Subversion Repositories f9daq

Rev

Rev 146 | Rev 172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 146 Rev 167
Line 11... Line 11...
11
{
11
{
12
   TGCompositeFrame *fT1;
12
   TGCompositeFrame *fT1;
13
   idtotal = 0;
13
   idtotal = 0;
14
 
14
 
15
   char *cTemp;
15
   char *cTemp;
-
 
16
 
-
 
17
   // Prepare the default open directory (basedir)
-
 
18
   currentOpenDir = new char[1024];
-
 
19
   sprintf(currentOpenDir, "%s/results", rootdir);
16
 
20
 
17
   // CAMAC and Scope objects
21
   // CAMAC and Scope objects
18
   gDaq = new daq();
22
   gDaq = new daq();
19
   gScopeDaq = new daqscope();
23
   gScopeDaq = new daqscope();
20
 
24
 
Line 63... Line 67...
63
   wPane = new int[analysiswin]; hPane = new int[analysiswin];
67
   wPane = new int[analysiswin]; hPane = new int[analysiswin];
64
   for(int i = 0; i < analysiswin; i++)
68
   for(int i = 0; i < analysiswin; i++)
65
   {
69
   {
66
      wPane[i] = frmWidth[i+measwin];
70
      wPane[i] = frmWidth[i+measwin];
67
      hPane[i] = frmHeight[i+measwin];
71
      hPane[i] = frmHeight[i+measwin];
68
   }
72
   }
69
 
73
 
70
   fT1 = fTab->AddTab("Analysis");
74
   fT1 = fTab->AddTab("Analysis");
71
   TGSplitter(fT1, "horizontal", hor, vert, analysisFrmTit, analysisLayout, wPane, hPane);
75
   TGSplitter(fT1, "horizontal", hor, vert, analysisFrmTit, analysisLayout, wPane, hPane);
72
   fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
76
   fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
73
   idtotal++;
77
   idtotal++;
74
   delete[] vert; delete hor; delete[] wPane; delete[] hPane;
78
   delete[] vert; delete hor; delete[] wPane; delete[] hPane;
Line 135... Line 139...
135
TGAppMainFrame::~TGAppMainFrame()
139
TGAppMainFrame::~TGAppMainFrame()
136
{
140
{
137
   fMain->Cleanup();
141
   fMain->Cleanup();
138
   delete fMain;
142
   delete fMain;
139
}
143
}
140
 
144
 
141
// -------------------------------------------------------------------
145
// -------------------------------------------------------------------
142
 
146
 
143
// Event handler for menubar actions ---------------------------------
147
// Event handler for menubar actions ---------------------------------
144
 
148
 
145
void TGAppMainFrame::HandleMenu(Int_t id)
149
void TGAppMainFrame::HandleMenu(Int_t id)
146
{
150
{
147
//   int ret = 0;
151
//   int ret = 0;
148
   char cmd[256];
152
   char cmd[256];
149
 
153
 
150
   switch(id)
154
   switch(id)
151
   {
155
   {
152
      case M_FILE_SET_LAYOUT:
156
      case M_FILE_SET_LAYOUT:
153
         LayoutSet();
157
         LayoutSet();
154
         break;
158
         break;
155
 
159
 
156
      case M_FILE_SAVE_LAYOUT:
160
      case M_FILE_SAVE_LAYOUT:
157
         LayoutSave();
161
         LayoutSave();
158
         break;
162
         break;
159
 
163
 
160
      case M_FILE_SAVE_MSETTINGS:
164
      case M_FILE_SAVE_MSETTINGS:
161
         // Here, we save the set values in the measurement layout (automatically done when we safely exit the application and after each start of measurement).
165
         // Here, we save the set values in the measurement layout (automatically done when we safely exit the application and after each start of measurement).
162
         break;
166
         break;
163
 
167
 
164
      case M_FILE_SAVE_ASETTINGS:
168
      case M_FILE_SAVE_ASETTINGS:
Line 579... Line 583...
579
      fH2->AddFrame(xPosMin->outsidebox, f0centerX);
583
      fH2->AddFrame(xPosMin->outsidebox, f0centerX);
580
 
584
 
581
   yPosMin = new TSubStructure();
585
   yPosMin = new TSubStructure();
582
   if(yPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (min):", 0, numform, "center"))
586
   if(yPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (min):", 0, numform, "center"))
583
      fH2->AddFrame(yPosMin->outsidebox, f0centerX);
587
      fH2->AddFrame(yPosMin->outsidebox, f0centerX);
584
   fG1->AddFrame(fH2, f1expandXpad);
588
   fG1->AddFrame(fH2, f1expandXpad);
585
 
589
 
586
   fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame);
590
   fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame);
587
   xPosMax = new TSubStructure();
591
   xPosMax = new TSubStructure();
588
   if(xPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (max):", 0, numform, "center"))
592
   if(xPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (max):", 0, numform, "center"))
589
      fH2->AddFrame(xPosMax->outsidebox, f0centerX);
593
      fH2->AddFrame(xPosMax->outsidebox, f0centerX);
590
 
594
 
591
   yPosMax = new TSubStructure();
595
   yPosMax = new TSubStructure();
Line 866... Line 870...
866
   intSpectButtons = new TSubStructure();
870
   intSpectButtons = new TSubStructure();
867
   selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values";
871
   selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values";
868
   if(intSpectButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center"))
872
   if(intSpectButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center"))
869
      fV1->AddFrame(intSpectButtons->outsidebox, f1expandX);
873
      fV1->AddFrame(intSpectButtons->outsidebox, f1expandX);
870
 
874
 
871
   fT1->AddFrame(fV1, f1expandX);
875
   fT1->AddFrame(fV1, f1expandX);
872
 
876
 
873
   // Relative photon detection efficiency tab (PDE)
877
   // Relative photon detection efficiency tab (PDE)
874
   fT1 = analTab->AddTab("Relative PDE");
878
   fT1 = analTab->AddTab("Relative PDE");
875
   fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight);
879
   fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight);
876
 
880
 
877
   // Check button to toggle normalization
881
   // Check button to toggle normalization
Line 1152... Line 1156...
1152
   // Edit the selected histograms
1156
   // Edit the selected histograms
1153
   if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *editSelHist -> Button to additionally edit the selected histograms (make a canvas clone in a new tab)\n");
1157
   if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *editSelHist -> Button to additionally edit the selected histograms (make a canvas clone in a new tab)\n");
1154
   editSelHist = new TSubStructure();
1158
   editSelHist = new TSubStructure();
1155
   if(editSelHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Edit selected histograms:", "Edit", "center"))
1159
   if(editSelHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Edit selected histograms:", "Edit", "center"))
1156
      analysisLayout[3]->AddFrame(editSelHist->outsidebox, f1expandXpad);
1160
      analysisLayout[3]->AddFrame(editSelHist->outsidebox, f1expandXpad);
-
 
1161
 
-
 
1162
   // Select position units to use for ploting (micrometer, table position units)
-
 
1163
   if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posUnitsPlot -> Dropdown menu for selecting the position units for ploting\n");
-
 
1164
   posUnitsPlot = new TSubStructure();
-
 
1165
   selnames[0] = "table units"; selnames[1] = "micrometers";
-
 
1166
   sprintf(selected, "table units");
-
 
1167
   if(posUnitsPlot->TGLabelDrop(analysisLayout[3], 2.*subgroup[0]/3., 30, "Position units for plots:", 2, selnames, selected))
-
 
1168
      analysisLayout[3]->AddFrame(posUnitsPlot->outsidebox, f0centerX);
1157
 
1169
 
1158
   // Actions for histogram controls pane //TODO
1170
   // Actions for histogram controls pane //TODO
1159
   for(int i = 0; i < 2; i++)
1171
   for(int i = 0; i < 2; i++)
1160
   {
1172
   {
1161
      adcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)");
1173
      adcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)");