diff --git a/CMakeLists.txt b/CMakeLists.txt index d5e45b7a..3caa276a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # - musrfit --- DKS ----------------------------------------------------------- cmake_minimum_required(VERSION 3.17) -project(musrfit VERSION 1.8.1 LANGUAGES C CXX) +project(musrfit VERSION 1.8.2 LANGUAGES C CXX) #--- musrfit specific options ------------------------------------------------- option(dks "build musrfit with DKS (GPU/MIC) support" ON) diff --git a/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp b/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp index 7ac028c0..84635563 100644 --- a/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp +++ b/src/musredit_qt5/mupp/plotter/PMuppCanvas.cpp @@ -169,6 +169,9 @@ void PMuppCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) Done(0); } else if (x == 'b') { // about new TGMsgBox(gClient->GetRoot(), 0, "About mupp", "created by Andreas Suter\nPSI/NUM/LMU/LEM\n2018", kMBIconAsterisk); + } else if (x == 'l') { // draw with lines + fWithLines = !fWithLines; + UpdateGraphs(); } } @@ -182,7 +185,10 @@ void PMuppCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) */ void PMuppCanvas::HandleMenuPopup(Int_t id) { - if (id == P_MENU_ID_EXPORT) { + if (id == P_MENU_ID_WITH_LINE) { + fWithLines = !fWithLines; + UpdateGraphs(); + } else if (id == P_MENU_ID_EXPORT) { ExportData(); } else if (id == P_MENU_ID_ABOUT) { new TGMsgBox(gClient->GetRoot(), 0, "About mupp", "created by Andreas Suter\nPSI/NUM/LMU/LEM\n2017", kMBIconAsterisk); @@ -267,6 +273,7 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, fBar = fImp->GetMenuBar(); fPopupMain = fBar->AddPopup("&Mupp"); + fPopupMain->AddEntry("Toggle with&Line", P_MENU_ID_WITH_LINE); fPopupMain->AddEntry("Export &Data", P_MENU_ID_EXPORT); fPopupMain->AddSeparator(); fPopupMain->AddEntry("A&bout", P_MENU_ID_ABOUT); @@ -599,10 +606,14 @@ void PMuppCanvas::UpdateGraphs() } for (UInt_t i=0; iAdd(fGraphE[i], "p"); + fMultiGraph->Add(fGraphE[i]); } - fMultiGraph->Draw("a"); + if (fWithLines) { + fMultiGraph->Draw("ALP"); + } else { + fMultiGraph->Draw("AP"); + } // set x-axis limits. This is needed that the graphs x-axis starts at 0.0 Double_t xmin=fMultiGraph->GetXaxis()->GetXmin(); diff --git a/src/musredit_qt5/mupp/plotter/PMuppCanvas.h b/src/musredit_qt5/mupp/plotter/PMuppCanvas.h index 9cbe61d8..9e78e4bb 100644 --- a/src/musredit_qt5/mupp/plotter/PMuppCanvas.h +++ b/src/musredit_qt5/mupp/plotter/PMuppCanvas.h @@ -46,8 +46,9 @@ #include "mupp.h" // Canvas menu id's -#define P_MENU_ID_EXPORT 10001 -#define P_MENU_ID_ABOUT 10002 +#define P_MENU_ID_WITH_LINE 10001 +#define P_MENU_ID_EXPORT 10002 +#define P_MENU_ID_ABOUT 10003 //-------------------------------------------------------------------------- struct PDataPoint { @@ -113,6 +114,8 @@ private: PDoubleVector fMarkerSizeList; PIntVector fColorList; + bool fWithLines{false}; + virtual void CreateStyle(); virtual void InitMuppCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh); diff --git a/src/musredit_qt6/mupp/plotter/PMuppCanvas.cpp b/src/musredit_qt6/mupp/plotter/PMuppCanvas.cpp index 7ac028c0..84635563 100644 --- a/src/musredit_qt6/mupp/plotter/PMuppCanvas.cpp +++ b/src/musredit_qt6/mupp/plotter/PMuppCanvas.cpp @@ -169,6 +169,9 @@ void PMuppCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) Done(0); } else if (x == 'b') { // about new TGMsgBox(gClient->GetRoot(), 0, "About mupp", "created by Andreas Suter\nPSI/NUM/LMU/LEM\n2018", kMBIconAsterisk); + } else if (x == 'l') { // draw with lines + fWithLines = !fWithLines; + UpdateGraphs(); } } @@ -182,7 +185,10 @@ void PMuppCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) */ void PMuppCanvas::HandleMenuPopup(Int_t id) { - if (id == P_MENU_ID_EXPORT) { + if (id == P_MENU_ID_WITH_LINE) { + fWithLines = !fWithLines; + UpdateGraphs(); + } else if (id == P_MENU_ID_EXPORT) { ExportData(); } else if (id == P_MENU_ID_ABOUT) { new TGMsgBox(gClient->GetRoot(), 0, "About mupp", "created by Andreas Suter\nPSI/NUM/LMU/LEM\n2017", kMBIconAsterisk); @@ -267,6 +273,7 @@ void PMuppCanvas::InitMuppCanvas(const Char_t *title, Int_t wtopx, Int_t wtopy, fBar = fImp->GetMenuBar(); fPopupMain = fBar->AddPopup("&Mupp"); + fPopupMain->AddEntry("Toggle with&Line", P_MENU_ID_WITH_LINE); fPopupMain->AddEntry("Export &Data", P_MENU_ID_EXPORT); fPopupMain->AddSeparator(); fPopupMain->AddEntry("A&bout", P_MENU_ID_ABOUT); @@ -599,10 +606,14 @@ void PMuppCanvas::UpdateGraphs() } for (UInt_t i=0; iAdd(fGraphE[i], "p"); + fMultiGraph->Add(fGraphE[i]); } - fMultiGraph->Draw("a"); + if (fWithLines) { + fMultiGraph->Draw("ALP"); + } else { + fMultiGraph->Draw("AP"); + } // set x-axis limits. This is needed that the graphs x-axis starts at 0.0 Double_t xmin=fMultiGraph->GetXaxis()->GetXmin(); diff --git a/src/musredit_qt6/mupp/plotter/PMuppCanvas.h b/src/musredit_qt6/mupp/plotter/PMuppCanvas.h index 9cbe61d8..9e78e4bb 100644 --- a/src/musredit_qt6/mupp/plotter/PMuppCanvas.h +++ b/src/musredit_qt6/mupp/plotter/PMuppCanvas.h @@ -46,8 +46,9 @@ #include "mupp.h" // Canvas menu id's -#define P_MENU_ID_EXPORT 10001 -#define P_MENU_ID_ABOUT 10002 +#define P_MENU_ID_WITH_LINE 10001 +#define P_MENU_ID_EXPORT 10002 +#define P_MENU_ID_ABOUT 10003 //-------------------------------------------------------------------------- struct PDataPoint { @@ -113,6 +114,8 @@ private: PDoubleVector fMarkerSizeList; PIntVector fColorList; + bool fWithLines{false}; + virtual void CreateStyle(); virtual void InitMuppCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);