using Common;
using Config.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TBF.Rig.Generic;
using TBF.Rig.Input.DataStorage.UniDataStorageReader.Readers;
using TBF.Rig.Scales.MettlerToledo;
using static TBF.Rig.Input.DataStorage.UniDataStorageReader.ReaderCfg;
using System.Threading;
namespace TBF.Rig.Input.DataStorage.UniDataStorageReader
{
///
/// Main component that selects appropriate data reader based on configuration.
/// Acts as a dispatcher between different storage implementations.
///
public class Reader : IComponent
{
private readonly ReaderCfg cfg;
public Reader(ReaderCfg cfg)
{
this.cfg = cfg ?? throw new ArgumentNullException(nameof(cfg));
}
public string Name { get { return cfg.Name; } }
public string ClassName { get { return cfg.ClassName; } }
public string ParentName { get { return cfg.ParentName; } }
public DebugMode DebugLevel { get { return cfg.DebugLevel; } }
public LogLevel LogLevel { get { return cfg.LogLevel; } }
public IComponentCfg Cfg { get { return cfg; } }
public IList Corrections { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public IList Uncertainties { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
private readonly SemaphoreSlim readLock = new SemaphoreSlim(1, 1);
public async Task