Kstars

analyze.h
1/*
2 SPDX-FileCopyrightText: 2020 Hy Murveit <hy@murveit.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef ANALYZE_H
8#define ANALYZE_H
9
10#include <memory>
11#include "ekos/ekos.h"
12#include "ekos/mount/mount.h"
13#include "indi/indimount.h"
14#include "yaxistool.h"
15#include "ui_analyze.h"
16#include "ekos/manager/meridianflipstate.h"
17#include "ekos/focus/focusutils.h"
18
19class FITSViewer;
20class OffsetDateTimeTicker;
21class QCustomPlot;
22
23namespace Ekos
24{
25
26class RmsFilter;
27
28/**
29 *@class Analyze
30 *@short Analysis tab for Ekos sessions.
31 *@author Hy Murveit
32 *@version 1.0
33 */
34class Analyze : public QWidget, public Ui::Analyze
35{
37
38 public:
39 Analyze();
40 ~Analyze();
41
42 // Baseclass used to represent a segment of Timeline data.
43 class Session
44 {
45 public:
46 // Start and end time in seconds since start of the log.
47 double start, end;
48 // y-offset for the timeline plot. Each line uses a different integer.
49 int offset;
50 // Variables used in temporary sessions. A temporary session
51 // represents a process that has started but not yet finished.
52 // Those are plotted "for now", but will be replaced by the
53 // finished line when the process completes.
54 // Rect is the temporary graphic on the Timeline, and
55 // temporaryBrush defines its look.
57 QBrush temporaryBrush;
58
59 Session(double s, double e, int o, QCPItemRect *r)
60 : start(s), end(e), offset(o), rect(r) {}
61
62 Session() : start(0), end(0), offset(0), rect(nullptr) {}
63
64 // These 2 are used to build tables for the details display.
65 void setupTable(const QString &name, const QString &status,
66 const QDateTime &startClock, const QDateTime &endClock,
67 QTableWidget *table);
68 void addRow(const QString &key, const QString &value);
69
70 // True if this session is temporary.
71 bool isTemporary() const;
72
73 private:
74 QTableWidget *details;
75 QString htmlString;
76 };
77 // Below are subclasses of Session used to represent all the different
78 // lines in the Timeline. Each of those hold different types of information
79 // about the process it represents.
80 class CaptureSession : public Session
81 {
82 public:
83 bool aborted;
84 QString filename;
85 double duration;
86 QString filter;
87 double hfr;
88 CaptureSession(double start_, double end_, QCPItemRect *rect,
89 bool aborted_, const QString &filename_,
90 double duration_, const QString &filter_)
91 : Session(start_, end_, CAPTURE_Y, rect),
92 aborted(aborted_), filename(filename_),
93 duration(duration_), filter(filter_), hfr(0) {}
94 CaptureSession() : Session(0, 0, CAPTURE_Y, nullptr) {}
95 };
96 // Guide sessions collapse some of the possible guiding states.
97 // SimpleGuideState are those collapsed states.
98 typedef enum
99 {
100 G_IDLE, G_GUIDING, G_CALIBRATING, G_SUSPENDED, G_DITHERING, G_IGNORE
101 } SimpleGuideState;
102 class GuideSession : public Session
103 {
104 public:
105 SimpleGuideState simpleState;
106 GuideSession(double start_, double end_, QCPItemRect *rect, SimpleGuideState state_)
107 : Session(start_, end_, GUIDE_Y, rect), simpleState(state_) {}
108 GuideSession() : Session(0, 0, GUIDE_Y, nullptr) {}
109 };
110 class AlignSession : public Session
111 {
112 public:
113 AlignState state;
114 AlignSession(double start_, double end_, QCPItemRect *rect, AlignState state_)
115 : Session(start_, end_, ALIGN_Y, rect), state(state_) {}
116 AlignSession() : Session(0, 0, ALIGN_Y, nullptr) {}
117 };
118 class MountSession : public Session
119 {
120 public:
121 ISD::Mount::Status state;
122 MountSession(double start_, double end_, QCPItemRect *rect, ISD::Mount::Status state_)
123 : Session(start_, end_, MOUNT_Y, rect), state(state_) {}
124 MountSession() : Session(0, 0, MOUNT_Y, nullptr) {}
125 };
126 class MountFlipSession : public Session
127 {
128 public:
129 MeridianFlipState::MeridianFlipMountState state;
130 MountFlipSession(double start_, double end_, QCPItemRect *rect, MeridianFlipState::MeridianFlipMountState state_)
131 : Session(start_, end_, MERIDIAN_MOUNT_FLIP_Y, rect), state(state_) {}
132 MountFlipSession() : Session(0, 0, MERIDIAN_MOUNT_FLIP_Y, nullptr) {}
133 };
134 class SchedulerJobSession : public Session
135 {
136 public:
137 SchedulerJobSession(double start_, double end_, QCPItemRect *rect,
138 const QString &jobName_, const QString &reason_)
139 : Session(start_, end_, SCHEDULER_Y, rect), jobName(jobName_), reason(reason_) {}
140 SchedulerJobSession() : Session(0, 0, SCHEDULER_Y, nullptr) {}
141 QString jobName;
142 QString reason;
143 };
144 class FocusSession : public Session
145 {
146 public:
147 bool success;
148 double temperature;
149 QString filter;
150
151 // Standard focus parameters
152 AutofocusReason reason;
153 QString reasonInfo;
154 QString points;
155 bool useWeights;
156 QString curve;
157 QString title;
158 AutofocusFailReason failCode;
159 QString failCodeInfo;
160 QVector<double> positions; // Double to be more friendly to QCustomPlot addData.
161 QVector<double> hfrs;
162 QVector<double> weights;
163 QVector<bool> outliers;
164
165 // Adaptive focus parameters
166 double tempTicks, altitude, altTicks;
167 int prevPosError, thisPosError, totalTicks, adaptedPosition;
168
169 // false for adaptiveFocus.
170 bool standardSession = true;
171
172 FocusSession() : Session(0, 0, FOCUS_Y, nullptr) {}
173 FocusSession(double start_, double end_, QCPItemRect *rect, bool ok, double temperature_,
174 const QString &filter_, const QString &points_, const QString &curve_, const QString &title_);
175 FocusSession(double start_, double end_, QCPItemRect *rect, bool ok, double temperature_,
176 const QString &filter_, const AutofocusReason reason_, const QString &reasonInfo_, const QString &points_, const bool useWeights_,
177 const QString &curve_, const QString &title_, const AutofocusFailReason failCode_, const QString failCodeInfo_);
178 FocusSession(double start_, double end_, QCPItemRect *rect,
179 const QString &filter_, double temperature_, double tempTicks_, double altitude_,
180 double altTicks_, int prevPosError, int thisPosError, int totalTicks_, int position_);
181 double focusPosition();
182 };
183
184 // This will cause the .analyze file to reset -- that is, stop appending to any
185 // .analyze file that's already open and start writing a new .analyze file.
186 // All graphics will be reset such that the session begins "now".
187 void restart();
188
189 void clearLog();
190 QStringList logText()
191 {
192 return m_LogText;
193 }
194 QString getLogText()
195 {
196 return m_LogText.join("\n");
197 }
198
199 public slots:
200 // These slots are messages received from the different Ekos processes
201 // used to gather data about those processes.
202
203 // From Capture
204 void captureComplete(const QVariantMap &metadata);
205 void captureStarting(double exposureSeconds, const QString &filter);
206 void captureAborted(double exposureSeconds);
207
208 // From Guide
209 void guideState(Ekos::GuideState status);
210 void guideStats(double raError, double decError, int raPulse, int decPulse,
211 double snr, double skyBg, int numStars);
212
213 // From Focus
214 void autofocusStarting(double temperature, const QString &filter, const AutofocusReason reason, const QString &reasonInfo);
215 void autofocusComplete(const double temperature, const QString &filter, const QString &points, const bool useWeights,
216 const QString &curve, const QString &title);
217 void adaptiveFocusComplete(const QString &filter, double temperature, double tempTicks,
218 double altitude, double altTicks, int prevPosError, int thisPosError, int totalTicks,
219 int position, bool focuserMoved);
220 void autofocusAborted(const QString &filter, const QString &points, const bool useWeights,
221 const AutofocusFailReason failCode, const QString failCodeInfo);
222 void newTemperature(double temperatureDelta, double temperature);
223
224 // From Align
225 void alignState(Ekos::AlignState state);
226
227 // From Mount
228 void mountState(ISD::Mount::Status status);
229 void mountCoords(const SkyPoint &position, ISD::Mount::PierSide pierSide, const dms &haValue);
230 void mountFlipStatus(Ekos::MeridianFlipState::MeridianFlipMountState status);
231
232 void schedulerJobStarted(const QString &jobName);
233 void schedulerJobEnded(const QString &jobName, const QString &endReason);
234 void newTargetDistance(double targetDistance);
235
236 // From YAxisTool
237 void userChangedYAxis(QObject *key, const YAxisInfo &axisInfo);
238 void userSetLeftAxis(QCPAxis *axis);
239 void userSetAxisColor(QObject *key, const YAxisInfo &axisInfo, const QColor &color);
240
241 void yAxisRangeChanged(const QCPRange &newRange);
242
243 void appendLogText(const QString &);
244
245 private slots:
246
247 signals:
248 void newLog(const QString &text);
249
250 private:
251
252 // The file-reading, processInputLine(), and signal-slot codepaths share the methods below
253 // to process their messages. Time is the offset in seconds from the start of the log.
254 // BatchMode is true in the file reading path. It means don't call replot() as there may be
255 // many more messages to come. The rest of the args are specific to the message type.
256 void processCaptureStarting(double time, double exposureSeconds, const QString &filter);
257 void processCaptureComplete(double time, const QString &filename, double exposureSeconds, const QString &filter,
258 double hfr, int numStars, int median, double eccentricity, bool batchMode = false);
259 void processCaptureAborted(double time, double exposureSeconds, bool batchMode = false);
260 void processAutofocusStarting(double time, double temperature, const QString &filter, const AutofocusReason reason, const QString &reasonInfo);
261 void processAutofocusComplete(double time, const QString &filter, const QString &points, const QString &curve, const QString &title, bool batchMode);
262 void processAutofocusCompleteV2(double time, double temperature, const QString &filter, const AutofocusReason reason, const QString &reasonInfo,
263 const QString &points, const bool useWeights, const QString &curve, const QString &title, bool batchMode = false);
264 void processAutofocusAborted(double time, const QString &filter, const QString &points, bool batchMode);
265 void processAutofocusAbortedV2(double time, double temperature, const QString &filter, const AutofocusReason reason, const QString &reasonInfo,
266 const QString &points, const bool useWeights, const AutofocusFailReason failCode, const QString failCodeInfo, bool batchMode = false);
267 void processAdaptiveFocusComplete(double time, const QString &filter, double temperature, double tempTicks,
268 double altitude, double altTicks, int prevPosError, int thisPosError, int totalTicks,
269 int position, bool focuserMoved, bool batchMode = false);
270 void processTemperature(double time, double temperature, bool batchMode = false);
271 void processGuideState(double time, const QString &state, bool batchMode = false);
272 void processGuideStats(double time, double raError, double decError, int raPulse,
273 int decPulse, double snr, double skyBg, int numStars, bool batchMode = false);
274 void processMountCoords(double time, double ra, double dec, double az, double alt,
275 int pierSide, double ha, bool batchMode = false);
276
277 void processMountState(double time, const QString &statusString, bool batchMode = false);
278 void processAlignState(double time, const QString &statusString, bool batchMode = false);
279 void processMountFlipState(double time, const QString &statusString, bool batchMode = false);
280
281 void processSchedulerJobStarted(double time, const QString &jobName);
282 void processSchedulerJobEnded(double time, const QString &jobName, const QString &reason, bool batchMode = false);
283 void checkForMissingSchedulerJobEnd(double time);
284 void processTargetDistance(double time, double targetDistance, bool batchMode = false);
285
286 // Plotting primatives.
287 void replot(bool adjustSlider = true);
288 void zoomIn();
289 void zoomOut();
290 void scroll(int value);
291 void scrollRight();
292 void scrollLeft();
293 void statsYZoom(double zoomAmount);
294 void statsYZoomIn();
295 void statsYZoomOut();
296 // Return true if the session is visible on the plots.
297 bool isVisible(const Session &s) const;
298 // Shift the view so that time is at the center (keeping the current plot width).
299 void adjustView(double time);
300
301
302 // maxXValue keeps the largest time offset we've received so far.
303 // It represents the extent of the plots (0 -> maxXValue).
304 // This is called each time a message is received in case that message's
305 // time is past the current value of maxXValue.
306 void updateMaxX(double time);
307
308 // Callbacks for when the timeline is clicked. ProcessTimelineClick
309 // will determine which segment on which line was clicked and then
310 // call captureSessionClicked() or focusSessionClicked, etc.
311 void processTimelineClick(QMouseEvent *event, bool doubleClick);
312 void captureSessionClicked(CaptureSession &c, bool doubleClick);
313 void focusSessionClicked(FocusSession &c, bool doubleClick);
314 void guideSessionClicked(GuideSession &c, bool doubleClick);
315 void mountSessionClicked(MountSession &c, bool doubleClick);
316 void alignSessionClicked(AlignSession &c, bool doubleClick);
317 void mountFlipSessionClicked(MountFlipSession &c, bool doubleClick);
318 void schedulerSessionClicked(SchedulerJobSession &c, bool doubleClick);
319
320 // Low-level callbacks.
321 // These two call processTimelineClick().
322 void timelineMousePress(QMouseEvent *event);
323 void timelineMouseDoubleClick(QMouseEvent *event);
324 // Calls zoomIn or zoomOut.
325 void timelineMouseWheel(QWheelEvent *event);
326 // Sets the various displays visbile or not according to the checkboxes.
327 void setVisibility();
328
329 void processStatsClick(QMouseEvent *event, bool doubleClick);
330 void statsMousePress(QMouseEvent *event);
331 void statsMouseDoubleClick(QMouseEvent *event);
332 void statsMouseMove(QMouseEvent *event);
333 void setupKeyboardShortcuts(QWidget *plot);
334
335 // (Un)highlights a segment on the timeline after one is clicked.
336 // This indicates which segment's data is displayed in the
337 // graphicsPlot and details table.
338 void highlightTimelineItem(const Session &session);
339 void unhighlightTimelineItem();
340
341 // Tied to the keyboard shortcuts that go to the next or previous
342 // items on the timeline. next==true means next, otherwise previous.
343 void changeTimelineItem(bool next);
344 // These are assigned to various keystrokes.
345 void nextTimelineItem();
346 void previousTimelineItem();
347
348 // logTime() returns the number of seconds between "now" or "time" and
349 // the start of the log. They are useful for recording signal and storing
350 // them to file. They are not useful when reading data from files.
351 double logTime();
352 // Returns the number of seconds between time and the start of the log.
353 double logTime(const QDateTime &time);
354 // Goes back from logSeconds to human-readable clock time.
355 QDateTime clockTime(double logSeconds);
356
357 // Add a new segment to the Timeline graph.
358 // Returns a rect item, which is only important temporary objects, who
359 // need to erase the item when the temporary session is removed.
360 // This memory is owned by QCustomPlot and shouldn't be freed.
361 // This pointer is stored in Session::rect.
362 QCPItemRect * addSession(double start, double end, double y,
363 const QBrush &brush, const QBrush *stripeBrush = nullptr);
364
365 // Manage temporary sessions (only used for live data--file-reading doesn't
366 // need temporary sessions). For example, when an image capture has started
367 // but not yet completed, a temporary session is added to the timeline to
368 // represent the not-yet-completed capture.
369 void addTemporarySession(Session *session, double time, double duration,
370 int y_offset, const QBrush &brush);
371 void removeTemporarySession(Session *session);
372 void removeTemporarySessions();
373 void adjustTemporarySession(Session *session);
374 void adjustTemporarySessions();
375
376 // Add new stats to the statsPlot.
377 void addGuideStats(double raDrift, double decDrift, int raPulse, int decPulse,
378 double snr, int numStars, double skyBackground, double time);
379 void addGuideStatsInternal(double raDrift, double decDrift, double raPulse,
380 double decPulse, double snr, double numStars,
381 double skyBackground, double drift, double rms, double time);
382 void addMountCoords(double ra, double dec, double az, double alt, int pierSide,
383 double ha, double time);
384 void addHFR(double hfr, int numCaptureStars, int median, double eccentricity,
385 const double time, double startTime);
386 void addTemperature(double temperature, const double time);
387 void addFocusPosition(double focusPosition, double time);
388 void addTargetDistance(double targetDistance, const double time);
389
390 // Initialize the graphs (axes, linestyle, pen, name, checkbox callbacks).
391 // Returns the graph index.
392 int initGraph(QCustomPlot *plot, QCPAxis *yAxis, QCPGraph::LineStyle lineStyle,
393 const QColor &color, const QString &name);
394 template <typename Func>
395 int initGraphAndCB(QCustomPlot *plot, QCPAxis *yAxis, QCPGraph::LineStyle lineStyle,
396 const QColor &color, const QString &name, const QString &shortName,
397 QCheckBox *cb, Func setCb, QLineEdit *out = nullptr);
398
399 // Make graphs visible/invisible & add/delete them from the legend.
400 void toggleGraph(int graph_id, bool show);
401
402 // Initializes the main QCustomPlot windows.
403 void initStatsPlot();
404 void initTimelinePlot();
405 void initGraphicsPlot();
406 void initInputSelection();
407
408 // Displays the focus positions and HFRs on the graphics plot.
409 void displayFocusGraphics(const QVector<double> &positions, const QVector<double> &hfrs, const bool useWeights,
410 const QVector<double> &weights, const QVector<bool> &outliers, const QString &curve, const QString &title, bool success);
411 // Displays the guider ra and dec drift plot, and computes RMS errors.
412 void displayGuideGraphics(double start, double end, double *raRMS,
413 double *decRMS, double *totalRMS, int *numSamples);
414
415 // Updates the stats value display boxes next to their checkboxes.
416 void updateStatsValues();
417 // Manages the statsPlot cursor.
418 void setStatsCursor(double time);
419 void removeStatsCursor();
420 void keepCurrent(int state);
421
422 // Restore checkboxs from Options.
423 void initStatsCheckboxes();
424
425 // Clears the data, resets the various plots & displays.
426 void reset();
427 void resetGraphicsPlot();
428
429 // Resets the variables used to process the signals received.
430 void resetCaptureState();
431 void resetAutofocusState();
432 void resetGuideState();
433 void resetGuideStats();
434 void resetAlignState();
435 void resetMountState();
436 void resetMountCoords();
437 void resetMountFlipState();
438 void resetSchedulerJob();
439 void resetTemperature();
440
441 // Read and display an input .analyze file.
442 double readDataFromFile(const QString &filename);
443 double processInputLine(const QString &line);
444
445 // Opens a FITS file for viewing.
446 void displayFITS(const QString &filename);
447
448 // Write the analyze log file message.
449 void saveMessage(const QString &type, const QString &message);
450 // low level file writing.
451 void startLog();
452 void appendToLog(const QString &lines);
453
454 // Used to capture double clicks on stats output QLineEdits to set y-axis limits.
455 bool eventFilter(QObject *o, QEvent *e) override;
456 QTimer clickTimer;
457 YAxisInfo m_ClickTimerInfo;
458
459 // Utility that adds a y-axis to the stats plot.
460 QCPAxis *newStatsYAxis(const QString &label, double lower = YAxisInfo::LOWER_RESCALE,
461 double upper = YAxisInfo::UPPER_RESCALE);
462
463 // Save and restore user-updated y-axis limits.
464 QString serializeYAxes();
465 bool restoreYAxes(const QString &encoding);
466
467 // Sets the y-axis to be displayed on the left of the statsPlot.
468 void setLeftAxis(QCPAxis *axis);
469 void updateYAxisMap(QObject *key, const YAxisInfo &axisInfo);
470
471 // The pop-up allowing users to edit y-axis lower and upper graph values.
472 YAxisTool m_YAxisTool;
473
474 // The y-axis values displayed to the left of the stat's graph.
475 QCPAxis *activeYAxis { nullptr };
476
477 void startYAxisTool(QObject *key, const YAxisInfo &info);
478
479 // Map connecting QLineEdits to Y-Axes, so when a QLineEdit is double clicked,
480 // the corresponding y-axis can be found.
481 std::map<QObject*, YAxisInfo> yAxisMap;
482
483 // The .analyze log file being written.
484 QString logFilename { "" };
485 QSharedPointer<QFile> logFile;
486 bool logInitialized { false };
487
488 // These define the view for the timeline and stats plots.
489 // The plots start plotStart seconds from the start of the session, and
490 // are plotWidth seconds long. The end of the X-axis is maxXValue.
491 double plotStart { 0.0 };
492 double plotWidth { 10.0 };
493 double maxXValue { 10.0 };
494
495 // Data are displayed in seconds since the session started.
496 // analyzeStartTime is when the session started, used to translate to clock time.
497 QDateTime analyzeStartTime;
498 QString analyzeTimeZone { "" };
499 bool startTimeInitialized { false };
500
501 // displayStartTime is similar to analyzeStartTime, but references the
502 // start of the log being displayed (e.g. if reading from a file).
503 // When displaying the current session it should equal analyzeStartTime.
504 QDateTime displayStartTime;
505
506 // AddGuideStats uses RmsFilter to compute RMS values of the squared
507 // RA and DEC errors, thus calculating the RMS error.
508 std::unique_ptr<RmsFilter> guiderRms;
509 std::unique_ptr<RmsFilter> captureRms;
510
511 // Used to keep track of the y-axis position when moving it with the mouse.
512 double yAxisInitialPos = { 0 };
513
514 // Used to display clock-time on the X-axis.
516
517 // The rectangle over the current selection.
518 // Memory owned by QCustomPlot.
519 QCPItemRect *selectionHighlight { nullptr };
520
521 // FITS Viewer to display FITS images.
523 int fitsViewerTabID { 0 };
524
525 // The vertical line in the stats plot.
526 QCPItemLine *statsCursor { nullptr };
527 QCPItemLine *timelineCursor { nullptr };
528 double statsCursorTime { -1 };
529
530 // Keeps the directory from the last time the user loaded a .analyze file.
531 QUrl dirPath;
532 // This is the .analyze file we're displaying, if we're not displaying the currently active session.
533 QUrl displayedSession;
534 QString getNextFile(bool after);
535
536 // Display other .analyze files.
537 void nextFile();
538 void prevFile();
539 void displayFile(const QUrl &url, bool forceCurrentSession = false);
540
541 // True if Analyze is displaying data as it comes in from the other modules.
542 // False if Analyze is displaying data read from a file.
543 bool runtimeDisplay { true };
544
545 // When a module's session is ongoing, we represent it as a "temporary session"
546 // which will be replaced once the session is done.
547 CaptureSession temporaryCaptureSession;
548 FocusSession temporaryFocusSession;
549 GuideSession temporaryGuideSession;
550 AlignSession temporaryAlignSession;
551 MountSession temporaryMountSession;
552 MountFlipSession temporaryMountFlipSession;
553 SchedulerJobSession temporarySchedulerJobSession;
554
555 // Capture state-machine variables.
556 double captureStartedTime { -1 };
557 double previousCaptureStartedTime { 1 };
558 double previousCaptureCompletedTime { 1 };
559 QString captureStartedFilter { "" };
560
561 // Autofocus state-machine variables.
562 double autofocusStartedTime { -1 };
563 QString autofocusStartedFilter { "" };
564 double autofocusStartedTemperature { 0 };
565 AutofocusReason autofocusStartedReason { AutofocusReason::FOCUS_NONE};
566 QString autofocusStartedReasonInfo { "" };
567
568 // GuideState state-machine variables.
569 SimpleGuideState lastGuideStateStarted { G_IDLE };
570 double guideStateStartedTime { -1 };
571
572 // GuideStats state-machine variables.
573 double lastGuideStatsTime { -1 };
574 double lastCaptureRmsTime { -1 };
575 int numStarsMax { 0 };
576 double snrMax { 0 };
577 double skyBgMax { 0 };
578 int medianMax { 0 };
579 int numCaptureStarsMax { 0 };
580 double lastTemperature { -1000 };
581
582 // AlignState state-machine variables.
583 AlignState lastAlignStateReceived { ALIGN_IDLE };
584 AlignState lastAlignStateStarted { ALIGN_IDLE };
585 double lastAlignStateStartedTime { -1 };
586
587 // MountState state-machine variables.
588 double mountStateStartedTime { -1 };
589 ISD::Mount::Status lastMountState { ISD::Mount::Status::MOUNT_IDLE };
590
591 // Mount coords state machine variables.
592 // Used to filter out mount Coords messages--we only process ones
593 // where the values have changed significantly.
594 double lastMountRa { -1 };
595 double lastMountDec { -1 };
596 double lastMountHa { -1 };
597 double lastMountAz { -1 };
598 double lastMountAlt { -1 };
599 int lastMountPierSide { -1 };
600
601 // Flip state machine variables
602 MeridianFlipState::MeridianFlipMountState lastMountFlipStateReceived { MeridianFlipState::MOUNT_FLIP_NONE};
603 MeridianFlipState::MeridianFlipMountState lastMountFlipStateStarted { MeridianFlipState::MOUNT_FLIP_NONE };
604 double mountFlipStateStartedTime { -1 };
605
606 // SchedulerJob state machine variables
607 double schedulerJobStartedTime;
608 QString schedulerJobStartedJobName;
609
610 QMap<QString, QColor> schedulerJobColors;
611 QBrush schedulerJobBrush(const QString &jobName, bool temporary);
612
613 void setSelectedSession(const Session &s);
614 void clearSelectedSession();
615 Session m_selectedSession;
616
617 // Analyze log file info.
618 QStringList m_LogText;
619
620 // Y-offsets for the timeline plot for the various modules.
621 static constexpr int CAPTURE_Y = 1;
622 static constexpr int FOCUS_Y = 2;
623 static constexpr int ALIGN_Y = 3;
624 static constexpr int GUIDE_Y = 4;
625 static constexpr int MERIDIAN_MOUNT_FLIP_Y = 5;
626 static constexpr int MOUNT_Y = 6;
627 static constexpr int SCHEDULER_Y = 7;
628 static constexpr int LAST_Y = 8;
629
630 // Error bars used on the Focus graphs
631 QCPErrorBars *errorBars = nullptr;
632 QCPErrorBars *finalErrorBars = nullptr;
633};
634}
635
636
637#endif // Analyze
Primary window to view monochrome and color FITS images.
Definition fitsviewer.h:54
Manages a single axis inside a QCustomPlot.
A plottable that adds a set of error bars to other plottables.
A line from one point to another.
A rectangle.
Represents the range an axis is encompassing.
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Manages adjusting the Y-axis of Analyze stats graphs.
Definition yaxistool.h:69
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
AlignState
Definition ekos.h:145
@ ALIGN_IDLE
No ongoing operations.
Definition ekos.h:146
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QWidget(QWidget *parent, Qt::WindowFlags f)
virtual bool event(QEvent *event) override
void lower()
void show()
bool isVisible() const const
Used to keep track of the various Y-axes and connect them to the QLineEdits.
Definition yaxistool.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:58:34 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.