示例#1
0
        public MainViewModel()
        {
            model = new Model.MainModel(appByJOChKey);
            DatosDeConfiguracionModificados = false;

            AppCloseCommand    = new Extras.RelayCommand(CloseMainWindows, param => CanCloseWindows);
            AppMaximizeCommand = new Extras.RelayCommand(MaximizeMainWindows, param => CanCloseWindows);
            AppMinimizeCommand = new Extras.RelayCommand(MinimizeMainWindows, param => CanCloseWindows);

            OpenExeFFMPEGCommand = new Extras.RelayCommand(OpenExeFile, param => CanStartGrabaciones);
            OpenDataCommand      = new Extras.RelayCommand(OpenDataDir, param => CanStartGrabaciones);

            AgregarCamaraCommand = new Extras.RelayCommand(AgregarCamara, param => CanStartGrabaciones);

            GuardarLosCambiosCommand = new Extras.RelayCommand(GuardarLosCambios, param => DatosDeConfiguracionModificados);

            IniciarGrabacionesCommand = new Extras.RelayCommand(IniciarGrabaciones, param => CanStartGrabaciones);
            DetenerGrabacionesCommand = new Extras.RelayCommand(DetenerGrabaciones, param => CanStopGrabaciones);

            TiempoDeGrabacionesCommand = new Extras.RelayCommand(TiempoDeGrabaciones, param => CanStartGrabaciones);

            LimpiarLogDeActividadCommand = new Extras.RelayCommand(LimpiarLogDeActividad, param => CanCloseWindows);

            //ListaDeCamaras = new List<Extras.DescriptorDeCamara>();
            //ListaDeCamaras.Add(new Extras.DescriptorDeCamara { activa = true, grabar = false, nombre = "camara 01", url = "192.168.0.90", conexion = "none", portRtsp = 554, portHttp = 80, usuario = "admin", password = "******" });
            //ListaDeCamaras.Add(new Extras.DescriptorDeCamara { activa = true, grabar = false, nombre = "camara 02", url = "192.168.0.91", conexion = "none", portRtsp = 554, portHttp = 80, usuario = "admin", password = "******" });
            //ListaDeCamaras.Add(new Extras.DescriptorDeCamara { activa = true, grabar = false, nombre = "camara 03", url = "192.168.0.92", conexion = "none", portRtsp = 554, portHttp = 80, usuario = "admin", password = "******" });

            LogDeActividad += $"Inicializando la app: {DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss")} con {ListaDeCamaras.Count} camaras.\r\n";
        }
示例#2
0
        public MainViewModel()
        {
            model = new Model.MainModel(appByJOChKey);
            DatosDeConfiguracionModificados = false;

            AppCloseCommand    = new Extras.RelayCommand(CloseMainWindows, param => CanCloseWindows);
            AppMaximizeCommand = new Extras.RelayCommand(MaximizeMainWindows, param => CanCloseWindows);
            AppMinimizeCommand = new Extras.RelayCommand(MinimizeMainWindows, param => CanCloseWindows);

            OpenExeFFMPEGCommand = new Extras.RelayCommand(OpenExeFile, param => CanCloseWindows);

            OpenPairsBinFileCommand = new Extras.RelayCommand(OpenPairsBinFile, param => CanCloseWindows);
        }
示例#3
0
        /// <summary>IPC通信:メイン.ViewModel</summary>
        public MainViewModel()
        {
            _Model = new Model.MainModel(ChangeResult);

            GetResultCommand = new DelegateCommand(() =>
            {
                IsEnabled = false;
                CallPropertyChanged(nameof(IsEnabled));

                _Model?.Execute();
            },
                                                   () => IsEnabled);
        }
示例#4
0
        public void MultiplierCalculate()
        {
            // arrange
            string workGroup = "Manager";

            double expected = 1.05d;

            // act
            Model.MainModel model = new Model.MainModel();

            double actual = model.MultiplierCalculate(workGroup);

            // assert
            Assert.AreEqual(expected, actual);
        }
示例#5
0
        public void TimeCalculate()
        {
            // arrange
            DateTime startDate    = new DateTime(2000, 1, 1);
            DateTime selectedDate = new DateTime(2010, 1, 1);

            double expected = 10;

            // act
            Model.MainModel model = new Model.MainModel();

            double actual = model.TimeCalculate(startDate, selectedDate);

            // assert
            Assert.AreEqual(expected, actual);
        }
示例#6
0
        public static Model.MainModel getPowerStatus()
        {
            Model.MainModel MainModel = new Model.MainModel();
            PowerState      state     = PowerState.GetPowerState();

            if (state == null)
            {
                return(MainModel);
            }
            MainModel.ACLineStatus        = state.ACLineStatus;
            MainModel.BatteryFlag         = state.BatteryFlag;
            MainModel.BatteryLifePercent  = state.BatteryLifePercent;
            MainModel.BatteryLifeTime     = state.BatteryLifeTime;
            MainModel.BatteryFullLifeTime = state.BatteryFullLifeTime;
            return(MainModel);
        }
示例#7
0
        public void Allowance_Manager_()
        {
            // arrange
            string   workGroup    = "Manager";
            DateTime startDate    = new DateTime(2000, 1, 1);
            DateTime selectedDate = new DateTime(2005, 1, 1);

            double expected = Math.Pow(1.05, 5);

            // act
            Model.MainModel model = new Model.MainModel();

            double actual = model.Allowance(workGroup, startDate, selectedDate);

            // assert
            Assert.AreEqual(expected, actual);
        }