Baseclient struct data to extra class

pull/125/head
Robert Stein 2020-12-15 13:58:12 +01:00
parent 89d0625ecb
commit 912ef576c6
3 changed files with 35 additions and 30 deletions

View File

@ -4,13 +4,7 @@
#include <base64.h> #include <base64.h>
#include "Debug.h" #include "Debug.h"
#include "../Network/JsonRequestClient.h" #include "../Network/JsonRequestClient.h"
#include "PrinterDataStruct.h"
#define PRINTER_STATE_OFFLINE (int)-2
#define PRINTER_STATE_ERROR (int)-1
#define PRINTER_STATE_STANDBY (int)0
#define PRINTER_STATE_PRINTING (int)1
#define PRINTER_STATE_PAUSED (int)2
#define PRINTER_STATE_COMPLETED (int)3
class BasePrinterClient { class BasePrinterClient {
public: public:

View File

@ -10,29 +10,7 @@ protected:
JsonRequestClient *jsonRequestClient; JsonRequestClient *jsonRequestClient;
String printerType = "Octoprint"; String printerType = "Octoprint";
typedef struct { PrinterDataStruct printerData;
String averagePrintTime;
String estimatedPrintTime;
String fileName;
String fileSize;
String lastPrintTime;
String progressCompletion;
String progressFilepos;
String progressPrintTime;
String progressPrintTimeLeft;
int state;
String toolTemp;
String toolTargetTemp;
String filamentLength;
String bedTemp;
String bedTargetTemp;
boolean isPrinting;
boolean isPSUoff;
String error;
String printerName;
} PrinterStruct;
PrinterStruct printerData;
String result; String result;
String encodedAuth = ""; String encodedAuth = "";

View File

@ -0,0 +1,33 @@
#pragma once
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <base64.h>
#define PRINTER_STATE_OFFLINE (int)-2
#define PRINTER_STATE_ERROR (int)-1
#define PRINTER_STATE_STANDBY (int)0
#define PRINTER_STATE_PRINTING (int)1
#define PRINTER_STATE_PAUSED (int)2
#define PRINTER_STATE_COMPLETED (int)3
typedef struct {
String averagePrintTime;
String estimatedPrintTime;
String fileName;
String fileSize;
String lastPrintTime;
String progressCompletion;
String progressFilepos;
String progressPrintTime;
String progressPrintTimeLeft;
int state;
String toolTemp;
String toolTargetTemp;
String filamentLength;
String bedTemp;
String bedTargetTemp;
boolean isPrinting;
boolean isPSUoff;
String error;
String printerName;
} PrinterDataStruct;