Compare commits
No commits in common. "download-device-controller" and "master" have entirely different histories.
download-d
...
master
@ -591,8 +591,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
|
||||
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()
|
||||
@ -961,7 +959,7 @@ void MainWindow::chainControl(void)
|
||||
|
||||
uint16_t nextScreen=0;
|
||||
uint8_t useNavi=0;
|
||||
bool busy=false, nowBL;
|
||||
bool busy=false;
|
||||
static uint32_t offlineCtr;
|
||||
|
||||
// call permanent functions here:
|
||||
@ -969,14 +967,19 @@ void MainWindow::chainControl(void)
|
||||
//diary->working();
|
||||
//conf->working();
|
||||
|
||||
nowBL=myFenster12->isBLup();
|
||||
if (HWaccess->sys_areDCdataValid()==false && !nowBL)
|
||||
//qDebug()<<"mainwin chaincontrol calling mif";
|
||||
|
||||
|
||||
if (HWaccess->sys_areDCdataValid()==false)
|
||||
{
|
||||
//qDebug()<<"mainwin: lost connection to DC "<<offlineCtr;
|
||||
qDebug()<<"mainwin: lost connection to DC "<<offlineCtr;
|
||||
offlineCtr++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// working step chain:
|
||||
if (chainCurrentStep != chainNextStep)
|
||||
{
|
||||
@ -1006,7 +1009,7 @@ void MainWindow::chainControl(void)
|
||||
if (chain_stepIni)
|
||||
busy=myFenster02->work_ini(&nextScreen, &useNavi);
|
||||
else
|
||||
busy=myFenster02->working(&nextScreen, &useNavi, nowBL);
|
||||
busy=myFenster02->working(&nextScreen, &useNavi);
|
||||
} else
|
||||
if (chainCurrentStep==3)
|
||||
{
|
||||
@ -1268,7 +1271,5 @@ void MainWindow::vendingTimeout(void)
|
||||
timerVendingTimeout->stop();
|
||||
}
|
||||
|
||||
bool MainWindow::BLisRunning()
|
||||
{
|
||||
return myFenster12->isBLup();
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,7 +147,6 @@ public:
|
||||
#define FORWBUTTON 3
|
||||
void enableNaviButtons(uint8_t buttonNr, bool enabled);
|
||||
void enableNaviButtons(uint8_t switchBitwise);
|
||||
bool BLisRunning();
|
||||
|
||||
private slots:
|
||||
void chainControl();
|
||||
|
10
stepList.h
10
stepList.h
@ -35,9 +35,8 @@
|
||||
#define PAGE_NEXT20 20
|
||||
|
||||
// fix: customize:
|
||||
//#define WCS_STARTSCREEN PAGE_COMPORT
|
||||
//#define WCS_STARTSCREEN PAGE_NEXT16
|
||||
#define WCS_STARTSCREEN PAGE_SERVICEMAIN
|
||||
//#define WCS_STARTSCREEN PAGE_COMPORT // if APservice uses masterLib
|
||||
#define WCS_STARTSCREEN PAGE_SERVICEMAIN // if APservice uses slaveLib
|
||||
|
||||
// PAGE_COMPORT:
|
||||
#define WCS_WIN01BAK PAGE_COMPORT
|
||||
@ -45,7 +44,6 @@
|
||||
#define WCS_WIN01FWD PAGE_SERVICEMAIN
|
||||
|
||||
// PAGE_SERVICEMAIN:
|
||||
//#define WCS_WIN02BAK PAGE_NEXT16
|
||||
#define WCS_WIN02BAK PAGE_BOOTLOADER
|
||||
#define WCS_WIN02MID PAGE_SERVICEMAIN
|
||||
#define WCS_WIN02FWD PAGE_TIMEDATEVERSION
|
||||
@ -172,8 +170,8 @@
|
||||
#define WCS_WIN02SHORT08 PAGE_VAULTRECORD
|
||||
#define WIN02_LABEL_SHORT09 "Program"
|
||||
#define WCS_WIN02SHORT09 PAGE_PROG_JSON
|
||||
#define WIN02_LABEL_SHORT10 " B L "
|
||||
#define WCS_WIN02SHORT10 PAGE_BOOTLOADER
|
||||
#define WIN02_LABEL_SHORT10 " "
|
||||
#define WCS_WIN02SHORT10 PAGE_SERVICEMAIN
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
// 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();
|
||||
|
||||
// update values:
|
||||
if (HWaccess->bl_isUp()==1)
|
||||
//if (isBLup)
|
||||
{
|
||||
labState->setText(" DC2 Bootloader");
|
||||
labState->setStyleSheet(COLOR_RED);
|
||||
|
||||
} else
|
||||
if (HWaccess->sys_areDCdataValid())
|
||||
{
|
||||
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);
|
||||
|
||||
|
||||
|
||||
if (cunu>0 && manu>0)
|
||||
{
|
||||
myStr.clear();
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
// bit0,1: enable/disable button "next"
|
||||
// bit2,3: enable/disable button "home"
|
||||
// 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();
|
||||
|
||||
private slots:
|
||||
|
@ -18,7 +18,6 @@ T_win04::T_win04(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
myTabFont.setPixelSize(PIXELSIZE_BUTTONS);
|
||||
pb_refresh = new QPushButton("Refresh");
|
||||
pb_refresh->setFont(myTabFont);
|
||||
pb_refresh->setStyleSheet("background-color: rgb(250,150,150)"); // hell rot
|
||||
myLayout->addWidget(pb_refresh,1,1);
|
||||
connect(pb_refresh, SIGNAL(clicked()), this, SLOT(ButtonRefreshClicked()));
|
||||
|
||||
@ -100,7 +99,6 @@ void T_win04::Nav_next(void)
|
||||
void T_win04::ButtonRefreshClicked(void)
|
||||
{
|
||||
win04_dataAreValid=0;
|
||||
pb_refresh->setStyleSheet("background-color: white");
|
||||
}
|
||||
|
||||
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_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);
|
||||
|
||||
if (!win04_dataAreValid)
|
||||
|
@ -114,37 +114,6 @@ T_win09::T_win09(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
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);
|
||||
myNextStep=0;
|
||||
myStep=0;
|
||||
@ -241,33 +210,6 @@ void T_win09::slot_startTest(void)
|
||||
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();
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -37,7 +37,6 @@ class T_win09 : public QWidget
|
||||
QPushButton *pbModemPwr, *pbModemWake, *pbCreditPwr, *pbCreditWake, *pbModemRes;
|
||||
QLabel *showModemCondition;
|
||||
|
||||
//QPushButton *pbTest1, *pbTest2, *pbTest3, *pbTest4;
|
||||
|
||||
public:
|
||||
explicit T_win09(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
|
||||
@ -59,12 +58,6 @@ public slots:
|
||||
void slot_CreditWake(void);
|
||||
void slot_startTest(void);
|
||||
void slot_ModemRes(void);
|
||||
// void slot_pbTest1(void);
|
||||
// void slot_pbTest2(void);
|
||||
// void slot_pbTest3(void);
|
||||
// void slot_pbTest4(void);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
237
win12_BL.cpp
237
win12_BL.cpp
@ -44,11 +44,11 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
// linke Spalte: controls
|
||||
QLabel *lab7 = new QLabel(" ");
|
||||
lab7->setFont(myTabFont);
|
||||
myVlayer_right->addWidget(lab7);
|
||||
myVlayer_left->addWidget(lab7);
|
||||
|
||||
but9 = new QPushButton("Starting \nBootloader");
|
||||
myVlayer_right->addWidget(but9);
|
||||
connect(but9, SIGNAL(clicked()), this, SLOT(slot_startCompleteBL()));
|
||||
myVlayer_left->addWidget(but9);
|
||||
connect(but9, SIGNAL(clicked()), this, SLOT(slot_b9()));
|
||||
but9->setStyleSheet(BUTTONCOLOR0);
|
||||
but9->setFont(myTabFont);
|
||||
|
||||
@ -57,8 +57,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
myH0layer->addWidget(lab3);
|
||||
|
||||
but4 = new QPushButton("load Bin-File");
|
||||
myVlayer_right->addWidget(but4);
|
||||
connect(but4, SIGNAL(clicked()), this, SLOT(slot_loadBin()));
|
||||
myVlayer_left->addWidget(but4);
|
||||
connect(but4, SIGNAL(clicked()), this, SLOT(slot_b4()));
|
||||
but4->setStyleSheet(BUTTONCOLOR0);
|
||||
but4->setFont(myTabFont);
|
||||
|
||||
@ -67,8 +67,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
myH0layer->addWidget(lab4);
|
||||
|
||||
but5 = new QPushButton(" send file to DC");
|
||||
myVlayer_right->addWidget(but5);
|
||||
connect(but5, SIGNAL(clicked()), this, SLOT(slot_sendBin()));
|
||||
myVlayer_left->addWidget(but5);
|
||||
connect(but5, SIGNAL(clicked()), this, SLOT(slot_b5()));
|
||||
but5->setStyleSheet(BUTTONCOLOR0);
|
||||
but5->setFont(myTabFont);
|
||||
|
||||
@ -76,22 +76,49 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
lab5->setFont(myTabFont);
|
||||
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);
|
||||
but1 = new QPushButton("restart DC: \n");
|
||||
myVlayer_right->addWidget(but1);
|
||||
connect(but1, SIGNAL(clicked()), this, SLOT(slot_restart()));
|
||||
but1 = new QPushButton("restart DC: ");
|
||||
myVlayer_left->addWidget(but1);
|
||||
connect(but1, SIGNAL(clicked()), this, SLOT(slot_b1()));
|
||||
but1->setStyleSheet(BUTTONCOLOR0);
|
||||
but1->setFont(myTabFont);
|
||||
|
||||
but2 = new QPushButton("Start BL: \n");
|
||||
myVlayer_right->addWidget(but2);
|
||||
connect(but2, SIGNAL(clicked()), this, SLOT(slot_startBl()));
|
||||
but2 = new QPushButton("Start BL: ");
|
||||
myVlayer_left->addWidget(but2);
|
||||
connect(but2, SIGNAL(clicked()), this, SLOT(slot_b2()));
|
||||
but2->setStyleSheet(BUTTONCOLOR0);
|
||||
but2->setFont(myTabFont);
|
||||
|
||||
but3 = new QPushButton("check BL: \n");
|
||||
myVlayer_right->addWidget(but3);
|
||||
connect(but3, SIGNAL(clicked()), this, SLOT(slot_checkBl()));
|
||||
but3 = new QPushButton("check BL: ");
|
||||
myVlayer_left->addWidget(but3);
|
||||
connect(but3, SIGNAL(clicked()), this, SLOT(slot_b3()));
|
||||
but3->setStyleSheet(BUTTONCOLOR0);
|
||||
but3->setFont(myTabFont);
|
||||
|
||||
@ -101,8 +128,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
|
||||
myTabFont.setPixelSize(22);
|
||||
but10 = new QPushButton("stop BL: ");
|
||||
myVlayer_right->addWidget(but10);
|
||||
connect(but10, SIGNAL(clicked()), this, SLOT(slot_stopBL()));
|
||||
myVlayer_left->addWidget(but10);
|
||||
connect(but10, SIGNAL(clicked()), this, SLOT(slot_b10()));
|
||||
but10->setStyleSheet(BUTTONCOLOR0);
|
||||
but10->setFont(myTabFont);
|
||||
|
||||
@ -129,10 +156,9 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
|
||||
myTO->setSingleShot(true);
|
||||
myTO->start(2);
|
||||
trigger_BLstartup=false;
|
||||
win12_startProgramming=false;
|
||||
win12_startProgramming=0;
|
||||
win12_nrOfFWblocks=0;
|
||||
win12_currentBlkNr=0;
|
||||
APservBLisUp=false;
|
||||
}
|
||||
|
||||
T_win12::~T_win12()
|
||||
@ -153,29 +179,20 @@ void T_win12::Nav_next(void)
|
||||
myNextStep=WCS_WIN12FWD;
|
||||
}
|
||||
|
||||
void T_win12::slot_startCompleteBL(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)
|
||||
void T_win12::slot_b1(void)
|
||||
{
|
||||
showProgress->append(" rebooting");
|
||||
HWaccess->dc_autoRequest(false);
|
||||
HWaccess->bl_rebootDC();
|
||||
}
|
||||
|
||||
void T_win12::slot_startBl(void)
|
||||
void T_win12::slot_b2(void)
|
||||
{
|
||||
HWaccess->dc_autoRequest(false);
|
||||
HWaccess->bl_startBL();
|
||||
}
|
||||
|
||||
void T_win12::slot_checkBl(void)
|
||||
void T_win12::slot_b3(void)
|
||||
{
|
||||
HWaccess->dc_autoRequest(false);
|
||||
showState->setText(" ");
|
||||
@ -185,24 +202,17 @@ void T_win12::slot_checkBl(void)
|
||||
myStep=20;
|
||||
}
|
||||
|
||||
void T_win12::slot_loadBin(void)
|
||||
void T_win12::slot_b4(void)
|
||||
{
|
||||
QString myStr;
|
||||
QString fileName;
|
||||
|
||||
win12_nrOfFWblocks=0;
|
||||
fileName.clear();
|
||||
|
||||
// bin file im selben folder wie in PTU5: /etc/dc/
|
||||
fileName = QFileDialog::getOpenFileName(this, ("Select DC firmware file:"),
|
||||
"/etc/dc",
|
||||
"C:/own/work2023/PSA1256ptu5/PTU SW",
|
||||
("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;
|
||||
bool ret=HWaccess->bl_storeFirmware(fileName);
|
||||
win12_nrOfFWblocks = HWaccess->bl_getNrOfFirmwareBlocks();
|
||||
@ -219,27 +229,42 @@ void T_win12::slot_loadBin(void)
|
||||
showFile->setText(" cannot load file :-( ");
|
||||
}
|
||||
|
||||
|
||||
void T_win12::slot_sendBin(void)
|
||||
void T_win12::slot_b5(void)
|
||||
{
|
||||
win12_startProgramming=true;
|
||||
showProgress->clear();
|
||||
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 ");
|
||||
showFile->setText(" ");
|
||||
HWaccess->bl_stopBL();
|
||||
HWaccess->dc_autoRequest(true);
|
||||
APservBLisUp=false;
|
||||
}
|
||||
|
||||
bool T_win12::isBLup()
|
||||
{
|
||||
return APservBLisUp;
|
||||
}
|
||||
|
||||
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
|
||||
*useNavi=0;
|
||||
int8_t iresult;
|
||||
//int8_t iresult;
|
||||
|
||||
if (HWaccess->bl_isUp()==1)
|
||||
APservBLisUp=true;
|
||||
|
||||
if (APservBLisUp)
|
||||
if (HWaccess->bl_isUp())
|
||||
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 (win12_startProgramming)
|
||||
@ -299,26 +405,17 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
|
||||
|
||||
if (myStep==6)
|
||||
{
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//qDebug()<<"starting transfer";
|
||||
HWaccess->bl_blockAutoLoad(win12_currentBlkNr);
|
||||
// -------------------------------------------------------------------
|
||||
//if (win12_currentBlkNr%10==0) // nur jeden 10. Block anzeigen
|
||||
// geht auch nicht schneller
|
||||
showProgress->append(swl_int2str(win12_currentBlkNr));
|
||||
showProgress->append(swl_int2str(win12_currentBlkNr));
|
||||
myStep++;
|
||||
//qDebug()<<"win12 chain step 6->7";
|
||||
} else
|
||||
|
||||
if (myStep==7)
|
||||
{
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
iresult=HWaccess->bl_blockAutoResponse();
|
||||
// 0: wait 1: OK, blk was sent 2: OK, transfer complete 3: error
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
if (iresult==1)
|
||||
{
|
||||
win12_currentBlkNr++;
|
||||
@ -355,7 +452,7 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
|
||||
{
|
||||
|
||||
}
|
||||
/*
|
||||
|
||||
if (myStep==20)
|
||||
{
|
||||
if (!myTO->isActive())
|
||||
|
21
win12_BL.h
21
win12_BL.h
@ -50,7 +50,6 @@ class T_win12 : public QWidget
|
||||
bool trigger_BLstartup;
|
||||
int retryCtr;
|
||||
QTextEdit *showProgress;
|
||||
bool APservBLisUp;
|
||||
|
||||
public:
|
||||
explicit T_win12(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
|
||||
@ -62,21 +61,21 @@ public:
|
||||
bool working (uint16_t *nextScreen, uint8_t *useNavi);
|
||||
~T_win12();
|
||||
|
||||
bool isBLup();
|
||||
|
||||
|
||||
public slots:
|
||||
void Nav_back(void);
|
||||
void Nav_home(void);
|
||||
void Nav_next(void);
|
||||
|
||||
void slot_restart(void);
|
||||
void slot_startBl(void);
|
||||
void slot_checkBl(void);
|
||||
void slot_startCompleteBL(void);
|
||||
void slot_sendBin(void);
|
||||
void slot_loadBin(void);
|
||||
void slot_stopBL(void);
|
||||
void slot_b1(void);
|
||||
void slot_b2(void);
|
||||
void slot_b3(void);
|
||||
void slot_b4(void);
|
||||
void slot_b5(void);
|
||||
void slot_b6(void);
|
||||
void slot_b7(void);
|
||||
void slot_b8(void);
|
||||
void slot_b9(void);
|
||||
void slot_b10(void);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user