LPCManager.py
changeset 57 4b838bdedc16
parent 55 0be064739434
child 58 96741ddb78c0
equal deleted inserted replaced
56:a4bc15ac7998 57:4b838bdedc16
  1004 
  1004 
  1005     def _Simulate(self):
  1005     def _Simulate(self):
  1006         """
  1006         """
  1007         Method called by user to Simulate PLC
  1007         Method called by user to Simulate PLC
  1008         """
  1008         """
  1009         self.CurrentMode = SIMULATION_MODE
       
  1010         
       
  1011         uri = "LOCAL://"
  1009         uri = "LOCAL://"
  1012         try:
  1010         try:
  1013             self._SetConnector(connectors.ConnectorFactory(uri, self))
  1011             self._SetConnector(connectors.ConnectorFactory(uri, self))
  1014         except Exception, msg:
  1012         except Exception, msg:
  1015             self.logger.write_error(_("Exception while connecting %s!\n")%uri)
  1013             self.logger.write_error(_("Exception while connecting %s!\n")%uri)
  1019         if self._connector is None:
  1017         if self._connector is None:
  1020             # Oups.
  1018             # Oups.
  1021             self.logger.write_error(_("Connection failed to %s!\n")%uri)
  1019             self.logger.write_error(_("Connection failed to %s!\n")%uri)
  1022             self.StopSimulation()
  1020             self.StopSimulation()
  1023             return False
  1021             return False
       
  1022         
       
  1023         self.CurrentMode = SIMULATION_MODE
  1024         
  1024         
  1025         buildpath = self._getBuildPath()
  1025         buildpath = self._getBuildPath()
  1026         
  1026         
  1027         # Eventually create build dir
  1027         # Eventually create build dir
  1028         if not os.path.exists(buildpath):
  1028         if not os.path.exists(buildpath):