本文整理汇总了C++中ITheFramework::Start方法的典型用法代码示例。如果您正苦于以下问题:C++ ITheFramework::Start方法的具体用法?C++ ITheFramework::Start怎么用?C++ ITheFramework::Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITheFramework
的用法示例。
在下文中一共展示了ITheFramework::Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ex_xml
bool ex_xml(void *arg) {
XMLPipeline *xmlpipe = ssi_create(XMLPipeline, 0, false);
xmlpipe->SetRegisterDllFptr(Factory::RegisterDLL);
xmlpipe->setLogLevel(SSI_LOG_LEVEL_DEBUG);
ssi_size_t n_confs = 3;
ssi_char_t *confs[] = { "global", "global2", "global3" };
xmlpipe->parse("my", 3, confs, true);
//IThePainter *painter = Factory::GetPainter();
ITheFramework *frame = Factory::GetFramework();
//ITheEventBoard *eboard = Factory::GetEventBoard();
frame->Start();
/*
if (xmlpipe->startEventBoard()) {
eboard->Start();
}
*/
ssi_print("\n\n\tpress enter to continue\n\n");
getchar();
/*
if (xmlpipe->startEventBoard()) {
eboard->Stop();
}*/
frame->Stop();
frame->Clear();
//painter->Clear();
//eboard->Clear();
delete xmlpipe;
return true;
}
示例2: ex_print
bool ex_print(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *button_t = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonConsumer *py_print = ssi_create(PythonConsumer, 0, true);
py_print->getOptions()->setScript("ssi_print");
ITransformable *input[] = { button_t, cursor_t };
//py_print->getOptions()->add("path", "result.txt");
frame->AddConsumer(2, input, py_print, "100ms");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例3: ex_diff
bool ex_diff(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonFilter *py_diff = ssi_create(PythonFilter, 0, true);
py_diff->getOptions()->setScript("ssi_diff");
ITransformable *py_diff_t = frame->AddTransformer(cursor_t, py_diff, "0.1s");
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("DIFF (PYTHON)");
plot->getOptions()->size = 10;
frame->AddConsumer(py_diff_t, plot, "1");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例4: ex_mfcc_chain
void ex_mfcc_chain () {
ITheFramework *frame = Factory::GetFramework ();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
// audio sensor
#ifndef SIMULATE
Audio *audio = ssi_create (Audio, "audio", true);
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_AUDIO_PROVIDER_NAME);
#else
WavReader *audio = ssi_create (WavReader, 0, true);
audio->getOptions()->setPath("audio.wav");
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_WAVREADER_PROVIDER_NAME);
#endif
frame->AddSensor(audio);
// preemph
OSPreemphasis *preemph = ssi_create (OSPreemphasis, "preemph", true);
ITransformable *preemph_t = frame->AddTransformer(audio_p, preemph, "0.02s");
// fft
OSMfccChain *mfcc = ssi_create (OSMfccChain, "mfcc", true);
mfcc->getOSTransformFFT()->getOptions()->nfft = 2048;
ITransformable *mfcc_t = frame->AddTransformer(preemph_t, mfcc, "0.01s", "0.01s");
// plot
SignalPainter *plot = 0;
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("audio");
plot->getOptions()->type = PaintSignalType::AUDIO;
plot->getOptions()->size = 10.0;
frame->AddConsumer(audio_p, plot, "0.1s");
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("mfcc");
plot->getOptions()->type = PaintSignalType::IMAGE;
plot->getOptions()->size = 10.0;
frame->AddConsumer(mfcc_t, plot, "0.1s");
FileWriter *writer = ssi_create (FileWriter, 0, true);
writer->getOptions()->setPath("mfcc_chain");
writer->getOptions()->type = File::ASCII;
frame->AddConsumer(mfcc_t, writer, "0.1s");
// run framework
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
}
示例5: ex_send_notifications
bool ex_send_notifications(void *arg)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
decorator->getOptions()->setOrigin(CONSOLE_WIDTH, 0);
frame->AddDecorator(decorator);
// start mouse
Mouse *mouse = ssi_create(Mouse, 0, true);
ITransformable *cursor_p = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
// sender + receiver
NotifySender *sender = ssi_create_id(NotifySender, 0, "sender");
sender->setLogLevel(SSI_LOG_LEVEL_DEBUG);
sender->getOptions()->setUrl("udp://localhost:1111");
frame->AddRunnable(sender);
NotifyReceiver *receiver = ssi_create_id(NotifyReceiver, 0, "receiver");
receiver->setLogLevel(SSI_LOG_LEVEL_DEBUG);
receiver->getOptions()->setUrl("udp://localhost:1111");
receiver->getOptions()->setId("plot");
frame->AddRunnable((SSI_IRunnableObject*)receiver);
// control (place after sender!)
ControlCheckBox *checkbox = 0;
checkbox = ssi_create_id(ControlCheckBox, 0, "checkbox");
checkbox->getOptions()->setId("sender");
checkbox->getOptions()->setTitle("VISUALIZATION");
checkbox->getOptions()->setLabel("SHOW");
checkbox->getOptions()->value = false;
frame->AddRunnable(checkbox);
// plot
SignalPainter *plot;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->size = 10;
plot->getOptions()->setTitle("cursor");
frame->AddConsumer(cursor_p, plot, "0.2s");
decorator->add("plot*", 0, 0, 400, CONSOLE_HEIGHT - 200);
decorator->add("checkbox*", 0, CONSOLE_HEIGHT - 200, 400, 200);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例6: ex_plp
bool ex_plp(void *args) {
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
// audio sensor
#ifndef SIMULATE
Audio *audio = ssi_create(Audio, "audio", true);
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_AUDIO_PROVIDER_NAME);
#else
WavReader *audio = ssi_create(WavReader, 0, true);
audio->getOptions()->setPath("audio.wav");
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_WAVREADER_PROVIDER_NAME);
#endif
frame->AddSensor(audio);
OSPlpChain *plp = ssi_create(OSPlpChain, "OSPlpChain", true);
ITransformable *plp_t = frame->AddTransformer(audio_p, plp, "0.06s", "0.01s");
SignalPainter *plot = 0;
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("audio");
plot->getOptions()->type = PaintSignalType::AUDIO;
plot->getOptions()->size = 10.0;
frame->AddConsumer(audio_p, plot, "0.1s");
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("lpc");
plot->getOptions()->size = 10.0;
frame->AddConsumer(plp_t, plot, "1");
FileWriter *writer = ssi_create(FileWriter, 0, true);
writer->getOptions()->setPath("plp_chain");
writer->getOptions()->type = File::ASCII;
frame->AddConsumer(plp_t, writer, "1");
#ifdef SIMULATE
AudioPlayer *player = ssi_create(AudioPlayer, "player", true);
frame->AddConsumer(audio_p, player, "0.01s");
#endif
// run framework
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例7: ex_pitch_chain
void ex_pitch_chain () {
ITheFramework *frame = Factory::GetFramework ();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
// audio sensor
#ifndef SIMULATE
Audio *audio = ssi_create (Audio, "audio", true);
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_AUDIO_PROVIDER_NAME);
#else
WavReader *audio = ssi_create (WavReader, 0, true);
audio->getOptions()->setPath("audio.wav");
audio->getOptions()->scale = true;
audio->getOptions()->block = 0.01;
ITransformable *audio_p = frame->AddProvider(audio, SSI_WAVREADER_PROVIDER_NAME);
#endif
frame->AddSensor(audio);
// pitch
OSPitchChain *pitch = ssi_create (OSPitchChain, "pitch", true);
pitch->getOSTransformFFT()->getOptions()->nfft = 1024;
pitch->getOSPitchShs()->getOptions()->baseSr = audio_p->getSampleRate();
ITransformable *pitch_t = frame->AddTransformer(audio_p, pitch, "0.01s", "0.01s");
// plot
SignalPainter *plot = 0;
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("audio");
plot->getOptions()->type = PaintSignalType::AUDIO;
plot->getOptions()->size = 10.0;
frame->AddConsumer(audio_p, plot, "0.01s");
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("pitch");
plot->getOptions()->size = 10.0;
frame->AddConsumer(pitch_t, plot, "0.01s");
FileWriter *writer = ssi_create (FileWriter, 0, true);
writer->getOptions()->setPath("pitch_chain");
writer->getOptions()->type = File::ASCII;
frame->AddConsumer(pitch_t, writer, "0.01s");
// run framework
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
}
示例8: ex_clone
bool ex_clone(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *button_t = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonTransformer *clone = 0;
clone = ssi_create(PythonTransformer, 0, true);
clone->getOptions()->setScript("ssi_clone");
ITransformable *button_clone_t = frame->AddTransformer(button_t, clone, "0.1s");
clone = ssi_create(PythonTransformer, 0, true);
clone->getOptions()->setScript("ssi_clone");
ITransformable *cursor_clone_t = frame->AddTransformer(cursor_t, clone, "0.1s");
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("BUTTON (RAW)");
plot->getOptions()->size = 5;
frame->AddConsumer(button_t, plot, "0.1s");
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("CURSOR (RAW)");
plot->getOptions()->size = 5;
frame->AddConsumer(cursor_t, plot, "0.1s");
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("BUTTON (CLONE)");
plot->getOptions()->size = 5;
frame->AddConsumer(button_clone_t, plot, "0.1s");
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("CURSOR (CLONE)");
plot->getOptions()->size = 5;
frame->AddConsumer(cursor_clone_t, plot, "0.1s");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例9: ex_gsr_arousal
bool ex_gsr_arousal(void *args) {
ITheEventBoard *board = Factory::GetEventBoard();
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
FileReader *reader = ssi_create(FileReader, 0, true);
reader->getOptions()->setPath("data\\gsr");
reader->getOptions()->block = 0.2;
ITransformable *gsr_p = frame->AddProvider(reader, SSI_FILEREADER_PROVIDER_NAME);
frame->AddSensor(reader);
GSRArousalEstimation *arousal = ssi_create(GSRArousalEstimation, 0, true);
ITransformable *arousal_p = frame->AddTransformer(gsr_p, arousal, "1");
ThresClassEventSender *classifier = ssi_create(ThresClassEventSender, 0, true);
classifier->getOptions()->setClasses("low,med,high");
classifier->getOptions()->setThresholds("0.01,0.3,0.7");
frame->AddConsumer(arousal_p, classifier, "1");
board->RegisterSender(*classifier);
EventMonitor *monitor = ssi_create_id(EventMonitor, 0, "monitor");
board->RegisterListener(*monitor, "@");
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("gsr");
plot->getOptions()->size = 150.0;
frame->AddConsumer(gsr_p, plot, "0.2s");
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("arousal");
plot->getOptions()->size = 150.0;
frame->AddConsumer(arousal_p, plot, "0.2s");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
board->Stop();
frame->Clear();
board->Clear();
return true;
}
示例10: ex_sender_video
bool ex_sender_video(void *arg) {
#if _WIN32|_WIN64
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
decorator->getOptions()->setOrigin(CONSOLE_WIDTH, 0);
frame->AddDecorator(decorator);
FakeSignal *camera = ssi_create(FakeSignal, 0, true);
camera->getOptions()->type = FakeSignal::SIGNAL::IMAGE_SSI;
camera->getOptions()->sr = 1;
ITransformable *camera_p = frame->AddProvider(camera, "fake");
camera->setLogLevel(SSI_LOG_LEVEL_DEBUG);
frame->AddSensor(camera);
SocketWriter *socket_writer_img = ssi_create (SocketWriter, 0, true);
socket_writer_img->getOptions()->port = 4444;
socket_writer_img->getOptions()->setHost("localhost");
socket_writer_img->getOptions()->type = Socket::TYPE::UDP;
socket_writer_img->getOptions()->format = SocketWriter::Options::FORMAT::IMAGE;
frame->AddConsumer(camera_p, socket_writer_img, "1");
SocketReader *socket_reader_img = ssi_create (SocketReader, 0, true);
socket_reader_img->getOptions()->port = 4444;
socket_reader_img->getOptions()->type = Socket::TYPE::UDP;
socket_reader_img->getOptions()->format = SocketReader::Options::FORMAT::IMAGE;
socket_reader_img->getOptions()->setSampleInfo(camera->getFormat());
ITransformable *socket_reader_img_p = frame->AddProvider(socket_reader_img, SSI_SOCKETREADER_PROVIDER_NAME);
frame->AddSensor(socket_reader_img);
VideoPainter *plot;
plot = ssi_create_id(VideoPainter, 0, "plot");
frame->AddConsumer(camera_p, plot, "1");
plot = ssi_create_id(VideoPainter, 0, "plot");
frame->AddConsumer(socket_reader_img_p, plot, "1");
decorator->add("plot*", 1, 2, 0, 0, 320, 480);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
#endif
return true;
}
示例11: ex_stream_info
bool ex_stream_info(void *arg) {
Factory::RegisterDLL("ssimouse");
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
ITheEventBoard *board = Factory::GetEventBoard();
//ClockEventSender *eclock = ssi_create(ClockEventSender, 0, true);
Mouse *mouse = ssi_create(Mouse, "mouse", true);
mouse->getOptions()->mask = Mouse::LEFT;
mouse->getOptions()->scale = true;
mouse->getOptions()->single = false;
mouse->getOptions()->sendEvent = true;
ITransformable *cursor_p = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
ITransformable *button_p = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
frame->AddSensor(mouse);
board->RegisterSender(*mouse);
Websocket *websocket = ssi_create(Websocket, 0, true);
websocket->getOptions()->setHttpRoot("stream_to_browser_info");
websocket->getOptions()->send_info = true;
//frame->AddConsumer(cursor_p, websocket, "0.25s");
ssi::ITransformable *src[2] = { cursor_p, button_p };
frame->AddConsumer(2, src, websocket, "1");
board->RegisterSender(*websocket);
board->RegisterListener(*websocket);
EventMonitor *monitor = ssi_create_id (EventMonitor, 0, "monitor");
board->RegisterListener(*monitor);
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例12: ex_imgplot
bool ex_imgplot(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
FakeSignal *video = 0;
video = ssi_create(FakeSignal, 0, true);
video->getOptions()->type = FakeSignal::SIGNAL::IMAGE_RANDOM_RGB;
ITransformable *rgb_t = frame->AddProvider(video, "video");
frame->AddSensor(video);
video = ssi_create(FakeSignal, 0, true);
video->getOptions()->type = FakeSignal::SIGNAL::IMAGE_RANDOM_GRAY;
ITransformable *gray_t = frame->AddProvider(video, "video");
frame->AddSensor(video);
PythonImageConsumer *imgplot = 0;
imgplot = ssi_create(PythonImageConsumer, 0, true);
imgplot->getOptions()->setScript("ssi_imgplot");
imgplot->getOptions()->add("name", "RGB");
imgplot->getOptions()->add("x", 650);
imgplot->getOptions()->add("y", 0);
imgplot->getOptions()->add("width", 200);
imgplot->getOptions()->add("height", 200);
frame->AddConsumer(rgb_t, imgplot, "1");
imgplot = ssi_create(PythonImageConsumer, 0, true);
imgplot->getOptions()->setScript("ssi_imgplot");
imgplot->getOptions()->add("name", "GRAY");
imgplot->getOptions()->add("x", 650);
imgplot->getOptions()->add("y", 220);
imgplot->getOptions()->add("width", 200);
imgplot->getOptions()->add("height", 200);
frame->AddConsumer(gray_t, imgplot, "1");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例13: ex_async
bool ex_async (void *arg) {
ITheFramework *frame = Factory::GetFramework ();
ssi_pcast(TheFramework, frame)->getOptions()->setConsolePos(800, 200, 400, 200);
//IThePainter *painter = Factory::GetPainter ();
Mouse *mouse = ssi_create (Mouse, 0, false);
ITransformable *cursor_p = frame->AddProvider (mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor (mouse);
// trans
Delay delay;
ITransformable *filter_t = frame->AddTransformer (cursor_p, &delay, "0.2s");
Asynchronous *delay_async = ssi_create (Asynchronous, 0, true);
//Asynchronous *delay_async = ssi_pcast (Asynchronous, Asynchronous::Create (0));
delay_async->setTransformer (&delay);
ITransformable *filter_async_t = frame->AddTransformer (cursor_p, delay_async, "0.2s");
// output
/*
SignalPainter *signal_painter = 0;
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("cursor");
frame->AddConsumer (cursor_p, signal_painter, "0.2s");
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("delay");
frame->AddConsumer (filter_t, signal_painter, "0.2s");
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("delay async");
frame->AddConsumer (filter_async_t, signal_painter, "0.2s");
*/
// run
frame->Start ();
//painter->Arrange (1,3,0,0,800,400);
frame->Wait ();
frame->Stop ();
frame->Clear ();
//painter->Clear ();
return true;
}
示例14: ex_event
bool ex_event(void *args)
{
ITheFramework *frame = Factory::GetFramework();
ITheEventBoard *board = Factory::GetEventBoard();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *button_t = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonConsumer *py_send = ssi_create_id(PythonConsumer, 0, "pysend");
py_send->getOptions()->setScript("ssi_send");
ITransformable *input[] = { button_t, cursor_t };
frame->AddConsumer(2, input, py_send, "100ms");
board->RegisterSender(*py_send);
PythonObject *py_listen = ssi_create_id(PythonObject, 0, "pylisten");
py_listen->getOptions()->setScript("ssi_listen");
board->RegisterListener(*py_listen, py_send->getEventAddress());
EventMonitor *monitor = ssi_create_id(EventMonitor, 0, "monitor");
board->RegisterListener(*monitor, 0, 10000u);
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("CURSOR");
frame->AddEventConsumer(cursor_t, plot, board, py_send->getEventAddress());
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
board->Stop();
frame->Clear();
board->Clear();
return true;
}
示例15: ex_xml
void ex_xml () {
ITheFramework *frame = Factory::GetFramework ();
IThePainter *painter = Factory::GetPainter ();
ITheEventBoard *board = Factory::GetEventBoard ();
XMLPipeline *xmlpipe = ssi_factory_create (XMLPipeline, 0, true);
xmlpipe->parse ("my.pipeline");
frame->Start ();
board->Start ();
frame->Wait ();
board->Stop ();
frame->Stop ();
board->Clear ();
frame->Clear ();
painter->Clear ();
}