Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIPlot.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUIPLOT_H
11#define GUIPLOT_H
12
13#include "GUIObject.h"
14#include "GUIColorPropertyObserver.h"
15#include "GUIFontResource.h"
16
17#include "GUICommonEnums.h"
18
19#include "eC_TArray.h"
20
29{
30public:
40 CGUICompositeObject* const pkParent,
41 const eC_Value& vX, const eC_Value& vY,
42 const eC_Value& vWidth, const eC_Value& vHeight,
43 const ObjectHandle_t &eID = NO_HANDLE);
44
47
49 virtual ~CGUIPlot();
50
54 CGUIPlot(const CGUIPlot& kToBeCopied);
55
60 CGUIPlot& operator=(const CGUIPlot& kSource);
61
62 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
63
64 virtual void SetWidth(const eC_Value& vX);
65 virtual void SetHeight(const eC_Value& vY);
66
71 void SetNumberOfDataSources(const eC_UInt& uiNumberOfDataSources);
72
76 eC_UInt GetNumberOfDataSources() const;
77
86 void AddData(const eC_UInt& uiIndex, const eC_Float& fValue);
87
93 void SetBufferSize(const eC_UInt& uiBuffersize);
94
98 eC_UInt GetBufferSize() const;
99
106 void SetRefresh(const eC_Bool& bAutomaticRefresh, const eC_UInt& uiRefreshInterval);
107
112 void GetRefresh(eC_Bool& bAutomaticRefresh, eC_UInt& uiRefreshInterval) const;
113
117 void SetRetainValues(const eC_Bool& bRetainValues);
118
122 eC_Bool GetRetainValues() const;
123
127 void SetLabelSpacingY(const eC_UInt& uiLabelSpacingY);
128
132 eC_UInt GetLabelSpacingY() const;
133
141 void SetScaling(const eC_Value& vScalingX, const eC_Value& vScalingY);
142
147 void GetScaling(eC_Value& vScalingX, eC_Value& vScalingY) const;
148
154 void SetOffset(const eC_Value& vOffset);
155
159 eC_Value GetOffset() const;
160
165 void SetPadding(const eC_Value& vPaddingX, const eC_Value& vPaddingY);
166
171 void GetPadding(eC_Value& vPaddingX, eC_Value& vPaddingY) const;
172
176 void SetFontID(const FontResource_t& eFontID);
177
182
186 void SetAxisColor(const eC_UInt& uiAxisColor);
187
191 void SetAxisColor(const GlobalProperty_t& eAxisColor);
192
196 eC_UInt GetAxisColor() const;
197
201 void SetAxisLineWidth(const eC_Value& vAxisLineWidth);
202
206 eC_Value GetAxisLineWidth() const;
207
212 void SetLineColor(const eC_UInt& uiIndex, const eC_UInt& uiLineColor);
213
218 void SetLineColor(const eC_UInt& uiIndex, const GlobalProperty_t& eLineColor);
219
224 eC_UInt GetLineColor(const eC_UInt& uiIndex) const;
225
229 void SetLineWidth(const eC_Value& vLineWidth);
230
234 eC_Value GetLineWidth() const;
235
242 void SetInteractive(const eC_Bool& bInteractive);
243
247 eC_Bool GetInteractive() const;
248
254 void Refresh();
255
256#if defined(GUILIANI_STREAM_GUI)
261 virtual void ReadFromStream();
262#endif
263
264#if defined(GUILIANI_WRITE_GUI)
270 virtual void WriteToStream(const eC_Bool bWriteClassID=false);
271#endif
272
273 virtual eC_Bool DoDraw();
274
275 virtual eC_Bool DoDrag(
276 const eC_Value& vDeltaX,
277 const eC_Value& vDeltaY,
278 const eC_Value& vAbsX,
279 const eC_Value& vAbsY);
280
281 virtual eC_Bool DoDoubleClick(
282 const eC_Value& vAbsX,
283 const eC_Value& vAbsY);
284
285 virtual eC_Bool IsHighlightable() const { return false; }
286
287private:
288 void Init();
289 void DeInit();
290
291 void DrawAxis();
292 void DrawData(const eC_UInt& uiDataIndex);
293
294 void UpdateWindow();
295 void CalcDecimals();
296
297private:
298 static const eC_UInt INDEX_AXISCOLOR;
299 static const eC_UInt INDEX_LINECOLOR;
300 static const eC_UByte MAX_NUMBER_OF_DECIMALS;
301
302 eC_TArray<eC_TArray<eC_Float> > m_kData;
303 eC_UInt m_uiBufferSize;
304 eC_UInt m_uiReadLength;
305 eC_UInt m_uiReadIndex;
306 eC_UInt m_uiWriteIndex;
307
308 eC_Bool m_bAutomaticRefresh;
309 eC_UInt m_uiRefreshInterval;
310 eC_Bool m_bRetainValues;
311
312 eC_Value m_vScalingX;
313 eC_Value m_vScalingY;
314 eC_Value m_vOffset;
315 eC_Value m_vPaddingX;
316 eC_Value m_vPaddingY;
317 eC_UInt m_uiLabelSpacingY;
318
319 FontResource_t m_eFontID;
320 eC_UInt m_uiAxisColor;
321 eC_Value m_vAxisLineWidth;
322 eC_UInt m_uiLineColor;
323 eC_Value m_vDrawLineWidth;
324
325 eC_UInt m_uiNumberOfDataSources;
326 eC_UInt m_uiNumberLineColors;
327
328 eC_Bool m_bInteractive;
329
330 eC_Bool m_bFloatForAxis;
331 eC_UByte m_ubDecimals;
332};
333
334#endif
Helper Macros in Guiliani
FontResource_t
List of font resource ids.
Definition: GUIFontResource.h:54
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
GlobalProperty_t
List of property resource ids.
Definition: GUIPropertyResource.h:67
This observer provides the base-interface for controls when using color-properties.
Definition: GUIColorPropertyObserver.h:23
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
this control can be used to display continuous data over time. It supports automatic and manual refre...
Definition: GUIPlot.h:29
void Refresh()
virtual void ReadFromStream()
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
void SetRefresh(const eC_Bool &bAutomaticRefresh, const eC_UInt &uiRefreshInterval)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
void AddData(const eC_UInt &uiIndex, const eC_Float &fValue)
CGUIPlot(const CGUIPlot &kToBeCopied)
void SetPadding(const eC_Value &vPaddingX, const eC_Value &vPaddingY)
virtual ~CGUIPlot()
Destructor.
void GetScaling(eC_Value &vScalingX, eC_Value &vScalingY) const
eC_UInt GetBufferSize() const
void SetLineWidth(const eC_Value &vLineWidth)
eC_Value GetOffset() const
void SetLineColor(const eC_UInt &uiIndex, const eC_UInt &uiLineColor)
void SetOffset(const eC_Value &vOffset)
virtual void SetHeight(const eC_Value &vY)
eC_UInt GetLineColor(const eC_UInt &uiIndex) const
CGUIPlot & operator=(const CGUIPlot &kSource)
virtual eC_Bool DoDraw()
FontResource_t GetFontID() const
void SetScaling(const eC_Value &vScalingX, const eC_Value &vScalingY)
eC_Value GetAxisLineWidth() const
void SetAxisColor(const GlobalProperty_t &eAxisColor)
CGUIPlot(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
eC_UInt GetAxisColor() const
void SetLabelSpacingY(const eC_UInt &uiLabelSpacingY)
void SetRetainValues(const eC_Bool &bRetainValues)
void SetBufferSize(const eC_UInt &uiBuffersize)
void SetAxisColor(const eC_UInt &uiAxisColor)
void SetAxisLineWidth(const eC_Value &vAxisLineWidth)
void SetInteractive(const eC_Bool &bInteractive)
eC_Bool GetInteractive() const
eC_UInt GetNumberOfDataSources() const
virtual eC_Bool DoDoubleClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
void SetLineColor(const eC_UInt &uiIndex, const GlobalProperty_t &eLineColor)
eC_Bool GetRetainValues() const
virtual void SetWidth(const eC_Value &vX)
virtual eC_Bool IsHighlightable() const
Definition: GUIPlot.h:285
eC_UInt GetLabelSpacingY() const
void GetRefresh(eC_Bool &bAutomaticRefresh, eC_UInt &uiRefreshInterval) const
void SetFontID(const FontResource_t &eFontID)
virtual eC_Bool DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
void SetNumberOfDataSources(const eC_UInt &uiNumberOfDataSources)
eC_Value GetLineWidth() const
CGUIPlot()
Default constructor.
void GetPadding(eC_Value &vPaddingX, eC_Value &vPaddingY) const