ultimatepp/uppdev/E011/rtd.cpp
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

40 lines
751 B
C++

#include "E011.h"
RealTimeD::RealTimeD() {
CtrlLayoutCancel(*this, "Real time display");
return;
}
void RealTimeD::Perform() {
SetTimeCallback(-250, THISBACK(RealTime), 0);
Run();
KillTimeCallback(0);
}
void RealTimeD::RealTime() {
int i;
bool r;
r = true;
i = SEP1_ReadVar(2);
if(i >= 0) rt_level = Format("%04X", (int)i);
else r = "";
i = SEP1_ReadVar(0);
if(i >= 0) fd_level = Format("%04X", (int)i);
else r = "";
if( SEP1_ReadFlash(9) == 1 ) {
i = SEP1_ReadVar(1);
if(i >= 0) display = i;
else r = false;
}
else display = "-";
if(!r) {
port.disconnect();
KillTimeCallback(0);
Exclamation("Problema di comunicazione. Il collegamento è stato interrotto.");
}
return;
}