Skip to content

Commit 7de15d9

Browse files
authored
Merge branch 'master' into ParaGenerateStreamLines
2 parents 35492eb + f6b9007 commit 7de15d9

31 files changed

+986
-162
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ SET_PROPERTY(TARGET Algorithms_Math PROPERTY FOLDER "Core/Algorithms")
625625
SET_PROPERTY(TARGET Algorithms_Field PROPERTY FOLDER "Core/Algorithms")
626626
SET_PROPERTY(TARGET Algorithms_Describe PROPERTY FOLDER "Core/Algorithms")
627627
SET_PROPERTY(TARGET Algorithms_BrainStimulator PROPERTY FOLDER "Core/Algorithms")
628+
SET_PROPERTY(TARGET Algorithms_Legacy_Inverse PROPERTY FOLDER "Core/Algorithms")
628629
SET_PROPERTY(TARGET Algorithms_Factory PROPERTY FOLDER "Core/Algorithms")
629630
SET_PROPERTY(TARGET Core_Algorithms_Legacy_Fields PROPERTY FOLDER "Core/Algorithms")
630631
SET_PROPERTY(TARGET Core_Algorithms_Legacy_Forward PROPERTY FOLDER "Core/Algorithms")

src/Core/Application/Application.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ namespace
181181
if (!script_.empty())
182182
{
183183
PythonInterpreter::Instance().importSCIRunLibrary();
184-
PythonInterpreter::Instance().run_string(script_);
184+
PythonInterpreter::Instance().run_script(script_);
185185
}
186186
return true;
187187
}
@@ -199,9 +199,17 @@ namespace
199199
switch (type)
200200
{
201201
case NetworkEventCommands::PostModuleAdd:
202-
return boost::make_shared<HardCodedPythonTestCommand>(prefs.postModuleAddScript_temporarySolution.val(), prefs.postModuleAddScriptEnabled_temporarySolution.val());
202+
return boost::make_shared<HardCodedPythonTestCommand>(
203+
prefs.postModuleAdd.script.val(),
204+
prefs.postModuleAdd.enabled.val());
203205
case NetworkEventCommands::OnNetworkLoad:
204-
return boost::make_shared<HardCodedPythonTestCommand>(prefs.onNetworkLoadScript_temporarySolution.val(), prefs.onNetworkLoadScriptEnabled_temporarySolution.val());
206+
return boost::make_shared<HardCodedPythonTestCommand>(
207+
prefs.onNetworkLoad.script.val(),
208+
prefs.onNetworkLoad.enabled.val());
209+
case NetworkEventCommands::ApplicationStart:
210+
return boost::make_shared<HardCodedPythonTestCommand>(
211+
prefs.applicationStart.script.val(),
212+
prefs.applicationStart.enabled.val());
205213
}
206214
return nullptr;
207215
}
@@ -238,10 +246,6 @@ NetworkEditorControllerHandle Application::controller()
238246

239247
/// @todo: sloppy way to initialize this but similar to v4, oh well
240248
IEPluginManager::Initialize();
241-
242-
/// @todo split out into separate piece
243-
// TODO: turn off until Matlab services are converted.
244-
// private_->start_eai();
245249
}
246250
return private_->controller_;
247251
}

src/Core/Application/Preferences/Preferences.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ Preferences::Preferences() :
5555
highDPIAdjustment("highDPIAdjustment", false),
5656
modulesAreDockable("modulesAreDockable", true),
5757
networkBackgroundColor("backgroundColor", "#808080"),
58-
postModuleAddScript_temporarySolution("postModuleAddScript_temporarySolution", ""),
59-
postModuleAddScriptEnabled_temporarySolution("postModuleAddScriptEnabled_temporarySolution", false),
60-
onNetworkLoadScript_temporarySolution("onNetworkLoadScript_temporarySolution", ""),
61-
onNetworkLoadScriptEnabled_temporarySolution("onNetworkLoadScriptEnabled_temporarySolution", false)
58+
postModuleAdd("postModuleAdd"),
59+
onNetworkLoad("onNetworkLoad"),
60+
applicationStart("applicationStart")
6261
{
6362
}
6463

64+
TriggeredScriptInfo::TriggeredScriptInfo(const std::string& name) :
65+
script(name + "_script", ""), enabled(name + "_enabled", false)
66+
{}
6567

6668
boost::filesystem::path Preferences::dataDirectory() const
6769
{

src/Core/Application/Preferences/Preferences.h

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ namespace SCIRun
6262
ValueChangedSignal valueChanged_;
6363
};
6464

65-
66-
65+
struct TriggeredScriptInfo
66+
{
67+
explicit TriggeredScriptInfo(const std::string& name);
68+
StringVariable script;
69+
BooleanVariable enabled;
70+
};
6771

6872
class SCISHARE Preferences : boost::noncopyable
6973
{
@@ -73,8 +77,6 @@ namespace SCIRun
7377
Preferences();
7478

7579
public:
76-
/// @todo: reuse Seg3D state vars
77-
7880
TrackedVariable<BooleanVariable> showModuleErrorDialogs;
7981
BooleanVariable saveBeforeExecute;
8082
BooleanVariable showModuleErrorInlineMessages;
@@ -87,11 +89,9 @@ namespace SCIRun
8789
TrackedVariable<BooleanVariable> modulesAreDockable;
8890
StringVariable networkBackgroundColor;
8991

90-
//super duper ugly.
91-
StringVariable postModuleAddScript_temporarySolution;
92-
BooleanVariable postModuleAddScriptEnabled_temporarySolution;
93-
StringVariable onNetworkLoadScript_temporarySolution;
94-
BooleanVariable onNetworkLoadScriptEnabled_temporarySolution;
92+
TriggeredScriptInfo postModuleAdd;
93+
TriggeredScriptInfo onNetworkLoad;
94+
TriggeredScriptInfo applicationStart;
9595

9696
std::string dataDirectoryPlaceholder() const;
9797

@@ -101,13 +101,8 @@ namespace SCIRun
101101
std::vector<boost::filesystem::path> dataPath() const;
102102
void addToDataPath(const boost::filesystem::path& path);
103103
void setDataPath(const std::string& dirs); // ;-delimited
104-
//TODO: remove path entry
105-
106-
107-
//void save_state();
108104

109105
private:
110-
//void initialize_states();
111106
boost::filesystem::path dataDir_;
112107
std::vector<boost::filesystem::path> dataPath_;
113108
};

src/Core/Command/Command.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ namespace SCIRun
9999
enum class NetworkEventCommands
100100
{
101101
PostModuleAdd,
102-
OnNetworkLoad
102+
OnNetworkLoad,
103+
ApplicationStart
103104
//TODO: add more based on user request
104105
};
105106

src/Dataflow/Engine/Controller/NetworkEditorController.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ NetworkEditorController::NetworkEditorController(ModuleFactoryHandle mf, ModuleS
8585
#ifdef BUILD_WITH_PYTHON
8686
NetworkEditorPythonAPI::setImpl(boost::make_shared<PythonImpl>(*this, cmdFactory_));
8787
#endif
88+
89+
eventCmdFactory_->create(NetworkEventCommands::ApplicationStart)->execute();
8890
}
8991

9092
NetworkEditorController::NetworkEditorController(NetworkHandle network, ExecutionStrategyFactoryHandle executorFactory, NetworkEditorSerializationManager* nesm)

0 commit comments

Comments
 (0)