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

View File

@ -246,8 +246,8 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
init_baud = min(ESPLoader.ESP_ROM_BAUD, baudrate)
esp = ESPLoader.detect_chip(device, init_baud, 'default_reset', False)
progress.emit(self.tr('Done. Chip type: %s') %
esp.get_chip_description(), 0)
progress.emit(self.tr('Connected. Chip type: {chip_type}').format(
chip_type=esp.get_chip_description()), 0)
esp = esp.run_stub()
esp.change_baud(baudrate)
@ -264,7 +264,8 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
t = time.time()
while len(image) > 0:
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)
block = image[0:esp.FLASH_WRITE_SIZE]
@ -274,12 +275,15 @@ class MainWindow(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow):
written += len(block)
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()
def on_expertModeBox_clicked(self):
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())