コード例 #1
0
ファイル: Simulator.py プロジェクト: eyyi/BuildingsPy
 def _check_simulation_errors(self, worDir):
     ''' Method that checks if errors occured during simulation.
     '''
     import os
     from buildingspy.io.outputfile import get_errors_and_warnings
     path_to_logfile = os.path.join(worDir, 'simulator.log')
     ret = get_errors_and_warnings(path_to_logfile, 'dymola')
     if not ret["errors"]:
         pass
     else:
         for li in ret["errors"]:
             self._reporter.writeError(li)
         raise IOError
コード例 #2
0
 def _check_simulation_errors(self, worDir):
     ''' Method that checks if errors occured during simulation.
     '''
     import os
     from buildingspy.io.outputfile import get_errors_and_warnings
     path_to_logfile = os.path.join(worDir, 'simulator.log')
     ret = get_errors_and_warnings(path_to_logfile, 'dymola')
     if not ret["errors"]:
         pass
     else:
         for li in ret["errors"]:
             self._reporter.writeError(li)
         raise IOError
コード例 #3
0
ファイル: Dymola.py プロジェクト: khinkelman/BuildingsPy
 def _check_simulation_errors(self, worDir):
     """ Method that checks if errors occured during simulation.
     """
     import os
     from buildingspy.io.outputfile import get_errors_and_warnings
     path_to_logfile = os.path.join(worDir, 'simulator.log')
     # `simulator.log` may not exist in case of process timeout.
     if os.path.exists(path_to_logfile):
         ret = get_errors_and_warnings(path_to_logfile, 'dymola')
         if not ret["errors"]:
             pass
         else:
             for li in ret["errors"]:
                 self._reporter.writeError(li)
             raise Exception(
                 f"Simulation terminated with error. Check {path_to_logfile}."
             )
     else:
         em = f"Log file {path_to_logfile} does not exist."
         self._reporter.writeError(em)
         raise IOError(em)