Esempio n. 1
0
        /// <summary>
        /// Scheduler 
        /// </summary>
        /// <param name="dataController"></param>
        public Scheduler(Data dataController)
        {
            //data controller
            this.dataController = dataController;

            //update
            this.Update();
        }
Esempio n. 2
0
 /// <summary>
 /// Initialize HttpServer class
 /// </summary>
 public HttpServer(Data dataController, CoPilot.View.CoPilot application)
 {
     this.dataController = dataController;
     this.application = application;
 }
Esempio n. 3
0
        /// <summary>
        /// On navigated to
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var data = NavigationService.GetLastNavigationData();
            if (data != null)
            {
                DataContainer container = data as DataContainer;
                this.CameraController = container.CameraController;
                this.FtpController = container.FtpController;
                this.DriveModeController = container.DriveModeController;
                this.DataController = container.DataController;
            }

            //show message
            if (FtpController.IsOneDriveAvailable)
            {
                Popup.MessageBox box = Popup.MessageBox.Create();
                box.Caption = AppResources.Backup_NotSignedIn;
                box.Message = AppResources.Backup_NotSignedIn_Description;
                box.ShowLeftButton = true;
                box.ShowRightButton = false;
                box.LeftButtonText = AppResources.Ok;
                box.IsOpen = true;
            }

            //connect upload
            FtpController.Connect(this.UploadProgress);

            if (App.IsInactiveMode)
            {
                CameraController.CameraStart();
            }
            App.IsInactiveMode = false;
            base.OnNavigatedFrom(e);
        }
Esempio n. 4
0
 /// <summary>
 /// Stats
 /// </summary>
 public Stats(Data dataController, CoPilot.View.CoPilot copilot)
 {
     //data controller
     this.DataController = dataController;
     this.DataController.PropertyChanged += propertyChangedEvent;
     //menu controller
     this.MenuController = new Menu();
     this.MenuController.Context = MenuContext.Statistics;
     //copilot
     this.CoPilot = copilot;
     //stats
     this.baseStats = new Statistics.Statistics(DataController.Records);
     this.speedwayStats = new Statistics.Statistics(DataController.Circuits);
 }
Esempio n. 5
0
        /// <summary>
        /// Create data controller
        /// </summary>
        private void createDataController()
        {
            ///CONTROLLER
            DataController = new Controllers.Data();

            //Events
            DataController.onUnitsChange += (object sender, EventArgs e) =>
            {
                RateExchange.CurrentCurrency = DataController.Currency;
                DistanceExchange.CurrentDistance = DataController.Distance;
                UnitExchange.CurrentUnit = DataController.Unit;
            };
            DataController.PropertyChanged += (object sender, PropertyChangedEventArgs e) =>
            {
                if (DriveModeController != null && DriveModeController.IsOpen && e.PropertyName == "Speed")
                {
                    DriveModeController.Speak(PredefinnedSpeak.Speed, DataController.Speed);
                }

                //tile update
                if (e.PropertyName == "AverageConsumption" ||
                    e.PropertyName == "Repairs" ||
                    e.PropertyName == "Fills" ||
                    e.PropertyName == "Maintenances" ||
                    e.PropertyName == "Consumption" ||
                    e.PropertyName == "Distance")
                {
                    TileController.Update();
                    SchedulerController.Update();
                }

                if (e.PropertyName == "AvailableSpace")
                {
                    CameraController.OnPropertyChanged("IsSupported");
                    CameraController.OnPropertyChanged("IsShotEnabled");
                }
            };
        }