Ejemplo n.º 1
0
	def save_data(self):
		file_name="fxmesh"+str(self.index)+".inp"
		scan_remove_file(file_name)

		out_text=[]
		out_text.append("#fx_start")
		out_text.append(str(float(self.fx_start)))
		out_text.append("#fx_segments")
		out_text.append(str(self.tab.rowCount()))

		for i in range(0,self.tab.rowCount()):
			out_text.append("#fx_segment"+str(i)+"_len")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" period"),1)
			out_text.append(str(tab_get_value(self.tab,i, 0)))

			out_text.append("#fx_segment"+str(i)+"_dfx")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" dfx"),1)
			out_text.append(str(tab_get_value(self.tab,i, 1)))

			out_text.append("#fx_segment"+str(i)+"_mul")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" mul"),1)
			out_text.append(str(tab_get_value(self.tab,i, 2)))


		out_text.append("#ver")
		out_text.append("1.0")
		out_text.append("#end")

		inp_write_lines_to_file(os.path.join(os.getcwd(),file_name),out_text)
		self.update_scan_tokens()
Ejemplo n.º 2
0
	def save_data(self):
		file_name="fxmesh"+str(self.index)+".inp"
		scan_remove_file(file_name)

		out_text=[]
		out_text.append("#fx_start")
		out_text.append(str(float(self.fx_start)))
		out_text.append("#fx_segments")
		out_text.append(str(int(len(self.store))))
		i=0
		for line in self.store:
			out_text.append("#fx_segment"+str(i)+"_len")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" period"),1)
			out_text.append(str(line[SEG_LENGTH]))

			out_text.append("#fx_segment"+str(i)+"_dfx")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" dfx"),1)
			out_text.append(str(line[SEG_DFX]))

			out_text.append("#fx_segment"+str(i)+"_mul")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" mul"),1)
			out_text.append(str(line[SEG_MUL]))
			i=i+1

		out_text.append("#ver")
		out_text.append("1.0")
		out_text.append("#end")
		
		inp_write_lines_to_file(os.path.join(os.getcwd(),file_name),out_text)
		self.update_scan_tokens()
Ejemplo n.º 3
0
def epitaxy_save():
	global layers
	global electrical_layers
	global width
	global mat_file
	global electrical_layer
	global pl_file
	global name

	#dos_text=""
	lines=[]
	lines.append("#layers")
	lines.append(str(layers))

	layer=0
	for i in range(0,layers):
		lines.append("#layer_name"+str(layer))
		lines.append(str(name[i]))
		lines.append("#layer_width"+str(layer))
		lines.append(str(width[i]))
		lines.append("#layer_material_file"+str(layer))
		lines.append(mat_file[i])
		lines.append("#layer_dos_file"+str(layer))
		lines.append(electrical_layer[i])
		lines.append("#layer_pl_file"+str(layer))
		lines.append(pl_file[i])
		layer=layer+1

	lines.append("#ver")
	lines.append("1.3")
	lines.append("#end")

	inp_write_lines_to_file(os.path.join(os.getcwd(),"epitaxy.inp"),lines)
Ejemplo n.º 4
0
	def update(self,window,name):
		global wlist
		pos=-1
		x,y=window.get_position()

		for i in range(0,len(wlist)):
			if wlist[i].name==name:
				pos=i
				wlist[i].x=x
				wlist[i].y=y
				break

		if pos==-1:
			a=window_item()
			a.name=name
			a.x=x
			a.y=y
			wlist.append(a)
			pos=len(wlist)-1


		lines=[]
		lines.append(str(len(wlist)))

		for i in range(0,len(wlist)):
			lines.append(wlist[i].name)
			lines.append(str(wlist[i].x))
			lines.append(str(wlist[i].y))

		inp_write_lines_to_file("window_list.inp",lines)
Ejemplo n.º 5
0
	def callback_edit(self,data):
		lines=[]
		lines.append("#entry0")
		lines.append(self.entry0.get_active_text())
		lines.append("#entry1")
		lines.append(self.entry1.get_active_text())
		lines.append("#entry2")
		lines.append(self.entry2.get_text())
		lines.append("#entry3")
		lines.append(self.entry3.get_text())
		inp_write_lines_to_file("gui_cmp_config.inp",lines)
		self.plot.gen_colors(2)
		self.count_dumps()
	def save_model(self):
		lines=[]
		lines.append("#mesh_layers")
		lines.append(str(len(self.mesh_model)))
		i=0
		for item in self.mesh_model:
			lines.append("#mesh_layer_length"+str(i))
			lines.append(item[MESH_THICKNES])
			lines.append("#mesh_layer_points"+str(i))
			lines.append(item[MESH_POINTS])
			i=i+1
		lines.append("#ver")			
		lines.append("1.0")			
		lines.append("#end")			
		inp_write_lines_to_file(os.path.join(os.getcwd(),"mesh.inp"),lines)
Ejemplo n.º 7
0
	def save_data(self):
		file_name="time_mesh_config"+str(self.index)+".inp"
		scan_remove_file(file_name)

		out_text=[]
		out_text.append("#start_time")
		out_text.append(str(float(self.start_time)))
		out_text.append("#fs_laser_time")
		out_text.append(str(float(self.fs_laser_time)))
		out_text.append("#time_segments")
		out_text.append(str(int(len(self.store))))
		i=0
		for line in self.store:
			out_text.append("#time_segment"+str(i)+"_len")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" period"),1)
			out_text.append(str(line[SEG_LENGTH]))

			out_text.append("#time_segment"+str(i)+"_dt")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" dt"),1)
			out_text.append(str(line[SEG_DT]))

			out_text.append("#time_segment"+str(i)+"_voltage_start")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" start voltage"),1)
			out_text.append(str(line[SEG_VOLTAGE_START]))

			out_text.append("#time_segment"+str(i)+"_voltage_stop")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" stop voltage"),1)
			out_text.append(str(line[SEG_VOLTAGE_STOP]))

			out_text.append("#time_segment"+str(i)+"_mul")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" mul"),1)
			out_text.append(str(line[SEG_MUL]))

			out_text.append("#time_segment"+str(i)+"_sun")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" sun"),1)
			out_text.append(str(line[SEG_SUN]))

			out_text.append("#time_segment"+str(i)+"_laser")
			scan_item_add(file_name,out_text[len(out_text)-1],_("Part ")+str(i)+_(" laser"),1)
			out_text.append(str(line[SEG_LASER]))
			i=i+1

		out_text.append("#ver")
		out_text.append("1.1")
		out_text.append("#end")
		
		inp_write_lines_to_file(os.path.join(os.getcwd(),file_name),out_text)
		self.update_scan_tokens()
Ejemplo n.º 8
0
def mesh_save(file_name,my_list):
	lines=[]
	lines.append("#mesh_layers")
	lines.append(str(len(my_list)))
	i=0
	for item in my_list:
		lines.append("#mesh_layer_length"+str(i))
		lines.append(str(item.thick))
		lines.append("#mesh_layer_points"+str(i))
		lines.append(str(item.points))
		i=i+1
	lines.append("#ver")
	lines.append("1.0")
	lines.append("#end")
	print(file_name,lines)
	inp_write_lines_to_file(os.path.join(os.getcwd(),file_name),lines)
Ejemplo n.º 9
0
	def save(self):
		lines=[]
		for i in range(0,self.tab.rowCount()):
			lines.append("#function_"+str(i))
			lines.append(tab_get_value(self.tab,i, 0))
			lines.append("#function_enable_"+str(i))
			lines.append(tab_get_value(self.tab,i, 1))
			lines.append("#function_a_"+str(i))
			lines.append(tab_get_value(self.tab,i, 2))
			lines.append("#function_b_"+str(i))
			lines.append(tab_get_value(self.tab,i, 3))
			lines.append("#function_c_"+str(i))
			lines.append(tab_get_value(self.tab,i, 4))
		lines.append("#ver")
		lines.append("#1.0")
		lines.append("#end")
		inp_write_lines_to_file(self.file_name,lines)
Ejemplo n.º 10
0
	def save_data(self):
		file_name="time_mesh_config"+str(self.index)+".inp"
		scan_remove_file(file_name)

		out_text=[]
		out_text.append("#start_time")
		out_text.append(str(float(self.start_time)))
		out_text.append("#fs_laser_time")
		out_text.append(str(float(self.fs_laser_time)))
		out_text.append("#time_segments")
		out_text.append(str(self.tab.rowCount()))

		for i in range(0,self.tab.rowCount()):
			out_text.append("#time_segment"+str(i)+"_len")
			out_text.append(str(tab_get_value(self.tab,i, 0)))

			out_text.append("#time_segment"+str(i)+"_dt")
			out_text.append(str(tab_get_value(self.tab,i, 1)))

			out_text.append("#time_segment"+str(i)+"_voltage_start")
			out_text.append(str(tab_get_value(self.tab,i, 2)))

			out_text.append("#time_segment"+str(i)+"_voltage_stop")
			out_text.append(str(tab_get_value(self.tab,i, 3)))

			out_text.append("#time_segment"+str(i)+"_mul")
			out_text.append(str(tab_get_value(self.tab,i, 4)))

			out_text.append("#time_segment"+str(i)+"_sun")
			out_text.append(str(tab_get_value(self.tab,i, 5)))

			out_text.append("#time_segment"+str(i)+"_laser")
			out_text.append(str(tab_get_value(self.tab,i, 6)))

		out_text.append("#ver")
		out_text.append("1.1")
		out_text.append("#end")

		inp_write_lines_to_file(os.path.join(os.getcwd(),file_name),out_text)
		self.update_scan_tokens()
Ejemplo n.º 11
0
	def save_model(self, ):
		lines=[]
		function=0
		for item in self.LUMO_model:
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function))
			lines.append(item[LUMO_FUNCTION])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_enable")
			lines.append(item[LUMO_ENABLE])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_a")
			lines.append(item[LUMO_A])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_b")
			lines.append(item[LUMO_B])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_c")
			lines.append(item[LUMO_C])
			function=function+1
		lines.append("#ver")
		lines.append("#1.0")
		lines.append("#end")
		inp_write_lines_to_file("./lumo0.inp",lines)

		lines=[]
		function=0
		for item in self.HOMO_model:
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function))
			lines.append(item[HOMO_FUNCTION])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_enable")
			lines.append(item[HOMO_ENABLE])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_a")
			lines.append(item[HOMO_A])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_b")
			lines.append(item[HOMO_B])
			lines.append("#function_"+item[HOMO_FUNCTION]+str(function)+"_c")
			lines.append(item[HOMO_C])
			function=function+1
		lines.append("#ver")
		lines.append("#1.0")		
		lines.append("#end")			
		inp_write_lines_to_file("./homo0.inp",lines)
Ejemplo n.º 12
0
def contacts_save():
	global store
	lines=[]
	lines.append("#contacts")
	lines.append(str(len(store)))
	i=0
	for s in store:
		lines.append("#contact_start"+str(i))
		lines.append(str(s.start))
		lines.append("#contact_width"+str(i))
		lines.append(str(s.width))
		lines.append("#contact_depth"+str(i))
		lines.append(str(s.depth))
		lines.append("#contact_voltage"+str(i))
		lines.append(str(s.voltage))
		lines.append("#contact_active"+str(i))
		lines.append(str(s.active))
		i=i+1
	lines.append("#ver")
	lines.append("1.0")
	lines.append("#end")
	
	inp_write_lines_to_file(os.path.join(os.getcwd(),"contacts.inp"),lines)