Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/scheduler/schedulerjob.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
83 | 83 | | |||
84 | /* Refresh estimated time - which update job cells */ | 84 | /* Refresh estimated time - which update job cells */ | ||
85 | setEstimatedTime(estimatedTime); | 85 | setEstimatedTime(estimatedTime); | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | void SchedulerJob::setCompletionCondition(const CompletionCondition &value) | 88 | void SchedulerJob::setCompletionCondition(const CompletionCondition &value) | ||
89 | { | 89 | { | ||
90 | completionCondition = value; | 90 | completionCondition = value; | ||
91 | | ||||
92 | // Update repeats requirement, looping jobs have none | ||||
93 | switch (completionCondition) | ||||
94 | { | ||||
95 | case FINISH_AT: | ||||
96 | case FINISH_LOOP: | ||||
97 | if (0 < getRepeatsRequired()) | ||||
98 | setRepeatsRequired(0); | ||||
99 | break; | ||||
100 | | ||||
101 | case FINISH_SEQUENCE: | ||||
102 | if (1 != getRepeatsRequired()) | ||||
103 | setRepeatsRequired(1); | ||||
104 | break; | ||||
105 | | ||||
106 | case FINISH_REPEAT: | ||||
107 | if (0 == getRepeatsRequired()) | ||||
108 | setRepeatsRequired(1); | ||||
109 | break; | ||||
110 | | ||||
111 | default: break; | ||||
112 | } | ||||
113 | | ||||
91 | updateJobCell(); | 114 | updateJobCell(); | ||
92 | } | 115 | } | ||
93 | 116 | | |||
94 | void SchedulerJob::setStepPipeline(const StepPipeline &value) | 117 | void SchedulerJob::setStepPipeline(const StepPipeline &value) | ||
95 | { | 118 | { | ||
96 | stepPipeline = value; | 119 | stepPipeline = value; | ||
97 | } | 120 | } | ||
98 | 121 | | |||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | |||||
293 | void SchedulerJob::setLightFramesRequired(bool value) | 316 | void SchedulerJob::setLightFramesRequired(bool value) | ||
294 | { | 317 | { | ||
295 | lightFramesRequired = value; | 318 | lightFramesRequired = value; | ||
296 | } | 319 | } | ||
297 | 320 | | |||
298 | void SchedulerJob::setRepeatsRequired(const uint16_t &value) | 321 | void SchedulerJob::setRepeatsRequired(const uint16_t &value) | ||
299 | { | 322 | { | ||
300 | repeatsRequired = value; | 323 | repeatsRequired = value; | ||
324 | | ||||
325 | // Update completion condition to be compatible | ||||
326 | if (1 < repeatsRequired) | ||||
327 | { | ||||
328 | if (FINISH_REPEAT != completionCondition) | ||||
329 | setCompletionCondition(FINISH_REPEAT); | ||||
330 | } | ||||
331 | else if (0 < repeatsRequired) | ||||
332 | { | ||||
333 | if (FINISH_SEQUENCE != completionCondition) | ||||
334 | setCompletionCondition(FINISH_SEQUENCE); | ||||
335 | } | ||||
336 | else | ||||
337 | { | ||||
338 | if (FINISH_LOOP != completionCondition) | ||||
339 | setCompletionCondition(FINISH_LOOP); | ||||
340 | } | ||||
341 | | ||||
301 | updateJobCell(); | 342 | updateJobCell(); | ||
302 | } | 343 | } | ||
303 | 344 | | |||
304 | void SchedulerJob::setRepeatsRemaining(const uint16_t &value) | 345 | void SchedulerJob::setRepeatsRemaining(const uint16_t &value) | ||
305 | { | 346 | { | ||
306 | repeatsRemaining = value; | 347 | repeatsRemaining = value; | ||
307 | updateJobCell(); | 348 | updateJobCell(); | ||
308 | } | 349 | } | ||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 513 | else | |||
473 | /* Invalid marker */ | 514 | /* Invalid marker */ | ||
474 | estimatedTimeCell->setText("-"); | 515 | estimatedTimeCell->setText("-"); | ||
475 | 516 | | |||
476 | estimatedTimeCell->tableWidget()->resizeColumnToContents(estimatedTimeCell->column()); | 517 | estimatedTimeCell->tableWidget()->resizeColumnToContents(estimatedTimeCell->column()); | ||
477 | } | 518 | } | ||
478 | 519 | | |||
479 | if (captureCountCell && captureCountCell->tableWidget()) | 520 | if (captureCountCell && captureCountCell->tableWidget()) | ||
480 | { | 521 | { | ||
522 | switch (completionCondition) | ||||
523 | { | ||||
524 | case FINISH_LOOP: | ||||
525 | case FINISH_AT: | ||||
526 | // If looping, display the count of completed frames | ||||
527 | captureCountCell->setText(QString("%L1").arg(completedCount)); | ||||
528 | break; | ||||
529 | | ||||
530 | case FINISH_SEQUENCE: | ||||
531 | case FINISH_REPEAT: | ||||
532 | default: | ||||
533 | // If repeating, display the count of completed frames to the count of requested frames | ||||
481 | captureCountCell->setText(QString("%L1/%L2").arg(completedCount).arg(sequenceCount)); | 534 | captureCountCell->setText(QString("%L1/%L2").arg(completedCount).arg(sequenceCount)); | ||
535 | break; | ||||
536 | } | ||||
482 | captureCountCell->tableWidget()->resizeColumnToContents(captureCountCell->column()); | 537 | captureCountCell->tableWidget()->resizeColumnToContents(captureCountCell->column()); | ||
483 | } | 538 | } | ||
484 | 539 | | |||
485 | if (scoreCell && scoreCell->tableWidget()) | 540 | if (scoreCell && scoreCell->tableWidget()) | ||
486 | { | 541 | { | ||
487 | if (0 <= score) | 542 | if (0 <= score) | ||
488 | scoreCell->setText(QString("%L1").arg(score)); | 543 | scoreCell->setText(QString("%L1").arg(score)); | ||
489 | else | 544 | else | ||
Show All 38 Lines |