-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Generate read attribute #11650
Generate read attribute #11650
Conversation
…cts on the ui next
63a30b9
to
a062072
Compare
d1f6b2c
to
39ab841
Compare
PR #11650: Size comparison from 0528ce0 to 389ccc2 Increases above 0.2%:
Increases (2 builds for esp32, linux)
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
389ccc2
to
f01bced
Compare
PR #11650: Size comparison from 9964cdb to bbf2d37 Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
Fast tracking, given platform changes by a platform maintainer. |
/rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix these comments in a follow-up PR.
...main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt
Show resolved
Hide resolved
...main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt
Show resolved
Hide resolved
...main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt
Show resolved
Hide resolved
...main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt
Show resolved
Hide resolved
// read attribute | ||
{{#chip_server_cluster_attributes}} | ||
Map<String, CommandParameterInfo> read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}CommandParams = new LinkedHashMap<String, CommandParameterInfo>(); | ||
CommandInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeCommandInfo = new CommandInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking reads using CommandInfo
makes sense from a code use perspective, but the naming is a bit weird (since reads are different than commands). Let's discuss an alternative offline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name CommandInfo
to InteractionInfo
getCommandMap(clusterMap); | ||
getReadAttributeMap(clusterMap); | ||
return clusterMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this design is cleaner:
Map<String, ClusterInfo> clusterMap = new HashMap<>();
Map<> commandMap = getCommandMap();
Map<> readMap = getReadAttributeMap();
combineCommands(clusterMap, commandMap);
combineCommands(clusterMap, readMap);
void combineCommands(Map<String, ClusterInfo> dest, Map<String, ClusterInfo> source) {
// For every key-value pair, take the ClusterInfo commands from source and add them to the ClusterInfo
// commands in dest.
}
Since it moves the combine
logic out of the individual functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one problem is that in the getReadAttributeMap
function, I will have to generate ClusterInfo, which is redundant. Here, what I did was add each command into the already generated ClusterInfo.
* resolve comments * Restyled by google-java-format * Restyled by gn * update zap generated code * fix comments * merge with master * fix unwanted format changes * modify clusterinfo mapping to resolve comment * final fix for comments * Delete misc.xml Co-authored-by: Restyled.io <[email protected]>
* try to find a state where m5stack doesn't bootloop * add back class description * select different cluster, command will remove previous displayed parameter * add responseValueInfo class instead of string split * remove unused variable * Restyled by whitespace * Restyled by google-java-format * Restyled by gn * fix parameter response ui alignment issue * resolve comments * fix format * regenerate clusterInfoMapping.java * resolve comments * merge with master to get pass the check * finish read attribute code generation, need to handle displaying objects on the ui next * able to display complex data on the ui * skip merge with master * need outer loop variable to store the deserialized string representation of the object * Update ClusterInteractionFragment.kt Co-authored-by: Restyled.io <[email protected]>
* resolve comments * Restyled by google-java-format * Restyled by gn * update zap generated code * fix comments * merge with master * fix unwanted format changes * modify clusterinfo mapping to resolve comment * final fix for comments * Delete misc.xml Co-authored-by: Restyled.io <[email protected]>
Change overview
Testing
Manually tested.