src/eric7/MicroPython/Devices/EspDevices.py

branch
eric7
changeset 11006
a671918232f3
parent 11005
b918c6c2736b
child 11034
7b8a21fd2d58
equal deleted inserted replaced
11005:b918c6c2736b 11006:a671918232f3
262 @pyqtSlot() 262 @pyqtSlot()
263 def __eraseFlash(self): 263 def __eraseFlash(self):
264 """ 264 """
265 Private slot to erase the device flash memory. 265 Private slot to erase the device flash memory.
266 """ 266 """
267 eraseFlash(self.microPython.getCurrentPort()) 267 eraseFlash(self.microPython.getCurrentPort(), parent=self.microPython)
268 268
269 @pyqtSlot() 269 @pyqtSlot()
270 def __flashMicroPython(self): 270 def __flashMicroPython(self):
271 """ 271 """
272 Private slot to flash a MicroPython firmware to the device. 272 Private slot to flash a MicroPython firmware to the device.
311 self.tr("'esptool read_flash' Output"), 311 self.tr("'esptool read_flash' Output"),
312 self.tr("Backup Firmware"), 312 self.tr("Backup Firmware"),
313 showProgress=True, 313 showProgress=True,
314 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 314 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
315 encoding=Preferences.getSystem("IOEncoding"), 315 encoding=Preferences.getSystem("IOEncoding"),
316 parent=self.microPython,
316 ) 317 )
317 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) 318 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs)
318 if res: 319 if res:
319 dlg.exec() 320 dlg.exec()
320 321
366 self.tr("'esptool write_flash' Output"), 367 self.tr("'esptool write_flash' Output"),
367 self.tr("Restore Firmware"), 368 self.tr("Restore Firmware"),
368 showProgress=True, 369 showProgress=True,
369 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 370 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
370 encoding=Preferences.getSystem("IOEncoding"), 371 encoding=Preferences.getSystem("IOEncoding"),
372 parent=self.microPython,
371 ) 373 )
372 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) 374 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs)
373 if res: 375 if res:
374 dlg.exec() 376 dlg.exec()
375 377
463 dlg = EricProcessDialog( 465 dlg = EricProcessDialog(
464 self.tr("'esptool chip_id' Output"), 466 self.tr("'esptool chip_id' Output"),
465 self.tr("Show Chip ID"), 467 self.tr("Show Chip ID"),
466 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 468 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
467 encoding=Preferences.getSystem("IOEncoding"), 469 encoding=Preferences.getSystem("IOEncoding"),
470 parent=self.microPython,
468 ) 471 )
469 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) 472 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args)
470 if res: 473 if res:
471 dlg.exec() 474 dlg.exec()
472 475
486 dlg = EricProcessDialog( 489 dlg = EricProcessDialog(
487 self.tr("'esptool flash_id' Output"), 490 self.tr("'esptool flash_id' Output"),
488 self.tr("Show Flash ID"), 491 self.tr("Show Flash ID"),
489 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 492 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
490 encoding=Preferences.getSystem("IOEncoding"), 493 encoding=Preferences.getSystem("IOEncoding"),
494 parent=self.microPython,
491 ) 495 )
492 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) 496 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args)
493 if res: 497 if res:
494 dlg.exec() 498 dlg.exec()
495 499
509 dlg = EricProcessDialog( 513 dlg = EricProcessDialog(
510 self.tr("'esptool read_mac' Output"), 514 self.tr("'esptool read_mac' Output"),
511 self.tr("Show MAC Address"), 515 self.tr("Show MAC Address"),
512 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 516 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
513 encoding=Preferences.getSystem("IOEncoding"), 517 encoding=Preferences.getSystem("IOEncoding"),
518 parent=self.microPython,
514 ) 519 )
515 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args) 520 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), args)
516 if res: 521 if res:
517 dlg.exec() 522 dlg.exec()
518 523
1745 ## as well. ## 1750 ## as well. ##
1746 ################################################################################ 1751 ################################################################################
1747 1752
1748 1753
1749 @pyqtSlot() 1754 @pyqtSlot()
1750 def eraseFlash(port): 1755 def eraseFlash(port, parent=None):
1751 """ 1756 """
1752 Slot to erase the device flash memory. 1757 Slot to erase the device flash memory.
1753 1758
1754 @param port name of the serial port device to be used 1759 @param port name of the serial port device to be used
1755 @type str 1760 @type str
1761 @param parent reference to the parent widget (defaults to None)
1762 @type QWidget
1756 """ 1763 """
1757 ok = EricMessageBox.yesNo( 1764 ok = EricMessageBox.yesNo(
1758 None, 1765 parent,
1759 QCoreApplication.translate("EspDevice", "Erase Flash"), 1766 QCoreApplication.translate("EspDevice", "Erase Flash"),
1760 QCoreApplication.translate( 1767 QCoreApplication.translate(
1761 "EspDevice", """Shall the flash of the selected device really be erased?""" 1768 "EspDevice", """Shall the flash of the selected device really be erased?"""
1762 ), 1769 ),
1763 ) 1770 )
1774 QCoreApplication.translate("EspDevice", "'esptool erase_flash' Output"), 1781 QCoreApplication.translate("EspDevice", "'esptool erase_flash' Output"),
1775 QCoreApplication.translate("EspDevice", "Erase Flash"), 1782 QCoreApplication.translate("EspDevice", "Erase Flash"),
1776 showProgress=True, 1783 showProgress=True,
1777 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 1784 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
1778 encoding=Preferences.getSystem("IOEncoding"), 1785 encoding=Preferences.getSystem("IOEncoding"),
1786 parent=parent,
1779 ) 1787 )
1780 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) 1788 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs)
1781 if res: 1789 if res:
1782 dlg.exec() 1790 dlg.exec()
1783 1791
1822 QCoreApplication.translate("EspDevice", "'esptool write_flash' Output"), 1830 QCoreApplication.translate("EspDevice", "'esptool write_flash' Output"),
1823 QCoreApplication.translate("EspDevice", "Flash µPy/CPy Firmware"), 1831 QCoreApplication.translate("EspDevice", "Flash µPy/CPy Firmware"),
1824 showProgress=True, 1832 showProgress=True,
1825 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 1833 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
1826 encoding=Preferences.getSystem("IOEncoding"), 1834 encoding=Preferences.getSystem("IOEncoding"),
1835 parent=parent,
1827 ) 1836 )
1828 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) 1837 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs)
1829 if res: 1838 if res:
1830 dlg.exec() 1839 dlg.exec()
1831 1840
1867 QCoreApplication.translate("EspDevice", "'esptool write_flash' Output"), 1876 QCoreApplication.translate("EspDevice", "'esptool write_flash' Output"),
1868 QCoreApplication.translate("EspDevice", "Flash Additional Firmware"), 1877 QCoreApplication.translate("EspDevice", "Flash Additional Firmware"),
1869 showProgress=True, 1878 showProgress=True,
1870 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"), 1879 monospacedFont=Preferences.getEditorOtherFonts("MonospacedFont"),
1871 encoding=Preferences.getSystem("IOEncoding"), 1880 encoding=Preferences.getSystem("IOEncoding"),
1881 parent=parent,
1872 ) 1882 )
1873 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs) 1883 res = dlg.startProcess(PythonUtilities.getPythonExecutable(), flashArgs)
1874 if res: 1884 if res:
1875 dlg.exec() 1885 dlg.exec()

eric ide

mercurial