mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-05 15:10:41 +08:00
Remove Snapshot Display as dropped feature
This commit is contained in:
parent
60f9680df6
commit
3b3e03c3e5
@ -122,9 +122,6 @@ Flash pins (6~11) cannot be used
|
|||||||
* Touch Calibration
|
* Touch Calibration
|
||||||
[ESP215]<CALIBRATE> json=<no> [pwd=<user password>]
|
[ESP215]<CALIBRATE> json=<no> [pwd=<user password>]
|
||||||
|
|
||||||
* Take screen snapshot
|
|
||||||
[ESP216]<SNAP> json=<no> [pwd=<user password>]
|
|
||||||
|
|
||||||
* Show defined pins
|
* Show defined pins
|
||||||
[ESP220]<SNAP> json=<no> [pwd=<user password>]
|
[ESP220]<SNAP> json=<no> [pwd=<user password>]
|
||||||
|
|
||||||
|
@ -268,12 +268,6 @@
|
|||||||
#define DEBUG_ESP3D_OUTPUT_PORT 8000
|
#define DEBUG_ESP3D_OUTPUT_PORT 8000
|
||||||
#endif //ESP_DEBUG_FEATURE
|
#endif //ESP_DEBUG_FEATURE
|
||||||
|
|
||||||
#if defined (DISPLAY_DEVICE) && (DISPLAY_UI_TYPE == UI_TYPE_ADVANCED)
|
|
||||||
//allows to use [ESP216]SNAP to do screen capture
|
|
||||||
#define DISPLAY_SNAPSHOT_FEATURE
|
|
||||||
#define AUTO_SNAPSHOT_FEATURE
|
|
||||||
#endif //DISPLAY_DEVICE
|
|
||||||
|
|
||||||
/************************************
|
/************************************
|
||||||
*
|
*
|
||||||
* Serial Communications
|
* Serial Communications
|
||||||
|
@ -568,13 +568,6 @@ bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_
|
|||||||
response = ESP215(cmd_params, auth_type, output);
|
response = ESP215(cmd_params, auth_type, output);
|
||||||
break;
|
break;
|
||||||
#endif //DISPLAY_TOUCH_DRIVER
|
#endif //DISPLAY_TOUCH_DRIVER
|
||||||
#if defined(DISPLAY_SNAPSHOT_FEATURE)
|
|
||||||
//Take screen snapshot
|
|
||||||
//[ESP216]<SNAP>[pwd=<user password>]
|
|
||||||
case 216:
|
|
||||||
response = ESP216(cmd_params, auth_type, output);
|
|
||||||
break;
|
|
||||||
#endif //DISPLAY_SNAPSHOT_FEATURE
|
|
||||||
#ifdef BUZZER_DEVICE
|
#ifdef BUZZER_DEVICE
|
||||||
//Play sound
|
//Play sound
|
||||||
//[ESP250]F=<frequency> D=<duration> [pwd=<user password>]
|
//[ESP250]F=<frequency> D=<duration> [pwd=<user password>]
|
||||||
|
@ -109,9 +109,6 @@ public:
|
|||||||
#if defined(DISPLAY_TOUCH_DRIVER)
|
#if defined(DISPLAY_TOUCH_DRIVER)
|
||||||
bool ESP215(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
|
bool ESP215(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
|
||||||
#endif //DISPLAY_TOUCH_DRIVER
|
#endif //DISPLAY_TOUCH_DRIVER
|
||||||
#if defined(DISPLAY_SNAPSHOT_FEATURE)
|
|
||||||
bool ESP216(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
|
|
||||||
#endif //DISPLAY_TOUCH_DRIVER
|
|
||||||
#endif //DISPLAY_DEVICE
|
#endif //DISPLAY_DEVICE
|
||||||
#ifdef SENSOR_DEVICE
|
#ifdef SENSOR_DEVICE
|
||||||
bool ESP210(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
|
bool ESP210(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
|
||||||
|
@ -94,9 +94,6 @@ const char * help[]= {"[ESP] (id) - display this help",
|
|||||||
#if defined(DISPLAY_TOUCH_DRIVER)
|
#if defined(DISPLAY_TOUCH_DRIVER)
|
||||||
"[ESP215](CALIBRATE) - display state / start touch calibration",
|
"[ESP215](CALIBRATE) - display state / start touch calibration",
|
||||||
#endif //DISPLAY_TOUCH_DRIVER
|
#endif //DISPLAY_TOUCH_DRIVER
|
||||||
#if defined(DISPLAY_SNAPSHOT_FEATURE)
|
|
||||||
"[ESP216](SNAP) - Take screen snapshot",
|
|
||||||
#endif //DISPLAY_SNAPSHOT_FEATURE
|
|
||||||
#endif //DISPLAY_DEVICE
|
#endif //DISPLAY_DEVICE
|
||||||
"[ESP220] - Show used pins",
|
"[ESP220] - Show used pins",
|
||||||
#ifdef BUZZER_DEVICE
|
#ifdef BUZZER_DEVICE
|
||||||
@ -230,9 +227,6 @@ const uint cmdlist[]= {0,
|
|||||||
#if defined(DISPLAY_TOUCH_DRIVER)
|
#if defined(DISPLAY_TOUCH_DRIVER)
|
||||||
215,
|
215,
|
||||||
#endif //DISPLAY_TOUCH_DRIVER
|
#endif //DISPLAY_TOUCH_DRIVER
|
||||||
#if defined(DISPLAY_SNAPSHOT_FEATURE)
|
|
||||||
216,
|
|
||||||
#endif //DISPLAY_SNAPSHOT_FEATURE
|
|
||||||
#endif //DISPLAY_DEVICE
|
#endif //DISPLAY_DEVICE
|
||||||
220,
|
220,
|
||||||
#ifdef BUZZER_DEVICE
|
#ifdef BUZZER_DEVICE
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
ESP216.cpp - ESP3D command class
|
|
||||||
|
|
||||||
Copyright (c) 2014 Luc Lebosse. All rights reserved.
|
|
||||||
|
|
||||||
This code is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This code is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with This code; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
#include "../../include/esp3d_config.h"
|
|
||||||
#if defined(DISPLAY_SNAPSHOT_FEATURE)
|
|
||||||
#include "../commands.h"
|
|
||||||
#include "../esp3doutput.h"
|
|
||||||
#include "../settings_esp3d.h"
|
|
||||||
#include "../../modules/authentication/authentication_service.h"
|
|
||||||
#include "../../modules/display/display.h"
|
|
||||||
//Take screen snapshot
|
|
||||||
//[ESP216]<SNAP> json=<no>[pwd=<user password>]
|
|
||||||
#define COMMANDID 216
|
|
||||||
bool Commands::ESP216(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output)
|
|
||||||
{
|
|
||||||
bool noError = true;
|
|
||||||
bool json = has_tag (cmd_params, "json");
|
|
||||||
String response;
|
|
||||||
String parameter;
|
|
||||||
int errorCode = 200; //unless it is a server error use 200 as default and set error in json instead
|
|
||||||
#ifdef AUTHENTICATION_FEATURE
|
|
||||||
if (auth_type == LEVEL_GUEST) {
|
|
||||||
response = format_response(COMMANDID, json, false, "Guest user can't use this command");
|
|
||||||
noError = false;
|
|
||||||
errorCode = 401;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
(void)auth_type;
|
|
||||||
#endif //AUTHENTICATION_FEATURE
|
|
||||||
if (noError) {
|
|
||||||
parameter = clean_param(get_param (cmd_params, ""));
|
|
||||||
//get
|
|
||||||
if (parameter.length() == 0) {
|
|
||||||
response = format_response(COMMANDID, json, false, "Invalid parameter");
|
|
||||||
noError = false;
|
|
||||||
} else { //set
|
|
||||||
parameter.toUpperCase();
|
|
||||||
if (has_tag (cmd_params, "SNAP")) {
|
|
||||||
if (!json) {
|
|
||||||
output->printMSG("Creating snapshot");
|
|
||||||
}
|
|
||||||
if(esp3d_display.snapshot()) {
|
|
||||||
response = format_response(COMMANDID, json, true, "ok");
|
|
||||||
} else {
|
|
||||||
response = format_response(COMMANDID, json, false, "Cannot save snapshot");
|
|
||||||
noError = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
response = format_response(COMMANDID, json, false, "Invalid parameter");
|
|
||||||
response = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (noError) {
|
|
||||||
if (json) {
|
|
||||||
output->printLN (response.c_str() );
|
|
||||||
} else {
|
|
||||||
output->printMSG (response.c_str() );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
output->printERROR(response.c_str(), errorCode);
|
|
||||||
}
|
|
||||||
return noError;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //DISPLAY_SNAPSHOT_FEATURE
|
|
Loading…
x
Reference in New Issue
Block a user