/// <summary> /// 更新staticConfigDic,并返回指定炮号的配置文件 /// 如果给定炮号已经在staticConfigDic中,则直接返回 /// 否则将该炮的配置文件加入staticConfigDic中 /// 如果炮号有误,将抛出异常 /// </summary> /// <param name="shotNo"></param> private BasicAIStaticConfig tryUpdateStaticConfigDic(int shotNo) { if (shotNo < 0) { throw new Exception("从文件中读取数据时,炮号应为正数!"); } int actualShotNo; if (shotNo == 0) { actualShotNo = CurrentShotNo; } else { actualShotNo = shotNo; } try { if (!staticConfigDic.ContainsKey(actualShotNo)) { string fileDirectory = DataFileParentDirectory + "\\" + actualShotNo.ToString() + "\\"; dataReader = DataFileFactory.GetReader(fileDirectory, dataFileName); BasicAIStaticConfig temp = basicAI.LoadStaticConfig(null); //添加 Status 中暴露的参数 temp.ChannelCount = dataReader.ChannelCount(); temp.ClockConfig.SampleRate = dataReader.SampleRate(); temp.ClockConfig.TotalSampleLengthPerChannel = dataReader.SampleCount(); staticConfigDic.Add(actualShotNo, temp); } return(staticConfigDic[actualShotNo]); } catch { throw new Exception("无法找到" + actualShotNo.ToString() + "的数据文件!可能未采集完全或已经删除。"); } }
public void ChangeStaticConfig(BasicAIStaticConfig basicAIStaticConfig) { _staticConfig = (JYAIStaticConfig)basicAIStaticConfig; }
/// <summary> /// 配置简仪采集卡AI任务触发、同步、通道、时钟等各项属性 /// </summary> /// <param name="jyTask"></param> /// <param name="basicAIConifg"></param> public static void MapAndConfigAll(JYPXI62022AITask jyTask, BasicAIStaticConfig basicAIConifg) { MapAndConfigChannel(jyTask, basicAIConifg.ChannelConfig); MapAndConfigClock(jyTask, basicAIConifg.ClockConfig); MapAndConfigTrigger(jyTask, basicAIConifg.TriggerConfig); }
public void ChangeStaticConfig(BasicAIStaticConfig basicAIStaticConfig) { _staticConfig = (NIScopeAIStaticConfig)basicAIStaticConfig; }
/// <summary> /// 配置NI采集卡AI任务触发、同步、通道、时钟等各项属性 /// </summary> /// <param name="niTask"></param> /// <param name="basicAIConifg"></param> public static void MapAndConfigAll(NationalInstruments.DAQmx.Task niTask, BasicAIStaticConfig basicAIConifg) { MapAndConfigChannel(niTask, basicAIConifg.ChannelConfig); MapAndConfigClock(niTask, basicAIConifg.ClockConfig); MapAndConfigTrigger(niTask, basicAIConifg.TriggerConfig); }