Skip to content

Commit 109b49f

Browse files
committed
Closes #56
1 parent 760fad2 commit 109b49f

File tree

4 files changed

+110
-12
lines changed

4 files changed

+110
-12
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<!DOCTYPE boost_serialization>
3+
<boost_serialization signature="serialization::archive" version="12">
4+
<networkFile class_id="0" tracking_level="0" version="3">
5+
<networkInfo class_id="1" tracking_level="0" version="0">
6+
<modules class_id="2" tracking_level="0" version="0">
7+
<count>2</count>
8+
<item_version>0</item_version>
9+
<item class_id="3" tracking_level="0" version="0">
10+
<first>ReceiveComplexMatrix:0</first>
11+
<second class_id="4" tracking_level="0" version="0">
12+
<module class_id="5" tracking_level="0" version="0">
13+
<package_name_>SCIRun</package_name_>
14+
<category_name_>Math</category_name_>
15+
<module_name_>ReceiveComplexMatrix</module_name_>
16+
</module>
17+
<state class_id="6" tracking_level="0" version="0">
18+
<stateMap class_id="7" tracking_level="0" version="0">
19+
<count>0</count>
20+
<item_version>0</item_version>
21+
</stateMap>
22+
</state>
23+
</second>
24+
</item>
25+
<item>
26+
<first>SendComplexMatrix:0</first>
27+
<second>
28+
<module>
29+
<package_name_>SCIRun</package_name_>
30+
<category_name_>Math</category_name_>
31+
<module_name_>SendComplexMatrix</module_name_>
32+
</module>
33+
<state>
34+
<stateMap>
35+
<count>0</count>
36+
<item_version>0</item_version>
37+
</stateMap>
38+
</state>
39+
</second>
40+
</item>
41+
</modules>
42+
<connections class_id="8" tracking_level="0" version="0">
43+
<count>1</count>
44+
<item_version>0</item_version>
45+
<item class_id="9" tracking_level="0" version="0">
46+
<moduleId1_>SendComplexMatrix:0</moduleId1_>
47+
<port1_ class_id="10" tracking_level="0" version="0">
48+
<name>Scalar</name>
49+
<id>0</id>
50+
</port1_>
51+
<moduleId2_>ReceiveComplexMatrix:0</moduleId2_>
52+
<port2_>
53+
<name>Input</name>
54+
<id>0</id>
55+
</port2_>
56+
</item>
57+
</connections>
58+
</networkInfo>
59+
<modulePositions class_id="11" tracking_level="0" version="0">
60+
<count>2</count>
61+
<item_version>0</item_version>
62+
<item class_id="12" tracking_level="0" version="0">
63+
<first>ReceiveComplexMatrix:0</first>
64+
<second class_id="13" tracking_level="0" version="0">
65+
<first>4.90000000000000000e+01</first>
66+
<second>3.50000000000000000e+00</second>
67+
</second>
68+
</item>
69+
<item>
70+
<first>SendComplexMatrix:0</first>
71+
<second>
72+
<first>-7.60000000000000000e+01</first>
73+
<second>-1.52000000000000000e+02</second>
74+
</second>
75+
</item>
76+
</modulePositions>
77+
<moduleNotes class_id="14" tracking_level="0" version="0">
78+
<count>0</count>
79+
<item_version>0</item_version>
80+
</moduleNotes>
81+
<connectionNotes>
82+
<count>0</count>
83+
<item_version>0</item_version>
84+
</connectionNotes>
85+
<moduleTags class_id="15" tracking_level="0" version="0">
86+
<count>2</count>
87+
<item_version>0</item_version>
88+
<item class_id="16" tracking_level="0" version="0">
89+
<first>ReceiveComplexMatrix:0</first>
90+
<second>0</second>
91+
</item>
92+
<item>
93+
<first>SendComplexMatrix:0</first>
94+
<second>0</second>
95+
</item>
96+
</moduleTags>
97+
</networkFile>
98+
</boost_serialization>
99+

src/Modules/Basic/ReceiveComplexScalar.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ using namespace SCIRun::Core::Datatypes;
3838
using namespace SCIRun::Core::Algorithms;
3939

4040
ReceiveComplexScalarModule::ReceiveComplexScalarModule()
41-
: Module(ModuleLookupInfo("ReceiveComplexScalar", "Math", "SCIRun"), false),
41+
: Module(ModuleLookupInfo("ReceiveComplexMatrix", "Math", "SCIRun"), false),
4242
latestValue_(-1)
4343
{
4444
INITIALIZE_PORT(Input);
4545
}
4646

4747
void ReceiveComplexScalarModule::execute()
4848
{
49-
auto doubleData = getRequiredInput(Input);
50-
//latestValue_ = doubleData->value();
51-
//get_state()->setValue(ReceivedValue, latestValue_);
49+
auto complexData = getRequiredInput(Input);
50+
std::cout << *complexData << std::endl;
5251
}

src/Modules/Basic/SendComplexScalar.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace SCIRun::Core::Algorithms;
3838
using namespace SCIRun::Core::Logging;
3939

4040
SendComplexScalarModule::SendComplexScalarModule()
41-
: Module(ModuleLookupInfo("SendComplexScalar", "Math", "SCIRun"), false),
41+
: Module(ModuleLookupInfo("SendComplexMatrix", "Math", "SCIRun"), false),
4242
data_(-1)
4343
{
4444
INITIALIZE_PORT(Scalar);
@@ -48,13 +48,13 @@ void SendComplexScalarModule::execute()
4848
{
4949
if (needToExecute())
5050
{
51-
//data_ = get_state()->getValue(SendScalarModule::ValueToSend()).toDouble();
52-
//LOG_DEBUG("Executing SendScalar with new value: " << data_);
53-
//boost::shared_ptr<Double> output(new Double(data_));
54-
//sendOutput(Scalar, output);
51+
ComplexDenseMatrix c(2,2);
52+
c << Complex(1,2), Complex(3,4), Complex(-1,-2), Complex(-3,-4);
53+
auto output(boost::make_shared<ComplexDenseMatrix>(c));
54+
sendOutput(Scalar, output);
5555
}
5656
else
5757
{
58-
LOG_DEBUG("Executing SendScalar with old value, not sending anything: " << data_);
58+
LOG_DEBUG("Executing SendComplexMatrix with old value, not sending anything: " << data_);
5959
}
6060
}

src/Modules/Factory/ModuleFactoryImpl1.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ void ModuleDescriptionLookup::addTestingModules()
198198
{
199199
addModuleDesc<SendScalarModule>("SendScalar", "Testing", "SCIRun", "Functional, needs GUI and algorithm work.", "...");
200200
addModuleDesc<ReceiveScalarModule>("ReceiveScalar", "Testing", "SCIRun", "...", "...");
201-
addModuleDesc<SendComplexScalarModule>("SendComplexScalar", "Testing", "SCIRun", "...", "...");
202-
addModuleDesc<ReceiveComplexScalarModule>("ReceiveComplexScalar", "Testing", "SCIRun", "...", "...");
201+
addModuleDesc<SendComplexScalarModule>("SendComplexMatrix", "Testing", "SCIRun", "...", "...");
202+
addModuleDesc<ReceiveComplexScalarModule>("ReceiveComplexMatrix", "Testing", "SCIRun", "...", "...");
203203
addModuleDesc<SendTestMatrixModule>("SendTestMatrix", "Testing", "SCIRun", "...", "...");
204204
addModuleDesc<ReceiveTestMatrixModule>("ReceiveTestMatrix", "Testing", "SCIRun", "...", "...");
205205
addModuleDesc<DynamicPortTester>("DynamicPortTester", "Testing", "SCIRun", "...", "...");

0 commit comments

Comments
 (0)