/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(
548 by Suren A. Chilingaryan
Optimize Cache Administrator (inroduces new REQUEST flags and significant changes to CACHEDB)
89
		'max_gap' => 600,
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)
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*/
548 by Suren A. Chilingaryan
Optimize Cache Administrator (inroduces new REQUEST flags and significant changes to CACHEDB)
441
    $ADEI_CACHE_LATENCY_THRESHOLD = 1800;    // Bellow this threshold, we consider normal latency between source data & cache
210.1.2 by Suren A. Chilingaryan
Download manager by Aki Rimpelainen
442
  
290 by Suren A. Chilingaryan
Limit size of log files unless config option is specified
443
    $JPGRAPH_PATH = "/usr/share/php5/jpgraph";
1 by Suren A. Chilingaryan
Initial import
444
    $EXCEL_WRITER_PATH ="";
24 by Suren A. Chilingaryan
Logger subsystem
445
    $TMP_PATH=$ADEI_ROOTDIR . "tmp";
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
446
447
    $ADEI_ROOT_STORAGE = "$ADEI_ROOTDIR/storage/";
1 by Suren A. Chilingaryan
Initial import
448
    
449
    $ADEI_APP_PATH = array (
53 by Suren A. Chilingaryan
fixups and some search hooks (incomplete)
450
	"default" => "/usr/bin/"
1 by Suren A. Chilingaryan
Initial import
451
    );
452
    
453
    $CSV_SEPARATOR = ",";
454
    $CSV_DATE_FORMAT = "d-M-y H:i:s";
455
    $EXCEL_DATE_FORMAT = "DD.MM.YYYY hh:mm:ss";
456
    $EXCEL_SUBSEC_FORMAT = "DD.MM.YYYY hh:mm:ss.000;@"; /* 
457
	    Unfortunately Excel doesn't support more than 3 digits,
458
	    OpenOffice does */
459
    $ROOT_COMBIHIST_LIMIT = 604800; /* No more, than 1 week */
460
461
14 by Suren A. Chilingaryan
Some minimal information on status bar
462
    $STATUS_DEFAULT_DURATION = 2000;	/* in milliseconds */
463
464
1 by Suren A. Chilingaryan
Initial import
465
    $GRAPH_DEFAULT_HEIGHT = 768; /* in pixels */
466
    $GRAPH_DEFAULT_WIDTH = 1024; /* in pixels */
354.1.11 by Suren A. Chilingaryan
Limit max axes per graph
467
    $GRAPH_MAX_AXES = 6;
1 by Suren A. Chilingaryan
Initial import
468
/* Maximal number of points (all plots) on Graph, this allows us to produce 
469
rough multiplots to sustain high update rate (most of resources are used to 
470
graph->Stroke()) */
471
    $GRAPH_MAX_POINTS_PER_GRAPH = 5000;
472
/* Maximal approximation interval (in pixels). I.e. maximal distance between
473
to approximation points. This option have a priority over MAX_POINTS_PER_GRAPH
474
option. */
475
    $GRAPH_MAX_APPROXIMATION_INTERVAL = 10; /* in pixels */
476
477
    $GRAPH_AUTOAGGREGATION_MINMAX_THRESHOLD = 10; /* in precision, approx. px/2 */
478
479
    $GRAPH_INTERPOLATE_DATA_GAPS = false; /* Do not indicate missing data */
480
481
/* Maximal distance between currently CACHEd data and the data available in the
482
data source, measured in seconds. 0 means - unlimited */
483
    $GRAPH_MAX_CACHE_GAP = 0;
484
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
485
    
486
    $GRAPH_ZOOM_RATIO = 2.;	// This coeficent defines product of division of original window by zoomed window
487
    $GRAPH_DEEPZOOM_AREA = 10;	// In pixels (actual interval is 2x)
488
    $GRAPH_STEP_RATIO = 5.;	// This coeficent defines product of division of original window by step
489
    $GRAPH_EDGE_RATIO = 6;	// Product of division of while window by edge size
1 by Suren A. Chilingaryan
Initial import
490
491
    $GRAPH_DELTA_SIZE = 10; /* delta neighborhood size, in pixels */
492
    $GRAPH_MARGINS = array (
115 by Suren A. Chilingaryan
Further drawing improvements: legend, gaps, source tree
493
	"left" => 0,
1 by Suren A. Chilingaryan
Initial import
494
	"top" => 20,
495
	"right" => 20,
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
496
	"bottom" => 30,
149 by Suren A. Chilingaryan
Y-axis labeling fixes (specially case xxxxxxxx.000001)
497
	"axis" => 80
1 by Suren A. Chilingaryan
Initial import
498
    );
499
    $GRAPH_SELECTION = array (
500
	"min_width" => 20,
501
	"min_height" => 20
502
    );
503
504
505
    $GRAPH_LINE_WEIGHT = 2;
506
/* Enables approximation point marks starting with accuracy greater than the
507
specified number of pixels. 0 - to disable. Significatly degradate performance
508
if used */
509
    $GRAPH_ACCURACY_MARKS_OUTSET = 14;
510
    $GRAPH_ACCURACY_MARKS_MULTIOUTSET = 49;
511
    $GRAPH_ACCURACY_MARKS_IF_GAPS = false;	// Force if data gaps are found
512
    $GRAPH_ACCURACY_MARKS_COLOR = "blue";
513
#   $GRAPH_ACCURACY_MARKS_TYPE = MARK_FILLEDCIRCLE;
514
    $GRAPH_ACCURACY_MARKS_SIZE = 3;
515
    
516
/* Display a bar on top of the graph, indicating the density of the data. The
517
four modes are supported:
518
    SHOW_NONE: do not show
519
    SHOW_EMPTY: show only if missing (due to inavalability of the data) points 
520
    are available on the graph
521
    SHOW_POINTS: Indicate all set points on the graph (somehow duplicates 
522
    'GRAPH_ACCURACY_MARKS' functionality, but displayed even if precision is 
523
    high and GRAP_ACCURACY_MARKS are disable by OUTSET
524
    SHOW_GAPS: Will display information on data gaps. Even if point placed on
525
    the graph, but there is less data than expected, all such points will be
526
    indicated on the bar 
527
*/
528
529
    $GRAPH_INDICATE_DATA_DENSITY = 'SHOW_NONE';
11 by Suren A. Chilingaryan
Graph navigation: mouse wheel, modifier keys, etc.
530
//    $GRAPH_INDICATE_DATA_DENSITY = SHOW_POINTS;//SHOW_GAPS;
1 by Suren A. Chilingaryan
Initial import
531
532
    $GRAPH_DENSITY_PLOT_INVALID_SIZE = 3;
533
    $GRAPH_DENSITY_PLOT_INVALID_COLOR = 'red';
534
535
    $GRAPH_DENSITY_PLOT_VALID_SIZE = 0;
536
    $GRAPH_DENSITY_PLOT_VALID_COLOR = 'green';
537
    
538
    $GRAPH_DENSITY_POINTS_TYPE = 'MARK_FILLEDCIRCLE';
539
    $GRAPH_DENSITY_POINTS_SIZE = 1;
540
    $GRAPH_DENSITY_POINTS_COLOR = 'green';
541
    $GRAPH_DENSITY_POINTS_OUTLINE = 'black';
542
    
117 by Suren A. Chilingaryan
Multiple axis support in JavaScript, multiple fixups in source tree handling
543
    $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)
544
545
    $GRAPH_LOWPRECISION_UPDATE_RATE = 10800; // How often we should update low precision graphs
1 by Suren A. Chilingaryan
Initial import
546
    
547
    $GRAPH_SUBSECOND_THRESHOLD = 5;	/* in seconds, for shorter intervals the subsecond handling is performed */
548
549
/* This option defines a plot colors (used sequently), comment out to use black
550
only */
551
    $GRAPH_COLORS =  array("black", "blue", "orange", "brown",
552
	    "#90EE90", "#ADD8E6", "#FFC0CB", "#A020F0", "#1E90FF");
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
553
554
    $AXES_COLORS = array(
555
	array("black"),
556
	array("blue"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
557
	array("#f800e9"),
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
558
	array("green"),
119 by Suren A. Chilingaryan
New way of service handling (mod_rewrite), Various fixups, katrin stuff moved to SETUP directory
559
	array("yellow")
114 by Suren A. Chilingaryan
Massive rewrite of DRAW (unfinished): multiple groups and axis
560
    );
1 by Suren A. Chilingaryan
Initial import
561
/*
562
    $GRAPH_COLORS =  array("black", "#483D8B","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#1E90FF","#D19275","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC",
563
	    "#808080","#008000","#ADFF2F","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6",
564
	    "#D3D3D3","#90EE90","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#8470FF","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF",
565
	    "#BA55D3","#9370D8","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6",
566
	    "#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#D87093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#FF0000",
567
	    "#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080");
568
*/
569
481 by Suren A. Chilingaryan
Various improvements for OpenShift operation
570
    if ($ADEI_SETUP)
571
        $SAVED_ADEI_SETUP = $ADEI_SETUP;
572
    else
573
        $SAVED_ADEI_SETUP = false;
574
        
575
    if (getenv("ADEI_SETUP")) {
576
        require("config.env.php");
577
    }
578
    if (file_exists("config.actual.php")) {
579
        require("config.actual.php");
580
    } else {
581
	$ADEI_SETUP = "all";
582
    }
583
    
584
    if ($SAVED_ADEI_SETUP)
585
        $ADEI_SETUP = $SAVED_ADEI_SETUP;
1 by Suren A. Chilingaryan
Initial import
586
587
588
    if ($SETUP_MULTI_MODE) {
589
	if ($_GET['setup']) {
24 by Suren A. Chilingaryan
Logger subsystem
590
	    $ADEI_SETUP = $_GET['setup'];
1 by Suren A. Chilingaryan
Initial import
591
	    unset($_GET['setup']);
592
	} else {
593
	    $params = sizeof($_SERVER['argv']);
594
    	    if ($params>1) {
595
		$pos = array_search("-setup", $_SERVER['argv']);
24 by Suren A. Chilingaryan
Logger subsystem
596
		if (($pos)&&(($pos + 1) < $params)) $ADEI_SETUP =  $_SERVER['argv'][$pos + 1];
1 by Suren A. Chilingaryan
Initial import
597
		else $SETUP_MULTI_MODE = 0;
598
	    } else $SETUP_MULTI_MODE = 0;
599
	}
600
    }
601
398 by Suren A. Chilingaryan
Propogate correct ADEI_SETUP_STRING to JS
602
    $ADEI_SETUP_STRING = $ADEI_SETUP;
603
    
396 by Suren A. Chilingaryan
Introduce ADEI_SETUP_ARGS and support subset option to limit visible data in setup
604
    if (!isset($ADEI_SETUP_ARGS)) {
605
	$ADEI_SETUP_ARGS = array();
606
	
607
	if (preg_match("/^([^\/]+)\/(.*)$/",$ADEI_SETUP, $m)) {
608
	    $ADEI_SETUP = $m[1];
609
	    $ADEI_SETUP_ARGS['subset'] = $m[2];
610
		// we can also parse key:value pairs instead if ':' are in
611
	}
612
    }
613
24 by Suren A. Chilingaryan
Logger subsystem
614
    $SETUP_CONFIG = "setups/$ADEI_SETUP/config.php";
475 by Suren A. Chilingaryan
Further openshift fixes
615
    $SETUP_CSS = "setups/$ADEI_SETUP/config.css";
616
    $LEGACY_SETUP_CSS = "setups/$ADEI_SETUP/$ADEI_SETUP.css";
397 by Suren A. Chilingaryan
Automatically handle subset filtering
617
    
1 by Suren A. Chilingaryan
Initial import
618
    if (!file_exists("config.php")) {
619
        $curdir = getcwd();
23 by Suren A. Chilingaryan
Administrative interface and better handling of missing group channels
620
	if (preg_match("/(services|admin|system|test)$/", $curdir)) chdir("..");
621
	if (!file_exists("config.php")) {
622
	    if (preg_match("/tmp\/admin$/", $curdir)) chdir("..");
623
	}
1 by Suren A. Chilingaryan
Initial import
624
    }
625
    
626
    if (file_exists($SETUP_CONFIG)) require($SETUP_CONFIG);
33 by Suren A. Chilingaryan
Documentation and configuration updates
627
    
628
    if (file_exists("config.override.php")) require("config.override.php");
397 by Suren A. Chilingaryan
Automatically handle subset filtering
629
630
	// The option should be unset in setup if subsetting is handled inside
631
    if (isset($ADEI_SETUP_ARGS['subset'])) {
632
	$subset = $ADEI_SETUP_ARGS['subset'];
412 by Suren A. Chilingaryan
Support multi-server SETUP subsets
633
	foreach (array_keys($READER_DB) as $key) {
634
	    if (!preg_match("/^{$subset}([_\-\\/]|$)/", $key))
635
		unset($READER_DB[$key]);
636
	}
397 by Suren A. Chilingaryan
Automatically handle subset filtering
637
    }
484 by Suren A. Chilingaryan
Group INSERTs into the transactions for better INNODB performance
638
639
    if ($ADEI_CACHE_ENGINE != "INNODB") {
640
	$ADEI_CACHE_COMPRESSION = "None";
641
	$ADEI_TRANSACTION_SIZE = false;
642
    }
643
195 by Suren A. Chilingaryan
Image Export by Arsen Sogomonyan
644
?>