+
diff --git a/desktop/src/app/settings/settings.component.ts b/desktop/src/app/settings/settings.component.ts
index 6ceb802ae..d625254ee 100644
--- a/desktop/src/app/settings/settings.component.ts
+++ b/desktop/src/app/settings/settings.component.ts
@@ -18,7 +18,6 @@ export class SettingsComponent implements AfterViewInit, OnDestroy {
locations: Location[] = []
location = Object.assign({}, EMPTY_LOCATION)
- private deletedLocations: Location[] = []
readonly plateSolvers: PlateSolverType[] = ['ASTAP', 'ASTROMETRY_NET']
plateSolver!: PlateSolverOptions
@@ -43,20 +42,12 @@ export class SettingsComponent implements AfterViewInit, OnDestroy {
private prime: PrimeService,
) {
app.title = 'Settings'
-
- app.extra.push({
- icon: 'mdi mdi-content-save',
- tooltip: 'Save changes',
- command: () => {
- this.save()
- }
- })
}
async ngAfterViewInit() {
this.plateSolver = await this.api.getPlateSolverSettings()
- this.loadLocation()
+ this.loadLocations()
}
@HostListener('window:unload')
@@ -73,52 +64,37 @@ export class SettingsComponent implements AfterViewInit, OnDestroy {
private async showLocation(location: Location) {
const result = await this.prime.open(LocationDialog, { header: 'Location', data: location })
- if (result && !this.locations.includes(result)) {
- this.locations.push(result)
+ if (result) {
+ await this.api.saveLocation(result)
+ await this.loadLocations()
+ this.electron.send('LOCATION_CHANGED', this.location)
}
}
- private async loadLocation() {
+ private async loadLocations() {
this.locations = await this.api.locations()
this.location = this.locations.find(e => e.selected) ?? this.locations[0] ?? EMPTY_LOCATION
- }
- async deleteLocation() {
- if (this.location.id > 0) {
- this.deletedLocations.push(this.location)
+ if (this.location.id && !this.location.selected) {
+ this.location.selected = true
+ this.api.saveLocation(this.location)
}
+ }
- const index = this.locations.indexOf(this.location)
-
- if (index >= 0) {
- const deletedLocation = this.locations[index]
- this.locations.splice(index, 1)
-
- if (this.location === deletedLocation) {
- this.location = this.locations[0]
- this.location.selected = true
- }
- }
+ async deleteLocation() {
+ await this.api.deleteLocation(this.location)
+ await this.loadLocations()
+ this.electron.send('LOCATION_CHANGED', this.location)
}
locationChanged() {
this.locations.forEach(e => e.selected = false)
this.location.selected = true
+ this.locations.forEach(e => this.api.saveLocation(e))
+ this.electron.send('LOCATION_CHANGED', this.location)
}
async save() {
- for (const location of this.locations) {
- await this.api.saveLocation(location)
- }
-
- for (const location of this.deletedLocations) {
- await this.api.deleteLocation(location)
- }
-
- this.deletedLocations = []
- await this.loadLocation()
- this.electron.send('LOCATION_CHANGED', this.location)
-
- this.api.setPlateSolverSettings(this.plateSolver)
+ this.api.updatePlateSolverSettings(this.plateSolver)
}
}
\ No newline at end of file
diff --git a/desktop/src/assets/icons/CREDITS.md b/desktop/src/assets/icons/CREDITS.md
index 9640a1559..c9b465176 100644
--- a/desktop/src/assets/icons/CREDITS.md
+++ b/desktop/src/assets/icons/CREDITS.md
@@ -26,7 +26,7 @@
* https://www.flaticon.com/free-icon/stars_3266390
* https://www.flaticon.com/free-icon/milky-way_1086076
* https://www.flaticon.com/free-icon/satellite_1086093
-* https://www.flaticon.com/free-icon/schedule_3652191
* https://www.flaticon.com/free-icon/search_10770011
* https://www.flaticon.com/free-icon/stack_3342239
+* https://www.flaticon.com/free-icon/workflow_7400612
* https://thenounproject.com/icon/random-dither-4259782
diff --git a/desktop/src/assets/icons/brazil.png b/desktop/src/assets/icons/brazil.png
new file mode 100644
index 000000000..e6ec11e47
Binary files /dev/null and b/desktop/src/assets/icons/brazil.png differ
diff --git a/desktop/src/assets/icons/schedule.png b/desktop/src/assets/icons/schedule.png
deleted file mode 100644
index 5b879191a..000000000
Binary files a/desktop/src/assets/icons/schedule.png and /dev/null differ
diff --git a/desktop/src/assets/icons/workflow.png b/desktop/src/assets/icons/workflow.png
new file mode 100644
index 000000000..2a5789dc4
Binary files /dev/null and b/desktop/src/assets/icons/workflow.png differ
diff --git a/desktop/src/shared/components/openstreetmap/openstreetmap.component.scss b/desktop/src/shared/components/openstreetmap/openstreetmap.component.scss
index a9b54e028..b0973beae 100644
--- a/desktop/src/shared/components/openstreetmap/openstreetmap.component.scss
+++ b/desktop/src/shared/components/openstreetmap/openstreetmap.component.scss
@@ -1,5 +1,6 @@
:host {
display: block;
+ width: 100%;
}
::ng-deep .leaflet-marker-shadow {
diff --git a/desktop/src/shared/dialogs/location/location.dialog.ts b/desktop/src/shared/dialogs/location/location.dialog.ts
index 56e5180a4..09fcb36fc 100644
--- a/desktop/src/shared/dialogs/location/location.dialog.ts
+++ b/desktop/src/shared/dialogs/location/location.dialog.ts
@@ -16,7 +16,7 @@ export class LocationDialog implements AfterViewInit {
constructor(
private dialogRef: DynamicDialogRef,
- config: DynamicDialogConfig,
+ config: DynamicDialogConfig,
) {
this.location = config.data!
}
diff --git a/desktop/src/shared/pipes/exposureTime.pipe.ts b/desktop/src/shared/pipes/exposureTime.pipe.ts
index d030cbe68..d7e3bea5c 100644
--- a/desktop/src/shared/pipes/exposureTime.pipe.ts
+++ b/desktop/src/shared/pipes/exposureTime.pipe.ts
@@ -25,7 +25,7 @@ export class ExposureTimePipe implements PipeTransform {
function formatter(format: Intl.NumberFormat, unit: string) {
return function (value: number) {
- return `${format.format(value)}${unit}`
+ return value ? `${format.format(value)}${unit}` : ''
}
}
diff --git a/desktop/src/shared/services/api.service.ts b/desktop/src/shared/services/api.service.ts
index 36710016a..7dcef4b7f 100644
--- a/desktop/src/shared/services/api.service.ts
+++ b/desktop/src/shared/services/api.service.ts
@@ -3,10 +3,8 @@ import moment from 'moment'
import {
Angle, BodyPosition, CalibrationFrame, CalibrationFrameGroup, Camera, CameraStartCapture, ComputedLocation, Constellation, CoordinateInterpolation, DeepSkyObject, DetectedStar, Device,
FilterWheel, Focuser, GuideDirection, GuideOutput, Guider, HipsSurvey, HistoryStep,
- INDIProperty, INDISendProperty, ImageAnnotation, ImageCalibrated,
- ImageChannel, ImageInfo, ListeningEventType, Location, MinorPlanet,
- Mount, PlateSolverOptions, SCNRProtectionMethod, Satellite, SatelliteGroupType,
- SettleInfo, SkyObjectType, SlewRate, Star, TrackMode, Twilight
+ INDIProperty, INDISendProperty, ImageAnnotation, ImageChannel, ImageInfo, ImageSolved, Location, MinorPlanet, Mount, PlateSolverOptions, SCNRProtectionMethod, Satellite, SatelliteGroupType,
+ SequencePlan, SettleInfo, SkyObjectType, SlewRate, Star, TrackMode, Twilight
} from '../types'
import { HttpService } from './http.service'
@@ -339,24 +337,26 @@ export class ApiService {
return this.http.delete(`image?${query}`)
}
+ // INDI
+
indiProperties(device: Device) {
- return this.http.get[]>(`indiProperties?name=${device.name}`)
+ return this.http.get[]>(`indi/${device.name}/properties`)
}
- sendIndiProperty(device: Device, property: INDISendProperty) {
- return this.http.post(`sendIndiProperty?name=${device.name}`, property)
+ indiSendProperty(device: Device, property: INDISendProperty) {
+ return this.http.put(`indi/${device.name}/send`, property)
}
- startListening(eventType: ListeningEventType) {
- return this.http.post(`startListening?eventType=${eventType}`)
+ indiStartListening(device: Device) {
+ return this.http.put(`indi/listener/${device.name}/start`)
}
- stopListening(eventType: ListeningEventType) {
- return this.http.post(`stopListening?eventType=${eventType}`)
+ indiStopListening(device: Device) {
+ return this.http.put(`indi/listener/${device.name}/stop`)
}
indiLog(device: Device) {
- return this.http.get(`indiLog?name=${device.name}`)
+ return this.http.get(`indi/${device.name}/log`)
}
// LOCATION
@@ -582,8 +582,8 @@ export class ApiService {
// DARV
darvStart(camera: Camera, guideOutput: GuideOutput,
- exposureTime: number, initialPause: number, direction: GuideDirection, reversed: boolean = false) {
- const data = { exposureTime, initialPause, direction, reversed }
+ exposureTime: number, initialPause: number, direction: GuideDirection, reversed: boolean = false, capture?: CameraStartCapture) {
+ const data = { capture, exposureTime, initialPause, direction, reversed }
return this.http.put(`polar-alignment/darv/${camera.name}/${guideOutput.name}/start`, data)
}
@@ -591,6 +591,16 @@ export class ApiService {
return this.http.put(`polar-alignment/darv/${camera.name}/${guideOutput.name}/stop`)
}
+ // SEQUENCER
+
+ sequencerStart(plan: SequencePlan) {
+ return this.http.put