pass port from combobox
This commit is contained in:
@@ -68,7 +68,7 @@ void loop() {{
|
||||
|
||||
sketch += H("hello.h", """
|
||||
void hello() {
|
||||
Serial.println("hello smi7");
|
||||
Serial.println("HemoCube QC");
|
||||
}
|
||||
""")
|
||||
|
||||
@@ -171,6 +171,7 @@ if __name__ == "__main__":
|
||||
cb = QComboBox()
|
||||
cb.setFixedSize(QSize(150, 30))
|
||||
ports = get_port()
|
||||
cb.addItem("Select")
|
||||
for port in ports:
|
||||
cb.addItem(port)
|
||||
layout.addWidget(cb)
|
||||
@@ -178,6 +179,7 @@ if __name__ == "__main__":
|
||||
flash_port = ""
|
||||
def selectionchange(i):
|
||||
flash_port = cb.currentText()
|
||||
print("flash_port", flash_port)
|
||||
cb.currentIndexChanged.connect(selectionchange)
|
||||
|
||||
# Create a QPushButton object with a caption on it
|
||||
@@ -199,7 +201,7 @@ if __name__ == "__main__":
|
||||
# Close the application when the button is pressed
|
||||
# Here I am using slots & signals, which I will demonstrate later in this tutorial
|
||||
# qbtn.clicked.connect(lambda:addLabel(layout, "Flashing..."))
|
||||
qbtn.clicked.connect(lambda:flash(w, line_edit_led1.text(), line_edit_led2.text(), flash_port))
|
||||
qbtn.clicked.connect(lambda: flash(w, line_edit_led1.text(), line_edit_led2.text(), cb.currentText()))
|
||||
|
||||
window.setWindowTitle("HemoCube QC")
|
||||
window.setGeometry(400, 400, 800, 600)
|
||||
|
||||
Reference in New Issue
Block a user