Compare commits

..

No commits in common. "download-device-controller" and "master" have entirely different histories.

10 changed files with 197 additions and 196 deletions

View File

@ -591,8 +591,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
connect(myFenster02, SIGNAL(quitMyApp()), this, SLOT(close())); connect(myFenster02, SIGNAL(quitMyApp()), this, SLOT(close()));
HWaccess->bl_stopBL(); // 6.11.2024, to be sure about BL-status after DCdiag program start
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -961,7 +959,7 @@ void MainWindow::chainControl(void)
uint16_t nextScreen=0; uint16_t nextScreen=0;
uint8_t useNavi=0; uint8_t useNavi=0;
bool busy=false, nowBL; bool busy=false;
static uint32_t offlineCtr; static uint32_t offlineCtr;
// call permanent functions here: // call permanent functions here:
@ -969,14 +967,19 @@ void MainWindow::chainControl(void)
//diary->working(); //diary->working();
//conf->working(); //conf->working();
nowBL=myFenster12->isBLup(); //qDebug()<<"mainwin chaincontrol calling mif";
if (HWaccess->sys_areDCdataValid()==false && !nowBL)
if (HWaccess->sys_areDCdataValid()==false)
{ {
//qDebug()<<"mainwin: lost connection to DC "<<offlineCtr; qDebug()<<"mainwin: lost connection to DC "<<offlineCtr;
offlineCtr++; offlineCtr++;
} }
// working step chain: // working step chain:
if (chainCurrentStep != chainNextStep) if (chainCurrentStep != chainNextStep)
{ {
@ -1006,7 +1009,7 @@ void MainWindow::chainControl(void)
if (chain_stepIni) if (chain_stepIni)
busy=myFenster02->work_ini(&nextScreen, &useNavi); busy=myFenster02->work_ini(&nextScreen, &useNavi);
else else
busy=myFenster02->working(&nextScreen, &useNavi, nowBL); busy=myFenster02->working(&nextScreen, &useNavi);
} else } else
if (chainCurrentStep==3) if (chainCurrentStep==3)
{ {
@ -1268,7 +1271,5 @@ void MainWindow::vendingTimeout(void)
timerVendingTimeout->stop(); timerVendingTimeout->stop();
} }
bool MainWindow::BLisRunning()
{
return myFenster12->isBLup();
}

View File

@ -147,7 +147,6 @@ public:
#define FORWBUTTON 3 #define FORWBUTTON 3
void enableNaviButtons(uint8_t buttonNr, bool enabled); void enableNaviButtons(uint8_t buttonNr, bool enabled);
void enableNaviButtons(uint8_t switchBitwise); void enableNaviButtons(uint8_t switchBitwise);
bool BLisRunning();
private slots: private slots:
void chainControl(); void chainControl();

View File

@ -35,9 +35,8 @@
#define PAGE_NEXT20 20 #define PAGE_NEXT20 20
// fix: customize: // fix: customize:
//#define WCS_STARTSCREEN PAGE_COMPORT //#define WCS_STARTSCREEN PAGE_COMPORT // if APservice uses masterLib
//#define WCS_STARTSCREEN PAGE_NEXT16 #define WCS_STARTSCREEN PAGE_SERVICEMAIN // if APservice uses slaveLib
#define WCS_STARTSCREEN PAGE_SERVICEMAIN
// PAGE_COMPORT: // PAGE_COMPORT:
#define WCS_WIN01BAK PAGE_COMPORT #define WCS_WIN01BAK PAGE_COMPORT
@ -45,7 +44,6 @@
#define WCS_WIN01FWD PAGE_SERVICEMAIN #define WCS_WIN01FWD PAGE_SERVICEMAIN
// PAGE_SERVICEMAIN: // PAGE_SERVICEMAIN:
//#define WCS_WIN02BAK PAGE_NEXT16
#define WCS_WIN02BAK PAGE_BOOTLOADER #define WCS_WIN02BAK PAGE_BOOTLOADER
#define WCS_WIN02MID PAGE_SERVICEMAIN #define WCS_WIN02MID PAGE_SERVICEMAIN
#define WCS_WIN02FWD PAGE_TIMEDATEVERSION #define WCS_WIN02FWD PAGE_TIMEDATEVERSION
@ -172,8 +170,8 @@
#define WCS_WIN02SHORT08 PAGE_VAULTRECORD #define WCS_WIN02SHORT08 PAGE_VAULTRECORD
#define WIN02_LABEL_SHORT09 "Program" #define WIN02_LABEL_SHORT09 "Program"
#define WCS_WIN02SHORT09 PAGE_PROG_JSON #define WCS_WIN02SHORT09 PAGE_PROG_JSON
#define WIN02_LABEL_SHORT10 " B L " #define WIN02_LABEL_SHORT10 " "
#define WCS_WIN02SHORT10 PAGE_BOOTLOADER #define WCS_WIN02SHORT10 PAGE_SERVICEMAIN

View File

@ -360,7 +360,7 @@ bool T_win02::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
} }
bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi, bool isBLup) bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi)
{ {
// one state of the vending/operating FSM // one state of the vending/operating FSM
// called cyclic until this state changes intentionally to another state // called cyclic until this state changes intentionally to another state
@ -395,13 +395,6 @@ bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi, bool isBLup)
tmpStr.clear(); tmpStr.clear();
// update values: // update values:
if (HWaccess->bl_isUp()==1)
//if (isBLup)
{
labState->setText(" DC2 Bootloader");
labState->setStyleSheet(COLOR_RED);
} else
if (HWaccess->sys_areDCdataValid()) if (HWaccess->sys_areDCdataValid())
{ {
labState->setText(" DC2 connected "); // datenverkehr läuft labState->setText(" DC2 connected "); // datenverkehr läuft
@ -438,6 +431,8 @@ bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi, bool isBLup)
} }
labLoc2->setText(myStr); labLoc2->setText(myStr);
if (cunu>0 && manu>0) if (cunu>0 && manu>0)
{ {
myStr.clear(); myStr.clear();

View File

@ -90,7 +90,7 @@ public:
// 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"
bool working (uint16_t *nextScreen, uint8_t *useNavi, bool isBLup); bool working (uint16_t *nextScreen, uint8_t *useNavi);
~T_win02(); ~T_win02();
private slots: private slots:

View File

@ -18,7 +18,6 @@ T_win04::T_win04(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myTabFont.setPixelSize(PIXELSIZE_BUTTONS); myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
pb_refresh = new QPushButton("Refresh"); pb_refresh = new QPushButton("Refresh");
pb_refresh->setFont(myTabFont); pb_refresh->setFont(myTabFont);
pb_refresh->setStyleSheet("background-color: rgb(250,150,150)"); // hell rot
myLayout->addWidget(pb_refresh,1,1); myLayout->addWidget(pb_refresh,1,1);
connect(pb_refresh, SIGNAL(clicked()), this, SLOT(ButtonRefreshClicked())); connect(pb_refresh, SIGNAL(clicked()), this, SLOT(ButtonRefreshClicked()));
@ -100,7 +99,6 @@ void T_win04::Nav_next(void)
void T_win04::ButtonRefreshClicked(void) void T_win04::ButtonRefreshClicked(void)
{ {
win04_dataAreValid=0; win04_dataAreValid=0;
pb_refresh->setStyleSheet("background-color: white");
} }
bool T_win04::work_ini(uint16_t *nextScreen, uint8_t *useNavi) bool T_win04::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
@ -177,27 +175,6 @@ bool T_win04::working(uint16_t *nextScreen, uint8_t *useNavi)
struct T_dynamicCondition myDynMachCond; struct T_dynamicCondition myDynMachCond;
struct T_devices devPara; // used devices struct T_devices devPara; // used devices
// neu, 24.7.24
static bool win04_dcDataAreValid;
bool bget;
bget=HWaccess->sys_areDCdataValid();
if (bget && !win04_dcDataAreValid)
{
// DC soeben ANgesteckt
win04_dcDataAreValid=true;
win04_dataAreValid=0;
// genau jetzt die Geräte Stati einlesen, scheinen nicht immer aktuell zu sein
pb_refresh->setStyleSheet("background-color: rgb(150,230,150)"); // hell grün
}
if (!bget && win04_dcDataAreValid)
{
// DC soeben ABgesteckt
win04_dcDataAreValid=false;
win04_dataAreValid=0;
pb_refresh->setStyleSheet("background-color: rgb(250,150,150)"); // hell rot
}
HWaccess->sys_restoreDeviceParameter(&devPara); HWaccess->sys_restoreDeviceParameter(&devPara);
if (!win04_dataAreValid) if (!win04_dataAreValid)

View File

@ -114,37 +114,6 @@ T_win09::T_win09(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
connect(pbCreditWake, SIGNAL(clicked()), this, SLOT(slot_startTest())); connect(pbCreditWake, SIGNAL(clicked()), this, SLOT(slot_startTest()));
*/ */
/*
pbTest1 = new QPushButton("PTU up");
pbTest1->setCheckable(false); // true = toggle button
pbTest1->setFont(myTabFont);
pbTest1->setStyleSheet("background-color: yellow");
myLayout->addWidget(pbTest1, 5, 0);
connect(pbTest1, SIGNAL(clicked()), this, SLOT(slot_pbTest1()));
pbTest2 = new QPushButton("PTU dn");
pbTest2->setCheckable(false); // true = toggle button
pbTest2->setFont(myTabFont);
pbTest2->setStyleSheet("background-color: yellow");
myLayout->addWidget(pbTest2, 6, 0);
connect(pbTest2, SIGNAL(clicked()), this, SLOT(slot_pbTest2()));
pbTest3 = new QPushButton("DC up");
pbTest3->setCheckable(false); // true = toggle button
pbTest3->setFont(myTabFont);
pbTest3->setStyleSheet("background-color: yellow");
myLayout->addWidget(pbTest3, 7, 0);
connect(pbTest3, SIGNAL(clicked()), this, SLOT(slot_pbTest3()));
pbTest4 = new QPushButton("DC dn");
pbTest4->setCheckable(false); // true = toggle button
pbTest4->setFont(myTabFont);
pbTest4->setStyleSheet("background-color: yellow");
myLayout->addWidget(pbTest4, 8, 0);
connect(pbTest4, SIGNAL(clicked()), this, SLOT(slot_pbTest4()));
*/
setLayout(myLayout); setLayout(myLayout);
myNextStep=0; myNextStep=0;
myStep=0; myStep=0;
@ -241,33 +210,6 @@ void T_win09::slot_startTest(void)
HWaccess->sys_runCompleteTest(); HWaccess->sys_runCompleteTest();
} }
// 8.10.2024 new, control power up/down
/*
void slot_pbTest1(void)
{
HWaccess->prepareForPowerDown();
}
void slot_pbTest2(void)
{
HWaccess->justReactivated();
}
void slot_pbTest3(void)
{
HWaccess->dcNotActive();
}
void slot_pbTest4(void)
{
HWaccess->dcIsActive();
}
*/

View File

@ -37,7 +37,6 @@ class T_win09 : public QWidget
QPushButton *pbModemPwr, *pbModemWake, *pbCreditPwr, *pbCreditWake, *pbModemRes; QPushButton *pbModemPwr, *pbModemWake, *pbCreditPwr, *pbCreditWake, *pbModemRes;
QLabel *showModemCondition; QLabel *showModemCondition;
//QPushButton *pbTest1, *pbTest2, *pbTest3, *pbTest4;
public: public:
explicit T_win09(hwinf *HWaccess = nullptr, QWidget *parent = nullptr); explicit T_win09(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
@ -59,12 +58,6 @@ public slots:
void slot_CreditWake(void); void slot_CreditWake(void);
void slot_startTest(void); void slot_startTest(void);
void slot_ModemRes(void); void slot_ModemRes(void);
// void slot_pbTest1(void);
// void slot_pbTest2(void);
// void slot_pbTest3(void);
// void slot_pbTest4(void);
}; };

View File

@ -44,11 +44,11 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
// linke Spalte: controls // linke Spalte: controls
QLabel *lab7 = new QLabel(" "); QLabel *lab7 = new QLabel(" ");
lab7->setFont(myTabFont); lab7->setFont(myTabFont);
myVlayer_right->addWidget(lab7); myVlayer_left->addWidget(lab7);
but9 = new QPushButton("Starting \nBootloader"); but9 = new QPushButton("Starting \nBootloader");
myVlayer_right->addWidget(but9); myVlayer_left->addWidget(but9);
connect(but9, SIGNAL(clicked()), this, SLOT(slot_startCompleteBL())); connect(but9, SIGNAL(clicked()), this, SLOT(slot_b9()));
but9->setStyleSheet(BUTTONCOLOR0); but9->setStyleSheet(BUTTONCOLOR0);
but9->setFont(myTabFont); but9->setFont(myTabFont);
@ -57,8 +57,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myH0layer->addWidget(lab3); myH0layer->addWidget(lab3);
but4 = new QPushButton("load Bin-File"); but4 = new QPushButton("load Bin-File");
myVlayer_right->addWidget(but4); myVlayer_left->addWidget(but4);
connect(but4, SIGNAL(clicked()), this, SLOT(slot_loadBin())); connect(but4, SIGNAL(clicked()), this, SLOT(slot_b4()));
but4->setStyleSheet(BUTTONCOLOR0); but4->setStyleSheet(BUTTONCOLOR0);
but4->setFont(myTabFont); but4->setFont(myTabFont);
@ -67,8 +67,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myH0layer->addWidget(lab4); myH0layer->addWidget(lab4);
but5 = new QPushButton(" send file to DC"); but5 = new QPushButton(" send file to DC");
myVlayer_right->addWidget(but5); myVlayer_left->addWidget(but5);
connect(but5, SIGNAL(clicked()), this, SLOT(slot_sendBin())); connect(but5, SIGNAL(clicked()), this, SLOT(slot_b5()));
but5->setStyleSheet(BUTTONCOLOR0); but5->setStyleSheet(BUTTONCOLOR0);
but5->setFont(myTabFont); but5->setFont(myTabFont);
@ -76,22 +76,49 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
lab5->setFont(myTabFont); lab5->setFont(myTabFont);
myH0layer->addWidget(lab5); myH0layer->addWidget(lab5);
/*
but6 = new QPushButton(" ");
myVlayer_left->addWidget(but6);
connect(but6, SIGNAL(clicked()), this, SLOT(slot_b6()));
but6->setStyleSheet(BUTTONCOLOR0);
but6->setFont(myTabFont);
but7 = new QPushButton(" ");
myVlayer_left->addWidget(but7);
connect(but7, SIGNAL(clicked()), this, SLOT(slot_b7()));
but7->setStyleSheet(BUTTONCOLOR0);
but7->setFont(myTabFont);
but8 = new QPushButton(" ");
myVlayer_left->addWidget(but8);
connect(but8, SIGNAL(clicked()), this, SLOT(slot_b8()));
but8->setStyleSheet(BUTTONCOLOR0);
but8->setFont(myTabFont);
*/
/*
but9 = new QPushButton("complete start");
myVlayer_left->addWidget(but9);
connect(but9, SIGNAL(clicked()), this, SLOT(slot_b9()));
but9->setStyleSheet(BUTTONCOLOR0);
but9->setFont(myTabFont);
*/
myTabFont.setPixelSize(14); myTabFont.setPixelSize(14);
but1 = new QPushButton("restart DC: \n"); but1 = new QPushButton("restart DC: ");
myVlayer_right->addWidget(but1); myVlayer_left->addWidget(but1);
connect(but1, SIGNAL(clicked()), this, SLOT(slot_restart())); connect(but1, SIGNAL(clicked()), this, SLOT(slot_b1()));
but1->setStyleSheet(BUTTONCOLOR0); but1->setStyleSheet(BUTTONCOLOR0);
but1->setFont(myTabFont); but1->setFont(myTabFont);
but2 = new QPushButton("Start BL: \n"); but2 = new QPushButton("Start BL: ");
myVlayer_right->addWidget(but2); myVlayer_left->addWidget(but2);
connect(but2, SIGNAL(clicked()), this, SLOT(slot_startBl())); connect(but2, SIGNAL(clicked()), this, SLOT(slot_b2()));
but2->setStyleSheet(BUTTONCOLOR0); but2->setStyleSheet(BUTTONCOLOR0);
but2->setFont(myTabFont); but2->setFont(myTabFont);
but3 = new QPushButton("check BL: \n"); but3 = new QPushButton("check BL: ");
myVlayer_right->addWidget(but3); myVlayer_left->addWidget(but3);
connect(but3, SIGNAL(clicked()), this, SLOT(slot_checkBl())); connect(but3, SIGNAL(clicked()), this, SLOT(slot_b3()));
but3->setStyleSheet(BUTTONCOLOR0); but3->setStyleSheet(BUTTONCOLOR0);
but3->setFont(myTabFont); but3->setFont(myTabFont);
@ -101,8 +128,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myTabFont.setPixelSize(22); myTabFont.setPixelSize(22);
but10 = new QPushButton("stop BL: "); but10 = new QPushButton("stop BL: ");
myVlayer_right->addWidget(but10); myVlayer_left->addWidget(but10);
connect(but10, SIGNAL(clicked()), this, SLOT(slot_stopBL())); connect(but10, SIGNAL(clicked()), this, SLOT(slot_b10()));
but10->setStyleSheet(BUTTONCOLOR0); but10->setStyleSheet(BUTTONCOLOR0);
but10->setFont(myTabFont); but10->setFont(myTabFont);
@ -129,10 +156,9 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
myTO->setSingleShot(true); myTO->setSingleShot(true);
myTO->start(2); myTO->start(2);
trigger_BLstartup=false; trigger_BLstartup=false;
win12_startProgramming=false; win12_startProgramming=0;
win12_nrOfFWblocks=0; win12_nrOfFWblocks=0;
win12_currentBlkNr=0; win12_currentBlkNr=0;
APservBLisUp=false;
} }
T_win12::~T_win12() T_win12::~T_win12()
@ -153,29 +179,20 @@ void T_win12::Nav_next(void)
myNextStep=WCS_WIN12FWD; myNextStep=WCS_WIN12FWD;
} }
void T_win12::slot_startCompleteBL(void) void T_win12::slot_b1(void)
{
// replaces the next three single steps restart_DC, start_BL and check_BL
showState->setText(" starting bootloader... ");
showFile->setText(" ");
HWaccess->bl_completeStart();
}
// single steps from former version:
void T_win12::slot_restart(void)
{ {
showProgress->append(" rebooting"); showProgress->append(" rebooting");
HWaccess->dc_autoRequest(false); HWaccess->dc_autoRequest(false);
HWaccess->bl_rebootDC(); HWaccess->bl_rebootDC();
} }
void T_win12::slot_startBl(void) void T_win12::slot_b2(void)
{ {
HWaccess->dc_autoRequest(false); HWaccess->dc_autoRequest(false);
HWaccess->bl_startBL(); HWaccess->bl_startBL();
} }
void T_win12::slot_checkBl(void) void T_win12::slot_b3(void)
{ {
HWaccess->dc_autoRequest(false); HWaccess->dc_autoRequest(false);
showState->setText(" "); showState->setText(" ");
@ -185,24 +202,17 @@ void T_win12::slot_checkBl(void)
myStep=20; myStep=20;
} }
void T_win12::slot_loadBin(void) void T_win12::slot_b4(void)
{ {
QString myStr; QString myStr;
QString fileName; QString fileName;
win12_nrOfFWblocks=0; win12_nrOfFWblocks=0;
fileName.clear(); fileName.clear();
// bin file im selben folder wie in PTU5: /etc/dc/
fileName = QFileDialog::getOpenFileName(this, ("Select DC firmware file:"), fileName = QFileDialog::getOpenFileName(this, ("Select DC firmware file:"),
"/etc/dc", "C:/own/work2023/PSA1256ptu5/PTU SW",
("binary file(*.bin)")); ("binary file(*.bin)"));
// Jsons im selben folder wie in PTU5: /etc/psa_config
//fileName = QFileDialog::getOpenFileName(this, ("Select JSON file:"),
// "/etc/psa_config",
// ("binary file(*.json)"));
//qDebug()<<"T_win12: selected file: "<<fileName; //qDebug()<<"T_win12: selected file: "<<fileName;
bool ret=HWaccess->bl_storeFirmware(fileName); bool ret=HWaccess->bl_storeFirmware(fileName);
win12_nrOfFWblocks = HWaccess->bl_getNrOfFirmwareBlocks(); win12_nrOfFWblocks = HWaccess->bl_getNrOfFirmwareBlocks();
@ -219,27 +229,42 @@ void T_win12::slot_loadBin(void)
showFile->setText(" cannot load file :-( "); showFile->setText(" cannot load file :-( ");
} }
void T_win12::slot_b5(void)
void T_win12::slot_sendBin(void)
{ {
win12_startProgramming=true; win12_startProgramming=true;
showProgress->clear();
myStep=5; myStep=5;
} }
void T_win12::slot_b6(void)
{
}
void T_win12::slot_stopBL(void) void T_win12::slot_b7(void)
{
}
void T_win12::slot_b8(void)
{
}
void T_win12::slot_b9(void)
{
showState->setText(" Bootloader is off ");
showFile->setText(" ");
//trigger_BLstartup=true;
//myStep=0;
// neu, 29.9: Start-Schrittkette jetzt in HWapi:
HWaccess->bl_completeStart();
}
void T_win12::slot_b10(void)
{ {
showState->setText(" Bootloader is off "); showState->setText(" Bootloader is off ");
showFile->setText(" "); showFile->setText(" ");
HWaccess->bl_stopBL(); HWaccess->bl_stopBL();
HWaccess->dc_autoRequest(true); HWaccess->dc_autoRequest(true);
APservBLisUp=false;
}
bool T_win12::isBLup()
{
return APservBLisUp;
} }
bool T_win12::work_ini(uint16_t *nextScreen, uint8_t *useNavi) bool T_win12::work_ini(uint16_t *nextScreen, uint8_t *useNavi)
@ -270,17 +295,98 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
*nextScreen=0; // 0=no change *nextScreen=0; // 0=no change
*useNavi=0; *useNavi=0;
int8_t iresult; //int8_t iresult;
if (HWaccess->bl_isUp()==1) if (HWaccess->bl_isUp())
APservBLisUp=true;
if (APservBLisUp)
showState->setText(" Bootloader is running"); showState->setText(" Bootloader is running");
else
showState->setText(" - - - ");
/*
if (myStep==0)
{
if (trigger_BLstartup)
{
HWaccess->dc_autoRequest(false);
myStep++;
}
} else
if (myStep==1)
{
//qDebug()<<"win12 chain step 1";
if (trigger_BLstartup)
{
//qDebug()<<"starting up BL step1";
trigger_BLstartup=false;
HWaccess->bl_rebootDC();
myTO->stop();
myTO->start(1000); // restart
retryCtr=0;
myStep++;
//qDebug()<<"win12 chain step 2";
}
} else
if (myStep==2)
{
if (!myTO->isActive())
{
qDebug()<<"starting BL";
HWaccess->bl_startBL();
myTO->stop();
myTO->start(100);
myStep++;
//qDebug()<<"win12 chain step 3";
}
} else
if (myStep==3)
{
if (!myTO->isActive())
{
HWaccess->bl_checkBL();
myTO->stop();
myTO->start(100);
myStep++;
//qDebug()<<"win12 chain step 4";
}
} else
if (myStep==4)
{
if (!myTO->isActive())
{
//qDebug()<<"starting up BL step4";
myTO->stop();
if (HWaccess->bl_isUp())
{
myStep++;
//qDebug()<<"win12 chain step 5";
showState->setText(" --- BL is up and running ---");
//qDebug()<<"BL laeuft!!!";
} else
{
retryCtr++; // start again
if (retryCtr>=15)
{
myStep=99;
//qDebug()<<"win12 chain step 99";
showState->setText(" --- BL error! ---");
//qDebug()<<"BL error!!!";
} else
{
myStep=3;
//qDebug()<<"BL retry...";
//qDebug()<<"win12 chain step 3";
}
}
}
} else
if (myStep==5) if (myStep==5)
{ {
if (win12_startProgramming) if (win12_startProgramming)
@ -299,26 +405,17 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
if (myStep==6) if (myStep==6)
{ {
//qDebug()<<"starting transfer";
// -------------------------------------------------------------------
HWaccess->bl_blockAutoLoad(win12_currentBlkNr); HWaccess->bl_blockAutoLoad(win12_currentBlkNr);
// ------------------------------------------------------------------- showProgress->append(swl_int2str(win12_currentBlkNr));
//if (win12_currentBlkNr%10==0) // nur jeden 10. Block anzeigen
// geht auch nicht schneller
showProgress->append(swl_int2str(win12_currentBlkNr));
myStep++; myStep++;
//qDebug()<<"win12 chain step 6->7"; //qDebug()<<"win12 chain step 6->7";
} else } else
if (myStep==7) if (myStep==7)
{ {
// -------------------------------------------------------------------
iresult=HWaccess->bl_blockAutoResponse(); iresult=HWaccess->bl_blockAutoResponse();
// 0: wait 1: OK, blk was sent 2: OK, transfer complete 3: error // 0: wait 1: OK, blk was sent 2: OK, transfer complete 3: error
// -------------------------------------------------------------------
if (iresult==1) if (iresult==1)
{ {
win12_currentBlkNr++; win12_currentBlkNr++;
@ -355,7 +452,7 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
{ {
} }
/*
if (myStep==20) if (myStep==20)
{ {
if (!myTO->isActive()) if (!myTO->isActive())

View File

@ -50,7 +50,6 @@ class T_win12 : public QWidget
bool trigger_BLstartup; bool trigger_BLstartup;
int retryCtr; int retryCtr;
QTextEdit *showProgress; QTextEdit *showProgress;
bool APservBLisUp;
public: public:
explicit T_win12(hwinf *HWaccess = nullptr, QWidget *parent = nullptr); explicit T_win12(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
@ -62,21 +61,21 @@ public:
bool working (uint16_t *nextScreen, uint8_t *useNavi); bool working (uint16_t *nextScreen, uint8_t *useNavi);
~T_win12(); ~T_win12();
bool isBLup();
public slots: public slots:
void Nav_back(void); void Nav_back(void);
void Nav_home(void); void Nav_home(void);
void Nav_next(void); void Nav_next(void);
void slot_restart(void); void slot_b1(void);
void slot_startBl(void); void slot_b2(void);
void slot_checkBl(void); void slot_b3(void);
void slot_startCompleteBL(void); void slot_b4(void);
void slot_sendBin(void); void slot_b5(void);
void slot_loadBin(void); void slot_b6(void);
void slot_stopBL(void); void slot_b7(void);
void slot_b8(void);
void slot_b9(void);
void slot_b10(void);
}; };