public MainWindow() { InitializeComponent(); GetIni(); SetPanle(); RobotEngine2 = new WifiRobotCMDEngineV2((Object)this.statusBar); OpenWifi(); }
/// <summary> /// forward /// 往前走 /// </summary> /// <param name="obj"></param> /// <param name="RobotEngine2"></param> /// <param name="Send_status"></param> /// <param name="ctrlType"></param> /// <param name="cmd"></param> /// <param name="comm"></param> public void OnUp(object obj, WifiRobotCMDEngineV2 RobotEngine2, ref bool Send_status, int ctrlType, SerialPort comm) { MessageBox.Show("Up"); if (Send_status) { RobotEngine2.SendCMD(ctrlType, CMD_Forward, comm); Send_status = false; } }
public MainWindowViewModel() { #region 命令 this.OpsCameraCommand = new DelegateCommand <object>(OnOpsCamera); this.ScreenshotCommand = new DelegateCommand <object>(OnScreenshot); this.VideotapeCommand = new DelegateCommand <object>(OnVideotape); this.UpCommand = new DelegateCommand <object>(OnUp); this.DownCommand = new DelegateCommand <object>(OnDown); this.LeftCommand = new DelegateCommand <object>(OnLeft); this.RightCommand = new DelegateCommand <object>(OnRight); this.TurboCommand = new DelegateCommand <object>(OnTurbe); this.DecelerateCommand = new DelegateCommand <object>(OnDecelerate); this.CameraLeftCommand = new DelegateCommand <object>(OnCameraLeftFunc); this.CameraRightCommand = new DelegateCommand <object>(OnCameraRightFunc); this.WiperCommand = new DelegateCommand <object>(OnWiperFunc); this.WiperTurbeCommand = new DelegateCommand <object>(OnWiperTurbeFunc); this.WiperDecelerateCommand = new DelegateCommand <object>(OnWiperDecelerateFunc); this.SprayCommand = new DelegateCommand <object>(OnSprayFunc); this.SprayTurbeCommand = new DelegateCommand <object>(OnSprayTurbeFunc); this.SprayDecelerateCommand = new DelegateCommand <object>(OnSprayDecelerateFunc); this.FanCommand = new DelegateCommand <object>(OnFanFunc); this.FanTurbeCommand = new DelegateCommand <object>(OnFanTurboFunc); this.FanDecelerateCommand = new DelegateCommand <object>(OnFanDecelerateFunc); #endregion RobotEngine2 = new WifiRobotCMDEngineV2((Object)MainWindow.statusBar); directionCtrl.Init(); StartWifi(); timer = new System.Timers.Timer(); timer.Interval = 1000D; timer.SynchronizingObject = MainWindow.CameraWindow; this.timer.Elapsed += Timer_Elapsed; CameraIp = Utilities.ReadIni("VideoUrl", "videoUrl", ""); }
public void OnStop(object obj, WifiRobotCMDEngineV2 RobotEngine2, ref bool Send_status, int ctrlType, SerialPort comm) { Send_status = true; RobotEngine2.SendCMD(ctrlType, CMD_Stop, comm); }