fuc j'ai ouvlier un truc #21

Merged
Clement merged 1 commits from feat/output-reader into develop 2024-02-02 16:10:32 +00:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 627509a2d7 - Show all commits

View File

@ -60,6 +60,7 @@ public:
void set_product_label(std::string str);
void set_product_id(std::string str);
void set_servo_message(std::string str);
int _current_page;
private:
void update_page() const;
void show_debug() const;
@ -68,7 +69,6 @@ private:
void update_pagination() const;
void update_dashboard() const;
int _current_page;
int _debug_loc_y;
std::vector<LogMessage> _logs;
ComponentsStatus _components_status;

View File

@ -83,6 +83,7 @@ Program::Program() {
this->outputReader = new BigNfcReader();
this->outputReader->init();
this->grblUpdateTime = 0;
lcdScreen->set_grbl_status(COMPONENT_OK);
Wire.begin(21, 22);
grbl->init(STEPER_SPEED, STEPER_PAS, STEPER_ACC);
struct WifiConfig wifi_c = {WIFI_SSID, WIFI_PASSWORD};
@ -105,7 +106,7 @@ void Program::loop() {
if(this->outputReader->getNbTags() >= 2){
lcdScreen->set_nfc_message("To mutch colis number detected");
return;
lcdScreen->set_grbl_status(COMPONENT_KO);
}
String nfcId = this->nfcReader->ReadNfc();
@ -163,10 +164,12 @@ void Program::loop() {
}
this->grbl->mouveForward(CONVOYER_LEN);
} else {
if(this->grbl->isIddle() || (maintenant - this->grblUpdateTime >= GRBL_UPDATE)){
if((this->grbl->isIddle() || (maintenant - this->grblUpdateTime >= GRBL_UPDATE)) && lcdScreen->get_components().grbl == COMPONENT_OK){
this->grblUpdateTime = maintenant;
this->grbl->mouveForward(5);
Serial.print("pouet");
}
}
if(M5.BtnC.wasReleased() != 0 && lcdScreen->_current_page == DASHBOARD_SCREEN){
lcdScreen->set_grbl_status(COMPONENT_OK);
}
}