mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
ensuring acquire, p receiver start and the gui enables and disables data streaming accordingly. those with api will have to know what they want before acquiring
This commit is contained in:
parent
931e750d65
commit
df01ca7e4b
@ -571,6 +571,8 @@ QVector<QwtIntervalSample> histogramSamples;
|
|||||||
bool plotRequired;
|
bool plotRequired;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void UpdatingPlotFinished();
|
void UpdatingPlotFinished();
|
||||||
void InterpolateSignal(bool);
|
void InterpolateSignal(bool);
|
||||||
|
@ -296,7 +296,7 @@ void qDetectorMain::SetUpDetector(const string fName){
|
|||||||
//#endif
|
//#endif
|
||||||
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||||
if(detType != slsDetectorDefs::MYTHEN) {
|
if(detType != slsDetectorDefs::MYTHEN) {
|
||||||
if(myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {cprintf(GREEN,"is online!\n");
|
if(myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {
|
||||||
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
|
myDet->setReceiverOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||||
}else cprintf(RED,"is not online!\n");
|
}else cprintf(RED,"is not online!\n");
|
||||||
}
|
}
|
||||||
|
@ -332,11 +332,6 @@ void qDrawPlot::SetupWidgetWindow(){
|
|||||||
myDet->registerMeasurementFinishedCallback(&(GetMeasurementFinishedCallBack),this);
|
myDet->registerMeasurementFinishedCallback(&(GetMeasurementFinishedCallBack),this);
|
||||||
//Setting the callback function to get progress from detector class(using receivers)
|
//Setting the callback function to get progress from detector class(using receivers)
|
||||||
myDet->registerProgressCallback(&(GetProgressCallBack),this);
|
myDet->registerProgressCallback(&(GetProgressCallBack),this);
|
||||||
//stream data from receiver to the gui
|
|
||||||
if(detType != slsDetectorDefs::MYTHEN && myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {
|
|
||||||
myDet->enableDataStreamingFromReceiver(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
qDefs::checkErrorMessage(myDet,"qDrawPlot::SetupWidgetWindow");
|
qDefs::checkErrorMessage(myDet,"qDrawPlot::SetupWidgetWindow");
|
||||||
}
|
}
|
||||||
@ -496,7 +491,7 @@ bool qDrawPlot::StartOrStopThread(bool start){
|
|||||||
/*XYRangeChanged = true;*/
|
/*XYRangeChanged = true;*/
|
||||||
boxPlot->setTitle("Old_Plot.raw");
|
boxPlot->setTitle("Old_Plot.raw");
|
||||||
|
|
||||||
cout << "Starting new acquisition thread ...." << endl;
|
cprintf(BLUE, "Starting new acquisition thread ....\n");
|
||||||
// Start acquiring data from server
|
// Start acquiring data from server
|
||||||
if(!firstTime) pthread_join(gui_acquisition_thread,NULL);//wait until he's finished, ie. exits
|
if(!firstTime) pthread_join(gui_acquisition_thread,NULL);//wait until he's finished, ie. exits
|
||||||
pthread_create(&gui_acquisition_thread, NULL,DataStartAcquireThread, (void*) this);
|
pthread_create(&gui_acquisition_thread, NULL,DataStartAcquireThread, (void*) this);
|
||||||
@ -731,6 +726,18 @@ void qDrawPlot::SetupMeasurement(){
|
|||||||
|
|
||||||
|
|
||||||
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
|
void* qDrawPlot::DataStartAcquireThread(void *this_pointer){
|
||||||
|
//stream data from receiver to the gui
|
||||||
|
if(((qDrawPlot*)this_pointer)->myDet->setReceiverOnline(slsDetectorDefs::GET_ONLINE_FLAG) == slsDetectorDefs::ONLINE_FLAG) {
|
||||||
|
//if it was not on
|
||||||
|
if (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver(-1)!= 1){
|
||||||
|
//switch it on, if error
|
||||||
|
if (((qDrawPlot*)this_pointer)->myDet->enableDataStreamingFromReceiver(1) != 1) {
|
||||||
|
qDefs::checkErrorMessage(((qDrawPlot*)this_pointer)->myDet,"qDrawPlot::DataStartAcquireThread");
|
||||||
|
return this_pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
((qDrawPlot*)this_pointer)->myDet->acquire(1);
|
((qDrawPlot*)this_pointer)->myDet->acquire(1);
|
||||||
return this_pointer;
|
return this_pointer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user