summaryrefslogtreecommitdiff
path: root/menus.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:03:07 +0900
committerroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:03:07 +0900
commit814a723a47398479fbe9893def230ec17cc72ca0 (patch)
treec8733db4f516f5bf1b370390b7fdb985c17f83a0 /menus.c
parent02fcb4911bc7f0a390fd74e5d0b7d9109e9c6788 (diff)
show channel numbers in submenu headings if used, and no +/- if ignored anyway
Diffstat (limited to 'menus.c')
-rw-r--r--menus.c56
1 files changed, 37 insertions, 19 deletions
diff --git a/menus.c b/menus.c
index 4781356..651d13a 100644
--- a/menus.c
+++ b/menus.c
@@ -1091,7 +1091,13 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch
case Show_amplitude:
Submenu_Value=globals.ChannelState[channel].amplitude;
- show_plus_sign=YES;
+
+ if (globals.Flash.ignore_ampl_polarity[channel]) {
+ show_plus_sign=NO;
+ } else {
+ show_plus_sign=YES;
+ }
+
if (globals.Flash.voltage_enabled[channel]) {
units = g_strdup("V");
} else {
@@ -1200,6 +1206,15 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch
}
+static gchar* title_with_channel (const gchar* title, char chan_key, int channel)
+{
+ if (chan_key) {
+ return g_strdup_printf ("%s %d:", title, channel+1);
+ } else {
+ return g_strdup_printf ("%s:", title);
+ }
+}
+
static void Submenu_Display(int change_selection)
{
gchar *title = NULL;
@@ -1260,9 +1275,9 @@ static void Submenu_Display(int change_selection)
case Submenu1_delay:
if (globals.ChannelState[channel].double_pulse==double_off) {
- title = g_strdup ("Delay:");
+ title = title_with_channel("Delay",globals.Flash.ChanKey_delay,channel);
} else {
- title = g_strdup ("Pulse Spacing:");
+ title = title_with_channel("Pulse Spacing",globals.Flash.ChanKey_delay,channel);
}
Submenu_Numeric_Parameter=Show_delay+channel;
@@ -1280,14 +1295,14 @@ static void Submenu_Display(int change_selection)
case Submenu1_pw:
if (globals.ChannelState[channel].pw_ctrl_mode==pw_normal) {
if (globals.ChannelState[channel].hold_setting==hold_width) {
- title = g_strdup ("Pulse Width:");
+ title = title_with_channel("Pulse Width",globals.Flash.ChanKey_pw,channel);
Submenu_Numeric_Parameter=Show_pw+channel;
} else {
- title = g_strdup ("Duty Cycle:");
+ title = title_with_channel("Duty Cycle",globals.Flash.ChanKey_pw,channel);
Submenu_Numeric_Parameter=Show_duty_cycle+channel;
}
} else {
- title = g_strdup ("Pulse Width:");
+ title = title_with_channel("Pulse Width",globals.Flash.ChanKey_pw,channel);
}
Submenu_max_entry=0;
@@ -1316,7 +1331,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_amp:
- title = g_strdup ("Amplitude:");
+ title = title_with_channel("Amplitude",globals.Flash.ChanKey_amplitude,channel);
if (number_of_fixed_ampl_points(channel)>0) {
int fixed_count;
@@ -1339,53 +1354,56 @@ static void Submenu_Display(int change_selection)
Submenu_Structure[Submenu_max_entry]=mode_amp_amplify;
}
+ if (globals.Flash.ignore_ampl_polarity[channel]) {
+ LCD_write(2,2,"(+/- set by AMP1)");
+ }
break;
case Submenu1_burst_count:
- title = g_strdup ("Pulses per burst:");
+ title = title_with_channel("Pulses per burst",globals.Flash.ChanKey_Burst_Count,channel);
Submenu_Numeric_Parameter=Show_Burst_Count+channel;
Submenu_max_entry=0;
break;
case Submenu1_burst_time:
- title = g_strdup ("Burst Spacing (i.e., low interval):");
+ title = title_with_channel("Burst Spacing",globals.Flash.ChanKey_Burst_Time,channel);
Submenu_Numeric_Parameter=Show_Burst_Time+channel;
Submenu_max_entry=0;
break;
case Submenu1_rise_time:
- title = g_strdup ("Rise time (10%-90%):");
+ title = title_with_channel("Rise time (10%-90%)",globals.Flash.ChanKey_rise_time,channel);
Submenu_Numeric_Parameter=Show_rise_time+channel;
Submenu_max_entry=0;
break;
case Submenu1_slew:
- title = g_strdup ("Slew rate:");
+ title = title_with_channel("Slew Rate",globals.Flash.ChanKey_slew,channel);
Submenu_Numeric_Parameter=Show_slew+channel;
Submenu_max_entry=0;
break;
case Submenu1_soft_current_limit:
- title = g_strdup ("Current limit:");
+ title = title_with_channel("Current Limit",globals.Flash.ChanKey_current_limit,channel);
Submenu_Numeric_Parameter=Show_soft_current_limit+channel;
Submenu_max_entry=0;
break;
case Submenu1_zout:
- title = g_strdup ("Output Impedance");
+ title = title_with_channel("Output Impedance",globals.Flash.ChanKey_zout,channel);
Submenu_max_entry=1;
Submenu_Structure[0]=mode_zout_min;
Submenu_Structure[1]=mode_zout_max;
break;
case Submenu1_loadtype:
- title = g_strdup ("Load Impedance");
+ title = title_with_channel("Load Impedance",globals.Flash.ChanKey_load_type,channel);
Submenu_Numeric_Parameter=Show_load_type+channel;
Submenu_max_entry=0;
break;
case Submenu1_offset:
- title = g_strdup ("Offset:");
+ title = title_with_channel("Offset",globals.Flash.ChanKey_offset,channel);
if (globals.ChannelState[channel].os_mode==os_mode_normal) {
Submenu_Numeric_Parameter=Show_offset+channel;
@@ -1403,7 +1421,7 @@ static void Submenu_Display(int change_selection)
case Submenu1_mon:
Submenu_max_entry=0;
- title = g_strdup ("Monitor:");
+ title = title_with_channel("Monitor",globals.Flash.ChanKey_Curr_Mon_value,channel);
if (globals.ChannelState[channel].pw<globals.Flash.mon_pw_threshold[channel]) {
LCD_write(2,2,"*PW too narrow for accurate reading.");
}
@@ -1411,7 +1429,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_output_state:
- title = g_strdup ("Output State:");
+ title = title_with_channel("Output State",globals.Flash.ChanKey_output_state,channel);
Submenu_max_entry=1;
Submenu_Structure[0]=mode_output_on;
@@ -1420,7 +1438,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_invert:
- title = g_strdup ("Inverted Output?:");
+ title = title_with_channel("Inverted Mode",globals.Flash.ChanKey_polarity,channel);
Submenu_max_entry=1;
Submenu_Structure[0]=mode_inv_no;
@@ -1429,7 +1447,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_logic_level:
- title = g_strdup ("Logic Outputs:");
+ title = title_with_channel("Logic Output",globals.Flash.ChanKey_logic_level,channel);
Submenu_max_entry=1;
Submenu_Structure[0]=mode_logic_ttl;
Submenu_Structure[1]=mode_logic_ecl;