#include "Processor.h" #include #include "TAxis.h" #include "TVirtualFFT.h" #include "TMath.h" #include "TApplication.h" #include "TROOT.h" #include "TSystem.h" #include "TF1.h" //Constructor Processor::Processor(std::string folder) : TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame), cCurrent(0), cFFT(0), lineFrequency(0), boxWindow(0) { //Create the GUI this->SetLayoutBroken(kTRUE); fNumberEntryFrequency = new TGNumberEntry(this, (Double_t) 0,6,101,(TGNumberFormat::EStyle) 5); this->AddFrame(fNumberEntryFrequency, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); fNumberEntryFrequency->MoveResize(8,8,160,22); fDoubleHSlider = new TGDoubleHSlider(this,160,1,100); this->AddFrame(fDoubleHSlider, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); fDoubleHSlider->MoveResize(8,40,160,24); fTextButtonProcess = new TGTextButton(this,"Process",102); fTextButtonProcess->SetTextJustify(36); fTextButtonProcess->SetMargins(0,0,0,0); fTextButtonProcess->SetWrapLength(-1); fTextButtonProcess->Resize(160,24); this->AddFrame(fTextButtonProcess, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); fTextButtonProcess->MoveResize(8,72,160,24); this->SetMWMHints(kMWMDecorAll, kMWMFuncAll, kMWMInputModeless); this->MapSubwindows(); this->Resize(this->GetDefaultSize()); this->MapWindow(); this->MoveResize(820,0,179,103); this->SetWindowName("Processor"); this->DontCallClose(); } //Default constructor Processor::Processor(){} //Destructor Processor::~Processor() { Cleanup(); DestroyWindow(); gSystem->ProcessEvents(); } //Manage the actions of the buttons bool Processor::ProcessMessage(Long_t message, Long_t par1, Long_t par2) { //Get the number of the action switch(par1) { case 102: //Save processed data saveProcessedData(); break; } return true; } //Save processed data void Processor::saveProcessedData() { //Exit gApplication->Terminate(0); }