Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 72dd9dea authored by suter_a's avatar suter_a
Browse files

add feature that mupp_plotter can show/hide lines between the data points.

parent 6b31c0a3
No related branches found
No related tags found
No related merge requests found
# - musrfit
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(nexus "build optional NeXus support. Needed for ISIS" OFF)
......
......@@ -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; i<fGraphE.size(); i++) {
fMultiGraph->Add(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();
......
......@@ -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);
......
......@@ -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; i<fGraphE.size(); i++) {
fMultiGraph->Add(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();
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment