Add a reset feature to mobile app which allows the device to be reset to the default settings (direction forward, exposure 630 and delay 0).
This commit is contained in:
parent
42580c46b9
commit
a37c58d791
|
@ -80,6 +80,12 @@
|
||||||
<button id="wifi" class="" onclick="mobile.setWifi();">CONNECT</button>
|
<button id="wifi" class="" onclick="mobile.setWifi();">CONNECT</button>
|
||||||
<button id="wifiRefresh" class="" onclick="mobile.getWifi();">REFRESH WIFI</button>
|
<button id="wifiRefresh" class="" onclick="mobile.getWifi();">REFRESH WIFI</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ble">
|
||||||
|
<br />
|
||||||
|
<button id="reset" onclick="mobile.reset();">RESET</button>
|
||||||
|
<button id="restart" onclick="mobile.restart();">RESTART</button>
|
||||||
|
<button id="update" onclick="mobile.update();">UPDATE</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--<div id="mscript" class="page">
|
<!--<div id="mscript" class="page">
|
||||||
<h2>MSCRIPT</h2>
|
<h2>MSCRIPT</h2>
|
||||||
|
|
|
@ -412,3 +412,7 @@ span.pos{
|
||||||
body.mobile footer{
|
body.mobile footer{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#reset{
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
|
@ -289,9 +289,11 @@ mobile.sequence = function () {
|
||||||
stringToBytes(JSON.stringify(opts)), //check length?
|
stringToBytes(JSON.stringify(opts)), //check length?
|
||||||
mobile.sequenceSuccess,
|
mobile.sequenceSuccess,
|
||||||
mobile.ble.onError);
|
mobile.ble.onError);
|
||||||
|
|
||||||
if (!elem.classList.contains('focus')) {
|
if (!elem.classList.contains('focus')) {
|
||||||
elem.classList.add('focus');
|
elem.classList.add('focus');
|
||||||
}
|
}
|
||||||
|
|
||||||
mobile.ble.active = true;
|
mobile.ble.active = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -596,6 +598,25 @@ mobile.EV = function (fstop, shutter) {
|
||||||
return Math.log(square / sec);
|
return Math.log(square / sec);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mobile.reset = function () {
|
||||||
|
const reset = confirm(`Reset INTVAL3 to default settings?`);
|
||||||
|
if (!reset) return false;
|
||||||
|
let opts = {
|
||||||
|
type : 'reset'
|
||||||
|
};
|
||||||
|
ble.write(mobile.ble.device.id,
|
||||||
|
mobile.ble.SERVICE_ID,
|
||||||
|
mobile.ble.CHAR_ID,
|
||||||
|
stringToBytes(JSON.stringify(opts)),
|
||||||
|
mobile.resetSuccess,
|
||||||
|
mobile.ble.onError);
|
||||||
|
};
|
||||||
|
|
||||||
|
mobile.resetSuccess = function () {
|
||||||
|
console.log('Reset to default settings');
|
||||||
|
mobile.getState();
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mobile helper functions
|
* Mobile helper functions
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue