diff --git a/.github/utils/download_from_gdrive.py b/.github/utils/download_from_gdrive.py new file mode 100755 index 0000000000000000000000000000000000000000..1a01b42db8a5a5e02a31bee40fd1df503a4a41a1 --- /dev/null +++ b/.github/utils/download_from_gdrive.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +from google.oauth2.credentials import Credentials +from google.auth.transport.requests import Request +from googleapiclient.discovery import build +from googleapiclient.http import MediaIoBaseDownload +import os +import io + +TOKEN_FILE = 'token.json' +VM_FILE_PATH = '/home/runner/discos_manager.ova' +ARCHIVE_FILE_PATH = '/home/runner/vagrant.tar.gz' +SCOPES = ['https://www.googleapis.com/auth/drive.readonly'] + +# Create the token file from the GH Secret +with open(TOKEN_FILE, 'w') as tokenfile: + tokenfile.write(os.environ.get('GOOGLE_DRIVE_TOKEN')) + +# Authenticate with the token and eventually update it +creds = Credentials.from_authorized_user_file(TOKEN_FILE, SCOPES) +if creds.expired and creds.refresh_token: + creds.refresh(Request()) + +# Download the VM +creds = Credentials.from_authorized_user_file(TOKEN_FILE, SCOPES) +if creds.expired and creds.refresh_token: + creds.refresh(Request()) + +service = build('drive', 'v3', credentials=creds) + +downloader = MediaIoBaseDownload( + io.FileIO(ARCHIVE_FILE_PATH, 'wb'), + service.files().get_media( + fileId=os.environ.get('PROVISIONED_ARCHIVE_GDRIVE_ID') + ) +) +done = False +while not done: + _, done = downloader.next_chunk() + +downloader = MediaIoBaseDownload( + io.FileIO(VM_FILE_PATH, 'wb'), + service.files().get_media( + fileId=os.environ.get('PROVISIONED_VM_GDRIVE_ID'), + ), + chunksize=5*1024*1024 +) +done = False +while not done: + _, done = downloader.next_chunk() + +# Finally update the token file +with open(TOKEN_FILE, 'w') as tokenfile: + tokenfile.write(creds.to_json()) diff --git a/.github/utils/gdrive_requirements.txt b/.github/utils/gdrive_requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..7c68661757fab083504dd82d496d285635f78a96 --- /dev/null +++ b/.github/utils/gdrive_requirements.txt @@ -0,0 +1,4 @@ +google-auth +google-auth-oauthlib +google-auth-httplib2 +google-api-python-client diff --git a/.github/utils/upload_to_gdrive.py b/.github/utils/upload_to_gdrive.py new file mode 100755 index 0000000000000000000000000000000000000000..a9cc1c67424ad7b68d6b33eb278ac64f20ac67b6 --- /dev/null +++ b/.github/utils/upload_to_gdrive.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +from google.oauth2.credentials import Credentials +from google.auth.transport.requests import Request +from googleapiclient.discovery import build +from googleapiclient.http import MediaFileUpload +import os + +TOKEN_FILE = 'token.json' +VM_FILE_PATH = '/home/runner/discos_manager.ova' +SCOPES = [ + 'https://www.googleapis.com/auth/drive', + 'https://www.googleapis.com/auth/drive.file' +] + +# Authenticate with the token and eventually update it +creds = Credentials.from_authorized_user_file(TOKEN_FILE, SCOPES) +if creds.expired and creds.refresh_token: + creds.refresh(Request()) + +# Prepare the files to be uploaded +service = build('drive', 'v3', credentials=creds) +vm_media = MediaFileUpload(VM_FILE_PATH, resumable=True) +service.files().update( + fileId=os.environ.get('DEPLOYED_VM_GDRIVE_ID'), + media_body=vm_media, + fields='id' +).execute() + +# Finally update the token file +with open(TOKEN_FILE, 'w') as tokenfile: + tokenfile.write(creds.to_json()) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000000000000000000000000000000000000..b31e196449faccb35c03a3254d91baeb652bc776 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,70 @@ +name: DISCOS deployment and build + +on: + push: + workflow_dispatch: + +jobs: + deploy-discos: + env: + REPOSITORY_TOKEN: "${{ secrets.DEPENDENCIES_TOKEN }}" + GH_TOKEN: "${{ secrets.GH_WORKFLOWS_TOKEN }}" + GOOGLE_DRIVE_TOKEN: "${{ secrets.GOOGLE_DRIVE_TOKEN }}" + PROVISIONED_VM_GDRIVE_ID: "${{ secrets.PROVISIONED_VM_GDRIVE_ID }}" + PROVISIONED_ARCHIVE_GDRIVE_ID: "${{ secrets.PROVISIONED_ARCHIVE_GDRIVE_ID }}" + strategy: + fail-fast: false + matrix: + station: ['SRT', 'Medicina', 'Noto'] + runs-on: ubuntu-22.04 + steps: + - name: Free up space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + - name: Install Vagrant + run: | + wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + sudo apt update && sudo apt install vagrant + - name: Install VirtualBox + run: | + wget https://download.virtualbox.org/virtualbox/7.0.14/virtualbox-7.0_7.0.14-161095~Ubuntu~jammy_amd64.deb + sudo apt install ./virtualbox-7.0_7.0.14-161095~Ubuntu~jammy_amd64.deb + - name: Clone the repository + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3' + check-latest: true + - name: Download the provisioned virtual machine from Google Drive + run: | + pip install -r .github/utils/gdrive_requirements.txt + python .github/utils/download_from_gdrive.py + gh secret set GOOGLE_DRIVE_TOKEN --org discos --visibility selected --repos discos,deployment < token.json + - name: Install the virtual machine + run: | + vboxmanage import discos_manager.ova --vsys 0 --options keepallmacs + rm discos_manager.ova + tar -xzvf vagrant.tar.gz + working-directory: /home/runner + - name: Add the virtual machine to Vagrant + run: | + sed -i "s/$(cat id)/$(vboxmanage list vms | grep 'discos_manager' | grep -oP '(?<=\{)[0-9a-fA-F-]+(?=\})')/" action_provision + sed -i "s/$(cat id)/$(vboxmanage list vms | grep 'discos_manager' | grep -oP '(?<=\{)[0-9a-fA-F-]+(?=\})')/" id + working-directory: /home/runner/.deployment/.vagrant/machines/manager/virtualbox/ + - name: Clone the deployment repository + uses: actions/checkout@v4 + with: + repository: 'discos/deployment' + - name: Install deployment package and dependencies + run: | + python -m pip install -r requirements.txt + pip install . + - name: Deploy DISCOS + run: | + discos-deploy manager:development --deploy-only -s ${{ matrix.station }} -b ${{ github.ref_name }} + - name: Shutdown the virtual machine + run: | + discos-vms stop diff --git a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/include/MedicinaActiveSurfaceGUI.h b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/include/MedicinaActiveSurfaceGUI.h index 577e6de9e7d40c13a670fbbbdb187bb40229f45f..8968f6099018084b3d90b2deecc3c485524d060f 100644 --- a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/include/MedicinaActiveSurfaceGUI.h +++ b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/include/MedicinaActiveSurfaceGUI.h @@ -1,10 +1,9 @@ /******************************************************************************** -** Form generated from reading ui file 'MedicinaActiveSurfaceGUI.ui' +** Form generated from reading UI file 'MedicinaActiveSurfaceGUI.ui' ** -** Created: Wed Dec 7 09:22:24 2022 -** by: Qt User Interface Compiler version 4.5.2 +** Created by: Qt User Interface Compiler version 4.8.7 ** -** WARNING! All changes made in this file will be lost when recompiling ui file! +** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef MEDICINAACTIVESURFACEGUI_H @@ -17675,9 +17674,6 @@ public: buttonGroup1->setEnabled(false); buttonGroup1->setGeometry(QRect(970, 448, 288, 291)); CalibrateButton = new QPushButton(buttonGroup1); - QButtonGroup *buttonGroup = new QButtonGroup(MedicinaActiveSurfaceGUI); - buttonGroup->setObjectName(QString::fromUtf8("buttonGroup")); - buttonGroup->addButton(CalibrateButton); CalibrateButton->setObjectName(QString::fromUtf8("CalibrateButton")); CalibrateButton->setGeometry(QRect(192, 45, 90, 35)); QPalette palette321; @@ -17731,7 +17727,6 @@ public: palette321.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); CalibrateButton->setPalette(palette321); StopButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(StopButton); StopButton->setObjectName(QString::fromUtf8("StopButton")); StopButton->setGeometry(QRect(4, 5, 90, 35)); QPalette palette322; @@ -17785,7 +17780,6 @@ public: palette322.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); StopButton->setPalette(palette322); ResetButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(ResetButton); ResetButton->setObjectName(QString::fromUtf8("ResetButton")); ResetButton->setGeometry(QRect(98, 5, 90, 35)); QPalette palette323; @@ -17839,7 +17833,6 @@ public: palette323.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); ResetButton->setPalette(palette323); RefPosButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(RefPosButton); RefPosButton->setObjectName(QString::fromUtf8("RefPosButton")); RefPosButton->setGeometry(QRect(4, 45, 90, 35)); QPalette palette324; @@ -17893,7 +17886,6 @@ public: palette324.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); RefPosButton->setPalette(palette324); TopButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(TopButton); TopButton->setObjectName(QString::fromUtf8("TopButton")); TopButton->setGeometry(QRect(5, 125, 90, 35)); QPalette palette325; @@ -17947,7 +17939,6 @@ public: palette325.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); TopButton->setPalette(palette325); StowButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(StowButton); StowButton->setObjectName(QString::fromUtf8("StowButton")); StowButton->setGeometry(QRect(98, 45, 90, 35)); QPalette palette326; @@ -18001,7 +17992,6 @@ public: palette326.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); StowButton->setPalette(palette326); BottomButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(BottomButton); BottomButton->setObjectName(QString::fromUtf8("BottomButton")); BottomButton->setGeometry(QRect(98, 125, 90, 35)); QPalette palette327; @@ -18055,7 +18045,6 @@ public: palette327.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); BottomButton->setPalette(palette327); SetupButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(SetupButton); SetupButton->setObjectName(QString::fromUtf8("SetupButton")); SetupButton->setGeometry(QRect(192, 5, 90, 35)); QPalette palette328; @@ -18109,7 +18098,6 @@ public: palette328.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); SetupButton->setPalette(palette328); DownButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(DownButton); DownButton->setObjectName(QString::fromUtf8("DownButton")); DownButton->setGeometry(QRect(98, 85, 90, 35)); QPalette palette329; @@ -18163,7 +18151,6 @@ public: palette329.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); DownButton->setPalette(palette329); UpButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(UpButton); UpButton->setObjectName(QString::fromUtf8("UpButton")); UpButton->setGeometry(QRect(4, 85, 90, 35)); QPalette palette330; @@ -18217,7 +18204,6 @@ public: palette330.setBrush(QPalette::Disabled, QPalette::LinkVisited, brush10); UpButton->setPalette(palette330); MoveButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(MoveButton); MoveButton->setObjectName(QString::fromUtf8("MoveButton")); MoveButton->setGeometry(QRect(5, 165, 90, 35)); QPalette palette331; @@ -18279,7 +18265,6 @@ public: ActuatorMovelineEdit->setAlignment(Qt::AlignRight); ActuatorMovelineEdit->setReadOnly(false); CorrectionButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(CorrectionButton); CorrectionButton->setObjectName(QString::fromUtf8("CorrectionButton")); CorrectionButton->setGeometry(QRect(5, 205, 90, 35)); QPalette palette332; @@ -18339,7 +18324,6 @@ public: ActuatorCorrectionlineEdit->setAlignment(Qt::AlignRight); ActuatorCorrectionlineEdit->setReadOnly(false); UpdateButton = new QPushButton(buttonGroup1); - buttonGroup->addButton(UpdateButton); UpdateButton->setObjectName(QString::fromUtf8("UpdateButton")); UpdateButton->setGeometry(QRect(5, 245, 90, 35)); QPalette palette333; @@ -20676,7 +20660,6 @@ public: StatuslineEdit_2->setText(QString()); StatuslineEdit->setStyleSheet(QApplication::translate("MedicinaActiveSurfaceGUI", "background-color: rgb(0, 85, 255);", 0, QApplication::UnicodeUTF8)); StatuslineEdit->setText(QApplication::translate("MedicinaActiveSurfaceGUI", "STATUS", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(MedicinaActiveSurfaceGUI); } // retranslateUi }; diff --git a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/MedicinaActiveSurfaceGUI.ui b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/MedicinaActiveSurfaceGUI.ui index 13d9fe7fd0087ba81fab7d2110a2cfd9fa343f3e..3ffe3444d687fa08c22eb78b8b21baf191e345ef 100755 --- a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/MedicinaActiveSurfaceGUI.ui +++ b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/MedicinaActiveSurfaceGUI.ui @@ -149211,9 +149211,6 @@ <property name="text"> <string>Calibration</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="StopButton"> <property name="geometry"> @@ -149675,9 +149672,6 @@ <property name="text"> <string>Stop</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="ResetButton"> <property name="geometry"> @@ -150139,9 +150133,6 @@ <property name="text"> <string>Reset</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="RefPosButton"> <property name="geometry"> @@ -150603,9 +150594,6 @@ <property name="text"> <string>RefPos</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="TopButton"> <property name="geometry"> @@ -151067,9 +151055,6 @@ <property name="text"> <string>Top</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="StowButton"> <property name="geometry"> @@ -151531,9 +151516,6 @@ <property name="text"> <string>Stow</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="BottomButton"> <property name="geometry"> @@ -151995,9 +151977,6 @@ <property name="text"> <string>Bottom</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="SetupButton"> <property name="geometry"> @@ -152459,9 +152438,6 @@ <property name="text"> <string>Setup</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="DownButton"> <property name="geometry"> @@ -152923,9 +152899,6 @@ <property name="text"> <string>Down</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="UpButton"> <property name="geometry"> @@ -153387,9 +153360,6 @@ <property name="text"> <string>Up</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QPushButton" name="MoveButton"> <property name="geometry"> @@ -153851,9 +153821,6 @@ <property name="text"> <string>Move</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QLineEdit" name="ActuatorMovelineEdit"> <property name="geometry"> @@ -154336,9 +154303,6 @@ <property name="text"> <string>Correction</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QLineEdit" name="ActuatorCorrectionlineEdit"> <property name="geometry"> @@ -154821,9 +154785,6 @@ <property name="text"> <string>Update</string> </property> - <attribute name="buttonGroup"> - <string/> - </attribute> </widget> <widget class="QLineEdit" name="ActuatorUpdatelineEdit"> <property name="geometry"> diff --git a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceCore.cpp b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceCore.cpp index 3783a3dd1a4611ca1b3c6b95090eee7a07742ffc..007c3f222a19b08c2a3a7967aa516c527d67e245 100644 --- a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceCore.cpp +++ b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceCore.cpp @@ -1,8 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'MedicinaActiveSurfaceCore.h' ** -** Created: Wed Dec 7 14:02:43 2022 -** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2) +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ @@ -10,8 +9,8 @@ #include "../include/MedicinaActiveSurfaceCore.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'MedicinaActiveSurfaceCore.h' doesn't include <QObject>." -#elif Q_MOC_OUTPUT_REVISION != 61 -#error "This file was generated using the moc from 4.5.2. It" +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.7. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif @@ -20,13 +19,15 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_MedicinaActiveSurfaceCore[] = { // content: - 2, // revision + 6, // revision 0, // classname 0, 0, // classinfo - 12, 12, // methods + 12, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors + 0, // flags + 12, // signalCount // signals: signature, parameters, type, tag, flags 35, 31, 27, 26, 0x05, @@ -58,14 +59,57 @@ static const char qt_meta_stringdata_MedicinaActiveSurfaceCore[] = { "setGUIasProfileCode(int)\0" }; +void MedicinaActiveSurfaceCore::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MedicinaActiveSurfaceCore *_t = static_cast<MedicinaActiveSurfaceCore *>(_o); + switch (_id) { + case 0: { int _r = _t->setGUIActuatorColor((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3])),(*reinterpret_cast< bool(*)>(_a[4]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 1: { int _r = _t->setGUIAllActuators((*reinterpret_cast< bool(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 2: { int _r = _t->setGUIAllActuators(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 3: { int _r = _t->setGUIcircleORradius((*reinterpret_cast< bool(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 4: { int _r = _t->setGUIcircleORradius(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 5: { int _r = _t->setGUIActuator((*reinterpret_cast< bool(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 6: { int _r = _t->setGUIActuator(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 7: { int _r = _t->setGUIActuatorStatusEnblLabel(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 8: { int _r = _t->setGUIActuatorValues(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 9: { int _r = _t->setGUIActuatorStatusLabels(); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 10: { int _r = _t->setGUIasStatusCode((*reinterpret_cast< int(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + case 11: { int _r = _t->setGUIasProfileCode((*reinterpret_cast< int(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; + default: ; + } + } +} + +const QMetaObjectExtraData MedicinaActiveSurfaceCore::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + const QMetaObject MedicinaActiveSurfaceCore::staticMetaObject = { { &QThread::staticMetaObject, qt_meta_stringdata_MedicinaActiveSurfaceCore, - qt_meta_data_MedicinaActiveSurfaceCore, 0 } + qt_meta_data_MedicinaActiveSurfaceCore, &staticMetaObjectExtraData } }; +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MedicinaActiveSurfaceCore::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + const QMetaObject *MedicinaActiveSurfaceCore::metaObject() const { - return &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *MedicinaActiveSurfaceCore::qt_metacast(const char *_clname) @@ -82,33 +126,8 @@ int MedicinaActiveSurfaceCore::qt_metacall(QMetaObject::Call _c, int _id, void * if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: { int _r = setGUIActuatorColor((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3])),(*reinterpret_cast< bool(*)>(_a[4]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 1: { int _r = setGUIAllActuators((*reinterpret_cast< bool(*)>(_a[1]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 2: { int _r = setGUIAllActuators(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 3: { int _r = setGUIcircleORradius((*reinterpret_cast< bool(*)>(_a[1]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 4: { int _r = setGUIcircleORradius(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 5: { int _r = setGUIActuator((*reinterpret_cast< bool(*)>(_a[1]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 6: { int _r = setGUIActuator(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 7: { int _r = setGUIActuatorStatusEnblLabel(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 8: { int _r = setGUIActuatorValues(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 9: { int _r = setGUIActuatorStatusLabels(); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 10: { int _r = setGUIasStatusCode((*reinterpret_cast< int(*)>(_a[1]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - case 11: { int _r = setGUIasProfileCode((*reinterpret_cast< int(*)>(_a[1]))); - if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; } break; - default: ; - } + if (_id < 12) + qt_static_metacall(this, _c, _id, _a); _id -= 12; } return _id; @@ -128,7 +147,7 @@ int MedicinaActiveSurfaceCore::setGUIAllActuators(bool _t1) { int _t0; void *_a[] = { const_cast<void*>(reinterpret_cast<const void*>(&_t0)), const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; - QMetaObject::activate(this, &staticMetaObject, 1, 2, _a); + QMetaObject::activate(this, &staticMetaObject, 1, _a); return _t0; } @@ -137,7 +156,7 @@ int MedicinaActiveSurfaceCore::setGUIcircleORradius(bool _t1) { int _t0; void *_a[] = { const_cast<void*>(reinterpret_cast<const void*>(&_t0)), const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; - QMetaObject::activate(this, &staticMetaObject, 3, 4, _a); + QMetaObject::activate(this, &staticMetaObject, 3, _a); return _t0; } @@ -146,7 +165,7 @@ int MedicinaActiveSurfaceCore::setGUIActuator(bool _t1) { int _t0; void *_a[] = { const_cast<void*>(reinterpret_cast<const void*>(&_t0)), const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; - QMetaObject::activate(this, &staticMetaObject, 5, 6, _a); + QMetaObject::activate(this, &staticMetaObject, 5, _a); return _t0; } diff --git a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceGUIui.cpp b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceGUIui.cpp index 3652a8c536a542afba84040795a28c1fc2b77bba..02756b88f7c053e4a009d07183d906366c026977 100644 --- a/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceGUIui.cpp +++ b/Medicina/Clients/MedicinaActiveSurfaceGUIClient/src/moc_MedicinaActiveSurfaceGUIui.cpp @@ -1,8 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'MedicinaActiveSurfaceGUIui.h' ** -** Created: Wed Dec 7 14:02:43 2022 -** by: The Qt Meta Object Compiler version 61 (Qt 4.5.2) +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ @@ -10,8 +9,8 @@ #include "../include/MedicinaActiveSurfaceGUIui.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'MedicinaActiveSurfaceGUIui.h' doesn't include <QObject>." -#elif Q_MOC_OUTPUT_REVISION != 61 -#error "This file was generated using the moc from 4.5.2. It" +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.7. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif @@ -20,13 +19,15 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_MedicinaActiveSurfaceGUI[] = { // content: - 2, // revision + 6, // revision 0, // classname 0, 0, // classinfo - 36, 12, // methods + 36, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors + 0, // flags + 0, // signalCount // slots: signature, parameters, type, tag, flags 26, 25, 25, 25, 0x0a, @@ -91,14 +92,69 @@ static const char qt_meta_stringdata_MedicinaActiveSurfaceGUI[] = { "changeGUIasProfileCode(int)\0" }; +void MedicinaActiveSurfaceGUI::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MedicinaActiveSurfaceGUI *_t = static_cast<MedicinaActiveSurfaceGUI *>(_o); + switch (_id) { + case 0: _t->Quit(); break; + case 1: _t->move(); break; + case 2: _t->correction(); break; + case 3: _t->update(); break; + case 4: _t->reset(); break; + case 5: _t->stop(); break; + case 6: _t->up(); break; + case 7: _t->down(); break; + case 8: _t->top(); break; + case 9: _t->bottom(); break; + case 10: _t->calibrate(); break; + case 11: _t->calVer(); break; + case 12: _t->stow(); break; + case 13: _t->setup(); break; + case 14: _t->refPos(); break; + case 15: _t->recoverUSD(); break; + case 16: _t->setupAS(); break; + case 17: _t->startAS(); break; + case 18: _t->stowAS(); break; + case 19: _t->stopAS(); break; + case 20: _t->setallactuators(); break; + case 21: _t->setradius(); break; + case 22: _t->setcircle(); break; + case 23: _t->setactuator(); break; + case 24: _t->changeGUIActuatorColor((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3])),(*reinterpret_cast< bool(*)>(_a[4]))); break; + case 25: _t->changeGUIAllActuators((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 26: _t->changeGUIAllActuators(); break; + case 27: _t->changeGUIcircleORradius((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 28: _t->changeGUIcircleORradius(); break; + case 29: _t->changeGUIActuator((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 30: _t->changeGUIActuator(); break; + case 31: _t->changeGUIActuatorStatusEnblLabel(); break; + case 32: _t->changeGUIActuatorValues(); break; + case 33: _t->changeGUIActuatorStatusLabels(); break; + case 34: _t->changeGUIasStatusCode((*reinterpret_cast< int(*)>(_a[1]))); break; + case 35: _t->changeGUIasProfileCode((*reinterpret_cast< int(*)>(_a[1]))); break; + default: ; + } + } +} + +const QMetaObjectExtraData MedicinaActiveSurfaceGUI::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + const QMetaObject MedicinaActiveSurfaceGUI::staticMetaObject = { { &QWidget::staticMetaObject, qt_meta_stringdata_MedicinaActiveSurfaceGUI, - qt_meta_data_MedicinaActiveSurfaceGUI, 0 } + qt_meta_data_MedicinaActiveSurfaceGUI, &staticMetaObjectExtraData } }; +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MedicinaActiveSurfaceGUI::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + const QMetaObject *MedicinaActiveSurfaceGUI::metaObject() const { - return &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *MedicinaActiveSurfaceGUI::qt_metacast(const char *_clname) @@ -117,45 +173,8 @@ int MedicinaActiveSurfaceGUI::qt_metacall(QMetaObject::Call _c, int _id, void ** if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: Quit(); break; - case 1: move(); break; - case 2: correction(); break; - case 3: update(); break; - case 4: reset(); break; - case 5: stop(); break; - case 6: up(); break; - case 7: down(); break; - case 8: top(); break; - case 9: bottom(); break; - case 10: calibrate(); break; - case 11: calVer(); break; - case 12: stow(); break; - case 13: setup(); break; - case 14: refPos(); break; - case 15: recoverUSD(); break; - case 16: setupAS(); break; - case 17: startAS(); break; - case 18: stowAS(); break; - case 19: stopAS(); break; - case 20: setallactuators(); break; - case 21: setradius(); break; - case 22: setcircle(); break; - case 23: setactuator(); break; - case 24: changeGUIActuatorColor((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3])),(*reinterpret_cast< bool(*)>(_a[4]))); break; - case 25: changeGUIAllActuators((*reinterpret_cast< bool(*)>(_a[1]))); break; - case 26: changeGUIAllActuators(); break; - case 27: changeGUIcircleORradius((*reinterpret_cast< bool(*)>(_a[1]))); break; - case 28: changeGUIcircleORradius(); break; - case 29: changeGUIActuator((*reinterpret_cast< bool(*)>(_a[1]))); break; - case 30: changeGUIActuator(); break; - case 31: changeGUIActuatorStatusEnblLabel(); break; - case 32: changeGUIActuatorValues(); break; - case 33: changeGUIActuatorStatusLabels(); break; - case 34: changeGUIasStatusCode((*reinterpret_cast< int(*)>(_a[1]))); break; - case 35: changeGUIasProfileCode((*reinterpret_cast< int(*)>(_a[1]))); break; - default: ; - } + if (_id < 36) + qt_static_metacall(this, _c, _id, _a); _id -= 36; } return _id;