21 #include "GaugeRadialPointer.h" 22 #include "ChartWindow.h" 24 #include "ButtonWindow.h" 25 #include "SensorDataBuffer.h" 26 #include "SensorManager.h" 27 #include "FakeSensor.h" 33 Gauge *_gaugeRadialPointer;
40 SensorManager *_sensorManager;
56 int gauge_axis_y_margins=3;
60 gaugeAxis->
SetOffset(szx-offsetX,gauge_axis_y_margins);
61 _gaugeBar=
new GaugeBar(gaugeAxis,x,1,szx,szy);
72 _chartWindow=
new ChartWindow(NULL,chartYAxis,x,height/2+2,szx,szy);
86 _btnFast=
new Button(x,y,szx,szy,F(
"Fast"));
89 _btnSlow=
new Button(x,y,szx,szy,F(
"Slow"));
93 _btnTop=
new ButtonWindow(ButtonWindow::TriangleTop,x+15,y,szx,szy);
95 _btnBottom=
new ButtonWindow(ButtonWindow::TriangleBottom,x+15,y,szx,szy);
118 out<<F(
"touch in gauges fast")<<endln;
119 if(_sensorManager!=NULL)
121 _sensorManager->SetPause(_sensorManager->GetPause()*0.9);
124 else if(window==_btnSlow)
126 out<<F(
"touch in gauges slow")<<endln;
127 if(_sensorManager!=NULL)
129 _sensorManager->SetPause(_sensorManager->GetPause()*1.1);
132 else if(window==_btnTop)
134 out<<F(
"touch in gauges top")<<endln;
135 if(_sensorManager!=NULL)
136 ((
FakeSensor *)_sensorManager->Sensor())->Increase();
138 else if(window==_btnBottom)
140 out<<F(
"touch in gauges bottom")<<endln;
141 if(_sensorManager!=NULL)
142 ((
FakeSensor *)_sensorManager->Sensor())->Decrease();
148 float value=sensorManager->GetData();
150 _gaugeRadialPointer->
SetValue(value);
152 _sensorManager=sensorManager;
153 _chartWindow->
SetBuffer(sensorManager->SecBuffer());
void initButton(ButtonWindow *button)
Initialize button windows.
Definition: GaugesWindow.h:108
void NotifyTouch(Window *window)
Events routing for gui interaction (see RegisterTouchEventReceiver and public ITouchEventReceiver dec...
Definition: GaugesWindow.h:114
int EstimateRight(DC *dc)
Estimates decorator right coordinate.
Definition: DecoratorPrimitives.h:219
void NotifySensorHasData(SensorManager *sensorManager)
Event sensor has new data. If data is the same as measured previosly. This event is not generated (se...
Definition: GaugesWindow.h:146
void RegisterTouchEventReceiver(ITouchEventReceiver *touchEventReceiver)
Registers receiver for touch event.
Definition: Window.h:102
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
float SetValue(float value)
Sets display value.
Definition: Gauge.h:75
Base class for window with text content.
Definition: TextBox.h:30
void NotifySensorMeasured(SensorManager *sensorManager)
Event is generated after each measurement.
Definition: GaugesWindow.h:157
Gauge radial pointer class.
Definition: GaugeRadialPointer.h:24
Vertcal axis with the labels left to the axis.
Definition: DecoratorPrimitives.h:152
Text box for numbers.
Definition: TextBoxNumber.h:24
void SetOffset(int offsetX, int offsetY)
Sets decorator offset in the parent window coordinate system.
Definition: DecoratorPrimitives.h:188
void InvalidateOnlyChartArea()
Forces to repain only chart arey (not axises) - reduces flickering.
Definition: ChartWindow.h:60
Axis decorator primitive. It is shared between gauge and chart objects. Overriden members description...
Definition: DecoratorPrimitives.h:145
GaugesWindow(int width, int height)
Constructor.
Definition: GaugesWindow.h:48
void initTextBox(TextBox *textBox)
Initialize text box windows.
Definition: GaugesWindow.h:100
Gauge window class, that allows visualisaion of data in form of bar or radial pointer.
Definition: Gauge.h:24
Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing functio...
Definition: DC.h:29
Chart window implement XY plots.
Definition: ChartWindow.h:30
Decorator primitive for 3D rectangle. Overriden members description see Decorator class documentation...
Definition: DecoratorPrimitives.h:130
Decorator primitive that sets current color. Overriden members description see Decorator class docume...
Definition: DecoratorPrimitives.h:24
Vertcal axis with the labels right to the axis.
Definition: DecoratorPrimitives.h:153
Main window of gauges example. Routs events between child elements.
Definition: GaugesWindow.h:30
Decorator primitive for round rect filled area. Overriden members description see Decorator class doc...
Definition: DecoratorPrimitives.h:79
void AddChild(Window *window)
Adds window child window.
Definition: Window.h:194
Fake sensor. It is intended only to generate some data. Sensor value can be modified via Increase...
Definition: FakeSensor.h:22
void SetBuffer(IDataBuffer *buffer)
Sets data buffer.
Definition: ChartWindow.h:54
void SetNumber(float number)
Initialize window with number.
Definition: TextBoxNumber.h:74
void AddDecorator(Decorator *decorator)
Adds decorator to the decaorator list.
Definition: Window.h:86
Base class for main application window. Each application has to have one main window, which is root parent for all other application windows.
Definition: MainWindow.h:38
void SetFillColor(Color fillColor)
Sets fill color.
Definition: Gauge.h:56
Interface that provides screen touch notifications. If you want receive this notification in the targ...
Definition: ITouchEventReceiver.h:24
Bar gauge class.
Definition: GaugeBar.h:25
void SetMargins(int offset_x, int offset_y)
Defines offset from left and top for text.
Definition: TextBox.h:58