Esempio n. 1
0
PARTICLES::PARTICLES()
{
	on_reset();
	render_trail.parts = this;
	render_explosions.parts = this;
	render_general.parts = this;
}
Esempio n. 2
0
int main(void)
{

    /* On reset */
    on_reset();

    /* Init software subsystems */
    log_init();      // Logging system
    cmd_repo_init(); // Command repository initialization
    dat_repo_init(); // Update status repository

    LOGI(tag, "Creating tasks...");

    /* Initializing shared Queues */
    dispatcher_queue = osQueueCreate(25,sizeof(cmd_t *));
    executer_cmd_queue = osQueueCreate(1,sizeof(cmd_t *));
    executer_stat_queue = osQueueCreate(1,sizeof(int));

    int n_threads = 3;
    os_thread threads_id[n_threads];

    /* Crating system task (the others are created inside taskDeployment) */
    osCreateTask(taskDispatcher,"dispatcher", 2*configMINIMAL_STACK_SIZE,NULL,3, &threads_id[0]);
    osCreateTask(taskExecuter, "executer", 5*configMINIMAL_STACK_SIZE, NULL, 4, &threads_id[1]);

    osCreateTask(taskTest, "test", 2*configMINIMAL_STACK_SIZE, "TEST1", 2, &threads_id[2]);


#ifndef ESP32
    /* Start the scheduler. Should never return */
    osScheduler(threads_id, n_threads);
    return 0;
#endif

}
Esempio n. 3
0
int main(void)
{
    //lenguaje C orientado a microcontroladores rev 1
    //quidel.inele.ufro.cl
    //cc5x
    //printf("%i\n",0xFFFFFFFF);
    /* Initializing shared Queues */
    dispatcherQueue = osQueueCreate(25,sizeof(DispCmd));
    executerCmdQueue = osQueueCreate(1,sizeof(ExeCmd));
    executerStatQueue = osQueueCreate(1,sizeof(int));

    /* Initializing shared Semaphore */
    osSemaphoreCreate(&repoDataSem);

    /* Crating all task (the others are created inside taskDeployment) */
    osCreateTask(taskDispatcher,"dispatcher",2*configMINIMAL_STACK_SIZE,NULL,3);
    osCreateTask(taskExecuter, "executer", 5*configMINIMAL_STACK_SIZE, NULL, 4);

    osCreateTask(taskHousekeeping, "housekeeping", 2*configMINIMAL_STACK_SIZE, NULL, 2);
    osCreateTask(taskConsole, "console", 2*configMINIMAL_STACK_SIZE, NULL, 2);

    /* Configure Peripherals */

    /* On reset */
    on_reset();

    /* Start the scheduler. Should never return */
    osScheduler();

    return 0;
}
void MainWindow::create_actions()
{
    connect(view, SIGNAL(clicked(const QModelIndex &)), this, SLOT(on_recevied_index(const QModelIndex &)));
    connect(buttonOK, SIGNAL(clicked()), this, SLOT(on_ok_clicked()));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
    connect(button_reset, SIGNAL(clicked()), this, SLOT(on_reset()));
    connect(video_tab, SIGNAL(comboChange(QString, QString, QString)), this, SLOT(on_combo_update(QString, QString, QString)));
    connect(audio_tab, SIGNAL(comboChange(QString, QString, QString)), this, SLOT(on_combo_update(QString, QString, QString)));
}
VideoTab::VideoTab(QWidget *parent, CodeInterface &codeInt) : QWidget(parent)
{
    code_int = &codeInt;
    createDisplay();
    populateBoxes();
    createActions();
    connect(parent, SIGNAL(repopulate_combos()), this , SLOT(on_repopulate()));
    connect(parent, SIGNAL(reset_fields()), this, SLOT(on_reset()));
}
Esempio n. 6
0
void GAMECLIENT::on_statechange(int new_state, int old_state)
{
	if(demorec_isrecording())
		demorec_record_stop();

	// reset everything
	on_reset();
	
	// then change the state
	for(int i = 0; i < all.num; i++)
		all.components[i]->on_statechange(new_state, old_state);
}
Esempio n. 7
0
void Snake::reset(const Vector& startingPoint,
		const Vector& lookingAt,const int initialGrowth) {
	_tail.assign(1);
	_head.assign(0);
	_previous_head = 1;
	_is_alive = true;
	_rotation_angle = 0;
	_move_vector = _translation_vector;
	_remaining_growth = initialGrowth;
	_points[_tail].assign(startingPoint);
	_points[_head].assign(startingPoint + _move_vector, &_points[_tail]);
	on_reset();
}
Esempio n. 8
0
int main(void)
#endif
{
    /* On reset */
    on_reset();
    printf("\n\n--------- FLIGHT SOFTWARE START ---------\n");
    printf("\t Version: %s\n", SCH_SW_VERSION);
    printf("\t Device : %d (%s)\n", SCH_DEVICE_ID, SCH_NAME);
    printf("-----------------------------------------\n\n");

    /* Init software subsystems */
    log_init();      // Logging system
    cmd_repo_init(); // Command repository initialization
    dat_repo_init(); // Update status repository

    /* Initializing shared Queues */
    dispatcher_queue = osQueueCreate(25,sizeof(cmd_t *));
    if(dispatcher_queue == 0)
        LOGE(tag, "Error creating dispatcher queue");
    executer_stat_queue = osQueueCreate(1,sizeof(int));
    if(executer_stat_queue == 0)
        LOGE(tag, "Error creating executer stat queue");
    executer_cmd_queue = osQueueCreate(1,sizeof(cmd_t *));
    if(executer_cmd_queue == 0)
        LOGE(tag, "Error creating executer cmd queue");

    int n_threads = 4;
    os_thread threads_id[n_threads];

    LOGI(tag, "Creating basic tasks...");
    /* Crating system task (the others are created inside taskInit) */
    int t_inv_ok = osCreateTask(taskDispatcher,"invoker", SCH_TASK_DIS_STACK, NULL, 3, &threads_id[1]);
    int t_exe_ok = osCreateTask(taskExecuter, "receiver", SCH_TASK_EXE_STACK, NULL, 4, &threads_id[2]);
    int t_wdt_ok = osCreateTask(taskWatchdog, "watchdog", SCH_TASK_WDT_STACK, NULL, 2, &threads_id[0]);
    int t_ini_ok = osCreateTask(taskInit, "init", SCH_TASK_INI_STACK, NULL, 3, &threads_id[3]);

    /* Check if the task were created */
    if(t_inv_ok != 0) LOGE(tag, "Task invoker not created!");
    if(t_exe_ok != 0) LOGE(tag, "Task receiver not created!");
    if(t_wdt_ok != 0) LOGE(tag, "Task watchdog not created!");
    if(t_ini_ok != 0) LOGE(tag, "Task init not created!");

#ifndef ESP32
    /* Start the scheduler. Should never return */
    osScheduler(threads_id, n_threads);
    return 0;
#endif

}
Esempio n. 9
0
void GAMECLIENT::on_statechange(int new_state, int old_state)
{
	if(demorec_isrecording())
		demorec_record_stop();

	// reset everything
	on_reset();
	
	// then change the state
	for(int i = 0; i < all.num; i++)
		all.components[i]->on_statechange(new_state, old_state);

	if(new_state == CLIENTSTATE_ONLINE && config.tc_autodemo)
		teecomp_demo_start();
}
Esempio n. 10
0
void
IgcReplay::Start()
{
  if (Enabled)
    Stop();

  if (!OpenFile()) {
    on_bad_file();
    return;
  }

  cli.Reset();
  reset_time();
  on_reset();

  Enabled = true;
}
Esempio n. 11
0
GMTools::GMTools(QWidget *parent)
	: QDialog(parent)
{
	state_ = 0;
	auto_set_times_ = 1;
	maxset_ = 1;

	ui = new Ui::GMToolsClass();
	ui->setupUi(this);
	QTimer::singleShot(20, this, SLOT(step()));

	connect(ui->btn_logingame, SIGNAL(clicked()), this, SLOT(on_logingame()));
	connect(ui->btn_sendcmd, SIGNAL(clicked()), this, SLOT(on_sendcmd()));
	connect(ui->btn_reset, SIGNAL(clicked()), this, SLOT(on_reset()));
	ui->cmb_functions->clear();

	ui->cmb_functions->addItem("Dynamic Set User Stock", 1);
	ui->cmb_functions->addItem("Disable User Stock", 2);
	ui->cmb_functions->addItem("Query System Balance", 3);
}
Esempio n. 12
0
static
int on_request(struct mg_connection* conn) {
	int ret = MG_FALSE;

	// LOG(("MG_REQUEST:      %p %d %d\n", conn, conn->is_websocket, conn->wsbits));

	engine_lock();

	if (!strncmp(conn->uri, API_SETTINGS, strlen(API_SETTINGS))) {
		on_settings(conn);
		ret = MG_TRUE;
	} else if (!strncmp(conn->uri, API_EFFECTS, strlen(API_EFFECTS))) {
		on_effects(conn);
		ret = MG_TRUE;
	} else if (!strncmp(conn->uri, API_RESET, strlen(API_RESET))) {
		on_reset(conn);
		ret = MG_TRUE;
	}

	engine_unlock();

	return ret;
}
Esempio n. 13
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->starttime->setText("0");
    ui->simurate->setText("1");

    ///create node
    //STM32 MCU
    Simulator* stm32comm = new Simulator(library, "Sensor_stm32comm", "stm32comm", config, QTime(),1);
    stm32comm->setOutputNodesName(QList<QString>()<<"stm32comm_viewer;stm32comm_storage;doordetection;simplecollect;planner");


    VisualizationMono* stm32comm_viewer = new VisualizationMono(library, "Sensor_stm32comm", "stm32comm_viewer", config);
    stm32comm_viewer->setInputNodesName(QList<QString>()<<"stm32comm");
    stm32comm_viewer->connectExternalTrigger(0, DRAINSLOT);

    //LCamera
    Simulator* l_camera = new Simulator(library, "Sensor_Camera", "l_camera", config, QTime(),1);
    l_camera->setOutputNodesName(QList<QString>()<<"l_camera_viewer;l_camera_storage;cameralasercalib");

    VisualizationMono* l_camera_viewer = new VisualizationMono(library, "Sensor_Camera", "l_camera_viewer", config);
    l_camera_viewer->setInputNodesName(QList<QString>()<<"l_camera");
    l_camera_viewer->connectExternalTrigger(0, DRAINSLOT);


    //RCamera
    Simulator* r_camera = new Simulator(library, "Sensor_Camera", "r_camera",config, QTime(),1);
    r_camera->setOutputNodesName(QList<QString>()<<"r_camera_viewer");

    VisualizationMono*r_camera_viewer = new VisualizationMono(library, "Sensor_Camera", "r_camera_viewer", config);
    r_camera_viewer->setInputNodesName(QList<QString>()<<"r_camera");
    r_camera_viewer->connectExternalTrigger(0, DRAINSLOT);


    //Laser
    Simulator* laser = new Simulator(library, "Sensor_Laser", "laser", config, QTime(),1);
    laser->setOutputNodesName(QList<QString>()<<"laser_viewer;doordetection;simplecollect;calib;cameralasercalib");

    VisualizationMono* laser_viewer = new VisualizationMono(library, "Sensor_Laser", "laser_viewer", config);
    laser_viewer->setInputNodesName(QList<QString>()<<"laser");
    laser_viewer->connectExternalTrigger(0, DRAINSLOT);

    //camera laser calib
    ProcessorMulti* cameralasercalib = new ProcessorMulti(library, "Processor_CameraLaser", "cameralasercalib", config);
    cameralasercalib->setInputNodesName(QList<QString>()<<"l_camera"<<"laser");
    cameralasercalib->setOutputNodesName(QList<QString>()<<"cameralasercalib_viewer");
    cameralasercalib->connectExternalTrigger(1,PROCESSORSLOT);

    VisualizationMono *cameralasercalib_viewer = new VisualizationMono(library, "Processor_CameraLaser", "cameralasercalib_viewer", config);
    cameralasercalib_viewer->setInputNodesName(QList<QString>()<<"cameralasercalib");
    cameralasercalib_viewer->connectExternalTrigger(0, DRAINSLOT);

    //calibration
    VisualizationMono *laserCalib = new VisualizationMono(library, "Calibration_Laser", "calib", config);
    laserCalib->setInputNodesName(QList<QString>()<<"laser");
    laserCalib->connectExternalTrigger(0, DRAINSLOT);

    //Path
    ProcessorMono* pathPlanner = new ProcessorMono(library, "Processor_PathGenerator", "planner", config);
    pathPlanner->setInputNodesName(QList<QString>() << "stm32comm");
    pathPlanner->setOutputNodesName(QList<QString>() << "plannerViewer");
    pathPlanner->connectExternalTrigger(0, PROCESSORSLOT);

    VisualizationMono* pathPlannerViewer = new VisualizationMono(library, "Processor_PathGenerator", "plannerViewer", config);
    pathPlannerViewer->setInputNodesName(QList<QString>() << "planner");
    pathPlannerViewer->connectExternalTrigger(0, DRAINSLOT);


    //doordetection
    ProcessorMulti* doordetection = new ProcessorMulti(library,"Processor_doordetection", "doordetection",config);
    doordetection->setInputNodesName(QList<QString>()<<"laser"<<"stm32comm");
    doordetection->setOutputNodesName(QList<QString>()<<"doordetection_viewer;simplecollect");
    doordetection->connectExternalTrigger(1, PROCESSORSLOT);

    VisualizationMono* doordetection_viewer = new VisualizationMono(library,"Processor_doordetection", "doordetection_viewer", config);
    doordetection_viewer->setInputNodesName(QList<QString>()<<"doordetection");
    doordetection_viewer->connectExternalTrigger(0,DRAINSLOT);

    //simple collect
    ProcessorMulti* simplecollect = new ProcessorMulti(library,"Processor_SimpleCollect", "simplecollect", config);
    simplecollect->setInputNodesName(QList<QString>()<<"joystick"<<"laser"<<"stm32comm"<<"doordetection");
    simplecollect->setOutputNodesName(QList<QString>()<<"simplecollect_viewer");
    simplecollect->connectExternalTrigger(2, PROCESSORSLOT);

    VisualizationMono* simplecollect_viewer = new VisualizationMono(library,"Processor_SimpleCollect", "simplecollect_viewer",config);
    simplecollect_viewer->setInputNodesName(QList<QString>()<<"simplecollect");
    simplecollect_viewer->connectExternalTrigger(0,DRAINSLOT);

    ///add node
    edge.addNode(stm32comm, 1, MONITOR);
    edge.addNode(stm32comm_viewer, 0, 0);


    edge.addNode(l_camera, 1, MONITOR);
    edge.addNode(l_camera_viewer, 0, 0);

    edge.addNode(r_camera, 1, MONITOR);
    edge.addNode(r_camera_viewer, 0, 0);


    edge.addNode(laser, 1, MONITOR);
    edge.addNode(laser_viewer, 0, 0);

    edge.addNode(pathPlanner, 1, MONITOR);
    edge.addNode(pathPlannerViewer, 0, 0);


    edge.addNode(doordetection, 1, MONITOR);
    edge.addNode(doordetection_viewer, 0, 0);

    edge.addNode(cameralasercalib, 1, MONITOR);
    edge.addNode(cameralasercalib_viewer, 0, 0);

//    edge.addNode(simplecollect, 1, MONITOR);
//    edge.addNode(simplecollect_viewer, 0, 0);

    edge.addNode(laserCalib, 0, 0);

    edge.connectAll();

    connect(ui->open, SIGNAL(clicked()), &edge, SLOT(openAllNodesSlot()));
    connect(ui->close, SIGNAL(clicked()), &edge, SLOT(closeAllNodesSlot()));

    connect(ui->setvale, SIGNAL(clicked()), this, SLOT(on_setvalue()));
    connect(this, SIGNAL(sig_setstarttime(QTime)), stm32comm, SLOT(setStartTimeSlot(QTime)));
    connect(this,SIGNAL(sig_setsimurate(double)), stm32comm, SLOT(setSimulateRateSlot(double)));
    connect(this, SIGNAL(sig_setstarttime(QTime)), l_camera, SLOT(setStartTimeSlot(QTime)));
    connect(this,SIGNAL(sig_setsimurate(double)), l_camera, SLOT(setSimulateRateSlot(double)));
    connect(this, SIGNAL(sig_setstarttime(QTime)), r_camera, SLOT(setStartTimeSlot(QTime)));
    connect(this,SIGNAL(sig_setsimurate(double)), r_camera, SLOT(setSimulateRateSlot(double)));
    connect(this, SIGNAL(sig_setstarttime(QTime)), laser, SLOT(setStartTimeSlot(QTime)));
    connect(this,SIGNAL(sig_setsimurate(double)), laser, SLOT(setSimulateRateSlot(double)));

    connect(ui->sync, SIGNAL(clicked()), this, SLOT(on_sync()));
    connect(this, SIGNAL(sig_sync()), stm32comm, SLOT(syncTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), l_camera, SLOT(syncTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), r_camera, SLOT(syncTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), laser, SLOT(syncTimeTrackSlot()));

    connect(ui->start, SIGNAL(clicked()), this, SLOT(on_start()));
    connect(this, SIGNAL(sig_start()), stm32comm, SLOT(startSimulatorSlot()));
    connect(this, SIGNAL(sig_start()), l_camera, SLOT(startSimulatorSlot()));
    connect(this, SIGNAL(sig_start()), r_camera, SLOT(startSimulatorSlot()));
    connect(this, SIGNAL(sig_start()), laser, SLOT(startSimulatorSlot()));

    connect(ui->stop, SIGNAL(clicked()), this, SLOT(on_stop()));
    connect(this, SIGNAL(sig_stop()), stm32comm, SLOT(stopSimulatorSlot()));
    connect(this, SIGNAL(sig_stop()), l_camera, SLOT(stopSimulatorSlot()));
    connect(this, SIGNAL(sig_stop()), r_camera, SLOT(stopSimulatorSlot()));
    connect(this, SIGNAL(sig_stop()), laser, SLOT(stopSimulatorSlot()));

    connect(ui->reset, SIGNAL(clicked()), this, SLOT(on_reset()));
    connect(this, SIGNAL(sig_sync()), stm32comm, SLOT(resetTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), l_camera, SLOT(resetTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), r_camera, SLOT(resetTimeTrackSlot()));
    connect(this, SIGNAL(sig_sync()), laser, SLOT(resetTimeTrackSlot()));

    ///visualazition
    QList<QWidget *> widgets;

    widgets = stm32comm_viewer->getVisualizationWidgets();
    ui->scrollArea->setWidget(widgets.front());

    widgets = laser_viewer->getVisualizationWidgets();
    ui->scrollArea_2->setWidget(widgets.front());

 //   widgets = laserCalib->getVisualizationWidgets();
 //   ui->scrollArea_3->setWidget(widgets.front());
    widgets =cameralasercalib_viewer->getVisualizationWidgets();
    ui->scrollArea_3->setWidget(widgets.front());

    widgets = l_camera_viewer->getVisualizationWidgets();
    ui->scrollArea_4->setWidget(widgets.front());

    widgets = r_camera_viewer->getVisualizationWidgets();
    ui->scrollArea_5->setWidget(widgets.front());

    widgets = doordetection_viewer->getVisualizationWidgets();
    ui->scrollArea_6->setWidget(widgets.front());

    widgets = pathPlannerViewer->getVisualizationWidgets();
    ui->scrollArea_7->setWidget(widgets.front());

//    widgets = simplecollect_viewer->getVisualizationWidgets();
//    ui->scrollArea_8->setWidget(widgets.front());

    if(MONITOR)
        ui->tabWidget->addTab(&edge, "Monitor");

}
Esempio n. 14
0
SCOREBOARD::SCOREBOARD()
{
	on_reset();
}