* test vue-echarts and dataset>source instead of series>data Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix disposed state of chart & delete update interval of settings page Signed-off-by: Stefan Dej <meteyou@gmail.com> * init TS migation & dashboard Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: dashbaord console Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: add "disabled" status to the filament runout sensor on the dashboard Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix klipper restart process Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix status panel during a print Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert g-code files to typescript Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert history files to typescript Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert machine limits to typescript Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert update manager to typescript Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert endstops & logfiles to typescript Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix temp display in tools panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert machine > config files to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert select printer dialog to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert select printer menu to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert farm page to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix debug output of farm printer getters Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix import webcam streams in farm view Signed-off-by: Stefan Dej <meteyou@gmail.com> * better handling when changing printers Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert heightmap to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert heightmap to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * Console QOL (#300) * CHORE Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * NEW: console ts refactor, linux autocomplete, gui helplist, multiline Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * FIX: console autocomplete flood fix Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * fix merged console Signed-off-by: Stefan Dej <meteyou@gmail.com> * fixed return of ConsoleTable.vue isCommand Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: add toast after creating file in ConfigFilesPanel.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: file upload message Signed-off-by: Stefan Dej <meteyou@gmail.com> * add toolbar to files panels Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: disable scrollbars in TempChart.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: sidebar z-index and farm printer toolbar Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: sidebar & topbar z-index and farm printer toolbar Signed-off-by: Stefan Dej <meteyou@gmail.com> * update toolbars in gcode-files and history Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: new settings dialog (#302) * create settings dialog and integrate general, console, control, marcos, presets, webcams Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: renamed webcam gui state variable Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: temperature_fan chamber in farm printers dashboard Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: only display RPM in tools panel, when its available Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: reading empty remote printers list Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: loading additionalSensors in temp panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix: bed_mesh loading rework heightmap settings save heightmap settings in moonraker db Signed-off-by: Stefan Dej <meteyou@gmail.com> * add remote printers to settings Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix types Signed-off-by: Stefan Dej <meteyou@gmail.com> * add beforeDestroy to echarts Signed-off-by: Stefan Dej <meteyou@gmail.com> * add heightmap visualMap scaling and format tooltip Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: logo & primary color customizing Signed-off-by: Stefan Dej <meteyou@gmail.com> * remove keep-alive in app.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * round tempchart data Signed-off-by: Stefan Dej <meteyou@gmail.com> * normalize toolbar buttons Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix series attributes & update echarts-gl Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix hostname in sidebar Signed-off-by: Stefan Dej <meteyou@gmail.com> * rework websocket loadings Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix rework websocket loadings Signed-off-by: Stefan Dej <meteyou@gmail.com> * Fixes for console QOL PR (#301) * FIX: command help dialog added Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * FIX: console fixes Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * rework events store Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: check customFilters if string or array Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: edit preset dont work (existing name check) Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: save webcam with index 0 Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: tool combobox input dont work Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: tooltip position & z-index Signed-off-by: Stefan Dej <meteyou@gmail.com> * rework console Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix output name of filament sensor Signed-off-by: Stefan Dej <meteyou@gmail.com> * store performance updates and StatusPanel.vue optimizing Signed-off-by: Stefan Dej <meteyou@gmail.com> * console bugfixes Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix icon-rotate in temperatures panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * add auto-grow to console input fields Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix dialog action button colors Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix refreshMetadata of gcocde files Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: add multi fileupload to drag&drop upload Signed-off-by: Stefan Dej <meteyou@gmail.com> * convert SystemPanel to TS Signed-off-by: Stefan Dej <meteyou@gmail.com> * add init and getters for system panels Signed-off-by: Stefan Dej <meteyou@gmail.com> * add init and getters for system panels Signed-off-by: Stefan Dej <meteyou@gmail.com> * finish SystemPanel.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: raspberry throttled flags in topbar Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: fix type in TheThrottledStates.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: add new editor (#307) * init test Signed-off-by: Stefan Dej <meteyou@gmail.com> * theme test Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: switch to codemirror editor Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: fix type in TheThrottledStates.vue Signed-off-by: Stefan Dej <meteyou@gmail.com> * reformat flags output and deactivate debug output Signed-off-by: Stefan Dej <meteyou@gmail.com> * add types to throttle states Signed-off-by: Stefan Dej <meteyou@gmail.com> * display "dirty" in the board firmware version string Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix mini console array cut Signed-off-by: Stefan Dej <meteyou@gmail.com> * delete old comment Signed-off-by: Stefan Dej <meteyou@gmail.com> * fix config files on small devices Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: display macro description in settings tab Signed-off-by: Stefan Dej <meteyou@gmail.com> * change settings icons Signed-off-by: Stefan Dej <meteyou@gmail.com> * rename dashboard panel & change slider text in settings Signed-off-by: Stefan Dej <meteyou@gmail.com> * responsive optimations for settings Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix throttled state flags filter Signed-off-by: Stefan Dej <meteyou@gmail.com> * Code highlighting for codemirror (#309) * init test Signed-off-by: Stefan Dej <meteyou@gmail.com> * theme test Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: switch to codemirror editor Signed-off-by: Stefan Dej <meteyou@gmail.com> * NEW: klipper_config editor theme Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> * NEW: code highlighting for codemirror Signed-off-by: Eike Ahmels <eike.ahmels@tu-dortmund.de> Co-authored-by: Stefan Dej <meteyou@gmail.com> * feature: hide/show jobs with special print status Signed-off-by: Stefan Dej <meteyou@gmail.com> * redesign console help modal Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: default state of sidebar was wrong on mobile devices Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: mobile view interface settings Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: optimize mobile view interface settings Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: block empty console commands Signed-off-by: Stefan Dej <meteyou@gmail.com> * push version number Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: add current / max flow in status panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * feature: add big gcode thumbnail to status panel Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: fix favicon and setting tab names Signed-off-by: Stefan Dej <meteyou@gmail.com> * cleanup old editor Signed-off-by: Stefan Dej <meteyou@gmail.com> * bugfix: add redirect for updates from 1.6.0 to 2.0.0 Signed-off-by: Stefan Dej <meteyou@gmail.com> Co-authored-by: Eike Ahmels <hui_buh-@gmx.net>
384 lines
20 KiB
Vue
384 lines
20 KiB
Vue
<style scoped>
|
|
.heater-row .vertical_align_center {
|
|
margin: auto 0;
|
|
}
|
|
|
|
.colHeaterIcons {
|
|
width: 68px;
|
|
}
|
|
|
|
.canvasjs-chart-tooltip>div {
|
|
border-radius: 10px !important;
|
|
}
|
|
|
|
.datasetColorSymbol {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-style: solid;
|
|
border-width: 0px;
|
|
cursor: pointer;
|
|
border-radius: 50%;
|
|
}
|
|
|
|
</style>
|
|
|
|
<template>
|
|
<v-card v-if="klipperReadyForGui" class="mb-6">
|
|
<v-toolbar flat dense>
|
|
<v-toolbar-title>
|
|
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Panels.ToolsPanel.Temperatures") }}</span>
|
|
</v-toolbar-title>
|
|
<v-spacer></v-spacer>
|
|
<v-menu :offset-y="true" title="Preheat" v-if="presets.length">
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Panels.ToolsPanel.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
|
|
</template>
|
|
<v-list dense class="py-0">
|
|
<v-list-item v-for="preset of presets" v-bind:key="preset.index" link @click="preheat(preset)">
|
|
<v-list-item-icon class="mr-0">
|
|
<v-icon small>mdi-fire</v-icon>
|
|
</v-list-item-icon>
|
|
<v-list-item-content>
|
|
<v-list-item-title v-text="preset.name"></v-list-item-title>
|
|
</v-list-item-content>
|
|
</v-list-item>
|
|
</v-list>
|
|
<v-divider></v-divider>
|
|
<v-list dense class="py-0">
|
|
<v-list-item link @click="cooldown()">
|
|
<v-list-item-icon class="mr-0">
|
|
<v-icon small>mdi-snowflake</v-icon>
|
|
</v-list-item-icon>
|
|
<v-list-item-content>
|
|
<v-list-item-title>{{ $t("Panels.ToolsPanel.Cooldown") }}</v-list-item-title>
|
|
</v-list-item-content>
|
|
</v-list-item>
|
|
</v-list>
|
|
</v-menu>
|
|
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="presets.length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Panels.ToolsPanel.Cooldown") }}</v-btn>
|
|
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Panels.ToolsPanel.SetupTemperatures')">
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<v-btn small class="px-2 minwidth-0 ml-3" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
|
</template>
|
|
<v-list>
|
|
<v-list-item class="minHeight36">
|
|
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Panels.ToolsPanel.ShowChart')"></v-checkbox>
|
|
</v-list-item>
|
|
<v-list-item class="minHeight36">
|
|
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Panels.ToolsPanel.AutoscaleChart')"></v-checkbox>
|
|
</v-list-item>
|
|
</v-list>
|
|
</v-menu>
|
|
</v-toolbar>
|
|
<v-card-text class="pa-0 content">
|
|
<v-container class="px-0">
|
|
<v-row align="center">
|
|
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Panels.ToolsPanel.Name") }}</v-col>
|
|
<v-col class="py-2 text-center flex-grow-0 font-weight-bold d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">{{ $t("Panels.ToolsPanel.Color") }}</v-col>
|
|
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Panels.ToolsPanel.State") }}</v-col>
|
|
<v-col class="py-2 text-center font-weight-bold">{{ $t("Panels.ToolsPanel.Current") }}</v-col>
|
|
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Panels.ToolsPanel.Target") }}</v-col>
|
|
</v-row>
|
|
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
|
<v-divider class="my-2"></v-divider>
|
|
<v-row align="center">
|
|
<v-col class="pl-8 pr-0 flex-grow-0 py-2 colHeaterIcons">
|
|
<v-icon :color="heater.iconColor">mdi-{{ heater.icon }}</v-icon>
|
|
</v-col>
|
|
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(heater)">{{ convertName(heater.name) }}</span></v-col>
|
|
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
|
<div :style="'background-color: '+heater.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(heater)"></div>
|
|
</v-col>
|
|
<v-col class="py-2 text-center d-none d-sm-block">
|
|
<v-tooltip top>
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<small v-bind="attrs" v-on="on">{{ heater.target > 0 ? heater.power+'%' : "off" }}</small>
|
|
</template>
|
|
<span>{{ $t("Panels.ToolsPanel.Avg") }}: {{ heater.avgPower+'%' }}</span>
|
|
</v-tooltip>
|
|
</v-col>
|
|
<v-col class="py-2 text-center">
|
|
<span class="d-block">{{ heater.temperature.toFixed(1) }}°C</span>
|
|
<div v-for="(values, key) of heater.additionSensors" v-bind:key="key">
|
|
<span v-if="values.bool" class="d-block"><small>{{ values.value }} {{ values.unit }}</small></span>
|
|
</div>
|
|
</v-col>
|
|
<v-col class="text-center py-2 pr-8 vertical_align_center">
|
|
<tool-input
|
|
:name="heater.name"
|
|
:target="heater.target"
|
|
:min_temp="heater.min_temp"
|
|
:max_temp="heater.max_temp"
|
|
:items="heater.presets"
|
|
command="SET_HEATER_TEMPERATURE"
|
|
attribute-name="HEATER"
|
|
></tool-input>
|
|
</v-col>
|
|
</v-row>
|
|
</div>
|
|
<div v-for="(fan, index) in temperatureFans" v-bind:key="index+99" >
|
|
<v-divider class="my-2"></v-divider>
|
|
<v-row align="center">
|
|
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
|
|
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
|
|
</v-col>
|
|
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(fan)">{{ convertName(fan.name) }}</span></v-col>
|
|
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
|
<div :style="'background-color: '+fan.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(fan)"></div>
|
|
</v-col>
|
|
<v-col class="py-2 text-center d-none d-sm-block">
|
|
<v-tooltip top>
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<small class="d-block" v-bind="attrs" v-on="on">{{ fan.target > 0 && fan.speed > 0 ? fan.speed+"%" : (fan.target > 0 ? "standby" : "off") }}</small>
|
|
</template>
|
|
<span>{{ $t("Panels.ToolsPanel.Avg") }}: {{ fan.avgSpeed+'%' }}</span>
|
|
</v-tooltip>
|
|
</v-col>
|
|
<v-col class="py-2 text-center">
|
|
<span class="d-block">{{ fan.temperature.toFixed(1) }}°C</span>
|
|
<div v-for="(values, key) of fan.additionSensors" v-bind:key="key">
|
|
<span v-if="values.bool" class="d-block"><small>{{ values.value }} {{ values.unit }}</small></span>
|
|
</div>
|
|
<small v-if="fan.rpm !== null" :class="'d-block ' + (fan.rpm === 0 && fan.speed > 0 ? 'red--text' : '')">{{ fan.rpm }} RPM</small>
|
|
</v-col>
|
|
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
|
|
<tool-input
|
|
:name="fan.name"
|
|
:target="fan.target"
|
|
:min_temp="fan.min_temp"
|
|
:max_temp="fan.max_temp"
|
|
:items="fan.presets"
|
|
command="SET_TEMPERATURE_FAN_TARGET"
|
|
attribute-name="temperature_fan"
|
|
></tool-input>
|
|
</v-col>
|
|
</v-row>
|
|
</div>
|
|
<div v-for="(sensor,index) in temperatureSensors" v-bind:key="index+999">
|
|
<v-divider class="my-2"></v-divider>
|
|
<v-row align="center">
|
|
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
|
|
<v-icon color="grey darken-2" :title="$t('Panels.ToolsPanel.Min')+': '+sensor.min_temp+'° / ' + $t('Panels.ToolsPanel.Max')+': '+sensor.max_temp+'°'">mdi-{{ sensor.icon }}</v-icon>
|
|
</v-col>
|
|
<v-col class="py-2 font-weight-bold">
|
|
<span style="cursor: pointer;" @click="openHeater(sensor)">{{ convertName(sensor.name) }}</span>
|
|
</v-col>
|
|
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
|
<div :style="'background-color: '+sensor.chartColor+'CC;'" class="datasetColorSymbol d-inline-block" @click="openHeater(sensor)"></div>
|
|
</v-col>
|
|
<v-col class="py-2 d-none d-sm-block"><span> </span></v-col>
|
|
<v-col class="py-2 text-center">
|
|
<v-tooltip top>
|
|
<template v-slot:activator="{ on, attrs }">
|
|
<span
|
|
style="cursor: default;"
|
|
class="d-block px-0"
|
|
v-bind="attrs"
|
|
v-on="on"
|
|
>{{ sensor.temperature.toFixed(1) }}°C</span>
|
|
</template>
|
|
<span>{{ $t('Panels.ToolsPanel.Max')}}: {{ sensor.measured_max_temp }}°C<br />{{ $t('Panels.ToolsPanel.Min') }}: {{ sensor.measured_min_temp }}°C</span>
|
|
</v-tooltip>
|
|
<div v-for="(values, key) of sensor.additionSensors" v-bind:key="key">
|
|
<span v-if="values.bool" class="d-block"><small>{{ values.value }} {{ values.unit }}</small></span>
|
|
</div>
|
|
</v-col>
|
|
<v-col class="text-center py-2 pr-8 vertical_align_center"><span> </span></v-col>
|
|
</v-row>
|
|
</div>
|
|
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
|
|
<v-row v-if="boolTempchart">
|
|
<v-col class="py-0 px-3">
|
|
<temp-chart></temp-chart>
|
|
</v-col>
|
|
</v-row>
|
|
</v-container>
|
|
</v-card-text>
|
|
<v-dialog v-model="editHeater.bool" persistent :width="400">
|
|
<v-card dark>
|
|
<v-toolbar flat dense color="primary">
|
|
<v-toolbar-title>
|
|
<span class="subheading">
|
|
<v-icon left>mdi-{{ editHeater.icon }}</v-icon>
|
|
{{ convertName(editHeater.name) }}
|
|
</span>
|
|
</v-toolbar-title>
|
|
<v-spacer></v-spacer>
|
|
<v-btn small class="minwidth-0" @click="editHeater.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
|
</v-toolbar>
|
|
<v-card-text class="pt-6">
|
|
<v-row v-for="dataset in editHeater.chartSeries" v-bind:key="dataset">
|
|
<v-col class="col-12 py-1">
|
|
<v-checkbox
|
|
v-model="editHeater['bool' + dataset.charAt(0).toUpperCase() + dataset.slice(1)]"
|
|
:label="$t('Panels.ToolsPanel.ShowNameInChart', {name: $t('Panels.ToolsPanel.Dataset.'+dataset.charAt(0).toUpperCase() + dataset.slice(1))})"
|
|
hide-details
|
|
class="mt-0"
|
|
@change="setVisible(dataset)"
|
|
></v-checkbox>
|
|
</v-col>
|
|
</v-row>
|
|
<v-row v-for="key in Object.keys(editHeater.additionSensors)" v-bind:key="key">
|
|
<v-col class="col-12 py-1">
|
|
<v-checkbox
|
|
v-model="editHeater.additionSensors[key]['bool']"
|
|
:label="$t('Panels.ToolsPanel.ShowNameInList', {name: key})"
|
|
hide-details
|
|
class="mt-0"
|
|
@change="setVisibleAdditionalSensor(key)"
|
|
></v-checkbox>
|
|
</v-col>
|
|
</v-row>
|
|
<v-row>
|
|
<v-col class="col-12 text-center py-0">
|
|
<v-color-picker
|
|
hide-canvas
|
|
hide-mode-switch
|
|
mode="hexa"
|
|
:value="editHeater.color"
|
|
@update:color="setChartColor"
|
|
class="mx-auto"
|
|
></v-color-picker>
|
|
</v-col>
|
|
</v-row>
|
|
</v-card-text>
|
|
</v-card>
|
|
</v-dialog>
|
|
</v-card>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Component from "vue-class-component";
|
|
import {Mixins} from "vue-property-decorator";
|
|
import BaseMixin from "@/components/mixins/base";
|
|
import {GuiStatePreset} from "@/store/gui/types";
|
|
import { convertName } from '@/plugins/helpers'
|
|
import ToolInput from "@/components/inputs/ToolInput.vue";
|
|
import TempChart from "@/components/charts/TempChart.vue";
|
|
import {datasetTypes} from "@/store/variables";
|
|
import {PrinterStateHeater, PrinterStateSensor, PrinterStateTemperatureFan} from "@/store/printer/types";
|
|
import {Debounce} from "vue-debounce-decorator";
|
|
|
|
@Component({
|
|
components: {TempChart, ToolInput}
|
|
})
|
|
export default class ToolsPanel extends Mixins(BaseMixin) {
|
|
convertName = convertName
|
|
datasetTypes = datasetTypes
|
|
|
|
private editHeater: any = {
|
|
bool: false,
|
|
name: "",
|
|
icon: "",
|
|
boolTemperature: false,
|
|
boolTarget: false,
|
|
boolPower: false,
|
|
boolSpeed: false,
|
|
additionSensors: {},
|
|
color: "",
|
|
}
|
|
|
|
get presets(): GuiStatePreset[] {
|
|
return this.$store.getters['gui/getPreheatPresets'] ?? []
|
|
}
|
|
|
|
get cooldownGcode(): string {
|
|
return this.$store.state.gui.cooldown_gcode ?? "TURN_OFF_HEATERS"
|
|
}
|
|
|
|
get boolTempchart(): boolean {
|
|
return this.$store.state.gui.dashboard?.boolTempchart ?? false
|
|
}
|
|
|
|
set boolTempchart(newVal: boolean) {
|
|
this.$store.dispatch("gui/saveSetting", { name: 'dashboard.boolTempchart', value: newVal })
|
|
}
|
|
|
|
get autoscaleTempchart(): boolean {
|
|
return this.$store.state.gui.tempchart.autoscale ?? false
|
|
}
|
|
|
|
set autoscaleTempchart(newVal: boolean) {
|
|
this.$store.dispatch("gui/saveSetting", { name: 'tempchart.autoscale', value: newVal })
|
|
}
|
|
|
|
get heaters(): PrinterStateHeater[] {
|
|
return this.$store.getters['printer/getHeaters'] ?? []
|
|
}
|
|
|
|
get temperatureFans(): PrinterStateTemperatureFan {
|
|
return this.$store.getters["printer/getTemperatureFans"]
|
|
}
|
|
|
|
get temperatureSensors(): PrinterStateSensor {
|
|
return this.$store.getters["printer/getTemperatureSensors"]
|
|
}
|
|
|
|
preheat(preset: GuiStatePreset): void {
|
|
for (const [name, attributes] of Object.entries(preset.values)) {
|
|
if (attributes.bool) {
|
|
let gcode = "SET_HEATER_TEMPERATURE HEATER="+name+" TARGET="+attributes.value
|
|
|
|
if (attributes.type === "temperature_fan") {
|
|
const fanName = name.replace("temperature_fan ", "")
|
|
gcode = "SET_TEMPERATURE_FAN_TARGET temperature_fan="+fanName+" TARGET="+attributes.value
|
|
}
|
|
|
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
|
}
|
|
}
|
|
|
|
if (preset.gcode !== "") {
|
|
setTimeout(() => {
|
|
this.$store.dispatch('server/addEvent', { message: preset.gcode, type: 'command' })
|
|
this.$socket.emit('printer.gcode.script', { script: preset.gcode })
|
|
}, 100)
|
|
}
|
|
}
|
|
|
|
cooldown(): void {
|
|
this.$store.dispatch('server/addEvent', { message: this.cooldownGcode, type: 'command' })
|
|
this.$socket.emit('printer.gcode.script', { script: this.cooldownGcode })
|
|
}
|
|
|
|
openHeater(object: PrinterStateHeater | PrinterStateTemperatureFan | PrinterStateSensor): void {
|
|
this.editHeater.name = object.name
|
|
this.editHeater.icon = object.icon
|
|
|
|
this.editHeater.color = object.chartColor
|
|
this.editHeater.chartSeries = 'chartSeries' in object ? object.chartSeries : []
|
|
this.editHeater.boolTemperature = this.$store.getters["gui/getDatasetValue"]({ name: object.name, type: 'temperature' })
|
|
this.editHeater.boolTarget = this.$store.getters["gui/getDatasetValue"]({ name: object.name, type: 'target' })
|
|
this.editHeater.boolPower = this.$store.getters["gui/getDatasetValue"]({ name: object.name, type: 'power' })
|
|
this.editHeater.boolSpeed = this.$store.getters["gui/getDatasetValue"]({ name: object.name, type: 'speed' })
|
|
this.editHeater.additionSensors = object.additionSensors
|
|
|
|
this.editHeater.bool = true
|
|
}
|
|
|
|
setVisible(type: string): void {
|
|
const serieName = 'bool'+type.charAt(0).toUpperCase() + type.slice(1)
|
|
const value = this.editHeater[serieName]
|
|
|
|
const path = "tempchart.datasetSettings."+this.editHeater.name+"."+type
|
|
this.$socket.emit('server.database.post_item', { namespace: 'mainsail', key: path, value: value }, { action: 'gui/updateDataFromDB' })
|
|
}
|
|
|
|
setVisibleAdditionalSensor(sensor: string): void {
|
|
const path = "tempchart.datasetSettings."+this.editHeater.name+".additionalSensors."+sensor
|
|
this.$socket.emit('server.database.post_item', { namespace: 'mainsail', key: path, value: this.editHeater.additionSensors[sensor].bool }, { action: 'gui/updateDataFromDB' })
|
|
}
|
|
|
|
@Debounce(500)
|
|
setChartColor(value: string | any): void {
|
|
if (typeof value === "object" && 'hex' in value) value = value.hex
|
|
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.name, value: value })
|
|
|
|
const path = "tempchart.datasetSettings."+this.editHeater.name+".color"
|
|
this.$socket.emit('server.database.post_item', { namespace: 'mainsail', key: path, value: value }, { action: 'gui/updateDataFromDB' })
|
|
}
|
|
|
|
|
|
}
|
|
</script> |