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