summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1970-01-01 11:26:38 +0900
committerroot <root@avtech.domain.avtechpulse.com>1970-01-01 11:26:38 +0900
commita1a298c37ad0a762b651ad349d86ad32eb902904 (patch)
treed284ce8dda755ea870860a743467e067b8feaad5
parentca44808e60b819465971c626c8ff5d90de90785a (diff)
fixed submenu mode numbering
-rw-r--r--device-functions.c1
-rw-r--r--menus.c55
2 files changed, 33 insertions, 23 deletions
diff --git a/device-functions.c b/device-functions.c
index 4bff9f5..1d27a3a 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -4990,6 +4990,5 @@ gboolean fixed_ampl_ok (int channel, float use_ampl) {
if (fabs(use_ampl-globals.Flash.fixed_ampl_points[channel][i])<globals.Flash.ampl_zero_equiv[channel])
return TRUE;
}
-
return FALSE;
}
diff --git a/menus.c b/menus.c
index b990dbd..85f53a5 100644
--- a/menus.c
+++ b/menus.c
@@ -131,7 +131,18 @@
#define mode_57600 7700
#define mode_115200 7800
#define mode_pw_ew 7900
-#define mode_ampl_fixed_points 8000
+
+#define mode_ampl_fixed_point0 8000
+#define mode_ampl_fixed_point1 8100
+#define mode_ampl_fixed_point2 8200
+#define mode_ampl_fixed_point3 8300
+#define mode_ampl_fixed_point4 8400
+#define mode_ampl_fixed_point5 8500
+#define mode_ampl_fixed_point6 8600
+#define mode_ampl_fixed_point7 8700
+#define mode_ampl_fixed_point8 8800
+#define mode_ampl_fixed_point9 8900
+
#define Submenu_maximum_entries 10
@@ -1354,7 +1365,7 @@ static void Submenu_Display(int change_selection)
int fixed_count;
Submenu_max_entry = number_of_fixed_ampl_points(channel) - 1;
for (fixed_count = 0; fixed_count < number_of_fixed_ampl_points(channel); ++fixed_count) {
- Submenu_Structure[fixed_count] = mode_ampl_fixed_points + fixed_count;
+ Submenu_Structure[fixed_count] = mode_ampl_fixed_point0 + (fixed_count*100);
}
} else if (globals.ChannelState[channel].amp_mode==amp_mode_normal) {
Submenu_Numeric_Parameter=Show_amplitude+channel;
@@ -1906,21 +1917,21 @@ static void Submenu_Display(int change_selection)
// hard-coded count of 10 - not ideal!
- case mode_ampl_fixed_points + 0:
+ case (mode_ampl_fixed_point0):
use_ampl = globals.Flash.fixed_ampl_points[channel][0];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 1:
+ case (mode_ampl_fixed_point1):
use_ampl = globals.Flash.fixed_ampl_points[channel][1];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 2:
+ case (mode_ampl_fixed_point2):
use_ampl = globals.Flash.fixed_ampl_points[channel][2];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
@@ -1928,7 +1939,7 @@ static void Submenu_Display(int change_selection)
}
break;
- case mode_ampl_fixed_points + 3:
+ case (mode_ampl_fixed_point3):
use_ampl = globals.Flash.fixed_ampl_points[channel][3];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
@@ -1936,42 +1947,42 @@ static void Submenu_Display(int change_selection)
}
break;
- case mode_ampl_fixed_points + 4:
+ case (mode_ampl_fixed_point4):
use_ampl = globals.Flash.fixed_ampl_points[channel][4];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 5:
+ case (mode_ampl_fixed_point5):
use_ampl = globals.Flash.fixed_ampl_points[channel][5];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 6:
+ case (mode_ampl_fixed_point6):
use_ampl = globals.Flash.fixed_ampl_points[channel][6];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 7:
+ case (mode_ampl_fixed_point7):
use_ampl = globals.Flash.fixed_ampl_points[channel][7];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 8:
+ case (mode_ampl_fixed_point8):
use_ampl = globals.Flash.fixed_ampl_points[channel][8];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
current_operating_mode=i;
}
break;
- case mode_ampl_fixed_points + 9:
+ case (mode_ampl_fixed_point9):
use_ampl = globals.Flash.fixed_ampl_points[channel][9];
String_Parameter_To_Text(use_ampl,2,"",fixed_ampl_units,&mode_name,YES,LCD_col_width);
if (fabs(globals.ChannelState[channel].amplitude-use_ampl)<globals.Flash.ampl_zero_equiv[channel]) {
@@ -3210,52 +3221,52 @@ static int Submenu_Implement_Changes(void)
break;
// hard-coded count of 10 - not ideal!
- case mode_ampl_fixed_points + 0:
+ case (mode_ampl_fixed_point0):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][0],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 1:
+ case (mode_ampl_fixed_point1):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][1],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 2:
+ case (mode_ampl_fixed_point2):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][2],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 3:
+ case (mode_ampl_fixed_point3):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][3],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 4:
+ case (mode_ampl_fixed_point4):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][4],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 5:
+ case (mode_ampl_fixed_point5):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][5],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 6:
+ case (mode_ampl_fixed_point6):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][6],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 7:
+ case (mode_ampl_fixed_point7):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][7],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 8:
+ case (mode_ampl_fixed_point8):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][8],0)) {
return error_num;
}
break;
- case mode_ampl_fixed_points + 9:
+ case (mode_ampl_fixed_point9):
if (error_num=Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.fixed_ampl_points[channel][9],0)) {
return error_num;
}