@@ -329,6 +329,29 @@ impl NodeDataTrait for NodeData {
329
329
}
330
330
}
331
331
332
+ let outputs = & _graph[ node_id] . outputs ;
333
+ for ( name, id) in outputs. iter ( ) {
334
+ let reg = user_state. outs_to_regs . get ( id) ;
335
+ let value = match reg {
336
+ Some ( reg) => user_state. simulation . register ( * reg) ,
337
+ None => false ,
338
+ } ;
339
+
340
+ let button = egui:: Button :: new (
341
+ egui:: RichText :: new ( format ! ( "{}: {}" , name, value) ) . color (
342
+ match value {
343
+ true => egui:: Color32 :: BLACK ,
344
+ false => egui:: Color32 :: WHITE ,
345
+ } ,
346
+ ) ,
347
+ )
348
+ . fill ( match value {
349
+ true => egui:: Color32 :: GREEN ,
350
+ false => egui:: Color32 :: RED ,
351
+ } ) ;
352
+ ui. add ( button) ;
353
+ }
354
+
332
355
responses
333
356
}
334
357
}
@@ -527,18 +550,18 @@ impl eframe::App for NodeGraphExample {
527
550
}
528
551
529
552
if changed {
530
- println ! ( ) ;
531
- println ! ( "Gates: {:?}" , self . user_state. gates) ;
532
- println ! ( "Immediates: {:?}" , self . user_state. immediates) ;
533
- println ! ( "Regs: {:?}" , self . user_state. outs_to_regs) ;
553
+ // println!();
554
+ // println!("Gates: {:?}", self.user_state.gates);
555
+ // println!("Immediates: {:?}", self.user_state.immediates);
556
+ // println!("Regs: {:?}", self.user_state.outs_to_regs);
534
557
535
558
self . user_state . simulation = self
536
559
. user_state
537
560
. compiler
538
561
. compile ( self . user_state . gates . values ( ) . collect :: < Vec < _ > > ( ) ) ;
539
562
540
- println ! ( "Compiler: {:?}" , self . user_state. compiler) ;
541
- println ! ( "Simulation: {:?}" , self . user_state. simulation) ;
563
+ // println!("Compiler: {:?}", self.user_state.compiler);
564
+ // println!("Simulation: {:?}", self.user_state.simulation);
542
565
543
566
let mut immediates: Vec < bool > =
544
567
vec ! [ false ; self . user_state. compiler. immediate_count] ;
@@ -552,7 +575,7 @@ impl eframe::App for NodeGraphExample {
552
575
} ) ;
553
576
554
577
self . user_state . simulation . run ( & immediates) ;
555
- println ! ( "Ran: {:?}" , self . user_state. simulation) ;
578
+ // println!("Ran: {:?}", self.user_state.simulation);
556
579
}
557
580
558
581
for node_response in graph_response. node_responses {
0 commit comments