7#include "buildfilteroffsets.h"
8#include <kstars_debug.h>
10#include "indi_debug.h"
11#include "kstarsdata.h"
13#include "ekos/focus/focus.h"
14#include "ekos/manager.h"
16#include "auxiliary/kspaths.h"
17#include "auxiliary/ksmessagebox.h"
18#include "ekos/auxiliary/tabledelegate.h"
21#include <QSqlTableModel>
22#include <QSqlDatabase>
25#include <basedevice.h>
40 connect(buttonBox, SIGNAL(accepted()),
this, SLOT(
close()));
41 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(
close()));
45 kcfg_FlatSyncFocus->setChecked(Options::flatSyncFocus());
48 Options::setFlatSyncFocus(kcfg_FlatSyncFocus->isChecked());
54 noEditDelegate =
new NotEditableDelegate(m_FilterView);
55 m_FilterView->setItemDelegateForColumn(FM_LABEL, noEditDelegate);
58 exposureDelegate =
new DoubleDelegate(m_FilterView, 0.001, 3600, 1);
59 m_FilterView->setItemDelegateForColumn(FM_EXPOSURE, exposureDelegate);
62 offsetDelegate =
new IntegerDelegate(m_FilterView, -10000, 10000, 1);
63 m_FilterView->setItemDelegateForColumn(FM_OFFSET, offsetDelegate);
66 useAutoFocusDelegate =
new ToggleDelegate(m_FilterView);
67 m_FilterView->setItemDelegateForColumn(FM_AUTO_FOCUS, useAutoFocusDelegate);
70 lockDelegate =
new ComboDelegate(m_FilterView);
71 m_FilterView->setItemDelegateForColumn(FM_LOCK_FILTER, lockDelegate);
72 lockDelegate->setValues(getLockDelegates());
76 lastAFSolutionDelegate =
new IntegerDelegate(m_FilterView, 0, 1000000, 1);
77 m_FilterView->setItemDelegateForColumn(FM_LAST_AF_SOLUTION, lastAFSolutionDelegate);
80 lastAFTempDelegate =
new DoubleDelegate(m_FilterView, -60.0, 60.0, 1.0);
81 m_FilterView->setItemDelegateForColumn(FM_LAST_AF_TEMP, lastAFTempDelegate);
84 lastAFAltDelegate =
new DoubleDelegate(m_FilterView, 0.0, 90.0, 1.0);
85 m_FilterView->setItemDelegateForColumn(FM_LAST_AF_ALT, lastAFAltDelegate);
88 ticksPerTempDelegate =
new DoubleDelegate(m_FilterView, -10000.0, 10000.0, 1.0);
89 m_FilterView->setItemDelegateForColumn(FM_TICKS_PER_TEMP, ticksPerTempDelegate);
92 ticksPerAltDelegate =
new DoubleDelegate(m_FilterView, -10000.0, 10000.0, 1.0);
93 m_FilterView->setItemDelegateForColumn(FM_TICKS_PER_ALT, ticksPerAltDelegate);
96 wavelengthDelegate =
new IntegerDelegate(m_FilterView, 200, 1000, 50);
97 m_FilterView->setItemDelegateForColumn(FM_WAVELENGTH, wavelengthDelegate);
100void FilterManager::createFilterModel()
105 m_FilterView->setModel(m_FilterModel);
106 m_FilterModel->setTable(
"filter");
117 m_FilterModel->setHeaderData(FM_AUTO_FOCUS,
Qt::Horizontal,
i18n(
"Start Auto Focus when filter is activated"),
121 m_FilterModel->setHeaderData(FM_LOCK_FILTER,
Qt::Horizontal,
i18n(
"Lock specific filter when running Auto Focus"),
126 i18n(
"Last AF solution. Updated automatically by the autofocus process."),
Qt::ToolTipRole);
127 m_FilterModel->setHeaderData(FM_LAST_AF_SOLUTION,
Qt::Horizontal,
i18n(
"Last AF Solution"));
130 i18n(
"The temperature of the last AF solution. Updated automatically by the autofocus process."),
Qt::ToolTipRole);
131 m_FilterModel->setHeaderData(FM_LAST_AF_TEMP,
Qt::Horizontal,
i18n(
"Last AF Temp (°C)"));
134 i18n(
"The altitude of the last AF solution. Updated automatically by the autofocus process."),
Qt::ToolTipRole);
135 m_FilterModel->setHeaderData(FM_LAST_AF_ALT,
Qt::Horizontal,
i18n(
"Last AF Alt (°Alt)"));
138 i18n(
"The number of ticks per °C increase in temperature. +ve for outward focuser movement"),
Qt::ToolTipRole);
142 i18n(
"The number of ticks per degree increase in altitude. +ve for outward focuser movement"),
Qt::ToolTipRole);
154 if (topLeft.
column() == FM_EXPOSURE)
155 emit exposureChanged(m_FilterModel->data(topLeft).toDouble());
156 else if (topLeft.
column() == FM_LOCK_FILTER)
160 QString lock = m_FilterModel->
data(m_FilterModel->index(topLeft.
row(), topLeft.
column())).toString();
161 QString filter = m_FilterModel->data(m_FilterModel->index(topLeft.
row(), FM_LABEL)).toString();
162 bool alreadyALock =
false;
163 for (
int i = 0; i < m_ActiveFilters.count(); i++)
165 if (m_ActiveFilters[i]->lockedFilter() == filter)
171 if (alreadyALock || (lock == filter))
173 m_FilterModel->setData(m_FilterModel->index(topLeft.
row(), topLeft.
column()), NULL_FILTER);
176 lockDelegate->setValues(getLockDelegates());
178 else if (topLeft.
column() == FM_TICKS_PER_TEMP)
179 emit ticksPerTempChanged();
180 else if (topLeft.
column() == FM_TICKS_PER_ALT)
181 emit ticksPerAltChanged();
182 else if (topLeft.
column() == FM_WAVELENGTH)
183 emit wavelengthChanged();
187void FilterManager::refreshFilterModel()
189 if (m_FilterWheel ==
nullptr || m_currentFilterLabels.empty())
193 if (m_FilterModel ==
nullptr)
196 QString vendor(m_FilterWheel->getDeviceName());
197 m_FilterModel->setFilter(
QString(
"vendor='%1'").arg(vendor));
198 m_FilterModel->select();
200 m_FilterView->hideColumn(0);
201 m_FilterView->hideColumn(1);
202 m_FilterView->hideColumn(2);
203 m_FilterView->hideColumn(3);
207 if (m_FilterModel->rowCount() > 0 && m_FilterModel->rowCount() != m_currentFilterLabels.count())
209 for (
int i = 0; i < m_FilterModel->rowCount(); i++)
210 m_FilterModel->removeRow(i);
212 m_FilterModel->select();
216 if (m_FilterModel->rowCount() == 0)
218 filterProperties *fp =
new filterProperties(vendor,
"",
"",
"");
219 for (
QString &filter : m_currentFilterLabels)
225 m_FilterModel->select();
230 for (
int i = 0; i < m_FilterModel->rowCount(); ++i)
232 QModelIndex index = m_FilterModel->index(i, FM_LABEL);
233 if (m_FilterModel->data(index).toString() != m_currentFilterLabels[i])
235 m_FilterModel->setData(index, m_currentFilterLabels[i]);
240 lockDelegate->setValues(getLockDelegates());
246void FilterManager::resizeDialog()
250 int width = m_FilterView->horizontalHeader()->length() + 50;
251 int height =
label->height() + m_FilterView->verticalHeader()->
length() + label_2->height() + buttonBox->height() + 100;
252 this->resize(width, height);
260 for (
int i = 0; i < m_ActiveFilters.count(); i++)
262 if (m_ActiveFilters[i]->lockedFilter() == NULL_FILTER)
263 lockDelegates.
append(m_ActiveFilters[i]->color());
265 return lockDelegates;
268void FilterManager::reloadFilters()
270 qDeleteAll(m_ActiveFilters);
271 currentFilter =
nullptr;
272 targetFilter =
nullptr;
273 m_ActiveFilters.clear();
274 operationQueue.clear();
276 filterProperties *fp =
new filterProperties(
"",
"",
"",
"");
278 for (
int i = 0; i < m_FilterModel->rowCount(); ++i)
290 fp->useAutoFocus = record.
value(
"UseAutoFocus").
toInt() == 1;
291 fp->absFocusPos = record.
value(
"AbsoluteFocusPosition").
toInt();
292 fp->focusTemperature = record.
value(
"FocusTemperature").
toDouble();
293 fp->focusAltitude = record.
value(
"FocusAltitude").
toDouble();
294 fp->focusTicksPerTemp = record.
value(
"FocusTicksPerTemp").
toDouble();
295 fp->focusTicksPerAlt = record.
value(
"FocusTicksPerAlt").
toDouble();
296 fp->wavelength = record.
value(
"Wavelength").
toInt();
298 m_ActiveFilters.append(o);
302void FilterManager::setFilterWheel(ISD::FilterWheel *filter)
305 if (m_FilterWheel == filter && m_FilterNameProperty && m_FilterPositionProperty)
307 else if (m_FilterWheel)
308 m_FilterWheel->disconnect(
this);
312 m_FilterNameProperty =
nullptr;
313 m_FilterPositionProperty =
nullptr;
314 m_FilterConfirmSet =
nullptr;
319 connect(m_FilterWheel, &ISD::ConcreteDevice::propertyUpdated,
this, &FilterManager::updateProperty);
320 connect(m_FilterWheel, &ISD::ConcreteDevice::Disconnected,
this, &FilterManager::processDisconnect);
322 refreshFilterProperties();
325void FilterManager::refreshFilterProperties()
327 if (m_FilterNameProperty && m_FilterPositionProperty)
329 if (m_FilterConfirmSet ==
nullptr)
330 m_FilterConfirmSet = m_FilterWheel->getSwitch(
"CONFIRM_FILTER_SET");
333 if (m_currentFilterLabels.count() == m_FilterNameProperty->ntp)
337 filterNameLabel->setText(m_FilterWheel->getDeviceName());
339 m_currentFilterLabels.clear();
341 m_FilterNameProperty = m_FilterWheel->getText(
"FILTER_NAME");
342 m_FilterPositionProperty = m_FilterWheel->getNumber(
"FILTER_SLOT");
343 m_FilterConfirmSet = m_FilterWheel->getSwitch(
"CONFIRM_FILTER_SET");
345 refreshFilterLabels();
346 refreshFilterPosition();
348 if (m_currentFilterPosition >= 1 && m_currentFilterPosition <= m_ActiveFilters.count())
349 lastFilterOffset = m_ActiveFilters[m_currentFilterPosition - 1]->offset();
352QStringList FilterManager::getFilterLabels(
bool forceRefresh)
354 if ((!m_currentFilterLabels.empty() && forceRefresh ==
false) || !m_FilterNameProperty || !m_FilterPositionProperty)
355 return m_currentFilterLabels;
359 for (
int i = 0; i < m_FilterPositionProperty->np[0].max; i++)
361 if (m_FilterNameProperty !=
nullptr && (i < m_FilterNameProperty->ntp))
362 filterList.
append(m_FilterNameProperty->tp[i].text);
368int FilterManager::getFilterPosition(
bool forceRefresh)
370 if (forceRefresh ==
false || m_FilterPositionProperty ==
nullptr)
371 return m_currentFilterPosition;
373 return static_cast<int>(m_FilterPositionProperty->np[0].value);
376void FilterManager::refreshFilterLabels()
378 QList filters = getFilterLabels(
true);
380 if (filters != m_currentFilterLabels)
382 m_currentFilterLabels = filters;
383 refreshFilterModel();
385 emit labelsChanged(filters);
388 refreshFilterPosition();
392void FilterManager::refreshFilterPosition()
395 int pos = getFilterPosition(
true);
396 if (pos != m_currentFilterPosition)
398 m_currentFilterPosition = pos;
399 emit positionChanged(pos);
403bool FilterManager::setFilterPosition(uint8_t position, FilterPolicy policy)
406 if (position > m_ActiveFilters.count())
410 currentFilter = m_ActiveFilters[m_currentFilterPosition - 1];
411 targetFilter = m_ActiveFilters[position - 1];
413 if (currentFilter == targetFilter)
419 buildOperationQueue(FILTER_CHANGE);
421 executeOperationQueue();
427void FilterManager::updateProperty(INDI::Property prop)
429 if (m_FilterWheel ==
nullptr || m_FilterWheel->getDeviceName() != prop.getDeviceName())
432 if (prop.isNameMatch(
"FILTER_NAME"))
434 auto tvp = prop.getText();
435 m_FilterNameProperty = tvp;
437 refreshFilterLabels();
439 else if (prop.isNameMatch(
"FILTER_SLOT"))
441 auto nvp = prop.getNumber();
442 if (nvp->s != IPS_OK)
445 m_FilterPositionProperty = nvp;
446 refreshFilterPosition();
448 if (state == FILTER_CHANGE)
449 executeOperationQueue();
451 else if (state == FILTER_IDLE && m_ActiveFilters.count() >= m_currentFilterPosition)
452 lastFilterOffset = m_ActiveFilters[m_currentFilterPosition - 1]->offset();
457void FilterManager::processDisconnect()
459 m_currentFilterLabels.clear();
460 m_currentFilterPosition = -1;
461 m_FilterNameProperty =
nullptr;
462 m_FilterPositionProperty =
nullptr;
465void FilterManager::buildOperationQueue(FilterState operation)
467 operationQueue.clear();
468 m_useTargetFilter =
false;
474 if ( (m_Policy & CHANGE_POLICY) && targetFilter != currentFilter)
475 m_useTargetFilter =
true;
477 if (m_useTargetFilter)
479 operationQueue.enqueue(FILTER_CHANGE);
480 if (m_FocusReady && (m_Policy & OFFSET_POLICY))
481 operationQueue.enqueue(FILTER_OFFSET);
485 lastFilterOffset = targetFilter->offset();
486 currentFilter = targetFilter;
491 if (m_FocusReady && (m_Policy & AUTOFOCUS_POLICY) && targetFilter->useAutoFocus())
492 operationQueue.enqueue(FILTER_AUTOFOCUS);
501bool FilterManager::executeOperationQueue()
503 if (operationQueue.isEmpty())
506 emit newStatus(state);
511 FilterState nextOperation = operationQueue.dequeue();
513 bool actionRequired =
true;
515 switch (nextOperation)
519 if (m_ConfirmationPending)
522 state = FILTER_CHANGE;
523 if (m_useTargetFilter)
524 targetFilterPosition = m_ActiveFilters.indexOf(targetFilter) + 1;
525 m_FilterWheel->setPosition(targetFilterPosition);
527 emit newStatus(state);
529 if (m_FilterConfirmSet)
534 m_ConfirmationPending =
false;
535 m_FilterWheel->confirmFilter();
540 m_ConfirmationPending =
false;
543 m_ConfirmationPending =
true;
545 KSMessageBox::Instance()->questionYesNo(
i18n(
"Set filter to %1. Is filter set?", targetFilter->color()),
546 i18n(
"Confirm Filter"));
553 state = FILTER_OFFSET;
554 if (m_useTargetFilter)
556 targetFilterOffset = targetFilter->offset() - lastFilterOffset;
557 lastFilterOffset = targetFilter->offset();
558 currentFilter = targetFilter;
559 m_useTargetFilter =
false;
561 if (targetFilterOffset == 0)
562 actionRequired =
false;
565 emit newFocusOffset(targetFilterOffset,
false);
566 emit newStatus(state);
571 case FILTER_AUTOFOCUS:
572 state = FILTER_AUTOFOCUS;
573 qCDebug(KSTARS) <<
"FilterManager.cpp is triggering autofocus.";
574 emit newStatus(state);
575 emit runAutoFocus(AutofocusReason::FOCUS_FILTER,
"");
587 return executeOperationQueue();
590bool FilterManager::executeOneOperation(FilterState operation)
592 bool actionRequired =
false;
600 return actionRequired;
603void FilterManager::setFocusOffsetComplete()
605 if (state == FILTER_OFFSET)
606 executeOperationQueue();
609double FilterManager::getFilterExposure(
const QString &name)
const
611 auto filterDetails = getFilterByName(name);
613 return filterDetails->exposure();
619bool FilterManager::setFilterExposure(
int index,
double exposure)
621 if (m_currentFilterLabels.empty())
624 QString color = m_currentFilterLabels[index];
625 for (
int i = 0; i < m_ActiveFilters.count(); i++)
627 if (color == m_ActiveFilters[i]->color())
629 m_FilterModel->setData(m_FilterModel->index(i, FM_EXPOSURE), exposure);
630 m_FilterModel->submitAll();
631 refreshFilterModel();
639int FilterManager::getFilterOffset(
const QString &name)
const
641 int offset = INVALID_VALUE;
642 auto filterDetails = getFilterByName(name);
644 offset = filterDetails->offset();
649bool FilterManager::setFilterOffset(
QString color,
int offset)
651 if (m_currentFilterLabels.empty())
654 for (
int i = 0; i < m_ActiveFilters.count(); i++)
656 if (color == m_ActiveFilters[i]->color())
658 m_FilterModel->setData(m_FilterModel->index(i, FM_OFFSET), offset);
659 m_FilterModel->submitAll();
660 refreshFilterModel();
668bool FilterManager::getFilterAbsoluteFocusDetails(
const QString &name,
int &focusPos,
double &focusTemp,
669 double &focusAlt)
const
671 auto filterDetails = getFilterByName(name);
674 focusPos = filterDetails->absoluteFocusPosition();
675 focusTemp = filterDetails->focusTemperature();
676 focusAlt = filterDetails->focusAltitude();
683bool FilterManager::setFilterAbsoluteFocusDetails(
int index,
int focusPos,
double focusTemp,
double focusAlt)
685 if (index < 0 || index >= m_currentFilterLabels.count())
688 QString color = m_currentFilterLabels[index];
689 for (
int i = 0; i < m_ActiveFilters.count(); i++)
691 if (color == m_ActiveFilters[i]->color())
693 m_FilterModel->setData(m_FilterModel->index(i, FM_LAST_AF_SOLUTION), focusPos);
694 m_FilterModel->setData(m_FilterModel->index(i, FM_LAST_AF_TEMP), focusTemp);
695 m_FilterModel->setData(m_FilterModel->index(i, FM_LAST_AF_ALT), focusAlt);
696 m_FilterModel->submitAll();
697 refreshFilterModel();
707 auto filterDetails = getFilterByName(name);
709 return filterDetails->lockedFilter();
715bool FilterManager::setFilterLock(
int index,
QString name)
717 if (m_currentFilterLabels.empty())
720 QString color = m_currentFilterLabels[index];
721 for (
int i = 0; i < m_ActiveFilters.count(); i++)
723 if (color == m_ActiveFilters[i]->color())
725 m_FilterModel->setData(m_FilterModel->index(i, FM_LOCK_FILTER), name);
726 m_FilterModel->submitAll();
727 refreshFilterModel();
735int FilterManager::getFilterWavelength(
const QString &name)
const
737 auto filterDetails = getFilterByName(name);
739 return filterDetails->wavelength();
745double FilterManager::getFilterTicksPerTemp(
const QString &name)
const
747 auto filterDetails = getFilterByName(name);
749 return filterDetails->focusTicksPerTemp();
755double FilterManager::getFilterTicksPerAlt(
const QString &name)
const
757 auto filterDetails = getFilterByName(name);
759 return filterDetails->focusTicksPerAlt();
767 if (m_currentFilterLabels.empty() ||
768 m_currentFilterPosition < 1 ||
769 m_currentFilterPosition > m_currentFilterLabels.count())
774 color = m_currentFilterLabels[m_currentFilterPosition - 1];
776 auto pos = std::find_if(m_ActiveFilters.begin(), m_ActiveFilters.end(), [color](
OAL::Filter * oneFilter)
778 return (oneFilter->color() == color);
781 if (pos != m_ActiveFilters.end())
789 if (m_FilterWheel && (m_FilterWheel->getDeviceName() == device->getDeviceName()))
791 m_FilterNameProperty =
nullptr;
792 m_FilterPositionProperty =
nullptr;
793 m_FilterWheel =
nullptr;
794 m_currentFilterLabels.clear();
795 m_currentFilterPosition = 0;
796 qDeleteAll(m_ActiveFilters);
797 m_ActiveFilters.clear();
798 delete(m_FilterModel);
799 m_FilterModel =
nullptr;
803void FilterManager::setFocusStatus(Ekos::FocusState focusState)
805 if (state == FILTER_AUTOFOCUS)
810 executeOperationQueue();
821 emit runAutoFocus(AutofocusReason::FOCUS_FILTER,
"");
831bool FilterManager::syncAbsoluteFocusPosition(
int index)
833 if (index < 0 || index > m_ActiveFilters.count())
838 qCWarning(KSTARS_INDI) << __FUNCTION__ <<
"index" << index <<
"is out of bounds.";
844 auto absFocusPos = m_ActiveFilters[index]->absoluteFocusPosition();
846 if (m_FocusAbsPosition == absFocusPos || absFocusPos <= 0)
848 m_FocusAbsPositionPending =
false;
851 else if (m_FocusAbsPositionPending ==
false)
853 m_FocusAbsPositionPending =
true;
854 emit newFocusOffset(absFocusPos,
true);
860bool FilterManager::setFilterNames(
const QStringList &newLabels)
862 if (m_FilterWheel ==
nullptr || m_currentFilterLabels.empty())
865 m_FilterWheel->setLabels(newLabels);
876 for (
int i = 0; i < m_FilterModel->rowCount(); ++i)
881 {
"label", m_FilterModel->data(m_FilterModel->index(i, FM_LABEL)).toString()},
882 {
"exposure", m_FilterModel->data(m_FilterModel->index(i, FM_EXPOSURE)).toDouble()},
883 {
"offset", m_FilterModel->data(m_FilterModel->index(i, FM_OFFSET)).toInt()},
884 {
"autofocus", m_FilterModel->data(m_FilterModel->index(i, FM_AUTO_FOCUS)).toBool()},
885 {
"lock", m_FilterModel->data(m_FilterModel->index(i, FM_LOCK_FILTER)).toString()},
886 {
"lastafsolution", m_FilterModel->data(m_FilterModel->index(i, FM_LAST_AF_SOLUTION)).toInt()},
887 {
"lastaftemp", m_FilterModel->data(m_FilterModel->index(i, FM_LAST_AF_TEMP)).toDouble()},
888 {
"lastafalt", m_FilterModel->data(m_FilterModel->index(i, FM_LAST_AF_ALT)).toDouble()},
889 {
"tickspertemp", m_FilterModel->data(m_FilterModel->index(i, FM_TICKS_PER_TEMP)).toDouble()},
890 {
"ticksperalt", m_FilterModel->data(m_FilterModel->index(i, FM_TICKS_PER_ALT)).toDouble()},
891 {
"wavelength", m_FilterModel->data(m_FilterModel->index(i, FM_WAVELENGTH)).toInt()},
894 filters.
append(oneFilter);
899 {
"device", m_FilterWheel->getDeviceName()},
907void FilterManager::setFilterData(
const QJsonObject &settings)
912 if (settings[
"device"].
toString() != m_FilterWheel->getDeviceName())
915 QJsonArray filters = settings[
"filters"].toArray();
918 for (
auto oneFilterRef : filters)
921 int row = oneFilter[
"index"].toInt();
923 labels[row] = oneFilter[
"label"].toString();
924 m_FilterModel->setData(m_FilterModel->index(row, FM_LABEL), oneFilter[
"label"].toString());
925 m_FilterModel->setData(m_FilterModel->index(row, FM_EXPOSURE), oneFilter[
"exposure"].toDouble());
926 m_FilterModel->setData(m_FilterModel->index(row, FM_OFFSET), oneFilter[
"offset"].toInt());
927 m_FilterModel->setData(m_FilterModel->index(row, FM_AUTO_FOCUS), oneFilter[
"autofocus"].toBool());
928 m_FilterModel->setData(m_FilterModel->index(row, FM_LOCK_FILTER), oneFilter[
"lock"].toString());
929 m_FilterModel->setData(m_FilterModel->index(row, FM_LAST_AF_SOLUTION), oneFilter[
"lastafsolution"].toInt());
930 m_FilterModel->setData(m_FilterModel->index(row, FM_LAST_AF_TEMP), oneFilter[
"lastaftemp"].toDouble());
931 m_FilterModel->setData(m_FilterModel->index(row, FM_LAST_AF_ALT), oneFilter[
"lastafalt"].toDouble());
932 m_FilterModel->setData(m_FilterModel->index(row, FM_TICKS_PER_TEMP), oneFilter[
"tickspertemp"].toDouble());
933 m_FilterModel->setData(m_FilterModel->index(row, FM_TICKS_PER_ALT), oneFilter[
"ticksperalt"].toDouble());
934 m_FilterModel->setData(m_FilterModel->index(row, FM_WAVELENGTH), oneFilter[
"wavelength"].toInt());
937 m_FilterModel->submitAll();
938 setFilterNames(labels);
940 refreshFilterModel();
943void FilterManager::buildFilterOffsets()
947 Ekos::Manager::Instance()->getFilterManager(m_FilterWheel->getDeviceName(), filterManager);
948 BuildFilterOffsets bfo(filterManager);
951void FilterManager::signalRunAutoFocus(AutofocusReason autofocusReason,
const QString &reasonInfo)
954 emit runAutoFocus(autofocusReason, reasonInfo);
957void FilterManager::autoFocusComplete(FocusState completionState,
int currentPosition,
double currentTemperature,
961 emit autoFocusDone(completionState, currentPosition, currentTemperature, currentAlt);
964void FilterManager::signalAbortAutoFocus()
967 emit abortAutoFocus();
bool AddFilter(const filterProperties *fp)
Add a new filter to the database.
Information of user filters.
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
Ekos is an advanced Astrophotography tool for Linux.
QString name(StandardAction id)
const QList< QKeySequence > & close()
QString label(StandardShortcut id)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void append(const QJsonValue &value)
void append(QList< T > &&value)
bool disconnect(const QMetaObject::Connection &connection)
QSqlDatabase database(const QString &connectionName, bool open)
QVariant value(const QString &name) const const
bool isEmpty() const const
qsizetype length() const const
QFuture< void > filter(QThreadPool *pool, Sequence &sequence, KeepFunctor &&filterFunction)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
double toDouble(bool *ok) const const
int toInt(bool *ok) const const
QString toString() const const