Subversion Repositories f9daq

Rev

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

Rev 146 Rev 167
Line 462... Line 462...
462
   delete meas_data;
462
   delete meas_data;
463
   if(scopeTemp)
463
   if(scopeTemp)
464
      delete scope_data;
464
      delete scope_data;
465
   delete inroot;
465
   delete inroot;
466
 
466
 
467
printf("HeaderChange(): 6\n");
467
//printf("HeaderChange(): 6\n");
468
   // Prepare branches for the new header
468
   // Prepare branches for the new header
469
   TTree *new_header_data = new TTree("header_data", "Header information for the measurement.");
469
   TTree *new_header_data = new TTree("header_data", "Header information for the measurement.");
470
   new_header_data->Branch("nrch", &evtheader.nrch, "nrch/I");
470
   new_header_data->Branch("nrch", &evtheader.nrch, "nrch/I");
471
   new_header_data->Branch("timestamp", &evtheader.timestamp, "timestamp/I");
471
   new_header_data->Branch("timestamp", &evtheader.timestamp, "timestamp/I");
472
   new_header_data->Branch("biasvolt", &evtheader.biasvolt, "biasvolt/D");
472
   new_header_data->Branch("biasvolt", &evtheader.biasvolt, "biasvolt/D");
Line 475... Line 475...
475
   new_header_data->Branch("zpos", &evtheader.zpos, "zpos/I");
475
   new_header_data->Branch("zpos", &evtheader.zpos, "zpos/I");
476
   new_header_data->Branch("temperature", &evtheader.temperature, "temperature/D");
476
   new_header_data->Branch("temperature", &evtheader.temperature, "temperature/D");
477
   new_header_data->Branch("angle", &evtheader.angle, "temperature/D");
477
   new_header_data->Branch("angle", &evtheader.angle, "temperature/D");
478
   new_header_data->Branch("laserinfo", &evtheader.laserinfo, "laserinfo/C");
478
   new_header_data->Branch("laserinfo", &evtheader.laserinfo, "laserinfo/C");
479
 
479
 
480
printf("HeaderChange(): 7\n");
480
//printf("HeaderChange(): 7\n");
481
   // Save new values (and old ones where we don't want to edit anything)
481
   // Save new values (and old ones where we don't want to edit anything)
482
   evtheader.nrch = itemp[0];
482
   evtheader.nrch = itemp[0];
483
   evtheader.timestamp = itemp[1];
483
   evtheader.timestamp = itemp[1];
484
   // Bias voltage
484
   // Bias voltage
485
   if(changetype[0])
485
   if(changetype[0])
Line 515... Line 515...
515
   if(changetype[6])
515
   if(changetype[6])
516
      sprintf(evtheader.laserinfo, "%s", laserEdit->widgetTE->GetText());
516
      sprintf(evtheader.laserinfo, "%s", laserEdit->widgetTE->GetText());
517
   else
517
   else
518
      sprintf(evtheader.laserinfo, "%s", ctemp);
518
      sprintf(evtheader.laserinfo, "%s", ctemp);
519
 
519
 
520
printf("HeaderChange(): 8\n");
520
//printf("HeaderChange(): 8\n");
521
   new_header_data->Fill();
521
   new_header_data->Fill();
522
 
522
 
523
   // Write down the temporary output file
523
   // Write down the temporary output file
524
   new_header_data->Write();
524
   new_header_data->Write();
525
   new_meas_data->Write();
525
   new_meas_data->Write();
526
   if(scopeTemp)
526
   if(scopeTemp)
527
      new_scope_data->Write();
527
      new_scope_data->Write();
528
 
528
 
529
printf("HeaderChange(): 9\n");
529
//printf("HeaderChange(): 9\n");
530
   delete new_header_data;
530
   delete new_header_data;
531
   delete new_meas_data;
531
   delete new_meas_data;
532
   if(scopeTemp)
532
   if(scopeTemp)
533
      delete new_scope_data;
533
      delete new_scope_data;
534
   delete outroot;
534
   delete outroot;
Line 662... Line 662...
662
      if(exportExitAnalysis->TGMultiButton(fV1, subgroup[0]/2, 30, 2, selnames, "center"))
662
      if(exportExitAnalysis->TGMultiButton(fV1, subgroup[0]/2, 30, 2, selnames, "center"))
663
         fV1->AddFrame(exportExitAnalysis->outsidebox, f1expandXpad);
663
         fV1->AddFrame(exportExitAnalysis->outsidebox, f1expandXpad);
664
 
664
 
665
      // Actions for header editor
665
      // Actions for header editor
666
      char cTemp[512];
666
      char cTemp[512];
-
 
667
      exportExitAnalysis->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "ExportTempAnalysisPlot()");
667
      sprintf(cTemp, "CloseTempAnalysisTab(=%d)", newTab*100+startTab);
668
      sprintf(cTemp, "CloseTempAnalysisTab(=%d)", newTab*100+startTab);
668
      exportExitAnalysis->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, cTemp);
669
      exportExitAnalysis->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, cTemp);
669
 
670
 
670
      fT1->AddFrame(fV1, f1expand2d);
671
      fT1->AddFrame(fV1, f1expand2d);
671
 
672
 
Line 770... Line 771...
770
         gCanvas->Update();
771
         gCanvas->Update();
771
         delete[] xval;
772
         delete[] xval;
772
         delete[] yval;
773
         delete[] yval;
773
      }
774
      }
774
   }
775
   }
-
 
776
}
-
 
777
 
-
 
778
void TGAppMainFrame::ExportTempAnalysisPlot()
-
 
779
{
-
 
780
   TCanvas *gCanvas = tempAnalysisCanvas->GetCanvas();
-
 
781
 
-
 
782
   TGFileInfo file_info;
-
 
783
   const char *filetypes[] = {"PDF","*.pdf","Encapsulated PostScript (.eps)","*.eps", "JPG/JPEG", "*.jpg", "PNG", "*.png",0,0};
-
 
784
   char *cTemp;
-
 
785
   file_info.fFileTypes = filetypes;
-
 
786
   cTemp = new char[1024];
-
 
787
//   sprintf(cTemp, "%s/results", rootdir);
-
 
788
//   file_info.fIniDir = StrDup(cTemp);
-
 
789
   file_info.fIniDir = StrDup(currentOpenDir);
-
 
790
   new TGFileDialog(gClient->GetDefaultRoot(), fMain, kFDSave, &file_info);
-
 
791
   delete[] cTemp;
-
 
792
 
-
 
793
   if(file_info.fFilename != NULL)
-
 
794
      gCanvas->SaveAs(file_info.fFilename);
775
}
795
}
776
 
796
 
777
// Temporary analysis window ------------------------------------------
797
// Temporary analysis window ------------------------------------------