예제 #1
0
        public void Init()
        {
            filterWheelMediatorMock       = new Mock <IFilterWheelMediator>();
            profileServiceMock            = new Mock <IProfileService>();
            imagingVMMock                 = new Mock <IImagingVM>();
            cameraMediatorMock            = new Mock <ICameraMediator>();
            telescopeMediatorMock         = new Mock <ITelescopeMediator>();
            applicationStatusMediatorMock = new Mock <IApplicationStatusMediator>();
            exposureServiceMock           = new Mock <IFlatWizardExposureTimeFinderService>();
            localeMock = new Mock <ILoc>();
            filterWheelSettingsMock = new Mock <IFilterWheelSettings>();
            _flatDeviceMediatorMock = new Mock <IFlatDeviceMediator>();
            profileMock             = new Mock <IProfile>();
            flatWizardSettingsMock  = new Mock <IFlatWizardSettings>();
            cameraSettingsMock      = new Mock <ICameraSettings>();
            resourceDictionaryMock  = new Mock <IApplicationResourceDictionary>();
            profileServiceMock.SetupGet(m => m.ActiveProfile).Returns(profileMock.Object);
            profileMock.SetupGet(m => m.FlatWizardSettings).Returns(flatWizardSettingsMock.Object);
            profileMock.SetupGet(m => m.CameraSettings).Returns(cameraSettingsMock.Object);
            profileMock.SetupGet(m => m.FilterWheelSettings).Returns(filterWheelSettingsMock.Object);
            profileServiceMock.Setup(m => m.ActiveProfile.ImageSettings.AutoStretchFactor).Returns(1.0);
            profileServiceMock.Setup(m => m.ActiveProfile.ImageSettings.BlackClipping).Returns(0.1);
            profileServiceMock.Setup(m => m.ActiveProfile.ImageFileSettings.FilePath).Returns(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName);
            filterWheelSettingsMock.SetupGet(m => m.FilterWheelFilters)
            .Returns(new ObserveAllCollection <FilterInfo>());

            _camera = new SimulatorCamera(profileServiceMock.Object, telescopeMediatorMock.Object)
            {
                Settings = { Type = CameraType.RANDOM, RandomSettings = { ImageMean = 32000, ImageStdDev = 1000 } }
            };
            _image = _camera.DownloadExposure(new CancellationToken()).Result.ToImageData().Result.RenderImage();
            localeMock.SetupGet(m => m[It.IsAny <string>()]).Returns("Test");
            imagingVMMock.Setup(m => m.CaptureAndPrepareImage(It.IsAny <CaptureSequence>(),
                                                              It.IsAny <PrepareImageParameters>(), It.IsAny <CancellationToken>(),
                                                              It.IsAny <IProgress <ApplicationStatus> >())).ReturnsAsync(_image);
            _flatDevice = new FlatDeviceInfo()
            {
                Brightness    = 1.0,
                Connected     = true,
                CoverState    = CoverState.Open,
                Description   = "Some description",
                DriverInfo    = "Some driverInfo",
                LightOn       = false,
                DriverVersion = "200",
                MaxBrightness = 255,
                MinBrightness = 0,
                Name          = "Some name"
            };
        }
예제 #2
0
 private void Awake()
 {
     SimulatorCamera  = Instantiate(SimulatorCameraPrefab, transform).GetComponentInChildren <Camera>();
     CameraController = SimulatorCamera.GetComponentInParent <SimulatorCameraController>();
 }