@@ -22,8 +22,6 @@ pub fn miner_view<'a>(
2222 dragging : bool ,
2323 color_mode : ColorMode ,
2424) -> Element < ' a , Message > {
25- let sidebar = sidebar ( data, system_info) ;
26-
2725 // Look up miner config based on model name for physical layout
2826 let miner_config = system_info. and_then ( |info| config:: lookup ( & info. model ) ) ;
2927
@@ -37,9 +35,11 @@ pub fn miner_view<'a>(
3735 . unwrap_or ( 3 )
3836 } ) ;
3937
40- // Compute cross-slot analysis for gradient/outlier modes
38+ // Compute cross-slot analysis for gradient/outlier/nonce modes
4139 let all_analysis = analysis:: analyze_all_slots ( & data. slots , chips_per_domain) ;
4240
41+ let sidebar = sidebar ( data, system_info, & all_analysis) ;
42+
4343 let grids = data. slots . iter ( ) . zip ( all_analysis. iter ( ) ) . fold (
4444 Column :: new ( ) . spacing ( 25 ) . width ( Length :: Shrink ) ,
4545 |col, ( slot, slot_analysis) | {
@@ -86,7 +86,11 @@ pub fn miner_view<'a>(
8686 }
8787}
8888
89- fn sidebar < ' a > ( data : & ' a MinerData , system_info : Option < & ' a SystemInfo > ) -> Column < ' a , Message > {
89+ fn sidebar < ' a > (
90+ data : & ' a MinerData ,
91+ system_info : Option < & ' a SystemInfo > ,
92+ all_analysis : & [ Vec < ChipAnalysis > ] ,
93+ ) -> Column < ' a , Message > {
9094 let mut col = Column :: new ( ) . spacing ( 2 ) . padding ( 5 ) . width ( Length :: Fill ) ;
9195
9296 // System info section
@@ -103,22 +107,40 @@ fn sidebar<'a>(data: &'a MinerData, system_info: Option<&'a SystemInfo>) -> Colu
103107 . push ( Space :: with_height ( 8 ) ) ; // spacer
104108 }
105109
106- for slot in & data. slots {
110+ for ( slot_idx , slot) in data. slots . iter ( ) . enumerate ( ) {
107111 col = col. push (
108112 text ( format ! ( "── Slot {} ──" , slot. id) )
109113 . size ( 13 )
110114 . color ( theme:: BRAND_ORANGE ) ,
111115 ) ;
112116
113- for chip in & slot. chips {
117+ let slot_analysis = all_analysis. get ( slot_idx) ;
118+
119+ for ( chip_idx, chip) in slot. chips . iter ( ) . enumerate ( ) {
120+ let nonce_deficit = slot_analysis
121+ . and_then ( |a| a. get ( chip_idx) )
122+ . map_or ( 0.0 , |a| a. nonce_deficit ) ;
123+
114124 col = col. push (
115- text ( format ! (
116- "C{:<3} freq:{:<3} vol:{:<3} temp:{:<2} nonce:{:<6} err:{} crc:{} x:{} repeat:{} pct:{:.1}%/{:.1}%" ,
117- chip. id, chip. freq, chip. vol, chip. temp, chip. nonce,
118- chip. errors, chip. crc, chip. x, chip. repeat, chip. pct1, chip. pct2,
119- ) )
120- . size ( 12 )
121- . color ( theme:: color_for_chip_temp ( chip. temp ) ) ,
125+ row ! [
126+ text( format!( "C{:<3}" , chip. id) ) . size( 12 ) ,
127+ text( format!( "freq:{:<3}" , chip. freq) ) . size( 12 ) ,
128+ text( format!( "vol:{:<3}" , chip. vol) ) . size( 12 ) ,
129+ text( "temp:" ) . size( 12 ) ,
130+ text( format!( "{:<2}" , chip. temp) )
131+ . size( 12 )
132+ . color( theme:: color_for_chip_temp( chip. temp) ) ,
133+ text( "nonce:" ) . size( 12 ) ,
134+ text( format!( "{:<6}" , chip. nonce) )
135+ . size( 12 )
136+ . color( theme:: color_for_nonce_deficit( nonce_deficit) ) ,
137+ text( format!(
138+ "errors:{} crc:{} x:{} repeat:{} pct:{:.0}%/{:.0}%" ,
139+ chip. errors, chip. crc, chip. x, chip. repeat, chip. pct1, chip. pct2,
140+ ) )
141+ . size( 12 ) ,
142+ ]
143+ . spacing ( 2 ) ,
122144 ) ;
123145 }
124146 }
0 commit comments