Source file: /~heha/enas/Convac-Ätzer/Firmware-190517.zip/dlgAlarm.cpp

#include "Convac.h"
#include "Display.h"
/* Alarm-Listendarstellung */

static void xorFocus() {
 lvXorFocus(C.focuse);
}

void dlgAlarm() {
vorn:
 d.clear();
 byte n=ALARM::n();
 if (!zoom) {
  d.print(floatstr(n));
  d.print(F(" Alarm"));
  if (n!=1) d.print('e');
  byte mask=0x10;
  if (n) mask=0x14;
  if (n>1) mask=0x1F;
  paintMenu(F("\x1C\0\x1D\0\x7F\0alle\x7F\0\x15"),mask);
  paintMenuZoom();
 }
 clrFocusVis();
 if (n) {
  C.focuse=lvInit(C.focuse,n-1);
  setRedraw();
paint:
  if (redraw) {
   byte y=0;
   for (auto a=ALARM::alarm; a<ALARM::alarm+elemof(ALARM::alarm); a++) if (a->occ) {
    if (lv.itemInvalid(y)) {
     d.gotoXY(0,lvScreenY(y));
     a->print();
     idle();
    }
    y++;
   }
   clrRedraw();
  }
  if (!focusVis) xorFocus();
 }
again:
 switch (byte action=getkey(n?50:0)) {
  case 0: xorFocus(); goto again;
  case '\r': return;
  case 0xF1:
  case 0xF2: if (n<2) goto err;
  if (focusVis) xorFocus();
  C.focuse=updown(C.focuse,action,n-1);
  d.clrClip();
  lv.scrollIntoView(C.focuse);	// generiert Inval-Region und Redraw-Flag
  goto paint;
  case 0xF3: if (!n) goto err;
  ALARM::nth(C.focuse)->clear();
  goto vorn;
  case 0xF4: if (n<2) goto err;
  ALARM::clearAll();
  goto vorn;
  case 0xF5: goto vorn;	// Refresh
  case 0xF6: xorZoom(); goto vorn;
  default: err: errorbeep(); goto again;
 }
}
Detected encoding: ASCII (7 bit)2