Skip to content

Commit 7270267

Browse files
committed
Fix message saying there are RIID results not showing up when loading file.
Also slightly improved display of RIID results for one type of detector. Fixed compilation warning on Windows.
1 parent 5d40814 commit 7270267

File tree

5 files changed

+37
-11
lines changed

5 files changed

+37
-11
lines changed

src/InterSpec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9392,7 +9392,7 @@ void InterSpec::setSpectrum( std::shared_ptr<SpecMeas> meas,
93929392
switch( spec_type )
93939393
{
93949394
case SpecUtils::SpectrumType::Foreground:
9395-
worthShowing = ana->is_empty();
9395+
worthShowing = !ana->is_empty();
93969396
break;
93979397

93989398
case SpecUtils::SpectrumType::SecondForeground:

src/MakeDrf.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,10 @@ namespace
479479
m_useForEffCb->setChecked( use );
480480
if( m_userBr )
481481
m_userBr->setHidden( !use || m_isBackground );
482-
482+
483+
#ifndef _WIN32
483484
#warning "Use peak model (after modding it) to set whether to use intrinsic eff or not"
485+
#endif
484486
//m_peakModel->setUseForDrfIntrinsicEffFit( use );
485487
//m_peakModel->setData( )
486488
}
@@ -2629,7 +2631,9 @@ std::shared_ptr<SpecMeas> MakeDrf::assembleCalFile()
26292631
for( auto peak : sample->peaks() )
26302632
{
26312633
shared_ptr<PeakDef> newpeak = make_shared<PeakDef>( *peak->m_peak );
2634+
#ifndef _WIN32
26322635
#warning "newpeak->setUseForDrfIntrinsicEffFit not needed anymore"
2636+
#endif
26332637
newpeak->setUseForDrfIntrinsicEffFit( peak->useForEffFit() );
26342638
//blah blah blah I dont think this will be needed after we add UseForDrfIntrinsicEffFit as a peak model, assuming m_peak is same as the peak model has...
26352639
newpeaks.push_back( newpeak );

src/ShowRiidInstrumentsAna.cpp

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "InterSpec/SpecMeas.h"
3636
#include "SpecUtils/SpecFile.h"
3737
#include "InterSpec/InterSpec.h"
38+
#include "SpecUtils/StringAlgo.h"
3839
#include "InterSpec/SimpleDialog.h"
3940
#include "InterSpec/PhysicalUnits.h"
4041
#include "InterSpec/InterSpecUser.h"
@@ -232,15 +233,36 @@ class AnaResultDisplay : public WContainerWidget
232233
m_algorithm_result_description->setText( ana->algorithm_result_description_ );
233234
m_table->rowAt(AlgorithmResultDescription)->setHidden( m_algorithm_result_description->text().empty() );
234235

236+
#if( ENABLE_EDIT_RESULTS )
235237
string remarktxt;
236-
for( const string &r : ana->remarks_ )
238+
for( string r : ana->remarks_ )
239+
{
240+
SpecUtils::ireplace_all( r, "&#009;", " " );
237241
remarktxt += (remarktxt.size() ? "\n" : "") + r;
238-
239-
#if( ENABLE_EDIT_RESULTS )
242+
}
240243
m_algorithm_remarks->setText( remarktxt );
241244
#else
242-
const WString remarks = Wt::Utils::htmlEncode( WString::fromUTF8(remarktxt), Wt::Utils::HtmlEncodingFlag::EncodeNewLines );
243-
m_algorithm_remarks->setText( remarks );
245+
string remarktxt;
246+
for( string r : ana->remarks_ )
247+
{
248+
if( r.empty() )
249+
continue;
250+
251+
// Lets make lines line "Top Line 1: Am241&#009;662.45&#009;400.81" semi-reasonable, and have
252+
// displayed all on the same line.
253+
// TODO: there are probably a lot better ways to do this, like first check if there are any
254+
// lines like this, and if so, make a html table.
255+
// TODO: there are probably a lot of other special cases we can handle.
256+
SpecUtils::ireplace_all( r, "&#009;", "---mytab---" );
257+
r = Wt::Utils::htmlEncode( r, Wt::Utils::HtmlEncodingFlag::EncodeNewLines );
258+
SpecUtils::ireplace_all( r, "---mytab---", "&nbsp;&nbsp;&nbsp;" );
259+
SpecUtils::ireplace_all( r, ": ", ":&nbsp;" );
260+
SpecUtils::ireplace_all( r, "Top Line ", "Top&nbsp;Line&nbsp;" );
261+
262+
remarktxt += "<div>" + r + "</div>";
263+
}//for( string r : ana->remarks_ )
264+
265+
m_algorithm_remarks->setText( WString::fromUTF8(remarktxt) );
244266
#endif
245267

246268
m_table->rowAt(AlgorithmRemarks)->setHidden( m_algorithm_remarks->text().empty() );

target/electron/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ninja -C build_dir install
4141
# 'app' sub-directory of your build dir
4242
cmake-js build --out=build_dir --target install
4343
# Or
44-
cmake --build build_dir --target install --config Release
44+
cmake --build build_dir --target install --config Release --clean-first
4545
# Or
4646
ninja -C build_dir install
4747

@@ -86,5 +86,5 @@ The `InterSpec` module is really a shared library that node.js loads, therefore
8686

8787
## Future Work
8888
- In the future the build process may be improved to do the final packaging through CMake.
89-
- launch_options.json is intended to allow users to customize behaviours (like allow multiple windows, or not), but is not actually implemented.
89+
- launch_options.json is intended to allow users to customize behaviors (like allow multiple windows, or not), but is not actually implemented.
9090
- Need to look into having only a single instance of the application running when user wants multiple windows open.

target/electron/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"install": "cmake-js compile",
1313
"start": "electron ./build_win/app/",
1414
"package-mac": "electron-packager ./build_macos/app --overwrite --platform=darwin --arch=x64 --icon=macOS/InterSpec.icns --prune=true --out=release-builds --binaries=InterSpec.exe --extendInfo=macOS/Info.plist --entitlements=macOS/entitlements.mac.plist --ignore=copy_resources.* --ignore=LICENSE.md --ignore=README.md",
15-
"package-win": "electron-packager ./build_win/app InterSpec --overwrite --asar=0 --platform=win32 --arch=x64 --icon=windows/icon.ico --prune=true --out=release-builds --version-string.CompanyName=\"Sandia National Laboratories\" --version-string.FileDescription=\"nuclear spectroscopy analysis program\" --version-string.ProductName=\"InterSpec\" --ignore=LICENSE.md --ignore=README.md",
16-
"package-linux": "electron-packager ./build_linux/app InterSpec --overwrite --asar=0 --platform=linux --arch=x64 --icon=linux/InterSpec_desktop_icon_256x256.png --prune=true --out=release-builds --ignore=copy_resources.* --ignore=LICENSE.md --ignore=README.md"
15+
"package-win": "electron-packager ./build_win/app InterSpec --overwrite --asar=false --platform=win32 --arch=x64 --icon=windows/icon.ico --prune=true --out=release-builds --version-string.CompanyName=\"Sandia National Laboratories\" --version-string.FileDescription=\"nuclear spectroscopy analysis program\" --version-string.ProductName=\"InterSpec\" --ignore=LICENSE.md --ignore=README.md",
16+
"package-linux": "electron-packager ./build_linux/app InterSpec --overwrite --asar=false --platform=linux --arch=x64 --icon=linux/InterSpec_desktop_icon_256x256.png --prune=true --out=release-builds --ignore=copy_resources.* --ignore=LICENSE.md --ignore=README.md"
1717
},
1818
"author": {
1919
"name": "William Johnson",

0 commit comments

Comments
 (0)