FW, in case people on OpenModelicainterest are also interested.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Adeel Asghar
Sent: den 30 november 2011 21:55
To: [email protected]; [email protected]
Subject: RE: OMCProxy

Hi,

Yes it is very much possible. All you need to do is re-initialize the mOMC 
object with the new IOR.

----------------------------
char buf[1024];
objectRefFile.readLine( buf, sizeof(buf) );
QString uri( (const char*)buf );
CORBA::Object_var obj = orb->string_to_object(uri.trimmed().toLocal8Bit());
mOMC = OmcCommunication::_narrow(obj);
----------------------------


-          Read the new IOR file and create the CORBA object from it.

However, few things that you need to makesure here.

-          You must kill the old server otherwise you have a lot of servers 
running doing nothing.

-          Your new server scope is empty. For example, if old has done 
loadModel(Modelica) then new one doesn't have it automatically and it can lead 
to unknown errors.

-          May be more problems (We never tried such thing).

There is no refresh function.

Regards,
Adeel.

From: [email protected] [mailto:[email protected]] On 
Behalf Of [email protected]
Sent: den 30 november 2011 21:01
To: [email protected]
Subject: OMCProxy

Hello

I'm looking to initialize my own OMC server from a hard coded IOR file. In the 
OMCProxy->startServer, it starts the OMC and sets the objectRefFile and this 
establishes the local server connection for the program. (please correct me if 
I'm anywhere wrong)

However I want it to start OMEdit from this startServer function and this 
function will connect to the local compiler, but later, i have a menu option 
(linked to another function) that will allow OMEdit to connect to a new IOR ID 
(or a new IOR file)... can I do this after the local server has started? Is 
there a refresh functions for the entire OMEdit so i can connect to my own 
process?

Thank you

_______________________________________
Peter (Dong Hao) Geng
Co-op Student

Reply via email to