Compare commits

..

No commits in common. "cc2b41527ae312bafd6f547321b4913105a9a09f" and "1be3c8308d544af6edb2f4bac8ae03ec21b596ec" have entirely different histories.

9 changed files with 53 additions and 2094 deletions

View File

@ -57,6 +57,4 @@ interface State {
interface Message { interface Message {
cmd? : string; cmd? : string;
state? : State; state? : State;
} }
declare function humanizeDuration(a : any, b : any) : string;

View File

@ -150,13 +150,11 @@ class Client {
this.client.onopen = this.onOpen.bind(this); this.client.onopen = this.onOpen.bind(this);
this.client.onclose = this.onClose.bind(this); this.client.onclose = this.onClose.bind(this);
this.client.onmessage = this.onMessage.bind(this); this.client.onmessage = this.onMessage.bind(this);
(document.getElementById('sequenceSelectForm') as HTMLFormElement ).reset();
this.resetForm('sequenceSelectForm'); (document.getElementById('sequenceCtrlForm') as HTMLFormElement ).reset();
this.resetForm('sequenceCtrlForm'); (document.getElementById('manualCtrlForm') as HTMLFormElement ).reset();
this.resetForm('manualCtrlForm'); (document.getElementById('exposureCtrlForm') as HTMLFormElement ).reset();
this.resetForm('exposureCtrlForm'); (document.getElementById('statisticsForm') as HTMLFormElement).reset();
this.resetForm('statisticsForm');
this.disableClass('sequenceCtrl'); this.disableClass('sequenceCtrl');
this.disableClass('manualCtrl'); this.disableClass('manualCtrl');
this.disableClass('exposureCtrl'); this.disableClass('exposureCtrl');
@ -272,32 +270,29 @@ class Client {
private setStatistics (stats : SequenceStatistics) { private setStatistics (stats : SequenceStatistics) {
if (stats !== null) { if (stats !== null) {
this.set('statsFrameTotalAvg', this.roundDigits(stats.totalFrameAvg, 2).toString()); this.set('statsFrameTotalAvg', stats.totalFrameAvg.toString());
this.set('statsFrameTotalLast', Math.round(stats.totalFrameLast).toString()); this.set('statsFrameTotalLast', stats.totalFrameLast.toString());
this.set('statsFrameTotalMargin', Math.round(stats.totalFrameMargin).toString()); this.set('statsFrameTotalMargin', stats.totalFrameMargin.toString());
this.set('statsFPS', this.roundDigits(stats.fps, 2).toString()); this.set('statsFPS', stats.fps.toString());
this.set('statsFrameLoadAvg', this.roundDigits(stats.loadAvg, 2).toString()); this.set('statsFrameLoadAvg', stats.loadAvg.toString());
this.set('statsFrameLoadMargin', Math.round(stats.loadMargin).toString()); this.set('statsFrameLoadMargin', stats.loadMargin.toString());
this.set('statsFrameOpenLast', Math.round(stats.openLast).toString()); this.set('statsFrameOpenLast', stats.openLast.toString());
this.set('statsFrameOpenAvg', this.roundDigits(stats.openAvg, 2).toString()); this.set('statsFrameOpenAvg', stats.openAvg.toString());
this.set('statsFrameOpenMargin', Math.round(stats.openMargin).toString()); this.set('statsFrameOpenMargin', stats.openMargin.toString());
this.set('statsFrameCloseLast', Math.round(stats.closeLast).toString()); this.set('statsFrameCloseLast', stats.closeLast.toString());
this.set('statsFrameCloseAvg', this.roundDigits(stats.closeAvg, 2).toString()); this.set('statsFrameCloseAvg', stats.closeAvg.toString());
this.set('statsFrameCloseMargin', Math.round(stats.closeMargin).toString()); this.set('statsFrameCloseMargin', stats.closeMargin.toString());
this.set('statsExposureLast', Math.round(stats.exposureLast).toString()); this.set('statsExposureLast', stats.exposureLast.toString());
this.set('statsExposureAvg', this.roundDigits(stats.exposureAvg, 2).toString()); this.set('statsExposureAvg', stats.exposureAvg.toString());
this.set('statsExposureMargin', Math.round(stats.exposureMargin).toString()); this.set('statsExposureMargin', stats.exposureMargin.toString());
this.set('statsElapsed', Math.round(stats.elapsed).toString()); //this.set('statsFrameTotalAvg', stats.elapsed.toString());
this.set('statsEstimate', Math.round(stats.estimate).toString()); //this.set('statsFrameTotalAvg', stats.estimate.toString());
this.set('statsElapsedHuman', this.shortenHumanize(Math.round(stats.elapsed)));
this.set('statsEstimateHuman', this.shortenHumanize(Math.round(stats.estimate)));
} }
} }
@ -476,26 +471,6 @@ class Client {
public get (id : string) { public get (id : string) {
return (document.getElementById(id) as HTMLInputElement).value; return (document.getElementById(id) as HTMLInputElement).value;
} }
private resetForm (id : string) {
(document.getElementById(id) as HTMLFormElement ).reset();
}
private shortenHumanize (val : number) : string {
const str : string = humanizeDuration(val, { round : true });
return str.replace('years', 'y').replace('year', 'y')
.replace('months', 'mo').replace('month', 'mo')
.replace('weeks', 'w').replace('week', 'w')
.replace('days', 'd').replace('day', 'd')
.replace('hours', 'h').replace('hour', 'h')
.replace('minutes', 'm').replace('minute', 'm')
.replace('seconds', 's').replace('second', 's');
}
private roundDigits (val : number, digits : number) {
const mult : number = Math.pow(10.0, digits);
return Math.round(val * mult) / mult;
}
} }
client = new Client(); client = new Client();

4
src/globals.d.ts vendored
View File

@ -57,6 +57,4 @@ interface State {
interface Message { interface Message {
cmd? : string; cmd? : string;
state? : State; state? : State;
} }
declare function humanizeDuration(a : any, b : any) : string;

View File

@ -84,20 +84,16 @@ fieldset.inline input.medium {
label { label {
width: 80px; width: 80px;
text-align: right; text-align: right;
display: inline-block; display: inline-block;
padding-right: 3px; padding-right: 3px;
}
} }
progress { progress {
width: 97vw; width: 97vw;
background-color: silver; position: absolute;
box-shadow: inset -1px -1px #fff,inset 1px 1px grey, inset -2px -2px #dfdfdf,inset 2px 2px #0a0a0a; bottom: 28px;
box-sizing: border-box; left: 0.5vw;
padding: 3px 4px;
bottom: 31px;
position: absolute;
appearance: none;
padding: 2px;
} }
button.small, button.small,
@ -122,12 +118,4 @@ input.large {
min-width: 75px; min-width: 75px;
max-width: 75px; max-width: 75px;
padding: 0 6px; padding: 0 6px;
}
button.xlarge,
input.xlarge{
width: 125px;
min-width: 125px;
max-width: 125px;
padding: 0 6px;
} }

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,4 @@ declare class Client {
removeClass(id: string, className: string): void; removeClass(id: string, className: string): void;
set(id: string, value: string): void; set(id: string, value: string): void;
get(id: string): string; get(id: string): string;
private resetForm;
private shortenHumanize;
private roundDigits;
} }

View File

@ -124,11 +124,11 @@ class Client {
this.client.onopen = this.onOpen.bind(this); this.client.onopen = this.onOpen.bind(this);
this.client.onclose = this.onClose.bind(this); this.client.onclose = this.onClose.bind(this);
this.client.onmessage = this.onMessage.bind(this); this.client.onmessage = this.onMessage.bind(this);
this.resetForm('sequenceSelectForm'); document.getElementById('sequenceSelectForm').reset();
this.resetForm('sequenceCtrlForm'); document.getElementById('sequenceCtrlForm').reset();
this.resetForm('manualCtrlForm'); document.getElementById('manualCtrlForm').reset();
this.resetForm('exposureCtrlForm'); document.getElementById('exposureCtrlForm').reset();
this.resetForm('statisticsForm'); document.getElementById('statisticsForm').reset();
this.disableClass('sequenceCtrl'); this.disableClass('sequenceCtrl');
this.disableClass('manualCtrl'); this.disableClass('manualCtrl');
this.disableClass('exposureCtrl'); this.disableClass('exposureCtrl');
@ -225,25 +225,21 @@ class Client {
} }
setStatistics(stats) { setStatistics(stats) {
if (stats !== null) { if (stats !== null) {
this.set('statsFrameTotalAvg', this.roundDigits(stats.totalFrameAvg, 2).toString()); this.set('statsFrameTotalAvg', stats.totalFrameAvg.toString());
this.set('statsFrameTotalLast', Math.round(stats.totalFrameLast).toString()); this.set('statsFrameTotalLast', stats.totalFrameLast.toString());
this.set('statsFrameTotalMargin', Math.round(stats.totalFrameMargin).toString()); this.set('statsFrameTotalMargin', stats.totalFrameMargin.toString());
this.set('statsFPS', this.roundDigits(stats.fps, 2).toString()); this.set('statsFPS', stats.fps.toString());
this.set('statsFrameLoadAvg', this.roundDigits(stats.loadAvg, 2).toString()); this.set('statsFrameLoadAvg', stats.loadAvg.toString());
this.set('statsFrameLoadMargin', Math.round(stats.loadMargin).toString()); this.set('statsFrameLoadMargin', stats.loadMargin.toString());
this.set('statsFrameOpenLast', Math.round(stats.openLast).toString()); this.set('statsFrameOpenLast', stats.openLast.toString());
this.set('statsFrameOpenAvg', this.roundDigits(stats.openAvg, 2).toString()); this.set('statsFrameOpenAvg', stats.openAvg.toString());
this.set('statsFrameOpenMargin', Math.round(stats.openMargin).toString()); this.set('statsFrameOpenMargin', stats.openMargin.toString());
this.set('statsFrameCloseLast', Math.round(stats.closeLast).toString()); this.set('statsFrameCloseLast', stats.closeLast.toString());
this.set('statsFrameCloseAvg', this.roundDigits(stats.closeAvg, 2).toString()); this.set('statsFrameCloseAvg', stats.closeAvg.toString());
this.set('statsFrameCloseMargin', Math.round(stats.closeMargin).toString()); this.set('statsFrameCloseMargin', stats.closeMargin.toString());
this.set('statsExposureLast', Math.round(stats.exposureLast).toString()); this.set('statsExposureLast', stats.exposureLast.toString());
this.set('statsExposureAvg', this.roundDigits(stats.exposureAvg, 2).toString()); this.set('statsExposureAvg', stats.exposureAvg.toString());
this.set('statsExposureMargin', Math.round(stats.exposureMargin).toString()); this.set('statsExposureMargin', stats.exposureMargin.toString());
this.set('statsElapsed', Math.round(stats.elapsed).toString());
this.set('statsEstimate', Math.round(stats.estimate).toString());
this.set('statsElapsedHuman', this.shortenHumanize(Math.round(stats.elapsed)));
this.set('statsEstimateHuman', this.shortenHumanize(Math.round(stats.estimate)));
} }
} }
cmd(msg) { cmd(msg) {
@ -399,23 +395,6 @@ class Client {
get(id) { get(id) {
return document.getElementById(id).value; return document.getElementById(id).value;
} }
resetForm(id) {
document.getElementById(id).reset();
}
shortenHumanize(val) {
const str = humanizeDuration(val, { round: true });
return str.replace('years', 'y').replace('year', 'y')
.replace('months', 'mo').replace('month', 'mo')
.replace('weeks', 'w').replace('week', 'w')
.replace('days', 'd').replace('day', 'd')
.replace('hours', 'h').replace('hour', 'h')
.replace('minutes', 'm').replace('minute', 'm')
.replace('seconds', 's').replace('second', 's');
}
roundDigits(val, digits) {
const mult = Math.pow(10.0, digits);
return Math.round(val * mult) / mult;
}
} }
client = new Client(); client = new Client();
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -179,22 +179,7 @@
</div> </div>
</div> </div>
<div id="statisticsTiming" class="quarter"> <div id="statisticsTiming" class="quarter">
<div>
<label for="statsElapsed">Elapsed</label>
<input id="statsElapsed" class="large" type="text" readonly value="0" /><span> ms</span>
</div>
<div>
<label for="statsElapsedHuman"> </label>
<input id="statsElapsedHuman" type="text" class="xlarge" readonly value="" />
</div>
<div>
<label for="statsEstimate">Remaining</label>
<input id="statsEstimate" class="large" type="text" readonly value="0" /><span> ms</span>
</div>
<div>
<label for="statsEstimateHuman"> </label>
<input id="statsEstimateHuman" type="text" class="xlarge" readonly value="" />
</div>
</div> </div>
</form> </form>
</fieldset> </fieldset>
@ -214,7 +199,6 @@
<script> <script>
const WEBSOCKET_PORT = {{wsPort}}; const WEBSOCKET_PORT = {{wsPort}};
</script> </script>
<script src="/static/js/humanize-duration.js"></script>
<script src="/static/js/index.js"></script> <script src="/static/js/index.js"></script>
</body> </body>
</html> </html>