hi,
I've got a problem sending floating point values to an corba server.
With other datatyes like short or string it works fine.
So having this idl file :
module Example{
interface User{
void setV( in float x );
};
interface Target{
void getV( out short x);
};
};
I just receive zero ( -2.58265845332e-05) by sending an float to
another client with the above interface.
the client :
*************** *************** *************** *************
import sys
from omniORB import CORBA
import _omnipy
import Example, CosNaming
orb = CORBA.ORB_init( sys.argv, CORBA.ORB_ID)
ior = sys.argv[1]
obj = orb.string_to_o bject(ior)
us = obj._narrow( Example.User )
if us is None:
print "blabla"
sys.exit(1)
us.setV( 5.0 )
*************** *************** *************** *************
the server :
*************** *************** *************** *************
import sys
from omniORB import CORBA, PortableServer
import CosNaming, Example, Example__POA
class User_i( Example__POA.Us er ):
def setV( self, x ):
print x
print type(x)
y = float(x)
print y
print type(y)
class Target_i( Example__POA.Ta rget ):
def getV( self ):
return 5
orb = CORBA.ORB_init( sys.argv, CORBA.ORB_ID)
poa = orb.resolve_ini tial_references ("RootPOA")
us = User_i()
tg = Target_i()
uo = us._this()
to = tg._this()
print orb.object_to_s tring(uo)
print
print orb.object_to_s tring(to)
poaManager = poa._get_the_PO AManager()
poaManager.acti vate()
orb.run()
*************** *************** *************** *************
does anyone have an answer to that kind of problem?
I mean, it just like sending short values, or strings.
I've got a problem sending floating point values to an corba server.
With other datatyes like short or string it works fine.
So having this idl file :
module Example{
interface User{
void setV( in float x );
};
interface Target{
void getV( out short x);
};
};
I just receive zero ( -2.58265845332e-05) by sending an float to
another client with the above interface.
the client :
*************** *************** *************** *************
import sys
from omniORB import CORBA
import _omnipy
import Example, CosNaming
orb = CORBA.ORB_init( sys.argv, CORBA.ORB_ID)
ior = sys.argv[1]
obj = orb.string_to_o bject(ior)
us = obj._narrow( Example.User )
if us is None:
print "blabla"
sys.exit(1)
us.setV( 5.0 )
*************** *************** *************** *************
the server :
*************** *************** *************** *************
import sys
from omniORB import CORBA, PortableServer
import CosNaming, Example, Example__POA
class User_i( Example__POA.Us er ):
def setV( self, x ):
print x
print type(x)
y = float(x)
print y
print type(y)
class Target_i( Example__POA.Ta rget ):
def getV( self ):
return 5
orb = CORBA.ORB_init( sys.argv, CORBA.ORB_ID)
poa = orb.resolve_ini tial_references ("RootPOA")
us = User_i()
tg = Target_i()
uo = us._this()
to = tg._this()
print orb.object_to_s tring(uo)
print orb.object_to_s tring(to)
poaManager = poa._get_the_PO AManager()
poaManager.acti vate()
orb.run()
*************** *************** *************** *************
does anyone have an answer to that kind of problem?
I mean, it just like sending short values, or strings.
Comment