root/ui/config.php

Revision ui,120, 12.7 kB (checked in by Suren A. Chilingaryan <csa@dside.dyndns.org>, 2 years ago)

Quick fix for broken database selection

Line 
1 <?php
2     error_reporting(E_ALL ^ E_NOTICE);
3
4     $SETUP_MULTI_MODE = true;
5     
6     $ADEI_RELEASE = false;
7
8     $TITLE = "ADEI";
9
10     $DEFAULT_MODULE = "graph";
11     
12     $MODULES = array("config", "graph", "alarms", "logs", "help");
13     $POPUPS = array("source", "controls");
14     $CONTROLS = array("export", "aggregator", "searchtab", false, "virtual"); // false/null indicates line break
15
16     /* more specific configs should go after less specific ones */
17     $OPTIONS = array (
18     "default" => array(
19         "min_resolution" => 600,         // in db config could be array by id
20 //        "cache_config" => $ADEI_CACHE    // alter default cache timing configuration
21         "ignore_subseconds" => true,    // Timestamps with second precision
22         "omit_raw_cache" => false,        // Use data source instead of cache0 tables
23         "fill_raw_first" => false,        // Fill RAW cache table completely prior to processing agregating cache tables
24         "optimize_empty_cache" => false,    // Do not fill lower resolution cache intervals if encompassing one is empty
25         "use_cache_timewindow" => true,    // Shrink time window to currently cached data
26         "use_cache_reader" => false,    // Do not access data source while reading cache
27         "overcome_reader_faults" => false,    // Use CACHE if connection to reader is failed
28         "optimize_time_axes" => true,    // Limit window size by available data (temporary change)
29         "use_md5_postfix" => false,        // Use md5 for table name postfixes
30         "null_value" => 0,            // The numeric value to use instead of NULL (missing data) when needed
31         "disable_caching" => false,        // The CACHE should not be generated, Item for RT display only
32         "channel_uids" => false,        // If channels have unique identifactors within ADEI setup
33     )
34     );
35     
36
37     $ADEI_DB = array (
38     "host" => "localhost",
39     "port" => 0,
40     "database" => "adei",
41     "user" => "adei",
42     "password" => "adei"
43     );
44
45 /*
46     The TSQLFile support in ROOT is not mature enough   
47     $ROOT_DB = array (
48     "driver" => "mysql",
49     "host" => "localhost",
50     "port" => 0,
51     "user" => "zeus",
52     "password" => "zeus"
53     );
54 */
55     
56     $BACKUP_DB = array (
57     "driver" => "mysql",
58     "host" => "localhost",
59     "port" => 0,
60     "user" => "zeus",
61     "password" => "zeus"
62     );
63
64     $ADEI_TIMINGS = array (
65     _("1 Year") => 31536000,
66     _("1 Month") => 2592000,
67     _("1 Week") => 604800,
68     _("1 Day") => 86400,
69     _("6 Hours") => 21600,
70     _("1 Hour") => 3600,
71     _("15 Min") => 900,
72     _("5 Min") => 300
73     );
74     
75     
76     $ADEI_CACHE = array (
77     array("min" => 31536000, "res" => 43200), /* year - 12 hour data, 730 points min */
78     array("min" => 2592000, "res" => 3600), /* month - 1 hour data, 720 - 8760 data points */
79     array("min" => 604800, "res" => 600), /* week - 10 min data, 1008 - 4320 data points */
80     array("min" => 86400, "res" => 60), /* day - 1 min data, 1440 - 10080 data points */
81     array("min" => 7200, "res" => 10), /* 2 hours - 10 s, 720 - 8640 data points */
82     /* 1 - 7200 data points */
83     );
84     
85     
86     $ADEI_VIRTUAL_READERS = array(
87     "virtual_vg" => array(
88         "title" => _("User Groups"),
89         "reader"=> "VGReader"
90     ),
91     "virtual" => array(
92         "title" => _("Virtual"),
93         "reader" => "VIRTUALReader"
94     )
95     );
96
97     $ADEI_AXES = array(
98     "temperature" => array(
99         "axis_units" => _("C"),
100         "axis_name" => _("Temperature"),
101         "axis_mode" => "STANDARD",
102         "axis_range" => false
103     ),
104     "voltage" => array(
105         "axis_units" => _("V"),
106         "axis_name" => _("Voltage"),
107         "axis_mode" => "STANDARD",
108         "axis_range" => false
109     )
110     );
111
112     $DEFAULT_MISSING_VALUE = NULL;    /* Value to use instead of NULL values */
113
114     $EXPORT_DEFAULT_FORMAT = "csv";
115     
116     /* Joiner/Filter: Joiner is a filter supporting multiple groups. From the
117     software point of view there is no difference and both are implemented
118     using the same base class. It is possible to have arbitrary sequence of
119     enclosed filters/joiners within format configuration.
120     Only joiner or filter should be specified on the one level, if both
121     are specified the filter will be used.
122     
123     @PROP@             - replaced by passed value
124     ?{@PROP@?@PROP@:nothing}
125
126       Default:
127     @TMPFILE@
128     @BLOCK_TITLE@
129     @EXPECTED_BLOCKS@
130     @BLOCK_NUMBER@
131
132
133     @ROOT__COMBHIST@   
134     */
135     
136     $ADEI_SYSTEM_FORMATS = array (
137     "labview32" => array(
138         'title' => "LabVIEW array",
139         'handler' => "LABVIEW",
140         'hidden' => true,
141         'type' => "streamarray"
142     )
143     );
144     
145     $EXPORT_FORMATS = array (
146     "csv" => array(
147         'title' => "CSV",
148         'accept_null_values' => true
149     ),
150     "xls" => array(
151         'title' => "Excel",
152         'handler' => "EXCEL",
153 //        subsec_format => "DD.MM.YYYY hh:mm:ss.000;@"
154 //        subsec_format => "text()" /* Use text (CSV) */
155 //        subsec_format => "text(format)" /* Use text (format) */
156 //        subsec_format => "DD.MM.YYYY hh:mm:ss.000000;@" /* HP, OpenOffice */
157 //        subsec_width => 26
158 //        date_format => "DD.MM.YYYY hh:mm:ss"
159 //        date_width => 20
160 //        value_format => "0.0000E+##"
161 //        value_width => 12
162 /*        filter => array (
163         "type" => "ZIP"
164         )*/
165     ),
166     "root" => array(
167         'title' => "ROOT",
168         'filter' => array (
169         'app' => "csv2root",
170         'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@}",
171         'joiner' => true,
172         'groupmode' => true,    /* Run filter app for each group */
173             'extension' => "root"
174         )
175     ),
176     "root_hist" => array(
177         'title' => "ROOT+Hist",
178         'filter' => array(
179         'app' => "csv2root",
180         'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@} --save-histograms ?{@ROOT__COMBHIST@?--combined-histogram}",
181         'joiner' => true,
182         'groupmode' => true,    /* Run filter app for each block */
183         'extension' => "root"
184         )
185     ),
186     "tdms" => array(
187         'title' => "TDMS",
188         'handler' => "LABVIEW",
189         'type' => "tdms"
190     )
191     );
192     
193     $EXPORT_SAMPLING_RATES = array (
194     _("Hourly") => 3600,
195     _("Minutely") => 60,
196     _("1 Hz") => 1,
197     _("1000 Hz") => 0.001
198     );
199     
200     $SEARCH_ENGINES = array (
201     "ITEMSearch" => array()
202     );
203     
204     
205     $ADEI_ID_DELIMITER = "__";
206     
207     $LOGGER_LOG_REQUESTS = false;    /* Log all ADEI requests */
208     $LOGGER_LOG_OUTPUT = false;        /* Log output of ADEI requests */
209
210 /* This forces MySQL to use INDEXes while SELECT queries returning huge
211 rowsets are executed. After certain threshold, MySQL optimizator stops
212 using INDEXes what bringing to huge slowdown. This option is intended
213 to fix this behaviour. */
214     $MYSQL_FORCE_INDEXES = true;   
215     
216     $CACHE_PRECISE_GAPS = false;    /* Enables more precise maxgap calculation in DATAInterval */
217     
218     $AJAX_UPDATE_RATE = 60;         /* in seconds */
219     $AJAX_WINDOW_BORDER = 10;         /* in pixels */
220     $AJAX_PARSE_DELAY = 100;         /* html, in milliseconds */
221
222     $SOURCE_KEEP_WINDOW = false;    /* Preserve time range when group is changed */
223     
224
225     $DHTMLX_SKIN = "standard";
226 //    $DHTMLX_SKIN="dhx_blue";
227     $DHTMLX_ICONSET = "csh_bluefolders";
228     $MENU_SHOW_ITEMS = false;        /* Show separate items in popup menu */
229     $MENU_SCROLL_LIMIT = 10;        /* Add scrolling if more than that items present */
230     
231     $JPGRAPH_PATH="/usr/share/php5/jpgraph";
232     $EXCEL_WRITER_PATH ="";
233     $TMP_PATH=$ADEI_ROOTDIR . "tmp";
234
235     $ADEI_ROOT_STORAGE = "$ADEI_ROOTDIR/storage/";
236     
237     $ADEI_APP_PATH = array (
238     "default" => "/usr/bin/"
239     );
240     
241     $CSV_SEPARATOR = ",";
242     $CSV_DATE_FORMAT = "d-M-y H:i:s";
243     $EXCEL_DATE_FORMAT = "DD.MM.YYYY hh:mm:ss";
244     $EXCEL_SUBSEC_FORMAT = "DD.MM.YYYY hh:mm:ss.000;@"; /*
245         Unfortunately Excel doesn't support more than 3 digits,
246         OpenOffice does */
247     $ROOT_COMBIHIST_LIMIT = 604800; /* No more, than 1 week */
248
249
250     $STATUS_DEFAULT_DURATION = 2000;    /* in milliseconds */
251
252
253     $GRAPH_DEFAULT_HEIGHT = 768; /* in pixels */
254     $GRAPH_DEFAULT_WIDTH = 1024; /* in pixels */
255 /* Maximal number of points (all plots) on Graph, this allows us to produce
256 rough multiplots to sustain high update rate (most of resources are used to
257 graph->Stroke()) */
258     $GRAPH_MAX_POINTS_PER_GRAPH = 5000;
259 /* Maximal approximation interval (in pixels). I.e. maximal distance between
260 to approximation points. This option have a priority over MAX_POINTS_PER_GRAPH
261 option. */
262     $GRAPH_MAX_APPROXIMATION_INTERVAL = 10; /* in pixels */
263
264     $GRAPH_AUTOAGGREGATION_MINMAX_THRESHOLD = 10; /* in precision, approx. px/2 */
265
266     $GRAPH_INTERPOLATE_DATA_GAPS = false; /* Do not indicate missing data */
267
268 /* Maximal distance between currently CACHEd data and the data available in the
269 data source, measured in seconds. 0 means - unlimited */
270     $GRAPH_MAX_CACHE_GAP = 0;
271
272     
273     $GRAPH_ZOOM_RATIO = 2.;    // This coeficent defines product of division of original window by zoomed window
274     $GRAPH_DEEPZOOM_AREA = 10;    // In pixels (actual interval is 2x)
275     $GRAPH_STEP_RATIO = 5.;    // This coeficent defines product of division of original window by step
276     $GRAPH_EDGE_RATIO = 6;    // Product of division of while window by edge size
277
278     $GRAPH_DELTA_SIZE = 10; /* delta neighborhood size, in pixels */
279     $GRAPH_MARGINS = array (
280     "left" => 50,
281     "top" => 20,
282     "right" => 220,
283     "bottom" => 30
284     );
285     $GRAPH_SELECTION = array (
286     "min_width" => 20,
287     "min_height" => 20
288     );
289
290
291     $GRAPH_LINE_WEIGHT = 2;
292 /* Enables approximation point marks starting with accuracy greater than the
293 specified number of pixels. 0 - to disable. Significatly degradate performance
294 if used */
295     $GRAPH_ACCURACY_MARKS_OUTSET = 14;
296     $GRAPH_ACCURACY_MARKS_MULTIOUTSET = 49;
297     $GRAPH_ACCURACY_MARKS_IF_GAPS = false;    // Force if data gaps are found
298     $GRAPH_ACCURACY_MARKS_COLOR = "blue";
299 #   $GRAPH_ACCURACY_MARKS_TYPE = MARK_FILLEDCIRCLE;
300     $GRAPH_ACCURACY_MARKS_SIZE = 3;
301     
302 /* Display a bar on top of the graph, indicating the density of the data. The
303 four modes are supported:
304     SHOW_NONE: do not show
305     SHOW_EMPTY: show only if missing (due to inavalability of the data) points
306     are available on the graph
307     SHOW_POINTS: Indicate all set points on the graph (somehow duplicates
308     'GRAPH_ACCURACY_MARKS' functionality, but displayed even if precision is
309     high and GRAP_ACCURACY_MARKS are disable by OUTSET
310     SHOW_GAPS: Will display information on data gaps. Even if point placed on
311     the graph, but there is less data than expected, all such points will be
312     indicated on the bar
313 */
314
315     $GRAPH_INDICATE_DATA_DENSITY = 'SHOW_NONE';
316 //    $GRAPH_INDICATE_DATA_DENSITY = SHOW_POINTS;//SHOW_GAPS;
317
318     $GRAPH_DENSITY_PLOT_INVALID_SIZE = 3;
319     $GRAPH_DENSITY_PLOT_INVALID_COLOR = 'red';
320
321     $GRAPH_DENSITY_PLOT_VALID_SIZE = 0;
322     $GRAPH_DENSITY_PLOT_VALID_COLOR = 'green';
323     
324     $GRAPH_DENSITY_POINTS_TYPE = 'MARK_FILLEDCIRCLE';
325     $GRAPH_DENSITY_POINTS_SIZE = 1;
326     $GRAPH_DENSITY_POINTS_COLOR = 'green';
327     $GRAPH_DENSITY_POINTS_OUTLINE = 'black';
328     
329     
330     
331     $GRAPH_SUBSECOND_THRESHOLD = 5;    /* in seconds, for shorter intervals the subsecond handling is performed */
332
333 /* This option defines a plot colors (used sequently), comment out to use black
334 only */
335     $GRAPH_COLORS =  array("#000000","#006400","#000080","#0B0000","#00008B","#8B0000","#8B008B","#8B8B00","#0F0F0F","#F0F0F0");
336 /*
337     $GRAPH_COLORS =  array("black", "#483D8B","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#1E90FF","#D19275","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC",
338         "#808080","#008000","#ADFF2F","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6",
339         "#D3D3D3","#90EE90","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#8470FF","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF",
340         "#BA55D3","#9370D8","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6",
341         "#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#D87093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#FF0000",
342         "#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080");
343 */
344
345     if (file_exists("config.actual.php")) {
346     require("config.actual.php");
347     } else {
348     $ADEI_SETUP = "all";
349     }
350
351
352     if ($SETUP_MULTI_MODE) {
353     if ($_GET['setup']) {
354         $ADEI_SETUP = $_GET['setup'];
355         unset($_GET['setup']);
356     } else {
357         $params = sizeof($_SERVER['argv']);
358             if ($params>1) {
359         $pos = array_search("-setup", $_SERVER['argv']);
360         if (($pos)&&(($pos + 1) < $params)) $ADEI_SETUP $_SERVER['argv'][$pos + 1];
361         else $SETUP_MULTI_MODE = 0;
362         } else $SETUP_MULTI_MODE = 0;
363     }
364     }
365
366     $SETUP_CONFIG = "setups/$ADEI_SETUP/config.php";
367     $SETUP_CSS = "setups/$ADEI_SETUP/$ADEI_SETUP.css";
368     
369     if (!file_exists("config.php")) {
370         $curdir = getcwd();
371     if (preg_match("/(services|admin|system|test)$/", $curdir)) chdir("..");
372     if (!file_exists("config.php")) {
373         if (preg_match("/tmp\/admin$/", $curdir)) chdir("..");
374     }
375     }
376     
377     if (file_exists($SETUP_CONFIG)) require($SETUP_CONFIG);
378     
379     if (file_exists("config.override.php")) require("config.override.php");
380 ?>
Note: See TracBrowser for help on using the browser.