Display the current loop state below the loop counter setting

This commit is contained in:
mmcw-dev 2017-12-20 17:12:45 -05:00
parent df4eeb9d14
commit 3610d842b5
4 changed files with 23 additions and 0 deletions

View File

@ -609,6 +609,12 @@ button:focus {
display: inline-block; display: inline-block;
margin-right: 5px; margin-right: 5px;
} }
#loop_current {
margin-top: 54px;
width: 121px;
text-align: center;
color: #DAE035;
}
#console { #console {
background: #000; background: #000;
border-top: 2px solid rgba(255, 255, 255, 0.3); border-top: 2px solid rgba(255, 255, 255, 0.3);

View File

@ -628,6 +628,13 @@ button{
} }
} }
#loop_current{
margin-top: 54px;
width: 121px;
text-align: center;
color: @SELECTED;
}
#console{ #console{
background: #000; background: #000;
border-top: 2px solid rgba(255, 255, 255, 0.3); border-top: 2px solid rgba(255, 255, 255, 0.3);

View File

@ -61,6 +61,7 @@
<div id="seq_loop"> <div id="seq_loop">
<h3>LOOPS</h3> <h3>LOOPS</h3>
<input type="number" min="1" id="seq_loop" value="00001" onchange="this.value = gui.fmtZero(this.value, 6); gui.grid.loopChange(this);"/> <input type="number" min="1" id="seq_loop" value="00001" onchange="this.value = gui.fmtZero(this.value, 6); gui.grid.loopChange(this);"/>
<div id="loop_current"></div>
</div> </div>
</div> </div>
<div id="script" class="screen"> <div id="script" class="screen">

View File

@ -24,6 +24,9 @@ seq.run = function () {
seq.run(); seq.run();
}, mcopy.cfg.arduino.sequenceDelay); }, mcopy.cfg.arduino.sequenceDelay);
} }
if (seq.i == 0) {
$('#loop_current').text(gui.fmtZero(mcopy.loopCount + 1, 6));
}
if (seq.stop()) { if (seq.stop()) {
$('.row input').removeClass('h'); $('.row input').removeClass('h');
$('#numbers div').removeClass('h'); $('#numbers div').removeClass('h');
@ -55,6 +58,7 @@ seq.run = function () {
} }
} else { } else {
mcopy.loopCount++; mcopy.loopCount++;
$('#loop_current').text(gui.fmtZero(mcopy.loopCount + 1, 6));
if (mcopy.loopCount < mcopy.loop) { if (mcopy.loopCount < mcopy.loop) {
log.info('Loop ' + mcopy.loopCount + ' completed', 'SEQUENCE', true); log.info('Loop ' + mcopy.loopCount + ' completed', 'SEQUENCE', true);
$('.row input').removeClass('h'); $('.row input').removeClass('h');
@ -78,6 +82,7 @@ seq.run = function () {
//clear gui //clear gui
$('.row input').removeClass('h'); $('.row input').removeClass('h');
$('#numbers div').removeClass('h'); $('#numbers div').removeClass('h');
$('#loop_current').text('');
seq.stats(); seq.stats();
} }
} }
@ -89,6 +94,10 @@ seq.stop = function (state) {
} else { } else {
seq.stopState = state; seq.stopState = state;
} }
if (state === false) {
mcopy.loopCount = 0
$('#loop_current').text('');
}
}; };
seq.init = function (start) { seq.init = function (start) {
'use strict'; 'use strict';