File tree Expand file tree Collapse file tree 4 files changed +32
-12
lines changed
script-gen-manager/src/model Expand file tree Collapse file tree 4 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ impl BiasChannel {
2626
2727 pub fn evaluate ( & mut self ) {
2828 self . common_chan_attributes . evaluate ( ) ;
29- self . common_chan_attributes . evaluate_source_limits ( & self . bias , & self . bias ) ; //Use the bias value for both start and stop as the absolute max is used
29+ self . common_chan_attributes
30+ . evaluate_source_limits ( & self . bias , & self . bias ) ; //Use the bias value for both start and stop as the absolute max is used
3031 self . determine_bias_value ( ) ;
3132 }
3233
Original file line number Diff line number Diff line change @@ -286,13 +286,13 @@ impl CommonChanAttributes {
286286 stop_value : & ParameterFloat ,
287287 ) {
288288 //Use region map to further limit the source limits based on the source function and range
289- let mut limit_value = start_value. value ;
289+ let mut limit_value = start_value. value . abs ( ) ;
290290 if let Some ( region_map) =
291291 self . get_region_map ( & self . device . metadata , & self . source_range . value )
292292 {
293293 if stop_value. value . abs ( ) > limit_value. abs ( ) {
294294 //Use the largest absolute value
295- limit_value = stop_value. value ;
295+ limit_value = stop_value. value . abs ( ) ;
296296 }
297297 match & self . source_function . value [ ..] {
298298 s if s == BaseMetadata :: FUNCTION_VOLTAGE => {
Original file line number Diff line number Diff line change @@ -57,16 +57,33 @@ impl StartStopChannel {
5757 }
5858 }
5959
60- pub fn evaluate ( & mut self , list_size : usize ) {
60+ pub fn evaluate ( & mut self , list_size : usize , is_list_enabled : bool ) {
6161 self . common_chan_attributes . evaluate ( ) ;
6262 self . determine_start_value ( ) ;
6363 self . determine_stop_value ( ) ;
6464
6565 //List evaluation
6666
6767 self . update_list ( list_size) ;
68- self . common_chan_attributes
69- . evaluate_source_limits ( & self . start , & self . stop ) ;
68+
69+ if is_list_enabled {
70+ let min_value = self
71+ . list
72+ . iter ( )
73+ . min_by ( |a, b| a. value . partial_cmp ( & b. value ) . unwrap ( ) )
74+ . unwrap ( ) ;
75+ let max_value = self
76+ . list
77+ . iter ( )
78+ . max_by ( |a, b| a. value . partial_cmp ( & b. value ) . unwrap ( ) )
79+ . unwrap ( ) ;
80+
81+ self . common_chan_attributes
82+ . evaluate_source_limits ( min_value, max_value) ;
83+ } else {
84+ self . common_chan_attributes
85+ . evaluate_source_limits ( & self . start , & self . stop ) ;
86+ }
7087 }
7188
7289 fn update_list ( & mut self , list_size : usize ) {
Original file line number Diff line number Diff line change @@ -393,14 +393,16 @@ impl SweepConfig {
393393 }
394394
395395 for step_channel in & mut self . step_channels {
396- step_channel
397- . start_stop_channel
398- . evaluate ( self . step_global_parameters . step_points . value as usize ) ;
396+ step_channel. start_stop_channel . evaluate (
397+ self . step_global_parameters . step_points . value as usize ,
398+ self . step_global_parameters . list_step ,
399+ ) ;
399400 }
400401 for sweep_channel in & mut self . sweep_channels {
401- sweep_channel
402- . start_stop_channel
403- . evaluate ( self . sweep_global_parameters . sweep_points . value as usize ) ;
402+ sweep_channel. start_stop_channel . evaluate (
403+ self . sweep_global_parameters . sweep_points . value as usize ,
404+ self . sweep_global_parameters . list_sweep ,
405+ ) ;
404406 }
405407 }
406408
You can’t perform that action at this time.
0 commit comments