Minor: Move reading of machine_nr, customer_nr and zone_nr upwards.

This commit is contained in:
Gerhard Hoffmann 2023-10-18 11:28:06 +02:00
parent 42961dea40
commit b4e2d4c54a

View File

@ -135,6 +135,15 @@ int main(int argc, char *argv[]) {
bool const showExtendedVersion = parser.isSet(extendedVersionOption); bool const showExtendedVersion = parser.isSet(extendedVersionOption);
QString const rtPath = QCoreApplication::applicationDirPath(); QString const rtPath = QCoreApplication::applicationDirPath();
int machineNr = Utils::read1stLineOfFile("/etc/machine_nr");
int customerNr = Utils::read1stLineOfFile("/etc/cust_nr");
int zoneNr = Utils::read1stLineOfFile("/etc/zone_nr");
QString const branchName = (zoneNr != 0)
? QString("zg1/zone%1").arg(zoneNr) : "master";
QThread::currentThread()->setObjectName("main thread");
qInfo() << "Main thread" << QThread::currentThreadId();
if (showExtendedVersion) { if (showExtendedVersion) {
printf(APP_EXTENDED_VERSION"\n"); printf(APP_EXTENDED_VERSION"\n");
return 0; return 0;
@ -176,15 +185,6 @@ int main(int argc, char *argv[]) {
hw->dc_autoRequest(true); hw->dc_autoRequest(true);
// hw->dc_openSerial(5, "115200", "ttymxc2", 1); // hw->dc_openSerial(5, "115200", "ttymxc2", 1);
int machineNr = Utils::read1stLineOfFile("/etc/machine_nr");
int customerNr = Utils::read1stLineOfFile("/etc/cust_nr");
int zoneNr = Utils::read1stLineOfFile("/etc/zone_nr");
QString const branchName = (zoneNr != 0)
? QString("zg1/zone%1").arg(zoneNr) : "master";
QThread::currentThread()->setObjectName("main thread");
qInfo() << "Main thread" << QThread::currentThreadId();
Worker worker(customerNr, Worker worker(customerNr,
machineNr, machineNr,
zoneNr, zoneNr,