a.pure-menu-link(href="#spindle") Spindle
li.pure-menu-heading
- a.pure-menu-link(href="#switches") Switches
+ a.pure-menu-link(href="#io") I/O
li.pure-menu-heading
a.pure-menu-link(href="#gcode") Gcode
--- /dev/null
+script#io-view-template(type="text/x-template")
+ #io
+ h1 I/O Configuration
+
+ h2 Switches
+ form.pure-form.pure-form-aligned
+ fieldset
+ templated-input(v-for="templ in template.switches", :name="$key",
+ :model.sync="switches[$key]", :template="templ")
+
+ h2 Outputs
+ form.pure-form.pure-form-aligned
+ fieldset
+ templated-input(v-for="templ in template.outputs", :name="$key",
+ :model.sync="outputs[$key]", :template="templ")
+++ /dev/null
-script#switches-view-template(type="text/x-template")
- #switches
- h1 Switch Configuration
-
- form.pure-form.pure-form-aligned
- fieldset
- templated-input(v-for="templ in template.switches", :name="$key",
- :model.sync="switches[$key]", :template="templ")
'control-view': require('./control-view'),
'motor-view': require('./motor-view'),
'spindle-view': require('./spindle-view'),
- 'switches-view': require('./switches-view'),
+ 'io-view': require('./io-view'),
'gcode-view': require('./gcode-view'),
'admin-view': require('./admin-view')
},
--- /dev/null
+'use strict'
+
+
+module.exports = {
+ template: '#io-view-template',
+ props: ['config', 'template'],
+
+
+ data: function () {
+ return {
+ switches: {},
+ outputs: {}
+ }
+ },
+
+
+ events: {
+ 'input-changed': function() {
+ this.$dispatch('config-changed');
+ return false;
+ }
+ },
+
+
+ ready: function () {this.update()},
+
+
+ methods: {
+ update: function () {
+ Vue.nextTick(function () {
+ // Switches
+ if (this.config.hasOwnProperty('switches'))
+ this.switches = this.config.switches;
+ else this.switches = {};
+
+ var template = this.template.switches;
+ for (var key in template)
+ if (!this.switches.hasOwnProperty(key))
+ this.$set('switches["' + key + '"]', template[key].default);
+
+ // Outputs
+ if (this.config.hasOwnProperty('outputs'))
+ this.outputs = this.config.outputs;
+ else this.outputs = {};
+
+ var template = this.template.outputs;
+ for (var key in template)
+ if (!this.outputs.hasOwnProperty(key))
+ this.$set('outputs["' + key + '"]', template[key].default);
+ }.bind(this));
+ }
+ }
+}
+++ /dev/null
-'use strict'
-
-
-module.exports = {
- template: '#switches-view-template',
- props: ['config', 'template'],
-
-
- data: function () {
- return {
- switches: {}
- }
- },
-
-
- events: {
- 'input-changed': function() {
- this.$dispatch('config-changed');
- return false;
- }
- },
-
-
- ready: function () {
- this.update();
- },
-
-
- methods: {
- update: function () {
- Vue.nextTick(function () {
- if (this.config.hasOwnProperty('switches'))
- this.switches = this.config.switches;
- else this.switches = {};
-
- var template = this.template.switches;
- for (var key in template)
- if (!this.switches.hasOwnProperty(key))
- this.$set('switches["' + key + '"]', template[key].default);
- }.bind(this));
- }
- }
-}
{"axis": "A"},
],
"switches": {},
+ "outputs": {},
"spindle": {},
+ "gcode": {},
}
try:
config = self.load_path('config.json')
config['version'] = self.version
+
+ # Add missing sections
+ for key, value in default_config.items():
+ if not key in config: config[key] = value
+
return config
except Exception as e:
"estop": {
"type": "enum",
"values": ["disabled", "normally-open", "normally-closed"],
- "default": "disabled",
+ "default": "normally-open",
"code": "et"
},
"probe": {
"type": "enum",
"values": ["disabled", "normally-open", "normally-closed"],
- "default": "disabled",
+ "default": "normally-open",
"code": "pt"
}
},
+ "outputs": {
+ "load-1": {
+ "type": "enum",
+ "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
+ "hi-tri"],
+ "default": "lo-hi",
+ "code": "1om"
+ },
+ "load-2": {
+ "type": "enum",
+ "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
+ "hi-tri"],
+ "default": "lo-hi",
+ "code": "2om"
+ },
+ "fault": {
+ "type": "enum",
+ "values": ["disabled", "lo-hi", "hi-lo", "tri-lo", "tri-hi", "lo-tri",
+ "hi-tri"],
+ "default": "lo-hi",
+ "code": "fom"
+ }
+ },
+
"gcode": {
"preamble": {
"type": "text",
50%
fill #ff9d00
-.estop
+.header-content .estop
width 130px
transition 250ms