| 564 | |
| 565 | |
| 566 | eTickResult cSimpleVisualiserGUI::myTick(long long t) |
| 567 | { |
| 568 | SMILE_IDBG(4,"tick # %i, reading value vector:",t); |
| 569 | cVector *vec = NULL; |
| 570 | if (!terminate) vec= reader->getNextFrame(); |
| 571 | if (vec == NULL) return TICK_SOURCE_NOT_AVAIL; |
| 572 | //else reader->nextFrame(); |
| 573 | |
| 574 | long vi = vec->tmeta->vIdx; |
| 575 | double tm = vec->tmeta->time; |
| 576 | |
| 577 | smileMutexLock(wxMtx); |
| 578 | if (pApp == NULL) { |
| 579 | smileMutexUnlock(wxMtx); |
| 580 | if (terminate) return TICK_INACTIVE; |
| 581 | else return TICK_SUCCESS; |
| 582 | } |
| 583 | smileMutexUnlock(wxMtx); |
| 584 | |
| 585 | // update VA status in GUI.... |
| 586 | // pApp->AddPendingEvent(); |
| 587 | // notify the main thread |
| 588 | |
| 589 | int nr = 0; |
| 590 | paintDataEvent *pe = new paintDataEvent(nInputs); |
| 591 | |
| 592 | for (nr = 0; nr<nInputs; nr++) { |
| 593 | |
| 594 | long idx = inputsIdx[nr]; |
| 595 | FLOAT_DMEM data = 0.0; |
| 596 | if (idx >= 0) data = vec->data[idx]; |
| 597 | pe->val[nr] = (int)((data+inputOffset[nr])*inputScale[nr]); |
| 598 | |
| 599 | } |
| 600 | pe->scale0 = 100.0 / inputScale[0]; |
| 601 | pe->offset0 = inputOffset[nr]*inputScale[0]; |
| 602 | pe->names = inputNames; |
| 603 | pe->colours = inputColours; |
| 604 | pe->action = action; |
| 605 | pe->matMultiplier = matMultiplier; |
| 606 | |
| 607 | //smileMutexLock(wxMtx); |
| 608 | wxCommandEvent myevent(wxEVT_COMMAND_TEXT_UPDATED, PLOT_UPDATE_ID); |
| 609 | // myevent.SetInt((int)((data+inputOffset[nr])*inputScale[nr])); // pass some data along the event, a number in this case |
| 610 | // myevent.SetString(vec->fmeta->getName(idx)); // TODO: this name is not present when using inputsIdx in the config... |
| 611 | myevent.SetClientData(pe); |
| 612 | pApp->vframe->GetEventHandler()->AddPendingEvent( myevent ); |
| 613 | //smileMutexUnlock(wxMtx); |
| 614 | |
| 615 | return TICK_SUCCESS; |
| 616 | } |
| 617 | |
| 618 | |
| 619 | cSimpleVisualiserGUI::~cSimpleVisualiserGUI() |
nothing calls this directly
no test coverage detected