Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
3 changed files with 31 additions and 0 deletions
Showing only changes of commit a37c58d791 - Show all commits

View File

@ -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>

View File

@ -412,3 +412,7 @@ span.pos{
body.mobile footer{ body.mobile footer{
display: block; display: block;
} }
#reset{
margin-top: 60px;
}

View File

@ -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
*/ */