diff --git a/CatRotator.pro b/CatRotator.pro index 910c9f8..82d6d38 100644 --- a/CatRotator.pro +++ b/CatRotator.pro @@ -1,4 +1,4 @@ -QT += core gui +pQT += core gui QT += serialport QT += network @@ -44,7 +44,7 @@ LIBS += -L$$PWD/hamlib/ -lhamlib INCLUDEPATH += $$PWD/hamlib RESOURCES += qdarkstyle/dark/darkstyle.qrc -VERSION = 1.4.0 +VERSION = 1.5.0 RC_ICONS = catrotator.ico diff --git a/dialogrotator.cpp b/dialogrotator.cpp index 0ae2f0a..c8f70a5 100644 --- a/dialogrotator.cpp +++ b/dialogrotator.cpp @@ -1,6 +1,6 @@ /** ** This file is part of the CatRotator project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2023 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -197,6 +197,8 @@ DialogRotator::DialogRotator(QWidget *parent) : ui->lineEdit_name->setText(rotSet[0].nameLabel); ui->spinBox_azPark->setValue(rotSet[0].azPark); ui->spinBox_elPark->setValue(rotSet[0].elPark); + ui->spinBox_azOffset->setValue(rotSet[0].azOffset); + ui->spinBox_elOffset->setValue(rotSet[0].elOffset); ui->checkBox_overlap->setChecked(rotSet[0].overlap); ui->doubleSpinBox_tolerance->setValue(rotSet[0].trackTolerance); ui->doubleSpinBox_threshold->setValue(rotSet[0].trackThreshold); @@ -219,6 +221,8 @@ DialogRotator::DialogRotator(QWidget *parent) : ui->lineEdit_name_2->setText(rotSet[1].nameLabel); ui->spinBox_azPark_2->setValue(rotSet[1].azPark); ui->spinBox_elPark_2->setValue(rotSet[1].elPark); + ui->spinBox_azOffset_2->setValue(rotSet[1].azOffset); + ui->spinBox_elOffset_2->setValue(rotSet[1].elOffset); ui->checkBox_overlap_2->setChecked(rotSet[1].overlap); ui->doubleSpinBox_tolerance_2->setValue(rotSet[1].trackTolerance); ui->doubleSpinBox_threshold_2->setValue(rotSet[1].trackThreshold); @@ -241,6 +245,8 @@ DialogRotator::DialogRotator(QWidget *parent) : ui->lineEdit_name_3->setText(rotSet[2].nameLabel); ui->spinBox_azPark_3->setValue(rotSet[2].azPark); ui->spinBox_elPark_3->setValue(rotSet[2].elPark); + ui->spinBox_azOffset_3->setValue(rotSet[2].azOffset); + ui->spinBox_elOffset_3->setValue(rotSet[2].elOffset); ui->checkBox_overlap_3->setChecked(rotSet[2].overlap); ui->doubleSpinBox_tolerance_3->setValue(rotSet[2].trackTolerance); ui->doubleSpinBox_threshold_3->setValue(rotSet[2].trackThreshold); @@ -312,6 +318,8 @@ void DialogRotator::on_buttonBox_accepted() rotSet[0].nameLabel = ui->lineEdit_name->text(); rotSet[0].azPark = ui->spinBox_azPark->value(); rotSet[0].elPark = ui->spinBox_elPark->value(); + rotSet[0].azOffset = ui->spinBox_azOffset->value(); + rotSet[0].elOffset = ui->spinBox_elOffset->value(); rotSet[0].overlap = ui->checkBox_overlap->isChecked(); rotSet[0].trackTolerance = ui->doubleSpinBox_tolerance->value(); rotSet[0].trackThreshold = ui->doubleSpinBox_threshold->value(); @@ -369,6 +377,8 @@ void DialogRotator::on_buttonBox_accepted() rotSet[1].nameLabel = ui->lineEdit_name_2->text(); rotSet[1].azPark = ui->spinBox_azPark_2->value(); rotSet[1].elPark = ui->spinBox_elPark_2->value(); + rotSet[1].azOffset = ui->spinBox_azOffset_2->value(); + rotSet[1].elOffset = ui->spinBox_elOffset_2->value(); rotSet[1].overlap = ui->checkBox_overlap_2->isChecked(); rotSet[1].trackTolerance = ui->doubleSpinBox_tolerance_2->value(); rotSet[1].trackThreshold = ui->doubleSpinBox_threshold_2->value(); @@ -426,6 +436,8 @@ void DialogRotator::on_buttonBox_accepted() rotSet[2].nameLabel = ui->lineEdit_name_3->text(); rotSet[2].azPark = ui->spinBox_azPark_3->value(); rotSet[2].elPark = ui->spinBox_elPark_3->value(); + rotSet[2].azOffset = ui->spinBox_azOffset_3->value(); + rotSet[2].elOffset = ui->spinBox_elOffset_3->value(); rotSet[2].overlap = ui->checkBox_overlap_3->isChecked(); rotSet[2].trackTolerance = ui->doubleSpinBox_tolerance_3->value(); rotSet[2].trackThreshold = ui->doubleSpinBox_threshold_3->value(); @@ -447,6 +459,8 @@ void DialogRotator::on_buttonBox_accepted() configFile.setValue("Rotator"+QString::number(i+1)+"/nameLabel", rotSet[i].nameLabel); configFile.setValue("Rotator"+QString::number(i+1)+"/azPark", rotSet[i].azPark); configFile.setValue("Rotator"+QString::number(i+1)+"/elPark", rotSet[i].elPark); + configFile.setValue("Rotator"+QString::number(i+1)+"/azOffset", rotSet[i].azOffset); + configFile.setValue("Rotator"+QString::number(i+1)+"/elOffset", rotSet[i].elOffset); configFile.setValue("Rotator"+QString::number(i+1)+"/overlap", rotSet[i].overlap); configFile.setValue("Rotator"+QString::number(i+1)+"/trackTolerance", rotSet[i].trackTolerance); configFile.setValue("Rotator"+QString::number(i+1)+"/trackThreshold", rotSet[i].trackThreshold); diff --git a/dialogrotator.ui b/dialogrotator.ui index 71a391f..3fa025a 100644 --- a/dialogrotator.ui +++ b/dialogrotator.ui @@ -10,7 +10,7 @@ 0 0 440 - 573 + 605 @@ -108,13 +108,30 @@ Settings - - + + + + 450 + + + + + - Az Park + Label - spinBox_azPark + lineEdit_name + + + + + + + true + + + 90 @@ -131,6 +148,13 @@ + + + + Overlap + + + @@ -138,37 +162,47 @@ - - - - true + + + + Az Park - - 90 + + spinBox_azPark - - - - 450 + + + + Az Offset - - - - Label + + + + -180 - - lineEdit_name + + 180 - - + + - Overlap + El Offset + + + + + + + -90 + + + 90 @@ -370,33 +404,30 @@ Settings - - - - true + + + + Label - - 90 + + lineEdit_name_2 - - - - Az Park - - - spinBox_azPark_2 + + + + 450 - - - - Label + + + + true - - lineEdit_name_2 + + 90 @@ -420,20 +451,57 @@ - - - - 450 + + + + Az Park + + + spinBox_azPark_2 - + Overlap + + + + Az Offset + + + + + + + -180 + + + 180 + + + + + + + El Offset + + + + + + + -90 + + + 90 + + + @@ -557,13 +625,6 @@ Settings - - - - Rotator 3 - - - @@ -574,23 +635,24 @@ - - - - true + + + + Overlap + + + + - 90 + 450 - - + + - Az Park - - - spinBox_azPark_2 + Rotator 3 @@ -607,17 +669,57 @@ - - + + + + Az Park + + + spinBox_azPark_2 + + + + + + + true + - 450 + 90 - + - Overlap + Az Offset + + + + + + + -180 + + + 180 + + + + + + + El Offset + + + + + + + -90 + + + 90 diff --git a/mainwindow.cpp b/mainwindow.cpp index dd7b584..2037367 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,6 +1,6 @@ /** ** This file is part of the CatRotator project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2023 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -105,6 +105,8 @@ MainWindow::MainWindow(QWidget *parent) rotSet[i].nameLabel = configFile.value("Rotator"+QString::number(i+1)+"/nameLabel", "Rotator "+QString::number(i+1)).toString(); rotSet[i].azPark = configFile.value("Rotator"+QString::number(i+1)+"/azPark", 0).toInt(); rotSet[i].elPark = configFile.value("Rotator"+QString::number(i+1)+"/elPark", 0).toInt(); + rotSet[i].azOffset = configFile.value("Rotator"+QString::number(i+1)+"/azOffset", 0).toInt(); + rotSet[i].elOffset = configFile.value("Rotator"+QString::number(i+1)+"/elOffset", 0).toInt(); rotSet[i].overlap = configFile.value("Rotator"+QString::number(i+1)+"/overlap", false).toBool(); rotSet[i].trackTolerance = configFile.value("Rotator"+QString::number(i+1)+"/trackTolerance", 5.0).toDouble(); rotSet[i].trackThreshold = configFile.value("Rotator"+QString::number(i+1)+"/trackThreshold", 0.0).toDouble(); @@ -586,6 +588,10 @@ void MainWindow::setPosition(int rot, float azim, float elev) case 0: if (rotCom[0].connected) { + azim = azim - rotSet[0].azOffset; //Apply offset + if (azim < 0) azim = 360 + azim; + elev = elev - rotSet[0].elOffset; + if (my_rot->caps->rot_type == ROT_TYPE_ELEVATION) //Elevation only rotator { rotSet[0].az = 0; @@ -1014,9 +1020,13 @@ void MainWindow::on_pushButton_go_clicked() setPosition(0, tempAz, tempEl); QString posText; - if (my_rot->caps->rot_type == ROT_TYPE_AZEL || my_rot->caps->rot_type == ROT_TYPE_OTHER) posText = QString::number(rotSet[0].az,'f',1) + " " + QString::number(rotSet[0].el,'f',1); - else if (my_rot->caps->rot_type == ROT_TYPE_ELEVATION) posText = QString::number(rotSet[0].el,'f',1); - else posText = QString::number(rotSet[0].az,'f',1); //ROT_TYPE_AZIMUTH + //if (my_rot->caps->rot_type == ROT_TYPE_AZEL || my_rot->caps->rot_type == ROT_TYPE_OTHER) posText = QString::number(rotSet[0].az,'f',1) + " " + QString::number(rotSet[0].el,'f',1); + //else if (my_rot->caps->rot_type == ROT_TYPE_ELEVATION) posText = QString::number(rotSet[0].el,'f',1); + //else posText = QString::number(rotSet[0].az,'f',1); //ROT_TYPE_AZIMUTH + + if (my_rot->caps->rot_type == ROT_TYPE_AZEL || my_rot->caps->rot_type == ROT_TYPE_OTHER) posText = QString::number(tempAz,'f',1) + " " + QString::number(tempEl,'f',1); + else if (my_rot->caps->rot_type == ROT_TYPE_ELEVATION) posText = QString::number(tempEl,'f',1); + else posText = QString::number(tempAz,'f',1); //ROT_TYPE_AZIMUTH ui->lineEdit_posAz->setText(posText); } diff --git a/mainwindow.h b/mainwindow.h index 5b0af09..d745d7d 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -1,6 +1,6 @@ /** ** This file is part of the CatRotator project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2023 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ #define RELEASE_DATE __DATE__ #define VERSION_MAJ 1 -#define VERSION_MIN 4 +#define VERSION_MIN 5 #define VERSION_MIC 0 QT_BEGIN_NAMESPACE diff --git a/rotatordata.h b/rotatordata.h index 459fb45..2f9312d 100644 --- a/rotatordata.h +++ b/rotatordata.h @@ -1,6 +1,6 @@ /** ** This file is part of the CatRotator project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2023 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -37,8 +37,8 @@ typedef struct { typedef struct { bool enable; //Rotor enabled QString nameLabel; //Rotor name - azimuth_t az, azPark; - elevation_t el, elPark; + azimuth_t az, azPark, azOffset; + elevation_t el, elPark, elOffset; bool overlap; //Overlap capacity bool lPathFlag; //Long Path bool trackFlag, trackPreviSat, trackAirScout; //Tracking