<script type="text/javascript" src="static/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="static/jquery.flot.min.js"></script>
<script type="text/javascript" src="static/mctx.gui.js"></script>
+ <script type="text/javascript" src="static/mctx.control.js"></script>
<link rel="stylesheet" type="text/css" href="static/style.css">
<link rel="stylesheet" type="text/css" href="static/nav-menu.css">
<script type="text/javascript">
runBeforeLoad().done(function () {
$(document).ready(function () {
- $("#main_controls").submit(function () {
- //Validate!
- return false;
- });
});
})
-
</script>
</head>
<input id="experiment-stop" type="button" value="Stop">
</td>
</tr>
- <tr id="state-software-r">
- <th>Software status</th>
- <td id="state-software"></td>
- <td></td>
- </tr>
</table>
<div class="sub-title">Error and warning messages</div>
<form id="start-controls" class="nice" action="#">
<p>
<label for="experiment_name">Experiment name</label>
- <input id="experiment_name" type="text" name="experiment_name">
+ <input id="experiment_name" type="text">
</p>
<p id="start-result">
--- /dev/null
+/**
+ * Code for the controls page.
+ * @date 19-10-2013
+ */
+
+mctx.control = {};
+mctx.control.api = mctx.api + 'control'
+
+$(document).ready(function () {
+ $.ajax({
+ url : mctx.control.api,
+ data : {'action' : 'identify'}
+ }).done(function () {
+
+ });
+});
+
* Appends each value pair to the result
* @returns result
*/
+/**
+ * Helper - Calculate pairs of (dependent, independent) values
+ * Given input as (time, value) pairs for dependent and independent
+ * Appends each value pair to the result
+ * @param {array[][]} dependent Dependent data to be correlated with independent
+ * @param {array[][]} independent Independent data
+ * @param {array[][]} result Storage location
+ * @returns {dataMerge.result}
+ */
function dataMerge(dependent, independent, result) {
var j = 0;
for (var i = 0; i < dependent.length-1; ++i) {
alert(arguments[i]);
}
} else {
- console.log.apply(this, arguments);
+ try {
+ console.log.apply(this, arguments);
+ } catch (e) {
+ //Chromie
+ for (var i = 0; i < arguments.length; i++) {
+ console.log(arguments[i]);
+ }
+ }
}
}
}
var url = mctx.api + "errorlog";
var outdiv = this;
+ if ($(this).length <= 0) {
+ //No error log, so do nothing.
+ return;
+ }
+
var updater = function () {
$.ajax({url : url}).done(function (data) {
outdiv.text(data);
outdiv.scrollTop(
- outdiv[0].scrollHeight - outdiv.height()
+ outdiv[0].scrollHeight - outdiv.height()
);
setTimeout(updater, 3000);
}).fail(function (jqXHR) {