65
65
const ALARM_MODE_FULL_LIST = 1;
66
66
const ALARM_MODE_ACTIVE_LIST = 2;
68
const EXPORT_SKIP_HEADERS = 1;
68
70
function __construct(&$props) {
69
71
if ($props instanceof REQUEST) {
70
72
$this->req = &$props;
1001
1003
throw new ADEIException(translate("Control interface is not supported by the READER"));
1004
protected function ExportData(DATAHandler $h = NULL, LOGGROUP $grp, MASK $mask, INTERVAL $ivl = NULL, $resample = 0, array &$names, $opts = 0, $dmcb = NULL) {
1006
protected function ExportData(DATAHandler $h = NULL, LOGGROUP $grp, MASK $mask, INTERVAL $ivl = NULL, $resample = 0, array &$names, $flags = 0, $dmcb = NULL) {
1005
1007
global $DEFAULT_MISSING_VALUE;
1006
1008
$dm = new DOWNLOADMANAGER();
1007
1009
if (!$h) $h = new CSVHandler();
1014
1016
$data = $this->GetFilteredData($grp, $ivl->GetWindowStart(), $ivl->GetWindowEnd(), $filter);
1016
$columns = sizeof($names);
1019
$columns = sizeof($names);
1018
$h->Start($columns);
1019
$h->DataHeaders($names);
1021
$h->Start($columns);
1022
$h->DataHeaders($names);
1021
1027
if($dmcb != NULL) {
1022
1028
$action = "start";
1059
function Export(DATAHandler $h = NULL, LOGGROUP $grp = NULL, MASK $mask = NULL, INTERVAL $ivl = NULL, $resample = 0, $opts = 0, $dmcb = NULL) {
1063
function Export(DATAHandler $h = NULL, LOGGROUP $grp = NULL, MASK $mask = NULL, INTERVAL $ivl = NULL, $resample = 0, $flags = 0, $dmcb = NULL) {
1060
1064
$grp = $this->CheckGroup($grp);
1061
1065
if (!$mask) $mask = $this->CreateMask($grp, $minfo = array());
1063
$names = $this->GetItemList($grp, $mask);
1064
return $this->ExportData($h, $grp, $mask, $ivl, $resample, $names, $opts, $dmcb);
1067
if ($flags&READER::EXPORT_SKIP_HEADERS)
1070
$names = $this->GetItemList($grp, $mask);
1072
return $this->ExportData($h, $grp, $mask, $ivl, $resample, $names, $flags, $dmcb);
1068
function ExportCSV(STRINGHandler $h = NULL, LOGGROUP $grp = NULL, MASK $mask = NULL, INTERVAL $ivl = NULL, $resample = 0, $opts = 0) {
1069
return $this->Export(new CSVHandler($h), $grp, $msk, $ivl, $resample, $opts);
1075
function ExportCSV(STRINGHandler $h = NULL, LOGGROUP $grp = NULL, MASK $mask = NULL, INTERVAL $ivl = NULL, $resample = 0, $flags = 0) {
1076
return $this->Export(new CSVHandler($h), $grp, $msk, $ivl, $resample, $flags);