00001 #ifndef EDDPLOTDATASOURCE_H 00002 #define EDDPLOTDATASOURCE_H 00003 00004 #include <EDDSourceLib/inc/EDDDataSource.h> 00005 #include <proto/EDDPlotDataMsg.h> 00006 00007 #ifndef EDD_EXPORT 00008 #define EDD_EXPORT 00009 #endif 00010 00018 class EDD_EXPORT tcEDDPlotDataSource : public tcEDDDataSource 00019 { 00020 public: 00022 typedef enum 00023 { 00024 eeX = 0, 00025 eeY = 1, 00026 eeZ = 2 00027 } teAxis; 00028 00029 tcEDDPlotDataSource(char* apDesc, bool abIsContinuous = false, int anMaxContPoints = 1024); 00030 00031 virtual ~tcEDDPlotDataSource(void); 00032 00033 virtual int HandleMsg(tsEDDMsgHdr* apMsg); 00034 00036 00045 int SendPlotData(float* X, float* Y, int N); 00046 int SendPlotData(int32_t* X, int32_t* Y, int N); 00047 int SendPlotData(int16_t* X, int16_t* Y, int N); 00048 int SendPlotData(int8_t* X, int8_t* Y, int N); 00049 int SendPlotData(uint32_t* X, uint32_t* Y, int N); 00050 int SendPlotData(uint16_t* X, uint16_t* Y, int N); 00051 int SendPlotData(uint8_t* X, uint8_t* Y, int N); 00053 00055 00063 int SendPlotData(float* Y, int N); 00064 int SendPlotData(uint32_t* Y, int N); 00065 int SendPlotData(uint16_t* Y, int N); 00066 int SendPlotData(uint8_t* Y, int N); 00067 int SendPlotData(int32_t* Y, int N); 00068 int SendPlotData(int16_t* Y, int N); 00069 int SendPlotData(int8_t* Y, int N); 00071 00072 int SetLabel(teAxis, char* apLabel); 00073 int SetDescription(char* apDesc); 00074 00075 int SetOffset(teAxis aeAxis, float anOffset) { maOffset[aeAxis] = anOffset; return 0; } 00076 int SetScale(teAxis aeAxis, float anScale) { maScale[aeAxis] = anScale; return 0; } 00077 00078 static const int gnMaxStringLen = 64; 00079 00080 protected: 00081 int Send2DData(void* Xdata, void* Ydata, int N, int WordSizeBytes, uint8_t anDataType); 00082 int Send1DData(void* Ydata, int N, int WordSizeBytes, uint8_t anDataType); 00083 00084 void SendPlotDescriptor(int32_t anNumPoints, uint8_t anType); 00085 void BuildOutputBuffer(void); 00086 00087 int mnPlotType; 00088 char maDescription[gnMaxStringLen]; 00089 char maXLabel[gnMaxStringLen]; 00090 char maYLabel[gnMaxStringLen]; 00091 char maZLabel[gnMaxStringLen]; 00092 float maScale[3]; 00093 float maOffset[3]; 00094 uint16_t mnPlotNo; 00095 char* mpOutputBuffer; 00096 int mnOutputBufferLen; 00097 int mnMaxContPoints; 00098 bool mbIsContinuous; 00099 }; 00100 00101 #endif