Works with simple/no kinematics
This commit is contained in:
parent
dd6f37a960
commit
471d018bfe
7 changed files with 221 additions and 245 deletions
43
hpglparser.h
43
hpglparser.h
|
|
@ -3,18 +3,39 @@
|
|||
#ifndef _HPGLPARSER_h
|
||||
#define _HPGLPARSER_h
|
||||
|
||||
#include "WString.h"
|
||||
#include "point.h"
|
||||
#include <stdio.h>
|
||||
#include "plotter.h"
|
||||
|
||||
#define PA_M 1
|
||||
#define PR_M 2
|
||||
#define SKIP_M 3
|
||||
#define ERROR_M 4
|
||||
|
||||
class HpglParser
|
||||
{
|
||||
private:
|
||||
Plotter* _plotter;
|
||||
char buffer[64];
|
||||
int bufferIndex = 0;
|
||||
|
||||
uint8_t cmdMode = 0;
|
||||
uint8_t searchMode = 0;
|
||||
|
||||
bool xSet = false;
|
||||
Point _nextPoint;
|
||||
|
||||
bool isWhitespace(const char ch);
|
||||
bool isSeparator(char ch);
|
||||
|
||||
void findCommand();
|
||||
void findCoordinats();
|
||||
|
||||
public:
|
||||
HpglParser(Plotter* plotter);
|
||||
~HpglParser(){}
|
||||
|
||||
int add(const char ch);
|
||||
};
|
||||
|
||||
String readHpglCmd();
|
||||
bool tryReadPoint(Point *pt);
|
||||
bool readSeparator();
|
||||
String readStringUntil(char ch);
|
||||
void addToBuffer(char ch);
|
||||
void setBuffer(String in);
|
||||
void purgeBuffer();
|
||||
bool isBufferEmpty();
|
||||
bool isBufferFull();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue