示例#1
0
        public SettingsViewModel(IEditorContext editorContext, IStorageController storageController, ITestRunner testRunner, ITelemetryManager telemetryManager, IOptions options, IIoProvider ioProvider)
        {
            _editorContext     = editorContext;
            _storageController = storageController;
            _testRunner        = testRunner;
            _options           = options;
            _ioProvider        = ioProvider;

            _outputDirectories = new ObservableEnumeration <OutputDirectoryViewModel>(() =>
                                                                                      storageController.GetOutputDirectories().Select(p => new OutputDirectoryViewModel(p)), (a, b) => StringComparer.OrdinalIgnoreCase.Compare(a.Name, b.Name));
            _testSettingsFiles = new ObservableEnumeration <string>(() =>
                                                                    (_editorContext?.Solution.FindFiles(new Regex("^.*\\.runSettings$", RegexOptions.Compiled | RegexOptions.IgnoreCase)) ?? new string[0])
                                                                    .Select(p => _ioProvider.GetRelativePath(p)),
                                                                    StringComparer.OrdinalIgnoreCase.Compare);

            editorContext.BuildFinished  += (o, e) => Refresh();
            editorContext.SolutionOpened += (o, e) => Refresh();

            //Fix unsupported state
            if (_options.IsExcludingTestAssemblies && _options.IsCoveringByTest)
            {
                _options.IsExcludingTestAssemblies = false;
                _options.IsCoveringByTest          = false;
            }
        }
示例#2
0
 public AxoTestRunner(IEditorContext editorContext, IStorageController storageController, IOptions options, ITelemetryManager telemetryManager, ITestAdapterRepository testAdapterRepository, IIoProvider ioProvider)
 {
     _editorContext         = editorContext;
     _storageController     = storageController;
     _options               = options;
     _telemetryManager      = telemetryManager;
     _testAdapterRepository = testAdapterRepository;
     _ioProvider            = ioProvider;
 }
示例#3
0
 public void Initialize()
 {
     _optionsMock = new Mock <IOptions>();
     _ioProvider  = new IoProvider(_optionsMock.Object);
 }
示例#4
0
 /// <summary>
 /// Constructs the AHRS class using serial communication.
 /// </summary>
 /// <remarks>
 /// This constructor should be used if communicating via either TTL UART 
 /// or USB Serial Interface.
 /// <para></para>
 /// Note that the serial interfaces can communicate either processed data, or raw data,
 /// but not both simultaneously. If simultaneous processed and raw data are needed,
 /// use one of the register-based interfaces (SPI or I2C). The default is processed data.
 /// <para></para>
 ///  The update rate may be between 4 Hz and 60 Hz, representing the number
 /// of updates per second sent by the sensor. Note that increasing the update 
 /// rate may increase the CPU utilization.
 /// </remarks>
 /// <param name="serialPortId">The <see cref="SerialPort.Port">Serial Port</see> to use.</param>
 /// <param name="dataType">Either <see cref="SerialDataType.KProcessedData"/> (Default) or <see cref="SerialDataType.KRawData"/>.</param>
 /// <param name="updateRateHz">The Update Rate (Hz) [4..60] (Default 50)</param>
 public AHRS(SerialPort.Port serialPortId, SerialDataType dataType = SerialDataType.KProcessedData, byte updateRateHz = NavxDefaultUpdateRateHz)
 {
     CommonInit(updateRateHz);
     if (RobotBase.IsSimulation)
     {
         m_io = new SimulatorIO(updateRateHz, m_ioCompleteSink, m_boardCapabilities);
     }
     else
     {
         bool processedData = (dataType == SerialDataType.KProcessedData);
         m_io = new SerialIO(serialPortId, updateRateHz, processedData, m_ioCompleteSink, m_boardCapabilities);
     }
     m_ioThread.Start();
 }
示例#5
0
 /// <summary>
 /// Constructs the AHRS class using I2C Communication
 /// </summary>
 /// <remarks>
 /// The update rate may be between 4 Hz and 60 Hz, representing the number
 /// of updates per second sent by the sensor.
 /// <para/>
 /// This constructor should be used if communicating via I2C.
 /// <para/>
 /// Note that increasing the update rate may increase the CPU utilization.
 /// </remarks>
 /// <param name="i2CPortId">The <see cref="I2C.Port">I2C Port</see> to use.</param>
 /// <param name="updateRateHz">The Update Rate (Hz) [4..60] (Default 50)</param>
 public AHRS(I2C.Port i2CPortId, byte updateRateHz = NavxDefaultUpdateRateHz)
 {
     CommonInit(updateRateHz);
     if (RobotBase.IsSimulation)
     {
         m_io = new SimulatorIO(updateRateHz, m_ioCompleteSink, m_boardCapabilities);
     }
     else
     {
         m_io = new RegisterIO(new RegisterIO_I2C(new I2C(i2CPortId, 0x32)), updateRateHz, m_ioCompleteSink,
             m_boardCapabilities);
     }
     m_ioThread.Start();
 }
示例#6
0
 /// <summary>
 /// Constructs the AHRS class using SPI Communication, overriding the SPI bitrate.
 /// </summary>
 /// <remarks>
 /// The update rate may be between 4 Hz and 60 Hz, representing the number
 /// of updates per second sent by the sensor.
 /// <para/>
 /// This constructor should be used if communicating via SPI.
 /// <para/>
 /// Note that increasing the update rate may increase the CPU utilization.
 /// </remarks>
 /// <param name="spiPortId">The <see cref="SPI.Port">SPI Port</see> to use.</param>
 /// <param name="spiBitrate">The SPI bitrate to use (bits/seconds) (Maximum: 2,000,000)</param>
 /// <param name="updateRateHz">The Update Rate (Hz) [4..60] (Default 50)</param>
 public AHRS(SPI.Port spiPortId, int spiBitrate, byte updateRateHz = NavxDefaultUpdateRateHz)
 {
     CommonInit(updateRateHz);
     if (RobotBase.IsSimulation)
     {
         m_io = new SimulatorIO(updateRateHz, m_ioCompleteSink, m_boardCapabilities);
     }
     else
     {
         m_io = new RegisterIO(new RegisterIO_SPI(new SPI(spiPortId), spiBitrate), updateRateHz, m_ioCompleteSink,
             m_boardCapabilities);
     }
     m_ioThread.Start();
 }