diff --git a/.github/workflows/build-linux-clazy.yml b/.github/workflows/build-linux-clazy.yml index 7aed6c8e..c9e8009d 100644 --- a/.github/workflows/build-linux-clazy.yml +++ b/.github/workflows/build-linux-clazy.yml @@ -17,8 +17,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: sudo apt update - - run: sudo apt install -y clazy apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libqt6core5compat6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev + - run: sudo apt update + - run: sudo apt install -y clazy apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev - run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber - run: 7z x qwt-${{env.QWT_version}}.zip - run: cd qwt-${{env.QWT_version}} ; /usr/lib/qt6/bin/qmake diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e5ef47a9..be272e1a 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -19,8 +19,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - run: sudo apt update - - run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libqt6core5compat6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev + - run: sudo apt update + - run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev - run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber - run: 7z x qwt-${{env.QWT_version}}.zip - run: cd qwt-${{env.QWT_version}} ; /usr/lib/qt6/bin/qmake diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 8812bfe7..e63f600b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -92,7 +92,7 @@ jobs: run: pip install aqtinstall - name: install QT if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw -m qtcharts qtdatavis3d qt5compat + run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw -m qtcharts qtdatavis3d - uses: actions/checkout@v4 if: steps.cache-openCV-QT.outputs.cache-hit != 'true' with: diff --git a/DFTFringe.pro b/DFTFringe.pro index 2cb9728a..a84b5c6e 100644 --- a/DFTFringe.pro +++ b/DFTFringe.pro @@ -14,7 +14,7 @@ DEFINES += QAPPLICATION_CLASS=QApplication TEMPLATE = app -QT += charts concurrent core core5compat datavisualization gui network opengl widgets xml +QT += charts concurrent core datavisualization gui network opengl widgets xml qtHaveModule(printsupport): QT += printsupport diff --git a/standastigwizard.cpp b/standastigwizard.cpp index b2018da1..6bcf1c7c 100644 --- a/standastigwizard.cpp +++ b/standastigwizard.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "surfacemanager.h" QString AstigReportTitle = ""; @@ -304,22 +304,36 @@ void define_input::compute(){ emit computeStandAstig( this, rotationList); } -QString getNumberFromQString(const QString &xString) -{ - QStringList l = xString.split("/"); - QString fn = l[l.size()-1]; - QRegExp xRegExp("(\\d+([\\.p]\\d+)?)"); - xRegExp.indexIn(fn); - QString c = xRegExp.cap(); - c.replace("p","."); - if (c == ""){ - xRegExp.indexIn(l[l.size()-2]); - c = xRegExp.cap(); - c.replace("p","."); - } - return c; +/** + * @brief Extracts a numeric value from a given QString, replacing 'p' with '.' for decimal representation. + * + * This function splits the input string by '/' and attempts to find a number (integer or decimal) + * in the last segment. If not found, it checks the second-to-last segment. The number can contain + * digits and may use 'p' as a decimal separator, which will be replaced by '.' in the output. + * + * @param xString The input QString from which to extract the number. + * @return QString The extracted number as a string, or an empty string if no number is found. + */ +QString getNumberFromQString(const QString &xString) { + QStringList l = xString.split("/"); + QString fn = l[l.size()-1]; + static const QRegularExpression xRegExp("(\\d+(?:[\\.p]\\d+)?)"); + QRegularExpressionMatch match = xRegExp.match(fn); + QString c; + if(match.hasMatch()) { + c = match.captured(1).replace("p","."); + } else { + match = xRegExp.match(l[l.size()-2]); + if(match.hasMatch()) { + c = match.captured(1).replace("p","."); + } else { + c = ""; + } + } + return c; } + void define_input::browse(){ QStringList fileNames = QFileDialog::getOpenFileNames(this,