public override CommunicationProcessResult Read(ISettingItem[] items, IReporter reporter = null, int timeout = 100, int retryLimit = 3) { CheckConnection(); List <ISettingValue> settings = GetAllValues(items); SettingProcess process = new SettingProcess(Connection, reporter, settings, timeout, retryLimit); lock (readWriteLock) { return(process.Read()); } }
/// <summary> /// Reads a single <see cref="ISettingValue"/>. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="connection">The connection.</param> /// <param name="reporter">The reporter.</param> /// <param name="timeout">The timeout.</param> /// <param name="retryLimit">The retry limit.</param> /// <param name="setting">The setting.</param> /// <param name="value">The value.</param> /// <returns>ImuAsyncProcessResult.</returns> public static CommunicationProcessResult ReadSingle <T>(Connection connection, IReporter reporter, int timeout, int retryLimit, ISettingValue <T> setting, out T value) { SettingProcess process = new SettingProcess(connection, reporter, setting, timeout, retryLimit); CommunicationProcessResult result = process.Read(); switch (result) { case CommunicationProcessResult.Success: value = setting.RemoteValue; break; default: value = default(T); break; } return(result); }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="connection"></param> /// <param name="reporter">Progress reporter.</param> /// <param name="muteToStart"></param> /// <param name="message"></param> /// <param name="value"></param> /// <returns></returns> public static CommunicationProcessResult ReadSingle <T>(Connection connection, IReporter reporter, ISettingValue <T> setting, out T value) // bool muteToStart, { SettingProcess process = new SettingProcess(connection, reporter, new ISettingValue[] { setting }, 100, 3); // muteToStart CommunicationProcessResult result = process.Read(); switch (result) { case CommunicationProcessResult.Success: value = setting.RemoteValue; break; default: value = default(T); break; } return(result); }