Ejemplo n.º 1
0
def epitaxy_mesh_update():
    mesh = get_mesh().y
    if len(mesh.layers) == 1:
        tot = 0.0
        for i in range(0, epitaxy_get_layers()):
            width = float(epitaxy_get_dy(i))
            dos_layer = epitaxy_get_dos_file(i)
            print(dos_layer, width)
            if dos_layer.startswith("dos") == True:
                tot = tot + width

        mesh.layers[0].thick = tot
        mesh.save()
Ejemplo n.º 2
0
    def draw_box(self, qp, x, y, h, r, g, b, layer):

        text = ""
        w = 200
        qp.setBrush(QColor(r * 255, g * 255, b * 255))
        qp.drawRect(x, y, 200, h)

        if epitaxy_get_dos_file(layer).startswith("dos") == True:
            text = epitaxy_get_name(layer) + " (active)"
            qp.setBrush(QColor(0, 0, 0.7 * 255))
            qp.drawRect(x + w + 5, y, 20, h)
        else:
            text = epitaxy_get_name(layer)

        qp.drawText(x + 200 + 40, y + h / 2, text)

        return
Ejemplo n.º 3
0
    def save_data(self):
        print("save")
        pos = -1
        for i in range(0, self.tab.rowCount()):
            pos = self.epi.get_next_dos_layer(pos)
            dos_file = epitaxy_get_dos_file(pos) + ".inp"
            file_name = os.path.join(get_sim_path(), dos_file)

            inp_update_token_value(file_name, "#doping_start",
                                   self.tab.item(i, 2).text())
            inp_update_token_value(file_name, "#doping_stop",
                                   self.tab.item(i, 3).text())

            inp_update_token_value(file_name, "#ion_density",
                                   self.tab.item(i, 4).text())
            inp_update_token_value(file_name, "#ion_mobility",
                                   self.tab.item(i, 5).text())
Ejemplo n.º 4
0
    def load(self):
        self.tab.blockSignals(True)
        self.tab.clear()
        self.tab.setHorizontalHeaderLabels(
            [_("File Name"), _("Width"),
             _("Start"), _("Stop")])
        layers = epitaxy_get_layers()

        for i in range(0, layers):
            dos_file = epitaxy_get_dos_file(i)
            width = epitaxy_get_width(i)
            if dos_file != "none":
                lines = []
                print("loading", dos_file)
                file_name = os.path.join(get_sim_path(), dos_file + ".inp")
                lines = inp_load_file(file_name)
                if lines != False:
                    doping_start = float(
                        inp_search_token_value(lines, "#doping_start"))
                    doping_stop = float(
                        inp_search_token_value(lines, "#doping_stop"))

                    print("add", dos_file)

                    count = self.tab.rowCount()
                    self.tab.insertRow(count)

                    item1 = QTableWidgetItem(str(dos_file))
                    self.tab.setItem(count, 0, item1)

                    item2 = QTableWidgetItem(str(width))
                    self.tab.setItem(count, 1, item2)

                    item3 = QTableWidgetItem(str(doping_start))
                    self.tab.setItem(count, 2, item3)

                    item3 = QTableWidgetItem(str(doping_stop))
                    self.tab.setItem(count, 3, item3)

        self.tab.blockSignals(False)

        return
Ejemplo n.º 5
0
	def load(self):
		self.tab.blockSignals(True)
		self.tab.clear()
		self.tab.setHorizontalHeaderLabels([_("File Name"), _("Width"), _("Start"), _("Stop")])
		layers=epitaxy_get_layers()

		for i in range(0,layers):
			dos_file=epitaxy_get_dos_file(i)
			width=epitaxy_get_width(i)
			if dos_file!="none":
				lines=[]
				print("loading",dos_file)
				if inp_load_file(lines,dos_file+".inp")==True:
					doping_start=float(inp_search_token_value(lines, "#doping_start"))
					doping_stop=float(inp_search_token_value(lines, "#doping_stop"))

					print("add",dos_file)

					count=self.tab.rowCount()
					self.tab.insertRow(count)

					item1 = QTableWidgetItem(str(dos_file))
					self.tab.setItem(count,0,item1)

					item2 = QTableWidgetItem(str(width))
					self.tab.setItem(count,1,item2)

					item3 = QTableWidgetItem(str(doping_start))
					self.tab.setItem(count,2,item3)

					item3 = QTableWidgetItem(str(doping_stop))
					self.tab.setItem(count,3,item3)

		self.tab.blockSignals(False)

		return
Ejemplo n.º 6
0
def gen_workbook(input_file_or_dir, output_file):
    if work_book_enabled == False:
        print("python3-openpyxl not found")
        return

    wb = Workbook()
    if os.path.isfile(input_file_or_dir):
        files = [input_file_or_dir]
    if os.path.isdir(input_file_or_dir):
        files = glob.glob(os.path.join(input_file_or_dir, "*.dat"))
    else:
        return

    ws = wb.active
    pos = 1
    for i in range(0, epitaxy_get_layers()):
        dos_layer = epitaxy_get_dos_file(i)
        if dos_layer.startswith("dos") == True:
            pos = workbook_from_inp(ws,
                                    pos,
                                    dos_layer + ".inp",
                                    title=epitaxy_get_name(i))

    for my_file in files:
        #print("about to save1",my_file)
        #print(my_file)
        data = dat_file()
        if data.load(my_file, guess=False) == True:
            x = []
            y = []
            z = []
            if data.load(my_file) == True:
                #print("read",my_file)
                ws = wb.create_sheet(
                    title=title_truncate(os.path.basename(my_file)))
                ws.cell(column=1, row=1, value=data.title)
                ws.cell(column=1,
                        row=2,
                        value=data.x_label + " (" + data.x_units + ") ")
                ws.cell(column=2,
                        row=2,
                        value=data.data_label + " (" + data.data_units + ") ")

                for i in range(0, data.y_len):
                    ws.cell(column=1, row=i + 3, value=data.y_scale[i])
                    ws.cell(column=2, row=i + 3, value=data.data[0][0][i])

                c1 = ScatterChart()
                c1.title = data.title
                c1.style = 13
                c1.height = 20
                c1.width = 20
                c1.y_axis.title = data.data_label + " (" + data.data_units + ") "
                c1.x_axis.title = data.x_label + " (" + data.x_units + ") "

                xdata = Reference(ws,
                                  min_col=1,
                                  min_row=3,
                                  max_row=3 + data.y_len)
                ydata = Reference(ws,
                                  min_col=2,
                                  min_row=3,
                                  max_row=3 + data.y_len)

                series = Series(ydata, xdata, title_from_data=True)
                c1.series.append(series)
                ws.add_chart(c1, "G4")
    #print("about to save1")
    try:
        wb.save(filename=output_file)
    except:
        return False

    return True
Ejemplo n.º 7
0
    def __init__(self):
        QWidgetSavePos.__init__(self, "doping")
        self.setMinimumSize(900, 600)
        self.setWindowIcon(icon_get("doping"))
        self.setWindowTitle(
            _("Doping/Mobilie ion profile editor") +
            " (https://www.gpvdm.com)")

        self.epi = get_epi()

        self.main_vbox = QVBoxLayout()

        toolbar = QToolBar()
        toolbar.setIconSize(QSize(48, 48))

        self.save = QAction(icon_get("document-save-as"), _("Save"), self)
        self.save.triggered.connect(self.callback_save)
        toolbar.addAction(self.save)

        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        toolbar.addWidget(spacer)

        self.help = QAction(icon_get("help"), _("Help"), self)
        self.help.triggered.connect(self.callback_help)
        toolbar.addAction(self.help)

        self.main_vbox.addWidget(toolbar)

        self.fig = Figure(figsize=(5, 4), dpi=100)
        self.ax1 = None
        self.show_key = True
        canvas = FigureCanvas(self.fig)
        #canvas.set_background('white')
        #canvas.set_facecolor('white')
        canvas.figure.patch.set_facecolor('white')
        canvas.show()

        self.main_vbox.addWidget(canvas)

        self.tab = gpvdm_tab()
        self.tab.resizeColumnsToContents()

        self.tab.verticalHeader().setVisible(False)

        self.tab.clear()
        self.tab.setColumnCount(6)
        self.tab.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.load()
        self.build_mesh()

        self.tab.cellChanged.connect(self.tab_changed)

        self.tab.setColumnWidth(2, 150)
        self.tab.setColumnWidth(3, 150)
        self.tab.setColumnWidth(4, 180)
        self.tab.setColumnWidth(5, 180)

        self.main_vbox.addWidget(self.tab)

        self.draw_graph()

        self.setLayout(self.main_vbox)

        layers = epitaxy_get_layers()
        for i in range(0, layers):
            dos_file = epitaxy_get_dos_file(i) + ".inp"
            if dos_file.startswith("dos") == True:
                get_watch().add_call_back(dos_file, self.load)

        return
Ejemplo n.º 8
0
    def load(self):
        self.tab.blockSignals(True)
        self.tab.clear()
        self.tab.setHorizontalHeaderLabels([
            _("Layer"),
            _("Width"),
            _("Doping Start (m-3)"),
            _("Doping Stop (m-3)"),
            _("Mobile ion density (m-3)"),
            _("Mobile ion mobility (m-3)")
        ])
        layers = epitaxy_get_layers()

        row = 0
        for i in range(0, layers):
            dos_file = epitaxy_get_dos_file(i)
            if dos_file.startswith("dos") == True:
                row = row + 1
        self.tab.setRowCount(row)

        row = 0
        for i in range(0, layers):
            dos_file = epitaxy_get_dos_file(i)
            e = epitaxy_get_layer(i)
            dy = e.dy
            if dos_file.startswith("dos") == True:
                lines = []
                print("loading", dos_file)
                file_name = os.path.join(get_sim_path(), dos_file + ".inp")
                lines = inp_load_file(file_name)
                if lines != False:
                    doping_start = float(
                        inp_search_token_value(lines, "#doping_start"))
                    doping_stop = float(
                        inp_search_token_value(lines, "#doping_stop"))

                    ion_density = float(
                        inp_search_token_value(lines, "#ion_density"))
                    ion_mobility = float(
                        inp_search_token_value(lines, "#ion_mobility"))

                    item = QTableWidgetItem(e.name)
                    item.setFlags(item.flags() ^ Qt.ItemIsEnabled)
                    self.tab.setItem(row, 0, item)

                    item = QTableWidgetItem(str(dy))
                    item.setFlags(item.flags() ^ Qt.ItemIsEnabled)
                    self.tab.setItem(row, 1, item)

                    item = QTableWidgetItem(str(doping_start))
                    self.tab.setItem(row, 2, item)

                    item = QTableWidgetItem(str(doping_stop))
                    self.tab.setItem(row, 3, item)

                    item = QTableWidgetItem(str(ion_density))
                    self.tab.setItem(row, 4, item)

                    item = QTableWidgetItem(str(ion_mobility))
                    self.tab.setItem(row, 5, item)

                row = row + 1

        self.tab.blockSignals(False)

        return