/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
1 by Suren A. Chilingaryan
Initial import
1
<?php
308 by Suren A. Chilingaryan
Prevent deprecation and strict-mode errors
2
    error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
243 by Suren A. Chilingaryan
Move timezone setup into the config.php
3
    date_default_timezone_set("UTC");
1 by Suren A. Chilingaryan
Initial import
4
5
    $SETUP_MULTI_MODE = true;
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
6
    
412 by Suren A. Chilingaryan
Support multi-server SETUP subsets
7
    $ADEI_RELEASE = true;
1 by Suren A. Chilingaryan
Initial import
8
9
    $TITLE = "ADEI";
536 by Suren A. Chilingaryan
Allow per-setup customization of ADEI menu
10
    $ADEI_MENU_ICON = "menu.png";
11
    $ADEI_MENU_EXTRA_ITEMS = "";
1 by Suren A. Chilingaryan
Initial import
12
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
13
        // INNODB is required for replication, MyISAM in other case especially on the systems with low IOPS
14
        // MyISAM tables are significantly smaller and less disk intensive
484 by Suren A. Chilingaryan
Group INSERTs into the transactions for better INNODB performance
15
        // Compression with Katrin dataset give 35% of data savings, but results 50-70% performance degradation
16
        // There is more CPU usage, but systems are not bound by CPU, so reason is not completely clear
17
    $ADEI_CACHE_ENGINE = "MYISAM";		// "INNODB"
18
    $ADEI_TRANSACTION_SIZE = 0;	                // 0 to disable
19
    $ADEI_CONTINUOUS_TRANSACTION = true;        // required unless we have a perfectly tuned configuration
20
    $ADEI_CACHE_COMPRESSION = "None";		// "zlib"
21
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
22
        // This does not help much to performance and may create problems under some circumstances. Don't turn on.
23
    $ADEI_DELAYED_KEYS = false;			
24
465 by Suren A. Chilingaryan
Initial release of scheduling service
25
    $ADEI_CACHE_SCHEDULER = false;
471 by Suren A. Chilingaryan
Scheduler improvements
26
    $ADEI_CONTINUOUS_CACHING = false;
402 by Suren A. Chilingaryan
Support srctree minimal mode
27
    $ADEI_DEFAULT_MODE = false;
96 by Suren A. Chilingaryan
WiKi integration
28
    $DEFAULT_MODULE = "wiki";
253 by Suren A. Chilingaryan
Initial support of secondary views
29
344 by Suren A. Chilingaryan
Disable control and alarms pages in the default configuration
30
    $MODULES = array(/*"slowcontrol", "alarms",*/ "infopage", "graph", "download", "wiki");
12 by Suren A. Chilingaryan
Layout redesign: search tab, controls, menu
31
    $POPUPS = array("source", "controls");
100 by Suren A. Chilingaryan
Initial SEARCH implementation
32
253 by Suren A. Chilingaryan
Initial support of secondary views
33
    $CONTROLS = array("infotab", "searchtab", "virtual", false, "export", "aggregator", "plot"); // false/null indicates line break
538 by Suren A. Chilingaryan
Enable loading default XSLT file for a subpath and drop XSLT symlinks for standard image-based (image.xsl) VIEWs
34
239 by Suren A. Chilingaryan
Basic implementation of TANGOReader
35
    $ADEI_SRCTREE_EXTRA = array();
538 by Suren A. Chilingaryan
Enable loading default XSLT file for a subpath and drop XSLT symlinks for standard image-based (image.xsl) VIEWs
36
37
    $ADEI_DEFAULT_XSLT = array(
38
	"views" => "image",
39
    );
40
253 by Suren A. Chilingaryan
Initial support of secondary views
41
    $ADEI_INFO_MODULES = array(
42
        "legend" => array(
43
            'title' => _("Channel Overview"),
44
            'handler' => "CHANNELView",
45
            'opts' => array()
46
        ),
47
        "scatter" => array(
48
            'title' => _("Scatter Plot"),
49
            'handler' => "SCATTERView",
50
            'opts' => array()
311 by Suren A. Chilingaryan
Histogram view (based on the code by Hovhannes)
51
        ),
372 by Suren A. Chilingaryan
Merge SPECTRUMView from Arthur
52
        "spectrum" => array(
53
            'title' => _("Spectrum"),
54
            'handler' => "spectrumview",
55
            'opts' => array()
56
        ),
311 by Suren A. Chilingaryan
Histogram view (based on the code by Hovhannes)
57
        "histogram" => array(
58
            'title' => _("Histogram"),
59
            'handler' => "histogramview",
60
            'opts' => array(
61
		'bins' => array(0, 5, 10, 20, 50)
62
            )
63
        ),
533 by Suren A. Chilingaryan
CALC InfoTab module by Jalal
64
        "count" => array(
65
            'title' => _("Count Records"),
66
            'handler' => "COUNTView",
67
            'opts' => array()
68
        ),
69
	"calc" => array(
70
	    'title' => _("Channel Math"),
71
            'handler' => "CALCView",
72
            'opts' => array(
73
		'raw_data' => false,
74
		'max_points' => 10000,
75
	    )
76
	),
253 by Suren A. Chilingaryan
Initial support of secondary views
77
    );
78
541 by Suren A. Chilingaryan
Generalize data filtering/resampling in the VIEWs and provide common tools for secondary time series plots (based on work of Jalal)
79
    $ADEI_RESAMPLERS = array(
80
	"skip" => array(
81
	    'title' => _("Skip incomplete vectors"),
82
	    'handler' => "SKIPResampler",
83
	    'opts' => array()
84
	),
85
	"last" => array(
86
	    'title' => _("Take last recorded value"),
87
	    'handler' => "LASTResampler",
88
	    'opts' => array(
89
		'max_gap' => 0,
90
	    )
91
	),
92
    );
1 by Suren A. Chilingaryan
Initial import
93
94
	/* more specific configs should go after less specific ones */
95
    $OPTIONS = array (
96
	"default" => array( 
97
	    "min_resolution" => 600, 		// in db config could be array by id
98
//	    "cache_config" => $ADEI_CACHE	// alter default cache timing configuration
99
	    "ignore_subseconds" => true,	// Timestamps with second precision
100
	    "omit_raw_cache" => false,		// Use data source instead of cache0 tables
101
	    "fill_raw_first" => false,		// Fill RAW cache table completely prior to processing agregating cache tables
102
	    "optimize_empty_cache" => false,	// Do not fill lower resolution cache intervals if encompassing one is empty
103
	    "use_cache_timewindow" => true,	// Shrink time window to currently cached data
104
	    "use_cache_reader" => false,	// Do not access data source while reading cache
105
	    "overcome_reader_faults" => false,	// Use CACHE if connection to reader is failed
106
	    "optimize_time_axes" => false,	// Limit window size by available data
107
	    "use_md5_postfix" => false,		// Use md5 for table name postfixes
71 by Suren A. Chilingaryan
Fast data support in TESTReader
108
	    "null_value" => 0,			// The numeric value to use instead of NULL (missing data) when needed
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
109
	    "disable_caching" => false,		// The CACHE should not be generated, Item for RT display only
110
	    "channel_uids" => false,		// If channels have unique identifactors within ADEI setup
263 by Suren A. Chilingaryan
Support private source axes
111
	    "private_axes" => false,            // The READER has his own set of axes which shall not be mixed with global ones
1 by Suren A. Chilingaryan
Initial import
112
	)
113
    );
114
    
115
116
    $ADEI_DB = array (
117
	"host" => "localhost",
118
	"port" => 0,
119
	"database" => "adei",
120
	"user" => "adei",
121
	"password" => "adei"
122
    );
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
123
    
1 by Suren A. Chilingaryan
Initial import
124
/*
125
    The TSQLFile support in ROOT is not mature enough    
126
    $ROOT_DB = array (
127
	"driver" => "mysql",
128
	"host" => "localhost",
129
	"port" => 0,
130
	"user" => "zeus",
131
	"password" => "zeus"
132
    );
133
*/
134
    
135
    $BACKUP_DB = array (
136
	"driver" => "mysql",
137
	"host" => "localhost",
138
	"port" => 0,
139
	"user" => "zeus",
140
	"password" => "zeus"
141
    );
142
143
    $ADEI_TIMINGS = array (
144
	_("1 Year") => 31536000,
145
	_("1 Month") => 2592000,
146
	_("1 Week") => 604800,
147
	_("1 Day") => 86400,
148
	_("6 Hours") => 21600,
149
	_("1 Hour") => 3600,
150
	_("15 Min") => 900,
151
	_("5 Min") => 300
152
    );
153
    
154
    
155
    $ADEI_CACHE = array (
156
	array("min" => 31536000, "res" => 43200), /* year - 12 hour data, 730 points min */
157
	array("min" => 2592000, "res" => 3600), /* month - 1 hour data, 720 - 8760 data points */
158
	array("min" => 604800, "res" => 600), /* week - 10 min data, 1008 - 4320 data points */
159
	array("min" => 86400, "res" => 60), /* day - 1 min data, 1440 - 10080 data points */
160
	array("min" => 7200, "res" => 10), /* 2 hours - 10 s, 720 - 8640 data points */
161
	/* 1 - 7200 data points */
162
    );
69 by Suren A. Chilingaryan
Fist step of importing infrastracture fro VIRTUAL data sources and COMPLEX LogGroups
163
    
164
    
165
    $ADEI_VIRTUAL_READERS = array(
83 by Suren A. Chilingaryan
Initial support for alarms in backend, DB retries on link failures, more on axis
166
/*	"virtual_vg" => array(
167
	    "title" => _("User Groups"),
168
	    "reader"=> "VGReader"
169
	),*/
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
170
	"virtual" => array(
171
	    "title" => _("Virtual"),
172
	    "reader" => "VIRTUALReader"
83 by Suren A. Chilingaryan
Initial support for alarms in backend, DB retries on link failures, more on axis
173
	)
69 by Suren A. Chilingaryan
Fist step of importing infrastracture fro VIRTUAL data sources and COMPLEX LogGroups
174
    );
1 by Suren A. Chilingaryan
Initial import
175
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
176
    $ADEI_AXES = array(
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
177
/*	"0" => array(
178
	),*/
193 by Suren A. Chilingaryan
Few fixes and setup for ASEC installation
179
	"countrate" => array(
180
	    "axis_name" => _("Count Rate"),
181
	    "axis_units" => false,
329 by Suren A. Chilingaryan
Fix axis_mode naming
182
	    "axis_mode" => "STD",
193 by Suren A. Chilingaryan
Few fixes and setup for ASEC installation
183
	    "axis_range" => false
184
	),    
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
185
	"percent" => array(
186
	    "axis_name" => false,
187
	    "axis_units" => _("%"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
188
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
189
	    "axis_range" => false
190
	),    
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
191
	"temperature" => array(
192
	    "axis_units" => _("C"),
193
	    "axis_name" => _("Temperature"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
194
	    "axis_mode" => "STD",
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
195
	    "axis_range" => false
196
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
197
	"temperature/kelvin" => array(
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
198
	    "axis_units" => _("K"),
199
	    "axis_name" => _("Temperature"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
200
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
201
	    "axis_range" => false
202
	),
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
203
	"voltage" => array(
204
	    "axis_units" => _("V"),
205
	    "axis_name" => _("Voltage"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
206
	    "axis_mode" => "STD",
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
207
	    "axis_range" => false
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
208
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
209
	"voltage/kilo" => array(
210
	    "axis_units" => _("kV"),
211
	    "axis_name" => _("Voltage"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
212
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
213
	    "axis_range" => false
214
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
215
	"current" => array(
216
	    "axis_units" => _("A"),
217
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
218
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
219
	    "axis_range" => false
220
	),
317 by Suren A. Chilingaryan
Revise global axes
221
	"current/micro" => array(
182 by Suren A. Chilingaryan
New TOSKA configuration
222
	    "axis_units" => _("uA"),
223
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
224
	    "axis_mode" => "STD",
182 by Suren A. Chilingaryan
New TOSKA configuration
225
	    "axis_range" => false
226
	),
317 by Suren A. Chilingaryan
Revise global axes
227
	"current/nano" => array(
228
	    "axis_units" => _("nA"),
229
	    "axis_name" => _("Current"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
230
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
231
	    "axis_range" => false
232
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
233
	"resistance" => array(
234
	    "axis_units" => _("Ohm"),
235
	    "axis_name" => _("Resistance"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
236
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
237
	    "axis_range" => false
238
	), 
239
	"pressure" => array(
240
	    "axis_units" => _("bar"),
241
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
242
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
243
	    "axis_range" => false
244
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
245
	"pressure/psi" => array(
246
	    "axis_units" => _("psi"),
247
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
248
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
249
	    "axis_range" => false
250
	),
317 by Suren A. Chilingaryan
Revise global axes
251
	"pressure/milli" => array(
252
	    "axis_units" => _("millibar"),
253
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
254
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
255
	    "axis_range" => false
256
	),
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
257
	"pressure/hpa" => array(
258
	    "axis_units" => _("hPa"),
259
	    "axis_name" => _("Pressure"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
260
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
261
	    "axis_range" => false
262
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
263
	"mass" => array(
264
	    "axis_units" => _("kg"),
265
	    "axis_name" => _("Mass"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
266
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
267
	    "axis_range" => false
268
	),
317 by Suren A. Chilingaryan
Revise global axes
269
	"rpm" => array(
270
	    "axis_units" => _("rpm"),
335 by Suren A. Chilingaryan
Prevent overgrowing of source popup due to hoardes of axes
271
	    "axis_name" => _("RPM"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
272
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
273
	    "axis_range" => false
274
	),
275
	"volume-flow" => array(
276
	    "axis_units" => _("m3/s"),
277
	    "axis_name" => _("Flow"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
278
	    "axis_mode" => "STD",
317 by Suren A. Chilingaryan
Revise global axes
279
	    "axis_range" => false
280
	),
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
281
	"mass-flow" => array(
282
	    "axis_units" => _("g/s"),
283
	    "axis_name" => _("Mass-flow"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
284
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
285
	    "axis_range" => false
286
	),
317 by Suren A. Chilingaryan
Revise global axes
287
	"power" => array(
288
	    "axis_units" => _("W"),
289
	    "axis_name" => _("Power"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
290
	    "axis_mode" => "STD",
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
291
	    "axis_range" => false
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
292
	),
293
	"magnetic_field" => array(
294
	    "axis_units" => _("T"),
295
	    "axis_name" => _("Magnetic field"),
329 by Suren A. Chilingaryan
Fix axis_mode naming
296
	    "axis_mode" => "STD",
322 by Suren A. Chilingaryan
Define more axes and improvements to KATRIN naming scheme
297
	    "axis_range" => false
81 by Suren A. Chilingaryan
Better handling of axes in base classes, the real implementation is not here yet
298
	)
299
    );
300
23 by Suren A. Chilingaryan
Administrative interface and better handling of missing group channels
301
    $DEFAULT_MISSING_VALUE = NULL;	/* Value to use instead of NULL values */
1 by Suren A. Chilingaryan
Initial import
302
303
    $EXPORT_DEFAULT_FORMAT = "csv";
304
    
305
    /* Joiner/Filter: Joiner is a filter supporting multiple groups. From the
306
    software point of view there is no difference and both are implemented 
307
    using the same base class. It is possible to have arbitrary sequence of
308
    enclosed filters/joiners within format configuration.
309
    Only joiner or filter should be specified on the one level, if both
310
    are specified the filter will be used.
311
    
312
	@PROP@ 			- replaced by passed value
313
	?{@PROP@?@PROP@:nothing}
314
315
      Default:
316
	@TMPFILE@
317
	@BLOCK_TITLE@
318
	@EXPECTED_BLOCKS@
319
	@BLOCK_NUMBER@
320
321
322
	@ROOT__COMBHIST@	
323
    */
324
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
325
    $ADEI_SYSTEM_FORMATS = array (
326
	"labview32" => array(
327
	    'title' => "LabVIEW array",
328
	    'handler' => "LABVIEW",
329
	    'hidden' => true,
330
	    'type' => "streamarray"
331
	)
332
    );
333
    
1 by Suren A. Chilingaryan
Initial import
334
    $EXPORT_FORMATS = array (
335
	"csv" => array(
336
	    'title' => "CSV",
43 by Suren A. Chilingaryan
Data filtering support
337
	    'accept_null_values' => true
1 by Suren A. Chilingaryan
Initial import
338
	),
195 by Suren A. Chilingaryan
Image Export by Arsen Sogomonyan
339
     	"image" => array(
340
    	    'title' => "PNG Image",
341
            'handler' => 'Image',
342
 	    'type' => 'image'
343
     	),
1 by Suren A. Chilingaryan
Initial import
344
	"xls" => array(
345
	    'title' => "Excel",
346
	    'handler' => "EXCEL",
347
//	    subsec_format => "DD.MM.YYYY hh:mm:ss.000;@"
348
//	    subsec_format => "text()" /* Use text (CSV) */
349
//	    subsec_format => "text(format)" /* Use text (format) */
350
//	    subsec_format => "DD.MM.YYYY hh:mm:ss.000000;@" /* HP, OpenOffice */
351
//	    subsec_width => 26
352
//	    date_format => "DD.MM.YYYY hh:mm:ss"
353
//	    date_width => 20
354
//	    value_format => "0.0000E+##"
355
//	    value_width => 12
356
/*	    filter => array (
357
		"type" => "ZIP"
358
	    )*/
408 by Suren A. Chilingaryan
Include netcdf exported from ntj
359
        ),
360
/*
361
	"nc" => array(
362
	    'title' => "netCDF4",
363
	    'filter' => array (
364
		'app' => "csv2netcdf",
365
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@}",
366
		'joiner' => true,
367
		'groupmode' => true,	// Run filter app for each group
368
	        'extension' => "nc"
369
	    )
1 by Suren A. Chilingaryan
Initial import
370
	),
408 by Suren A. Chilingaryan
Include netcdf exported from ntj
371
	"root" => array(
1 by Suren A. Chilingaryan
Initial import
372
	    'title' => "ROOT",
373
	    'filter' => array (
374
		'app' => "csv2root",
375
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@}",
376
		'joiner' => true,
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
377
		'groupmode' => true,	// Run filter app for each group
1 by Suren A. Chilingaryan
Initial import
378
	        'extension' => "root"
379
	    )
380
	),
381
	"root_hist" => array(
382
	    'title' => "ROOT+Hist",
383
	    'filter' => array(
384
		'app' => "csv2root",
385
		'opts' => "--file @TMPFILE@ ?{@BLOCK_NUMBER@===0?--overwrite} ?{@EXPECTED_BLOCKS@!=1?--group @BLOCK_TITLE@} --save-histograms ?{@ROOT__COMBHIST@?--combined-histogram}",
386
		'joiner' => true,
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
387
		'groupmode' => true,	// Run filter app for each block
1 by Suren A. Chilingaryan
Initial import
388
		'extension' => "root"
389
	    )
310 by Suren A. Chilingaryan
Disable ROOT export in default configuration
390
	),*/
43 by Suren A. Chilingaryan
Data filtering support
391
	"tdms" => array(
392
	    'title' => "TDMS",
393
	    'handler' => "LABVIEW",
1 by Suren A. Chilingaryan
Initial import
394
	)
395
    );
396
    
397
    $EXPORT_SAMPLING_RATES = array (
398
	_("Hourly") => 3600,
399
	_("Minutely") => 60,
400
	_("1 Hz") => 1,
401
	_("1000 Hz") => 0.001
402
    );
403
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
404
    $SEARCH_ENGINES = array (
100 by Suren A. Chilingaryan
Initial SEARCH implementation
405
	"ITEMSearch" => array(),
101 by Suren A. Chilingaryan
Further search improvements, support for custom properties (config)
406
	"INTERVALSearch" => array(),
407
	"PROXYSearch" => array()
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
408
    );
409
    
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
410
    
411
    $ADEI_ID_DELIMITER = "__";
412
    
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
413
    $LOGGER_LOG_REQUESTS = false;	/* Log all ADEI requests */
414
    $LOGGER_LOG_OUTPUT = false;		/* Log output of ADEI requests */
290 by Suren A. Chilingaryan
Limit size of log files unless config option is specified
415
    $LOGGER_STORE_OBJECTS = false;	/* Will produce big, but very detailed logs */
32 by Suren A. Chilingaryan
Option to force MySQL optimizer to use INDEXEs on queries involving huge rowsets. Use unbuffered mysql queries on RAWPoint cache requests
416
417
/* This forces MySQL to use INDEXes while SELECT queries returning huge 
418
rowsets are executed. After certain threshold, MySQL optimizator stops
419
using INDEXes what bringing to huge slowdown. This option is intended
420
to fix this behaviour. */
210.1.2 by Suren A. Chilingaryan
Download manager by Aki Rimpelainen
421
    
32 by Suren A. Chilingaryan
Option to force MySQL optimizer to use INDEXEs on queries involving huge rowsets. Use unbuffered mysql queries on RAWPoint cache requests
422
    $MYSQL_FORCE_INDEXES = true;	
24 by Suren A. Chilingaryan
Logger subsystem
423
    
1 by Suren A. Chilingaryan
Initial import
424
    $CACHE_PRECISE_GAPS = false;	/* Enables more precise maxgap calculation in DATAInterval */
425
    
426
    $AJAX_UPDATE_RATE = 60; 		/* in seconds */
427
    $AJAX_WINDOW_BORDER = 10; 		/* in pixels */
428
    $AJAX_PARSE_DELAY = 100; 		/* html, in milliseconds */
429
430
    $SOURCE_KEEP_WINDOW = false;	/* Preserve time range when group is changed */
431
    
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
432
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
433
    $DHTMLX_SKIN = "standard";
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
434
//    $DHTMLX_SKIN="dhx_blue";
79 by Suren A. Chilingaryan
New version of dhtmlxmenu and dhtmlxtree is added
435
    $DHTMLX_ICONSET = "csh_bluefolders";
1 by Suren A. Chilingaryan
Initial import
436
    $MENU_SHOW_ITEMS = false;		/* Show separate items in popup menu */
80 by Suren A. Chilingaryan
Few steps on source tree integration in javascript frontend
437
    $MENU_SCROLL_LIMIT = 10;		/* Add scrolling if more than that items present */
1 by Suren A. Chilingaryan
Initial import
438
    
210.1.2 by Suren A. Chilingaryan
Download manager by Aki Rimpelainen
439
    $PHP_BINARY = "/usr/bin/php";
440
    $DOWNLOAD_DECAY_TIME = 72000;       /*  Time after unused download is removed from server*/
441
  
290 by Suren A. Chilingaryan
Limit size of log files unless config option is specified
442
    $JPGRAPH_PATH = "/usr/share/php5/jpgraph";
1 by Suren A. Chilingaryan
Initial import
443
    $EXCEL_WRITER_PATH ="";
24 by Suren A. Chilingaryan
Logger subsystem
444
    $TMP_PATH=$ADEI_ROOTDIR . "tmp";
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
445
446
    $ADEI_ROOT_STORAGE = "$ADEI_ROOTDIR/storage/";
1 by Suren A. Chilingaryan
Initial import
447
    
448
    $ADEI_APP_PATH = array (
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
449
	"default" => "/usr/bin/"
1 by Suren A. Chilingaryan
Initial import
450
    );
451
    
452
    $CSV_SEPARATOR = ",";
453
    $CSV_DATE_FORMAT = "d-M-y H:i:s";
454
    $EXCEL_DATE_FORMAT = "DD.MM.YYYY hh:mm:ss";
455
    $EXCEL_SUBSEC_FORMAT = "DD.MM.YYYY hh:mm:ss.000;@"; /* 
456
	    Unfortunately Excel doesn't support more than 3 digits,
457
	    OpenOffice does */
458
    $ROOT_COMBIHIST_LIMIT = 604800; /* No more, than 1 week */
459
460
14 by Suren A. Chilingaryan
Some minimal information on status bar
461
    $STATUS_DEFAULT_DURATION = 2000;	/* in milliseconds */
462
463
1 by Suren A. Chilingaryan
Initial import
464
    $GRAPH_DEFAULT_HEIGHT = 768; /* in pixels */
465
    $GRAPH_DEFAULT_WIDTH = 1024; /* in pixels */
354.1.11 by Suren A. Chilingaryan
Limit max axes per graph
466
    $GRAPH_MAX_AXES = 6;
1 by Suren A. Chilingaryan
Initial import
467
/* Maximal number of points (all plots) on Graph, this allows us to produce 
468
rough multiplots to sustain high update rate (most of resources are used to 
469
graph->Stroke()) */
470
    $GRAPH_MAX_POINTS_PER_GRAPH = 5000;
471
/* Maximal approximation interval (in pixels). I.e. maximal distance between
472
to approximation points. This option have a priority over MAX_POINTS_PER_GRAPH
473
option. */
474
    $GRAPH_MAX_APPROXIMATION_INTERVAL = 10; /* in pixels */
475
476
    $GRAPH_AUTOAGGREGATION_MINMAX_THRESHOLD = 10; /* in precision, approx. px/2 */
477
478
    $GRAPH_INTERPOLATE_DATA_GAPS = false; /* Do not indicate missing data */
479
480
/* Maximal distance between currently CACHEd data and the data available in the
481
data source, measured in seconds. 0 means - unlimited */
482
    $GRAPH_MAX_CACHE_GAP = 0;
483
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
484
    
485
    $GRAPH_ZOOM_RATIO = 2.;	// This coeficent defines product of division of original window by zoomed window
486
    $GRAPH_DEEPZOOM_AREA = 10;	// In pixels (actual interval is 2x)
487
    $GRAPH_STEP_RATIO = 5.;	// This coeficent defines product of division of original window by step
488
    $GRAPH_EDGE_RATIO = 6;	// Product of division of while window by edge size
1 by Suren A. Chilingaryan
Initial import
489
490
    $GRAPH_DELTA_SIZE = 10; /* delta neighborhood size, in pixels */
491
    $GRAPH_MARGINS = array (
115 by Suren A. Chilingaryan
Further drawing improvements: legend, gaps, source tree
492
	"left" => 0,
1 by Suren A. Chilingaryan
Initial import
493
	"top" => 20,
494
	"right" => 20,
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
495
	"bottom" => 30,
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
496
	"axis" => 80
1 by Suren A. Chilingaryan
Initial import
497
    );
498
    $GRAPH_SELECTION = array (
499
	"min_width" => 20,
500
	"min_height" => 20
501
    );
502
503
504
    $GRAPH_LINE_WEIGHT = 2;
505
/* Enables approximation point marks starting with accuracy greater than the
506
specified number of pixels. 0 - to disable. Significatly degradate performance
507
if used */
508
    $GRAPH_ACCURACY_MARKS_OUTSET = 14;
509
    $GRAPH_ACCURACY_MARKS_MULTIOUTSET = 49;
510
    $GRAPH_ACCURACY_MARKS_IF_GAPS = false;	// Force if data gaps are found
511
    $GRAPH_ACCURACY_MARKS_COLOR = "blue";
512
#   $GRAPH_ACCURACY_MARKS_TYPE = MARK_FILLEDCIRCLE;
513
    $GRAPH_ACCURACY_MARKS_SIZE = 3;
514
    
515
/* Display a bar on top of the graph, indicating the density of the data. The
516
four modes are supported:
517
    SHOW_NONE: do not show
518
    SHOW_EMPTY: show only if missing (due to inavalability of the data) points 
519
    are available on the graph
520
    SHOW_POINTS: Indicate all set points on the graph (somehow duplicates 
521
    'GRAPH_ACCURACY_MARKS' functionality, but displayed even if precision is 
522
    high and GRAP_ACCURACY_MARKS are disable by OUTSET
523
    SHOW_GAPS: Will display information on data gaps. Even if point placed on
524
    the graph, but there is less data than expected, all such points will be
525
    indicated on the bar 
526
*/
527
528
    $GRAPH_INDICATE_DATA_DENSITY = 'SHOW_NONE';
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
529
//    $GRAPH_INDICATE_DATA_DENSITY = SHOW_POINTS;//SHOW_GAPS;
1 by Suren A. Chilingaryan
Initial import
530
531
    $GRAPH_DENSITY_PLOT_INVALID_SIZE = 3;
532
    $GRAPH_DENSITY_PLOT_INVALID_COLOR = 'red';
533
534
    $GRAPH_DENSITY_PLOT_VALID_SIZE = 0;
535
    $GRAPH_DENSITY_PLOT_VALID_COLOR = 'green';
536
    
537
    $GRAPH_DENSITY_POINTS_TYPE = 'MARK_FILLEDCIRCLE';
538
    $GRAPH_DENSITY_POINTS_SIZE = 1;
539
    $GRAPH_DENSITY_POINTS_COLOR = 'green';
540
    $GRAPH_DENSITY_POINTS_OUTLINE = 'black';
541
    
117 by Suren A. Chilingaryan
Multiple axis support in JavaScript, multiple fixups in source tree handling
542
    $GRAPH_FAST_LEGEND = false;		// Inpricese in rapidly changing data    
138 by Suren A. Chilingaryan
Reuse generated png files in low precision mode (to speedup wiki)
543
544
    $GRAPH_LOWPRECISION_UPDATE_RATE = 10800; // How often we should update low precision graphs
1 by Suren A. Chilingaryan
Initial import
545
    
546
    $GRAPH_SUBSECOND_THRESHOLD = 5;	/* in seconds, for shorter intervals the subsecond handling is performed */
547
548
/* This option defines a plot colors (used sequently), comment out to use black
549
only */
550
    $GRAPH_COLORS =  array("black", "blue", "orange", "brown",
551
	    "#90EE90", "#ADD8E6", "#FFC0CB", "#A020F0", "#1E90FF");
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
552
553
    $AXES_COLORS = array(
554
	array("black"),
555
	array("blue"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
556
	array("#f800e9"),
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
557
	array("green"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
558
	array("yellow")
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
559
    );
1 by Suren A. Chilingaryan
Initial import
560
/*
561
    $GRAPH_COLORS =  array("black", "#483D8B","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#1E90FF","#D19275","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC",
562
	    "#808080","#008000","#ADFF2F","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6",
563
	    "#D3D3D3","#90EE90","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#8470FF","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF",
564
	    "#BA55D3","#9370D8","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6",
565
	    "#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#D87093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#FF0000",
566
	    "#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080");
567
*/
568
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
569
    if ($ADEI_SETUP)
570
        $SAVED_ADEI_SETUP = $ADEI_SETUP;
571
    else
572
        $SAVED_ADEI_SETUP = false;
573
        
574
    if (getenv("ADEI_SETUP")) {
575
        require("config.env.php");
576
    }
577
    if (file_exists("config.actual.php")) {
578
        require("config.actual.php");
579
    } else {
580
	$ADEI_SETUP = "all";
581
    }
582
    
583
    if ($SAVED_ADEI_SETUP)
584
        $ADEI_SETUP = $SAVED_ADEI_SETUP;
1 by Suren A. Chilingaryan
Initial import
585
586
587
    if ($SETUP_MULTI_MODE) {
588
	if ($_GET['setup']) {
24 by Suren A. Chilingaryan
Logger subsystem
589
	    $ADEI_SETUP = $_GET['setup'];
1 by Suren A. Chilingaryan
Initial import
590
	    unset($_GET['setup']);
591
	} else {
592
	    $params = sizeof($_SERVER['argv']);
593
    	    if ($params>1) {
594
		$pos = array_search("-setup", $_SERVER['argv']);
24 by Suren A. Chilingaryan
Logger subsystem
595
		if (($pos)&&(($pos + 1) < $params)) $ADEI_SETUP =  $_SERVER['argv'][$pos + 1];
1 by Suren A. Chilingaryan
Initial import
596
		else $SETUP_MULTI_MODE = 0;
597
	    } else $SETUP_MULTI_MODE = 0;
598
	}
599
    }
600
398 by Suren A. Chilingaryan
Propogate correct ADEI_SETUP_STRING to JS
601
    $ADEI_SETUP_STRING = $ADEI_SETUP;
602
    
396 by Suren A. Chilingaryan
Introduce ADEI_SETUP_ARGS and support subset option to limit visible data in setup
603
    if (!isset($ADEI_SETUP_ARGS)) {
604
	$ADEI_SETUP_ARGS = array();
605
	
606
	if (preg_match("/^([^\/]+)\/(.*)$/",$ADEI_SETUP, $m)) {
607
	    $ADEI_SETUP = $m[1];
608
	    $ADEI_SETUP_ARGS['subset'] = $m[2];
609
		// we can also parse key:value pairs instead if ':' are in
610
	}
611
    }
612
24 by Suren A. Chilingaryan
Logger subsystem
613
    $SETUP_CONFIG = "setups/$ADEI_SETUP/config.php";
475 by Suren A. Chilingaryan
Further openshift fixes
614
    $SETUP_CSS = "setups/$ADEI_SETUP/config.css";
615
    $LEGACY_SETUP_CSS = "setups/$ADEI_SETUP/$ADEI_SETUP.css";
397 by Suren A. Chilingaryan
Automatically handle subset filtering
616
    
1 by Suren A. Chilingaryan
Initial import
617
    if (!file_exists("config.php")) {
618
        $curdir = getcwd();
23 by Suren A. Chilingaryan
Administrative interface and better handling of missing group channels
619
	if (preg_match("/(services|admin|system|test)$/", $curdir)) chdir("..");
620
	if (!file_exists("config.php")) {
621
	    if (preg_match("/tmp\/admin$/", $curdir)) chdir("..");
622
	}
1 by Suren A. Chilingaryan
Initial import
623
    }
624
    
625
    if (file_exists($SETUP_CONFIG)) require($SETUP_CONFIG);
33 by Suren A. Chilingaryan
Documentation and configuration updates
626
    
627
    if (file_exists("config.override.php")) require("config.override.php");
397 by Suren A. Chilingaryan
Automatically handle subset filtering
628
629
	// The option should be unset in setup if subsetting is handled inside
630
    if (isset($ADEI_SETUP_ARGS['subset'])) {
631
	$subset = $ADEI_SETUP_ARGS['subset'];
412 by Suren A. Chilingaryan
Support multi-server SETUP subsets
632
	foreach (array_keys($READER_DB) as $key) {
633
	    if (!preg_match("/^{$subset}([_\-\\/]|$)/", $key))
634
		unset($READER_DB[$key]);
635
	}
397 by Suren A. Chilingaryan
Automatically handle subset filtering
636
    }
484 by Suren A. Chilingaryan
Group INSERTs into the transactions for better INNODB performance
637
638
    if ($ADEI_CACHE_ENGINE != "INNODB") {
639
	$ADEI_CACHE_COMPRESSION = "None";
640
	$ADEI_TRANSACTION_SIZE = false;
641
    }
642
195 by Suren A. Chilingaryan
Image Export by Arsen Sogomonyan
643
?>