public model_cls(raw_kinematics_data_cls raw_data) { channels = new List <channel_cls>(); number_of_channels = 0; segments = new Segment_cls[20]; for (int i = 1; i <= 19; i++) { segments[i] = new Segment_cls(i, raw_data); } segments[0] = null; }
public Segment_cls(int Segment_id, raw_kinematics_data_cls Raw_data) { raw_data = Raw_data; segment_id = Segment_id; segment_axis = new Double[3]; x = new Double[3]; y = new Double[3]; z = new Double[3]; xl = new Double[3]; yl = new Double[3]; zl = new Double[3]; Accelerometer = new sensor_cls(); Gyroscope = new sensor_cls(); Magnetometer = new sensor_cls(); Sensors_array[0] = Accelerometer; Sensors_array[1] = Gyroscope; Sensors_array[2] = Magnetometer; }
// constructor public MainWindow() { InitializeComponent(); string Host = System.Net.Dns.GetHostName(); debug_info_panel.Content += "my host -> " + Host + "\r\n"; string IP1 = System.Net.Dns.GetHostByName(Host).AddressList[0].ToString(); debug_info_panel.Content += "my ip -> " + IP1 + "\r\n"; //local_kinematics_endpoint.Address = IPAddress.Parse("192.168.1.1"); local_kinematics_endpoint.Address = IPAddress.Parse(IP1); local_kinematics_endpoint.Port = 112; kinematics_listener = new UdpClient(); try { kinematics_listener.Client.Bind(local_kinematics_endpoint); } catch (Exception e) { } raw_data = new raw_kinematics_data_cls(); model = new model_cls(raw_data); // fill model model.add_channel(new angle_cls(model.Segments[1], model.Segments[2])); model.add_channel(new angle_cls(model.Segments[1], model.Segments[3])); model.add_channel(new angle_cls(model.Segments[1], model.Segments[4])); model.add_channel(new angle_cls(model.Segments[2], model.Segments[3])); model.add_channel(new angle_cls(model.Segments[2], model.Segments[4])); model.add_channel(new angle_cls(model.Segments[3], model.Segments[4])); histogram = new histogram_cls(160, 13, 40); // object just to run tests //metronomeThread = new Thread(new ThreadStart(this.metronome_thread_method)); //metronomeThread.IsBackground = true; stop_metronome_button.IsEnabled = false; //metronomeThread.Start(); angle_chart0 = new angle_graph_cls(angle_0_graph_canvas, chart0_legend_label); angle_chart1 = new angle_graph_cls(angle_1_graph_canvas, chart1_legend_label); angle_chart2 = new angle_graph_cls(angle_2_graph_canvas, chart2_legend_label); //mean_cycle_chart0 = new mean_cycle_graph_cls(channel_0_mean_graph_canvas); //mean_cycle_chart1 = new mean_cycle_graph_cls(channel_1_mean_graph_canvas); //mean_cycle_chart2 = new mean_cycle_graph_cls(channel_2_mean_graph_canvas); registrator0 = new registrator_cls(storage0, metronom); registrator1 = new registrator_cls(storage1, metronom); registrator2 = new registrator_cls(storage2, metronom); //windowsFormsHost.Child = userControl_unity3d; //MyPSI = new ProcessStartInfo(unity_game_path); //unity_game_process = new Process(); //unity_game_process.StartInfo = MyPSI; //unity_game_process.Start(); //System.IntPtr handle1 = unity_game_process.MainWindowHandle; //System.IntPtr handle2 = userControl_unity3d.Handle; //SetParent(handle1, handle2); //(windowsFormsHost.Child as System.Windows.Forms.WebBrowser).Navigate("file:///C:/workspace/unity_workspace/skeleton/skeleton_00_01/skeleton_00_01/web_play/web_play.html"); }// end constructor