if(value) encoders[i].switch_address=atoi(value);
}
- if(controller==CONTROLLER1) {
- for(int f=0;f<MAX_FUNCTIONS;f++) {
- for(int i=0;i<MAX_SWITCHES;i++) {
- sprintf(name,"switches[%d,%d].switch_enabled",f,i);
- value=getProperty(name);
- if(value) switches_controller1[f][i].switch_enabled=atoi(value);
- sprintf(name,"switches[%d,%d].switch_pullup",f,i);
- value=getProperty(name);
- if(value) switches_controller1[f][i].switch_pullup=atoi(value);
- sprintf(name,"switches[%d,%d].switch_address",f,i);
- value=getProperty(name);
- if(value) switches_controller1[f][i].switch_address=atoi(value);
- }
+ for(int f=0;f<MAX_FUNCTIONS;f++) {
+ for(int i=0;i<MAX_SWITCHES;i++) {
+ sprintf(name,"switches[%d,%d].switch_enabled",f,i);
+ value=getProperty(name);
+ if(value) switches_controller1[f][i].switch_enabled=atoi(value);
+ sprintf(name,"switches[%d,%d].switch_pullup",f,i);
+ value=getProperty(name);
+ if(value) switches_controller1[f][i].switch_pullup=atoi(value);
+ sprintf(name,"switches[%d,%d].switch_address",f,i);
+ value=getProperty(name);
+ if(value) switches_controller1[f][i].switch_address=atoi(value);
}
- } else {
+ }
+
+ if(controller!=CONTROLLER1) {
for(int i=0;i<MAX_SWITCHES;i++) {
sprintf(name,"switches[%d].switch_enabled",i);
value=getProperty(name);
setProperty(name,value);
}
- if(controller==CONTROLLER1) {
- for(int f=0;f<MAX_FUNCTIONS;f++) {
- for(int i=0;i<MAX_SWITCHES;i++) {
- sprintf(name,"switches[%d,%d].switch_enabled",f,i);
- sprintf(value,"%d",switches_controller1[f][i].switch_enabled);
- setProperty(name,value);
- sprintf(name,"switches[%d,%d].switch_pullup",f,i);
- sprintf(value,"%d",switches_controller1[f][i].switch_pullup);
- setProperty(name,value);
- sprintf(name,"switches[%d,%d].switch_address",f,i);
- sprintf(value,"%d",switches_controller1[f][i].switch_address);
- setProperty(name,value);
- }
+ for(int f=0;f<MAX_FUNCTIONS;f++) {
+ for(int i=0;i<MAX_SWITCHES;i++) {
+ sprintf(name,"switches[%d,%d].switch_enabled",f,i);
+ sprintf(value,"%d",switches_controller1[f][i].switch_enabled);
+ setProperty(name,value);
+ sprintf(name,"switches[%d,%d].switch_pullup",f,i);
+ sprintf(value,"%d",switches_controller1[f][i].switch_pullup);
+ setProperty(name,value);
+ sprintf(name,"switches[%d,%d].switch_address",f,i);
+ sprintf(value,"%d",switches_controller1[f][i].switch_address);
+ setProperty(name,value);
}
-/*
- } else {
+ }
+
+ if(controller!=CONTROLLER1) {
for(int i=0;i<MAX_SWITCHES;i++) {
sprintf(name,"switches[%d].switch_enabled",i);
sprintf(value,"%d",switches[i].switch_enabled);
sprintf(value,"%d",switches[i].switch_address);
setProperty(name,value);
}
-*/
}
saveProperties("gpio.props");
if(value) encoders[i].switch_function=atoi(value);
}
- if(controller==CONTROLLER1) {
- for(int f=0;f<MAX_FUNCTIONS;f++) {
- for(int i=0;i<MAX_SWITCHES;i++) {
- sprintf(name,"switches[%d,%d].switch_function",f,i);
- value=getProperty(name);
- if(value) switches_controller1[f][i].switch_function=atoi(value);
- }
+ for(int f=0;f<MAX_FUNCTIONS;f++) {
+ for(int i=0;i<MAX_SWITCHES;i++) {
+ sprintf(name,"switches[%d,%d].switch_function",f,i);
+ value=getProperty(name);
+ if(value) switches_controller1[f][i].switch_function=atoi(value);
}
- } else {
+ }
+ if(controller!=CONTROLLER1) {
for(int i=0;i<MAX_SWITCHES;i++) {
sprintf(name,"switches[%d].switch_function",i);
value=getProperty(name);
setProperty(name,value);
}
- if(controller==CONTROLLER1) {
- for(int f=0;f<MAX_FUNCTIONS;f++) {
- for(int i=0;i<MAX_SWITCHES;i++) {
- sprintf(name,"switches[%d,%d].switch_function",f,i);
- sprintf(value,"%d",switches_controller1[f][i].switch_function);
- setProperty(name,value);
- }
+ for(int f=0;f<MAX_FUNCTIONS;f++) {
+ for(int i=0;i<MAX_SWITCHES;i++) {
+ sprintf(name,"switches[%d,%d].switch_function",f,i);
+ sprintf(value,"%d",switches_controller1[f][i].switch_function);
+ setProperty(name,value);
}
- } else {
+ }
+ if(controller!=CONTROLLER1) {
for(int i=0;i<MAX_SWITCHES;i++) {
sprintf(name,"switches[%d].switch_function",i);
sprintf(value,"%d",switches[i].switch_function);
static GtkWidget *vfo_panel;
static cairo_surface_t *vfo_surface = NULL;
-int steps[]={1,10,25,50,100,250,500,1000,5000,9000,10000,100000,250000,500000,1000000,0};
-char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","5kHz","9kHz","10kHz","100kHz","250KHz","500KHz","1MHz",0};
+int steps[]={1,10,25,50,100,250,500,1000,5000,9000,10000,100000,250000,500000,1000000};
+char *step_labels[]={"1Hz","10Hz","25Hz","50Hz","100Hz","250Hz","500Hz","1kHz","5kHz","9kHz","10kHz","100kHz","250KHz","500KHz","1MHz"};
static GtkWidget* menu=NULL;
static GtkWidget* band_menu=NULL;
#ifdef CLIENT_SERVER
if(radio_is_remote) {
- //send_vfo_step(client_socket,id,steps);
update_vfo_step(id,steps);
return;
}
}
cairo_show_text(cr, "DIV");
- int s=0;
- while(steps[s]!=step && steps[s]!=0) {
- s++;
+ int s;
+ for(s=0;s<STEPS;s++) {
+ if(steps[s]==step) break;
}
+ if(s>=STEPS) s=0;
+
sprintf(temp_text,"Step %s",step_labels[s]);
cairo_move_to(cr, 400, 15);
cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);
}
}
-/*
-static gboolean
-vfo_step_select_cb (GtkWidget *widget,
- gpointer data)
-{
- step=steps[(int)data];
- g_idle_add(ext_vfo_update,NULL);
-}
-*/
-
static gboolean
vfo_press_event_cb (GtkWidget *widget,
GdkEventButton *event,