Skip to content

Commit 1559d0a

Browse files
committed
Change missing state var semantics
1 parent 6572b5f commit 1559d0a

34 files changed

+94
-43
lines changed

src/Core/Algorithms/Math/GetMatrixSliceAlgo.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ GetMatrixSliceAlgo::GetMatrixSliceAlgo()
5252
{
5353
addParameter(Parameters::IsSliceColumn, true);
5454
addParameter(Parameters::SliceIndex, 0);
55+
addParameter(Parameters::MaxIndex, 0);
5556
addParameter(Parameters::PlayModeActive, false);
5657
//TODO DAN: make overload to handle const char*
5758
addOption(Parameters::PlayModeType, "looponce", "looponce|loopforever"); //TODO add more play options

src/Dataflow/State/SimpleMapModuleState.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <Dataflow/State/SimpleMapModuleState.h>
3131
#include <Core/Utils/StringUtil.h>
3232
#include <Core/Logging/Log.h>
33+
#include <Core/Algorithms/Base/AlgorithmPreconditions.h>
3334
#include <boost/lexical_cast.hpp>
3435

3536
using namespace SCIRun::Dataflow::State;
@@ -82,7 +83,9 @@ ModuleStateHandle SimpleMapModuleState::clone() const
8283
const ModuleStateInterface::Value SimpleMapModuleState::getValue(const Name& parameterName) const
8384
{
8485
StateMap::const_iterator i = stateMap_.find(parameterName);
85-
return i != stateMap_.end() ? i->second : Value(AlgorithmParameterName(""), -1);
86+
if (i != stateMap_.end())
87+
return i->second;
88+
BOOST_THROW_EXCEPTION(AlgorithmParameterNotFound() << Core::ErrorMessage("Module has no state value with name " + parameterName.name_));
8689
}
8790

8891
bool SimpleMapModuleState::containsKey(const Name& name) const

src/Interface/Modules/Fields/ConvertMatricesToMeshDialog.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ ConvertMatricesToMeshDialog::ConvertMatricesToMeshDialog(const std::string& name
4343
setWindowTitle(QString::fromStdString(name));
4444
fixSize();
4545

46-
addDynamicLabelManager(nameTextLabel_, Modules::Fields::ConvertMatricesToMesh::InputFieldTypeName);
47-
addDynamicLabelManager(typeNameTextLabel_, Modules::Fields::ConvertMatricesToMesh::InputFieldTypeTypeName);
46+
addDynamicLabelManager(nameTextLabel_, Modules::Fields::ConvertMatricesToMesh::InputFieldName);
47+
addDynamicLabelManager(typeNameTextLabel_, Modules::Fields::ConvertMatricesToMesh::InputFieldTypeName);
4848
addComboBoxManager(fieldBaseTypeComboBox_, Modules::Fields::ConvertMatricesToMesh::FieldBaseType);
4949
addComboBoxManager(dataTypeComboBox_, Modules::Fields::ConvertMatricesToMesh::DataType);
5050
}

src/Interface/Modules/Fields/RefineTetMeshLocallyDialog.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,3 @@ RefineTetMeshLocallyDialog::RefineTetMeshLocallyDialog(const std::string& name,
6161
6262
connect(constraintComboBox_, SIGNAL(activated(int)), this, SLOT(setIsoValueEnabled()));*/
6363
}
64-
65-
void RefineTetMeshLocallyDialog::pullSpecial()
66-
{
67-
68-
}
69-

src/Interface/Modules/Fields/RefineTetMeshLocallyDialog.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ class SCISHARE RefineTetMeshLocallyDialog : public ModuleDialogGeneric,
4444
public:
4545
RefineTetMeshLocallyDialog(const std::string& name,
4646
SCIRun::Dataflow::Networks::ModuleStateHandle state,
47-
QWidget* parent = 0);
48-
protected:
49-
virtual void pullSpecial() override;
47+
QWidget* parent = nullptr);
5048
/*
5149
private Q_SLOTS:
5250
//void setIsoValueEnabled();

src/Interface/Modules/Fields/ResampleRegularMeshDialog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ResampleRegularMeshDialog::ResampleRegularMeshDialog(const std::string& name, Mo
5252
addTwoChoiceBooleanComboBoxManager(zAxisDimensionComboBox_, Parameters::ResampleZDimUseScalingFactor);
5353
addComboBoxManager(kernelComboBox_, Parameters::ResampleMethod);
5454

55-
connect(kernelComboBox_, SIGNAL(activated(const QString&)), this, SLOT(setGuassianWidgetsEnabled(const QString&)));
55+
connect(kernelComboBox_, SIGNAL(activated(const QString&)), this, SLOT(setGaussianWidgetsEnabled(const QString&)));
5656
}
5757

5858
void ResampleRegularMeshDialog::setGaussianWidgetsEnabled(const QString& label)

src/Interface/Modules/Teem/BuildDerivedNrrdWithGageDialog.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ BuildDerivedNrrdWithGageDialog::BuildDerivedNrrdWithGageDialog(const std::string
5757
addLineEditManager(ddNumParm1LineEdit_, Parameters::DDNumParm1);
5858
addLineEditManager(ddNumParm2LineEdit_, Parameters::DDNumParm2);
5959
addLineEditManager(ddNumParm3LineEdit_, Parameters::DDNumParm3);
60-
//connect(quantityComboBox_, SIGNAL(), this, SLOT());
6160
}
6261

6362
void BuildDerivedNrrdWithGageDialog::updateDescriptionLabel(const QString& item)

src/Modules/Basic/PortFeedbackTestModules.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ PortFeedbackSender::PortFeedbackSender()
4242
INITIALIZE_PORT(Input);
4343
}
4444

45+
void PortFeedbackSender::setStateDefaults()
46+
{
47+
48+
}
49+
4550
void PortFeedbackSender::execute()
4651
{
4752

@@ -54,7 +59,12 @@ PortFeedbackReceiver::PortFeedbackReceiver()
5459
{
5560
INITIALIZE_PORT(Output);
5661

57-
getOutputPort(Output)->connectConnectionFeedbackListener([this](const ModuleFeedback& var) { processFeedback(var); });
62+
//getOutputPort(Output)->connectConnectionFeedbackListener([this](const ModuleFeedback& var) { processFeedback(var); });
63+
}
64+
65+
void PortFeedbackReceiver::setStateDefaults()
66+
{
67+
5868
}
5969

6070
void PortFeedbackReceiver::execute()

src/Modules/Basic/PortFeedbackTestModules.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Basic {
4343
public:
4444
PortFeedbackSender();
4545
virtual void execute() override;
46-
virtual void setStateDefaults() override {}
46+
virtual void setStateDefaults() override;
4747

4848
INPUT_PORT(0, Input, String);
4949

@@ -58,9 +58,9 @@ namespace Basic {
5858
void processFeedback(const Core::Datatypes::ModuleFeedback& var);
5959
PortFeedbackReceiver();
6060
virtual void execute() override;
61-
virtual void setStateDefaults() override {}
61+
virtual void setStateDefaults() override;
6262

63-
OUTPUT_PORT(0, Output, Matrix);
63+
OUTPUT_PORT(0, Output, String);
6464

6565
static const Dataflow::Networks::ModuleLookupInfo staticInfo_;
6666
};

src/Modules/Basic/ReceiveScalar.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ ReceiveScalarModule::ReceiveScalarModule()
4646
INITIALIZE_PORT(Input);
4747
}
4848

49+
void ReceiveScalarModule::setStateDefaults()
50+
{
51+
get_state()->setValue(ReceivedValue, 0.0);
52+
}
53+
4954
void ReceiveScalarModule::execute()
5055
{
5156
auto doubleData = getRequiredInput(Input);

0 commit comments

Comments
 (0)