-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlw_widget.h
118 lines (97 loc) · 3.3 KB
/
lw_widget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// *****************************************************************************
// NICOS, the Networked Instrument Control System of the FRM-II
// Copyright (c) 2009-2014 by the NICOS contributors (see AUTHORS)
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Module authors:
// Tobias Weber <[email protected]>
// Georg Brandl <[email protected]>
//
// *****************************************************************************
#ifndef LW_WIDGET_H
#define LW_WIDGET_H
class LWControls;
#include "lw_plot.h"
#include "lw_controls.h"
#include "lw_common.h"
#define INSTR_NONE 0
#define INSTR_TOFTOF 1
#define INSTR_IMAGING 2
#define INSTR_LAUE 3
class LWWidget : public QWidget
{
Q_OBJECT
friend class LWProfileWindow;
private:
bool m_bForceReinit;
int m_instr;
void *m_instr_data;
void unload();
protected:
LWData *m_data;
LWPlot *m_plot;
LWControls *m_controls;
bool m_showgrid;
bool m_log10;
bool m_normalized;
bool m_darkfieldsubtracted;
bool m_despeckled;
float m_despecklevalue;
virtual void resizeEvent(QResizeEvent *event);
void adjustAspect();
public:
LWWidget(QWidget *parent = NULL);
virtual ~LWWidget();
void setInstrumentOption(const char *instr);
int instrument();
LWPlot *plot() { return m_plot; }
LWData *data() { return m_data; }
void setData(LWData *data);
bool hasGrid() const;
bool isLog10() const;
bool isKeepAspect() const;
bool isNormalized() const;
bool isDarkfieldSubtracted() const;
bool isDespeckled() const;
bool controlsVisible() const;
LWImageFilters isImageFilter() const;
LWImageOperations isImageOperation() const;
void setCustomRange(double lower, double upper);
void setStandardColorMap(bool grayscale, bool cyclic);
void setAxisLabels(const char *xaxis, const char *yaxis);
public slots:
void setGrid(bool val);
void setLog10(bool val);
void setImageFilter(LWImageFilters which);
void setImageOperation(LWImageOperations which);
void setDespeckleValue(float value);
void setNormalizeFile(QString value);
void setDarkfieldFile(QString value);
void setKeepAspect(bool val);
void setNormalized(bool val);
void setDarkfieldSubtracted(bool val);
void setDespeckled(bool val);
void setControlsVisible(bool val);
void setControls(LWCtrl which);
void hideProfileLine();
void updateGraph(bool newdata=true);
void updateLabels();
signals:
void dataUpdated(LWData *data);
void profilePointPicked(int type, double x, double y);
void profileUpdate(int type, int nbins, void *dx, void *dy);
};
#endif