diff options
Diffstat (limited to 'OMChem/Flowsheet.py')
-rw-r--r-- | OMChem/Flowsheet.py | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/OMChem/Flowsheet.py b/OMChem/Flowsheet.py index ab271af..ab4d729 100644 --- a/OMChem/Flowsheet.py +++ b/OMChem/Flowsheet.py @@ -57,26 +57,21 @@ class Flowsheet(): self.process = Popen([self.omc_path, '-s',simpath], stdout=PIPE, stderr=PIPE) self.stdout, self.stderr = self.process.communicate() - #s = subprocess.check_output([self.omc_path, '-s',simpath]) - #print(s) - #print("############### StdOut ################") - print(self.stdout) + os.chdir(self.root_dir) - #os.system(self.omc_path + ' -s ' + simpath) - print("Hello") - if self.sim_method == 'Eqn': - print("hhhh") - csvpath = os.path.join(self.sim_dir_path,'Flowsheet_res.csv') - print("csvPath",csvpath) - with open (csvpath,'r') as resultFile: + if ('timeSimulation = 0.0,\n' in self.stdout.decode("utf-8")): self.result_data = [] - print("opened") - csvreader = csv.reader(resultFile,delimiter=',') - for row in csvreader: - print("124125") - self.result_data.append(row) - print(self.result_data) - #self.ext_data() + else: + csvpath = os.path.join(self.sim_dir_path,'Flowsheet_res.csv') + print("csvPath",csvpath) + with open (csvpath,'r') as resultFile: + self.result_data = [] + print("opened") + csvreader = csv.reader(resultFile,delimiter=',') + for row in csvreader: + print("in reading csvreader") + self.result_data.append(row) + print(self.result_data) def send_for_simulation_SM(self,unitop): |