コード例 #1
0
ファイル: controller.cs プロジェクト: MChehadeh/userTerminal
 private void update_mrft_point_settings(mrft_point mrft_point_para)
 {
     _msgID = _organizer.MWCommander.AckID;
     settings_controller.mrft_para mrft_data = new settings_controller.mrft_para();
     mrft_data.relay_amp = mrft_point_para.H;
     mrft_data.beta = mrft_point_para.Beta;
     mrft_data.bias = mrft_point_para.Bias;
     switch (_ctrl_chnl)
     {
         case commander.ctrl_channel.roll:
             LastMessage = _organizer.MWCommander.update_settings(commander.tSetting.mrft_roll, mrft_data);
             break;
         case commander.ctrl_channel.pitch:
             LastMessage = _organizer.MWCommander.update_settings(commander.tSetting.mrft_pitch, mrft_data);
             break;
         case commander.ctrl_channel.yaw:
             LastMessage = _organizer.MWCommander.update_settings(commander.tSetting.mrft_yaw, mrft_data);
             break;
         case commander.ctrl_channel.z_axis:
             LastMessage = _organizer.MWCommander.update_settings(commander.tSetting.mrft_z, mrft_data);
             break;
         default:
             //TODO: Add x and y channels
             throw new NotImplementedException();
     }
     _organizer.MWSerialDriver.serial_send(LastMessage);
 }
コード例 #2
0
ファイル: controller.cs プロジェクト: MChehadeh/userTerminal
 public void add_mrft_point()
 {
     mrft_point mrft_point_new = new mrft_point(PointsCounter);
     mrft_points.Add(mrft_point_new);
     populate_treeView();
     PointsCounter++;
 }
コード例 #3
0
ファイル: controller.cs プロジェクト: MChehadeh/userTerminal
        public void OnMRFTBagsCompeleted(mrft_point sender, MRFTBagsCompletedEventArgs args)//Watch for ind. points
        {
            //MISSING! Update new MRFT parameters

            Debug.WriteLine(string.Format("MRFT bags completed {0}", DateTime.Now.ToLongTimeString()));
            ElementStatusUpdateEventArgs eStatus = new ElementStatusUpdateEventArgs();
            eStatus.Status = string.Format("MRFT Bags Completed at {0}", DateTime.Now.ToLongTimeString());
            if (ElementStatusUpdateEvent != null)
            {
                ElementStatusUpdateEvent(this, eStatus);
            }
            else
            {
                Debug.WriteLine(string.Format("Unhandled Event {0} at {1}", "ElementStatusUpdateEvent", DateTime.Now.ToString("HH:mm:ss.fff")));
            }

            if (_perform_counter == mrft_points.Count-1)
            {
                mrft_points[_perform_counter].MRFTbagsCompleted -= OnMRFTBagsCompeleted;
                _organizer.MWMsgCtrl.MRFTBagReceived -= OnMRFTBagReceived;
                IsDone = true;
            }
            else
            {
                mrft_points[_perform_counter].MRFTbagsCompleted -= OnMRFTBagsCompeleted;
                _organizer.MWMsgCtrl.MRFTBagReceived -= OnMRFTBagReceived;
                do
                {
                    _perform_counter++;
                } while (!mrft_points[_perform_counter].Is_included);
                _organizer.MWMsgCtrl.AckSettingUpdateReceived += OnAckSettingUpdateReceived;
                update_mrft_point_settings(mrft_points[_perform_counter]);
            }
        }