diff options
author | pravindalve | 2020-08-11 19:08:57 +0530 |
---|---|---|
committer | GitHub | 2020-08-11 19:08:57 +0530 |
commit | b31cf75d9362412e755fce76f61d73eab1e7da14 (patch) | |
tree | 0ab99a88893f8b0a7c18138c0eec0c806654cf1a /OMChem/Flowsheet.py | |
parent | d3bed1ef7150f8e493ebaed3b841b1fe781e974d (diff) | |
parent | 4cffaf3d0d29ee1f2d31601dd1571c7de40a8c5f (diff) | |
download | Chemical-Simulator-GUI-b31cf75d9362412e755fce76f61d73eab1e7da14.tar.gz Chemical-Simulator-GUI-b31cf75d9362412e755fce76f61d73eab1e7da14.tar.bz2 Chemical-Simulator-GUI-b31cf75d9362412e755fce76f61d73eab1e7da14.zip |
Merge pull request #4 from pravindalve/master
Updates and Bug Fixes
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): |