admin::admin(QWidget * parent) : QMainWindow(parent), settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog") { setupUi(this); n = settings.value("FontSize").toString().toInt(); QFont font; font.setPointSize(n); setFont(font); connect(actionEnde, SIGNAL(triggered(bool)), this, SLOT(goExit())); connect(actionAdif_Export, SIGNAL(triggered(bool)), this, SLOT(adifExpCb())); connect(actionAdif_Import, SIGNAL(triggered(bool)), this, SLOT(adifImpCb())); connect(actionDump, SIGNAL(triggered(bool)), this, SLOT(dumpCb())); connect(actionRefNamen, SIGNAL(triggered(bool)), this, SLOT(refNamenCb())); connect(actionHilfe, SIGNAL(triggered(bool)), this, SLOT(getHilfeCb())); connect(pushButtonEnde, SIGNAL(clicked()), this, SLOT(goExit())); connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackedWidgetCb(int))); connect(checkBoxLog, SIGNAL(pressed()), this, SLOT(toggelLogBoxCb())); connect(checkBoxDb, SIGNAL(pressed()), this, SLOT(toggelDbBoxCb())); connect(checkBoxQslMode, SIGNAL(pressed()), this, SLOT(toggelQslModeCb())); connect(logList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(logListCb(QTreeWidgetItem*,int))); connect(sysList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(sysListCb(QTreeWidgetItem*,int))); connect(RefTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateRefItemCb(QTableWidgetItem*))); connect(RefTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(saveValCb(QTableWidgetItem*))); connect(customsTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateCustomItemCb(QTableWidgetItem*))); connect(customsTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(saveValCb(QTableWidgetItem*))); connect(ButtonDumpDir, SIGNAL(clicked()), this, SLOT(getSaveDirCb())); connect(ButtonAdifDir, SIGNAL(clicked()), this, SLOT(getAdifDirCb())); connect(ButtonDump, SIGNAL(clicked()), this, SLOT(dbDump())); connect(ButtonRestore, SIGNAL(clicked()), this, SLOT(dbRestore())); connect(ButtonAdifExport, SIGNAL(clicked()), this, SLOT(adifExport())); connect(ButtonAdifImport, SIGNAL(clicked()), this, SLOT(adifImport())); s = settings.value("dbname").toString(); s += " Rel.: "; s += RELEASE; label_db->setText(s); label_dbase->setText(s); dirsel = 0; setupAction(); lItem = 0; sItem = 0; udpSocket = new QUdpSocket(this); ltreeWidget = logList; }
/** * Application entry point. */ int main(void) { /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); sdStart(&CONSOLE, &sdConfig); chprintf((BaseSequentialStream *)&CONSOLE, "GENIST SPIF\r\n"); /* * Shell manager initialization. */ shellInit(); /* Get database from Flash */ chprintf((BaseSequentialStream *)&CONSOLE, "Restoring database\r\n"); dbRestore(); chThdSleepMilliseconds(1000); // disable analog status // enableAstatus(0); palClearPad(OUT_AXLE1_PORT, OUT_AXLE1_PIN); palClearPad(OUT_AXLE2_PORT, OUT_AXLE2_PIN); palClearPad(OUT_AXLE3_PORT, OUT_AXLE3_PIN); palClearPad(OUT_AXLE4_PORT, OUT_AXLE4_PIN); palClearPad(OUT_BACKUP2_PORT, OUT_BACKUP2_PIN); palClearPad(OUT_BACKUP_PORT, OUT_BACKUP_PIN); palClearPad(OUT_ACTIVECOOL_PORT, OUT_ACTIVECOOL_PIN); palClearPad(OUT_FLOCK_PORT, OUT_FLOCK_PIN); palClearPad(OUT_LOCK_PORT, OUT_LOCK_PIN); palClearPad(OUT_BULBCHECK_PORT, OUT_BULBCHECK_PIN); palClearPad(OUT_LEDPOWER_PORT, OUT_LEDPOWER_PIN); palClearPad(OUT_SENSPOWER_PORT, OUT_SENSPOWER_PIN); palClearPad(LED_STBY_PAD, LED_STBY_PIN); // enableAstatus(0); // StateMachineMailboxInit(); // startThreadStateMachine(); // startThreadSpeed(); // startThreadBlinker(); // startThreadPressureSensor(); startThreadSDADC(); //startThreadMonitor(); #ifdef GENIST_USE_RTD startThreadRTD(); #endif // initHazard(); /* * Normal main() thread activity, it does nothing except sleeping in a loop. */ #ifdef START_JSON startJSON(); #endif while (TRUE) { #ifndef START_JSON if (!shelltp) { /* Spawns a new shell.*/ shelltp = startConsole(); } else { /* If the previous shell exited.*/ if (chThdTerminated(shelltp)) { /* Recovers memory of the previous shell.*/ chThdRelease(shelltp); shelltp = NULL; dbgprint_enable = FALSE; } } #else #endif chThdSleepMilliseconds(10000); } }