Skip to content

Commit

Permalink
Merge pull request #87 from aglowacki/master
Browse files Browse the repository at this point in the history
Adding bluesky qserver api calls throught zmq
  • Loading branch information
aglowacki authored Aug 12, 2024
2 parents 87e087a + 7100d76 commit 083f795
Show file tree
Hide file tree
Showing 24 changed files with 1,358 additions and 128 deletions.
Binary file added images/chip_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/chip_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions src/gstar/Annotation/ScanRegionGraphicsItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ using namespace gstar;

//---------------------------------------------------------------------------

ScanRegionGraphicsItem::ScanRegionGraphicsItem(AbstractGraphicsItem* parent)
ScanRegionGraphicsItem::ScanRegionGraphicsItem(std::map<QString, BlueskyPlan> * avail_scans, AbstractGraphicsItem* parent)
: UProbeRegionGraphicsItem(parent)
{

_avail_scans = avail_scans;
_scan_dialog.setAvailScans(avail_scans);
connect(&_scan_dialog, &ScanRegionDialog::ScanUpdated, this, &ScanRegionGraphicsItem::onScanUpdated);

prependProperty(new AnnotationProperty("Edit", QIcon(":/images/editing.png")));
Expand Down Expand Up @@ -124,7 +125,7 @@ const QString ScanRegionGraphicsItem::displayName() const

ScanRegionGraphicsItem* ScanRegionGraphicsItem::cloneRegion()
{
ScanRegionGraphicsItem* newRegion = new ScanRegionGraphicsItem();
ScanRegionGraphicsItem* newRegion = new ScanRegionGraphicsItem(_avail_scans);

//newRegion->m_outlineColor = m_outlineColor;
newRegion->m_rect = m_rect;
Expand All @@ -142,10 +143,18 @@ QDialog* ScanRegionGraphicsItem::get_custom_dialog()

//---------------------------------------------------------------------------

void ScanRegionGraphicsItem::onScanUpdated()
void ScanRegionGraphicsItem::onScanUpdated(const BlueskyPlan& plan)
{

setPropertyValue(DEF_STR_DISPLAY_NAME, _scan_dialog.getScanName());
BlueskyPlan nplan = plan;
nplan.name = _scan_dialog.getScanName();
BlueskyParam meta_data;
meta_data.name = "md";
meta_data.default_val = nplan.name;
meta_data.description = "Link to scan name";
nplan.parameters["md"] = meta_data;
emit scanUpdated(nplan);

}
/*
Expand Down
10 changes: 8 additions & 2 deletions src/gstar/Annotation/ScanRegionGraphicsItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "gstar/CoordinateModel.h"
#include "gstar/Annotation/UProbeRegionGraphicsItem.h"
#include "mvc/ScanRegionDialog.h"
#include "mvc/BlueSkyPlan.h"

//---------------------------------------------------------------------------

Expand All @@ -46,7 +47,7 @@ Q_OBJECT
* @param h - height
* @param parent - parent Qt widget
*/
ScanRegionGraphicsItem(AbstractGraphicsItem* parent = 0);
ScanRegionGraphicsItem(std::map<QString, BlueskyPlan> * avail_scans, AbstractGraphicsItem* parent = 0);

/**
* @brief MarkerGraphicsItem
Expand Down Expand Up @@ -148,13 +149,18 @@ Q_OBJECT
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
*/

signals:

void scanUpdated(const BlueskyPlan &plan);

public slots:

void onScanUpdated();
void onScanUpdated(const BlueskyPlan &plan);

private:
ScanRegionDialog _scan_dialog;

std::map<QString, BlueskyPlan> *_avail_scans;
/*
void initialScale();
Expand Down
2 changes: 1 addition & 1 deletion src/mvc/BatchRoiFitWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void BatchRoiFitWidget::createLayout()

_cb_opt_method = new QComboBox();
_cb_opt_method->addItem(STR_HYBRID_MP_FIT);
_cb_opt_method->addItem(STR_LM_FIT);
_cb_opt_method->addItem(STR_MP_FIT);
_cb_opt_method->addItem(STR_LM_FIT);
connect(_cb_opt_method, &QComboBox::currentTextChanged, this, &BatchRoiFitWidget::optimizer_changed);

_file_list_model = new QStandardItemModel();
Expand Down
Loading

0 comments on commit 083f795

Please sign in to comment.