Subversion Repositories f9daq

Compare Revisions

Regard whitespace Rev 171 → Rev 172

/lab/sipmscan/trunk/doc/README
529,7 → 529,16
= 8. Change log ===
===================
 
11.8.2016 (Current Rev):
??.8.2016 (Current Rev)
a) Fixed the time estimation for surface and Z-axis scans (TimeEstimateNew).
b) Did the same as c) in the previous revision, but separately for opening histogram files and for selecting the measurement
output file.
c) Added an Emergency stop button to the movement of the table - just in case a wrong value is inserted and there is something
in the way.
d) Added a way to integrate the surface scan, when using the "Start and Edit" option. This can be useful for determining the
angular dependence of the light passing onto a complete camera pixel.
 
11.8.2016 (Rev 167):
a) When using breakdown voltage or relative PDE analysis and with only one file selected, the analysis is stopped and the fit
is displayed on the graph. This makes it easier to setup fitting settings.
b) Added the possibility to export plots created through analysis ("Start and edit" option).
/lab/sipmscan/trunk/include/sipmscan.h
48,6 → 48,7
void layoutMainWindow(int *w, int *h);
void SeqNumber(int innum, int maxnum, char *outstr);
void TimeEstimate(clock_t stopw0, time_t time0, float progress, char *retEstim, int offset);
void TimeEstimateNew(int nr, clock_t stopw0, time_t time0, int rX, int rY, int rZ, int xWait, int yWait, int zWait, char *retEstim);
void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc);
double PointEstimate(int nrp, double *points);
// Separate functions -----------------------------------------
129,6 → 130,9
void LayoutSave();
void LayoutSet();
void ToolTipSet();
void ToolTipSetSurfaceScan();
void ToolTipSetRelativePDE();
void ToolTipSetTempAnalysis();
 
// Subframes where we display everything
TGCompositeFrame *measLayout[measwin];
300,8 → 304,14
TSubStructure *secondAxis;
TSubStructure *exportExitAnalysis;
TSubStructure *xCrop;
TSubStructure *yCrop;
TSubStructure *interpolSize;
TSubStructure *updateCrop;
// Action connections for temporary analysis edit window (new tab)
void ApplyRunningAver();
void UpdateIntegrateSurface(int val);
void CloseTempAnalysisTab(int tabval);
void ExportTempAnalysisPlot();
 
312,8 → 322,9
void RunMeas(void *ptr, int runCase, int &scanon);
int MyTimer();
 
// Open directory
char *currentOpenDir;
// Open directory (separate for saving measurement and for opening histograms)
char *currentMeasDir;
char *currentAnalDir;
 
// ROOT file variable structure -------------------------------
struct EventHeader {
/lab/sipmscan/trunk/src/analysis.cpp
29,7 → 29,7
// cTemp = new char[1024];
// sprintf(cTemp, "%s/results", rootdir);
// file_info.fIniDir = StrDup(cTemp);
file_info.fIniDir = StrDup(currentOpenDir);
file_info.fIniDir = StrDup(currentAnalDir);
file_info.fMultipleSelection = kFALSE;
new TGFileDialog(gClient->GetDefaultRoot(), fMain, kFDOpen, &file_info);
// delete[] cTemp;
58,7 → 58,7
}
else if(analTab->GetCurrent() == 1) // Relative PDE
{
relPde->widgetChBox[1]->SetState(kButtonDown);
relPde->widgetChBox[0]->SetState(kButtonDown);
midPeak->widgetChBox[0]->SetState(kButtonUp);
zeroAngle->widgetNE[0]->SetNumber(0.00);
}
370,6 → 370,7
double range[4];
TGraph2D *gScan2D;
gScan2D = new TGraph2D();
gScan2D->SetName("edgescan");
range[0] = TMath::MinElement(nrfiles, surfxy);
range[1] = TMath::MaxElement(nrfiles, surfxy);
range[2] = TMath::MinElement(nrfiles, surfz);
896,7 → 897,7
if(j > 50) break;
}
 
if(npeaks > 1)
if( (npeaks > 1) && (nrfit > 1) )
{
int bin = histtemp->GetXaxis()->FindBin((int)(meanparam+meansel[sortindex[1]])/2);
adcpedestal[0] = (meanparam+meansel[sortindex[1]])/2;
993,6 → 994,13
if( (angle[i] == zeroAngle->widgetNE[0]->GetNumber()) && (darkhist != i) )
zeromu = i;
 
// Checking for errors when fitting a histogram
if(k2 == 0)
{
printf("PhotonMu(): No pedestal entries found. Check the fitting results.\n");
muval[i] = -1;
}
else
muval[i] = -TMath::Log((double)k2/(double)k);
printf("PhotonMu(): %lf: muval = %lf\n", angle[i], muval[i]);
 
1040,6 → 1048,10
if(i == darkhist)
exclude = false;
 
// Wrong fit
if(muval[i] == -1)
exclude = true;
 
// If nothing excluded, pass the points in pointest variable like in a FIFO
if(!exclude)
{
1740,6 → 1752,7
double range[4];
TGraph2D *gScan2D;
gScan2D = new TGraph2D();
gScan2D->SetName("surfscan");
range[0] = TMath::MinElement(nrfiles, surfx);
range[1] = TMath::MaxElement(nrfiles, surfx);
range[2] = TMath::MinElement(nrfiles, surfy);
1842,6 → 1855,8
{
gCanvas->Modified();
gCanvas->Update();
 
UpdateIntegrateSurface(-1);
}
}
}
/lab/sipmscan/trunk/src/connections.cpp
597,7 → 597,6
}
meas_data->Fill();
n++;
sleep(1);
 
// Start making a scope measurement
/* if( (gScopeDaq->scopeUseType == 2) && (sCamaclink->IsDown()) )
1210,7 → 1209,33
#endif
PositionSet(1);
}
// Abort any motion
else if(opt == 4)
{
sprintf(cmd, "sudo %s/src/MIKRO/mikro_ctrl -n 1 -c ab", rootdir); // X-axis
#if WORKSTAT == 'I'
printf("Emergency stop of the current movement of all linear tables.\n");
retTemp = system(cmd);
#else
printf("Cmd: %s\n",cmd);
#endif
 
sprintf(cmd, "sudo %s/src/MIKRO/mikro_ctrl -n 2 -c ab", rootdir); // Y-axis
#if WORKSTAT == 'I'
retTemp = system(cmd);
#else
printf("Cmd: %s\n",cmd);
#endif
 
sprintf(cmd, "sudo %s/src/MIKRO/mikro_ctrl -n 3 -c ab", rootdir); // Z-axis
#if WORKSTAT == 'I'
retTemp = system(cmd);
#else
printf("Cmd: %s\n",cmd);
#endif
PositionSet(1);
}
}
 
// Set, get, home or reset the rotation platform
void TGAppMainFrame::RotationSet(int opt)
1296,24 → 1321,41
#endif
RotationSet(1);
}
// Abort any motion
else if(opt == 4)
{
sprintf(cmd, "sudo %s/src/MIKRO/mikro_ctrl -n 4 -c ab", rootdir);
#if WORKSTAT == 'I'
printf("Emergency stop of the current movement of the rotation platform.\n");
retTemp = system(cmd);
#else
printf("Cmd: %s\n",cmd);
#endif
RotationSet(1);
}
}
 
// File browser for selecting the save file
void TGAppMainFrame::SaveFile()
{
// char *cTemp;
 
TGFileInfo file_info;
const char *filetypes[] = {"Histograms",histextall,0,0};
char *cTemp;
file_info.fFileTypes = filetypes;
cTemp = new char[1024];
sprintf(cTemp, "%s/results", rootdir);
file_info.fIniDir = StrDup(cTemp);
// cTemp = new char[1024];
// sprintf(cTemp, "%s/results", rootdir);
// file_info.fIniDir = StrDup(cTemp);
file_info.fIniDir = StrDup(currentMeasDir);
new TGFileDialog(gClient->GetDefaultRoot(), fMain, kFDSave, &file_info);
delete[] cTemp;
// delete[] cTemp;
 
if(file_info.fFilename != NULL)
{
fileName->widgetTE->SetText(file_info.fFilename);
remove_from_last(file_info.fFilename, '/', currentMeasDir);
}
}
 
// Start the acquisition
void TGAppMainFrame::StartAcq()
1605,6 → 1647,8
measProgress->widgetPB->SetPosition(progVal);
gVirtualX->Update(1);
 
int nrAverMeas = -1;
 
clkt0 = clock();
timet0 = time(NULL);
 
1668,8 → 1712,8
progVal = (float)(100.00/(abs(repetX)*abs(repetY)*abs(repetZ)))*(k*abs(repetX)*abs(repetY) + j*abs(repetX) + i);
measProgress->widgetPB->SetPosition(progVal);
 
TimeEstimate(clkt0, timet0, progVal, cmd, doublewait*((abs(repetX)+2)*abs(repetY)+2)*abs(repetZ));
measProgress->widgetTE->SetText(cmd);
// TimeEstimate(clkt0, timet0, progVal, cmd, doublewait*((abs(repetX)+2)*abs(repetY)+2)*abs(repetZ));
// measProgress->widgetTE->SetText(cmd);
 
gVirtualX->Update(1);
 
1688,6 → 1732,9
printf("Next X position...\n");
fflush(stdout);
TimeEstimateNew(nrAverMeas, clkt0, timet0, repetX, repetY, repetZ, doublewait, 2*doublewait, 2*doublewait, cmd);
measProgress->widgetTE->SetText(cmd);
printf("Waiting for position change...\n");
sleep(doublewait);
xPos->widgetNE[0]->SetNumber(minXpos + stepXpos*i);
1694,8 → 1741,9
printf("Continuing...\n");
// Here comes function to start histogramming <<<<<<<<<<<<<<<<<<<<<<<<
clkt0 = clock();
RunMeas((void*)0, (j*repetX + i), scanon);
nrAverMeas++;
fflush(stdout);
 
i++;
1969,7 → 2017,7
// cTemp = new char[1024];
// sprintf(cTemp, "%s/results", rootdir);
// file_info.fIniDir = StrDup(cTemp);
file_info.fIniDir = StrDup(currentOpenDir);
file_info.fIniDir = StrDup(currentAnalDir);
file_info.fMultipleSelection = kTRUE;
new TGFileDialog(gClient->GetDefaultRoot(), fMain, kFDOpen, &file_info);
// delete[] cTemp;
1983,7 → 2031,7
while(file=(TSystemFile*)next())
{
fname = file->GetName();
remove_from_last((char*)fname.Data(), '/', currentOpenDir);
remove_from_last((char*)fname.Data(), '/', currentAnalDir);
fileList->AddEntry(fname.Data(), i);
i++;
}
/lab/sipmscan/trunk/src/new_tabs.cpp
588,6 → 588,7
if(DBGSIG > 1) printf("TempAnalysisTab(): Current tab = %d, Nr. of tabs = %d\n", startTab, newTab );
 
double numform[6];
double numform2[6];
int subgroup[2];
subgroup[0] = mainTab->GetWidth()-10;
615,7 → 616,7
}
tempAnalysisCanvas->GetCanvas()->SetGrid();
 
// Specific options for plotting (analtype: 0 = Normal integration, 1 = Edge scans, 2 = Relative PDE,...)
// Specific options for plotting (analtype: 0 = Normal integration, 1 = Edge scans, 2 = Relative PDE, 3 = Breakdown voltage, 4 = Surface scan, 5 = Timing,...)
// Normal integration
if(analtype == 0)
{
653,8 → 654,57
 
runningAver->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "ApplyRunningAver()");
runningOff->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "ApplyRunningAver()");
 
ToolTipSetRelativePDE();
}
// Breakdown voltage
else if(analtype == 3)
{
}
// Surface scan
else if(analtype == 4)
{
fH1 = new TGCompositeFrame(fV1, subgroup[0], subgroup[1], kHorizontalFrame);
 
// Values to create a crop of the graph
if(DBGSIG > 1) printf("TempAnalysisTab(): Creating TSubStructure *xCrop -> Set how many X parts of the surface scan to crop.\n");
xCrop = new TSubStructure();
for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; }
if(posUnitsPlot->widgetCB->GetSelected() == 0) { numform[0] = 8; numform[2] = 2; numform2[0] = 8; numform2[2] = 2; }
else if(posUnitsPlot->widgetCB->GetSelected() == 1) { numform[0] = 8; numform[1] = 2; numform[2] = 2; numform2[0] = 8; numform2[1] = 2; numform2[2] = 2; }
if(xCrop->TGLabelDoubleNEntry(fH1, subgroup[0]/4-50, 30, "X axis crop values:", 0, numform, 0, numform2, "center"))
fH1->AddFrame(xCrop->outsidebox, f1expandXpad);
 
if(DBGSIG > 1) printf("TempAnalysisTab(): Creating TSubStructure *yCrop -> Set how many Y parts of the surface scan to crop.\n");
yCrop = new TSubStructure();
for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; }
if(posUnitsPlot->widgetCB->GetSelected() == 0) { numform[0] = 8; numform[2] = 2; numform2[0] = 8; numform2[2] = 2; }
else if(posUnitsPlot->widgetCB->GetSelected() == 1) { numform[0] = 8; numform[1] = 2; numform[2] = 2; numform2[0] = 8; numform2[1] = 2; numform2[2] = 2; }
if(yCrop->TGLabelDoubleNEntry(fH1, subgroup[0]/4-50, 30, "Y axis crop values:", 0, numform, 0, numform2, "center"))
fH1->AddFrame(yCrop->outsidebox, f1expandXpad);
 
if(DBGSIG > 1) printf("TempAnalysisTab(): Creating TSubStructure *interpolSize -> Set the interpolation step size of the 2D graph.\n");
interpolSize = new TSubStructure();
for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; }
if(posUnitsPlot->widgetCB->GetSelected() == 0) { numform[0] = 8; numform[2] = 2; numform2[0] = 8; numform2[2] = 2; }
else if(posUnitsPlot->widgetCB->GetSelected() == 1) { numform[0] = 8; numform[1] = 2; numform[2] = 2; numform2[0] = 8; numform2[1] = 2; numform2[2] = 2; }
if(interpolSize->TGLabelDoubleNEntry(fH1, subgroup[0]/4+20, 30, "Interpol. step size:", 500, numform, 500, numform2, "center"))
fH1->AddFrame(interpolSize->outsidebox, f1expandXpad);
 
if(DBGSIG > 1) printf("TempAnalysisTab(): Creating TSubStructure *updateCrop -> 2 buttons for either updating the crop or making an integral\n");
updateCrop = new TSubStructure();
const char *selnames[512] = {"Update","Integrate surface scan"};
if(updateCrop->TGMultiButton(fH1, subgroup[0]/4-50, 30, 2, selnames, "center"))
fH1->AddFrame(updateCrop->outsidebox, f1expandXpad);
 
fV1->AddFrame(fH1, f1expandXpad);
 
updateCrop->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "UpdateIntegrateSurface(=0)");
updateCrop->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "UpdateIntegrateSurface(=1)");
 
ToolTipSetSurfaceScan();
}
 
// Export and close buttons
if(DBGSIG > 1) printf("TempAnalysisTab(): Creating TSubStructure *exportExitAnalysis -> 2 buttons for either exporting the plot or closing the tab\n");
exportExitAnalysis = new TSubStructure();
674,6 → 724,8
fMain->MapWindow();
fMain->Layout();
 
ToolTipSetTempAnalysis();
 
// Set tab ID
*tabid = newTab;
 
775,6 → 827,83
}
}
 
void TGAppMainFrame::UpdateIntegrateSurface(int val)
{
TCanvas *gCanvas = tempAnalysisCanvas->GetCanvas();
TList *funcList = (TList*)gCanvas->GetListOfPrimitives();
unsigned int nrfunc = funcList->GetSize();
TGraph2D *baseGr;
char funcname[512];
 
double integralValue;
int pointCount;
double xStepsize, yStepsize;
int xInterpol, yInterpol;
 
for(int i = 0; i < nrfunc; i++)
{
sprintf(funcname, "%s", funcList->At(i)->GetName());
if(DBGSIG) printf("UpdateIntegrateSurface(): Function is: %s\n", funcname);
 
if(strcmp(funcname,"surfscan") == 0)
{
baseGr = (TGraph2D*)gCanvas->GetPrimitive(funcname);
 
// Just set the initial things for the surface scan
if(val == -1)
{
xCrop->widgetNE[0]->SetNumber(baseGr->GetXaxis()->GetXmin());
xCrop->widgetNE[1]->SetNumber(baseGr->GetXaxis()->GetXmax());
yCrop->widgetNE[0]->SetNumber(baseGr->GetYaxis()->GetXmin());
yCrop->widgetNE[1]->SetNumber(baseGr->GetYaxis()->GetXmax());
 
xCrop->widgetNE[0]->SetLimits(TGNumberFormat::kNELLimitMinMax, baseGr->GetXaxis()->GetXmin(), baseGr->GetXaxis()->GetXmax());
xCrop->widgetNE[1]->SetLimits(TGNumberFormat::kNELLimitMinMax, baseGr->GetXaxis()->GetXmin(), baseGr->GetXaxis()->GetXmax());
yCrop->widgetNE[0]->SetLimits(TGNumberFormat::kNELLimitMinMax, baseGr->GetYaxis()->GetXmin(), baseGr->GetYaxis()->GetXmax());
yCrop->widgetNE[1]->SetLimits(TGNumberFormat::kNELLimitMinMax, baseGr->GetYaxis()->GetXmin(), baseGr->GetYaxis()->GetXmax());
}
// Update the cropping
else if(val == 0)
{
baseGr->GetXaxis()->SetRange(xCrop->widgetNE[0]->GetNumber(), xCrop->widgetNE[1]->GetNumber());
baseGr->GetXaxis()->SetRangeUser(xCrop->widgetNE[0]->GetNumber(), xCrop->widgetNE[1]->GetNumber());
baseGr->GetYaxis()->SetRange(yCrop->widgetNE[0]->GetNumber(), yCrop->widgetNE[1]->GetNumber());
baseGr->GetYaxis()->SetRangeUser(yCrop->widgetNE[0]->GetNumber(), yCrop->widgetNE[1]->GetNumber());
 
gCanvas->Modified();
gCanvas->Update();
}
// Make an integral over all histogram values in range
else if(val == 1)
{
integralValue = 0;
pointCount = 0;
 
xStepsize = interpolSize->widgetNE[0]->GetNumber();
yStepsize = interpolSize->widgetNE[1]->GetNumber();
xInterpol = (int)((xCrop->widgetNE[1]->GetNumber() - xCrop->widgetNE[0]->GetNumber())/xStepsize);
yInterpol = (int)((yCrop->widgetNE[1]->GetNumber() - yCrop->widgetNE[0]->GetNumber())/yStepsize);
 
for(int j = 0; j < xInterpol; j++)
{
for(int k = 0; k < yInterpol; k++)
{
if((xCrop->widgetNE[0]->GetNumber()+j*xStepsize+xStepsize/2. <= xCrop->widgetNE[1]->GetNumber()) && (yCrop->widgetNE[0]->GetNumber()+k*yStepsize+yStepsize/2. <= yCrop->widgetNE[1]->GetNumber()))
{
if(DBGSIG) cout << "Interpolation at (" << xCrop->widgetNE[0]->GetNumber()+j*xStepsize+xStepsize/2. << "," << yCrop->widgetNE[0]->GetNumber()+k*yStepsize+yStepsize/2. << ") is " << baseGr->Interpolate(xCrop->widgetNE[0]->GetNumber()+j*xStepsize+xStepsize/2., yCrop->widgetNE[0]->GetNumber()+k*yStepsize+yStepsize/2.) << endl;
integralValue += baseGr->Interpolate(xCrop->widgetNE[0]->GetNumber()+j*xStepsize+xStepsize/2., yCrop->widgetNE[0]->GetNumber()+k*yStepsize+yStepsize/2.);
pointCount++;
}
}
}
 
cout << "Total integral value (" << pointCount << " points) = " << integralValue << endl << "Total normated integral value = " << (double)integralValue/pointCount << endl;
 
}
}
}
}
 
void TGAppMainFrame::ExportTempAnalysisPlot()
{
TCanvas *gCanvas = tempAnalysisCanvas->GetCanvas();
786,7 → 915,7
cTemp = new char[1024];
// sprintf(cTemp, "%s/results", rootdir);
// file_info.fIniDir = StrDup(cTemp);
file_info.fIniDir = StrDup(currentOpenDir);
file_info.fIniDir = StrDup(currentAnalDir);
new TGFileDialog(gClient->GetDefaultRoot(), fMain, kFDSave, &file_info);
delete[] cTemp;
 
/lab/sipmscan/trunk/src/separate_functions.cpp
165,6 → 165,37
sprintf(retEstim, "Estimated end time: %s", ctemp);
}
 
void TimeEstimateNew(int nr, clock_t stopw0, time_t time0, int rX, int rY, int rZ, int xWait, int yWait, int zWait, char *retEstim)
{
clock_t clkt1;
char ctemp[512];
double timeSec;
double averMeasTime;
 
clkt1 = clock() - stopw0;
if(nr == -1)
return;
else if(nr == 0)
averMeasTime = (double)clkt1/CLOCKS_PER_SEC;
else
averMeasTime = (averMeasTime + (double)clkt1/CLOCKS_PER_SEC)/2.0;
 
// calculate the time of one row
timeSec = rX*(xWait + averMeasTime);
// calculate the time of a surface scan
timeSec = timeSec + rY*(timeSec + yWait);
// calculate the time of a zscan
if(rZ == 1)
timeSec = timeSec + zWait;
else
timeSec = timeSec + rZ*(timeSec + zWait);
 
GetTime((int)timeSec+(int)time0, ctemp);
sprintf(retEstim, "Estimated end time: %s", ctemp);
 
printf("TimeEstimateNew(): Average time of measurement = %lf, Measurement time = %lf, Finishing time = %s\n", averMeasTime, timeSec, ctemp);
}
 
void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc)
{
int count = 0;
/lab/sipmscan/trunk/src/sipmscan.cpp
15,8 → 15,10
char *cTemp;
 
// Prepare the default open directory (basedir)
currentOpenDir = new char[1024];
sprintf(currentOpenDir, "%s/results", rootdir);
currentMeasDir = new char[1024];
sprintf(currentMeasDir, "%s/results", rootdir);
currentAnalDir = new char[1024];
sprintf(currentAnalDir, "%s/results", rootdir);
 
// CAMAC and Scope objects
gDaq = new daq();
567,10 → 569,10
fG1->AddFrame(fH2, f1expandXpad);
// Set, get, home and reset position buttons
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posButtons -> 4 buttons (set position, read current position, home the motor and reset all three controllers)\n");
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posButtons -> 5 buttons (set position, read current position, home the motor, reset all three controllers and emergency stop)\n");
posButtons = new TSubStructure();
selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset";
if(posButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 4, selnames, "center"))
selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; selnames[4] = "Emergency stop";
if(posButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 5, selnames, "center"))
fG1->AddFrame(posButtons->outsidebox, f1expandXpad);
 
// Position scan controls
627,10 → 629,10
fG1->AddFrame(rotPos->outsidebox, f1expandXpad);
// Set, get, home and reset rotation buttons
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotButtons -> 4 buttons (set rotation, read current rotation, home the motor and reset controller)\n");
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotButtons -> 5 buttons (set rotation, read current rotation, home the motor, reset controller and emergency stop)\n");
rotButtons = new TSubStructure();
selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset";
if(rotButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 4, selnames, "center"))
selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; selnames[4] = "Emergency stop";
if(rotButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 5, selnames, "center"))
fG1->AddFrame(rotButtons->outsidebox, f1expandXpad);
 
// Rotation scan controls
709,6 → 711,14
measLayout[2]->AddFrame(measProgress->outsidebox, f1expandXpad);
}
 
Pixel_t pixel_color;
gClient->GetColorByName("white", pixel_color);
posButtons->widgetTB[4]->SetTextColor(pixel_color);
rotButtons->widgetTB[4]->SetTextColor(pixel_color);
gClient->GetColorByName("red", pixel_color);
posButtons->widgetTB[4]->SetBackgroundColor(pixel_color);
rotButtons->widgetTB[4]->SetBackgroundColor(pixel_color);
 
// Actions for Main window //TODO
vOutOpt->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "NegativePolarity()");
vOutButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=0)");
718,10 → 728,12
posButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=1)");
posButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=2)");
posButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=3)");
posButtons->widgetTB[4]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=4)");
rotButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=0)");
rotButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=1)");
rotButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=2)");
rotButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=3)");
rotButtons->widgetTB[4]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=4)");
fileName->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SaveFile()");
measProgress->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "StartAcq()");
// TODO - Save file
/lab/sipmscan/trunk/src/tooltips.cpp
84,6 → 84,8
SetToolTipText("Move the movement table to its predetermined initial position (home).");
posButtons->widgetTB[3]->
SetToolTipText("Reset, initialize and home all controllers for the movement table. Only use,\nif there is a problem with moving the table. If further problems\noccur, check under \"Movement table\" in the \"Help\" file.");
posButtons->widgetTB[4]->
SetToolTipText("Emergency stop of all three linear motors. Use if you know the motor is about to hit something.");
 
rotPos->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Incidence angle of the laser onto the sample (in units set by \"Rotation units\" in the\n\"Settings pane\"). 0 degrees corresponds to perpendicular laser light onto the surface.");
101,6 → 103,8
SetToolTipText("Move the rotation sample holder to angle 0 deg.");
rotButtons->widgetTB[3]->
SetToolTipText("Reposition to 0 deg, reset and initialize controller for the rotation sample holder.\nOnly use, if there is a problem with moving the table. If further problems\noccur, check under \"Movement table\" in the \"Help\" file.");
rotButtons->widgetTB[4]->
SetToolTipText("Emergency stop of the rotation samble holder. Use if you know the motor is about to hit something.");
 
evtNum->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Number of events to obtain before stopping data acquisition.");
113,6 → 117,8
 
measProgress->widgetTB[0]->
SetToolTipText("Start a new measurement. Stopping a measurement before finishing is\nonly possible for single measurements (not for scans).");
/* measProgress->widgetTE->
SetToolTipText("Estimated time for the current measurement to end.\nIf the system has a heavy load, the time will be higher.");*/
 
// Analysis -------------------------------------------------------------------------
// Histogram file selection pane
252,3 → 258,39
SetToolTipText("Open the currently visible plot in the \"Histogram\"\nwindow in a new tab to enable further editing.");
// posUnitsPlot->widgetTB[0]->SetToolTipText("Open the currently visible plot in the \"Histogram\"\nwindow in a new tab to enable further editing.");
}
 
void TGAppMainFrame::ToolTipSetSurfaceScan()
{
xCrop->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Position value to cut on left side of the surface scan.");
xCrop->widgetNE[1]->GetNumberEntry()->
SetToolTipText("Position value to cut on right side of the surface scan.");
yCrop->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Position value to cut on the bottom of the surface scan.");
yCrop->widgetNE[1]->GetNumberEntry()->
SetToolTipText("Position value to cut on the top of the surface scan.");
interpolSize->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Set the step size of X axis to be used for integration.");
interpolSize->widgetNE[1]->GetNumberEntry()->
SetToolTipText("Set the step size of Y axis to be used for integration.");
updateCrop->widgetTB[0]->
SetToolTipText("Update the surface scan to the current cut settings.");
updateCrop->widgetTB[1]->
SetToolTipText("Start integration of the surface scan using the interpolation step size.");
}
 
void TGAppMainFrame::ToolTipSetRelativePDE()
{
runningOff->widgetNE[0]->GetNumberEntry()->
SetToolTipText("The offset for the running average estimation.");
runningAver->widgetNE[0]->GetNumberEntry()->
SetToolTipText("Set how many points to use for running average. If set to 0, running average will not be plotted.");
}
 
void TGAppMainFrame::ToolTipSetTempAnalysis()
{
exportExitAnalysis->widgetTB[0]->
SetToolTipText("Export the above plot and decide where to save it.");
exportExitAnalysis->widgetTB[1]->
SetToolTipText("Close the temporary analysis tab.");
}