This commit is contained in:
ADElectronics 2017-11-28 22:31:40 +03:00
parent 6a1f93f17b
commit 764b020238
1201 changed files with 527271 additions and 1 deletions

View file

@ -0,0 +1,117 @@
/**
* Default styles for the dygraphs charting library.
*/
.dygraph-legend {
position: absolute;
font-size: 14px;
z-index: 10;
width: 250px; /* labelsDivWidth */
/*
dygraphs determines these based on the presence of chart labels.
It might make more sense to create a wrapper div around the chart proper.
top: 0px;
right: 2px;
*/
background: white;
line-height: normal;
text-align: left;
overflow: hidden;
}
/* styles for a solid line in the legend */
.dygraph-legend-line {
display: inline-block;
position: relative;
bottom: .5ex;
padding-left: 1em;
height: 1px;
border-bottom-width: 2px;
border-bottom-style: solid;
/* border-bottom-color is set based on the series color */
}
/* styles for a dashed line in the legend, e.g. when strokePattern is set */
.dygraph-legend-dash {
display: inline-block;
position: relative;
bottom: .5ex;
height: 1px;
border-bottom-width: 2px;
border-bottom-style: solid;
/* border-bottom-color is set based on the series color */
/* margin-right is set based on the stroke pattern */
/* padding-left is set based on the stroke pattern */
}
.dygraph-roller {
position: absolute;
z-index: 10;
}
/* This class is shared by all annotations, including those with icons */
.dygraph-annotation {
position: absolute;
z-index: 10;
overflow: hidden;
}
/* This class only applies to annotations without icons */
/* Old class name: .dygraphDefaultAnnotation */
.dygraph-default-annotation {
border: 1px solid black;
background-color: white;
text-align: center;
}
.dygraph-axis-label {
/* position: absolute; */
/* font-size: 14px; */
z-index: 10;
line-height: normal;
overflow: hidden;
color: black; /* replaces old axisLabelColor option */
}
.dygraph-axis-label-x {
}
.dygraph-axis-label-y {
}
.dygraph-axis-label-y2 {
}
.dygraph-title {
font-weight: bold;
z-index: 10;
text-align: center;
/* font-size: based on titleHeight option */
}
.dygraph-xlabel {
text-align: center;
/* font-size: based on xLabelHeight option */
}
/* For y-axis label */
.dygraph-label-rotate-left {
text-align: center;
/* See http://caniuse.com/#feat=transforms2d */
transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
}
/* For y2-axis label */
.dygraph-label-rotate-right {
text-align: center;
/* See http://caniuse.com/#feat=transforms2d */
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dygraph.css">
<title>Get data ADC</title>
<script type="text/javascript" src="dygraph.min.js"></script>
</head>
<body>
<h3 style="width:800px; text-align: center;">Read ADC RTL8711AM/RTL8195AM</h3>
<div id="div_g" style="width:800px; height:400px;"></div>
<script type="text/javascript">
var data = [];
var g = new Dygraph(document.getElementById("div_g"), data,
{ drawPoints: true,
showRangeSelector: true,
showRoller: true, labels: ['X', 'U']});
var oldblkid = 0;
var rdnextflg = false;
var cur_idx = 0;
ws = new WebSocket('ws://rtl871x0/web.cgi');
ws.binaryType = 'arraybuffer';
ws.onopen = function(){ws.send('adc');ws.send('adc')};
ws.onmessage = function (event) {
if(event.data instanceof ArrayBuffer) {
var wordarray = new Uint16Array(event.data);
if(wordarray.length > 2) {
var blksz = wordarray[0];
if(wordarray.length == blksz + 2) {
var blkid = wordarray[1];
if(rdnextflg) {
cur_idx += (blkid - oldblkid) & 0xFFFF;
} else rdnextflg = true;
oldblkid = blkid + blksz;
for (var i = 2; i < wordarray.length; i++) {
if(cur_idx > 10000 ) data.shift();
data.push([cur_idx++, wordarray[i]]);
}
g.updateOptions({'file':data});
}
}
if(cur_idx < 10000 ) ws.send("adc");
}
}
</script>
</body></html>

View file

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dygraph.css">
<title>Get data INA219</title>
<script type="text/javascript" src="dygraph.js"></script>
</head>
<body>
<h3 style="width:800px; text-align: center;">Read regs U & I INA219</h3>
<div id="div_v" style="width:800px; height:400px;"></div>
<script type="text/javascript">
var datau = [];
//var datai = [];
var gu = new Dygraph(
document.getElementById("div_v"),
datau,
{
labels: ['X', 'I', 'U'],
// drawPoints: true,
rollPeriod: 100,
// errorBars: true,
// showRoller: true,
y2label: 'U(mV)',
ylabel: 'I(mA)',
series : {
'U': { axis: 'y2' }
}
// , axes: { y: {valueRange: [4500, 5500] }, y2: {valueRange: [75, 125] }}
});
var oldblkid = 0;
var rdnextflg = false;
var cur_idx = 0;
var sig = 10;
ws = new WebSocket('ws://rtl871x0/web.cgi');
ws.binaryType = 'arraybuffer';
ws.onopen = function(){ws.send('ina219'); ws.send('pr=0')};
ws.onmessage = function (event) {
if(event.data instanceof ArrayBuffer) {
var wordarray = new Int16Array(event.data);
if(wordarray.length > 2) {
var blksz = wordarray[0];
if(wordarray.length == blksz*2 + 2) {
var blkid = wordarray[1] & 0xFFFF;
if(rdnextflg) {
cur_idx += (blkid - oldblkid) & 0xFFFF;
} else rdnextflg = true;
oldblkid = blkid + blksz;
for (var i=2; i<wordarray.length; i+=2) {
if(cur_idx > 10000 ) datau.shift();
datau.push([cur_idx, wordarray[i+1], wordarray[i]*0.5 ]);
cur_idx++;
}
gu.updateOptions({'file':datau});
}
}
ws.send("ina219");
}
}
</script>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dygraph.css">
<title>Get data INA219</title>
<script type="text/javascript" src="dygraph.js"></script>
</head>
<body>
<h3 style="width:800px; text-align: center;">U & I (INA219)</h3>
<div id="div_v" style="width:800px; height:400px;"></div>
<script type="text/javascript">
var datau = [];
//var datai = [];
var gu = new Dygraph(
document.getElementById("div_v"),
datau,
{
showRangeSelector: true,
labels: ['X', 'U', 'I'],
// drawPoints: true,
rollPeriod: 5,
// errorBars: true,
// showRoller: true,
ylabel: 'U(mV)',
y2label: 'I(mA)',
series : {
'I': { axis: 'y2' }
}
// , axes: { y: {valueRange: [4500, 5500] }, y2: {valueRange: [75, 125] }}
});
var oldblkid = 0;
var rdnextflg = false;
var cur_idx = 0;
var sig = 10;
ws = new WebSocket('ws://rtl871x0/web.cgi');
ws.binaryType = 'arraybuffer';
ws.onopen = function(){ws.send('ina219'); ws.send('pr=0')};
ws.onmessage = function (event) {
if(event.data instanceof ArrayBuffer) {
var wordarray = new Int16Array(event.data);
if(wordarray.length > 2) {
var blksz = wordarray[0];
if(wordarray.length == blksz*2 + 2) {
var blkid = wordarray[1] & 0xFFFF;
if(rdnextflg) {
cur_idx += (blkid - oldblkid) & 0xFFFF;
} else rdnextflg = true;
oldblkid = blkid + blksz;
for (var i=2; i<wordarray.length; i+=2) {
if(cur_idx > 50000 ) datau.shift();
datau.push([cur_idx, wordarray[i]*0.5, wordarray[i+1]*0.1]);
cur_idx++;
}
gu.updateOptions({'file':datau});
}
}
ws.send("ina219");
}
}
</script>
</body>
</html>

View file

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dygraph.css">
<title>Get data MLX90614</title>
<script type="text/javascript" src="dygraph.js"></script>
</head>
<body>
<h3 style="width:800px; text-align: center;">Read regs Ta & Tobj1 MLX90614</h3>
<div id="div_v" style="width:800px; height:400px;"></div>
<script type="text/javascript">
var datau = [];
//var datai = [];
var gu = new Dygraph(
document.getElementById("div_v"),
datau,
{
labels: ['T', 'Ta', 'To'],
// drawPoints: true,
rollPeriod: 10,
// errorBars: true,
// showRoller: true,
y2label: 'To(C&deg;)',
ylabel: 'Ta(C&deg;)',
xlabel: 'T(sec)',
series : {
'To': { axis: 'y2' }
}
// , axes: { y: {valueRange: [4500, 5500] }, y2: {valueRange: [75, 125] }}
});
var oldblkid = 0;
var rdnextflg = false;
var cur_idx = 0;
var sig = 10;
var wstt;
function wsping() {ws.send('mlx90614'); wstt = setTimeout(wsping, 50);}
ws = new WebSocket('ws://rtl871x0/web.cgi');
ws.binaryType = 'arraybuffer';
ws.onopen = function(){ ws.send('user=rtl871x:supervisor'); ws.send('sys_debug=0'); wstt = setTimeout(wsping, 50);};
ws.onmessage = function (event) {
if(event.data instanceof ArrayBuffer) {
clearTimeout(wstt);
var wordarray = new Int16Array(event.data);
if(wordarray.length > 2) {
var blksz = wordarray[0];
if(wordarray.length == blksz*2 + 2) {
var blkid = wordarray[1] & 0xFFFF;
if(rdnextflg) {
cur_idx += (blkid - oldblkid) & 0xFFFF;
} else rdnextflg = true;
oldblkid = blkid + blksz;
for (var i=2; i<wordarray.length; i+=2) {
if(cur_idx >= 10000 ) datau.shift();
datau.push([cur_idx * 0.01, (wordarray[i+1]*0.02)-273.15, (wordarray[i]*0.02)-273.15]);
cur_idx++;
}
gu.updateOptions({'file':datau});
}
}
wstt = setTimeout(wsping, 50);
}
}
</script>
</body>
</html>