From 98ed81d79037d66303f2436a43c12292842bbbd5 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Wed, 4 Dec 2019 14:34:04 -0500 Subject: [PATCH] 2019-12-04 Fred Gleason * Fixed a bug in rdgpimon(1) that caused incorrect state indications to be displayed after switching to a different page. --- ChangeLog | 3 +++ ripcd/ripcd.cpp | 1 + utils/rdgpimon/rdgpimon.cpp | 19 +++++++++++++++++++ utils/rdgpimon/rdgpimon.h | 1 + 4 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index febb71aa..20a0e670 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19294,3 +19294,6 @@ * Fixed a bug in ripcd(8) that caused input and output counts to be calculated incorrectly for Software Authority protocol devices containing holes in the input and/or output lists. +2019-12-04 Fred Gleason + * Fixed a bug in rdgpimon(1) that caused incorrect state indications + to be displayed after switching to a different page. diff --git a/ripcd/ripcd.cpp b/ripcd/ripcd.cpp index 0c705c1b..531caee3 100644 --- a/ripcd/ripcd.cpp +++ b/ripcd/ripcd.cpp @@ -756,6 +756,7 @@ void MainObject::LoadGpiTable() q->value(3).toInt(); } delete q; + rda->syslog(LOG_DEBUG,"GPIO table settings reloaded"); } diff --git a/utils/rdgpimon/rdgpimon.cpp b/utils/rdgpimon/rdgpimon.cpp index 5b2fd6a3..0258cc01 100644 --- a/utils/rdgpimon/rdgpimon.cpp +++ b/utils/rdgpimon/rdgpimon.cpp @@ -597,6 +597,8 @@ void MainWidget::UpdateLabelsUp(int last_line) } gpi_up_button->setEnabled(q->next()); delete q; + + RefreshGpioStates(); } @@ -643,6 +645,23 @@ void MainWidget::UpdateLabelsDown(int first_line) } gpi_down_button->setEnabled(q->next()); delete q; + + RefreshGpioStates(); +} + + +void MainWidget::RefreshGpioStates() +{ + if(gpi_type_box->currentIndex()==0) { + rda->ripc()->sendGpiStatus(gpi_matrix_box->currentIndex()); + rda->ripc()->sendGpiCart(gpi_matrix_box->currentIndex()); + rda->ripc()->sendGpiMask(gpi_matrix_box->currentIndex()); + } + else { + rda->ripc()->sendGpoStatus(gpi_matrix_box->currentIndex()); + rda->ripc()->sendGpoCart(gpi_matrix_box->currentIndex()); + rda->ripc()->sendGpoMask(gpi_matrix_box->currentIndex()); + } } diff --git a/utils/rdgpimon/rdgpimon.h b/utils/rdgpimon/rdgpimon.h index 2439eec5..3414acf1 100644 --- a/utils/rdgpimon/rdgpimon.h +++ b/utils/rdgpimon/rdgpimon.h @@ -67,6 +67,7 @@ class MainWidget : public RDWidget private: void UpdateLabelsUp(int last_line); void UpdateLabelsDown(int first_line); + void RefreshGpioStates(); void RefreshEventsList(); void AddEventsItem(int line,bool state); RDMatrix *gpi_matrix;