Add collected changes from T.Sax

This commit is contained in:
Siegfried Siegert 2024-07-08 10:34:47 +02:00
parent 85716fb9db
commit 433f295f8b
Signed by untrusted user: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
19 changed files with 760 additions and 346 deletions

View File

@ -13,6 +13,11 @@ T_keypad::T_keypad(QWidget *parent) : QWidget(parent)
myMainLay = new QVBoxLayout;
mySubLayout = new QGridLayout;
headline = new QLabel();
headline->setText("head line");
headline->setFont(myTabFont);
myMainLay->addWidget(headline);
valueDisplay = new QLabel();
valueDisplay->setStyleSheet("background-color: white");
valueDisplay->setLineWidth(5);
@ -145,6 +150,12 @@ void T_keypad::hide(void)
numPad->hide();
}
void T_keypad::setText(QString headLine)
{
headline->setText(headLine);
}
void T_keypad::keysVisible(uint8_t visib)
{
// visib=0: show * 1:show numbers 2: show * but allow visi-key

View File

@ -27,6 +27,7 @@ class T_keypad : public QWidget
QVBoxLayout *myMainLay;
QGridLayout *mySubLayout;
QLabel *headline;
public:
explicit T_keypad(QWidget *parent = nullptr);
@ -34,6 +35,8 @@ public:
void show(void);
void hide();
void setText(QString headLine);
void keysVisible(uint8_t visib);
// visib=0: show * 1:show numbers 2: show * but allow visi-key

View File

@ -19,7 +19,7 @@ int main(int argc, char *argv[])
QSize myMainSize={800, 480}; // breite, höhe, PTU: 800x440
myMainWin.setMinimumSize(myMainSize);
myMainWin.setMaximumSize(myMainSize);
myMainWin.setWindowTitle("PSA Service Tool V4.1");
myMainWin.setWindowTitle("PSA Service Tool V4.3");
myMainWin.show();
//myMainWin.showFullScreen();

View File

@ -21,10 +21,8 @@ char MainWindow::loadPlugIn(char lade1_entlade2)
QPluginLoader *pluginLoader = new QPluginLoader();
// select system:
//pluginLoader->setFileName("../MasterPlug/libCAmaster.so"); // for suse
//pluginLoader->setFileName("../SlavePlug/libCAslave.so"); // for ptu5
//pluginLoader->setFileName("../../MasterPlug/CAmaster.dll"); // for windows
// Windows DT
// pluginLoader->setFileName("../../SlavePlug/CAslave.dll"); // for windows
pluginLoader->setFileName("/usr/lib/libCAslave.so"); // for PTU5
@ -956,6 +954,7 @@ void MainWindow::chainControl(void)
uint16_t nextScreen=0;
uint8_t useNavi=0;
bool busy=false;
static uint32_t offlineCtr;
// call permanent functions here:
//mifCard->working();
@ -964,6 +963,17 @@ void MainWindow::chainControl(void)
//qDebug()<<"mainwin chaincontrol calling mif";
if (HWaccess->sys_areDCdataValid()==false)
{
qDebug()<<"mainwin: lost connection to DC "<<offlineCtr;
offlineCtr++;
}
// working step chain:
if (chainCurrentStep != chainNextStep)
{

View File

@ -44,7 +44,7 @@
#define WCS_WIN01FWD PAGE_SERVICEMAIN
// PAGE_SERVICEMAIN:
#define WCS_WIN02BAK PAGE_COMPORT
#define WCS_WIN02BAK PAGE_BOOTLOADER
#define WCS_WIN02MID PAGE_SERVICEMAIN
#define WCS_WIN02FWD PAGE_TIMEDATEVERSION
@ -114,13 +114,14 @@
// PAGE_BOOTLOADER:
#define WCS_WIN12BAK PAGE_PROG_JSON
#define WCS_WIN12MID PAGE_SERVICEMAIN
#define WCS_WIN12FWD PAGE_NEXT16
//#define WCS_WIN12FWD PAGE_NEXT16
#define WCS_WIN12FWD PAGE_SERVICEMAIN
// PAGE_NEXT16
#define WCS_WIN16BAK PAGE_BOOTLOADER
#define WCS_WIN16BAK PAGE_SERVICEMAIN
#define WCS_WIN16MID PAGE_SERVICEMAIN
#define WCS_WIN16FWD PAGE_NEXT17
#define WCS_WIN16FWD PAGE_SERVICEMAIN
// PAGE_NEXT17
#define WCS_WIN17BAK PAGE_NEXT16
@ -165,7 +166,7 @@
#define WIN02_LABEL_SHORT07 "Printer"
#define WCS_WIN02SHORT07 PAGE_PRINTER
#define WIN02_LABEL_SHORT08 "Accounting"
#define WIN02_LABEL_SHORT08 "Account"
#define WCS_WIN02SHORT08 PAGE_VAULTRECORD
#define WIN02_LABEL_SHORT09 "Program"
#define WCS_WIN02SHORT09 PAGE_PROG_JSON

View File

@ -202,6 +202,13 @@ T_win02::T_win02(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
connect(AutSendButton, SIGNAL(clicked()), this, SLOT(callAutoSend()));
// new 4.6.2024: wake DC
AutSendButton = new QPushButton(tr("&Automatic\n reading")); // &A --> also keycode Alt-A possible
myLayout->addWidget(AutSendButton,3,4);
AutSendButton->setCheckable(true); // true = toggle button
AutSendButton->setAutoDefault(true); // beim start aus
AutSendButton->setMinimumHeight(50);
connect(AutSendButton, SIGNAL(clicked()), this, SLOT(callAutoSend()));
systTime = new QTime();
@ -246,7 +253,7 @@ T_win02::~T_win02()
void T_win02::Nav_back(void)
{
//myNextStep=WCS_WIN02BAK;
myNextStep=WCS_WIN02BAK;
}
void T_win02::Nav_home(void)
@ -332,6 +339,9 @@ void T_win02::callAutoSend()
}
// ptu_switchWake(true);
bool T_win02::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
{
// one state of the vending/operating FSM
@ -343,7 +353,7 @@ bool T_win02::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // needed 0=no change
//*useNavi=SWITCH_BACK_ON | SWITCH_HOME_OFF | SWITCH_NEXT_ON; just for master
*useNavi=SWITCH_BACK_OFF | SWITCH_HOME_OFF | SWITCH_NEXT_ON;
*useNavi=SWITCH_BACK_ON | SWITCH_HOME_OFF | SWITCH_NEXT_ON;
myNextStep=0;
return false;
@ -393,6 +403,7 @@ bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi)
{
labState->setText(" no connection\n to DC ");
labState->setStyleSheet(COLORYELLOW);
//qDebug()<<"lost connection to DC";
}
HWaccess->readback_machineIDdata(&len, buf);

View File

@ -195,19 +195,24 @@ void T_win03::ButtonTime2sysClicked(void)
void T_win03::ButtonTime2dcClicked(void)
{
/*
localTime.rtc_hour = systTime->currentTime().hour();
localTime.rtc_min = systTime->currentTime().minute();
localTime.rtc_sec = systTime->currentTime().second();
localTime.rtc_year = uint8_t(systDate->currentDate().year()%100);
//localTime.rtc_year = uint8_t(systDate->currentDate().year()%100);
localTime.rtc_year = systDate->currentDate().year();
localTime.rtc_month= systDate->currentDate().month();
localTime.rtc_dayOfMonth= systDate->currentDate().day();
//localTime.rtc_dayOfWeek = swl_weekday(systDate->currentDate().year(), systDate->currentDate().month(), systDate->currentDate().day());
localTime.rtc_dayOfWeek = systDate->currentDate().dayOfWeek(); // oder so
HWaccess->rtc_setTimeDateDirect(&localTime);
//qDebug()<<"send date/time to DC ";
//qDebug()<<"date: " << localTime.rtc_year << localTime.rtc_month << localTime.rtc_dayOfMonth << localTime.rtc_dayOfWeek ;
//qDebug()<<"time: " << localTime.rtc_hour << localTime.rtc_min << localTime.rtc_sec;
qDebug()<<"send date/time to DC ";
qDebug()<<"date: " << localTime.rtc_year << localTime.rtc_month << localTime.rtc_dayOfMonth << localTime.rtc_dayOfWeek ;
qDebug()<<"time: " << localTime.rtc_hour << localTime.rtc_min << localTime.rtc_sec;
HWaccess->rtc_setTimeDateDirect(&localTime);
*/
HWaccess->rtc_setDateTime();
}
void T_win03::ButtonSetTimeClicked(void)
@ -222,14 +227,18 @@ void T_win03::ButtonSetTimeClicked(void)
localTime.rtc_hour = myTime.hour();
localTime.rtc_min = myTime.minute();
localTime.rtc_sec = myTime.second();
localTime.rtc_year = uint8_t(myDate.year()%100);
uint16_t val=myDate.year();
val%=100;
localTime.rtc_year = uint8_t(val);
localTime.rtc_month= myDate.month();
localTime.rtc_dayOfMonth= myDate.day();
localTime.rtc_dayOfWeek = myDate.dayOfWeek();
qDebug()<<"send manual date/time to DC ";
qDebug()<<"date: " << localTime.rtc_year << localTime.rtc_month << localTime.rtc_dayOfMonth << localTime.rtc_dayOfWeek ;
qDebug()<<"time: " << localTime.rtc_hour << localTime.rtc_min << localTime.rtc_sec;
HWaccess->rtc_setTimeDateDirect(&localTime);
//qDebug()<<"send manual date/time to DC ";
//qDebug()<<"date: " << localTime.rtc_year << localTime.rtc_month << localTime.rtc_dayOfMonth << localTime.rtc_dayOfWeek ;
//qDebug()<<"time: " << localTime.rtc_hour << localTime.rtc_min << localTime.rtc_sec;
}

View File

@ -173,13 +173,16 @@ bool T_win04::working(uint16_t *nextScreen, uint8_t *useNavi)
*useNavi=0;
struct T_moduleCondition myDevCond;
struct T_dynamicCondition myDynMachCond;
//struct T_devices devPara; // used devices
struct T_devices devPara; // used devices
HWaccess->sys_restoreDeviceParameter(&devPara);
if (!win04_dataAreValid)
{
win04_dataAreValid=1;
win4_showDeviceState->clear();
HWaccess->sys_getDeviceConditions(&myDevCond);
entryDevState("Internal Ram : ", myDevCond.ram );
entryDevState("Internal Eeprom: ", myDevCond.intEe );
entryDevState("External Eeprom: ", myDevCond.extEe );
@ -250,7 +253,14 @@ bool T_win04::working(uint16_t *nextScreen, uint8_t *useNavi)
entryMachineCond("Print result : ", myDynMachCond.resultOfLastTemplPrint );
entryMachineCond("last Pri. Stat: ", myDynMachCond.lastPrinterStatus );
entryMachineCond("startup run : ", myDynMachCond.startupTestIsRunning);
//entryMachineCond(": ", myDynMachCond. );
entryMachineCond("totalNrOfCuts: ", myDynMachCond.totalNrOfCuts );
entryMachineCond("nextAccountNumber: ", myDynMachCond.nextAccountNumber );
entryMachineCond("nrOfBillsInBox: ", myDynMachCond.nrOfBillsInBox );
entryMachineCond("amountInBillbox: ", myDynMachCond.amountInBillbox );
entryMachineCond("UbatAtLastPrint: ", myDynMachCond.UbatAtLastPrint );
entryMachineCond("reserve08: ", myDynMachCond.reserve08 );
entryMachineCond("reserve14: ", myDynMachCond.reserve14);
win4_showErrors->clear();
win4_devParameters->clear();
@ -273,12 +283,12 @@ bool T_win04::working(uint16_t *nextScreen, uint8_t *useNavi)
if (myDevCond.coinEscrow>=200) win4_showErrors->addItem("Error Coin escrow");
if (myDevCond.coinChecker==3)
if (devPara.kindOfCoinChecker==3)
{
if (myDevCond.changer>=200) win4_showErrors->addItem("Error Coin changer");
}
if (myDevCond.coinChecker>0) // irgendeiner
if (devPara.kindOfCoinChecker>0) // irgendeiner
{
if (myDevCond.coinSafe==200)
win4_showErrors->addItem("Error no cash box ");
@ -309,7 +319,7 @@ bool T_win04::working(uint16_t *nextScreen, uint8_t *useNavi)
if (myDevCond.printer==100) win4_showErrors->addItem("Warning Printer NearPaperEnd");
if (myDevCond.coinChecker>0)
if (devPara.kindOfCoinChecker>0) // irgendeiner
{
if (myDevCond.coinSafe>=100 && myDevCond.coinSafe<200)
win4_showErrors->addItem("Warning cash box almost full");

View File

@ -29,6 +29,7 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
butPrnPow->setChecked(true);
connect(butPrnPow, SIGNAL(clicked()), this, SLOT(slot_powerButton()));
myTabFont.setPixelSize(14);
QLabel *lab14 =new QLabel(tr("external low paper sensor:"));
lab14->setFont(myTabFont);
@ -41,6 +42,9 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
lab15->setFrameStyle(3);
myLayout->addWidget(lab15,1,3);
QLabel *lab30 = new QLabel(" ");
myLayout->addWidget(lab30,2,0);
myTabFont.setPixelSize(PIXELSIZE_LABEL);
QLabel *lab12 =new QLabel(tr("State:"));
lab12->setFont(myTabFont);
@ -63,8 +67,51 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
cb_templNr->setMaxVisibleItems(5);
cb_templNr->setStyleSheet("QScrollBar:vertical { width: 30px; }");
//myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
QPushButton *butPrint2 = new QPushButton(" print\ntemplate");
myLayout->addWidget(butPrint2,3,3);
connect(butPrint2, SIGNAL(clicked()), this, SLOT(slot_printVaris()));
QLabel *lab31 = new QLabel(" ");
myLayout->addWidget(lab31,4,0);
// myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_LABEL);
QLabel *lab13 =new QLabel(tr("Result:"));
lab13->setFont(myTabFont);
myLayout->addWidget(lab13,5,0);
myTabFont.setPixelSize(PIXELSIZE_BIGFONT);
showPrnResult =new QLabel(tr(" "));
showPrnResult->setFont(myTabFont);
showPrnResult->setFrameStyle(1);
myLayout->addWidget(showPrnResult,5,1);
// Anzeige: DC-connection
labState =new QLabel(tr("------------")); // datenverkehr läuft
labState->setFont(myTabFont);
labState->setFrameStyle(1);
myLayout->addWidget(labState,5,2);
QLabel *lab32 = new QLabel(" ");
myLayout->addWidget(lab32,6,0);
// myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_LABEL);
QLabel *lab16 =new QLabel(tr("Signals:"));
lab16->setFont(myTabFont);
myLayout->addWidget(lab16,7,0);
myTabFont.setPixelSize(PIXELSIZE_DATA);
labSignal =new QLabel(tr(" "));
labSignal->setFont(myTabFont);
labSignal->setFrameStyle(1);
myLayout->addWidget(labSignal,7,1);
cb_kombiNr = new QComboBox();
myLayout->addWidget(cb_kombiNr,5,2);
myLayout->addWidget(cb_kombiNr,7,2);
for (nn=1; nn<=8; nn++)
cb_kombiNr->addItem(swl_int2str(nn));
cb_kombiNr->setFont(myTabFont);
@ -77,67 +124,12 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
// cb_kombiNr->setStyleSheet(QComboBox::downarrow {width: 30px; });
//cb_kombiNr->adjustSize();
//myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
QPushButton *butPrint2 = new QPushButton(" print\ntemplate");
myLayout->addWidget(butPrint2,3,3);
connect(butPrint2, SIGNAL(clicked()), this, SLOT(slot_printVaris()));
QPushButton *butPrint6 = new QPushButton(" print\ncombi");
myLayout->addWidget(butPrint6,5,3);
myLayout->addWidget(butPrint6,7,3);
connect(butPrint6, SIGNAL(clicked()), this, SLOT(slot_printCombi()));
// myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_LABEL);
QLabel *lab13 =new QLabel(tr("Result:"));
lab13->setFont(myTabFont);
myLayout->addWidget(lab13,4,0);
myTabFont.setPixelSize(PIXELSIZE_BIGFONT);
showPrnResult =new QLabel(tr(" "));
showPrnResult->setFont(myTabFont);
showPrnResult->setFrameStyle(1);
myLayout->addWidget(showPrnResult,4,1);
// myTabFont.setPixelSize(14);
myTabFont.setPixelSize(PIXELSIZE_LABEL);
QLabel *lab16 =new QLabel(tr("Signals:"));
lab16->setFont(myTabFont);
myLayout->addWidget(lab16,5,0);
myTabFont.setPixelSize(PIXELSIZE_DATA);
labSignal =new QLabel(tr(" "));
labSignal->setFont(myTabFont);
labSignal->setFrameStyle(1);
myLayout->addWidget(labSignal,5,1);
myTabFont.setPixelSize(PIXELSIZE_SMALLFONT);
QLabel *lab10 =new QLabel(tr("send dummy values: "));
lab10->setFont(myTabFont);
myLayout->addWidget(lab10,13,0);
QPushButton *butSendDyn1 = new QPushButton("V1_abcde V2_ghijk V3_mnopq V4_stuvw\nV5_ABCDE V6_GHIJK V7_MNOPQ V8_STUVW");
myLayout->addWidget(butSendDyn1,13,1);
connect(butSendDyn1, SIGNAL(clicked()), this, SLOT(slot_sendDD1()));
QPushButton *butSendDyn2 = new QPushButton("V1_00011 V2_00022 V3_00033 V4_00044\nV5_00055 V6_00066 V7_00077 V8_00088");
myLayout->addWidget(butSendDyn2,13,2);
connect(butSendDyn2, SIGNAL(clicked()), this, SLOT(slot_sendDD2()));
lab6 =new QLabel(tr("read back: "));
lab6->setFont(myTabFont);
myLayout->addWidget(lab6,16,0);
lab7 =new QLabel(tr(" "));
lab7->setFont(myTabFont);
lab7->setFrameStyle(1);
myLayout->addWidget(lab7,16,1);
myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
QPushButton *butGetDD = new QPushButton("read\nback");
myLayout->addWidget(butGetDD,16,2);
connect(butGetDD, SIGNAL(clicked()), this, SLOT(slot_rdBackDD()));
QLabel *lab33 = new QLabel(" ");
myLayout->addWidget(lab33,8,0);
QPushButton *butPrint3 = new QPushButton("print \nLogo");
myLayout->addWidget(butPrint3,19,0);
@ -155,16 +147,18 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myLayout->addWidget(butPrint5,19,3);
connect(butPrint5, SIGNAL(clicked()), this, SLOT(slot_printCut()));
QLabel *lab34 = new QLabel(" ");
myLayout->addWidget(lab34,20,0);
// -------------------------------------------------------------
// 25.6.23 dazu:
QPushButton *butPrint10 = new QPushButton("Send\nText");
myLayout->addWidget(butPrint10,22,0);
connect(butPrint10, SIGNAL(clicked()), this, SLOT(slot_sendText()));
QPushButton *butPrint20 = new QPushButton("Print QR\n");
myLayout->addWidget(butPrint20,22,0);
connect(butPrint20, SIGNAL(clicked()), this, SLOT(slot_printQr()));
QPushButton *butPrint30 = new QPushButton("Print Text\n");
myLayout->addWidget(butPrint30,22,1);
connect(butPrint30, SIGNAL(clicked()), this, SLOT(slot_sendText()));
QPushButton *butPrint11 = new QPushButton("Setup");
myLayout->addWidget(butPrint11,22,1);
connect(butPrint11, SIGNAL(clicked()), this, SLOT(slot_setup()));
QPushButton *butPrint12 = new QPushButton("Move \n Paper");
myLayout->addWidget(butPrint12,22,2);
@ -174,7 +168,7 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myLayout->addWidget(butPrint15,22,3);
connect(butPrint15, SIGNAL(clicked()), this, SLOT(slot_movBack()));
/*
QPushButton *butPrint13 = new QPushButton(" set \nFonts");
myLayout->addWidget(butPrint13,23,1);
connect(butPrint13, SIGNAL(clicked()), this, SLOT(slot_fonts()));
@ -182,14 +176,7 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
QPushButton *butPrint14 = new QPushButton(" set \nLetters");
myLayout->addWidget(butPrint14,23,2);
connect(butPrint14, SIGNAL(clicked()), this, SLOT(slot_letters()));
QPushButton *butPrint20 = new QPushButton("Print QR\n");
myLayout->addWidget(butPrint20,23,0);
connect(butPrint20, SIGNAL(clicked()), this, SLOT(slot_printQr()));
*/
setLayout(myLayout);
myNextStep=0;
@ -208,7 +195,7 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
dummyText.clear();
/*
dummyText.append(" Quod equidem non reprehendo; Lorem ipsum dolor sit amet, consectetur adipiscing elit. ");
dummyText.append(" Quibus natura iure responderit non esse verum aliunde finem beate vivendi, ");
dummyText.append(" a se principia rei gerendae peti; Quae enim adhuc protulisti, popularia sunt, ");
@ -226,10 +213,10 @@ T_win06::T_win06(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
dummyText.append("beato M. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Quod si ita sit, cur ");
dummyText.append("opera philosophiae sit danda nescio. valde probata sunt, quod item fratri puto");
dummyText.truncate(1278);
*/
dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
//dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
//dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
//dummyText.append("abcdefghijklmnopqrstuvwxyz0123ABCDEFGHIJKLMNOPQRSTUVWXYZ4567"); // 60byte
@ -283,6 +270,7 @@ void T_win06::slot_printVaris(void)
int val=cb_templNr->currentIndex();
val++;
HWaccess->prn_printTemplate(val);
/* test
val++;
HWaccess->prn_printTemplate(val);
val++;
@ -297,7 +285,7 @@ void T_win06::slot_printVaris(void)
HWaccess->prn_printTemplate(val);
val++;
HWaccess->prn_printTemplate(val);
*/
}
void T_win06::slot_printCombi(void)
@ -384,9 +372,23 @@ void T_win06::slot_printCut(void)
void T_win06::slot_sendText(void)
{
HWaccess->prn_switchPower(1);
uint8_t wayInMm=30;
uint8_t direction=1;
HWaccess->prn_switchPower(1);
HWaccess->prn_movePaper(wayInMm, direction);
//direction: 1=forward 2=backward
//void prn_newLine(uint8_t nrOfLines) const override;
HWaccess->prn_sendText(&dummyText);
// up to 1280 bytes
HWaccess->prn_movePaper(wayInMm, direction);
HWaccess->prn_cut(1);
}
void T_win06::slot_setup(void)
@ -486,8 +488,6 @@ void T_win06::slot_(void)
*/
bool T_win06::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
{
// one state of the vending/operating FSM
@ -517,45 +517,15 @@ bool T_win06::working(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // 0=no change
*useNavi=0;
QString myStr;
uint8_t buf[66];
char ctmp;
//uint8_t buf[66];
//char ctmp;
uint8_t uctmp;
bool btmp;
// Ruecklesen und anzeigen der dyn. Variablen
myStr.clear();
btmp=HWaccess->prn_getCurrentDynamicPrnValuesFromDC(buf);
if (btmp)
{
for (int nn=0; nn<32; nn++)
{
ctmp=char(buf[nn]);
myStr.append(ctmp);
}
myStr.append('\n');
for (int nn=32; nn<64; nn++)
{
ctmp=char(buf[nn]);
myStr.append(ctmp);
}
lab7->setText(myStr);
if (HWaccess->prn_dynDataAreEqual(buf))
//lab9->setText("equal");
lab7->setStyleSheet("background-color: rgb(150,230,150)"); // hell grün
else
//lab9->setText("wrong");
lab7->setStyleSheet("background-color: rgb(250,150,150)"); // hell rot
}
//bool btmp;
// clear signals after 2s:
if (!myTO->isActive())
labSignal->setText(" ");
// HWaccess->sys_getDynMachineConditions(&myDynMachCond);
uctmp=HWaccess->prn_getCurrentPrinterState();
// 0: printer OK
// bit0: near paper end bit1: no paper
@ -628,31 +598,18 @@ bool T_win06::working(uint16_t *nextScreen, uint8_t *useNavi)
butPrnPow->setText("Power");
}
/*
uctmp=HWaccess->log_getAnswerToLastCmdBatch();
// 0xFF: no command sent by now
// 0: started, in progress
// 1: done and OK
// 2: done and error
myStr.clear();
myStr.append(QString::number(uctmp));
label16->setText(myStr);
uctmp=HWaccess->log_getAnswerToLastSlaveRequest();
// use only for ONE request/command
// return: 0xFF: result unknown by now as sending is ongoing
// 0=OK
// 1= wrong length 2=wrong start sign 5= wrong crc
// 6= slave: master cmd was wrong 7: slave: could not write/read data
// 8=timeout, got no response from slave
myStr.clear();
myStr.append(QString::number(uctmp));
label17->setText(myStr);
*/
// update values:
if (HWaccess->sys_areDCdataValid())
{
labState->setText(" DC2 connected "); // datenverkehr läuft
labState->setStyleSheet(COLORGREEN);
} else
{
labState->setText(" no connection\n to DC ");
labState->setStyleSheet(COLORYELLOW);
//qDebug()<<"lost connection to DC";
}
if (myNextStep)
{

View File

@ -42,6 +42,7 @@ class T_win06 : public QWidget
QLabel *lab9;
QLabel *labSignal;
QLabel *lab15;
QLabel *labState;
QLabel *label16;
QLabel *label17;
@ -95,7 +96,7 @@ private slots:
void slot_fonts(void);
void slot_letters(void);
void slot_printQr(void);
//void slot_printTXT(void);
};

View File

@ -96,7 +96,7 @@ T_win09::T_win09(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myLayout->addWidget(lab11,10,1);
pbCreditWake = new QPushButton("Creditcard wake");
pbCreditWake->setCheckable(false); // true = toggle button
pbCreditWake->setCheckable(true); // true = toggle button
pbCreditWake->setFont(myTabFont);
pbCreditWake->setStyleSheet("background-color: white");
myLayout->addWidget(pbCreditWake, 11, 1);
@ -105,14 +105,14 @@ T_win09::T_win09(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
lab7 =new QLabel(tr(" "));
lab7->setFont(myTabFont);
myLayout->addWidget(lab7,12,1);
/*
pbCreditWake = new QPushButton("restart System test (20s!)");
pbCreditWake->setCheckable(false); // true = toggle button
pbCreditWake->setFont(myTabFont);
pbCreditWake->setStyleSheet("background-color: white");
myLayout->addWidget(pbCreditWake, 13, 1);
connect(pbCreditWake, SIGNAL(clicked()), this, SLOT(slot_startTest()));
*/
setLayout(myLayout);
myNextStep=0;
@ -180,14 +180,28 @@ void T_win09::slot_CreditPower(void)
if (pbCreditPwr->isChecked())
{
HWaccess->credit_switchPower(true);
pbCreditPwr->setStyleSheet("background-color: green");
} else
{
HWaccess->credit_switchPower(false);
pbCreditPwr->setStyleSheet("background-color: white");
}
}
void T_win09::slot_CreditWake(void)
{
HWaccess->credit_switchWake(true);
myTO->start(200);
if (pbCreditWake->isChecked())
{
pbCreditWake->setStyleSheet("background-color: green");
HWaccess->credit_switchWake(false); // LOW-ACTIVE
} else
{
pbCreditWake->setStyleSheet("background-color: white");
HWaccess->credit_switchWake(true);
}
myTO->start(200);
wakeTerminal=true;
}
@ -235,8 +249,8 @@ bool T_win09::working(uint16_t *nextScreen, uint8_t *useNavi)
// time out
if (wakeModem)
HWaccess->mod_switchWake(false);
if (wakeTerminal)
HWaccess->credit_switchWake(false);
//if (wakeTerminal)
// HWaccess->credit_switchWake(false);
if (resetModem)
HWaccess->aux_setOutputs(0);
@ -250,14 +264,16 @@ bool T_win09::working(uint16_t *nextScreen, uint8_t *useNavi)
if (bret)
pbModemPwr->setStyleSheet("background-color: green");
else
pbCreditPwr->setStyleSheet("background-color: white");
pbModemPwr->setStyleSheet("background-color: white");
bret=HWaccess->cred_isCreditPowerOn();
//bret=HWaccess->cred_isCreditPowerOn(); // funktioniert nicht
/*
bret=pbCreditPwr->isChecked();
if (bret)
pbCreditPwr->setStyleSheet("background-color: green");
else
pbCreditPwr->setStyleSheet("background-color: white");
*/
// restart complete system test with cmd 149

View File

@ -5,6 +5,7 @@
#define BUTTONCOLORGOT "background-color: green"
#define BUTTONCOLORBAD "background-color: red"
#define BUTTONCOLORGOOD "background-color: green"
#define MYBUTTONHEIGT 40
static char updateList, wait4data;
static uint8_t pwreq;
@ -36,6 +37,7 @@ T_win11::T_win11(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
//myLayout = new QGridLayout;
mainHLayout = new QHBoxLayout;
veryLeftLayout = new QVBoxLayout;
leftLayout = new QVBoxLayout;
RightLayout = new QVBoxLayout;
@ -53,13 +55,7 @@ T_win11::T_win11(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
// availAccNrList.append("8");
availAccNrList.clear();
// left side: big ListWindow to show accounting record
but2 = new QPushButton(" Load Data");
leftLayout->addWidget(but2);
connect(but2, SIGNAL(clicked()), this, SLOT(slot_loadData()));
but2->setStyleSheet(BUTTONCOLOR0); // BUTTONCOLORWAIT BUTTONCOLORGOT
but2->setFont(myTabFont);
// middle: big ListWindow to show accounting record
QLabel *lab1 =new QLabel("accounting data:");
leftLayout->addWidget(lab1);
@ -69,26 +65,35 @@ T_win11::T_win11(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
win11_showVaultRecord = new QListWidget;
win11_showVaultRecord->setFont(myTabFont);
//win11_showVaultRecord->setMinimumHeight(200);
win11_showVaultRecord->setMinimumWidth(500);
win11_showVaultRecord->setMinimumWidth(300);
leftLayout->addWidget(win11_showVaultRecord);
//win11_showVaultRecord->addItem("data 123");
win11_showVaultRecord->setLineWidth(3);
// right side:
but2 = new QPushButton(" Load Data");
veryLeftLayout->addWidget(but2);
connect(but2, SIGNAL(clicked()), this, SLOT(slot_loadData()));
but2->setStyleSheet(BUTTONCOLOR0); // BUTTONCOLORWAIT BUTTONCOLORGOT
but2->setFont(myTabFont);
but2->setMinimumHeight(MYBUTTONHEIGT);
QLabel *lab59 =new QLabel(" ");
veryLeftLayout->addWidget(lab59);
myTabFont.setPixelSize(20);
but1 = new QPushButton(" Reload Acc. Nrs");
RightLayout->addWidget(but1);
//RightLayout->addWidget(but1);
veryLeftLayout->addWidget(but1); // am 15.5.24 nach links
connect(but1, SIGNAL(clicked()), this, SLOT(slot_loadNumbers()));
but1->setFont(myTabFont);
but1->setStyleSheet(BUTTONCOLOR0); // BUTTONCOLORWAIT BUTTONCOLORGOT
//QLabel *lab6 =new QLabel(" ");
//RightLayout->addWidget(lab6);
but1->setMinimumHeight(MYBUTTONHEIGT);
QLabel *lab4 =new QLabel("select Acc. Nr.:");
RightLayout->addWidget(lab4);
//RightLayout->addWidget(lab4);
veryLeftLayout->addWidget(lab4); // am 15.5.24 nach links
lab4->setFont(myTabFont);
QFont myCBfont;
@ -104,48 +109,46 @@ T_win11::T_win11(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
cb_selAccNr->setMaxVisibleItems(8);
cb_selAccNr->setStyleSheet("QComboBox { font-size: 20px; }"); // gilt fuer Liste und Eingabezeile
//cb_selAccNr->setStyleSheet("QScrollBar:vertical { width: 30px; }");
RightLayout->addWidget(cb_selAccNr);
//RightLayout->addWidget(cb_selAccNr);
veryLeftLayout->addWidget(cb_selAccNr); // am 15.5.24 nach links
//myTabFont.setPixelSize(16);
//QLabel *lab5 =new QLabel(" ");
//RightLayout->addWidget(lab5);
//lab5->setFont(myTabFont);
/*
myTabFont.setPixelSize(16);
QLabel *lab2 =new QLabel("available AccNrs.:");
lab2->setFont(myTabFont);
RightLayout->addWidget(lab2);
myTabFont.setPixelSize(16);
win11_showAccNrs = new QListWidget;
win11_showAccNrs->setFont(myTabFont);
//win11_showAccNrs->setMinimumHeight(200);
//win11_showAccNrs->setMinimumWidth(100);
win11_showAccNrs->setLineWidth(3);
win11_showAccNrs->clear();
win11_showAccNrs->addItems(availAccNrList);
RightLayout->addWidget(win11_showAccNrs);
*/
//QLabel *lab3 =new QLabel(" ");
//RightLayout->addWidget(lab3);
QLabel *lab60 =new QLabel(" ");
veryLeftLayout->addWidget(lab60);
QLabel *lab61 =new QLabel(" ");
veryLeftLayout->addWidget(lab61);
but3 = new QPushButton(" print ");
RightLayout->addWidget(but3);
// RightLayout->addWidget(but3);
veryLeftLayout->addWidget(but3); // am 15.5.24 nach links
connect(but3, SIGNAL(clicked()), this, SLOT(slot_printSel()));
but3->setStyleSheet(BUTTONCOLOR0);
but3->setFont(myTabFont);
but3->setMinimumHeight(MYBUTTONHEIGT);
QLabel *lab62 =new QLabel(" ");
veryLeftLayout->addWidget(lab62);
but4 = new QPushButton(" verify ");
RightLayout->addWidget(but4);
// RightLayout->addWidget(but4);
veryLeftLayout->addWidget(but4); // am 15.5.24 nach links
connect(but4, SIGNAL(clicked()), this, SLOT(slot_crc()));
but4->setStyleSheet(BUTTONCOLOR0);
but4->setFont(myTabFont);
but4->setMinimumHeight(MYBUTTONHEIGT);
but5 = new QPushButton("read acc-nr");
but5 = new QPushButton("get acc-nr");
RightLayout->addWidget(but5);
connect(but5, SIGNAL(clicked()), this, SLOT(slot_readNr()));
but5->setStyleSheet(BUTTONCOLOR0);
but5->setFont(myTabFont);
but5->setMinimumHeight(MYBUTTONHEIGT);
but20 = new QPushButton("set new acc-nr");
RightLayout->addWidget(but20);
connect(but20, SIGNAL(clicked()), this, SLOT(slot_setNextAccNr()));
but20->setStyleSheet(BUTTONCOLOR0);
but20->setFont(myTabFont);
but20->setMinimumHeight(MYBUTTONHEIGT);
//disp_CurrentAccNr=new QLabel();
disp_CurrentAccNr=new QLineEdit(); // mit Eingabemoeglichkeit!
@ -154,37 +157,38 @@ T_win11::T_win11(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
//disp_CurrentAccNr->setLineWidth(3);
disp_CurrentAccNr->setStyleSheet(BUTTONCOLOR0);
disp_CurrentAccNr->setEnabled(true);
// neu, 15.5.24:
//connect(disp_CurrentAccNr, SIGNAL(cursorPositionChanged()), this, SLOT(slot_setNextAccNr()));
// geht nicht :(
myTabFont.setPixelSize(16);
//QLabel *lab5 =new QLabel(" ");
//RightLayout->addWidget(lab5);
//lab5->setFont(myTabFont);
myTabFont.setPixelSize(20);
myKeypad = new T_keypad();
leftLayout->addWidget(myKeypad);
connect(myKeypad, SIGNAL(keyEntryFinished()), this, SLOT(valueIsSet()));
but6 = new QPushButton("set acc-nr");
but6 = new QPushButton("send new acc-nr");
RightLayout->addWidget(but6);
connect(but6, SIGNAL(clicked()), this, SLOT(slot_setAccNr()));
connect(but6, SIGNAL(clicked()), this, SLOT(slot_sendNewAccNr()));
but6->setStyleSheet(BUTTONCOLOR0);
but6->setFont(myTabFont);
but6->setMinimumHeight(MYBUTTONHEIGT);
but7 = new QPushButton("delete all DC-data");
RightLayout->addWidget(but7);
connect(but7, SIGNAL(clicked()), this, SLOT(slot_deleteAccData()));
but7->setStyleSheet(BUTTONCOLOR0);
but7->setFont(myTabFont);
but7->setMinimumHeight(MYBUTTONHEIGT);
but8 = new QPushButton("delete all Totals");
RightLayout->addWidget(but8);
connect(but8, SIGNAL(clicked()), this, SLOT(slot_deleteTotals()));
but8->setStyleSheet(BUTTONCOLOR0);
but8->setFont(myTabFont);
but8->setMinimumHeight(MYBUTTONHEIGT);
but8->setMinimumHeight(MYBUTTONHEIGT);
mainHLayout->addLayout(veryLeftLayout);
mainHLayout->addLayout(leftLayout);
mainHLayout->addLayout(RightLayout);
@ -293,11 +297,23 @@ void T_win11::slot_readNr(void)
}
void T_win11::slot_setAccNr(void)
void T_win11::slot_setNextAccNr(void)
{
pwreq=10;
myKeypad->setText("new accNr:");
myKeypad->keysVisible(1);
myKeypad->show(); // display pinpad
}
void T_win11::slot_sendNewAccNr(void)
{
// set new accouning number
// request password before
pwreq=1;
myKeypad->setText("Password:");
myKeypad->keysVisible(2);
myKeypad->show(); // display pinpad for password entry
}
@ -305,6 +321,7 @@ void T_win11::slot_setAccNr(void)
void T_win11::slot_deleteAccData(void)
{
pwreq=2;
myKeypad->setText("Password:");
myKeypad->keysVisible(2);
myKeypad->show();
}
@ -312,6 +329,7 @@ void T_win11::slot_deleteAccData(void)
void T_win11::slot_deleteTotals(void)
{
pwreq=3;
myKeypad->setText("Password:");
myKeypad->keysVisible(2);
myKeypad->show();
}
@ -328,6 +346,7 @@ void T_win11::valueIsSet(void)
if (myPW=="92706") // compare password
{
//qDebug()<<"PW correct";
myStr=disp_CurrentAccNr->text(); // new value was set before PW
uint16_t nxtAn=myStr.toUInt(&ok,10);
if (ok)
@ -352,6 +371,11 @@ void T_win11::valueIsSet(void)
HWaccess->log_DC_deleteAllTotalCounters();
disp_CurrentAccNr->setText("->all totals deleted");
}
}else
if (pwreq==10) // new acc nr
{
//swl_str2ulong(pwreq);
disp_CurrentAccNr->setText(myPW);
}
pwreq=0;

View File

@ -33,13 +33,13 @@ class T_win11 : public QWidget
//QGridLayout *myLayout;
QHBoxLayout *mainHLayout;
QVBoxLayout *leftLayout;
QVBoxLayout *leftLayout, *veryLeftLayout;
QVBoxLayout *RightLayout;
QListWidget *win11_showVaultRecord;
//QListWidget *win11_showAccNrs;
QStringList availAccNrList;
QComboBox *cb_selAccNr;
QPushButton *but1, *but2, *but3, *but4, *but5, *but6, *but7, *but8;
QPushButton *but1, *but2, *but3, *but4, *but5, *but6, *but7, *but8, *but20;
hwinf *HWaccess;
uint16_t myNextStep;
@ -79,7 +79,8 @@ private slots:
void slot_printSel(void);
void slot_crc(void);
void slot_readNr(void);
void slot_setAccNr(void);
void slot_setNextAccNr(void);
void slot_sendNewAccNr(void);
void slot_deleteAccData(void);
void slot_deleteTotals(void);
void valueIsSet(void);

View File

@ -295,8 +295,13 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // 0=no change
*useNavi=0;
int8_t iresult;
//int8_t iresult;
if (HWaccess->bl_isUp())
showState->setText(" Bootloader is running");
/*
if (myStep==0)
{
@ -461,6 +466,7 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
myStep=99;
}
}
*/
if (myNextStep)
{

View File

@ -10,6 +10,7 @@
// file is 0-terminated!
// return false if sending is not possible, wait a second
static bool win13_nowPrinting;
T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
@ -43,7 +44,8 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myH1layer->addLayout(myVlayer_right);
// linke Spalte: laden
pB1 = new QPushButton("load config");
/*
pB1 = new QPushButton("load settings");
myVlayer_left->addWidget(pB1);
pB1->setFont(myTabFont);
connect(pB1, SIGNAL(clicked()), this, SLOT(slot_pb1()));
@ -62,7 +64,7 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myVlayer_left->addWidget(pB4);
pB4->setFont(myTabFont);
connect(pB4, SIGNAL(clicked()), this, SLOT(slot_pb4()));
*/
// Mitte: anzeigen
@ -75,13 +77,24 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
showFile->append(" ");
showFile->append(" ");
// rechte Spalte: zum DC senden
myTabFont.setPixelSize(22);
pB5 = new QPushButton("send config");
// rechte Spalte:
// Laden mit Dialogbox:
pB1 = new QPushButton("L O A D");
myVlayer_right->addWidget(pB1);
pB1->setFont(myTabFont);
connect(pB1, SIGNAL(clicked()), this, SLOT(slot_pb1()));
myTabFont.setPixelSize(22);
pB5 = new QPushButton("S E N D");
myVlayer_right->addWidget(pB5);
pB5->setFont(myTabFont);
connect(pB5, SIGNAL(clicked()), this, SLOT(slot_pb5()));
// Untrscheidung nicht noetig
/*
pB6 = new QPushButton("send devices");
myVlayer_right->addWidget(pB6);
pB6->setFont(myTabFont);
@ -96,8 +109,13 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myVlayer_right->addWidget(pB8);
pB8->setFont(myTabFont);
connect(pB8, SIGNAL(clicked()), this, SLOT(slot_pb8()));
*/
// neu, 23.5.2024
pB9 = new QPushButton("print directly");
myVlayer_right->addWidget(pB9);
pB9->setFont(myTabFont);
connect(pB9, SIGNAL(clicked()), this, SLOT(slot_pb9()));
@ -109,13 +127,7 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myTO->setSingleShot(true);
myTO->start(2000);
this->config_filename = QString(config_path) + QString(filename_config);
this->device_filename = QString(config_path) + QString(filename_device);
this->cash_filename = QString(config_path) + QString(filename_cash);
this->print_filename = QString(config_path) + QString(filename_print);
win13_nowPrinting=false;
}
T_win13::~T_win13()
@ -138,23 +150,38 @@ void T_win13::Nav_next(void)
void T_win13::slot_pb1(void)
{
QString fileName;
showFile->clear();
if (QFileInfo::exists(this->config_filename))
/*
if (datei_ifFileExists(FILENAME_CONFIG))
{
loadedFile=datei_readFromFile(this->config_filename);
loadedFile=datei_readFromFile(FILENAME_CONFIG);
showFile->append(loadedFile);
} else
{
showFile->append("file not found");
}
}
} */
fileName.clear();
fileName = QFileDialog::getOpenFileName(this, ("Select JSON file:"),
"/etc/psa_config",
("binary file(*.json)"));
loadedFile=datei_readFromFile(fileName);
showFile->append(loadedFile);
// neu, 23.5.2024
HWaccess->prn_translateLocalPrinterJson(loadedFile);
}
/*
void T_win13::slot_pb2(void)
{
showFile->clear();
if (QFileInfo::exists(this->device_filename))
if (datei_ifFileExists(FILENAME_DEVICE))
{
loadedFile=datei_readFromFile(this->device_filename);
loadedFile=datei_readFromFile(FILENAME_DEVICE);
showFile->append(loadedFile);
} else
{
@ -165,9 +192,9 @@ void T_win13::slot_pb2(void)
void T_win13::slot_pb3(void)
{
showFile->clear();
if (QFileInfo::exists(this->cash_filename))
if (datei_ifFileExists(FILENAME_CASH))
{
loadedFile=datei_readFromFile(this->cash_filename);
loadedFile=datei_readFromFile(FILENAME_CASH);
showFile->append(loadedFile);
} else
{
@ -178,18 +205,18 @@ void T_win13::slot_pb3(void)
void T_win13::slot_pb4(void)
{
showFile->clear();
if (QFileInfo::exists(this->print_filename))
if (datei_ifFileExists(FILENAME_PRINT))
{
loadedFile=datei_readFromFile(this->print_filename);
loadedFile=datei_readFromFile(FILENAME_PRINT);
showFile->append(loadedFile);
} else
{
showFile->append("file not found");
}
}
*/
// send selected file:
void T_win13::slot_pb5(void) // send config
void T_win13::slot_pb5(void)
{
uint8_t buf800[800];
uint16_t ii, len;
@ -208,7 +235,7 @@ void T_win13::slot_pb5(void) // send config
HWaccess->sys_sendJsonFileToDc(1, 0, buf800);
}
/*
void T_win13::slot_pb6(void)
{
uint8_t buf800[800];
@ -250,6 +277,13 @@ void T_win13::slot_pb8(void)
HWaccess->sys_sendJsonFileToDc(4, 32, buf800);
}
*/
void T_win13::slot_pb9(void)
{
pB9->setStyleSheet("background-color: white");
HWaccess->prn_printTranslatedTicket();
win13_nowPrinting=true;
}
bool T_win13::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
@ -277,10 +311,23 @@ bool T_win13::working(uint16_t *nextScreen, uint8_t *useNavi)
// bit0,1: enable/disable button "next"
// bit2,3: enable/disable button "home"
// bit4,5: enable/disable button "back"
uint8_t result;
*nextScreen=0; // 0=no change
*useNavi=0;
if (win13_nowPrinting)
{
result=HWaccess->prn_waitForDirectTicket();
if (result==1)
pB9->setStyleSheet("background-color: rgb(150,230,150)"); // hell grün
else
if (result>1)
pB9->setStyleSheet("background-color: rgb(250,150,150)"); // hell rot
if (result>0)
win13_nowPrinting=0;
}
if (myStep==0)
{

View File

@ -25,6 +25,8 @@
#include "datei.h"
#include "QDir"
#include "guidefs.h"
#include "QFileDialog"
class T_win13 : public QWidget
{
@ -43,7 +45,7 @@ class T_win13 : public QWidget
QLabel *lab2;
QLabel *lab3;
QTimer *myTO;
QPushButton *pB1, *pB2, *pB3, *pB4, *pB5, *pB6, *pB7, *pB8;
QPushButton *pB1, *pB2, *pB3, *pB4, *pB5, *pB6, *pB7, *pB8, *pB9;
QTextEdit *showFile;
QByteArray loadedFile;
@ -63,19 +65,14 @@ public slots:
void Nav_home(void);
void Nav_next(void);
void slot_pb1(void);
void slot_pb2(void);
void slot_pb3(void);
void slot_pb4(void);
//void slot_pb2(void);
//void slot_pb3(void);
//void slot_pb4(void);
void slot_pb5(void);
void slot_pb6(void);
void slot_pb7(void);
void slot_pb8(void);
private:
QString config_filename;
QString device_filename;
QString cash_filename;
QString print_filename;
//void slot_pb6(void);
//void slot_pb7(void);
//void slot_pb8(void);
void slot_pb9(void);
};

View File

@ -1,5 +1,6 @@
#include "win15_bna.h"
static uint8_t lastNoteCount;
T_win15::T_win15(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
@ -29,7 +30,7 @@ T_win15::T_win15(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myTabFont.setPixelSize(PIXELSIZE_DATA);
showDynamics = new QTextEdit("dynamic values:");
showDynamics->setFont(myTabFont);
showDynamics->setStyleSheet("background-color: white");
showDynamics->setStyleSheet("background-color: yellow");
showDynamics->append(" ");
//myLayout->addWidget(showDynamics,3,1);
myVlayer_left->addWidget(showDynamics);
@ -154,20 +155,20 @@ void T_win15::slot_sendDef(void)
uint16_t bilVals[16];
memset(bilVals,0,32);
bilVals[0]=500;
bilVals[1]=1000;
bilVals[2]=2000;
bilVals[3]=5000;
// bilVals[0]=500;
// bilVals[1]=1000;
// bilVals[2]=2000;
// bilVals[3]=5000;
HWaccess->bna_sendSettings(0b0000000000001111, 0, bilVals, 35000);
HWaccess->bna_sendSettings(0xFFFF, 0, bilVals, 35000);
}
void T_win15::slot_start(void)
{
HWaccess->cash_startPayment(0);
showDynamics->clear();
showDynamics->setStyleSheet("background-color: white");
pb_startPay->setStyleSheet(COLORWHITE);
//showDynamics->clear();
showDynamics->setStyleSheet("background-color: yellow");
lastNoteCount=255; // to display value once on startup
paymentStarted=true;
}
@ -185,9 +186,6 @@ void T_win15::slot_stop(void)
{
//HWaccess->cash_stopPayment();
HWaccess->vend_success();
pb_startPay->setStyleSheet(COLORWHITE);
showDynamics->clear();
showDynamics->setStyleSheet("background-color: white");
paymentStarted=false;
}
@ -202,8 +200,8 @@ bool T_win15::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // needed 0=no change
*useNavi=SWITCH_BACK_ON | SWITCH_HOME_ON | SWITCH_NEXT_ON;
pb_startPay->setChecked(false);
lastNoteCount=255; // to display value once on startup
myNextStep=0;
return false;
}
@ -232,8 +230,13 @@ bool T_win15::working(uint16_t *nextScreen, uint8_t *useNavi)
if (myDynMachCond.paymentInProgress==2)
{
pb_startPay->setStyleSheet(COLORGREEN);
displayDynamics();
pb_startPay->setChecked(true);
} else
{
pb_startPay->setStyleSheet(COLORWHITE);
pb_startPay->setChecked(false);
}
displayDynamics();
displayStacker();
@ -250,7 +253,7 @@ bool T_win15::working(uint16_t *nextScreen, uint8_t *useNavi)
{
myStep++;
myTO->start(200);
HWaccess->bna_requestParameters();
//HWaccess->bna_requestParameters();
//qDebug()<<"win15 requesting bna parameters";
}
} else
@ -261,7 +264,7 @@ bool T_win15::working(uint16_t *nextScreen, uint8_t *useNavi)
{
myStep++;
myTO->start(200);
HWaccess->bna_requestCurrentNotes();
//HWaccess->bna_requestCurrentNotes();
//qDebug()<<"win15 requesting bna new bills";
}
@ -273,7 +276,7 @@ bool T_win15::working(uint16_t *nextScreen, uint8_t *useNavi)
{
myStep=1;
myTO->start(200);
HWaccess->bna_requestStackerLevel();
//HWaccess->bna_requestStackerLevel();
}
@ -313,19 +316,18 @@ void T_win15::displayDynamics(void)
uint8_t ret;
uint16_t currentNotes[8];
uint32_t amount;
static uint8_t lastNoteCount;
ret= HWaccess->bna_getCurrentNotes(0, currentNotes);
// returns number of collected bank notes since start-command (current transaction)
// latestBill: not used
// currentNotes[0] = last bill value
// currentNotes[1] = 0/1 1 if bill in escrow 0 if bill in cash box (stacker)
// currentNotes[2,3] = total sum of collected bills within this transaction
// currentNotes[0] = last bill value
// currentNotes[1] = 0/1 1 if bill in escrow 0 if bill in cash box (stacker)
// currentNotes[2,3] = total sum of collected bills within this transaction
if (paymentStarted==false)
{
// if (paymentStarted==false)
// {
} else
// } else
if (ret==99 )
{
showDynamics->clear();
@ -360,6 +362,7 @@ void T_win15::displayDynamics(void)
amount<<=16;
amount |=currentNotes[2];
showDynamics->append(swl_labelAndValToStr("total : ", amount));
}
}

388
win16.cpp
View File

@ -1,29 +1,79 @@
#include "win16.h"
static char generalState=0;
T_win16::T_win16(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
{
this->HWaccess = HWaccess;
myLayout = new QGridLayout;
//myLayout = new QGridLayout;
myH0layer = new QHBoxLayout;
myVlayer_left = new QVBoxLayout;
myVlayer_midd = new QVBoxLayout;
myVlayer_right = new QVBoxLayout;
myH0layer->addLayout(myVlayer_left);
myH0layer->addLayout(myVlayer_midd);
myH0layer->addLayout(myVlayer_right);
// myVlayer_left->addWidget(lab1);
QFont myTabFont;
myTabFont.setPixelSize(22);
myTabFont.setPixelSize(PIXELSIZE_BIGFONT);
lab1 =new QLabel(tr("win16"));
lab1 =new QLabel(tr("PSA1256DC Doors"));
lab1->setFont(myTabFont);
myLayout->addWidget(lab1,1,0);
myVlayer_left->addWidget(lab1);
myTabFont.setPixelSize(PIXELSIZE_DATA);
win16_showDoors = new QListWidget;
win16_showDoors->setFont(myTabFont);
myVlayer_left->addWidget(win16_showDoors);
win16_showDoors->clear();
win16_showDoors->addItem(" - ");
myTabFont.setPixelSize(PIXELSIZE_BIGFONT);
lab2 =new QLabel(tr(" "));
lab2->setFont(myTabFont);
myLayout->addWidget(lab2,2,0);
lab3 =new QLabel(tr(" "));
lab3->setFont(myTabFont);
myLayout->addWidget(lab3,3,0);
myVlayer_left->addWidget(lab2);
lab3 =new QLabel(tr("PSA1256DC Status"));
lab3->setFont(myTabFont);
myVlayer_left->addWidget(lab3);
myTabFont.setPixelSize(PIXELSIZE_DATA);
win16_showErrors = new QListWidget;
win16_showErrors->setFont(myTabFont);
myVlayer_left->addWidget(win16_showErrors);
win16_showErrors->clear();
win16_showErrors->addItem("no errors, no warnings");
lab4 =new QLabel(tr(" "));
lab4->setFont(myTabFont);
myVlayer_midd->addWidget(lab4);
myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
pb1 = new QPushButton("S E R V I C E");
pb1->setFont(myTabFont);
myVlayer_right->addWidget(pb1);
connect(pb1, SIGNAL(clicked()), this, SLOT(Button1Clicked()));
pb2 = new QPushButton(" D E M O ");
pb2->setFont(myTabFont);
myVlayer_right->addWidget(pb2);
connect(pb2, SIGNAL(clicked()), this, SLOT(Button2Clicked()));
pb3 = new QPushButton(" E X I T ");
pb3->setFont(myTabFont);
myVlayer_right->addWidget(pb3);
connect(pb3, SIGNAL(clicked()), this, SLOT(Button3Clicked()));
//setLayout(myLayout);
setLayout(myH0layer);
setLayout(myLayout);
myNextStep=0;
myStep=0;
@ -51,6 +101,22 @@ void T_win16::Nav_next(void)
myNextStep=WCS_WIN16FWD;
}
void T_win16::Button1Clicked(void)
{
myNextStep=PAGE_SERVICEMAIN;
}
void T_win16::Button2Clicked(void)
{
myNextStep=PAGE_SERVICEMAIN;
}
void T_win16::Button3Clicked(void)
{
//emit quitMyApp();
}
bool T_win16::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
{
@ -81,51 +147,35 @@ bool T_win16::working(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // 0=no change
*useNavi=0;
if (myStep==0)
if (generalState==0)
{
myTO->start(); // restart
win16_showErrors->setStyleSheet("background-color: green");
win16_showErrors->clear();
win16_showErrors->addItem(" *** machine OK ***");
} else
if (myStep==1)
if (generalState==1)
{
if (!myTO->isActive())
{
// time out
}
win16_showErrors->setStyleSheet("background-color: yellow");
} else
if (myStep==2)
if (generalState==2)
{
} else
if (myStep==3)
{
} else
if (myStep==4)
{
} else
if (myStep==5)
{
} else
if (myStep==6)
{
} else
if (myStep==7)
{
} else
{
win16_showErrors->setStyleSheet("background-color: red");
}
if (HWaccess->sys_areDCdataValid())
{
showDoorState();
showErrAndWarn();
win16_showDoors->setStyleSheet(COLORGREY);
} else
{
win16_showDoors->setStyleSheet(COLOR_LIGHTRED);
win16_showErrors->setStyleSheet(COLOR_LIGHTRED);
win16_showDoors->clear();
win16_showDoors->addItem(" DC not connected");
win16_showErrors->clear();
win16_showErrors->addItem(" DC not connected");
}
if (myNextStep)
{
*nextScreen=myNextStep;
@ -134,4 +184,246 @@ bool T_win16::working(uint16_t *nextScreen, uint8_t *useNavi)
return false;
}
void T_win16::showErrAndWarn(void)
{
static struct T_moduleCondition myDevCond;
static struct T_devices devPara; // used devices
uint8_t uctmp;
myDevCond.rtc=0;
myDevCond.changer=0;
devPara.autoAlarm=0;
HWaccess->sys_getDeviceConditions(&myDevCond);
HWaccess->sys_restoreDeviceParameter(&devPara);
qDebug()<<"win16 changer: "<<myDevCond.changer;
win16_showErrors->clear();
generalState=0;
if ( myDevCond.rtc>=200)
{
generalState=2;
win16_showErrors->addItem("Error RTC HW");
} else
if (myDevCond.rtc>=100)
{
if (generalState==0) generalState=1;
win16_showErrors->addItem("Warning RTC time may be wrong");
}
if (myDevCond.printer==200)
{
generalState=2;
win16_showErrors->addItem("Error Printer no response");
} else
{
if (myDevCond.printer==201)
{
generalState=2;
win16_showErrors->addItem("Error Printer HW");
} else
{
if (myDevCond.printer==202)
{
generalState=2;
win16_showErrors->addItem("Error Printer no Paper");
} else
if (myDevCond.printer>=100)
{
if (generalState==0) generalState=1;
win16_showErrors->addItem("Warning Printer NearPaperEnd");
}
}
}
if (myDevCond.coinBlocker>=200)
{
generalState=2;
win16_showErrors->addItem("Error Coin Blocker");
}
if (myDevCond.mdbBus>=200)
{
generalState=2;
win16_showErrors->addItem("Error Mdb Bus");
}
if (myDevCond.intEe>=200)
{
generalState=2;
win16_showErrors->addItem("Error int eeprom");
}
if (myDevCond.coinChecker>=200)
{
generalState=2;
win16_showErrors->addItem("Error Coin checker");
}
if (myDevCond.coinEscrow>=200)
{
generalState=2;
win16_showErrors->addItem("Error Coin escrow");
}
if (devPara.kindOfCoinChecker==3)
{
uctmp = myDevCond.changer;
if (uctmp>=200)
{
generalState=2;
win16_showErrors->addItem("Error Coin changer");
}
}
if (devPara.kindOfCoinChecker>0)
{
if (myDevCond.coinSafe==200)
{
generalState=2;
win16_showErrors->addItem("Error no cash box ");
}
if (myDevCond.coinSafe==201)
{
generalState=2;
win16_showErrors->addItem("Error cash box full");
}
}
if ( myDevCond.billReader>=200 )
{
generalState=2;
win16_showErrors->addItem("Error Bill reader");
}
if (myDevCond.voltage==200)
{
generalState=2;
win16_showErrors->addItem("Error voltage off limits");
}
if (myDevCond.voltage==201)
{
generalState=2;
win16_showErrors->addItem("Error voltage too low");
}
if (myDevCond.temper==200 )
{
generalState=2;
win16_showErrors->addItem("Error temperature off limits");
}
if (myDevCond.temper==201 )
{
generalState=2;
win16_showErrors->addItem("Error extrem temperature");
}
if (devPara.kindOfCoinChecker>0)
{
if (myDevCond.coinSafe>=100 && myDevCond.coinSafe<200)
{
if (generalState==0) generalState=1;
win16_showErrors->addItem("Warning cash box almost full");
}
}
if (myDevCond.voltage>=100 && myDevCond.voltage<200)
{
if (generalState==0) generalState=1;
win16_showErrors->addItem("Warning voltage low");
}
if (myDevCond.temper>=100 && myDevCond.temper<200 )
{
if (generalState==0) generalState=1;
win16_showErrors->addItem("Warning temperature");
}
}
void T_win16::showDoorState(void)
{
static struct T_dynamicCondition dynCond;
static char acc_stat;
win16_showDoors->clear();
HWaccess->sys_getDynMachineConditions(&dynCond);
if (dynCond.upperDoor==0) // 99: undefined 0:closed 1:open
win16_showDoors->addItem("service door closed");
else
if (dynCond.upperDoor==1)
win16_showDoors->addItem("service door open");
if (dynCond.middleDoor==0) // 99: undefined 0:closed 1:open
{
win16_showDoors->addItem("vault door closed");
lab2->setText(" ");
acc_stat=0;
} else
if (dynCond.middleDoor==1)
{
win16_showDoors->addItem("vault door open");
if (dynCond.onAlarm==0)
{
if (dynCond.CBinDebounced==1) // drin
{
if (acc_stat==2)
{
lab2->setText("close vault door please");
} else
{
lab2->setText("cash box can be removed now...");
acc_stat=1;
}
} else
{
if (acc_stat==1 )
{
lab2->setText("insert cash box please");
acc_stat=2;
}
}
}
}
if (dynCond.lowerDoor==0) // 99: undefined 0:closed 1:open
win16_showDoors->addItem("battery door closed");
else
if (dynCond.lowerDoor==1)
win16_showDoors->addItem("battery door open");
if (dynCond.CBinDebounced==0)
win16_showDoors->addItem("no cash box");
else
if (dynCond.CBinDebounced==1)
win16_showDoors->addItem("cash box inserted");
if (dynCond.modeAbrech)
win16_showDoors->addItem("cash box change ongoing...");
if (dynCond.onAlarm)
win16_showDoors->addItem("on alarm");
if (dynCond.lastMifCardType==1)
{
win16_showDoors->addItem("valid card Service door");
lab2->setText(" service door may be opened now...");
}
if (dynCond.lastMifCardType==2)
{
win16_showDoors->addItem("valid card Vault door");
lab2->setText(" vault door may be opened now...");
}
}

19
win16.h
View File

@ -27,14 +27,24 @@ class T_win16 : public QWidget
{
Q_OBJECT
QGridLayout *myLayout;
//QGridLayout *myLayout;
QHBoxLayout *myH0layer;
QVBoxLayout *myVlayer_left;
QVBoxLayout *myVlayer_midd;
QVBoxLayout *myVlayer_right;
hwinf *HWaccess;
uint16_t myNextStep;
uint8_t myStep;
QLabel *lab1;
QLabel *lab2;
QLabel *lab3;
QLabel *lab4;
QTimer *myTO;
QListWidget *win16_showErrors, *win16_showDoors;
QPushButton *pb1, *pb2, *pb3;
void showErrAndWarn(void);
void showDoorState(void);
public:
explicit T_win16(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
@ -46,10 +56,15 @@ public:
bool working (uint16_t *nextScreen, uint8_t *useNavi);
~T_win16();
public slots:
private slots:
void Nav_back(void);
void Nav_home(void);
void Nav_next(void);
void Button1Clicked(void);
void Button2Clicked(void);
void Button3Clicked(void);
};