From 994f6168f98234e35d3a759c5b127f49c71606df Mon Sep 17 00:00:00 2001 From: Tim Beccue Date: Tue, 8 Oct 2024 18:07:36 -0400 Subject: [PATCH 1/2] Change "camera_note" to "cam_note" in camera command payload --- src/components/InstrumentControls/Camera.vue | 10 +++++----- src/components/sitepages/SiteObserve.vue | 6 +++--- src/mixins/commands_mixin.js | 6 +++--- src/store/modules/command_params.js | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/InstrumentControls/Camera.vue b/src/components/InstrumentControls/Camera.vue index d1409e99..c9911e6a 100644 --- a/src/components/InstrumentControls/Camera.vue +++ b/src/components/InstrumentControls/Camera.vue @@ -273,10 +273,10 @@ state.subframeIsActive, subframeDefinedWithFile: state => state.subframeDefinedWithFile, camera_areas_selection: state => state.camera_areas_selection, - camera_note: state => state.camera_note, + cam_note: state => state.cam_note, object_name: state => state.object_name, camera_exposure: state => state.camera_exposure, camera_count: state => state.camera_count, @@ -132,7 +132,7 @@ const mutations = { subframeIsActive (state, val) { state.subframeIsActive = val }, subframeDefinedWithFile (state, val) { state.subframeDefinedWithFile = val }, camera_areas_selection (state, val) { state.camera_areas_selection = val }, - camera_note (state, val) { state.camera_note = val }, + cam_note (state, val) { state.cam_note = val }, object_name (state, val) { state.object_name = val }, camera_exposure (state, val) { state.camera_exposure = val }, camera_count (state, val) { state.camera_count = val }, From 2c2a1895e1e657c63ffbf6eb8009fe13106df4c8 Mon Sep 17 00:00:00 2001 From: Tim Beccue Date: Tue, 8 Oct 2024 19:00:08 -0400 Subject: [PATCH 2/2] Add tel_note to mount commands --- .../InstrumentControls/Telescope.vue | 16 ++++++++ src/mixins/commands_mixin.js | 39 ++++++++++--------- src/store/modules/command_params.js | 3 ++ 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/components/InstrumentControls/Telescope.vue b/src/components/InstrumentControls/Telescope.vue index 7ba962f9..8f4364a9 100644 --- a/src/components/InstrumentControls/Telescope.vue +++ b/src/components/InstrumentControls/Telescope.vue @@ -154,6 +154,18 @@

+ + +
@@ -403,6 +415,10 @@ export default { this.$store.commit('command_params/mount_alt', val) } }, + tel_note: { + get () { return this.$store.getters['command_params/tel_note'] }, + set (val) { this.$store.commit('command_params/tel_note', val) } + }, telescope_selection: { get () { diff --git a/src/mixins/commands_mixin.js b/src/mixins/commands_mixin.js index 924433ee..8923792d 100644 --- a/src/mixins/commands_mixin.js +++ b/src/mixins/commands_mixin.js @@ -296,6 +296,7 @@ export const commands_mixin = { ...mapGetters('command_params', [ 'telescope_selection', 'telescope_coordinate_frame', + 'tel_note', 'smartstackIsActive', 'subStackIsActive', @@ -447,16 +448,12 @@ export const commands_mixin = { extract: this.camera_extract, object_name: this.object_name, zoom: this.zoom_options_selection, - // object_name: 'test test test', username: this.username // from auth0 } // Avoid empty strings (thanks, dynamodb) if (this.cam_note != '') { - opt_params.hint = this.cam_note + opt_params.cam_note = this.cam_note } - // if (this.object_name != '') { - // opt_params["hint"] = this.object_name - // } // If active, add subframe parameters. // Also ignore if active but subframe params specify the whole image [(0,0),(1,1)] (the sum should == 2). @@ -503,10 +500,8 @@ export const commands_mixin = { }, mount_slew_radec_command () { let ra = emptyString(this.mount_ra.toString()) - let dec = emptyString(this.mount_dec.toString()) - const obj = emptyString(this.mount_object.toString()) - // console.log(ra) + const object = emptyString(this.mount_object.toString()) // Convert if RA Decimal Degrees if (ra.includes('d')) { @@ -528,14 +523,14 @@ export const commands_mixin = { dec = dec.toFixed(4) } - // if (ra.includes("d") ) { - // ra.replace("d","") - // ra = Number(ra) / 15 - // console.log(ra) - // } + const optional_params = { + object, + ...(this.tel_note != '' && { tel_note: this.tel_note }) // only add tel_note if it's not an empty string + } + return this.base_command('mount', 'go', 'slew to RA/Dec', { ra, dec, frame: this.telescope_coordinate_frame }, - { object: obj } + optional_params ) }, mount_slew_and_center_radec_command () { @@ -548,19 +543,27 @@ export const commands_mixin = { mount_slew_hadec_command () { const ha = emptyString(this.mount_ha.toString()) const dec = emptyString(this.mount_dec.toString()) - const obj = emptyString(this.mount_object.toString()) + const object = emptyString(this.mount_object.toString()) + const optional_params = { + object, + ...(this.tel_note != '' && { tel_note: this.tel_note }) // only add tel_note if it's not an empty string + } return this.base_command('mount', 'go', 'slew to HA/Dec', { ha, dec, frame: this.telescope_coordinate_frame }, - { object: obj } + optional_params ) }, mount_slew_azalt_command () { const az = emptyString(this.mount_az.toString()) const alt = emptyString(this.mount_alt.toString()) - const obj = emptyString(this.mount_object.toString()) + const object = emptyString(this.mount_object.toString()) + const optional_params = { + object, + ...(this.tel_note != '' && { tel_note: this.tel_note }) // only add tel_note if it's not an empty string + } return this.base_command('mount', 'go', 'slew to az/alt', { az, alt, frame: this.telescope_coordinate_frame }, - { object: obj } + optional_params ) }, mount_slew_near_tycho () { diff --git a/src/store/modules/command_params.js b/src/store/modules/command_params.js index acbc5cb1..ecd76107 100644 --- a/src/store/modules/command_params.js +++ b/src/store/modules/command_params.js @@ -17,6 +17,7 @@ const state = { telescope_selection: 1, // 1: main telescope, 2: auxiliary telescope telescope_coordinate_frame: 'ICRS', + tel_note: '', // Stack parameters smartstackIsActive: true, @@ -64,6 +65,7 @@ const getters = { mount_alt: state => state.mount_alt, telescope_selection: state => state.telescope_selection, telescope_coordinate_frame: state => state.telescope_coordinate_frame, + tel_note: state => state.tel_note, smartstackIsActive: state => state.smartstackIsActive, subStackIsActive: state => state.subStackIsActive, subframeIsActive: state => state.subframeIsActive, @@ -127,6 +129,7 @@ const mutations = { mount_object (state, val) { state.mount_object = val }, telescope_selection (state, val) { state.telescope_selection = val }, telescope_coordinate_frame (state, val) { state.telescope_coordinate_frame = val }, + tel_note (state, val) { state.tel_note = val }, smartstackIsActive (state, val) { state.smartstackIsActive = val }, subStackIsActive (state, val) { state.subStackIsActive = val }, subframeIsActive (state, val) { state.subframeIsActive = val },