OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000824OMNeT++simulation kernelpublic2015-04-25 14:432015-04-25 14:43
woife 
 
normalminoralways
newopen 
x86_64LinuxKubuntu 14.10
4.6 
 
0000824: Error in prefix conversion for @unit parameters
Having a parameter with @unit(ns) and assigning a value of 100us leads to an incorrect value of 99999ns.

Example:

Testmodule.ned:

simple TestModule
{
    int Interval @unit(ns) = default(100us);
}

Testmodule.cc:

#include "TestModule.h"

Define_Module(TestModule);

void TestModule::initialize()
{
    cPar& p = par("Interval");
    ev << "parameter: " << p.getName() << "\n";
    ev << " type:" << cPar::getTypeName(p.getType()) << "\n";
    ev << " contains:" << p.str() << "\n";
}

void TestModule::handleMessage(cMessage *msg)
{
}

OMNeT output:

** Initializing network
Initializing module TestSimulation, stage 0
TestSimulation.testModule: Initializing module TestSimulation.testModule, stage 0
TestSimulation.testModule: parameter: Interval
TestSimulation.testModule: type:long
TestSimulation.testModule: contains:99999


No tags attached.
Issue History
2015-04-25 14:43woifeNew Issue
2015-10-12 09:28ammmar1988Issue cloned: 0000850

There are no notes attached to this issue.