Skip to content

CSSTUDIO-2964 Alarm Tree application: Add indicators for the existence of disabled leaves#3310

Merged
abrahamwolk merged 15 commits intomasterfrom
CSSTUDIO-2964
Mar 6, 2025
Merged

CSSTUDIO-2964 Alarm Tree application: Add indicators for the existence of disabled leaves#3310
abrahamwolk merged 15 commits intomasterfrom
CSSTUDIO-2964

Conversation

@abrahamwolk
Copy link
Copy Markdown
Collaborator

@abrahamwolk abrahamwolk commented Mar 5, 2025

This pull request adds indicators for the existence of disabled leaves to the Alarm Tree application.

The following screenshots demonstrate the implemented functionality. The idea is that one should not have to expand the alarm tree in order to see that there exist disabled alarms in an alarm component. The indicators are currently always in grey text. The existence of a timer is indicated.

The existence of at least one disabled alarm is indicated as follows:
screenshot1
The same alarm tree expanded:
screenshot2
The existence of a timer is indicated as follows:
screenshot3
When all leaves of "Alarm Component 1" are disabled, this is indicated as follows ("Alarm Component 1.3" contains no leaves, and hence it is not greyed out):
screenshot4

if (leaf.getEnabled().enabled_date != null) {
LocalDateTime enabledDate = leaf.getEnabled().enabled_date;
String stringToAppend = padWithLeadingZero(enabledDate.getHour()) + ":" + padWithLeadingZero(enabledDate.getMinute()) + ":" + padWithLeadingZero(enabledDate.getSecond());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not SimpleDateFormat be a simpler approach here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I have changed this.

String paddedMonthNumber = padWithLeadingZero(enabledDate.getMonthValue());
String paddedDayNumber = padWithLeadingZero(enabledDate.getDayOfMonth());
stringToAppend = enabledDate.getYear() + "-" + paddedMonthNumber + "-" + paddedDayNumber + "T" + stringToAppend;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: native Date/Time APIs could be a simpler option.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed this.

@georgweiss
Copy link
Copy Markdown
Collaborator

Do not see the need to differentiate formatting of "disabled until" date/time based on whether its the current date or not, see screen shot. If someone is looking at the tree around midnight, what happens then when a future date becomes current date?

Screenshot 2025-03-05 at 13 35 10

@abrahamwolk
Copy link
Copy Markdown
Collaborator Author

Do not see the need to differentiate formatting of "disabled until" date/time based on whether its the current date or not, see screen shot.

The idea is that it reduces the cognitive load: if a date is displayed, the user will first have to parse it and determine if it's the current day or a future day.

If someone is looking at the tree around midnight, what happens then when a future date becomes current date?

This is a good question; I believe it will continue to display the date.

@georgweiss
Copy link
Copy Markdown
Collaborator

I'd claim that differences in how date/time is rendered may also be define as cognitive load, in particular as after midnight the date/time is not re-rendered and potentially adds confusion.

@abrahamwolk
Copy link
Copy Markdown
Collaborator Author

I'd claim that differences in how date/time is rendered may also be define as cognitive load, in particular as after midnight the date/time is not re-rendered and potentially adds confusion.

I tested how it changes when the future date becomes the current date, and it didn't update automatically, at least not immediately. When the state of the alarm tree was changed by enabling another disabled node, then it updated the text, however.

I cannot think of an easy-to-implement way of automatically updating the text, and I have therefore changed the pull request so that the full date is always displayed to prevent potential confusion.

@abrahamwolk abrahamwolk merged commit d54610d into master Mar 6, 2025
2 checks passed
@abrahamwolk abrahamwolk deleted the CSSTUDIO-2964 branch March 6, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants