parent
a778eb6d64
commit
46d861e0dc
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.8 KiB |
File diff suppressed because one or more lines are too long
@ -0,0 +1,66 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||||
|
|
||||||
|
<title>About - Current analyzer</title> |
||||||
|
|
||||||
|
<link href="/css/app.css" rel="stylesheet"> |
||||||
|
|
||||||
|
|
||||||
|
<script src="/js/all.js"></script> |
||||||
|
</head> |
||||||
|
<body class="page-about"> |
||||||
|
<div id="outer"> |
||||||
|
<nav id="menu"> |
||||||
|
<div id="brand" onclick="$('#menu').toggleClass('expanded')">Current Analyser</div> |
||||||
|
<a href="/">Home</a><a href="/wifi">WiFi config</a><a href="/waveform">Waveform</a><a href="/fft">FFT</a><a href="/about" class="selected">About</a></nav> |
||||||
|
<div id="content"> |
||||||
|
|
||||||
|
<h1>About</h1> |
||||||
|
|
||||||
|
<div class="Box"> |
||||||
|
<img src="/img/cvut.svg" id="logo" class="mq-tablet-min"> |
||||||
|
<h2>Current Analyser</h2> |
||||||
|
|
||||||
|
<img src="/img/cvut.svg" id="logo2" class="mq-phone"> |
||||||
|
|
||||||
|
<p>© Ondřej Hruška, 2016 <<a href="mailto:ondra@ondrovo.com" target="blank">ondra@ondrovo.com</a>></p> |
||||||
|
|
||||||
|
<p><a href="http://measure.feld.cvut.cz/" target="blank">Katedra měření FEL ČVUT</a><br>Department of Measurement, FEE CTU</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="Box"> |
||||||
|
<h2>Firmware</h2> |
||||||
|
|
||||||
|
<p> |
||||||
|
The ESP8266 firmware is based on the amazing <a href="https://github.com/Spritetm/esphttpd" target="blank">esp-httpd</a> |
||||||
|
library by Jeroen Domburg. |
||||||
|
</p> |
||||||
|
|
||||||
|
<table> |
||||||
|
<tr> |
||||||
|
<th>Firmware</th> |
||||||
|
<td>v%vers_fw%, build <i>%date%</i> at <i>%time%</i></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>HTTPD</th> |
||||||
|
<td>v%vers_httpd%</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>SBMP</th> |
||||||
|
<td>v%vers_sbmp%</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>IoT SDK</th> |
||||||
|
<td>v%vers_sdk%</td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,85 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||||
|
|
||||||
|
<title>FFT - Current analyzer</title> |
||||||
|
|
||||||
|
<link href="/css/app.css" rel="stylesheet"> |
||||||
|
|
||||||
|
|
||||||
|
<script src="/js/all.js"></script> |
||||||
|
</head> |
||||||
|
<body class="page-fft"> |
||||||
|
<div id="outer"> |
||||||
|
<nav id="menu"> |
||||||
|
<div id="brand" onclick="$('#menu').toggleClass('expanded')">Current Analyser</div> |
||||||
|
<a href="/">Home</a><a href="/wifi">WiFi config</a><a href="/waveform">Waveform</a><a href="/fft" class="selected">FFT</a><a href="/about">About</a></nav> |
||||||
|
<div id="content"> |
||||||
|
|
||||||
|
<h1>FFT</h1> |
||||||
|
|
||||||
|
<div class="Box center" id="samp-ctrl"> |
||||||
|
<div> |
||||||
|
<label for="count">Bins</label> |
||||||
|
<label for="count" class="select-wrap"> |
||||||
|
<select name="count" id="count"> |
||||||
|
<!-- <option value="16">8--> |
||||||
|
<!-- <option value="32">16--> |
||||||
|
<!-- <option value="64">32--> |
||||||
|
<!-- <option value="128">64--> |
||||||
|
<!-- <option value="256">128--> |
||||||
|
<option value="512">256 |
||||||
|
<option value="1024">512 |
||||||
|
<option value="2048" selected>1024 |
||||||
|
</select> |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<label for="freq">Rate <span class="mq-tablet-max" style="font-weight:normal;">(Hz)</span></label> |
||||||
|
<input id="freq" type="number" value="4096"> |
||||||
|
<span class="mq-normal-min">Hz</span> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<a id="load" class="button btn-green">Load</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="Box medium chartbox"> |
||||||
|
<div id="chart" class="ct-chart ct-wide ct-with-area"></div> |
||||||
|
<div class="stats invis"> |
||||||
|
<table> |
||||||
|
<tr> |
||||||
|
<th>Samples</th> |
||||||
|
<td id="stat-count"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>f<sub>s</sub></th> |
||||||
|
<td id="stat-f-s"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>I<sub>peak</sub></th> |
||||||
|
<td id="stat-i-peak"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>I<sub>RMS</sub></th> |
||||||
|
<td id="stat-i-rms"></td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
<div class="ar"><!-- auto reload --> |
||||||
|
<input type="number" id="ar-time" step="0.5" value="1" min="0"> s |
||||||
|
<input type="button" id="ar-btn" class="btn-blue narrow" value="Auto"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script> |
||||||
|
$().ready(page_waveform.init('fft')); |
||||||
|
</script> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.8 KiB |
@ -1,272 +1,285 @@ |
|||||||
(function (root, factory) { |
(function (root, factory) { |
||||||
// if (typeof define === 'function' && define.amd) {
|
// if (typeof define === 'function' && define.amd) {
|
||||||
// // AMD. Register as an anonymous module.
|
// // AMD. Register as an anonymous module.
|
||||||
// define([], function () {
|
// define([], function () {
|
||||||
// return (root.returnExportsGlobal = factory());
|
// return (root.returnExportsGlobal = factory());
|
||||||
// });
|
// });
|
||||||
// } else if (typeof exports === 'object') {
|
// } else if (typeof exports === 'object') {
|
||||||
// // Node. Does not work with strict CommonJS, but
|
// // Node. Does not work with strict CommonJS, but
|
||||||
// // only CommonJS-like enviroments that support module.exports,
|
// // only CommonJS-like enviroments that support module.exports,
|
||||||
// // like Node.
|
// // like Node.
|
||||||
// module.exports = factory();
|
// module.exports = factory();
|
||||||
// } else {
|
// } else {
|
||||||
root['Chartist.plugins.zoom'] = factory(); |
root['Chartist.plugins.zoom'] = factory(); |
||||||
// }
|
// }
|
||||||
}(this, function () { |
}(this, function () { |
||||||
|
|
||||||
/** |
/** |
||||||
* Chartist.js zoom plugin. |
* Chartist.js zoom plugin. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
(function (window, document, Chartist) { |
(function (window, document, Chartist) { |
||||||
'use strict'; |
'use strict'; |
||||||
|
|
||||||
var defaultOptions = { |
var defaultOptions = { |
||||||
// onZoom
|
// onZoom
|
||||||
// resetOnRightMouseBtn
|
// resetOnRightMouseBtn
|
||||||
}; |
}; |
||||||
|
|
||||||
|
|
||||||
Chartist.plugins = Chartist.plugins || {}; |
Chartist.plugins = Chartist.plugins || {}; |
||||||
Chartist.plugins.zoom = function (options) { |
Chartist.plugins.zoom = function (options) { |
||||||
|
|
||||||
options = Chartist.extend({}, defaultOptions, options); |
options = Chartist.extend({}, defaultOptions, options); |
||||||
|
|
||||||
return function zoom(chart) { |
return function zoom(chart) { |
||||||
|
|
||||||
if (!(chart instanceof Chartist.Line)) { |
if (!(chart instanceof Chartist.Line)) { |
||||||
return; |
return; |
||||||
} |
} |
||||||
|
|
||||||
var rect, svg, axisX, axisY, chartRect; |
var rect, svg, axisX, axisY, chartRect; |
||||||
var downPosition; |
var downPosition; |
||||||
var onZoom = options.onZoom; |
var onZoom = options.onZoom; |
||||||
var ongoingTouches = []; |
var ongoingTouches = []; |
||||||
|
|
||||||
chart.on('draw', function (data) { |
chart.on('draw', function (data) { |
||||||
var type = data.type; |
var type = data.type; |
||||||
if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') { |
if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') { |
||||||
data.element.attr({ |
data.element.attr({ |
||||||
'clip-path': 'url(#zoom-mask)' |
'clip-path': 'url(#zoom-mask)' |
||||||
}); |
}); |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
|
||||||
chart.on('created', function (data) { |
chart.on('created', function (data) { |
||||||
axisX = data.axisX; |
axisX = data.axisX; |
||||||
axisY = data.axisY; |
axisY = data.axisY; |
||||||
chartRect = data.chartRect; |
chartRect = data.chartRect; |
||||||
svg = data.svg._node; |
svg = data.svg._node; |
||||||
rect = data.svg.elem('rect', { |
rect = data.svg.elem('rect', { |
||||||
x: 10, |
x: 10, |
||||||
y: 10, |
y: 10, |
||||||
width: 100, |
width: 100, |
||||||
height: 100, |
height: 100, |
||||||
}, 'ct-zoom-rect'); |
}, 'ct-zoom-rect'); |
||||||
hide(rect); |
hide(rect); |
||||||
|
|
||||||
var defs = data.svg.querySelector('defs') || data.svg.elem('defs'); |
var defs = data.svg.querySelector('defs') || data.svg.elem('defs'); |
||||||
var width = chartRect.width(); |
var width = chartRect.width(); |
||||||
var height = chartRect.height(); |
var height = chartRect.height(); |
||||||
|
|
||||||
defs |
defs |
||||||
.elem('clipPath', { |
.elem('clipPath', { |
||||||
id: 'zoom-mask' |
id: 'zoom-mask' |
||||||
}) |
}) |
||||||
.elem('rect', { |
.elem('rect', { |
||||||
x: chartRect.x1, |
x: chartRect.x1, |
||||||
y: chartRect.y2, |
y: chartRect.y2, |
||||||
width: width, |
width: width, |
||||||
height: height, |
height: height, |
||||||
fill: 'white' |
fill: 'white' |
||||||
}); |
}); |
||||||
|
|
||||||
svg.addEventListener('mousedown', onMouseDown); |
svg.addEventListener('mousedown', onMouseDown); |
||||||
svg.addEventListener('mouseup', onMouseUp); |
svg.addEventListener('mouseup', onMouseUp); |
||||||
svg.addEventListener('mousemove', onMouseMove); |
svg.addEventListener('mousemove', onMouseMove); |
||||||
svg.addEventListener('touchstart', onTouchStart); |
svg.addEventListener('touchstart', onTouchStart); |
||||||
svg.addEventListener('touchmove', onTouchMove); |
svg.addEventListener('touchmove', onTouchMove); |
||||||
svg.addEventListener('touchend', onTouchEnd); |
svg.addEventListener('touchend', onTouchEnd); |
||||||
svg.addEventListener('touchcancel', onTouchCancel); |
svg.addEventListener('touchcancel', onTouchCancel); |
||||||
}); |
}); |
||||||
|
|
||||||
function copyTouch(touch) { |
function copyTouch(touch) { |
||||||
var p = position(touch, svg); |
var p = position(touch, svg); |
||||||
p.id = touch.identifier; |
p.id = touch.identifier; |
||||||
return p; |
return p; |
||||||
} |
} |
||||||
|
|
||||||
function ongoingTouchIndexById(idToFind) { |
function ongoingTouchIndexById(idToFind) { |
||||||
for (var i = 0; i < ongoingTouches.length; i++) { |
for (var i = 0; i < ongoingTouches.length; i++) { |
||||||
var id = ongoingTouches[i].id; |
var id = ongoingTouches[i].id; |
||||||
if (id === idToFind) { |
if (id === idToFind) { |
||||||
return i; |
return i; |
||||||
} |
} |
||||||
} |
} |
||||||
return -1; |
return -1; |
||||||
} |
} |
||||||
|
|
||||||
function onTouchStart(event) { |
function onTouchStart(event) { |
||||||
var touches = event.changedTouches; |
var touches = event.changedTouches; |
||||||
for (var i = 0; i < touches.length; i++) { |
for (var i = 0; i < touches.length; i++) { |
||||||
ongoingTouches.push(copyTouch(touches[i])); |
ongoingTouches.push(copyTouch(touches[i])); |
||||||
} |
} |
||||||
|
|
||||||
if (ongoingTouches.length > 1) { |
if (ongoingTouches.length > 1) { |
||||||
rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); |
rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); |
||||||
show(rect); |
show(rect); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
function onTouchMove(event) { |
function onTouchMove(event) { |
||||||
var touches = event.changedTouches; |
var touches = event.changedTouches; |
||||||
for (var i = 0; i < touches.length; i++) { |
for (var i = 0; i < touches.length; i++) { |
||||||
var idx = ongoingTouchIndexById(touches[i].identifier); |
var idx = ongoingTouchIndexById(touches[i].identifier); |
||||||
ongoingTouches.splice(idx, 1, copyTouch(touches[i])); |
ongoingTouches.splice(idx, 1, copyTouch(touches[i])); |
||||||
} |
} |
||||||
|
|
||||||
if (ongoingTouches.length > 1) { |
if (ongoingTouches.length > 1) { |
||||||
rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); |
rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); |
||||||
show(rect); |
show(rect); |
||||||
event.preventDefault(); |
event.preventDefault(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
function onTouchCancel(event) { |
function onTouchCancel(event) { |
||||||
removeTouches(event.changedTouches); |
removeTouches(event.changedTouches); |
||||||
} |
} |
||||||
|
|
||||||
function removeTouches(touches) { |
function removeTouches(touches) { |
||||||
for (var i = 0; i < touches.length; i++) { |
for (var i = 0; i < touches.length; i++) { |
||||||
var idx = ongoingTouchIndexById(touches[i].identifier); |
var idx = ongoingTouchIndexById(touches[i].identifier); |
||||||
if (idx >= 0) { |
if (idx >= 0) { |
||||||
ongoingTouches.splice(idx, 1); |
ongoingTouches.splice(idx, 1); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
function onTouchEnd(event) { |
function onTouchEnd(event) { |
||||||
if (ongoingTouches.length > 1) { |
if (ongoingTouches.length > 1) { |
||||||
zoomIn(getRect(ongoingTouches[0], ongoingTouches[1])); |
zoomIn(getRect(ongoingTouches[0], ongoingTouches[1])); |
||||||
} |
} |
||||||
removeTouches(event.changedTouches); |
removeTouches(event.changedTouches); |
||||||
hide(rect); |
hide(rect); |
||||||
} |
} |
||||||
|
|
||||||
function onMouseDown(event) { |
function onMouseDown(event) { |
||||||
if (event.button === 0) { |
if (event.button === 0) { |
||||||
downPosition = position(event, svg); |
downPosition = position(event, svg); |
||||||
rect.attr(getRect(downPosition, downPosition)); |
rect.attr(getRect(downPosition, downPosition)); |
||||||
show(rect); |
show(rect); |
||||||
event.preventDefault(); |
event.preventDefault(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
var reset = function () { |
var reset = function () { |
||||||
chart.options.axisX.highLow = null; |
chart.options.axisX.highLow = null; |
||||||
chart.options.axisY.highLow = null; |
chart.options.axisY.highLow = null; |
||||||
chart.update(chart.data, chart.options); |
chart.update(chart.data, chart.options); |
||||||
}; |
}; |
||||||
|
|
||||||
function onMouseUp(event) { |
function onMouseUp(event) { |
||||||
if (event.button === 0) { |
if (event.button === 0) { |
||||||
var box = getRect(downPosition, position(event, svg)); |
var box = getRect(downPosition, position(event, svg)); |
||||||
zoomIn(box); |
zoomIn(box); |
||||||
downPosition = null; |
downPosition = null; |
||||||
hide(rect); |
hide(rect); |
||||||
event.preventDefault(); |
event.preventDefault(); |
||||||
} |
} |
||||||
else if (options.resetOnRightMouseBtn && event.button === 2) { |
else if (options.resetOnRightMouseBtn && event.button === 2) { |
||||||
reset(); |
reset(); |
||||||
event.preventDefault(); |
event.preventDefault(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
function zoomIn(rect) { |
function zoomIn(rect) { |
||||||
if (rect.width > 5 && rect.height > 5) { |
if (rect.width > 5 && rect.height > 5) { |
||||||
var x1 = rect.x - chartRect.x1; |
var x1 = rect.x - chartRect.x1; |
||||||
var x2 = x1 + rect.width; |
var x2 = x1 + rect.width; |
||||||
var y2 = chartRect.y1 - rect.y; |
var y2 = chartRect.y1 - rect.y; |
||||||
var y1 = y2 - rect.height; |
var y1 = y2 - rect.height; |
||||||
|
|
||||||
chart.options.axisX.highLow = { low: project(x1, axisX), high: project(x2, axisX) }; |
var xLow = project(x1, axisX); |
||||||
chart.options.axisY.highLow = { low: project(y1, axisY), high: project(y2, axisY) }; |
var xHigh = project(x2, axisX); |
||||||
|
var yLow = project(y1, axisY); |
||||||
chart.update(chart.data, chart.options); |
var yHigh = project(y2, axisY); |
||||||
onZoom && onZoom(chart, reset); |
|
||||||
} |
var explb = chart.options.explicitBounds; |
||||||
} |
if (!_.isUndefined(explb)) { |
||||||
|
if (!_.isUndefined(explb.xLow)) xLow = Math.max(explb.xLow, xLow); |
||||||
function onMouseMove(event) { |
if (!_.isUndefined(explb.xHigh)) xHigh = Math.min(explb.xHigh, xHigh); |
||||||
if (downPosition) { |
if (!_.isUndefined(explb.yLow)) yLow = Math.max(explb.yLow, yLow); |
||||||
var point = position(event, svg); |
if (!_.isUndefined(explb.yHigh)) yHigh = Math.min(explb.yHigh, yHigh); |
||||||
rect.attr(getRect(downPosition, point)); |
} |
||||||
event.preventDefault(); |
|
||||||
} |
chart.options.axisX.highLow = {low: xLow, high: xHigh}; |
||||||
} |
chart.options.axisY.highLow = {low: yLow, high: yHigh}; |
||||||
}; |
|
||||||
|
chart.update(chart.data, chart.options); |
||||||
}; |
onZoom && onZoom(chart, reset); |
||||||
|
} |
||||||
function hide(rect) { |
} |
||||||
rect.attr({ style: 'display:none' }); |
|
||||||
} |
function onMouseMove(event) { |
||||||
|
if (downPosition) { |
||||||
function show(rect) { |
var point = position(event, svg); |
||||||
rect.attr({ style: 'display:block' }); |
rect.attr(getRect(downPosition, point)); |
||||||
} |
event.preventDefault(); |
||||||
|
} |
||||||
function getRect(firstPoint, secondPoint) { |
} |
||||||
var x = firstPoint.x; |
}; |
||||||
var y = firstPoint.y; |
|
||||||
var width = secondPoint.x - x; |
}; |
||||||
var height = secondPoint.y - y; |
|
||||||
if (width < 0) { |
function hide(rect) { |
||||||
width = -width; |
rect.attr({style: 'display:none'}); |
||||||
x = secondPoint.x; |
} |
||||||
} |
|
||||||
if (height < 0) { |
function show(rect) { |
||||||
height = -height; |
rect.attr({style: 'display:block'}); |
||||||
y = secondPoint.y; |
} |
||||||
} |
|
||||||
return { |
function getRect(firstPoint, secondPoint) { |
||||||
x: x, |
var x = firstPoint.x; |
||||||
y: y, |
var y = firstPoint.y; |
||||||
width: width, |
var width = secondPoint.x - x; |
||||||
height: height |
var height = secondPoint.y - y; |
||||||
}; |
if (width < 0) { |
||||||
} |
width = -width; |
||||||
|
x = secondPoint.x; |
||||||
function position(event, svg) { |
} |
||||||
return transform(event.clientX, event.clientY, svg); |
if (height < 0) { |
||||||
} |
height = -height; |
||||||
|
y = secondPoint.y; |
||||||
function transform(x, y, svgElement) { |
} |
||||||
var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement; |
return { |
||||||
var matrix = svg.getScreenCTM(); |
x: x, |
||||||
var point = svg.createSVGPoint(); |
y: y, |
||||||
point.x = x; |
width: width, |
||||||
point.y = y; |
height: height |
||||||
point = point.matrixTransform(matrix.inverse()); |
}; |
||||||
return point || { x: 0, y: 0 }; |
} |
||||||
} |
|
||||||
|
function position(event, svg) { |
||||||
function project(value, axis) { |
return transform(event.clientX, event.clientY, svg); |
||||||
var max = axis.bounds.max; |
} |
||||||
var min = axis.bounds.min; |
|
||||||
if (axis.scale && axis.scale.type === 'log') { |
function transform(x, y, svgElement) { |
||||||
var base = axis.scale.base; |
var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement; |
||||||
return Math.pow(base, |
var matrix = svg.getScreenCTM(); |
||||||
value * baseLog(max / min, base) / axis.axisLength) * min; |
var point = svg.createSVGPoint(); |
||||||
} |
point.x = x; |
||||||
return (value * axis.bounds.range / axis.axisLength) + min; |
point.y = y; |
||||||
} |
point = point.matrixTransform(matrix.inverse()); |
||||||
|
return point || {x: 0, y: 0}; |
||||||
function baseLog(val, base) { |
} |
||||||
return Math.log(val) / Math.log(base); |
|
||||||
} |
function project(value, axis) { |
||||||
|
var max = axis.bounds.max; |
||||||
} (window, document, Chartist)); |
var min = axis.bounds.min; |
||||||
return Chartist.plugins.zoom; |
if (axis.scale && axis.scale.type === 'log') { |
||||||
|
var base = axis.scale.base; |
||||||
|
return Math.pow(base, |
||||||
|
value * baseLog(max / min, base) / axis.axisLength) * min; |
||||||
|
} |
||||||
|
return (value * axis.bounds.range / axis.axisLength) + min; |
||||||
|
} |
||||||
|
|
||||||
|
function baseLog(val, base) { |
||||||
|
return Math.log(val) / Math.log(base); |
||||||
|
} |
||||||
|
|
||||||
|
}(window, document, Chartist)); |
||||||
|
return Chartist.plugins.zoom; |
||||||
|
|
||||||
})); |
})); |
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,44 @@ |
|||||||
|
<?php $page = 'about'; include "_start.php"; ?> |
||||||
|
|
||||||
|
<h1>About</h1> |
||||||
|
|
||||||
|
<div class="Box"> |
||||||
|
<img src="/img/cvut.svg" id="logo" class="mq-tablet-min"> |
||||||
|
<h2>Current Analyser</h2> |
||||||
|
|
||||||
|
<img src="/img/cvut.svg" id="logo2" class="mq-phone"> |
||||||
|
|
||||||
|
<p>© Ondřej Hruška, 2016 <<a href="mailto:ondra@ondrovo.com" target="blank">ondra@ondrovo.com</a>></p> |
||||||
|
|
||||||
|
<p><a href="http://measure.feld.cvut.cz/" target="blank">Katedra měření FEL ČVUT</a><br>Department of Measurement, FEE CTU</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="Box"> |
||||||
|
<h2>Firmware</h2> |
||||||
|
|
||||||
|
<p> |
||||||
|
The ESP8266 firmware is based on the amazing <a href="https://github.com/Spritetm/esphttpd" target="blank">esp-httpd</a> |
||||||
|
library by Jeroen Domburg. |
||||||
|
</p> |
||||||
|
|
||||||
|
<table> |
||||||
|
<tr> |
||||||
|
<th>Firmware</th> |
||||||
|
<td>v%vers_fw%, build <i>%date%</i> at <i>%time%</i></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>HTTPD</th> |
||||||
|
<td>v%vers_httpd%</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>SBMP</th> |
||||||
|
<td>v%vers_sbmp%</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>IoT SDK</th> |
||||||
|
<td>v%vers_sdk%</td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include "_end.php"; ?> |
@ -0,0 +1,63 @@ |
|||||||
|
<?php $page = 'fft'; include "_start.php"; ?> |
||||||
|
|
||||||
|
<h1>FFT</h1> |
||||||
|
|
||||||
|
<div class="Box center" id="samp-ctrl"> |
||||||
|
<div> |
||||||
|
<label for="count">Bins</label> |
||||||
|
<label for="count" class="select-wrap"> |
||||||
|
<select name="count" id="count"> |
||||||
|
<!-- <option value="16">8--> |
||||||
|
<!-- <option value="32">16--> |
||||||
|
<!-- <option value="64">32--> |
||||||
|
<!-- <option value="128">64--> |
||||||
|
<!-- <option value="256">128--> |
||||||
|
<option value="512">256 |
||||||
|
<option value="1024">512 |
||||||
|
<option value="2048" selected>1024 |
||||||
|
</select> |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<label for="freq">Rate <span class="mq-tablet-max" style="font-weight:normal;">(Hz)</span></label> |
||||||
|
<input id="freq" type="number" value="4096"> |
||||||
|
<span class="mq-normal-min">Hz</span> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<a id="load" class="button btn-green">Load</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="Box medium chartbox"> |
||||||
|
<div id="chart" class="ct-chart ct-wide ct-with-area"></div> |
||||||
|
<div class="stats invis"> |
||||||
|
<table> |
||||||
|
<tr> |
||||||
|
<th>Samples</th> |
||||||
|
<td id="stat-count"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>f<sub>s</sub></th> |
||||||
|
<td id="stat-f-s"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>I<sub>peak</sub></th> |
||||||
|
<td id="stat-i-peak"></td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>I<sub>RMS</sub></th> |
||||||
|
<td id="stat-i-rms"></td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
<div class="ar"><!-- auto reload --> |
||||||
|
<input type="number" id="ar-time" step="0.5" value="1" min="0"> s |
||||||
|
<input type="button" id="ar-btn" class="btn-blue narrow" value="Auto"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script> |
||||||
|
$().ready(page_waveform.init('fft')); |
||||||
|
</script> |
||||||
|
|
||||||
|
<?php include "_end.php"; ?> |
@ -0,0 +1,17 @@ |
|||||||
|
.page-about { |
||||||
|
.Box { |
||||||
|
padding-left:dist(0); |
||||||
|
padding-right:dist(0); |
||||||
|
|
||||||
|
a {font-weight: bold;} |
||||||
|
} |
||||||
|
|
||||||
|
#logo { |
||||||
|
float:right; |
||||||
|
height: 130px; |
||||||
|
} |
||||||
|
|
||||||
|
#logo2 { |
||||||
|
max-width: 150px; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
#ifndef FW_VERSION_H |
||||||
|
#define FW_VERSION_H |
||||||
|
|
||||||
|
#define FIRMWARE_VERSION "0.1.1" |
||||||
|
|
||||||
|
#endif // FW_VERSION_H
|
@ -0,0 +1,35 @@ |
|||||||
|
#include <esp8266.h> |
||||||
|
#include <httpd.h> |
||||||
|
#include "page_about.h" |
||||||
|
#include "fw_version.h" |
||||||
|
#include "sbmp.h" |
||||||
|
|
||||||
|
/** "About" page */ |
||||||
|
int FLASH_FN tplAbout(HttpdConnData *connData, char *token, void **arg) |
||||||
|
{ |
||||||
|
// arg is unused
|
||||||
|
(void)arg; |
||||||
|
|
||||||
|
if (token == NULL) return HTTPD_CGI_DONE; |
||||||
|
|
||||||
|
if (streq(token, "vers_fw")) { |
||||||
|
httpdSend(connData, FIRMWARE_VERSION, -1); |
||||||
|
|
||||||
|
} else if (streq(token, "date")) { |
||||||
|
httpdSend(connData, __DATE__, -1); |
||||||
|
|
||||||
|
} else if (streq(token, "time")) { |
||||||
|
httpdSend(connData, __TIME__, -1); |
||||||
|
|
||||||
|
} else if (streq(token, "vers_httpd")) { |
||||||
|
httpdSend(connData, HTTPDVER, -1); |
||||||
|
|
||||||
|
} else if (streq(token, "vers_sbmp")) { |
||||||
|
httpdSend(connData, SBMP_VER, -1); |
||||||
|
|
||||||
|
} else if (streq(token, "vers_sdk")) { |
||||||
|
httpdSend(connData, STR(ESP_SDK_VERSION), -1); |
||||||
|
} |
||||||
|
|
||||||
|
return HTTPD_CGI_DONE; |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
#ifndef PAGE_ABOUT_H |
||||||
|
#define PAGE_ABOUT_H |
||||||
|
|
||||||
|
#include <httpd.h> |
||||||
|
|
||||||
|
int tplAbout(HttpdConnData *connData, char *token, void **arg); |
||||||
|
|
||||||
|
#endif // PAGE_ABOUT_H
|
Loading…
Reference in new issue