@@ -201,15 +201,7 @@ namespace rt::ui
201201
202202 void draw_behavior (core::behavior_ptr behavior)
203203 {
204- out << " subgraph " << behavior->id_str () << " [\" \" ]" << std::endl;
205204 draw_behavior_info (behavior.get ());
206-
207- for (auto [_, c] : behavior->ordered_cown )
208- {
209- this ->draw_cown (c, behavior);
210- }
211- out << " end" << std::endl;
212-
213205 // Set background color
214206 auto background = ERROR_NODE_COLOR;
215207 switch (behavior->status )
@@ -224,31 +216,23 @@ namespace rt::ui
224216 background = BEHAVIOR_PENDING_COLOR;
225217 break ;
226218 }
227- out << " style " << behavior->id_str () << " fill:" << background
228- << std::endl;
229- }
230-
231- void draw_dependencies (core::behavior_ptr behavior)
232- {
233- for (auto [_, cown_obj] : behavior->ordered_cown )
234- {
235- assert (cown_obj->get_prototype () == core::cownPrototypeObject ());
236- core::CownObject* cown = reinterpret_cast <core::CownObject*>(cown_obj);
237- auto cown_id = cown->get_id ();
238-
239- // Draw dependencies
240- for (auto succ : behavior->succ )
241- {
242- if (succ->ordered_cown .contains (cown_id))
243- {
244- out << " " ;
245- out << cown_node_id (cown, succ->id );
246- out << " --> " ;
247- out << cown_node_id (cown, behavior->id );
248- out << std::endl;
249- edge_counter += 1 ;
250- }
251- }
219+ out << " style " << this ->behavior_node_name (behavior.get ())
220+ << " fill:" << background << std::endl;
221+
222+ for (auto [cown, pred] : behavior->cown_deps )
223+ {
224+ out << " " ;
225+ out << this ->behavior_node_name (behavior.get ());
226+ out << " --> |" ;
227+ // TODO: This really shouldn't directly access the name. get_name()
228+ // should always just return the name and then there is a
229+ // `more_info()` method that provides additional info like
230+ // the cown status or LRC for regions etc.
231+ out << escape (cown->get_name ());
232+ out << " | " ;
233+ out << this ->behavior_node_name (pred);
234+ out << std::endl;
235+ edge_counter += 1 ;
252236 }
253237 }
254238
@@ -290,15 +274,6 @@ namespace rt::ui
290274 this ->draw_behavior (behavior);
291275 }
292276
293- for (auto & [bid, behavior] : behaviors)
294- {
295- this ->draw_dependencies (behavior);
296- }
297-
298- // TODO:
299- // -> Show running behavior?
300- // -> Cown colors
301-
302277 // Footer
303278 this ->draw_footer ();
304279 }
0 commit comments