From 40001dc49380332a5e202e44ecea64abf7b9ea38 Mon Sep 17 00:00:00 2001 From: tiagohm Date: Sun, 25 Aug 2024 11:39:41 -0300 Subject: [PATCH 1/3] [desktop]: Use BMP Version 3 to show splash image for portable https://github.com/electron-userland/electron-builder/issues/5390#issuecomment-905587782 --- .gitattributes | 1 + desktop/electron-builder.json | 2 +- desktop/src/assets/images/splash.bmp | Bin 0 -> 786486 bytes 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 desktop/src/assets/images/splash.bmp diff --git a/.gitattributes b/.gitattributes index 709fc3af8..791be7c28 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,3 +21,4 @@ *.dll binary *.so binary *.zip binary +*.bmp binary diff --git a/desktop/electron-builder.json b/desktop/electron-builder.json index f94f67c50..42417765e 100644 --- a/desktop/electron-builder.json +++ b/desktop/electron-builder.json @@ -20,7 +20,7 @@ "target": ["portable"] }, "portable": { - "splashImage": "dist/assets/images/splash.png" + "splashImage": "dist/assets/images/splash.bmp" }, "mac": { "icon": "dist/assets/icons", diff --git a/desktop/src/assets/images/splash.bmp b/desktop/src/assets/images/splash.bmp new file mode 100644 index 0000000000000000000000000000000000000000..5fc00005152dd7fd604e2bf57e584cc63dd8cb6f GIT binary patch literal 786486 zcmeI*=aZyYmFMxt$8T{qnF^VIdTc@L$oyC1kab=@=Xq11Knqw`bOzu)`&)b+#r9!p&x{_>rv z>uX=RFLnLPhrW=yu6WONsq26LpSPy2RQ#iOD*jPC75^xnihmSO#XpLt;vdCR@sHxE z_($W~AH`GgkK(ELM{)h<9Yp_m2ho4tLG+(@5dG&J zMF0621nXU&>c9T8@SN(u{c9Ti%!pX;`qchk|5+v+$g<-u0>e>pu(6sq-KGXW=<@{-giSfAX#ZV!i8A{nvjMo>TqTfBo10 z(mvw#pFBbG`cK|Ly#AACM9zPl|I|DSD7oG0y#DJy3(u+k>pu(6sjvU??$FBlQXT!* ze-@ro{nvjMo>TqTf1dDj%6iwQ&VTfuh3C}ykN&gpoR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(0~1B;W^cR{b%7hZRLEa zj{fUE3(u+ZAN^c9T8@SL`CzEns5^`C|3)cKG8v+$fc|IvS*@Nmj{*QfUX`p?31YX7hQEIg;BzP;6X z`+wde^k4s3cuw_S|5!PPM!bgKTmi#WxeZD`+xms;W@Sc z*MAnC(^B8w>b(6w?-Ba1|13PG`mg^iJg2RkFV)e1{b%7hb^fFOEIg;qfApUxJe;!L z^{M^8{TqTe-@t8R?e5|=)eB6@SHmT(SH`6 zQ|CYW&l4U_S?~JP{$KxDcuwvA^`C|3wA8n^I&c5adxZY$KMT*P{_8&r&uJ^?OLg>L J|5 Date: Sun, 25 Aug 2024 13:13:28 -0300 Subject: [PATCH 2/3] [api]: Remove generic parameter from GuideOutputEvent class --- .../main/kotlin/nebulosa/api/guiding/GuideOutputEventAware.kt | 2 +- .../main/kotlin/nebulosa/api/guiding/GuideOutputEventHub.kt | 4 ++-- .../kotlin/nebulosa/indi/device/guider/GuideOutputAttached.kt | 2 +- .../indi/device/guider/GuideOutputCanPulseGuideChanged.kt | 2 +- .../kotlin/nebulosa/indi/device/guider/GuideOutputDetached.kt | 2 +- .../kotlin/nebulosa/indi/device/guider/GuideOutputEvent.kt | 4 ++-- .../nebulosa/indi/device/guider/GuideOutputPulsingChanged.kt | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventAware.kt b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventAware.kt index d05fa5afc..9fc088a91 100644 --- a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventAware.kt +++ b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventAware.kt @@ -4,5 +4,5 @@ import nebulosa.indi.device.guider.GuideOutputEvent fun interface GuideOutputEventAware { - fun handleGuideOutputEvent(event: GuideOutputEvent<*>) + fun handleGuideOutputEvent(event: GuideOutputEvent) } diff --git a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventHub.kt b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventHub.kt index 2208e8fc4..471c23828 100644 --- a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventHub.kt +++ b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputEventHub.kt @@ -17,10 +17,10 @@ import org.springframework.stereotype.Component @Subscriber class GuideOutputEventHub( private val messageService: MessageService, -) : DeviceEventHub>(DeviceType.GUIDE_OUTPUT), GuideOutputEventAware { +) : DeviceEventHub(DeviceType.GUIDE_OUTPUT), GuideOutputEventAware { @Subscribe(threadMode = ThreadMode.ASYNC) - override fun handleGuideOutputEvent(event: GuideOutputEvent<*>) { + override fun handleGuideOutputEvent(event: GuideOutputEvent) { if (event.device.type == DeviceType.GUIDE_OUTPUT) { when (event) { is PropertyChangedEvent -> if (event.device.canPulseGuide) onNext(event) diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputAttached.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputAttached.kt index b1b5357ba..2cdd1e4ce 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputAttached.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputAttached.kt @@ -2,4 +2,4 @@ package nebulosa.indi.device.guider import nebulosa.indi.device.DeviceAttached -data class GuideOutputAttached(override val device: GuideOutput) : GuideOutputEvent, DeviceAttached +data class GuideOutputAttached(override val device: GuideOutput) : GuideOutputEvent, DeviceAttached diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputCanPulseGuideChanged.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputCanPulseGuideChanged.kt index 5ac443a7a..188bb9c86 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputCanPulseGuideChanged.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputCanPulseGuideChanged.kt @@ -2,4 +2,4 @@ package nebulosa.indi.device.guider import nebulosa.indi.device.PropertyChangedEvent -data class GuideOutputCanPulseGuideChanged(override val device: GuideOutput) : PropertyChangedEvent, GuideOutputEvent +data class GuideOutputCanPulseGuideChanged(override val device: GuideOutput) : GuideOutputEvent, PropertyChangedEvent diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputDetached.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputDetached.kt index 4daf6ed43..db4858159 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputDetached.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputDetached.kt @@ -2,4 +2,4 @@ package nebulosa.indi.device.guider import nebulosa.indi.device.DeviceDetached -data class GuideOutputDetached(override val device: GuideOutput) : GuideOutputEvent, DeviceDetached +data class GuideOutputDetached(override val device: GuideOutput) : GuideOutputEvent, DeviceDetached diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputEvent.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputEvent.kt index d146979a8..a5fc8ee8c 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputEvent.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputEvent.kt @@ -2,7 +2,7 @@ package nebulosa.indi.device.guider import nebulosa.indi.device.DeviceEvent -interface GuideOutputEvent : DeviceEvent { +interface GuideOutputEvent : DeviceEvent { - override val device: T + override val device: GuideOutput } diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputPulsingChanged.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputPulsingChanged.kt index ddf9fbc1e..d78cf36bb 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputPulsingChanged.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/guider/GuideOutputPulsingChanged.kt @@ -2,4 +2,4 @@ package nebulosa.indi.device.guider import nebulosa.indi.device.PropertyChangedEvent -data class GuideOutputPulsingChanged(override val device: GuideOutput) : PropertyChangedEvent, GuideOutputEvent +data class GuideOutputPulsingChanged(override val device: GuideOutput) : GuideOutputEvent, PropertyChangedEvent From 5d7df2ea64bbc63e66739f239877ec2c3c9602a6 Mon Sep 17 00:00:00 2001 From: tiagohm Date: Sun, 25 Aug 2024 23:06:15 -0300 Subject: [PATCH 3/3] [api][desktop]: Show driver name and version --- .../nebulosa/api/cameras/CameraSerializer.kt | 2 + .../api/focusers/FocuserSerializer.kt | 2 + .../api/guiding/GuideOutputSerializer.kt | 2 + .../nebulosa/api/mounts/MountSerializer.kt | 2 + .../api/rotators/RotatorSerializer.kt | 2 + .../nebulosa/api/wheels/WheelSerializer.kt | 2 + desktop/src/app/app.module.ts | 2 + desktop/src/app/camera/camera.component.html | 9 +- .../filterwheel/filterwheel.component.html | 9 +- .../src/app/focuser/focuser.component.html | 9 +- desktop/src/app/mount/mount.component.html | 9 +- .../src/app/rotator/rotator.component.html | 9 +- .../device-name/device-name.component.ts | 20 +++++ desktop/src/shared/types/camera.types.ts | 2 + desktop/src/shared/types/device.types.ts | 2 + desktop/src/shared/types/focuser.types.ts | 2 + desktop/src/shared/types/guider.types.ts | 2 + desktop/src/shared/types/mount.types.ts | 2 + desktop/src/shared/types/rotator.types.ts | 2 + desktop/src/shared/types/wheel.types.ts | 2 + .../kotlin/nebulosa/indi/client/INDIClient.kt | 35 ++++---- .../nebulosa/indi/client/device/DriverInfo.kt | 24 +++++ .../nebulosa/indi/client/device/INDIDevice.kt | 17 +++- .../device/INDIDeviceProtocolHandler.kt | 88 ++++++++----------- .../indi/client/device/auxiliary/INDIGPS.kt | 5 +- .../device/auxiliary/INDIGuideOutput.kt | 5 +- .../indi/client/device/camera/AsiCamera.kt | 6 +- .../indi/client/device/camera/INDICamera.kt | 7 +- .../indi/client/device/camera/SVBonyCamera.kt | 6 +- .../indi/client/device/camera/SimCamera.kt | 6 +- .../indi/client/device/focuser/INDIFocuser.kt | 5 +- .../indi/client/device/mount/INDIMount.kt | 5 +- .../indi/client/device/rotator/INDIRotator.kt | 5 +- .../client/device/wheel/INDIFilterWheel.kt | 5 +- .../kotlin/nebulosa/indi/device/Device.kt | 12 ++- .../nebulosa/indi/protocol/EnableBLOB.kt | 4 +- 36 files changed, 186 insertions(+), 142 deletions(-) create mode 100644 desktop/src/shared/components/device-name/device-name.component.ts create mode 100644 nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/DriverInfo.kt diff --git a/api/src/main/kotlin/nebulosa/api/cameras/CameraSerializer.kt b/api/src/main/kotlin/nebulosa/api/cameras/CameraSerializer.kt index 57384a107..76943085b 100644 --- a/api/src/main/kotlin/nebulosa/api/cameras/CameraSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/cameras/CameraSerializer.kt @@ -15,6 +15,8 @@ class CameraSerializer(private val capturesPath: Path) : StdSerializer(C gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/api/src/main/kotlin/nebulosa/api/focusers/FocuserSerializer.kt b/api/src/main/kotlin/nebulosa/api/focusers/FocuserSerializer.kt index 9aeb365e3..dce0db80a 100644 --- a/api/src/main/kotlin/nebulosa/api/focusers/FocuserSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/focusers/FocuserSerializer.kt @@ -13,6 +13,8 @@ class FocuserSerializer : StdSerializer(Focuser::class.java) { gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputSerializer.kt b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputSerializer.kt index 9745eab4c..bb86459c3 100644 --- a/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/guiding/GuideOutputSerializer.kt @@ -13,6 +13,8 @@ class GuideOutputSerializer : StdSerializer(GuideOutput::class.java gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/api/src/main/kotlin/nebulosa/api/mounts/MountSerializer.kt b/api/src/main/kotlin/nebulosa/api/mounts/MountSerializer.kt index 49a2b6dd1..dc16d9fc7 100644 --- a/api/src/main/kotlin/nebulosa/api/mounts/MountSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/mounts/MountSerializer.kt @@ -18,6 +18,8 @@ class MountSerializer : StdSerializer(Mount::class.java) { gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/api/src/main/kotlin/nebulosa/api/rotators/RotatorSerializer.kt b/api/src/main/kotlin/nebulosa/api/rotators/RotatorSerializer.kt index fc654c7bb..4a798747f 100644 --- a/api/src/main/kotlin/nebulosa/api/rotators/RotatorSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/rotators/RotatorSerializer.kt @@ -13,6 +13,8 @@ class RotatorSerializer : StdSerializer(Rotator::class.java) { gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/api/src/main/kotlin/nebulosa/api/wheels/WheelSerializer.kt b/api/src/main/kotlin/nebulosa/api/wheels/WheelSerializer.kt index cbadc3fc4..7104a5d18 100644 --- a/api/src/main/kotlin/nebulosa/api/wheels/WheelSerializer.kt +++ b/api/src/main/kotlin/nebulosa/api/wheels/WheelSerializer.kt @@ -13,6 +13,8 @@ class WheelSerializer : StdSerializer(FilterWheel::class.java) { gen.writeStartObject() gen.writeStringField("type", value.type.name) gen.writeStringField("sender", value.sender.id) + gen.writeStringField("driverName", value.driverName) + gen.writeStringField("driverVersion", value.driverVersion) gen.writeStringField("id", value.id) gen.writeStringField("name", value.name) gen.writeBooleanField("connected", value.connected) diff --git a/desktop/src/app/app.module.ts b/desktop/src/app/app.module.ts index b11224e03..e09df9694 100644 --- a/desktop/src/app/app.module.ts +++ b/desktop/src/app/app.module.ts @@ -48,6 +48,7 @@ import { CameraExposureComponent } from '../shared/components/camera-exposure/ca import { CameraInfoComponent } from '../shared/components/camera-info/camera-info.component' import { DeviceChooserComponent } from '../shared/components/device-chooser/device-chooser.component' import { DeviceListMenuComponent } from '../shared/components/device-list-menu/device-list-menu.component' +import { DeviceNameComponent } from '../shared/components/device-name/device-name.component' import { DialogMenuComponent } from '../shared/components/dialog-menu/dialog-menu.component' import { HistogramComponent } from '../shared/components/histogram/histogram.component' import { LocationComponent } from '../shared/components/location/location.dialog' @@ -117,6 +118,7 @@ import { StackerComponent } from './stacker/stacker.component' CrossHairComponent, DeviceChooserComponent, DeviceListMenuComponent, + DeviceNameComponent, DialogMenuComponent, DropdownOptionsPipe, EnumPipe, diff --git a/desktop/src/app/camera/camera.component.html b/desktop/src/app/camera/camera.component.html index d53d34fca..1b78ac65a 100644 --- a/desktop/src/app/camera/camera.component.html +++ b/desktop/src/app/camera/camera.component.html @@ -1,14 +1,7 @@
- - - - +
- - - - +
- - - - +
- - - - +
- - - - + + {{ device.name }} +
+ DRIVER: {{ device.driverName }} + VERSION: {{ device.driverVersion }} +
+
+ `, + encapsulation: ViewEncapsulation.None, +}) +export class DeviceNameComponent { + @Input({ required: true }) + readonly device!: Device +} diff --git a/desktop/src/shared/types/camera.types.ts b/desktop/src/shared/types/camera.types.ts index 54b10fc03..cb8eb75bd 100644 --- a/desktop/src/shared/types/camera.types.ts +++ b/desktop/src/shared/types/camera.types.ts @@ -200,6 +200,8 @@ export interface CameraNamingFormatDialog { export const DEFAULT_CAMERA: Camera = { type: 'CAMERA', sender: '', + driverName: '', + driverVersion: '', id: '', exposuring: false, hasCoolerControl: false, diff --git a/desktop/src/shared/types/device.types.ts b/desktop/src/shared/types/device.types.ts index 3147ae30c..d9d958318 100644 --- a/desktop/src/shared/types/device.types.ts +++ b/desktop/src/shared/types/device.types.ts @@ -15,6 +15,8 @@ export interface Device { readonly sender: string readonly id: string readonly name: string + readonly driverName: string + readonly driverVersion: string connected: boolean } diff --git a/desktop/src/shared/types/focuser.types.ts b/desktop/src/shared/types/focuser.types.ts index b73e9f815..168868c8b 100644 --- a/desktop/src/shared/types/focuser.types.ts +++ b/desktop/src/shared/types/focuser.types.ts @@ -22,6 +22,8 @@ export interface FocuserPreference { export const DEFAULT_FOCUSER: Focuser = { type: 'FOCUSER', sender: '', + driverName: '', + driverVersion: '', id: '', moving: false, position: 0, diff --git a/desktop/src/shared/types/guider.types.ts b/desktop/src/shared/types/guider.types.ts index bf4895238..f736bd604 100644 --- a/desktop/src/shared/types/guider.types.ts +++ b/desktop/src/shared/types/guider.types.ts @@ -105,6 +105,8 @@ export interface GuiderChartInfo { export const DEFAULT_GUIDE_OUTPUT: GuideOutput = { type: 'CAMERA', sender: '', + driverName: '', + driverVersion: '', id: '', canPulseGuide: false, pulseGuiding: false, diff --git a/desktop/src/shared/types/mount.types.ts b/desktop/src/shared/types/mount.types.ts index f88e21e4b..cd1c34b2f 100644 --- a/desktop/src/shared/types/mount.types.ts +++ b/desktop/src/shared/types/mount.types.ts @@ -79,6 +79,8 @@ export interface MountPreference { export const DEFAULT_MOUNT: Mount = { type: 'MOUNT', sender: '', + driverName: '', + driverVersion: '', id: '', slewing: false, tracking: false, diff --git a/desktop/src/shared/types/rotator.types.ts b/desktop/src/shared/types/rotator.types.ts index 0b003d434..5552b6344 100644 --- a/desktop/src/shared/types/rotator.types.ts +++ b/desktop/src/shared/types/rotator.types.ts @@ -20,6 +20,8 @@ export interface RotatorPreference { export const DEFAULT_ROTATOR: Rotator = { type: 'ROTATOR', sender: '', + driverName: '', + driverVersion: '', id: '', name: '', moving: false, diff --git a/desktop/src/shared/types/wheel.types.ts b/desktop/src/shared/types/wheel.types.ts index 2ebb46491..a797424d6 100644 --- a/desktop/src/shared/types/wheel.types.ts +++ b/desktop/src/shared/types/wheel.types.ts @@ -58,6 +58,8 @@ export function makeFilter(wheel: Wheel, filters: Filter[], shutterPosition: num export const DEFAULT_WHEEL: Wheel = { type: 'WHEEL', sender: '', + driverName: '', + driverVersion: '', id: '', count: 0, position: 0, diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/INDIClient.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/INDIClient.kt index 5351b639e..14daac32a 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/INDIClient.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/INDIClient.kt @@ -2,6 +2,7 @@ package nebulosa.indi.client import nebulosa.indi.client.connection.INDIProccessConnection import nebulosa.indi.client.connection.INDISocketConnection +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDeviceProtocolHandler import nebulosa.indi.client.device.auxiliary.INDIGPS import nebulosa.indi.client.device.auxiliary.INDIGuideOutput @@ -48,32 +49,32 @@ data class INDIClient(val connection: INDIConnection) : INDIDeviceProtocolHandle override val input get() = connection.input - override fun newCamera(name: String, executable: String): Camera { - return CAMERAS[executable]?.create(this, name) ?: INDICamera(this, name) + override fun newCamera(driverInfo: DriverInfo): Camera { + return CAMERAS[driverInfo.executable]?.create(this, driverInfo) ?: INDICamera(this, driverInfo) } - override fun newMount(name: String, executable: String): Mount { - return INDIMount(this, name) + override fun newMount(driverInfo: DriverInfo): Mount { + return INDIMount(this, driverInfo) } - override fun newFocuser(name: String, executable: String): Focuser { - return INDIFocuser(this, name) + override fun newFocuser(driverInfo: DriverInfo): Focuser { + return INDIFocuser(this, driverInfo) } - override fun newFilterWheel(name: String, executable: String): FilterWheel { - return INDIFilterWheel(this, name) + override fun newFilterWheel(driverInfo: DriverInfo): FilterWheel { + return INDIFilterWheel(this, driverInfo) } - override fun newRotator(name: String, executable: String): Rotator { - return INDIRotator(this, name) + override fun newRotator(driverInfo: DriverInfo): Rotator { + return INDIRotator(this, driverInfo) } - override fun newGPS(name: String, executable: String): GPS { - return INDIGPS(this, name) + override fun newGPS(driverInfo: DriverInfo): GPS { + return INDIGPS(this, driverInfo) } - override fun newGuideOutput(name: String, executable: String): GuideOutput { - return INDIGuideOutput(this, name) + override fun newGuideOutput(driverInfo: DriverInfo): GuideOutput { + return INDIGuideOutput(this, driverInfo) } override fun start() { @@ -109,9 +110,9 @@ data class INDIClient(val connection: INDIConnection) : INDIDeviceProtocolHandle ) @JvmStatic - private fun Class.create(handler: INDIClient, name: String): T { - return getConstructor(INDIClient::class.java, String::class.java) - .newInstance(handler, name) + private fun Class.create(handler: INDIClient, driverInfo: DriverInfo): T { + return getConstructor(INDIClient::class.java, DriverInfo::class.java) + .newInstance(handler, driverInfo) } } } diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/DriverInfo.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/DriverInfo.kt new file mode 100644 index 000000000..1c6e2b190 --- /dev/null +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/DriverInfo.kt @@ -0,0 +1,24 @@ +package nebulosa.indi.client.device + +import nebulosa.indi.protocol.TextVector + +data class DriverInfo( + @JvmField val name: String, + @JvmField val executable: String, + @JvmField val version: String, + @JvmField val interfaceType: Int, +) { + + companion object { + + @JvmStatic + fun from(message: TextVector<*>): DriverInfo? { + return DriverInfo( + message.device, + message["DRIVER_EXEC"]?.value?.takeIf { it.isNotBlank() } ?: return null, + message["DRIVER_VERSION"]?.value?.takeIf { it.isNotBlank() } ?: return null, + message["DRIVER_INTERFACE"]?.value?.toIntOrNull() ?: return null, + ) + } + } +} diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDevice.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDevice.kt index 4a1f62f2b..c4887e8a6 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDevice.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDevice.kt @@ -11,15 +11,24 @@ internal abstract class INDIDevice : Device { abstract override val sender: INDIClient - override val properties = linkedMapOf>() - override val messages = LinkedList() + abstract val driverInfo: DriverInfo - override val id by lazy { type.code + "." + name.encodeUtf8().md5().hex() } + final override val properties = linkedMapOf>() + final override val messages = LinkedList() + final override val id by lazy { type.code + "." + name.encodeUtf8().md5().hex() } + final override val snoopedDevices = ArrayList(4) + + override val name + get() = driverInfo.name @Volatile override var connected = false protected set - override val snoopedDevices = ArrayList(4) + final override val driverName + get() = driverInfo.executable + + final override val driverVersion + get() = driverInfo.version private fun addMessageAndFireEvent(text: String) { synchronized(messages) { diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDeviceProtocolHandler.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDeviceProtocolHandler.kt index d17a4d1f7..1497cd0a5 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDeviceProtocolHandler.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/INDIDeviceProtocolHandler.kt @@ -32,85 +32,71 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message override val isClosed get() = protocolReader == null || !protocolReader!!.isRunning - protected abstract fun newCamera(name: String, executable: String): Camera + protected abstract fun newCamera(driverInfo: DriverInfo): Camera - protected abstract fun newMount(name: String, executable: String): Mount + protected abstract fun newMount(driverInfo: DriverInfo): Mount - protected abstract fun newFocuser(name: String, executable: String): Focuser + protected abstract fun newFocuser(driverInfo: DriverInfo): Focuser - protected abstract fun newFilterWheel(name: String, executable: String): FilterWheel + protected abstract fun newFilterWheel(driverInfo: DriverInfo): FilterWheel - protected abstract fun newRotator(name: String, executable: String): Rotator + protected abstract fun newRotator(driverInfo: DriverInfo): Rotator - protected abstract fun newGPS(name: String, executable: String): GPS + protected abstract fun newGPS(driverInfo: DriverInfo): GPS - protected abstract fun newGuideOutput(name: String, executable: String): GuideOutput + protected abstract fun newGuideOutput(driverInfo: DriverInfo): GuideOutput - private fun registerCamera(message: TextVector<*>): Camera? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && camera(message.name) == null) { - newCamera(message.device, executable).also(::registerCamera) + private fun registerCamera(driverInfo: DriverInfo): Camera? { + return if (camera(driverInfo.name) == null) { + newCamera(driverInfo).also(::registerCamera) } else { null } } - private fun registerMount(message: TextVector<*>): Mount? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && mount(message.name) == null) { - newMount(message.device, executable).also(::registerMount) + private fun registerMount(driverInfo: DriverInfo): Mount? { + return if (mount(driverInfo.name) == null) { + newMount(driverInfo).also(::registerMount) } else { null } } - private fun registerFocuser(message: TextVector<*>): Focuser? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && focuser(message.name) == null) { - newFocuser(message.device, executable).also(::registerFocuser) + private fun registerFocuser(driverInfo: DriverInfo): Focuser? { + return if (focuser(driverInfo.name) == null) { + newFocuser(driverInfo).also(::registerFocuser) } else { null } } - private fun registerRotator(message: TextVector<*>): Rotator? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && rotator(message.name) == null) { - newRotator(message.device, executable).also(::registerRotator) + private fun registerRotator(driverInfo: DriverInfo): Rotator? { + return if (rotator(driverInfo.name) == null) { + newRotator(driverInfo).also(::registerRotator) } else { null } } - private fun registerFilterWheel(message: TextVector<*>): FilterWheel? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && wheel(message.name) == null) { - newFilterWheel(message.device, executable).also(::registerFilterWheel) + private fun registerFilterWheel(driverInfo: DriverInfo): FilterWheel? { + return if (wheel(driverInfo.name) == null) { + newFilterWheel(driverInfo).also(::registerFilterWheel) } else { null } } - private fun registerGPS(message: TextVector<*>): GPS? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && gps(message.name) == null) { - newGPS(message.device, executable).also(::registerGPS) + private fun registerGPS(driverInfo: DriverInfo): GPS? { + return if (gps(driverInfo.name) == null) { + newGPS(driverInfo).also(::registerGPS) } else { null } } - private fun registerGuideOutput(message: TextVector<*>): GuideOutput? { - val executable = message["DRIVER_EXEC"]?.value - - return if (!executable.isNullOrEmpty() && message.device.isNotEmpty() && guideOutput(message.device) == null) { - newGuideOutput(message.device, executable).also(::registerGuideOutput) + private fun registerGuideOutput(driverInfo: DriverInfo): GuideOutput? { + return if (guideOutput(driverInfo.name) == null) { + newGuideOutput(driverInfo).also(::registerGuideOutput) } else { null } @@ -161,11 +147,13 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message if (message is TextVector<*>) { when (message.name) { "DRIVER_INFO" -> { - val interfaceType = message["DRIVER_INTERFACE"]?.value?.toIntOrNull() ?: 0 + val driverInfo = DriverInfo.from(message) ?: return + + val interfaceType = driverInfo.interfaceType var registered = false if (DeviceInterfaceType.isCamera(interfaceType)) { - registerCamera(message)?.also { + registerCamera(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -173,7 +161,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isMount(interfaceType)) { - registerMount(message)?.also { + registerMount(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -181,7 +169,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isFilterWheel(interfaceType)) { - registerFilterWheel(message)?.also { + registerFilterWheel(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -189,7 +177,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isFocuser(interfaceType)) { - registerFocuser(message)?.also { + registerFocuser(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -197,7 +185,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isRotator(interfaceType)) { - registerRotator(message)?.also { + registerRotator(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -205,7 +193,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isGPS(interfaceType)) { - registerGPS(message)?.also { + registerGPS(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) @@ -213,7 +201,7 @@ abstract class INDIDeviceProtocolHandler : AbstractINDIDeviceProvider(), Message } if (DeviceInterfaceType.isGuider(interfaceType)) { - registerGuideOutput(message)?.also { + registerGuideOutput(driverInfo)?.also { registered = true it.handleMessage(message) takeMessageFromReorderingQueue(it) diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGPS.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGPS.kt index 0c287db19..e3a6214e7 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGPS.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGPS.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.auxiliary import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.device.DeviceType import nebulosa.indi.device.gps.GPS @@ -15,8 +16,8 @@ import java.time.OffsetDateTime import java.time.ZoneOffset internal open class INDIGPS( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), GPS { override val type diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGuideOutput.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGuideOutput.kt index 24488fbee..b5e66adfe 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGuideOutput.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/auxiliary/INDIGuideOutput.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.auxiliary import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.client.device.handler.INDIGuideOutputHandler import nebulosa.indi.device.DeviceType @@ -9,8 +10,8 @@ import nebulosa.indi.protocol.INDIProtocol import java.time.Duration internal open class INDIGuideOutput( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), GuideOutput { override val type diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/AsiCamera.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/AsiCamera.kt index 56490a761..5bf9a9903 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/AsiCamera.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/AsiCamera.kt @@ -1,13 +1,11 @@ package nebulosa.indi.client.device.camera import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.protocol.INDIProtocol import nebulosa.indi.protocol.NumberVector -internal class AsiCamera( - provider: INDIClient, - name: String, -) : INDICamera(provider, name) { +internal class AsiCamera(provider: INDIClient, driverInfo: DriverInfo) : INDICamera(provider, driverInfo) { override fun handleMessage(message: INDIProtocol) { when (message) { diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/INDICamera.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/INDICamera.kt index 831d78452..9cc506feb 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/INDICamera.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/INDICamera.kt @@ -4,6 +4,7 @@ import nebulosa.fits.FitsHeaderCard import nebulosa.image.algorithms.transformation.CfaPattern import nebulosa.image.format.HeaderCard import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.client.device.handler.INDIGuideOutputHandler import nebulosa.indi.device.Device @@ -23,7 +24,7 @@ import java.time.Duration internal open class INDICamera( final override val sender: INDIClient, - final override val name: String, + final override val driverInfo: DriverInfo, ) : INDIDevice(), Camera { @Volatile final override var exposuring = false @@ -439,7 +440,9 @@ internal open class INDICamera( " gainMax=$gainMax, offset=$offset, offsetMin=$offsetMin," + " offsetMax=$offsetMax, canPulseGuide=$canPulseGuide, pulseGuiding=$pulseGuiding)" - internal data class GuideHeadCamera(override val main: INDICamera) : GuideHead, INDICamera(main.sender, main.name + " $GUIDE_HEAD_SUFFIX") { + internal data class GuideHeadCamera(override val main: INDICamera) : GuideHead, INDICamera(main.sender, main.driverInfo) { + + override val name = main.name + " $GUIDE_HEAD_SUFFIX" init { exposuring = main.exposuring diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SVBonyCamera.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SVBonyCamera.kt index d4a50dbcc..63b4cc5fa 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SVBonyCamera.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SVBonyCamera.kt @@ -1,13 +1,11 @@ package nebulosa.indi.client.device.camera import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.protocol.INDIProtocol import nebulosa.indi.protocol.NumberVector -internal class SVBonyCamera( - provider: INDIClient, - name: String, -) : INDICamera(provider, name) { +internal class SVBonyCamera(provider: INDIClient, driverInfo: DriverInfo) : INDICamera(provider, driverInfo) { override fun handleMessage(message: INDIProtocol) { when (message) { diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SimCamera.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SimCamera.kt index ddc0d7505..88ba8c58d 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SimCamera.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/camera/SimCamera.kt @@ -1,13 +1,11 @@ package nebulosa.indi.client.device.camera import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.protocol.INDIProtocol import nebulosa.indi.protocol.NumberVector -internal class SimCamera( - provider: INDIClient, - name: String, -) : INDICamera(provider, name) { +internal class SimCamera(provider: INDIClient, driverInfo: DriverInfo) : INDICamera(provider, driverInfo) { override fun handleMessage(message: INDIProtocol) { when (message) { diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/focuser/INDIFocuser.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/focuser/INDIFocuser.kt index f8a517f66..5fac1b64a 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/focuser/INDIFocuser.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/focuser/INDIFocuser.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.focuser import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.device.firstOnSwitch import nebulosa.indi.device.focuser.* @@ -10,8 +11,8 @@ import nebulosa.indi.protocol.Vector.Companion.isBusy // https://github.com/indilib/indi/blob/master/libs/indibase/indifocuser.cpp internal open class INDIFocuser( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), Focuser { @Volatile final override var moving = false diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt index 1fb5e4ed6..8c12ec2e9 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/mount/INDIMount.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.mount import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.client.device.handler.INDIGuideOutputHandler import nebulosa.indi.device.firstOnSwitch @@ -19,8 +20,8 @@ import java.time.ZoneOffset // https://github.com/indilib/indi/blob/master/libs/indibase/inditelescope.cpp internal open class INDIMount( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), Mount { @Volatile final override var slewing = false diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/rotator/INDIRotator.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/rotator/INDIRotator.kt index d02f56cbb..15ffea282 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/rotator/INDIRotator.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/rotator/INDIRotator.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.rotator import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.device.firstOnSwitch import nebulosa.indi.device.rotator.* @@ -10,8 +11,8 @@ import nebulosa.indi.protocol.Vector.Companion.isBusy // https://github.com/indilib/indi/blob/master/libs/indibase/indirotatorinterface.cpp internal open class INDIRotator( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), Rotator { @Volatile final override var moving = false diff --git a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/wheel/INDIFilterWheel.kt b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/wheel/INDIFilterWheel.kt index a853c2e14..828912742 100644 --- a/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/wheel/INDIFilterWheel.kt +++ b/nebulosa-indi-client/src/main/kotlin/nebulosa/indi/client/device/wheel/INDIFilterWheel.kt @@ -1,6 +1,7 @@ package nebulosa.indi.client.device.wheel import nebulosa.indi.client.INDIClient +import nebulosa.indi.client.device.DriverInfo import nebulosa.indi.client.device.INDIDevice import nebulosa.indi.device.filterwheel.* import nebulosa.indi.protocol.* @@ -9,8 +10,8 @@ import nebulosa.indi.protocol.Vector.Companion.isBusy // https://github.com/indilib/indi/blob/master/libs/indibase/indifilterwheel.cpp internal open class INDIFilterWheel( - override val sender: INDIClient, - override val name: String, + final override val sender: INDIClient, + final override val driverInfo: DriverInfo, ) : INDIDevice(), FilterWheel { @Volatile final override var count = 0 diff --git a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/Device.kt b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/Device.kt index 6078b3eb1..64d96c6cd 100644 --- a/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/Device.kt +++ b/nebulosa-indi-device/src/main/kotlin/nebulosa/indi/device/Device.kt @@ -21,6 +21,12 @@ interface Device : INDIProtocolHandler, AutoCloseable, Comparable { val snoopedDevices: List + val driverName: String + get() = "" + + val driverVersion: String + get() = "" + fun connect() fun disconnect() @@ -30,15 +36,15 @@ interface Device : INDIProtocolHandler, AutoCloseable, Comparable { } fun ask() { - sendMessageToServer(GetProperties().also { it.device = name }) + sendMessageToServer(GetProperties(name)) } fun enableBlob() { - sendMessageToServer(EnableBLOB().also { it.device = name }) + sendMessageToServer(EnableBLOB(name)) } fun disableBlob() { - sendMessageToServer(EnableBLOB().also { it.value = BLOBEnable.NEVER; it.device = name }) + sendMessageToServer(EnableBLOB(name, value = BLOBEnable.NEVER)) } fun snoop(devices: Iterable) diff --git a/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/EnableBLOB.kt b/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/EnableBLOB.kt index 422485c70..7d32e39cd 100644 --- a/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/EnableBLOB.kt +++ b/nebulosa-indi-protocol/src/main/kotlin/nebulosa/indi/protocol/EnableBLOB.kt @@ -4,11 +4,11 @@ import nebulosa.indi.protocol.INDIProtocol.Companion.writeXML import java.io.PrintStream data class EnableBLOB( - override var name: String = "", override var device: String = "", + override var name: String = "", + var value: BLOBEnable = BLOBEnable.ALSO, override var message: String = "", override var timestamp: String = "", - var value: BLOBEnable = BLOBEnable.ALSO, ) : INDIProtocol { override fun writeTo(stream: PrintStream) = stream.writeXML(