OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000098OMNeT++simulation kernelpublic2009-08-27 14:192010-05-26 19:59
rhornig 
andras 
normalminoralways
resolvedfixed 
4.0 
4.1rc1 
0000098: Assignment of a compound module parameter in a submodule does not assign the unit
I ran into some problems using the @unit property for integer
parameters of compound modules and was hoping for some feedback to
clear up my confusion or confirmation that there's something wrong.

Here are the important parts of the simple module definition:
simple SimpleApp {
   volatile int msgLength @unit(b) = default(1024b);
}

and of the compound module:
module StumpNode {
   parameters:
       volatile int pktLength @unit(b);
   submodules:
       app: SimpleApp{
           parameters:
               msgLength = pktLength;
       }
}

In omnetpp.ini I have:
**.pktLength = 2048b

Running the simulation yields the following error:
Error evaluating parameter `msgLength': Cannot convert unit none to
'b' (bit)

After some debugging, I found that if I change the following code:
cdynamicexpression.cc line 95:
case cPar::LONG: *this = par.doubleValue(); break;

to
case cPar::LONG: *this = par.doubleValue(); dblunit = par.getUnit();
break;

Then, it works as expected. Also, changing the compound module
parameter type to double fixes the problem.
No tags attached.
Issue History
2009-08-27 14:19rhornigNew Issue
2010-05-26 19:59andrasNote Added: 0000307
2010-05-26 19:59andrasStatusnew => resolved
2010-05-26 19:59andrasFixed in Version => 4.1rc1
2010-05-26 19:59andrasResolutionopen => fixed
2010-05-26 19:59andrasAssigned To => andras

Notes
(0000307)
andras   
2010-05-26 19:59   
Fixed as recommended in the description.