Baseclient struct data to extra class
parent
89d0625ecb
commit
912ef576c6
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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 = "";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
Loading…
Reference in New Issue