Clear up status messages, add sensor ID display

This commit is contained in:
Piotr Dobrowolski 2018-08-30 12:32:54 +02:00
parent 12988acda9
commit caf09bc432
2 changed files with 33 additions and 29 deletions

View File

@ -4,94 +4,94 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../luftdaten-tool.py" line="138"/> <location filename="../luftdaten-tool.py" line="147"/>
<source>No boards found</source> <source>No boards found</source>
<translation>Nie znaleziono płytki</translation> <translation>Nie znaleziono płytki</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="143"/> <location filename="../luftdaten-tool.py" line="152"/>
<source>Others...</source> <source>Others...</source>
<translation>Inne...</translation> <translation>Inne...</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="172"/> <location filename="../luftdaten-tool.py" line="181"/>
<source>No device selected.</source> <source>No device selected.</source>
<translation>Nie wybrano urządzenia.</translation> <translation>Nie wybrano urządzenia.</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="176"/> <location filename="../luftdaten-tool.py" line="185"/>
<source>No version selected.</source> <source>No version selected.</source>
<translation>Nie wybrano wersji.</translation> <translation>Nie wybrano wersji.</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="131"/> <location filename="../gui/mainwindow.py" line="130"/>
<source>Luftdaten.info Flashing Tool</source> <source>Luftdaten.info Flashing Tool</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="132"/> <location filename="../gui/mainwindow.py" line="131"/>
<source>Board:</source> <source>Board:</source>
<translation>Płytka:</translation> <translation>Płytka:</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="133"/> <location filename="../gui/mainwindow.py" line="132"/>
<source>Firmware version:</source> <source>Firmware version:</source>
<translation>Wersja oprogramowania:</translation> <translation>Wersja oprogramowania:</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="134"/> <location filename="../gui/mainwindow.py" line="133"/>
<source>master</source> <source>master</source>
<translation>master</translation> <translation>master</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="135"/> <location filename="../gui/mainwindow.py" line="134"/>
<source>Upload</source> <source>Upload</source>
<translation>Wgraj</translation> <translation>Wgraj</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="136"/> <location filename="../gui/mainwindow.py" line="135"/>
<source>Expert mode</source> <source>Expert mode</source>
<translation>Tryb eksperta</translation> <translation>Tryb eksperta</translation>
</message> </message>
<message> <message>
<location filename="../gui/mainwindow.py" line="137"/> <location filename="../gui/mainwindow.py" line="136"/>
<source>Baudrate:</source> <source>Baudrate:</source>
<translation>Prędkość portu:</translation> <translation>Prędkość portu:</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="191"/> <location filename="../luftdaten-tool.py" line="200"/>
<source>Invalid version / file does not exist</source> <source>Invalid version / file does not exist</source>
<translation>Błędna wersja / plik nie istnieje</translation> <translation>Błędna wersja / plik nie istnieje</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="196"/> <location filename="../luftdaten-tool.py" line="205"/>
<source>Work in progess...</source> <source>Work in progess...</source>
<translation>Praca w toku...</translation> <translation>Praca w toku...</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="224"/> <location filename="../luftdaten-tool.py" line="233"/>
<source>Downloading...</source> <source>Downloading...</source>
<translation>Pobieranie...</translation> <translation>Pobieranie...</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="235"/> <location filename="../luftdaten-tool.py" line="244"/>
<source>Connecting...</source> <source>Connecting...</source>
<translation>Łączenie...</translation> <translation>Łączenie...</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="240"/> <location filename="../luftdaten-tool.py" line="249"/>
<source>Done. Chip type: %s</source> <source>Connected. Chip type: {chip_type}</source>
<translation>Zrobione. Typ układu: %s</translation> <translation>Połączono. Typ układu: {chip_type}</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="258"/> <location filename="../luftdaten-tool.py" line="267"/>
<source>Writing at 0x%08x...</source> <source>Writing at 0x{address:08x}...</source>
<translation>Zapisywanie pod adresem 0x%08x...</translation> <translation>Zapisywanie pod adresem 0x{address:08x}...</translation>
</message> </message>
<message> <message>
<location filename="../luftdaten-tool.py" line="268"/> <location filename="../luftdaten-tool.py" line="278"/>
<source>Finished in %.2f seconds</source> <source>Finished in {time:.2f} seconds. Sensor ID: {sensor_id}</source>
<translation>Zrobione w %.2f sekundy</translation> <translation>Zakończono w {time:.2f} sekundy. ID sensora: {sensor_id}</translation>
</message> </message>
</context> </context>
</TS> </TS>

View File

@ -246,8 +246,8 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
init_baud = min(ESPLoader.ESP_ROM_BAUD, baudrate) init_baud = min(ESPLoader.ESP_ROM_BAUD, baudrate)
esp = ESPLoader.detect_chip(device, init_baud, 'default_reset', False) esp = ESPLoader.detect_chip(device, init_baud, 'default_reset', False)
progress.emit(self.tr('Done. Chip type: %s') % progress.emit(self.tr('Connected. Chip type: {chip_type}').format(
esp.get_chip_description(), 0) chip_type=esp.get_chip_description()), 0)
esp = esp.run_stub() esp = esp.run_stub()
esp.change_baud(baudrate) esp.change_baud(baudrate)
@ -264,7 +264,8 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
t = time.time() t = time.time()
while len(image) > 0: while len(image) > 0:
current_addr = address + seq * esp.FLASH_WRITE_SIZE current_addr = address + seq * esp.FLASH_WRITE_SIZE
progress.emit(self.tr('Writing at 0x%08x...') % (current_addr,), progress.emit(self.tr('Writing at 0x{address:08x}...').format(
address=current_addr),
100 * (seq + 1) // blocks) 100 * (seq + 1) // blocks)
block = image[0:esp.FLASH_WRITE_SIZE] block = image[0:esp.FLASH_WRITE_SIZE]
@ -274,12 +275,15 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
written += len(block) written += len(block)
t = time.time() - t t = time.time() - t
progress.emit(self.tr('Finished in %.2f seconds') % (t,), 100) progress.emit(self.tr(
'Finished in {time:.2f} seconds. Sensor ID: {sensor_id}').format(
time=t, sensor_id=esp.chip_id()), 100)
@QtCore.Slot() @QtCore.Slot()
def on_expertModeBox_clicked(self): def on_expertModeBox_clicked(self):
self.expertForm.setVisible(self.expertModeBox.checkState()) self.expertForm.setVisible(self.expertModeBox.checkState())
self.centralwidget.setFixedHeight(self.centralwidget.sizeHint().height()) self.centralwidget.setFixedHeight(
self.centralwidget.sizeHint().height())
self.setFixedHeight(self.sizeHint().height()) self.setFixedHeight(self.sizeHint().height())