Example #1
0
 /// <summary>
 /// Initializes each viewmodel after the MainViewModel has been constructed.
 /// </summary>
 public void Init()
 {
     if (VehicleViewModel == null)
         VehicleViewModel = new VehicleViewModel();
     if (CommunicationViewModel == null)
         CommunicationViewModel = new CommunicationViewModel();
     if (AutoControlViewModel == null)
         AutoControlViewModel = new AutoControlViewModel();
     if (VisualizationViewModel == null)
         VisualizationViewModel = new VisualizationViewModel();
 }
Example #2
0
        private async void VuTimerEvent(object sender, ElapsedEventArgs elapsedEventArgs)
        {
            _vuTimer.Stop();
            //VuMeterValue = _r.Next(0,100);
            var z = new GetVu(_main.Id);

            CommunicationViewModel.AddData(z);
            await z.WaitAsync();

            _vuValues.Add(z.VuMeterValue);
            OnVuDataReceived(new VuDataReceivedEventArgs
            {
                Last          = _vuValues.Last(),
                Max           = _vuValues.Max(),
                Avarage       = _vuValues.Average(),
                LastVuMeasure = DateTime.Now,
                Channel       = ChannelId,
            });
            if (IsActive)
            {
                _vuTimer.Start();
            }
        }
Example #3
0
 public ActionResult Index(CommunicationViewModel model)
 {
     if (model.Id == 1)
     {
         return(RedirectToAction("AppForPay"));
     }
     else if (model.Id == 2)
     {
         return(RedirectToAction("EmploymentCertificate"));
     }
     else if (model.Id == 3)
     {
         return(RedirectToAction("NonUseOfChildCare"));
     }
     else if (model.Id == 4)
     {
         return(RedirectToAction("AskForLeave"));
     }
     else
     {
         return(RedirectToAction("AppForLoan"));
     }
 }
Example #4
0
        /// <summary>
        ///     List of in and output names
        /// </summary>
        /// <returns></returns>
        public async Task SetInAndOutputNames(IProgress <DownloadProgress> iProgress)
        {
            _inOutputNamesPackages = 0;

            var list = new List <NameUpdate>(
                _flows.Select(result => new[]
            {
                new NameUpdate(result.Id, result.NameOfInput, NameType.Input),
                new NameUpdate(result.Id, result.NameOfOutput, NameType.Output),
            }).SelectMany(io => io));

            CommunicationViewModel.AddData(list);

            foreach (var update in list)
            {
                await update.WaitAsync();

                iProgress.Report(new DownloadProgress()
                {
                    Progress = ++_inOutputNamesPackages,
                    Total    = 24
                });
            }
        }
Example #5
0
        public async Task GetEeprom(IProgress <DownloadProgress> iProgress)
        {
            _eepromReceivePackages[_area] = 0;
            var ar = McuDat.EepromAreaFactory(_area);

            var count = ar.Size / McuDat.BufferSize + 1;

            for (var i = ar.Location; i < ar.Location + ar.Size + McuDat.BufferSize; i += McuDat.BufferSize)
            {
                var s = new GetE2PromExt(_mcuid, McuDat.BufferSize, i);
                CommunicationViewModel.AddData(s);

                await s.WaitAsync();

                UpdateEepromData(s);

                iProgress.Report(new DownloadEeprom()
                {
                    Progress = ++_eepromReceivePackages[_area],
                    Total    = count,
                    Area     = _area
                });
            }
        }
Example #6
0
 private void SendData()
 {
     CommunicationViewModel.AddData(new RoutingTable(new[] { ButtonId }, MainUnit.Id, LibraryData.FuturamaSys.MatrixSelection));
 }
 private static SdCardMessageName CardNameFactory(int card, int track)
 {
     var download = new SdCardMessageName(card, track);
     CommunicationViewModel.AddData(download);
     return download;
 }
 private void UpdateSettings1()
 {
     CommunicationViewModel.AddData(new SetMeasurement(_main.Id, Error48VInterval, Error220VInterval, Error48VAmount.Value, Error220VAmount.Value));
 }
 public ActionResult Detail(CommunicationViewModel comm)
 {
     return(File(comm.Data, "application/force-download", comm.FileName));
 }