コード例 #1
0
ファイル: scan_tab.py プロジェクト: roderickmackenzie/gpvdm
	def simulate(self,run_simulation,generate_simulations,args):

		base_dir=os.getcwd()
		run=True

		if self.tab.rowCount() == 0:
			error_dlg(self,_("You have not selected any parameters to scan through.  Use the add button."))
			return


		if self.sim_name=="":
			error_dlg(self,_("No sim dir name"))
			return

		self.make_sim_dir()
		if generate_simulations==True:
			scan_clean_dir(self,self.sim_dir)

		print("Running")
		program_list=[]
		for i in range(0,self.tab.rowCount()):
			program_list.append([tab_get_value(self.tab,i,0),tab_get_value(self.tab,i,1),tab_get_value(self.tab,i,3),tab_get_value(self.tab,i,4)])

		print(program_list)
		tree_load_config(self.sim_dir)
		if generate_simulations==True:
			flat_simulation_list=[]
			if tree_gen(flat_simulation_list,program_list,base_dir,self.sim_dir)==False:
				error_dlg(self,_("Problem generating tree."))
				return

			print("flat list",flat_simulation_list)
			tree_save_flat_list(self.sim_dir,flat_simulation_list)

		commands=tree_load_flat_list(self.sim_dir)
		print("loaded commands",commands)
		if run_simulation==True:
			self.send_commands_to_server(commands,args)

		self.save_combo()
		os.chdir(base_dir)
		gc.collect()
コード例 #2
0
 def scan_clean_simulation_output(self):
     scan_clean_dir(self.sim_dir, parent_window=self)
コード例 #3
0
 def clean_scan_dir(self):
     scan_clean_dir(self.sim_dir, parent_window=self)
コード例 #4
0
ファイル: scan_tab.py プロジェクト: roderickmackenzie/opvdm
	def simulate(self,run_simulation,generate_simulations):

		base_dir=os.getcwd()
		run=True

		if len(self.liststore_combobox) == 0:
			message = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK)
			message.set_markup(_("You have not selected any parameters to scan through.  Use the add button."))
			message.run()
			message.destroy()
			return


		if self.sim_name=="":
			message = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK)
			message.set_markup(_("No sim dir name"))
			message.run()
			message.destroy()
			return

		self.make_sim_dir()
		if generate_simulations==True:
			scan_clean_dir(self.sim_dir)


		for i in range(0,len(self.liststore_combobox)):
			found=False
			for ii in range(0,len(self.liststore_op_type)):
				if self.liststore_combobox[i][2]==self.liststore_op_type[ii][0]:
					found=True
			if found==False:
				run=False

				md = gtk.MessageDialog(None, 
				0, gtk.MESSAGE_ERROR, 
				gtk.BUTTONS_CLOSE, self.liststore_combobox[i][2]+"Not valid")
				md.run()
				md.destroy()
				break



		if run==True:
			print "Running"
			program_list=[]
			for i in range(0,len(self.liststore_combobox)):
				program_list.append([self.liststore_combobox[i][0],self.liststore_combobox[i][1],self.liststore_combobox[i][2],self.liststore_combobox[i][3]])

			print program_list

			if generate_simulations==True:
				flat_simulation_list=[]
				tree_gen(flat_simulation_list,program_list,base_dir,self.sim_dir)
				print "flat list",flat_simulation_list
				tree_save_flat_list(self.sim_dir,flat_simulation_list)

			commands=[]
			server_find_simulations_to_run(commands,self.sim_dir)

			if run_simulation==True:
				self.send_commands_to_server(commands)

		self.save_combo()
		os.chdir(base_dir)
		gc.collect()
コード例 #5
0
ファイル: scan_tab.py プロジェクト: roderickmackenzie/opvdm
	def clean_scan_dir(self):
		scan_clean_dir(self.sim_dir)