Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dffb3079e | ||
|
|
dc0fb853bc | ||
|
|
91dc42e47e | ||
|
|
402ea9f1cd | ||
|
|
d6c73ce012 | ||
|
|
becef8f1ea | ||
|
|
f4656c7150 | ||
|
|
79b529eb1e | ||
|
|
16efdc6042 | ||
|
|
36a29eb629 | ||
|
|
07094a52dd | ||
|
|
5363322681 | ||
|
|
48403d09cc | ||
|
|
80ded1b9ff | ||
|
|
c4ccfce216 | ||
|
|
f2ea6c039f | ||
|
|
1a18af1569 | ||
|
|
d953cab29c | ||
|
|
222bd60d9e | ||
|
|
85bd5279f5 | ||
|
|
a0d21f6664 | ||
|
|
8b7756aea7 | ||
|
|
fe1f659c51 | ||
|
|
c2eeabe165 | ||
|
|
fbdacef932 | ||
|
|
c22d0c2040 | ||
|
|
c63fd161c2 | ||
|
|
eac1d69cf7 | ||
|
|
01df98b8ec | ||
|
|
fa01bfac39 | ||
|
|
8bce2467a0 | ||
|
|
626d76e852 | ||
|
|
0895026c02 | ||
|
|
0b2d17d633 | ||
|
|
be821f913d | ||
|
|
baa4d9b416 | ||
|
|
2be28ab463 | ||
|
|
cbd9d6ea75 | ||
|
|
b204373dd9 | ||
|
|
5b2dad6c32 | ||
|
|
14195daa5a | ||
|
|
389c162878 | ||
|
|
1217927fae | ||
|
|
306d510719 | ||
|
|
a3d4497577 | ||
|
|
46728ded75 | ||
|
|
7c07db946d | ||
|
|
a167a14f12 | ||
|
|
9a84111fb3 | ||
|
|
81541d33f7 | ||
|
|
7e471ab995 | ||
|
|
7b1ff60adc | ||
|
|
c00da9bae3 | ||
|
|
a2fae98f28 | ||
|
|
cb6706415e | ||
|
|
e872c3e975 | ||
|
|
be52358121 | ||
|
|
2db574effd | ||
|
|
0128831423 | ||
|
|
ab79857fbe | ||
|
|
93f71e1f18 | ||
|
|
184d2430c4 | ||
|
|
a37eb272ac | ||
|
|
7e48b08f81 | ||
|
|
d1d84953a1 | ||
|
|
502b5ac7c1 | ||
|
|
d8dff1affa | ||
|
|
6aa99bc75f | ||
|
|
ac24c8a47a | ||
|
|
8ccd018c21 | ||
|
|
2634b37755 | ||
|
|
aaf50a403d | ||
|
|
5f06da45cf | ||
|
|
33bc3673ae | ||
|
|
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
@@ -9,5 +9,12 @@ temp
|
||||
.version
|
||||
.versions
|
||||
.changelog
|
||||
.idea
|
||||
package-lock.json
|
||||
*.local
|
||||
*.local
|
||||
docker/gcode
|
||||
docker/logs
|
||||
docker/config/*.cfg
|
||||
docker/config/*.conf
|
||||
docker/config/.mainsail.json
|
||||
docker/config/.theme
|
||||
@@ -0,0 +1,33 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: api/Dockerfile
|
||||
image: mainsail-stack-api/1
|
||||
volumes:
|
||||
- ./docker/config:/home/node/printer_config
|
||||
- ./docker/logs:/tmp/logs
|
||||
- ./docker/gcode:/home/node/gcode
|
||||
container_name: ${APP_NAME}-stack-api
|
||||
ports:
|
||||
- 7125:7125
|
||||
networks:
|
||||
- dev_net
|
||||
application:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: Dockerfile
|
||||
image: mainsail-stack-npm/1
|
||||
volumes:
|
||||
- ./:/home/node/mainsail
|
||||
container_name: ${APP_NAME}-stack-npm
|
||||
ports:
|
||||
- 8080:8080
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- dev_net
|
||||
networks:
|
||||
dev_net:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM node:buster AS base
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y zip
|
||||
|
||||
COPY start-npm /usr/local/bin/start-npm
|
||||
RUN chmod +x /usr/local/bin/start-npm
|
||||
|
||||
USER node
|
||||
|
||||
WORKDIR /home/node/mainsail
|
||||
|
||||
ENTRYPOINT ["start-npm"]
|
||||
@@ -0,0 +1,66 @@
|
||||
FROM debian:buster AS base
|
||||
|
||||
RUN groupadd --force -g 1000 node
|
||||
RUN useradd -ms /bin/bash --no-user-group -g 1000 -u 1000 node
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y sudo wget cmake swig git virtualenv python-dev libffi-dev build-essential libncurses-dev libusb-dev avrdude gcc-avr binutils-avr avr-libc dfu-util libnewlib-arm-none-eabi gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0
|
||||
RUN mkdir /src
|
||||
WORKDIR /src
|
||||
RUN wget http://download.savannah.nongnu.org/releases/simulavr/libsim_1.1.0_amd64.deb
|
||||
RUN apt install /src/libsim_1.1.0_amd64.deb
|
||||
|
||||
#prebuild files for simulavr, not needed currently, because we just build the python lib later
|
||||
#RUN wget http://download.savannah.nongnu.org/releases/simulavr/simulavr_1.1.0_amd64.deb
|
||||
#RUN apt install /src/simulavr_1.1.0_amd64.deb
|
||||
#RUN wget http://download.savannah.nongnu.org/releases/simulavr/python3-simulavr_1.1.0_amd64.deb
|
||||
#RUN apt install /src/python3-simulavr_1.1.0_amd64.deb
|
||||
|
||||
RUN cat /etc/passwd
|
||||
|
||||
RUN echo 'node ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/node && \
|
||||
chown node:node -R ./
|
||||
#if systemd is installed, we need to backup the current systemctl command
|
||||
#RUN mv /bin/systemctl /bin/systemctl.bak
|
||||
RUN ln -s /bin/true /bin/systemctl
|
||||
|
||||
USER node
|
||||
|
||||
WORKDIR /home/node
|
||||
RUN git clone https://github.com/KevinOConnor/klipper
|
||||
WORKDIR /home/node/klipper
|
||||
COPY api/simulavr.config /home/node/klipper/.config
|
||||
RUN make
|
||||
RUN cp /home/node/klipper/out/klipper.elf /home/node/klipper/simulavr.elf
|
||||
RUN rm /home/node/klipper/.config
|
||||
COPY api/linux.config /home/node/klipper/.config
|
||||
RUN make clean
|
||||
RUN make
|
||||
RUN chmod +x /home/node/klipper/scripts/install-debian.sh
|
||||
RUN /home/node/klipper/scripts/install-debian.sh
|
||||
|
||||
WORKDIR /home/node
|
||||
RUN git clone https://github.com/Arksine/moonraker
|
||||
WORKDIR /home/node/moonraker
|
||||
RUN sed -E 's/check_klipper\(\)/check_klipper() { return 0; }\nold()/' /home/node/moonraker/scripts/install-moonraker.sh > /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
RUN chmod +x /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
RUN /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
|
||||
RUN sudo rm -f /bin/systemctl
|
||||
#restore backed up systemctl command
|
||||
#RUN sudo mv /bin/systemctl.bak /bin/systemctl
|
||||
|
||||
WORKDIR /home/node/
|
||||
RUN git clone https://git.savannah.nongnu.org/git/simulavr.git
|
||||
WORKDIR /home/node/simulavr
|
||||
RUN make python
|
||||
RUN make build
|
||||
|
||||
USER root
|
||||
|
||||
COPY api/run-api /usr/local/bin/run-api
|
||||
RUN chmod +x /usr/local/bin/run-api
|
||||
|
||||
USER node
|
||||
|
||||
ENTRYPOINT ["run-api"]
|
||||
@@ -0,0 +1,25 @@
|
||||
CONFIG_LOW_LEVEL_OPTIONS=y
|
||||
# CONFIG_MACH_AVR is not set
|
||||
# CONFIG_MACH_ATSAM is not set
|
||||
# CONFIG_MACH_ATSAMD is not set
|
||||
# CONFIG_MACH_LPC176X is not set
|
||||
# CONFIG_MACH_STM32 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
CONFIG_MACH_LINUX=y
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_STEP_DELAY=2
|
||||
CONFIG_BOARD_DIRECTORY="linux"
|
||||
CONFIG_CLOCK_FREQ=50000000
|
||||
CONFIG_LINUX_SELECT=y
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
CONFIG_USB_SERIAL_NUMBER="12345"
|
||||
# CONFIG_CUSTOM_STEP_DELAY is not set
|
||||
CONFIG_INITIAL_PINS=""
|
||||
CONFIG_HAVE_GPIO=y
|
||||
CONFIG_HAVE_GPIO_ADC=y
|
||||
CONFIG_HAVE_GPIO_SPI=y
|
||||
CONFIG_HAVE_GPIO_I2C=y
|
||||
CONFIG_HAVE_GPIO_HARD_PWM=y
|
||||
CONFIG_HAVE_GPIO_BITBANGING=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
PYTHONPATH="/home/node/simulavr/build/pysimulavr/" /home/node/klipper/scripts/avrsim.py -m atmega644 -s 20000000 -b 250000 /home/node/klipper/simulavr.elf &
|
||||
/home/node/klippy-env/bin/python /home/node/klipper/klippy/klippy.py /home/node/printer_config/printer.cfg -l /tmp/logs/klippy.log -a /tmp/klippy_uds &
|
||||
/home/node/moonraker-env/bin/python /home/node/moonraker/moonraker/moonraker.py -l /tmp/logs/moonraker.log -c /home/node/printer_config/moonraker.conf &
|
||||
echo "Starting ..." >> /tmp/logs/klippy.log
|
||||
tail -f /tmp/logs/klippy.log
|
||||
@@ -0,0 +1,50 @@
|
||||
CONFIG_LOW_LEVEL_OPTIONS=y
|
||||
CONFIG_MACH_AVR=y
|
||||
# CONFIG_MACH_ATSAM is not set
|
||||
# CONFIG_MACH_ATSAMD is not set
|
||||
# CONFIG_MACH_LPC176X is not set
|
||||
# CONFIG_MACH_STM32 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
# CONFIG_MACH_LINUX is not set
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_AVR_SELECT=y
|
||||
CONFIG_STEP_DELAY=-1
|
||||
CONFIG_BOARD_DIRECTORY="avr"
|
||||
# CONFIG_MACH_atmega2560 is not set
|
||||
# CONFIG_MACH_atmega1280 is not set
|
||||
# CONFIG_MACH_at90usb1286 is not set
|
||||
# CONFIG_MACH_at90usb646 is not set
|
||||
# CONFIG_MACH_atmega32u4 is not set
|
||||
# CONFIG_MACH_atmega1284p is not set
|
||||
CONFIG_MACH_atmega644p=y
|
||||
# CONFIG_MACH_atmega328p is not set
|
||||
# CONFIG_MACH_atmega328 is not set
|
||||
# CONFIG_MACH_atmega168 is not set
|
||||
CONFIG_MCU="atmega644p"
|
||||
CONFIG_AVRDUDE_PROTOCOL="arduino"
|
||||
# CONFIG_AVR_FREQ_16000000 is not set
|
||||
CONFIG_AVR_FREQ_20000000=y
|
||||
# CONFIG_AVR_FREQ_8000000 is not set
|
||||
CONFIG_CLOCK_FREQ=20000000
|
||||
CONFIG_AVR_CLKPR=-1
|
||||
CONFIG_AVR_STACK_SIZE=256
|
||||
CONFIG_AVR_WATCHDOG=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_AVR_SERIAL_UART0=y
|
||||
# CONFIG_AVR_SERIAL_UART1 is not set
|
||||
CONFIG_SERIAL_PORT=0
|
||||
CONFIG_SIMULAVR=y
|
||||
CONFIG_SERIAL_BAUD=250000
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
CONFIG_USB_SERIAL_NUMBER="12345"
|
||||
# CONFIG_CUSTOM_STEP_DELAY is not set
|
||||
CONFIG_INITIAL_PINS=""
|
||||
CONFIG_HAVE_GPIO=y
|
||||
CONFIG_HAVE_GPIO_ADC=y
|
||||
CONFIG_HAVE_GPIO_SPI=y
|
||||
CONFIG_HAVE_GPIO_I2C=y
|
||||
CONFIG_HAVE_GPIO_HARD_PWM=y
|
||||
CONFIG_HAVE_GPIO_BITBANGING=y
|
||||
CONFIG_HAVE_STRICT_TIMING=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
@@ -0,0 +1,14 @@
|
||||
# moonraker.conf
|
||||
|
||||
[server]
|
||||
host: 0.0.0.0
|
||||
port: 7125
|
||||
enable_debug_logging: True
|
||||
config_path: /home/node/printer_config/
|
||||
|
||||
[authorization]
|
||||
enabled: True
|
||||
trusted_clients:
|
||||
0.0.0.0/0
|
||||
cors_domains:
|
||||
*
|
||||
@@ -0,0 +1,179 @@
|
||||
[virtual_sdcard]
|
||||
path: ~/gcode
|
||||
|
||||
[pause_resume]
|
||||
[display_status]
|
||||
|
||||
[mcu]
|
||||
serial: /tmp/pseudoserial
|
||||
pin_map: arduino
|
||||
baud: 250000
|
||||
|
||||
[stepper_x]
|
||||
step_pin: PD7
|
||||
dir_pin: !PC5
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 40
|
||||
endstop_pin: ^PC2
|
||||
position_endstop: 0
|
||||
position_max: 235
|
||||
homing_speed: 50
|
||||
homing_retract_dist: 0
|
||||
|
||||
[stepper_y]
|
||||
step_pin: PC6
|
||||
dir_pin: !PC7
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 40
|
||||
endstop_pin: ^PC3
|
||||
position_endstop: 0
|
||||
position_max: 235
|
||||
homing_speed: 50
|
||||
homing_retract_dist: 0
|
||||
|
||||
[stepper_z]
|
||||
step_pin: PB3
|
||||
dir_pin: PB2
|
||||
enable_pin: !PA5
|
||||
microsteps: 16
|
||||
rotation_distance: 8
|
||||
endstop_pin: ^PC4
|
||||
position_endstop: 0.0
|
||||
position_max: 250
|
||||
homing_retract_dist: 0
|
||||
|
||||
[extruder]
|
||||
max_extrude_only_distance: 100.0
|
||||
step_pin: PB1
|
||||
dir_pin: !PB0
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 33.683
|
||||
nozzle_diameter: 0.400
|
||||
filament_diameter: 1.750
|
||||
heater_pin: PD5
|
||||
sensor_type: EPCOS 100K B57560G104F
|
||||
sensor_pin: PA7
|
||||
control: watermark
|
||||
min_temp: 0
|
||||
max_temp: 250
|
||||
min_extrude_temp: 50
|
||||
|
||||
[heater_bed]
|
||||
heater_pin: PD4
|
||||
sensor_type: EPCOS 100K B57560G104F
|
||||
sensor_pin: PA6
|
||||
control: watermark
|
||||
min_temp: 0
|
||||
max_temp: 130
|
||||
|
||||
[fan]
|
||||
pin: PB4
|
||||
|
||||
[heater_fan nozzle_fan]
|
||||
pin: PB5
|
||||
off_below: 0.0
|
||||
shutdown_speed: 1.0
|
||||
max_power: 1.0
|
||||
|
||||
[controller_fan mcu_fan]
|
||||
pin: PB6
|
||||
off_below: 0.2
|
||||
shutdown_speed: 1.0
|
||||
max_power: 1.0
|
||||
|
||||
[printer]
|
||||
kinematics: cartesian
|
||||
max_velocity: 300
|
||||
max_accel: 3000
|
||||
max_z_velocity: 5
|
||||
max_z_accel: 100
|
||||
|
||||
#[display]
|
||||
#lcd_type: st7920
|
||||
#cs_pin: PA3
|
||||
#sclk_pin: PA1
|
||||
#sid_pin: PC1
|
||||
#encoder_pins: ^PD2, ^PD3
|
||||
#click_pin: ^!PC0
|
||||
|
||||
# The print bed can move so far to the front, that the nozzle can reach the
|
||||
# plastic cover of the print bed heater cable (only when the bed is moved by
|
||||
# hand). By homing the Y axis before the X axis, it is ensured the nozzle will
|
||||
# not melt through the plastic part.
|
||||
# BEWARE: You will lose the ability to home axes individually. The printer will
|
||||
# always home all axes for every G28 command.
|
||||
#[homing_override]
|
||||
#gcode:
|
||||
# G28 Y0
|
||||
# G28 X0
|
||||
# G28 Z0
|
||||
|
||||
[gcode_macro PAUSE]
|
||||
rename_existing: BASE_PAUSE
|
||||
default_parameter_X: 230 #edit to your park position
|
||||
default_parameter_Y: 230 #edit to your park position
|
||||
default_parameter_Z: 10 #edit to your park position
|
||||
default_parameter_E: 1 #edit to your retract length
|
||||
gcode:
|
||||
SAVE_GCODE_STATE NAME=PAUSE_state
|
||||
BASE_PAUSE
|
||||
G91
|
||||
G1 E-{E} F2100
|
||||
G1 Z{Z}
|
||||
G90
|
||||
G1 X{X} Y{Y} F6000
|
||||
[gcode_macro RESUME]
|
||||
rename_existing: BASE_RESUME
|
||||
default_parameter_E: 1 #edit to your retract length
|
||||
gcode:
|
||||
G91
|
||||
G1 E{E} F2100
|
||||
G90
|
||||
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
|
||||
BASE_RESUME
|
||||
[gcode_macro CANCEL_PRINT]
|
||||
rename_existing: BASE_CANCEL_PRINT
|
||||
gcode:
|
||||
TURN_OFF_HEATERS
|
||||
CLEAR_PAUSE
|
||||
SDCARD_RESET_FILE
|
||||
BASE_CANCEL_PRINT
|
||||
|
||||
[gcode_macro START_PRINT]
|
||||
default_parameter_BED_TEMP: 103.3
|
||||
default_parameter_EXTRUDER_TEMP: 103.3
|
||||
gcode:
|
||||
# Start bed heating
|
||||
M140 S103.3
|
||||
# Use absolute coordinates
|
||||
G90
|
||||
# Reset the G-Code Z offset (adjust Z offset if needed)
|
||||
SET_GCODE_OFFSET Z=0.0
|
||||
# Home the printer
|
||||
G28
|
||||
# Move the nozzle near the bed
|
||||
G1 Z5 F3000
|
||||
# Move the nozzle very close to the bed
|
||||
G1 Z0.15 F300
|
||||
# Wait for bed to reach temperature
|
||||
M190 S103.3
|
||||
# Set and wait for nozzle to reach temperature
|
||||
M109 S103.3
|
||||
|
||||
[gcode_macro END_PRINT]
|
||||
gcode:
|
||||
# Turn off bed, extruder, and fan
|
||||
M140 S0
|
||||
M104 S0
|
||||
M106 S0
|
||||
# Move nozzle away from print while retracting
|
||||
G91
|
||||
G1 X-2 Y-2 E-3 F300
|
||||
# Raise nozzle by 10mm
|
||||
G1 Z10 F3000
|
||||
G90
|
||||
# Disable steppers
|
||||
M84
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export APP_NAME=mainsail
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
if [ "$1" == "restart" ]; then
|
||||
docker-compose restart "$2"
|
||||
elif [ "$1" == "bash" ]; then
|
||||
docker exec -it "$APP_NAME-stack-$2" bash
|
||||
elif [ "$1" == "npm-build" ]; then
|
||||
docker exec "$APP_NAME-stack-npm" npm run build
|
||||
else
|
||||
docker-compose "$@"
|
||||
fi
|
||||
else
|
||||
docker-compose ps
|
||||
fi
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
if [ ! -d 'node_modules' ]; then
|
||||
npm ci
|
||||
fi
|
||||
npm run serve
|
||||
@@ -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 +1,49 @@
|
||||
$link-color: $red-300;
|
||||
|
||||
.success {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(38, 203, 124);
|
||||
}
|
||||
|
||||
.info {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(56, 132, 255);
|
||||
}
|
||||
|
||||
.warning {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(247, 125, 5);
|
||||
}
|
||||
|
||||
.alert {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(255, 70, 66);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Support
|
||||
nav_order: 7
|
||||
has_children: true
|
||||
permalink: /additional
|
||||
---
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/thumbnails
|
||||
---
|
||||
|
||||
## Thumbnails
|
||||
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer
|
||||
|
||||
To enable thumbnails, click on `Help > Show Configuration Folder` and navigate to your printer profiles inside the `printer` folder.
|
||||
Open your printer profile in a text editor and find `thumbnails =` and add the resolutions `32x32,400x300`. Save the file and restart your Slicer.
|
||||
|
||||

|
||||
|
||||
From now on the gcode files contain thumbnails displayed by mainsail.
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 647 KiB |
@@ -6,11 +6,49 @@ nav_order: 99
|
||||
permalink: /customizing/custom-css
|
||||
---
|
||||
|
||||
## Custom-CSS
|
||||
## Custom-CSS
|
||||
|
||||
The custom.css file allows you to customize the appearance of Mainsail
|
||||
without the need of rebuilding it. All you need to do is to place a file
|
||||
named "custom.css" into the configuration directory ".theme" and define
|
||||
your css rules in there.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
### How to CSS
|
||||
|
||||
You need to be familiar with the CSS (**C**ascading **S**tyle **S**heets) syntax.
|
||||
There are many resources to learn CSS online, for example:
|
||||
- https://www.w3schools.com/css/default.asp
|
||||
|
||||
#### find the Element selector (example based on Chrome Browser)
|
||||
|
||||
Use your browser's built-in developer tools to find the right selector of the element you want to add your own flair to.
|
||||
|
||||
Open the developer tools:
|
||||
|
||||
right click anywhere on the page and select "inspect" (or F12 on the keyboard)
|
||||
|
||||

|
||||
|
||||
1. Activate the "inspector"
|
||||
2. Select the desired element
|
||||
3. Find the selector
|
||||
4. Use the style editor and fiddle arround
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
When you have achieved your desired appearance copy the full "section" including selector and curly braces
|
||||
|
||||

|
||||
|
||||
Then copy it to the "custom.css" file (you can keep everything or only what you have added)
|
||||
|
||||

|
||||
|
||||
NOTE: After saving, your browser may need a uncached reload to show the change (https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache#Bypassing_cache)
|
||||
@@ -18,5 +18,5 @@ are not yet listed below, please create a FR (feature request) on Github.
|
||||
- [change favicon](favicon.md)
|
||||
- [upload custom.css](custom-css.md)
|
||||
|
||||
### cooming soon
|
||||
- change primary color (all blue buttons atm)
|
||||
### coming soon
|
||||
- change primary color (all blue buttons atm)
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: Docker
|
||||
parent: Development
|
||||
has_children: false
|
||||
permalink: /development/docker
|
||||
description: >-
|
||||
Setup docker and docker-compose for quick full stack mainsail development with simulavr without any real printer
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
Install docker and docker-compose on your desired machine.
|
||||
|
||||
### Debian/Ubuntu
|
||||
```shell
|
||||
sudo apt install docker docker-compose
|
||||
```
|
||||
### Mac
|
||||
https://docs.docker.com/docker-for-mac/install/
|
||||
### Windows
|
||||
https://docs.docker.com/docker-for-windows/install/
|
||||
|
||||
## Start
|
||||
1. Look into the docker/config folder. Copy the ".example" without the "example ending".
|
||||
2. Edit the configs to your likings. They are inital setup for a minimal setup environment with simulavr.
|
||||
3. In the root directory of mainsail run
|
||||
```shell
|
||||
docker/run up
|
||||
```
|
||||
|
||||
## Development
|
||||
### Commands
|
||||
```shell
|
||||
docker/run ps # showing running containers
|
||||
docker/run restart <api/npm> # restarting container
|
||||
# api: restarting complete api container with simulavr/moonraker/klipper services,
|
||||
# npm: restarting nodejs container with running 'npm run serve'
|
||||
docker/run bash <api/npm> # spawning bash shell inside container
|
||||
```
|
||||
Restarting the api container will happen a lot, because simulavr WILL crash a lot! Timings within simulavr are not precise and klipper will bug alot about that.
|
||||
## Todo
|
||||
1. The current implementation of simulavr/moonraker/klipper is kinda naiv, because docker wont run with systemd.
|
||||
I will fix that in later versions of the docker container, so you can restart specific containers and omit simulavr and bind a real connected printer for example.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: default
|
||||
title: Development
|
||||
nav_order: 15
|
||||
has_children: true
|
||||
permalink: /development
|
||||
description: development guide
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
layout: default
|
||||
title: Standalone
|
||||
parent: Development
|
||||
has_children: false
|
||||
permalink: /development/standalone
|
||||
description: >-
|
||||
Setup the project and start developing with your local printer(s)
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
Make a copy of the '.env.development.local.example' and omit the .example.
|
||||
In the new file edit it to refect your desired printer:
|
||||
```dotenv
|
||||
VUE_APP_HOSTNAME=192.168.0.15 #for your printer with moonraker running on 192.168.0.15
|
||||
```
|
||||
In moonraker you need to add your local ip at the cors_domains:
|
||||
```yaml
|
||||
cors_domains:
|
||||
http://<your local ip>:<local port>
|
||||
```
|
||||
access the local running dev environment with `http://<your local ip>:<local port>`.
|
||||
|
||||
### Nodejs Environment >= v15.9.0
|
||||
Linux
|
||||
```shell
|
||||
curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
|
||||
```
|
||||
Debian/Ubuntu
|
||||
```shell
|
||||
sudo apt-get install -y nodejs
|
||||
```
|
||||
For other package-managers look here:
|
||||
https://nodejs.org/en/download/package-manager/
|
||||
|
||||
## Start
|
||||
```shell
|
||||
npm install # only once and if you updated/installed packages
|
||||
npm run serve # starting current build with hot module reloading
|
||||
```
|
||||
@@ -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: temperature_host
|
||||
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. The gcode will be executed after the selected temperatures are set.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||
|
||||

|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/thumbnails
|
||||
description: >-
|
||||
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.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer
|
||||
|
||||
To enable thumbnails, click on `Help > Show Configuration Folder` and navigate to your printer profiles inside the `printer` folder.
|
||||
Open your printer profile in a text editor and find `thumbnails =` and add the resolutions `32x32,400x300`. Save the file and restart your Slicer.
|
||||
|
||||

|
||||
|
||||
From now on the gcode files contain thumbnails displayed by mainsail.
|
||||
|
||||
### Cura
|
||||
|
||||
The Cura plugin "Cura2Moonraker" is required for this. You can find this plugin and a install guide
|
||||
here: [https://github.com/emtrax-ltd/Cura2MoonrakerPlugin](https://github.com/emtrax-ltd/Cura2MoonrakerPlugin)
|
||||
|
||||

|
||||
@@ -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}
|
||||
@@ -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.
|
||||
@@ -48,8 +48,11 @@ trusted_clients:
|
||||
2a02:810d:9340:33f6::/64
|
||||
|
||||
[update_manager]
|
||||
client_repo: meteyou/mainsail
|
||||
client_path: ~/mainsail
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
> 🔥 **trusted_clients - read carefully** 🔥
|
||||
|
||||
@@ -23,8 +23,11 @@ If you see a content like this
|
||||
To use the update manager in Mainsail you have to add this in your moonraker.conf:
|
||||
```
|
||||
[update_manager]
|
||||
client_repo: meteyou/mainsail
|
||||
client_path: ~/mainsail
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
### Change Moonraker to systemd service (December 6th 2020)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "1.0.2",
|
||||
"version": "1.3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -11,19 +11,24 @@
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.8.2",
|
||||
"echarts": "^5.0.2",
|
||||
"echarts-gl": "^2.0.1",
|
||||
"object-assign-deep": "^0.4.0",
|
||||
"plotly.js": "^1.58.4",
|
||||
"prismjs": "^1.23.0",
|
||||
"semver": "^5.7.1",
|
||||
"vue": "^2.6.12",
|
||||
"vue-context": "^6.0.0",
|
||||
"vue-github-api": "^0.1.7",
|
||||
"vue-headful": "^2.1.0",
|
||||
"vue-observe-visibility": "^1.0.0",
|
||||
"vue-plotly": "^1.1.0",
|
||||
"vue-prism-editor": "^1.2.2",
|
||||
"vue-resource": "^1.5.1",
|
||||
"vue-simple-upload": "^0.1.6",
|
||||
"vue-toast-notification": "^0.6.0",
|
||||
"vuetify": "^2.4.2",
|
||||
"vuex": "^3.6.0"
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "^5.8.55",
|
||||
@@ -43,7 +48,7 @@
|
||||
"vue-cli-plugin-vuetify": "^2.0.9",
|
||||
"vue-router": "^3.4.9",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuetify-loader": "^1.6.0"
|
||||
"vuetify-loader": "^1.7.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
||||
@@ -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,9 +1,11 @@
|
||||
<template>
|
||||
<div id="tempchart" style="height: 270px; width: 100%;"></div>
|
||||
<div id="tempchart" style="height: 250px; width: 100%;"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
|
||||
import { mapState } from 'vuex'
|
||||
import * as echarts from 'echarts'
|
||||
import { convertName } from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -11,87 +13,288 @@ export default {
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
tempchartDisplayMinutes: 10,
|
||||
timer: '',
|
||||
chart : null,
|
||||
timerChart: '',
|
||||
timerDataset: '',
|
||||
chartFocus: false,
|
||||
chartOptions: {
|
||||
theme: "dark1",
|
||||
backgroundColor: 'transparent',
|
||||
animationEnabled: true,
|
||||
legend: {
|
||||
horizontalAlign: "center",
|
||||
verticalAlign: "top",
|
||||
darkMode: true,
|
||||
animation: false,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(0,0,0,0.9)',
|
||||
borderWidth: 0,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: '14px'
|
||||
},
|
||||
padding: 15,
|
||||
formatter: (datasets) => {
|
||||
let output = ""
|
||||
|
||||
if (datasets.length) {
|
||||
let outputTime = datasets[0]['axisValueLabel']
|
||||
outputTime = outputTime.substr(outputTime.indexOf(" "))
|
||||
|
||||
output += "<div class=\"row mb-2\">" +
|
||||
"<div class=\"col py-1\" style='border-bottom: 1px solid rgba(255, 255, 255, 0.24);'>" +
|
||||
"<span class='v-icon mdi mdi-clock theme-dark' style='font-size: 14px; margin-right: 5px;'></span>" +
|
||||
"<span class='font-weight-bold'>"+outputTime+"</span>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
}
|
||||
|
||||
datasets.forEach(dataset => {
|
||||
if (
|
||||
!dataset.seriesName.endsWith('_target') &&
|
||||
!dataset.seriesName.endsWith('_power') &&
|
||||
!dataset.seriesName.endsWith('_speed')
|
||||
) {
|
||||
output += "<div class=\"row\">"
|
||||
output += "<div class=\"col-auto pt-2 pb-1\">"
|
||||
|
||||
const mainDataset = this.series.find(tmpDataset => tmpDataset.name === dataset.seriesName)
|
||||
if (mainDataset)
|
||||
output += "<span style=\"" +
|
||||
"display:inline-block;" +
|
||||
"margin-right:10px;" +
|
||||
"width:8px;" +
|
||||
"height:8px;" +
|
||||
"border-radius: 50%;" +
|
||||
"background-color:"+mainDataset.lineStyle.color+"CC;" +
|
||||
"\"></span>"
|
||||
|
||||
output += convertName(dataset.seriesName)+":"
|
||||
|
||||
output += "</div>"
|
||||
output += "<div class=\"col text-right pt-2 pb-1 font-weight-bold\">"
|
||||
|
||||
if (dataset.value[1]) output += dataset.value[1].toFixed(1)
|
||||
|
||||
const target = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_target")
|
||||
if (target) output += " / "+target.value[1].toFixed(1)
|
||||
|
||||
output += "°C"
|
||||
|
||||
const power = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_power")
|
||||
if (power) output += " [ "+power.value[1].toFixed(0)+"% ]"
|
||||
|
||||
const speed = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_speed")
|
||||
if (speed) output += " [ "+speed.value[1].toFixed(0)+"% ]"
|
||||
|
||||
output += "</div>"
|
||||
output += "</div>"
|
||||
}
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
},
|
||||
toolTip:{
|
||||
content: "{name}: {y}",
|
||||
yValueFormatString: "#,###.00",
|
||||
grid: {
|
||||
top: 35,
|
||||
right: 25,
|
||||
bottom: 25,
|
||||
left: 25,
|
||||
},
|
||||
axisX:{
|
||||
valueFormatString: "HH:mm" ,
|
||||
//labelAngle: -50
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: new Date() - 60*10,
|
||||
maximum: new Date(),
|
||||
margin: 15,
|
||||
dataZoom: [{
|
||||
type: 'inside',
|
||||
}],
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
min: new Date() - 60*10,
|
||||
max: new Date(),
|
||||
splitNumber: 5,
|
||||
minInterval: 60*1000,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.06)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
margin: 10,
|
||||
},
|
||||
},
|
||||
axisY: {
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 300,
|
||||
interval: 50,
|
||||
},
|
||||
data: [ ]
|
||||
yAxis: [
|
||||
{
|
||||
name: 'Temperature [°C]',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 300,
|
||||
minInterval: 10,
|
||||
maxInterval: 100,
|
||||
nameLocation: 'end',
|
||||
nameGap: 5,
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
align: 'left',
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
formatter: '{value}',
|
||||
rotate: 90,
|
||||
//showMaxLabel: false,
|
||||
showMinLabel: true,
|
||||
margin: 5,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
}
|
||||
}, {
|
||||
name: 'PWM [%]',
|
||||
min: 0,
|
||||
max: 100,
|
||||
minInterval: 100,
|
||||
type: 'value',
|
||||
nameLocation: 'end',
|
||||
nameGap: 5,
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
align: 'right',
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
formatter: '{value}',
|
||||
showMinLabel: true,
|
||||
rotate: 90,
|
||||
margin: 5,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
series: [],
|
||||
media: [{
|
||||
query: {
|
||||
minWidth: 500,
|
||||
},
|
||||
option: {
|
||||
xAxis: {
|
||||
//splitNumber: 10,
|
||||
}
|
||||
}
|
||||
}, {
|
||||
query: {
|
||||
minWidth: 500,
|
||||
},
|
||||
option: {
|
||||
grid: {
|
||||
right: 40,
|
||||
left: 40,
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
maxInterval: 50,
|
||||
axisLabel: {
|
||||
showMinLabel: false,
|
||||
showMaxLabel: true,
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
{
|
||||
maxInterval: 25,
|
||||
axisLabel: {
|
||||
showMinLabel: false,
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
}],
|
||||
},
|
||||
chart : null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
intervalChartUpdate: state => state.gui.tempchart.intervalChartUpdate,
|
||||
intervalDatasetUpdate: state => state.gui.tempchart.intervalDatasetUpdate,
|
||||
boolTempchart: state => state.gui.dashboard.boolTempchart,
|
||||
}),
|
||||
maxHistory: {
|
||||
get() {
|
||||
return this.$store.getters["server/getConfig"]('server', 'temperature_store_size') || 1200
|
||||
}
|
||||
},
|
||||
series: {
|
||||
get () {
|
||||
return this.$store.state.printer.tempHistory.series
|
||||
}
|
||||
},
|
||||
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("_target")) return -1
|
||||
if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
})
|
||||
return this.$store.state.printer.tempHistory.datasets
|
||||
}
|
||||
},
|
||||
autoscale: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
}
|
||||
},
|
||||
maxTemp: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getMaxTemp"]
|
||||
}
|
||||
},
|
||||
currentMaxTemp: {
|
||||
get() {
|
||||
return this.$store.getters["printer/tempHistory/getCurrentMaxTemp"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createChart() {
|
||||
if (document.getElementById("tempchart")) {
|
||||
this.chart = new CanvasJS.Chart("tempchart", this.chartOptions)
|
||||
if (document.getElementById("tempchart") && this.chart === null) {
|
||||
this.chart = echarts.init(document.getElementById("tempchart"), null, {renderer: 'canvas'})
|
||||
this.chart.setOption(this.chartOptions)
|
||||
} else setTimeout(() => {
|
||||
this.createChart()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.timerChart = setInterval(() => {
|
||||
if (
|
||||
document.getElementById("tempchart") &&
|
||||
this.chart &&
|
||||
this.chart._toolBar
|
||||
this.boolTempchart &&
|
||||
document.visibilityState === "visible" &&
|
||||
this.$route.path === "/"
|
||||
) {
|
||||
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.chart.render()
|
||||
this.chart.setOption({
|
||||
series: this.series,
|
||||
xAxis: {
|
||||
min: new Date() - this.maxHistory * 1000,
|
||||
max: new Date(),
|
||||
},
|
||||
yAxis: [{
|
||||
max: this.autoscale ? this.currentMaxTemp : this.maxTemp,
|
||||
}],
|
||||
})
|
||||
}
|
||||
}, 1000);
|
||||
}, this.intervalChartUpdate)
|
||||
|
||||
this.timerDataset = setInterval(() => {
|
||||
this.$store.dispatch("printer/tempHistory/updateDatasets")
|
||||
}, this.intervalDatasetUpdate)
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.chart) this.chart.resize()
|
||||
})
|
||||
},
|
||||
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 === currentFeedAmount ? '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="(rate === currentFeedRate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -34,43 +34,61 @@
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
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 })
|
||||
}
|
||||
},
|
||||
currentFeedAmount: {
|
||||
get() {
|
||||
return parseFloat(this.$store.state.gui.dashboard.extruder.feedamount)
|
||||
},
|
||||
set(newVal) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamount: newVal } } })
|
||||
}
|
||||
},
|
||||
currentFeedRate: {
|
||||
get() {
|
||||
return parseFloat(this.$store.state.gui.dashboard.extruder.feedrate)
|
||||
},
|
||||
set(newVal) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrate: newVal } } })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
this.feedAmount = value;
|
||||
this.currentFeedAmount = value;
|
||||
},
|
||||
setFeedrate(value) {
|
||||
this.feedrate = value;
|
||||
this.currentFeedRate = value;
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
let gcode = "M83\nG1 E-"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
let gcode = "M83\nG1 E"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" command="M220" attribute-name="S" ></tool-slider>
|
||||
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" :dynamic-range="true" command="M220" attribute-name="S" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Extrusion factor" :target="extrude_factor" :max="200" :multi="100" :step="1" command="M221" attribute-name="S" ></tool-slider>
|
||||
</v-card>
|
||||
@@ -35,7 +35,7 @@
|
||||
</v-toolbar>
|
||||
<div v-for="(object, index) of this['printer/getMiscellaneous']" v-bind:key="index">
|
||||
<v-divider v-if="index"></v-divider>
|
||||
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)" ></miscellaneous-slider>
|
||||
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)"></miscellaneous-slider>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
@@ -65,6 +65,6 @@
|
||||
...mapGetters([
|
||||
'printer/getMiscellaneous',
|
||||
]),
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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>
|
||||
@@ -26,6 +26,34 @@
|
||||
<v-switch v-model="boolShowConsoleOnDashboard" label="Console" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-2">
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Chart update interval"
|
||||
v-model="intervalChartUpdate"
|
||||
@blur="blurIntervalChartUpdate"
|
||||
type="number"
|
||||
suffix="ms"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v >= 500 || 'Minimum is 500ms'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Datapoint interval"
|
||||
type="number"
|
||||
v-model="intervalDatasetUpdate"
|
||||
@blur="blurIntervalDatasetUpdate"
|
||||
suffix="ms"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v >= 500 || 'Minimum is 500ms'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
@@ -55,7 +83,7 @@
|
||||
return this.$store.state.gui.dashboard.boolTempchart;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolTempchart: status } });
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolTempchart: status } })
|
||||
}
|
||||
},
|
||||
boolShowConsoleOnDashboard: {
|
||||
@@ -63,12 +91,33 @@
|
||||
return this.$store.state.gui.dashboard.boolConsole;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolConsole: status } });
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolConsole: status } })
|
||||
}
|
||||
},
|
||||
intervalChartUpdate: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.intervalChartUpdate
|
||||
},
|
||||
set(newVal) {
|
||||
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { gui: { tempchart: { intervalChartUpdate: newVal } } })
|
||||
}
|
||||
},
|
||||
intervalDatasetUpdate: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.intervalDatasetUpdate
|
||||
},
|
||||
set(newVal) {
|
||||
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { gui: { tempchart: { intervalDatasetUpdate: newVal } } })
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
blurIntervalDatasetUpdate() {
|
||||
if (this.intervalDatasetUpdate < 500) this.intervalDatasetUpdate = 500
|
||||
},
|
||||
blurIntervalChartUpdate() {
|
||||
if (this.intervalChartUpdate < 500) this.intervalChartUpdate = 500
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -5,13 +5,13 @@
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||
<tool-slider label="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" :default-value="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||
<tool-slider label="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" :default-value="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<tool-slider label="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" :default-value="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
<tool-slider label="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" :default-value="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
current_accel: state => state.printer.toolhead.max_accel,
|
||||
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
|
||||
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
|
||||
config: state => state.printer.configfile.config,
|
||||
max_velocity: state => parseInt(state.printer.configfile.config.printer.max_velocity) || 0,
|
||||
max_accel: state => parseInt(state.printer.configfile.config.printer.max_accel) || 0,
|
||||
max_accel_to_decel: state => parseInt(state.printer.configfile.config.printer.max_accel_to_decel) || parseInt(state.printer.configfile.config.printer.max_accel) / 2,
|
||||
max_square_corner_velocity: state => parseInt(state.printer.configfile.config.printer.square_corner_velocity) || 5,
|
||||
config: state => state.printer.configfile.settings,
|
||||
max_velocity: state => state.printer.configfile.settings.printer.max_velocity,
|
||||
max_accel: state => state.printer.configfile.settings.printer.max_accel,
|
||||
max_accel_to_decel: state => state.printer.configfile.settings.printer.max_accel_to_decel,
|
||||
max_square_corner_velocity: state => state.printer.configfile.settings.printer.square_corner_velocity,
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -1,73 +1,120 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Update Manager</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
</template>
|
||||
<span>Check for updates</span>
|
||||
</v-tooltip>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
<style scoped>
|
||||
.cursor--pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<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">
|
||||
{{ 'name' in value ? value.name : key }}<br />
|
||||
{{ getVersionOutput(value) }}
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 mt-3 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Update Manager</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
</template>
|
||||
<span>Check for updates</span>
|
||||
</v-tooltip>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
|
||||
<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">
|
||||
<strong>{{ 'name' in value ? value.name : key }}</strong><br />
|
||||
<span @click="openCommitsOverlay(key, value)" :class="getVersionClickable(value) ? 'primary--text cursor--pointer' : ''">{{ getVersionOutput(value) }}</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
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>
|
||||
</div>
|
||||
<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="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 }">
|
||||
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} packages can be upgraded</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">OS-Packages</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
|
||||
@click="updateSystem"
|
||||
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>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="commitsOverlay.bool" persistent width="60%" max-width="800">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Commits</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" color="grey darken-3" @click="commitsOverlay.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-5" v-if="commitsOverlay.loading">
|
||||
<v-row class="pt-0">
|
||||
<v-col>
|
||||
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<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">
|
||||
<strong>System</strong><br />
|
||||
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} packages can be upgraded</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">OS-Packages</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
: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"
|
||||
><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-card-text>
|
||||
<v-card-text class="py-0" v-if="!commitsOverlay.loading" style="max-height: 400px; overflow-y: scroll;">
|
||||
<v-row>
|
||||
<v-col class="pt-3 pl-0">
|
||||
<v-timeline align-top dense >
|
||||
<v-timeline-item color="primary" small v-for="commit of commitsOverlay.outputs" v-bind:key="commit.sha">
|
||||
<v-row class="pt-0">
|
||||
<v-col>
|
||||
<a class="font-weight-bold white--text" :href="commit.url" target="_blank">{{ commit.title }}</a><br />
|
||||
<p v-if="commit.message" class="mb-0" v-html="commit.message.replace(/(?:\r\n|\r|\n)/g, '<br />')"></p>
|
||||
<div class="caption">
|
||||
<strong>{{ commit.author }}</strong> committed at {{ commit.date.toLocaleString() }}
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState } from 'vuex'
|
||||
import semver from 'semver'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -75,12 +122,16 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
commitsOverlay: {
|
||||
bool: false,
|
||||
loading: false,
|
||||
response: [],
|
||||
outputs: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
package_version: state => state.packageVersion,
|
||||
loadings: state => state.socket.loadings,
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
@@ -103,7 +154,7 @@
|
||||
if ('is_dirty' in object && object.is_dirty) return 'orange'
|
||||
if ('is_valid' in object && !object.is_valid) return 'red'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'primary'
|
||||
if ('version' in object && 'remote_version' in object && semver.gt(object.remote_version, object.version)) return 'primary'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
@@ -116,7 +167,7 @@
|
||||
if ('is_valid' in object && !object.is_valid) return 'invalid'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'dirty'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'update'
|
||||
if ('version' in object && 'remote_version' in object && semver.gt(object.remote_version, object.version)) return 'update'
|
||||
|
||||
return 'up-to-date'
|
||||
}
|
||||
@@ -129,7 +180,7 @@
|
||||
if ('is_valid' in object && !object.is_valid) return 'alert-circle'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'alert-circle'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'progress-upload'
|
||||
if ('version' in object && 'remote_version' in object && semver.gt(object.remote_version, object.version)) return 'progress-upload'
|
||||
|
||||
return 'check'
|
||||
}
|
||||
@@ -142,7 +193,7 @@
|
||||
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('is_valid' in object && !object.is_valid) return true
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return false
|
||||
if ('version' in object && 'remote_version' in object && semver.gt(object.remote_version, object.version)) return false
|
||||
}
|
||||
|
||||
return true
|
||||
@@ -151,7 +202,27 @@
|
||||
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 += semver.gt(remote_version, local_version) ? local_version+" > "+remote_version : local_version
|
||||
|
||||
return output
|
||||
},
|
||||
getVersionClickable(object) {
|
||||
return (
|
||||
'branch' in object &&
|
||||
object.branch === "master" &&
|
||||
'current_hash' in object &&
|
||||
'remote_hash' in object &&
|
||||
object.current_hash !== object.remote_hash
|
||||
)
|
||||
},
|
||||
updateModule(key) {
|
||||
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
|
||||
@@ -160,6 +231,70 @@
|
||||
updateSystem() {
|
||||
this.$socket.sendObj('machine.update.system', { })
|
||||
},
|
||||
openCommitsOverlay(key, object) {
|
||||
if (
|
||||
['klipper', 'moonraker'].includes(key) &&
|
||||
this.getVersionClickable(object)
|
||||
) {
|
||||
this.commitsOverlay.bool = true
|
||||
this.commitsOverlay.loading = true
|
||||
|
||||
let owner = ""
|
||||
switch(key) {
|
||||
case 'klipper':
|
||||
owner = "kevinOConnor"
|
||||
break
|
||||
|
||||
case 'moonraker':
|
||||
owner = "arksine"
|
||||
break
|
||||
}
|
||||
|
||||
const apiUrl = "https://api.github.com/repos/"+owner+"/"+key+"/commits"
|
||||
if (apiUrl) {
|
||||
axios
|
||||
.get(apiUrl)
|
||||
.then(response => {
|
||||
this.commitsOverlay.response = response
|
||||
this.commitsOverlay.outputs.splice(0, this.commitsOverlay.outputs.length)
|
||||
|
||||
const index = response.data.findIndex(commit => commit.sha === object.current_hash)
|
||||
if (index !== -1) {
|
||||
this.commitsOverlay.response = response.data.splice(0, index).sort((a,b) => {
|
||||
const dataA = new Date(a.commit.author.date)
|
||||
const dataB = new Date(b.commit.author.date)
|
||||
|
||||
return dataB - dataA
|
||||
})
|
||||
|
||||
this.commitsOverlay.response.forEach(commit => {
|
||||
const date = new Date(commit.commit.author.date)
|
||||
const author = commit.commit.author.name
|
||||
|
||||
const firstIndex = commit.commit.message.indexOf('\n\n')
|
||||
let lastIndex = commit.commit.message.lastIndexOf('\n\n')
|
||||
if (firstIndex === lastIndex && commit.commit.message.lastIndexOf('\r') > firstIndex) {
|
||||
lastIndex = commit.commit.message.lastIndexOf('\r')
|
||||
}
|
||||
|
||||
this.commitsOverlay.outputs.push({
|
||||
sha: commit.sha,
|
||||
date: date,
|
||||
author: author,
|
||||
url: commit.html_url,
|
||||
title: commit.commit.message.substr(0, firstIndex),
|
||||
message: (firstIndex+2 < lastIndex-2) ? commit.commit.message.substr(firstIndex+2, lastIndex-firstIndex-2) : "",
|
||||
firstIndex: firstIndex,
|
||||
lastIndex: lastIndex,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.commitsOverlay.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -12,7 +12,17 @@
|
||||
<v-card-text>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="pt-2 mb-1">
|
||||
<v-col class="py-2">
|
||||
<v-select v-model="service" :items="serviceItems" hide-details label="Service" class="mt-0"></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="service === 'mjpegstreamer-adaptive'">
|
||||
<v-col class="py-2 mt-2">
|
||||
<v-text-field v-model="targetFps" hide-details label="Target FPS" class="mt-0"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="pt-2 mt-2 mb-1">
|
||||
<v-text-field
|
||||
v-model="webcamUrl"
|
||||
hide-details
|
||||
@@ -55,7 +65,11 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
rotationEnabled: false
|
||||
rotationEnabled: false,
|
||||
serviceItems: [
|
||||
{ value: 'mjpegstreamer', text: 'MJPEG-Streamer' },
|
||||
{ value: 'mjpegstreamer-adaptive', text: 'Adaptive MJPEG-Streamer (experimental)' },
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -107,6 +121,22 @@
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { bool: showNav } });
|
||||
}
|
||||
},
|
||||
service: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.service;
|
||||
},
|
||||
set(selectedMethod) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { service: selectedMethod } });
|
||||
}
|
||||
},
|
||||
targetFps: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.targetFps;
|
||||
},
|
||||
set(fps) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { targetFps: fps } });
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -93,11 +93,11 @@
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400)
|
||||
current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400)
|
||||
">
|
||||
<img
|
||||
class="statusPanel-image-preview"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400).data : '')"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -106,7 +106,7 @@
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 col-sm-8' : 'col-12'
|
||||
current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400)) ? 'col-12 col-sm-8' : 'col-12'
|
||||
">
|
||||
<v-row class="text-center" align="center">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
@@ -172,7 +172,7 @@
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) && 'filament_total' in current_file ">
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-icon>mdi-printer-3d</v-icon>
|
||||
</v-col>
|
||||
|
||||
@@ -6,112 +6,247 @@
|
||||
.colHeaterIcons {
|
||||
width: 68px;
|
||||
}
|
||||
|
||||
.canvasjs-chart-tooltip>div {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.datasetColorSymbol {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-style: solid;
|
||||
border-width: 0px;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-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 flex-grow-0 font-weight-bold d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">Color</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 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+heater.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(heater)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><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.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></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 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+fan.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(fan)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><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.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></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 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+sensor.chartColor+'CC;'" class="datasetColorSymbol d-inline-block" @click="openHeater(sensor)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 d-none d-sm-block"><span> </span></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span
|
||||
style="cursor: default;"
|
||||
class="d-block px-0"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>{{ sensor.temperature ? 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"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></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="py-0 px-3">
|
||||
<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 +262,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 +299,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 +322,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 +343,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 && 'lineStyle' in object.chartTemperature && 'opacity' in object.chartTemperature.lineStyle ? object.chartTemperature.lineStyle.opacity : false
|
||||
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'areaStyle' in object.chartTarget && 'opacity' in object.chartTarget.areaStyle ? (object.chartTarget.areaStyle.opacity > 0) : false
|
||||
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'lineStyle' in object.chartPower && 'opacity' in object.chartPower.lineStyle ? object.chartPower.lineStyle.opacity : false
|
||||
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'lineStyle' in object.chartSpeed && 'opacity' in object.chartSpeed.lineStyle ? object.chartSpeed.lineStyle.opacity : 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 })
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -5,14 +5,17 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card v-observe-visibility="visibilityChanged">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
<span class="subheading">
|
||||
<v-icon left>mdi-webcam</v-icon> Webcam
|
||||
<small v-if="this.webcamConfig.service === 'mjpegstreamer-adaptive' && this.time">(FPS: {{ currentFPS }})</small>
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<img :src="url" class="webcamImage" :style="webcamStyle" alt="Webcam"/>
|
||||
<img :src="url" class="webcamImage" :style="webcamStyle" @load="onLoad" alt="Webcam" v-if="['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcamConfig.service)" />
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -23,12 +26,28 @@
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
refresh: Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
refresh: Math.ceil(Math.random() * Math.pow(10, 12)),
|
||||
connection: "",
|
||||
imageData: "",
|
||||
|
||||
request_start_time: performance.now(),
|
||||
start_time: performance.now(),
|
||||
time: 0,
|
||||
request_time: 0,
|
||||
time_smoothing: 0.6,
|
||||
request_time_smoothing: 0.1,
|
||||
isVisible: true,
|
||||
currentFPS: 0,
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
document.addEventListener("focus", () => this.handleRefreshChange(), false);
|
||||
document.addEventListener("visibilitychange", this.handleRefreshChange, false);
|
||||
|
||||
if(this.webcamConfig.service === 'mjpegstreamer-adaptive') {
|
||||
this.requestMjpeg()
|
||||
}
|
||||
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -37,11 +56,20 @@
|
||||
...mapState({
|
||||
'webcamConfig': state => state.gui.webcam
|
||||
}),
|
||||
|
||||
url() {
|
||||
const params = new URLSearchParams(this.webcamConfig.url);
|
||||
params.set('bypassCache', ""+this.refresh);
|
||||
return decodeURIComponent(params.toString())
|
||||
if (this.webcamConfig.service === 'mjpegstreamer' && this.webcamConfig.url.indexOf("?") !== -1) {
|
||||
let basicUrl = this.webcamConfig.url
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+this.refresh)
|
||||
return decodeURIComponent(params.toString())
|
||||
} else if (this.webcamConfig.service === 'mjpegstreamer-adaptive') {
|
||||
return this.imageData
|
||||
} else {
|
||||
return this.webcamConfig.url
|
||||
}
|
||||
},
|
||||
|
||||
webcamStyle() {
|
||||
let transforms = '';
|
||||
if (this.webcamConfig.flipX) {
|
||||
@@ -66,6 +94,47 @@
|
||||
if (!document.hidden) {
|
||||
this.refresh = Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const end_time = performance.now()
|
||||
const current_time = end_time - this.start_time
|
||||
this.time = (this.time * this.time_smoothing) + (current_time * (1.0 - this.time_smoothing))
|
||||
this.start_time = end_time
|
||||
|
||||
const target_time = 1000/this.webcamConfig.targetFps
|
||||
|
||||
const current_request_time = performance.now() - this.request_start_time
|
||||
this.request_time = (this.request_time * this.request_time_smoothing) + (current_request_time * (1.0 - this.request_time_smoothing))
|
||||
const timeout = Math.max(0, target_time - this.request_time)
|
||||
|
||||
this.$nextTick(() => {
|
||||
setTimeout(this.requestMjpeg, timeout)
|
||||
})
|
||||
},
|
||||
|
||||
requestMjpeg() {
|
||||
if(!this.isVisible) return
|
||||
|
||||
this.request_start_time = performance.now()
|
||||
let basicUrl = this.webcamConfig.url
|
||||
basicUrl = basicUrl.replace("action=stream", "action=snapshot")
|
||||
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
|
||||
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+ this.refresh + (Math.random() * 1000))
|
||||
|
||||
|
||||
this.currentFPS = Math.round(1000 / this.time)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.imageData = decodeURIComponent(params.toString())
|
||||
})
|
||||
},
|
||||
|
||||
visibilityChanged(isVisible) {
|
||||
this.isVisible = isVisible
|
||||
if(isVisible) this.requestMjpeg()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -10,15 +10,27 @@
|
||||
<v-col class="pb-1 pt-3">
|
||||
<v-subheader class="_tool-slider-subheader">
|
||||
<span>{{ label }}</span>
|
||||
<v-btn
|
||||
v-if="value !== defaultValue"
|
||||
class="ml-2"
|
||||
x-small
|
||||
icon
|
||||
@click="processedMin = min; processedMax = max; value = defaultValue; sliding = true; sendCmd()"
|
||||
>
|
||||
<v-icon>mdi-restart</v-icon>
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
<span class="font-weight-bold">
|
||||
{{ value }} {{ unit }}
|
||||
</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@change="sendCmd"
|
||||
:max="processedMax"
|
||||
@start="sliding = true"
|
||||
@end="sendCmd()"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -38,11 +50,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
@@ -81,6 +88,26 @@
|
||||
required: false,
|
||||
default: 100
|
||||
},
|
||||
dynamicRange: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dynamicDebounceTime: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 250
|
||||
},
|
||||
dynamicClamp: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => ([0, 1000])
|
||||
},
|
||||
defaultValue: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 100
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
required: false,
|
||||
@@ -90,32 +117,69 @@
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
startValue: this.target * this.multi,
|
||||
sliding: false,
|
||||
processedMin: this.min,
|
||||
processedMax: this.max,
|
||||
dynamicStep: Math.floor((this.max - this.min) / 2),
|
||||
dynamicValue: 30,
|
||||
editing: false,
|
||||
processingTimer: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.value > this.max || this.value < this.min) {
|
||||
this.processedMax = Math.ceil(this.value / this.defaultValue) * this.defaultValue;
|
||||
this.processedMin = Math.floor(this.value / this.defaultValue) * this.defaultValue - this.defaultValue;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
target: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
this.value = Math.round(newVal * this.multi);
|
||||
if (!this.dynamicRange) {
|
||||
return;
|
||||
}
|
||||
if (this.processingTimer) {
|
||||
clearTimeout(this.processingTimer);
|
||||
this.processingTimer = null;
|
||||
}
|
||||
if (this.value >= this.processedMax) {
|
||||
this.processingTimer = setTimeout(() => {
|
||||
const [min, max] = this.dynamicClamp;
|
||||
this.processedMin = Math.max(min, this.value - this.dynamicStep);
|
||||
this.processedMax = Math.min(max, this.value + this.dynamicStep);
|
||||
}, this.dynamicDebounceTime);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
sendCmd(btnPress = false) {
|
||||
if (this.sliding || btnPress) {
|
||||
let gcode = this.command + ' ' + this.attributeName + (Math.max(1, this.value) * this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', {message: gcode, type: 'command'})
|
||||
this.$socket.sendObj('printer.gcode.script', {script: gcode})
|
||||
this.sliding = false;
|
||||
}
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > this.min ? (this.value - this.step).toFixed(0) : this.min
|
||||
this.sendCmd();
|
||||
this.value = this.value > this.min ? Math.round(this.value - this.step) : this.min
|
||||
this.sendCmd(true);
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < this.max ? (this.value + this.step).toFixed(0) : this.max
|
||||
this.sendCmd();
|
||||
this.value = this.value < this.processedMax ? Math.round(this.value + this.step) : this.processedMax
|
||||
this.sendCmd(true);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal * this.multi;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -7,10 +7,12 @@ import './components'
|
||||
import store from './store'
|
||||
import router from './plugins/router'
|
||||
import vueHeadful from 'vue-headful';
|
||||
import VueObserveVisibility from 'vue-observe-visibility';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
Vue.use(VueResource);
|
||||
Vue.use(VueObserveVisibility);
|
||||
Vue.http.headers.common['Content-Type'] = 'application/json';
|
||||
Vue.http.headers.common['Access-Control-Allow-Origin'] = '*';
|
||||
Vue.http.headers.common['Accept'] = 'application/json, text/plain, */*';
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import {mapGetters, mapState} from 'vuex'
|
||||
import { Plotly } from 'vue-plotly'
|
||||
|
||||
export default {
|
||||
@@ -221,7 +221,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
config: state => state.printer.configfile.config,
|
||||
config: state => state.printer.configfile.settings,
|
||||
loadings: state => state.socket.loadings,
|
||||
}),
|
||||
|
||||
@@ -250,41 +250,32 @@
|
||||
},
|
||||
methods: {
|
||||
showBedMesh: function() {
|
||||
window.console.log("showBedMesh")
|
||||
this.data[0].x = [];
|
||||
this.data[0].y = [];
|
||||
this.data[0].z = [];
|
||||
|
||||
if (this.bed_mesh && this.bed_mesh.profile_name !== "") {
|
||||
const meshXmin = this.bed_mesh.mesh_min[0]
|
||||
const meshXmax = this.bed_mesh.mesh_max[0]
|
||||
const meshYmin = this.bed_mesh.mesh_min[1]
|
||||
const meshYmax = this.bed_mesh.mesh_max[1]
|
||||
|
||||
if ('stepper_x 'in this.config && 'stepper_y' in this.config) {
|
||||
this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max];
|
||||
this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max];
|
||||
if ('stepper_x' in this.config && 'stepper_y' in this.config) {
|
||||
this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max]
|
||||
this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max]
|
||||
} else {
|
||||
this.layout.scene.xaxis.range = [this.bed_mesh.mesh_min[0], this.bed_mesh.mesh_max[0]];
|
||||
this.layout.scene.yaxis.range = [this.bed_mesh.mesh_min[1], this.bed_mesh.mesh_max[1]];
|
||||
this.layout.scene.xaxis.range = [meshXmin, meshXmax];
|
||||
this.layout.scene.yaxis.range = [meshYmin, meshYmax];
|
||||
}
|
||||
|
||||
let x_count = 0;
|
||||
let y_count = 0;
|
||||
const meshData = this.showMeshType === "probed" ? this.bed_mesh.probed_matrix : this.bed_mesh.mesh_matrix
|
||||
const x_count = meshData[0].length;
|
||||
const y_count = meshData.length;
|
||||
this.data[0].z = meshData;
|
||||
|
||||
let min = -0.5;
|
||||
let max = 0.5;
|
||||
|
||||
if (this.showMeshType === 'probed') {
|
||||
x_count = this.bed_mesh.probed_matrix[0].length;
|
||||
y_count = this.bed_mesh.probed_matrix.length;
|
||||
this.data[0].z = this.bed_mesh.probed_matrix;
|
||||
|
||||
min = Math.min.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
max = Math.max.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
} else if (this.showMeshType === 'mesh') {
|
||||
x_count = this.bed_mesh.mesh_matrix[0].length;
|
||||
y_count = this.bed_mesh.mesh_matrix.length;
|
||||
this.data[0].z = this.bed_mesh.mesh_matrix;
|
||||
|
||||
min = Math.min.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
max = Math.max.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
}
|
||||
let min = Math.min.apply(null, meshData.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
let max = Math.max.apply(null, meshData.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
|
||||
let x_step = (this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / (x_count - 1);
|
||||
for(let i = 0; i < x_count; i++) {
|
||||
@@ -365,7 +356,7 @@
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -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) {
|
||||
@@ -47,7 +45,21 @@ export default {
|
||||
|
||||
if (payload.files && payload.files.length) {
|
||||
for (let file of payload.files) {
|
||||
if (!parent.find(element => (element.isDirectory === false && element.filename === file.filename))) {
|
||||
const existingFile = parent.find(element => (element.isDirectory === false && element.filename === file.filename))
|
||||
|
||||
if (
|
||||
existingFile && (
|
||||
existingFile.size !== file.size ||
|
||||
existingFile.modified.getTime() !== new Date(file.modified*1000).getTime()
|
||||
)
|
||||
) {
|
||||
Vue.set(existingFile, 'modified', new Date(file.modified*1000))
|
||||
Vue.set(existingFile, 'size', file.size)
|
||||
|
||||
if (existingFile.metadataPulled) {
|
||||
Vue.prototype.$socket.sendObj("server.files.metadata", { filename: payload.requestParams.path+'/'+file.filename }, "files/getMetadata")
|
||||
}
|
||||
} else if (!existingFile) {
|
||||
parent.push({
|
||||
isDirectory: false,
|
||||
filename: file.filename,
|
||||
@@ -56,24 +68,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 +112,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 +122,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 +176,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,8 +13,22 @@ export function getDefaultState() {
|
||||
boolConsole: true,
|
||||
hiddenMacros: [],
|
||||
hiddenTempChart: [],
|
||||
control: {
|
||||
feedrateXY: 100,
|
||||
stepsXY: [ 100, 10, 1 ],
|
||||
feedrateZ: 25,
|
||||
stepsZ: [ 25, 1, 0.1 ],
|
||||
},
|
||||
extruder: {
|
||||
feedamount: 25,
|
||||
feedamounts: [ 50, 25, 10, 5, 1 ],
|
||||
feedrate: 5,
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
webcam: {
|
||||
service: 'mjpegstreamer',
|
||||
targetFps: 25,
|
||||
url: "",
|
||||
rotate: false,
|
||||
rotateDegrees: 90,
|
||||
@@ -22,6 +36,14 @@ export function getDefaultState() {
|
||||
flipY: false,
|
||||
bool: false,
|
||||
},
|
||||
tempchart: {
|
||||
intervalChartUpdate: 1000,
|
||||
intervalDatasetUpdate: 1000,
|
||||
autoscale: false,
|
||||
datasetSettings: {
|
||||
|
||||
},
|
||||
},
|
||||
console: {
|
||||
hideWaitTemperatures: true,
|
||||
boolCustomFilters: false,
|
||||
|
||||
@@ -13,11 +13,11 @@ export default {
|
||||
if ("gui" in payload) payload = payload.gui
|
||||
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
if (typeof value === 'object') {
|
||||
if (typeof value === 'object' && !Array.isArray(value) && key in state) {
|
||||
Object.entries(value).forEach(([key2, value2]) => {
|
||||
Vue.set(state[key], key2, value2)
|
||||
if (key2 in state[key]) Vue.set(state[key], key2, value2)
|
||||
})
|
||||
} else Vue.set(state, key, value)
|
||||
} else if (key in state) Vue.set(state, key, value)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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/getSeries"](name),
|
||||
chartTarget: getters["tempHistory/getSeries"](name+"_target"),
|
||||
chartPower: getters["tempHistory/getSeries"](name+'_power'),
|
||||
chartSpeed: getters["tempHistory/getSeries"](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/getSeries"](nameSplit[1]),
|
||||
chartTarget: getters["tempHistory/getSeries"](nameSplit[1]+"_target"),
|
||||
chartPower: getters["tempHistory/getSeries"](nameSplit[1]+'_power'),
|
||||
chartSpeed: getters["tempHistory/getSeries"](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/getSeries"](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 = []
|
||||
|
||||
@@ -409,4 +508,4 @@ export default {
|
||||
checkConfigMacroCancel: state => {
|
||||
return Object.keys(state.configfile.config).findIndex(key => key.toLowerCase() === 'gcode_macro cancel_print') !== -1;
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -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,183 @@
|
||||
import {colorArray, colorChamber, colorHeaterBed, datasetTypes} from "@/store/variables";
|
||||
|
||||
export default {
|
||||
reset({ commit }) {
|
||||
commit('reset')
|
||||
},
|
||||
|
||||
getHistory({ commit }, payload) {
|
||||
commit('setHistory', payload);
|
||||
getHistory({ commit, state, rootGetters }, payload) {
|
||||
const now = new Date()
|
||||
const maxHistory = rootGetters['server/getConfig']('server', 'temperature_store_size') || 1200
|
||||
|
||||
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.series.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.series.filter(element =>
|
||||
'name' in element &&
|
||||
!element.name.endsWith("_target") &&
|
||||
element.name !== "heater_bed" &&
|
||||
element.name !== "chamber"
|
||||
).length];
|
||||
break;
|
||||
}
|
||||
|
||||
datasetTemperature = {
|
||||
type: "line",
|
||||
name: name,
|
||||
lineStyle: {
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
width: 2,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 0.9 : 0
|
||||
},
|
||||
symbol: 'none',
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
width: 2,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 0.9 : 0
|
||||
}
|
||||
},
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addSeries', datasetTemperature)
|
||||
} else commit('clearDataset', name)
|
||||
|
||||
commit('addValue', {
|
||||
name: name,
|
||||
value: datasets.temperatures,
|
||||
type: type,
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
|
||||
if ('targets' in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetTarget = state.series.find(element => element.name === name+"_target")
|
||||
if (datasetTarget === undefined) {
|
||||
datasetTarget = {
|
||||
type: "line",
|
||||
name: name+"_target",
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 0,
|
||||
},
|
||||
areaStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 0.1 : 0
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 0,
|
||||
},
|
||||
areaStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 0.1 : 0
|
||||
},
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addSeries', datasetTarget)
|
||||
} else commit('clearDataset', name+"_target")
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_target",
|
||||
value: datasets.targets,
|
||||
type: type,
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
|
||||
['power', 'speed'].forEach(additionalType => {
|
||||
if (additionalType+"s" in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetAdditinal = state.series.find(element => element.name === name+"_"+additionalType)
|
||||
if (datasetAdditinal === undefined) {
|
||||
datasetAdditinal = {
|
||||
type: "line",
|
||||
name: name+"_"+additionalType,
|
||||
yAxisIndex: 1,
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 1,
|
||||
type: 'dotted',
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 0.9 : 0
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 1,
|
||||
type: 'dotted',
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 0.9 : 0
|
||||
},
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addSeries', datasetAdditinal)
|
||||
} else commit('clearDataset', name+"_"+additionalType)
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_"+additionalType,
|
||||
value: datasets[additionalType+"s"],
|
||||
type: type,
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
updateDatasets({ commit, rootState, rootGetters }) {
|
||||
if (
|
||||
'heaters' in rootState.printer &&
|
||||
'available_sensors' in rootState.printer.heaters &&
|
||||
rootState.printer.heaters.available_sensors.length
|
||||
) {
|
||||
const now = new Date()
|
||||
const maxHistory = rootGetters['server/getConfig']('server', 'temperature_store_size') || 1200
|
||||
|
||||
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,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,42 @@
|
||||
export default {
|
||||
|
||||
getDatasetColor: state => (name) => {
|
||||
let dataset = state.datasets.find(element => element.name === name)
|
||||
let dataset = state.series.find(element => element.name === name)
|
||||
|
||||
return (dataset) ? dataset.color : null
|
||||
return (dataset && 'lineStyle' in dataset) ? dataset.lineStyle.color : null
|
||||
},
|
||||
|
||||
getSeries: state => (name) => {
|
||||
return state.series.find(element => element.name === name)
|
||||
},
|
||||
|
||||
getCurrentMaxTemp: state => {
|
||||
let maxTemp = 0
|
||||
|
||||
state.series.forEach(serie => {
|
||||
if (
|
||||
serie.name.lastIndexOf("_") === -1 ||
|
||||
!['power', 'speed'].includes(serie.name.substr(serie.name.lastIndexOf("_")+1))
|
||||
) {
|
||||
if (
|
||||
serie.data.length && (
|
||||
(
|
||||
'lineStyle' in serie &&
|
||||
'opacity' in serie.lineStyle &&
|
||||
serie.lineStyle.opacity
|
||||
) || (
|
||||
'areaStyle' in serie &&
|
||||
'opacity' in serie.areaStyle &&
|
||||
serie.areaStyle.opacity
|
||||
)
|
||||
)
|
||||
) {
|
||||
const max = Math.max(...serie.data.map(data => data[1]))
|
||||
if (maxTemp < max) maxTemp = max
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return Math.ceil((maxTemp + 1) / 10) * 10
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import getters from './getters'
|
||||
|
||||
export function getDefaultState() {
|
||||
return {
|
||||
datasets: [],
|
||||
series: [],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,134 +1,82 @@
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
addSeries(state, payload) {
|
||||
state.series.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
|
||||
|
||||
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) {
|
||||
const dataset = state.series.find(element => element.name === payload.name)
|
||||
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.data.push([
|
||||
payload.time - (i*1000),
|
||||
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.data.push([
|
||||
payload.time,
|
||||
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 * payload.maxHistory)
|
||||
while ((i = dataset.data.findIndex(item => timeOld > item[0])) > -1) {
|
||||
dataset.data.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearDataset(state, payload) {
|
||||
let dataset = null
|
||||
const series = state.series.find(element => element.name === payload.name)
|
||||
if (series) dataset = state.datasets[series.datasetIndex]
|
||||
|
||||
if (dataset) {
|
||||
Vue.set(dataset, 'source', [])
|
||||
}
|
||||
},
|
||||
|
||||
setVisible(state, payload) {
|
||||
const datasetName = payload.type !== 'temperature' ? payload.name+'_'+payload.type : payload.name
|
||||
|
||||
const datasetIndex = state.series.findIndex(element => element.name === datasetName)
|
||||
if (datasetIndex !== -1) {
|
||||
if (payload.type === "target" && 'areaStyle' in state.series[datasetIndex]) {
|
||||
Vue.set(state.series[datasetIndex].areaStyle, 'opacity', payload.value ? 0.1 : 0)
|
||||
} else if ('lineStyle' in state.series[datasetIndex]) {
|
||||
Vue.set(state.series[datasetIndex].lineStyle, 'opacity', payload.value ? 0.9 : 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setColor(state, payload) {
|
||||
state.series.forEach(element => {
|
||||
if (
|
||||
'lineStyle' in element && (
|
||||
element.name === payload.name ||
|
||||
element.name === payload.name+'_target' ||
|
||||
element.name === payload.name+'_power'
|
||||
)
|
||||
) element.lineStyle.color = payload.value
|
||||
|
||||
if (element.name === payload.name+'_target' && 'areaStyle' in element) {
|
||||
element.areaStyle.color = payload.value
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -7,15 +7,32 @@ export default {
|
||||
dispatch('updateManager/reset')
|
||||
},
|
||||
|
||||
init({ dispatch }) {
|
||||
init() {
|
||||
Vue.prototype.$socket.sendObj('server.info', {}, 'server/getInfo')
|
||||
Vue.prototype.$socket.sendObj('server.config', {}, 'server/getConfig')
|
||||
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) {
|
||||
Vue.prototype.$socket.sendObj('server.gcode_store', {}, 'server/getGcodeStore')
|
||||
|
||||
if (state.plugins.length === 0) {
|
||||
if (payload.plugins.includes("power") !== false)
|
||||
Vue.prototype.$socket.sendObj('machine.device_power.devices', {}, 'server/power/getDevices')
|
||||
@@ -42,11 +59,18 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
getConfig({ commit }, payload) {
|
||||
commit('setConfig', payload)
|
||||
|
||||
Vue.prototype.$socket.sendObj('server.gcode_store', {}, 'server/getGcodeStore')
|
||||
},
|
||||
|
||||
getData({ commit }, payload){
|
||||
commit('setData', payload)
|
||||
},
|
||||
|
||||
getGcodeStore({ commit }, payload) {
|
||||
commit('clearGcodeStore')
|
||||
commit('setGcodeStore', payload)
|
||||
},
|
||||
|
||||
|
||||
@@ -20,4 +20,13 @@ export default {
|
||||
|
||||
return events
|
||||
},
|
||||
|
||||
getConfig: (state) => (section, attribute) => {
|
||||
if (
|
||||
section in state.config &&
|
||||
attribute in state.config[section]
|
||||
) return state.config[section][attribute]
|
||||
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export function getDefaultState() {
|
||||
failed_plugins: [],
|
||||
registered_directories: [],
|
||||
events: [],
|
||||
config: {},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,16 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
setConfig(state, payload) {
|
||||
Object.entries(payload.config).forEach(([key, value]) => {
|
||||
Vue.set(state.config, key, value)
|
||||
})
|
||||
},
|
||||
|
||||
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':
|
||||
|
||||
@@ -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",
|
||||
]
|
||||