pfodParser 3.55.0 The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections

pfodDwgsBase.h
Go to the documentation of this file.
1 #ifndef pfodDwgsBase_h
2 #define pfodDwgsBase_h
3 /*
4 * (c)2014-2017 Forward Computing and Control Pty. Ltd.
5 * NSW Australia, www.forward.com.au
6 * This code is not warranted to be fit for any purpose. You may only use it at your own risk.
7 * This code may be freely used for both private and commercial use
8 * Provide this copyright is maintained.
9 */
10 #include <stdint.h>
11 #include <Arduino.h>
12 #include "pfodAutoIdx.h"
13
14
15 struct VALUES {
16 float startAngle;
17 float arcAngle;
18 const char *text;
19 const __FlashStringHelper *textF;
20 const char *units;
21 const __FlashStringHelper *unitsF;
22 float reading;
23 uint8_t haveReading;
24 int32_t value;
25 uint8_t haveValue;
26 float displayMax;
27 float displayMin;
28 int32_t max;
29 int32_t min;
30 int decPlaces;
31 int fontSize;
32 uint8_t bold;
33 uint8_t italic;
34 uint8_t underline;
35 int color; // default WHITE is
36 int backgroundColor; // default is 0 black
37 float width;
38 float height;
39 float colOffset;
40 float rowOffset;
41 uint16_t idx;
42 float radius;
43 char cmd;
44 const char* cmdStr; // for loading inserted dwg
45 char loadCmd; // for erase inserted dwg
46 const char* loadCmdStr; // for erase inserted dwg
47 uint16_t filter;
48 uint8_t filled;
49 uint8_t rounded;
50 uint8_t encodeOutput; // non-zero if output should replace restricted chars
51 uint8_t centered;
52 char align;
53 };
54
55 class pfodDwgsBase {
56 public:
57 virtual void send(char _startChar = '|');
58 Print *out;
59 static const int BLACK_WHITE = -1;
60 static const int BLACK = 0;
61 static const int MAROON = 1;
62 static const int GREEN = 2;
63 static const int OLIVE = 3;
64 static const int NAVY = 4;
65 static const int PURPLE = 5;
66 static const int TEAL = 6;
67 static const int SILVER = 7;
68 static const int GREY = 8;
69 static const int RED = 9;
70 static const int LIME = 10;
71 static const int YELLOW = 11;
72 static const int BLUE = 12;
73 static const int FUCHSIA = 13;
74 static const int MAGENTA = FUCHSIA;
75 static const int AQUA = 14;
76 static const int WHITE = 15;
77 // touchZone filters
78 const static int TOUCH = 0; // touches blocked if pfodApp busy waiting for response
79 const static int DOWN = 1; // queued if pfodApp busy waiting for response
80 const static int DRAG = 2; // queued if pfodApp busy waiting for response
81 const static int UP = 4; // queued if pfodApp busy waiting for response
82 const static int CLICK = 8; // queued if pfodApp busy waiting for response
83 const static int PRESS = 16; // queued if pfodApp busy waiting for response
84 const static int ENTRY = 32; // queued if pfodApp busy waiting for response
85 const static int EXIT = 64; // queued if pfodApp busy waiting for response
86 // these flags are NEVER sent to pfodApp
87 const static int DOWN_UP = 256; // msg not sent until finger removed (UP) but updates touchAction
88 const static int TOUCH_DISABLED = 512; // capture touch to prevent scroll but do not send msg
89
90 // These are only valid for size and offset, and label values
91 const static uint16_t TOUCHED_COL = 65534; // only used in touchZone actions to specify touched col value
92 const static uint16_t TOUCHED_ROW = 65532; // only used in touchZone actions to specify touched row value
93 const static uint16_t TOUCHED_X = 65534; // only used in touchZone actions to specify touched col value
94 const static uint16_t TOUCHED_Y = 65532; // only used in touchZone actions to specify touched row value
95
96 void printFloatNumber(float f); // prints just number, no ~
97 protected:
98 void startText();
99 void encodeText(Print* out, uint8_t encodeOutput, const char *cPtr); // replace resticted char if encode non-zero else just drop ` ~ { }
100 void encodeText(Print* out, uint8_t encodeOutput, const __FlashStringHelper *ifsh);
101 void encodeChar(Print* out, uint8_t encodeOutput, char c);
102 void printFloat(float f); // prints ~ + number
103 void printFloatDecimals(float f,int decPlaces); // prints float with +/- decimals, no ~
104 void sendColRowVars(float val); // replace special valuse with c r rc or rr
105 void printColor();
106 void printTextFormatsWithBkgndColor(); // for dialog input only
107 void printIdx();
108 void colRowOffset();
109 void colWidthHeight();
110 void initValues(struct VALUES* _valuesPtr);
111 struct VALUES* valuesPtr;
112 pfodDwgsBase();
113 int getAutoIdx(uint16_t &idx);
114 private:
115 void printTextFormats(); // called from printTextFormatsWithBkgndColor() and startText()
116 };
117
118 #endif // pfodDwgsBase_h
pfodDwgsBase
Definition: pfodDwgsBase.h:55
pfodDwgsBase::printFloatNumber
void printFloatNumber(float f)
pfodDwgsBase::AQUA
static const int AQUA
Definition: pfodDwgsBase.h:75
pfodDwgsBase::ENTRY
static const int ENTRY
Definition: pfodDwgsBase.h:84
pfodDwgsBase::YELLOW
static const int YELLOW
Definition: pfodDwgsBase.h:71
pfodDwgsBase::printFloatDecimals
void printFloatDecimals(float f, int decPlaces)
pfodDwgsBase::printFloat
void printFloat(float f)
pfodDwgsBase::EXIT
static const int EXIT
Definition: pfodDwgsBase.h:85
pfodDwgsBase::initValues
void initValues(struct VALUES *_valuesPtr)
pfodDwgsBase::PURPLE
static const int PURPLE
Definition: pfodDwgsBase.h:65
pfodDwgsBase::printTextFormatsWithBkgndColor
void printTextFormatsWithBkgndColor()
pfodDwgsBase::TOUCHED_ROW
static const uint16_t TOUCHED_ROW
Definition: pfodDwgsBase.h:92
pfodDwgsBase::send
virtual void send(char _startChar='|')
pfodDwgsBase::BLACK
static const int BLACK
Definition: pfodDwgsBase.h:60
pfodDwgsBase::TOUCH
static const int TOUCH
Definition: pfodDwgsBase.h:78
pfodDwgsBase::RED
static const int RED
Definition: pfodDwgsBase.h:69
pfodDwgsBase::encodeChar
void encodeChar(Print *out, uint8_t encodeOutput, char c)
pfodDwgsBase::encodeText
void encodeText(Print *out, uint8_t encodeOutput, const __FlashStringHelper *ifsh)
pfodDwgsBase::pfodDwgsBase
pfodDwgsBase()
pfodDwgsBase::TOUCHED_X
static const uint16_t TOUCHED_X
Definition: pfodDwgsBase.h:93
pfodDwgsBase::DRAG
static const int DRAG
Definition: pfodDwgsBase.h:80
pfodDwgsBase::colRowOffset
void colRowOffset()
pfodDwgsBase::UP
static const int UP
Definition: pfodDwgsBase.h:81
pfodDwgsBase::BLUE
static const int BLUE
Definition: pfodDwgsBase.h:72
pfodDwgsBase::TOUCH_DISABLED
static const int TOUCH_DISABLED
Definition: pfodDwgsBase.h:88
pfodDwgsBase::SILVER
static const int SILVER
Definition: pfodDwgsBase.h:67
pfodDwgsBase::printColor
void printColor()
pfodDwgsBase::sendColRowVars
void sendColRowVars(float val)
pfodDwgsBase::GREEN
static const int GREEN
Definition: pfodDwgsBase.h:62
pfodDwgsBase::out
Print * out
Definition: pfodDwgsBase.h:58
pfodDwgsBase::CLICK
static const int CLICK
Definition: pfodDwgsBase.h:82
pfodDwgsBase::FUCHSIA
static const int FUCHSIA
Definition: pfodDwgsBase.h:73
pfodDwgsBase::encodeText
void encodeText(Print *out, uint8_t encodeOutput, const char *cPtr)
pfodDwgsBase::printIdx
void printIdx()
pfodDwgsBase::OLIVE
static const int OLIVE
Definition: pfodDwgsBase.h:63
pfodDwgsBase::getAutoIdx
int getAutoIdx(uint16_t &idx)
pfodDwgsBase::GREY
static const int GREY
Definition: pfodDwgsBase.h:68
pfodDwgsBase::BLACK_WHITE
static const int BLACK_WHITE
Definition: pfodDwgsBase.h:59
pfodDwgsBase::startText
void startText()
pfodDwgsBase::WHITE
static const int WHITE
Definition: pfodDwgsBase.h:76
pfodDwgsBase::PRESS
static const int PRESS
Definition: pfodDwgsBase.h:83
pfodDwgsBase::DOWN
static const int DOWN
Definition: pfodDwgsBase.h:79
pfodDwgsBase::MAGENTA
static const int MAGENTA
Definition: pfodDwgsBase.h:74
pfodDwgsBase::TOUCHED_Y
static const uint16_t TOUCHED_Y
Definition: pfodDwgsBase.h:94
pfodDwgsBase::colWidthHeight
void colWidthHeight()
pfodDwgsBase::DOWN_UP
static const int DOWN_UP
Definition: pfodDwgsBase.h:87
pfodDwgsBase::NAVY
static const int NAVY
Definition: pfodDwgsBase.h:64
pfodDwgsBase::LIME
static const int LIME
Definition: pfodDwgsBase.h:70
pfodDwgsBase::valuesPtr
struct VALUES * valuesPtr
Definition: pfodDwgsBase.h:111
pfodDwgsBase::MAROON
static const int MAROON
Definition: pfodDwgsBase.h:61
pfodDwgsBase::TEAL
static const int TEAL
Definition: pfodDwgsBase.h:66
pfodDwgsBase::TOUCHED_COL
static const uint16_t TOUCHED_COL
Definition: pfodDwgsBase.h:91
pfodAutoIdx.h
VALUES
Definition: pfodDwgsBase.h:15
VALUES::cmdStr
const char * cmdStr
Definition: pfodDwgsBase.h:44
VALUES::unitsF
const __FlashStringHelper * unitsF
Definition: pfodDwgsBase.h:21
VALUES::filter
uint16_t filter
Definition: pfodDwgsBase.h:47
VALUES::displayMax
float displayMax
Definition: pfodDwgsBase.h:26
VALUES::haveReading
uint8_t haveReading
Definition: pfodDwgsBase.h:23
VALUES::reading
float reading
Definition: pfodDwgsBase.h:22
VALUES::decPlaces
int decPlaces
Definition: pfodDwgsBase.h:30
VALUES::rounded
uint8_t rounded
Definition: pfodDwgsBase.h:49
VALUES::max
int32_t max
Definition: pfodDwgsBase.h:28
VALUES::fontSize
int fontSize
Definition: pfodDwgsBase.h:31
VALUES::loadCmd
char loadCmd
Definition: pfodDwgsBase.h:45
VALUES::italic
uint8_t italic
Definition: pfodDwgsBase.h:33
VALUES::loadCmdStr
const char * loadCmdStr
Definition: pfodDwgsBase.h:46
VALUES::height
float height
Definition: pfodDwgsBase.h:38
VALUES::units
const char * units
Definition: pfodDwgsBase.h:20
VALUES::textF
const __FlashStringHelper * textF
Definition: pfodDwgsBase.h:19
VALUES::width
float width
Definition: pfodDwgsBase.h:37
VALUES::backgroundColor
int backgroundColor
Definition: pfodDwgsBase.h:36
VALUES::rowOffset
float rowOffset
Definition: pfodDwgsBase.h:40
VALUES::colOffset
float colOffset
Definition: pfodDwgsBase.h:39
VALUES::underline
uint8_t underline
Definition: pfodDwgsBase.h:34
VALUES::value
int32_t value
Definition: pfodDwgsBase.h:24
VALUES::haveValue
uint8_t haveValue
Definition: pfodDwgsBase.h:25
VALUES::encodeOutput
uint8_t encodeOutput
Definition: pfodDwgsBase.h:50
VALUES::displayMin
float displayMin
Definition: pfodDwgsBase.h:27
VALUES::startAngle
float startAngle
Definition: pfodDwgsBase.h:16
VALUES::min
int32_t min
Definition: pfodDwgsBase.h:29
VALUES::bold
uint8_t bold
Definition: pfodDwgsBase.h:32
VALUES::idx
uint16_t idx
Definition: pfodDwgsBase.h:41
VALUES::radius
float radius
Definition: pfodDwgsBase.h:42
VALUES::color
int color
Definition: pfodDwgsBase.h:35
VALUES::filled
uint8_t filled
Definition: pfodDwgsBase.h:48
VALUES::centered
uint8_t centered
Definition: pfodDwgsBase.h:51
VALUES::arcAngle
float arcAngle
Definition: pfodDwgsBase.h:17
VALUES::text
const char * text
Definition: pfodDwgsBase.h:18
VALUES::align
char align
Definition: pfodDwgsBase.h:52
VALUES::cmd
char cmd
Definition: pfodDwgsBase.h:43