@@ -91,7 +91,7 @@ th.checkbox {
cloud_download {{ $tc('list.baseFileList.download', innerValue.length) }}
-
+
edit {{ $t('list.baseFileList.edit') }}
@@ -175,6 +175,7 @@ export default {
computed: {
...mapState(['selectedMachine']),
...mapGetters(['isConnected']),
+ ...mapState('machine', ['isReconnecting']),
...mapState('machine/cache', ['sorting']),
...mapState('machine/model', ['storages']),
storageIndex() {
@@ -211,6 +212,7 @@ export default {
innerValue: [],
contextMenu: {
shown: false,
+ touchTimer: undefined,
x: 0,
y: 0
},
@@ -355,20 +357,32 @@ export default {
}
return (item[prop] !== null) ? this.$displayTime(item[prop]) : this.$t('generic.noValue');
},
- itemClicked(item) {
- if (item.isDirectory) {
- this.loadDirectory(Path.combine(this.innerDirectory, item.name));
+ onItemTouchStart(props, e) {
+ const that = this;
+ this.contextMenu.touchTimer = setTimeout(function() {
+ that.contextMenu.touchTimer = undefined;
+ that.onItemContextmenu(props, { clientX: e.targetTouches[0].clientX, clientY: e.targetTouches[0].clientY });
+ }, 1000);
+ },
+ onItemTouchEnd() {
+ if (this.contextMenu.touchTimer) {
+ clearTimeout(this.contextMenu.touchTimer);
+ this.contextMenu.touchTimer = undefined;
+ }
+ },
+ onItemClick(props) {
+ if (props.item.isDirectory) {
+ this.loadDirectory(Path.combine(this.innerDirectory, props.item.name));
} else {
- this.$emit('fileClicked', item);
+ this.$emit('fileClicked', props.item);
}
},
- itemContextmenu(props, e) {
+ onItemContextmenu(props, e) {
+ this.onItemTouchEnd();
+
// Deal with selection
if (!props.selected) {
- this.innerValue = [];
- this.$nextTick(() => {
- props.selected = true;
- });
+ props.selected = true;
}
// Open the context menu
@@ -379,7 +393,7 @@ export default {
this.contextMenu.shown = true;
});
},
- dragStart(item, e) {
+ onItemDragStart(item, e) {
if (this.noDragDrop) {
return;
}
@@ -423,9 +437,10 @@ export default {
const x = e.clientX - table.getClientRects()[0].left;
const y = e.clientY - e.target.closest('tr').getClientRects()[0].top + offsetY;
e.dataTransfer.setDragImage(tableClone, x, y);
- this.$nextTick(() => tableClone.remove());
+
+ setTimeout(() => tableClone.remove(), 0);
},
- dragOver(item, e) {
+ onItemDragOver(item, e) {
if (!this.noDragDrop && item.isDirectory) {
const jsonData = e.dataTransfer.getData('application/json');
if (jsonData) {
@@ -434,20 +449,29 @@ export default {
e.preventDefault();
e.stopPropagation();
}
+ } else {
+ // Fix for Chrome: It does not grant access to dataTransfer on the same domain "for security reasons"...
+ e.preventDefault();
+ e.stopPropagation();
}
}
},
- async dragDrop(item, e) {
- const data = JSON.parse(e.dataTransfer.getData('application/json'));
- const directory = this.innerDirectory;
- for (let i = 0; i < data.items.length; i++) {
- const from = Path.combine(data.directory, data.items[i].name);
- const to = Path.combine(directory, item.name, data.items[i].name);
- try {
- await this.machineMove({ from, to });
- } catch (e) {
- this.$makeNotification('error', `Failed to move ${data.items[i].name} to ${directory}`, e.message);
- break;
+ async onItemDragDrop(item, e) {
+ const jsonData = e.dataTransfer.getData('application/json');
+ if (jsonData) {
+ const data = JSON.parse(jsonData);
+ if (data.type === 'dwcFiles' && !data.items.some(dataItem => dataItem.isDirectory && dataItem.name === item.name)) {
+ const directory = this.innerDirectory;
+ for (let i = 0; i < data.items.length; i++) {
+ const from = Path.combine(data.directory, data.items[i].name);
+ const to = Path.combine(directory, item.name, data.items[i].name);
+ try {
+ await this.machineMove({ from, to });
+ } catch (e) {
+ this.$makeNotification('error', `Failed to move ${data.items[i].name} to ${directory}`, e.message);
+ break;
+ }
+ }
}
}
},
@@ -465,14 +489,14 @@ export default {
},
async edit(item) {
try {
- const filename = Path.combine(this.innerDirectory, (item && item.name) ? item.name : this.innerValue[0].name);
- const response = await this.machineDownload({ filename, type: 'text', showSuccess: false });
let notification, showDelay = 0;
- if (response.length > bigFileThreshold) {
- notification = this.$makeNotification('warning', this.$t('notification.loading.title'), this.$t('notification.loading.message'), false);
+ if (item.size > bigFileThreshold) {
+ notification = this.$makeNotification('warning', this.$t('notification.loadingFile.title'), this.$t('notification.loadingFile.message'), false);
showDelay = 1000;
}
+ const filename = Path.combine(this.innerDirectory, item.name);
+ const response = await this.machineDownload({ filename, type: 'text', showSuccess: false });
const editDialog = this.editDialog;
setTimeout(function() {
editDialog.filename = filename;
@@ -616,8 +640,22 @@ export default {
this.unsubscribe();
},
watch: {
+ isConnected(to) {
+ if (to) {
+ this.refresh();
+ } else {
+ this.innerDirectory = this.initialDirectory;
+ this.innerFilelist = [];
+
+ this.editDialog.shown = false;
+ this.renameDialog.shown = false;
+ }
+ },
selectedMachine() {
+ // TODO store current directory per selected machine
+ this.innerDirectory = this.initialDirectory;
this.innerFilelist = [];
+
this.editDialog.shown = false;
this.renameDialog.shown = false;
},
diff --git a/src/components/lists/DisplayFileList.vue b/src/components/lists/DisplayFileList.vue
index f5cd843ae..7d91a6cd5 100644
--- a/src/components/lists/DisplayFileList.vue
+++ b/src/components/lists/DisplayFileList.vue
@@ -46,15 +46,12 @@
diff --git a/src/components/lists/EventList.vue b/src/components/lists/EventList.vue
index 1459ea04d..f710b3802 100644
--- a/src/components/lists/EventList.vue
+++ b/src/components/lists/EventList.vue
@@ -14,11 +14,20 @@ td.title-cell {
.message {
white-space: pre-wrap;
}
+
+.no-selection {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
-
+
{{ $t('list.eventLog.noEvents') }}
@@ -35,7 +44,7 @@ td.title-cell {
-
+
{{ item.date.toLocaleString() }}
|
@@ -50,7 +59,7 @@ td.title-cell {
-
+
assignment {{ $t('list.eventLog.copy') }}
@@ -85,6 +94,7 @@ export default {
return {
contextMenu: {
shown: false,
+ touchTimer: undefined,
item: null,
x: 0,
y: 0
@@ -141,7 +151,22 @@ export default {
this.pagination.descending = false;
}
},
- showContextMenu(e, item) {
+ onItemTouchStart(item, e) {
+ const that = this;
+ this.contextMenu.touchTimer = setTimeout(function() {
+ that.contextMenu.touchTimer = undefined;
+ that.onItemContextmenu(item, { clientX: e.targetTouches[0].clientX, clientY: e.targetTouches[0].clientY });
+ }, 1000);
+ },
+ onItemTouchEnd() {
+ if (this.contextMenu.touchTimer) {
+ clearTimeout(this.contextMenu.touchTimer);
+ this.contextMenu.touchTimer = undefined;
+ }
+ },
+ onItemContextmenu(item, e) {
+ this.onItemTouchEnd();
+
this.contextMenu.shown = false;
this.contextMenu.item = item;
this.contextMenu.x = e.clientX;
diff --git a/src/components/lists/FilamentFileList.vue b/src/components/lists/FilamentFileList.vue
index d29f78063..6dab51585 100644
--- a/src/components/lists/FilamentFileList.vue
+++ b/src/components/lists/FilamentFileList.vue
@@ -68,7 +68,6 @@ import Path from '../../utils/path.js'
export default {
computed: {
- ...mapState(['selectedMachine']),
...mapGetters(['uiFrozen']),
...mapState('machine/model', ['tools']),
isRootDirectory() { return this.directory === Path.filaments; },
@@ -207,11 +206,6 @@ export default {
fileClicked(item) {
this.$refs.filelist.edit(item);
}
- },
- watch: {
- selectedMachine() {
- this.directory = Path.filaments;
- }
}
}
diff --git a/src/components/lists/JobFileList.vue b/src/components/lists/JobFileList.vue
index 271609937..52def258b 100644
--- a/src/components/lists/JobFileList.vue
+++ b/src/components/lists/JobFileList.vue
@@ -25,10 +25,10 @@
-
+
play_arrow {{ $t('list.jobs.start') }}
-
+
fast_forward {{ $t('list.jobs.simulate') }}
@@ -61,10 +61,8 @@ import Path from '../../utils/path.js'
export default {
computed: {
- ...mapState(['selectedMachine']),
...mapGetters(['isConnected', 'uiFrozen']),
- ...mapState('machine', ['isReconnecting']),
- ...mapState('machine/model', ['storages']),
+ ...mapState('machine/model', ['state', 'storages']),
...mapState('settings', ['language']),
isFile() {
return (this.selection.length === 1) && !this.selection[0].isDirectory;
@@ -235,7 +233,7 @@ export default {
item.filament = null;
item.generatedBy = null;
item.printTime = null;
- item.simuatedTime = null;
+ item.simulatedTime = null;
}
});
this.requestFileInfo(directory, 0, this.filelist.length);
@@ -253,14 +251,6 @@ export default {
simulate(item) {
this.sendCode(`M37 P"${Path.combine(this.directory, (item && item.name) ? item.name : this.selection[0].name)}"`);
}
- },
- watch: {
- isReconnecting() {
- this.directory = Path.gcodes;
- },
- selectedMachine() {
- this.directory = Path.gcodes;
- }
}
}
diff --git a/src/components/lists/MacroFileList.vue b/src/components/lists/MacroFileList.vue
index 444c7e7bf..0987baa27 100644
--- a/src/components/lists/MacroFileList.vue
+++ b/src/components/lists/MacroFileList.vue
@@ -53,13 +53,12 @@
diff --git a/src/components/lists/MacroList.vue b/src/components/lists/MacroList.vue
index 51af4fd3b..97376217a 100644
--- a/src/components/lists/MacroList.vue
+++ b/src/components/lists/MacroList.vue
@@ -148,11 +148,22 @@ export default {
this.unsubscribe();
},
watch: {
+ isConnected(to) {
+ if (to) {
+ this.wasMounted = this.storages.length && this.storages[0].mounted;
+ this.loadDirectory();
+ } else {
+ this.directory = Path.macros;
+ this.filelist = [];
+ }
+ },
selectedMachine() {
+ // TODO store current directory per selected machine
if (this.isConnected) {
this.wasMounted = this.storages.length && this.storages[0].mounted;
this.loadDirectory();
} else {
+ this.directory = Path.macros;
this.filelist = [];
}
},
diff --git a/src/components/lists/SysFileList.vue b/src/components/lists/SysFileList.vue
index 1c9d5aeea..e07f6657e 100644
--- a/src/components/lists/SysFileList.vue
+++ b/src/components/lists/SysFileList.vue
@@ -53,7 +53,6 @@ import Path from '../../utils/path.js'
export default {
computed: {
- ...mapState(['selectedMachine']),
...mapState('machine/model', ['state']),
...mapGetters(['uiFrozen'])
},
@@ -91,11 +90,6 @@ export default {
// this is expected
}
}
- },
- watch: {
- selectedMachine() {
- this.directory = Path.sys;
- }
}
}
diff --git a/src/components/misc/DirectoryBreadcrumbs.vue b/src/components/misc/DirectoryBreadcrumbs.vue
index d66cc5021..9afb9689e 100644
--- a/src/components/misc/DirectoryBreadcrumbs.vue
+++ b/src/components/misc/DirectoryBreadcrumbs.vue
@@ -88,18 +88,28 @@ export default {
e.preventDefault();
e.stopPropagation();
}
+ } else {
+ // Fix for Chrome: It does not grant access to dataTransfer on the same domain "for security reasons"...
+ e.preventDefault();
+ e.stopPropagation();
}
},
async dragDrop(directory, e) {
- const data = JSON.parse(e.dataTransfer.getData('application/json'));
- for (let i = 0; i < data.items.length; i++) {
- const from = Path.combine(data.directory, data.items[i].name);
- const to = Path.combine(directory, data.items[i].name);
- try {
- await this.move({ from, to });
- } catch (e) {
- this.$log('error', this.$t('error.move', [data.items[i].name, directory]), e.message);
- break;
+ const jsonData = e.dataTransfer.getData('application/json');
+ if (jsonData) {
+ const data = JSON.parse(jsonData);
+ if (data.type === 'dwcFiles' && !data.items.some(dataItem => dataItem.isDirectory && directory === Path.combine(data.directory, dataItem.name))) {
+ const data = JSON.parse(jsonData);
+ for (let i = 0; i < data.items.length; i++) {
+ const from = Path.combine(data.directory, data.items[i].name);
+ const to = Path.combine(directory, data.items[i].name);
+ try {
+ await this.move({ from, to });
+ } catch (e) {
+ this.$log('error', this.$t('error.move', [data.items[i].name, directory]), e.message);
+ break;
+ }
+ }
}
}
}
diff --git a/src/components/panels/HeightmapPanel.vue b/src/components/panels/HeightmapPanel.vue
index aa57db410..27e3ac3f3 100644
--- a/src/components/panels/HeightmapPanel.vue
+++ b/src/components/panels/HeightmapPanel.vue
@@ -165,7 +165,9 @@ export default {
minDiff: undefined,
maxDiff: undefined,
meanError: undefined,
- rmsError: undefined
+ rmsError: undefined,
+
+ unsubscribe: undefined
}
},
methods: {
@@ -217,7 +219,8 @@ export default {
showCSV(csvData) {
// Load the CSV. The first line is a comment that can be removed
const csv = new CSV(csvData.substr(csvData.indexOf("\n") + 1));
- const radius = parseFloat(csv.get('radius'));
+ let radius = parseFloat(csv.get('radius'));
+ if (radius <= 0) { radius = undefined; }
const xMin = parseFloat(csv.get('xmin'));
const yMin = parseFloat(csv.get('ymin'));
let xSpacing = parseFloat(csv.get('xspacing'));
@@ -419,10 +422,19 @@ export default {
this.isActive = false;
},
mounted() {
+ const getHeightmap = this.getHeightmap;
+ this.unsubscribe = this.$store.subscribeAction(function(action) {
+ if (action.type.endsWith('onCodeCompleted') && action.payload.reply.indexOf('heightmap.csv') !== -1) {
+ getHeightmap();
+ }
+ });
+
// FIXME give the grid some time to resize everything...
setTimeout(this.init, 100);
},
beforeDestroy() {
+ this.unsubscribe();
+
threeInstances = threeInstances.filter(item => item !== this);
if (this.three.renderer) {
this.three.renderer.forceContextLoss();
diff --git a/src/components/panels/JobControlPanel.vue b/src/components/panels/JobControlPanel.vue
index 0954f8e0b..5ccf95f98 100644
--- a/src/components/panels/JobControlPanel.vue
+++ b/src/components/panels/JobControlPanel.vue
@@ -1,6 +1,6 @@
-
+
build {{ $t('panel.jobControl.caption') }}
diff --git a/src/components/panels/JobDataPanel.vue b/src/components/panels/JobDataPanel.vue
index 81c2316da..cc9babc8d 100644
--- a/src/components/panels/JobDataPanel.vue
+++ b/src/components/panels/JobDataPanel.vue
@@ -9,10 +9,10 @@
- {{ $t('panel.jobData.warmUpTime') }}
+ {{ $t('panel.jobData.warmUpDuration') }}
- {{ $displayTime(job.warmUpTime) }}
+ {{ $displayTime(job.warmUpDuration) }}
diff --git a/src/components/panels/JobEstimationsPanel.vue b/src/components/panels/JobEstimationsPanel.vue
index b98ee86a8..476fc8a8f 100644
--- a/src/components/panels/JobEstimationsPanel.vue
+++ b/src/components/panels/JobEstimationsPanel.vue
@@ -36,13 +36,23 @@
-
+
+
+
+ {{ $t('panel.jobEstimations.slicer') }}
+
+
+ {{ $displayTime(state.isPrinting ? Math.max(0, job.file.printTime - job.duration) : job.file.printTime) }}
+
+
+
+
{{ $t('panel.jobEstimations.simulation') }}
- {{ $displayTime(Math.max(0, totalTime - job.duration)) }}
+ {{ $displayTime(state.isPrinting ? Math.max(0, job.file.simulatedTime - job.duration) : job.file.simulatedTime) }}
@@ -57,12 +67,6 @@
import { mapState } from 'vuex'
export default {
- computed: {
- ...mapState('machine/model', ['job']),
- totalTime() {
- // Simulated times are usually more accurate than the slicers' print time estmations
- return this.job.file.simulatedTime ? this.job.file.simulatedTime : this.job.file.printTime;
- }
- }
+ computed: mapState('machine/model', ['job', 'state'])
}
diff --git a/src/components/panels/SettingsAboutPanel.vue b/src/components/panels/SettingsAboutPanel.vue
index 1bfc21b61..0b83d267b 100644
--- a/src/components/panels/SettingsAboutPanel.vue
+++ b/src/components/panels/SettingsAboutPanel.vue
@@ -1,7 +1,7 @@
- Duet Web Control 2.0.0-RC5
+ Duet Web Control 2.0.0-RC6
star GitHub
diff --git a/src/components/panels/ToolsPanel.vue b/src/components/panels/ToolsPanel.vue
index f8fb51e46..8762a9516 100644
--- a/src/components/panels/ToolsPanel.vue
+++ b/src/components/panels/ToolsPanel.vue
@@ -67,7 +67,7 @@ table.extra tr > td:first-child {
-
+
{{ tool.name || $t('panel.tools.tool', [tool.number]) }}
@@ -318,7 +318,7 @@ export default {
return !this.uiFrozen && this.heat.heaters.some(heater => heater.state);
},
selectedToolClass() {
- return this.darkTheme ? 'grey darken-3' : 'grey lighten-4';
+ return this.darkTheme ? 'grey darken-3' : 'blue lighten-5';
}
},
data() {
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 39386bd23..6165ca386 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -204,7 +204,6 @@ export default {
invalidPassword: 'Invalid password!',
noFreeSession: 'No more free sessions!',
connect: 'Failed to connect to {0}',
- connectionError: 'Failed to maintain connection to {0}',
disconnect: 'Could not disconnect cleanly from {0}',
disconnected: 'Could not complete action because the connection has been terminated',
cancelled: 'Operation has been cancelled',
@@ -228,6 +227,14 @@ export default {
filamentsLoadFailed: 'Failed to load filaments',
move: 'Failed to move {0} to {1}'
},
+ events: {
+ connected: 'Connected to {0}',
+ connectionLost: 'Failed to maintain connection to {0}',
+ emergencyStop: 'Emergency stop, attemping to reconnect...',
+ reconnecting: 'Connection interrupted, attempting to reconnect...',
+ reconnected: 'Connection established',
+ disconnected: 'Disconnected from {0}'
+ },
generic: {
ok: 'OK',
cancel: 'Cancel',
@@ -378,7 +385,6 @@ export default {
message: 'Please stand by while your files are being compressed...',
errorTitle: 'Failed to compress files'
},
- connected: 'Connected to {0}',
delete: {
errorTitle: 'Failed to delete {0}',
errorMessageDirectory: 'Please make sure that this directory is empty',
@@ -390,7 +396,6 @@ export default {
errorStillLoaded: 'At least one of the selected filaments is still loaded. Please unload them before you proceed',
errorSubDirectories: 'The filament {0} contains sub-directories. Please delete them manually and try again.'
},
- disconnected: 'Disconnected from {0}',
download: {
title: 'Downloading {0} @ {1}, {2}% complete',
message: 'Please stand by while the file is being downloaded...',
@@ -399,7 +404,7 @@ export default {
error: 'Failed to download {0}'
},
loadingFile: {
- title: 'Loading file',
+ title: 'Loading file...',
message: 'This file is relatively big so it may take a while before it is displayed.'
},
message: 'Message',
@@ -508,7 +513,7 @@ export default {
},
jobData: {
caption: 'Collected Data',
- warmUpTime: 'Warm-Up Time',
+ warmUpDuration: 'Warm-Up Time',
currentLayerTime: 'Current Layer Time',
lastLayerTime: 'Last Layer Time',
jobDuration: 'Job Duration'
@@ -518,6 +523,7 @@ export default {
filament: 'Based on Filament Usage',
file: 'Based on File Progress',
layer: 'Based on Layer Time',
+ slicer: 'Based on Slicer',
simulation: 'Based on Simulation'
},
jobInfo: {
diff --git a/src/main.js b/src/main.js
index 3d9692287..f75f7ca6f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -13,7 +13,6 @@ import router from './routes'
import store from './store'
Vue.config.productionTip = false
-window.Vue = Vue
Vue.use(plugins)
Vue.use(Vuetify, {
diff --git a/src/plugins/display.js b/src/plugins/display.js
index 33d253972..6deff80b5 100644
--- a/src/plugins/display.js
+++ b/src/plugins/display.js
@@ -71,7 +71,7 @@ export function displaySpeed(bytesPerSecond) {
}
export function displayTime(value, showTrailingZeroes = false) {
- if (isNaN(value)) {
+ if (value === null || isNaN(value)) {
return i18n.t('generic.noValue');
}
diff --git a/src/store/index.js b/src/store/index.js
index 1e5038787..7866f7140 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -39,7 +39,7 @@ const store = new Vuex.Store({
},
actions: {
// Connect to the given hostname using the specified credentials
- async connect({ state, commit, dispatch }, { hostname, username = defaultUsername, password = defaultPassword } = { hostname: location.host, username: defaultUsername, password: defaultPassword }) {
+ async connect({ state, commit, dispatch }, { hostname = location.host, username = defaultUsername, password = defaultPassword } = {}) {
if (!hostname || hostname === defaultMachine) {
throw new Error('Invalid hostname');
}
@@ -58,7 +58,7 @@ const store = new Vuex.Store({
connectorInstance.register(moduleInstance);
commit('setSelectedMachine', hostname);
- logGlobal('success', i18n.t('notification.connected', [hostname]));
+ logGlobal('success', i18n.t('events.connected', [hostname]));
if (state.isLocal) {
commit('settings/setLastHostname', hostname);
@@ -77,7 +77,7 @@ const store = new Vuex.Store({
},
// Disconnect from the given hostname
- async disconnect({ state, commit, dispatch }, { hostname, doDisconnect = true } = { hostname: state.selectedMachine, doDisconnect: true }) {
+ async disconnect({ state, commit, dispatch }, { hostname = state.selectedMachine, doDisconnect = true } = {}) {
if (!hostname || hostname === defaultMachine) {
throw new Error('Invalid hostname');
}
@@ -92,7 +92,7 @@ const store = new Vuex.Store({
commit('setDisconnecting', true);
try {
await dispatch(`machines/${hostname}/disconnect`);
- logGlobal('success', i18n.t('notification.disconnected', [hostname]));
+ logGlobal('success', i18n.t('events.disconnected', [hostname]));
// Disconnecting must always work - even if it does not always happen cleanly
} catch (e) {
logGlobal('warning', i18n.t('error.disconnect', [hostname]), e.message);
@@ -120,13 +120,15 @@ const store = new Vuex.Store({
// Called when a machine cannot stay connected
async onConnectionError({ state, dispatch, commit }, { hostname, error }) {
- logGlobal('error', i18n.t('error.connectionError', [hostname]), error.message);
if (error instanceof InvalidPasswordError) {
+ logGlobal('error', i18n.t('events.connectionLost', [hostname]), error.message);
await dispatch('disconnect', { hostname, doDisconnect: false });
commit('askForPassword');
} else if (state.isLocal) {
+ logGlobal('error', i18n.t('events.connectionLost', [hostname]), error.message);
await dispatch('disconnect', { hostname, doDisconnect: false });
} else {
+ logGlobal('warning', i18n.t('events.reconnecting', [hostname]), error.message);
dispatch(`machines/${hostname}/reconnect`);
}
}
diff --git a/src/store/machine/connector/PollConnector.js b/src/store/machine/connector/PollConnector.js
index 761066eae..44c07486f 100644
--- a/src/store/machine/connector/PollConnector.js
+++ b/src/store/machine/connector/PollConnector.js
@@ -414,16 +414,31 @@ export default class PollConnector extends BaseConnector {
newData.job = {
file: {},
filePosition: response.data.filePosition,
- extrudedRaw: response.data.extrRaw,
- duration: response.data.printDuration,
- layer: response.data.currentLayer,
- layerTime: response.data.currentLayerTime,
- warmUpDuration: response.data.warmUpDuration,
- timesLeft: {
- file: response.data.timesLeft.file,
- filament: response.data.timesLeft.filament,
- layer: response.data.timesLeft.layer
- }
+ extrudedRaw: response.data.extrRaw
+ }
+
+ // Update some stats only if the print is still live
+ if (isPrinting) {
+ quickPatch(newData.job, {
+ duration: response.data.printDuration,
+ layer: response.data.currentLayer,
+ layerTime: response.data.currentLayerTime,
+ warmUpDuration: response.data.warmUpDuration,
+ timesLeft: {
+ file: response.data.timesLeft.file,
+ filament: response.data.timesLeft.filament,
+ layer: response.data.timesLeft.layer
+ }
+ });
+ } else {
+ quickPatch(newData.job, {
+ layerTime: null,
+ timesLeft: {
+ file: null,
+ filament: null,
+ layer: null
+ }
+ });
}
// See if we need to record more layer stats
diff --git a/src/store/machine/index.js b/src/store/machine/index.js
index 97b265933..3c7023176 100644
--- a/src/store/machine/index.js
+++ b/src/store/machine/index.js
@@ -187,9 +187,17 @@ export default function(hostname, connector) {
// Is an update or emergency reset in progress?
const reconnect = (state.model.state.status === 'updating') || (state.model.state.status === 'halted');
if (reconnect) {
- commit('setReconnecting', true);
+ if (!state.isReconnecting) {
+ if (state.model.state.status === 'halted') {
+ log('warning', i18n.t('events.emergencyStop'));
+ } else {
+ log('warning', i18n.t('events.reconnecting'));
+ }
+ commit('setReconnecting', true);
+ }
} else {
if (state.isReconnecting) {
+ log('success', i18n.t('events.reconnected'));
commit('setReconnecting', false);
}
diff --git a/src/store/machine/model.js b/src/store/machine/model.js
index 15f7473d9..e05a60842 100644
--- a/src/store/machine/model.js
+++ b/src/store/machine/model.js
@@ -233,17 +233,6 @@ export default function(connector) {
} else if (wasPrinting) {
state.state.isSimulating = false;
- for (let key in state.job) {
- if (!(state.job[key] instanceof Array)) {
- if (state.job[key] instanceof Object) {
- for (let subkey in state.job[key]) {
- state.job[key][subkey] = null;
- }
- } else {
- state.job[key] = null;
- }
- }
- }
state.job.lastFileName = lastJobFile;
state.job.lastFileSimulated = wasSimulating;
}
diff --git a/src/utils/colors.js b/src/utils/colors.js
index f278cfa58..600b3583c 100644
--- a/src/utils/colors.js
+++ b/src/utils/colors.js
@@ -9,12 +9,12 @@ const heaterColors = [
'lime',
'black',
'purple',
+ 'yellow',
'teal',
'brown',
'deep-orange',
'pink',
- 'blue-grey',
- 'yellow'
+ 'blue-grey'
]
export function getHeaterColor(heater) {
| |