Changeset 86


Ignore:
Timestamp:
10/21/05 15:17:58 (19 years ago)
Author:
remar
Message:
  • now starts a Modeq server if one doesn't exist at startup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt/src/org/modelica/mdt/corba/ModeqCommunicationImplementation.java

    r85 r86  
    1919    static boolean hasInitialized = false;
    2020   
     21    static String pathToModeq = "c:\\OpenModelica122\\modeq.exe";
     22   
    2123    public static void init(String args[]) throws Exception
    2224    {
     
    2729            File f = new File(fileName);
    2830            String stringifiedObjectReference = null;
    29             if(f.exists())
     31
     32            if(!f.exists())
    3033            {
    31                 FileReader fr = new FileReader(f);
    32                 BufferedReader br = new BufferedReader(fr);
     34                System.out.println("Starting modeq server.");
     35                String[] command = {pathToModeq, "+d=interactiveCorba"};
     36                Runtime.getRuntime().exec(command);
     37                while(!f.exists())
     38                {
     39                    Thread.sleep(100);
     40                }
     41            }
     42           
     43            FileReader fr = new FileReader(f);
     44            BufferedReader br = new BufferedReader(fr);
    3345               
    34                 stringifiedObjectReference = br.readLine();
    35             }
    36             else
    37             {
    38                 /* this is the ugly stuff, fix it */
    39                 System.out.println("Filen existerar ju inte!");
    40                 throw new Exception("Herrejävlar");
    41             }
     46            stringifiedObjectReference = br.readLine();
    4247           
    4348            orb = ORB.init(args, null);
     
    4752        catch(Exception e)
    4853        {
     54            e.printStackTrace();
     55            System.out.println(e.getMessage());
    4956            MdtPlugin.log(e);
    5057            throw new Exception("Unable to initialize communication with OMC");
Note: See TracChangeset for help on using the changeset viewer.