button.save.pure-button.button-success(:disabled="!modified",
@click="save") Save
- select.units(v-model="config.settings.units", @change="modified = true")
- option(value="METRIC") Metric
- option(value="IMPERIAL") Imperial
-
.pure-menu
ul.pure-menu-list
li.pure-menu-heading
a.pure-menu-link(href="#control") Control
+ li.pure-menu-heading
+ a.pure-menu-link(href="#settings") Settings
+
li.pure-menu-heading
a.pure-menu-link(href="#motor:0") Motors
li.pure-menu-heading
a.pure-menu-link(href="#io") I/O
- li.pure-menu-heading
- a.pure-menu-link(href="#gcode") Gcode
-
li.pure-menu-heading
a.pure-menu-link(href="#admin-general") Admin
td
tr(title="Currently active machine units")
th Units
- td {{state.imperial ? 'IMPERIAL' : 'METRIC'}}
+ td.mach_units
+ select(v-model="mach_units", :disabled="!can_mdi")
+ option(value="METRIC") METRIC
+ option(value="IMPERIAL") IMPERIAL
td
tr
th Feed
input#tab6(type="radio", name="tabs", @click="load_video")
label(for="tab6") Video
- section#content1.tab-content
- .toolbar
+ section#content1.tab-content.pure-form
+ .toolbar.pure-control-group
button.pure-button(
title="{{is_running ? 'Pause' : 'Start'}} program.",
@click="start_pause", :disabled="!state.selected")
+++ /dev/null
-//-/////////////////////////////////////////////////////////////////////////////
-//- //
-//- This file is part of the Buildbotics firmware. //
-//- //
-//- Copyright (c) 2015 - 2018, Buildbotics LLC //
-//- All rights reserved. //
-//- //
-//- This file ("the software") is free software: you can redistribute it //
-//- and/or modify it under the terms of the GNU General Public License, //
-//- version 2 as published by the Free Software Foundation. You should //
-//- have received a copy of the GNU General Public License, version 2 //
-//- along with the software. If not, see <http://www.gnu.org/licenses/>. //
-//- //
-//- The software is distributed in the hope that it will be useful, but //
-//- WITHOUT ANY WARRANTY; without even the implied warranty of //
-//- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
-//- Lesser General Public License for more details. //
-//- //
-//- You should have received a copy of the GNU Lesser General Public //
-//- License along with the software. If not, see //
-//- <http://www.gnu.org/licenses/>. //
-//- //
-//- For information regarding this software email: //
-//- "Joseph Coffland" <joseph@buildbotics.com> //
-//- //
-//-/////////////////////////////////////////////////////////////////////////////
-
-script#gcode-view-template(type="text/x-template")
- #gcode
- h1 GCode Configuration
-
- form.pure-form.pure-form-aligned
- fieldset
- templated-input(v-for="templ in template.gcode", :name="$key",
- :model.sync="config.gcode[$key]", :template="templ")
#io
h1 I/O Configuration
- h2 Switches
- form.pure-form.pure-form-aligned
+ .pure-form.pure-form-aligned
fieldset
+ h2 Switches
templated-input(v-for="templ in template.switches", :name="$key",
:model.sync="config.switches[$key]", :template="templ")
- h2 Outputs
- form.pure-form.pure-form-aligned
fieldset
+ h2 Outputs
templated-input(v-for="templ in template.outputs", :name="$key",
:model.sync="config.outputs[$key]", :template="templ")
.motor(:class="{slave: is_slave}")
h1 Motor {{index}} Configuration
- form.pure-form.pure-form-aligned
+ .pure-form.pure-form-aligned
fieldset(v-for="category in template.motors.template", :class="$key")
h2 {{$key}}
--- /dev/null
+//- All rights reserved. //
+//- //
+//- This file ("the software") is free software: you can redistribute it //
+//- and/or modify it under the terms of the GNU General Public License, //
+//- version 2 as published by the Free Software Foundation. You should //
+//- have received a copy of the GNU General Public License, version 2 //
+//- along with the software. If not, see <http://www.gnu.org/licenses/>. //
+//- //
+//- The software is distributed in the hope that it will be useful, but //
+//- WITHOUT ANY WARRANTY; without even the implied warranty of //
+//- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
+//- Lesser General Public License for more details. //
+//- //
+//- You should have received a copy of the GNU Lesser General Public //
+//- License along with the software. If not, see //
+//- <http://www.gnu.org/licenses/>. //
+//- //
+//- For information regarding this software email: //
+//- "Joseph Coffland" <joseph@buildbotics.com> //
+//- //
+//-/////////////////////////////////////////////////////////////////////////////
+
+script#settings-view-template(type="text/x-template")
+ #settings
+ h1 Settings
+
+ .pure-form.pure-form-aligned
+ fieldset
+ h2 Units
+ templated-input(name="units", :model.sync="config.settings.units",
+ :template="template.settings.units")
+
+ p
+ | Note, <tt>units</tt> sets both the machine default units and the
+ | units used in motor configuration. GCode <tt>program-start</tt>,
+ | set below, may also change the default machine units.
+
+ fieldset
+ h2 GCode
+ templated-input(v-for="templ in template.gcode", :name="$key",
+ :model.sync="config.gcode[$key]", :template="templ")
#tool
h1 Tool Configuration
- form.pure-form.pure-form-aligned
+ .pure-form.pure-form-aligned
fieldset
templated-input(v-for="templ in template.tool", :name="$key",
:model.sync="config.tool[$key]", :template="templ",
v-if="tool_type != 'DISABLED' || $key == 'tool-type'")
- div(v-if="tool_type == 'PWM SPINDLE'")
- h2 PWM Spindle
- form.pure-form.pure-form-aligned
- fieldset
- templated-input(v-for="templ in template['pwm-spindle']",
- :name="$key", :model.sync="config['pwm-spindle'][$key]",
- :template="templ")
+ fieldset(v-if="tool_type == 'PWM SPINDLE'")
+ h2 PWM Spindle
+ templated-input(v-for="templ in template['pwm-spindle']",
+ :name="$key", :model.sync="config['pwm-spindle'][$key]",
+ :template="templ")
- div(v-if="is_modbus")
- h2 Modbus Configuration
- form.pure-form.pure-form-aligned
- fieldset
- templated-input(v-for="templ in template['modbus-spindle']",
- :name="$key", :model.sync="config['modbus-spindle'][$key]",
- :template="templ", v-if="$key != 'regs'")
+ fieldset(v-if="is_modbus")
+ h2 Modbus Configuration
+ templated-input(v-for="templ in template['modbus-spindle']",
+ :name="$key", :model.sync="config['modbus-spindle'][$key]",
+ :template="templ", v-if="$key != 'regs'")
- div(v-if="tool_type == 'VFD TEST'")
- h2 Modbus Test
- form.pure-form
+ fieldset(v-if="tool_type == 'VFD TEST'")
+ h2 Modbus Test
table.modbus-regs
tr
th Address
button.pure-button(@click="write") Write
td.modbus-status {{modbus_status}}
- div.modbus-program(v-if="is_modbus && this.tool_type != 'HUANYANG VFD'")
- h2 Active Modbus Program
- form.pure-form
+ fieldset.modbus-program(
+ v-if="is_modbus && this.tool_type != 'HUANYANG VFD'")
+ h2 Active Modbus Program
table.modbus-regs.fixed-regs
tr
th Index
td.reg-addr {{get_reg_addr(reg)}}
td.reg-value {{get_reg_value(reg)}}
- button.pure-button-secondary(@click="customize") Customize
- button.pure-button-secondary(@click="clear") Clear
+ button.pure-button-secondary(@click="customize") Customize
+ button.pure-button-secondary(@click="clear") Clear
- div(v-if="tool_type == 'CUSTOM MODBUS VFD'")
- h2 Edit Modbus Program
- form.pure-form
+ fieldset(v-if="tool_type == 'CUSTOM MODBUS VFD'")
+ h2 Edit Modbus Program
table.modbus-regs
tr
th Index
'estop': {template: '#estop-template'},
'loading-view': {template: '<h1>Loading...</h1>'},
'control-view': require('./control-view'),
+ 'settings-view': require('./settings-view'),
'motor-view': require('./motor-view'),
'tool-view': require('./tool-view'),
'io-view': require('./io-view'),
- 'gcode-view': require('./gcode-view'),
'admin-general-view': require('./admin-general-view'),
'admin-network-view': require('./admin-network-view'),
'help-view': {template: '#help-view-template'},
data: function () {
return {
+ mach_units: 'METRIC',
mdi: '',
files: [],
axes: 'xyzabc',
watch: {
+ 'state.imperial': function (imperial) {
+ this.mach_units = imperial ? 'IMPERIAL' : 'METRIC';
+ },
+
+
+ mach_units: function (units) {
+ if ((units == 'METRIC') != this.metric)
+ this.send(units == 'METRIC' ? 'G21' : 'G20');
+ },
+
+
'state.line': function () {
if (this.mach_state != 'HOMING')
this.$broadcast('gcode-line', this.state.line);
computed: {
- metric: function () {return this.$root.metric()},
+ metric: function () {return !this.state.imperial},
mach_state: function () {
+++ /dev/null
-/******************************************************************************\
-
- This file is part of the Buildbotics firmware.
-
- Copyright (c) 2015 - 2018, Buildbotics LLC
- All rights reserved.
-
- This file ("the software") is free software: you can redistribute it
- and/or modify it under the terms of the GNU General Public License,
- version 2 as published by the Free Software Foundation. You should
- have received a copy of the GNU General Public License, version 2
- along with the software. If not, see <http://www.gnu.org/licenses/>.
-
- The software is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the software. If not, see
- <http://www.gnu.org/licenses/>.
-
- For information regarding this software email:
- "Joseph Coffland" <joseph@buildbotics.com>
-
-\******************************************************************************/
-
-'use strict'
-
-
-module.exports = {
- template: '#gcode-view-template',
- props: ['config', 'template'],
-
-
- events: {
- 'input-changed': function() {
- this.$dispatch('config-changed');
- return false;
- }
- }
-}
--- /dev/null
+/******************************************************************************\
+
+ This file is part of the Buildbotics firmware.
+
+ Copyright (c) 2015 - 2018, Buildbotics LLC
+ All rights reserved.
+
+ This file ("the software") is free software: you can redistribute it
+ and/or modify it under the terms of the GNU General Public License,
+ version 2 as published by the Free Software Foundation. You should
+ have received a copy of the GNU General Public License, version 2
+ along with the software. If not, see <http://www.gnu.org/licenses/>.
+
+ The software is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the software. If not, see
+ <http://www.gnu.org/licenses/>.
+
+ For information regarding this software email:
+ "Joseph Coffland" <joseph@buildbotics.com>
+
+\******************************************************************************/
+
+'use strict'
+
+
+module.exports = {
+ template: '#settings-view-template',
+ props: ['config', 'template'],
+
+
+ events: {
+ 'input-changed': function() {
+ this.$dispatch('config-changed');
+ return false;
+ }
+ }
+}
computed: {
- metric: function () {return this.$root.metric()},
+ metric: function () {return !this.$root.state.imperial},
text: function () {
self.text('%-9s' % state.get('xx', ''), 0, 0)
+ metric = not state.get('imperial', False)
+ scale = 1 if metric else 25.4
+
# Show enabled axes
row = 0
for axis in 'xyzabc':
if state.is_axis_enabled(axis):
position = state.get(axis + 'p', 0)
position += state.get('offset_' + axis, 0)
+ position /= scale
self.text('% 10.3f%s' % (position, axis.upper()), 9, row)
row += 1
row += 1
# Show tool, units, feed and speed
- units = 'INCH' if state.get('imperial', False) else 'MM'
- self.text('%2uT' % state.get('tool', 0), 6, 1)
- self.text('%-6s' % units, 0, 1)
- self.text('%8uF' % state.get('feed', 0), 0, 2)
- self.text('%8dS' % state.get('speed',0), 0, 3)
+ self.text('%2uT' % state.get('tool', 0), 6, 1)
+ self.text('%-6s' % 'MM' if metric else 'INCH', 0, 1)
+ self.text('%8uF' % (state.get('feed', 0) / scale), 0, 2)
+ self.text('%8dS' % state.get('speed', 0), 0, 3)
def _get_config(self, mdi, with_limits):
+ metric = self.ctrl.state.get('metric', True)
config = {
+ 'default-units': 'METRIC' if metric else 'IMPERIAL',
'max-vel': self._get_config_vector('vm', 1000),
'max-accel': self._get_config_vector('am', 1000000),
'max-jerk': self._get_config_vector('jm', 1000000),
self.vars = {
'line': -1,
'tool': 0,
- 'units': 'METRIC',
'feed': 0,
'speed': 0,
}
# Indirectly configure mach via calls to config()
self.ctrl.config.reload()
+ # Configure units
+ metric = self.ctrl.config.get('units') == 'METRIC'
+ self.set('metric', 1 if metric else 0)
+ self.set('imperial', 0 if metric else 1)
+
def find_motor(self, axis):
for motor in range(6):
"gcode": {
"program-start": {
"type": "text",
- "default": "(Runs at program start)\nG21 (Metric units)\nG90 (Absolute distance mode)\nG17 (Select XY plane)\n"
+ "default": "(Runs at program start)\nG90 (Absolute distance mode)\nG17 (Select XY plane)\n"
},
"tool-change": {
"type": "text",
[v-cloak]
display none
+tt
+ color #000
+ background #eee
+ padding 2px
+
.button-success:not([disabled])
background-color #1cb841
top 50%
#menu
- .save, .units
+ .save
display block
margin 0.25em 0.6em
td:nth-child(3)
text-align left
+ .mach_units
+ padding 0
+
+ select
+ width 100%
+ height 1.9em
+ background-color transparent
+ border 0
+ padding 3px
+ text-align right
+
.info:nth-of-type(2)
float left
clear left