Skip to content
Snippets Groups Projects
Commit 34245470 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Cherry-picked SVN branch multideploy.

parent d7ce4c4f
No related branches found
No related tags found
No related merge requests found
Showing with 1305 additions and 0 deletions
build/
target/
org.fortiss.af3.platform.raspberry.ui/icons/console.png

469 B

/*--------------------------------------------------------------------------+
$Id: CameraInputHandler.java 23956 2018-04-11 14:15:25Z barner $
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.RaspberryPiReceiverBase;
import org.fortiss.af3.platform.raspberry.model.camera.CameraDistanceLeft;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link CameraDistanceLeft}s and other camera model elements.
*
* @author hoelzl
* @author $Author: barner $
* @version $Rev: 23956 $
* @ConQAT.Rating GREEN Hash: D80CF94CBBADB4627AAEDA1F34ABF0A5
*/
public class CameraInputHandler extends
NamedCommentedModelElementHandlerBase<RaspberryPiReceiverBase> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*--------------------------------------------------------------------------+
$Id: MotorControlInputHandler.java 23956 2018-04-11 14:15:25Z barner $
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlInput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link MotorControlInput}s.
*
* @author hoelzl
* @author $Author: barner $
* @version $Rev: 23956 $
* @ConQAT.Rating GREEN Hash: D80CF94CBBADB4627AAEDA1F34ABF0A5
*/
public class MotorControlInputHandler extends
NamedCommentedModelElementHandlerBase<MotorControlInput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
/*--------------------------------------------------------------------------+
$Id: MotorControlOutputHandler.java 23956 2018-04-11 14:15:25Z barner $
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.ui.handler;
import static org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.platform.raspberry.model.motorcontrol.MotorControlOutput;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Handler for {@link MotorControlOutput}s.
*
* @author hoelzl
* @author $Author: barner $
* @version $Rev: 23956 $
* @ConQAT.Rating GREEN Hash: D80CF94CBBADB4627AAEDA1F34ABF0A5
*/
public class MotorControlOutputHandler extends
NamedCommentedModelElementHandlerBase<MotorControlOutput> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return getImageDescriptor("icons/unknown.png");
}
}
build/
target/
group MainFile;
MainFile(UNIT_NAME,
COORDINATOR_OR_WORKER,
CAN_ID_LOCAL_UNIT,
SYSTEM_INIT_CODE,
SENSOR_VARIABLES,
REMOTE_UNIT_SETUP_CODE,
SYSTEM_INCLUDES,
COMPONENT_PORTS,
COMPONENT_SETUP,
COMPONENT_IMPL,
CYCLE_TIME_IN_MILLIS,
THREAD_SLEEPTIME_IN_MICROS) ::= <<
// due to current data dictionary declaration of GENTYPE_boolean
// system include must be first
/******************** BEGIN_@GENERATED ***********************/
$SYSTEM_INCLUDES$
/********************* END_@GENERATED ************************/
#include <stdbool.h>
#include <stddef.h>
#include <unistd.h>
#include <af3.h>
#include <af3_component.h>
#include <af3_component_remote_proxy.h>
#include <debugprint.h>
#include <listutil.h>
#include <protocol_control_center.h>
#include <protocol_coordinator.h>
#include <protocol_factory.h>
#include <timeutil.h>
#include "data.h"
int global_debug_print_level = DEBUG_PRINT_LEVEL_NONE;
const int cycle_time = $CYCLE_TIME_IN_MILLIS$;
#define BRICK_HOST "localhost"
#define BRICK_PORT 4223
/******************** BEGIN_@GENERATED ***********************/
$COMPONENT_PORTS$
$SENSOR_VARIABLES$
/********************* END_@GENERATED ************************/
/******************** BEGIN_@GENERATED ***********************/
$COMPONENT_IMPL$
/********************* END_@GENERATED ************************/
static void initialize_af3_subsystem() {
af3_module_initialize("$UNIT_NAME$", 0, NULL, NULL);
af3_component_module_initialize($THREAD_SLEEPTIME_IN_MICROS$, default_send_remote_impl);
af3_component_remote_proxy_module_initialize();
can_thread_add_reception_listener(default_recv_remote_impl);
/******************** BEGIN_@GENERATED ***********************/
$COMPONENT_SETUP$
/********************* END_@GENERATED ************************/
}
static void worker() {
af3_component_run_system();
af3_component_remote_proxy_clear_inputs();
}
int main(int argc, char** argv) {
if(argc >= 2) {
int dbg = atoi(argv[1]);
if(dbg < 0) {
dbg = 0;
} else if (dbg > 3) {
dbg = 3;
}
global_debug_print_level = dbg;
}
if (!can_thread_create("can0")) {
return -1;
}
can_thread_set_thread_sleep_in_micros($THREAD_SLEEPTIME_IN_MICROS$);
/******************** BEGIN_@GENERATED ***********************/
$SYSTEM_INIT_CODE$
/********************* END_@GENERATED ************************/
initialize_af3_subsystem();
protocol_can_config_t* can_config = protocol_can_config_create(0x01, 0x00, $CAN_ID_LOCAL_UNIT$);
protocol_worker_clock_config_t* clock_config =
protocol_worker_clock_config_create(cycle_time, 0, $THREAD_SLEEPTIME_IN_MICROS$);
protocol_worker_computation_config_t* computation_config =
protocol_worker_computation_config_create("$UNIT_NAME$", worker, 0);
#if $COORDINATOR_OR_WORKER$ == 1
// create list of remote units
list_t* remote_units = list_util_create_list();
/******************** BEGIN_@GENERATED ***********************/
$REMOTE_UNIT_SETUP_CODE$
/********************* END_@GENERATED ************************/
// run the unit coordinator protocol mode
int result = protocol_coordinator_main(can_config, clock_config, computation_config, remote_units);
#else
// run the unit in worker protocol mode
int result = protocol_worker_main(can_config, clock_config, computation_config);
#endif
can_thread_terminate();
free(can_config);
free(clock_config);
free(computation_config);
return result;
}
>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment