-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/auto color #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,7 @@ | |
| v-model="filter_wheel_options_selection" | ||
| placeholder="select filter..." | ||
| size="is-small" | ||
| :disabled="auto_color_options_selection !== 'manual'" | ||
| > | ||
| <option | ||
| v-for="(filter, index) in filter_wheel_options" | ||
|
|
@@ -137,6 +138,29 @@ | |
| </b-field> | ||
| </b-field> | ||
|
|
||
| <b-field | ||
| v-if="auto_color_options.length > 1" | ||
| horizontal | ||
| label="Auto-Color" | ||
| > | ||
| <b-field> | ||
| <b-select | ||
| v-model="auto_color_options_selection" | ||
| placeholder="auto-color..." | ||
| size="is-small" | ||
| > | ||
| <option | ||
| v-for="(color_opt, index) in auto_color_options" | ||
| :key="index" | ||
| :value="color_opt" | ||
| :selected="index === 0" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is necessary because the default selection is already defined through the v-model setting. |
||
| > | ||
| {{ color_opt }} | ||
| </option> | ||
| </b-select> | ||
| </b-field> | ||
| </b-field> | ||
|
|
||
| <!--b-field horizontal label="Bin" v-if="camera_can_bin"> | ||
| <b-select placeholder="Select bin" v-model="camera_bin" size="is-small"> | ||
| <option | ||
|
|
@@ -418,6 +442,11 @@ export default { | |
| set (val) { this.$store.commit('command_params/filter_wheel_options_selection', val) } | ||
| }, | ||
|
|
||
| auto_color_options_selection: { | ||
| get () { return this.$store.getters['command_params/auto_color_options_selection'] }, | ||
| set (val) { this.$store.commit('command_params/auto_color_options_selection', val) } | ||
| }, | ||
|
|
||
| selector_position: { | ||
| get () { return this.$store.getters['command_params/selector_position'] }, | ||
| set (val) { this.$store.commit('command_params/selector_position', val) } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,6 +278,7 @@ export const commands_mixin = { | |
| // (eg. what filters are available in the filter wheel) | ||
| 'camera_areas', | ||
| 'filter_wheel_options', | ||
| 'auto_color_options', | ||
| 'camera_bin_options', | ||
| 'camera_can_bin' | ||
| ]), | ||
|
|
@@ -308,6 +309,7 @@ export const commands_mixin = { | |
| 'camera_de_ice_cooling', | ||
|
|
||
| 'filter_wheel_options_selection', | ||
| 'auto_color_options_selection', | ||
|
|
||
| 'selector_position', | ||
|
|
||
|
|
@@ -431,6 +433,7 @@ export const commands_mixin = { | |
| count: this.camera_count.toString(), | ||
| bin: JSON.stringify(this.camera_bin), | ||
| filter: this.filter_wheel_options_selection, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might make more sense to not include the filter if auto_color is set to something besides manual. It maps to reality a little better, but it does make the code a little more complicated. So I'm not 100% sold in either direction. Thoughts? |
||
| auto_color: this.auto_color_options_selection, | ||
| area: this.camera_areas_selection, | ||
| dither: this.camera_dither, | ||
| extract: this.camera_extract, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,6 +187,13 @@ const getters = { | |
| return fwo | ||
| }, | ||
|
|
||
| // Available automatic 3-color image options | ||
| auto_color_options: (state, getters) => { | ||
| const fwo = getters.selected_filter_wheel_config.settings?.auto_color_options | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwo (from the method above) refers to filter wheel options (admittedly not a fantastic name). I think a different name here would help future readability. |
||
| if (fwo == undefined) return [[]] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally a good idea to use the strict equality operator Also, while the filter wheel options expects a different format (the first array element is an array of keys, so an empty value still needs one element). But the auto_color_options is just a simple array of values. So the empty value should just be a simple |
||
| return fwo | ||
| }, | ||
|
|
||
| // Get the site events from the selected config (things like nautical dark start, etc) | ||
| site_events: (state, getters) => { | ||
| return getters.site_config.events ?? {} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this tag necessary?