/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to docs/samples/legend.php

  • Committer: Suren A. Chilingaryan
  • Date: 2014-10-17 14:09:35 UTC
  • Revision ID: csa@suren.me-20141017140935-aous739tn3noirae
Added samples of PHP API to documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
require("../adei.php");
 
3
$ADEI->RequireClass("draw");
 
4
 
 
5
header("Content-type: application/json");
 
6
header("Cache-Control: no-cache, must-revalidate");
 
7
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 
8
 
 
9
// Gaps
 
10
//$_POST['props'] = "{\"db_server\": \"katrin\", \"db_name\": \"hauptspektrometer\", \"db_group\": \"0\", \"db_mask\": \"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56\", \"experiment\": \"0-0\", \"window\": \"1184572999-1185575717\", \"width\": 937, \"height\": 549, \"xmin\": \"1184544000\", \"xmax\": \"1185580800\", \"ymin\": 11.1085494014, \"ymax\": 856.067930927, \"x\": \"1185420556.4013840831\", \"y\": 28.041603139387917}";
 
11
//$_POST['props'] = "{\"db_server\": \"katrin\", \"db_name\": \"hauptspektrometer\", \"db_group\": \"0\", \"db_mask\": \"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56\", \"experiment\": \"0-0\", \"window\": \"1185369134-1185449256\", \"width\": 937, \"height\": 549, \"xmin\": \"1185368400\", \"xmax\": \"1185449400\", \"ymin\": 12.4924722853, \"ymax\": 856.057920634, \"x\": \"1185404368.85813148789\", \"y\": 36.15963917283864}";
 
12
 
 
13
// No gaps
 
14
//$_POST['props'] = '{"db_server": "katrin", "db_name": "hauptspektrometer", "db_group": "0", "control_group": "0", "db_mask": "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56", "experiment": "0-0", "window": "0", "width": 854, "height": 719, "aggregation": null, "interpolate": null, "show_marks": null, "show_gaps": null, "virtual": null, "srctree": null, "pageid": null, "module": "graph", "format": null, "resample": null, "mask_mode": null, "custom": null, "xmin": "1183593600", "xmax": "1190332800", "ymin": 0, "ymax": 900, "x": "1185099906.9767441861", "y": 141.25560538116588}';
 
15
//$_POST['props'] = '{\"db_server\": \"autogen\", \"db_name\": \"minutely\", \"db_group\": \"default\", \"control_group\": \"default\", \"db_mask\": \"0,1,2,3,4,5,6\", \"experiment\": \"0-0\", \"window\": \"0\", \"width\": 1158, \"height\": 626, \"aggregation\": null, \"interpolate\": null, \"show_marks\": null, \"show_gaps\": null, \"virtual\": null, \"srctree\": null, \"pageid\": null, \"module\": \"graph\", \"run\": null, \"format\": null, \"resample\": null, \"mask_mode\": null, \"custom\": null, \"xmin\": \"1104537600\", \"xmax\": \"1262304000\", \"ymin\": [-10, -15], \"ymax\": [14, 15], \"x\": \"1130418728.48722986\", \"y\": null, \"xslt\": \"legend\", \"time_format\": \"text\"}';
 
16
 
 
17
// MEAN
 
18
$_POST['props'] = '{\"db_server\": \"virtual\", \"db_name\": \"autogen\", \"db_group\": \"autogen__minutely__extra\", \"control_group\": \"autogen__minutely__default\", \"db_mask\": \"0,1\", \"experiment\": \"0-0\", \"window\": \"0\", \"width\": 893, \"height\": 626, \"aggregation\": null, \"interpolate\": null, \"show_marks\": null, \"show_gaps\": null, \"virtual\": \"srctree\", \"srctree\": \"\", \"pageid\": null, \"module\": \"graph\", \"axis_range\": null, \"temperature_axis_range\": null, \"voltage_axis_range\": null, \"format\": null, \"resample\": null, \"mask_mode\": null, \"custom\": null, \"xmin\": \"1104537600\", \"xmax\": \"1105185600\", \"ymin\": [-0.8], \"ymax\": [0.8], \"x\": \"1104563105.535055350552\", \"y\": [0.25], \"xslt\": \"legend\", \"time_format\": \"text\"}';
 
19
 
 
20
try {
 
21
    $draw = new DRAW();
 
22
    $legend = $draw->Legend();
 
23
} catch(ADEIException $e) {
 
24
    $error = $e->getMessage();
 
25
}
 
26
 
 
27
if ($error) {
 
28
    print_r($error);
 
29
} else {
 
30
    print_r($legend);
 
31
}
 
32
 
 
33
 
 
34
?>
 
 
b'\\ No newline at end of file'