Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devt #1078

Merged
merged 4 commits into from
Dec 8, 2023
Merged

Devt #1078

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FluidNC/src/OLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void OLED::init() {
_oled->display();

allChannels.registration(this);
setReportInterval(500);
setReportInterval(_report_interval_ms);
}

Channel* OLED::pollLine(char* line) {
Expand Down
2 changes: 2 additions & 0 deletions FluidNC/src/OLED.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class OLED : public Channel, public Configuration::Configurable {
std::string _ticker;

int _radio_delay = 0;
int _report_interval_ms = 500;

uint8_t _i2c_num = 0;

Expand Down Expand Up @@ -116,6 +117,7 @@ class OLED : public Channel, public Configuration::Configurable {
void afterParse() override;

void group(Configuration::HandlerBase& handler) override {
handler.item("report_interval_ms", _report_interval_ms, 100, 5000);
handler.item("i2c_num", _i2c_num);
handler.item("i2c_address", _address);
handler.item("width", _width);
Expand Down
4 changes: 2 additions & 2 deletions FluidNC/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ static bool isPassword(bool (*_checker)(char*)) {

const char* StringSetting::getDefaultString() {
// If the string is a password do not display it
return (_checker && isPassword(_checker)) ? "******" : _defaultValue.c_str();
return (_checker && isPassword(_checker)) ? "********" : _defaultValue.c_str();
}
const char* StringSetting::getStringValue() {
return (_checker && isPassword(_checker)) ? "******" : get();
return (_checker && isPassword(_checker)) ? "********" : get();
}

void StringSetting::addWebui(WebUI::JSONencoder* j) {
Expand Down
6 changes: 3 additions & 3 deletions FluidNC/src/Status_outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ void Status_Outputs::init() {
}

log_info("Status outputs"
<< " Interval:" << _interval_ms << " Idle:" << _Idle_pin.name() << " Cycle:" << _Run_pin.name() << " Hold:" << _Hold_pin.name()
<< " Alarm:" << _Alarm_pin.name());
<< " Interval:" << _report_interval_ms << " Idle:" << _Idle_pin.name() << " Cycle:" << _Run_pin.name()
<< " Hold:" << _Hold_pin.name() << " Alarm:" << _Alarm_pin.name());

allChannels.registration(this);
setReportInterval(_interval_ms);
setReportInterval(_report_interval_ms);
}

void Status_Outputs::parse_report() {
Expand Down
10 changes: 5 additions & 5 deletions FluidNC/src/Status_outputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class Status_Outputs : public Channel, public Configuration::Configurable {
std::string _report;
std::string _state;

int _interval_ms = 500;
int _report_interval_ms = 500;

void parse_report();
void parse_status_report();

public:
Status_Outputs() : Channel("status_outputs") {}

Status_Outputs(const Status_Outputs&) = delete;
Status_Outputs(Status_Outputs&&) = delete;
Status_Outputs(const Status_Outputs&) = delete;
Status_Outputs(Status_Outputs&&) = delete;
Status_Outputs& operator=(const Status_Outputs&) = delete;
Status_Outputs& operator=(Status_Outputs&&) = delete;
Status_Outputs& operator=(Status_Outputs&&) = delete;

virtual ~Status_Outputs() = default;

Expand All @@ -47,7 +47,7 @@ class Status_Outputs : public Channel, public Configuration::Configurable {
void afterParse() override {};

void group(Configuration::HandlerBase& handler) override {
handler.item("report_interval_ms", _interval_ms, 100, 5000);
handler.item("report_interval_ms", _report_interval_ms, 100, 5000);
handler.item("idle_pin", _Idle_pin);
handler.item("run_pin", _Run_pin);
handler.item("hold_pin", _Hold_pin);
Expand Down
1 change: 1 addition & 0 deletions FluidNC/src/UartChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void UartChannel::init() {
} else {
log_error("UartChannel: missing uart" << _uart_num);
}
setReportInterval(_report_interval_ms);
}
void UartChannel::init(Uart* uart) {
_uart = uart;
Expand Down
8 changes: 6 additions & 2 deletions FluidNC/src/UartChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class UartChannel : public Channel, public Configuration::Configurable {
Lineedit* _lineedit;
Uart* _uart;

int _uart_num = 0;
int _uart_num = 0;
int _report_interval_ms = 0;

public:
UartChannel(bool addCR = false);
Expand All @@ -39,7 +40,10 @@ class UartChannel : public Channel, public Configuration::Configurable {
Channel* pollLine(char* line) override;

// Configuration methods
void group(Configuration::HandlerBase& handler) override { handler.item("uart_num", _uart_num); }
void group(Configuration::HandlerBase& handler) override {
handler.item("uart_num", _uart_num);
handler.item("report_interval_ms", _report_interval_ms);
}
};

extern UartChannel Uart0;
Expand Down