Issues with dynamic using
Some bugs occurred when dynamic ports are used in cooperative Autopilot development.
-
Generation of connecting method
Duplicate Method for the copy of dynamic message inputs shows as follows:dynamic component Statusduplicate{ ports // copy statusmessage for dupilcate in ports dynamic in Statusmessage status_msg[0:32], dynamic out Statusmessage status_msg1[0:32], ... out Statusmessage smsg; @ status_msg::connect{/*interface for dynamic ports*/} implementation Math{ for i = 1:32 if is_connected(status_msg,i) smsg = status_msg(i); if ports_connect(status_msg1, i, smsg) status_msg1(i) = smsg; end .... end end } }
Once the Statusduplicate component is instantiated is the structure like follows
dynamic component Autopilot{ ports dynamic in Statusmessage status_msg[0:32], ... instance Statusduplicate s_dup; instance Autopilot1 ap1; @ status_msg::connect{ connect status_msg[?] -> s_dup.status_msg[?]; } @ s_dup.status_msg1::connect{ connect s_dup.status_msg1 -> ap1.status_msg[?]; } } dynamic component Autopilot1{ ports dynamic in Statusmessage status_msg[0:32], ... instance Statusduplicate s_dup; @ status_msg::connect{ connect status_msg[?] -> s_dup.status_msg[?]; } }
the generated c++ file of Statusduplicate instance in Autopilot1 wont't contain the ports_connect methods.
-
When there are dynamic connects and static connects in one component, sometimes the execution order in generated c++ file is not correct, but it happens irregularly, so current the detailed problems cannot locate.
-
Generation of C++ files costs too long time when there are dynamic ports and connects in the model, the generation of around 4000 lines component costs over 10 hours(without dynamic using only 10 - 20 minutes), it may due to some redundant processes.