From 1219c8f2d844c44d6b536af4a5e9b9ae90be9420 Mon Sep 17 00:00:00 2001 From: markuspg Date: Thu, 22 Sep 2016 22:11:11 +0200 Subject: [PATCH] Removed never properly implemented client webcam functionality --- CHANGELOG.md | 11 ++++++----- data/Labcontrol.conf | 2 -- src/Lib/client.cpp | 7 +++---- src/Lib/client.h | 4 +--- src/Lib/lablib.cpp | 10 +--------- src/mainwindow.cpp | 7 ------- 6 files changed, 11 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4656c8..fd9d7ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [2.0.0] - 2016-09-21 -### Added -- Imported code from the lp:labcontrol repository on launchpad.net - ## [Unreleased] ### Added ### Changed ### Fixed ### Removed +- Never properly implemented client webcam functionality + +## [2.0.0] - 2016-09-21 +### Added +- Imported code from the lp:labcontrol repository on launchpad.net -[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v2.0.0...HEAD +[Unreleased]: https://github.com/markuspg/Labcontrol/compare/v2.0.0...HEAD diff --git a/data/Labcontrol.conf b/data/Labcontrol.conf index b2bf725..25fe42a 100644 --- a/data/Labcontrol.conf +++ b/data/Labcontrol.conf @@ -13,8 +13,6 @@ client_macs=00:00:00:00:00:00|00:00:00:00:00:00|00:00:00:00:00:00|00:00:00:00:00 client_names=client01|client02|client03|client04|client05|client06|client07|client08|client09|client10|client11|client12|client13|client14|client15|client16|client17|client18|backupclient01|backupclient02|backupclient03|backupclient04|backupclient05|backupclient06 # This is just a hash to control the correct length of the other client attributes client_quantity=24 -# This should be set to 1, if a webcam is connected to a client -client_webcams=0|1|0|1|0|1|0|1|0|1|0|1|0|1|0|1|0|1|0|1|0|1|0|1 # The following two coordinates specify where the client will be shown in the coordinate grid at the bottom of the Labcontrol screen client_xpos=1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24 client_ypos=1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1 diff --git a/src/Lib/client.cpp b/src/Lib/client.cpp index 88f1a5e..5e926df 100644 --- a/src/Lib/client.cpp +++ b/src/Lib/client.cpp @@ -21,9 +21,8 @@ lc::Client::Client( QPlainTextEdit *argDebugMessagesTextEdit, QString *argIP, QString *argMAC, QString *argName, unsigned short int argXPosition, - unsigned short int argYPosition, bool argHasWebcam, + unsigned short int argYPosition, const QVector< QString* > * const argSettingsItems ): - hasWebcam{ argHasWebcam }, ip{ *argIP }, mac{ *argMAC }, name{ *argName }, @@ -53,9 +52,9 @@ lc::Client::Client( QPlainTextEdit *argDebugMessagesTextEdit, QString *argIP, QS pingTimer->start( 3000 ); } - debugMessagesTextEdit->appendPlainText( tr ( "[DEBUG] Created client %1\n\tMac: %2\tIP: %3\n\tPosition: %4x%5\t\tWebcam = %6" ) + debugMessagesTextEdit->appendPlainText( tr ( "[DEBUG] Created client %1\n\tMac: %2\tIP: %3\n\tPosition: %4x%5" ) .arg( name ).arg( mac ).arg( ip ).arg( QString::number( xPosition ) ) - .arg( QString::number( yPosition ) ).arg( QString::number( hasWebcam ) ) ); + .arg( QString::number( yPosition ) ) ); } lc::Client::~Client() { diff --git a/src/Lib/client.h b/src/Lib/client.h index 2815915..3877f82 100644 --- a/src/Lib/client.h +++ b/src/Lib/client.h @@ -45,7 +45,6 @@ public slots: void SetStateToZLEAF_RUNNING( QString argClientIP ); public: - const bool hasWebcam = false; const QString ip; const QString mac; const QString name; @@ -60,10 +59,9 @@ public: @param argName The hostname of the represented client @param argXPosition The client's x coordinate in the lab @param argYPosition The client's y coordinate in the lab - @param argHasWebcam If the represented client has a webcam installed @param argSettingsItems A QVector storing many needed data QStrings */ - Client( QPlainTextEdit *argDebugMessagesTextEditPtr, QString *argIP, QString *argMAC, QString *argName, unsigned short int argXPosition, unsigned short int argYPosition, bool argHasWebcam, const QVector< QString* > * const argSettingsItems ); + Client( QPlainTextEdit *argDebugMessagesTextEditPtr, QString *argIP, QString *argMAC, QString *argName, unsigned short int argXPosition, unsigned short int argYPosition, const QVector< QString* > * const argSettingsItems ); //! Client's destructor ~Client(); //! Beams the chosen file to the client's 'media4ztree' directory diff --git a/src/Lib/lablib.cpp b/src/Lib/lablib.cpp index af4d56b..07d54cd 100644 --- a/src/Lib/lablib.cpp +++ b/src/Lib/lablib.cpp @@ -306,14 +306,6 @@ void lc::Lablib::ReadSettings() { return; } debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] Client names: %1" ).arg( clientNames.join( " / " ) ) ); - QStringList clientWebcams = labSettings.value( "client_webcams" ).toString().split( '|', QString::SkipEmptyParts, Qt::CaseSensitive ); - if ( clientWebcams.length() != clientQuantity ) { - QMessageBox messageBox{ QMessageBox::Critical, tr( "Wrong client webcam property quantity" ), - tr( "The quantity of client webcam properties does not match the client quantity. Client creation will fail. No clients will be available for interaction." ), QMessageBox::Ok }; - messageBox.exec(); - return; - } - debugMessagesTextEdit->appendPlainText( tr( "[DEBUG] Client webcams: %1").arg( clientWebcams.join( " / " ) ) ); QStringList clientXPositions = labSettings.value( "client_xpos" ).toString().split( '|', QString::SkipEmptyParts, Qt::CaseSensitive ); if ( clientXPositions.length() != clientQuantity ) { QMessageBox messageBox{ QMessageBox::Critical, tr( "Wrong client x positions quantity" ), @@ -334,7 +326,7 @@ void lc::Lablib::ReadSettings() { clients = new QVector< Client* >; for ( int i = 0; i < clientQuantity; i++ ) { clients->append( new Client{ debugMessagesTextEdit, &clientIPs[ i ], &clientMACs[ i ], &clientNames[ i ], clientXPositions[ i ].toUShort(), - clientYPositions[ i ].toUShort(), clientWebcams[ i ].toInt(), settingsItems } ); + clientYPositions[ i ].toUShort(), settingsItems } ); // Add an corresponding entry to the 'client_ips_to_clients_map' std::map ( *clientIPsToClientsMap )[ clients->last()->ip ] = clients->last(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ddb8248..00444db 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -676,13 +676,6 @@ void lc::MainWindow::SetupWidgets() { ui->CBWebcamChooser->addItem( s, QVariant( 0 ) ); } - // Append available client webcams to the 'CBWebcamChooser' - if ( !( clients == nullptr ) ) { - for ( auto *s : *clients ) { - if ( s->hasWebcam ) - ui->CBWebcamChooser->addItem( s->name, QVariant( 1 ) ); - } - } // Deactivate the webcam choosing interface, if no webcams are available (none mounted at clients and none mounted in the laboratory) if ( ui->CBWebcamChooser->count() == 1 ) { ui->LWebcamChooser->setEnabled( false );