Esempio n. 1
0
 public override void Initialize()
 {
     initializeTwisterPositions();
     try
     {
         TwisterClsServer = new clsServer();
         string iniFile = TwisterClsServer.ApplicationPath + "\\" + InitiationFile;//"Twister.ini";//hope this is right one
         TwisterClsServer.ConfigureRobot(iniFile, ref SimulationMode);
         TwisterClsServer.Initialize();
         //THE TWISTER SERVE MUST BE INITIALIZED BEFORE IT WILL GIVE A ROBOT REF PROPERLY
         RobotServ = TwisterClsServer.GetRobotRef();//this line must follow the server initialization
         RobotServ.HomeAllAxes();
         //BIG ERROR IF NOT FOLLOWED!!!!
         short windowState = 1;//0 normal, 1 minimized, 2 maximized
         TwisterClsServer.ShowWindow(ref windowState);
         RobotServ.SpeedAsPercentMax = (short)50;
         StatusOK = true;
     }
     catch(Exception thrown)
     {
          StatusOK = false;
          throw new InstrumentError("Could not initialize Twister: "+thrown.Message, false, this);
     }
 }