/// <summary> /// 配置已经实例化的 scopeSession,包括通道设置、时钟设置以及触发设置 /// </summary> /// <param name="niTask"></param> /// <param name="channelConfiguration"></param> public static void MapAndConfigAll(NIScope scopeSession, NIScopeAIStaticConfig basicAIConifg, ref TClock tClockSession) { if (basicAIConifg.MoreRecordsThanMemoryAllowed == true) { throw new Exception("暂时不支持超内存采样!"); } scopeSession.Timing.MoreRecordsThanMemoryAllowed = basicAIConifg.MoreRecordsThanMemoryAllowed; MapAndConfigTrigger(scopeSession, basicAIConifg.TriggerConfig, ref tClockSession); MapAndConfigClock(scopeSession, basicAIConifg.ClockConfig); MapAndConfigChannel(scopeSession, basicAIConifg.ChannelConfig); }
/// <summary> /// 通过配置文件构造实例 /// </summary> /// <param name="filePath"></param> public NIScopeAIStaticConfig(string filePath) { NIScopeAIStaticConfig config = (NIScopeAIStaticConfig)InitFromConfigFile(filePath); TriggerConfig = config.TriggerConfig; ClockConfig = config.ClockConfig; ChannelConfig = config.ChannelConfig; StartTime = config.StartTime; AutoWriteDataToFile = config.AutoWriteDataToFile; ChannelCount = config.ChannelCount; RemainShotsMax = config.RemainShotsMax; RemainShotsMin = config.RemainShotsMin; IsOn = config.IsOn; CardType = config.CardType; ResourceName = config.ResourceName; //MoreRecordsThanMemoryAllowed = config.MoreRecordsThanMemoryAllowed; //暂时固定这样 MoreRecordsThanMemoryAllowed = false; //这里保证相等,也就是说永远只有 1 个 records ClockConfig.ReadSamplePerTime = config.ClockConfig.TotalSampleLengthPerChannel; }
public void ChangeStaticConfig(BasicAIStaticConfig basicAIStaticConfig) { _staticConfig = (NIScopeAIStaticConfig)basicAIStaticConfig; }
/// <summary> /// 从配置文件为已经存在的 basicAI 赋初值 /// </summary> /// <param name="configFilePath"></param> public void InitAI(string configFilePath) { _staticConfig = LoadStaticConfig(configFilePath) as NIScopeAIStaticConfig; }