public AcquisitionEngine(IDataSource source) { samplesOverflowSink = new List<float>(); overviewWfLastCapture = DateTime.Now; overviewWf = new Waveform(1, 6000000); TriggerSources = new List<ITrigger>(); TriggerSources.Add(new FreeRunning()); TriggerSources.Add(new Edge()); Trigger = new Edge(); // TODO: Temporary trigger Source = source; Source.Data += ProcessWaveform; Source.Data += Source_Data; Source.HighresVoltage += Source_HighresVoltage; Source.Connect(null); var dummyCfg = new NetStreamConfiguration(); dummyCfg.AdcSpeed = 0; dummyCfg.AfeGain = 0; dummyCfg.UseFastAdc = false; Source.Configure(dummyCfg); }
public AcquisitionEngine(IDataSource source) { samplesOverflowSink = new List <float>(); overviewWfLastCapture = DateTime.Now; overviewWf = new Waveform(1, 6000000); TriggerSources = new List <ITrigger>(); TriggerSources.Add(new FreeRunning()); TriggerSources.Add(new Edge()); Trigger = new Edge(); // TODO: Temporary trigger Source = source; Source.Data += ProcessWaveform; Source.Data += Source_Data; Source.HighresVoltage += Source_HighresVoltage; Source.Connect(null); var dummyCfg = new NetStreamConfiguration(); dummyCfg.AdcSpeed = 0; dummyCfg.AfeGain = 0; dummyCfg.UseFastAdc = false; Source.Configure(dummyCfg); }
private bool CreateSourceInstance(DataSource source) { try { Assembly assembly = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(source.AssemblyName)); Type type = assembly.GetType(source.TypeName); m_Source = (IDataSource)Activator.CreateInstance(type); IConfiguration config = new ConfigurationBuilder().AddGemstoneConnectionString(source.ConnectionString).Build(); m_Source.Configure(config); return(true); } catch (Exception ex) { return(false); } }