public void BuildUp()
 {
     // Initialize appointment entity
     spectraCyberConfig_1 = new SpectraCyberConfig(mode, integration_time, offset_voltage_1, if_gain, dc_gain, bandwidth);
     spectraCyberConfig_2 = new SpectraCyberConfig(mode, integration_time, offset_voltage_1, if_gain, dc_gain, bandwidth);
     spectraCyberConfig_3 = new SpectraCyberConfig(mode, integration_time, offset_voltage_2, if_gain, dc_gain, bandwidth);
 }
Exemple #2
0
        public void BuildUp()
        {
            // Initialize appointment entity
            appointment_1 = new Appointment();
            greaterThan   = new Appointment();

            // Initialize data for fields
            controlRoomUser   = new User("control", "room", "*****@*****.**", NotificationTypeEnum.SMS);
            startTime_1       = DateTime.UtcNow;
            endTime_1         = DateTime.UtcNow.AddHours(1);
            celestial_body    = new CelestialBody(CelestialBodyConstants.SUN);
            orientation       = new Orientation(20, 20);
            coordinate        = new Coordinate(20, 20);
            spectraCyber      = new SpectraCyber();
            telescope         = new RadioTelescope(new SpectraCyberController(spectraCyber), new TestPLCDriver(PLCConstants.LOCAL_HOST_IP, PLCConstants.LOCAL_HOST_IP, 8089, 8089, false), new Location(), new Orientation());
            rf_data           = new RFData();
            rf_data.Intensity = 100;
            status            = AppointmentStatusEnum.REQUESTED;
            type = AppointmentTypeEnum.POINT;
            spectracyber_config = new SpectraCyberConfig(SpectraCyberModeTypeEnum.CONTINUUM);

            startTime_2 = DateTime.UtcNow.AddDays(1);
            endTime_2   = DateTime.UtcNow.AddDays(1).AddHours(1);

            // Initialize fields we are testing against
            appointment_1.User          = controlRoomUser;
            appointment_1.start_time    = startTime_1;
            appointment_1.end_time      = endTime_1;
            appointment_1.CelestialBody = celestial_body;
            appointment_1.Orientation   = orientation;
            appointment_1.Coordinates.Add(coordinate);
            appointment_1.RFDatas.Add(rf_data);
            appointment_1._Status            = status;
            appointment_1._Type              = type;
            appointment_1.SpectraCyberConfig = spectracyber_config;
            appointment_1.Telescope          = telescope;

            greaterThan.start_time = startTime_2;
            greaterThan.end_time   = endTime_2;

            equalTo = appointment_1;
        }
        public void BuildUp()
        {
            // Initialize appointment entity
            appointment_1 = new Appointment();
            appointment_2 = new Appointment();

            // Initialize data for fields
            user_id           = 1;
            startTime_1       = DateTime.UtcNow;
            endTime_1         = DateTime.UtcNow.AddHours(1);
            celestial_body    = new CelestialBody(CelestialBodyConstants.SUN);
            orientation       = new Orientation(20, 20);
            coordinate        = new Coordinate(20, 20);
            rf_data           = new RFData();
            rf_data.Intensity = 100;
            telescope_id      = 1;
            status            = AppointmentStatusEnum.REQUESTED;
            type = AppointmentTypeEnum.POINT;
            spectracyber_config = new SpectraCyberConfig(SpectraCyberModeTypeEnum.CONTINUUM);

            startTime_2 = DateTime.UtcNow.AddDays(1);
            endTime_2   = DateTime.UtcNow.AddDays(1).AddHours(1);

            // Initialize fields we are testing against
            appointment_1.UserId        = user_id;
            appointment_1.StartTime     = startTime_1;
            appointment_1.EndTime       = endTime_1;
            appointment_1.CelestialBody = celestial_body;
            appointment_1.Orientation   = orientation;
            appointment_1.Coordinates.Add(coordinate);
            appointment_1.RFDatas.Add(rf_data);
            appointment_1.TelescopeId        = telescope_id;
            appointment_1.Status             = status;
            appointment_1.Type               = type;
            appointment_1.SpectraCyberConfig = spectracyber_config;

            appointment_2.StartTime = startTime_2;
            appointment_2.EndTime   = endTime_2;
        }
        public bool SetApptConfig(Appointment appt)
        {
            bool success = false;

            SetActiveAppointment(appt);
            SpectraCyberConfig config = appt.SpectraCyberConfig;

            SetSpectraCyberModeType(config._Mode);
            if (config._Mode == SpectraCyberModeTypeEnum.CONTINUUM)
            {
                success = SetContinuumIntegrationTime(config.IntegrationTime) && SetContinuumOffsetVoltage(config.OffsetVoltage);
            }
            else if (config._Mode == SpectraCyberModeTypeEnum.SPECTRAL)
            {
                success = SetSpectralOffsetVoltage(config.OffsetVoltage) && SetSpectralIntegrationTime(config.IntegrationTime);
            }
            else
            {
                // Unknown current mode type
                logger.Info(Utilities.GetTimeStamp() + ": [AbstractSpectraCyberController] ERROR: invalid SpectraCyber mode type: " + SpectraCyber.CurrentModeType.ToString());
            }
            return(success);
        }