RequestOutPutPlotElementPlotFunctionNodeClass.php
4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
require_once("RequestOutPutPlotElementPlotFunctionNodeClass.php");
class RequestOutPutPlotElementPlotFunctionNodeClass extends RequestOutputPlotElementNodeClass
{
const REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME = "plotFunction";
const PLOT_FUNCTION_ABSCISSE = "abscisse";
const PLOT_FUNCTION_SCALE_ABSCISSE = "scale_abscisse";
const PLOT_FUNCTION_SCALE_ORDONNEE = "scale_ordonnee";
const PLOT_FUNCTION_PARAMS_NB_POINTS = "param_nb_points";
const PLOT_FUNCTION_TYPE = "type";
const PLOT_FUNCTION_TIMEAXIS_ID = "xaxis_id1";
const PLOT_FUNCTION_YAXIS_ID = "y-left";
const PLOT_FUNCTION_DIGITALAXIS_ID = "xaxis_id";
const PLOT_FUNCTION_FFT = "FFT";
const PLOT_FUNCTION_DFT = "DFT";
const PLOT_FUNCTION_IHERITS = "Inherits";
const PLOT_FUNCTION_FREQUNECY = "Frequency";
const PLOT_FUNCTION_PERIOD = "Period";
public function __construct()
{
parent::__construct(RequestOutPutPlotElementPlotFunctionNodeClass::REQUESTOUTPUTPLOTELEMENT_PLOTFUNCTION_NAME, true, false, false, false, false, true);
//create x axis
$this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS, REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
//force color axis creation
$this->getAxes()->getColorAxis();
}
public function getTimeAxis()
{
$timeAxis = $this->getAxes()->getTimeAxis();
$timeAxis->setId(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_TIMEAXIS_ID);
return $timeAxis;
}
/**
* Check if the function to apply is Fourier
*/
public static function isFourier($value)
{
return $value == RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FFT
|| $value == RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_DFT;
}
/**
* Get a label to assoiciated with getAbscisse type when using Fourier
*/
public static function getTextLegend($abscisse)
{
return $abscisse === RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_FREQUNECY ? "Freq, Hz" : "Period, S";
}
public function getXAxis()
{
return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS, REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
}
public function addYAxis($id)
{
return $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, $id);
}
public function getYAxis($id)
{
return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS, $id);
}
public function getZAxis()
{
return $this->getAxes()->getColorAxis();
}
public function loadFromNode($xmlNode)
{
parent::loadFromNode($xmlNode);
}
/**
* Set Abscisse
*/
public function setAbscisse($abscisse)
{
$this->setAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_ABSCISSE, $abscisse);
}
/**
* Get Abscisse
*/
public function getAbscisse()
{
$this->getAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_ABSCISSE);
}
/**
* Set Type
*/
public function setType($type)
{
$this->setAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_TYPE, $type);
}
/**
* Get Type
*/
public function getType()
{
$this->getAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_TYPE);
}
/**
* Set Scale Abscisse
*/
public function setScaleAbscisse($scale_abscisse)
{
$this->setAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ABSCISSE, $scale_abscisse);
}
/**
* Get Scale Abscisse
*/
public function getScaleAbscisse()
{
$this->getAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ABSCISSE);
}
/**
* Set Scale Ordonnée
*/
public function setScaleOrdonnee($scale_ordonnee)
{
$this->setAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ORDONNEE, $scale_ordonnee);
}
/**
* Get Scale Ordonnée
*/
public function getScaleOrdonnee()
{
$this->getAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_SCALE_ORDONNEE);
}
/*
* Set Param's nb points for FFT
public function setParamsNbPoints($nb)
{
$this->setAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_PARAMS_NB_POINTS, $nb);
}
GET Param's nb points for FFT
public function getParamsNbPoints()
{
$this->getAttribute(RequestOutPutPlotElementPlotFunctionNodeClass::PLOT_FUNCTION_PARAMS_NB_POINTS);
}*/
}