make pixie to be memeber of MainWindow

This commit is contained in:
Ryan Tang 2022-03-30 16:13:26 -04:00
parent f4e217aa8e
commit 50e6eb64d8
2 changed files with 13 additions and 16 deletions

View File

@ -17,7 +17,6 @@
#include <unistd.h> #include <unistd.h>
#include "Pixie16Class.h" #include "Pixie16Class.h"
static Pixie16 * pixie = new Pixie16();
#include "pixieDAQ.h" #include "pixieDAQ.h"
@ -33,9 +32,19 @@ enum MenuIdentifiers{
}; };
///make static members
Pixie16 * MainWindow::pixie = NULL;
MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) { MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
openPixie(); printf("Removing Pixie16Msg.log \n");
remove( "Pixie16Msg.log");
pixie = new Pixie16();
if ( pixie->GetStatus() < 0 ) {
printf("Exiting program... \n");
GoodBye();
}
/// Create a main frame /// Create a main frame
fMain = new TGMainFrame(p,w,h); fMain = new TGMainFrame(p,w,h);
@ -207,17 +216,6 @@ void MainWindow::HandleMenu(Int_t id){
} }
void MainWindow::openPixie(){
printf("Removing Pixie16Msg.log \n");
remove( "Pixie16Msg.log");
if ( pixie->GetStatus() < 0 ) {
printf("Exiting program... \n");
GoodBye();
}
}
void MainWindow::GetADCTrace() { void MainWindow::GetADCTrace() {
printf("--------- get ADCTrace \n"); printf("--------- get ADCTrace \n");

View File

@ -30,6 +30,8 @@ private:
TGTextEntry * tePath; TGTextEntry * tePath;
TGTextEdit * teLog; TGTextEdit * teLog;
static Pixie16 * pixie;
SettingsSummary * mainSettings; SettingsSummary * mainSettings;
ScalarPanel * scalarPanel; ScalarPanel * scalarPanel;
@ -41,11 +43,8 @@ public:
MainWindow(const TGWindow *p, UInt_t w, UInt_t h); MainWindow(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~MainWindow(); virtual ~MainWindow();
void HandleMenu(Int_t id); void HandleMenu(Int_t id);
void openPixie();
void GetADCTrace(); void GetADCTrace();
void GetBaseLine(); void GetBaseLine();
void Scope(); void Scope();