Scope
Storage.cpp
1 #include "stdafx.h"
2 #include "parameters/Storage.h"
3 #include "helpers/ScopeException.h"
4 
5 namespace scope {
6 
7 namespace parameters {
8 
9 // Save some typing here...
10 using namespace boost::property_tree;
11 
12 Storage::Storage()
13  : folder(L"C:\\ScopeData\\", L"Folder")
14  , basename(L"test", L"Basename")
15  , autosave(true, false, true, L"Autosave")
16  , savelive(false, false, true, L"SaveLive")
17  , saveparameters(true, false, true, L"SaveParameters")
18  , usetifftags(true, false, true, L"UseTIFFTags")
19  , compresstiff(true, false, true, L"CompressTIFF") {
20 }
21 
22 void Storage::Load(const wptree& pt) {
30 }
31 
32 void Storage::Save(wptree& pt) const {
40 }
41 
43  const bool enabler = (_runstate.t==RunStateHelper::Mode::Stopped)?true:false;
44  autosave.SetRWState(enabler);
45  savelive.SetRWState(enabler);
46  basename.SetRWState(enabler);
47  folder.SetRWState(enabler);
48  saveparameters.SetRWState(enabler);
49  usetifftags.SetRWState(enabler);
50  compresstiff.SetRWState(enabler);
51 }
52 
53 }
54 
55 }
ScopeString basename
basename for image files
Definition: Storage.h:28
ScopeNumber< bool > autosave
autosave all acquisitions (except live scan)
Definition: Storage.h:31
void Save(wptree &pt) const override
save parameters into a boost:property_tree
Definition: Storage.cpp:32
void AddToPropertyTree(boost::property_tree::wptree &pt) const
Adds the value to a Boost property tree, using its name and value.
Definition: ScopeValue.h:103
ScopeNumber< bool > savelive
autosave live scan acquisitions
Definition: Storage.h:34
ScopeNumber< bool > compresstiff
write compressed TIFF
Definition: Storage.h:43
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
ScopeNumber< bool > usetifftags
write tiff tags for ImageJ etc.
Definition: Storage.h:40
ScopeString folder
folder to Save into
Definition: Storage.h:25
This is the include file for standard system include files, or project specific include files that ar...
T::Mode t
the enum from the template class
void Load(const wptree &pt) override
load parameters from a boost::property_tree
Definition: Storage.cpp:22
void SetRWState(const bool &_state)
Sets readonly/read-write state.
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Definition: Storage.cpp:42
void SetFromPropertyTree(const boost::property_tree::wptree &pt)
Set value from a Boost property, using its name as a key.
Definition: ScopeValue.h:108
ScopeNumber< bool > saveparameters
Save ScopeParameters in xml file.
Definition: Storage.h:37