@@ -54,6 +54,8 @@ FDMLControl::FDMLControl(QWidget *parent) : QMainWindow(parent){
5454 this ->queryManager ->moveToThread (&comThread);
5555 connect (this , &FDMLControl::openSerialPort, this ->queryManager , &QueryManager::openSerialPort);
5656 connect (this , &FDMLControl::closeSerialPort, this ->queryManager , &QueryManager::closeSerialPort);
57+ connect (this , &FDMLControl::info, this ->logConsole , &MessageConsole::slot_displayInfo);
58+ connect (this , &FDMLControl::error, this ->logConsole , &MessageConsole::slot_displayError);
5759 connect (this ->queryManager , &QueryManager::serialOpen, this , &FDMLControl::enableGui);
5860 connect (this ->queryManager , &QueryManager::info, this ->logConsole , &MessageConsole::slot_displayInfo);
5961 connect (this ->queryManager , &QueryManager::error, this ->logConsole , &MessageConsole::slot_displayError);
@@ -205,6 +207,9 @@ void FDMLControl::initMenu(){
205207 QMenu* deviceMenu = this ->menuBar ()->addMenu (tr (" &Device" ));
206208 this ->readOutAction = deviceMenu->addAction (tr (" &Read From Device" ), this , &FDMLControl::readOutDevice);
207209 this ->readOutAction ->setStatusTip (tr (" Read out current FDML Laser parameters and update graphical user interface." ));
210+ this ->authenticateAction = deviceMenu->addAction (tr (" &Authenticate As Admin" ), this , &FDMLControl::authenticateAsAdmin);
211+ this ->authenticateAction ->setStatusTip (tr (" Log in as administrator to edit expert parameters." ));
212+
208213
209214 QMenu* helpMenu = this ->menuBar ()->addMenu (tr (" &Help" ));
210215 QAction* aboutAction = helpMenu->addAction (tr (" &About" ), this , &FDMLControl::showAbout);
@@ -259,6 +264,7 @@ void FDMLControl::enableGui(bool enable){
259264 this ->enableGroupBoxes (enable);
260265 this ->plot ->setAutoUpdate (enable);
261266 this ->readOutAction ->setEnabled (enable);
267+ this ->authenticateAction ->setEnabled (enable);
262268
263269 if (enable) {
264270 this ->authenticator ->authenticate ();
@@ -284,8 +290,8 @@ void FDMLControl::showAbout() {
284290 " Contact: zabic"
285291 " @"
286292 " iqo.uni-hannover.de<br>"
287- " Date: 21 June 2019<br>"
288- " Version: 1.0.2 " ));
293+ " Date: 17 July 2019<br>"
294+ " Version: 1.0.3 " ));
289295}
290296
291297void FDMLControl::toggleExpertView () {
@@ -302,5 +308,13 @@ void FDMLControl::toggleLogView() {
302308}
303309
304310void FDMLControl::readOutDevice (){
305- this ->widgetManager ->queryCurrentValues ();
311+ this ->widgetManager ->queryCurrentValues ();
312+ }
313+
314+ void FDMLControl::authenticateAsAdmin (){
315+ if (this ->authenticator ->isKeyAvailable ()){
316+ this ->authenticator ->authenticate ();
317+ }else {
318+ emit error (tr (" Administrator authentication not possible, key file is missing." ));
319+ }
306320}
0 commit comments