-
+
@@ -69,7 +68,7 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/desktop/src/app/mount/mount.component.ts b/desktop/src/app/mount/mount.component.ts
index 7b1dcd6e5..8b3f56339 100644
--- a/desktop/src/app/mount/mount.component.ts
+++ b/desktop/src/app/mount/mount.component.ts
@@ -1,13 +1,20 @@
import { AfterContentInit, Component, HostListener, NgZone, OnDestroy } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
import { MenuItem } from 'primeng/api'
-import { Subject, Subscription, debounceTime, interval, throttleTime } from 'rxjs'
+import { Subject, Subscription, interval, throttleTime } from 'rxjs'
import { ApiService } from '../../shared/services/api.service'
import { BrowserWindowService } from '../../shared/services/browser-window.service'
import { ElectronService } from '../../shared/services/electron.service'
-import { PreferenceService } from '../../shared/services/preference.service'
+import { LocalStorageService } from '../../shared/services/local-storage.service'
import { Angle, ComputedLocation, Constellation, Mount, PierSide, SlewRate, TargetCoordinateType, TrackMode, Union } from '../../shared/types'
import { AppComponent } from '../app.component'
+export interface MountPreference {
+ targetCoordinateType?: TargetCoordinateType
+ targetRightAscension?: Angle
+ targetDeclination?: Angle
+}
+
@Component({
selector: 'app-mount',
templateUrl: './mount.component.html',
@@ -15,9 +22,9 @@ import { AppComponent } from '../app.component'
})
export class MountComponent implements AfterContentInit, OnDestroy {
- mounts: Mount[] = []
mount?: Mount
connected = false
+
slewing = false
parking = false
parked = false
@@ -53,12 +60,12 @@ export class MountComponent implements AfterContentInit, OnDestroy {
private computeCoordinateSubscriptions: Subscription[] = []
private readonly moveToDirection = [false, false]
- readonly targetCoordinateOptions: MenuItem[] = [
+ readonly targetCoordinateModel: MenuItem[] = [
{
icon: 'mdi mdi-telescope',
label: 'Go To',
command: () => {
- this.targetCoordinateOption = this.targetCoordinateOptions[0]
+ this.targetCoordinateOption = this.targetCoordinateModel[0]
this.goTo()
},
},
@@ -66,7 +73,7 @@ export class MountComponent implements AfterContentInit, OnDestroy {
icon: 'mdi mdi-telescope',
label: 'Slew',
command: () => {
- this.targetCoordinateOption = this.targetCoordinateOptions[1]
+ this.targetCoordinateOption = this.targetCoordinateModel[1]
this.slewTo()
},
},
@@ -74,7 +81,7 @@ export class MountComponent implements AfterContentInit, OnDestroy {
icon: 'mdi mdi-sync',
label: 'Sync',
command: () => {
- this.targetCoordinateOption = this.targetCoordinateOptions[2]
+ this.targetCoordinateOption = this.targetCoordinateModel[2]
this.sync()
},
},
@@ -136,24 +143,25 @@ export class MountComponent implements AfterContentInit, OnDestroy {
},
]
- targetCoordinateOption = this.targetCoordinateOptions[0]
+ targetCoordinateOption = this.targetCoordinateModel[0]
constructor(
private app: AppComponent,
private api: ApiService,
private browserWindow: BrowserWindowService,
private electron: ElectronService,
- private preference: PreferenceService,
+ private storage: LocalStorageService,
+ private route: ActivatedRoute,
ngZone: NgZone,
) {
app.title = 'Mount'
api.startListening('MOUNT')
- electron.on('MOUNT_UPDATED', (_, event: Mount) => {
- if (event.name === this.mount?.name) {
+ electron.on('MOUNT_UPDATED', event => {
+ if (event.device.name === this.mount?.name) {
ngZone.run(() => {
- Object.assign(this.mount!, event)
+ Object.assign(this.mount!, event.device)
this.update()
})
}
@@ -170,23 +178,30 @@ export class MountComponent implements AfterContentInit, OnDestroy {
})
this.computeCoordinateSubscriptions[2] = this.computeTargetCoordinatePublisher
- .pipe(debounceTime(1000))
+ .pipe(throttleTime(1000))
.subscribe(() => this.computeTargetCoordinates())
}
async ngAfterContentInit() {
- this.mounts = await this.api.mounts()
+ this.route.queryParams.subscribe(e => {
+ const mount = JSON.parse(decodeURIComponent(e.data)) as Mount
+ this.mountChanged(mount)
+ })
}
@HostListener('window:unload')
ngOnDestroy() {
+ this.abort()
+
this.computeCoordinateSubscriptions
.forEach(e => e.unsubscribe())
this.api.stopListening('MOUNT')
}
- async mountChanged() {
+ async mountChanged(mount?: Mount) {
+ this.mount = mount
+
if (this.mount) {
this.app.subTitle = this.mount!.name
@@ -195,12 +210,9 @@ export class MountComponent implements AfterContentInit, OnDestroy {
this.loadPreference()
this.update()
- this.savePreference()
} else {
this.app.subTitle = ''
}
-
- this.electron.send('MOUNT_CHANGED', this.mount)
}
connect() {
@@ -227,11 +239,11 @@ export class MountComponent implements AfterContentInit, OnDestroy {
}
targetCoordinateOptionClicked() {
- if (this.targetCoordinateOption === this.targetCoordinateOptions[0]) {
+ if (this.targetCoordinateOption === this.targetCoordinateModel[0]) {
this.goTo()
- } else if (this.targetCoordinateOption === this.targetCoordinateOptions[1]) {
+ } else if (this.targetCoordinateOption === this.targetCoordinateModel[1]) {
this.slewTo()
- } else if (this.targetCoordinateOption === this.targetCoordinateOptions[2]) {
+ } else if (this.targetCoordinateOption === this.targetCoordinateModel[2]) {
this.sync()
}
}
@@ -374,18 +386,23 @@ export class MountComponent implements AfterContentInit, OnDestroy {
private loadPreference() {
if (this.mount) {
- this.targetCoordinateType = this.preference.get(`mount.${this.mount.name}.targetCoordinateType`, 'JNOW')
- this.targetRightAscension = this.preference.get(`mount.${this.mount.name}.targetRightAscension`, '00h00m00s')
- this.targetDeclination = this.preference.get(`mount.${this.mount.name}.targetDeclination`, `00°00'00"`)
+ const preference = this.storage.get
(`mount.${this.mount.name}`, {})
+ this.targetCoordinateType = preference.targetCoordinateType ?? 'JNOW'
+ this.targetRightAscension = preference.targetRightAscension ?? '00h00m00s'
+ this.targetDeclination = preference.targetDeclination ?? `00°00'00"`
this.computeTargetCoordinatePublisher.next()
}
}
private savePreference() {
if (this.mount && this.mount.connected) {
- this.preference.set(`mount.${this.mount.name}.targetCoordinateType`, this.targetCoordinateType)
- this.preference.set(`mount.${this.mount.name}.targetRightAscension`, this.targetRightAscension)
- this.preference.set(`mount.${this.mount.name}.targetDeclination`, this.targetDeclination)
+ const preference: MountPreference = {
+ targetCoordinateType: this.targetCoordinateType,
+ targetRightAscension: this.targetRightAscension,
+ targetDeclination: this.targetDeclination,
+ }
+
+ this.storage.set(`mount.${this.mount.name}`, preference)
}
}
}
diff --git a/desktop/src/app/settings/settings.component.html b/desktop/src/app/settings/settings.component.html
new file mode 100644
index 000000000..16cf282ba
--- /dev/null
+++ b/desktop/src/app/settings/settings.component.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/desktop/src/app/settings/settings.component.scss b/desktop/src/app/settings/settings.component.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/desktop/src/app/settings/settings.component.ts b/desktop/src/app/settings/settings.component.ts
new file mode 100644
index 000000000..6ceb802ae
--- /dev/null
+++ b/desktop/src/app/settings/settings.component.ts
@@ -0,0 +1,124 @@
+import { AfterViewInit, Component, HostListener, OnDestroy } from '@angular/core'
+import { MenuItem } from 'primeng/api'
+import { LocationDialog } from '../../shared/dialogs/location/location.dialog'
+import { ApiService } from '../../shared/services/api.service'
+import { ElectronService } from '../../shared/services/electron.service'
+import { PrimeService } from '../../shared/services/prime.service'
+import { EMPTY_LOCATION, Location, PlateSolverOptions, PlateSolverType } from '../../shared/types'
+import { AppComponent } from '../app.component'
+
+@Component({
+ selector: 'app-settings',
+ templateUrl: './settings.component.html',
+ styleUrls: ['./settings.component.scss'],
+})
+export class SettingsComponent implements AfterViewInit, OnDestroy {
+
+ activeTab = 0
+
+ locations: Location[] = []
+ location = Object.assign({}, EMPTY_LOCATION)
+ private deletedLocations: Location[] = []
+
+ readonly plateSolvers: PlateSolverType[] = ['ASTAP', 'ASTROMETRY_NET']
+ plateSolver!: PlateSolverOptions
+
+ readonly items: MenuItem[] = [
+ {
+ icon: 'mdi mdi-map-marker',
+ label: 'Location',
+ },
+ {
+ icon: 'mdi mdi-sigma',
+ label: 'Plate Solver',
+ },
+ ]
+
+ item = this.items[0]
+
+ constructor(
+ app: AppComponent,
+ private api: ApiService,
+ private electron: ElectronService,
+ 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()
+ }
+
+ @HostListener('window:unload')
+ ngOnDestroy() { }
+
+ addLocation() {
+ this.showLocation(Object.assign({}, EMPTY_LOCATION))
+ }
+
+ editLocation() {
+ this.showLocation(this.location)
+ }
+
+ 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)
+ }
+ }
+
+ private async loadLocation() {
+ 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)
+ }
+
+ 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
+ }
+ }
+ }
+
+ locationChanged() {
+ this.locations.forEach(e => e.selected = false)
+ this.location.selected = true
+ }
+
+ 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)
+ }
+}
\ No newline at end of file
diff --git a/desktop/src/assets/fonts/icomoon.ttf b/desktop/src/assets/fonts/icomoon.ttf
new file mode 100644
index 000000000..796fd516a
Binary files /dev/null and b/desktop/src/assets/fonts/icomoon.ttf differ
diff --git a/desktop/src/assets/icons/CREDITS.md b/desktop/src/assets/icons/CREDITS.md
index d0c7b1449..9640a1559 100644
--- a/desktop/src/assets/icons/CREDITS.md
+++ b/desktop/src/assets/icons/CREDITS.md
@@ -2,12 +2,8 @@
* https://www.flaticon.com/free-icon/galaxy_1534067
* https://www.flaticon.com/free-icon/information_9195785
-* https://www.flaticon.com/free-icon/gps_856332
-* https://www.flaticon.com/free-icon/clock_3133110
-* https://www.flaticon.com/free-icon/map_854878
* https://www.flaticon.com/free-icon/remote-control_3567313
* https://www.flaticon.com/free-icon/sky_3982229
-* https://www.flaticon.com/free-icon/text-box_3815460
* https://www.flaticon.com/free-icon/histogram_2709742
* https://www.flaticon.com/free-icon/target_3207593
* https://www.flaticon.com/free-icon/camera-lens_5708327
@@ -19,12 +15,9 @@
* https://www.flaticon.com/free-icon/image-processing_6062419
* https://www.flaticon.com/free-icon/star_740882
* https://www.flaticon.com/free-icon/rotate_3303063
-* https://www.flaticon.com/free-icon/combination_8654893
-* https://www.flaticon.com/free-icon/rgb-print_4904473
* https://www.flaticon.com/free-icon/location_4631354
* https://www.flaticon.com/free-icon/rgb-print_7664547
-* https://www.flaticon.com/free-icon/setting_839374
-* https://www.flaticon.com/free-icon/filter_679991
+* https://www.flaticon.com/free-icon/cogwheel_3953226
* https://www.flaticon.com/free-icon/target_10542035
* https://www.flaticon.com/free-icon/contrast_439842
* https://www.flaticon.com/free-icon/full-moon_9689786
@@ -33,4 +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/gear_8753403
+* 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://thenounproject.com/icon/random-dither-4259782
diff --git a/desktop/src/assets/icons/about.png b/desktop/src/assets/icons/about.png
index dcc3290ca..7a82378e1 100644
Binary files a/desktop/src/assets/icons/about.png and b/desktop/src/assets/icons/about.png differ
diff --git a/desktop/src/assets/icons/asteroid.png b/desktop/src/assets/icons/asteroid.png
index 3c4b7f4d8..c45e9308a 100644
Binary files a/desktop/src/assets/icons/asteroid.png and b/desktop/src/assets/icons/asteroid.png differ
diff --git a/desktop/src/assets/icons/atlas.png b/desktop/src/assets/icons/atlas.png
index dffc74958..5c4f59c2b 100644
Binary files a/desktop/src/assets/icons/atlas.png and b/desktop/src/assets/icons/atlas.png differ
diff --git a/desktop/src/assets/icons/camera.png b/desktop/src/assets/icons/camera.png
index cfcc105f9..2cdded1b5 100644
Binary files a/desktop/src/assets/icons/camera.png and b/desktop/src/assets/icons/camera.png differ
diff --git a/desktop/src/assets/icons/filter-wheel.png b/desktop/src/assets/icons/filter-wheel.png
index ed843f917..2daf28c9f 100644
Binary files a/desktop/src/assets/icons/filter-wheel.png and b/desktop/src/assets/icons/filter-wheel.png differ
diff --git a/desktop/src/assets/icons/filter.png b/desktop/src/assets/icons/filter.png
deleted file mode 100644
index b73b88f9b..000000000
Binary files a/desktop/src/assets/icons/filter.png and /dev/null differ
diff --git a/desktop/src/assets/icons/focus.png b/desktop/src/assets/icons/focus.png
index 6dfc87d46..155f13952 100644
Binary files a/desktop/src/assets/icons/focus.png and b/desktop/src/assets/icons/focus.png differ
diff --git a/desktop/src/assets/icons/framing.png b/desktop/src/assets/icons/framing.png
index e42b7720c..394a657b4 100644
Binary files a/desktop/src/assets/icons/framing.png and b/desktop/src/assets/icons/framing.png differ
diff --git a/desktop/src/assets/icons/gear.png b/desktop/src/assets/icons/gear.png
deleted file mode 100644
index a57fd0a7a..000000000
Binary files a/desktop/src/assets/icons/gear.png and /dev/null differ
diff --git a/desktop/src/assets/icons/guider.png b/desktop/src/assets/icons/guider.png
index 20897eb5f..70e48e71c 100644
Binary files a/desktop/src/assets/icons/guider.png and b/desktop/src/assets/icons/guider.png differ
diff --git a/desktop/src/assets/icons/histogram.png b/desktop/src/assets/icons/histogram.png
index 90c02cacf..ba4e5ec4d 100644
Binary files a/desktop/src/assets/icons/histogram.png and b/desktop/src/assets/icons/histogram.png differ
diff --git a/desktop/src/assets/icons/image.png b/desktop/src/assets/icons/image.png
index bd097621c..3b443000f 100644
Binary files a/desktop/src/assets/icons/image.png and b/desktop/src/assets/icons/image.png differ
diff --git a/desktop/src/assets/icons/indi.png b/desktop/src/assets/icons/indi.png
index 7d0bf1163..debf55518 100644
Binary files a/desktop/src/assets/icons/indi.png and b/desktop/src/assets/icons/indi.png differ
diff --git a/desktop/src/assets/icons/jupiter.png b/desktop/src/assets/icons/jupiter.png
index 6d2365460..880593dc7 100644
Binary files a/desktop/src/assets/icons/jupiter.png and b/desktop/src/assets/icons/jupiter.png differ
diff --git a/desktop/src/assets/icons/location.png b/desktop/src/assets/icons/location.png
index 1ce76af1c..9cdce86ae 100644
Binary files a/desktop/src/assets/icons/location.png and b/desktop/src/assets/icons/location.png differ
diff --git a/desktop/src/assets/icons/map-marker.png b/desktop/src/assets/icons/map-marker.png
index 37835cfbc..f63b28183 100644
Binary files a/desktop/src/assets/icons/map-marker.png and b/desktop/src/assets/icons/map-marker.png differ
diff --git a/desktop/src/assets/icons/milky-way.png b/desktop/src/assets/icons/milky-way.png
index 073c3817b..b6c1e3f78 100644
Binary files a/desktop/src/assets/icons/milky-way.png and b/desktop/src/assets/icons/milky-way.png differ
diff --git a/desktop/src/assets/icons/moon.png b/desktop/src/assets/icons/moon.png
index f64202ee2..0fe4e02a6 100644
Binary files a/desktop/src/assets/icons/moon.png and b/desktop/src/assets/icons/moon.png differ
diff --git a/desktop/src/assets/icons/nebulosa-256.png b/desktop/src/assets/icons/nebulosa-256.png
new file mode 100644
index 000000000..f4c5e6415
Binary files /dev/null and b/desktop/src/assets/icons/nebulosa-256.png differ
diff --git a/desktop/src/assets/icons/nebulosa-512.png b/desktop/src/assets/icons/nebulosa-512.png
deleted file mode 100644
index d0571cd7d..000000000
Binary files a/desktop/src/assets/icons/nebulosa-512.png and /dev/null differ
diff --git a/desktop/src/assets/icons/nebulosa.png b/desktop/src/assets/icons/nebulosa.png
index 38ab0d8d8..2d70654f2 100644
Binary files a/desktop/src/assets/icons/nebulosa.png and b/desktop/src/assets/icons/nebulosa.png differ
diff --git a/desktop/src/assets/icons/observatory.png b/desktop/src/assets/icons/observatory.png
index fe5814692..15420ca67 100644
Binary files a/desktop/src/assets/icons/observatory.png and b/desktop/src/assets/icons/observatory.png differ
diff --git a/desktop/src/assets/icons/online-search.png b/desktop/src/assets/icons/online-search.png
new file mode 100644
index 000000000..6c74d6dc1
Binary files /dev/null and b/desktop/src/assets/icons/online-search.png differ
diff --git a/desktop/src/assets/icons/random-dither.svg b/desktop/src/assets/icons/random-dither.svg
new file mode 100644
index 000000000..58f0c9c73
--- /dev/null
+++ b/desktop/src/assets/icons/random-dither.svg
@@ -0,0 +1 @@
+
diff --git a/desktop/src/assets/icons/remote-control.png b/desktop/src/assets/icons/remote-control.png
index 2fee819e9..3341d7c19 100644
Binary files a/desktop/src/assets/icons/remote-control.png and b/desktop/src/assets/icons/remote-control.png differ
diff --git a/desktop/src/assets/icons/rgb.png b/desktop/src/assets/icons/rgb.png
deleted file mode 100644
index 33edd1c04..000000000
Binary files a/desktop/src/assets/icons/rgb.png and /dev/null differ
diff --git a/desktop/src/assets/icons/rotate.png b/desktop/src/assets/icons/rotate.png
index 9073b2552..a1d936786 100644
Binary files a/desktop/src/assets/icons/rotate.png and b/desktop/src/assets/icons/rotate.png differ
diff --git a/desktop/src/assets/icons/satellite.png b/desktop/src/assets/icons/satellite.png
index 3a5a1291b..ef9f4660b 100644
Binary files a/desktop/src/assets/icons/satellite.png and b/desktop/src/assets/icons/satellite.png differ
diff --git a/desktop/src/assets/icons/schedule.png b/desktop/src/assets/icons/schedule.png
index b8a1d3809..5b879191a 100644
Binary files a/desktop/src/assets/icons/schedule.png and b/desktop/src/assets/icons/schedule.png differ
diff --git a/desktop/src/assets/icons/settings.png b/desktop/src/assets/icons/settings.png
index d6acd23dc..2c8a74b86 100644
Binary files a/desktop/src/assets/icons/settings.png and b/desktop/src/assets/icons/settings.png differ
diff --git a/desktop/src/assets/icons/stack.png b/desktop/src/assets/icons/stack.png
new file mode 100644
index 000000000..7cfd07d6b
Binary files /dev/null and b/desktop/src/assets/icons/stack.png differ
diff --git a/desktop/src/assets/icons/star.png b/desktop/src/assets/icons/star.png
index 518d71ff7..b6d70ed1a 100644
Binary files a/desktop/src/assets/icons/star.png and b/desktop/src/assets/icons/star.png differ
diff --git a/desktop/src/assets/icons/stars.png b/desktop/src/assets/icons/stars.png
index 916705d97..eceb06ff8 100644
Binary files a/desktop/src/assets/icons/stars.png and b/desktop/src/assets/icons/stars.png differ
diff --git a/desktop/src/assets/icons/sun.png b/desktop/src/assets/icons/sun.png
index 545ac7b8e..326b05d5e 100644
Binary files a/desktop/src/assets/icons/sun.png and b/desktop/src/assets/icons/sun.png differ
diff --git a/desktop/src/assets/icons/switch.png b/desktop/src/assets/icons/switch.png
index 088c6cc8b..71f552c38 100644
Binary files a/desktop/src/assets/icons/switch.png and b/desktop/src/assets/icons/switch.png differ
diff --git a/desktop/src/assets/icons/telescope.png b/desktop/src/assets/icons/telescope.png
index dee85f31a..c1d0d039e 100644
Binary files a/desktop/src/assets/icons/telescope.png and b/desktop/src/assets/icons/telescope.png differ
diff --git a/desktop/src/assets/icons/text-box.png b/desktop/src/assets/icons/text-box.png
deleted file mode 100644
index 0a95948c8..000000000
Binary files a/desktop/src/assets/icons/text-box.png and /dev/null differ
diff --git a/desktop/src/assets/images/splash.png b/desktop/src/assets/images/splash.png
index a50b5bc99..aca9fba8b 100644
Binary files a/desktop/src/assets/images/splash.png and b/desktop/src/assets/images/splash.png differ
diff --git a/desktop/src/index.html b/desktop/src/index.html
index e75cf5e49..d4d0152a0 100644
--- a/desktop/src/index.html
+++ b/desktop/src/index.html
@@ -7,14 +7,10 @@
-
-
-
-
-
+