Skip to content
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

fix(tempchart): fix select/unselect monitor sensors in tempchart #1903

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"codemirror": "^6.0.1",
"core-js": "^3.16.0",
"detect-browser": "^5.3.0",
"echarts": "^5.2.2",
"echarts": "^5.5.0",
"echarts-gl": "^2.0.8",
"hls.js": "^1.3.3",
"jmuxer": "^2.0.5",
Expand Down
11 changes: 2 additions & 9 deletions src/components/charts/TempChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,8 @@ export default class TempChart extends Mixins(BaseMixin, ThemeMixin) {
}

@Watch('selectedLegends')
selectedLegendsChanged(newVal: any, oldVal: any) {
if (this.chart?.isDisposed() !== true) {
Object.keys(newVal).forEach((key) => {
if (newVal[key] !== oldVal[key]) {
const actionType = newVal[key] ? 'legendSelect' : 'legendUnSelect'
this.chart?.dispatchAction({ type: actionType, name: key })
}
})
}
selectedLegendsChanged(newVal: any) {
if (this.chart?.isDisposed() !== true) this.chart?.setOption({ legend: { selected: newVal } })
}

@Watch('source')
Expand Down
3 changes: 2 additions & 1 deletion src/store/printer/tempHistory/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ export const getters: GetterTree<PrinterTempHistoryState, RootState> = {

const selected: legends = {}
const available_sensors = rootState.printer?.heaters?.available_sensors ?? []
const available_monitors = rootState.printer?.heaters?.available_monitors ?? []
const viewSettings = rootState.gui?.view?.tempchart?.datasetSettings ?? {}

Object.keys(viewSettings).forEach((key) => {
// break if this element doesn't exist in available_sensors
if (!available_sensors.includes(key)) return
if (!available_sensors.includes(key) && !available_monitors.includes(key)) return

Object.keys(viewSettings[key]).forEach((attrKey) => {
// break if this element isn't a valid datasetType
Expand Down
Loading