示例#1
0
        /// <summary>
        /// Checks this simulator instance to verify it is responsive.
        /// </summary>
        public override void Validate(ParallelLoopState loopState)
        {
            TraceFactory.Logger.Debug("Validating {0}".FormatWith(_simulatorDetail.AssetId));

            // Using DAT to validate because the host machine could be running with the simulators not running.
            // The host machine hosts the IP addresses of the simulators, so they will respond to a ping in that case.
            // Using DAT will return data about the actual simulator.
            try
            {
                _device = new SiriusDevice(_simulatorDetail.Address);

                if (IsSimulatorReady())
                {
                    MapElement.UpdateStatus("Validated", RuntimeState.Validated);
                }
                else
                {
                    MapElement.UpdateStatus("Sirius Simulator is in an unknown state", RuntimeState.Warning);
                }
            }
            catch (Exception ex)
            {
                MapElement.UpdateStatus(RuntimeState.Error, "Validation failure: {0}".FormatWith(ex.Message), ex);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SiriusDeviceSettingsManager" /> class.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <exception cref="ArgumentNullException"><paramref name="device" /> is null.</exception>
        public SiriusDeviceSettingsManager(SiriusDevice device)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            _device = device;
        }
示例#3
0
        /// <summary>
        /// Logs device information for this simulator.
        /// </summary>
        /// <param name="loopState"></param>
        public override void PowerUp(ParallelLoopState loopState)
        {
            // Log Device Info for the simulator.
            LogDeviceInformation();

            //There is no reason to hold the device instance open for the duration of the test.
            _device?.Dispose();
            _device = null;

            MapElement.UpdateStatus("Ready", RuntimeState.Ready);
        }