Sfoglia il codice sorgente

多频点切换测试处最大调制已完成

ceac_pqy@163.com 3 anni fa
parent
commit
cf90eb4f4b

BIN
exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.dll


BIN
exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.pdb


+ 594 - 0
exe/logs/202108.log

@@ -5135,3 +5135,597 @@
 2021-08-20 20:33:24.3718 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
 2021-08-20 20:33:24.3718 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"停止成功 
 2021-08-20 20:33:24.3718 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-20 21:34:11.7768 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:34:11.9068 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:34:12.2048 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:34:12.2198 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:34:12.2498 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:34:12.2538 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:34:12.2538 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:34:12.2538 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:34:12.2538 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:34:20.9298 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:34:22.9488 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:34:22.9698 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:34:22.9908 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:34:56.0908 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:34:56.2858 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:34:56.7048 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:34:56.8218 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:34:56.9268 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:34:56.9318 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:34:56.9318 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:34:56.9318 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:34:56.9318 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:35:05.2338 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:35:07.2668 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:35:07.2918 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:35:07.3118 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:35:24.2508 Error:                [source]:runtime,[msg]:索引超出范围。必须为非负值并小于集合大小。
+参数名: index     在 System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
+   在 System.Collections.Generic.List`1.get_Item(Int32 index)
+   在 System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
+   在 Tps_LQ_Transmitter.FrmMain.StartTest() 位置 F:\Code\Transmitter-3-New\TpsLabStudio_LTS\tps\TpsLabStudio\FrmMain.cs:行号 331
+   在 Tps_LQ_Transmitter.FrmMain.BtnStart_Click(Object sender, EventArgs e) 位置 F:\Code\Transmitter-3-New\TpsLabStudio_LTS\tps\TpsLabStudio\FrmMain.cs:行号 254
+   在 System.Windows.Forms.Control.OnClick(EventArgs e)
+   在 DevComponents.DotNetBar.ButtonX.OnClick(EventArgs e)
+   在 DevComponents.DotNetBar.ButtonX.OnMouseUp(MouseEventArgs e)
+   在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
+   在 System.Windows.Forms.Control.WndProc(Message& m)
+   在 DevComponents.DotNetBar.PopupItemControl.WndProc(Message& m)
+   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
+   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
+   在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
+   在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
+   在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
+   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
+   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
+   在 System.Windows.Forms.Application.Run(Form mainForm)
+   在 JGWorks.Program.Main() 位置 D:\code\LabStudio\JGWorks\Program.cs:行号 70 
+2021-08-20 21:35:36.5068 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:35:36.6448 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:35:37.0388 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:35:37.0638 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:35:37.1048 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:35:37.1048 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:35:37.1048 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:35:37.1048 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:35:37.1048 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:35:45.2348 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:35:47.2668 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:35:47.2928 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:35:47.3138 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:37:50.9798 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:37:51.0818 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:37:51.2928 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:37:51.3068 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:37:51.3338 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:37:51.3338 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:37:51.3408 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:37:51.3408 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:37:51.3408 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:38:00.4278 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:38:02.4448 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:38:02.4778 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:38:02.5078 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:38:31.6398 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:38:31.7768 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:38:32.0618 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:38:32.0778 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:38:32.1088 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:38:32.1088 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:38:32.1088 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:38:32.1088 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:38:32.1088 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:38:40.4508 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:38:42.4798 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:38:42.5138 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:38:42.5318 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:53:21.6218 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:53:21.7668 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:53:22.1268 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:53:22.1488 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:53:22.1918 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:53:22.1918 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:53:22.1998 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:53:22.1998 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:53:22.1998 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:53:30.8478 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:53:32.8678 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:53:32.8908 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:53:32.9198 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 21:56:10.4468 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 21:56:10.6408 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 21:56:11.0888 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 21:56:11.2278 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 21:56:11.4218 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 21:56:11.4298 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 21:56:11.4578 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 21:56:11.4578 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 21:56:11.4598 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 21:56:20.4538 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:56:22.4738 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 21:56:22.4958 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 21:56:22.5378 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:01:30.3068 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:01:30.4598 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:01:30.8718 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:01:30.9008 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:01:30.9808 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:01:30.9808 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:01:30.9808 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:01:30.9808 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:01:30.9808 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:01:39.0388 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:01:41.0748 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:01:41.1058 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:01:41.1248 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:03:11.0618 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:03:11.2088 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:03:11.5258 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:03:11.5628 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:03:11.5918 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:03:11.5918 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:03:11.5918 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:03:11.6018 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:03:11.6018 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:03:19.8698 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:03:21.9038 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:03:21.9218 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:03:21.9378 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:04:48.7278 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:04:48.9338 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:04:49.3198 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:04:49.3458 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:04:49.4218 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:04:49.4438 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:04:49.4458 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:04:49.4458 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:04:49.4458 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:04:57.6828 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:04:59.7958 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:04:59.8218 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:04:59.8488 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:14:04.9228 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:14:05.1098 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:14:05.5188 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:14:05.5388 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:14:05.5778 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:14:05.5778 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:14:05.5778 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:14:05.5888 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:14:05.5888 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:14:14.1258 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:14:16.2068 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:14:16.2268 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:14:16.2608 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:15:13.6118 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:15:13.7538 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:15:14.0558 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:15:14.0758 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:15:14.1098 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:15:14.1288 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:15:14.1288 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:15:14.1288 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:15:14.1288 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:15:22.4578 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:15:24.4878 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:15:24.5138 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:15:24.5288 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 22:17:55.4238 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 22:17:55.5838 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 22:17:55.9738 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 22:17:55.9888 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 22:17:56.0128 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 22:17:56.0198 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 22:17:56.0198 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 22:17:56.0198 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 22:17:56.0198 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 22:18:04.5168 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:18:06.5778 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 22:18:06.6038 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 22:18:06.6268 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 23:11:31.7018 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:11:31.9118 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:11:32.2308 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:11:32.2478 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:11:32.2728 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:11:32.2788 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:11:32.2788 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:11:32.2788 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:11:32.2788 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:11:40.5848 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:11:42.6268 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:11:42.6358 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:11:42.6698 Error:                [source]:资源管理器 LoadDevice,[msg]:初始化本地配置文件的设备异常:USB0::0x0957::0x0D0B::US49230327::INSTR,请确认设备是否存在。原因:调用的目标发生了异常。 
+2021-08-20 23:14:28.4178 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:14:28.6428 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:14:29.1348 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:14:29.2448 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:14:29.3048 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:14:29.3048 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:14:29.3048 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:14:29.3048 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:14:29.3048 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:14:37.9418 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:14:39.9588 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:14:39.9708 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:14:40.0648 Error:                [source]:资源管理器 LoadDevice,[msg]:初始化本地配置文件的设备异常:USB0::0x0957::0x0D0B::US49230327::INSTR,请确认设备是否存在。原因:调用的目标发生了异常。 
+2021-08-20 23:16:43.2608 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:16:43.4048 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:16:43.7068 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:16:43.7398 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:16:43.7848 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:16:43.7848 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:16:43.7848 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:16:43.7948 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:16:43.7948 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:16:52.4038 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:16:54.4248 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:16:54.4478 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:16:54.4698 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 23:19:40.3768 Error:                [source]:runtime,[msg]:未知系统错误(其它错误)。  VISA error code -1073807360 (0xBFFF0000), ErrorSystemError     在 NationalInstruments.VisaNS.Internal.ErrorChecker.CheckStatusAndThrow(Int32 status, VisaHandle visaObject)
+   在 NationalInstruments.VisaNS.Session.CheckStatusAndThrow(Int32 status)
+   在 NationalInstruments.VisaNS.Internal.MessageBasedSessionImpl.Write(String data)
+   在 NationalInstruments.VisaNS.MessageBasedSession.Write(String data)
+   在 CommonDevHostApp.Devices.CommonVisaResource.Write(String command) 位置 F:\Code\Transmitter-3-New\TpsLabStudio_LTS\tps\TpsLabStudio\Common\VisaResource.cs:行号 90
+   在 Tps_LQ_Transmitter.FrmMain.StartTest() 位置 F:\Code\Transmitter-3-New\TpsLabStudio_LTS\tps\TpsLabStudio\FrmMain.cs:行号 313
+   在 Tps_LQ_Transmitter.FrmMain.BtnStart_Click(Object sender, EventArgs e) 位置 F:\Code\Transmitter-3-New\TpsLabStudio_LTS\tps\TpsLabStudio\FrmMain.cs:行号 262
+   在 System.Windows.Forms.Control.OnClick(EventArgs e)
+   在 DevComponents.DotNetBar.ButtonX.OnClick(EventArgs e)
+   在 DevComponents.DotNetBar.ButtonX.OnMouseUp(MouseEventArgs e)
+   在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
+   在 System.Windows.Forms.Control.WndProc(Message& m)
+   在 DevComponents.DotNetBar.PopupItemControl.WndProc(Message& m)
+   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
+   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
+   在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
+   在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
+   在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
+   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
+   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
+   在 System.Windows.Forms.Application.Run(Form mainForm)
+   在 JGWorks.Program.Main() 位置 D:\code\LabStudio\JGWorks\Program.cs:行号 70 
+2021-08-20 23:20:01.2968 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:20:01.4708 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:20:01.8408 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:20:01.8568 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:20:01.8798 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:20:01.8858 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:20:01.8858 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:20:01.8858 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:20:01.8858 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:20:10.3308 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:20:12.3458 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:20:12.6388 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:20:12.7168 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 23:24:11.0198 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:24:11.1508 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:24:11.5078 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:24:11.5518 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:24:11.6228 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:24:11.6278 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:24:11.6278 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:24:11.6278 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:24:11.6278 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:24:19.8478 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:24:21.8758 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:24:21.9078 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:24:21.9288 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 
+2021-08-20 23:25:15.6708 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-20 23:25:15.8518 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-20 23:25:16.1248 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-20 23:25:16.1418 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-3-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-20 23:25:16.1658 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-20 23:25:16.1658 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-20 23:25:16.1658 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-20 23:25:16.1658 Info:                [source]:runtime,[msg]:插件"6YX03B-9B"启动成功 
+2021-08-20 23:25:16.1658 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-20 23:25:24.2988 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:25:26.3288 Error:                [source]:Visa SearchDevices,[msg]:VISA设备搜索执行异常,   在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
+   在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
+   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+   在 System.Activator.CreateInstance(Type type, Object[] args)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName, AccessModes accessMode, Int32 openTimeout)
+   在 NationalInstruments.VisaNS.ResourceManager.Open(String resourceName)
+   在 DevicesApp.VisaBus.GetDeviceModel(String resourcehandle, String& deviceID, String& bustype) 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 129
+   在 DevicesApp.VisaBus.SearchDevices() 位置 D:\code\LabStudio\component\DevicesApp\VisaBus.cs:行号 30 
+2021-08-20 23:25:26.3498 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-20 23:25:26.3718 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:USB0::0x0957::0x0D0B::US49230327::INSTR。 

BIN
tps/TpsLabStudio/.vs/TpsLabStudio/v16/.suo


+ 172 - 0
tps/TpsLabStudio/Common/SerialConfig.cs

@@ -1,13 +1,185 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 
 namespace Tps_LQ_Transmitter.Common
 {
+    /// <summary>
+    /// 串口控制4个对应项
+    /// </summary>
+    public class ComMatchParameter
+    {
+
+        /// <summary>
+        /// 序号
+        /// </summary>
+        public string SN { get; set; }
+        /// <summary>
+        /// 串口号
+        /// </summary>
+        public string ComPort { get; set; }
+        /// <summary>
+        /// 第3个字节
+        /// </summary>
+        public string ThirdByte { get; set; }
+        /// <summary>
+        /// 第4个字节
+        /// </summary>
+        public string FourthByte { get; set; }
+        /// <summary>
+        /// 频点
+        /// </summary>
+        public string freqpoint { get; set; }
+
+    }
+
+    public class MatchComPara
+    {
+        public Dictionary<string, ComMatchParameter> ComParameters;
+        public MatchComPara()
+        {
+            ComParameters = new Dictionary<string, ComMatchParameter>();
+        }
+        public string GetComPort(string name)
+        {
+            if (string.IsNullOrEmpty(name))
+                return null;
+
+            if (this.ComParameters.ContainsKey(name) == false)
+                return null;
+
+            string val1 = this.ComParameters[name].ComPort.Trim();
+            return val1;
+        }
+        public string GetThirdByte(string name)
+        {
+            string val1 = this.ComParameters[name].ThirdByte.Trim();
+            return val1;
+        }
+        public string GetFourthByte(string name)
+        {
+            string val2 = this.ComParameters[name].FourthByte.Trim();
+            return val2;
+        }
+        public string Getfreqpoint(string name)
+        {
+            string val2 = this.ComParameters[name].freqpoint.Trim();
+            return val2;
+        }
+    }
     public class SerialConfig
     {
+        #region 串口配置表
+
+
+        /// <summary>
+        /// 获取串口配置表
+        /// </summary>
+        /// <returns></returns>
+        public MatchComPara LoadComWorkBook()
+        {
+            MatchComPara pars = new MatchComPara();
+            string FileName = Path.Combine(Bundle.bundle.BundleDir, "config\\串口控制.xlsx");
+            if (!File.Exists(FileName))
+            {
+                ShowMessage( "找不到串口控制.xlsx");
+                return null;
+            }
+
+            Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
+            workbook.LoadFromFile(FileName);
+
+
+            //获取第一个工作表sheet1
+            Spire.Xls.Worksheet sheet = workbook.Worksheets[0];
+            int num = 0;
+            int blankRows = 0;
+
+            while (num++ < 200)
+            {
+                //索引从1开始
+                string col1 = sheet.Range[num, 1].Value2 != null ? sheet.Range[num, 1].Value2.ToString() : "";
+                col1 = col1.Trim();
+                if (string.IsNullOrEmpty(col1))
+                {
+                    blankRows++;
+                    if (blankRows > 5)
+                    {
+                        //连续5个空行以上则退出
+                        break;
+                    }
+                }
+                else
+                {
+                    blankRows = 0;
+                }
+                if (col1.Equals("序号"))
+                {
+                    List<ComMatchParameter> ComTable = ReadParameters(sheet, num);
+
+                    foreach (var item in ComTable)
+                    {
+                        if (pars.ComParameters.ContainsKey(item.SN))
+                        {
+                            ShowMessage( string.Format("串口控制:{0} 存在同名参数:{1},无法重复添加参数", sheet.Name, item.SN));
+                            continue;
+                        }
+                        pars.ComParameters.Add(item.SN, item);
+                    }
+                }
+            }
+            return pars;
+        }
+      
+        protected void ShowMessage(string msg)
+        {
+            MessageBox.Show(msg);
+
+        }
+        List<ComMatchParameter> ReadParameters(Spire.Xls.Worksheet sheet, int rowIndex)
+        {
+            List<ComMatchParameter> ModulationTable = new List<ComMatchParameter>();
+            string col1 = sheet.Range[rowIndex, 1].Value2 != null ? sheet.Range[rowIndex, 1].Value2.ToString() : "";
+            string col2 = sheet.Range[rowIndex, 2].Value2 != null ? sheet.Range[rowIndex, 2].Value2.ToString() : "";
+            string col3 = sheet.Range[rowIndex, 3].Value2 != null ? sheet.Range[rowIndex, 3].Value2.ToString() : "";
+            string col4 = sheet.Range[rowIndex, 4].Value2 != null ? sheet.Range[rowIndex, 4].Value2.ToString() : "";
+            string col5 = sheet.Range[rowIndex, 5].Value2 != null ? sheet.Range[rowIndex, 5].Value2.ToString() : "";
+
+            if (!(col1 == "序号" && col2 == "串口号" && col3 == "第3个字节" && col4 == "第4个字节" && col5 == "频点(MHz)"))
+            {
+                ShowMessage( "'串口控制'行首标题位置和格式不正确");
+                return ModulationTable;
+            }
+
+            int num = rowIndex;
+            //默认最多30行
+            while (num++ < rowIndex + 100)
+            {
+                col1 = sheet.Range[num, 1].Value2 != null ? sheet.Range[num, 1].Value2.ToString() : "";
+                col2 = sheet.Range[num, 2].Value2 != null ? sheet.Range[num, 2].Value2.ToString() : "";
+                col3 = sheet.Range[num, 3].Value2 != null ? sheet.Range[num, 3].Value2.ToString() : "";
+                col4 = sheet.Range[num, 4].Value2 != null ? sheet.Range[num, 4].Value2.ToString() : "";
+                col5 = sheet.Range[num, 5].Value2 != null ? sheet.Range[num, 5].Value2.ToString() : "";
+                if (string.IsNullOrEmpty(col1))
+                {
+                    break;
+                }
+                ComMatchParameter ObjModulation = new ComMatchParameter();
+                ObjModulation.SN = col1;
+                ObjModulation.ComPort = col2;
+                ObjModulation.ThirdByte = col3;
+                ObjModulation.FourthByte = col4;
+                ObjModulation.freqpoint = col5;
 
+                ModulationTable.Add(ObjModulation);
+            }
+            return ModulationTable;
+        }
+      
+        #endregion
     }
 }

+ 59 - 5
tps/TpsLabStudio/FrmMain.cs

@@ -7,9 +7,11 @@ using System.Drawing;
 using System.IO;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using Tps_LQ_Transmitter.com;
+using Tps_LQ_Transmitter.Common;
 using Tps_LQ_Transmitter.views;
 
 namespace Tps_LQ_Transmitter
@@ -27,6 +29,12 @@ namespace Tps_LQ_Transmitter
         /// </summary>
         FileNode currFileNode;
 
+        /// <summary>
+        /// 停止测试标志
+        /// </summary>
+        bool IsRuning = true;
+
+
         FrmMsg frmMsg;
         FrmDevice frmDevice;
 
@@ -220,6 +228,8 @@ namespace Tps_LQ_Transmitter
             if (currFileNode == null)
                 return;
 
+            IsRuning = true;
+
             BtnLoadTpsConfig.Enabled = false;
             BtnStart.Enabled = false;
 
@@ -270,7 +280,20 @@ namespace Tps_LQ_Transmitter
 
             MainTps tps = new MainTps();
 
-            tps.LoadComWorkBook();
+
+            SerialConfig scfg = new SerialConfig();
+
+            MatchComPara CfigComParas =  scfg.LoadComWorkBook();
+            if (CfigComParas == null)
+            {
+                return;
+            }
+            byte FourthByte = 0x00;
+            string ComPort = CfigComParas.GetComPort("1");
+            byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"), 16);
+
+            int FrequencyNumber = CfigComParas.ComParameters.Count;
+           
 
             dgvTestData.DataSource = null;
             dgvTestData.DataSource = currFileNode.Tps.TestTable;
@@ -298,7 +321,7 @@ namespace Tps_LQ_Transmitter
             DCPower.Write($"VOLTage {volt} V\n"); DCPower.Query("*OPC?\n");//设置电压
             DCPower.Write($"CURRent {Current} A\n"); DCPower.Query("*OPC?\n");//设置电流
             DCPower.Write("GLOBal:OUTPut:STATe 1\n"); DCPower.Query("*OPC?\n");
-            
+
 
 
             //获取仪器
@@ -311,12 +334,40 @@ namespace Tps_LQ_Transmitter
             //DC.Write("设置电压", "28V");
             //DC.Write("设置限流", "2A");
             //DC.Write("打开电源");
-
-
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            
+            int ControlDelay = currFileNode.Tps.TestNodes[0].Parameters.GetParameter<int>("控制延时");
             task = new Task(new Action(() => {
                 //执行测试过程
-                currFileNode.Tps.Start(isOrderByChannel);
+                //currFileNode.Tps.Start(isOrderByChannel);
+                SerialClient.SerialOpen(CfigComParas.GetComPort("1"));
+                #region 根据频点来测指标
+                for (int point = 0; point < FrequencyNumber; point++)//频点总数
+                {
+                    FourthByte = Convert.ToByte(CfigComParas.GetFourthByte((point + 1).ToString()), 16);
+                    double CenterFreq = double.Parse(CfigComParas.Getfreqpoint((point + 1).ToString()));
+                    for (int i = 0; i < currFileNode.Tps.TestNodes.Count; i++)
+                    {
+                        currFileNode.Tps.TestNodes[i].PointIndex = point; 
+                        currFileNode.Tps.TestNodes[i].CenterFreq = CenterFreq;
+                        currFileNode.Tps.TestNodes[i].PointTotal = currFileNode.Tps.TestNodes.Count;
+                    }
 
+                    if (IsRuning == false)
+                    {
+                        SerialClient.SerialClose();
+                        return;
+                    }
+                    //控制
+                    SerialClient.DUT_Transmitter_Ctrol(ThridByte, FourthByte);
+                    Thread.Sleep(ControlDelay);//单位ms
+
+                    currFileNode.Tps.Start(isOrderByChannel);
+
+                }
+
+                SerialClient.SerialClose();
+                #endregion
                 DCPower.Write("GLOBal:OUTPut:STATe 0\n"); DCPower.Query("*OPC?\n");
                 this.Invoke(new Action(() => {
                     BtnLoadTpsConfig.Enabled = true;
@@ -335,6 +386,7 @@ namespace Tps_LQ_Transmitter
                 dgvTestData.DataSource = data;
             }));
         }
+
         private void BtnStop_Click(object sender, EventArgs e)
         {
             MainTps tps = new MainTps();
@@ -342,6 +394,7 @@ namespace Tps_LQ_Transmitter
             //获取仪器
             //var DC = tps.GetDevice("程控电源");
             currFileNode.Tps.Stop();
+            IsRuning = false;
             //if(task != null && task.IsCompleted == false)
             //{
             //    //等待任务退出
@@ -349,6 +402,7 @@ namespace Tps_LQ_Transmitter
             //}
             BtnStart.Enabled = true;
             BtnLoadTpsConfig.Enabled = true;
+          
             //DC.Write("关闭电源");
             DCPower.Write("GLOBal:OUTPut:STATe 0\n"); DCPower.Query("*OPC?\n");
         }

+ 1 - 1
tps/TpsLabStudio/com/SerialPort.cs

@@ -7,7 +7,7 @@ using System.IO.Ports;
 
 namespace Tps_LQ_Transmitter.com
 {
-    class TransmitterSerialPort
+     public  class TransmitterSerialPort
     {
          SerialPort sp = new SerialPort(); //新建一个串口对象  
         public void SerialOpen(string PORT)

+ 17 - 0
tps/TpsLabStudio/com/TestNode.cs

@@ -49,6 +49,23 @@ namespace Tps_LQ_Transmitter.com
         /// </summary>
         public BaseModel TestModel { get; set; }
 
+
+        /// <summary>
+        /// 中心频率
+        /// </summary>
+        [DisplayName("中心频率")]
+        public double CenterFreq { get; set; }
+        /// <summary>
+        /// 频点索引
+        /// </summary>
+        [DisplayName("频点索引")]
+        public int PointIndex { get; set; }
+
+        /// <summary>
+        /// 频点索引
+        /// </summary>
+        [DisplayName("频点总数")]
+        public int PointTotal { get; set; }
         public virtual TestNode Copy()
         {
             TestNode node = (TestNode)this.MemberwiseClone();

+ 5 - 1
tps/TpsLabStudio/models/BaseModel.cs

@@ -117,7 +117,7 @@ namespace Tps_LQ_Transmitter.models
             }
             sheet = sheet1;
         }
-
+      
         public void WriteExcelData(Spire.Xls.Worksheet sheet, int row, int channel, string name, string lower, string upper, string val, string result)
         {
             int column = (channel - 1) * 6;
@@ -145,6 +145,9 @@ namespace Tps_LQ_Transmitter.models
             workbook.CalculateAllValue();
             workbook.SaveToFile(FileName);
         }
+        #region 串口配置表
+
+       
         /// <summary>
         /// 获取串口配置表
         /// </summary>
@@ -304,6 +307,7 @@ namespace Tps_LQ_Transmitter.models
             public string freqpoint { get; set; }
 
         }
+        #endregion
         public class DataType
         {
 

+ 31 - 35
tps/TpsLabStudio/models/HarmonicSuppression.cs

@@ -23,7 +23,7 @@ namespace Tps_LQ_Transmitter.models
             Random random = new Random();
             //获取仪器
             var SA = this.tps.GetDevice("频谱仪");
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            //TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             OutData Data = new OutData();
             DataType HarmonicSuppressionPrint = new DataType();
 
@@ -41,20 +41,19 @@ namespace Tps_LQ_Transmitter.models
 
             sheet.Range["L1"].Value2 = tps.Serial;
             ConfigParameter PowerPara = new ConfigParameter();
-            MatchComPara CfigComParas = new MatchComPara();
+          //  MatchComPara CfigComParas = new MatchComPara();
 
-            CfigComParas = LoadComWorkBook();
+            //CfigComParas = LoadComWorkBook();
 
-            if (CfigComParas == null)
-            {
-                return false;
-            }
-
-            byte FourthByte = 0x00;
-            string ComPort = CfigComParas.GetComPort("1");
-            byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"), 16);
-            PowerPara.StepFrequency = 0;
+            //if (CfigComParas == null)
+            //{
+            //    return false;
+            //}
 
+            //byte FourthByte = 0x00;
+            //string ComPort = CfigComParas.GetComPort("1");
+            //byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"), 16);
+          
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
             PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
             PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
@@ -62,7 +61,7 @@ namespace Tps_LQ_Transmitter.models
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
             PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
             PowerPara.HarmonicTime = parameters.Parameters.GetParameterToArray<int>("谐波次数");
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.HarmonicSuppressionLower = parameters.Parameters.GetParameter<double>("谐波抑制下限");
             if ( (PowerPara.SPAN == null) || (PowerPara.REF == null) ||(PowerPara.SmallSignalREF==null)|| (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.HarmonicTime == null)
                 ||(PowerPara.HarmonicSuppressionLower==0))
@@ -70,11 +69,11 @@ namespace Tps_LQ_Transmitter.models
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
-            SerialClient.SerialOpen(ComPort);
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
+            //SerialClient.SerialOpen(ComPort);
             if (true)//需具备仪器
             {
                 SA.Write("仪器复位"); SA.Query("OPC");
@@ -87,24 +86,21 @@ namespace Tps_LQ_Transmitter.models
             double CenterFreq;
             int harmonic_num;
             double Power, Freq;
-            Data.HarmonicSuppression = new double[PowerPara.FrequencyNumber,PowerPara.HarmonicTime.Length];
+            Data.HarmonicSuppression = new double[parameters.PointTotal, PowerPara.HarmonicTime.Length];
            
-            for (int point = 0; ; point++)
+            //for (int point = 0; ; point++)
             {
 
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+              
                 if(true)//需具备仪器
                 {
                     //控制
                    // SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
-                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+                    //Thread.Sleep(PowerPara.ControlDelay);//单位ms
 
                     SA.Write("REF", PowerPara.REF); SA.Query("OPC");
-                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     SA.Write("SingleOrCont", "0"); SA.Query("OPC");
                     PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
                     Freq=x_value;
@@ -126,9 +122,9 @@ namespace Tps_LQ_Transmitter.models
                        // SA.Write("SingleOrCont", "0"); SA.Query("OPC");
                         SA.Write("单次扫描"); SA.Query("OPC");
                         PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
-                        Data.HarmonicSuppression[point, harmonic_num] = Math.Round(Power - y_value, 2);
-                        HarmonicSuppressionPrint.Test_name = parameters.Channel + "-"+ PowerPara.HarmonicTime[harmonic_num].ToString()+ "次-谐波抑制测试-" + CenterFreq.ToString() + "MHz";
-                        HarmonicTimeVal[harmonic_num] = Data.HarmonicSuppression[point, harmonic_num];
+                        Data.HarmonicSuppression[parameters.PointIndex, harmonic_num] = Math.Round(Power - y_value, 2);
+                        HarmonicSuppressionPrint.Test_name = parameters.Channel + "-"+ PowerPara.HarmonicTime[harmonic_num].ToString()+ "次-谐波抑制测试-" + parameters.CenterFreq.ToString() + "MHz";
+                        HarmonicTimeVal[harmonic_num] = Data.HarmonicSuppression[parameters.PointIndex, harmonic_num];
                         if (HarmonicTimeVal[harmonic_num] >= HarmonicSuppressionPrint.Lower)
                         {
                             HarmonicSuppressionPrint.Result = "是";
@@ -141,13 +137,13 @@ namespace Tps_LQ_Transmitter.models
                         if (parameters.Channel == "通道1")
                         {
 
-                            WriteExcelData(sheet, point, 1+2*(harmonic_num+1), HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
+                            WriteExcelData(sheet, parameters.PointIndex, 1+2*(harmonic_num+1), HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
                             // tps.SetTestTableCellValue(point, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
                         }
                         else if (parameters.Channel == "通道2")
                         {
 
-                            WriteExcelData(sheet, point, 2 + 2 * (harmonic_num + 1), HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
+                            WriteExcelData(sheet, parameters.PointIndex, 2 + 2 * (harmonic_num + 1), HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
                             // tps.SetTestTableCellValue(point + 15, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
                         }
                     }
@@ -163,7 +159,7 @@ namespace Tps_LQ_Transmitter.models
 
                 }
 
-                HarmonicSuppressionPrint.Test_name = parameters.Channel + "-谐波抑制测试-" + CenterFreq.ToString() + "MHz";
+                HarmonicSuppressionPrint.Test_name = parameters.Channel + "-谐波抑制测试-" + parameters.CenterFreq.ToString() + "MHz";
                
                 HarmonicSuppressionPrint.TestVal = HarmonicMinTimeVal;
               //  HarmonicSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
@@ -179,13 +175,13 @@ namespace Tps_LQ_Transmitter.models
                 if (parameters.Channel == "通道1")
                 {
                     
-                    WriteExcelData(sheet, point, 1, HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(),"/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 1, HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(),"/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
                    // tps.SetTestTableCellValue(point, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
                 }
                 else if (parameters.Channel == "通道2")
                 {
                     
-                    WriteExcelData(sheet, point, 2, HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 2, HarmonicSuppressionPrint.Test_name, HarmonicSuppressionPrint.Lower.ToString(), "/", HarmonicSuppressionPrint.TestVal.ToString(), HarmonicSuppressionPrint.Result);
                    // tps.SetTestTableCellValue(point + 15, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
                 }
 

+ 79 - 80
tps/TpsLabStudio/models/ModulationIndexAndMaxFreqOffset.cs

@@ -25,7 +25,7 @@ namespace Tps_LQ_Transmitter.models
             //获取仪器
             var SA = this.tps.GetDevice("频谱仪");
 
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+           // TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             OutData Data = new OutData();
             DataType ModulationIndexPrint = new DataType();
             DataType leftModulationIndexPrint = new DataType();
@@ -47,20 +47,20 @@ namespace Tps_LQ_Transmitter.models
             }
 
             MatchModulaPara CfigModuParas = new MatchModulaPara();
-            CfigModuParas = LoadModulationWorkBook();
-            if (CfigModuParas == null)
-            {
-                return false;
-            }
+            //CfigModuParas = LoadModulationWorkBook();
+            //if (CfigModuParas == null)
+            //{
+            //    return false;
+            //}
 
             ConfigParameter PowerPara = new ConfigParameter();
             PowerPara.StepFrequency = 0;
             PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-            PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+            //PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+            //PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
+            //PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+            //PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
             PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
             PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
@@ -68,17 +68,16 @@ namespace Tps_LQ_Transmitter.models
             PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.ModulationIndexLower = parameters.Parameters.GetParameter<double>("调制系数下限");
             PowerPara.ModulationIndexUpper = parameters.Parameters.GetParameter<double>("调制系数上限");
-            if ((PowerPara.StartFrequency == 0) || (PowerPara.StopFrequency == 0)
-                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null)||
+            if ( (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null)||
                 (PowerPara.ModulationIndexLower==0) || (PowerPara.ModulationIndexUpper==0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
             if (true)//需具备仪器
             {
                 SA.Write("仪器复位"); SA.Query("OPC");
@@ -96,41 +95,41 @@ namespace Tps_LQ_Transmitter.models
             }
 
 
-            if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
-            {
-                PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
-            }
-            if(PowerPara.StepFrequency != 0)
-            {
-                PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
-            }
+            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //{
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //}
+            //if(PowerPara.StepFrequency != 0)
+            //{
+            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //}
             
-            double CenterFreq;
-            double[] PowerDeltleft = new double[PowerPara.FrequencyNumber];
-            double[] PowerDeltright = new double[PowerPara.FrequencyNumber];
-            Data.ModulationIndex = new string[PowerPara.FrequencyNumber];
-            Data.leftModulationIndex = new string[PowerPara.FrequencyNumber];
-            Data.rightModulationIndex = new string[PowerPara.FrequencyNumber];
-            Data.MaxFreqOffset = new string[PowerPara.FrequencyNumber];
-            Data.leftFreqOffset = new string[PowerPara.FrequencyNumber];
-            Data.rightFreqOffset = new string[PowerPara.FrequencyNumber];
-
-            for (int point = 0;; point++)
+            //double CenterFreq;
+            double[] PowerDeltleft = new double[parameters.PointTotal];
+            double[] PowerDeltright = new double[parameters.PointTotal];
+            Data.ModulationIndex = new string[parameters.PointTotal];
+            Data.leftModulationIndex = new string[parameters.PointTotal];
+            Data.rightModulationIndex = new string[parameters.PointTotal];
+            Data.MaxFreqOffset = new string[parameters.PointTotal];
+            Data.leftFreqOffset = new string[parameters.PointTotal];
+            Data.rightFreqOffset = new string[parameters.PointTotal];
+
+           // for (int point = 0;; point++)
             {           
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency ||( PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                //if (CenterFreq > PowerPara.StopFrequency ||( PowerPara.FrequencyNumber == 1 && point == 1))
+                //{
+                //    break;
+                //}
                 if(true)//需具备仪器
                 {
                     // 控制
                   //  SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
-                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+                    //Thread.Sleep(PowerPara.ControlDelay);//单位ms
 
 
 
-                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     SA.Write("SingleOrCont", "0"); SA.Query("OPC");
                     SA.Write("单次扫描"); SA.Query("OPC");
                     SA.Write("PEAK", "1"); SA.Query("OPC");
@@ -142,17 +141,17 @@ namespace Tps_LQ_Transmitter.models
                                          
                         SA.Write("DELT打开", "2"); SA.Query("OPC");
                         SA.Write("NextPeakLeft", "2"); SA.Query("OPC");
-                        PowerDeltleft[point] = double.Parse(SA.Query("读MARK功率", "2")); SA.Query("OPC");
+                        PowerDeltleft[parameters.PointIndex] = double.Parse(SA.Query("读MARK功率", "2")); SA.Query("OPC");
                         SA.Write("DELT打开", "3"); SA.Query("OPC");
                         SA.Write("NextPeakRight", "3"); SA.Query("OPC");
-                        PowerDeltright[point] = double.Parse(SA.Query("读MARK功率", "3")); SA.Query("OPC");
+                        PowerDeltright[parameters.PointIndex] = double.Parse(SA.Query("读MARK功率", "3")); SA.Query("OPC");
                     }
                     else//其他型号频谱仪
                     {
                         SA.Write("NextPeakLeft", "2"); SA.Query("OPC");
-                        PowerDeltleft[point] = double.Parse(SA.Query("读DELT功率", "2")); SA.Query("OPC");
+                        PowerDeltleft[parameters.PointIndex] = double.Parse(SA.Query("读DELT功率", "2")); SA.Query("OPC");
                         SA.Write("NextPeakRight", "3"); SA.Query("OPC");
-                        PowerDeltright[point] = double.Parse(SA.Query("读DELT功率", "3")); SA.Query("OPC");
+                        PowerDeltright[parameters.PointIndex] = double.Parse(SA.Query("读DELT功率", "3")); SA.Query("OPC");
 
                     }
                     
@@ -164,49 +163,49 @@ namespace Tps_LQ_Transmitter.models
                 string RelativeVal= "0";
                 foreach (KeyValuePair<string, ModulationMatchParameter> kvp in CfigModuParas.ModulaParameters)
                 {
-                    if ((Math.Abs(Math.Abs(PowerDeltleft[point]) - double.Parse(kvp.Value.CfgRelative))) < temp)
+                    if ((Math.Abs(Math.Abs(PowerDeltleft[parameters.PointIndex]) - double.Parse(kvp.Value.CfgRelative))) < temp)
                     {
-                        temp = Math.Abs(Math.Abs(PowerDeltleft[point]) - double.Parse(kvp.Value.CfgRelative));
+                        temp = Math.Abs(Math.Abs(PowerDeltleft[parameters.PointIndex]) - double.Parse(kvp.Value.CfgRelative));
                         RelativeVal = kvp.Value.CfgRelative;
                     }                    
                 }
-                Data.leftModulationIndex[point] = CfigModuParas.GetModulaParameter(RelativeVal);//左侧调制系数
-                Data.leftFreqOffset[point] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//左侧最大频偏
+                Data.leftModulationIndex[parameters.PointIndex] = CfigModuParas.GetModulaParameter(RelativeVal);//左侧调制系数
+                Data.leftFreqOffset[parameters.PointIndex] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//左侧最大频偏
 
                 temp = 30;
                 RelativeVal = "0";
                 foreach (KeyValuePair<string, ModulationMatchParameter> kvp in CfigModuParas.ModulaParameters)
                 {
-                    if ((Math.Abs(Math.Abs(PowerDeltright[point]) - double.Parse(kvp.Value.CfgRelative))) < temp)
+                    if ((Math.Abs(Math.Abs(PowerDeltright[parameters.PointIndex]) - double.Parse(kvp.Value.CfgRelative))) < temp)
                     {
-                        temp = Math.Abs(Math.Abs(PowerDeltright[point]) - double.Parse(kvp.Value.CfgRelative));
+                        temp = Math.Abs(Math.Abs(PowerDeltright[parameters.PointIndex]) - double.Parse(kvp.Value.CfgRelative));
                         RelativeVal = kvp.Value.CfgRelative;
                     }
                 }
-                Data.rightModulationIndex[point] = CfigModuParas.GetModulaParameter(RelativeVal);//右侧调制系数
-                Data.rightFreqOffset[point] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//右侧最大频偏
+                Data.rightModulationIndex[parameters.PointIndex] = CfigModuParas.GetModulaParameter(RelativeVal);//右侧调制系数
+                Data.rightFreqOffset[parameters.PointIndex] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//右侧最大频偏
 
-                Data.ModulationIndex[point] = Math.Min(double.Parse(Data.leftModulationIndex[point]), double.Parse(Data.rightModulationIndex[point])).ToString();//调制系数
-                Data.MaxFreqOffset[point] = Math.Min(double.Parse(Data.leftFreqOffset[point]), double.Parse(Data.rightFreqOffset[point])).ToString();//最大频偏
+                Data.ModulationIndex[parameters.PointIndex] = Math.Min(double.Parse(Data.leftModulationIndex[parameters.PointIndex]), double.Parse(Data.rightModulationIndex[parameters.PointIndex])).ToString();//调制系数
+                Data.MaxFreqOffset[parameters.PointIndex] = Math.Min(double.Parse(Data.leftFreqOffset[parameters.PointIndex]), double.Parse(Data.rightFreqOffset[parameters.PointIndex])).ToString();//最大频偏
 
-                ModulationIndexPrint.Test_name = parameters.Channel + "-调制系数测试-" + CenterFreq.ToString() + "MHz";
-                leftModulationIndexPrint.Test_name = parameters.Channel + "-fL调制系数测试-" + CenterFreq.ToString() + "MHz";
-                rightModulationIndexPrint.Test_name = parameters.Channel + "-fH调制系数测试-" + CenterFreq.ToString() + "MHz";
+                ModulationIndexPrint.Test_name = parameters.Channel + "-调制系数测试-" + parameters.CenterFreq.ToString() + "MHz";
+                leftModulationIndexPrint.Test_name = parameters.Channel + "-fL调制系数测试-" + parameters.CenterFreq.ToString() + "MHz";
+                rightModulationIndexPrint.Test_name = parameters.Channel + "-fH调制系数测试-" + parameters.CenterFreq.ToString() + "MHz";
 
-                MaxFreqOffsetPrint.Test_name = parameters.Channel + "-最大频偏(KHz)-" + CenterFreq.ToString() + "MHz";
-                leftFreqOffsetPrint.Test_name = parameters.Channel + "-fL(KHz)-" + CenterFreq.ToString() + "MHz";
-                rightFreqOffsetPrint.Test_name = parameters.Channel + "-fH(KHz)-" + CenterFreq.ToString() + "MHz";
+                MaxFreqOffsetPrint.Test_name = parameters.Channel + "-最大频偏(KHz)-" + parameters.CenterFreq.ToString() + "MHz";
+                leftFreqOffsetPrint.Test_name = parameters.Channel + "-fL(KHz)-" + parameters.CenterFreq.ToString() + "MHz";
+                rightFreqOffsetPrint.Test_name = parameters.Channel + "-fH(KHz)-" + parameters.CenterFreq.ToString() + "MHz";
 
                 ModulationIndexPrint.Lower = PowerPara.ModulationIndexLower;
                 ModulationIndexPrint.Upper = PowerPara.ModulationIndexUpper;
 
-                ModulationIndexPrint.TestVal = double.Parse(Data.ModulationIndex[point]);
-                leftModulationIndexPrint.TestVal = double.Parse(Data.leftModulationIndex[point]);
-                rightModulationIndexPrint.TestVal = double.Parse(Data.rightModulationIndex[point]);
+                ModulationIndexPrint.TestVal = double.Parse(Data.ModulationIndex[parameters.PointIndex]);
+                leftModulationIndexPrint.TestVal = double.Parse(Data.leftModulationIndex[parameters.PointIndex]);
+                rightModulationIndexPrint.TestVal = double.Parse(Data.rightModulationIndex[parameters.PointIndex]);
 
-                MaxFreqOffsetPrint.TestVal = double.Parse(Data.MaxFreqOffset[point]);
-                leftFreqOffsetPrint.TestVal = double.Parse(Data.leftFreqOffset[point]);
-                rightFreqOffsetPrint.TestVal = double.Parse(Data.rightFreqOffset[point]);
+                MaxFreqOffsetPrint.TestVal = double.Parse(Data.MaxFreqOffset[parameters.PointIndex]);
+                leftFreqOffsetPrint.TestVal = double.Parse(Data.leftFreqOffset[parameters.PointIndex]);
+                rightFreqOffsetPrint.TestVal = double.Parse(Data.rightFreqOffset[parameters.PointIndex]);
 
                 if (ModulationIndexPrint.TestVal >= ModulationIndexPrint.Lower && ModulationIndexPrint.TestVal <= ModulationIndexPrint.Upper)
                 {
@@ -259,23 +258,23 @@ namespace Tps_LQ_Transmitter.models
                 {
                    
                     //tps.SetTestTableCellValue(point, 9, ModulationIndexPrint.Result,Data.ModulationIndex[point]);
-                    WriteExcelData(sheet, point, 1, ModulationIndexPrint.Test_name, ModulationIndexPrint.Lower.ToString(), ModulationIndexPrint.Upper.ToString(), ModulationIndexPrint.TestVal.ToString(), ModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 5, leftModulationIndexPrint.Test_name, leftModulationIndexPrint.Lower.ToString(), leftModulationIndexPrint.Upper.ToString(), leftModulationIndexPrint.TestVal.ToString(), leftModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 9, rightModulationIndexPrint.Test_name, rightModulationIndexPrint.Lower.ToString(), rightModulationIndexPrint.Upper.ToString(), rightModulationIndexPrint.TestVal.ToString(), rightModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 3, MaxFreqOffsetPrint.Test_name, MaxFreqOffsetPrint.Lower.ToString(), MaxFreqOffsetPrint.Upper.ToString(), MaxFreqOffsetPrint.TestVal.ToString(), MaxFreqOffsetPrint.Result);
-                    WriteExcelData(sheet, point, 7, leftFreqOffsetPrint.Test_name, leftFreqOffsetPrint.Lower.ToString(), leftFreqOffsetPrint.Upper.ToString(), leftFreqOffsetPrint.TestVal.ToString(), leftFreqOffsetPrint.Result);
-                    WriteExcelData(sheet, point, 11, rightFreqOffsetPrint.Test_name, rightFreqOffsetPrint.Lower.ToString(), rightFreqOffsetPrint.Upper.ToString(), rightFreqOffsetPrint.TestVal.ToString(), rightFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 1, ModulationIndexPrint.Test_name, ModulationIndexPrint.Lower.ToString(), ModulationIndexPrint.Upper.ToString(), ModulationIndexPrint.TestVal.ToString(), ModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 5, leftModulationIndexPrint.Test_name, leftModulationIndexPrint.Lower.ToString(), leftModulationIndexPrint.Upper.ToString(), leftModulationIndexPrint.TestVal.ToString(), leftModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 9, rightModulationIndexPrint.Test_name, rightModulationIndexPrint.Lower.ToString(), rightModulationIndexPrint.Upper.ToString(), rightModulationIndexPrint.TestVal.ToString(), rightModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 3, MaxFreqOffsetPrint.Test_name, MaxFreqOffsetPrint.Lower.ToString(), MaxFreqOffsetPrint.Upper.ToString(), MaxFreqOffsetPrint.TestVal.ToString(), MaxFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 7, leftFreqOffsetPrint.Test_name, leftFreqOffsetPrint.Lower.ToString(), leftFreqOffsetPrint.Upper.ToString(), leftFreqOffsetPrint.TestVal.ToString(), leftFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 11, rightFreqOffsetPrint.Test_name, rightFreqOffsetPrint.Lower.ToString(), rightFreqOffsetPrint.Upper.ToString(), rightFreqOffsetPrint.TestVal.ToString(), rightFreqOffsetPrint.Result);
                     // tps.SetTestTableCellValue(point, 6, Data.MaxFreqOffset[point]);
                 }
                 else if (parameters.Channel == "通道2")
                 {
                     
-                    WriteExcelData(sheet, point, 2, ModulationIndexPrint.Test_name, ModulationIndexPrint.Lower.ToString(), ModulationIndexPrint.Upper.ToString(), ModulationIndexPrint.TestVal.ToString(), ModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 6, leftModulationIndexPrint.Test_name, leftModulationIndexPrint.Lower.ToString(), leftModulationIndexPrint.Upper.ToString(), leftModulationIndexPrint.TestVal.ToString(), leftModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 10, rightModulationIndexPrint.Test_name, rightModulationIndexPrint.Lower.ToString(), rightModulationIndexPrint.Upper.ToString(), rightModulationIndexPrint.TestVal.ToString(), rightModulationIndexPrint.Result);
-                    WriteExcelData(sheet, point, 4, MaxFreqOffsetPrint.Test_name, MaxFreqOffsetPrint.Lower.ToString(), MaxFreqOffsetPrint.Upper.ToString(), MaxFreqOffsetPrint.TestVal.ToString(), MaxFreqOffsetPrint.Result);
-                    WriteExcelData(sheet, point, 8, leftFreqOffsetPrint.Test_name, leftFreqOffsetPrint.Lower.ToString(), leftFreqOffsetPrint.Upper.ToString(), leftFreqOffsetPrint.TestVal.ToString(), leftFreqOffsetPrint.Result);
-                    WriteExcelData(sheet, point, 11, rightFreqOffsetPrint.Test_name, rightFreqOffsetPrint.Lower.ToString(), rightFreqOffsetPrint.Upper.ToString(), rightFreqOffsetPrint.TestVal.ToString(), rightFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 2, ModulationIndexPrint.Test_name, ModulationIndexPrint.Lower.ToString(), ModulationIndexPrint.Upper.ToString(), ModulationIndexPrint.TestVal.ToString(), ModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 6, leftModulationIndexPrint.Test_name, leftModulationIndexPrint.Lower.ToString(), leftModulationIndexPrint.Upper.ToString(), leftModulationIndexPrint.TestVal.ToString(), leftModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 10, rightModulationIndexPrint.Test_name, rightModulationIndexPrint.Lower.ToString(), rightModulationIndexPrint.Upper.ToString(), rightModulationIndexPrint.TestVal.ToString(), rightModulationIndexPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 4, MaxFreqOffsetPrint.Test_name, MaxFreqOffsetPrint.Lower.ToString(), MaxFreqOffsetPrint.Upper.ToString(), MaxFreqOffsetPrint.TestVal.ToString(), MaxFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 8, leftFreqOffsetPrint.Test_name, leftFreqOffsetPrint.Lower.ToString(), leftFreqOffsetPrint.Upper.ToString(), leftFreqOffsetPrint.TestVal.ToString(), leftFreqOffsetPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 11, rightFreqOffsetPrint.Test_name, rightFreqOffsetPrint.Lower.ToString(), rightFreqOffsetPrint.Upper.ToString(), rightFreqOffsetPrint.TestVal.ToString(), rightFreqOffsetPrint.Result);
                     //tps.SetTestTableCellValue(point + 15, 9, ModulationIndexPrint.Result, Data.ModulationIndex[point]);
                     //tps.SetTestTableCellValue(point + 15, 6, Data.MaxFreqOffset[point]);
                 }

+ 33 - 33
tps/TpsLabStudio/models/NoisePowerDensity.cs

@@ -23,7 +23,7 @@ namespace Tps_LQ_Transmitter.models
             //获取仪器
             var SA = this.tps.GetDevice("频谱仪");
            
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            //TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             OutData Data = new OutData();
             DataType NoisePowerPrint = new DataType();
 
@@ -35,32 +35,31 @@ namespace Tps_LQ_Transmitter.models
 
             
             ConfigParameter PowerPara = new ConfigParameter();
-            PowerPara.StepFrequency = 0;
-            PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
+            //PowerPara.StepFrequency = 0;
+            //PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-            PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+            //PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+            //PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
+            //PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
 
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+            //PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
            // PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
             PowerPara.CHSPAN = parameters.Parameters.GetParameter<string>("通道扫描带宽(SPAN)");
             PowerPara.ACHBand = parameters.Parameters.GetParameter<string>("通道带宽");
             PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
             PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.NoisePowerUpper = parameters.Parameters.GetParameter<double>("噪声功率谱密度上限");
-            if ((PowerPara.StartFrequency == 0) || (PowerPara.StopFrequency == 0)  || (PowerPara.CHSPAN == null) || (PowerPara.ACHBand == null) 
-                || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.NoisePowerUpper == 0))
+            if ( (PowerPara.CHSPAN == null) || (PowerPara.ACHBand == null)  || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.NoisePowerUpper == 0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
             SA.Write("仪器复位"); SA.Query("OPC");
            
             SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
@@ -89,31 +88,31 @@ namespace Tps_LQ_Transmitter.models
 
 
 
-            if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
-            {
-                PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
-            }
-            if (PowerPara.StepFrequency != 0)
-            {
-                PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
-            }
+            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //{
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //}
+            //if (PowerPara.StepFrequency != 0)
+            //{
+            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //}
 
-            double CenterFreq;
-            Data.NoisePower = new string[PowerPara.FrequencyNumber];
+            //double CenterFreq;
+            Data.NoisePower = new string[parameters.PointTotal];
         
-            for (int point = 0;; point++)
+          //  for (int point = 0;; point++)
             {      
                 
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                //if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                //{
+                //    break;
+                //}
                 // 控制
               //  SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
-                Thread.Sleep(PowerPara.ControlDelay);//单位ms            
+              //  Thread.Sleep(PowerPara.ControlDelay);//单位ms            
 
-                SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
 
                 SA.Write("单次扫描"); SA.Query("OPC");
                 if (SA.Query("IDN").Contains("N9030"))//N9030A型号频谱仪
@@ -129,7 +128,7 @@ namespace Tps_LQ_Transmitter.models
 
 
 
-                NoisePowerPrint.Test_name = parameters.Channel + "-噪声功率谱密度(dBm/Hz)-" + CenterFreq.ToString() + "MHz";
+                NoisePowerPrint.Test_name = parameters.Channel + "-噪声功率谱密度(dBm/Hz)-" + parameters.CenterFreq.ToString() + "MHz";
                 NoisePowerPrint.Upper = PowerPara.NoisePowerUpper;
                 
                 if ( NoisePowerPrint.TestVal <= NoisePowerPrint.Upper)
@@ -160,6 +159,7 @@ namespace Tps_LQ_Transmitter.models
                 SA.Write("关闭所有MARK"); SA.Query("OPC");
 
             }           
+
             return true;
         }
 

+ 39 - 40
tps/TpsLabStudio/models/PhaseNoise.cs

@@ -24,7 +24,7 @@ namespace Tps_LQ_Transmitter.models
             //获取仪器
             var SA = this.tps.GetDevice("频谱仪");
            
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            //TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             DataType PhaseNoisePrint = new DataType();//相位噪声
             OutData Data = new OutData();
 
@@ -34,31 +34,30 @@ namespace Tps_LQ_Transmitter.models
                 return false;
             }
             ConfigParameter PowerPara = new ConfigParameter();
-            PowerPara.StepFrequency = 0;
-            PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
+            //PowerPara.StepFrequency = 0;
+            //PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-            PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+            //PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+            //PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
+            //PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+            //PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
             PowerPara.PNosieOffsetFreq = parameters.Parameters.GetParameterToArray<double>("相位噪声偏置频率");
             PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
             PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
             PowerPara.PNoiseREF = parameters.Parameters.GetParameter<string>("相位噪声模式参考电平(REF)");
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
             PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.PhaseNoiseUpper = parameters.Parameters.GetParameter<double >("相位噪声上限");
-            if ((PowerPara.StartFrequency == 0) ||  (PowerPara.StopFrequency == 0)|| (PowerPara.SPAN == null) || (PowerPara.REF == null) 
-                || (PowerPara.RBW == null) ||  (PowerPara.VBW == null) || (PowerPara.PhaseNoiseUpper==0))
+            if ( (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) ||  (PowerPara.VBW == null) || (PowerPara.PhaseNoiseUpper==0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
             SA.Write("仪器复位"); SA.Query("OPC");
             
     
@@ -77,36 +76,36 @@ namespace Tps_LQ_Transmitter.models
 
 
 
-            if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
-            {
-                PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
-            }
-            if (PowerPara.StepFrequency != 0)
-            {
-                PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
-            }
+            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //{
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //}
+            //if (PowerPara.StepFrequency != 0)
+            //{
+            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //}
 
-            double CenterFreq,Freq;
-            Data.PhaseNoise = new double[PowerPara.FrequencyNumber, PowerPara.PNosieOffsetFreq.Length];
+            double Freq;
+            Data.PhaseNoise = new double[parameters.PointTotal, PowerPara.PNosieOffsetFreq.Length];
            
-            for (int point = 0;; point++)
+            //for (int point = 0;; point++)
             {
                
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                //if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                //{
+                //    break;
+                //}
                 // 控制
                // SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
-                Thread.Sleep(PowerPara.ControlDelay);//单位ms
+                //Thread.Sleep(PowerPara.ControlDelay);//单位ms
 
                 if (SA.Query("IDN").Contains("N9030"))//N9030A型号频谱仪
                 {
                     //SA.Write("相位噪声测试模式");SA.Query("OPC");
                     //SA.Write("相位噪声LogPlot模式"); SA.Query("OPC");
                     //SA.Write("相位噪声模式参考电平","-30"); SA.Query("OPC");
-                    SA.Write("相位噪声载波频率设置", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("相位噪声载波频率设置", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     
                     //Psa.Write("相位噪声stopOffset", "200000"); Psa.QueryTimeout("OPC", 3000);
                     //Psa.Write("相位噪声startOffset", "20"); Psa.QueryTimeout("OPC", 3000);
@@ -124,7 +123,7 @@ namespace Tps_LQ_Transmitter.models
                     SA.Write("SPAN", "0.1"); SA.Query("OPC");
                     SA.Write("RBWAUTO"); SA.Query("OPC");
                     SA.Write("VBWAUTO"); SA.Query("OPC");
-                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     SA.Write("SingleOrCont", "0"); SA.Query("OPC");
                     PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
                     SA.Write("CENTER",( x_value/1000000).ToString()); SA.Query("OPC");                  
@@ -142,7 +141,7 @@ namespace Tps_LQ_Transmitter.models
                     if (SA.Query("IDN").Contains("N9030"))//N9030A型号频谱仪
                     {
                         SA.Write("设置Mark频率Hz", "1", PowerPara.PNosieOffsetFreq[offset_num].ToString()); SA.Query("OPC");
-                        Data.PhaseNoise[point, offset_num] = Math.Round(double.Parse(SA.Query("读Mark相位噪声值", "1")), 2); 
+                        Data.PhaseNoise[parameters.PointIndex, offset_num] = Math.Round(double.Parse(SA.Query("读Mark相位噪声值", "1")), 2); 
                     }
                     else
                     {
@@ -156,12 +155,12 @@ namespace Tps_LQ_Transmitter.models
                      
                      
                         SA.Write("设置DELT频率", "1", (PowerPara.PNosieOffsetFreq[offset_num]/1000).ToString()); SA.Query("OPC");
-                        Data.PhaseNoise[point, offset_num] = Math.Round(double.Parse(SA.Query("读相位噪声", "1")), 2);
+                        Data.PhaseNoise[parameters.PointIndex, offset_num] = Math.Round(double.Parse(SA.Query("读相位噪声", "1")), 2);
                        
 
                     }
-                    PhaseNoisePrint.Test_name = parameters.Channel + "-" + (PowerPara.PNosieOffsetFreq[offset_num]/1000).ToString()+"Khz-相位噪声(dBc/Hz)-" + CenterFreq.ToString() + "MHz";
-                    if (Data.PhaseNoise[point, offset_num] <= PhaseNoisePrint.Upper)
+                    PhaseNoisePrint.Test_name = parameters.Channel + "-" + (PowerPara.PNosieOffsetFreq[offset_num]/1000).ToString()+"Khz-相位噪声(dBc/Hz)-" + parameters.CenterFreq.ToString() + "MHz";
+                    if (Data.PhaseNoise[parameters.PointIndex, offset_num] <= PhaseNoisePrint.Upper)
                     {
                         PhaseNoisePrint.Result = "是";
                     }
@@ -169,8 +168,8 @@ namespace Tps_LQ_Transmitter.models
                     {
                         PhaseNoisePrint.Result = "否";
                     }
-                    tps.TestTableAddCell(PhaseNoisePrint.Test_name, "/", PhaseNoisePrint.Upper.ToString(), Data.PhaseNoise[point, offset_num].ToString(), PhaseNoisePrint.Result);
-                    PhaseNoiseOffsetVal[offset_num] = Data.PhaseNoise[point, offset_num];
+                    tps.TestTableAddCell(PhaseNoisePrint.Test_name, "/", PhaseNoisePrint.Upper.ToString(), Data.PhaseNoise[parameters.PointIndex, offset_num].ToString(), PhaseNoisePrint.Result);
+                    PhaseNoiseOffsetVal[offset_num] = Data.PhaseNoise[parameters.PointIndex, offset_num];
                 }
                 if (PowerPara.PNosieOffsetFreq.Length > 1)//计算相位噪声中的最大值
                 {
@@ -180,7 +179,7 @@ namespace Tps_LQ_Transmitter.models
                 {
                     PhaseNoiseMaxOffsetVal = PhaseNoiseOffsetVal[0];
                 }
-                PhaseNoisePrint.Test_name = parameters.Channel + "-相位噪声(dBc/Hz)-" + CenterFreq.ToString() + "MHz";
+                PhaseNoisePrint.Test_name = parameters.Channel + "-相位噪声(dBc/Hz)-" + parameters.CenterFreq.ToString() + "MHz";
                
                 PhaseNoisePrint.TestVal = PhaseNoiseMaxOffsetVal;
                 if (PhaseNoisePrint.TestVal <= PhaseNoisePrint.Upper)

+ 66 - 66
tps/TpsLabStudio/models/PowerAndFreqStability.cs

@@ -54,23 +54,23 @@ namespace Tps_LQ_Transmitter.models
 
 
             ConfigParameter PowerPara = new ConfigParameter();
-            MatchComPara CfigComParas = new MatchComPara();
-            CfigComParas = LoadComWorkBook();
+            //MatchComPara CfigComParas = new MatchComPara();
+            //CfigComParas = LoadComWorkBook();
 
-            if (CfigComParas == null)
-            {
-                return false;
-            }
+            //if (CfigComParas == null)
+            //{
+            //    return false;
+            //}
 
-            byte FourthByte = 0x00;
-            string ComPort = CfigComParas.GetComPort("1");
-            byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"), 16);
+            //byte FourthByte = 0x00;
+            //string ComPort = CfigComParas.GetComPort("1");
+            //byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"), 16);
             PowerPara.StepFrequency = 0;
             
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
            // PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
            // PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-           // PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+           // parameters.PointTotal = parameters.Parameters.GetParameter<int>("频点数量");
          //   PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
             PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
             PowerPara.CHSPAN = parameters.Parameters.GetParameter<string>("通道扫描带宽(SPAN)");
@@ -78,7 +78,7 @@ namespace Tps_LQ_Transmitter.models
             PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
             PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.PowerLower = parameters.Parameters.GetParameter<double>("功率下限");
             PowerPara.PowerUpper = parameters.Parameters.GetParameter<double>("功率上限");
             PowerPara.FreqAccuracyUpper = parameters.Parameters.GetParameter<double>("频率稳定度上限");
@@ -90,38 +90,38 @@ namespace Tps_LQ_Transmitter.models
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
-            SerialClient.SerialOpen(ComPort);
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
+            //SerialClient.SerialOpen(ComPort);
             if (true)//需具备仪器
             {
                 SA.Write("仪器复位"); SA.Query("OPC");                           
                 
 
             }
-            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //if ((parameters.PointTotal != 0) && (parameters.PointTotal != 1) && (PowerPara.StepFrequency == 0))
             //{
-            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (parameters.PointTotal - 1)) * 100)) / 100;
             //}
             //if (PowerPara.StepFrequency != 0)
             //{
-            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //    parameters.PointTotal = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
             //}
-            PowerPara.FrequencyNumber = CfigComParas.ComParameters.Count;
+            //parameters.PointTotal = CfigComParas.ComParameters.Count;
             double CenterFreq;
-            Data.Power = new double[PowerPara.FrequencyNumber];
-            Data.Freq = new double[PowerPara.FrequencyNumber];
-            Data.FreqAccuracy = new double[PowerPara.FrequencyNumber];
+            Data.Power = new double[parameters.PointTotal];
+            Data.Freq = new double[parameters.PointTotal];
+            Data.FreqAccuracy = new double[parameters.PointTotal];
             if (tps.Serial != serial)
             {
-                WTempPowerVal = new double[2, PowerPara.FrequencyNumber] ;
-                dBTempPowerVal = new double[2, PowerPara.FrequencyNumber];
+                WTempPowerVal = new double[2, parameters.PointTotal] ;
+                dBTempPowerVal = new double[2, parameters.PointTotal];
                 serial = tps.Serial;
                 for (int initVal1 = 0; initVal1 < 2; initVal1++)
                 {
-                    for (int initVal2 = 0; initVal2 < PowerPara.FrequencyNumber; initVal2++)
+                    for (int initVal2 = 0; initVal2 < parameters.PointTotal; initVal2++)
                     {
                         WTempPowerVal[initVal1, initVal2] = -100;
                         dBTempPowerVal[initVal1, initVal2] = -100;
@@ -129,19 +129,19 @@ namespace Tps_LQ_Transmitter.models
                 }
             }
             
-            for (int point = 0; point < PowerPara.FrequencyNumber; point++)
+            //for (int parameters.PointIndex = 0; parameters.PointIndex < parameters.PointTotal; parameters.PointIndex++)
             {
 
-                string sa= CfigComParas.GetFourthByte((point + 1).ToString());
-                FourthByte = Convert.ToByte(CfigComParas.GetFourthByte((point + 1).ToString()), 16);
-                CenterFreq = double.Parse(CfigComParas.Getfreqpoint((point + 1).ToString()));
+                //string sa= CfigComParas.GetFourthByte((parameters.PointIndex + 1).ToString());
+                //FourthByte = Convert.ToByte(CfigComParas.GetFourthByte((parameters.PointIndex + 1).ToString()), 16);
+                //CenterFreq = double.Parse(CfigComParas.Getfreqpoint((parameters.PointIndex + 1).ToString()));
                 //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * FourthByte;
                 
                 if (true)//需具备仪器
                 {
                     //控制
-                    SerialClient.DUT_Transmitter_Ctrol(ThridByte, FourthByte);
-                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+                    //SerialClient.DUT_Transmitter_Ctrol(ThridByte, FourthByte);
+                    //Thread.Sleep(PowerPara.ControlDelay);//单位ms
 
                     SA.Write("设置频谱测试模式"); SA.Query("OPC");
                     
@@ -149,7 +149,7 @@ namespace Tps_LQ_Transmitter.models
                     SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
                     SA.Write("VBW", PowerPara.VBW); SA.Query("OPC");
                     SA.Write("REF", PowerPara.REF); SA.Query("OPC");
-                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     SA.Write("SingleOrCont", "1"); SA.Query("OPC");
                     Thread.Sleep(500);
                     SA.Write("MARK打开", "1"); SA.Query("OPC");
@@ -191,18 +191,18 @@ namespace Tps_LQ_Transmitter.models
                        // PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
                         y_value = double.Parse(SA.Query("读通道功率"));
 
-                    }  
+                    }
                     
 
-                    Data.Power[point] = y_value + PowerPara.OutLoss;//功率
+                    Data.Power[parameters.PointIndex] = y_value + PowerPara.OutLoss;//功率
 
                 }
 
-                //Data.Power[point] = random.Next(3000, 4000) / 100.0;//随机数
-                PowerPrint.Test_name = parameters.Channel + "-功率测试(W)-" + CenterFreq.ToString() + "MHz";
+                //Data.Power[parameters.PointIndex] = random.Next(3000, 4000) / 100.0;//随机数
+                PowerPrint.Test_name = parameters.Channel + "-功率测试(W)-" + parameters.CenterFreq.ToString() + "MHz";
                 PowerPrint.Lower = PowerPara.PowerLower;
                 PowerPrint.Upper = PowerPara.PowerUpper;
-                PowerPrint.TestVal = Math.Round(Math.Pow(10, (Data.Power[point] / 10)) / 1000, 2);//功率W
+                PowerPrint.TestVal = Math.Round(Math.Pow(10, (Data.Power[parameters.PointIndex] / 10)) / 1000, 2);//功率W
 
                 if ((PowerPrint.TestVal >= PowerPrint.Lower) && (PowerPrint.TestVal <= PowerPrint.Upper))
                 {
@@ -212,9 +212,9 @@ namespace Tps_LQ_Transmitter.models
                 {
                     PowerPrint.Result = "否";
                 }
-                FreqPrint.Test_name = parameters.Channel + "-频率测试(MHz)-" + CenterFreq.ToString() + "MHz";
-                FreqPrint.Lower =Math.Round(0-((PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq),2);
-                FreqPrint.Upper = Math.Round((PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq,2);
+                FreqPrint.Test_name = parameters.Channel + "-频率测试(MHz)-" + parameters.CenterFreq.ToString() + "MHz";
+                FreqPrint.Lower =Math.Round(0-((PowerPara.FreqAccuracyUpper * parameters.CenterFreq) + parameters.CenterFreq),2);
+                FreqPrint.Upper = Math.Round((PowerPara.FreqAccuracyUpper * parameters.CenterFreq) + parameters.CenterFreq, 2);
                 FreqPrint.TestVal = Math.Round(TestFreq / 1000000, 3);//实测频率
                 //FreqPrint.TestVal = random.Next(-600, 6000) / 100.0 + CenterFreq;//随机数
                 if ((FreqPrint.TestVal >= FreqPrint.Lower) && (FreqPrint.TestVal <= FreqPrint.Upper))
@@ -226,9 +226,9 @@ namespace Tps_LQ_Transmitter.models
                     FreqPrint.Result = "否";
                 }
 
-                FreqAccuracyPrint.Test_name = parameters.Channel + "-频率稳定度测试-" + CenterFreq.ToString() + "MHz";
+                FreqAccuracyPrint.Test_name = parameters.Channel + "-频率稳定度测试-" + parameters.CenterFreq.ToString() + "MHz";
                 FreqAccuracyPrint.Upper = PowerPara.FreqAccuracyUpper;
-                FreqAccuracyPrint.TestVal = Math.Round(Math.Abs(TestFreq - CenterFreq * 1000000) / (CenterFreq * 1000000), 6);//频率稳定度
+                FreqAccuracyPrint.TestVal = Math.Round(Math.Abs(TestFreq - parameters.CenterFreq * 1000000) / (parameters.CenterFreq * 1000000), 6);//频率稳定度
                 //FreqAccuracyPrint.TestVal = Math.Round(Math.Abs((random.Next(-600, 6000) / 100.0 + CenterFreq)*1000000 - CenterFreq * 1000000) / (CenterFreq * 1000000), 6);//随机数
                 if (FreqAccuracyPrint.TestVal <= FreqAccuracyPrint.Upper)
                 {
@@ -243,37 +243,37 @@ namespace Tps_LQ_Transmitter.models
                 if (parameters.Channel == "通道1")
                 {
                     
-                    WriteExcelData(sheet, point, 1, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);
-                    WriteExcelData(sheet, point, 3, FreqPrint.Test_name, FreqPrint.Lower.ToString(), FreqPrint.Upper.ToString(), FreqPrint.TestVal.ToString(), FreqPrint.Result);
-                    //tps.SetTestTableCellValue(point, 10, PowerPrint.Result, PowerPrint.TestVal);
-                    //tps.SetTestTableCellValue(point, 7, FreqPrint.Result, FreqPrint.TestVal);
+                    WriteExcelData(sheet, parameters.PointIndex, 1, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 3, FreqPrint.Test_name, FreqPrint.Lower.ToString(), FreqPrint.Upper.ToString(), FreqPrint.TestVal.ToString(), FreqPrint.Result);
+                    //tps.SetTestTableCellValue(parameters.PointIndex, 10, PowerPrint.Result, PowerPrint.TestVal);
+                    //tps.SetTestTableCellValue(parameters.PointIndex, 7, FreqPrint.Result, FreqPrint.TestVal);
                 }
                 else if (parameters.Channel == "通道2")
                 {
                   
-                    WriteExcelData(sheet, point, 2, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);
-                    WriteExcelData(sheet, point, 4, FreqPrint.Test_name, "/", FreqPrint.Upper.ToString(), FreqPrint.TestVal.ToString(), FreqPrint.Result);
-                    //tps.SetTestTableCellValue(point, 11, PowerPrint.Result, PowerPrint.TestVal);
-                    //tps.SetTestTableCellValue(point + 15, 7, FreqPrint.Result, FreqPrint.TestVal);
+                    WriteExcelData(sheet, parameters.PointIndex, 2, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 4, FreqPrint.Test_name, "/", FreqPrint.Upper.ToString(), FreqPrint.TestVal.ToString(), FreqPrint.Result);
+                    //tps.SetTestTableCellValue(parameters.PointIndex, 11, PowerPrint.Result, PowerPrint.TestVal);
+                    //tps.SetTestTableCellValue(parameters.PointIndex + 15, 7, FreqPrint.Result, FreqPrint.TestVal);
                 }
 
                 #region 功率不平度及两路功率总和计算
                 if (parameters.Channel == "通道1")
                 {
-                    WTempPowerVal[0, point] = PowerPrint.TestVal;//W
-                    dBTempPowerVal[0, point] = Data.Power[point];//dB
+                    WTempPowerVal[0, parameters.PointIndex] = PowerPrint.TestVal;//W
+                    dBTempPowerVal[0, parameters.PointIndex] = Data.Power[parameters.PointIndex];//dB
                 }
                 else
                 {
-                    WTempPowerVal[1, point] = PowerPrint.TestVal;//W
-                    dBTempPowerVal[1, point] = Data.Power[point];//dB
+                    WTempPowerVal[1, parameters.PointIndex] = PowerPrint.TestVal;//W
+                    dBTempPowerVal[1, parameters.PointIndex] = Data.Power[parameters.PointIndex];//dB
                 }
 
-                if (WTempPowerVal[0, point] > -100 && WTempPowerVal[1, point] > -100)
+                if (WTempPowerVal[0, parameters.PointIndex] > -100 && WTempPowerVal[1, parameters.PointIndex] > -100)
                 {
-                    PowerSumPrint.Test_name =  "两路功率总和(W)-" + CenterFreq.ToString() + "MHz";
+                    PowerSumPrint.Test_name =  "两路功率总和(W)-" + parameters.CenterFreq.ToString() + "MHz";
                     PowerSumPrint.Lower = PowerPara.PowerSumLower;
-                    PowerSumPrint.TestVal = Math.Round(WTempPowerVal[0, point] + WTempPowerVal[1, point],2);//W
+                    PowerSumPrint.TestVal = Math.Round(WTempPowerVal[0, parameters.PointIndex] + WTempPowerVal[1, parameters.PointIndex],2);//W
                     if ((PowerSumPrint.TestVal >= PowerSumPrint.Lower) && (PowerSumPrint.TestVal <= PowerSumPrint.Upper))
                     {
                         PowerSumPrint.Result = "是";
@@ -282,9 +282,9 @@ namespace Tps_LQ_Transmitter.models
                     {
                         PowerSumPrint.Result = "否";
                     }
-                    PowerFlatnessPrint.Test_name =  "功率不平度(dB)-" + CenterFreq.ToString() + "MHz";
+                    PowerFlatnessPrint.Test_name =  "功率不平度(dB)-" + parameters.CenterFreq.ToString() + "MHz";
                     PowerFlatnessPrint.Upper = PowerPara.PowerFlatnessUpper;
-                    PowerFlatnessPrint.TestVal = Math.Round(Math.Abs(dBTempPowerVal[0, point] - dBTempPowerVal[1, point]),2);//dB
+                    PowerFlatnessPrint.TestVal = Math.Round(Math.Abs(dBTempPowerVal[0, parameters.PointIndex] - dBTempPowerVal[1, parameters.PointIndex]),2);//dB
                     if ((PowerFlatnessPrint.TestVal >= PowerFlatnessPrint.Lower) && (PowerFlatnessPrint.TestVal <= PowerFlatnessPrint.Upper))
                     {
                         PowerFlatnessPrint.Result = "是";
@@ -296,16 +296,16 @@ namespace Tps_LQ_Transmitter.models
                    
                     tps.TestTableAddCell(PowerSumPrint.Test_name, PowerSumPrint.Lower.ToString(), "/", PowerSumPrint.TestVal.ToString(), PowerSumPrint.Result);
                     tps.TestTableAddCell(PowerFlatnessPrint.Test_name, PowerFlatnessPrint.Lower.ToString(), "/", PowerFlatnessPrint.TestVal.ToString(), PowerFlatnessPrint.Result);
-                   // WriteExcelData(sheet, point, 3, PowerSumPrint.Test_name, PowerSumPrint.Lower.ToString(), "/", PowerSumPrint.TestVal.ToString(), PowerSumPrint.Result);
-                   // WriteExcelData(sheet, point, 4, PowerFlatnessPrint.Test_name, PowerFlatnessPrint.Lower.ToString(), "/", PowerFlatnessPrint.TestVal.ToString(), PowerFlatnessPrint.Result);
-                    //tps.SetTestTableCellValue(point, 12, PowerSumPrint.Result, PowerSumPrint.TestVal);
-                    //tps.SetTestTableCellValue(point, 13, PowerFlatnessPrint.Result,PowerFlatnessPrint.TestVal);
+                   // WriteExcelData(sheet, parameters.PointIndex, 3, PowerSumPrint.Test_name, PowerSumPrint.Lower.ToString(), "/", PowerSumPrint.TestVal.ToString(), PowerSumPrint.Result);
+                   // WriteExcelData(sheet, parameters.PointIndex, 4, PowerFlatnessPrint.Test_name, PowerFlatnessPrint.Lower.ToString(), "/", PowerFlatnessPrint.TestVal.ToString(), PowerFlatnessPrint.Result);
+                    //tps.SetTestTableCellValue(parameters.PointIndex, 12, PowerSumPrint.Result, PowerSumPrint.TestVal);
+                    //tps.SetTestTableCellValue(parameters.PointIndex, 13, PowerFlatnessPrint.Result,PowerFlatnessPrint.TestVal);
 
                 }
                 #endregion
             }
-            SerialClient.DUT_Transmitter_Ctrol( 00, 00);//控制掉电
-            SerialClient.SerialClose();
+            //SerialClient.DUT_Transmitter_Ctrol( 00, 00);//控制掉电
+            //SerialClient.SerialClose();
             SaveExcel(workbook);
             return true;
         }

+ 36 - 37
tps/TpsLabStudio/models/PowerTest-PowerMeter.cs

@@ -37,42 +37,41 @@ namespace Tps_LQ_Transmitter.models
                 ShowMessage(MsgType.Error, "找不到" + tps.TestProject + "模板.xlsx");
                 return false;
             }
-            Thread.Sleep(1000);//让产品稳定
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            
+         //   TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             ConfigParameter PowerPara = new ConfigParameter();
 
-            MatchComPara CfigComParas = new MatchComPara();
-            CfigComParas = LoadComWorkBook();
+         //   MatchComPara CfigComParas = new MatchComPara();
+            //CfigComParas = LoadComWorkBook();
             
-            if (CfigComParas == null)
-            {
-                return false;
-            }
+            //if (CfigComParas == null)
+            //{
+            //    return false;
+            //}
 
-            byte FourthByte=0x00;
-            string ComPort = CfigComParas.GetComPort("1");
-            byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"),16);
-            PowerPara.StepFrequency = 0;
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-         //   PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+         //   byte FourthByte=0x00;
+         //   string ComPort = CfigComParas.GetComPort("1");
+         //   byte ThridByte = Convert.ToByte(CfigComParas.GetThirdByte("1"),16);
+         //   PowerPara.StepFrequency = 0;
+         //   PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+         //   PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
+         ////   PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+         //   PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
             
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+         //   PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.PowerLower = parameters.Parameters.GetParameter<double>("功率下限");
             PowerPara.PowerUpper = parameters.Parameters.GetParameter<double>("功率上限");
             PowerPara.PowerSumLower = parameters.Parameters.GetParameter<double>("两路功率总和下限");
             PowerPara.PowerFlatnessUpper = parameters.Parameters.GetParameter<double>("功率不平度上限");
-            if ((PowerPara.StartFrequency == 0) || (PowerPara.StopFrequency == 0)  || (PowerPara.PowerLower == 0) 
-                || (PowerPara.PowerUpper == 0) ||  (PowerPara.PowerSumLower == 0) || (PowerPara.PowerFlatnessUpper == 0))
+            if ( (PowerPara.PowerLower == 0) || (PowerPara.PowerUpper == 0) ||  (PowerPara.PowerSumLower == 0) || (PowerPara.PowerFlatnessUpper == 0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
             PowerMeter.Write("设置显示单位W", "1");
             //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
             //{
@@ -82,22 +81,22 @@ namespace Tps_LQ_Transmitter.models
             //{
             //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
             //}
-            double CenterFreq;
-            PowerPara.FrequencyNumber = CfigComParas.ComParameters.Count;
+            //double CenterFreq;
+           // PowerPara.FrequencyNumber = CfigComParas.ComParameters.Count;
 
-            for ( int point = 0;  point< PowerPara.FrequencyNumber; point++)
+            //for ( int point = 0;  point< PowerPara.FrequencyNumber; point++)
             {
-                FourthByte = Convert.ToByte(CfigComParas.GetFourthByte((point+1).ToString()), 16);
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * FourthByte;
-                if (CenterFreq > PowerPara.StopFrequency)
-                {
-                    break;
-                }
+                //FourthByte = Convert.ToByte(CfigComParas.GetFourthByte((point+1).ToString()), 16);
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * FourthByte;
+                //if (CenterFreq > PowerPara.StopFrequency)
+                //{
+                //    break;
+                //}
                 
-                SerialClient.DUT_Transmitter_Ctrol(ThridByte, FourthByte);
-                Thread.Sleep(PowerPara.ControlDelay);//单位ms
+                //SerialClient.DUT_Transmitter_Ctrol(ThridByte, FourthByte);
+                //Thread.Sleep(PowerPara.ControlDelay);//单位ms
                 string aa = PowerMeter.Query("Fetch测量功率", "1");
-                PowerPrint.Test_name = parameters.Channel + "-功率测试(W)-" + CenterFreq.ToString() + "MHz";
+                PowerPrint.Test_name = parameters.Channel + "-功率测试(W)-" + parameters.CenterFreq.ToString() + "MHz";
                 PowerPrint.Lower = PowerPara.PowerLower;
                 PowerPrint.Upper = PowerPara.PowerUpper;
                 PowerPrint.TestVal = Math.Round(double.Parse(aa), 2);//功率W
@@ -113,12 +112,12 @@ namespace Tps_LQ_Transmitter.models
                 if (parameters.Channel == "通道1")
                 {
 
-                    WriteExcelData(sheet, point, 1, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);            
+                    WriteExcelData(sheet, parameters.PointIndex, 1, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);            
                 }
                 else if (parameters.Channel == "通道2")
                 {
 
-                    WriteExcelData(sheet, point, 2, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);                 
+                    WriteExcelData(sheet, parameters.PointIndex, 2, PowerPrint.Test_name, "/", PowerPrint.Upper.ToString(), PowerPrint.TestVal.ToString(), PowerPrint.Result);                 
                 }
             }
             SaveExcel(workbook);

+ 35 - 37
tps/TpsLabStudio/models/SpuriousSuppression.cs

@@ -24,7 +24,7 @@ namespace Tps_LQ_Transmitter.models
             //获取仪器
             var SA = this.tps.GetDevice("频谱仪");
            
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            //TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             OutData Data = new OutData();
             DataType SpuriousSuppressionPrint = new DataType();
 
@@ -41,13 +41,13 @@ namespace Tps_LQ_Transmitter.models
             }
 
             ConfigParameter PowerPara = new ConfigParameter();
-            PowerPara.StepFrequency = 0;
-            PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
+            //PowerPara.StepFrequency = 0;
+            //PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
             PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
-            PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+            //PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+            //PowerPara.StepFrequency = parameters.Parameters.GetParameter<double>("频率步进");
+            //PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+            //PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
             PowerPara.LeftOffset = parameters.Parameters.GetParameter<double>("主频左侧终止偏移量");
             PowerPara.LeftOffsetStart = parameters.Parameters.GetParameter<double>("主频左侧起始偏移量");
             PowerPara.RightOffset = parameters.Parameters.GetParameter<int>("主频右侧起始偏移量");
@@ -57,21 +57,19 @@ namespace Tps_LQ_Transmitter.models
             PowerPara.SmallSignalREF = parameters.Parameters.GetParameter<string>("小信号参考电平(REF)");
             PowerPara.RBW = parameters.Parameters.GetParameter<string>("分辨率带宽(RBW)");
             PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.SpuriousSuppressionLower = parameters.Parameters.GetParameter<double>("杂波抑制下限");
-            if ((PowerPara.StartFrequency == 0) ||  (PowerPara.StopFrequency == 0) || (PowerPara.LeftOffset == 0) ||
-                (PowerPara.LeftOffsetStart == 0) || (PowerPara.RightOffset == 0) || (PowerPara.RightOffsetStop == 0)
-                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.SmallSignalREF == null) ||
-                (PowerPara.RBW == null) || (PowerPara.VBW == null) || 
-                (PowerPara.SpuriousSuppressionLower == 0))
+            if ( (PowerPara.LeftOffset == 0) || (PowerPara.LeftOffsetStart == 0) || (PowerPara.RightOffset == 0) || (PowerPara.RightOffsetStop == 0)
+                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.SmallSignalREF == null) ||  (PowerPara.RBW == null) || 
+                (PowerPara.VBW == null) || (PowerPara.SpuriousSuppressionLower == 0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
             if(true)//需具备仪器
             {
                 SA.Write("仪器复位"); SA.Query("OPC");
@@ -82,27 +80,27 @@ namespace Tps_LQ_Transmitter.models
             }
 
 
-            if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
-            {
-                PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
-            }
-            if (PowerPara.StepFrequency != 0)
-            {
-                PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
-            }
+            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //{
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //}
+            //if (PowerPara.StepFrequency != 0)
+            //{
+            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //}
 
-            double CenterFreq;
+            //double CenterFreq;
             double Power,PowerLeft, PowerRigth, Freq;
-            Data.SpuriousSuppression = new double[PowerPara.FrequencyNumber];
+            Data.SpuriousSuppression = new double[parameters.PointTotal];
             
-            for (int point = 0; ; point++)
+           // for (int point = 0; ; point++)
             {
                             
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                //if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                //{
+                //    break;
+                //}
                 if (true)//需具备仪器
                 {
                     // 控制
@@ -110,7 +108,7 @@ namespace Tps_LQ_Transmitter.models
                     Thread.Sleep(PowerPara.ControlDelay);//单位ms    
 
                     SA.Write("REF", PowerPara.REF); SA.Query("OPC");
-                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("CENTER", parameters.CenterFreq.ToString()); SA.Query("OPC");
                     PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
                     Freq=x_value/1000000;
                     Power = y_value;
@@ -127,7 +125,7 @@ namespace Tps_LQ_Transmitter.models
                     PowerRigth = Power - y_value;
 
                 }
-                SpuriousSuppressionPrint.Test_name = parameters.Channel + "-杂波抑制测试-" + CenterFreq.ToString() + "MHz";
+                SpuriousSuppressionPrint.Test_name = parameters.Channel + "-杂波抑制测试-" + parameters.CenterFreq.ToString() + "MHz";
                 SpuriousSuppressionPrint.Lower = PowerPara.SpuriousSuppressionLower;
                 SpuriousSuppressionPrint.TestVal = Math.Round(Math.Min(PowerLeft, PowerRigth), 2);
                // SpuriousSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
@@ -144,13 +142,13 @@ namespace Tps_LQ_Transmitter.models
                 {
                     
                     //tps.SetTestTableCellValue(point, 14, SpuriousSuppressionPrint.Result,SpuriousSuppressionPrint.TestVal);    
-                    WriteExcelData(sheet, point, 1, SpuriousSuppressionPrint.Test_name, SpuriousSuppressionPrint.Lower.ToString(),"/", SpuriousSuppressionPrint.TestVal.ToString(), SpuriousSuppressionPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 1, SpuriousSuppressionPrint.Test_name, SpuriousSuppressionPrint.Lower.ToString(),"/", SpuriousSuppressionPrint.TestVal.ToString(), SpuriousSuppressionPrint.Result);
                 }
                 else if (parameters.Channel == "通道2")
                 {
                   
                     //tps.SetTestTableCellValue(point + 15, 14, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);           
-                    WriteExcelData(sheet, point, 2, SpuriousSuppressionPrint.Test_name, SpuriousSuppressionPrint.Lower.ToString(), "/", SpuriousSuppressionPrint.TestVal.ToString(), SpuriousSuppressionPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 2, SpuriousSuppressionPrint.Test_name, SpuriousSuppressionPrint.Lower.ToString(), "/", SpuriousSuppressionPrint.TestVal.ToString(), SpuriousSuppressionPrint.Result);
                 }
             }
             SaveExcel(workbook);

+ 39 - 40
tps/TpsLabStudio/models/VoltAndCurrent.cs

@@ -19,7 +19,7 @@ namespace Tps_LQ_Transmitter.models
             TemplateName = "电压及电流测试";
         }
         /// <summary>
-        /// 功率及频率稳定度测试
+        /// 电压电流测试
         /// </summary>
         public override bool Run(TestNode parameters)
         {
@@ -31,7 +31,7 @@ namespace Tps_LQ_Transmitter.models
           
             CommonVisaResource DCPower = new CommonVisaResource();
             DCPower.Open(tps.DCPowerAddress);
-            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+           // TransmitterSerialPort SerialClient = new TransmitterSerialPort();
             OutData Data = new OutData();
 
             DataType VoltDataPrint = new DataType();
@@ -56,60 +56,59 @@ namespace Tps_LQ_Transmitter.models
 
             ConfigParameter PowerPara = new ConfigParameter();
             PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
-            PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
-            PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
-            PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
+            //PowerPara.StartFrequency = parameters.Parameters.GetParameter<double>("起始频率");
+            //PowerPara.FrequencyNumber = parameters.Parameters.GetParameter<int>("频点数量");
+            //PowerPara.StopFrequency = parameters.Parameters.GetParameter<double>("终止频率");
          
-            PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
+            //PowerPara.ControlDelay = parameters.Parameters.GetParameter<int>("控制延时");
             PowerPara.VoltLower = parameters.Parameters.GetParameter<double>("电压下限");
             PowerPara.VoltUpper= parameters.Parameters.GetParameter<double>("电压上限");
             PowerPara.CurrentLower = parameters.Parameters.GetParameter<double>("电流下限");
             PowerPara.CurrentUpper = parameters.Parameters.GetParameter<double>("电流上限");
-            if ((PowerPara.StartFrequency == 0) || (PowerPara.StopFrequency == 0)|| (PowerPara.VoltLower==0) 
-                || (PowerPara.VoltUpper == 0) ||(PowerPara.CurrentLower==0) ||(PowerPara.CurrentUpper==0))
+            if ((PowerPara.VoltLower==0) || (PowerPara.VoltUpper == 0) ||(PowerPara.CurrentLower==0) ||(PowerPara.CurrentUpper==0))
             {
                 ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
                 return false;
             }
-            if (PowerPara.ControlDelay == 0)
-            {
-                PowerPara.ControlDelay = 10;
-            }
+            //if (PowerPara.ControlDelay == 0)
+            //{
+            //    PowerPara.ControlDelay = 10;
+            //}
 
 
-            if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
-            {
-                PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
-            }
-            if (PowerPara.StepFrequency != 0)
-            {
-                PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
-            }
-            double CenterFreq;
-            Data.VoltVal = new string[PowerPara.FrequencyNumber];
-            Data.CurrentVal = new string[PowerPara.FrequencyNumber];
-            for (int point = 0; ; point++)
+            //if ((PowerPara.FrequencyNumber != 0) && (PowerPara.FrequencyNumber != 1) && (PowerPara.StepFrequency == 0))
+            //{
+            //    PowerPara.StepFrequency = ((int)(((PowerPara.StopFrequency - PowerPara.StartFrequency) / (PowerPara.FrequencyNumber - 1)) * 100)) / 100;
+            //}
+            //if (PowerPara.StepFrequency != 0)
+            //{
+            //    PowerPara.FrequencyNumber = ((int)((PowerPara.StopFrequency - PowerPara.StartFrequency) / PowerPara.StepFrequency)) + 1;
+            //}
+            //double CenterFreq;
+            Data.VoltVal = new string[parameters.PointTotal];
+            Data.CurrentVal = new string[parameters.PointTotal];
+        //    for (int point = 0; ; point++)
             {
 
-                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
-                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
-                {
-                    break;
-                }
+                //CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                //if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                //{
+                //    break;
+                //}
                 Thread.Sleep(1000);
                 //控制
          //       SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
-                Thread.Sleep(PowerPara.ControlDelay);//单位ms
+               
                 
-                Data.VoltVal[point] = DCPower.Query("MEASure:VOLTage?\n");
+                Data.VoltVal[parameters.PointIndex] = DCPower.Query("MEASure:VOLTage?\n");
            
-                Data.CurrentVal[point] = DCPower.Query("MEASure:CURRent?\n");
+                Data.CurrentVal[parameters.PointIndex] = DCPower.Query("MEASure:CURRent?\n");
                 
 
-                VoltDataPrint.Test_name = parameters.Channel + "-电压测试-" + CenterFreq.ToString()+"MHz";
+                VoltDataPrint.Test_name = parameters.Channel + "-电压测试-" + parameters.CenterFreq.ToString()+"MHz";
                 VoltDataPrint.Lower = PowerPara.VoltLower;
                 VoltDataPrint.Upper = PowerPara.VoltUpper;
-                VoltDataPrint.TestVal = double.Parse(Data.VoltVal[point]);
+                VoltDataPrint.TestVal = double.Parse(Data.VoltVal[parameters.PointIndex]);
                 //VoltDataPrint.TestVal = random.Next(2500, 3000) / 100.0;//随机数
                 if ((VoltDataPrint.TestVal >= VoltDataPrint.Lower) && (VoltDataPrint.TestVal <= VoltDataPrint.Upper))
                 {
@@ -120,10 +119,10 @@ namespace Tps_LQ_Transmitter.models
                     VoltDataPrint.Result = "否";
                 }
 
-                CurrentDataPrint.Test_name = parameters.Channel + "-电流测试-" + CenterFreq.ToString() + "MHz";
+                CurrentDataPrint.Test_name = parameters.Channel + "-电流测试-" + parameters.CenterFreq.ToString() + "MHz";
                 CurrentDataPrint.Lower = PowerPara.CurrentLower;
                 CurrentDataPrint.Upper = PowerPara.CurrentUpper;
-                CurrentDataPrint.TestVal = double.Parse(Data.CurrentVal[point]);
+                CurrentDataPrint.TestVal = double.Parse(Data.CurrentVal[parameters.PointIndex]);
                 //CurrentDataPrint.TestVal = random.Next(90, 160) / 100.0;
                 if ((CurrentDataPrint.TestVal >= CurrentDataPrint.Lower) && (CurrentDataPrint.TestVal <= CurrentDataPrint.Upper))
                 {
@@ -141,16 +140,16 @@ namespace Tps_LQ_Transmitter.models
                 {
                    
 
-                    WriteExcelData(sheet, point, 3, CurrentDataPrint.Test_name, CurrentDataPrint.Lower.ToString(), CurrentDataPrint.Upper.ToString(), CurrentDataPrint.TestVal.ToString(), CurrentDataPrint.Result);
-                    WriteExcelData(sheet, point, 1, VoltDataPrint.Test_name, VoltDataPrint.Lower.ToString(), VoltDataPrint.Upper.ToString(), VoltDataPrint.TestVal.ToString(), VoltDataPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 3, CurrentDataPrint.Test_name, CurrentDataPrint.Lower.ToString(), CurrentDataPrint.Upper.ToString(), CurrentDataPrint.TestVal.ToString(), CurrentDataPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 1, VoltDataPrint.Test_name, VoltDataPrint.Lower.ToString(), VoltDataPrint.Upper.ToString(), VoltDataPrint.TestVal.ToString(), VoltDataPrint.Result);
                     //tps.SetTestTableCellValue(point, 5, VoltDataPrint.Result, VoltDataPrint.TestVal);
                     //tps.SetTestTableCellValue(point, 6, CurrentDataPrint.Result, CurrentDataPrint.TestVal);
                 }
                 else if (parameters.Channel == "通道2")
                 {
                     
-                    WriteExcelData(sheet, point, 4, CurrentDataPrint.Test_name, CurrentDataPrint.Lower.ToString(), CurrentDataPrint.Upper.ToString(), CurrentDataPrint.TestVal.ToString(), CurrentDataPrint.Result);
-                    WriteExcelData(sheet, point, 2, VoltDataPrint.Test_name, VoltDataPrint.Lower.ToString(), VoltDataPrint.Upper.ToString(), VoltDataPrint.TestVal.ToString(), VoltDataPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 4, CurrentDataPrint.Test_name, CurrentDataPrint.Lower.ToString(), CurrentDataPrint.Upper.ToString(), CurrentDataPrint.TestVal.ToString(), CurrentDataPrint.Result);
+                    WriteExcelData(sheet, parameters.PointIndex, 2, VoltDataPrint.Test_name, VoltDataPrint.Lower.ToString(), VoltDataPrint.Upper.ToString(), VoltDataPrint.TestVal.ToString(), VoltDataPrint.Result);
                     //tps.SetTestTableCellValue(point + 15, 5, VoltDataPrint.Result, VoltDataPrint.TestVal);
                     //tps.SetTestTableCellValue(point + 15, 6, CurrentDataPrint.Result, CurrentDataPrint.TestVal);
                 }