Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74f104f1a4 | ||
|
|
9ccc3f69a3 | ||
|
|
0d2f9bd8d8 | ||
|
|
28aa03a55f | ||
|
|
d891ec0800 | ||
|
|
767a9403fd | ||
|
|
6fb8d16143 | ||
|
|
0cffe5f235 | ||
|
|
f634872297 | ||
|
|
91014a7349 | ||
|
|
850eecd600 | ||
|
|
fff66f0c3b | ||
|
|
3749b76162 | ||
|
|
88ac7a5cae | ||
|
|
eb123ffc01 | ||
|
|
411087434c | ||
|
|
8db37259e1 | ||
|
|
3a03d93fef | ||
|
|
42071ae422 | ||
|
|
aeb6ae1ec9 | ||
|
|
837f6641d0 | ||
|
|
7a139d68c5 | ||
|
|
24bfb8bc58 | ||
|
|
390bb40c69 | ||
|
|
84470463fe | ||
|
|
f9c989793c | ||
|
|
b0044f3d2b | ||
|
|
e2e496c31e | ||
|
|
8363932ae9 | ||
|
|
f958027671 | ||
|
|
4b678468ab | ||
|
|
9090c60038 | ||
|
|
35955d4899 | ||
|
|
4a58f0c3e2 | ||
|
|
4003166000 | ||
|
|
9888d796bd | ||
|
|
8a8587786a | ||
|
|
64c6790d3a | ||
|
|
28998090e6 | ||
|
|
87e1ccb384 | ||
|
|
e5469b47ca |
No files matched your search
+10
-1
@@ -1,6 +1,15 @@
|
||||
title: "Mainsail"
|
||||
tagline: A web interface for Klipper
|
||||
description: Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
|
||||
logo: "/assets/img/logo-mainsail.png"
|
||||
description: A web interface for Klipper
|
||||
theme: just-the-docs
|
||||
remote_theme: pmarsceill/just-the-docs
|
||||
color_scheme: "mainsail"
|
||||
search_enabled: true
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
image: assets/img/rtfm.png
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Support
|
||||
nav_order: 7
|
||||
has_children: true
|
||||
permalink: /additional
|
||||
---
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 647 KiB |
+8
-2
@@ -9,9 +9,15 @@ has_children: false
|
||||
|
||||
Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
|
||||
|
||||
[Setup Guide](/setup-guide/index.md){: .btn}
|
||||
[Setup Guide](/setup){: .btn}
|
||||
[Release Notes](https://github.com/meteyou/mainsail/releases){: .btn}{:target="_blank"}
|
||||
|
||||
For support join us on Discord, or open an issue on Github.
|
||||
|
||||
[Discord](https://discord.gg/skWTwTD){: .btn}{:target="_blank"}
|
||||
[Github](https://github.com/meteyou/mainsail){: .btn}{:target="_blank"}
|
||||
|
||||
|
||||
For support join our discord server -> [https://discord.gg/skWTwTD](https://discord.gg/skWTwTD)
|
||||
|
||||
## Screenshots
|
||||

|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Sensors
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/additional-sensors
|
||||
description: >-
|
||||
Integrate additional sensors into the temperature graph. For example Raspberry Pi, MCU, BMExxx, HTU21D, LM75 and more..
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Raspberry Pi temperature sensor
|
||||
|
||||
Append the following section to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[temperature_sensor raspberry_pi]
|
||||
sensor_type: rpi_temperature
|
||||
min_temp: 10
|
||||
max_temp: 100
|
||||
```
|
||||
|
||||
## ATSAM, ATAMD, and STM32 temperature sensor
|
||||
|
||||
Append the following section to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[temperature_sensor mcu_temp]
|
||||
sensor_type: temperature_mcu
|
||||
min_temp: 0
|
||||
max_temp: 100
|
||||
```
|
||||
|
||||
For more information on this topic and how to add additional sensors, please refer to [Klipper documentation](https://www.klipper3d.org/Config_Reference.html#builtin-micro-controller-temperature-sensor){:target="_blank"}.
|
||||
{: .info}
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
layout: default
|
||||
title: Console Shortcuts
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/console-shortcuts
|
||||
description: >-
|
||||
Similar to a terminal of your OS, there are some keyboard shortcuts in Mainsail that make your everyday life easier.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Help command
|
||||
|
||||
Issue a `HELP` command to get a list of possible commands.
|
||||
|
||||
## Autocomplete
|
||||
|
||||
You can start typing a command and then complete it with the tab-key. If there are several possibilities, you will get a list of choices.
|
||||
|
||||

|
||||
|
||||
## Scroll through commands
|
||||
|
||||
Using the ↑ up / ↓ down arrow keys you can scroll through previous commands.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: default
|
||||
title: Disable Octoprint LCD menu
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/disable-octoprint-lcd-menu
|
||||
description: >-
|
||||
Klipper is shipped with an Octoprint entry in the LCD menu. These menu points don't work with Mainsail.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Modify printer.cfg
|
||||
Just add the following entry to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[menu __main __octoprint]
|
||||
type: disabled
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
layout: default
|
||||
title: Hide macros, outputs or fans
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/hide-gcode_macros
|
||||
description: >-
|
||||
As you probably already noticed, you can show and hide the gcode macros in the interface settings, but there is more...
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
Did you know, that you can also hide gcode macros by prefixing the name with an underscore?
|
||||
|
||||
```yaml
|
||||
[gcode_macro MY_AWESOME_GCODE]
|
||||
gcode:
|
||||
_MY_HELPER_CODE
|
||||
```
|
||||
|
||||
```yaml
|
||||
[gcode_macro _MY_HELPER_CODE]
|
||||
gcode:
|
||||
M300
|
||||
```
|
||||
|
||||
`MY_AWESOME_GCODE` appears in your interface settings, `_MY_HELPER_CODE` not.
|
||||
|
||||

|
||||
|
||||
By the way, this also works for other configuration sections like, **fans and outputs.**
|
||||
{: .info}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: default
|
||||
title: Quicktips
|
||||
nav_order: 10
|
||||
has_children: true
|
||||
permalink: /quicktips
|
||||
description: quick tips, without much explanation
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
layout: default
|
||||
title: Presets
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/presets
|
||||
description: >-
|
||||
Mainsail supports so-called presets. They are often used for preheat & cooldown, but also execute normal gcode.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
In Mainsails interface settings you will find a section called "Preheat Presets". There you can set your presets via "ADD PRESET" and the following dialog.
|
||||
|
||||
### Preheat
|
||||
|
||||
Enter a name \(e.g. name, color and type of filament\) and the temperatures obtained. You can disable individual heaters and even specify a custom gcode for the preheat phase.
|
||||
|
||||

|
||||
|
||||
### Further Examples
|
||||
|
||||
#### Z-Offset
|
||||
|
||||
To quickly switch between different Z-offsets \(flexplates with smooth and textured surfaces\), you can create presets and deactivate the heaters.
|
||||
|
||||
As G-Code you simply enter `SET_GCODE_OFFSET Z=0.2`, of course with your determined offset.
|
||||
|
||||

|
||||
@@ -1,17 +1,19 @@
|
||||
---
|
||||
layout: default
|
||||
title: Slicer upload
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/slicer-upload
|
||||
title: Slicer Upload
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/slicer-upload
|
||||
description: >-
|
||||
It is possible to upload G-Code from your slicer and have it start printing.
|
||||
---
|
||||
|
||||
## Upload from Slicer
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
Moonraker has compatibility with Octoprint's legacy file upload API.
|
||||
|
||||
### PrusaSlicer/SuperSlicer (prior to v2.3.0)
|
||||
|
||||
You can upload your GCode-files from your Slicer. Moonraker simulates the octoprint-upload function.
|
||||
|
||||
If not already been done, switch to advanced or expert mode and set the options under "Printer Settings / General" as shown in the screenshot below.
|
||||
If not already been done, switch to advanced or expert mode and set the options under `Printer Settings / General` as shown in the screenshot below.
|
||||
For "API Key" you can type anything.
|
||||
|
||||

|
||||
@@ -1,20 +1,27 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/thumbnails
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/thumbnails
|
||||
description: >-
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
---
|
||||
|
||||
## Thumbnails
|
||||
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer (since v2.3.0)
|
||||
|
||||
In "Expert" mode PrusaSlicer has an option in the "Printer Settings" tab to activate previews.
|
||||
Under `General / Firmware`, enter `32x32,400x300` as "G-code thumbnails".
|
||||
|
||||

|
||||
|
||||
### SuperSlicer (since v2.2.54.0)
|
||||
|
||||
In "Expert" mode SuperSlicer has some very convenient options in the "printer settings" tab to activate and customize the previews.
|
||||
In "Expert" mode SuperSlicer has some very convenient options in the "Printer Settings" tab to activate and customize the previews.
|
||||
|
||||

|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
layout: default
|
||||
title: Update Manager
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/update-manager
|
||||
description: >-
|
||||
Perform updates of Mainsail, Klipper, Moonraker and your system from within Mainsail.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Moonraker.conf
|
||||
|
||||
Add the following section to your printers moonraker.conf:
|
||||
|
||||
```yaml
|
||||
[update_manager]
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
Once you have restarted the moonraker service, the Update Manager will appear in Mainsails machine settings.
|
||||
|
||||

|
||||
|
||||
|
||||
You can find further information on this topic by checking out the [Moonraker documentation](https://github.com/Arksine/moonraker/blob/master/docs/configuration.md#update_manager){:target="_blank"}.
|
||||
{: .info}
|
||||
+5
-1
@@ -4,7 +4,11 @@ title: Remote Mode
|
||||
nav_order: 4
|
||||
has_children: false
|
||||
permalink: /remotemode
|
||||
description: >-
|
||||
description in progress
|
||||
---
|
||||
|
||||
## Remote Mode
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
The description will follow soon.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "1.0.2",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
||||
+10
-6
@@ -35,6 +35,7 @@
|
||||
:value="true"
|
||||
>
|
||||
<router-link
|
||||
style="position: relative;"
|
||||
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
|
||||
v-if="
|
||||
(category.title === 'Webcam' && boolNaviWebcam) ||
|
||||
@@ -45,12 +46,16 @@
|
||||
)
|
||||
">
|
||||
<v-icon>mdi-{{ category.icon }}</v-icon>
|
||||
<v-badge
|
||||
dot
|
||||
<v-icon
|
||||
small
|
||||
color="warning"
|
||||
style="top: -9px; left: -16px;"
|
||||
style="
|
||||
top: 11px;
|
||||
left: 32px;
|
||||
position: absolute;
|
||||
"
|
||||
v-if="category.title === 'Settings' && isUpdateAvailable"
|
||||
></v-badge>
|
||||
>mdi-progress-upload</v-icon>
|
||||
<span class="nav-title">
|
||||
{{ category.title }}
|
||||
</span>
|
||||
@@ -75,7 +80,7 @@
|
||||
<v-app-bar app elevate-on-scroll>
|
||||
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
||||
<v-spacer></v-spacer>
|
||||
<input type="file" ref="fileUploadAndStart" accept=".gcode" style="display: none" @change="uploadAndStart" />
|
||||
<input type="file" ref="fileUploadAndStart" accept=".gcode, .ufp" style="display: none" @change="uploadAndStart" />
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">SAVE CONFIG</v-btn>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && ['standby', 'complete'].includes(printer_state)" :loading="loadings.includes['btnUploadAndStart']" @click="btnUploadAndStart"><v-icon class="mr-2">mdi-file-upload</v-icon>Upload & Print</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
|
||||
@@ -193,7 +198,6 @@ export default {
|
||||
...mapGetters([
|
||||
'getTitle',
|
||||
'getVersion',
|
||||
'server/updateManager/isUpdateAvailable',
|
||||
]),
|
||||
print_percent: {
|
||||
get() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>Connecting<span v-if="connectingFailed"> failed</span><span v-if="isConnecting"> to {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}</span>
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>Connecting<span v-if="connectingFailed"> failed</span><span v-if="isConnecting"> to {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}</span>
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
@@ -16,7 +16,7 @@
|
||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
|
||||
<p>Cannot not connect to {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}.</p>
|
||||
<p>Cannot not connect to {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="reconnect" color="primary">try again</v-btn>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div v-if="countPowerDevices">
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">Power Devices</v-subheader>
|
||||
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error')">
|
||||
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error' || device.locked_while_printing && ['printing', 'paused'].includes(printer_state))">
|
||||
<v-list-item-title>
|
||||
<v-icon class="mr-2" :color="device.status === 'on' ? '' : 'grey darken-2'">mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}</v-icon>{{ device.device }}
|
||||
</v-list-item-title>
|
||||
@@ -62,6 +62,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
devices: (state) => state.server.power.devices,
|
||||
}),
|
||||
countPowerDevices: {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div id="tempchart" style="height: 270px; width: 100%;"></div>
|
||||
<div id="tempchart" style="height: 300px; width: 100%;"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
|
||||
|
||||
export default {
|
||||
@@ -11,10 +12,13 @@ export default {
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
chart : null,
|
||||
tempchartDisplayMinutes: 10,
|
||||
timer: '',
|
||||
timerChart: '',
|
||||
timerDataset: '',
|
||||
chartOptions: {
|
||||
theme: "dark1",
|
||||
zoomEnabled: true,
|
||||
backgroundColor: 'transparent',
|
||||
animationEnabled: true,
|
||||
legend: {
|
||||
@@ -22,8 +26,52 @@ export default {
|
||||
verticalAlign: "top",
|
||||
},
|
||||
toolTip:{
|
||||
content: "{name}: {y}",
|
||||
yValueFormatString: "#,###.00",
|
||||
shared: true,
|
||||
borderColor: "#ffffff30",
|
||||
content: (e) => {
|
||||
let output = ""
|
||||
|
||||
if (e.entries[0].dataPoint.x) {
|
||||
const date = new Date(e.entries[0].dataPoint.x)
|
||||
const hours = "0" + date.getHours();
|
||||
const minutes = "0" + date.getMinutes();
|
||||
const seconds = "0" + date.getSeconds();
|
||||
output += "<strong>"+hours.substr(-2) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2)+"</strong>"
|
||||
}
|
||||
|
||||
const mainEntries = e.entries.filter(dataset => dataset.dataSeries.showInLegend && dataset.dataSeries.visible).sort((a,b) => {
|
||||
if (a.dataSeries.legendText > b.dataSeries.legendText) return 1
|
||||
if (a.dataSeries.legendText < b.dataSeries.legendText) return -1
|
||||
|
||||
return 0
|
||||
})
|
||||
|
||||
if (mainEntries.length) {
|
||||
mainEntries.forEach(dataset => {
|
||||
output += "<br />"
|
||||
output += dataset.dataSeries.legendText+": "+dataset.dataPoint.y.toFixed(1)
|
||||
|
||||
const datasetTarget = e.entries.find(datasetTarget => datasetTarget.dataSeries.name === dataset.dataSeries.name+"_target")
|
||||
if (datasetTarget) {
|
||||
output += " / "+datasetTarget.dataPoint.y.toFixed(1)
|
||||
}
|
||||
|
||||
output += "°C"
|
||||
|
||||
const datasetPower = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_power")
|
||||
if (datasetPower) {
|
||||
output += " at "+datasetPower.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
|
||||
const datasetSpeed = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_speed")
|
||||
if (datasetSpeed) {
|
||||
output += " at "+datasetSpeed.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
},
|
||||
axisX:{
|
||||
valueFormatString: "HH:mm" ,
|
||||
@@ -40,19 +88,33 @@ export default {
|
||||
minimum: 0,
|
||||
maximum: 300,
|
||||
interval: 50,
|
||||
suffix: '°C'
|
||||
},
|
||||
axisY2: {
|
||||
gridThickness: 0,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
interval: 25,
|
||||
suffix: '%'
|
||||
},
|
||||
data: [ ]
|
||||
},
|
||||
chart : null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
intervalChartUpdate: state => state.gui.tempchart.intervalChartUpdate,
|
||||
intervalDatasetUpdate: state => state.gui.tempchart.intervalDatasetUpdate,
|
||||
}),
|
||||
datasets: {
|
||||
get () {
|
||||
const datasets = this.$store.state.printer.tempHistory.datasets
|
||||
|
||||
return datasets.sort((a,b) => {
|
||||
if ('name' in a && 'name' in b) {
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_power")) return -1
|
||||
if (a.name.endsWith("_power") < b.name.endsWith("_target")) return 1
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_target")) return -1
|
||||
if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1
|
||||
}
|
||||
@@ -61,6 +123,11 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
autoscale: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
}
|
||||
},
|
||||
maxTemp: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getMaxTemp"]
|
||||
@@ -78,8 +145,7 @@ export default {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.timerChart = setInterval(() => {
|
||||
if (
|
||||
document.getElementById("tempchart") &&
|
||||
this.chart &&
|
||||
@@ -88,10 +154,15 @@ export default {
|
||||
this.chartOptions.data = this.datasets
|
||||
this.chartOptions.axisX.minimum = new Date() - 60* this.tempchartDisplayMinutes *1000
|
||||
this.chartOptions.axisX.maximum = new Date()
|
||||
this.chartOptions.axisY.maximum = this.maxTemp
|
||||
this.chartOptions.axisY.maximum = this.autoscale ? null : this.maxTemp
|
||||
//this.chartOptions.axisY.interval = this.autoscale ? 25 : 50
|
||||
this.chart.render()
|
||||
}
|
||||
}, 1000);
|
||||
}, this.intervalChartUpdate)
|
||||
|
||||
this.timerDataset = setInterval(() => {
|
||||
this.$store.dispatch("printer/tempHistory/updateDatasets")
|
||||
}, this.intervalDatasetUpdate)
|
||||
},
|
||||
mounted: function() {
|
||||
this.createChart()
|
||||
|
||||
@@ -22,39 +22,27 @@
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('X-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Y-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Z-25')" dense class="btnMinWidthAuto col"><span class="body-2">-25</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-1')" dense class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-0.1')" dense class="btnMinWidthAuto col"><span class="body-2">-0.1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+0.1')" dense class="btnMinWidthAuto col"><span class="body-2">+0.1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+1')" dense class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+25')" dense class="btnMinWidthAuto col"><span class="body-2">+25</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -85,11 +73,36 @@
|
||||
homedAxes: state => state.printer.toolhead.homed_axes,
|
||||
config: state => state.printer.configfile.config,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
|
||||
feedrateXY: state => state.gui.dashboard.control.feedrateXY,
|
||||
stepsXY: state => state.gui.dashboard.control.stepsXY,
|
||||
feedrateZ: state => state.gui.dashboard.control.feedrateZ,
|
||||
stepsZ: state => state.gui.dashboard.control.stepsZ,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getMacros',
|
||||
])
|
||||
]),
|
||||
stepsXYsorted: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return b-a })
|
||||
}
|
||||
},
|
||||
stepsXYsortedReverse: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return a-b })
|
||||
}
|
||||
},
|
||||
stepsZsorted: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return b-a })
|
||||
}
|
||||
},
|
||||
stepsZsortedReverse: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return a-b })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doHome() {
|
||||
@@ -122,9 +135,9 @@
|
||||
this.$store.commit('socket/addLoading', { name: 'zTilt' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
doSendMove(gcode, feedrate) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F6000" + "\n" +
|
||||
"G1 " + gcode + " F"+feedrate*60 + "\n" +
|
||||
"G90";
|
||||
|
||||
this.doSend(gcode);
|
||||
@@ -138,6 +151,6 @@
|
||||
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -9,13 +9,13 @@
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>Feed amount in mm:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>Feedrate in mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -41,8 +41,6 @@
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -50,11 +48,24 @@
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
extruder: state => state.printer.extruder,
|
||||
config: state => state.printer.configfile.config
|
||||
config: state => state.printer.configfile.config,
|
||||
|
||||
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
|
||||
feedrates: state => state.gui.dashboard.extruder.feedrates,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
feedamountsSorted: {
|
||||
get() {
|
||||
return [...this.feedamounts].sort((a,b) => { return b-a })
|
||||
}
|
||||
},
|
||||
feedratesSorted: {
|
||||
get() {
|
||||
return [...this.feedrates].sort((a,b) => { return b-a })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" 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">
|
||||
|
||||
@@ -133,7 +133,9 @@
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar-items>
|
||||
<v-btn dark text href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>Config Reference</v-btn>
|
||||
<v-divider white vertical v-if="currentPath !== '/config_examples'" class="d-none d-md-flex"></v-divider>
|
||||
<v-btn dark text @click="saveFile(false)" v-if="currentPath !== '/config_examples'"><v-icon small class="mr-1">mdi-content-save</v-icon><span class="d-none d-sm-inline">Save</span></v-btn>
|
||||
<v-divider white vertical v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"></v-divider>
|
||||
<v-btn dark text @click="saveFile(true)" v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"><v-icon small class="mr-1">mdi-restart</v-icon>Save & restart</v-btn>
|
||||
</v-toolbar-items>
|
||||
</v-toolbar>
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-form ref="formControlExtruder">
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>Control</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-0">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Speed XY"
|
||||
v-model="feedrateXY"
|
||||
@blur="blurFeedrateXY"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v > 0 || 'Minimum speed is 1'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Speed Z"
|
||||
v-model="feedrateZ"
|
||||
@blur="blurFeedrateZ"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
hide-details="auto"
|
||||
ref="feedrateZ"
|
||||
:rules="[
|
||||
v => v > 1 || 'Minimum speed is 1'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances XY in mm"
|
||||
v-model="stepsXY"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances Z in mm"
|
||||
v-model="stepsZ"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-card class="mt-6">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>Extruder</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-0">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances E in mm"
|
||||
v-model="feedamountsE"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Speed E in mm/s"
|
||||
v-model="feedratesE"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
feedrateXY: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateXY
|
||||
},
|
||||
set(feedrate) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: feedrate } } })
|
||||
}
|
||||
},
|
||||
stepsXY: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.control.stepsXY
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(steps) {
|
||||
const absSteps = []
|
||||
for(const value of steps) absSteps.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsXY: absSteps } } })
|
||||
}
|
||||
},
|
||||
feedrateZ: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateZ
|
||||
},
|
||||
set(value) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateZ: value } } })
|
||||
}
|
||||
},
|
||||
stepsZ: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.control.stepsZ
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(steps) {
|
||||
const absSteps = []
|
||||
for(const value of steps) absSteps.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsZ: absSteps } } })
|
||||
}
|
||||
},
|
||||
feedamountsE: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.extruder.feedamounts
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(amounts) {
|
||||
const absAmounts = []
|
||||
for(const value of amounts) absAmounts.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamounts: absAmounts } } })
|
||||
}
|
||||
},
|
||||
feedratesE: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.extruder.feedrates
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(rates) {
|
||||
const absRates = []
|
||||
for(const value of rates) absRates.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrates: absRates } } })
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.formControlExtruder.validate()
|
||||
},
|
||||
methods: {
|
||||
blurFeedrateXY() {
|
||||
if (!(this.feedrateXY > 0)) this.feedrateXY = 100
|
||||
},
|
||||
blurFeedrateZ() {
|
||||
if (!(this.feedrateZ > 0)) this.feedrateZ = 25
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -278,7 +278,32 @@
|
||||
this.dialog.name = preset.name
|
||||
this.dialog.index = preset.index
|
||||
this.dialog.gcode = preset.gcode
|
||||
this.dialog.values = {...preset.values}
|
||||
this.dialog.values = {}
|
||||
|
||||
for(const heater of this["printer/getHeaters"]) {
|
||||
if (heater.name in preset.values) {
|
||||
this.dialog.values[heater.name] = {...preset.values[heater.name]}
|
||||
} else {
|
||||
this.dialog.values[heater.name] = {
|
||||
bool: false,
|
||||
value: 0,
|
||||
type: 'heater',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(const fan of this["printer/getTemperatureFans"]) {
|
||||
if ('temperature_fan '+fan.name in preset.values) {
|
||||
this.dialog.values['temperature_fan '+fan.name] = {...preset.values['temperature_fan '+fan.name]}
|
||||
} else {
|
||||
this.dialog.values['temperature_fan '+fan.name] = {
|
||||
bool: false,
|
||||
value: 0,
|
||||
type: 'temperature_fan',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.dialog.bool = true
|
||||
},
|
||||
savePreset() {
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<div v-for="(value, key) of updateableSoftwares" v-bind:key="key">
|
||||
<v-divider class="my-0" ></v-divider>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6 text-no-wrap">
|
||||
<v-col class="pl-6">
|
||||
{{ 'name' in value ? value.name : key }}<br />
|
||||
{{ getVersionOutput(value) }}
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right">
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
@@ -30,7 +30,7 @@
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 mt-3 px-2 text-uppercase"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -38,7 +38,7 @@
|
||||
<div v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="pl-6 text-no-wrap">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
<strong>System</strong><br />
|
||||
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
@@ -48,7 +48,7 @@
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">OS-Packages</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right">
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
@@ -56,7 +56,7 @@
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
|
||||
@click="updateSystem"
|
||||
class="minwidth-0 mt-3 px-2 text-uppercase"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -151,7 +151,18 @@
|
||||
const local_version = 'version' in object ? object.version : '?'
|
||||
const remote_version = 'remote_version' in object ? object.remote_version : '?'
|
||||
|
||||
return local_version !== remote_version ? local_version+" > "+remote_version : local_version
|
||||
let output = ""
|
||||
if ('remote_alias' in object && object.remote_alias !== "origin") output += object.remote_alias
|
||||
if ('branch' in object && object.branch !== "master") {
|
||||
if (output !== "") output += "/"
|
||||
|
||||
output += object.branch
|
||||
}
|
||||
if (output !== "") output += ": "
|
||||
|
||||
output += local_version !== remote_version ? local_version+" > "+remote_version : local_version
|
||||
|
||||
return output
|
||||
},
|
||||
updateModule(key) {
|
||||
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
import GeneralPanel from './GeneralPanel'
|
||||
import ControlPanel from './ControlPanel'
|
||||
import WebcamPanel from './WebcamPanel'
|
||||
import DashboardPanel from "./DashboardPanel";
|
||||
import ConsolePanel from "./ConsolePanel";
|
||||
@@ -15,6 +16,7 @@ import RemotePrintersPanel from "./RemotePrintersPanel";
|
||||
import PresetsPanel from "./PresetsPanel";
|
||||
|
||||
Vue.component('settings-general-panel', GeneralPanel);
|
||||
Vue.component('settings-control-panel', ControlPanel);
|
||||
Vue.component('settings-webcam-panel', WebcamPanel);
|
||||
Vue.component('settings-dashboard-panel', DashboardPanel);
|
||||
Vue.component('settings-console-panel', ConsolePanel);
|
||||
|
||||
@@ -6,112 +6,228 @@
|
||||
.colHeaterIcons {
|
||||
width: 68px;
|
||||
}
|
||||
|
||||
.canvasjs-chart-tooltip>div {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].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)">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 this['gui/getPreheatPresets']" 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>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="this['gui/getPreheatPresets'].length === 0"><v-icon small>mdi-snowflake</v-icon>Cooldown</v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-container class="px-0">
|
||||
<v-row align="center">
|
||||
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">Name</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">State</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold">Current</v-col>
|
||||
<v-col class="py-2 pr-8 text-center font-weight-bold">Target</v-col>
|
||||
</v-row>
|
||||
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].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)">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 this['gui/getPreheatPresets']" 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>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="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>Cooldown</v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Temperatures">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" 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="Show Chart"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details label="Autoscale Chart"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-container class="px-0">
|
||||
<v-row align="center">
|
||||
<v-col class="pl-8 pr-0 flex-grow-0 py-2colHeaterIcons">
|
||||
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold">{{ convertName(heater.name) }}</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
|
||||
<v-col class="py-2 text-center">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
|
||||
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">Name</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">State</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold">Current</v-col>
|
||||
<v-col class="py-2 pr-8 text-center font-weight-bold">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.color">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 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</span>
|
||||
<span v-for="(values, key) of heater.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center">
|
||||
<toolInput :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" ></toolInput>
|
||||
</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 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span>
|
||||
<span v-for="(values, key) of fan.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" :items="fan.presets" ></toolInput>
|
||||
</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="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ 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 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 ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
</template>
|
||||
<span>min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
</v-tooltip>
|
||||
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</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="px-8 pt-6">
|
||||
<temp-chart ></temp-chart>
|
||||
</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">{{ convertName(fan.name) }}</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-2 text-center">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</v-col>
|
||||
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" ></toolInput>
|
||||
</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="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold">{{ convertName(sensor.name) }}</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=" px-0"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
</template>
|
||||
<span>min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
</v-tooltip>
|
||||
</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="px-8 pt-6">
|
||||
<temp-chart ></temp-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<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-{{ 'icon' in editHeater.object ? editHeater.object.icon : "info" }}</v-icon>
|
||||
{{ 'name' in editHeater.object ? convertName(editHeater.object.name) : "UNKNOWN" }}
|
||||
</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-3">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row v-if="'chartTemperature' in editHeater.object && editHeater.object.chartTemperature">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTemperature"
|
||||
label="Show current temperature in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('temperature')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartTarget' in editHeater.object && editHeater.object.chartTarget">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTarget"
|
||||
label="Show target temperature in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('target')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartPower' in editHeater.object && editHeater.object.chartPower">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolPower"
|
||||
label="Show PWM-power in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('power')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartSpeed' in editHeater.object && editHeater.object.chartSpeed">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolSpeed"
|
||||
label="Show PWM-power in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('speed')"
|
||||
></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">
|
||||
<v-checkbox
|
||||
v-model="editHeater.additionSensors[key]"
|
||||
:label="'Show '+key+' in list'"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisibleAdditionalSensor(key)"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 text-center">
|
||||
<v-color-picker
|
||||
hide-canvas
|
||||
hide-mode-switch
|
||||
mode="hexa"
|
||||
v-model="editHeater.color"
|
||||
@input="setChartColor"
|
||||
class="mx-auto"
|
||||
></v-color-picker>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -127,7 +243,16 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
extruderTemps: [250,215,195,0],
|
||||
editHeater: {
|
||||
bool: false,
|
||||
object: {},
|
||||
boolTemperature: false,
|
||||
boolTarget: false,
|
||||
boolPower: false,
|
||||
boolSpeed: false,
|
||||
additionSensors: {},
|
||||
color: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -155,6 +280,22 @@
|
||||
get () {
|
||||
return this.$store.getters["printer/getTemperatureSensors"]
|
||||
}
|
||||
},
|
||||
boolTempchart: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.boolTempchart
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { dashboard: { boolTempchart: newVal } })
|
||||
}
|
||||
},
|
||||
autoscaleTempchart: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { tempchart: { autoscale: newVal } })
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -162,6 +303,11 @@
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
cssBorderLeftColor(color) {
|
||||
return {
|
||||
"border-left-color": color
|
||||
}
|
||||
},
|
||||
preheat(preset) {
|
||||
for (const [name, attributes] of Object.entries(preset.values)) {
|
||||
if (attributes.bool) {
|
||||
@@ -178,13 +324,50 @@
|
||||
}
|
||||
|
||||
if (preset.gcode !== "") {
|
||||
this.$store.commit('server/addEvent', { message: preset.gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: preset.gcode })
|
||||
setTimeout(() => {
|
||||
this.$store.commit('server/addEvent', { message: preset.gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: preset.gcode })
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
cooldown() {
|
||||
this.$store.commit('server/addEvent', { message: this.cooldownGcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: this.cooldownGcode })
|
||||
},
|
||||
openHeater(object) {
|
||||
this.editHeater.object = object
|
||||
|
||||
this.editHeater.color = object.chartColor
|
||||
this.editHeater.boolTemperature = 'chartTemperature' in object && object.chartTemperature !== undefined && 'visible' in object.chartTemperature ? object.chartTemperature.visible : false
|
||||
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'visible' in object.chartTarget ? object.chartTarget.visible : false
|
||||
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'visible' in object.chartPower ? object.chartPower.visible : false
|
||||
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'visible' in object.chartSpeed ? object.chartSpeed.visible : false
|
||||
|
||||
let additionalSensors = {}
|
||||
Object.keys(object.additionValues).forEach(sensor => {
|
||||
additionalSensors[sensor] = object.additionValues[sensor]['gui']['boolList']
|
||||
})
|
||||
this.editHeater.additionSensors = Object.assign(additionalSensors)
|
||||
|
||||
this.editHeater.bool = true
|
||||
},
|
||||
setVisible(type) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
this.$store.commit('printer/tempHistory/setVisible', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
|
||||
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
|
||||
}
|
||||
},
|
||||
setVisibleAdditionalSensor(sensor) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
this.$store.dispatch('gui/setTempchartDatasetAdditionalSensorSetting', { name: this.editHeater.object.name, sensor: sensor, value: this.editHeater.additionSensors[sensor] })
|
||||
}
|
||||
},
|
||||
setChartColor(value) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
if (typeof value === "object" && 'hex' in value) value = value.hex
|
||||
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.object.name, value: value })
|
||||
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: 'color', value: value })
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@
|
||||
'webcamConfig': state => state.gui.webcam
|
||||
}),
|
||||
url() {
|
||||
const params = new URLSearchParams(this.webcamConfig.url);
|
||||
params.set('bypassCache', ""+this.refresh);
|
||||
let basicUrl = this.webcamConfig.url
|
||||
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
|
||||
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+this.refresh)
|
||||
return decodeURIComponent(params.toString())
|
||||
},
|
||||
webcamStyle() {
|
||||
|
||||
@@ -19,14 +19,27 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-text-field type="number" min="0" :max="max_temp" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps" onClick="this.select();">
|
||||
</v-text-field>
|
||||
<v-combobox
|
||||
dense
|
||||
hide-details
|
||||
onClick="this.select();"
|
||||
v-model="value"
|
||||
:items="items"
|
||||
item-text="value"
|
||||
@change="setTemps"
|
||||
></v-combobox>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import Vue from "vue";
|
||||
|
||||
/*
|
||||
<v-text-field v-if="false" type="number" min="0" :max="max_temp" step="any" ref="toolField" class="tool-input">
|
||||
</v-text-field>
|
||||
*/
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
@@ -40,12 +53,14 @@
|
||||
max_temp: Number,
|
||||
command: String,
|
||||
attributeName: String,
|
||||
items: Array,
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
setTemps() {
|
||||
if (typeof this.value === 'object' && this.value !== null) this.value = this.value.value
|
||||
if (parseFloat(this.value) === 0) this.value = 0
|
||||
|
||||
if (this.max_temp !== undefined && this.value > this.max_temp) {
|
||||
|
||||
+68
-6
@@ -53,7 +53,7 @@
|
||||
<v-card-title>
|
||||
G-Code Files
|
||||
<v-spacer class="d-none d-sm-block"></v-spacer>
|
||||
<input type="file" ref="fileUpload" accept=".gcode" style="display: none" multiple @change="uploadFile" />
|
||||
<input type="file" ref="fileUpload" accept=".gcode, .ufp" style="display: none" multiple @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0" name="controllers">
|
||||
<v-btn @click="clickUploadButton" title="Upload new Gcode" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" title="Create new Directory" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
@@ -74,7 +74,21 @@
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}</v-card-subtitle>
|
||||
<v-card-subtitle>
|
||||
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}<br />
|
||||
<div v-if="this.disk_usage !== null">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">Free disk: {{ formatFilesize(disk_usage.free) }}</span>
|
||||
</template>
|
||||
<span>
|
||||
Used: {{ formatFilesize(this.disk_usage.used) }}<br />
|
||||
Free: {{ formatFilesize(this.disk_usage.free) }}<br />
|
||||
Total: {{ formatFilesize(this.disk_usage.total) }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
@@ -153,6 +167,7 @@
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'slicer')[0].visible">{{ item.slicer ? item.slicer : '--' }}<br /><small v-if="item.slicer_version">{{ item.slicer_version}}</small></td>
|
||||
</tr>
|
||||
</template>
|
||||
<v-data-footer>bla bla</v-data-footer>
|
||||
</v-data-table>
|
||||
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
|
||||
<div class="textnode">Drop files to add gcode.</div>
|
||||
@@ -163,6 +178,18 @@
|
||||
<v-list-item @click="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> Print start
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
@click="preheat"
|
||||
v-if="
|
||||
'first_layer_extr_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_extr_temp > 0 &&
|
||||
'first_layer_bed_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_bed_temp > 0
|
||||
"
|
||||
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
|
||||
>
|
||||
<v-icon class="mr-1">mdi-fire</v-icon> Preheat
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
|
||||
</v-list-item>
|
||||
@@ -180,7 +207,7 @@
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogPrintFile.show" max-width="400">
|
||||
<v-dialog v-model="dialogPrintFile.show" :max-width="getThumbnailWidth(dialogPrintFile.item)">
|
||||
<v-card>
|
||||
<v-img
|
||||
contain
|
||||
@@ -350,6 +377,7 @@
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
|
||||
displayMetadata: state => state.gui.gcodefiles.showMetadata,
|
||||
}),
|
||||
@@ -386,6 +414,11 @@
|
||||
return this.$store.dispatch("gui/setSettings", { gcodefiles: { hideMetadataColums: newVal } })
|
||||
}
|
||||
},
|
||||
disk_usage: {
|
||||
get: function() {
|
||||
return this.$store.getters["files/getDiskUsage"](this.currentPath)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadPath()
|
||||
@@ -519,6 +552,26 @@
|
||||
this.contextMenu.item = item
|
||||
this.$nextTick(() => { this.contextMenu.shown = true })
|
||||
},
|
||||
preheat() {
|
||||
if (
|
||||
'first_layer_extr_temp' in this.contextMenu.item &&
|
||||
'first_layer_bed_temp' in this.contextMenu.item &&
|
||||
!['error', 'printing', 'paused'].includes(this.printer_state)
|
||||
) {
|
||||
let gcode = ""
|
||||
if (this.contextMenu.item.first_layer_extr_temp > 0) {
|
||||
gcode = "M104 S"+this.contextMenu.item.first_layer_extr_temp
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
if (this.contextMenu.item.first_layer_bed_temp > 0) {
|
||||
gcode = "M140 S"+this.contextMenu.item.first_layer_bed_temp
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
@@ -618,7 +671,7 @@
|
||||
this.dropzone.visibility = 'hidden';
|
||||
this.dropzone.opacity = 0;
|
||||
|
||||
if (!this.is_printing && e.dataTransfer.files.length) {
|
||||
if (e.dataTransfer.files.length) {
|
||||
await this.doUploadFile(e.dataTransfer.files[0]);
|
||||
}
|
||||
}
|
||||
@@ -748,17 +801,26 @@
|
||||
return (
|
||||
'thumbnails' in item &&
|
||||
item.thumbnails !== undefined &&
|
||||
item.thumbnails.findIndex(thumb => thumb.width === 400) !== -1
|
||||
item.thumbnails.findIndex(thumb => thumb.width >= 300 && thumb.width <= 400) !== -1
|
||||
)
|
||||
},
|
||||
getBigThumbnail(item) {
|
||||
if (this.existsBigThumbnail(item)) {
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width === 400)
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
|
||||
|
||||
if (thumbnail) return thumbnail.data
|
||||
}
|
||||
|
||||
return ""
|
||||
},
|
||||
getThumbnailWidth(item) {
|
||||
if (this.existsBigThumbnail(item)) {
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
|
||||
|
||||
if (thumbnail) return thumbnail.width
|
||||
}
|
||||
|
||||
return 400
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-presets-panel></settings-presets-panel>
|
||||
<settings-remote-printers-panel class="mt-6"></settings-remote-printers-panel>
|
||||
<settings-control-panel class="mt-6"></settings-control-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,15 @@ export default {
|
||||
|
||||
getDirectory({ commit }, payload) {
|
||||
commit('setDirectory', payload)
|
||||
|
||||
if (
|
||||
'requestParams' in payload &&
|
||||
'path' in payload.requestParams &&
|
||||
'disk_usage' in payload
|
||||
) commit('setDiskUsage', {
|
||||
disk_usage: payload.disk_usage,
|
||||
path: payload.requestParams.path
|
||||
})
|
||||
},
|
||||
|
||||
getMetadata({ commit, rootState }, payload) {
|
||||
|
||||
@@ -60,4 +60,17 @@ export default {
|
||||
|
||||
return [favicon16Default, favicon32Default]
|
||||
},
|
||||
|
||||
getDiskUsage: (state) => (path) => {
|
||||
if (path.indexOf('/') !== -1) path = path.substr(0, path.indexOf('/'))
|
||||
|
||||
const dir = state.filetree.find(dir => dir.filename === path)
|
||||
if (dir && 'disk_usage' in dir) return dir.disk_usage
|
||||
|
||||
return {
|
||||
free: 0,
|
||||
total: 0,
|
||||
used: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,25 +9,29 @@ export function getDefaultState() {
|
||||
isDirectory: true,
|
||||
filename: 'gcodes',
|
||||
modified: new Date(),
|
||||
childrens: []
|
||||
childrens: [],
|
||||
disk_usage: {}
|
||||
},
|
||||
{
|
||||
isDirectory: true,
|
||||
filename: 'config_examples',
|
||||
modified: new Date(),
|
||||
childrens: []
|
||||
childrens: [],
|
||||
disk_usage: {}
|
||||
},
|
||||
{
|
||||
isDirectory: true,
|
||||
filename: 'config',
|
||||
modified: new Date(),
|
||||
childrens: []
|
||||
childrens: [],
|
||||
disk_usage: {}
|
||||
},
|
||||
{
|
||||
isDirectory: true,
|
||||
filename: 'docs',
|
||||
modified: new Date(),
|
||||
childrens: []
|
||||
childrens: [],
|
||||
disk_usage: {}
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import { getDefaultState } from './index'
|
||||
import { findDirectory } from "@/plugins/helpers"
|
||||
import store from "@/store";
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
reset(state) {
|
||||
@@ -56,24 +54,6 @@ export default {
|
||||
metadataPulled: false,
|
||||
})
|
||||
}
|
||||
|
||||
if (file.filename === ".mainsail.json" && payload.requestParams.path === "config") {
|
||||
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
|
||||
.then(res => res.json()).then(file => {
|
||||
this.commit('gui/setData', file, { root: true })
|
||||
if (!store.state.socket.remoteMode) this.dispatch('farm/readStoredPrinters', {}, { root: true })
|
||||
})
|
||||
}
|
||||
|
||||
if (file.filename === "gui.json" && payload.requestParams.path === "config") {
|
||||
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/gui.json?time='+Date.now())
|
||||
.then(res => res.json()).then(file => {
|
||||
this.commit('gui/setData', file, { root: true })
|
||||
this.dispatch('gui/upload', {}, { root: true })
|
||||
|
||||
axios.delete('//'+ store.state.socket.hostname+':'+store.state.socket.port +'/server/files/config/gui.json');
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -118,7 +98,7 @@ export default {
|
||||
let parent = findDirectory(state.filetree, (payload.item.root+"/"+path).split("/"));
|
||||
|
||||
if (parent) {
|
||||
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) < 0) {
|
||||
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) === -1) {
|
||||
let modified = new Date(payload.item.modified * 1000);
|
||||
|
||||
parent.push({
|
||||
@@ -128,7 +108,7 @@ export default {
|
||||
size: payload.item.size,
|
||||
metadataPulled: false,
|
||||
});
|
||||
}
|
||||
} else Vue.prototype.$socket.sendObj("server.files.metadata", { filename: payload.item.path }, "files/getMetadata")
|
||||
}
|
||||
},
|
||||
|
||||
@@ -182,4 +162,12 @@ export default {
|
||||
|
||||
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
|
||||
},
|
||||
|
||||
setDiskUsage(state, payload) {
|
||||
let path = payload.path
|
||||
if (path.indexOf('/') !== -1) path = path.substr(0, path.indexOf('/'))
|
||||
|
||||
const dir = state.filetree.find(dir => dir.filename === path)
|
||||
if (dir && 'disk_usage' in dir) Vue.set(dir, "disk_usage", payload.disk_usage)
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,38 @@ export default {
|
||||
commit('reset')
|
||||
},
|
||||
|
||||
getData({ commit }, payload) {
|
||||
getData({ commit, dispatch }, payload) {
|
||||
commit('setData', payload)
|
||||
|
||||
if (
|
||||
'state' in payload &&
|
||||
'tempchart' in payload.state &&
|
||||
'datasetSettings' in payload.state.tempchart
|
||||
) {
|
||||
for (const key of Object.keys(payload.state.tempchart.datasetSettings)) {
|
||||
if (
|
||||
'color' in payload.state.tempchart.datasetSettings[key] &&
|
||||
typeof payload.state.tempchart.datasetSettings[key].color === "object"
|
||||
) {
|
||||
dispatch('setTempchartDatasetSetting', { name: key, type: 'color', value: payload.state.tempchart.datasetSettings[key].color.hex })
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setSettings({ commit, dispatch }, payload) {
|
||||
commit('setSettings', payload)
|
||||
|
||||
if ('tempchart' in payload && 'boolPowerDatasets' in payload.tempchart) {
|
||||
if (payload.tempchart.boolPowerDatasets) commit('printer/tempHistory/showPowerDatasets', {}, { root: true })
|
||||
else commit('printer/tempHistory/hidePowerDatasets', {}, { root: true })
|
||||
}
|
||||
|
||||
dispatch('upload')
|
||||
},
|
||||
|
||||
upload({ state, rootState }) {
|
||||
let file = new File([JSON.stringify({ state })], '.mainsail.json');
|
||||
let file = new File([JSON.stringify({ state })], '.mainsail.json')
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
@@ -55,5 +76,15 @@ export default {
|
||||
deletePreset({ commit, dispatch }, payload) {
|
||||
commit("deletePreset", payload)
|
||||
dispatch("upload")
|
||||
},
|
||||
|
||||
setTempchartDatasetSetting({ commit, dispatch }, payload) {
|
||||
commit("setTempchartDatasetSetting", payload)
|
||||
dispatch("upload")
|
||||
},
|
||||
|
||||
setTempchartDatasetAdditionalSensorSetting({ commit, dispatch }, payload) {
|
||||
commit("setTempchartDatasetAdditionalSensorSetting", payload)
|
||||
dispatch("upload")
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,55 @@ export default {
|
||||
}
|
||||
|
||||
return output.sort(caseInsensitiveNameSort)
|
||||
},
|
||||
|
||||
getDatasetValue: (state) => (payload) => {
|
||||
if (
|
||||
payload.name in state.tempchart.datasetSettings &&
|
||||
payload.type in state.tempchart.datasetSettings[payload.name]
|
||||
) return state.tempchart.datasetSettings[payload.name][payload.type]
|
||||
|
||||
if (["temperature", "target"].includes(payload.type)) return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
getDatasetAdditionalSensorValue: (state) => (payload) => {
|
||||
if (
|
||||
payload.name in state.tempchart.datasetSettings &&
|
||||
'additionalSensors' in state.tempchart.datasetSettings[payload.name] &&
|
||||
payload.sensor in state.tempchart.datasetSettings[payload.name]['additionalSensors']
|
||||
) return state.tempchart.datasetSettings[payload.name]['additionalSensors'][payload.sensor]
|
||||
|
||||
return {
|
||||
'boolList': true
|
||||
}
|
||||
},
|
||||
|
||||
getPresetsFromHeater: state => (payload) => {
|
||||
const output = []
|
||||
|
||||
output.push({
|
||||
value: 0
|
||||
})
|
||||
|
||||
for (const [, preset] of Object.entries(state.presets)) {
|
||||
if (
|
||||
payload.name in preset.values &&
|
||||
preset.values[payload.name].bool &&
|
||||
output.findIndex(entry => entry.value === preset.values[payload.name].value) === -1
|
||||
) {
|
||||
output.push({
|
||||
value: preset.values[payload.name].value,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return output.sort((a,b) => {
|
||||
if (a.value > b.value) return -1
|
||||
if (a.value < b.value) return 1
|
||||
|
||||
return 0
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,16 @@ export function getDefaultState() {
|
||||
boolConsole: true,
|
||||
hiddenMacros: [],
|
||||
hiddenTempChart: [],
|
||||
control: {
|
||||
feedrateXY: 100,
|
||||
stepsXY: [ 100, 10, 1 ],
|
||||
feedrateZ: 25,
|
||||
stepsZ: [ 25, 1, 0.1 ],
|
||||
},
|
||||
extruder: {
|
||||
feedamounts: [ 50, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
webcam: {
|
||||
url: "",
|
||||
@@ -22,6 +32,14 @@ export function getDefaultState() {
|
||||
flipY: false,
|
||||
bool: false,
|
||||
},
|
||||
tempchart: {
|
||||
intervalChartUpdate: 1000,
|
||||
intervalDatasetUpdate: 500,
|
||||
autoscale: false,
|
||||
datasetSettings: {
|
||||
|
||||
},
|
||||
},
|
||||
console: {
|
||||
hideWaitTemperatures: true,
|
||||
boolCustomFilters: false,
|
||||
|
||||
@@ -65,5 +65,25 @@ export default {
|
||||
if (state.presets[payload.index]) {
|
||||
state.presets.splice(payload.index, 1)
|
||||
}
|
||||
},
|
||||
|
||||
setTempchartDatasetSetting(state, payload) {
|
||||
if (!(payload.name in state.tempchart.datasetSettings))
|
||||
Vue.set(state.tempchart.datasetSettings, payload.name, {})
|
||||
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name], payload.type, payload.value)
|
||||
},
|
||||
|
||||
setTempchartDatasetAdditionalSensorSetting(state, payload) {
|
||||
if (!(payload.name in state.tempchart.datasetSettings))
|
||||
Vue.set(state.tempchart.datasetSettings, payload.name, {})
|
||||
|
||||
if (!('additionalSensors' in state.tempchart.datasetSettings[payload.name]))
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name], 'additionalSensors', {})
|
||||
|
||||
if (!(payload.sensor in state.tempchart.datasetSettings[payload.name]['additionalSensors']))
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name]['additionalSensors'], payload.sensor, {})
|
||||
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name]['additionalSensors'][payload.sensor], 'boolList', payload.value)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { caseInsensitiveNameSort } from '@/plugins/helpers'
|
||||
import { additionalSensors } from '@/store/variables'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -45,7 +46,7 @@ export default {
|
||||
return array.sort(caseInsensitiveNameSort);
|
||||
},
|
||||
|
||||
getHeaters: (state, getters) => {
|
||||
getHeaters: (state, getters, rootState, rootGetters) => {
|
||||
let heaters = []
|
||||
let colorOff = "grey darken-2"
|
||||
let colorHot = "grey lighten-5"
|
||||
@@ -77,8 +78,15 @@ export default {
|
||||
color: color,
|
||||
target: value.target,
|
||||
temperature: value.temperature,
|
||||
additionValues: getters.getAdditionSensors(nameSplit[1]),
|
||||
tempListAdditionValues: getters.getTempListAdditionSensors(nameSplit[1]),
|
||||
power: 'power' in value ? value.power : null,
|
||||
presets: rootGetters["gui/getPresetsFromHeater"]({ name: key }),
|
||||
chartColor: getters["tempHistory/getDatasetColor"](name),
|
||||
chartTemperature: getters["tempHistory/getDataset"](name),
|
||||
chartTarget: getters["tempHistory/getDataset"](name+"_target"),
|
||||
chartPower: getters["tempHistory/getDataset"](name+'_power'),
|
||||
chartSpeed: getters["tempHistory/getDataset"](name+'_speed'),
|
||||
min_temp: state.configfile.config[key] !== undefined ? parseFloat(state.configfile.config[key].min_temp) : undefined,
|
||||
max_temp: state.configfile.config[key] !== undefined ? parseFloat(state.configfile.config[key].max_temp) : undefined,
|
||||
});
|
||||
@@ -89,7 +97,7 @@ export default {
|
||||
return heaters.sort(caseInsensitiveNameSort);
|
||||
},
|
||||
|
||||
getTemperatureFans: (state, getters) => {
|
||||
getTemperatureFans: (state, getters, rootState, rootGetters) => {
|
||||
let fans = []
|
||||
|
||||
for (let [key, value] of Object.entries(state)) {
|
||||
@@ -100,8 +108,15 @@ export default {
|
||||
name: nameSplit[1],
|
||||
target: value.target,
|
||||
temperature: value.temperature,
|
||||
additionValues: getters.getAdditionSensors(nameSplit[1]),
|
||||
tempListAdditionValues: getters.getTempListAdditionSensors(nameSplit[1]),
|
||||
speed: value.speed,
|
||||
presets: rootGetters["gui/getPresetsFromHeater"]({ name: key }),
|
||||
chartColor: getters["tempHistory/getDatasetColor"](nameSplit[1]),
|
||||
chartTemperature: getters["tempHistory/getDataset"](nameSplit[1]),
|
||||
chartTarget: getters["tempHistory/getDataset"](nameSplit[1]+"_target"),
|
||||
chartPower: getters["tempHistory/getDataset"](nameSplit[1]+'_power'),
|
||||
chartSpeed: getters["tempHistory/getDataset"](nameSplit[1]+'_speed'),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -124,15 +139,20 @@ export default {
|
||||
if (value.temperature <= min_temp + split) icon = "mdi-thermometer-low"
|
||||
if (value.temperature >= max_temp - split) icon = "mdi-thermometer-high"
|
||||
|
||||
|
||||
|
||||
sensors.push({
|
||||
name: nameSplit[1],
|
||||
temperature: value.temperature,
|
||||
additionValues: getters.getAdditionSensors(nameSplit[1]),
|
||||
tempListAdditionValues: getters.getTempListAdditionSensors(nameSplit[1]),
|
||||
icon: icon,
|
||||
min_temp: min_temp,
|
||||
max_temp: max_temp,
|
||||
measured_min_temp: value.measured_min_temp,
|
||||
measured_max_temp: value.measured_max_temp,
|
||||
chartColor: getters["tempHistory/getDatasetColor"](nameSplit[1]),
|
||||
chartTemperature: getters["tempHistory/getDataset"](nameSplit[1]),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -252,11 +272,14 @@ export default {
|
||||
if (a.type === "fan") return -1
|
||||
if (b.type === "fan") return 1
|
||||
|
||||
if (a.pwm < b.pwm) return 1
|
||||
if (a.pwm > b.pwm) return -1
|
||||
|
||||
if (a.controllable < b.controllable) return 1
|
||||
if (a.controllable > b.controllable) return -1
|
||||
|
||||
let nameA = a.name.toUpperCase()
|
||||
let nameB = b.name.toUpperCase()
|
||||
const nameA = a.name.toUpperCase()
|
||||
const nameB = b.name.toUpperCase()
|
||||
|
||||
if (nameA < nameB) return -1
|
||||
if (nameA > nameB) return 1
|
||||
@@ -265,6 +288,82 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
getAdditionSensors: (state, getters, rootState, rootGetters) => (name) => {
|
||||
let additionValues = {}
|
||||
additionalSensors.forEach(sensorName => {
|
||||
if (sensorName+" "+name in state) {
|
||||
Object.keys(state[sensorName+" "+name]).forEach(key => {
|
||||
if (key !== "temperature") {
|
||||
let tmp = {}
|
||||
tmp[key] = {}
|
||||
tmp[key]['value'] = state[sensorName+" "+name][key]
|
||||
tmp[key]['gui'] = rootGetters["gui/getDatasetAdditionalSensorValue"]({
|
||||
name: name,
|
||||
sensor: key
|
||||
})
|
||||
|
||||
switch(key) {
|
||||
case 'pressure':
|
||||
tmp[key]['unit'] = "hPa"
|
||||
break
|
||||
|
||||
case 'humidity':
|
||||
tmp[key]['unit'] = "%"
|
||||
break
|
||||
|
||||
default:
|
||||
tmp[key]['unit'] = ""
|
||||
}
|
||||
|
||||
additionValues = Object.assign(additionValues, tmp)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return additionValues
|
||||
},
|
||||
|
||||
getTempListAdditionSensors: (state, getters, rootState, rootGetters) => (name) => {
|
||||
let additionValues = {}
|
||||
additionalSensors.forEach(sensorName => {
|
||||
if (sensorName+" "+name in state) {
|
||||
Object.keys(state[sensorName+" "+name]).forEach(key => {
|
||||
if (key !== "temperature") {
|
||||
const settings = rootGetters["gui/getDatasetAdditionalSensorValue"]({
|
||||
name: name,
|
||||
sensor: key
|
||||
})
|
||||
|
||||
if (settings.boolList) {
|
||||
let tmp = {}
|
||||
tmp[key] = {}
|
||||
tmp[key]['value'] = state[sensorName+" "+name][key]
|
||||
|
||||
|
||||
switch(key) {
|
||||
case 'pressure':
|
||||
tmp[key]['unit'] = "hPa"
|
||||
break
|
||||
|
||||
case 'humidity':
|
||||
tmp[key]['unit'] = "%"
|
||||
break
|
||||
|
||||
default:
|
||||
tmp[key]['unit'] = ""
|
||||
}
|
||||
|
||||
additionValues = Object.assign(additionValues, tmp)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return additionValues
|
||||
},
|
||||
|
||||
getAllMacros: state => {
|
||||
let array = []
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
setData(state, payload) {
|
||||
if ("status" in payload) payload = payload.status;
|
||||
if ("requestParams" in payload) delete payload.requestParams
|
||||
let now = Date.now();
|
||||
//let now = Date.now();
|
||||
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
if (key === "webhooks") {
|
||||
@@ -36,31 +36,6 @@ export default {
|
||||
...value
|
||||
})
|
||||
} else Vue.set(state, key, value)
|
||||
|
||||
//update heaters
|
||||
if (
|
||||
Array.isArray(state.heaters.available_heaters) &&
|
||||
state.heaters.available_heaters.length
|
||||
) {
|
||||
let keySplit = key.split(" ")
|
||||
|
||||
if (
|
||||
state.heaters.available_heaters.includes(key) ||
|
||||
keySplit[0] === "temperature_fan" ||
|
||||
keySplit[0] === "temperature_sensor") {
|
||||
|
||||
let name = keySplit[0]
|
||||
if (keySplit[0] === "temperature_fan") name = keySplit[1]
|
||||
else if (keySplit[0] === "temperature_sensor") name = keySplit[1]
|
||||
else if (keySplit[0] === "heater_generic") name = keySplit[1]
|
||||
|
||||
if (value.temperature) this.commit('printer/tempHistory/addValue', { name: name, value: value.temperature, time: now })
|
||||
else if (key in state && 'temperature' in state[key]) this.commit('printer/tempHistory/addValue', { name: name, value: state[key].temperature, time: now })
|
||||
|
||||
if (value.target) this.commit('printer/tempHistory/addValue', { name: name+'_target', value: value.target, time: now })
|
||||
else if (key in state && 'target' in state[key]) this.commit('printer/tempHistory/addValue', { name: name+'_target', value: state[key].target, time: now })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1,9 +1,146 @@
|
||||
import {colorArray, colorChamber, colorHeaterBed, datasetTypes} from "@/store/variables";
|
||||
import {convertName} from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
reset({ commit }) {
|
||||
commit('reset')
|
||||
},
|
||||
|
||||
getHistory({ commit }, payload) {
|
||||
commit('setHistory', payload);
|
||||
getHistory({ commit, state, rootGetters }, payload) {
|
||||
const now = new Date()
|
||||
if (payload !== undefined) {
|
||||
Object.entries(payload).sort().forEach(([name, datasets]) => {
|
||||
let keySplit = name.split(" ")
|
||||
if (keySplit.length > 1) name = keySplit[1]
|
||||
const type = keySplit[0]
|
||||
|
||||
if ('temperatures' in datasets) {
|
||||
let datasetTemperature = state.datasets.find(element => element.name === name)
|
||||
if (datasetTemperature === undefined) {
|
||||
let color = ''
|
||||
|
||||
switch (name) {
|
||||
case 'heater_bed':
|
||||
color = colorHeaterBed;
|
||||
break;
|
||||
case 'chamber':
|
||||
color = colorChamber;
|
||||
break;
|
||||
default:
|
||||
color = colorArray[state.datasets.filter(element =>
|
||||
!element.name.endsWith("_target") && element.name !== "heater_bed" && element.name !== "chamber"
|
||||
).length];
|
||||
break;
|
||||
}
|
||||
|
||||
datasetTemperature = {
|
||||
type: "line",
|
||||
name: name,
|
||||
legendText: convertName(name),
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: true,
|
||||
markerType: 'circle',
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 1 : 0,
|
||||
}
|
||||
|
||||
commit('addDataset', datasetTemperature)
|
||||
} else commit('clearDataset', name)
|
||||
|
||||
commit('addValue', {
|
||||
name: name,
|
||||
value: datasets.temperatures,
|
||||
type: type,
|
||||
time: now
|
||||
})
|
||||
|
||||
if ('targets' in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetTarget = state.datasets.find(element => element.name === name+"_target")
|
||||
if (datasetTarget === undefined) {
|
||||
datasetTarget = {
|
||||
type: "stepArea",
|
||||
name: name+"_target",
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: false,
|
||||
markerType: 'none',
|
||||
color: datasetTemperature.color,
|
||||
fillOpacity: .1,
|
||||
lineThickness: 0,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 1 : 0,
|
||||
}
|
||||
|
||||
commit('addDataset', datasetTarget)
|
||||
} else commit('clearDataset', name+"_target")
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_target",
|
||||
value: datasets.targets,
|
||||
type: type,
|
||||
time: now
|
||||
})
|
||||
}
|
||||
|
||||
['power', 'speed'].forEach(additionalType => {
|
||||
if (additionalType+"s" in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetAdditinal = state.datasets.find(element => element.name === name+"_"+additionalType)
|
||||
if (datasetAdditinal === undefined) {
|
||||
datasetAdditinal = {
|
||||
type: "line",
|
||||
name: name+"_"+additionalType,
|
||||
xValueType: "dateTime",
|
||||
axisYType: "secondary",
|
||||
dataPoints:[],
|
||||
showInLegend: false,
|
||||
markerType: 'none',
|
||||
lineDashType: "dot",
|
||||
lineThickness: 1,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 1 : 0,
|
||||
color: datasetTemperature.color,
|
||||
}
|
||||
|
||||
commit('addDataset', datasetAdditinal)
|
||||
} else commit('clearDataset', name+"_"+additionalType)
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_"+additionalType,
|
||||
value: datasets[additionalType+"s"],
|
||||
type: type,
|
||||
time: now
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
updateDatasets({ commit, rootState }) {
|
||||
if (
|
||||
'heaters' in rootState.printer &&
|
||||
'available_sensors' in rootState.printer.heaters &&
|
||||
rootState.printer.heaters.available_sensors.length
|
||||
) {
|
||||
const now = new Date()
|
||||
rootState.printer.heaters.available_sensors.forEach((objectName) => {
|
||||
if (objectName in rootState.printer) {
|
||||
const objectNameSplits = objectName.split(" ")
|
||||
let name = objectNameSplits[0]
|
||||
if (["temperature_fan", "temperature_sensor", "heater_generic"].includes(objectNameSplits[0])) name = objectNameSplits[1]
|
||||
|
||||
datasetTypes.forEach(datasetType => {
|
||||
if (datasetType in rootState.printer[objectName]) {
|
||||
commit('addValue', {
|
||||
name: datasetType === "temperature" ? name : name+"_"+datasetType,
|
||||
value: rootState.printer[objectName][datasetType],
|
||||
type: objectNameSplits[0],
|
||||
time: now
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,9 @@ export default {
|
||||
let dataset = state.datasets.find(element => element.name === name)
|
||||
|
||||
return (dataset) ? dataset.color : null
|
||||
}
|
||||
},
|
||||
|
||||
getDataset: state => (name) => {
|
||||
return state.datasets.find(element => element.name === name)
|
||||
},
|
||||
}
|
||||
@@ -1,134 +1,90 @@
|
||||
import { getDefaultState } from './index'
|
||||
import { colorArray, colorChamber, colorHeaterBed } from "@/store/variables"
|
||||
import { datasetTypesInPercents } from '@/store/variables'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
reset(state) {
|
||||
Object.assign(state, getDefaultState())
|
||||
},
|
||||
|
||||
setHistory(state, payload) {
|
||||
let now = new Date();
|
||||
|
||||
if (payload !== undefined) {
|
||||
Object.entries(payload).sort().forEach(([key, datasets]) => {
|
||||
let keySplit = key.split(" ");
|
||||
|
||||
if (keySplit.length > 1) key = keySplit[1];
|
||||
|
||||
if (datasets.temperatures) {
|
||||
let max = datasets.temperatures.length;
|
||||
for (let i = 0; i < max; i++) {
|
||||
let time = new Date(now.getTime() - 1000 * (max - i));
|
||||
|
||||
this.commit('printer/tempHistory/addValue', {
|
||||
name: key,
|
||||
value: datasets.temperatures[i],
|
||||
type: keySplit[0],
|
||||
time: time
|
||||
});
|
||||
|
||||
this.commit('printer/tempHistory/addValue', {
|
||||
name: key+'_target',
|
||||
value: datasets.targets[i],
|
||||
type: keySplit[0],
|
||||
time: time
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
addDataset(state, payload) {
|
||||
state.datasets.push(payload)
|
||||
},
|
||||
|
||||
addValue(state, payload) {
|
||||
// definations for delete old entries
|
||||
let timeOld = new Date().getTime() - (1000 * 60 * 10)
|
||||
let minResolution = 1000 // value in ms
|
||||
//let deletedIndex
|
||||
let multi = 1
|
||||
datasetTypesInPercents.forEach(element => {
|
||||
if (payload.name.endsWith("_"+element)) multi = 100
|
||||
})
|
||||
|
||||
let mainDataset = state.datasets.find(element => element.name === payload.name)
|
||||
if (!mainDataset) {
|
||||
//TODO load hidden sensors from gui store
|
||||
//let hidden = this.rootState.gui.dashboard.hiddenTempChart.indexOf(payload.name.toUpperCase()) >= 0;
|
||||
//let hidden = false
|
||||
const dataset = state.datasets.find(element => element.name === payload.name)
|
||||
|
||||
if (payload.name.includes('_target')) {
|
||||
let masterDataset = state.datasets.find(element => element.name === payload.name.replace('_target', ''))
|
||||
|
||||
if (masterDataset) {
|
||||
mainDataset = {
|
||||
type: "stepArea",
|
||||
name: payload.name,
|
||||
legendText: payload.name,
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: false,
|
||||
markerType: 'none',
|
||||
fillOpacity: .1,
|
||||
lineThickness: 0,
|
||||
toolTipContent: "{name}: {y}°C",
|
||||
color: masterDataset.color || '#666'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let color = '';
|
||||
|
||||
switch (payload.name) {
|
||||
case 'heater_bed': color = colorHeaterBed; break;
|
||||
case 'chamber': color = colorChamber; break;
|
||||
default: color = colorArray[state.datasets.filter(element => !element.name.endsWith("_target") && element.name !== "heater_bed" && element.name !== "chamber").length]; break;
|
||||
}
|
||||
|
||||
mainDataset = {
|
||||
type: "spline",
|
||||
name: payload.name,
|
||||
legendText: payload.name,
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: true,
|
||||
markerType: 'none',
|
||||
toolTipContent: "{name}: {y}°C",
|
||||
color: color,
|
||||
}
|
||||
}
|
||||
|
||||
mainDataset = state.datasets.push(mainDataset);
|
||||
}
|
||||
|
||||
// update current temp in temperature chart
|
||||
if (mainDataset && payload.value !== undefined) {
|
||||
if (dataset !== undefined && payload.value !== undefined) {
|
||||
if (Array.isArray(payload.value)) {
|
||||
for (let i = 0; i < payload.value.length; i++) {
|
||||
mainDataset.data.push({
|
||||
x: payload.time - 1000 * i,
|
||||
y: Math.round(payload.value[i]*100)/100
|
||||
for (let i = payload.value.length; i > 0; i--) {
|
||||
dataset.dataPoints.push({
|
||||
x: payload.time - (i*1000),
|
||||
y: Math.round(payload.value[payload.value.length - i] * multi * 100)/100
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (mainDataset.dataPoints && mainDataset.dataPoints.length) {
|
||||
let lastTemp = mainDataset.dataPoints[mainDataset.dataPoints.length - 1].y
|
||||
let lastTime = mainDataset.dataPoints[mainDataset.dataPoints.length - 1].x
|
||||
dataset.dataPoints.push({
|
||||
x: payload.time,
|
||||
y: Math.round(payload.value * multi * 100)/100
|
||||
})
|
||||
|
||||
if (
|
||||
payload.time - lastTime > minResolution &&
|
||||
(lastTemp !== payload.value || payload.time - lastTime > minResolution)
|
||||
) {
|
||||
mainDataset.dataPoints.push({
|
||||
x: payload.time,
|
||||
y: Math.round(payload.value*100)/100
|
||||
});
|
||||
}
|
||||
|
||||
let i
|
||||
while ((i = mainDataset.dataPoints.findIndex(item => timeOld > item.x)) > -1) {
|
||||
mainDataset.dataPoints.splice(i, 1)
|
||||
}
|
||||
} else if (mainDataset.dataPoints) {
|
||||
mainDataset.dataPoints.push({
|
||||
x: payload.time,
|
||||
y: Math.round(payload.value*100)/100
|
||||
});
|
||||
let i
|
||||
const timeOld = new Date().getTime() - (1000 * 60 * 10)
|
||||
while ((i = dataset.dataPoints.findIndex(item => timeOld > item.x)) > -1) {
|
||||
dataset.dataPoints.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearDataset(state, payload) {
|
||||
const dataset = state.datasets.find(dataset => dataset.name === payload)
|
||||
if (dataset) {
|
||||
Vue.set(dataset, 'dataPoints', [])
|
||||
}
|
||||
},
|
||||
|
||||
hidePowerDatasets(state) {
|
||||
state.datasets.forEach(element => {
|
||||
if (element.name.endsWith("_power")) {
|
||||
element.visible = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showPowerDatasets(state) {
|
||||
state.datasets.forEach(element => {
|
||||
if (element.name.endsWith("_power")) {
|
||||
element.visible = true
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
setVisible(state, payload) {
|
||||
const datasetName = payload.type !== 'temperature' ? payload.name+'_'+payload.type : payload.name
|
||||
|
||||
const datasetIndex = state.datasets.findIndex(element => element.name === datasetName)
|
||||
if (datasetIndex !== -1) {
|
||||
Vue.set(state.datasets[datasetIndex], 'visible', payload.value)
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
setColor(state, payload) {
|
||||
state.datasets.forEach(element => {
|
||||
if (
|
||||
element.name === payload.name ||
|
||||
element.name === payload.name+'_target' ||
|
||||
element.name === payload.name+'_power'
|
||||
) {
|
||||
element.color = payload.value
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -7,10 +7,28 @@ export default {
|
||||
dispatch('updateManager/reset')
|
||||
},
|
||||
|
||||
init({ dispatch }) {
|
||||
init() {
|
||||
Vue.prototype.$socket.sendObj('server.info', {}, 'server/getInfo')
|
||||
Vue.prototype.$socket.sendObj('server.files.list', { root: 'config' }, 'server/checkMainsailJson')
|
||||
},
|
||||
|
||||
dispatch('printer/init', null, { root: true })
|
||||
checkMainsailJson({ dispatch, rootState }, payload) {
|
||||
let boolFallback = true
|
||||
|
||||
Object.entries(payload).forEach(([, file]) => {
|
||||
if ('filename' in file && file.filename === '.mainsail.json') {
|
||||
boolFallback = false
|
||||
|
||||
fetch('//'+rootState.socket.hostname+':'+rootState.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
|
||||
.then(res => res.json()).then(file => {
|
||||
dispatch('gui/getData', file, { root: true })
|
||||
if (!rootState.socket.remoteMode) dispatch('farm/readStoredPrinters', {}, { root: true })
|
||||
dispatch('printer/init', null, { root: true })
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
if (boolFallback) dispatch('printer/init', null, { root: true })
|
||||
},
|
||||
|
||||
getInfo({ commit, state, rootState }, payload) {
|
||||
@@ -47,6 +65,7 @@ export default {
|
||||
},
|
||||
|
||||
getGcodeStore({ commit }, payload) {
|
||||
commit('clearGcodeStore')
|
||||
commit('setGcodeStore', payload)
|
||||
},
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ export default {
|
||||
Vue.prototype.$socket.sendObj('server.info', {}, 'server/getInfo');
|
||||
},
|
||||
|
||||
setKlippyShutdown(state) {
|
||||
Vue.set(state, 'klippy_state', 'shutdown')
|
||||
Vue.set(state, 'klippy_message', 'Shutdown...')
|
||||
|
||||
Vue.prototype.$socket.sendObj('server.info', {}, 'server/getInfo');
|
||||
},
|
||||
|
||||
setData(state, payload) {
|
||||
if ("requestParams" in payload) delete payload.requestParams
|
||||
|
||||
@@ -26,6 +33,10 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
clearGcodeStore(state) {
|
||||
Vue.set(state, 'events', [])
|
||||
},
|
||||
|
||||
setGcodeStore(state, payload) {
|
||||
if ("gcode_store" in payload && Array.isArray(payload.gcode_store)) {
|
||||
payload.gcode_store.forEach(message => {
|
||||
|
||||
@@ -23,13 +23,12 @@ export default {
|
||||
},
|
||||
|
||||
isUpdateAvailable(state) {
|
||||
if (
|
||||
'klipper' in state &&
|
||||
'remote_hash' in state.klipper &&
|
||||
'current_hash' in state.klipper &&
|
||||
state.klipper.current_hash !== state.klipper.current_hash
|
||||
) {
|
||||
return true
|
||||
for (const key of Object.keys(state.version_info)) {
|
||||
if (
|
||||
'version' in state.version_info[key] &&
|
||||
'remote_version' in state.version_info[key] &&
|
||||
state.version_info[key].version !== state.version_info[key].remote_version
|
||||
) return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
@@ -51,6 +51,10 @@ export default {
|
||||
commit('server/setKlippyDisconnected', null, { root: true })
|
||||
break
|
||||
|
||||
case 'notify_klippy_shutdown':
|
||||
commit('server/setKlippyShutdown', null, { root: true })
|
||||
break
|
||||
|
||||
case 'notify_filelist_changed':
|
||||
switch(payload.params[0].action) {
|
||||
case 'upload_file':
|
||||
|
||||
+17
-1
@@ -11,4 +11,20 @@ export const colorArray = [
|
||||
export const colorHeaterBed = '#2196F3'
|
||||
export const colorChamber = '#4CAF50'
|
||||
export const temperaturChartSampleLength = 1200
|
||||
export const themeDir = '.theme'
|
||||
export const themeDir = '.theme'
|
||||
export const datasetTypes = [
|
||||
"temperature",
|
||||
"target",
|
||||
"power",
|
||||
"speed",
|
||||
]
|
||||
|
||||
export const datasetTypesInPercents = [
|
||||
"power",
|
||||
"speed",
|
||||
]
|
||||
|
||||
export const additionalSensors = [
|
||||
"bme280",
|
||||
"htu21d",
|
||||
]
|
||||
Reference in new issue
Block a user