From 1fdae2c578ca69a24853be38ee22b38c01f91895 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 20 Nov 2018 09:07:33 +0100 Subject: [PATCH 01/58] [assembly] updated assembly/assembly_parameters_DAF_180824.cfg --- assembly/assembly/assembly_parameters_DAF_180824.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_180824.cfg b/assembly/assembly/assembly_parameters_DAF_180824.cfg index 5bfb886c6..835563a44 100644 --- a/assembly/assembly/assembly_parameters_DAF_180824.cfg +++ b/assembly/assembly/assembly_parameters_DAF_180824.cfg @@ -27,10 +27,10 @@ RefPointSensor_Z -74.7897 RefPointSensor_A 1.000 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -47.3278 -RefPointSpacer_Y -76.3889 -RefPointSpacer_Z -73.8228 -RefPointSpacer_A -89.722 +RefPointSpacer_X -47.2578 +RefPointSpacer_Y -76.6889 +RefPointSpacer_Z -73.8812 +RefPointSpacer_A -89.8290 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) RefPointBaseplate_X -49.6478 From 3ee51feb0ee96bd1fae44ea614f2a3b92dcb900c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Wed, 16 Jan 2019 11:24:25 +0100 Subject: [PATCH 02/58] [assembly] fix in LStepExpressMotionManager::get_position --- assembly/assembly/AssemblyMainWindow.cc | 12 ++++++++---- .../assemblyCommon/LStepExpressMeasurement.cc | 19 +++++++------------ assembly/assemblyCommon/LStepExpressModel.cc | 4 ++-- assembly/assemblyCommon/LStepExpressModel.h | 3 ++- .../LStepExpressMotionManager.cc | 14 +++++++++++++- .../LStepExpressMotionManager.h | 2 ++ 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index 69faf8451..418748981 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -209,7 +209,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), this, SLOT(disconnect_objectAligner())); connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), motion_manager_, SLOT(emergency_stop())); - connect(motion_manager_->model(), SIGNAL(emergencyStopSignal()), motion_manager_, SLOT(clear_motion_queue())); + connect(motion_manager_->model(), SIGNAL(emergencyStop_request()), motion_manager_, SLOT(clear_motion_queue())); NQLog("AssemblyMainWindow", NQLog::Message) << "added view " << tabname_Alignm; // --------------------------------------------------------- @@ -346,16 +346,20 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr /// Upper Toolbar ------------------------------------------ toolBar_ = addToolBar("Tools"); - toolBar_ ->addAction("Camera ON" , this, SLOT( enable_images())); - toolBar_ ->addAction("Camera OFF", this, SLOT(disable_images())); - toolBar_ ->addAction("Snapshot" , this, SLOT( get_image ())); + toolBar_ ->addAction("Camera ON" , this, SLOT( enable_images())); + toolBar_ ->addAction("Camera OFF" , this, SLOT(disable_images())); + toolBar_ ->addAction("Snapshot" , this, SLOT( get_image ())); + + toolBar_ ->addAction("Emergency Stop", motion_manager_->model(), SLOT(emergencyStop())); autofocus_checkbox_ = new QCheckBox("Auto-Focusing", this); toolBar_->addWidget(autofocus_checkbox_); connect(autofocus_checkbox_, SIGNAL(stateChanged(int)), this, SLOT(changeState_autofocus(int))); connect(autofocus_checkbox_, SIGNAL(stateChanged(int)), aligner_view_, SLOT(update_autofocusing_checkbox(int))); + /// -------------------------------------------------------- + /// Main Tab ----------------------------------------------- QTabWidget* main_tab = new QTabWidget; main_tab->setTabPosition(QTabWidget::South); diff --git a/assembly/assemblyCommon/LStepExpressMeasurement.cc b/assembly/assemblyCommon/LStepExpressMeasurement.cc index 09cfaa55c..22f269d0b 100644 --- a/assembly/assemblyCommon/LStepExpressMeasurement.cc +++ b/assembly/assemblyCommon/LStepExpressMeasurement.cc @@ -39,22 +39,17 @@ LStepExpressMeasurement::LStepExpressMeasurement(LStepExpressModel* model, LStep currentIndex_ = -1; tableSize_ = 0; - connect(model_, SIGNAL(emergencyStopSignal()), - this, SLOT(stopMeasurement())); - - connect(model_, SIGNAL(motionFinished()), - this, SLOT(takeMeasurement())); - - connect(this, SIGNAL(nextScanStep()), - this, SLOT(doNextScanStep())); + connect(model_, SIGNAL(emergencyStop_request()), this, SLOT(stopMeasurement())); - connect(laserModel_, SIGNAL(deviceStateChanged(State)), - this,SLOT(setLaserEnabled(State))); + connect(model_, SIGNAL(motionFinished()), this, SLOT(takeMeasurement())); - generateCirclePositions(); + connect(this, SIGNAL(nextScanStep()), this, SLOT(doNextScanStep())); + + connect(laserModel_, SIGNAL(deviceStateChanged(State)), this, SLOT(setLaserEnabled(State))); + generateCirclePositions(); } - + LStepExpressMeasurement::~LStepExpressMeasurement() { } diff --git a/assembly/assemblyCommon/LStepExpressModel.cc b/assembly/assemblyCommon/LStepExpressModel.cc index 969e7f877..b97d22667 100644 --- a/assembly/assemblyCommon/LStepExpressModel.cc +++ b/assembly/assemblyCommon/LStepExpressModel.cc @@ -778,9 +778,9 @@ void LStepExpressModel::emergencyStop() finishedCalibrating_ = false; NQLog("LStepExpressModel", NQLog::Spam) << "emergencyStop" - << ": emitting signal \"emergencyStopSignal\""; + << ": emitting signal \"emergencyStop_request\""; - emit emergencyStopSignal(); + emit emergencyStop_request(); NQLog("LStepExpressModel", NQLog::Spam) << "emergencyStop" << ": emitting signal \"motionFinished\""; diff --git a/assembly/assemblyCommon/LStepExpressModel.h b/assembly/assemblyCommon/LStepExpressModel.h index 483d33fe4..eac11d74e 100644 --- a/assembly/assemblyCommon/LStepExpressModel.h +++ b/assembly/assemblyCommon/LStepExpressModel.h @@ -177,7 +177,8 @@ class LStepExpressModel : public QObject, public AbstractDeviceModelconnect_model(); } @@ -317,7 +319,17 @@ double LStepExpressMotionManager::get_position(const int axis) const { ++tries; - if(tries > 5) + if(tries > 20) + { + NQLog("LStepExpressMotionManager", NQLog::Warning) << "get_position(" << axis << ")" + << ": after try #" << tries << ", call for LStepExpressMotionManager::emergency_stop()"; + + NQLog("LStepExpressMotionManager", NQLog::Spam) << "get_position(" << axis << ")" + << ": emitting signal \"emergencyStop_request\""; + + emit emergencyStop_request(); + } + else if(tries > 5) { if(model()->isUpdating()) { diff --git a/assembly/assemblyCommon/LStepExpressMotionManager.h b/assembly/assemblyCommon/LStepExpressMotionManager.h index e36a276e0..a5ffa2fe5 100644 --- a/assembly/assemblyCommon/LStepExpressMotionManager.h +++ b/assembly/assemblyCommon/LStepExpressMotionManager.h @@ -86,6 +86,8 @@ class LStepExpressMotionManager : public QObject signals: + void emergencyStop_request() const; + void motion_finished(); void signalMoveRelative(double x, double y, double z, double a); From 8c96d496e403ed6e9c84b11a817365e8224369a2 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Wed, 16 Jan 2019 11:24:44 +0100 Subject: [PATCH 03/58] [assembly] added assembly/assembly_parameters_DAF_190116.cfg --- assembly/assembly.cfg | 2 +- .../assembly_parameters_DAF_190116.cfg | 73 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 assembly/assembly/assembly_parameters_DAF_190116.cfg diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index 5cf1d7c66..4c617f58a 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -40,7 +40,7 @@ startup_motion_stage 1 startup_camera 1 # AssemblyParameters -AssemblyParameters_file_path assembly_parameters_DAF_180824.cfg # format: relative path from where binary is executed +AssemblyParameters_file_path assembly_parameters_DAF_190116.cfg # format: relative path from where binary is executed # AssemblyZFocusFinder AssemblyZFocusFinder_zrange_max 3.0 diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg new file mode 100644 index 000000000..1622de6ee --- /dev/null +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -0,0 +1,73 @@ + +# Sensor Ref-Point = edge of fiducial marker measured with Pattern Recognition +# Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point +# Baseplate Ref-Point = edge [...] + +#################################### +### DIMENSIONS ##################### +#################################### + +# dimensions: thickness of assembly components +Thickness_VacuumCups 0.300 +Thickness_Baseplate 0.665 +Thickness_PSS 0.720 +Thickness_PSP 0.720 +Thickness_Spacer 3.105 +Height_SpacerSlots 1.450 +Thickness_GlueLayer 0.025 + +#################################### +### POSITIONS ###################### +#################################### + +# position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) +RefPointSensor_X -69.7431 +RefPointSensor_Y -78.5036 +RefPointSensor_Z -62.7689 +RefPointSensor_A -0.2030 + +# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) +RefPointSpacer_X -62.2778 +RefPointSpacer_Y -79.6489 +RefPointSpacer_Z -60.6716 +RefPointSpacer_A -90.1960 + +# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) +RefPointBaseplate_X -49.6478 +RefPointBaseplate_Y -66.159 +RefPointBaseplate_Z -62.8157 +RefPointBaseplate_A 0.372 + +# [DUMMY] position: Z-position (height) to put pickup tool in contact with rotation stage +PickupToolOnRotStage_Z -60.99 + +# position: XYZ-position with pickup tool in contact with glue-dispensing platform +PickupToolOnGluingStage_X 0.000 +PickupToolOnGluingStage_Y 0.000 +PickupToolOnGluingStage_Z 0.000 + +#################################### +### DISTANCES ###################### +#################################### + +# distance: Angle of Camera Frame in the XY Motion Stage Ref-Frame [deg] +AngleOfCameraFrameInRefFrame_dA -89.5954 + +# distance: from Sensor Ref-Point to Sensor Pickup position +FromSensorRefPointToSensorPickup_dX 88.00 +FromSensorRefPointToSensorPickup_dY 37.00 + +# distance: from PS-p Ref-Point to PS-s Ref-Point +FromPSPRefPointToPSSRefPoint_dX 1.25 +FromPSPRefPointToPSSRefPoint_dY 0.00 + +# distance: from Spacer Ref-Point to Sensor Ref-Point +FromSpacerRefPointToSensorRefPoint_dX 0.85 +FromSpacerRefPointToSensorRefPoint_dY -0.15 + +# distance: from Baseplate Ref-Point to PS-p Ref-Point +FromBaseplateRefPointToPSPRefPoint_dX 1.60 +FromBaseplateRefPointToPSPRefPoint_dY -10.65 + +# # distance: from best-focus z-position to pickup z-position +# FromCameraBestFocusToPickupHeight_dZ -0.00 From 08211d03219af71a8c6a4837e46c64b115ca8ccc Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Wed, 16 Jan 2019 13:15:37 +0100 Subject: [PATCH 04/58] [assembly] minor update to assemblyCommon/AssemblyUEyeView --- assembly/assemblyCommon/AssemblyUEyeView.cc | 15 +++------------ assembly/assemblyCommon/AssemblyUEyeView.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyUEyeView.cc b/assembly/assemblyCommon/AssemblyUEyeView.cc index 0da0a652a..cf51a4986 100644 --- a/assembly/assemblyCommon/AssemblyUEyeView.cc +++ b/assembly/assemblyCommon/AssemblyUEyeView.cc @@ -11,7 +11,6 @@ ///////////////////////////////////////////////////////////////////////////////// #include -#include #include @@ -41,18 +40,12 @@ void AssemblyUEyeView::setImage(const cv::Mat& newImage) cv::Mat temp; cvtColor(newImage, temp, CV_GRAY2RGB); - image_ = QImage((const uchar *) temp.data, - temp.cols, temp.rows, - temp.step, QImage::Format_RGB888); - + image_ = QImage((const uchar *) temp.data, temp.cols, temp.rows, temp.step, QImage::Format_RGB888); image_.bits(); } else { - image_ = QImage((const uchar *) newImage.data, - newImage.cols, newImage.rows, - newImage.step, QImage::Format_RGB888); - + image_ = QImage((const uchar *) newImage.data, newImage.cols, newImage.rows, newImage.step, QImage::Format_RGB888); image_.bits(); } @@ -65,9 +58,7 @@ void AssemblyUEyeView::paintEvent(QPaintEvent*) { if(image_.isNull() == false) { - QImage image = image_.scaled(image_.width() * zoomFactor_, - image_.height() * zoomFactor_, - Qt::KeepAspectRatio); + const QImage image = image_.scaled(image_.width() * zoomFactor_, image_.height() * zoomFactor_, Qt::KeepAspectRatio); resize(image.width(), image.height()); diff --git a/assembly/assemblyCommon/AssemblyUEyeView.h b/assembly/assemblyCommon/AssemblyUEyeView.h index 2201c0b40..0b6e2d728 100644 --- a/assembly/assemblyCommon/AssemblyUEyeView.h +++ b/assembly/assemblyCommon/AssemblyUEyeView.h @@ -17,8 +17,6 @@ #include #include -#include - #include class AssemblyUEyeView : public QLabel From 9e7f8a90c46ae2cb293e41576a388e1d360be2f0 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 21 Jan 2019 11:45:50 +0100 Subject: [PATCH 05/58] [assembly] updated assembly/assembly_parameters_DAF_190116.cfg --- .../assembly_parameters_DAF_190116.cfg | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index 1622de6ee..abb18e118 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -3,15 +3,17 @@ # Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point # Baseplate Ref-Point = edge [...] +# CameraFocusToPickup_dZ -31.85 + #################################### ### DIMENSIONS ##################### #################################### # dimensions: thickness of assembly components -Thickness_VacuumCups 0.300 +Thickness_VacuumCups 0.000 Thickness_Baseplate 0.665 -Thickness_PSS 0.720 -Thickness_PSP 0.720 +Thickness_PSS 0.700 +Thickness_PSP 0.780 Thickness_Spacer 3.105 Height_SpacerSlots 1.450 Thickness_GlueLayer 0.025 @@ -21,22 +23,22 @@ Thickness_GlueLayer 0.025 #################################### # position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) -RefPointSensor_X -69.7431 -RefPointSensor_Y -78.5036 -RefPointSensor_Z -62.7689 -RefPointSensor_A -0.2030 +RefPointSensor_X -70.0283 +RefPointSensor_Y -78.4945 +RefPointSensor_Z -62.7329 +RefPointSensor_A -0.307 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -62.2778 -RefPointSpacer_Y -79.6489 -RefPointSpacer_Z -60.6716 -RefPointSpacer_A -90.1960 +RefPointSpacer_X -62.4278 +RefPointSpacer_Y -79.7189 +RefPointSpacer_Z -60.7482 +RefPointSpacer_A -90.183 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) -RefPointBaseplate_X -49.6478 -RefPointBaseplate_Y -66.159 -RefPointBaseplate_Z -62.8157 -RefPointBaseplate_A 0.372 +RefPointBaseplate_X -64.4778 +RefPointBaseplate_Y -68.279 +RefPointBaseplate_Z -62.7678 +RefPointBaseplate_A -0.056 # [DUMMY] position: Z-position (height) to put pickup tool in contact with rotation stage PickupToolOnRotStage_Z -60.99 From 3b31caf7714ba800707ce97b30b7edb0ed0dad5d Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 29 Jan 2019 14:06:10 +0100 Subject: [PATCH 06/58] [assembly] added assembly/assembly_parameters_DAF_190116.cfg --- assembly/assembly/assembly_parameters_DAF_190116.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index abb18e118..1e0aae775 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -29,14 +29,14 @@ RefPointSensor_Z -62.7329 RefPointSensor_A -0.307 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -62.4278 -RefPointSpacer_Y -79.7189 -RefPointSpacer_Z -60.7482 -RefPointSpacer_A -90.183 +RefPointSpacer_X -62.428 +RefPointSpacer_Y -79.629 +RefPointSpacer_Z -63.248 +RefPointSpacer_A -90.182 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) RefPointBaseplate_X -64.4778 -RefPointBaseplate_Y -68.279 +RefPointBaseplate_Y -68.330 RefPointBaseplate_Z -62.7678 RefPointBaseplate_A -0.056 From d48f0b97a83cfe20330347a842f824ec3b26602b Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 09:44:34 +0100 Subject: [PATCH 07/58] [assembly] only code-formatting in assemblyCommon/LStepExpressJoystickWidget.cc --- .../LStepExpressJoystickWidget.cc | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/assembly/assemblyCommon/LStepExpressJoystickWidget.cc b/assembly/assemblyCommon/LStepExpressJoystickWidget.cc index b518dd9b2..fbd24845f 100644 --- a/assembly/assemblyCommon/LStepExpressJoystickWidget.cc +++ b/assembly/assemblyCommon/LStepExpressJoystickWidget.cc @@ -110,62 +110,62 @@ LStepExpressJoystickAxisWidget::LStepExpressJoystickAxisWidget(LStepExpressModel , axis_(axis) , motionTools_enabled_(true) { - layout_ = new QVBoxLayout(this); - setLayout(layout_); + layout_ = new QVBoxLayout(this); + this->setLayout(layout_); - stepBox_ = new QDoubleSpinBox(this); - stepBox_->setSuffix(" usteps"); - stepBox_->setMinimum(0.0000); - stepBox_->setMaximum(10.0000); - stepBox_->setValue(1.0); - layout_->addWidget(stepBox_); + stepBox_ = new QDoubleSpinBox(this); + stepBox_->setSuffix(" usteps"); + stepBox_->setMinimum(0.0000); + stepBox_->setMaximum(10.0000); + stepBox_->setValue(1.0); + layout_->addWidget(stepBox_); - upButton_ = new QPushButton(QIcon(QString(Config::CMSTkModLabBasePath.c_str())+"/share/icon_UP.png") , "", this); - downButton_ = new QPushButton(QIcon(QString(Config::CMSTkModLabBasePath.c_str())+"/share/icon_DOWN.png"), "", this); + upButton_ = new QPushButton(QIcon(QString(Config::CMSTkModLabBasePath.c_str())+"/share/icon_UP.png") , "", this); + downButton_ = new QPushButton(QIcon(QString(Config::CMSTkModLabBasePath.c_str())+"/share/icon_DOWN.png"), "", this); - layout_->addWidget( upButton_); - layout_->addWidget(downButton_); + layout_->addWidget( upButton_); + layout_->addWidget(downButton_); - connect( upButton_, SIGNAL(clicked()), this, SLOT( upButtonClicked())); - connect(downButton_, SIGNAL(clicked()), this, SLOT(downButtonClicked())); + connect( upButton_, SIGNAL(clicked()), this, SLOT( upButtonClicked())); + connect(downButton_, SIGNAL(clicked()), this, SLOT(downButtonClicked())); - connect(model_, SIGNAL(deviceStateChanged(State)) , this, SLOT(lStepStateChanged(State))); - connect(model_, SIGNAL(controlStateChanged(bool)) , this, SLOT(controlStateChanged(bool))); - connect(model_, SIGNAL(informationChanged()) , this, SLOT(updateWidgets())); - connect(model_, SIGNAL(motionInformationChanged()), this, SLOT(updateMotionWidgets())); + connect(model_, SIGNAL(deviceStateChanged(State)) , this, SLOT(lStepStateChanged(State))); + connect(model_, SIGNAL(controlStateChanged(bool)) , this, SLOT(controlStateChanged(bool))); + connect(model_, SIGNAL(informationChanged()) , this, SLOT(updateWidgets())); + connect(model_, SIGNAL(motionInformationChanged()), this, SLOT(updateMotionWidgets())); - connect(model_, SIGNAL(motionStarted()) , this, SLOT(motionStarted())); - connect(model_, SIGNAL(motionFinished()), this, SLOT(motionFinished())); + connect(model_, SIGNAL(motionStarted()) , this, SLOT(motionStarted())); + connect(model_, SIGNAL(motionFinished()), this, SLOT(motionFinished())); } LStepExpressJoystickAxisWidget::~LStepExpressJoystickAxisWidget() { - if(layout_){delete layout_; layout_ = nullptr;} - if(upButton_){delete upButton_; upButton_ = nullptr;} - if(downButton_){delete downButton_; downButton_ = nullptr;} - if(stepBox_){delete stepBox_; stepBox_ = nullptr;} + if(layout_) { delete layout_ ; layout_ = nullptr; } + if(upButton_) { delete upButton_ ; upButton_ = nullptr; } + if(downButton_){ delete downButton_; downButton_ = nullptr; } + if(stepBox_) { delete stepBox_ ; stepBox_ = nullptr; } } void LStepExpressJoystickAxisWidget::updateWidgets() { - const bool axis_enabled = model_->getAxisEnabled(axis_); + const bool axis_enabled = model_->getAxisEnabled(axis_); -// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" updateWidgets() " << axis ; +// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" updateWidgets() " << axis; - stepBox_->setSuffix(QString(" ") + model_->getAxisDimensionShortName(axis_)); + stepBox_->setSuffix(QString(" ") + model_->getAxisDimensionShortName(axis_)); - stepBox_ ->setEnabled(axis_enabled); + stepBox_->setEnabled(axis_enabled); - if(motionTools_enabled_) - { - upButton_ ->setEnabled(axis_enabled); - downButton_->setEnabled(axis_enabled); - } + if(motionTools_enabled_) + { + upButton_ ->setEnabled(axis_enabled); + downButton_->setEnabled(axis_enabled); + } } void LStepExpressJoystickAxisWidget::updateMotionWidgets() { - // NQLog("LStepExpressJoystickAxisWidget updateMotionWidgets()" ; +// NQLog("LStepExpressJoystickAxisWidget updateMotionWidgets()"; } void LStepExpressJoystickAxisWidget::lStepStateChanged(State newState) @@ -227,28 +227,28 @@ void LStepExpressJoystickAxisWidget::controlStateChanged(bool enabled) void LStepExpressJoystickAxisWidget::upButtonClicked() { - // NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" upButtonClicked()" ; +// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" upButtonClicked()"; - double value = stepBox_->value(); - model_->moveRelative(axis_, value); + const double value = stepBox_->value(); + model_->moveRelative(axis_, value); } void LStepExpressJoystickAxisWidget::downButtonClicked() { - // NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" downButtonClicked()" ; +// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" downButtonClicked()"; - double value = -stepBox_->value(); - model_->moveRelative(axis_, value); + const double value = (-1. * stepBox_->value()); + model_->moveRelative(axis_, value); } void LStepExpressJoystickAxisWidget::motionStarted() { - // NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" motionStarted()" ; +// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" motionStarted()"; } void LStepExpressJoystickAxisWidget::motionFinished() { - // NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" motionFinished()" ; +// NQLog("LStepExpressJoystickAxisWidget", NQLog::Spam)<<" motionFinished()"; } void LStepExpressJoystickAxisWidget::enableMotionTools(const bool enable) From a1cae53a46346c53d3511d2e831bb905115a9fe3 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 09:45:32 +0100 Subject: [PATCH 08/58] [assembly] updated assemblyCommon/AssemblyHardwareControlView.cc --- .../assemblyCommon/AssemblyHardwareControlView.cc | 2 +- assembly/assemblyCommon/LStepExpressWidget.cc | 12 +++++++----- assembly/assemblyCommon/LStepExpressWidget.h | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyHardwareControlView.cc b/assembly/assemblyCommon/AssemblyHardwareControlView.cc index fdbd3a8e1..237c29edd 100644 --- a/assembly/assemblyCommon/AssemblyHardwareControlView.cc +++ b/assembly/assemblyCommon/AssemblyHardwareControlView.cc @@ -138,7 +138,7 @@ void AssemblyHardwareControlView::stateChanged(const State& newState) void AssemblyHardwareControlView::enableMotionTools(const bool enable) { if(w_lStep_ ){ w_lStep_ ->enableMotionTools(enable); } - if(w_lStepJoystick_){ w_lStepJoystick_->enableMotionTools(enable); } +// if(w_lStepJoystick_){ w_lStepJoystick_->enableMotionTools(enable); } if(w_lStepPosition_){ w_lStepPosition_->enableMotionTools(enable); } if(w_move_){ w_move_->setEnabled(enable); } diff --git a/assembly/assemblyCommon/LStepExpressWidget.cc b/assembly/assemblyCommon/LStepExpressWidget.cc index bd744316c..1a1afe72c 100644 --- a/assembly/assemblyCommon/LStepExpressWidget.cc +++ b/assembly/assemblyCommon/LStepExpressWidget.cc @@ -23,6 +23,7 @@ LStepExpressWidget::LStepExpressWidget(LStepExpressModel* model, QWidget* parent , model_(model) + , mot_settings_box_(nullptr) , lstepCheckBox_ (nullptr) , joystickCheckBox_(nullptr) , posCtrlCheckBox_ (nullptr) @@ -55,13 +56,12 @@ LStepExpressWidget::LStepExpressWidget(LStepExpressModel* model, QWidget* parent layout->addLayout(hlayout); // Motion Stage Settings - QGroupBox* mot_settings_box = new QGroupBox(tr("Motion Stage Settings")); - hlayout->addWidget(mot_settings_box); - - mot_settings_box->setStyleSheet("QGroupBox { font-weight: bold; } "); + mot_settings_box_ = new QGroupBox(tr("Motion Stage Settings")); + mot_settings_box_->setStyleSheet("QGroupBox { font-weight: bold; } "); + hlayout->addWidget(mot_settings_box_); QGridLayout* mot_settings_grid = new QGridLayout; - mot_settings_box->setLayout(mot_settings_grid); + mot_settings_box_->setLayout(mot_settings_grid); lstepCheckBox_ = new QCheckBox("Enable Controller"); mot_settings_grid->addWidget(lstepCheckBox_, 0, 0); @@ -463,6 +463,8 @@ void LStepExpressWidget::lockMotionSettings(const bool disable) { motionSettings_locked_ = disable; + mot_settings_box_->setDisabled(disable); + if(lstepCheckBox_ ){ lstepCheckBox_ ->setDisabled(disable); } if(joystickCheckBox_){ joystickCheckBox_->setDisabled(disable); } if(posCtrlCheckBox_ ){ posCtrlCheckBox_ ->setDisabled(disable); } diff --git a/assembly/assemblyCommon/LStepExpressWidget.h b/assembly/assemblyCommon/LStepExpressWidget.h index 8c202d54c..b65cb31ac 100644 --- a/assembly/assemblyCommon/LStepExpressWidget.h +++ b/assembly/assemblyCommon/LStepExpressWidget.h @@ -15,14 +15,13 @@ #include +#include +#include #include #include #include #include -#include #include -#include -#include #include #include #include @@ -42,6 +41,7 @@ class LStepExpressWidget : public QWidget LStepExpressModel* model_; + QGroupBox* mot_settings_box_; QCheckBox* lstepCheckBox_; QCheckBox* joystickCheckBox_; QCheckBox* posCtrlCheckBox_; From 083c3ffe0b6ad3e4fc371c261c5cb66276363513 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 13:07:25 +0100 Subject: [PATCH 09/58] [assembly] updated assemblyCommon/AssemblyHardwareControlView.cc --- .../AssemblyHardwareControlView.cc | 19 +++---- .../AssemblyHardwareControlView.h | 4 +- .../LStepExpressJoystickWidget.cc | 4 +- .../LStepExpressJoystickWidget.h | 36 ++++++------- assembly/assemblyCommon/LStepExpressWidget.cc | 52 +++++++++---------- assembly/assemblyCommon/LStepExpressWidget.h | 6 +-- 6 files changed, 61 insertions(+), 60 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyHardwareControlView.cc b/assembly/assemblyCommon/AssemblyHardwareControlView.cc index 237c29edd..006d0a3b5 100644 --- a/assembly/assemblyCommon/AssemblyHardwareControlView.cc +++ b/assembly/assemblyCommon/AssemblyHardwareControlView.cc @@ -63,6 +63,7 @@ AssemblyHardwareControlView::AssemblyHardwareControlView(const LStepExpressMotio w_move_ = new AssemblyMoveWidget(manager_); w_move_->setToolTip("Single-Motion interface"); + w_move_->setEnabled(false); l_move->addWidget(w_move_); // ----- @@ -71,8 +72,8 @@ AssemblyHardwareControlView::AssemblyHardwareControlView(const LStepExpressMotio connect(manager_->model(), SIGNAL(deviceStateChanged(State)), this, SLOT(stateChanged(State))); - connect(manager_->model(), SIGNAL(motionStarted ()), this, SLOT(disableMotionTools())); - connect(manager_->model(), SIGNAL(motionFinished()), this, SLOT( enableMotionTools())); +// connect(manager_->model(), SIGNAL(motionStarted ()), this, SLOT(disableMotionTools())); +// connect(manager_->model(), SIGNAL(motionFinished()), this, SLOT( enableMotionTools())); g1->addWidget(box_move, 60); /// ------------- @@ -101,8 +102,6 @@ AssemblyHardwareControlView::AssemblyHardwareControlView(const LStepExpressMotio layout->addWidget(w_lStep_); connect(w_lStep_, SIGNAL(clearQueue_request()), manager_, SLOT(clear_motion_queue())); - - connect(cb_lockMotionSettings_, SIGNAL(toggled(bool)), w_lStep_, SLOT(lockMotionSettings(bool))); //// ------------------ //// LStepExpressJoystickWidget @@ -115,6 +114,8 @@ AssemblyHardwareControlView::AssemblyHardwareControlView(const LStepExpressMotio // layout->addWidget(w_lStepPosition_); // //// ------------------ + connect(cb_lockMotionSettings_, SIGNAL(toggled(bool)), w_lStep_, SLOT(lockMotionSettings(bool))); + // ------------------------------------------- NQLog("AssemblyHardwareControlView", NQLog::Debug) << "constructed"; @@ -137,14 +138,14 @@ void AssemblyHardwareControlView::stateChanged(const State& newState) void AssemblyHardwareControlView::enableMotionTools(const bool enable) { + if(w_move_){ w_move_->setEnabled(enable); } + if(w_lStep_ ){ w_lStep_ ->enableMotionTools(enable); } -// if(w_lStepJoystick_){ w_lStepJoystick_->enableMotionTools(enable); } + if(w_lStepJoystick_){ w_lStepJoystick_->enableMotionTools(enable); } if(w_lStepPosition_){ w_lStepPosition_->enableMotionTools(enable); } - - if(w_move_){ w_move_->setEnabled(enable); } } -void AssemblyHardwareControlView::disableMotionTools() +void AssemblyHardwareControlView::disableMotionTools(const bool disable) { - this->enableMotionTools(false); + this->enableMotionTools(!disable); } diff --git a/assembly/assemblyCommon/AssemblyHardwareControlView.h b/assembly/assemblyCommon/AssemblyHardwareControlView.h index 770c77acd..232c4e689 100644 --- a/assembly/assemblyCommon/AssemblyHardwareControlView.h +++ b/assembly/assemblyCommon/AssemblyHardwareControlView.h @@ -56,8 +56,8 @@ class AssemblyHardwareControlView : public QWidget void stateChanged(const State&); - void enableMotionTools(const bool enable=true); - void disableMotionTools(); + void enableMotionTools(const bool enable=true); + void disableMotionTools(const bool disable=true); }; #endif // ASSEMBLYHARDWARECONTROLVIEW_H diff --git a/assembly/assemblyCommon/LStepExpressJoystickWidget.cc b/assembly/assemblyCommon/LStepExpressJoystickWidget.cc index fbd24845f..84ed12a94 100644 --- a/assembly/assemblyCommon/LStepExpressJoystickWidget.cc +++ b/assembly/assemblyCommon/LStepExpressJoystickWidget.cc @@ -98,9 +98,9 @@ void LStepExpressJoystickWidget::enableMotionTools(const bool enable) if(w_joyax_A_){ w_joyax_A_->enableMotionTools(enable); } } -void LStepExpressJoystickWidget::disableMotionTools() +void LStepExpressJoystickWidget::disableMotionTools(const bool disable) { - this->enableMotionTools(false); + this->enableMotionTools(!disable); } // ============================================================================ diff --git a/assembly/assemblyCommon/LStepExpressJoystickWidget.h b/assembly/assemblyCommon/LStepExpressJoystickWidget.h index 107247698..38b21ee83 100644 --- a/assembly/assemblyCommon/LStepExpressJoystickWidget.h +++ b/assembly/assemblyCommon/LStepExpressJoystickWidget.h @@ -31,29 +31,29 @@ class LStepExpressJoystickAxisWidget; class LStepExpressJoystickWidget : public QWidget { - Q_OBJECT + Q_OBJECT -public: - explicit LStepExpressJoystickWidget(LStepExpressModel* model, QWidget *parent = 0); - ~LStepExpressJoystickWidget(); + public: + explicit LStepExpressJoystickWidget(LStepExpressModel* model, QWidget *parent = 0); + ~LStepExpressJoystickWidget(); -protected: - LStepExpressModel* model_; - QWidget* axisControlWidget_; + protected: + LStepExpressModel* model_; + QWidget* axisControlWidget_; - LStepExpressJoystickAxisWidget* w_joyax_X_; - LStepExpressJoystickAxisWidget* w_joyax_Y_; - LStepExpressJoystickAxisWidget* w_joyax_Z_; - LStepExpressJoystickAxisWidget* w_joyax_A_; + LStepExpressJoystickAxisWidget* w_joyax_X_; + LStepExpressJoystickAxisWidget* w_joyax_Y_; + LStepExpressJoystickAxisWidget* w_joyax_Z_; + LStepExpressJoystickAxisWidget* w_joyax_A_; -public slots: - void lstepStateChanged(State newState); - void controlStateChanged(bool); - void motionStarted(); - void motionFinished(); + public slots: + void lstepStateChanged(State newState); + void controlStateChanged(bool); + void motionStarted(); + void motionFinished(); - void enableMotionTools(const bool enable=true); - void disableMotionTools(); + void enableMotionTools(const bool enable=true); + void disableMotionTools(const bool disable=true); }; class LStepExpressJoystickAxisWidget : public QWidget diff --git a/assembly/assemblyCommon/LStepExpressWidget.cc b/assembly/assemblyCommon/LStepExpressWidget.cc index 1a1afe72c..292e3d39e 100644 --- a/assembly/assemblyCommon/LStepExpressWidget.cc +++ b/assembly/assemblyCommon/LStepExpressWidget.cc @@ -32,8 +32,8 @@ LStepExpressWidget::LStepExpressWidget(LStepExpressModel* model, QWidget* parent , buttonCalibrate_(nullptr) , buttonEmergencyStop_(nullptr) , buttonClearQueue_(nullptr) - , buttonErrorQuit_(nullptr) , buttonRestart_(nullptr) + , buttonErrorQuit_(nullptr) , axisWidget_X_(nullptr) , axisWidget_Y_(nullptr) @@ -69,30 +69,30 @@ LStepExpressWidget::LStepExpressWidget(LStepExpressModel* model, QWidget* parent posCtrlCheckBox_ = new QCheckBox("Enable Position Controller"); mot_settings_grid->addWidget(posCtrlCheckBox_, 0, 1); - buttonRestart_ = new QPushButton("Restart LStep"); - mot_settings_grid->addWidget(buttonRestart_, 1, 0); - - buttonErrorQuit_ = new QPushButton("Error Quit"); - mot_settings_grid->addWidget(buttonErrorQuit_, 1, 1); - joystickCheckBox_ = new QCheckBox("Enable Joystick"); mot_settings_grid->addWidget(joystickCheckBox_, 0, 2); // Motion Stage Basic Commands (e.g. Calibrate) - QGridLayout* mot_basicmoves_grid = new QGridLayout; - hlayout->addLayout(mot_basicmoves_grid); + QGridLayout* mot_basicfunc_grid = new QGridLayout; + hlayout->addLayout(mot_basicfunc_grid); buttonCalibrate_ = new QPushButton("Calibrate"); - mot_basicmoves_grid->addWidget(buttonCalibrate_, 0, 0); + mot_basicfunc_grid->addWidget(buttonCalibrate_, 0, 0); buttonOrigin_ = new QPushButton("Origin"); - mot_basicmoves_grid->addWidget(buttonOrigin_, 1, 0); + mot_basicfunc_grid->addWidget(buttonOrigin_, 1, 0); + + buttonRestart_ = new QPushButton("Restart Motion Stage"); + mot_basicfunc_grid->addWidget(buttonRestart_, 2, 0); buttonEmergencyStop_ = new QPushButton("Emergency Stop"); - mot_basicmoves_grid->addWidget(buttonEmergencyStop_, 0, 1); + mot_basicfunc_grid->addWidget(buttonEmergencyStop_, 0, 1); buttonClearQueue_ = new QPushButton("Clear Motion Queue"); - mot_basicmoves_grid->addWidget(buttonClearQueue_, 1, 1); + mot_basicfunc_grid->addWidget(buttonClearQueue_, 1, 1); + + buttonErrorQuit_ = new QPushButton("Error Quit"); + mot_basicfunc_grid->addWidget(buttonErrorQuit_, 2, 1); // AXIS axisControlWidget_ = new QWidget(this); @@ -126,8 +126,8 @@ LStepExpressWidget::LStepExpressWidget(LStepExpressModel* model, QWidget* parent connect(buttonCalibrate_ , SIGNAL(clicked()), model_, SLOT(calibrate())); connect(buttonEmergencyStop_, SIGNAL(clicked()), model_, SLOT(emergencyStop())); connect(buttonClearQueue_ , SIGNAL(clicked()), this , SIGNAL(clearQueue_request())); - connect(buttonErrorQuit_ , SIGNAL(clicked()), model_, SLOT(errorQuit())); connect(buttonRestart_ , SIGNAL(clicked()), this , SLOT(restart())); + connect(buttonErrorQuit_ , SIGNAL(clicked()), model_, SLOT(errorQuit())); this->lstepStateChanged(model_->getDeviceState()); @@ -143,8 +143,8 @@ LStepExpressWidget::~LStepExpressWidget() if(buttonCalibrate_ ){ delete buttonCalibrate_ ; buttonCalibrate_ = nullptr; } if(buttonEmergencyStop_){ delete buttonEmergencyStop_; buttonEmergencyStop_ = nullptr; } if(buttonClearQueue_ ){ delete buttonClearQueue_ ; buttonClearQueue_ = nullptr; } - if(buttonErrorQuit_ ){ delete buttonErrorQuit_ ; buttonErrorQuit_ = nullptr; } if(buttonRestart_ ){ delete buttonRestart_ ; buttonRestart_ = nullptr; } + if(buttonErrorQuit_ ){ delete buttonErrorQuit_ ; buttonErrorQuit_ = nullptr; } NQLog("LStepExpressWidget", NQLog::Debug) << "destructed"; } @@ -166,8 +166,8 @@ void LStepExpressWidget::lstepStateChanged(State newState) buttonCalibrate_ ->setEnabled(newState == READY); buttonEmergencyStop_->setEnabled(newState == READY); buttonClearQueue_ ->setEnabled(newState == READY); - buttonErrorQuit_ ->setEnabled(newState == READY); buttonRestart_ ->setEnabled(newState == READY); + buttonErrorQuit_ ->setEnabled(newState == READY); axisControlWidget_ ->setEnabled(newState == READY); } @@ -190,8 +190,8 @@ void LStepExpressWidget::controlStateChanged(bool enabled) buttonCalibrate_ ->setEnabled(false); buttonEmergencyStop_->setEnabled(false); buttonClearQueue_ ->setEnabled(false); - buttonErrorQuit_ ->setEnabled(false); buttonRestart_ ->setEnabled(false); + buttonErrorQuit_ ->setEnabled(false); axisControlWidget_ ->setEnabled(false); } @@ -468,8 +468,6 @@ void LStepExpressWidget::lockMotionSettings(const bool disable) if(lstepCheckBox_ ){ lstepCheckBox_ ->setDisabled(disable); } if(joystickCheckBox_){ joystickCheckBox_->setDisabled(disable); } if(posCtrlCheckBox_ ){ posCtrlCheckBox_ ->setDisabled(disable); } - if(buttonErrorQuit_ ){ buttonErrorQuit_ ->setDisabled(disable); } - if(buttonRestart_ ){ buttonRestart_ ->setDisabled(disable); } if(axisWidget_X_){ axisWidget_X_->lockMotionSettings(disable); } if(axisWidget_Y_){ axisWidget_Y_->lockMotionSettings(disable); } @@ -484,27 +482,29 @@ void LStepExpressWidget::unlockMotionSettings() void LStepExpressWidget::enableMotionTools(const bool enable) { - if(buttonOrigin_ ){ buttonOrigin_ ->setEnabled(enable); } - if(buttonCalibrate_){ buttonCalibrate_->setEnabled(enable); } - if(motionSettings_locked_ == false) { if(lstepCheckBox_ ){ lstepCheckBox_ ->setEnabled(enable); } if(joystickCheckBox_){ joystickCheckBox_->setEnabled(enable); } if(posCtrlCheckBox_ ){ posCtrlCheckBox_ ->setEnabled(enable); } - if(buttonErrorQuit_ ){ buttonErrorQuit_ ->setEnabled(enable); } - if(buttonRestart_ ){ buttonRestart_ ->setEnabled(enable); } } + if(buttonOrigin_ ){ buttonOrigin_ ->setEnabled(enable); } + if(buttonCalibrate_ ){ buttonCalibrate_ ->setEnabled(enable); } + if(buttonEmergencyStop_){ buttonEmergencyStop_->setEnabled(enable); } + if(buttonClearQueue_ ){ buttonClearQueue_ ->setEnabled(enable); } + if(buttonRestart_ ){ buttonRestart_ ->setEnabled(enable); } + if(buttonErrorQuit_ ){ buttonErrorQuit_ ->setEnabled(enable); } + if(axisWidget_X_){ axisWidget_X_->enableMotionTools(enable); } if(axisWidget_Y_){ axisWidget_Y_->enableMotionTools(enable); } if(axisWidget_Z_){ axisWidget_Z_->enableMotionTools(enable); } if(axisWidget_A_){ axisWidget_A_->enableMotionTools(enable); } } -void LStepExpressWidget::disableMotionTools() +void LStepExpressWidget::disableMotionTools(const bool disable) { - this->enableMotionTools(false); + this->enableMotionTools(!disable); } // ============================================================================ diff --git a/assembly/assemblyCommon/LStepExpressWidget.h b/assembly/assemblyCommon/LStepExpressWidget.h index b65cb31ac..bca512a1f 100644 --- a/assembly/assemblyCommon/LStepExpressWidget.h +++ b/assembly/assemblyCommon/LStepExpressWidget.h @@ -50,8 +50,8 @@ class LStepExpressWidget : public QWidget QPushButton* buttonCalibrate_; QPushButton* buttonEmergencyStop_; QPushButton* buttonClearQueue_; - QPushButton* buttonErrorQuit_; QPushButton* buttonRestart_; + QPushButton* buttonErrorQuit_; LStepExpressAxisWidget* axisWidget_X_; LStepExpressAxisWidget* axisWidget_Y_; @@ -84,8 +84,8 @@ class LStepExpressWidget : public QWidget void lockMotionSettings(const bool disable=true); void unlockMotionSettings(); - void enableMotionTools(const bool enable=true); - void disableMotionTools(); + void enableMotionTools(const bool enable=true); + void disableMotionTools(const bool disable=true); signals: From 23a7ba242c104d9546b72b4bcfbca77b69bd195e Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 13:09:15 +0100 Subject: [PATCH 10/58] [assembly] updated assemblyCommon/LStepExpressMotionManager.cc --- assembly/assemblyCommon/LStepExpressMotionManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assemblyCommon/LStepExpressMotionManager.cc b/assembly/assemblyCommon/LStepExpressMotionManager.cc index 3487fa1c3..902a5345a 100644 --- a/assembly/assemblyCommon/LStepExpressMotionManager.cc +++ b/assembly/assemblyCommon/LStepExpressMotionManager.cc @@ -319,7 +319,7 @@ double LStepExpressMotionManager::get_position(const int axis) const { ++tries; - if(tries > 20) + if(tries > 10) { NQLog("LStepExpressMotionManager", NQLog::Warning) << "get_position(" << axis << ")" << ": after try #" << tries << ", call for LStepExpressMotionManager::emergency_stop()"; From 6199e0da7fa5eed85ba870fe93dfac24e7f0bd38 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 17:53:22 +0100 Subject: [PATCH 11/58] [assembly] updated AssemblyZFocusFinder (stop button) --- assembly/assembly/AssemblyMainWindow.cc | 3 +++ assembly/assemblyCommon/AssemblyImageView.cc | 4 ++- assembly/assemblyCommon/AssemblyImageView.h | 4 +++ assembly/assemblyCommon/AssemblyUtilities.cc | 16 ++++++++---- .../assemblyCommon/AssemblyZFocusFinder.cc | 25 ++++++++++++++++++- .../assemblyCommon/AssemblyZFocusFinder.h | 4 +++ 6 files changed, 49 insertions(+), 7 deletions(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index 418748981..cfc838b46 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -208,6 +208,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), this, SLOT(disconnect_objectAligner())); connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), motion_manager_, SLOT(emergency_stop())); + connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), zfocus_finder_ , SLOT(emergency_stop())); connect(motion_manager_->model(), SIGNAL(emergencyStop_request()), motion_manager_, SLOT(clear_motion_queue())); @@ -555,6 +556,8 @@ void AssemblyMainWindow::connect_images() connect(image_view_->autofocus_button(), SIGNAL(clicked()), image_ctr_, SLOT(acquire_autofocused_image())); + connect(image_view_->autofocus_emergencyStop_button(), SIGNAL(clicked()), zfocus_finder_, SLOT(emergencyStop())); + NQLog("AssemblyMainWindow", NQLog::Message) << "connect_images" << ": enabled images in application view(s)"; diff --git a/assembly/assemblyCommon/AssemblyImageView.cc b/assembly/assemblyCommon/AssemblyImageView.cc index e9ddf8537..c55942fec 100644 --- a/assembly/assemblyCommon/AssemblyImageView.cc +++ b/assembly/assemblyCommon/AssemblyImageView.cc @@ -39,6 +39,7 @@ AssemblyImageView::AssemblyImageView(QWidget* parent) : AF_scroll_(nullptr), AF_result_bestZ_lineed_(nullptr), AF_exe_button_(nullptr), + AF_stop_button_(nullptr), AF_param_maxDZ_lineed_(nullptr), AF_param_Nstep_lineed_(nullptr), AF_save_zscan_button_(nullptr) @@ -142,7 +143,8 @@ AssemblyImageView::AssemblyImageView(QWidget* parent) : AF_exe_button_ = new QPushButton("Auto-Focus Image", this); AF_lay->addWidget(AF_exe_button_); - connect(AF_exe_button_, SIGNAL(clicked()), this, SIGNAL(autofocus_request())); + AF_stop_button_ = new QPushButton("Stop Auto-Focus", this); + AF_lay->addWidget(AF_stop_button_); // ----- AF_lay->addSpacing(20); diff --git a/assembly/assemblyCommon/AssemblyImageView.h b/assembly/assemblyCommon/AssemblyImageView.h index 7bd6491ba..c7df347d1 100644 --- a/assembly/assemblyCommon/AssemblyImageView.h +++ b/assembly/assemblyCommon/AssemblyImageView.h @@ -40,6 +40,7 @@ class AssemblyImageView : public QWidget void disconnectImageProducer_autofocus(const QObject* sender, const char* signal); QPushButton* autofocus_button() const { return AF_exe_button_; } + QPushButton* autofocus_emergencyStop_button() const { return AF_stop_button_; } protected: @@ -66,6 +67,7 @@ class AssemblyImageView : public QWidget QLineEdit* AF_result_bestZ_lineed_; QPushButton* AF_exe_button_; + QPushButton* AF_stop_button_; QLineEdit* AF_param_maxDZ_lineed_; QLineEdit* AF_param_Nstep_lineed_; @@ -103,6 +105,8 @@ class AssemblyImageView : public QWidget void autofocus_config(const double, const int); void autofocus_request(); + + void autofocus_emergencyStop_request(); }; #endif // ASSEMBLYIMAGEVIEW_H diff --git a/assembly/assemblyCommon/AssemblyUtilities.cc b/assembly/assemblyCommon/AssemblyUtilities.cc index 9f3744ec5..67f2ca700 100644 --- a/assembly/assemblyCommon/AssemblyUtilities.cc +++ b/assembly/assemblyCommon/AssemblyUtilities.cc @@ -10,6 +10,7 @@ // // ///////////////////////////////////////////////////////////////////////////////// +#include #include #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) @@ -109,19 +110,24 @@ void assembly::cv_imwrite(const std::string& path_str, const cv::Mat& img) void assembly::cv_imwrite(const QString& path_qstr, const cv::Mat& img) { - cv::Mat img_1; + if(path_qstr.endsWith(".png", Qt::CaseInsensitive) == false) + { + NQLog("AssemblyUtilities", NQLog::Warning) << "cv_imwrite(" << path_qstr << ", cv::Mat)" + << ": target output path does not end with \".png\", file not saved to disk"; - if(path_qstr.endsWith(".png", Qt::CaseInsensitive) && (img.channels() > 1)) + return; + } + else if(img.channels() > 1) { + cv::Mat img_1; cv::cvtColor(img, img_1, CV_BGR2RGB); + cv::imwrite(path_qstr.toUtf8().constData(), img_1); } else { - img_1 = img.clone(); + cv::imwrite(path_qstr.toUtf8().constData(), img); } - cv::imwrite(path_qstr.toUtf8().constData(), img_1); - return; } diff --git a/assembly/assemblyCommon/AssemblyZFocusFinder.cc b/assembly/assemblyCommon/AssemblyZFocusFinder.cc index 5b8a0c176..dd29141f2 100644 --- a/assembly/assemblyCommon/AssemblyZFocusFinder.cc +++ b/assembly/assemblyCommon/AssemblyZFocusFinder.cc @@ -88,7 +88,7 @@ AssemblyZFocusFinder::AssemblyZFocusFinder(const QString& output_dir_prepath, co // -------------- // connection(s) - connect(this , SIGNAL(next_zpoint()), this, SLOT(test_focus())); + connect(this, SIGNAL(next_zpoint()), this, SLOT(test_focus())); // -------------- NQLog("AssemblyZFocusFinder", NQLog::Debug) << "constructed"; @@ -387,6 +387,29 @@ void AssemblyZFocusFinder::test_focus() return; } +void AssemblyZFocusFinder::emergencyStop() +{ + NQLog("AssemblyZFocusFinder", NQLog::Message) << "emergencyStop" + << ": will stop execution of AssemblyZFocusFinder"; + + this->disable_motion(); + + v_zrelm_vals_.clear(); + + v_focus_vals_.clear(); + + focus_completed_ = false; + + zrelm_index_ = -1; + + NQLog("AssemblyZFocusFinder", NQLog::Message) << "emergencyStop" + << ": emitting signal \"emergencyStopped\""; + + emit emergencyStopped(); +} + + + void AssemblyZFocusFinder::process_image(const cv::Mat& img) { NQLog("AssemblyZFocusFinder", NQLog::Spam) << "process_image"; diff --git a/assembly/assemblyCommon/AssemblyZFocusFinder.h b/assembly/assemblyCommon/AssemblyZFocusFinder.h index 36c16fcfc..b4899546e 100644 --- a/assembly/assemblyCommon/AssemblyZFocusFinder.h +++ b/assembly/assemblyCommon/AssemblyZFocusFinder.h @@ -86,6 +86,8 @@ class AssemblyZFocusFinder : public QObject void process_image(const cv::Mat&); + void emergencyStop(); + signals: void next_zpoint(); @@ -100,6 +102,8 @@ class AssemblyZFocusFinder : public QObject void show_zscan(const QString&); void text_update_request(const double); + + void emergencyStopped(); }; #endif // ASSEMBLYZFOCUSFINDER_H From f0a96193d7823bc039bf62360332a9f5565bda80 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 17:59:12 +0100 Subject: [PATCH 12/58] [share/assembly] added markedglass_marker1_drawing_588x588_TL.png --- ...> markedglass_marker1_drawing_588x588_BL.png} | Bin .../markedglass_marker1_drawing_588x588_TL.png | Bin 0 -> 6685 bytes 2 files changed, 0 insertions(+), 0 deletions(-) rename share/assembly/{markedglass_marker1_drawing_588x588.png => markedglass_marker1_drawing_588x588_BL.png} (100%) create mode 100644 share/assembly/markedglass_marker1_drawing_588x588_TL.png diff --git a/share/assembly/markedglass_marker1_drawing_588x588.png b/share/assembly/markedglass_marker1_drawing_588x588_BL.png similarity index 100% rename from share/assembly/markedglass_marker1_drawing_588x588.png rename to share/assembly/markedglass_marker1_drawing_588x588_BL.png diff --git a/share/assembly/markedglass_marker1_drawing_588x588_TL.png b/share/assembly/markedglass_marker1_drawing_588x588_TL.png new file mode 100644 index 0000000000000000000000000000000000000000..efd18e2953deebc9efbe725e164e851748154357 GIT binary patch literal 6685 zcmeHLcT`j9w*SD2G!Ywp90w7QCRH)uNE-n~AqvtJnV^(_2uP@-BSo5`Kt>^eObDnW zBE1Ae2q>sP01;^dQbI35I^2D@_m%nY-nHIaYu0^_wX!%T`ObItxA$-V_HXa-Gp7xB zw+U}U2=Si$N!Ju1PGjt|bu)ak_3}a`{M+bx;v{}6{P}Oa9EOlk^GV$w@i!93Is=}4 z^jfKzQui^q`$+GaMz8AuGu>YrVhRytL^SMdt-_pWc>zA^m}l7Z`!N-0z- z)o0}6AJhVb@TNvaMm%9*T}&N>p19bvI1oA~MMh}HO)m7^zQ4wWQXxB-q()*7eIg_W zJkHBg)sGV1m8Ktc=iYt;eG?Ot>pngPK0ZFzy}a}Y1i~|`0{NqwnhupAyi~#lr1_KL zY~znx#C95pdg%I(I!Huhn$fD~r}`YS=-=-AvcYHchtAJ=&S`0B`#-n0JG8xYoSLlU zuW2&T?lgJI5p214y8xYPfNvD{8x^P#_j5_~{(Qyb^A#Gy)^DtZsO{We8#mRU!_Rnq zo7MoyirN@f~DP--S zz~vtPpfGd00IvihLiv*9?=MZz=c3zk2sP9MTj8aN@*vg`qA!b@&|57+j7(k`C1hW1 zdBXHWDOXgz6vf2A_o^PVE#@_DC1dAFr<3X5K08m{l34z(Y>qy`c&O@ZSkDoh-iWVIaryK@ zV{Lh+Z^UkmRNht9*{$aCX?v@!pKFKjU{bc%$VbeC9@SHdQ4-o(ZpEy0vQ_|zC9OL1 z^}cOuEq< z?$I4Er|Nh}Pj?i;Fol^cL`XbK+J;mjL$;-3k;3A$_sF%&ENMMn39Vy+utN=tmTZfy z`8A~I2cO<>sp^}XxF16@u^-e94G-V({BT5SoIcmZG(#!RRdp4`e81kyc4~aQSM@5M zB^{UJJ2OC5a?n3?;pOjOaE6tagt6cO<1j|V9s?^YD_D`|)>*8vIF!~0@0JDM4V&6@ zSE>N+=NSrt`{H-Fy1II_+W6=}AX(DrOv3O{a@oolvBp4a`W{nx`1RMf_Z_-QeW?U= z+~!HU{o*@HL%Bln&q8Fsc6dN>$A zQhP7*jq?>>Mv1bqoSd8zvFliN?tNGxpx$}?eu5ne7CYlpalKJ*4?~)kXiCzz(FAKB z_40;uq?{ifjSSmdosRQ{pfJsZ_07%AjT1GLRu}4n)}KAEP9SToE!0O)g+-2Dcd`zc zZNZ-HZ(#_fd-PQ^a_Y52*0E3RacO%gdBB*weI53jkc_iCizC3}tz<$NHSlG-TM6UY zg`D1}b}Ls|(l5*`t*jiTzrJnvAN^&E_`%!|8P8{vf%sLPrZ9p1ml$_;Wdq#fD9jhD zvspomeW9W|MAY35;Wl}Hx@RCR6mx9)jhcjrqW$qyRs3%bx98HP=M=?!Iy^3ACXazd zw(Z+cmrnmJ)=h5tgSb>_YyT+*RSF$aBT1)Sj^;(-k2F*ON*JojDoDmww+wtBCz;`n8W22yqmI;_xi{hX5xQ*Qx$r1y3Ku zaUhw@mlfBCQbVg(mnQ5;`es7vZr0$*Y&H+dNUYu5^g!Co(8S5GDgBfzwwm^`Ld9#i znJM@%)}AwX?3@~zPkVV1ZkZKZB&T79470>h>P`AN6CWi zd3kvZir@GJ(q{GrVBtkohw8}i#xw&zn}P$a2@Z}`VFD%gT(eFPg9+V3ajI?|g%%~= zt}LMjsemKr)!}&D@n^i?vXtw{M0zZNywU7Jnn8>_j$_fKE?$l*bw)~5wp1dHCmr|g zQyLt70N0-(MFW?4OK7qibhrBrB%nsd>%CP_f-QAv|rVc572L5;1@h z*U+-i)mDj`S|-&7vq&$>FgqbeAw=grh>m(MGG>1k}OVeGLh?NmDEJN>n{;I)77rsw@JNpe%90c{CuWhh66kk1Wdl#Apd(# zj@b)S^Ub`%coL`A>+IJ{XW!c23A-_zNyC5`*v(<@7ss0pW%U_^Hy4tQDTq?8$%q&m zCCJMG>TuI<_G4Mok5?m8fVck}R*xP%+6yHT$Sw1kO^F)CfBG$!MA*Xu0(0F#L2x?9 zsowRZlZ2$(EoX@*oiJPIoCq|>ux(1cbp?LT23BS&KRf}Xb8Pa}28>v+)gT~}WcGl7*$) zvkK~#%W7^NduImTM-+Ju#siPI74^s8fZ}UZADr~^T7Rv^Y_nN`FW*EJ_(kcv?@2~6 zZ$=>!Q}2}PtHw(vY)OWdphk=^E~EslE?{NlrA*LC`R^~aJUQpl?phE>X}lY_+$Rws ziGFGZG7Jmbz<*2;9CHbSAx(vckbqK%!@WFax>ee%Q!(@7KIK*9~*do{gXu3x{dyIxhih#;Gk9BUs~&`Dlck@5BN43X{)vU@XKXSaHdCB)lfWVaY= z!5OUe#CzT&3FRF$BSNv0LQ_OiQivQ}sN2XtJb#YRz2SJZ#9VrnQYrh2lc z5>{w}>av7NBL`+0LP;(@Yo7463k!WAXc43O45LwV3w3f!WSSJ||w_ryTu_2lqGDJ&H)Mfw#G5m9yWC5L{lr-=ED7ZE@{17n`* zxZZRM%Na(5LYW1L52?siu+{b(L`SlkXf>ETr6qY=-mCMnv9ZDMJm0SnB!scZ@}Txw zTfYbjcI8UU>`xyU8TR%mk+jm3(Q8@P{q^sQ8U9zgXlto$Ux(Td@^~R!d)T z_DATgB0(NUYxIVZ)m$x&la8wL0n0c!JGb}PjdZUqnB*#0?FJu40Nu{dB(I5ziHWVe z5JnlhD%e`N`T5m>OJjSmvU)a6pOJAk?b6pb_Zpj;1OZ)*ot! z)rMa2?SMWtJl(g)5Ctbm{xw>-KXsB_mB0m?1ko$MBVU3yTsp4Hju+<)Xk;=?Nt^=f zy@eoJw80uvVU>eg>{Nb6OdxxIh3?AGm{-OLIr_o`o=BWfTeBXipDkU;rci9AXBHQW zWLzeTh6BeVl|O`W2_C3=v{BGYN0H;q9lyVz3;s&&^`Bz%Z*JICr}2)WDG=Xfvt&&l zH`YmXoR>!)mvRqFHXs_P$EaDG@UJ5#GX$!A;rp3WkJNTqa-!x~`zNW<(b04Mu%A=~ zUPoeO$e_S?HQdDial;Oj62Dnjm&g*JMu{Fd%y)DsMQpW&XWVJE3ksl>`+Rxzi<0}7k^%yeNQ7aL zh~}(w`Q&SEO-*i;Auy-d@&*&fpv9spZmqSa;BYu4Xc#Q=T`p8OMpfdB(SzPt>nIQp zRZ!Ck-q$=YUnOO4M7+lpTN>&V%1htRK>xS4LS6G|s)0m+3XBBSKF(MX>3Ls-QOfzhyR~5toz8a-)w=)Z zq5neDtp7{t_CGL3%nWfW>wEP8A#W`AyK(LwJO+ zkqsnRwCXU7wYEbi(VaSR1^;(&ZZ}>dK<}mmEhJMpUl}&AD0IKb5{mndj1Dp+kNhJM zFm{q5kw}kAO8jVL>ly3Rkm9qlEJ7?5fQ*Ec&9W}KMl0h-8DdzEsOZkc|zLAq7ytvf8CJwV( z(#V2bL5Hb3FFGT;;rqu0?5#r)UADkuj)gyLL3g)3W=P=zO z;qT7kLMqu6c1xdIdtY-aME+q_P}a96H#e8P6!zn-&9h7OVPShUUaS$@gkg+Vz7}aS s>-l7QDQ~XJuZBNpzA~_z6HN>Rp)Ay(>_V-DnHxeU^-k+PKVg6KZ-5`BuK)l5 literal 0 HcmV?d00001 From 220d47c02c23406d0dd0e10aaa276bd6cef46e2c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 17:59:27 +0100 Subject: [PATCH 13/58] [assembly] bugfix in assembly/AssemblyMainWindow.cc --- assembly/assembly/AssemblyMainWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index cfc838b46..45f7e8093 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -208,7 +208,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), this, SLOT(disconnect_objectAligner())); connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), motion_manager_, SLOT(emergency_stop())); - connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), zfocus_finder_ , SLOT(emergency_stop())); + connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), zfocus_finder_ , SLOT(emergencyStop())); connect(motion_manager_->model(), SIGNAL(emergencyStop_request()), motion_manager_, SLOT(clear_motion_queue())); From f8e1c300ee4f4860fbb6b7449e93325a06b84e27 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 18:21:16 +0100 Subject: [PATCH 14/58] [assembly] updated assembly.cfg --- assembly/assembly.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index 4c617f58a..bcbf82a12 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -54,19 +54,19 @@ AssemblyMultiPickupTester_pickup_deltaZ 20.0 AssemblyMultiPickupTester_useBaseplateVacuum 1 # AssemblyObjectAlignerView -AssemblyObjectAlignerView_PSS_deltaX 94.30 # marked-glass top -AssemblyObjectAlignerView_PSS_deltaY -48.70 # marked-glass top +AssemblyObjectAlignerView_PSS_deltaX 95.30 # marked-glass top +AssemblyObjectAlignerView_PSS_deltaY 0.00 # marked-glass top -AssemblyObjectAlignerView_PSP_deltaX 96.80 # marked-glass bottom -AssemblyObjectAlignerView_PSP_deltaY -48.70 # marked-glass bottom +AssemblyObjectAlignerView_PSP_deltaX 97.50 # marked-glass bottom +AssemblyObjectAlignerView_PSP_deltaY 0.00 # marked-glass bottom -AssemblyObjectAlignerView_target_angle_deg -26.71165 # marked-glass bottom +AssemblyObjectAlignerView_target_angle_deg 0.00 # marked-glass bottom AssemblyObjectAlignerView_angle_max_dontIter 0.50 # maximum angular difference (required-measured) allowed for single-rotation correction, otherwise iterative procedure for alignment is used AssemblyObjectAlignerView_angle_max_complete 0.01 # maximum angular difference (required-measured) allowed to declare alignment procedure completed # AssemblyObjectFinderPatRecView -AssemblyObjectFinderPatRecView_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png +AssemblyObjectFinderPatRecView_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png AssemblyObjectFinderPatRecView_threshold 100 AssemblyObjectFinderPatRecView_adaptiveThreshold 587 AssemblyObjectFinderPatRecView_angles_prescan 0 @@ -76,14 +76,14 @@ AssemblyObjectFinderPatRecView_angles_finestep 0.2 # AssemblyObjectAligner # AssemblyObjectAlignerView -AssemblyObjectAlignerView_PatRec1_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png +AssemblyObjectAlignerView_PatRec1_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png AssemblyObjectAlignerView_PatRec1_threshold 100 AssemblyObjectAlignerView_PatRec1_adaptiveThreshold 587 AssemblyObjectAlignerView_PatRec1_angles_prescan 0 AssemblyObjectAlignerView_PatRec1_angles_finemax 2 AssemblyObjectAlignerView_PatRec1_angles_finestep 0.2 -AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png +AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588_TL.png AssemblyObjectAlignerView_PatRec2_threshold 100 AssemblyObjectAlignerView_PatRec2_adaptiveThreshold 587 AssemblyObjectAlignerView_PatRec2_angles_prescan 180 From 36213b77b95c587d56eaa7d68557a59aec51786f Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 19:18:08 +0100 Subject: [PATCH 15/58] [assembly] updated assemblyCommon/AssemblyAssembly.cc --- assembly/assembly.cfg | 4 +- .../assembly_parameters_DAF_190116.cfg | 24 +-- assembly/assemblyCommon/AssemblyAssembly.cc | 146 +++++++++--------- assembly/assemblyCommon/AssemblyAssembly.h | 4 +- .../assemblyCommon/AssemblyAssemblyView.cc | 15 +- .../assemblyCommon/AssemblyParametersView.cc | 20 +-- 6 files changed, 101 insertions(+), 112 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index bcbf82a12..dd33fc06b 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -94,5 +94,5 @@ AssemblyObjectAlignerView_PatRec2_angles_finestep 0.2 AssemblySmartMotionManager_steps_dZ 0.2,0.2,0.2,0.1,0.1 # AssemblyAssembly -AssemblyAssembly_pickup1_dZ 80.0 -AssemblyAssembly_pickup2_dZ 200.0 +AssemblyAssembly_pickup1_Z 130.0 +AssemblyAssembly_pickup2_Z 130.0 diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index 1e0aae775..82fb926db 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -3,19 +3,17 @@ # Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point # Baseplate Ref-Point = edge [...] -# CameraFocusToPickup_dZ -31.85 - #################################### ### DIMENSIONS ##################### #################################### # dimensions: thickness of assembly components Thickness_VacuumCups 0.000 -Thickness_Baseplate 0.665 +Thickness_Baseplate 0.000 Thickness_PSS 0.700 -Thickness_PSP 0.780 -Thickness_Spacer 3.105 -Height_SpacerSlots 1.450 +Thickness_PSP 0.700 +Thickness_Spacer 1.600 +Height_SpacerSlots 0.000 Thickness_GlueLayer 0.025 #################################### @@ -41,12 +39,12 @@ RefPointBaseplate_Z -62.7678 RefPointBaseplate_A -0.056 # [DUMMY] position: Z-position (height) to put pickup tool in contact with rotation stage -PickupToolOnRotStage_Z -60.99 +PickupToolOnRotStage_Z 0.00 # position: XYZ-position with pickup tool in contact with glue-dispensing platform -PickupToolOnGluingStage_X 0.000 -PickupToolOnGluingStage_Y 0.000 -PickupToolOnGluingStage_Z 0.000 +PickupToolOnGluingStage_X 0.00 +PickupToolOnGluingStage_Y 0.00 +PickupToolOnGluingStage_Z 0.00 #################################### ### DISTANCES ###################### @@ -71,5 +69,7 @@ FromSpacerRefPointToSensorRefPoint_dY -0.15 FromBaseplateRefPointToPSPRefPoint_dX 1.60 FromBaseplateRefPointToPSPRefPoint_dY -10.65 -# # distance: from best-focus z-position to pickup z-position -# FromCameraBestFocusToPickupHeight_dZ -0.00 +# distance: dZ distance to go from Z position where camera provides best-focus on object, +# to Z position where free pickup-tool (i.e. with no other objects attached) touches the object +# - empirical value calibrated with multi-pickup tests +FromCameraBestFocusToPickupHeight_dZ -31.70 # -31.85 diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index f009fe0ee..e50010f20 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -31,8 +31,8 @@ AssemblyAssembly::AssemblyAssembly(const LStepExpressMotionManager* const motion , vacuum_spacer_(0) , vacuum_basepl_(0) - , pickup1_dZ_(0.) - , pickup2_dZ_(0.) + , pickup1_Z_(0.) + , pickup2_Z_(0.) , use_smartMove_(false) { @@ -54,26 +54,10 @@ AssemblyAssembly::AssemblyAssembly(const LStepExpressMotionManager* const motion vacuum_spacer_ = config->getValue("Vacuum_Spacers"); vacuum_basepl_ = config->getValue("Vacuum_Baseplate"); - // positive double(s) for vertical upward movement(s) for pickup - pickup1_dZ_ = config->getValue("AssemblyAssembly_pickup1_dZ"); - - if(pickup1_dZ_ <= 0.) - { - NQLog("AssemblyAssembly", NQLog::Fatal) - << "invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << pickup1_dZ_ << "), closing application"; - - assembly::kill_application(tr("[AssemblyAssembly]"), "Invalid (non-positive) value for vertical upward movement for pickup #1 (dZ="+QString::number(pickup1_dZ_)+"), closing application"); - } - - pickup2_dZ_ = config->getValue("AssemblyAssembly_pickup2_dZ"); - - if(pickup2_dZ_ <= 0.) - { - NQLog("AssemblyAssembly", NQLog::Fatal) - << "invalid (non-positive) value for vertical upward movement for pickup #2 (dZ=" << pickup2_dZ_ << "), closing application"; - - assembly::kill_application(tr("[AssemblyAssembly]"), "Invalid (non-positive) value for vertical upward movement for pickup #2 (dZ="+QString::number(pickup2_dZ_)+"), closing application"); - } + // absolute Z-position of motion stage for pickup of object after gluing + // (1: PSs to Spacers, 2: PSs+Spacers to PSp) + pickup1_Z_ = config->getValue("AssemblyAssembly_pickup1_Z"); + pickup2_Z_ = config->getValue("AssemblyAssembly_pickup2_Z"); } const LStepExpressMotionManager* AssemblyAssembly::motion() const @@ -162,7 +146,7 @@ void AssemblyAssembly::GoToSensorMarkerPreAlignment_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoToSensorMarkerPreAlignment_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoToSensorMarkerPreAlignment_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -416,7 +400,7 @@ void AssemblyAssembly::GoFromSensorMarkerToPickupXY_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoFromSensorMarkerToPickupXY_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromSensorMarkerToPickupXY_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -460,7 +444,7 @@ void AssemblyAssembly::LowerPickupToolOntoPSS_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "LowerPickupToolOntoPSS_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPickupToolOntoPSS_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -470,12 +454,7 @@ void AssemblyAssembly::LowerPickupToolOntoPSS_start() const double dy0 = 0.0; const double da0 = 0.0; - const double dz0 = - - motion_->get_position_Z() - + this->parameters()->get("Thickness_PSS") - + this->parameters()->get("Thickness_VacuumCups") - + this->parameters()->get("PickupToolOnRotStage_Z") - ; + const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ"); if(use_smartMove_) { @@ -521,20 +500,28 @@ void AssemblyAssembly::PickupPSS_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "PickupPSS_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSS_start" << ": failed to update content of AssemblyParameters, no action taken"; return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupPSS_finish())); - const double dx0 = 0.0; const double dy0 = 0.0; - const double dz0 = pickup1_dZ_; + const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); const double da0 = 0.0; + if(dz0 <= 0.) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSS_start" + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + + return; + } + + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupPSS_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSS_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -565,7 +552,7 @@ void AssemblyAssembly::GoToSpacerRefPoint_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoToSpacerRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoToSpacerRefPoint_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -609,7 +596,7 @@ void AssemblyAssembly::GoFromSpacerRefPointToSpacerGluingXYPosition_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -653,7 +640,7 @@ void AssemblyAssembly::LowerPSSOntoSpacers_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "LowerPSSOntoSpacers_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPSSOntoSpacers_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -664,12 +651,9 @@ void AssemblyAssembly::LowerPSSOntoSpacers_start() const double da0 = 0.0; const double dz0 = - - motion_->get_position_Z() - + this->parameters()->get("Thickness_VacuumCups") + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_Spacer") - this->parameters()->get("Height_SpacerSlots") - + this->parameters()->get("PickupToolOnRotStage_Z") ; if(use_smartMove_) @@ -716,7 +700,7 @@ void AssemblyAssembly::ApplyPSPToPSSXYOffset_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "ApplyPSPToPSSXYOffset_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "ApplyPSPToPSSXYOffset_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -760,7 +744,7 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "LowerSpacersAndPSSOntoPSP_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoPSP_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -771,15 +755,11 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() const double da0 = 0.0; const double dz0 = - - motion_->get_position_Z() - + this->parameters()->get("Thickness_VacuumCups") + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") + this->parameters()->get("Thickness_Spacer") + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_PSP") - + this->parameters()->get("Thickness_VacuumCups") - + this->parameters()->get("PickupToolOnRotStage_Z") ; if(use_smartMove_) @@ -826,20 +806,28 @@ void AssemblyAssembly::PickupSpacersAndPSS_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "PickupSpacersAndPSS_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupSpacersAndPSS_start" << ": failed to update content of AssemblyParameters, no action taken"; return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupSpacersAndPSS_finish())); - const double dx0 = 0.0; const double dy0 = 0.0; - const double dz0 = pickup1_dZ_; + const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); const double da0 = 0.0; + if(dz0 <= 0.) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupSpacersAndPSS_start" + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + + return; + } + + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupSpacersAndPSS_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupSpacersAndPSS_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -870,20 +858,28 @@ void AssemblyAssembly::LiftUpPickupTool_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "LiftUpPickupTool_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "LiftUpPickupTool_start" << ": failed to update content of AssemblyParameters, no action taken"; return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LiftUpPickupTool_finish())); - const double dx0 = 0.0; const double dy0 = 0.0; - const double dz0 = pickup2_dZ_; + const double dz0 = (pickup2_Z_ - motion_->get_position_Z()); const double da0 = 0.0; + if(dz0 <= 0.) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LiftUpPickupTool_start" + << ": invalid (non-positive) value for vertical upward movement for pickup #2 (dZ=" << dz0 << "), no action taken"; + + return; + } + + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(LiftUpPickupTool_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "LiftUpPickupTool_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -914,20 +910,28 @@ void AssemblyAssembly::PickupPSPAndPSS_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "PickupPSPAndPSS_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSPAndPSS_start" << ": failed to update content of AssemblyParameters, no action taken"; return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupPSPAndPSS_finish())); - const double dx0 = 0.0; const double dy0 = 0.0; - const double dz0 = pickup1_dZ_; + const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); const double da0 = 0.0; + if(dz0 <= 0.) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSPAndPSS_start" + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + + return; + } + + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(PickupPSPAndPSS_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSPAndPSS_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -958,7 +962,7 @@ void AssemblyAssembly::GoToBaseplateRefPoint_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoToBaseplateRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoToBaseplateRefPoint_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -1002,7 +1006,7 @@ void AssemblyAssembly::GoFromBaseplateRefPointToBaseplateGluingXYPosition_start( if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -1046,7 +1050,7 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Fatal) << "LowerSensorAssemblyOntoBaseplate_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSensorAssemblyOntoBaseplate_start" << ": failed to update content of AssemblyParameters, no action taken"; return; @@ -1057,17 +1061,13 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() const double da0 = 0.0; const double dz0 = - - motion_->get_position_Z() - + this->parameters()->get("Thickness_VacuumCups") + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") + this->parameters()->get("Thickness_Spacer") + this->parameters()->get("Thickness_GlueLayer") + this->parameters()->get("Thickness_PSP") + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_Baseplate") - + this->parameters()->get("Thickness_VacuumCups") - + this->parameters()->get("PickupToolOnRotStage_Z") ; if(use_smartMove_) diff --git a/assembly/assemblyCommon/AssemblyAssembly.h b/assembly/assemblyCommon/AssemblyAssembly.h index 533fbfbbb..1b06fa44a 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.h +++ b/assembly/assemblyCommon/AssemblyAssembly.h @@ -49,8 +49,8 @@ class AssemblyAssembly : public QObject int vacuum_spacer_; int vacuum_basepl_; - double pickup1_dZ_; - double pickup2_dZ_; + double pickup1_Z_; + double pickup2_Z_; bool use_smartMove_; diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index ba39dca8d..4d1f6dbe9 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -208,13 +208,13 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl QVBoxLayout* PSSToSpacers_lay = new QVBoxLayout; wid_PSSToSpacers_->setLayout(PSSToSpacers_lay); - // step: Place Spacers on Assembly Platform + // step: Dispense Glue on Spacers { ++assembly_step_N_; AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Place Spacers on Assembly Platform"); + tmp_wid->text() ->setText("Dispense Glue on Spacers and Place them on Assembly Platform"); PSSToSpacers_lay->addWidget(tmp_wid); } // ---------- @@ -258,17 +258,6 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Dispense Fast-Curing Glue on Spacers - { - ++assembly_step_N_; - - AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; - tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Dispense Fast-Curing Glue on Spacers"); - PSSToSpacers_lay->addWidget(tmp_wid); - } - // ---------- - // step: Lower PSS onto Spacers { ++assembly_step_N_; diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index ee51b31d3..f4f9dd1c8 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -311,16 +311,16 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dY")) , 4, 3, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dY"), 4, 4, Qt::AlignRight); -// // distance: from best-focus z-position to pickup z-position -// tmp_tag = "FromCameraBestFocusToPickupHeight"; -// tmp_des = "From Best-Focus Height to Pickup Height :"; -// -// map_lineEdit_[tmp_tag+"_dZ"] = new QLineEdit(tr("")); -// -// dist_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); -// -// dist_lay->addWidget(new QLabel(tr("dZ")) , 5, 5, Qt::AlignRight); -// dist_lay->addWidget(this->get(tmp_tag+"_dZ"), 5, 6, Qt::AlignRight); + // distance: from best-focus z-position to pickup z-position + tmp_tag = "FromCameraBestFocusToPickupHeight"; + tmp_des = "From Best-Focus Height to Pickup Height :"; + + map_lineEdit_[tmp_tag+"_dZ"] = new QLineEdit(tr("")); + + dist_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); + + dist_lay->addWidget(new QLabel(tr("dZ")) , 5, 5, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dZ"), 5, 6, Qt::AlignRight); //// --------------------- From f93a27525f2ca802e8ffba6b0057579b4ed5f40d Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 19:20:46 +0100 Subject: [PATCH 16/58] [assembly] updated labels in assemblyCommon/AssemblyAssemblyView.cc --- .../assemblyCommon/AssemblyAssemblyView.cc | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 4d1f6dbe9..7a2e30609 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -277,7 +277,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 10 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); PSSToSpacers_lay->addWidget(tmp_wid); } // ---------- @@ -440,7 +440,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 10 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); PSSToPSP_lay->addWidget(tmp_wid); } // ---------- @@ -482,13 +482,13 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl QVBoxLayout* PSToBasep_lay = new QVBoxLayout; wid_PSToBasep_->setLayout(PSToBasep_lay); - // step: Place Baseplate on Assembly Platform + // step: Dispense Glue on Baseplate and Place it on Assembly Platform { ++assembly_step_N_; AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Place Baseplate on Assembly Platform"); + tmp_wid->text() ->setText("Dispense Glue on Baseplate and Place it on Assembly Platform"); PSToBasep_lay->addWidget(tmp_wid); } // ---------- @@ -519,17 +519,6 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Dispense Fast-Curing Glue on Baseplate - { - ++assembly_step_N_; - - AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; - tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Dispense Fast-Curing Glue on Baseplate"); - PSToBasep_lay->addWidget(tmp_wid); - } - // ---------- - // step: Go To XY Position To Glue Sensor Assembly To Baseplate { ++assembly_step_N_; @@ -562,7 +551,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 10 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); PSToBasep_lay->addWidget(tmp_wid); } // ---------- From 4433df53199b7a98be7dfe93466648f52ae7fbe5 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 19:32:09 +0100 Subject: [PATCH 17/58] [assembly] updated assembly.cfg --- assembly/assembly.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index dd33fc06b..f9f05da41 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -67,31 +67,31 @@ AssemblyObjectAlignerView_angle_max_complete 0.01 # maximum angular differenc # AssemblyObjectFinderPatRecView AssemblyObjectFinderPatRecView_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png -AssemblyObjectFinderPatRecView_threshold 100 +AssemblyObjectFinderPatRecView_threshold 30 AssemblyObjectFinderPatRecView_adaptiveThreshold 587 AssemblyObjectFinderPatRecView_angles_prescan 0 AssemblyObjectFinderPatRecView_angles_finemax 2 -AssemblyObjectFinderPatRecView_angles_finestep 0.2 +AssemblyObjectFinderPatRecView_angles_finestep 0.15 # AssemblyObjectAligner # AssemblyObjectAlignerView AssemblyObjectAlignerView_PatRec1_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png -AssemblyObjectAlignerView_PatRec1_threshold 100 +AssemblyObjectAlignerView_PatRec1_threshold 30 AssemblyObjectAlignerView_PatRec1_adaptiveThreshold 587 AssemblyObjectAlignerView_PatRec1_angles_prescan 0 AssemblyObjectAlignerView_PatRec1_angles_finemax 2 -AssemblyObjectAlignerView_PatRec1_angles_finestep 0.2 +AssemblyObjectAlignerView_PatRec1_angles_finestep 0.15 AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588_TL.png -AssemblyObjectAlignerView_PatRec2_threshold 100 +AssemblyObjectAlignerView_PatRec2_threshold 30 AssemblyObjectAlignerView_PatRec2_adaptiveThreshold 587 AssemblyObjectAlignerView_PatRec2_angles_prescan 180 AssemblyObjectAlignerView_PatRec2_angles_finemax 2 -AssemblyObjectAlignerView_PatRec2_angles_finestep 0.2 +AssemblyObjectAlignerView_PatRec2_angles_finestep 0.15 # AssemblySmartMotionManager -AssemblySmartMotionManager_steps_dZ 0.2,0.2,0.2,0.1,0.1 +AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1 # AssemblyAssembly AssemblyAssembly_pickup1_Z 130.0 From 3054adb4969b2357efda1861a486c7be9380b993 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 19:32:40 +0100 Subject: [PATCH 18/58] [assembly] bugfix in assembly/assembly_parameters_DAF_190116.cfg --- assembly/assembly/assembly_parameters_DAF_190116.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index 82fb926db..54cfcdb55 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -72,4 +72,4 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 # distance: dZ distance to go from Z position where camera provides best-focus on object, # to Z position where free pickup-tool (i.e. with no other objects attached) touches the object # - empirical value calibrated with multi-pickup tests -FromCameraBestFocusToPickupHeight_dZ -31.70 # -31.85 +FromCameraBestFocusToPickupHeight_dZ -31.70 From 902ed4b1fcb4a87f3175302cd940dcd2f7116572 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 11 Mar 2019 19:34:16 +0100 Subject: [PATCH 19/58] [assembly] updated assemblyCommon/AssemblyAssemblyView.cc (default: smartMove enabled) --- assembly/assemblyCommon/AssemblyAssemblyView.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 7a2e30609..000b655d9 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -48,11 +48,12 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl layout->addLayout(opts_lay); smartMove_checkbox_ = new QCheckBox(tr("Use SmartMove")); - smartMove_checkbox_->setChecked(false); opts_lay->addWidget(smartMove_checkbox_); connect(smartMove_checkbox_, SIGNAL(stateChanged(int)), assembly, SLOT(use_smartMove(int))); + + smartMove_checkbox_->setChecked(true); //// ------------------------------------------------- QToolBox* toolbox = new QToolBox; From 6fe9898a5a3d52846b526c650b24f8e47493b138 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 09:23:03 +0100 Subject: [PATCH 20/58] [assembly] bugfix in assembly/make_anew.sh --- assembly/assembly/make_anew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/make_anew.sh b/assembly/assembly/make_anew.sh index 1d3283ac3..2c6308121 100755 --- a/assembly/assembly/make_anew.sh +++ b/assembly/assembly/make_anew.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ -d ${TKMODLABBASE} ]; then +if [ ! -z ${TKMODLABBASE} ] && [ -d ${TKMODLABBASE} ]; then cd ${TKMODLABBASE} From 715903c90e0fae123b9cb86323d5338327af745d Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 10:52:53 +0100 Subject: [PATCH 21/58] [assembly] bugfix in AssemblySmartMotionManager --- assembly/assemblyCommon/AssemblySmartMotionManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/assemblyCommon/AssemblySmartMotionManager.cc b/assembly/assemblyCommon/AssemblySmartMotionManager.cc index 471c9ead4..4555437be 100644 --- a/assembly/assemblyCommon/AssemblySmartMotionManager.cc +++ b/assembly/assemblyCommon/AssemblySmartMotionManager.cc @@ -142,7 +142,7 @@ void AssemblySmartMotionManager::move_relative(const double dx0, const double dy { if(smartMove_steps_dZ_.size() == 0) { - NQLog("AssemblySmartMotionManager", NQLog::Fatal) << "move_relative" + NQLog("AssemblySmartMotionManager", NQLog::Critical) << "move_relative" << ": smartMove mode enabled, but empty list of dZ steps, no action taken"; motions_.clear(); @@ -240,7 +240,7 @@ QQueue AssemblySmartMotionManager::smartMotions_relative(con smart_motions_N = 0; - const bool move_xya = ((dx != 0.) && (dy != 0.) && (dz != 0.)); + const bool move_xya = ((dx != 0.) || (dy != 0.) || (da != 0.)); if(dz > 0.) { From 8ee2a3b5aa73f7f5443b0dd23f5f56be85624b17 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 12:29:43 +0100 Subject: [PATCH 22/58] [assembly] updates and fixes in AssemblyAssembly --- .../assembly_parameters_DAF_190116.cfg | 41 +- assembly/assemblyCommon/AssemblyAssembly.cc | 414 ++++++++++++++---- assembly/assemblyCommon/AssemblyAssembly.h | 30 +- .../assemblyCommon/AssemblyAssemblyView.cc | 46 +- .../assemblyCommon/AssemblyParametersView.cc | 32 +- 5 files changed, 456 insertions(+), 107 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index 54cfcdb55..dca84d894 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -21,30 +21,33 @@ Thickness_GlueLayer 0.025 #################################### # position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) -RefPointSensor_X -70.0283 -RefPointSensor_Y -78.4945 -RefPointSensor_Z -62.7329 -RefPointSensor_A -0.307 +RefPointSensor_X -70.0283 +RefPointSensor_Y -78.4945 +RefPointSensor_Z -62.7329 +RefPointSensor_A -0.307 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -62.428 -RefPointSpacer_Y -79.629 -RefPointSpacer_Z -63.248 -RefPointSpacer_A -90.182 +RefPointSpacer_X -62.428 +RefPointSpacer_Y -79.629 +RefPointSpacer_Z -63.248 +RefPointSpacer_A -90.182 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) -RefPointBaseplate_X -64.4778 -RefPointBaseplate_Y -68.330 -RefPointBaseplate_Z -62.7678 -RefPointBaseplate_A -0.056 +RefPointBaseplate_X -64.4778 +RefPointBaseplate_Y -68.330 +RefPointBaseplate_Z -62.7678 +RefPointBaseplate_A -0.056 # [DUMMY] position: Z-position (height) to put pickup tool in contact with rotation stage -PickupToolOnRotStage_Z 0.00 +PickupToolOnRotStage_Z 0.00 # position: XYZ-position with pickup tool in contact with glue-dispensing platform -PickupToolOnGluingStage_X 0.00 -PickupToolOnGluingStage_Y 0.00 -PickupToolOnGluingStage_Z 0.00 +PickupToolOnGluingStage_X 0.00 +PickupToolOnGluingStage_Y 0.00 +PickupToolOnGluingStage_Z 0.00 + +# position: z-position where camera is focused on Gluing Stage surface +CamerFocusOnGluingStage_Z -50.0 #################################### ### DISTANCES ###################### @@ -63,7 +66,7 @@ FromPSPRefPointToPSSRefPoint_dY 0.00 # distance: from Spacer Ref-Point to Sensor Ref-Point FromSpacerRefPointToSensorRefPoint_dX 0.85 -FromSpacerRefPointToSensorRefPoint_dY -0.15 +FromSpacerRefPointToSensorRefPoint_dY 0.75 # distance: from Baseplate Ref-Point to PS-p Ref-Point FromBaseplateRefPointToPSPRefPoint_dX 1.60 @@ -73,3 +76,7 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 # to Z position where free pickup-tool (i.e. with no other objects attached) touches the object # - empirical value calibrated with multi-pickup tests FromCameraBestFocusToPickupHeight_dZ -31.70 + +# distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' +FromPSPToPSSPosToGluingStage_dX -130.0 +FromPSPToPSSPosToGluingStage_dY 0.0 diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index e50010f20..ec49ae6ea 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -18,7 +18,7 @@ #include -#include +#include AssemblyAssembly::AssemblyAssembly(const LStepExpressMotionManager* const motion, const ConradManager* const vacuum, const AssemblySmartMotionManager* const smart_motion, QObject* parent) : QObject(parent) @@ -35,6 +35,11 @@ AssemblyAssembly::AssemblyAssembly(const LStepExpressMotionManager* const motion , pickup2_Z_(0.) , use_smartMove_(false) + + , PSPToPSSPosition_X_(0.) + , PSPToPSSPosition_Y_(0.) + , PSPToPSSPosition_Z_(0.) + , PSPToPSSPosition_A_(0.) { // validate pointers to controllers this->motion(); @@ -108,14 +113,14 @@ void AssemblyAssembly::use_smartMove(const int state) if(smart_motion_ == nullptr) { NQLog("AssemblyAssembly", NQLog::Warning) << "use_smartMove(" << state << ")" - << ": attemptin to enable smartMove option, but pointer to AssemblySmartMotionManager is invalid (NULL), smartMove option will stay OFF"; + << ": attempting to enable \"smartMove\" mode, but pointer to AssemblySmartMotionManager is invalid (NULL), \"smartMove\" mode will stay disabled"; use_smartMove_ = false; } else { NQLog("AssemblyAssembly", NQLog::Message) << "use_smartMove(" << state << ")" - << ": smartMove option switched ON"; + << ": \"smartMove\" mode switched ON"; use_smartMove_ = true; } @@ -123,14 +128,14 @@ void AssemblyAssembly::use_smartMove(const int state) else if(state == 0) { NQLog("AssemblyAssembly", NQLog::Message) << "use_smartMove(" << state << ")" - << ": smartMove option switched OFF"; + << ": \"smartMove\" mode switched OFF"; use_smartMove_ = false; } else { NQLog("AssemblyAssembly", NQLog::Warning) << "use_smartMove(" << state << ")" - << ": invalid state value, no action taken (smartMove=" << use_smartMove_ << ")"; + << ": invalid argument (state=" << state << "), no action taken (smartMove=" << use_smartMove_ << ")"; } return; @@ -149,17 +154,22 @@ void AssemblyAssembly::GoToSensorMarkerPreAlignment_start() NQLog("AssemblyAssembly", NQLog::Critical) << "GoToSensorMarkerPreAlignment_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSensorMarkerPreAlignment_finish" + << ": emitting signal \"GoToSensorMarkerPreAlignment_finished\""; + + emit GoToSensorMarkerPreAlignment_finished(); + return; } - connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSensorMarkerPreAlignment_finish())); - const double x0 = this->parameters()->get("RefPointSensor_X"); const double y0 = this->parameters()->get("RefPointSensor_Y"); const double z0 = this->parameters()->get("RefPointSensor_Z"); const double a0 = this->parameters()->get("RefPointSensor_A"); + connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSensorMarkerPreAlignment_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSensorMarkerPreAlignment_start" << ": emitting signal \"move_absolute_request(" << x0 << ", " << y0 << ", " << z0 << ", " << a0 << ")\""; @@ -403,17 +413,22 @@ void AssemblyAssembly::GoFromSensorMarkerToPickupXY_start() NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromSensorMarkerToPickupXY_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSensorMarkerToPickupXY_finish" + << ": emitting signal \"GoFromSensorMarkerToPickupXY_finished\""; + + emit GoFromSensorMarkerToPickupXY_finished(); + return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSensorMarkerToPickupXY_finish())); - const double dx0 = this->parameters()->get("FromSensorRefPointToSensorPickup_dX"); const double dy0 = this->parameters()->get("FromSensorRefPointToSensorPickup_dY"); const double dz0 = 0.0; const double da0 = 0.0; + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSensorMarkerToPickupXY_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSensorMarkerToPickupXY_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -447,14 +462,18 @@ void AssemblyAssembly::LowerPickupToolOntoPSS_start() NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPickupToolOntoPSS_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_finish" + << ": emitting signal \"LowerPickupToolOntoPSS_finished\""; + + emit LowerPickupToolOntoPSS_finished(); + return; } const double dx0 = 0.0; const double dy0 = 0.0; - const double da0 = 0.0; - const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ"); + const double da0 = 0.0; if(use_smartMove_) { @@ -496,16 +515,6 @@ void AssemblyAssembly::LowerPickupToolOntoPSS_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::PickupPSS_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSS_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - return; - } - const double dx0 = 0.0; const double dy0 = 0.0; const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); @@ -516,6 +525,11 @@ void AssemblyAssembly::PickupPSS_start() NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSS_start" << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSS_finish" + << ": emitting signal \"PickupPSS_finished\""; + + emit PickupPSS_finished(); + return; } @@ -555,17 +569,22 @@ void AssemblyAssembly::GoToSpacerRefPoint_start() NQLog("AssemblyAssembly", NQLog::Critical) << "GoToSpacerRefPoint_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSpacerRefPoint_finish" + << ": emitting signal \"GoToSpacerRefPoint_finished\""; + + emit GoToSpacerRefPoint_finished(); + return; } - connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSpacerRefPoint_finish())); - const double x0 = this->parameters()->get("RefPointSpacer_X"); const double y0 = this->parameters()->get("RefPointSpacer_Y"); const double z0 = this->parameters()->get("RefPointSpacer_Z"); const double a0 = this->parameters()->get("RefPointSpacer_A"); + connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSpacerRefPoint_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSpacerRefPoint_start" << ": emitting signal \"move_absolute_request(" << x0 << ", " << y0 << ", " << z0 << ", " << a0 << ")\""; @@ -599,17 +618,22 @@ void AssemblyAssembly::GoFromSpacerRefPointToSpacerGluingXYPosition_start() NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSpacerRefPointToSpacerGluingXYPosition_finish" + << ": emitting signal \"GoFromSpacerRefPointToSpacerGluingXYPosition_finished\""; + + emit GoFromSpacerRefPointToSpacerGluingXYPosition_finished(); + return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSpacerRefPointToSpacerGluingXYPosition_finish())); - const double dx0 = this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dX") + this->parameters()->get("FromSensorRefPointToSensorPickup_dX"); const double dy0 = this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dY") + this->parameters()->get("FromSensorRefPointToSensorPickup_dY"); const double dz0 = 0.0; const double da0 = 0.0; + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSpacerRefPointToSpacerGluingXYPosition_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -643,18 +667,22 @@ void AssemblyAssembly::LowerPSSOntoSpacers_start() NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPSSOntoSpacers_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_finish" + << ": emitting signal \"LowerPSSOntoSpacers_finished\""; + + emit LowerPSSOntoSpacers_finished(); + return; } const double dx0 = 0.0; const double dy0 = 0.0; - const double da0 = 0.0; - const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") ; + const double da0 = 0.0; if(use_smartMove_) { @@ -703,17 +731,22 @@ void AssemblyAssembly::ApplyPSPToPSSXYOffset_start() NQLog("AssemblyAssembly", NQLog::Critical) << "ApplyPSPToPSSXYOffset_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "ApplyPSPToPSSXYOffset_finish" + << ": emitting signal \"ApplyPSPToPSSXYOffset_finished\""; + + emit ApplyPSPToPSSXYOffset_finished(); + return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(ApplyPSPToPSSXYOffset_finish())); - const double dx0 = this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX"); const double dy0 = this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY"); const double dz0 = 0.0; const double da0 = 0.0; + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(ApplyPSPToPSSXYOffset_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "ApplyPSPToPSSXYOffset_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -735,6 +768,236 @@ void AssemblyAssembly::ApplyPSPToPSSXYOffset_finish() } // ---------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------------------- +// RegisterPSPToPSSPosition --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------------------- +void AssemblyAssembly::RegisterPSPToPSSPosition_start() +{ + PSPToPSSPosition_X_ = motion_->get_position_X(); + PSPToPSSPosition_Y_ = motion_->get_position_Y(); + PSPToPSSPosition_Z_ = motion_->get_position_Z(); + PSPToPSSPosition_A_ = motion_->get_position_A(); + + NQLog("AssemblyAssembly", NQLog::Message) << "RegisterPSPToPSSPosition_start" + << ": registered position (x=" << PSPToPSSPosition_X_ << ", y=" << PSPToPSSPosition_Y_ << ", z=" << PSPToPSSPosition_Z_ << ", a=" << PSPToPSSPosition_A_ << ")"; + + connect(this, SIGNAL(PSPToPSSPosition_registered()), this, SLOT(RegisterPSPToPSSPosition_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "RegisterPSPToPSSPosition_start" + << ": emitting signal \"PSPToPSSPosition_registered\""; + + emit PSPToPSSPosition_registered(); +} + +void AssemblyAssembly::RegisterPSPToPSSPosition_finish() +{ + disconnect(this, SIGNAL(PSPToPSSPosition_registered()), this, SLOT(RegisterPSPToPSSPosition_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "RegisterPSPToPSSPosition_finish" + << ": emitting signal \"RegisterPSPToPSSPosition_finished\""; + + emit RegisterPSPToPSSPosition_finished(); + + NQLog("AssemblyAssembly", NQLog::Message) << "RegisterPSPToPSSPosition_finish" + << ": assembly-step completed"; +} +// ---------------------------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------------------------- +// GoFromPSPToPSSPosToGluingStageRefPoint ------------------------------------------------------------- +// ---------------------------------------------------------------------------------------------------- +void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start() +{ + const bool valid_params = this->parameters()->update(); + + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + << ": failed to update content of AssemblyParameters, no action taken"; + + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + + emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + + return; + } + + const double dx0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dX"); + const double dy0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dY"); + const double dz0 = this->parameters()->get("CamerFocusOnGluingStage_Z") - motion_->get_position_Z(); + const double da0 = 0.0; + + if(use_smartMove_) + { + connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + } + else + { + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + } + + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); +} + +void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_finish() +{ + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + + emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + + NQLog("AssemblyAssembly", NQLog::Message) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + << ": assembly-step completed"; +} +// ---------------------------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------------------------- +// LowerSpacersAndPSSOntoGluingStage ------------------------------------------------------------------ +// ---------------------------------------------------------------------------------------------------- +void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_start() +{ + const bool valid_params = this->parameters()->update(); + + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoGluingStage_start" + << ": failed to update content of AssemblyParameters, no action taken"; + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; + + emit LowerSpacersAndPSSOntoGluingStage_finished(); + + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + const double dz0 = + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + + this->parameters()->get("Thickness_PSS") + + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_Spacer") + + this->parameters()->get("Thickness_GlueLayer") + ; + const double da0 = 0.0; + + if(use_smartMove_) + { + connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); + } + else + { + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); + } + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); +} + +void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_finish() +{ + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); + + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; + + emit LowerSpacersAndPSSOntoGluingStage_finished(); + + NQLog("AssemblyAssembly", NQLog::Message) << "LowerSpacersAndPSSOntoGluingStage_finish" + << ": assembly-step completed"; +} +// ---------------------------------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------------------------------- +// ReturnToPSPToPSSPosition --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------------------- +void AssemblyAssembly::ReturnToPSPToPSSPosition_start() +{ + if(use_smartMove_) + { + const double dx0 = PSPToPSSPosition_X_ - motion_->get_position_X(); + const double dy0 = PSPToPSSPosition_Y_ - motion_->get_position_Y(); + const double dz0 = PSPToPSSPosition_Z_ - motion_->get_position_Z(); + const double da0 = 0.; + + if(dz0 <= 0.) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "ReturnToPSPToPSSPosition_start" + << ": invalid (non-positive) value for vertical upward movement (dZ=" << dz0 << "), no action taken"; + + NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" + << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; + + emit ReturnToPSPToPSSPosition_finished(); + + return; + } + + connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(ReturnToPSPToPSSPosition_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); + } + else + { + NQLog("AssemblyAssembly", NQLog::Critical) << "ReturnToPSPToPSSPosition_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; + + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::ReturnToPSPToPSSPosition_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); + + NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" + << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; + + emit ReturnToPSPToPSSPosition_finished(); + + return; + } +} + +void AssemblyAssembly::ReturnToPSPToPSSPosition_finish() +{ + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); + disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(ReturnToPSPToPSSPosition_finish())); + + disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(ReturnToPSPToPSSPosition_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" + << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; + + emit ReturnToPSPToPSSPosition_finished(); + + NQLog("AssemblyAssembly", NQLog::Message) << "ReturnToPSPToPSSPosition_finish" + << ": assembly-step completed"; +} +// ---------------------------------------------------------------------------------------------------- + // ---------------------------------------------------------------------------------------------------- // LowerSpacersAndPSSOntoPSP -------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- @@ -747,13 +1010,16 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoPSP_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoPSP_finished\""; + + emit LowerSpacersAndPSSOntoPSP_finished(); + return; } const double dx0 = 0.0; const double dy0 = 0.0; - const double da0 = 0.0; - const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") @@ -761,6 +1027,7 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() + this->parameters()->get("Thickness_Spacer") + this->parameters()->get("Thickness_GlueLayer") ; + const double da0 = 0.0; if(use_smartMove_) { @@ -802,16 +1069,6 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::PickupSpacersAndPSS_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "PickupSpacersAndPSS_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - return; - } - const double dx0 = 0.0; const double dy0 = 0.0; const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); @@ -822,6 +1079,11 @@ void AssemblyAssembly::PickupSpacersAndPSS_start() NQLog("AssemblyAssembly", NQLog::Critical) << "PickupSpacersAndPSS_start" << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupSpacersAndPSS_finish" + << ": emitting signal \"PickupSpacersAndPSS_finished\""; + + emit PickupSpacersAndPSS_finished(); + return; } @@ -854,16 +1116,6 @@ void AssemblyAssembly::PickupSpacersAndPSS_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LiftUpPickupTool_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "LiftUpPickupTool_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - return; - } - const double dx0 = 0.0; const double dy0 = 0.0; const double dz0 = (pickup2_Z_ - motion_->get_position_Z()); @@ -874,6 +1126,11 @@ void AssemblyAssembly::LiftUpPickupTool_start() NQLog("AssemblyAssembly", NQLog::Critical) << "LiftUpPickupTool_start" << ": invalid (non-positive) value for vertical upward movement for pickup #2 (dZ=" << dz0 << "), no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "LiftUpPickupTool_finish" + << ": emitting signal \"LiftUpPickupTool_finished\""; + + emit LiftUpPickupTool_finished(); + return; } @@ -906,16 +1163,6 @@ void AssemblyAssembly::LiftUpPickupTool_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::PickupPSPAndPSS_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSPAndPSS_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - return; - } - const double dx0 = 0.0; const double dy0 = 0.0; const double dz0 = (pickup1_Z_ - motion_->get_position_Z()); @@ -926,6 +1173,11 @@ void AssemblyAssembly::PickupPSPAndPSS_start() NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSPAndPSS_start" << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSPAndPSS_finish" + << ": emitting signal \"PickupPSPAndPSS_finished\""; + + emit PickupPSPAndPSS_finished(); + return; } @@ -965,17 +1217,22 @@ void AssemblyAssembly::GoToBaseplateRefPoint_start() NQLog("AssemblyAssembly", NQLog::Critical) << "GoToBaseplateRefPoint_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToBaseplateRefPoint_finish" + << ": emitting signal \"GoToBaseplateRefPoint_finished\""; + + emit GoToBaseplateRefPoint_finished(); + return; } - connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToBaseplateRefPoint_finish())); - const double x0 = this->parameters()->get("RefPointBaseplate_X"); const double y0 = this->parameters()->get("RefPointBaseplate_Y"); const double z0 = this->parameters()->get("RefPointBaseplate_Z"); const double a0 = this->parameters()->get("RefPointBaseplate_A"); + connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToBaseplateRefPoint_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToBaseplateRefPoint_start" << ": emitting signal \"move_absolute_request(" << x0 << ", " << y0 << ", " << z0 << ", " << a0 << ")\""; @@ -1009,17 +1266,22 @@ void AssemblyAssembly::GoFromBaseplateRefPointToBaseplateGluingXYPosition_start( NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish" + << ": emitting signal \"GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished\""; + + emit GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished(); + return; } - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish())); - const double dx0 = this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") +this->parameters()->get("FromSensorRefPointToSensorPickup_dX"); const double dy0 = this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") +this->parameters()->get("FromSensorRefPointToSensorPickup_dY"); const double dz0 = 0.0; const double da0 = 0.0; + connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish())); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; @@ -1053,13 +1315,16 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSensorAssemblyOntoBaseplate_start" << ": failed to update content of AssemblyParameters, no action taken"; + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_finish" + << ": emitting signal \"LowerSensorAssemblyOntoBaseplate_finished\""; + + emit LowerSensorAssemblyOntoBaseplate_finished(); + return; } const double dx0 = 0.0; const double dy0 = 0.0; - const double da0 = 0.0; - const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") @@ -1069,6 +1334,7 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() + this->parameters()->get("Thickness_PSP") + this->parameters()->get("Thickness_GlueLayer") ; + const double da0 = 0.0; if(use_smartMove_) { diff --git a/assembly/assemblyCommon/AssemblyAssembly.h b/assembly/assemblyCommon/AssemblyAssembly.h index 1b06fa44a..f4241b19c 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.h +++ b/assembly/assemblyCommon/AssemblyAssembly.h @@ -54,6 +54,11 @@ class AssemblyAssembly : public QObject bool use_smartMove_; + double PSPToPSSPosition_X_; + double PSPToPSSPosition_Y_; + double PSPToPSSPosition_Z_; + double PSPToPSSPosition_A_; + public slots: void use_smartMove(const int); @@ -86,8 +91,17 @@ class AssemblyAssembly : public QObject void ApplyPSPToPSSXYOffset_start(); void ApplyPSPToPSSXYOffset_finish(); - void LiftUpPickupTool_start(); - void LiftUpPickupTool_finish(); + void RegisterPSPToPSSPosition_start(); + void RegisterPSPToPSSPosition_finish(); + + void GoFromPSPToPSSPosToGluingStageRefPoint_start(); + void GoFromPSPToPSSPosToGluingStageRefPoint_finish(); + + void LowerSpacersAndPSSOntoGluingStage_start(); + void LowerSpacersAndPSSOntoGluingStage_finish(); + + void ReturnToPSPToPSSPosition_start(); + void ReturnToPSPToPSSPosition_finish(); void LowerSpacersAndPSSOntoPSP_start(); void LowerSpacersAndPSSOntoPSP_finish(); @@ -103,6 +117,9 @@ class AssemblyAssembly : public QObject void LowerSensorAssemblyOntoBaseplate_start(); void LowerSensorAssemblyOntoBaseplate_finish(); + + void LiftUpPickupTool_start(); + void LiftUpPickupTool_finish(); // --------- // vacuum @@ -149,6 +166,15 @@ class AssemblyAssembly : public QObject void ApplyPSPToPSSXYOffset_finished(); + void RegisterPSPToPSSPosition_finished(); + void PSPToPSSPosition_registered(); + + void GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + + void ReturnToPSPToPSSPosition_finished(); + + void LowerSpacersAndPSSOntoGluingStage_finished(); + void LiftUpPickupTool_finished(); void LowerSpacersAndPSSOntoPSP_finished(); diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 000b655d9..860e393af 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -344,7 +344,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Go To Measurement Position on PSS + // step: Go To Measurement Position on PSP { ++assembly_step_N_; @@ -394,31 +394,55 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - //// - //// This is where the steps for the Gluing Stage will be introduced - //// + // step: Register PSP-To-PSS XYZA Position (before lowering pickup tool, camera focused on PS-p surface) + { + ++assembly_step_N_; + + AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; + tmp_wid->label() ->setText(QString::number(assembly_step_N_)); + tmp_wid->button()->setText("Register PSP-To-PSS XYZA Position"); + PSSToPSP_lay->addWidget(tmp_wid); - // step: Lift Up Pickup-Tool For Glue Dispensing on Spacers + tmp_wid->connect_action(assembly, SLOT(RegisterPSPToPSSPosition_start()), SIGNAL(RegisterPSPToPSSPosition_finished())); + } + // ---------- + + // step: Go From PSP-To-PSS Position to Gluing Stage (XY) Ref-Point { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Lift Up Pickup-Tool For Glue Dispensing on Spacers"); + tmp_wid->button()->setText("Go From PSP-To-PSS Position to Gluing Stage (XY) Ref-Point"); PSSToPSP_lay->addWidget(tmp_wid); - tmp_wid->connect_action(assembly, SLOT(LiftUpPickupTool_start()), SIGNAL(LiftUpPickupTool_finished())); + tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageXY_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageXY_finished())); } // ---------- - // step: Dispense Both Glues On Underside Of Spacers + // step: Lower Pickup-Tool onto Gluing Stage { ++assembly_step_N_; - AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; - tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Dispense Both Glues On Underside Of Spacers"); + AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; + tmp_wid->label() ->setText(QString::number(assembly_step_N_)); + tmp_wid->button()->setText("Lower Pickup-Tool onto Gluing Stage"); PSSToPSP_lay->addWidget(tmp_wid); + + tmp_wid->connect_action(assembly, SLOT(LowerSpacersAndPSSOntoGluingStage_start()), SIGNAL(LowerSpacersAndPSSOntoGluingStage_finished())); + } + // ---------- + + // step: Return To PSP-To-PSS XYZA Position (before lowering pickup tool, camera focused on PS-p surface) + { + ++assembly_step_N_; + + AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; + tmp_wid->label() ->setText(QString::number(assembly_step_N_)); + tmp_wid->button()->setText("Return To PSP-To-PSS XYZA Position"); + PSSToPSP_lay->addWidget(tmp_wid); + + tmp_wid->connect_action(assembly, SLOT(ReturnToPSPToPSSPosition_start()), SIGNAL(ReturnToPSPToPSSPosition_finished())); } // ---------- diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index f4f9dd1c8..0cbb481da 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -230,6 +230,17 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) posi_lay->addWidget(new QLabel(tr("Z")) , 4, 5, Qt::AlignRight); posi_lay->addWidget(this->get(tmp_tag+"_Z"), 4, 6, Qt::AlignRight); + // position: z-position where camera is focused on Gluing Stage surface + tmp_tag = "CamerFocusOnGluingStage"; + tmp_des = "Camera Focused on Gluing Stage Surface :"; + + map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); + + posi_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); + + posi_lay->addWidget(new QLabel(tr("Z")) , 5, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), 5, 6, Qt::AlignRight); + //// --------------------- //// DISTANCES ----------- @@ -311,16 +322,31 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dY")) , 4, 3, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dY"), 4, 4, Qt::AlignRight); + // distance: from Baseplate Ref-Point to PS-s Ref-Point relative to Baseplate + tmp_tag = "FromPSPToPSSPosToGluingStage"; + tmp_des = "From PSS-To-PSP Position to PSS-To-GluingStage Position :"; + + map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); + + dist_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); + + dist_lay->addWidget(new QLabel(tr("dX")) , 5, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), 5, 2, Qt::AlignRight); + + dist_lay->addWidget(new QLabel(tr("dY")) , 5, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), 5, 4, Qt::AlignRight); + // distance: from best-focus z-position to pickup z-position tmp_tag = "FromCameraBestFocusToPickupHeight"; tmp_des = "From Best-Focus Height to Pickup Height :"; map_lineEdit_[tmp_tag+"_dZ"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tmp_des) , 6, 0, Qt::AlignLeft); - dist_lay->addWidget(new QLabel(tr("dZ")) , 5, 5, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dZ"), 5, 6, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dZ")) , 6, 5, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dZ"), 6, 6, Qt::AlignRight); //// --------------------- From 0bc681f67b74144eb22e965e09a9aeaab2480379 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 14:25:44 +0100 Subject: [PATCH 23/58] [assembly] updated assembly/assembly_parameters_DAF_190116.cfg --- .../assembly_parameters_DAF_190116.cfg | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index dca84d894..e07f569e3 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -14,7 +14,7 @@ Thickness_PSS 0.700 Thickness_PSP 0.700 Thickness_Spacer 1.600 Height_SpacerSlots 0.000 -Thickness_GlueLayer 0.025 +Thickness_GlueLayer 0.030 #################################### ### POSITIONS ###################### @@ -27,27 +27,27 @@ RefPointSensor_Z -62.7329 RefPointSensor_A -0.307 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -62.428 -RefPointSpacer_Y -79.629 -RefPointSpacer_Z -63.248 -RefPointSpacer_A -90.182 +RefPointSpacer_X -61.258 +RefPointSpacer_Y -78.749 +RefPointSpacer_Z -63.137 +RefPointSpacer_A -90.157 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) -RefPointBaseplate_X -64.4778 -RefPointBaseplate_Y -68.330 -RefPointBaseplate_Z -62.7678 -RefPointBaseplate_A -0.056 +RefPointBaseplate_X -63.278 +RefPointBaseplate_Y -67.390 +RefPointBaseplate_Z -62.769 +RefPointBaseplate_A -0.069 -# [DUMMY] position: Z-position (height) to put pickup tool in contact with rotation stage -PickupToolOnRotStage_Z 0.00 +# position: Z-position (height) to put pickup tool in contact with rotation stage +PickupToolOnRotStage_Z 0.00 # position: XYZ-position with pickup tool in contact with glue-dispensing platform -PickupToolOnGluingStage_X 0.00 -PickupToolOnGluingStage_Y 0.00 -PickupToolOnGluingStage_Z 0.00 +PickupToolOnGluingStage_X 0.00 +PickupToolOnGluingStage_Y 0.00 +PickupToolOnGluingStage_Z 0.00 # position: z-position where camera is focused on Gluing Stage surface -CamerFocusOnGluingStage_Z -50.0 +CamerFocusOnGluingStage_Z -50.0 #################################### ### DISTANCES ###################### From a8df2b726d4e7e1a11eaebde98f327d6f7eae86c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 16:15:59 +0100 Subject: [PATCH 24/58] [assembly] updated assembly/assembly_parameters_DAF_190116.cfg --- assembly/assembly/assembly_parameters_DAF_190116.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index e07f569e3..48d01c2a3 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -75,7 +75,7 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 # distance: dZ distance to go from Z position where camera provides best-focus on object, # to Z position where free pickup-tool (i.e. with no other objects attached) touches the object # - empirical value calibrated with multi-pickup tests -FromCameraBestFocusToPickupHeight_dZ -31.70 +FromCameraBestFocusToPickupHeight_dZ -31.85 # distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' FromPSPToPSSPosToGluingStage_dX -130.0 From cb90e63b9314a029d84f25f9b5efbed14101ce14 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 12 Mar 2019 16:16:16 +0100 Subject: [PATCH 25/58] [assembly] updated assembly.cfg --- assembly/assembly.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index f9f05da41..de8833991 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -86,12 +86,12 @@ AssemblyObjectAlignerView_PatRec1_angles_finestep 0.15 AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588_TL.png AssemblyObjectAlignerView_PatRec2_threshold 30 AssemblyObjectAlignerView_PatRec2_adaptiveThreshold 587 -AssemblyObjectAlignerView_PatRec2_angles_prescan 180 +AssemblyObjectAlignerView_PatRec2_angles_prescan 0 AssemblyObjectAlignerView_PatRec2_angles_finemax 2 AssemblyObjectAlignerView_PatRec2_angles_finestep 0.15 # AssemblySmartMotionManager -AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1 +AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.5,0.5,0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1 # AssemblyAssembly AssemblyAssembly_pickup1_Z 130.0 From 9cf2cf5c739ba58f231716a82e902212e35e9d0d Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Fri, 15 Mar 2019 18:01:55 +0100 Subject: [PATCH 26/58] [assembly] updated tab-label in assembly/AssemblyMainWindow.cc --- assembly/assembly/AssemblyMainWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index 45f7e8093..57ec5b58f 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -156,7 +156,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr // --------------------------------------------------------- // IMAGE-THRESHOLDING VIEW --------------------------------- - const QString tabname_ImageThresholding("Thresholding"); + const QString tabname_ImageThresholding("Convert Image to B/W"); thresholder_ = new AssemblyThresholder(); From 10debb88fbeab346cb474e834cf0edbdf438b581 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 21 Mar 2019 12:10:12 +0100 Subject: [PATCH 27/58] [assembly] bugfix in assemblyCommon/AssemblyAssemblyView.cc --- assembly/assemblyCommon/AssemblyAssembly.cc | 23 ++++++++++++++++--- assembly/assemblyCommon/AssemblyAssembly.h | 1 + .../assemblyCommon/AssemblyAssemblyView.cc | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index ec49ae6ea..4d213f7bd 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -36,6 +36,7 @@ AssemblyAssembly::AssemblyAssembly(const LStepExpressMotionManager* const motion , use_smartMove_(false) + , PSPToPSSPosition_isRegistered_(false) , PSPToPSSPosition_X_(0.) , PSPToPSSPosition_Y_(0.) , PSPToPSSPosition_Z_(0.) @@ -778,6 +779,8 @@ void AssemblyAssembly::RegisterPSPToPSSPosition_start() PSPToPSSPosition_Z_ = motion_->get_position_Z(); PSPToPSSPosition_A_ = motion_->get_position_A(); + PSPToPSSPosition_isRegistered_ = true; + NQLog("AssemblyAssembly", NQLog::Message) << "RegisterPSPToPSSPosition_start" << ": registered position (x=" << PSPToPSSPosition_X_ << ", y=" << PSPToPSSPosition_Y_ << ", z=" << PSPToPSSPosition_Z_ << ", a=" << PSPToPSSPosition_A_ << ")"; @@ -934,6 +937,23 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::ReturnToPSPToPSSPosition_start() { + if(PSPToPSSPosition_isRegistered_ == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "ReturnToPSPToPSSPosition_start" + << ": PSP-To-PSS Position was not registered, which is mandatory for this step"; + + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::ReturnToPSPToPSSPosition_start -- PSP-To-PSS Position was not registered, which is mandatory for this step (see dedicated button in \"Assembly\" tab)")); + msgBox.exec(); + + NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" + << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; + + emit ReturnToPSPToPSSPosition_finished(); + + return; + } + if(use_smartMove_) { const double dx0 = PSPToPSSPosition_X_ - motion_->get_position_X(); @@ -985,9 +1005,6 @@ void AssemblyAssembly::ReturnToPSPToPSSPosition_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(ReturnToPSPToPSSPosition_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(ReturnToPSPToPSSPosition_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; diff --git a/assembly/assemblyCommon/AssemblyAssembly.h b/assembly/assemblyCommon/AssemblyAssembly.h index f4241b19c..c096a4ca3 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.h +++ b/assembly/assemblyCommon/AssemblyAssembly.h @@ -54,6 +54,7 @@ class AssemblyAssembly : public QObject bool use_smartMove_; + bool PSPToPSSPosition_isRegistered_; double PSPToPSSPosition_X_; double PSPToPSSPosition_Y_; double PSPToPSSPosition_Z_; diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 860e393af..22abc482b 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -416,7 +416,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl tmp_wid->button()->setText("Go From PSP-To-PSS Position to Gluing Stage (XY) Ref-Point"); PSSToPSP_lay->addWidget(tmp_wid); - tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageXY_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageXY_finished())); + tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageRefPoint_finished())); } // ---------- From 2f175c1df95a593b6e821a47268c90876b640d9c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 21 Mar 2019 15:57:21 +0100 Subject: [PATCH 28/58] [assembly] updated assembly.cfg --- assembly/assembly.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index de8833991..3fadab0a4 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -54,10 +54,10 @@ AssemblyMultiPickupTester_pickup_deltaZ 20.0 AssemblyMultiPickupTester_useBaseplateVacuum 1 # AssemblyObjectAlignerView -AssemblyObjectAlignerView_PSS_deltaX 95.30 # marked-glass top +AssemblyObjectAlignerView_PSS_deltaX 94.30 # marked-glass top AssemblyObjectAlignerView_PSS_deltaY 0.00 # marked-glass top -AssemblyObjectAlignerView_PSP_deltaX 97.50 # marked-glass bottom +AssemblyObjectAlignerView_PSP_deltaX 97.00 # marked-glass bottom AssemblyObjectAlignerView_PSP_deltaY 0.00 # marked-glass bottom AssemblyObjectAlignerView_target_angle_deg 0.00 # marked-glass bottom From c6f7d547822a7a6d2ab78157a6f951449c456155 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 21 Mar 2019 15:57:36 +0100 Subject: [PATCH 29/58] [assembly] updated assembly/assembly_parameters_DAF_190116.cfg --- assembly/assembly/assembly_parameters_DAF_190116.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190116.cfg b/assembly/assembly/assembly_parameters_DAF_190116.cfg index 48d01c2a3..97a79c6f5 100644 --- a/assembly/assembly/assembly_parameters_DAF_190116.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190116.cfg @@ -21,8 +21,8 @@ Thickness_GlueLayer 0.030 #################################### # position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) -RefPointSensor_X -70.0283 -RefPointSensor_Y -78.4945 +RefPointSensor_X -69.0283 +RefPointSensor_Y -77.4945 RefPointSensor_Z -62.7329 RefPointSensor_A -0.307 From 5af475f6bad08601a86c1f81053d3e41a7655b05 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 21 Mar 2019 15:58:15 +0100 Subject: [PATCH 30/58] [assembly] updated value of ConradManager::togglingVacuumDelay --- assembly/assemblyCommon/ConradManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assemblyCommon/ConradManager.h b/assembly/assemblyCommon/ConradManager.h index 95bb10ff9..8ac8568a5 100644 --- a/assembly/assemblyCommon/ConradManager.h +++ b/assembly/assemblyCommon/ConradManager.h @@ -35,7 +35,7 @@ class ConradManager : public QObject private: - const int togglingVacuumDelay = 3000; + const int togglingVacuumDelay = 2000; public slots: From ad44847f50e526c5bb2864be92b70238f53762f1 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Fri, 22 Mar 2019 14:53:50 +0100 Subject: [PATCH 31/58] [assembly] reverted 5af475f (value of ConradManager::togglingVacuumDelay) --- assembly/assemblyCommon/ConradManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assemblyCommon/ConradManager.h b/assembly/assemblyCommon/ConradManager.h index 8ac8568a5..95bb10ff9 100644 --- a/assembly/assemblyCommon/ConradManager.h +++ b/assembly/assemblyCommon/ConradManager.h @@ -35,7 +35,7 @@ class ConradManager : public QObject private: - const int togglingVacuumDelay = 2000; + const int togglingVacuumDelay = 3000; public slots: From e7757b5d5c3f780f5d7d9fb0caf5ee9504720e90 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 26 Mar 2019 16:07:58 +0100 Subject: [PATCH 32/58] [assembly] added assembly/assembly_parameters_DAF_190326_balljoint.cfg --- assembly/assembly.cfg | 4 +- ...sembly_parameters_DAF_190326_balljoint.cfg | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index 3fadab0a4..889b1c618 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -40,7 +40,7 @@ startup_motion_stage 1 startup_camera 1 # AssemblyParameters -AssemblyParameters_file_path assembly_parameters_DAF_190116.cfg # format: relative path from where binary is executed +AssemblyParameters_file_path assembly_parameters_DAF_190326_balljoint.cfg # format: relative path from where binary is executed # AssemblyZFocusFinder AssemblyZFocusFinder_zrange_max 3.0 @@ -54,7 +54,7 @@ AssemblyMultiPickupTester_pickup_deltaZ 20.0 AssemblyMultiPickupTester_useBaseplateVacuum 1 # AssemblyObjectAlignerView -AssemblyObjectAlignerView_PSS_deltaX 94.30 # marked-glass top +AssemblyObjectAlignerView_PSS_deltaX 95.00 # marked-glass top AssemblyObjectAlignerView_PSS_deltaY 0.00 # marked-glass top AssemblyObjectAlignerView_PSP_deltaX 97.00 # marked-glass bottom diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg new file mode 100644 index 000000000..526ef3e34 --- /dev/null +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -0,0 +1,82 @@ + +# Sensor Ref-Point = edge of fiducial marker measured with Pattern Recognition +# Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point +# Baseplate Ref-Point = edge [...] + +#################################### +### DIMENSIONS ##################### +#################################### + +# dimensions: thickness of assembly components +Thickness_VacuumCups 0.000 +Thickness_Baseplate 0.000 +Thickness_PSS 0.700 +Thickness_PSP 0.700 +Thickness_Spacer 1.600 +Height_SpacerSlots 0.000 +Thickness_GlueLayer 0.030 + +#################################### +### POSITIONS ###################### +#################################### + +# position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) +RefPointSensor_X -69.0283 +RefPointSensor_Y -77.4945 +RefPointSensor_Z -2.7480 +RefPointSensor_A -0.307 + +# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) +RefPointSpacer_X -61.258 +RefPointSpacer_Y -78.749 +RefPointSpacer_Z -3.137 +RefPointSpacer_A -90.157 + +# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) +RefPointBaseplate_X -63.278 +RefPointBaseplate_Y -67.390 +RefPointBaseplate_Z -2.769 +RefPointBaseplate_A -0.069 + +# position: Z-position (height) to put pickup tool in contact with rotation stage +PickupToolOnRotStage_Z 0.00 + +# position: XYZ-position with pickup tool in contact with glue-dispensing platform +PickupToolOnGluingStage_X 0.00 +PickupToolOnGluingStage_Y 0.00 +PickupToolOnGluingStage_Z 0.00 + +# position: z-position where camera is focused on Gluing Stage surface +CamerFocusOnGluingStage_Z -50.0 + +#################################### +### DISTANCES ###################### +#################################### + +# distance: Angle of Camera Frame in the XY Motion Stage Ref-Frame [deg] +AngleOfCameraFrameInRefFrame_dA -89.5954 + +# distance: from Sensor Ref-Point to Sensor Pickup position +FromSensorRefPointToSensorPickup_dX 88.00 +FromSensorRefPointToSensorPickup_dY 37.00 + +# distance: from PS-p Ref-Point to PS-s Ref-Point +FromPSPRefPointToPSSRefPoint_dX 1.25 +FromPSPRefPointToPSSRefPoint_dY 0.00 + +# distance: from Spacer Ref-Point to Sensor Ref-Point +FromSpacerRefPointToSensorRefPoint_dX 0.85 +FromSpacerRefPointToSensorRefPoint_dY 0.75 + +# distance: from Baseplate Ref-Point to PS-p Ref-Point +FromBaseplateRefPointToPSPRefPoint_dX 1.60 +FromBaseplateRefPointToPSPRefPoint_dY -10.65 + +# distance: dZ distance to go from Z position where camera provides best-focus on object, +# to Z position where free pickup-tool (i.e. with no other objects attached) touches the object +# - empirical value calibrated with multi-pickup tests +FromCameraBestFocusToPickupHeight_dZ -21.85 + +# distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' +FromPSPToPSSPosToGluingStage_dX -130.0 +FromPSPToPSSPosToGluingStage_dY 0.0 From ce85fda30817f00180c472d66d979ba083b1a42f Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 28 Mar 2019 16:36:55 +0100 Subject: [PATCH 33/58] [assembly] updated assembly/assembly_parameters_DAF_190326_balljoint.cfg --- assembly/assembly.cfg | 2 +- ...sembly_parameters_DAF_190326_balljoint.cfg | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index 889b1c618..ae4801dd2 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -54,7 +54,7 @@ AssemblyMultiPickupTester_pickup_deltaZ 20.0 AssemblyMultiPickupTester_useBaseplateVacuum 1 # AssemblyObjectAlignerView -AssemblyObjectAlignerView_PSS_deltaX 95.00 # marked-glass top +AssemblyObjectAlignerView_PSS_deltaX 94.30 # marked-glass top AssemblyObjectAlignerView_PSS_deltaY 0.00 # marked-glass top AssemblyObjectAlignerView_PSP_deltaX 97.00 # marked-glass bottom diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index 526ef3e34..4082d7baf 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -23,20 +23,20 @@ Thickness_GlueLayer 0.030 # position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) RefPointSensor_X -69.0283 RefPointSensor_Y -77.4945 -RefPointSensor_Z -2.7480 +RefPointSensor_Z -2.7629 RefPointSensor_A -0.307 # position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -61.258 -RefPointSpacer_Y -78.749 -RefPointSpacer_Z -3.137 +RefPointSpacer_X -61.368 +RefPointSpacer_Y -78.979 +RefPointSpacer_Z -3.154 RefPointSpacer_A -90.157 # position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) -RefPointBaseplate_X -63.278 -RefPointBaseplate_Y -67.390 -RefPointBaseplate_Z -2.769 -RefPointBaseplate_A -0.069 +RefPointBaseplate_X -64.278 +RefPointBaseplate_Y -67.99 +RefPointBaseplate_Z -3.169 +RefPointBaseplate_A -0.238 # position: Z-position (height) to put pickup tool in contact with rotation stage PickupToolOnRotStage_Z 0.00 @@ -47,7 +47,7 @@ PickupToolOnGluingStage_Y 0.00 PickupToolOnGluingStage_Z 0.00 # position: z-position where camera is focused on Gluing Stage surface -CamerFocusOnGluingStage_Z -50.0 +CamerFocusOnGluingStage_Z -2.6538 #################################### ### DISTANCES ###################### @@ -57,8 +57,8 @@ CamerFocusOnGluingStage_Z -50.0 AngleOfCameraFrameInRefFrame_dA -89.5954 # distance: from Sensor Ref-Point to Sensor Pickup position -FromSensorRefPointToSensorPickup_dX 88.00 -FromSensorRefPointToSensorPickup_dY 37.00 +FromSensorRefPointToSensorPickup_dX 86.00 +FromSensorRefPointToSensorPickup_dY 38.00 # distance: from PS-p Ref-Point to PS-s Ref-Point FromPSPRefPointToPSSRefPoint_dX 1.25 @@ -75,7 +75,7 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 # distance: dZ distance to go from Z position where camera provides best-focus on object, # to Z position where free pickup-tool (i.e. with no other objects attached) touches the object # - empirical value calibrated with multi-pickup tests -FromCameraBestFocusToPickupHeight_dZ -21.85 +FromCameraBestFocusToPickupHeight_dZ -31.85 # distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' FromPSPToPSSPosToGluingStage_dX -130.0 From 4bb0c6867186fda149e257c1368935b923cea180 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 18 Apr 2019 08:59:43 +0200 Subject: [PATCH 34/58] [assembly] updated assembly.cfg --- assembly/assembly.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index ae4801dd2..1b6d1d455 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -91,7 +91,7 @@ AssemblyObjectAlignerView_PatRec2_angles_finemax 2 AssemblyObjectAlignerView_PatRec2_angles_finestep 0.15 # AssemblySmartMotionManager -AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.5,0.5,0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1 +AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1 # AssemblyAssembly AssemblyAssembly_pickup1_Z 130.0 From e6eaa8b0bd0aaccbe116fbcb8ceeee6f68654868 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 18 Apr 2019 09:38:49 +0200 Subject: [PATCH 35/58] [assembly] updated AssemblyAssemblyView (text-only changes) --- .../assemblyCommon/AssemblyAssemblyView.cc | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 22abc482b..61cb5ed5d 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -77,7 +77,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl // CalibRotStage_lay->addStretch(1); // //// ----------------------------------------------- - //// PSP To Baseplate ------------------------------ + //// PS-s Alignment and Pick-up -------------------- wid_PSSAlignm_ = new QWidget; toolbox->addItem(wid_PSSAlignm_, tr("[1] PS-s Alignment and Pickup")); @@ -85,7 +85,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl QVBoxLayout* PSSAlignm_lay = new QVBoxLayout; wid_PSSAlignm_->setLayout(PSSAlignm_lay); - // step: Place PSS on Assembly Platform + // step: Place PS-s on Assembly Platform { ++assembly_step_N_; @@ -109,7 +109,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Go To Measurement Position on PSS + // step: Go To Measurement Position on PS-s { ++assembly_step_N_; @@ -122,13 +122,13 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Align PSS to Motion Stage + // step: Align PS-s to Motion Stage { ++assembly_step_N_; AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Align PS-s to Motion Stage"); + tmp_wid->text() ->setText("Align PS-s to Motion Stage (Go to \"Alignment\" Tab)"); PSSAlignm_lay->addWidget(tmp_wid); } // ---------- @@ -146,7 +146,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Lower Pickup-Tool onto PSS + // step: Lower Pickup-Tool onto PS-s { ++assembly_step_N_; @@ -185,7 +185,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Pick Up PSS + // step: Pick Up PS-s { ++assembly_step_N_; @@ -201,7 +201,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl PSSAlignm_lay->addStretch(1); //// ----------------------------------------------- - //// PSS To Spacers -------------------------------- + //// PS-s To Spacers ------------------------------- wid_PSSToSpacers_ = new QWidget; toolbox->addItem(wid_PSSToSpacers_, tr("[2] PS-s onto Spacers")); @@ -259,7 +259,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Lower PSS onto Spacers + // step: Lower PS-s onto Spacers { ++assembly_step_N_; @@ -278,7 +278,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 25 min)"); PSSToSpacers_lay->addWidget(tmp_wid); } // ---------- @@ -312,7 +312,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl PSSToSpacers_lay->addStretch(1); //// ----------------------------------------------- - //// PSP To PSS ------------------------------------ + //// PS-s To PS-p ---------------------------------- wid_PSSToPSP_ = new QWidget; toolbox->addItem(wid_PSSToPSP_, tr("[3] PS-p Alignment and Sensor-To-Sensor Assembly")); @@ -320,7 +320,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl QVBoxLayout* PSSToPSP_lay = new QVBoxLayout; wid_PSSToPSP_->setLayout(PSSToPSP_lay); - // step: Place PSP on Assembly Platform + // step: Place PS-p on Assembly Platform { ++assembly_step_N_; @@ -344,7 +344,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Go To Measurement Position on PSP + // step: Go To Measurement Position on PS-p { ++assembly_step_N_; @@ -357,13 +357,13 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Align PSP to Motion Stage + // step: Align PS-p to Motion Stage { ++assembly_step_N_; AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Align PS-p to Motion Stage"); + tmp_wid->text() ->setText("Align PS-p to Motion Stage (Go to \"Alignment\" Tab)"); PSSToPSP_lay->addWidget(tmp_wid); } // ---------- @@ -381,39 +381,39 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Apply PSP-To-PSS XY Offset + // step: Apply "PS-p To PS-s" XY Offset { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Apply PSP-To-PSS XY Offset"); + tmp_wid->button()->setText("Apply \"PS-p To PS-s\" XY Offset"); PSSToPSP_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(ApplyPSPToPSSXYOffset_start()), SIGNAL(ApplyPSPToPSSXYOffset_finished())); } // ---------- - // step: Register PSP-To-PSS XYZA Position (before lowering pickup tool, camera focused on PS-p surface) + // step: Register "PS-p To PS-s" XYZA Position (before lowering pickup tool, camera focused on PS-p surface) { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Register PSP-To-PSS XYZA Position"); + tmp_wid->button()->setText("Register \"PS-p To PS-s XYZA Position\""); PSSToPSP_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(RegisterPSPToPSSPosition_start()), SIGNAL(RegisterPSPToPSSPosition_finished())); } // ---------- - // step: Go From PSP-To-PSS Position to Gluing Stage (XY) Ref-Point + // step: Go From "PS-p To PS-s" Position to Gluing Stage (XY) Ref-Point { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go From PSP-To-PSS Position to Gluing Stage (XY) Ref-Point"); + tmp_wid->button()->setText("Go From \"PS-p To PS-s Position\" to Gluing Stage (XY) Ref-Point"); PSSToPSP_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageRefPoint_finished())); @@ -433,20 +433,20 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Return To PSP-To-PSS XYZA Position (before lowering pickup tool, camera focused on PS-p surface) + // step: Return To "PS-p To PS-s" XYZA Position (before lowering pickup tool, camera focused on PS-p surface) { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Return To PSP-To-PSS XYZA Position"); + tmp_wid->button()->setText("Return To \"PS-p To PS-s XYZA Position\""); PSSToPSP_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(ReturnToPSPToPSSPosition_start()), SIGNAL(ReturnToPSPToPSSPosition_finished())); } // ---------- - // step: Lower Pickup-Tool onto PSP + // step: Lower Pickup-Tool onto PS-p { ++assembly_step_N_; @@ -465,7 +465,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 25 min)"); PSSToPSP_lay->addWidget(tmp_wid); } // ---------- @@ -483,13 +483,13 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Pick Up PSP+PSS + // step: Pick Up "PS-p + PS-s" { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Pick Up PS-p+PS-s"); + tmp_wid->button()->setText("Pick Up \"PS-p + PS-s\""); PSSToPSP_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(PickupPSPAndPSS_start()), SIGNAL(PickupPSPAndPSS_finished())); @@ -499,7 +499,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl PSSToPSP_lay->addStretch(1); //// ----------------------------------------------- - //// PSP+PSS to Baseplate + //// "PS-p + PS-s" to Baseplate -------------------- wid_PSToBasep_ = new QWidget; toolbox->addItem(wid_PSToBasep_, tr("[4] Sensor-To-Sensor Assembly onto Baseplate")); @@ -576,7 +576,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyTextWidget* tmp_wid = new AssemblyAssemblyTextWidget; tmp_wid->label()->setText(QString::number(assembly_step_N_)); - tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 15 min)"); + tmp_wid->text() ->setText("Wait for Glue To Cure (approx. 25 min)"); PSToBasep_lay->addWidget(tmp_wid); } // ---------- From cff7da063abd5c2e82070170035d8aa3506d69c3 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 18 Apr 2019 09:39:11 +0200 Subject: [PATCH 36/58] [assembly] updated AssemblyMainWindow (tab arrangement) --- assembly/assembly/AssemblyMainWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index 57ec5b58f..fc15dbcba 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -363,7 +363,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr /// Main Tab ----------------------------------------------- QTabWidget* main_tab = new QTabWidget; - main_tab->setTabPosition(QTabWidget::South); + main_tab->setTabPosition(QTabWidget::North); main_tab->addTab(assembly_tab, tr("Module Assembly")); main_tab->addTab(controls_tab, tr("Manual Controls and Parameters")); From ea97c523899067fd74618271b5ab1c5e9a872927 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 18 Apr 2019 10:54:00 +0200 Subject: [PATCH 37/58] [assembly] code-formatting in AssemblyAssembly --- assembly/assemblyCommon/AssemblyAssembly.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index 4d213f7bd..d2006fd1b 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -1291,8 +1291,16 @@ void AssemblyAssembly::GoFromBaseplateRefPointToBaseplateGluingXYPosition_start( return; } - const double dx0 = this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") +this->parameters()->get("FromSensorRefPointToSensorPickup_dX"); - const double dy0 = this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") +this->parameters()->get("FromSensorRefPointToSensorPickup_dY"); + const double dx0 = + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") + + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") + ; + const double dy0 = + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") + + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") + ; const double dz0 = 0.0; const double da0 = 0.0; From 66ccb6e4428a1c11b7d4ab28cffa7eb1d87fec46 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Thu, 18 Apr 2019 15:29:49 +0200 Subject: [PATCH 38/58] [assembly] updated assembly/assembly_parameters_DAF_190326_balljoint.cfg --- .../assembly/assembly_parameters_DAF_190326_balljoint.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index 4082d7baf..ff4efc864 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -47,7 +47,7 @@ PickupToolOnGluingStage_Y 0.00 PickupToolOnGluingStage_Z 0.00 # position: z-position where camera is focused on Gluing Stage surface -CamerFocusOnGluingStage_Z -2.6538 +CamerFocusOnGluingStage_Z -56.693 #################################### ### DISTANCES ###################### @@ -78,5 +78,5 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 FromCameraBestFocusToPickupHeight_dZ -31.85 # distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' -FromPSPToPSSPosToGluingStage_dX -130.0 +FromPSPToPSSPosToGluingStage_dX -148.0 FromPSPToPSSPosToGluingStage_dY 0.0 From a56f22c01f0872201d59c3d9d9efc4eaeda8644e Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 13:50:21 +0200 Subject: [PATCH 39/58] [assembly] started cleanup of AssemblyParameters --- .../assembly_parameters_DAF_190326_balljoint.cfg | 3 +-- assembly/assemblyCommon/AssemblyParametersView.cc | 14 ++------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index ff4efc864..baeaf850d 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -8,12 +8,11 @@ #################################### # dimensions: thickness of assembly components -Thickness_VacuumCups 0.000 Thickness_Baseplate 0.000 Thickness_PSS 0.700 Thickness_PSP 0.700 Thickness_Spacer 1.600 -Height_SpacerSlots 0.000 +Depth_SpacerSlots 0.000 Thickness_GlueLayer 0.030 #################################### diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 0cbb481da..4801d549d 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -92,8 +92,8 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dime_lay->addWidget(this->get(tmp_tag) , 3, 6, Qt::AlignRight); // dimension: height of spacer slots - tmp_tag = "Height_SpacerSlots"; - tmp_des = "Height of Spacer Slots :"; + tmp_tag = "Depth_SpacerSlots"; + tmp_des = "Depth of Spacer Slots :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); @@ -111,16 +111,6 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dime_lay->addWidget(new QLabel(tr("dZ")), 5, 5, Qt::AlignRight); dime_lay->addWidget(this->get(tmp_tag) , 5, 6, Qt::AlignRight); - // dimension: thickness of Vacuum Cups - tmp_tag = "Thickness_VacuumCups"; - tmp_des = "Thickness of Vacuum Cups :"; - - map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - - dime_lay->addWidget(new QLabel(tmp_des) , 6, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 6, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 6, 6, Qt::AlignRight); - //// --------------------- //// POSITIONS ----------- From 65593567cd2de1c314124548dad8609dd3706182 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 13:50:55 +0200 Subject: [PATCH 40/58] [assembly] updated assembly/assembly_parameters_DAF_190326_balljoint.cfg --- assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index baeaf850d..a1f61a79b 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -11,7 +11,7 @@ Thickness_Baseplate 0.000 Thickness_PSS 0.700 Thickness_PSP 0.700 -Thickness_Spacer 1.600 +Thickness_Spacer 0.705 Depth_SpacerSlots 0.000 Thickness_GlueLayer 0.030 From e3efc5193d4e1f4c64556ec30bc29e06eeb319f9 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 14:02:34 +0200 Subject: [PATCH 41/58] [assembly] updated assemblyCommon/AssemblyParametersView.cc --- ...sembly_parameters_DAF_190326_balljoint.cfg | 17 +++-- assembly/assemblyCommon/AssemblyAssembly.cc | 2 +- .../assemblyCommon/AssemblyParametersView.cc | 69 +++++++++++-------- 3 files changed, 51 insertions(+), 37 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index a1f61a79b..beb242446 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -37,16 +37,19 @@ RefPointBaseplate_Y -67.99 RefPointBaseplate_Z -3.169 RefPointBaseplate_A -0.238 -# position: Z-position (height) to put pickup tool in contact with rotation stage -PickupToolOnRotStage_Z 0.00 +#!! # position: Z-position (height) to put pickup tool in contact with rotation stage +#!! PickupToolOnRotStage_Z 0.00 +#!! +#!! # position: XYZ-position with pickup tool in contact with glue-dispensing platform +#!! PickupToolOnGluingStage_X 0.00 +#!! PickupToolOnGluingStage_Y 0.00 +#!! PickupToolOnGluingStage_Z 0.00 -# position: XYZ-position with pickup tool in contact with glue-dispensing platform -PickupToolOnGluingStage_X 0.00 -PickupToolOnGluingStage_Y 0.00 -PickupToolOnGluingStage_Z 0.00 +# position: z-position where camera is focused on Assembly Stage surface +CameraFocusOnAssemblyStage_Z -3.4 # position: z-position where camera is focused on Gluing Stage surface -CamerFocusOnGluingStage_Z -56.693 +CameraFocusOnGluingStage_Z -56.693 #################################### ### DISTANCES ###################### diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index d2006fd1b..90e3ea60c 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -828,7 +828,7 @@ void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start() const double dx0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dX"); const double dy0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dY"); - const double dz0 = this->parameters()->get("CamerFocusOnGluingStage_Z") - motion_->get_position_Z(); + const double dz0 = this->parameters()->get("CameraFocusOnGluingStage_Z") - motion_->get_position_Z(); const double da0 = 0.0; if(use_smartMove_) diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 4801d549d..5799a5079 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -190,46 +190,57 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) posi_lay->addWidget(new QLabel(tr("A")) , 2, 7, Qt::AlignRight); posi_lay->addWidget(this->get(tmp_tag+"_A"), 2, 8, Qt::AlignRight); - // position: Z-position (height) to put pickup tool in contact with rotation stage - tmp_tag = "PickupToolOnRotStage"; - tmp_des = "Pickup Tool on Rotation Stage :"; +//!! // position: Z-position (height) to put pickup tool in contact with rotation stage +//!! tmp_tag = "PickupToolOnRotStage"; +//!! tmp_des = "Pickup Tool on Rotation Stage :"; +//!! +//!! map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); +//!! +//!! posi_lay->addWidget(new QLabel(tmp_des) , 3, 0, Qt::AlignLeft); +//!! +//!! posi_lay->addWidget(new QLabel(tr("Z")) , 3, 5, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), 3, 6, Qt::AlignRight); +//!! +//!! // position: XY pickup position on glue-dispensing platform + Z-position (height) to put pickup tool in contact with platform +//!! tmp_tag = "PickupToolOnGluingStage"; +//!! tmp_des = "Pickup Tool on Gluing Stage :"; +//!! +//!! map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); +//!! map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); +//!! map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); +//!! +//!! posi_lay->addWidget(new QLabel(tmp_des) , 4, 0, Qt::AlignLeft); +//!! +//!! posi_lay->addWidget(new QLabel(tr("X")) , 4, 1, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_X"), 4, 2, Qt::AlignRight); +//!! +//!! posi_lay->addWidget(new QLabel(tr("Y")) , 4, 3, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Y"), 4, 4, Qt::AlignRight); +//!! +//!! posi_lay->addWidget(new QLabel(tr("Z")) , 4, 5, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), 4, 6, Qt::AlignRight); + + // position: z-position where camera is focused on Assembly Stage surface + tmp_tag = "CameraFocusOnAssemblyStage"; + tmp_des = "Camera Focused on Assembly Stage Surface :"; map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 3, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("Z")) , 3, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 3, 6, Qt::AlignRight); - - // position: XY pickup position on glue-dispensing platform + Z-position (height) to put pickup tool in contact with platform - tmp_tag = "PickupToolOnGluingStage"; - tmp_des = "Pickup Tool on Gluing Stage :"; - - map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - - posi_lay->addWidget(new QLabel(tmp_des) , 4, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("X")) , 4, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), 4, 2, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Y")) , 4, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), 4, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); - posi_lay->addWidget(new QLabel(tr("Z")) , 4, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 4, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , 5, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), 5, 6, Qt::AlignRight); // position: z-position where camera is focused on Gluing Stage surface - tmp_tag = "CamerFocusOnGluingStage"; + tmp_tag = "CameraFocusOnGluingStage"; tmp_des = "Camera Focused on Gluing Stage Surface :"; map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tmp_des) , 6, 0, Qt::AlignLeft); - posi_lay->addWidget(new QLabel(tr("Z")) , 5, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 5, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , 6, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), 6, 6, Qt::AlignRight); //// --------------------- From 1bbc3f251606fac4344dbf926008d93946353f3a Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 14:14:31 +0200 Subject: [PATCH 42/58] [assembly] updated assemblyCommon/AssemblyParametersView.cc --- .../assemblyCommon/AssemblyParametersView.cc | 260 ++++++++++-------- 1 file changed, 138 insertions(+), 122 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 5799a5079..80aaa4a1f 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -40,6 +40,8 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) QToolBox* toolbox = new QToolBox; layout->addWidget(toolbox); + int row_index(-1); + std::string tmp_tag(""); QString tmp_des(""); @@ -52,67 +54,81 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dime_wid_->setLayout(dime_lay); // dimension: thickness of Baseplate + ++row_index; + tmp_tag = "Thickness_Baseplate"; tmp_des = "Thickness of Baseplate :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 0, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 0, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 0, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); // dimension: thickness of PS-s Sensor + ++row_index; + tmp_tag = "Thickness_PSS"; tmp_des = "Thickness of PS-s Sensor :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 1, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 1, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 1, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); // dimension: thickness of PS-p Sensor + ++row_index; + tmp_tag = "Thickness_PSP"; tmp_des = "Thickness of PS-p Sensor :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 2, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 2, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 2, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); // dimension: thickness of Spacer + ++row_index; + tmp_tag = "Thickness_Spacer"; tmp_des = "Thickness of Spacers :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 3, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 3, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 3, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); // dimension: height of spacer slots + ++row_index; + tmp_tag = "Depth_SpacerSlots"; tmp_des = "Depth of Spacer Slots :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 4, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 4, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 4, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); // dimension: thickness of Glue Layer + ++row_index; + tmp_tag = "Thickness_GlueLayer"; tmp_des = "Thickness of Glue Layer :"; map_lineEdit_[tmp_tag] = new QLineEdit(tr("")); - dime_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); - dime_lay->addWidget(new QLabel(tr("dZ")), 5, 5, Qt::AlignRight); - dime_lay->addWidget(this->get(tmp_tag) , 5, 6, Qt::AlignRight); + dime_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dime_lay->addWidget(new QLabel(tr("dZ")), row_index, 5, Qt::AlignRight); + dime_lay->addWidget(this->get(tmp_tag) , row_index, 6, Qt::AlignRight); //// --------------------- + row_index = -1; + //// POSITIONS ----------- posi_wid_ = new QWidget; @@ -122,6 +138,8 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) posi_wid_->setLayout(posi_lay); // position: XYZA position to point camera to sensor marker-1 (using reference mark on platform to place sensor) + ++row_index; + tmp_tag = "RefPointSensor"; tmp_des = "Sensor Marker-1 :"; @@ -130,21 +148,19 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 0, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("X")) , 0, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), 0, 2, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Y")) , 0, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), 0, 4, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Z")) , 0, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 0, 6, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("A")) , 0, 7, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_A"), 0, 8, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); // position: XYZA position to point camera to Spacer Ref-Point + ++row_index; + tmp_tag = "RefPointSpacer"; tmp_des = "Spacer Ref-Point :"; @@ -153,21 +169,19 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 1, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("X")) , 1, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), 1, 2, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Y")) , 1, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), 1, 4, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Z")) , 1, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 1, 6, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("A")) , 1, 7, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_A"), 1, 8, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); // position: XYZA position to point camera on Baseplate Ref-Point + ++row_index; + tmp_tag = "RefPointBaseplate"; tmp_des = "Baseplate Ref-Point :"; @@ -176,32 +190,31 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 2, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("X")) , 2, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), 2, 2, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Y")) , 2, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), 2, 4, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("Z")) , 2, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 2, 6, Qt::AlignRight); - - posi_lay->addWidget(new QLabel(tr("A")) , 2, 7, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_A"), 2, 8, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); //!! // position: Z-position (height) to put pickup tool in contact with rotation stage +//!! ++row_index; +//!! //!! tmp_tag = "PickupToolOnRotStage"; //!! tmp_des = "Pickup Tool on Rotation Stage :"; //!! //!! map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); //!! -//!! posi_lay->addWidget(new QLabel(tmp_des) , 3, 0, Qt::AlignLeft); -//!! -//!! posi_lay->addWidget(new QLabel(tr("Z")) , 3, 5, Qt::AlignRight); -//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), 3, 6, Qt::AlignRight); +//!! posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); +//!! posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); //!! //!! // position: XY pickup position on glue-dispensing platform + Z-position (height) to put pickup tool in contact with platform +//!! ++row_index; +//!! //!! tmp_tag = "PickupToolOnGluingStage"; //!! tmp_des = "Pickup Tool on Gluing Stage :"; //!! @@ -209,41 +222,42 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) //!! map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); //!! map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); //!! -//!! posi_lay->addWidget(new QLabel(tmp_des) , 4, 0, Qt::AlignLeft); -//!! -//!! posi_lay->addWidget(new QLabel(tr("X")) , 4, 1, Qt::AlignRight); -//!! posi_lay->addWidget(this->get(tmp_tag+"_X"), 4, 2, Qt::AlignRight); -//!! -//!! posi_lay->addWidget(new QLabel(tr("Y")) , 4, 3, Qt::AlignRight); -//!! posi_lay->addWidget(this->get(tmp_tag+"_Y"), 4, 4, Qt::AlignRight); -//!! -//!! posi_lay->addWidget(new QLabel(tr("Z")) , 4, 5, Qt::AlignRight); -//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), 4, 6, Qt::AlignRight); +//!! posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); +//!! posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); +//!! posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); +//!! posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); +//!! posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); // position: z-position where camera is focused on Assembly Stage surface + ++row_index; + tmp_tag = "CameraFocusOnAssemblyStage"; tmp_des = "Camera Focused on Assembly Stage Surface :"; map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("Z")) , 5, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 5, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); // position: z-position where camera is focused on Gluing Stage surface + ++row_index; + tmp_tag = "CameraFocusOnGluingStage"; tmp_des = "Camera Focused on Gluing Stage Surface :"; map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - posi_lay->addWidget(new QLabel(tmp_des) , 6, 0, Qt::AlignLeft); - - posi_lay->addWidget(new QLabel(tr("Z")) , 6, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), 6, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); //// --------------------- + row_index = -1; + //// DISTANCES ----------- dist_wid_ = new QWidget; @@ -253,101 +267,103 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_wid_->setLayout(dist_lay); // distance: angle between the camera frame and the XY reference frame of the motion stage + ++row_index; + tmp_tag = "AngleOfCameraFrameInRefFrame"; tmp_des = "Angle of Camera Frame in the XY Motion Stage Ref-Frame :"; map_lineEdit_[tmp_tag+"_dA"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 0, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dA")) , 0, 7, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dA"), 0, 8, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dA")) , row_index, 7, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dA"), row_index, 8, Qt::AlignRight); // distance: from Sensor Ref-Point to Sensor Pickup Position + ++row_index; + tmp_tag = "FromSensorRefPointToSensorPickup"; tmp_des = "From Sensor Ref-Point to Sensor Pickup Position :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 1, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dX")) , 1, 1, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dX"), 1, 2, Qt::AlignRight); - - dist_lay->addWidget(new QLabel(tr("dY")) , 1, 3, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dY"), 1, 4, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); // distance: shift from PS-p marker-1 Ref-Point to PS-s marker-1 Ref-Point + ++row_index; + tmp_tag = "FromPSPRefPointToPSSRefPoint"; tmp_des = "From PS-p Ref-Point To PS-s Ref-Point :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 2, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dX")) , 2, 1, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dX"), 2, 2, Qt::AlignRight); - - dist_lay->addWidget(new QLabel(tr("dY")) , 2, 3, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dY"), 2, 4, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); // distance: from Spacer Ref-Point to Sensor Ref-Point + ++row_index; + tmp_tag = "FromSpacerRefPointToSensorRefPoint"; tmp_des = "From Spacer Ref-Point to Sensor Ref-Point :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 3, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dX")) , 3, 1, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dX"), 3, 2, Qt::AlignRight); - - dist_lay->addWidget(new QLabel(tr("dY")) , 3, 3, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dY"), 3, 4, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); // distance: from Baseplate Ref-Point to PS-s Ref-Point relative to Baseplate + ++row_index; + tmp_tag = "FromBaseplateRefPointToPSPRefPoint"; tmp_des = "From Baseplate Ref-Point to PS-p Ref-Point :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 4, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dX")) , 4, 1, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dX"), 4, 2, Qt::AlignRight); - - dist_lay->addWidget(new QLabel(tr("dY")) , 4, 3, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dY"), 4, 4, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); // distance: from Baseplate Ref-Point to PS-s Ref-Point relative to Baseplate + ++row_index; + tmp_tag = "FromPSPToPSSPosToGluingStage"; tmp_des = "From PSS-To-PSP Position to PSS-To-GluingStage Position :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 5, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dX")) , 5, 1, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dX"), 5, 2, Qt::AlignRight); - - dist_lay->addWidget(new QLabel(tr("dY")) , 5, 3, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dY"), 5, 4, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); // distance: from best-focus z-position to pickup z-position + ++row_index; + tmp_tag = "FromCameraBestFocusToPickupHeight"; tmp_des = "From Best-Focus Height to Pickup Height :"; map_lineEdit_[tmp_tag+"_dZ"] = new QLineEdit(tr("")); - dist_lay->addWidget(new QLabel(tmp_des) , 6, 0, Qt::AlignLeft); - - dist_lay->addWidget(new QLabel(tr("dZ")) , 6, 5, Qt::AlignRight); - dist_lay->addWidget(this->get(tmp_tag+"_dZ"), 6, 6, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dZ")) , row_index, 5, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dZ"), row_index, 6, Qt::AlignRight); //// --------------------- From 532c77107bda7fe151f25cf11a6e450c63d25df8 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 14:48:07 +0200 Subject: [PATCH 43/58] [assembly] updated assemblyCommon/AssemblyParametersView.cc --- ...sembly_parameters_DAF_190326_balljoint.cfg | 12 ++++++ .../assemblyCommon/AssemblyParametersView.cc | 42 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index beb242446..a61195396 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -37,6 +37,18 @@ RefPointBaseplate_Y -67.99 RefPointBaseplate_Z -3.169 RefPointBaseplate_A -0.238 +# position: ref-point on assembly platform for calibration of spacers position (spacer aligned along x-axis) +RefPointCalibrationSpacers_X 0.0 +RefPointCalibrationSpacers_Y 0.0 +RefPointCalibrationSpacers_Z 0.0 +RefPointCalibrationSpacers_A 0.0 + +# position: ref-point on assembly platform for calibration of baseplate position (spacer aligned along x-axis) +RefPointCalibrationBaseplate_X 0.0 +RefPointCalibrationBaseplate_Y 0.0 +RefPointCalibrationBaseplate_Z 0.0 +RefPointCalibrationBaseplate_A 0.0 + #!! # position: Z-position (height) to put pickup tool in contact with rotation stage #!! PickupToolOnRotStage_Z 0.00 #!! diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 80aaa4a1f..34d67baab 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -200,6 +200,48 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); + // position: XYZA position of ref-point on assembly platform for calibration of spacers + ++row_index; + + tmp_tag = "RefPointCalibrationSpacers"; + tmp_des = "[Calibration: Spacers] Ref-Point :"; + + map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); + + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); + + // position: XYZA position of ref-point on assembly platform for calibration of baseplate + ++row_index; + + tmp_tag = "RefPointCalibrationBaseplate"; + tmp_des = "[Calibration: Baseplate] Ref-Point :"; + + map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); + + posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); + //!! // position: Z-position (height) to put pickup tool in contact with rotation stage //!! ++row_index; //!! From 96d3169c466e803d15f98094283dfba036ba18da Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 15:25:15 +0200 Subject: [PATCH 44/58] [assembly] updated assemblyCommon/AssemblyParametersView.cc --- ...sembly_parameters_DAF_190326_balljoint.cfg | 8 +++++ .../assemblyCommon/AssemblyParametersView.cc | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index a61195396..c592e4068 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -94,3 +94,11 @@ FromCameraBestFocusToPickupHeight_dZ -31.85 # distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' FromPSPToPSSPosToGluingStage_dX -148.0 FromPSPToPSSPosToGluingStage_dY 0.0 + +# distance: from ref-point on assembly platform (for spacers calibration) to spacer's edge +FromRefPointCalibrationSpacersToSpacerEdge_dX 0.0 +FromRefPointCalibrationSpacersToSpacerEdge_dY 0.0 + +# distance: from ref-point on assembly platform (for baseplate calibration) to baseplate's edge +FromRefPointCalibrationBaseplateToBaseplateEdge_dX 0.0 +FromRefPointCalibrationBaseplateToBaseplateEdge_dY 0.0 diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 34d67baab..753ffbc50 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -407,6 +407,36 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dZ")) , row_index, 5, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dZ"), row_index, 6, Qt::AlignRight); + // distance: from ref-point on assembly platform (for spacers' calibration) to spacer's edge + ++row_index; + + tmp_tag = "FromRefPointCalibrationSpacersToSpacerEdge"; + tmp_des = "From Ref-Point of Spacers-Calibration to Spacer's Edge :"; + + map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); + + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); + + // distance: from ref-point on assembly platform (for baseplates' calibration) to baseplate's edge + ++row_index; + + tmp_tag = "FromRefPointCalibrationBaseplateToBaseplateEdge"; + tmp_des = "From Ref-Point of Baseplate-Calibration to Baseplate's Edge :"; + + map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); + + dist_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + dist_lay->addWidget(new QLabel(tr("dX")) , row_index, 1, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dX"), row_index, 2, Qt::AlignRight); + dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); + dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); + //// --------------------- layout->addStretch(1); From a31f592fd8f043e14dfab97539beef930f1d14a8 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 15:25:38 +0200 Subject: [PATCH 45/58] [assembly] minor update to assembly/AssemblyMainWindow.cc --- assembly/assembly/AssemblyMainWindow.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index fc15dbcba..26a1ab929 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -385,14 +385,12 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr NQLog("AssemblyMainWindow", NQLog::Message) << "///////////////////////////////////////////////////////"; NQLog("AssemblyMainWindow", NQLog::Message) << "// //"; - NQLog("AssemblyMainWindow", NQLog::Message) << "// DESY-CMS //"; - NQLog("AssemblyMainWindow", NQLog::Message) << "// //"; NQLog("AssemblyMainWindow", NQLog::Message) << "// Automated Pixel-Strip Module Assembly //"; NQLog("AssemblyMainWindow", NQLog::Message) << "// //"; - NQLog("AssemblyMainWindow", NQLog::Message) << "// - AssemblyMainWindow initialized successfully - //"; - NQLog("AssemblyMainWindow", NQLog::Message) << "// //"; NQLog("AssemblyMainWindow", NQLog::Message) << "///////////////////////////////////////////////////////"; + NQLog("AssemblyMainWindow", NQLog::Message) << "application initialized successfully"; + // enable camera at startup const bool startup_camera = config->getValue("startup_camera", false); From 57cdcd451691da67a9c5837e42bd3eff3a1ae53b Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 15:30:17 +0200 Subject: [PATCH 46/58] [assembly] updated assemblyCommon/AssemblyImageView.cc (only data-member renaming) --- assembly/assemblyCommon/AssemblyImageView.cc | 146 +++++++++---------- assembly/assemblyCommon/AssemblyImageView.h | 24 ++- 2 files changed, 83 insertions(+), 87 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyImageView.cc b/assembly/assemblyCommon/AssemblyImageView.cc index c55942fec..899757fb1 100644 --- a/assembly/assemblyCommon/AssemblyImageView.cc +++ b/assembly/assemblyCommon/AssemblyImageView.cc @@ -35,14 +35,14 @@ AssemblyImageView::AssemblyImageView(QWidget* parent) : img_celi_button_(nullptr), // auto-focusing - AF_ueye_(nullptr), - AF_scroll_(nullptr), - AF_result_bestZ_lineed_(nullptr), - AF_exe_button_(nullptr), - AF_stop_button_(nullptr), - AF_param_maxDZ_lineed_(nullptr), - AF_param_Nstep_lineed_(nullptr), - AF_save_zscan_button_(nullptr) + autofocus_ueye_(nullptr), + autofocus_scroll_(nullptr), + autofocus_result_bestZ_lineed_(nullptr), + autofocus_exe_button_(nullptr), + autofocus_stop_button_(nullptr), + autofocus_param_maxDZ_lineed_(nullptr), + autofocus_param_Nstep_lineed_(nullptr), + autofocus_save_zscan_button_(nullptr) { QGridLayout* g0 = new QGridLayout; this->setLayout(g0); @@ -73,39 +73,39 @@ AssemblyImageView::AssemblyImageView(QWidget* parent) : // ---------- // auto-focusing - QVBoxLayout* AF_result_lay = new QVBoxLayout; + QVBoxLayout* autofocus_result_lay = new QVBoxLayout; - AF_ueye_ = new AssemblyUEyeView(this); - AF_ueye_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - AF_ueye_->setMinimumSize(500, 300); - AF_ueye_->setPalette(palette); - AF_ueye_->setBackgroundRole(QPalette::Background); - AF_ueye_->setScaledContents(true); - AF_ueye_->setAlignment(Qt::AlignCenter); - AF_ueye_->setZoomFactor(0.75); + autofocus_ueye_ = new AssemblyUEyeView(this); + autofocus_ueye_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + autofocus_ueye_->setMinimumSize(500, 300); + autofocus_ueye_->setPalette(palette); + autofocus_ueye_->setBackgroundRole(QPalette::Background); + autofocus_ueye_->setScaledContents(true); + autofocus_ueye_->setAlignment(Qt::AlignCenter); + autofocus_ueye_->setZoomFactor(0.75); - AF_scroll_ = new QScrollArea(this); - AF_scroll_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - AF_scroll_->setMinimumSize(500, 300); - AF_scroll_->setPalette(palette); - AF_scroll_->setBackgroundRole(QPalette::Background); - AF_scroll_->setAlignment(Qt::AlignCenter); - AF_scroll_->setWidget(AF_ueye_); + autofocus_scroll_ = new QScrollArea(this); + autofocus_scroll_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + autofocus_scroll_->setMinimumSize(500, 300); + autofocus_scroll_->setPalette(palette); + autofocus_scroll_->setBackgroundRole(QPalette::Background); + autofocus_scroll_->setAlignment(Qt::AlignCenter); + autofocus_scroll_->setWidget(autofocus_ueye_); - AF_result_lay->addWidget(AF_scroll_); + autofocus_result_lay->addWidget(autofocus_scroll_); - QHBoxLayout* AF_result_bestZ_lay = new QHBoxLayout; + QHBoxLayout* autofocus_result_bestZ_lay = new QHBoxLayout; - QLabel* AF_result_bestZ_label = new QLabel("Best-Focus Z-position [mm]", this); - AF_result_bestZ_lineed_ = new QLineEdit("", this); - AF_result_bestZ_lineed_->setReadOnly(true); + QLabel* autofocus_result_bestZ_label = new QLabel("Best-Focus Z-position [mm]", this); + autofocus_result_bestZ_lineed_ = new QLineEdit("", this); + autofocus_result_bestZ_lineed_->setReadOnly(true); - AF_result_bestZ_lay->addWidget(AF_result_bestZ_label , 40); - AF_result_bestZ_lay->addWidget(AF_result_bestZ_lineed_, 60); + autofocus_result_bestZ_lay->addWidget(autofocus_result_bestZ_label , 40); + autofocus_result_bestZ_lay->addWidget(autofocus_result_bestZ_lineed_, 60); - AF_result_lay->addLayout(AF_result_bestZ_lay); + autofocus_result_lay->addLayout(autofocus_result_bestZ_lay); - g0->addLayout(AF_result_lay, 1, 0); + g0->addLayout(autofocus_result_lay, 1, 0); // ---------- this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -137,56 +137,56 @@ AssemblyImageView::AssemblyImageView(QWidget* parent) : // ---------- // auto-focusing - QVBoxLayout* AF_lay = new QVBoxLayout; - g0->addLayout(AF_lay, 1, 1); + QVBoxLayout* autofocus_lay = new QVBoxLayout; + g0->addLayout(autofocus_lay, 1, 1); - AF_exe_button_ = new QPushButton("Auto-Focus Image", this); - AF_lay->addWidget(AF_exe_button_); + autofocus_exe_button_ = new QPushButton("Auto-Focus Image", this); + autofocus_lay->addWidget(autofocus_exe_button_); - AF_stop_button_ = new QPushButton("Stop Auto-Focus", this); - AF_lay->addWidget(AF_stop_button_); + autofocus_stop_button_ = new QPushButton("Stop Auto-Focus", this); + autofocus_lay->addWidget(autofocus_stop_button_); // ----- - AF_lay->addSpacing(20); + autofocus_lay->addSpacing(20); - QGroupBox* AF_param_box = new QGroupBox(tr("Auto-Focus Configuration")); - AF_param_box->setStyleSheet("QGroupBox { font-weight: bold; } "); + QGroupBox* autofocus_param_box = new QGroupBox(tr("Auto-Focus Configuration")); + autofocus_param_box->setStyleSheet("QGroupBox { font-weight: bold; } "); - AF_lay->addWidget(AF_param_box); + autofocus_lay->addWidget(autofocus_param_box); - QVBoxLayout* AF_param_lay = new QVBoxLayout; - AF_param_box->setLayout(AF_param_lay); + QVBoxLayout* autofocus_param_lay = new QVBoxLayout; + autofocus_param_box->setLayout(autofocus_param_lay); - QHBoxLayout* AF_param_maxDZ_lay = new QHBoxLayout; - AF_param_lay->addLayout(AF_param_maxDZ_lay); + QHBoxLayout* autofocus_param_maxDZ_lay = new QHBoxLayout; + autofocus_param_lay->addLayout(autofocus_param_maxDZ_lay); - QLabel* AF_param_maxDZ_label = new QLabel("Max delta-Z [mm]", this); - AF_param_maxDZ_lineed_ = new QLineEdit("", this); + QLabel* autofocus_param_maxDZ_label = new QLabel("Max delta-Z [mm]", this); + autofocus_param_maxDZ_lineed_ = new QLineEdit("", this); - AF_param_maxDZ_lay->addWidget(AF_param_maxDZ_label , 40); - AF_param_maxDZ_lay->addWidget(AF_param_maxDZ_lineed_, 60); + autofocus_param_maxDZ_lay->addWidget(autofocus_param_maxDZ_label , 40); + autofocus_param_maxDZ_lay->addWidget(autofocus_param_maxDZ_lineed_, 60); - QHBoxLayout* AF_param_Nstep_lay = new QHBoxLayout; - AF_param_lay->addLayout(AF_param_Nstep_lay); + QHBoxLayout* autofocus_param_Nstep_lay = new QHBoxLayout; + autofocus_param_lay->addLayout(autofocus_param_Nstep_lay); - QLabel* AF_param_Nstep_label = new QLabel("# Steps (int)", this); - AF_param_Nstep_lineed_ = new QLineEdit("", this); + QLabel* autofocus_param_Nstep_label = new QLabel("# Steps (int)", this); + autofocus_param_Nstep_lineed_ = new QLineEdit("", this); - AF_param_Nstep_lay->addWidget(AF_param_Nstep_label , 40); - AF_param_Nstep_lay->addWidget(AF_param_Nstep_lineed_, 60); + autofocus_param_Nstep_lay->addWidget(autofocus_param_Nstep_label , 40); + autofocus_param_Nstep_lay->addWidget(autofocus_param_Nstep_lineed_, 60); // ----- - AF_lay->addSpacing(20); + autofocus_lay->addSpacing(20); - AF_save_zscan_button_ = new QPushButton("Save Z-Scan Image", this); - AF_lay->addWidget(AF_save_zscan_button_); + autofocus_save_zscan_button_ = new QPushButton("Save Z-Scan Image", this); + autofocus_lay->addWidget(autofocus_save_zscan_button_); - connect(AF_save_zscan_button_, SIGNAL(clicked()), this, SLOT(save_image_zscan())); + connect(autofocus_save_zscan_button_, SIGNAL(clicked()), this, SLOT(save_image_zscan())); this->connectImageProducer_autofocus(this, SIGNAL(image_zscan_updated(const cv::Mat&))); // ----- - AF_lay->addStretch(); + autofocus_lay->addStretch(); // ---------- //// -------------------------------------------------- @@ -307,7 +307,7 @@ void AssemblyImageView::modify_image_centerlines() void AssemblyImageView::update_text(const double z) { - AF_result_bestZ_lineed_->setText(QString::fromStdString(std::to_string(z))); + autofocus_result_bestZ_lineed_->setText(QString::fromStdString(std::to_string(z))); NQLog("AssemblyImageView", NQLog::Spam) << "update_text" << ": displayed value of best z-position (focal point)"; @@ -320,12 +320,12 @@ void AssemblyImageView::update_autofocus_config(const double maxDZ, const int Ns std::stringstream maxDZ_strs; maxDZ_strs << maxDZ; - AF_param_maxDZ_lineed_->setText(QString::fromStdString(maxDZ_strs.str())); + autofocus_param_maxDZ_lineed_->setText(QString::fromStdString(maxDZ_strs.str())); std::stringstream Nstep_strs; Nstep_strs << Nstep; - AF_param_Nstep_lineed_->setText(QString::fromStdString(Nstep_strs.str())); + autofocus_param_Nstep_lineed_->setText(QString::fromStdString(Nstep_strs.str())); return; } @@ -333,7 +333,7 @@ void AssemblyImageView::update_autofocus_config(const double maxDZ, const int Ns void AssemblyImageView::acquire_autofocus_config() { // maximum delta-Z movement - const QString maxDZ_str = AF_param_maxDZ_lineed_->text(); + const QString maxDZ_str = autofocus_param_maxDZ_lineed_->text(); bool maxDZ_valid(false); const double maxDZ = maxDZ_str.toDouble(&maxDZ_valid); @@ -348,7 +348,7 @@ void AssemblyImageView::acquire_autofocus_config() // ------------------------- // number of steps in Z-scan - const QString Nstep_str = AF_param_Nstep_lineed_->text(); + const QString Nstep_str = autofocus_param_Nstep_lineed_->text(); bool Nstep_valid(false); const double Nstep = Nstep_str.toInt(&Nstep_valid); @@ -410,14 +410,14 @@ void AssemblyImageView::connectImageProducer_autofocus(const QObject* sender, co { NQLog("AssemblyImageView", NQLog::Debug) << "connectImageProducer_autofocus"; - AF_ueye_->connectImageProducer(sender, signal); + autofocus_ueye_->connectImageProducer(sender, signal); } void AssemblyImageView::disconnectImageProducer_autofocus(const QObject* sender, const char* signal) { NQLog("AssemblyImageView", NQLog::Debug) << "disconnectImageProducer_autofocus"; - AF_ueye_->disconnectImageProducer(sender, signal); + autofocus_ueye_->disconnectImageProducer(sender, signal); } void AssemblyImageView::keyReleaseEvent(QKeyEvent* event) @@ -428,25 +428,25 @@ void AssemblyImageView::keyReleaseEvent(QKeyEvent* event) { case Qt::Key_0: // img_ueye_->setZoomFactor(0.25); -// AF_ueye_ ->setZoomFactor(0.25); +// autofocus_ueye_ ->setZoomFactor(0.25); event->accept(); break; case Qt::Key_1: // img_ueye_->setZoomFactor(1.00); -// AF_ueye_ ->setZoomFactor(1.00); +// autofocus_ueye_ ->setZoomFactor(1.00); event->accept(); break; case Qt::Key_Plus: // img_ueye_->increaseZoomFactor(); -// AF_ueye_ ->increaseZoomFactor(); +// autofocus_ueye_ ->increaseZoomFactor(); event->accept(); break; case Qt::Key_Minus: // img_ueye_->decreaseZoomFactor(); -// AF_ueye_ ->decreaseZoomFactor(); +// autofocus_ueye_ ->decreaseZoomFactor(); event->accept(); break; diff --git a/assembly/assemblyCommon/AssemblyImageView.h b/assembly/assemblyCommon/AssemblyImageView.h index c7df347d1..789b739c8 100644 --- a/assembly/assemblyCommon/AssemblyImageView.h +++ b/assembly/assemblyCommon/AssemblyImageView.h @@ -39,8 +39,8 @@ class AssemblyImageView : public QWidget void connectImageProducer_autofocus(const QObject* sender, const char* signal); void disconnectImageProducer_autofocus(const QObject* sender, const char* signal); - QPushButton* autofocus_button() const { return AF_exe_button_; } - QPushButton* autofocus_emergencyStop_button() const { return AF_stop_button_; } + QPushButton* autofocus_button() const { return autofocus_exe_button_; } + QPushButton* autofocus_emergencyStop_button() const { return autofocus_stop_button_; } protected: @@ -61,18 +61,14 @@ class AssemblyImageView : public QWidget // ------------------- // auto-focusing - AssemblyUEyeView* AF_ueye_; - QScrollArea* AF_scroll_; - - QLineEdit* AF_result_bestZ_lineed_; - - QPushButton* AF_exe_button_; - QPushButton* AF_stop_button_; - - QLineEdit* AF_param_maxDZ_lineed_; - QLineEdit* AF_param_Nstep_lineed_; - - QPushButton* AF_save_zscan_button_; + AssemblyUEyeView *autofocus_ueye_; + QScrollArea *autofocus_scroll_; + QLineEdit *autofocus_result_bestZ_lineed_; + QPushButton *autofocus_exe_button_; + QPushButton *autofocus_stop_button_; + QLineEdit *autofocus_param_maxDZ_lineed_; + QLineEdit *autofocus_param_Nstep_lineed_; + QPushButton *autofocus_save_zscan_button_; cv::Mat image_zscan_; // ------------------- From 98122e1f3c44eccfc351fa6798426978dbf311ca Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 16:26:09 +0200 Subject: [PATCH 47/58] [assembly] updated assemblyCommon/AssemblyAssembly.cc --- assembly/assemblyCommon/AssemblyAssembly.cc | 198 ++++++------------ assembly/assemblyCommon/AssemblyAssembly.h | 20 +- .../assemblyCommon/AssemblyAssemblyView.cc | 38 +--- .../LStepExpressMotionManager.cc | 2 +- 4 files changed, 75 insertions(+), 183 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index 90e3ea60c..05a640c0a 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -559,99 +559,65 @@ void AssemblyAssembly::PickupPSS_finish() // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -// GoToSpacerRefPoint --------------------------------------------------------------------------------- +// GoToXYAPositionToGluePSSToSpacers ------------------------------------------------------------------ // ---------------------------------------------------------------------------------------------------- -void AssemblyAssembly::GoToSpacerRefPoint_start() +void AssemblyAssembly::GoToXYAPositionToGluePSSToSpacers_start() { const bool valid_params = this->parameters()->update(); if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoToSpacerRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoToXYAPositionToGluePSSToSpacers_start" << ": failed to update content of AssemblyParameters, no action taken"; - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSpacerRefPoint_finish" - << ": emitting signal \"GoToSpacerRefPoint_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGluePSSToSpacers_finish" + << ": emitting signal \"GoToXYAPositionToGluePSSToSpacers_finished\""; - emit GoToSpacerRefPoint_finished(); + emit GoToXYAPositionToGluePSSToSpacers_finished(); return; } - const double x0 = this->parameters()->get("RefPointSpacer_X"); - const double y0 = this->parameters()->get("RefPointSpacer_Y"); - const double z0 = this->parameters()->get("RefPointSpacer_Z"); - const double a0 = this->parameters()->get("RefPointSpacer_A"); - - connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSpacerRefPoint_finish())); - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSpacerRefPoint_start" - << ": emitting signal \"move_absolute_request(" << x0 << ", " << y0 << ", " << z0 << ", " << a0 << ")\""; - - emit move_absolute_request(x0, y0, z0, a0); -} - -void AssemblyAssembly::GoToSpacerRefPoint_finish() -{ - disconnect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToSpacerRefPoint_finish())); - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToSpacerRefPoint_finish" - << ": emitting signal \"GoToSpacerRefPoint_finished\""; - - emit GoToSpacerRefPoint_finished(); - - NQLog("AssemblyAssembly", NQLog::Message) << "GoToSpacerRefPoint_finish" - << ": assembly-step completed"; -} -// ---------------------------------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------------------------------- -// GoFromSpacerRefPointToSpacerGluingXYPosition ------------------------------------------------------- -// ---------------------------------------------------------------------------------------------------- -void AssemblyAssembly::GoFromSpacerRefPointToSpacerGluingXYPosition_start() -{ - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSpacerRefPointToSpacerGluingXYPosition_finish" - << ": emitting signal \"GoFromSpacerRefPointToSpacerGluingXYPosition_finished\""; - - emit GoFromSpacerRefPointToSpacerGluingXYPosition_finished(); + const double dx0 = + this->parameters()->get("RefPointCalibrationSpacers_X") + + this->parameters()->get("FromRefPointCalibrationSpacersToSpacerEdge_dX") + + this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dX") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") + - motion_->get_position_X(); - return; - } + const double dy0 = + this->parameters()->get("RefPointCalibrationSpacers_Y") + + this->parameters()->get("FromRefPointCalibrationSpacersToSpacerEdge_dY") + + this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dY") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") + - motion_->get_position_Y(); - const double dx0 = this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dX") + this->parameters()->get("FromSensorRefPointToSensorPickup_dX"); - const double dy0 = this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dY") + this->parameters()->get("FromSensorRefPointToSensorPickup_dY"); const double dz0 = 0.0; - const double da0 = 0.0; + + const double da0 = + this->parameters()->get("RefPointCalibrationSpacers_A") + - motion_->get_position_A(); connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSpacerRefPointToSpacerGluingXYPosition_finish())); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToXYAPositionToGluePSSToSpacers_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSpacerRefPointToSpacerGluingXYPosition_start" + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGluePSSToSpacers_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; emit move_relative_request(dx0, dy0, dz0, da0); } -void AssemblyAssembly::GoFromSpacerRefPointToSpacerGluingXYPosition_finish() +void AssemblyAssembly::GoToXYAPositionToGluePSSToSpacers_finish() { disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromSpacerRefPointToSpacerGluingXYPosition_finish())); + disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToXYAPositionToGluePSSToSpacers_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromSpacerRefPointToSpacerGluingXYPosition_finish" - << ": emitting signal \"GoFromSpacerRefPointToSpacerGluingXYPosition_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGluePSSToSpacers_finish" + << ": emitting signal \"GoToXYAPositionToGluePSSToSpacers_finished\""; - emit GoFromSpacerRefPointToSpacerGluingXYPosition_finished(); + emit GoToXYAPositionToGluePSSToSpacers_finished(); - NQLog("AssemblyAssembly", NQLog::Message) << "GoFromSpacerRefPointToSpacerGluingXYPosition_finish" + NQLog("AssemblyAssembly", NQLog::Message) << "GoToXYAPositionToGluePSSToSpacers_finish" << ": assembly-step completed"; } // ---------------------------------------------------------------------------------------------------- @@ -1223,107 +1189,67 @@ void AssemblyAssembly::PickupPSPAndPSS_finish() // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -// GoToBaseplateRefPoint --------------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------------------- -void AssemblyAssembly::GoToBaseplateRefPoint_start() -{ - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) - { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoToBaseplateRefPoint_start" - << ": failed to update content of AssemblyParameters, no action taken"; - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToBaseplateRefPoint_finish" - << ": emitting signal \"GoToBaseplateRefPoint_finished\""; - - emit GoToBaseplateRefPoint_finished(); - - return; - } - - const double x0 = this->parameters()->get("RefPointBaseplate_X"); - const double y0 = this->parameters()->get("RefPointBaseplate_Y"); - const double z0 = this->parameters()->get("RefPointBaseplate_Z"); - const double a0 = this->parameters()->get("RefPointBaseplate_A"); - - connect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToBaseplateRefPoint_finish())); - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToBaseplateRefPoint_start" - << ": emitting signal \"move_absolute_request(" << x0 << ", " << y0 << ", " << z0 << ", " << a0 << ")\""; - - emit move_absolute_request(x0, y0, z0, a0); -} - -void AssemblyAssembly::GoToBaseplateRefPoint_finish() -{ - disconnect(this, SIGNAL(move_absolute_request(double, double, double, double)), motion_, SLOT(moveAbsolute(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToBaseplateRefPoint_finish())); - - NQLog("AssemblyAssembly", NQLog::Spam) << "GoToBaseplateRefPoint_finish" - << ": emitting signal \"GoToBaseplateRefPoint_finished\""; - - emit GoToBaseplateRefPoint_finished(); - - NQLog("AssemblyAssembly", NQLog::Message) << "GoToBaseplateRefPoint_finish" - << ": assembly-step completed"; -} -// ---------------------------------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------------------------------- -// GoFromBaseplateRefPointToBaseplateGluingXYPosition ------------------------------------------------- +// GoToXYAPositionToGlueSensorAssemblyToBaseplate ------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -void AssemblyAssembly::GoFromBaseplateRefPointToBaseplateGluingXYPosition_start() +void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_start() { const bool valid_params = this->parameters()->update(); if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoToXYAPositionToGlueSensorAssemblyToBaseplate_start" << ": failed to update content of AssemblyParameters, no action taken"; - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish" - << ": emitting signal \"GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish" + << ": emitting signal \"GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished\""; - emit GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished(); + emit GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished(); return; } const double dx0 = - this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") - + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") - + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") - ; + this->parameters()->get("RefPointCalibrationBaseplate_X") + + this->parameters()->get("FromRefPointCalibrationBaseplateToBaseplateEdge_dX") + + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") + + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") + - motion_->get_position_X(); + const double dy0 = - this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") - + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") - + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") - ; + this->parameters()->get("RefPointCalibrationBaseplate_Y") + + this->parameters()->get("FromRefPointCalibrationBaseplateToBaseplateEdge_dY") + + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") + + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") + + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") + - motion_->get_position_Y(); + const double dz0 = 0.0; - const double da0 = 0.0; + + const double da0 = + this->parameters()->get("RefPointCalibrationBaseplate_A") + - motion_->get_position_A(); connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish())); + connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_start" + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGlueSensorAssemblyToBaseplate_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; emit move_relative_request(dx0, dy0, dz0, da0); } -void AssemblyAssembly::GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish() +void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish() { disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish())); + disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish" - << ": emitting signal \"GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish" + << ": emitting signal \"GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished\""; - emit GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished(); + emit GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished(); - NQLog("AssemblyAssembly", NQLog::Message) << "GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish" + NQLog("AssemblyAssembly", NQLog::Message) << "GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish" << ": assembly-step completed"; } // ---------------------------------------------------------------------------------------------------- diff --git a/assembly/assemblyCommon/AssemblyAssembly.h b/assembly/assemblyCommon/AssemblyAssembly.h index c096a4ca3..96fbf7d8b 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.h +++ b/assembly/assemblyCommon/AssemblyAssembly.h @@ -77,11 +77,8 @@ class AssemblyAssembly : public QObject void PickupPSS_start(); void PickupPSS_finish(); - void GoToSpacerRefPoint_start(); - void GoToSpacerRefPoint_finish(); - - void GoFromSpacerRefPointToSpacerGluingXYPosition_start(); - void GoFromSpacerRefPointToSpacerGluingXYPosition_finish(); + void GoToXYAPositionToGluePSSToSpacers_start(); + void GoToXYAPositionToGluePSSToSpacers_finish(); void LowerPSSOntoSpacers_start(); void LowerPSSOntoSpacers_finish(); @@ -110,11 +107,8 @@ class AssemblyAssembly : public QObject void PickupPSPAndPSS_start(); void PickupPSPAndPSS_finish(); - void GoToBaseplateRefPoint_start(); - void GoToBaseplateRefPoint_finish(); - - void GoFromBaseplateRefPointToBaseplateGluingXYPosition_start(); - void GoFromBaseplateRefPointToBaseplateGluingXYPosition_finish(); + void GoToXYAPositionToGlueSensorAssemblyToBaseplate_start(); + void GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish(); void LowerSensorAssemblyOntoBaseplate_start(); void LowerSensorAssemblyOntoBaseplate_finish(); @@ -159,7 +153,7 @@ class AssemblyAssembly : public QObject void GoToSpacerRefPoint_finished(); - void GoFromSpacerRefPointToSpacerGluingXYPosition_finished(); + void GoToXYAPositionToGluePSSToSpacers_finished(); void LowerPSSOntoSpacers_finished(); @@ -182,9 +176,7 @@ class AssemblyAssembly : public QObject void PickupPSPAndPSS_finished(); - void GoToBaseplateRefPoint_finished(); - - void GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished(); + void GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished(); void LowerSensorAssemblyOntoBaseplate_finished(); // ------ diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 61cb5ed5d..668727e6b 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -233,29 +233,16 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Go To XYZA Spacer Ref-Point + // step: Go To XYA Position To Glue PS-s to Spacers { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go To XYZA Spacer Ref-Point"); + tmp_wid->button()->setText("Go To XYA Position To Glue Sensor Assembly To Baseplate"); PSSToSpacers_lay->addWidget(tmp_wid); - tmp_wid->connect_action(assembly, SLOT(GoToSpacerRefPoint_start()), SIGNAL(GoToSpacerRefPoint_finished())); - } - // ---------- - - // step: Go To XY Position To Glue Spacers to PS-s - { - ++assembly_step_N_; - - AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; - tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go To XY Position To Glue Spacers to PS-s"); - PSSToSpacers_lay->addWidget(tmp_wid); - - tmp_wid->connect_action(assembly, SLOT(GoFromSpacerRefPointToSpacerGluingXYPosition_start()), SIGNAL(GoFromSpacerRefPointToSpacerGluingXYPosition_finished())); + tmp_wid->connect_action(assembly, SLOT(GoToXYAPositionToGluePSSToSpacers_start()), SIGNAL(GoToXYAPositionToGluePSSToSpacers_finished())); } // ---------- @@ -531,29 +518,16 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl } // ---------- - // step: Go To XYZA Baseplate Ref-Point - { - ++assembly_step_N_; - - AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; - tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go To XYZA Baseplate Ref-Point"); - PSToBasep_lay->addWidget(tmp_wid); - - tmp_wid->connect_action(assembly, SLOT(GoToBaseplateRefPoint_start()), SIGNAL(GoToBaseplateRefPoint_finished())); - } - // ---------- - - // step: Go To XY Position To Glue Sensor Assembly To Baseplate + // step: Go To XYA Position To Glue Sensor Assembly To Baseplate { ++assembly_step_N_; AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go To XY Position To Glue Sensor Assembly To Baseplate"); + tmp_wid->button()->setText("Go To XYA Position To Glue Sensor Assembly To Baseplate"); PSToBasep_lay->addWidget(tmp_wid); - tmp_wid->connect_action(assembly, SLOT(GoFromBaseplateRefPointToBaseplateGluingXYPosition_start()), SIGNAL(GoFromBaseplateRefPointToBaseplateGluingXYPosition_finished())); + tmp_wid->connect_action(assembly, SLOT(GoToXYAPositionToGlueSensorAssemblyToBaseplate_start()), SIGNAL(GoToXYAPositionToGlueSensorAssemblyToBaseplate_finished())); } // ---------- diff --git a/assembly/assemblyCommon/LStepExpressMotionManager.cc b/assembly/assemblyCommon/LStepExpressMotionManager.cc index 902a5345a..6c4761159 100644 --- a/assembly/assemblyCommon/LStepExpressMotionManager.cc +++ b/assembly/assemblyCommon/LStepExpressMotionManager.cc @@ -309,7 +309,7 @@ double LStepExpressMotionManager::get_position(const int axis) const // the motion stage is not moving and the list of positions has a valid format // // output: - // * it is not safe to return if all the above conditions are not met + // * it is not safe to return if any of the conditions above is not satisfied // * this means the 'while' shoud not be broken or shortcut (a priori, it might never finish) // * after a certain number of attempts, explicit warnings are printed // From afaecc18da1d72fc4367c9a20a2a5a643414ef4d Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sat, 11 May 2019 17:47:43 +0200 Subject: [PATCH 48/58] [assembly] updated assemblyCommon/AssemblyAssembly.cc --- ...sembly_parameters_DAF_190326_balljoint.cfg | 4 +- assembly/assemblyCommon/AssemblyAssembly.cc | 420 ++++++++++-------- 2 files changed, 242 insertions(+), 182 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index c592e4068..176961193 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -12,8 +12,8 @@ Thickness_Baseplate 0.000 Thickness_PSS 0.700 Thickness_PSP 0.700 Thickness_Spacer 0.705 -Depth_SpacerSlots 0.000 -Thickness_GlueLayer 0.030 +Depth_SpacerSlots 0.350 +Thickness_GlueLayer 0.020 #################################### ### POSITIONS ###################### diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index 05a640c0a..f5267a673 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -456,41 +456,52 @@ void AssemblyAssembly::GoFromSensorMarkerToPickupXY_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LowerPickupToolOntoPSS_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPickupToolOntoPSS_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_finish" - << ": emitting signal \"LowerPickupToolOntoPSS_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPickupToolOntoPSS_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit LowerPickupToolOntoPSS_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_finish" + << ": emitting signal \"LowerPickupToolOntoPSS_finished\""; - return; - } + emit LowerPickupToolOntoPSS_finished(); - const double dx0 = 0.0; - const double dy0 = 0.0; - const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ"); - const double da0 = 0.0; + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + const double dz0 = this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ"); + const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerPickupToolOntoPSS_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerPickupToolOntoPSS_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPickupToolOntoPSS_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::LowerPickupToolOntoPSS_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_finish" + << ": emitting signal \"LowerPickupToolOntoPSS_finished\""; + + emit LowerPickupToolOntoPSS_finished(); + + return; + } } void AssemblyAssembly::LowerPickupToolOntoPSS_finish() @@ -498,9 +509,6 @@ void AssemblyAssembly::LowerPickupToolOntoPSS_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerPickupToolOntoPSS_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerPickupToolOntoPSS_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPickupToolOntoPSS_finish" << ": emitting signal \"LowerPickupToolOntoPSS_finished\""; @@ -524,7 +532,7 @@ void AssemblyAssembly::PickupPSS_start() if(dz0 <= 0.) { NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSS_start" - << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dz=" << dz0 << "), no action taken"; NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSS_finish" << ": emitting signal \"PickupPSS_finished\""; @@ -627,45 +635,61 @@ void AssemblyAssembly::GoToXYAPositionToGluePSSToSpacers_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LowerPSSOntoSpacers_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPSSOntoSpacers_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_finish" - << ": emitting signal \"LowerPSSOntoSpacers_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPSSOntoSpacers_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit LowerPSSOntoSpacers_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_finish" + << ": emitting signal \"LowerPSSOntoSpacers_finished\""; - return; - } + emit LowerPSSOntoSpacers_finished(); - const double dx0 = 0.0; - const double dy0 = 0.0; - const double dz0 = - this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") - + this->parameters()->get("Thickness_PSS") - + this->parameters()->get("Thickness_GlueLayer") - ; - const double da0 = 0.0; + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + + const double dz0 = + this->parameters()->get("CameraFocusOnAssemblyStage_Z") + - this->parameters()->get("Depth_SpacerSlots") + + this->parameters()->get("Thickness_Spacer") + + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + + this->parameters()->get("Thickness_PSS") + + this->parameters()->get("Thickness_GlueLayer") + - motion_->get_position_Z(); + + const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerPSSOntoSpacers_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerPSSOntoSpacers_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerPSSOntoSpacers_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::LowerPSSOntoSpacers_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_finish" + << ": emitting signal \"LowerPSSOntoSpacers_finished\""; + + emit LowerPSSOntoSpacers_finished(); + + return; + } } void AssemblyAssembly::LowerPSSOntoSpacers_finish() @@ -673,9 +697,6 @@ void AssemblyAssembly::LowerPSSOntoSpacers_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerPSSOntoSpacers_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerPSSOntoSpacers_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerPSSOntoSpacers_finish" << ": emitting signal \"LowerPSSOntoSpacers_finished\""; @@ -777,41 +798,52 @@ void AssemblyAssembly::RegisterPSPToPSSPosition_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" - << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; - return; - } + emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); - const double dx0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dX"); - const double dy0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dY"); - const double dz0 = this->parameters()->get("CameraFocusOnGluingStage_Z") - motion_->get_position_Z(); - const double da0 = 0.0; + return; + } + + const double dx0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dX"); + const double dy0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dY"); + const double dz0 = this->parameters()->get("CameraFocusOnGluingStage_Z") - motion_->get_position_Z(); + const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + + emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + + return; + } } void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_finish() @@ -819,9 +851,6 @@ void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; @@ -837,47 +866,59 @@ void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoGluingStage_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" - << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoGluingStage_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit LowerSpacersAndPSSOntoGluingStage_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; - return; - } + emit LowerSpacersAndPSSOntoGluingStage_finished(); - const double dx0 = 0.0; - const double dy0 = 0.0; - const double dz0 = - this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") - + this->parameters()->get("Thickness_PSS") - + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_Spacer") - + this->parameters()->get("Thickness_GlueLayer") - ; - const double da0 = 0.0; + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + + const double dz0 = + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + + this->parameters()->get("Thickness_PSS") + + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_Spacer") + + this->parameters()->get("Thickness_GlueLayer"); + + const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoGluingStage_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; + + emit LowerSpacersAndPSSOntoGluingStage_finished(); + + return; + } } void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_finish() @@ -885,9 +926,6 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoGluingStage_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoGluingStage_finish" << ": emitting signal \"LowerSpacersAndPSSOntoGluingStage_finished\""; @@ -930,7 +968,7 @@ void AssemblyAssembly::ReturnToPSPToPSSPosition_start() if(dz0 <= 0.) { NQLog("AssemblyAssembly", NQLog::Critical) << "ReturnToPSPToPSSPosition_start" - << ": invalid (non-positive) value for vertical upward movement (dZ=" << dz0 << "), no action taken"; + << ": invalid (non-positive) value for vertical upward movement (dz=" << dz0 << "), no action taken"; NQLog("AssemblyAssembly", NQLog::Spam) << "ReturnToPSPToPSSPosition_finish" << ": emitting signal \"ReturnToPSPToPSSPosition_finished\""; @@ -986,47 +1024,60 @@ void AssemblyAssembly::ReturnToPSPToPSSPosition_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoPSP_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_finish" - << ": emitting signal \"LowerSpacersAndPSSOntoPSP_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoPSP_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit LowerSpacersAndPSSOntoPSP_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoPSP_finished\""; - return; - } + emit LowerSpacersAndPSSOntoPSP_finished(); + + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + + const double dz0 = + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + + this->parameters()->get("Thickness_PSS") + + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_Spacer") + + this->parameters()->get("Thickness_GlueLayer"); + + const double da0 = 0.0; - const double dx0 = 0.0; - const double dy0 = 0.0; - const double dz0 = - this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") - + this->parameters()->get("Thickness_PSS") - + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_Spacer") - + this->parameters()->get("Thickness_GlueLayer") - ; - const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoPSP_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoPSP_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSpacersAndPSSOntoPSP_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_finish" + << ": emitting signal \"LowerSpacersAndPSSOntoPSP_finished\""; + + emit LowerSpacersAndPSSOntoPSP_finished(); + + return; + } } void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_finish() @@ -1034,9 +1085,6 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoPSP_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSpacersAndPSSOntoPSP_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSpacersAndPSSOntoPSP_finish" << ": emitting signal \"LowerSpacersAndPSSOntoPSP_finished\""; @@ -1060,7 +1108,7 @@ void AssemblyAssembly::PickupSpacersAndPSS_start() if(dz0 <= 0.) { NQLog("AssemblyAssembly", NQLog::Critical) << "PickupSpacersAndPSS_start" - << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dz=" << dz0 << "), no action taken"; NQLog("AssemblyAssembly", NQLog::Spam) << "PickupSpacersAndPSS_finish" << ": emitting signal \"PickupSpacersAndPSS_finished\""; @@ -1107,7 +1155,7 @@ void AssemblyAssembly::LiftUpPickupTool_start() if(dz0 <= 0.) { NQLog("AssemblyAssembly", NQLog::Critical) << "LiftUpPickupTool_start" - << ": invalid (non-positive) value for vertical upward movement for pickup #2 (dZ=" << dz0 << "), no action taken"; + << ": invalid (non-positive) value for vertical upward movement for pickup #2 (dz=" << dz0 << "), no action taken"; NQLog("AssemblyAssembly", NQLog::Spam) << "LiftUpPickupTool_finish" << ": emitting signal \"LiftUpPickupTool_finished\""; @@ -1154,7 +1202,7 @@ void AssemblyAssembly::PickupPSPAndPSS_start() if(dz0 <= 0.) { NQLog("AssemblyAssembly", NQLog::Critical) << "PickupPSPAndPSS_start" - << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dZ=" << dz0 << "), no action taken"; + << ": invalid (non-positive) value for vertical upward movement for pickup #1 (dz=" << dz0 << "), no action taken"; NQLog("AssemblyAssembly", NQLog::Spam) << "PickupPSPAndPSS_finish" << ": emitting signal \"PickupPSPAndPSS_finished\""; @@ -1189,7 +1237,7 @@ void AssemblyAssembly::PickupPSPAndPSS_finish() // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -// GoToXYAPositionToGlueSensorAssemblyToBaseplate ------------------------------------------------------- +// GoToXYAPositionToGlueSensorAssemblyToBaseplate ----------------------------------------------------- // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_start() { @@ -1259,49 +1307,64 @@ void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_finish() // ---------------------------------------------------------------------------------------------------- void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() { - const bool valid_params = this->parameters()->update(); - - if(valid_params == false) + if(use_smartMove_) { - NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSensorAssemblyOntoBaseplate_start" - << ": failed to update content of AssemblyParameters, no action taken"; + const bool valid_params = this->parameters()->update(); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_finish" - << ": emitting signal \"LowerSensorAssemblyOntoBaseplate_finished\""; + if(valid_params == false) + { + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSensorAssemblyOntoBaseplate_start" + << ": failed to update content of AssemblyParameters, no action taken"; - emit LowerSensorAssemblyOntoBaseplate_finished(); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_finish" + << ": emitting signal \"LowerSensorAssemblyOntoBaseplate_finished\""; - return; - } + emit LowerSensorAssemblyOntoBaseplate_finished(); - const double dx0 = 0.0; - const double dy0 = 0.0; - const double dz0 = - this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") - + this->parameters()->get("Thickness_PSS") - + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_Spacer") - + this->parameters()->get("Thickness_GlueLayer") - + this->parameters()->get("Thickness_PSP") - + this->parameters()->get("Thickness_GlueLayer") - ; - const double da0 = 0.0; + return; + } + + const double dx0 = 0.0; + const double dy0 = 0.0; + + const double dz0 = + this->parameters()->get("CameraFocusOnAssemblyStage_Z") + + this->parameters()->get("Thickness_Baseplate") + + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + + this->parameters()->get("Thickness_PSS") + + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_Spacer") + + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_PSP") + + this->parameters()->get("Thickness_GlueLayer") + - motion_->get_position_Z(); + + const double da0 = 0.0; - if(use_smartMove_) - { connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSensorAssemblyOntoBaseplate_finish())); + + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_start" + << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + + emit move_relative_request(dx0, dy0, dz0, da0); } else { - connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - connect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSensorAssemblyOntoBaseplate_finish())); - } + NQLog("AssemblyAssembly", NQLog::Critical) << "LowerSensorAssemblyOntoBaseplate_start" + << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_start" - << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; + QMessageBox msgBox; + msgBox.setText(tr("AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.exec(); - emit move_relative_request(dx0, dy0, dz0, da0); + NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_finish" + << ": emitting signal \"LowerSensorAssemblyOntoBaseplate_finished\""; + + emit LowerSensorAssemblyOntoBaseplate_finished(); + + return; + } } void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_finish() @@ -1309,9 +1372,6 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_finish() disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSensorAssemblyOntoBaseplate_finish())); - disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); - disconnect(motion_, SIGNAL(motion_finished()), this, SLOT(LowerSensorAssemblyOntoBaseplate_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "LowerSensorAssemblyOntoBaseplate_finish" << ": emitting signal \"LowerSensorAssemblyOntoBaseplate_finished\""; From 388622faf07d21cc4f5971fdd87e070d86adb9da Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 08:51:16 +0200 Subject: [PATCH 49/58] [devices/Lang] updated a stdout message --- devices/Lang/LStepExpress.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices/Lang/LStepExpress.cpp b/devices/Lang/LStepExpress.cpp index ba262156d..2c9e8493d 100644 --- a/devices/Lang/LStepExpress.cpp +++ b/devices/Lang/LStepExpress.cpp @@ -95,7 +95,7 @@ void LStepExpress::DeviceInit() { std::cout << std::endl; std::cout << " LStepExpress::DeviceInit ---"; - std::cout << " device with invalid version [Command(\"ver\") = " << buf << "]"; + std::cout << " device with invalid version [Command(\"ver\") = \"" << buf << "\"]"; std::cout << ", device set to NON AVAILABLE"; std::cout << std::endl << std::endl; @@ -114,7 +114,7 @@ void LStepExpress::DeviceInit() ){ std::cout << std::endl; std::cout << " LStepExpress::DeviceInit ---"; - std::cout << " device with invalid internal version [Command(\"iver\") = " << buf << "]"; + std::cout << " device with invalid internal version [Command(\"iver\") = \"" << buf << "\"]"; std::cout << ", device set to NON AVAILABLE"; std::cout << std::endl << std::endl; @@ -137,7 +137,7 @@ void LStepExpress::DeviceInit() ){ std::cout << std::endl; std::cout << " LStepExpress::DeviceInit ---"; - std::cout << " device with invalid serial number [Command(\"readsn\") = " << serialNumber << "]"; + std::cout << " device with invalid serial number [Command(\"readsn\") = \"" << serialNumber << "\"]"; std::cout << ", device set to NON AVAILABLE"; std::cout << std::endl << std::endl; From 6fc2b7e56c3b9796287e30ebccf14ae76d587310 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 09:22:45 +0200 Subject: [PATCH 50/58] [assembly] fixed comment in assemblyCommon/AssemblyAssemblyView.cc --- assembly/assemblyCommon/AssemblyAssemblyView.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 668727e6b..5ab1b8025 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -239,7 +239,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl AssemblyAssemblyActionWidget* tmp_wid = new AssemblyAssemblyActionWidget; tmp_wid->label() ->setText(QString::number(assembly_step_N_)); - tmp_wid->button()->setText("Go To XYA Position To Glue Sensor Assembly To Baseplate"); + tmp_wid->button()->setText("Go To XYA Position To Glue PS-s to Spacers"); PSSToSpacers_lay->addWidget(tmp_wid); tmp_wid->connect_action(assembly, SLOT(GoToXYAPositionToGluePSSToSpacers_start()), SIGNAL(GoToXYAPositionToGluePSSToSpacers_finished())); From a44dca01d5671fd9c0a8414fc5c73f98f846b714 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 09:26:23 +0200 Subject: [PATCH 51/58] [assembly] revert recent changes to assembly/assembly_parameters_DAF_190326_balljoint.cfg (will be superseded by new file) --- ...sembly_parameters_DAF_190326_balljoint.cfg | 48 +++++-------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg index 176961193..4082d7baf 100644 --- a/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg @@ -8,12 +8,13 @@ #################################### # dimensions: thickness of assembly components +Thickness_VacuumCups 0.000 Thickness_Baseplate 0.000 Thickness_PSS 0.700 Thickness_PSP 0.700 -Thickness_Spacer 0.705 -Depth_SpacerSlots 0.350 -Thickness_GlueLayer 0.020 +Thickness_Spacer 1.600 +Height_SpacerSlots 0.000 +Thickness_GlueLayer 0.030 #################################### ### POSITIONS ###################### @@ -37,31 +38,16 @@ RefPointBaseplate_Y -67.99 RefPointBaseplate_Z -3.169 RefPointBaseplate_A -0.238 -# position: ref-point on assembly platform for calibration of spacers position (spacer aligned along x-axis) -RefPointCalibrationSpacers_X 0.0 -RefPointCalibrationSpacers_Y 0.0 -RefPointCalibrationSpacers_Z 0.0 -RefPointCalibrationSpacers_A 0.0 - -# position: ref-point on assembly platform for calibration of baseplate position (spacer aligned along x-axis) -RefPointCalibrationBaseplate_X 0.0 -RefPointCalibrationBaseplate_Y 0.0 -RefPointCalibrationBaseplate_Z 0.0 -RefPointCalibrationBaseplate_A 0.0 - -#!! # position: Z-position (height) to put pickup tool in contact with rotation stage -#!! PickupToolOnRotStage_Z 0.00 -#!! -#!! # position: XYZ-position with pickup tool in contact with glue-dispensing platform -#!! PickupToolOnGluingStage_X 0.00 -#!! PickupToolOnGluingStage_Y 0.00 -#!! PickupToolOnGluingStage_Z 0.00 - -# position: z-position where camera is focused on Assembly Stage surface -CameraFocusOnAssemblyStage_Z -3.4 +# position: Z-position (height) to put pickup tool in contact with rotation stage +PickupToolOnRotStage_Z 0.00 + +# position: XYZ-position with pickup tool in contact with glue-dispensing platform +PickupToolOnGluingStage_X 0.00 +PickupToolOnGluingStage_Y 0.00 +PickupToolOnGluingStage_Z 0.00 # position: z-position where camera is focused on Gluing Stage surface -CameraFocusOnGluingStage_Z -56.693 +CamerFocusOnGluingStage_Z -2.6538 #################################### ### DISTANCES ###################### @@ -92,13 +78,5 @@ FromBaseplateRefPointToPSPRefPoint_dY -10.65 FromCameraBestFocusToPickupHeight_dZ -31.85 # distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' -FromPSPToPSSPosToGluingStage_dX -148.0 +FromPSPToPSSPosToGluingStage_dX -130.0 FromPSPToPSSPosToGluingStage_dY 0.0 - -# distance: from ref-point on assembly platform (for spacers calibration) to spacer's edge -FromRefPointCalibrationSpacersToSpacerEdge_dX 0.0 -FromRefPointCalibrationSpacersToSpacerEdge_dY 0.0 - -# distance: from ref-point on assembly platform (for baseplate calibration) to baseplate's edge -FromRefPointCalibrationBaseplateToBaseplateEdge_dX 0.0 -FromRefPointCalibrationBaseplateToBaseplateEdge_dY 0.0 From 53cce75d05536f5e855ae25d01b5564d44d01f63 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 09:27:10 +0200 Subject: [PATCH 52/58] [assembly] switched to assembly/assembly_parameters_DAF_190513_balljoint.cfg in assembly.cfg (spacer/baseplate calibration via platform ref-points) --- assembly/assembly.cfg | 2 +- ...sembly_parameters_DAF_190513_balljoint.cfg | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg diff --git a/assembly/assembly.cfg b/assembly/assembly.cfg index 1b6d1d455..7b9397062 100644 --- a/assembly/assembly.cfg +++ b/assembly/assembly.cfg @@ -40,7 +40,7 @@ startup_motion_stage 1 startup_camera 1 # AssemblyParameters -AssemblyParameters_file_path assembly_parameters_DAF_190326_balljoint.cfg # format: relative path from where binary is executed +AssemblyParameters_file_path assembly_parameters_DAF_190513_balljoint.cfg # format: relative path from where binary is executed # AssemblyZFocusFinder AssemblyZFocusFinder_zrange_max 3.0 diff --git a/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg new file mode 100644 index 000000000..f8333e3b2 --- /dev/null +++ b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg @@ -0,0 +1,103 @@ +# Sensor Ref-Point = edge of fiducial marker measured with Pattern Recognition +# Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point +# Baseplate Ref-Point = edge [...] + +#################################### +### DIMENSIONS ##################### +#################################### + +# dimensions: thickness of assembly components +Thickness_Baseplate 0.000 +Thickness_PSS 0.700 +Thickness_PSP 0.700 +Thickness_Spacer 0.705 +Depth_SpacerSlots 0.350 +Thickness_GlueLayer 0.020 + +#################################### +### POSITIONS ###################### +#################################### + +# position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) +RefPointSensor_X -69.0283 +RefPointSensor_Y -77.4945 +RefPointSensor_Z -2.7629 +RefPointSensor_A -0.307 + +# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) +RefPointSpacer_X -61.368 +RefPointSpacer_Y -78.979 +RefPointSpacer_Z -3.154 +RefPointSpacer_A -90.157 + +# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) +RefPointBaseplate_X -64.278 +RefPointBaseplate_Y -67.99 +RefPointBaseplate_Z -3.169 +RefPointBaseplate_A -0.238 + +# position: ref-point on assembly platform for calibration of baseplate position (spacer aligned along x-axis) +# values correspond to bottom-left reference-edge on assembly platform (commented values: top-right reference-edge) +RefPointCalibrationBaseplate_X -73.978 # 47.022 +RefPointCalibrationBaseplate_Y -147.989 # -56.990 +RefPointCalibrationBaseplate_Z -3.458 # -3.506 +RefPointCalibrationBaseplate_A -0.146 # -0.146 + +# position: ref-point on assembly platform for calibration of spacers position (spacer aligned along x-axis) +# values correspond to top-left reference-edge on assembly platform +RefPointCalibrationSpacers_X -58.840 +RefPointCalibrationSpacers_Y -42.150 +RefPointCalibrationSpacers_Z -3.520 +RefPointCalibrationSpacers_A -90.146 + +# position: z-position where camera is focused on Assembly Stage surface +CameraFocusOnAssemblyStage_X -15.250 +CameraFocusOnAssemblyStage_Y -96.325 +CameraFocusOnAssemblyStage_Z -3.470 +CameraFocusOnAssemblyStage_A 0.000 + +# position: z-position where camera is focused on Gluing Stage surface +CameraFocusOnGluingStage_X -144.250 +CameraFocusOnGluingStage_Y -102.325 +CameraFocusOnGluingStage_Z -56.732 +CameraFocusOnGluingStage_A 0.000 + +#################################### +### DISTANCES ###################### +#################################### + +# distance: Angle of Camera Frame in the XY Motion Stage Ref-Frame [deg] +AngleOfCameraFrameInRefFrame_dA -89.5954 + +# distance: from Sensor Ref-Point to Sensor Pickup position +FromSensorRefPointToSensorPickup_dX 86.00 +FromSensorRefPointToSensorPickup_dY 38.00 + +# distance: from PS-p Ref-Point to PS-s Ref-Point +FromPSPRefPointToPSSRefPoint_dX 1.25 +FromPSPRefPointToPSSRefPoint_dY 0.00 + +# distance: from Spacer Ref-Point to Sensor Ref-Point +FromSpacerRefPointToSensorRefPoint_dX 0.85 +FromSpacerRefPointToSensorRefPoint_dY 0.75 + +# distance: from Baseplate Ref-Point to PS-p Ref-Point +FromBaseplateRefPointToPSPRefPoint_dX 1.60 +FromBaseplateRefPointToPSPRefPoint_dY -10.65 + +# distance: dZ distance to go from Z position where camera provides best-focus on object, +# to Z position where free pickup-tool (i.e. with no other objects attached) touches the object +# - empirical value calibrated with multi-pickup tests +FromCameraBestFocusToPickupHeight_dZ -31.85 + +# distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage' +FromPSPToPSSPosToGluingStage_dX -148.0 +FromPSPToPSSPosToGluingStage_dY 0.0 + +# distance: from ref-point on assembly platform (for spacers calibration) to spacer's edge +FromRefPointCalibrationSpacersToSpacerEdge_dX -2.56 +FromRefPointCalibrationSpacersToSpacerEdge_dY -36.82 + +# distance: from ref-point on assembly platform (for baseplate calibration) to baseplate's edge +FromRefPointCalibrationBaseplateToBaseplateEdge_dX 0.0 +FromRefPointCalibrationBaseplateToBaseplateEdge_dY 0.0 From 115eb625ed6adb93dc9254afc0437d8faf06a18e Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 12:01:13 +0200 Subject: [PATCH 53/58] [assembly] bugfix in assemblyCommon/AssemblyParametersView.cc --- .../assemblyCommon/AssemblyParametersView.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 753ffbc50..1201bd0c5 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -278,11 +278,20 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) tmp_tag = "CameraFocusOnAssemblyStage"; tmp_des = "Camera Focused on Assembly Stage Surface :"; + map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); // position: z-position where camera is focused on Gluing Stage surface ++row_index; @@ -290,11 +299,20 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) tmp_tag = "CameraFocusOnGluingStage"; tmp_des = "Camera Focused on Gluing Stage Surface :"; + map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); + map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); + posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); + posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); + posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); //// --------------------- From da8fedd732f6bab5bf9193eccf22d76317f99b5c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 12:05:19 +0200 Subject: [PATCH 54/58] [assembly] clean-up of outdated parameter types (AssemblyParametersView) --- ...sembly_parameters_DAF_190513_balljoint.cfg | 36 +++++---------- .../assemblyCommon/AssemblyParametersView.cc | 44 +------------------ 2 files changed, 13 insertions(+), 67 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg index f8333e3b2..ea07a73ec 100644 --- a/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg @@ -19,22 +19,10 @@ Thickness_GlueLayer 0.020 #################################### # position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor) -RefPointSensor_X -69.0283 -RefPointSensor_Y -77.4945 -RefPointSensor_Z -2.7629 -RefPointSensor_A -0.307 - -# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis) -RefPointSpacer_X -61.368 -RefPointSpacer_Y -78.979 -RefPointSpacer_Z -3.154 -RefPointSpacer_A -90.157 - -# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis) -RefPointBaseplate_X -64.278 -RefPointBaseplate_Y -67.99 -RefPointBaseplate_Z -3.169 -RefPointBaseplate_A -0.238 +RefPointSensor_X -69.028 +RefPointSensor_Y -77.495 +RefPointSensor_Z -2.763 +RefPointSensor_A -0.307 # position: ref-point on assembly platform for calibration of baseplate position (spacer aligned along x-axis) # values correspond to bottom-left reference-edge on assembly platform (commented values: top-right reference-edge) @@ -51,16 +39,16 @@ RefPointCalibrationSpacers_Z -3.520 RefPointCalibrationSpacers_A -90.146 # position: z-position where camera is focused on Assembly Stage surface -CameraFocusOnAssemblyStage_X -15.250 -CameraFocusOnAssemblyStage_Y -96.325 -CameraFocusOnAssemblyStage_Z -3.470 -CameraFocusOnAssemblyStage_A 0.000 +CameraFocusOnAssemblyStage_X -15.250 +CameraFocusOnAssemblyStage_Y -96.325 +CameraFocusOnAssemblyStage_Z -3.470 +CameraFocusOnAssemblyStage_A 0.000 # position: z-position where camera is focused on Gluing Stage surface -CameraFocusOnGluingStage_X -144.250 -CameraFocusOnGluingStage_Y -102.325 -CameraFocusOnGluingStage_Z -56.732 -CameraFocusOnGluingStage_A 0.000 +CameraFocusOnGluingStage_X -144.250 +CameraFocusOnGluingStage_Y -102.325 +CameraFocusOnGluingStage_Z -56.732 +CameraFocusOnGluingStage_A 0.000 #################################### ### DISTANCES ###################### diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index 1201bd0c5..ae26cc7c7 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -141,49 +141,7 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) ++row_index; tmp_tag = "RefPointSensor"; - tmp_des = "Sensor Marker-1 :"; - - map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); - - posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); - posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); - - // position: XYZA position to point camera to Spacer Ref-Point - ++row_index; - - tmp_tag = "RefPointSpacer"; - tmp_des = "Spacer Ref-Point :"; - - map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_Z"] = new QLineEdit(tr("")); - map_lineEdit_[tmp_tag+"_A"] = new QLineEdit(tr("")); - - posi_lay->addWidget(new QLabel(tmp_des) , row_index, 0, Qt::AlignLeft); - posi_lay->addWidget(new QLabel(tr("X")) , row_index, 1, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_X"), row_index, 2, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("Y")) , row_index, 3, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Y"), row_index, 4, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("Z")) , row_index, 5, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_Z"), row_index, 6, Qt::AlignRight); - posi_lay->addWidget(new QLabel(tr("A")) , row_index, 7, Qt::AlignRight); - posi_lay->addWidget(this->get(tmp_tag+"_A"), row_index, 8, Qt::AlignRight); - - // position: XYZA position to point camera on Baseplate Ref-Point - ++row_index; - - tmp_tag = "RefPointBaseplate"; - tmp_des = "Baseplate Ref-Point :"; + tmp_des = "Sensor Marker-1 Ref-Point :"; map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_Y"] = new QLineEdit(tr("")); From d7de4c0402302ef79b1531018a53b2cefd7b70f0 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 12:22:00 +0200 Subject: [PATCH 55/58] [assembly] minor change in assemblyCommon/AssemblyAssembly.cc --- assembly/assemblyCommon/AssemblyAssembly.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index f5267a673..e23f3fde1 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -1053,7 +1053,6 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoPSP_start() const double da0 = 0.0; - connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(LowerSpacersAndPSSOntoPSP_finish())); @@ -1329,7 +1328,6 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() const double dz0 = this->parameters()->get("CameraFocusOnAssemblyStage_Z") - + this->parameters()->get("Thickness_Baseplate") + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") @@ -1337,6 +1335,7 @@ void AssemblyAssembly::LowerSensorAssemblyOntoBaseplate_start() + this->parameters()->get("Thickness_GlueLayer") + this->parameters()->get("Thickness_PSP") + this->parameters()->get("Thickness_GlueLayer") + + this->parameters()->get("Thickness_Baseplate") - motion_->get_position_Z(); const double da0 = 0.0; From e9567c159a0a2cd0cfa51bdf6719d2719939b7c4 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 12:25:11 +0200 Subject: [PATCH 56/58] [assembly] bugfix in assembly/AssemblyMainWindow.cc (auto-focus stop) --- assembly/assembly/AssemblyMainWindow.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/assembly/assembly/AssemblyMainWindow.cc b/assembly/assembly/AssemblyMainWindow.cc index 26a1ab929..1e70b8ef7 100644 --- a/assembly/assembly/AssemblyMainWindow.cc +++ b/assembly/assembly/AssemblyMainWindow.cc @@ -555,6 +555,7 @@ void AssemblyMainWindow::connect_images() connect(image_view_->autofocus_button(), SIGNAL(clicked()), image_ctr_, SLOT(acquire_autofocused_image())); connect(image_view_->autofocus_emergencyStop_button(), SIGNAL(clicked()), zfocus_finder_, SLOT(emergencyStop())); + connect(image_view_->autofocus_emergencyStop_button(), SIGNAL(clicked()), image_ctr_ , SLOT(restore_autofocus_settings())); NQLog("AssemblyMainWindow", NQLog::Message) << "connect_images" << ": enabled images in application view(s)"; From ff48636532643e375b0fbe16f99cb15606a51d95 Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Mon, 13 May 2019 16:42:28 +0200 Subject: [PATCH 57/58] [assembly] updated assemblyCommon/AssemblyParametersView.cc and assembly/assembly_parameters_DAF_190513_balljoint.cfg (latest naming and calibration values) --- ...sembly_parameters_DAF_190513_balljoint.cfg | 36 +++++++++---------- assembly/assemblyCommon/AssemblyAssembly.cc | 28 +++++++-------- .../assemblyCommon/AssemblyParametersView.cc | 26 +++++++------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg index ea07a73ec..ac96a9502 100644 --- a/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg +++ b/assembly/assembly/assembly_parameters_DAF_190513_balljoint.cfg @@ -7,7 +7,7 @@ #################################### # dimensions: thickness of assembly components -Thickness_Baseplate 0.000 +Thickness_Baseplate 0.200 Thickness_PSS 0.700 Thickness_PSP 0.700 Thickness_Spacer 0.705 @@ -26,17 +26,17 @@ RefPointSensor_A -0.307 # position: ref-point on assembly platform for calibration of baseplate position (spacer aligned along x-axis) # values correspond to bottom-left reference-edge on assembly platform (commented values: top-right reference-edge) -RefPointCalibrationBaseplate_X -73.978 # 47.022 -RefPointCalibrationBaseplate_Y -147.989 # -56.990 -RefPointCalibrationBaseplate_Z -3.458 # -3.506 -RefPointCalibrationBaseplate_A -0.146 # -0.146 +PlatformRefPointCalibrationBaseplate_X -73.978 # 47.022 +PlatformRefPointCalibrationBaseplate_Y -147.989 # -56.990 +PlatformRefPointCalibrationBaseplate_Z -3.458 # -3.506 +PlatformRefPointCalibrationBaseplate_A -0.146 # -0.146 # position: ref-point on assembly platform for calibration of spacers position (spacer aligned along x-axis) # values correspond to top-left reference-edge on assembly platform -RefPointCalibrationSpacers_X -58.840 -RefPointCalibrationSpacers_Y -42.150 -RefPointCalibrationSpacers_Z -3.520 -RefPointCalibrationSpacers_A -90.146 +PlatformRefPointCalibrationSpacers_X -58.840 +PlatformRefPointCalibrationSpacers_Y -42.150 +PlatformRefPointCalibrationSpacers_Z -3.520 +PlatformRefPointCalibrationSpacers_A -90.146 # position: z-position where camera is focused on Assembly Stage surface CameraFocusOnAssemblyStage_X -15.250 @@ -65,13 +65,13 @@ FromSensorRefPointToSensorPickup_dY 38.00 FromPSPRefPointToPSSRefPoint_dX 1.25 FromPSPRefPointToPSSRefPoint_dY 0.00 -# distance: from Spacer Ref-Point to Sensor Ref-Point -FromSpacerRefPointToSensorRefPoint_dX 0.85 -FromSpacerRefPointToSensorRefPoint_dY 0.75 +# distance: from Spacer Ref-Point to PS-s Ref-Point +FromSpacerEdgeToPSSRefPoint_dX 0.85 +FromSpacerEdgeToPSSRefPoint_dY 0.75 # distance: from Baseplate Ref-Point to PS-p Ref-Point -FromBaseplateRefPointToPSPRefPoint_dX 1.60 -FromBaseplateRefPointToPSPRefPoint_dY -10.65 +FromPSPEdgeToPSPRefPoint_dX 0.85 +FromPSPEdgeToPSPRefPoint_dY -0.15 # distance: dZ distance to go from Z position where camera provides best-focus on object, # to Z position where free pickup-tool (i.e. with no other objects attached) touches the object @@ -83,9 +83,9 @@ FromPSPToPSSPosToGluingStage_dX -148.0 FromPSPToPSSPosToGluingStage_dY 0.0 # distance: from ref-point on assembly platform (for spacers calibration) to spacer's edge -FromRefPointCalibrationSpacersToSpacerEdge_dX -2.56 -FromRefPointCalibrationSpacersToSpacerEdge_dY -36.82 +FromPlatformRefPointCalibrationSpacersToSpacerEdge_dX -2.57 +FromPlatformRefPointCalibrationSpacersToSpacerEdge_dY -36.82 # distance: from ref-point on assembly platform (for baseplate calibration) to baseplate's edge -FromRefPointCalibrationBaseplateToBaseplateEdge_dX 0.0 -FromRefPointCalibrationBaseplateToBaseplateEdge_dY 0.0 +FromPlatformRefPointCalibrationBaseplateToPSPEdge_dX 11.13 +FromPlatformRefPointCalibrationBaseplateToPSPEdge_dY -70.08 # -(20.92+49.16) 49.16=PSp_shortSide_length diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index e23f3fde1..d1c9c356c 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -587,23 +587,23 @@ void AssemblyAssembly::GoToXYAPositionToGluePSSToSpacers_start() } const double dx0 = - this->parameters()->get("RefPointCalibrationSpacers_X") - + this->parameters()->get("FromRefPointCalibrationSpacersToSpacerEdge_dX") - + this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dX") + this->parameters()->get("PlatformRefPointCalibrationSpacers_X") + + this->parameters()->get("FromPlatformRefPointCalibrationSpacersToSpacerEdge_dX") + + this->parameters()->get("FromSpacerEdgeToPSSRefPoint_dX") + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") - motion_->get_position_X(); const double dy0 = - this->parameters()->get("RefPointCalibrationSpacers_Y") - + this->parameters()->get("FromRefPointCalibrationSpacersToSpacerEdge_dY") - + this->parameters()->get("FromSpacerRefPointToSensorRefPoint_dY") + this->parameters()->get("PlatformRefPointCalibrationSpacers_Y") + + this->parameters()->get("FromPlatformRefPointCalibrationSpacersToSpacerEdge_dY") + + this->parameters()->get("FromSpacerEdgeToPSSRefPoint_dY") + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") - motion_->get_position_Y(); const double dz0 = 0.0; const double da0 = - this->parameters()->get("RefPointCalibrationSpacers_A") + this->parameters()->get("PlatformRefPointCalibrationSpacers_A") - motion_->get_position_A(); connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); @@ -1256,17 +1256,17 @@ void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_start() } const double dx0 = - this->parameters()->get("RefPointCalibrationBaseplate_X") - + this->parameters()->get("FromRefPointCalibrationBaseplateToBaseplateEdge_dX") - + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dX") + this->parameters()->get("PlatformRefPointCalibrationBaseplate_X") + + this->parameters()->get("FromPlatformRefPointCalibrationBaseplateToPSPEdge_dX") + + this->parameters()->get("FromPSPEdgeToPSPRefPoint_dX") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dX") + this->parameters()->get("FromSensorRefPointToSensorPickup_dX") - motion_->get_position_X(); const double dy0 = - this->parameters()->get("RefPointCalibrationBaseplate_Y") - + this->parameters()->get("FromRefPointCalibrationBaseplateToBaseplateEdge_dY") - + this->parameters()->get("FromBaseplateRefPointToPSPRefPoint_dY") + this->parameters()->get("PlatformRefPointCalibrationBaseplate_Y") + + this->parameters()->get("FromPlatformRefPointCalibrationBaseplateToPSPEdge_dY") + + this->parameters()->get("FromPSPEdgeToPSPRefPoint_dY") + this->parameters()->get("FromPSPRefPointToPSSRefPoint_dY") + this->parameters()->get("FromSensorRefPointToSensorPickup_dY") - motion_->get_position_Y(); @@ -1274,7 +1274,7 @@ void AssemblyAssembly::GoToXYAPositionToGlueSensorAssemblyToBaseplate_start() const double dz0 = 0.0; const double da0 = - this->parameters()->get("RefPointCalibrationBaseplate_A") + this->parameters()->get("PlatformRefPointCalibrationBaseplate_A") - motion_->get_position_A(); connect(this, SIGNAL(move_relative_request(double, double, double, double)), motion_, SLOT(moveRelative(double, double, double, double))); diff --git a/assembly/assemblyCommon/AssemblyParametersView.cc b/assembly/assemblyCommon/AssemblyParametersView.cc index ae26cc7c7..560e5e8d8 100644 --- a/assembly/assemblyCommon/AssemblyParametersView.cc +++ b/assembly/assemblyCommon/AssemblyParametersView.cc @@ -161,7 +161,7 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) // position: XYZA position of ref-point on assembly platform for calibration of spacers ++row_index; - tmp_tag = "RefPointCalibrationSpacers"; + tmp_tag = "PlatformRefPointCalibrationSpacers"; tmp_des = "[Calibration: Spacers] Ref-Point :"; map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); @@ -182,7 +182,7 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) // position: XYZA position of ref-point on assembly platform for calibration of baseplate ++row_index; - tmp_tag = "RefPointCalibrationBaseplate"; + tmp_tag = "PlatformRefPointCalibrationBaseplate"; tmp_des = "[Calibration: Baseplate] Ref-Point :"; map_lineEdit_[tmp_tag+"_X"] = new QLineEdit(tr("")); @@ -326,11 +326,11 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); - // distance: from Spacer Ref-Point to Sensor Ref-Point + // distance: from Spacer's Edge to PS-s Sensor Ref-Point ++row_index; - tmp_tag = "FromSpacerRefPointToSensorRefPoint"; - tmp_des = "From Spacer Ref-Point to Sensor Ref-Point :"; + tmp_tag = "FromSpacerEdgeToPSSRefPoint"; + tmp_des = "From Spacer's Edge to PS-s Ref-Point :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); @@ -341,11 +341,11 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); - // distance: from Baseplate Ref-Point to PS-s Ref-Point relative to Baseplate + // distance: from Edge of PS-p Sensor to PS-p Ref-Point ++row_index; - tmp_tag = "FromBaseplateRefPointToPSPRefPoint"; - tmp_des = "From Baseplate Ref-Point to PS-p Ref-Point :"; + tmp_tag = "FromPSPEdgeToPSPRefPoint"; + tmp_des = "From Edge of PS-p Sensor to PS-p Ref-Point :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); @@ -386,8 +386,8 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) // distance: from ref-point on assembly platform (for spacers' calibration) to spacer's edge ++row_index; - tmp_tag = "FromRefPointCalibrationSpacersToSpacerEdge"; - tmp_des = "From Ref-Point of Spacers-Calibration to Spacer's Edge :"; + tmp_tag = "FromPlatformRefPointCalibrationSpacersToSpacerEdge"; + tmp_des = "From Platform Ref-Point for Spacers-Calibration to Spacer's Edge :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); @@ -398,11 +398,11 @@ AssemblyParametersView::AssemblyParametersView(QWidget* parent) dist_lay->addWidget(new QLabel(tr("dY")) , row_index, 3, Qt::AlignRight); dist_lay->addWidget(this->get(tmp_tag+"_dY"), row_index, 4, Qt::AlignRight); - // distance: from ref-point on assembly platform (for baseplates' calibration) to baseplate's edge + // distance: from ref-point on assembly platform (for baseplate's calibration) to edge of PS-p sensor ++row_index; - tmp_tag = "FromRefPointCalibrationBaseplateToBaseplateEdge"; - tmp_des = "From Ref-Point of Baseplate-Calibration to Baseplate's Edge :"; + tmp_tag = "FromPlatformRefPointCalibrationBaseplateToPSPEdge"; + tmp_des = "From Platform Ref-Point for Baseplate-Calibration to PS-p Edge :"; map_lineEdit_[tmp_tag+"_dX"] = new QLineEdit(tr("")); map_lineEdit_[tmp_tag+"_dY"] = new QLineEdit(tr("")); From 012a4ea67f725939ed1de5369cabc473749dee4a Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Tue, 21 May 2019 09:54:32 +0200 Subject: [PATCH 58/58] [assembly] updated AssemblyAssembly.cc --- assembly/assemblyCommon/AssemblyAssembly.cc | 46 ++++++++++--------- assembly/assemblyCommon/AssemblyAssembly.h | 6 +-- .../assemblyCommon/AssemblyAssemblyView.cc | 2 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/assembly/assemblyCommon/AssemblyAssembly.cc b/assembly/assemblyCommon/AssemblyAssembly.cc index d1c9c356c..7b4ec2230 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.cc +++ b/assembly/assemblyCommon/AssemblyAssembly.cc @@ -794,9 +794,9 @@ void AssemblyAssembly::RegisterPSPToPSSPosition_finish() // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -// GoFromPSPToPSSPosToGluingStageRefPoint ------------------------------------------------------------- +// GoFromPSPToPSSPosToGluingStageRefPointXY ----------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- -void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start() +void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPointXY_start() { if(use_smartMove_) { @@ -804,59 +804,59 @@ void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start() if(valid_params == false) { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPointXY_start" << ": failed to update content of AssemblyParameters, no action taken"; - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" - << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPointXY_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPointXY_finished\""; - emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + emit GoFromPSPToPSSPosToGluingStageRefPointXY_finished(); return; } const double dx0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dX"); const double dy0 = this->parameters()->get("FromPSPToPSSPosToGluingStage_dY"); - const double dz0 = this->parameters()->get("CameraFocusOnGluingStage_Z") - motion_->get_position_Z(); + const double dz0 = 0.0; const double da0 = 0.0; connect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); - connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + connect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPointXY_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPointXY_start" << ": emitting signal \"move_relative_request(" << dx0 << ", " << dy0 << ", " << dz0 << ", " << da0 << ")\""; emit move_relative_request(dx0, dy0, dz0, da0); } else { - NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPoint_start" + NQLog("AssemblyAssembly", NQLog::Critical) << "GoFromPSPToPSSPosToGluingStageRefPointXY_start" << ": please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step"; QMessageBox msgBox; - msgBox.setText(tr("AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); + msgBox.setText(tr("AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPointXY_start -- please enable \"smartMove\" mode (tick box in top-left corner of Assembly tab), required for this step")); msgBox.exec(); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" - << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPointXY_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPointXY_finished\""; - emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + emit GoFromPSPToPSSPosToGluingStageRefPointXY_finished(); return; } } -void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPoint_finish() +void AssemblyAssembly::GoFromPSPToPSSPosToGluingStageRefPointXY_finish() { disconnect(this, SIGNAL(move_relative_request(double, double, double, double)), smart_motion_, SLOT(move_relative(double, double, double, double))); - disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_finish())); + disconnect(smart_motion_, SIGNAL(motion_completed()), this, SLOT(GoFromPSPToPSSPosToGluingStageRefPointXY_finish())); - NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" - << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPoint_finished\""; + NQLog("AssemblyAssembly", NQLog::Spam) << "GoFromPSPToPSSPosToGluingStageRefPointXY_finish" + << ": emitting signal \"GoFromPSPToPSSPosToGluingStageRefPointXY_finished\""; - emit GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + emit GoFromPSPToPSSPosToGluingStageRefPointXY_finished(); - NQLog("AssemblyAssembly", NQLog::Message) << "GoFromPSPToPSSPosToGluingStageRefPoint_finish" + NQLog("AssemblyAssembly", NQLog::Message) << "GoFromPSPToPSSPosToGluingStageRefPointXY_finish" << ": assembly-step completed"; } // ---------------------------------------------------------------------------------------------------- @@ -887,11 +887,13 @@ void AssemblyAssembly::LowerSpacersAndPSSOntoGluingStage_start() const double dy0 = 0.0; const double dz0 = - this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("CameraFocusOnGluingStage_Z") + + this->parameters()->get("FromCameraBestFocusToPickupHeight_dZ") + this->parameters()->get("Thickness_PSS") + this->parameters()->get("Thickness_GlueLayer") + this->parameters()->get("Thickness_Spacer") - + this->parameters()->get("Thickness_GlueLayer"); + + this->parameters()->get("Thickness_GlueLayer") + - motion_->get_position_Z(); const double da0 = 0.0; diff --git a/assembly/assemblyCommon/AssemblyAssembly.h b/assembly/assemblyCommon/AssemblyAssembly.h index 96fbf7d8b..cba15a5e0 100644 --- a/assembly/assemblyCommon/AssemblyAssembly.h +++ b/assembly/assemblyCommon/AssemblyAssembly.h @@ -92,8 +92,8 @@ class AssemblyAssembly : public QObject void RegisterPSPToPSSPosition_start(); void RegisterPSPToPSSPosition_finish(); - void GoFromPSPToPSSPosToGluingStageRefPoint_start(); - void GoFromPSPToPSSPosToGluingStageRefPoint_finish(); + void GoFromPSPToPSSPosToGluingStageRefPointXY_start(); + void GoFromPSPToPSSPosToGluingStageRefPointXY_finish(); void LowerSpacersAndPSSOntoGluingStage_start(); void LowerSpacersAndPSSOntoGluingStage_finish(); @@ -164,7 +164,7 @@ class AssemblyAssembly : public QObject void RegisterPSPToPSSPosition_finished(); void PSPToPSSPosition_registered(); - void GoFromPSPToPSSPosToGluingStageRefPoint_finished(); + void GoFromPSPToPSSPosToGluingStageRefPointXY_finished(); void ReturnToPSPToPSSPosition_finished(); diff --git a/assembly/assemblyCommon/AssemblyAssemblyView.cc b/assembly/assemblyCommon/AssemblyAssemblyView.cc index 5ab1b8025..0e45069ae 100644 --- a/assembly/assemblyCommon/AssemblyAssemblyView.cc +++ b/assembly/assemblyCommon/AssemblyAssemblyView.cc @@ -403,7 +403,7 @@ AssemblyAssemblyView::AssemblyAssemblyView(const AssemblyAssembly* const assembl tmp_wid->button()->setText("Go From \"PS-p To PS-s Position\" to Gluing Stage (XY) Ref-Point"); PSSToPSP_lay->addWidget(tmp_wid); - tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageRefPoint_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageRefPoint_finished())); + tmp_wid->connect_action(assembly, SLOT(GoFromPSPToPSSPosToGluingStageRefPointXY_start()), SIGNAL(GoFromPSPToPSSPosToGluingStageRefPointXY_finished())); } // ----------