From 6c6109d421d8cbf88848f24c43be6ffa3456e7ec Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Fri, 18 Oct 2024 23:49:23 +0200 Subject: [PATCH] update class diagramms --- app/proxy_2.svg | 657 +++++++++++++++++++++-------------------------- app/proxy_2.yuml | 34 +-- app/proxy_3.svg | 364 ++++++++++++++++++++++++++ app/proxy_3.yuml | 42 +++ 4 files changed, 717 insertions(+), 380 deletions(-) create mode 100644 app/proxy_3.svg create mode 100644 app/proxy_3.yuml diff --git a/app/proxy_2.svg b/app/proxy_2.svg index 6a6fb51..232983f 100644 --- a/app/proxy_2.svg +++ b/app/proxy_2.svg @@ -4,429 +4,368 @@ - - + + G - + A0 - - - -You can stick notes -on diagrams too! + + + +Example of +instantiation for a +GEN3 inverter! A1 - -<<AbstractIterMeta>> - - -__iter__() + +<<AbstractIterMeta>> + + +__iter__() A14 - -<<ProtocolIfc>> - -_registry - -close() + +<<ProtocolIfc>> + +_registry + +close() - + A1->A14 - - + + A2 - -InverterG3 - -addr -remote:StreamPtr -local:StreamPtr - -create_remote() -close() - - - -A7 - -AsyncStreamServer - -create_remote - -<async>server_loop() -<async>_async_forward() -<async>publish_outstanding_mqtt() -close() - - - -A2->A7 - - - -local - - - -A8 - -AsyncStreamClient - - -<async>client_loop() -<async>_async_forward()) - - - -A2->A8 - - -remote + +InverterG3 + +addr +remote:StreamPtr +local:StreamPtr + +create_remote() +close() A3 - -InverterG3P - -addr -remote:StreamPtr -local:StreamPtr - -create_remote() -close() + +local:StreamPtr - - -A3->A7 - - - -local - - - -A3->A8 - - -remote + + +A2->A3 + + + A4 - -<<AsyncIfc>> - - -set_node_id() -get_conn_no() -tx_add() -tx_flush() -tx_get() -tx_peek() -tx_log() -tx_clear() -tx_len() -fwd_add() -fwd_log() -rx_get() -rx_peek() -rx_log() -rx_clear() -rx_len() -rx_set_cb() -prot_set_timeout_cb() + +remote:StreamPtr - - -A5 - -AsyncIfcImpl - -fwd_fifo:ByteFifo -tx_fifo:ByteFifo -rx_fifo:ByteFifo -conn_no:Count -node_id -timeout_cb - - - -A4->A5 - - - - - -A6 - -AsyncStream - -reader -writer -addr -r_addr -l_addr - -<async>loop -disc() -close() -healthy() -__async_read() -__async_write() -__async_forward() - - + -A5->A6 - - +A2->A4 + + + - - -A6->A7 - - + + +A8 + +AsyncStreamServer + +create_remote + +<async>server_loop() +<async>_async_forward() +<async>publish_outstanding_mqtt() +close() - - -A6->A8 - - + + +A3->A8 + + + A9 - -Talent - -ifc:AsyncIfc -conn_no -addr -await_conn_resp_cnt -id_str -contact_name -contact_mail -db:InfosG3 -mb:Modbus -switch - -msg_contact_info() -msg_ota_update() -msg_get_time() -msg_collector_data() -msg_inverter_data() -msg_unknown() -healthy() -close() + +AsyncStreamClient + + +<async>client_loop() +<async>_async_forward()) - + + +A4->A9 + + +0..1 + + + +A5 + +<<AsyncIfc>> + + +set_node_id() +get_conn_no() +tx_add() +tx_flush() +tx_get() +tx_peek() +tx_log() +tx_clear() +tx_len() +fwd_add() +fwd_log() +rx_get() +rx_peek() +rx_log() +rx_clear() +rx_len() +rx_set_cb() +prot_set_timeout_cb() + + + +A6 + +AsyncIfcImpl + +fwd_fifo:ByteFifo +tx_fifo:ByteFifo +rx_fifo:ByteFifo +conn_no:Count +node_id +timeout_cb + + + +A5->A6 + + + + + +A7 + +AsyncStream + +reader +writer +addr +r_addr +l_addr + +<async>loop +disc() +close() +healthy() +__async_read() +__async_write() +__async_forward() + + + +A6->A7 + + + + -A9->A2 - - -remote +A7->A8 + + - - -A9->A2 - - - -local - - - -A9->A4 - - -use - - - -A12 - -InfosG3 - - -ha_confs() -parse() - - - -A9->A12 - - + + +A7->A9 + + A10 - -SolarmanV5 - -ifc:AsyncIfc -conn_no -addr -control -serial -snr -db:InfosG3P -mb:Modbus -switch - -msg_unknown() -healthy() -close() + +Talent + +conn_no +addr +await_conn_resp_cnt +id_str +contact_name +contact_mail +db:InfosG3 +mb:Modbus +switch + +msg_contact_info() +msg_ota_update() +msg_get_time() +msg_collector_data() +msg_inverter_data() +msg_unknown() +healthy() +close() - + A10->A3 - - -remote - - - -A10->A3 - - - -local + + + - + A10->A4 - - -use + + +0..1 - - -A13 - -InfosG3P - - -ha_confs() -parse() + + +A12 + +InfosG3 + + +ha_confs() +parse() - - -A10->A13 - - + + +A10->A12 + + A11 - -Infos - -stat -new_stat_data -info_dev - -static_init() -dev_value() -inc_counter() -dec_counter() -ha_proxy_conf -ha_conf -ha_remove -update_db -set_db_def_value -get_db_value -ignore_this_device + +Infos + +stat +new_stat_data +info_dev + +static_init() +dev_value() +inc_counter() +dec_counter() +ha_proxy_conf +ha_conf +ha_remove +update_db +set_db_def_value +get_db_value +ignore_this_device - + A11->A12 - - + + - - -A11->A13 - - + + +A13 + +Message + +server_side:bool +mb:Modbus +ifc:AsyncIfc +node_id +header_valid:bool +header_len +data_len +unique_id +sug_area:str +new_data:dict +state:State +shutdown_started:bool +modbus_elms +mb_timer:Timer +mb_timeout +mb_first_timeout +modbus_polling:bool + +_set_mqtt_timestamp() +_timeout() +_send_modbus_cmd() +<async> end_modbus_cmd() +close() +inc_counter() +dec_counter() + + + +A13->A5 + + +use + + + +A13->A10 + + + + + +A14->A13 + + A15 - -Message - -node_id - -inc_counter() -dec_counter() + +Modbus + +que +snd_handler +rsp_handler +timeout +max_retires +last_xxx +err +retry_cnt +req_pend +tim + +build_msg() +recv_req() +recv_resp() +close() - - -A14->A15 - - - - - -A15->A9 - - - - - -A15->A10 - - - - - -A16 - -Modbus - -que -snd_handler -rsp_handler -timeout -max_retires -last_xxx -err -retry_cnt -req_pend -tim - -build_msg() -recv_req() -recv_resp() -close() - - - -A16->A9 - - -has -1 - - - -A16->A10 - - -has -1 + + +A15->A13 + + +has +0..1 diff --git a/app/proxy_2.yuml b/app/proxy_2.yuml index 39a399e..5138428 100644 --- a/app/proxy_2.yuml +++ b/app/proxy_2.yuml @@ -2,11 +2,12 @@ // {direction:topDown} // {generate:true} -[note: You can stick notes on diagrams too!{bg:cornsilk}] +[note: Example of instantiation for a GEN3 inverter!{bg:cornsilk}] [<>||__iter__()] [InverterG3|addr;remote:StreamPtr;local:StreamPtr|create_remote();;close()] -[InverterG3P|addr;remote:StreamPtr;local:StreamPtr|create_remote();;close()] +[InverterG3]++->[local:StreamPtr] +[InverterG3]++->[remote:StreamPtr] [<>||set_node_id();get_conn_no();;tx_add();tx_flush();tx_get();tx_peek();tx_log();tx_clear();tx_len();;fwd_add();fwd_log();rx_get();rx_peek();rx_log();rx_clear();rx_len();rx_set_cb();;prot_set_timeout_cb()] [AsyncIfcImpl|fwd_fifo:ByteFifo;tx_fifo:ByteFifo;rx_fifo:ByteFifo;conn_no:Count;node_id;timeout_cb] @@ -19,33 +20,24 @@ [AsyncStream]^[AsyncStreamClient] -[Talent|ifc:AsyncIfc;conn_no;addr;;await_conn_resp_cnt;id_str;contact_name;contact_mail;db:InfosG3;mb:Modbus;switch|msg_contact_info();msg_ota_update();msg_get_time();msg_collector_data();msg_inverter_data();msg_unknown();;healthy();close()] -[Talent][AsyncStreamClient] -[Talent]<-local++[InverterG3] -[InverterG3]++local->[AsyncStreamServer] - -[SolarmanV5|ifc:AsyncIfc;conn_no;addr;;control;serial;snr;db:InfosG3P;mb:Modbus;switch|msg_unknown();;healthy();close()] -[SolarmanV5][AsyncStreamClient] -[SolarmanV5]<-local++[InverterG3P] -[InverterG3P]++local->[AsyncStreamServer] +[Talent|conn_no;addr;;await_conn_resp_cnt;id_str;contact_name;contact_mail;db:InfosG3;mb:Modbus;switch|msg_contact_info();msg_ota_update();msg_get_time();msg_collector_data();msg_inverter_data();msg_unknown();;healthy();close()] +[Talent]<-++[local:StreamPtr] +[local:StreamPtr]++->[AsyncStreamServer] +[Talent]<-0..1[remote:StreamPtr] +[remote:StreamPtr]0..1->[AsyncStreamClient] [Infos|stat;new_stat_data;info_dev|static_init();dev_value();inc_counter();dec_counter();ha_proxy_conf;ha_conf;ha_remove;update_db;set_db_def_value;get_db_value;ignore_this_device] [Infos]^[InfosG3||ha_confs();parse()] -[Infos]^[InfosG3P||ha_confs();parse()] -[Talent]use->[<>] [Talent]->[InfosG3] -[SolarmanV5]use->[<>] -[SolarmanV5]->[InfosG3P] + +[Message|server_side:bool;mb:Modbus;ifc:AsyncIfc;node_id;header_valid:bool;header_len;data_len;unique_id;sug_area:str;new_data:dict;state:State;shutdown_started:bool;modbus_elms;mb_timer:Timer;mb_timeout;mb_first_timeout;modbus_polling:bool|_set_mqtt_timestamp();_timeout();_send_modbus_cmd(); end_modbus_cmd();close();inc_counter();dec_counter()] +[Message]use->[<>] [<>|_registry|close()] [<>]^-.-[<>] -[<>]^-.-[Message|node_id|inc_counter();dec_counter()] +[<>]^-.-[Message] [Message]^[Talent] -[Message]^[SolarmanV5] [Modbus|que;;snd_handler;rsp_handler;timeout;max_retires;last_xxx;err;retry_cnt;req_pend;tim|build_msg();recv_req();recv_resp();close()] -[Modbus]<1-has[SolarmanV5] -[Modbus]<1-has[Talent] +[Modbus]<0..1-has[Message] diff --git a/app/proxy_3.svg b/app/proxy_3.svg new file mode 100644 index 0000000..37fc587 --- /dev/null +++ b/app/proxy_3.svg @@ -0,0 +1,364 @@ + + + + + + +G + + + +A0 + + + +Example of +instantiation for a +GEN3PLUS inverter! + + + +A1 + +<<AbstractIterMeta>> + + +__iter__() + + + +A14 + +<<ProtocolIfc>> + +_registry + +close() + + + +A1->A14 + + + + + +A2 + +InverterG3P + +addr +remote:StreamPtr +local:StreamPtr + +create_remote() +close() + + + +A3 + +local:StreamPtr + + + +A2->A3 + + + + + + +A4 + +remote:StreamPtr + + + +A2->A4 + + + + + + +A8 + +AsyncStreamServer + +create_remote + +<async>server_loop() +<async>_async_forward() +<async>publish_outstanding_mqtt() +close() + + + +A3->A8 + + + + + + +A9 + +AsyncStreamClient + + +<async>client_loop() +<async>_async_forward()) + + + +A4->A9 + + +0..1 + + + +A5 + +<<AsyncIfc>> + + +set_node_id() +get_conn_no() +tx_add() +tx_flush() +tx_get() +tx_peek() +tx_log() +tx_clear() +tx_len() +fwd_add() +fwd_log() +rx_get() +rx_peek() +rx_log() +rx_clear() +rx_len() +rx_set_cb() +prot_set_timeout_cb() + + + +A6 + +AsyncIfcImpl + +fwd_fifo:ByteFifo +tx_fifo:ByteFifo +rx_fifo:ByteFifo +conn_no:Count +node_id +timeout_cb + + + +A5->A6 + + + + + +A7 + +AsyncStream + +reader +writer +addr +r_addr +l_addr + +<async>loop +disc() +close() +healthy() +__async_read() +__async_write() +__async_forward() + + + +A6->A7 + + + + + +A7->A8 + + + + + +A7->A9 + + + + + +A10 + +SolarmanV5 + +conn_no +addr +control +serial +snr +db:InfosG3P +switch + +msg_unknown() +healthy() +close() + + + +A10->A3 + + + + + + +A10->A4 + + +0..1 + + + +A12 + +InfosG3P + + +ha_confs() +parse() + + + +A10->A12 + + + + + +A11 + +Infos + +stat +new_stat_data +info_dev + +static_init() +dev_value() +inc_counter() +dec_counter() +ha_proxy_conf +ha_conf +ha_remove +update_db +set_db_def_value +get_db_value +ignore_this_device + + + +A11->A12 + + + + + +A13 + +Message + +server_side:bool +mb:Modbus +ifc:AsyncIfc +node_id +header_valid:bool +header_len +data_len +unique_id +sug_area:str +new_data:dict +state:State +shutdown_started:bool +modbus_elms +mb_timer:Timer +mb_timeout +mb_first_timeout +modbus_polling:bool + +_set_mqtt_timestamp() +_timeout() +_send_modbus_cmd() +<async> end_modbus_cmd() +close() +inc_counter() +dec_counter() + + + +A13->A5 + + +use + + + +A13->A10 + + + + + +A14->A13 + + + + + +A15 + +Modbus + +que +snd_handler +rsp_handler +timeout +max_retires +last_xxx +err +retry_cnt +req_pend +tim + +build_msg() +recv_req() +recv_resp() +close() + + + +A15->A13 + + +has +0..1 + + + diff --git a/app/proxy_3.yuml b/app/proxy_3.yuml new file mode 100644 index 0000000..499c93f --- /dev/null +++ b/app/proxy_3.yuml @@ -0,0 +1,42 @@ +// {type:class} +// {direction:topDown} +// {generate:true} + +[note: Example of instantiation for a GEN3PLUS inverter!{bg:cornsilk}] +[<>||__iter__()] + +[InverterG3P|addr;remote:StreamPtr;local:StreamPtr|create_remote();;close()] +[InverterG3P]++->[local:StreamPtr] +[InverterG3P]++->[remote:StreamPtr] + +[<>||set_node_id();get_conn_no();;tx_add();tx_flush();tx_get();tx_peek();tx_log();tx_clear();tx_len();;fwd_add();fwd_log();rx_get();rx_peek();rx_log();rx_clear();rx_len();rx_set_cb();;prot_set_timeout_cb()] +[AsyncIfcImpl|fwd_fifo:ByteFifo;tx_fifo:ByteFifo;rx_fifo:ByteFifo;conn_no:Count;node_id;timeout_cb] +[AsyncStream|reader;writer;addr;r_addr;l_addr|;loop;disc();close();healthy();;__async_read();__async_write();__async_forward()] +[AsyncStreamServer|create_remote|server_loop();_async_forward();publish_outstanding_mqtt();close()] +[AsyncStreamClient||client_loop();_async_forward())] +[<>]^-.-[AsyncIfcImpl] +[AsyncIfcImpl]^[AsyncStream] +[AsyncStream]^[AsyncStreamServer] +[AsyncStream]^[AsyncStreamClient] + +[SolarmanV5|conn_no;addr;;control;serial;snr;db:InfosG3P;switch|msg_unknown();;healthy();close()] +[SolarmanV5]<-++[local:StreamPtr] +[local:StreamPtr]++->[AsyncStreamServer] +[SolarmanV5]<-0..1[remote:StreamPtr] +[remote:StreamPtr]0..1->[AsyncStreamClient] + +[Infos|stat;new_stat_data;info_dev|static_init();dev_value();inc_counter();dec_counter();ha_proxy_conf;ha_conf;ha_remove;update_db;set_db_def_value;get_db_value;ignore_this_device] +[Infos]^[InfosG3P||ha_confs();parse()] + +[SolarmanV5]->[InfosG3P] + +[Message|server_side:bool;mb:Modbus;ifc:AsyncIfc;node_id;header_valid:bool;header_len;data_len;unique_id;sug_area:str;new_data:dict;state:State;shutdown_started:bool;modbus_elms;mb_timer:Timer;mb_timeout;mb_first_timeout;modbus_polling:bool|_set_mqtt_timestamp();_timeout();_send_modbus_cmd(); end_modbus_cmd();close();inc_counter();dec_counter()] +[Message]use->[<>] + +[<>|_registry|close()] +[<>]^-.-[<>] +[<>]^-.-[Message] +[Message]^[SolarmanV5] + +[Modbus|que;;snd_handler;rsp_handler;timeout;max_retires;last_xxx;err;retry_cnt;req_pend;tim|build_msg();recv_req();recv_resp();close()] +[Modbus]<0..1-has[Message]