public MeasurementViewModel(IApplicationController app, PortController portController, VideoCameraController videoCameraController)
            : base()
        {
            _app = app;
            Measuring = false;
            RatingViewModel ratingVM = new RatingViewModel(_app);
            RatingControl = ratingVM;

            RectangleColor = "White";

            gymnastList     = vaultModule.getGymnasts();
            vaultNumberList = vaultModule.getVaultNumbers();
            vaultKindList   = vaultModule.getVaultKinds();
            locationsList   = vaultModule.getLocations();

            // Set PortController
            this.portController = portController;

            // Set VideoCamera
            CameraView = new CameraViewModel(_app);
            VideoCameraController = videoCameraController;

            ManualModeChecked = true;

            //Turn pilotlaser off if it is on
            if (portController.PilotLaser != 0)
            {
                portController.PilotLaser = 0;
            }

            // Set Graph
            GraphViewModel graphVM = new GraphViewModel(_app, this, true, 1500);
            GraphViewMeasurement = graphVM;

            // Set validation
            SetValidationRules();

            // Set vault handler
            cameraModule.VaultCreated += vaultCreated;

            // Set thumbnail collection
            thumbnailCollection = new ObservableCollection<ThumbnailViewModel>();

            // Create empty vault
            vault newVault = new vault();
            newVault.timestamp = DateTime.Now;
            selectedVault = newVault;

            // Add empty thumbnail for live and set selected
            ThumbnailViewModel liveThumbnail = new ThumbnailViewModel(_app);
            liveThumbnail.setLive(true);
            liveThumbnail.Vault = newVault;
            thumbnailCollection.Add(liveThumbnail);
            SelectedThumbnail = liveThumbnail;
        }
Beispiel #2
0
        public HomeViewModel(IApplicationController app, VideoCameraController videoCameraController)
            : base()
        {
            _app = app;

            // Set menu
            MenuViewModel menuViewModel = new MenuViewModel(_app);
            menuViewModel.VisibilityLaser = true;
            Menu = menuViewModel;

            // Set VideoCamera
            CameraView = new CameraViewModel(_app);
            VideoCameraController = videoCameraController;

            // Set Graph
            GraphViewModel graphVM = new GraphViewModel(_app, this, true, 2000);
            GraphView = graphVM;
        }
Beispiel #3
0
        public SettingsViewModel(IApplicationController app, 
            PortController portController,
            VideoCameraController videoCameraController = null)
            : base()
        {
            _app = app;

            CameraView     = new CameraViewModel(_app);

            // Set PortController
            this.portController = portController;

            // Set videocamera settings
            this.videoCameraController = videoCameraController;
            openVideoSource(this.videoCameraController.CameraWindow);
            videoCameraController.setDevices();
            Devices = videoCameraController.Devices;

            setSettingsProperties();
            setValidationRules();
        }
Beispiel #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // check connectivity with internet
            CheckNetworkConnection();

            if (!IsOfflineMode)
            {
                SyncVaults();
            }

            // init VideoCameraController
            videoCameraController = new VideoCameraController();
            int videoCameraIndex = videoCameraSettingsModule.getVideocameraIndex();
            videoCameraController.OpenVideoSource(videoCameraIndex);

            // set portcontroller
            Thread portThread = new Thread(() => { portController = new PortController(); });
            portThread.Start();
            portThread.Join();

            // Pre-load entity (workaround?)
            Thread entityPreLoadThread = new Thread(() => { new EditorModule().readLocations(); });
            entityPreLoadThread.Start();
            entityPreLoadThread.Join();

            //Add a function to show the first screen
            ShowMainScreen();
            ShowHomeView();

            isLoggedIn = false;
            isLoginWindowOpen = false;

            Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
        }