Beispiel #1
0
        public ClientQuadUIViewModel(IToolAction toolAction, IMissionComponent missionComponent, IVehicleComponent vehicleComponent, IMissionSource missionSource)
        {
            VehicleSelected  = toolAction.VehicleSelected;
            MissionComponent = missionComponent;
            VehicleComponent = vehicleComponent;
            MissionSource    = missionSource;

            StartMissionCommand     = new RelayCommand(StartMissionExecute);
            QuadModeCommand         = new RelayCommand <VehicleModeEnum>(ArduModeCommandExecute);
            MissionCommands         = new RelayCommand <SoftkeyEnum>(MissionCommandsExecute);
            JoystickRestartCommands = new RelayCommand(JoystickRestartCommandsExecute);

            Messenger.Default.Register <VehicleSelected>(this, VehicleSelectedAction);

            Messenger.Default.Register <MapMouseLeftButtonDownMessenger>(this, MapMouseLeftButtonDownAction);

            Logger.Info("ClientQuadUIViewModel init");
        }
Beispiel #2
0
        public QuadPropertyViewModel(IToolAction toolAction, IMissionComponent missionComponent, IVehicleComponent vehicleComponent)
        {
            VehicleSelected       = toolAction.VehicleSelected;
            MissionComponent      = missionComponent;
            VehicleComponent      = vehicleComponent;
            QuadModeCommand       = new RelayCommand <VehicleModeEnum>(ArduModeCommandExecute);
            ChangeModeCommand     = new RelayCommand(ChangeModeCommandExecute);
            ButtonCommands        = new RelayCommand <SoftkeyEnum>(ButtonCommandsAction);
            FlyCommand            = new RelayCommand(FlyCommandExecute);
            ModeControlVisibility = Visibility.Collapsed;

            WriteMissionCommand = new RelayCommand(WriteMissionCommandExecute, WriteMissionCommandCanExecute);
            ReadMissionCommand  = new RelayCommand(ReadMissionCommandExecute, ReadMissionCommandCanExecute);
            LoadMissionCommand  = new RelayCommand(LoadMissionCommandExecute, LoadMissionCommandCanExecute);
            SaveMissionCommand  = new RelayCommand(SaveMissionCommandExecute, SaveMissionCommandCanExecute);

            Messenger.Default.Register <VehicleSelected>(this, VehicleSelectedAction);

            _dispatcherUiTimer = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, 0, 0, UpdataTimer)
            };
            _dispatcherUiTimer.Tick += DispatcherUiTimerTick;
            _dispatcherUiTimer.Start();
        }