Compare commits
No commits in common. "cea817cbcbb9787460749f9135e159e4d73810b7" and "7b1ea963e220b4088b00ba5a7f6072b0cf0dbb26" have entirely different histories.
cea817cbcb
...
7b1ea963e2
@ -375,9 +375,6 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
// bit0,1: enable/disable button "next"
|
// bit0,1: enable/disable button "next"
|
||||||
// bit2,3: enable/disable button "home"
|
// bit2,3: enable/disable button "home"
|
||||||
// bit4,5: enable/disable button "back"
|
// bit4,5: enable/disable button "back"
|
||||||
QString bs, cn;
|
|
||||||
int br, ci;
|
|
||||||
|
|
||||||
|
|
||||||
this->updateGui();
|
this->updateGui();
|
||||||
*nextScreen=0; // 0=no change
|
*nextScreen=0; // 0=no change
|
||||||
@ -388,29 +385,22 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
// load and use last settings: --------------------
|
// load and use last settings: --------------------
|
||||||
QByteArray myBA;
|
QByteArray myBA;
|
||||||
myBA=datei_readFromFile(FILENAME_COMPORT);
|
myBA=datei_readFromFile(FILENAME_COMPORT);
|
||||||
if (myBA.length()>0)
|
|
||||||
{
|
//uint32_t len= datei_nrOfEntriesInFile(myBA);
|
||||||
bs=csv_getEntryAsString(myBA,0); // read the 's' war 2!??
|
//uint64_t ulltmp=csv_getEntryAs2Ulong(myBA,0);
|
||||||
br=csv_getEntryAsInt(myBA,1); // z.B. 5 (5.Eintrag in der Baud-Liste)
|
//qDebug()<<"win_startup load long numer: "<<ulltmp;
|
||||||
|
|
||||||
|
QString bs=csv_getEntryAsString(myBA,0); // read the 's' war 2!??
|
||||||
|
int br=csv_getEntryAsInt(myBA,1); // z.B. 5 (5.Eintrag in der Baud-Liste)
|
||||||
bs=csv_getEntryAsString(myBA,2); // z.B 115200
|
bs=csv_getEntryAsString(myBA,2); // z.B 115200
|
||||||
cn=csv_getEntryAsString(myBA,3); // z.B. COM9
|
QString cn=csv_getEntryAsString(myBA,3); // z.B. COM9
|
||||||
ci=csv_getEntryAsInt(myBA,4); // Eintragsnummer in COM-Fenster
|
int ci=csv_getEntryAsInt(myBA,4); // Eintragsnummer in COM-Fenster
|
||||||
|
//qDebug()<<"win_startup loaded com settings: "<<br<<" "<<bs<<" "<<cn;
|
||||||
HWaccess->dc_openSerial(br,bs,cn,1);
|
HWaccess->dc_openSerial(br,bs,cn,1);
|
||||||
|
//CB_baudSel->setCurrentIndex(br); // im BR auswahlfenster diese Baud vorgeben
|
||||||
CB_portSel->setCurrentIndex(ci); // den Port aus der Datei hier vorgeben
|
CB_portSel->setCurrentIndex(ci); // den Port aus der Datei hier vorgeben
|
||||||
connectButton->setChecked(true); // connect Taste "druecken"
|
connectButton->setChecked(true); // connect Taste "druecken"
|
||||||
} else
|
|
||||||
{
|
|
||||||
// open with default settings
|
|
||||||
qDebug()<<"CArunGui: open serial with default values";
|
|
||||||
|
|
||||||
bs="115200";
|
|
||||||
br=5;
|
|
||||||
//cn="COM14"; // Windows
|
|
||||||
cn="ttymxc2"; // PTU5
|
|
||||||
ci=2;
|
|
||||||
HWaccess->dc_openSerial(br,bs,cn,1);
|
|
||||||
|
|
||||||
}
|
|
||||||
myTO->start(100); // restart
|
myTO->start(100); // restart
|
||||||
myStep++;
|
myStep++;
|
||||||
} else
|
} else
|
||||||
@ -420,13 +410,9 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
if (!myTO->isActive())
|
if (!myTO->isActive())
|
||||||
{
|
{
|
||||||
if (HWaccess->dc_isPortOpen())
|
if (HWaccess->dc_isPortOpen())
|
||||||
{
|
|
||||||
myStep++;
|
myStep++;
|
||||||
} else
|
else
|
||||||
{
|
myStep=99; // stop automatic connection and wait for manual start
|
||||||
myStep=6; // 13.12.23: start Autoconnect cycle
|
|
||||||
qDebug()<<"CArunGui: port is still closed, restarting..";
|
|
||||||
}
|
|
||||||
myTO->start(100);
|
myTO->start(100);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -448,10 +434,7 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
if (HWaccess->dc_readAnswTestResponse())
|
if (HWaccess->dc_readAnswTestResponse())
|
||||||
myStep++; // response was correct
|
myStep++; // response was correct
|
||||||
else
|
else
|
||||||
{
|
myStep=99; // stop automatic connection and wait for manual start
|
||||||
myStep=6; // 13.12.23: start Autoconnect cycle
|
|
||||||
qDebug()<<"CArunGui: got no answer from DC, retry..";
|
|
||||||
}
|
|
||||||
myTO->start(100);
|
myTO->start(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,38 +445,23 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
HWaccess->dc_autoRequest(1);
|
HWaccess->dc_autoRequest(1);
|
||||||
AutSendButton->setChecked(true); // taste "druecken"
|
AutSendButton->setChecked(true); // taste "druecken"
|
||||||
myStep++;
|
myStep++;
|
||||||
myTO->start(2000);
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==5)
|
if (myStep==5)
|
||||||
{
|
{
|
||||||
if (!myTO->isActive())
|
// got next screen:
|
||||||
{
|
//myNextStep=2; // nicht bei CArun
|
||||||
if (HWaccess->sys_areDCdataValid())
|
|
||||||
{
|
|
||||||
qDebug()<<"CArunGui: DC is connected";
|
|
||||||
myStep=7; // OK, connection is up and running
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
qDebug()<<"CArunGui: auto request is not running, retry...";
|
|
||||||
myStep++;
|
myStep++;
|
||||||
myTO->start(100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==6)
|
if (myStep==6)
|
||||||
{
|
{
|
||||||
// restart autoconnect cycle
|
// stop here, everything done
|
||||||
myTO->start(100); // restart
|
|
||||||
myStep=0;
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==7)
|
if (myStep==7)
|
||||||
{
|
{
|
||||||
// stay here, DC connection is up and running
|
|
||||||
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@ -502,6 +470,7 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
|
|
||||||
if (myNextStep)
|
if (myNextStep)
|
||||||
{
|
{
|
||||||
|
//qDebug()<<"fenster1 working: "<< myNextStep;
|
||||||
*nextScreen=myNextStep;
|
*nextScreen=myNextStep;
|
||||||
myNextStep=0;
|
myNextStep=0;
|
||||||
}
|
}
|
||||||
|
@ -375,9 +375,6 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
// bit0,1: enable/disable button "next"
|
// bit0,1: enable/disable button "next"
|
||||||
// bit2,3: enable/disable button "home"
|
// bit2,3: enable/disable button "home"
|
||||||
// bit4,5: enable/disable button "back"
|
// bit4,5: enable/disable button "back"
|
||||||
QString bs, cn;
|
|
||||||
int br, ci;
|
|
||||||
|
|
||||||
|
|
||||||
this->updateGui();
|
this->updateGui();
|
||||||
*nextScreen=0; // 0=no change
|
*nextScreen=0; // 0=no change
|
||||||
@ -388,29 +385,22 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
// load and use last settings: --------------------
|
// load and use last settings: --------------------
|
||||||
QByteArray myBA;
|
QByteArray myBA;
|
||||||
myBA=datei_readFromFile(FILENAME_COMPORT);
|
myBA=datei_readFromFile(FILENAME_COMPORT);
|
||||||
if (myBA.length()>0)
|
|
||||||
{
|
//uint32_t len= datei_nrOfEntriesInFile(myBA);
|
||||||
bs=csv_getEntryAsString(myBA,0); // read the 's' war 2!??
|
//uint64_t ulltmp=csv_getEntryAs2Ulong(myBA,0);
|
||||||
br=csv_getEntryAsInt(myBA,1); // z.B. 5 (5.Eintrag in der Baud-Liste)
|
//qDebug()<<"win_startup load long numer: "<<ulltmp;
|
||||||
|
|
||||||
|
QString bs=csv_getEntryAsString(myBA,0); // read the 's' war 2!??
|
||||||
|
int br=csv_getEntryAsInt(myBA,1); // z.B. 5 (5.Eintrag in der Baud-Liste)
|
||||||
bs=csv_getEntryAsString(myBA,2); // z.B 115200
|
bs=csv_getEntryAsString(myBA,2); // z.B 115200
|
||||||
cn=csv_getEntryAsString(myBA,3); // z.B. COM9
|
QString cn=csv_getEntryAsString(myBA,3); // z.B. COM9
|
||||||
ci=csv_getEntryAsInt(myBA,4); // Eintragsnummer in COM-Fenster
|
int ci=csv_getEntryAsInt(myBA,4); // Eintragsnummer in COM-Fenster
|
||||||
|
//qDebug()<<"win_startup loaded com settings: "<<br<<" "<<bs<<" "<<cn;
|
||||||
HWaccess->dc_openSerial(br,bs,cn,1);
|
HWaccess->dc_openSerial(br,bs,cn,1);
|
||||||
|
//CB_baudSel->setCurrentIndex(br); // im BR auswahlfenster diese Baud vorgeben
|
||||||
CB_portSel->setCurrentIndex(ci); // den Port aus der Datei hier vorgeben
|
CB_portSel->setCurrentIndex(ci); // den Port aus der Datei hier vorgeben
|
||||||
connectButton->setChecked(true); // connect Taste "druecken"
|
connectButton->setChecked(true); // connect Taste "druecken"
|
||||||
} else
|
|
||||||
{
|
|
||||||
// open with default settings
|
|
||||||
qDebug()<<"CArunGui: open serial with default values";
|
|
||||||
|
|
||||||
bs="115200";
|
|
||||||
br=5;
|
|
||||||
//cn="COM14"; // Windows
|
|
||||||
cn="ttymxc2"; // PTU5
|
|
||||||
ci=2;
|
|
||||||
HWaccess->dc_openSerial(br,bs,cn,1);
|
|
||||||
|
|
||||||
}
|
|
||||||
myTO->start(100); // restart
|
myTO->start(100); // restart
|
||||||
myStep++;
|
myStep++;
|
||||||
} else
|
} else
|
||||||
@ -420,13 +410,9 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
if (!myTO->isActive())
|
if (!myTO->isActive())
|
||||||
{
|
{
|
||||||
if (HWaccess->dc_isPortOpen())
|
if (HWaccess->dc_isPortOpen())
|
||||||
{
|
|
||||||
myStep++;
|
myStep++;
|
||||||
} else
|
else
|
||||||
{
|
myStep=99; // stop automatic connection and wait for manual start
|
||||||
myStep=6; // 13.12.23: start Autoconnect cycle
|
|
||||||
qDebug()<<"CArunGui: port is still closed, restarting..";
|
|
||||||
}
|
|
||||||
myTO->start(100);
|
myTO->start(100);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -448,10 +434,7 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
if (HWaccess->dc_readAnswTestResponse())
|
if (HWaccess->dc_readAnswTestResponse())
|
||||||
myStep++; // response was correct
|
myStep++; // response was correct
|
||||||
else
|
else
|
||||||
{
|
myStep=99; // stop automatic connection and wait for manual start
|
||||||
myStep=6; // 13.12.23: start Autoconnect cycle
|
|
||||||
qDebug()<<"CArunGui: got no answer from DC, retry..";
|
|
||||||
}
|
|
||||||
myTO->start(100);
|
myTO->start(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,38 +445,23 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
HWaccess->dc_autoRequest(1);
|
HWaccess->dc_autoRequest(1);
|
||||||
AutSendButton->setChecked(true); // taste "druecken"
|
AutSendButton->setChecked(true); // taste "druecken"
|
||||||
myStep++;
|
myStep++;
|
||||||
myTO->start(2000);
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==5)
|
if (myStep==5)
|
||||||
{
|
{
|
||||||
if (!myTO->isActive())
|
// got next screen:
|
||||||
{
|
//myNextStep=2; // nicht bei CArun
|
||||||
if (HWaccess->sys_areDCdataValid())
|
|
||||||
{
|
|
||||||
qDebug()<<"CArunGui: DC is connected";
|
|
||||||
myStep=7; // OK, connection is up and running
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
qDebug()<<"CArunGui: auto request is not running, retry...";
|
|
||||||
myStep++;
|
myStep++;
|
||||||
myTO->start(100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==6)
|
if (myStep==6)
|
||||||
{
|
{
|
||||||
// restart autoconnect cycle
|
// stop here, everything done
|
||||||
myTO->start(100); // restart
|
|
||||||
myStep=0;
|
|
||||||
} else
|
} else
|
||||||
|
|
||||||
if (myStep==7)
|
if (myStep==7)
|
||||||
{
|
{
|
||||||
// stay here, DC connection is up and running
|
|
||||||
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@ -502,6 +470,7 @@ bool T_winComPort::working(uint16_t *nextScreen, uint8_t *useNavi)
|
|||||||
|
|
||||||
if (myNextStep)
|
if (myNextStep)
|
||||||
{
|
{
|
||||||
|
//qDebug()<<"fenster1 working: "<< myNextStep;
|
||||||
*nextScreen=myNextStep;
|
*nextScreen=myNextStep;
|
||||||
myNextStep=0;
|
myNextStep=0;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ struct T_emp
|
|||||||
|
|
||||||
// dynamic:
|
// dynamic:
|
||||||
uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine):
|
uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine):
|
||||||
/*
|
|
||||||
// 0=start command
|
// 0=start command
|
||||||
// 1=powered, do emp ini, send reset
|
// 1=powered, do emp ini, send reset
|
||||||
// 2=delay
|
// 2=delay
|
||||||
@ -40,7 +39,7 @@ struct T_emp
|
|||||||
// 90: stop all, 1s delay
|
// 90: stop all, 1s delay
|
||||||
// 99: off, all stopped
|
// 99: off, all stopped
|
||||||
|
|
||||||
*/
|
|
||||||
uint8_t pollingRunning;
|
uint8_t pollingRunning;
|
||||||
uint8_t paymentRunning;
|
uint8_t paymentRunning;
|
||||||
|
|
||||||
@ -239,7 +238,6 @@ struct T_dynamicCondition
|
|||||||
uint8_t lastVDoorState;
|
uint8_t lastVDoorState;
|
||||||
uint8_t lastCBstate;
|
uint8_t lastCBstate;
|
||||||
char paymentInProgress;
|
char paymentInProgress;
|
||||||
// Version Szeged: aug2023
|
|
||||||
// 0: stopped by timeout
|
// 0: stopped by timeout
|
||||||
// 1: running 2: wait4lastCoin
|
// 1: running 2: wait4lastCoin
|
||||||
// 3: payment stopped manually, coins in Escrow
|
// 3: payment stopped manually, coins in Escrow
|
||||||
@ -248,21 +246,6 @@ struct T_dynamicCondition
|
|||||||
// 6: coins encashed 7:coins returned
|
// 6: coins encashed 7:coins returned
|
||||||
// 8: CoinChecker or MDB on Error
|
// 8: CoinChecker or MDB on Error
|
||||||
|
|
||||||
// since Schoenau with bill and changer, nov2023
|
|
||||||
//0 = no payment
|
|
||||||
//will be set to 1 by cash_startCollection()
|
|
||||||
//neu 1: wait for devices getting ready for payment
|
|
||||||
//2 = payment,
|
|
||||||
//3 = wait for last coin/bill
|
|
||||||
//4 = Bezahlvorgang manuell beendet
|
|
||||||
//5 = payment stopped autom, amount collected, coins in Escrow
|
|
||||||
//6 = Bezahlvorgang beendet weil ZK voll
|
|
||||||
//4,5,6: payment done, keep on polling, wait for cash or return command
|
|
||||||
//7 = encash collected money from coin escrow into cash box
|
|
||||||
//8 = return "amountToReturn", can be complete inserted amount or only overpayment
|
|
||||||
//9 = wait for changer result
|
|
||||||
//10= print refund receipt with "amountToReturn"
|
|
||||||
|
|
||||||
|
|
||||||
char res1;
|
char res1;
|
||||||
uint16_t U_Batt;
|
uint16_t U_Batt;
|
||||||
@ -2269,23 +2252,14 @@ public:
|
|||||||
virtual void bna_requestCurrentNotes() const {}
|
virtual void bna_requestCurrentNotes() const {}
|
||||||
// send command to DC in order to get transaction data
|
// send command to DC in order to get transaction data
|
||||||
|
|
||||||
virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const
|
virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const {
|
||||||
{
|
|
||||||
Q_UNUSED(latestBill);
|
Q_UNUSED(latestBill);
|
||||||
Q_UNUSED(currentNotes);
|
Q_UNUSED(currentNotes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// returns number of collected bank notes since start-command (current transaction)
|
// returns number of collected bank notes since start-command (current transaction)
|
||||||
// return value: numbers of bills or 99 in case of error
|
// latestBill: last accepted bank note, value in cent
|
||||||
// latestBill: not used
|
// currentNotes an array with up to 16 (further) notes collected
|
||||||
// in case of error: currentNotes[0,1,2,3] = 1..4 error number(s)
|
|
||||||
// in normal case:
|
|
||||||
// currentNotes[0]: last bill in cent (e.g. 1000 = 10€)
|
|
||||||
// currentNotes[1]: bin 1 = bill is still in escrow else bill is stacked
|
|
||||||
// note: by now (dec2023) escrow is not used, bills always go to stacker (box)
|
|
||||||
// currentNotes[2]: total sum of bills in cent, low word (16bit)
|
|
||||||
// currentNotes[3]: total sum of bills in cent, high word (16bit)
|
|
||||||
|
|
||||||
|
|
||||||
virtual void bna_requestStackerLevel() const {}
|
virtual void bna_requestStackerLevel() const {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user