From b1197bc2f07cfccec2bc1c29e5f524ba7a14ec2f Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Tue, 10 Jul 2018 15:51:59 -0400 Subject: [PATCH] Add an STC and LTC button on test creation --- OpenBench/config.py | 20 +++- OpenBench/static/style.css | 18 ++++ Templates/OpenBench/base.html | 4 + Templates/OpenBench/newTest.html | 160 +++++++++++++++++-------------- 4 files changed, 124 insertions(+), 78 deletions(-) diff --git a/OpenBench/config.py b/OpenBench/config.py index 87eb295..bc98a20 100644 --- a/OpenBench/config.py +++ b/OpenBench/config.py @@ -11,12 +11,22 @@ FRAMEWORK_DEFAULTS = { 'source' : 'http://github.com/AndyGrant/EtherealDev/', 'homepage' : 'http://github.com/AndyGrant/Ethereal', - # Default engine test options + # Default to uci since everyone uses it 'protocol' : 'uci', - 'threads' : 1, - 'hash' : 8, - 'threads' : 1, - 'timecontrol' : '10.0+0.1', + + # Defaults for Short Time Control tests (default on newTest) + 'stc' : { + 'threads' : 1, + 'hash' : 8, + 'timecontrol' : '10.0+0.1', + }, + + # Defaults for Long Time Control tests (ease of submitting LTC) + 'ltc' : { + 'threads' : 1, + 'hash' : 64, + 'timecontrol' : '60.0+0.6', + }, # SPRT bounds and confidence values 'elolower' : 0.0, diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css index 5578c94..10fa4bb 100644 --- a/OpenBench/static/style.css +++ b/OpenBench/static/style.css @@ -44,6 +44,24 @@ body { -webkit-box-sizing: border-box; } +#content button { + padding: 8px 0px; + margin: 2px 0px; + display: inline-block; + vertical-align: middle; + width: 290px; + background-color: #A7D691; + color: black; + border: none; + border-radius: 8px; + cursor: pointer; + font-weight: bold; +} + +#content button:hover { + background-color: #6AC63F; +} + #content input[type=submit] { background-color: #15A049; color: white; diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html index bcd4d9f..d0b26d5 100644 --- a/Templates/OpenBench/base.html +++ b/Templates/OpenBench/base.html @@ -6,6 +6,10 @@ OpenBench + {% if error %} diff --git a/Templates/OpenBench/newTest.html b/Templates/OpenBench/newTest.html index 9fa58d7..27d0630 100644 --- a/Templates/OpenBench/newTest.html +++ b/Templates/OpenBench/newTest.html @@ -1,80 +1,94 @@ {% extends "OpenBench/base.html" %} +{% block scripts %} + function setupSTC() { + document.getElementById("devoptions").value = "Threads={{config.stc.threads}} Hash={{config.stc.hash}}"; + document.getElementById("baseoptions").value = "Threads={{config.stc.threads}} Hash={{config.stc.hash}}"; + document.getElementById("timecontrol").value = "{{config.stc.timecontrol}}" + } + + function setupLTC() { + document.getElementById("devoptions").value = "Threads={{config.ltc.threads}} Hash={{config.ltc.hash}}"; + document.getElementById("baseoptions").value = "Threads={{config.ltc.threads}} Hash={{config.ltc.hash}}"; + document.getElementById("timecontrol").value = "{{config.ltc.timecontrol}}" + } +{% endblock %} + {% block content %}
{% csrf_token %} -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- -
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + {% endblock %}