Class FlashPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

class FlashPanel extends JPanel
Flashes the latest Heltec Receiver firmware (published from the firmware repo's main branch) to one or more plugged-in receivers at once. Only receivers are listed. Each unit's board ID, label, and show are kept; the unit is read before and after so any change is caught. A unit that fails is blinked red (when it can still respond) so it can be found among the others.
  • Field Details

    • OWNER

      private static final String OWNER
      See Also:
    • confirmedCommit

      private static String confirmedCommit
      Remembered for the rest of the session once the user confirms the version to flash.
    • rows

      private final List<FlashPanel.Row> rows
    • model

      private final FlashPanel.FlashTableModel model
    • table

      private final JTable table
    • releaseVersion

      private final JLabel releaseVersion
    • releaseDetail

      private final JTextArea releaseDetail
    • releasePill

      private final DevUI.Pill releasePill
    • scanButton

      private final JButton scanButton
    • flashButton

      private final JButton flashButton
    • countPill

      private final DevUI.Pill countPill
    • listCards

      private final CardLayout listCards
    • listArea

      private final JPanel listArea
    • emptyHeadline

      private final JLabel emptyHeadline
    • logArea

      private final JTextArea logArea
    • scanner

      private final ExecutorService scanner
    • activeFlashes

      private final AtomicInteger activeFlashes
    • pendingScans

      private final AtomicInteger pendingScans
    • scannedOnce

      private boolean scannedOnce
  • Constructor Details

    • FlashPanel

      FlashPanel()
  • Method Details

    • onShown

      void onShown()
    • isFlashing

      boolean isFlashing()
    • shutdown

      void shutdown()
    • refreshReleaseCard

      void refreshReleaseCard()
    • checkForUpdate

      private void checkForUpdate(boolean showProblems)
    • scan

      private void scan()
    • showList

      private void showList()
    • flashSelected

      private void flashSelected()
    • confirmRelease

      private boolean confirmRelease(FirmwareRelease release)
      Asks once per session (and again if a different version would be flashed).
    • startFlashing

      private void startFlashing(List<FlashPanel.Row> targets, FirmwareRelease release)
    • flashOne

      private void flashOne(FlashPanel.Row row, FirmwareRelease release)
    • finish

      private void finish(FlashPanel.Row row, boolean ok, String message, boolean blink)
      Parameters:
      blink - blink the unit's status LED red so it can be found among the others
    • status

      private void status(FlashPanel.Row row, String text, int progress)
    • onAllFinished

      private void onAllFinished()
    • log

      private void log(String line)
    • refreshRows

      private void refreshRows()
      Repaints rows in place; unlike fireTableDataChanged this keeps the selection.
    • outcomeTone

      private static DevUI.Tone outcomeTone(FlashPanel.Row row)