merge changes from T.Sax

This commit is contained in:
2025-10-22 15:18:34 +02:00
parent 9744db7838
commit 3f3911e573
15 changed files with 424 additions and 232 deletions

View File

@@ -9,7 +9,7 @@ static uint8_t hwapi_cash_lastCollectionState;
static uint8_t hwapi_paymentStarted;
static uint8_t hwapi_lastDoorState;
static uint8_t bl_startupStep;
static uint8_t runProc_BLisStarted;
T_runProc::T_runProc()
@@ -643,6 +643,7 @@ void T_runProc::bl_completeStart(void)
bl_startupStep=1;
}
bool T_runProc::bl_performComplStart(void)
{
bool result;
@@ -727,7 +728,12 @@ bool T_runProc::bl_performComplStart(void)
}
void T_runProc::resetBLvari(void)
{
// reset with BL-stop command
runProc_BLisStarted=0;
}
// new from 21.5.24 ..................................................................
@@ -1328,6 +1334,7 @@ void T_runProc::sub_changeStyle(char *valueStr)
// 10th:height 1th=width
"styl":"align c" // 'l' 'c' 'r' // left center right
"styl":"density25"; // 0....[25]...50 0=blass
"styl":"csiz 12" // character size 6..20, new 26.7.2024
*/
uint8_t val;
@@ -1397,7 +1404,16 @@ void T_runProc::sub_changeStyle(char *valueStr)
val=uint8_t(tslib_atol(&valueStr[7]));
runProc_prnCmdSeq[runProc_pointPrnCmd]=19;
runProc_prnCmdPara[runProc_pointPrnCmd++]=val;
} else
if ( memcmp(valueStr, "csiz ", 5) ==0 )
{
valueStr[7]=0;
val=uint8_t(tslib_atol(&valueStr[5]));
runProc_prnCmdSeq[runProc_pointPrnCmd]=20;
runProc_prnCmdPara[runProc_pointPrnCmd++]=val;
}
// "prn_papSped" comes with feed-cmd, not with "styl" !!
}
@@ -1619,51 +1635,25 @@ bool T_runProc::subGetVariStr(char *valueStr, char *returnStr)
if ( memcmp(valueStr, "wday eng shor", 13) ==0 )
{
switch (dow)
{
case 1:
returnStr[0]='m'; returnStr[1]='o';
break;
case 2:
returnStr[0]='t'; returnStr[1]='u';
break;
case 3:
returnStr[0]='w'; returnStr[1]='e';
break;
case 4:
returnStr[0]='t'; returnStr[1]='h';
break;
case 5:
returnStr[0]='f'; returnStr[1]='r';
break;
case 6:
returnStr[0]='s'; returnStr[1]='a';
break;
case 7:
returnStr[0]='s'; returnStr[1]='u';
break;
default:
returnStr[0]='-'; returnStr[1]='-';
break;
}
swl_returnWeekdayStr(dow, 2, returnStr);
returnStr[2]=0;
return true;
}
if ( memcmp(valueStr, "wday eng long", 13) ==0 )
{
swl_returnWeekdayStr(dow, 2, returnStr);
return true;
}
if ( memcmp(valueStr, "wday deu shor", 13) ==0 )
{
swl_returnWeekdayStr(dow, 1, returnStr);
returnStr[2]=0;
return true;
}
if ( memcmp(valueStr, "wday deu long", 13) ==0 )
{
swl_returnWeekdayStr(dow, 1, returnStr);
return true;
}
@@ -1987,7 +1977,6 @@ void T_runProc::runProc_subPerformPrintCmds(uint8_t nextCmd, uint8_t nextPara)
prn_fontInv=0;
sendFDcmd_set(CMD2DC_PRI_SETLETTER, 0, 0, prn_fontBold, prn_fontInv, prn_underLine, 0);
break;
case 16:
prn_fontTyp=nextPara; // kind of font 5...11 (0..22)
sendFDcmd_set(CMD2DC_PRI_SETFONT, 0,0, prn_fontTyp, prn_fontSiz, prn_width, prn_hei);
@@ -2008,12 +1997,14 @@ void T_runProc::runProc_subPerformPrintCmds(uint8_t nextCmd, uint8_t nextPara)
prn_density=nextPara;
prn_sendPrnSetup(prn_papSped, prn_density, prn_alignment, prn_orient);
break;
case 20:
prn_fontSiz=nextPara;
sendFDcmd_set(CMD2DC_PRI_SETFONT, 0,0, prn_fontTyp, prn_fontSiz, prn_width, prn_hei);
break;
case 30: // cut
// kindof = 1: full cut 2: partial cut 3=eject (5xLF + full cut)
sendFDcmd_set(CMD2DC_PRI_CUT, 0,0, 1,0,0,0);
break;
case 31: // part
// kindof = 1: full cut 2: partial cut 3=eject (5xLF + full cut)
sendFDcmd_set(CMD2DC_PRI_CUT, 0,0, 2,0,0,0);
@@ -2333,3 +2324,133 @@ char T_runProc::prn_directTicket_cycle(void)
}
// neuere TS Version, wurde aber von Gerhard nicht verwendet:
/*
bool T_runProc::bl_waitForRdyMsg(void) // vorher: bl_isUp()
{
uint8_t receivedData[160];
uint8_t LL, nn;
for (nn=0; nn<160; nn++) receivedData[nn]=0;
LL=epi_getRawRecLength();
if (LL>0)
{
epi_getRawReceivedData(receivedData);
// response to "readFWversion"
if (receivedData[0]==2 && receivedData[1]==146 && receivedData[2]==45 &&
receivedData[3]==45 && receivedData[4] ==95 && receivedData[5]==176)
{
//qDebug() << "*** runProc, got BL response to readFWversion";
//epi_clrRawReceivedString();
return true;
}
// response to "start BL"
if (receivedData[0]==2 && receivedData[1]==101 && receivedData[2]==48 &&
receivedData[3]==223 && receivedData[4] ==131 )
{
//qDebug() << "runProc, got BL response to start";
//epi_clrRawReceivedString();
return true;
}
//qDebug() << "runProc, got "<<LL<<" wrong bytes"<<receivedData[0]<<" "
// <<receivedData[1]<<" "<<receivedData[2]<<" "<<receivedData[3]<<" "
// <<receivedData[4]<<" "<<receivedData[5]<<" "<<receivedData[6];
}
return false;
}
uint8_t T_runProc::bl_isUp(void)
{
// return 1: BL is up 2: BL error 0: unknown
return runProc_BLisStarted;
}
bool T_runProc::bl_performComplStart(void)
{
bool result;
static uint8_t retryCtr;
if ((bl_startupStep<1) || (bl_startupStep>10))
return false;
if (bl_startupStep==1)
{
dc_autoRequest(false); // and clear serial input buffer
runProc_BLisStarted=0;
bl_startupStep++;
} else
if (bl_startupStep==2)
{
qDebug()<<"rebooting";
bl_rebootDC();
myTO->stop();
myTO->start(500);
retryCtr=0;
bl_startupStep++;
} else
if (bl_startupStep==3)
{
if (!myTO->isActive())
{
qDebug()<<"starting BL";
epi_clrRawReceivedString();
bl_startBL();
myTO->stop();
myTO->start(500);
bl_startupStep++;
}
} else
if (bl_startupStep==4)
{
if (!myTO->isActive())
{
qDebug()<<"checking BL";
bl_checkBL();
myTO->stop();
myTO->start(1000);
bl_startupStep++;
}
} else
if (bl_startupStep==5)
{
result = bl_waitForRdyMsg();
if (result==true)
{
bl_startupStep++;
qDebug()<<"BL is working now..."; // BL is up and running
runProc_BLisStarted=1; // ok
return true;
}
if (!myTO->isActive())
{
qDebug()<<"no resp. from BL"<< result;
retryCtr++; // start again
if (retryCtr>=3)
{
bl_startupStep=99;
qDebug()<<"BL error!!!";
} else
{
bl_startupStep=3;
runProc_BLisStarted=2; // error
myTO->stop();
myTO->start(1);
}
}
}
return false;
}
*/