static void callback_on_selected(GebrGuiSequenceEdit *self,
						    void (*button_func) (GebrGuiSequenceEdit *self, GtkTreeIter *iter))
{
	GtkTreeSelection *selection;
	GtkTreeModel *model;
	GtkTreeIter iter;

	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(self->tree_view));
	if (!gtk_tree_selection_get_selected(selection, &model, &iter))
		return;

	button_func(self, &iter);
}
Beispiel #2
0
// State of motor callibration
FLY_STATE func_motor_callibration(void)
{
	FLY_STATE mode = FLY_STATE_CALIB;
	
	if(fly_param.length > 0)
	{
		if(fly_param.motor[2] != 0)	// release calibration mode
		{
			update_calib_data();		// 
			mode = FLY_STATE_NORMAL;
			func_normal();
		}
		{							// calibration mode
			float acc[3];				// sensor data;
			
			button_func(button_check((unsigned char)fly_param.motor[3]));
			
			update_motor_data();
			// センサーデータ取得
			kx022.get_val(acc);
			// センサーデータの送信
			Print.init(tx_data,sizeof(tx_data));
			Print.p("SensorData,");
			Print.f(acc[0],1);
			Print.p(",");
			Print.f(acc[1],1);
			Print.p(",");
			Print.f(acc[2],1);
			Print.p(",");
	//		digitalWrite(BLUE_LED,LOW);
	//		P56D=0;
			SubGHz.send(SUBGHZ_PANID,SUBGHZ_TXADDR, (unsigned char *)&tx_data, Print.len(),NULL);
	//		digitalWrite(BLUE_LED,HIGH);
	//		P56D=1;
		}
	}
	else
	{
		if((fly_param.current_time-fly_param.last_recv_time)>500)
		{
			func_waiting_zero();
			mode = FLY_STATE_DETECTING_ZERO;
		}
	}
	
	return mode;
}