Skip to content

Commit 34a1db3

Browse files
committed
Expose renames
1 parent e890301 commit 34a1db3

File tree

9 files changed

+28
-7
lines changed

9 files changed

+28
-7
lines changed

src/Dataflow/Network/Module.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,6 @@ void Module::sendFeedbackUpstreamAlongIncomingConnections(const ModuleFeedback&
968968
std::string Module::helpPageUrl() const
969969
{
970970
auto url = "http://scirundocwiki.sci.utah.edu/SCIRunDocs/index.php/CIBC:Documentation:SCIRun:Reference:"
971-
+ legacyPackageName() + ":" + get_module_name();
971+
+ legacyPackageName() + ":" + legacyModuleName();
972972
return url;
973973
}

src/Dataflow/Network/Module.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ namespace Networks {
8282
virtual size_t num_input_ports() const override final;
8383
virtual size_t num_output_ports() const override final;
8484

85+
// override this for modules that changed packages, to point to correct wiki page
86+
virtual std::string legacyPackageName() const { return get_packagename(); }
87+
// override this for modules that changed names, to point to correct wiki page
88+
virtual std::string legacyModuleName() const { return get_module_name(); }
89+
8590
virtual bool hasInputPort(const PortId& id) const override final;
8691
virtual bool hasOutputPort(const PortId& id) const override final;
8792
virtual InputPortHandle getInputPort(const PortId& id) override final;
@@ -113,9 +118,6 @@ namespace Networks {
113118
protected:
114119
virtual void send_output_handle(const PortId& id, Core::Datatypes::DatatypeHandle data) override final;
115120

116-
// override this for modules that changed packages, to point to correct wiki page
117-
virtual std::string legacyPackageName() const { return get_packagename(); }
118-
119121
public:
120122
virtual void setLogger(Core::Logging::LoggerHandle log) override final;
121123
virtual Core::Logging::LoggerHandle getLogger() const override final;
@@ -1017,7 +1019,10 @@ namespace Modules
10171019
}
10181020
};
10191021

1020-
#define LEGACY_BIOPSE_MODULE protected: virtual std::string legacyPackageName() const override { return "BioPSE"; }
1022+
#define LEGACY_BIOPSE_MODULE public: virtual std::string legacyPackageName() const override { return "BioPSE"; }
1023+
#define LEGACY_MATLAB_MODULE public: virtual std::string legacyPackageName() const override { return "MatlabInterface"; }
1024+
#define CONVERTED_VERSION_OF_MODULE(modName) public: virtual std::string legacyModuleName() const override { return #modName; }
1025+
10211026
}
10221027
}
10231028

src/Dataflow/Network/ModuleInterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ namespace Networks {
8080
virtual bool hasDynamicPorts() const = 0;
8181

8282
virtual std::string helpPageUrl() const = 0;
83+
virtual std::string legacyPackageName() const = 0;
84+
virtual std::string legacyModuleName() const = 0;
8385
};
8486

8587
class SCISHARE ModuleDisplayInterface

src/Dataflow/Network/Tests/MockModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ namespace SCIRun {
9191
MOCK_METHOD1(connectExecuteSelfRequest, boost::signals2::connection(const ExecutionSelfRequestSignalType::slot_type&));
9292
MOCK_METHOD1(setExecutionDisabled, void(bool));
9393
MOCK_CONST_METHOD0(executionDisabled, bool(void));
94+
MOCK_CONST_METHOD0(legacyPackageName, std::string());
95+
MOCK_CONST_METHOD0(legacyModuleName, std::string());
9496
};
9597

9698
typedef boost::shared_ptr<MockModule> MockModulePtr;

src/Interface/Application/ModuleWidget.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ ModuleWidget::ModuleWidget(NetworkEditor* ed, const QString& name, ModuleHandle
329329
connect(this, SIGNAL(executeEnds()), this, SLOT(changeExecuteButtonToPlay()));
330330
connect(this, SIGNAL(signalExecuteButtonIconChangeToStop()), this, SLOT(changeExecuteButtonToStop()));
331331
//qDebug() << width() << height() << currentWidget()->size();
332+
333+
auto oldName = theModule->legacyModuleName();
334+
if (theModule->get_module_name() != oldName)
335+
setToolTip("Converted version of module " + QString::fromStdString(oldName));
332336
}
333337

334338
int ModuleWidget::buildDisplay(ModuleWidgetDisplayBase* display, const QString& name)

src/Modules/Legacy/Converters/ConvertMatrixToString.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#include <Core/Algorithms/Legacy/Converter/ConvertMatrixToString.h>
3131

3232
#include <Core/Datatypes/Matrix.h>
33-
#include <Core/Datatypes/MatrixFwd.h>
3433
#include <Core/Datatypes/DenseMatrix.h>
34+
// ReSharper disable once CppUnusedIncludeDirective
3535
#include <Core/Datatypes/String.h>
3636
#include <Core/Datatypes/DatatypeFwd.h>
3737
#include <Core/Datatypes/MatrixTypeConversions.h>
@@ -45,7 +45,7 @@ using namespace SCIRun::Core::Datatypes;
4545
using namespace SCIRun::Modules::Converters;
4646

4747

48-
ConvertMatrixToString::ConvertMatrixToString() : Module(ModuleLookupInfo("ConvertMatrixToString","Converters","BioPSE"),false)
48+
ConvertMatrixToString::ConvertMatrixToString() : Module(ModuleLookupInfo("ConvertMatrixToString","Converters","SCIRun"),false)
4949
{
5050
INITIALIZE_PORT(InputMatrix);
5151
INITIALIZE_PORT(ResultString);

src/Modules/Legacy/Matlab/DataIO/ExportFieldsToMatlab.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ namespace Matlab {
6262
virtual bool hasDynamicPorts() const override { return true; }
6363

6464
static const Dataflow::Networks::ModuleLookupInfo staticInfo_;
65+
66+
LEGACY_MATLAB_MODULE
6567
};
6668
}}}
6769

src/Modules/Legacy/Matlab/DataIO/ImportFieldsFromMatlab.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ namespace Matlab {
6767
enum { NUMPORTS = 6 };
6868

6969
static const Dataflow::Networks::ModuleLookupInfo staticInfo_;
70+
71+
LEGACY_MATLAB_MODULE
72+
7073
protected:
7174
virtual void postStateChangeInternalSignalHookup() override;
7275
private:

src/Modules/Math/GetMatrixSlice.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ namespace Math {
4040
public Has2InputPorts<MatrixPortTag, ScalarPortTag>,
4141
public Has2OutputPorts<MatrixPortTag, ScalarPortTag>
4242
{
43+
CONVERTED_VERSION_OF_MODULE(GetColumnOrRowFromMatrix)
44+
4345
public:
4446
GetMatrixSlice();
4547
virtual void execute();
@@ -50,6 +52,7 @@ namespace Math {
5052
OUTPUT_PORT(1, Selected_Index, Int32);
5153

5254
static const Dataflow::Networks::ModuleLookupInfo staticInfo_;
55+
5356
private:
5457
bool playing_;
5558
void playAgain(int nextIndex);

0 commit comments

Comments
 (0)