Compare commits

..

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

9 changed files with 53 additions and 2094 deletions

View File

@ -58,5 +58,3 @@ interface Message {
cmd? : string;
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.onclose = this.onClose.bind(this);
this.client.onmessage = this.onMessage.bind(this);
this.resetForm('sequenceSelectForm');
this.resetForm('sequenceCtrlForm');
this.resetForm('manualCtrlForm');
this.resetForm('exposureCtrlForm');
this.resetForm('statisticsForm');
(document.getElementById('sequenceSelectForm') as HTMLFormElement ).reset();
(document.getElementById('sequenceCtrlForm') as HTMLFormElement ).reset();
(document.getElementById('manualCtrlForm') as HTMLFormElement ).reset();
(document.getElementById('exposureCtrlForm') as HTMLFormElement ).reset();
(document.getElementById('statisticsForm') as HTMLFormElement).reset();
this.disableClass('sequenceCtrl');
this.disableClass('manualCtrl');
this.disableClass('exposureCtrl');
@ -272,32 +270,29 @@ class Client {
private setStatistics (stats : SequenceStatistics) {
if (stats !== null) {
this.set('statsFrameTotalAvg', this.roundDigits(stats.totalFrameAvg, 2).toString());
this.set('statsFrameTotalLast', Math.round(stats.totalFrameLast).toString());
this.set('statsFrameTotalMargin', Math.round(stats.totalFrameMargin).toString());
this.set('statsFrameTotalAvg', stats.totalFrameAvg.toString());
this.set('statsFrameTotalLast', stats.totalFrameLast.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('statsFrameLoadMargin', Math.round(stats.loadMargin).toString());
this.set('statsFrameLoadAvg', stats.loadAvg.toString());
this.set('statsFrameLoadMargin', stats.loadMargin.toString());
this.set('statsFrameOpenLast', Math.round(stats.openLast).toString());
this.set('statsFrameOpenAvg', this.roundDigits(stats.openAvg, 2).toString());
this.set('statsFrameOpenMargin', Math.round(stats.openMargin).toString());
this.set('statsFrameOpenLast', stats.openLast.toString());
this.set('statsFrameOpenAvg', stats.openAvg.toString());
this.set('statsFrameOpenMargin', stats.openMargin.toString());
this.set('statsFrameCloseLast', Math.round(stats.closeLast).toString());
this.set('statsFrameCloseAvg', this.roundDigits(stats.closeAvg, 2).toString());
this.set('statsFrameCloseMargin', Math.round(stats.closeMargin).toString());
this.set('statsFrameCloseLast', stats.closeLast.toString());
this.set('statsFrameCloseAvg', stats.closeAvg.toString());
this.set('statsFrameCloseMargin', stats.closeMargin.toString());
this.set('statsExposureLast', Math.round(stats.exposureLast).toString());
this.set('statsExposureAvg', this.roundDigits(stats.exposureAvg, 2).toString());
this.set('statsExposureMargin', Math.round(stats.exposureMargin).toString());
this.set('statsExposureLast', stats.exposureLast.toString());
this.set('statsExposureAvg', stats.exposureAvg.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)));
//this.set('statsFrameTotalAvg', stats.elapsed.toString());
//this.set('statsFrameTotalAvg', stats.estimate.toString());
}
}
@ -476,26 +471,6 @@ class Client {
public get (id : string) {
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();

2
src/globals.d.ts vendored
View File

@ -58,5 +58,3 @@ interface Message {
cmd? : string;
state? : State;
}
declare function humanizeDuration(a : any, b : any) : string;

View File

@ -84,20 +84,16 @@ fieldset.inline input.medium {
label {
width: 80px;
text-align: right;
display: inline-block;
display: inline-block;
padding-right: 3px;
}
}
progress {
width: 97vw;
background-color: silver;
box-shadow: inset -1px -1px #fff,inset 1px 1px grey, inset -2px -2px #dfdfdf,inset 2px 2px #0a0a0a;
box-sizing: border-box;
padding: 3px 4px;
bottom: 31px;
position: absolute;
appearance: none;
padding: 2px;
bottom: 28px;
left: 0.5vw;
}
button.small,
@ -123,11 +119,3 @@ input.large {
max-width: 75px;
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;
set(id: string, value: string): void;
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.onclose = this.onClose.bind(this);
this.client.onmessage = this.onMessage.bind(this);
this.resetForm('sequenceSelectForm');
this.resetForm('sequenceCtrlForm');
this.resetForm('manualCtrlForm');
this.resetForm('exposureCtrlForm');
this.resetForm('statisticsForm');
document.getElementById('sequenceSelectForm').reset();
document.getElementById('sequenceCtrlForm').reset();
document.getElementById('manualCtrlForm').reset();
document.getElementById('exposureCtrlForm').reset();
document.getElementById('statisticsForm').reset();
this.disableClass('sequenceCtrl');
this.disableClass('manualCtrl');
this.disableClass('exposureCtrl');
@ -225,25 +225,21 @@ class Client {
}
setStatistics(stats) {
if (stats !== null) {
this.set('statsFrameTotalAvg', this.roundDigits(stats.totalFrameAvg, 2).toString());
this.set('statsFrameTotalLast', Math.round(stats.totalFrameLast).toString());
this.set('statsFrameTotalMargin', Math.round(stats.totalFrameMargin).toString());
this.set('statsFPS', this.roundDigits(stats.fps, 2).toString());
this.set('statsFrameLoadAvg', this.roundDigits(stats.loadAvg, 2).toString());
this.set('statsFrameLoadMargin', Math.round(stats.loadMargin).toString());
this.set('statsFrameOpenLast', Math.round(stats.openLast).toString());
this.set('statsFrameOpenAvg', this.roundDigits(stats.openAvg, 2).toString());
this.set('statsFrameOpenMargin', Math.round(stats.openMargin).toString());
this.set('statsFrameCloseLast', Math.round(stats.closeLast).toString());
this.set('statsFrameCloseAvg', this.roundDigits(stats.closeAvg, 2).toString());
this.set('statsFrameCloseMargin', Math.round(stats.closeMargin).toString());
this.set('statsExposureLast', Math.round(stats.exposureLast).toString());
this.set('statsExposureAvg', this.roundDigits(stats.exposureAvg, 2).toString());
this.set('statsExposureMargin', Math.round(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)));
this.set('statsFrameTotalAvg', stats.totalFrameAvg.toString());
this.set('statsFrameTotalLast', stats.totalFrameLast.toString());
this.set('statsFrameTotalMargin', stats.totalFrameMargin.toString());
this.set('statsFPS', stats.fps.toString());
this.set('statsFrameLoadAvg', stats.loadAvg.toString());
this.set('statsFrameLoadMargin', stats.loadMargin.toString());
this.set('statsFrameOpenLast', stats.openLast.toString());
this.set('statsFrameOpenAvg', stats.openAvg.toString());
this.set('statsFrameOpenMargin', stats.openMargin.toString());
this.set('statsFrameCloseLast', stats.closeLast.toString());
this.set('statsFrameCloseAvg', stats.closeAvg.toString());
this.set('statsFrameCloseMargin', stats.closeMargin.toString());
this.set('statsExposureLast', stats.exposureLast.toString());
this.set('statsExposureAvg', stats.exposureAvg.toString());
this.set('statsExposureMargin', stats.exposureMargin.toString());
}
}
cmd(msg) {
@ -399,23 +395,6 @@ class Client {
get(id) {
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();
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -179,22 +179,7 @@
</div>
</div>
<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>
</form>
</fieldset>
@ -214,7 +199,6 @@
<script>
const WEBSOCKET_PORT = {{wsPort}};
</script>
<script src="/static/js/humanize-duration.js"></script>
<script src="/static/js/index.js"></script>
</body>
</html>