mirror of
https://github.com/0x1d/esp8266-laser.git
synced 2025-12-14 18:15:22 +01:00
fix motor numbers and parameter order
This commit is contained in:
@@ -96,11 +96,11 @@
|
||||
<label>L</label>
|
||||
<input type="range" class="laser slider" value="0" max="128">
|
||||
<label>M1</label>
|
||||
<input type="range" class="motor slider" value="0" max="128" data-motor-nr="0">
|
||||
<label>M2</label>
|
||||
<input type="range" class="motor slider" value="0" max="128" data-motor-nr="1">
|
||||
<label>M3</label>
|
||||
<label>M2</label>
|
||||
<input type="range" class="motor slider" value="0" max="128" data-motor-nr="2">
|
||||
<label>M3</label>
|
||||
<input type="range" class="motor slider" value="0" max="128" data-motor-nr="3">
|
||||
</div>
|
||||
<div id="prototypControls">
|
||||
<text class="sectionDesc">last uri:</text>
|
||||
|
||||
@@ -99,15 +99,13 @@ var $ = function(selector){
|
||||
let update = function(endpoint, method, props) {
|
||||
Sui.http.ajax({
|
||||
method: method,
|
||||
endpoint: node.api[endpoint] + props.join('/'),
|
||||
endpoint: node.api[endpoint] + (props ? props.join('/') : ''),
|
||||
cache: false
|
||||
}, actuator.onResponse || null);
|
||||
};
|
||||
Sui.select(actuator.selector).forEach( (domEl) =>{
|
||||
let handle = function(event) {
|
||||
data = [this.value];
|
||||
actuator.data ? data.push(actuator.data.call(this)) : undefined;
|
||||
update.call(this, actuator.api, 'GET', data);
|
||||
update.call(this, actuator.api, 'GET', actuator.data ? actuator.data.call(this) : undefined );
|
||||
}
|
||||
$(domEl).on(actuator.event, handle)
|
||||
});
|
||||
@@ -167,7 +165,7 @@ var $ = function(selector){
|
||||
selector: '.motor.slider',
|
||||
event: 'change',
|
||||
data: function(){
|
||||
return this.getAttribute('data-motor-nr');
|
||||
return [this.getAttribute('data-motor-nr'), this.value];
|
||||
},
|
||||
onResponse: debugResponse
|
||||
}, {
|
||||
@@ -175,6 +173,9 @@ var $ = function(selector){
|
||||
method: 'GET',
|
||||
selector: '.laser.slider',
|
||||
event: 'change',
|
||||
data: function(){
|
||||
return [this.value];
|
||||
},
|
||||
onResponse: debugResponse
|
||||
}].forEach(Sui.link({
|
||||
api: {
|
||||
|
||||
Reference in New Issue
Block a user