Skip to content

Commit 65881fa

Browse files
committed
Merge branch 'master' of https://github.com/sandialabs/InterSpec
2 parents da97589 + 41a2891 commit 65881fa

30 files changed

+969
-457
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ option(
160160
"Include support for downloading images of the displayed page"
161161
OFF
162162
)
163+
option(
164+
USE_CSS_FLEX_LAYOUT
165+
"Use CSS Flex/Grid Layout in-place of Wts layouts were possible (work in progress)"
166+
OFF
167+
)
163168

164169
set(MAX_SPECTRUM_MEMMORY_SIZE_MB 256
165170
CACHE STRING

InterSpec/AuxWindow.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class AuxWindow : public Wt::WDialog
144144
// w->finished( boost::bind( &AuxWindow:::deleteAuxWindow, window ) );
145145
static void deleteAuxWindow( AuxWindow *window );
146146

147+
/** A convenience function to call #deleteAuxWindow via binding to a signal. */
148+
void deleteSelf();
149+
147150
//rejectWhenEscapePressed(): sets it up so hitting escape will cause the
148151
// finished() signal to be emmitted; also hides the dialog
149152
virtual void rejectWhenEscapePressed( bool enable = true );

InterSpec/D3SpectrumDisplayDiv.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,9 @@ class D3SpectrumDisplayDiv : public Wt::WContainerWidget
9494

9595
void setPeakModel( PeakModel *model );
9696

97-
/// \TODO: for all setData, setSecondData, and setBackground, get rid of live/real-time arguments
98-
/// and neutron counts.
99-
void setData( std::shared_ptr<SpecUtils::Measurement> data_hist,
100-
float liveTime,
101-
float realTime,
102-
float neutronCounts,
103-
bool keep_curent_xrange );
104-
void setSecondData( std::shared_ptr<SpecUtils::Measurement> hist,
105-
float liveTime,
106-
float realTime,
107-
float neutronCounts,
108-
bool ownAxis );
109-
void setBackground( std::shared_ptr<SpecUtils::Measurement> background,
110-
float liveTime,
111-
float realTime,
112-
float neutronCounts );
97+
void setData( std::shared_ptr<SpecUtils::Measurement> data_hist, const bool keep_curent_xrange );
98+
void setSecondData( std::shared_ptr<SpecUtils::Measurement> hist, const bool ownAxis );
99+
void setBackground( std::shared_ptr<SpecUtils::Measurement> background );
113100

114101
void scheduleUpdateForeground();
115102
void scheduleUpdateBackground();

InterSpec/FluxTool.h

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "InterSpec/AuxWindow.h"
3838

3939
// ToDo:
40+
// - Better and more-consistent printing to appropriate number of significant figures.
4041
// - Havent fully tested that copying to clipboard will work everywhere.
4142
// - Can maybe improve copying to clipboard using the clipboard API.
4243
// - Have some capability to automatically fit for a number of pre-defined
@@ -81,6 +82,26 @@ class FluxToolWindow : public AuxWindow
8182

8283
class FluxToolWidget : public Wt::WContainerWidget
8384
{
85+
public:
86+
enum class DisplayInfoLevel
87+
{
88+
/** Only energy, nuclide, and gammas into 4pi are shown.
89+
Gammas into 4pi uncertainty gets its own column in CSV, and is given as a percent uncertainty.
90+
*/
91+
Simple,
92+
93+
/** Nuclide, IntrinsicEff, GeometricEff, FluxOnDet columns are NOT shown.
94+
Uncertainties get own column in CSV, as actual value (e.g., not percent).
95+
*/
96+
Normal,
97+
98+
/** All columns are shown.
99+
Uncertainties are placed in their own column in CSV, as the actual value (e.g., not percent).
100+
*/
101+
Extended
102+
};//enum class DisplayInfoLevel
103+
104+
84105
public:
85106
FluxToolWidget( InterSpec *viewer,
86107
Wt::WContainerWidget *parent = 0 );
@@ -105,11 +126,16 @@ class FluxToolWidget : public Wt::WContainerWidget
105126

106127
Wt::Signal<> &tableUpdated();
107128

129+
DisplayInfoLevel displayInfoLevel() const;
130+
108131
protected:
109132
void init();
110133
void setTableNeedsUpdating();
111134
void refreshPeakTable();
112-
void setMinimalColumnsOnly( const bool minonly );
135+
136+
137+
void setDisplayInfoLevel( const DisplayInfoLevel disptype );
138+
113139
#if( FLUX_USE_COPY_TO_CLIPBOARD )
114140
void tableCopiedToCliboardCallback( const int copied );
115141
#endif
@@ -132,8 +158,8 @@ class FluxToolWidget : public Wt::WContainerWidget
132158
*/
133159
bool m_needsTableRefresh;
134160

135-
/** Whether to show all the columns or not. Default no. */
136-
bool m_compactColumns;
161+
/** What columns to show. */
162+
DisplayInfoLevel m_displayInfoLevel;
137163

138164
Wt::Signal<> m_tableUpdated;
139165

InterSpec/InterSpec.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,18 +1188,15 @@ class InterSpec : public Wt::WContainerWidget
11881188

11891189
SpecMeasManager *m_fileManager; // The file manager
11901190

1191-
// 20210604: started playing around with using FLEX layout for just the charts - its not there yet,
1192-
// but shows some promise.
1193-
#define USE_CSS_FLEX_LAYOUT 1
11941191

1195-
//Note: m_chartsLayout may be eliminated; may even be able to eliminate
1196-
// m_toolsLayout...
11971192
#if( USE_CSS_FLEX_LAYOUT )
11981193
Wt::WContainerWidget *m_chartResizer;
11991194
Wt::WContainerWidget *m_toolsResizer;
12001195
#else
12011196
Wt::WGridLayout *m_layout;
1202-
Wt::WGridLayout *m_chartsLayout;
1197+
1198+
Wt::WContainerWidget *m_charts;
1199+
Wt::WContainerWidget *m_chartsResize;
12031200
Wt::WGridLayout *m_toolsLayout;
12041201
#endif
12051202

InterSpec/InterSpec_config.h.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232
#cmakedefine01 USE_OSX_NATIVE_MENU
3333
#cmakedefine01 USE_ELECTRON_NATIVE_MENU
3434

35+
// 20210604: started playing around with using FLEX layout its not there yet, but shows some promise.
36+
// Items that need to be worked on:
37+
// - [ ] Controlling time chart height properly.
38+
// - [ ] When tool tabs are hidden, and one of those tools is selected to show, properly handling that
39+
// - [ ] Allowing to resize the tool tabs and time chart.
40+
// - [ ] Propagating tool tab size changes to wtResize(...) in JS to allow those tabs layouts
41+
// to change - or reimplementing their layouts using CSS grid or flex
42+
#cmakedefine01 USE_CSS_FLEX_LAYOUT
43+
3544
// Since USE_ELECTRON_NATIVE_MENU can be set to true without BUILD_AS_ELECTRON_APP being true, you
3645
// have to test both its an electron app, and the menu type, so we'll create a little bit of a
3746
// shortcut

InterSpec/SpecMeasManager.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class UserFileInDb;
7070
class PopupDivMenu;
7171
class SpectraHeader;
7272
class InterSpec;
73+
class SimpleDialog;
7374
class SpecMeasManager;
7475
class SpectraFileModel;
7576
class PopupDivMenuItem;
@@ -369,6 +370,11 @@ class SpecMeasManager : public Wt::WObject
369370
void handleFileDrop( const std::string &name,
370371
const std::string &spoolName,
371372
SpecUtils::SpectrumType type );
373+
374+
void handleFileDropWorker( const std::string &name,
375+
const std::string &spoolName,
376+
SpecUtils::SpectrumType type,
377+
SimpleDialog *dialog );
372378

373379
protected:
374380
//Called from inside displayFile(...) to see if there are options for

InterSpec/SpectrumDataModel.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,15 @@ class SpectrumDataModel: public Wt::WAbstractItemModel
8080

8181
//setDataHistogram(): also sets m_secondSF and m_backgroundSF to
8282
// m_dataLiveTime/m_{Second|Background}LiveTime
83-
virtual void setDataHistogram( std::shared_ptr<SpecUtils::Measurement> hist,
84-
float liveTime,
85-
float realTime,
86-
float neutronCounts );
83+
virtual void setDataHistogram( std::shared_ptr<SpecUtils::Measurement> hist );
8784

88-
//setSecondDataHistogram(): also sets m_secondSF to
89-
// m_dataLiveTime/m_secondDataLiveTime
85+
//setSecondDataHistogram(): also sets m_secondSF to m_dataLiveTime/m_secondDataLiveTime
9086
virtual void setSecondDataHistogram( std::shared_ptr<SpecUtils::Measurement> hist,
91-
float liveTime,
92-
float realTime,
93-
float neutronCounts,
94-
bool ownAxis );
87+
const bool ownAxis );
9588

9689
//setBackgroundHistogram(): also sets m_backgroundSF to
9790
// m_dataLiveTime/m_backgroundLiveTime
98-
virtual void setBackgroundHistogram( std::shared_ptr<SpecUtils::Measurement> hist,
99-
float liveTime,
100-
float realTime,
101-
float neutronCounts );
91+
virtual void setBackgroundHistogram( std::shared_ptr<SpecUtils::Measurement> hist );
10292

10393
// Flags for whether the background are getting subtracted.
10494
void setBackgroundSubtract( const bool subtract = true );

InterSpec/SpectrumDisplayDiv.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,9 @@ class SpectrumDisplayDiv : public Wt::WContainerWidget
9797

9898
void setPeakModel( PeakModel *model );
9999

100-
void setData( std::shared_ptr<SpecUtils::Measurement> data_hist,
101-
float liveTime,
102-
float realTime,
103-
float neutronCounts,
104-
bool keep_curent_xrange );
105-
void setSecondData( std::shared_ptr<SpecUtils::Measurement> hist,
106-
float liveTime,
107-
float realTime,
108-
float neutronCounts,
109-
bool ownAxis );
110-
void setBackground( std::shared_ptr<SpecUtils::Measurement> background,
111-
float liveTime,
112-
float realTime,
113-
float neutronCounts );
100+
void setData( std::shared_ptr<SpecUtils::Measurement> data_hist, const bool keep_curent_xrange );
101+
void setSecondData( std::shared_ptr<SpecUtils::Measurement> hist, const bool ownAxis );
102+
void setBackground( std::shared_ptr<SpecUtils::Measurement> background );
114103

115104

116105
// These 8 functions retrieve the corresponding info from the model.

InterSpec_resources/CompactFileManager.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
.CompactFileManager.LeftToRight{
1313
display: grid;
14-
grid-template-columns: 1fr 1fr 1fr;
14+
/* We need to keep too long of file selectors of titles from forcing each display from overgrowing its allotted 1/3 of width. */
15+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
1516
grid-column-gap: 5px;
1617
grid-auto-rows: minmax(100px, auto) 23px;
1718
}
@@ -68,13 +69,8 @@ div.DispType > div {
6869
div.DispType .SpecFileSelect{
6970
padding-left: 5px;
7071
padding-right: 5px;
71-
display: flex;
72-
7372
}
7473

75-
div.DispType .SpecFileSelect > select{
76-
flex-grow: 1;
77-
}
7874

7975
div.DispType div.SampleSelectRow {
8076
display: flex;
@@ -107,6 +103,8 @@ div.SampleSelectRow .NextNextSample{
107103

108104
div.DispType .SpecTitle {
109105
margin-top: 15px;
106+
/* white-space: nowrap; */ /* having the title be a single line with ellipses doesnt seem to work quite right */
107+
text-overflow: ellipsis;
110108
}
111109

112110
div.DispType .BottomRow {

0 commit comments

Comments
 (0)