Compare commits
	
		
			9 Commits
		
	
	
		
			1.0.1
			...
			download-d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2b6a37da9e | |||
| 
						
						
							
						
						3acf0e3342
	
				 | 
					
					
						|||
| 
						
						
							
						
						5598cdc4cd
	
				 | 
					
					
						|||
| 
						
						
							
						
						c83e39e612
	
				 | 
					
					
						|||
| 
						
						
							
						
						433f295f8b
	
				 | 
					
					
						|||
| 
						
						
							
						
						85716fb9db
	
				 | 
					
					
						|||
| c0ae02edaf | |||
| 
						
						
							
						
						81d1e2984a
	
				 | 
					
					
						|||
| 
						
						
							
						
						ec7da3cc45
	
				 | 
					
					
						
							
								
								
									
										38
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,2 +1,36 @@
 | 
			
		||||
*.user
 | 
			
		||||
*.user.*
 | 
			
		||||
# C++ objects and libs
 | 
			
		||||
 | 
			
		||||
*.slo
 | 
			
		||||
*.lo
 | 
			
		||||
*.o
 | 
			
		||||
*.a
 | 
			
		||||
*.la
 | 
			
		||||
*.lai
 | 
			
		||||
*.so
 | 
			
		||||
*.dll
 | 
			
		||||
*.dylib
 | 
			
		||||
 | 
			
		||||
# Qt-es
 | 
			
		||||
 | 
			
		||||
*.pro.user
 | 
			
		||||
*.pro.user.*
 | 
			
		||||
moc_*.cpp
 | 
			
		||||
qrc_*.cpp
 | 
			
		||||
Makefile
 | 
			
		||||
Makefile.*
 | 
			
		||||
*-build-*
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
*.autosave
 | 
			
		||||
ui_*.h
 | 
			
		||||
version.h
 | 
			
		||||
version.txt
 | 
			
		||||
 | 
			
		||||
packages/*
 | 
			
		||||
*.pro.orig
 | 
			
		||||
Output/setup.exe
 | 
			
		||||
 | 
			
		||||
.directory
 | 
			
		||||
 | 
			
		||||
*~
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -104,3 +104,20 @@ HEADERS += \
 | 
			
		||||
    win_template.h \
 | 
			
		||||
    datei.h \
 | 
			
		||||
    plugin.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
OTHER_FILES += \
 | 
			
		||||
    generate-version.sh
 | 
			
		||||
 | 
			
		||||
CONFIG(DesktopLinux, DesktopLinux|PTU5):DEFINES += SYSTEM_DESKTOP_LINUX
 | 
			
		||||
CONFIG(PTU5,         DesktopLinux|PTU5):DEFINES += SYSTEM_PTU5
 | 
			
		||||
 | 
			
		||||
# Define how to create version.h
 | 
			
		||||
VERSION_H = $$PWD/version.h
 | 
			
		||||
version.output = $$PWD/version.h
 | 
			
		||||
version.commands = $$PWD/generate-version.sh $${ARCH} $${TARGET} $${VERSION_H}
 | 
			
		||||
version.depends = FORCE
 | 
			
		||||
version.input = VERSION_H
 | 
			
		||||
version.variable_out = HEADERS
 | 
			
		||||
QMAKE_EXTRA_COMPILERS += version
 | 
			
		||||
QMAKE_CLEAN += $${PWD}/version.h
 | 
			
		||||
 
 | 
			
		||||
@@ -840,6 +840,9 @@ QByteArray datei_readFromFile(QString filename)
 | 
			
		||||
    return myBA;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * deprecated - use QFileInfo
 | 
			
		||||
 */
 | 
			
		||||
bool datei_ifFileExists(QString filename)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								datei.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								datei.h
									
									
									
									
									
								
							@@ -28,13 +28,13 @@
 | 
			
		||||
// all generated files located in sudirectory "dynamic machine data - dmd"
 | 
			
		||||
 | 
			
		||||
#define FILENAME_COMPORT            "../comport.csv"
 | 
			
		||||
#define FILENAME_CONFIG             "/own/work2023/PSA1256ptu5/smd/DC2C_conf.json"
 | 
			
		||||
#define FILENAME_DEVICE             "/own/work2023/PSA1256ptu5/smd/DC2C_device.json"
 | 
			
		||||
#define FILENAME_CASH              "/own/work2023/PSA1256ptu5/smd/DC2C_cash.json"
 | 
			
		||||
#define FILENAME_PRINT             "/own/work2023/PSA1256ptu5/smd/DC2C_print32.json"
 | 
			
		||||
#define FILENAME_APSERVCONF        "../APserviceConfig.csv"
 | 
			
		||||
 | 
			
		||||
#define FILENAME_APSERVCONF         "../APserviceConfig.csv"
 | 
			
		||||
 | 
			
		||||
const QString config_path = QStringLiteral("/etc/psa_config/");
 | 
			
		||||
const QString filename_config = QStringLiteral("DC2C_conf.json");
 | 
			
		||||
const QString filename_device = QStringLiteral("DC2C_device.json");
 | 
			
		||||
const QString filename_cash   = QStringLiteral("DC2C_cash.json");
 | 
			
		||||
const QString filename_print  = QStringLiteral("DC2C_print32.json");
 | 
			
		||||
 | 
			
		||||
// -------------------------------------------------------------------------------------------------
 | 
			
		||||
// ------------------------------------------------------ create csv file -------------------------------
 | 
			
		||||
@@ -194,6 +194,7 @@ void datei_closeFile(QString filename);
 | 
			
		||||
// read content of an exiting file:
 | 
			
		||||
QByteArray datei_readFromFile(QString filename);
 | 
			
		||||
 | 
			
		||||
// deprecated - user QFileInfo
 | 
			
		||||
bool datei_ifFileExists(QString filename);
 | 
			
		||||
 | 
			
		||||
char datei_writeToFile(QString filename, QByteArray content);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										126
									
								
								generate-version.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										126
									
								
								generate-version.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,126 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
VERSION_STRING=""
 | 
			
		||||
 | 
			
		||||
#GIT='/cygdrive/c/Program Files \(x86\)/Git/bin/git'
 | 
			
		||||
GIT=git
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
parse_git_branch () {
 | 
			
		||||
    $GIT branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ARCH=$1
 | 
			
		||||
TARGET=$2
 | 
			
		||||
VERSION_H=$3
 | 
			
		||||
 | 
			
		||||
SCRIPT=$(readlink -f $0)
 | 
			
		||||
SCRIPTPATH=`dirname $SCRIPT`
 | 
			
		||||
OUTPUTDIR=$(pwd)
 | 
			
		||||
echo " current dir is : " $(pwd)
 | 
			
		||||
echo $SCRIPT
 | 
			
		||||
echo $SCRIPTPATH
 | 
			
		||||
 | 
			
		||||
echo "changing dir to script path: " $SCRIPTPATH
 | 
			
		||||
cd $SCRIPTPATH
 | 
			
		||||
 | 
			
		||||
# set version string ##################################################################
 | 
			
		||||
if [ -z $VERSION_STRING ] ; then
 | 
			
		||||
  VERSION_STRING=$(date +%Y%m%d_%H%M)
 | 
			
		||||
fi
 | 
			
		||||
GIT_DESCRIBE=$($GIT describe)
 | 
			
		||||
GIT_BRANCH=$(parse_git_branch)
 | 
			
		||||
 | 
			
		||||
# extract path from branchname:
 | 
			
		||||
IFS='_' read -ra TMP_ARRAY <<< "${GIT_BRANCH}"
 | 
			
		||||
BRANCH_PATH=${TMP_ARRAY[0]}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# detect if we have a development version:
 | 
			
		||||
if [ ${#TMP_ARRAY[1]} -gt 0 ] ; then
 | 
			
		||||
  DEV_SUFFIX="_dev"
 | 
			
		||||
else
 | 
			
		||||
  DEV_SUFFIX=""
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# detect if git status is dirty
 | 
			
		||||
GIT_DESCRIBE_DIRTY=$($GIT describe --dirty)
 | 
			
		||||
if [ "${GIT_DESCRIBE_DIRTY:(-6)}" == "-dirty" ] ; then
 | 
			
		||||
  DIRTY_SUFFIX="_dirty"
 | 
			
		||||
else
 | 
			
		||||
  DIRTY_SUFFIX=""
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if [ -n "$DIRTY_SUFFIX" ] || [ -n "$DEV_SUFFIX" ] ; then
 | 
			
		||||
  DEVDIRTY=true
 | 
			
		||||
else
 | 
			
		||||
  DEVDIRTY=false
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# write version.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo "     TARGET is: $TARGET"
 | 
			
		||||
echo "     ARCH   is: $ARCH"
 | 
			
		||||
echo " "
 | 
			
		||||
echo "     PluginName: $TARGET"
 | 
			
		||||
echo " "
 | 
			
		||||
echo "     new version is:  $VERSION_STRING"
 | 
			
		||||
echo "     git describe is: $GIT_DESCRIBE"
 | 
			
		||||
echo "     git branch is:   $GIT_BRANCH"
 | 
			
		||||
echo "     branch-path is:  $BRANCH_PATH"
 | 
			
		||||
echo "  "
 | 
			
		||||
 | 
			
		||||
echo "     dev suffix:     $DEV_SUFFIX"
 | 
			
		||||
echo "     dirty suffix:   $DIRTY_SUFFIX"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
APP_VERSION=${VERSION_STRING}
 | 
			
		||||
#ATB_QT_GIT_DESCRIBE=${GIT_DESCRIBE}_${GIT_BRANCH}
 | 
			
		||||
APP_GIT_DESCRIBE=${GIT_DESCRIBE}_${BRANCH_PATH}${DEV_SUFFIX}${DIRTY_SUFFIX}
 | 
			
		||||
 | 
			
		||||
#TARGET=IngenicoZVT_CCPlugin
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# build version.h #####################################################################
 | 
			
		||||
 | 
			
		||||
echo "     building new version info (version.h) ..."
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo "#ifndef VERSION_H"   >  ${VERSION_H}
 | 
			
		||||
echo "#define VERSION_H"   >> ${VERSION_H}
 | 
			
		||||
echo ""                    >> ${VERSION_H}
 | 
			
		||||
echo ""                    >> ${VERSION_H}
 | 
			
		||||
echo "#define APP_VERSION \"${APP_VERSION}\""           >> ${VERSION_H}
 | 
			
		||||
echo ""                                                 >> ${VERSION_H}
 | 
			
		||||
echo "#define APP_GIT_DESCRIBE \"${APP_GIT_DESCRIBE}\"" >> ${VERSION_H}
 | 
			
		||||
echo ""                                                 >> ${VERSION_H}
 | 
			
		||||
echo ""                                                 >> ${VERSION_H}
 | 
			
		||||
 | 
			
		||||
echo ""                                              >> ${VERSION_H}
 | 
			
		||||
echo ""                                              >> ${VERSION_H}
 | 
			
		||||
if [ ${DEVDIRTY} == "true" ] ; then
 | 
			
		||||
echo "#define DEVDIRTY"                              >> ${VERSION_H}
 | 
			
		||||
echo ""                                              >> ${VERSION_H}
 | 
			
		||||
echo ""                                              >> ${VERSION_H}
 | 
			
		||||
fi
 | 
			
		||||
echo "#define SYSTEM_ARCH \"${ARCH}\""               >> ${VERSION_H}
 | 
			
		||||
echo "#define ARCH_${ARCH}"                          >> ${VERSION_H}
 | 
			
		||||
echo ""                                              >> ${VERSION_H}
 | 
			
		||||
echo "" 					     >> ${VERSION_H}
 | 
			
		||||
echo "#endif //VERSION_H"  >> ${VERSION_H}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								keypad.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								keypad.cpp
									
									
									
									
									
								
							@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								keypad.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								keypad.h
									
									
									
									
									
								
							@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.cpp
									
									
									
									
									
								
							@@ -2,6 +2,8 @@
 | 
			
		||||
//#include "message_handler.h"
 | 
			
		||||
#include <QApplication>
 | 
			
		||||
 | 
			
		||||
#include "version.h"
 | 
			
		||||
 | 
			
		||||
int thisisglobal;
 | 
			
		||||
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
@@ -19,7 +21,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();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@
 | 
			
		||||
 * introduced in CatGui in 2021, dec. 6.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include "version.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
char MainWindow::loadPlugIn(char lade1_entlade2)
 | 
			
		||||
@@ -21,12 +22,15 @@ 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
 | 
			
		||||
 | 
			
		||||
//    pluginLoader->setFileName("../../SlavePlug/CAslave.dll"); // for windows
 | 
			
		||||
#if defined (ARCH_WINDOWS)
 | 
			
		||||
    // Windows DT
 | 
			
		||||
    pluginLoader->setFileName("../../SlavePlug/CAslave.dll"); // for windows
 | 
			
		||||
#elif defined (ARCH_DesktopLinux)
 | 
			
		||||
    pluginLoader->setFileName("../../SlavePlug/libCAslave.so");
 | 
			
		||||
#elif defined (ARCH_PTU5)
 | 
			
		||||
    pluginLoader->setFileName("/usr/lib/libCAslave.so"); // for PTU5
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (lade1_entlade2==2)
 | 
			
		||||
    {
 | 
			
		||||
@@ -587,6 +591,8 @@ 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()
 | 
			
		||||
@@ -955,14 +961,21 @@ void MainWindow::chainControl(void)
 | 
			
		||||
 | 
			
		||||
    uint16_t nextScreen=0;
 | 
			
		||||
    uint8_t  useNavi=0;
 | 
			
		||||
    bool busy=false;
 | 
			
		||||
    bool busy=false, nowBL;
 | 
			
		||||
    static uint32_t  offlineCtr;
 | 
			
		||||
 | 
			
		||||
    // call permanent functions here:
 | 
			
		||||
    //mifCard->working();
 | 
			
		||||
    //diary->working();
 | 
			
		||||
    //conf->working();
 | 
			
		||||
 | 
			
		||||
//qDebug()<<"mainwin chaincontrol calling mif";
 | 
			
		||||
    nowBL=myFenster12->isBLup();
 | 
			
		||||
    if (HWaccess->sys_areDCdataValid()==false && !nowBL)
 | 
			
		||||
    {
 | 
			
		||||
        //qDebug()<<"mainwin: lost connection to DC "<<offlineCtr;
 | 
			
		||||
        offlineCtr++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // working step chain:
 | 
			
		||||
    if (chainCurrentStep != chainNextStep)
 | 
			
		||||
@@ -993,7 +1006,7 @@ void MainWindow::chainControl(void)
 | 
			
		||||
        if (chain_stepIni)
 | 
			
		||||
            busy=myFenster02->work_ini(&nextScreen, &useNavi);
 | 
			
		||||
        else
 | 
			
		||||
            busy=myFenster02->working(&nextScreen, &useNavi);
 | 
			
		||||
            busy=myFenster02->working(&nextScreen, &useNavi, nowBL);
 | 
			
		||||
    } else
 | 
			
		||||
    if (chainCurrentStep==3)
 | 
			
		||||
    {
 | 
			
		||||
@@ -1255,5 +1268,7 @@ void MainWindow::vendingTimeout(void)
 | 
			
		||||
    timerVendingTimeout->stop();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool MainWindow::BLisRunning()
 | 
			
		||||
{
 | 
			
		||||
    return myFenster12->isBLup();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -147,6 +147,7 @@ public:
 | 
			
		||||
#define FORWBUTTON  3
 | 
			
		||||
    void enableNaviButtons(uint8_t buttonNr, bool enabled);
 | 
			
		||||
    void enableNaviButtons(uint8_t switchBitwise);
 | 
			
		||||
    bool BLisRunning();
 | 
			
		||||
 | 
			
		||||
private slots:
 | 
			
		||||
    void chainControl();
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								stepList.h
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								stepList.h
									
									
									
									
									
								
							@@ -35,8 +35,9 @@
 | 
			
		||||
#define     PAGE_NEXT20             20
 | 
			
		||||
 | 
			
		||||
//          fix:                customize:
 | 
			
		||||
//#define     WCS_STARTSCREEN     PAGE_COMPORT     // if APservice uses masterLib
 | 
			
		||||
#define     WCS_STARTSCREEN     PAGE_SERVICEMAIN  // if APservice uses slaveLib
 | 
			
		||||
//#define     WCS_STARTSCREEN     PAGE_COMPORT
 | 
			
		||||
//#define     WCS_STARTSCREEN     PAGE_NEXT16
 | 
			
		||||
#define     WCS_STARTSCREEN     PAGE_SERVICEMAIN
 | 
			
		||||
 | 
			
		||||
// PAGE_COMPORT:
 | 
			
		||||
#define     WCS_WIN01BAK    PAGE_COMPORT
 | 
			
		||||
@@ -44,7 +45,8 @@
 | 
			
		||||
#define     WCS_WIN01FWD    PAGE_SERVICEMAIN
 | 
			
		||||
 | 
			
		||||
// PAGE_SERVICEMAIN:
 | 
			
		||||
#define     WCS_WIN02BAK    PAGE_COMPORT
 | 
			
		||||
//#define     WCS_WIN02BAK    PAGE_NEXT16
 | 
			
		||||
#define     WCS_WIN02BAK    PAGE_BOOTLOADER
 | 
			
		||||
#define     WCS_WIN02MID    PAGE_SERVICEMAIN
 | 
			
		||||
#define     WCS_WIN02FWD    PAGE_TIMEDATEVERSION
 | 
			
		||||
 | 
			
		||||
@@ -114,13 +116,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,12 +168,12 @@
 | 
			
		||||
#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
 | 
			
		||||
#define     WIN02_LABEL_SHORT10     "      "
 | 
			
		||||
#define     WCS_WIN02SHORT10    PAGE_SERVICEMAIN
 | 
			
		||||
#define     WIN02_LABEL_SHORT10     "  B L  "
 | 
			
		||||
#define     WCS_WIN02SHORT10    PAGE_BOOTLOADER
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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,14 +353,14 @@ 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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi, bool isBLup)
 | 
			
		||||
{
 | 
			
		||||
    // one state of the vending/operating FSM
 | 
			
		||||
    // called cyclic until this state changes intentionally to another state
 | 
			
		||||
@@ -385,6 +395,13 @@ bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
    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
 | 
			
		||||
@@ -393,6 +410,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);
 | 
			
		||||
@@ -420,8 +438,6 @@ bool T_win02::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
    }
 | 
			
		||||
    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 working (uint16_t *nextScreen, uint8_t *useNavi, bool isBLup);
 | 
			
		||||
    ~T_win02();
 | 
			
		||||
 | 
			
		||||
private slots:
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,7 @@ 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()));
 | 
			
		||||
 | 
			
		||||
@@ -99,6 +100,7 @@ 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)
 | 
			
		||||
@@ -173,13 +175,37 @@ 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
 | 
			
		||||
 | 
			
		||||
    // 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)
 | 
			
		||||
    {
 | 
			
		||||
        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 +276,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 +306,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 +342,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");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										239
									
								
								win06_prn.cpp
									
									
									
									
									
								
							
							
						
						
									
										239
									
								
								win06_prn.cpp
									
									
									
									
									
								
							@@ -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)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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,13 +105,44 @@ 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()));
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    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);
 | 
			
		||||
@@ -180,14 +211,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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -196,6 +241,33 @@ 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();
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -235,8 +307,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 +322,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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@ 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);
 | 
			
		||||
@@ -58,6 +59,12 @@ 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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										126
									
								
								win11_abr.cpp
									
									
									
									
									
								
							
							
						
						
									
										126
									
								
								win11_abr.cpp
									
									
									
									
									
								
							@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										231
									
								
								win12_BL.cpp
									
									
									
									
									
								
							
							
						
						
									
										231
									
								
								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_left->addWidget(lab7);
 | 
			
		||||
    myVlayer_right->addWidget(lab7);
 | 
			
		||||
 | 
			
		||||
    but9 = new QPushButton("Starting \nBootloader");
 | 
			
		||||
    myVlayer_left->addWidget(but9);
 | 
			
		||||
    connect(but9, SIGNAL(clicked()), this, SLOT(slot_b9()));
 | 
			
		||||
    myVlayer_right->addWidget(but9);
 | 
			
		||||
    connect(but9, SIGNAL(clicked()), this, SLOT(slot_startCompleteBL()));
 | 
			
		||||
    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_left->addWidget(but4);
 | 
			
		||||
    connect(but4, SIGNAL(clicked()), this, SLOT(slot_b4()));
 | 
			
		||||
    myVlayer_right->addWidget(but4);
 | 
			
		||||
    connect(but4, SIGNAL(clicked()), this, SLOT(slot_loadBin()));
 | 
			
		||||
    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_left->addWidget(but5);
 | 
			
		||||
    connect(but5, SIGNAL(clicked()), this, SLOT(slot_b5()));
 | 
			
		||||
    myVlayer_right->addWidget(but5);
 | 
			
		||||
    connect(but5, SIGNAL(clicked()), this, SLOT(slot_sendBin()));
 | 
			
		||||
    but5->setStyleSheet(BUTTONCOLOR0);
 | 
			
		||||
    but5->setFont(myTabFont);
 | 
			
		||||
 | 
			
		||||
@@ -76,49 +76,22 @@ 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: ");
 | 
			
		||||
    myVlayer_left->addWidget(but1);
 | 
			
		||||
    connect(but1, SIGNAL(clicked()), this, SLOT(slot_b1()));
 | 
			
		||||
    but1 = new QPushButton("restart DC: \n");
 | 
			
		||||
    myVlayer_right->addWidget(but1);
 | 
			
		||||
    connect(but1, SIGNAL(clicked()), this, SLOT(slot_restart()));
 | 
			
		||||
    but1->setStyleSheet(BUTTONCOLOR0);
 | 
			
		||||
    but1->setFont(myTabFont);
 | 
			
		||||
 | 
			
		||||
    but2 = new QPushButton("Start BL: ");
 | 
			
		||||
    myVlayer_left->addWidget(but2);
 | 
			
		||||
    connect(but2, SIGNAL(clicked()), this, SLOT(slot_b2()));
 | 
			
		||||
    but2 = new QPushButton("Start BL: \n");
 | 
			
		||||
    myVlayer_right->addWidget(but2);
 | 
			
		||||
    connect(but2, SIGNAL(clicked()), this, SLOT(slot_startBl()));
 | 
			
		||||
    but2->setStyleSheet(BUTTONCOLOR0);
 | 
			
		||||
    but2->setFont(myTabFont);
 | 
			
		||||
 | 
			
		||||
    but3 = new QPushButton("check BL: ");
 | 
			
		||||
    myVlayer_left->addWidget(but3);
 | 
			
		||||
    connect(but3, SIGNAL(clicked()), this, SLOT(slot_b3()));
 | 
			
		||||
    but3 = new QPushButton("check BL: \n");
 | 
			
		||||
    myVlayer_right->addWidget(but3);
 | 
			
		||||
    connect(but3, SIGNAL(clicked()), this, SLOT(slot_checkBl()));
 | 
			
		||||
    but3->setStyleSheet(BUTTONCOLOR0);
 | 
			
		||||
    but3->setFont(myTabFont);
 | 
			
		||||
 | 
			
		||||
@@ -128,8 +101,8 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
 | 
			
		||||
 | 
			
		||||
    myTabFont.setPixelSize(22);
 | 
			
		||||
    but10 = new QPushButton("stop BL: ");
 | 
			
		||||
    myVlayer_left->addWidget(but10);
 | 
			
		||||
    connect(but10, SIGNAL(clicked()), this, SLOT(slot_b10()));
 | 
			
		||||
    myVlayer_right->addWidget(but10);
 | 
			
		||||
    connect(but10, SIGNAL(clicked()), this, SLOT(slot_stopBL()));
 | 
			
		||||
    but10->setStyleSheet(BUTTONCOLOR0);
 | 
			
		||||
    but10->setFont(myTabFont);
 | 
			
		||||
 | 
			
		||||
@@ -156,9 +129,10 @@ T_win12::T_win12(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
 | 
			
		||||
    myTO->setSingleShot(true);
 | 
			
		||||
    myTO->start(2);
 | 
			
		||||
    trigger_BLstartup=false;
 | 
			
		||||
    win12_startProgramming=0;
 | 
			
		||||
    win12_startProgramming=false;
 | 
			
		||||
    win12_nrOfFWblocks=0;
 | 
			
		||||
    win12_currentBlkNr=0;
 | 
			
		||||
    APservBLisUp=false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
T_win12::~T_win12()
 | 
			
		||||
@@ -179,20 +153,29 @@ void T_win12::Nav_next(void)
 | 
			
		||||
    myNextStep=WCS_WIN12FWD;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b1(void)
 | 
			
		||||
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)
 | 
			
		||||
{    
 | 
			
		||||
    showProgress->append(" rebooting");
 | 
			
		||||
    HWaccess->dc_autoRequest(false);
 | 
			
		||||
    HWaccess->bl_rebootDC();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b2(void)
 | 
			
		||||
void T_win12::slot_startBl(void)
 | 
			
		||||
{
 | 
			
		||||
    HWaccess->dc_autoRequest(false);
 | 
			
		||||
    HWaccess->bl_startBL();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b3(void)
 | 
			
		||||
void T_win12::slot_checkBl(void)
 | 
			
		||||
{
 | 
			
		||||
    HWaccess->dc_autoRequest(false);
 | 
			
		||||
    showState->setText("                      ");
 | 
			
		||||
@@ -202,17 +185,24 @@ void T_win12::slot_b3(void)
 | 
			
		||||
    myStep=20;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b4(void)
 | 
			
		||||
void T_win12::slot_loadBin(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:"),
 | 
			
		||||
                                            "C:/own/work2023/PSA1256ptu5/PTU SW",
 | 
			
		||||
                                            "/etc/dc",
 | 
			
		||||
                                            ("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();
 | 
			
		||||
@@ -229,42 +219,27 @@ void T_win12::slot_b4(void)
 | 
			
		||||
        showFile->setText(" cannot load file :-( ");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b5(void)
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_sendBin(void)
 | 
			
		||||
{
 | 
			
		||||
    win12_startProgramming=true;
 | 
			
		||||
    showProgress->clear();
 | 
			
		||||
    myStep=5;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void T_win12::slot_b6(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)
 | 
			
		||||
void T_win12::slot_stopBL(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)
 | 
			
		||||
@@ -297,90 +272,14 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
    *useNavi=0;
 | 
			
		||||
    int8_t  iresult;
 | 
			
		||||
 | 
			
		||||
    if (myStep==0)
 | 
			
		||||
    {
 | 
			
		||||
    if (HWaccess->bl_isUp()==1)
 | 
			
		||||
        APservBLisUp=true;
 | 
			
		||||
 | 
			
		||||
        if (trigger_BLstartup)
 | 
			
		||||
        {
 | 
			
		||||
            HWaccess->dc_autoRequest(false);
 | 
			
		||||
            myStep++;
 | 
			
		||||
        }
 | 
			
		||||
    if (APservBLisUp)
 | 
			
		||||
        showState->setText(" Bootloader is running");
 | 
			
		||||
    else
 | 
			
		||||
        showState->setText("       -  -  -        ");
 | 
			
		||||
 | 
			
		||||
    } 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)
 | 
			
		||||
    {
 | 
			
		||||
@@ -400,17 +299,26 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
 | 
			
		||||
    if (myStep==6)
 | 
			
		||||
    {
 | 
			
		||||
        //qDebug()<<"starting transfer";
 | 
			
		||||
 | 
			
		||||
        // -------------------------------------------------------------------
 | 
			
		||||
        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++;
 | 
			
		||||
        //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++;
 | 
			
		||||
@@ -447,7 +355,7 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    if (myStep==20)
 | 
			
		||||
    {
 | 
			
		||||
        if (!myTO->isActive())
 | 
			
		||||
@@ -461,6 +369,7 @@ bool T_win12::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
            myStep=99;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
    if (myNextStep)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								win12_BL.h
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								win12_BL.h
									
									
									
									
									
								
							@@ -50,6 +50,7 @@ class T_win12 : public QWidget
 | 
			
		||||
    bool trigger_BLstartup;
 | 
			
		||||
    int  retryCtr;
 | 
			
		||||
    QTextEdit *showProgress;
 | 
			
		||||
    bool APservBLisUp;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    explicit T_win12(hwinf *HWaccess = nullptr, QWidget *parent = nullptr);
 | 
			
		||||
@@ -61,21 +62,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_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);
 | 
			
		||||
    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);
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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,6 +127,7 @@ T_win13::T_win13(hwinf *HWaccess, QWidget *parent) : QWidget(parent)
 | 
			
		||||
    myTO->setSingleShot(true);
 | 
			
		||||
    myTO->start(2000);
 | 
			
		||||
 | 
			
		||||
    win13_nowPrinting=false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
T_win13::~T_win13()
 | 
			
		||||
@@ -131,7 +150,10 @@ void T_win13::Nav_next(void)
 | 
			
		||||
 | 
			
		||||
void T_win13::slot_pb1(void)
 | 
			
		||||
{
 | 
			
		||||
    QString fileName;
 | 
			
		||||
 | 
			
		||||
    showFile->clear();
 | 
			
		||||
    /*
 | 
			
		||||
    if (datei_ifFileExists(FILENAME_CONFIG))
 | 
			
		||||
    {
 | 
			
		||||
        loadedFile=datei_readFromFile(FILENAME_CONFIG);
 | 
			
		||||
@@ -139,9 +161,21 @@ void T_win13::slot_pb1(void)
 | 
			
		||||
    } 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();
 | 
			
		||||
@@ -180,9 +214,9 @@ void T_win13::slot_pb4(void)
 | 
			
		||||
        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;
 | 
			
		||||
@@ -201,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];
 | 
			
		||||
@@ -243,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)
 | 
			
		||||
@@ -270,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)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								win13_json.h
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								win13_json.h
									
									
									
									
									
								
							@@ -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,13 +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);
 | 
			
		||||
    //void slot_pb6(void);
 | 
			
		||||
    //void slot_pb7(void);
 | 
			
		||||
    //void slot_pb8(void);
 | 
			
		||||
    void slot_pb9(void);
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								win14_mw.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								win14_mw.cpp
									
									
									
									
									
								
							@@ -649,13 +649,14 @@ bool T_win14::working(uint16_t *nextScreen, uint8_t *useNavi)
 | 
			
		||||
        {
 | 
			
		||||
            myStep++;
 | 
			
		||||
            myTO->start(200);
 | 
			
		||||
            uint16_t acc=0x07;  // accept 5c,10c,20c
 | 
			
		||||
            //uint16_t acc=0x7E;  // accept 10c-2€ & Token
 | 
			
		||||
            uint16_t coinVal[16];
 | 
			
		||||
            memset(coinVal,0,32);
 | 
			
		||||
            coinVal[0]=2;
 | 
			
		||||
            coinVal[3]=49;
 | 
			
		||||
            coinVal[10]=230;
 | 
			
		||||
            HWaccess->emp_sendSettings(acc, 12, coinVal);   // getestet 19.10.23TS
 | 
			
		||||
            //coinVal[0]=5;
 | 
			
		||||
            //coinVal[3]=50;
 | 
			
		||||
            //coinVal[10]=0;
 | 
			
		||||
            // 17.11.23 raus.
 | 
			
		||||
            //HWaccess->emp_sendSettings(acc, 12, coinVal);   // getestet 19.10.23TS
 | 
			
		||||
        }
 | 
			
		||||
    } else
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
									
									
									
									
									
								
							
							
						
						
									
										388
									
								
								win16.cpp
									
									
									
									
									
								
							@@ -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
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								win16.h
									
									
									
									
									
								
							@@ -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);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user