MainFlowControl.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #pragma once
  2. #ifndef MAINFLOWCONTROL_H
  3. #define MAINFLOWCONTROL_H
  4. #include <esp_log.h>
  5. #include <string>
  6. #include <esp_http_server.h>
  7. #include "CImageBasis.h"
  8. #include "ClassFlowControll.h"
  9. #include "openmetrics.h"
  10. typedef struct
  11. {
  12. uint16_t CamSensor_id;
  13. framesize_t ImageFrameSize = FRAMESIZE_VGA; // 0 - 10
  14. gainceiling_t ImageGainceiling; // Image gain (GAINCEILING_x2, x4, x8, x16, x32, x64 or x128)
  15. int ImageQuality; // 0 - 63
  16. int ImageBrightness; // (-2 to 2) - set brightness
  17. int ImageContrast; //-2 - 2
  18. int ImageSaturation; //-2 - 2
  19. int ImageSharpness; //-2 - 2
  20. bool ImageAutoSharpness;
  21. int ImageSpecialEffect; // 0 - 6
  22. int ImageWbMode; // 0 to 4 - if awb_gain enabled (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
  23. int ImageAwb; // white balance enable (0 or 1)
  24. int ImageAwbGain; // Auto White Balance enable (0 or 1)
  25. int ImageAec; // auto exposure off (1 or 0)
  26. int ImageAec2; // automatic exposure sensor (0 or 1)
  27. int ImageAeLevel; // auto exposure levels (-2 to 2)
  28. int ImageAecValue; // set exposure manually (0-1200)
  29. int ImageAgc; // auto gain off (1 or 0)
  30. int ImageAgcGain; // set gain manually (0 - 30)
  31. int ImageBpc; // black pixel correction
  32. int ImageWpc; // white pixel correction
  33. int ImageRawGma; // (1 or 0)
  34. int ImageLenc; // lens correction (1 or 0)
  35. int ImageHmirror; // (0 or 1) flip horizontally
  36. int ImageVflip; // Invert image (0 or 1)
  37. int ImageDcw; // downsize enable (1 or 0)
  38. int ImageDenoiseLevel; // The OV2640 does not support it, OV3660 and OV5640 (0 to 8)
  39. int ImageWidth;
  40. int ImageHeight;
  41. int ImageLedIntensity;
  42. bool ImageZoomEnabled;
  43. int ImageZoomOffsetX;
  44. int ImageZoomOffsetY;
  45. int ImageZoomSize;
  46. int WaitBeforePicture;
  47. bool isImageSize;
  48. bool CameraInitSuccessful;
  49. bool changedCameraSettings;
  50. bool DemoMode;
  51. bool SaveAllFiles;
  52. } camera_flow_config_temp_t;
  53. extern camera_flow_config_temp_t CFstatus;
  54. extern ClassFlowControll flowctrl;
  55. esp_err_t setCCstatusToCFstatus(void); // CCstatus >>> CFstatus
  56. esp_err_t setCFstatusToCCstatus(void); // CFstatus >>> CCstatus
  57. esp_err_t setCFstatusToCam(void); // CFstatus >>> Kamera
  58. void register_server_main_flow_task_uri(httpd_handle_t server);
  59. void CheckIsPlannedReboot(void);
  60. bool getIsPlannedReboot(void);
  61. void InitializeFlowTask(void);
  62. void DeleteMainFlowTask(void);
  63. bool isSetupModusActive(void);
  64. int getCountFlowRounds(void);
  65. #ifdef ENABLE_MQTT
  66. esp_err_t MQTTCtrlFlowStart(std::string _topic);
  67. #endif // ENABLE_MQTT
  68. esp_err_t GetRawJPG(httpd_req_t *req);
  69. esp_err_t GetJPG(std::string _filename, httpd_req_t *req);
  70. #endif // MAINFLOWCONTROL_H