From 4785fd31ffd143e2324ac43874ec1453b4d96886 Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Sun, 17 Apr 2022 11:03:26 +0200 Subject: [PATCH] dnetview: updated README --- bin/dnetview/README.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/bin/dnetview/README.md b/bin/dnetview/README.md index 8f01ba66e..84891c976 100644 --- a/bin/dnetview/README.md +++ b/bin/dnetview/README.md @@ -72,19 +72,37 @@ an enum: ``` enum SelectableObject { - Node(NodeInfo) - Session(SessionInfo) - Connect(ConnectInfo) + Node(NodeId) + Session(SessionId) + Connect(ConnectId) } ``` +Id is a randomly generated number to correspond to the received info. -We copy these values into a Vec to use them around the program. +Each SelectableObject corresponds to an info HashMap. + +``` +NodeInfo = Hashmap +SessionInfo = Hashmap +ConnectInfo = Hashmap +``` + +We use mutexes to protect the data because we are updating it +asynchronously. ### View View is a copy of model without mutex's and with an index that allows the -objects to be scrollable lists. We also create a function called render() -that draws each window. +objects to be scrollable lists. + +We create a IdsList which is a hashset of all the IDs and a ListState. +This allows us to transform SelectableObject's into a scrollable list. + +``` +IdsList = HashSet +``` + +We also create a function called render() that draws each window. ``` NodeInfo.render()