From 50e6eb64d86c4ebece496b7a789ceafb097eb4d1 Mon Sep 17 00:00:00 2001 From: "Ryan@Debain10" Date: Wed, 30 Mar 2022 16:13:26 -0400 Subject: [PATCH] make pixie to be memeber of MainWindow --- pixieDAQ.cpp | 24 +++++++++++------------- pixieDAQ.h | 5 ++--- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/pixieDAQ.cpp b/pixieDAQ.cpp index 05805ab..10f86ef 100644 --- a/pixieDAQ.cpp +++ b/pixieDAQ.cpp @@ -17,7 +17,6 @@ #include #include "Pixie16Class.h" -static Pixie16 * pixie = new Pixie16(); #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) { - 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 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() { printf("--------- get ADCTrace \n"); diff --git a/pixieDAQ.h b/pixieDAQ.h index 61303d2..65a4e3f 100644 --- a/pixieDAQ.h +++ b/pixieDAQ.h @@ -30,6 +30,8 @@ private: TGTextEntry * tePath; TGTextEdit * teLog; + static Pixie16 * pixie; + SettingsSummary * mainSettings; ScalarPanel * scalarPanel; @@ -41,11 +43,8 @@ public: MainWindow(const TGWindow *p, UInt_t w, UInt_t h); virtual ~MainWindow(); - void HandleMenu(Int_t id); - void openPixie(); - void GetADCTrace(); void GetBaseLine(); void Scope();