From 8ebf2ee631f51a6b986739ae02b6981df573fa40 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Mon, 15 Apr 2024 08:00:41 +0200 Subject: [PATCH] Convert help text to HTML Turns out PySide2 doesn't have a setMarkdown() method for the text widgets, only setHtml(). --- src/python/adgui.py | 90 ++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/src/python/adgui.py b/src/python/adgui.py index a8c6f99f..d56fa85f 100755 --- a/src/python/adgui.py +++ b/src/python/adgui.py @@ -534,7 +534,7 @@ class adgui(QObject): self.disable_fuses() self.helptext() - self.help.textBrowser.setMarkdown(self.helptext) + self.help.textBrowser.setHtml(self.helptext) self.adgui.show() @@ -1565,99 +1565,105 @@ class adgui(QObject): def helptext(self): self.helptext=''' -# Usage instructions + + +Usage instructions + +

Usage instructions

-## Preface +

Preface

-Keep in mind that this is a GUI demonstrator only. +

Keep in mind that this is a GUI demonstrator only.

-## GUI layout +

GUI layout

-The GUI consists of three major parts: a menu bar to select the +

The GUI consists of three major parts: a menu bar to select the various actions; a central part for operating messages, warnings and errors; and interactive windows for individual tasks like programming -an AVR. +an AVR.

-The center area is reserved for logging. Different log levels are +

The center area is reserved for logging. Different log levels are marked in different colors to allow for an easy optical -differentiation. +differentiation.

-The log level shown can be selected using Settings → Log level … Note +

The log level shown can be selected using Settings → Log level … Note that log entries above "Debug" are not displayed in the log window but -only stored internally. +only stored internally.

-The internal log data can be written into a file using File → Save -log … +

The internal log data can be written into a file using File → Save +log …

-The selected log level is remembered in the configuration data -mentioned below. +

The selected log level is remembered in the configuration data +mentioned below.

-## Operating instructions +

Operating instructions

-First pick the AVR using the File → Device dialog. Once selected, -Device → Info … shows more information about the part. +

First pick the AVR using the File → Device dialog. Once selected, +Device → Info … shows more information about the part.

-Then, use File → Programmer to select the programming hardware or +

Then, use File → Programmer to select the programming hardware or bootloader. Be sure to set the Port entry. For programmers that only make sense on a particular port (e.g. "usb"), an attempt is made to -pre-fill the port. +pre-fill the port.

-All these values are saved in a platform-dependent configuration +

All these values are saved in a platform-dependent configuration database, and loaded from that place at next start. Thus, if operating -again on the same platform next time, they are already pre-selected. +again on the same platform next time, they are already pre-selected.

-In the next step select File → Attach Programmer to start talking to +

In the next step select File → Attach Programmer to start talking to the device. Once the programmer has started up successfully, the Device → Programming … menu is enabled which pops up a window to handle the various persistent device memories (flash, EEPROM, -fuses). +fuses).

-Before anything else can proceed, the signature must be read from +

Before anything else can proceed, the signature must be read from the device on the Signature tab. If the read signature does not match that of the selected device the entry is marked red and a candidate device is suggested from the database that matches the -signature. +signature.

-### Flash, EEPROM +

Flash, EEPROM

-Flash and EEPROM tabs are laid out similarly. +

Flash and EEPROM tabs are laid out similarly.

-Internally, all data are stored in a buffer for the correspondig +

Internally, all data are stored in a buffer for the correspondig memory area. The buffer can be filled either by reading it from the device, or by loading it from a file. For file operations, the desired file format can be selected using radion button entries. For reading files, it is possible to use ELF files (that could contain information for more than one memory area), as well as use an autodection logic. For writing files, the file format must be selected explicitly, to -either "Intel Hex", "Motorola S-Record", or "Raw binary". +either "Intel Hex", "Motorola S-Record", or "Raw binary".

-The buffer can be saved to a file, or programmed into the device. +

The buffer can be saved to a file, or programmed into the device.

-The "Clear" button clears all internally remembered contents of the -buffer, as well as the "cell has been loaded" flags. +

The "Clear" button clears all internally remembered contents of the +buffer, as well as the "cell has been loaded" flags.

-On the "Flash" memory tab, the "Erase" button (marked red) can be used +

On the "Flash" memory tab, the "Erase" button (marked red) can be used to perform a chip erase. Depending on the fuse selections for the -device, this might also erase the EEPROM memory area. +device, this might also erase the EEPROM memory area.

-### Fuses +

Fuses

-The memory tab for fuse memories is laid out similar to the other +

The memory tab for fuse memories is laid out similar to the other tabs, yet on the right-hand side, it contains entry fields for the individual fuse values. The entries are displayed in hexadecimal -notation. Provided the internal `libavrdude` database contains +notation. Provided the internal libavrdude database contains configuration information for the selected device, right-clicking on each entry pops up menues that allow selecting the individual fuse bitfields based on their purpose. If the respective entry field already contains a value (either, from reading the device, or loaded from a file), that value is used to pre-select the respective entries of the comboboxes. If there was no value present, the default value -(according to the datasheet) is used as a starting point. +(according to the datasheet) is used as a starting point.

-Only ELF files can contain values for multiple fuses. All other file +

Only ELF files can contain values for multiple fuses. All other file formats can only contain a single fuse value. To allow loading or -saving multiple fuses, a percent sign (`%`) in the file name entry is -considered a pattern that will be replaced by the `fuse`*N* name. +saving multiple fuses, a percent sign (%) in the file name entry is +considered a pattern that will be replaced by the fuseN name.

+ + ''' def avrlogo(self):