Ver código fonte

发射机测试功能完成,经讨论后,软件测试平台还存在一些问题,待优化。

ceac_pqy@163.com 3 anos atrás
pai
commit
6deeb7120f
31 arquivos alterados com 4173 adições e 157 exclusões
  1. 3 2
      exe/JGWorks.exe.config
  2. 455 17
      exe/apps/DevicesApp/commands/程控命令.xml
  3. BIN
      exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.dll
  4. BIN
      exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.pdb
  5. 2 2
      exe/apps/Tps_LQ_Transmitter/bundle.config
  6. BIN
      exe/apps/Tps_LQ_Transmitter/config/ModulationMode.xlsx
  7. BIN
      exe/apps/Tps_LQ_Transmitter/config/测试#常温检查#发射机.xlsx
  8. BIN
      exe/apps/Tps_LQ_Transmitter/config/测试#常温测试#发射机.xlsx
  9. 663 0
      exe/logs/202108.log
  10. BIN
      tps/TpsLabStudio/.vs/TpsLabStudio/v16/.suo
  11. 56 33
      tps/TpsLabStudio/FrmMain.cs
  12. 29 8
      tps/TpsLabStudio/MainTps.cs
  13. 15 3
      tps/TpsLabStudio/TpsLabStudio.csproj
  14. 1 1
      tps/TpsLabStudio/TpsLabStudio.csproj.user
  15. 2 2
      tps/TpsLabStudio/bundle.config
  16. 51 0
      tps/TpsLabStudio/com/SerialPort.cs
  17. BIN
      tps/TpsLabStudio/config/ModulationMode.xlsx
  18. BIN
      tps/TpsLabStudio/config/测试#常温检查#发射机.xlsx
  19. 0 0
      tps/TpsLabStudio/config/测试#常温测试#原.xlsx
  20. BIN
      tps/TpsLabStudio/config/测试#常温测试#发射机.xlsx
  21. BIN
      tps/TpsLabStudio/config/测试#常温测试#发射机测试.xlsx
  22. 0 68
      tps/TpsLabStudio/models/GainTestModel.cs
  23. 264 4
      tps/TpsLabStudio/models/HarmonicSuppression.cs
  24. 438 0
      tps/TpsLabStudio/models/ModulationIndexAndMaxFreqOffset.cs
  25. 234 0
      tps/TpsLabStudio/models/NoisePowerDensity.cs
  26. 798 0
      tps/TpsLabStudio/models/NormalTemperatureTest.cs
  27. 289 0
      tps/TpsLabStudio/models/PhaseNoise.cs
  28. 375 0
      tps/TpsLabStudio/models/PowerAndFreqStability.cs
  29. 253 17
      tps/TpsLabStudio/models/SpuriousSuppression.cs
  30. 245 0
      tps/TpsLabStudio/models/VoltAndCurrent.cs
  31. BIN
      tps/TpsLabStudio/obj/Debug/TpsLabStudio.csprojAssemblyReference.cache

+ 3 - 2
exe/JGWorks.exe.config

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <configSections>
     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
@@ -27,7 +27,8 @@
   <!--configSections配置节一定要在connectionStrings节之前,为了保险,我把它放在最后了。
 其中,连接字符串是后来加上的。到这一步已经可以正常访问了-->
   <connectionStrings>
-    <add name="localdb" connectionString="Data Source=localhost\SQLEXPRESS;Database=autotestdata;User ID=mskjpt;Password=Pmskjpt2020;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
+    <!--<add name="localdb" connectionString="Data Source=localhost\SQLEXPRESS;Database=autotestdata;User ID=mskjpt;Password=Pmskjpt2020;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />-->
+    <add name="localdb" connectionString="Data Source=127.0.0.1;port=3306;database=bladex_boot;user id=tester;password=tester12345;" providerName="MySql.Data.MySqlClient" />
     <add name="serverdb" connectionString="Data Source=132.232.11.90;port=3306;database=bladex_boot;user id=root;password=ds3342Jg*df;" providerName="MySql.Data.MySqlClient" />
     <!--<add name="serverdb" connectionString="Data Source=111.230.41.196;port=15589;database=autotestdata;user id=mskjpt;password=Pmskjpt2020;" providerName="MySql.Data.MySqlClient" />-->
     <!--<add name="serverdb" connectionString="Data Source=111.230.41.196;port=15589;database=bladex_boot;user id=mskjpt;password=Pmskjpt2020;" providerName="MySql.Data.MySqlClient" />-->

+ 455 - 17
exe/apps/DevicesApp/commands/程控命令.xml

@@ -3,13 +3,14 @@
   <Devices>
     <DeviceCommand DeviceType="信号源">
       <Models>
-        <string>ESG-D3000B</string>
+        <string>ESG-D4000B</string>
         <string>ESG-3000B</string>
         <string>E4421B</string>
-        <string>E4432B</string>
+        <string>E4433B</string>
       </Models>
       <Commands>
         <Command Key="仪器复位" Value=":SYSTem:PRESet" Description="{0}频率,单位MHz"/>
+        <Command Key="OPC" Value="*OPC?"/>
         <Command Key="设置频率" Value=":FREQ:CW {0} MHz" Description="{0}频率,单位MHz"/>
         <Command Key="设置功率" Value=":POW:AMPL {0} dBm" Description="{0}频率,单位MHz"/>
         <Command Key="射频开关开" Value=":OUTP:STAT ON" Description="单位V"/>
@@ -20,10 +21,74 @@
         <Command Key="Step扫描点数" Value=":SWEep:POINts {0}" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="单次扫描" Value=":INITiate" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="单次扫描模式" Value=":INITiate:CONTinuous OFF" Description="{0}电压值,单位V,CV模式下"/>
-        <Command Key="开启Sweep扫频" Value=":FREQuency:MODE LIST" Description="{0}电压值,单位V,CV模式下"/>
-        <Command Key="关闭Sweep扫频" Value=":FREQuency:MODE CW" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="开启Sweep扫频" Value=":FREQuency:MODE LIST" Description="电压值,单位V,CV模式下"/>
+        <Command Key="关闭Sweep扫频" Value=":FREQuency:MODE CW" Description="电压值,单位V,CV模式下"/>
         <Command Key="扫描起始频率" Value=":FREQuency:STARt {0} MHz" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="扫描终止频率" Value=":FREQuency:Stop {0} MHz" Description="{0}电压值,单位V,CV模式下"/>
+       <Command Key="连续扫描模式" Value=":INITiate:CONTinuous ON" Description="{0}电压值,单位V,CV模式下"/>
+      </Commands>
+    </DeviceCommand>
+	
+	<DeviceCommand DeviceType="函数发生器">
+      <Models>
+        <string>33210A</string>
+      </Models>
+      <Commands>
+        <Command Key="仪器复位" Value="*RST" Description="仪器复位"/>
+		<Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+		<Command Key="定义函数" Value="APPLy:{0} {1}, {2}, {3}" Description="选择函数、频率、振幅、偏移,example:APPL:SIN 5 KHZ, 3.0 VPP, -2.5 V"/>
+		<Command Key="设置波形" Value="FUNCtion {0}" Description="设置波形,{0} SINusoid|SQUare|RAMP|PULSe|NOISe|DC|USER"/>
+		<Command Key="设置频率" Value="FREQuency {0} MHz" Description="设置频率,{0}  频率|MINimum|MAXimum,单位MHz"/>
+		<Command Key="设置振幅" Value="VOLTage {0}" Description="设置振幅,{0} 振幅|MINimum|MAXimum,单位V"/>
+        <Command Key="设置偏移" Value="VOLTage:OFFSet {0}" Description="设置偏移,{0} 偏移|MINimum|MAXimum,单位V"/>
+		<Command Key="设置高电平" Value="VOLTage:HIGH {0}" Description="设置高电平,{0} 电压|MINimum|MAXimum,单位V"/>
+		<Command Key="设置低电平" Value="VOLTage:LOW {0}" Description="设置低电平,{0} 电压|MINimum|MAXimum,单位V"/>
+		<Command Key="设置振幅单位" Value="VOLTage:UNIT {0}" Description="设置振幅单位,{0} VPP|VRMS|DBM"/>
+		<Command Key="设置脉冲的占空比" Value="FUNCtion:SQUare:DCYCle {0}" Description="设置振幅单位,{0} 百分比|MINimum|MAXimum"/>
+		<Command Key="输出开" Value="OUTPut ON" Description="输出开"/>
+		<Command Key="输出关" Value="OUTPut OFF" Description="输出关"/>
+		<Command Key="波形极性" Value="OUTPut:POLarity {0}" Description="相对于偏移电压将波形是否反向,{0} NORMal|INVerted"/>
+		<Command Key="打开同步信号" Value="OUTPut:SYNC ON" Description="打开同步信号"/>
+		<Command Key="关闭同步信号" Value="OUTPut:SYNC OFF" Description="关闭同步信号"/>
+		
+		<Command Key="设置脉冲周期" Value="PULSe:PERiod {0}" Description="设置脉冲周期,{0} < 秒 >|MINimum|MAXimum"/>
+		<Command Key="脉冲宽度配置模式" Value="FUNCtion:PULSe:HOLD {0}" Description="设置函数发生器以保持脉冲宽度或脉冲占空比,{0} WIDTh|DCYCle"/>
+		<Command Key="设置脉冲宽度" Value="FUNCtion:PULSe:WIDTh {0}" Description="设置脉冲宽度,{0} < 秒 >|MINimum|MAXimum"/>
+		<Command Key="设置脉冲占空比" Value="FUNCtion:PULSe:DCYCle {0}" Description="设置脉冲占空比,{0} < 百分比 >|MINimum|MAXimum"/>
+		<Command Key="设置边沿时间" Value="FUNCtion:PULSe:TRANsition {0}" Description="设置上升沿和下降沿的边沿时间,{0} < 秒 >|MINimum|MAXimum"/>
+		
+		<Command Key="AM调制波形" Value="AM:INTernal {0}" Description="选择AM调制波形仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="AM调制频率" Value="AM:INTernal:FREQuency {0}" Description="设置AM调制波形频率仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="AM调制源" Value="AM:SOURce {0}" Description="选择AM调制源内部或外部,{0} INTernal|EXTernal"/>
+		<Command Key="AM调制开" Value="AM:STATe ON" Description="AM调制开"/>
+		<Command Key="AM调制关" Value="AM:STATe OFF" Description="AM调制关"/>
+		
+		<Command Key="FM调制波形" Value="FM:INTernal {0}" Description="选择FM调制波形仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="FM调制频率" Value="FM:INTernal:FREQuency {0}" Description="设置FM调制波形频率仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="FM调制源" Value="FM:SOURce {0}" Description="选择FM调制源内部或外部,{0} INTernal|EXTernal"/>
+		<Command Key="FM调制开" Value="FM:STATe ON" Description="FM调制开"/>
+		<Command Key="FM调制关" Value="FM:STATe OFF" Description="FM调制关"/>
+		
+		<Command Key="PWM调制波形" Value="PWM:INTernal {0}" Description="选择PWM调制波形仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="PWM调制频率" Value="PWM:INTernal:FREQuency {0}" Description="设置PWM调制波形频率仅在内部源时使用,{0} SINusoid|SQUare|RAMP|NRAMp|TRIangle|NOISe|USER"/>
+		<Command Key="PWM调制占空比" Value="PWM:DEViation:DCYCle {0}" Description="PWM调制占空比,{0} < 偏差,百分比 >|MINimum|MAXimum"/>
+		<Command Key="PWM调制源" Value="PWM:SOURce {0}" Description="选择PWM调制源内部或外部,{0} INTernal|EXTernal"/>
+		<Command Key="PWM调制开" Value="PWM:STATe ON" Description="PWM调制开"/>
+		<Command Key="PWM调制关" Value="PWM:STATe OFF" Description="PWM调制关"/>
+		
+		<Command Key="设置起始频率" Value="FREQuency:STARt {0} MHz" Description="设置起始频率 {0} < 频率 >|MINimum|MAXimum,单位MHz"/>
+		<Command Key="设置停止频率" Value="FREQuency:STOP {0} MHz" Description="设置停止频率 {0} < 频率 >|MINimum|MAXimum,单位MHz"/>
+		<Command Key="设置中心频率" Value="FREQuency:CENTer {0} MHz" Description="设置中心频率 {0} < 频率 >|MINimum|MAXimum,单位MHz"/>
+		<Command Key="设置频率跨距" Value="FREQuency:SPAN {0} MHz" Description="设置频率跨距 {0} < 频率 >|MINimum|MAXimum,单位MHz"/>
+		
+		<Command Key="设置扫描间隔模式" Value="SWEep:SPACing {0}" Description="设置扫描间隔模式 {0} LINear|LOGarithmic"/>		
+		<Command Key="读扫描时间" Value="SWEep:TIME?" Description="从起始频率到停止频率进行扫描所需的秒数。 ,MINimum|MAXimum"/>
+		<Command Key="扫描模式开" Value="SWEep:STATe ON" Description="扫描模式开"/>
+		<Command Key="扫描模式关" Value="SWEep:STATe OFF" Description="扫描模式关"/>
+		<Command Key="置边沿触发模式" Value="OUTPut:TRIGger:SLOPe {0}" Description="设置边沿触发模式 {0} POSitive|NEGative"/>
+		<Command Key="触发开" Value="OUTPut:TRIGger ON" Description="触发开"/>
+		<Command Key="触发关" Value="OUTPut:TRIGger OFF" Description="触发关"/>		
       </Commands>
     </DeviceCommand>
 
@@ -45,8 +110,8 @@
         <Command Key="SweepPoint" Value=":SWEep:POINts {0}" Description="单位A"/>
         <Command Key="ContinuousMeasState" Value="INIT:CONT {0}" Description="单位A"/>
         <Command Key="CalState" Value="DISP:DATA:CORR {0}" Description="单位A"/>
-        <Command Key="StoreStateFile" Value="MMEM:STOR:STAT 1, \'{0}\'" Description="单位A"/>
-        <Command Key="LoadStateFile" Value="MMEM:STOR:STAT 1, \'{0}\'" Description="单位A"/>
+        <Command Key="StoreStateFile" Value="MMEM:STOR:STAT 1, '{0}'" Description="单位A"/>
+        <Command Key="LoadStateFile" Value="MMEM:LOAD:STAT 1, '{0}'" Description="单位A"/>
         <Command Key="Measure" Value="INIT" Description="单位A"/>
         <Command Key="OPC" Value="*OPC?" Description="方法研究"/>
 
@@ -69,25 +134,24 @@
         <Command Key="获取DUT前端补偿表" Value=":CORRection:LOSS:BEFore:TABLe:DATA?" Description="{0}数据以‘,’号分格"/>
         <Command Key="DUT后端热力学温度" Value=":CORR:TEMP:AFT {0}" Description="{0}数据以‘,’号分格"/>
         <Command Key="DUT前端热力学温度" Value=":CORR:TEMP:BEF {0}" Description="{0}数据以‘,’号分格"/>
-
-
-
       </Commands>
     </DeviceCommand>
 
     <DeviceCommand DeviceType="频谱仪">
       <Models>
-        <!--<string>N9020A</string>-->
         <string>E4440A</string>
       </Models>
       <Commands>
         <Command Key="仪器复位" Value=":SYSTem:PRESet" Description="{0}频率,单位MHz"/>
+        <Command Key="OPC" Value="*OPC?"/>
         <Command Key="START" Value=":SENS:FREQ:STAR {0} MHz" Description="{0}频率,单位MHz"/>
         <Command Key="STOP" Value=":SENS:FREQ:STOP {0} MHz" Description="{0}频率,单位MHz"/>
         <Command Key="CENTER" Value=":SENS:FREQ:CENT {0} MHz" Description="{0}频率,单位MHz"/>
         <Command Key="SPAN" Value=":SENS:FREQ:SPAN {0} MHz" Description="{0}频率,单位MHz"/>
         <Command Key="REF" Value=":DISP:WIND:TRAC:Y:SCAL:RLEV {0} dBm" Description="单位V"/>
-        <Command Key="RBW" Value="???" Description="单位A"/>
+        <Command Key="RBW" Value="BAND {0}" Description="单位A"/>
+        <Command Key="ReturnRBW" Value="BAND?" Description="单位A"/>
+        <Command Key="RBWAUTO" Value="BWID:AUTO ON" Description="单位A"/>
         <Command Key="VBW" Value=":BWIDth:VID {0}" Description="{0}电流值,单位A,CC模式下"/>
         <Command Key="VBWAUTO" Value=":BWIDth:VID:AUTO 1" Description="{0}电流值,单位A,CC模式下"/>
         <Command Key="PEAK" Value=":CALC:MARK{0}:MAX" Description="{0}电压值,单位V,CV模式下"/>
@@ -105,12 +169,346 @@
         <Command Key="噪声模式" Value=":CALC:MARK:FUNC NOIS" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="关闭频谱仪自检" Value=":CALibration:AUTO OFF" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="AVER_ON" Value=":AVERage ON" Description="{0}电压值,单位V,CV模式下"/>
-        <Command Key="AVER_OFF" Value=":AVERage ON" Description="{0}电压值,单位V,CV模式下"/>
-        <Command Key="AVERCounts" Value=":AVERage COUNt {0}" Description="{0}电压值,单位V,CV模式下"/>
+         <Command Key="AVER_OFF" Value=":AVERage OFF" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="AVERCounts" Value=":AVERage:COUNt {0}" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="DCmode" Value=":INPut:COUPling DC" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="ACmode" Value=":INPut:COUPling AC" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="StoreStateFile" Value="MMEM:STOR:STAT 1, '{0}'" Description="单位A"/>
+        <Command Key="LoadStateFile" Value="MMEM:LOAD:STAT 1, '{0}'" Description="单位A"/>
+        <Command Key="SetSAMode" Value=":INST SA" Description="单位A"/>
+        <Command Key="SingleOrCont" Value=":INITiate:CONTinuous {0}" Description="单位A"/>
+        <Command Key="ATT" Value=":POW:ATT {0}" Description="单位A"/>
+        
+        <Command Key="单次扫描" Value=":INITiate:IMMediate" Description="单位A"/>
+        <Command Key="测试点数读取" Value=":SENSe:SWEep:POInts?" Description="单位A"/>
+        <Command Key="测试点数" Value=":SENSe:SWEep:POInts {0}" Description="单位A"/>
+
+        <Command Key="DUT后端补偿状态" Value="CORR:LOSS:AFT:STAT {0}" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="DUT前端补偿状态" Value="CORR:LOSS:BEF:STAT {0}" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="DUT后端补偿表模式" Value=":CORRection:LOSS:AFTer:MODE TABLe" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="DUT前端补偿表模式" Value=":CORRection:LOSS:BEFore:MODE TABLe" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="DUT后端补偿表" Value=":CORRection:LOSS:AFTer:TABLe:DATA {0}" Description="{0}数据以‘,’号分格"/>
+        <Command Key="DUT前端补偿表" Value=":CORRection:LOSS:BEFore:TABLe:DATA {0}" Description="{0}数据以‘,’号分格"/>
+        <Command Key="获取DUT后端补偿表" Value=":CORRection:LOSS:AFTer:TABLe:DATA?" Description="{0}数据以‘,’号分格"/>
+        <Command Key="获取DUT前端补偿表" Value=":CORRection:LOSS:BEFore:TABLe:DATA?" Description="{0}数据以‘,’号分格"/>
+        <Command Key="DUT后端热力学温度" Value=":CORR:TEMP:AFT {0}" Description="{0}数据以‘,’号分格"/>
+        <Command Key="DUT前端热力学温度" Value=":CORR:TEMP:BEF {0}" Description="{0}数据以‘,’号分格"/>
+        <Command Key="噪声系数测试" Value=":INIT:IMM" Description="单位A"/>
+
+
+        <Command Key="相位噪声测试模式" Value="INSTrument PNOISE" Description="单位A"/>
+        <Command Key="相位噪声测试" Value="FREQ:CARR:SEAR" Description="单位A"/>
+        <Command Key="相位噪声载波频率设置" Value=":FREQ:CARR {0} MHz" Description="单位A"/>
+        <Command Key="相位噪声关闭平均" Value=":LPL:AVER OFF" Description="单位A"/>
+        <Command Key="相位噪声打开MarkTable" Value="CALC:LPL:MARK:TABL 1" Description="单位A"/>
+        <Command Key="读Mark相位噪声值" Value=":CALC:LPLot:MARK{0}:Y?" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="设置Mark频率Hz" Value="CALC:LPL:MARK{0}:X {1}"/>
+
+        <Command Key="相位噪声startOffset" Value="LPL:FREQ:OFFS:STAR {0}" Description="单位A"/>
+        <Command Key="相位噪声stopOffset" Value="LPL:FREQ:OFFS:STOP {0}" Description="单位A"/>
+        
+        
+      </Commands>
+    </DeviceCommand>
+    
+	
+	<DeviceCommand DeviceType="频谱仪">
+      <Models>
+		<string>N9020A</string>
+        <string>N9030A</string>
+      </Models>
+      <Commands>
+	    <Command Key="仪器复位" Value="*RST" Description="复位"/>
+        <Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+        <Command Key="单次扫描" Value=":INITiate:IMMediate" Description="单位A"/>
+		
+        <Command Key="START" Value=":SENS:FREQ:STAR {0} MHz" Description="{0}频率,单位MHz"/>
+		<Command Key="读起始频率" Value=":SENS:FREQ:STAR?" Description="单位Hz"/>      
+        <Command Key="STOP" Value=":SENS:FREQ:STOP {0} MHz" Description="{0}频率,单位MHz"/>
+		<Command Key="读截止频率" Value=":SENS:FREQ:STOP?" Description="单位Hz"/>
+        <Command Key="CENTER" Value=":SENS:FREQ:CENT {0} MHz" Description="{0}频率,单位MHz"/>
+        <Command Key="SPAN" Value=":SENS:FREQ:SPAN {0} MHz" Description="{0}频率,单位MHz"/>
+        <Command Key="REF" Value=":DISP:WIND:TRAC:Y:SCAL:RLEV {0} dBm" Description="{0}参考功率,单位dBm"/>
+		<Command Key="OFFSET" Value=":DISP:WIND:TRAC:Y:SCAL:RLEV:OFFSet {0} dBm" Description="{0}功率补偿,单位dBm"/>
+		<Command Key="ATT" Value=":POW:ATT {0}" Description="设置衰减,单位dB"/>
+        <Command Key="RBW" Value=":BWIDth {0}" Description="设置分辨率带宽,{0}RBW 单位Hz"/>
+		<Command Key="RBWAUTO" Value=":BWIDth:AUTO 1" Description="设置分辨率带宽自动"/>
+        <Command Key="VBW" Value=":BWIDth:VID {0}" Description="设置视频带宽,{0}VBW,单位Hz"/>
+        <Command Key="VBWAUTO" Value=":BWIDth:VID:AUTO 1" Description="设置视频带宽自动"/>
+		
+        <Command Key="PEAK" Value=":CALC:MARK{0}:MAX" Description="标记峰值,{0}MARK点"/>
+		<Command Key="NextPeak" Value=":CALC:MARK{0}:MAX:NEXT" Description="标记次峰值,{0}MARK点"/>
+		<Command Key="NextPeakLeft" Value=":CALC:MARK{0}:MAX:LEFT" Description="标记左峰值,{0}MARK点"/>
+		<Command Key="NextPeakRight" Value=":CALC:MARK{0}:MAX:RIGHT" Description="标记右峰值,{0}MARK点"/>
+		
+        <Command Key="MARK打开" Value=":CALC:MARK{0}:STAT ON" Description="打开MARK,{0}MARK点"/>
+        <Command Key="读MARK功率" Value=":CALC:MARK{0}:Y?" Description="读MARK功率,{0}MARK点"/>
+        <Command Key="读MARK频率" Value=":CALC:MARK{0}:X?" Description="读MARK频率,{0}MARK点"/>
+		<Command Key="DELT打开" Value=":CALCulate:MARKer{0} DELTa" Description="打开DELT,{0}}MARK点"/>
+        <Command Key="设置MARK频率" Value=":CALC:MARK{0}:X {1} MHz" Description="设置MARK频率,{0} MARK点,{1} 频率,单位MHz"/>
+        <Command Key="设置MARK为NOISe" Value=":CALCulate:MARKer{0}:FUNCtion NOISe" Description="设置MARK为NOISe,{0} MARK点"/>
+        <Command Key="设置MARK为常规" Value=":CALCulate:MARKer{0}:FUNCtion OFF" Description="设置MARK为常规,{0} MARK点"/>
+		<Command Key="SingleOrCont" Value=":INITiate:CONTinuous {0}" Description="设置触发模式,{0} 0|1"/>
+        <Command Key="读曲线" Value="TRACe? TRACE1" Description="读曲线"/>
+		
+        <Command Key="SetSAMode" Value=":INSTrument SA" Description="SetSAMode"/>
+        <Command Key="相位噪声测试模式" Value=":INSTrument PNOISE" Description="相位噪声测试模式"/>
+		<Command Key="相位噪声测试" Value="FREQ:CARR:SEAR" Description="单位A"/>
+        <Command Key="相位噪声载波频率设置" Value=":FREQ:CARR {0} MHz" Description="单位A"/>
+        <Command Key="相位噪声关闭平均" Value=":LPL:AVER OFF" Description="单位A"/>
+        <Command Key="相位噪声打开MarkTable" Value="CALC:LPL:MARK:TABL 1" Description="单位A"/>
+        <Command Key="读Mark相位噪声值" Value=":CALC:LPLot:MARK{0}:Y?" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="设置Mark频率Hz" Value="CALC:LPL:MARK{0}:X {1}"/>
+		
+		<Command Key="测试点数" Value=":SWEep:POINts {0}" Description="设置扫描点,{0} integer扫描点"/>
+		<Command Key="测试点数读取" Value=":SWEep:POINts?" Description="查询扫描点"/>
+		
+      </Commands>
+    </DeviceCommand>
+	
+	<DeviceCommand DeviceType="频谱仪">
+      <Models>
+		<string>FSQ</string>
+        <string>FSU</string>
+      </Models>
+      <Commands>
+	    <Command Key="仪器复位" Value="*RST" Description="复位"/>
+        <Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+		<Command Key="单次扫描" Value=":INITiate:IMMediate" Description="单位A"/>
+
+        <Command Key="START" Value=":SENS:FREQ:STAR {0} MHz" Description="{0}频率,单位MHz"/>
+		<Command Key="读起始频率" Value=":SENS:FREQ:STAR?" Description="单位Hz"/>      
+        <Command Key="STOP" Value=":SENS:FREQ:STOP {0} MHz" Description="{0}频率,单位MHz"/>
+		<Command Key="读截止频率" Value=":SENS:FREQ:STOP?" Description="单位Hz"/>
+        <Command Key="CENTER" Value=":SENS:FREQ:CENT {0} MHz" Description="{0}频率,单位MHz"/>
+        <Command Key="SPAN" Value=":SENS:FREQ:SPAN {0} MHz" Description="{0}频率,单位MHz"/>
+        <Command Key="REF" Value=":DISP:WIND:TRAC:Y:RLEV {0} dBm" Description="{0}参考功率,单位dBm"/>
+		
+		<Command Key="OFFSET" Value=":DISP:WIND:TRAC:RLEV:OFFSet {0} dBm" Description="{0}功率补偿,单位dBm"/>		
+		<Command Key="ATT" Value="INP::ATT {0}" Description="设置衰减,单位dB"/>
+		<Command Key="ATTAUTO" Value="INP:ATT:AUTO ON" Description="设置自动衰减,单位dB"/>
+        <Command Key="RBW" Value=":BWIDth {0}" Description="设置分辨率带宽,{0}RBW 单位Hz"/>
+		<Command Key="RBWAUTO" Value=":BWIDth:AUTO 1" Description="设置分辨率带宽自动"/>
+        <Command Key="VBW" Value=":BWIDth:VID {0}" Description="设置视频带宽,{0}VBW,单位Hz"/>
+        <Command Key="VBWAUTO" Value=":BWIDth:VID:AUTO 1" Description="设置视频带宽自动"/>
+		
+        <Command Key="PEAK" Value=":CALC:MARK{0}:MAX" Description="标记峰值,{0}MARK点"/>
+		<Command Key="NextPeak" Value=":CALC:MARK{0}:MAX:NEXT" Description="标记次峰值,{0}MARK点"/>
+		<Command Key="NextPeakLeft" Value=":CALC:MARK{0}:MAX:LEFT" Description="标记左峰值,{0}MARK点"/>
+		<Command Key="NextPeakRight" Value=":CALC:MARK{0}:MAX:RIGHT" Description="标记右峰值,{0}MARK点"/>
+		
+        <Command Key="MARK打开" Value=":CALC:MARK{0} ON" Description="打开MARK,{0}MARK点"/>
+        <Command Key="读MARK功率" Value=":CALC:MARK{0}:Y?" Description="读MARK功率,{0}MARK点"/>
+        <Command Key="读MARK频率" Value=":CALC:MARK{0}:X?" Description="读MARK频率,{0}MARK点"/>
+        <Command Key="设置MARK频率" Value=":CALC:MARK{0}:X {1} MHz" Description="设置MARK频率,{0} MARK点,{1} 频率,单位MHz"/>
+		<Command Key="关闭所有MARK" Value=":CALC:MARK:AOFF" Description="关闭所有MARK"/>
+		<Command Key="DELT打开" Value=":CALC:DELT{0} ON" Description="打开DELT,{0}DELT点"/>
+		<Command Key="DELT关闭" Value=":CALC:DELT{0} OFF" Description="打开DELT,{0}DELT点"/>
+		<Command Key="设置DELT频率" Value=":CALC:DELT{0}:X {1} KHz" Description="设置DELT频率,{0} DELT点,{1} 频率,单位KHz"/>
+	    <Command Key="读DELT功率" Value=":CALC:DELT{0}:Y?" Description="读DELT功率,{0} DELT点,"/>
+       
+	    <Command Key="设置MARK为NOISe" Value=":CALCulate:MARKer{0}:FUNCtion:NOISe ON" Description="设置MARK为NOISe,{0} MARK点"/>
+        <Command Key="设置MARK为常规" Value=":CALCulate:MARKer{0}:FUNCtion:NOISe OFF" Description="设置MARK为常规,{0} MARK点"/>
+		<Command Key="读噪声功率谱密度" Value="CALC:MARK{0}:FUNC:NOIS:RES?" Description="读噪声功率谱密度,{0}MARK点"/>
+		
+		<Command Key="SingleOrCont" Value=":INITiate:CONTinuous {0}" Description="设置触发模式,{0} 0|1"/>
+        <Command Key="读曲线" Value="TRACe? TRACE1" Description="读曲线"/>
+		
+        <Command Key="SetSAMode" Value=":INSTrument SA" Description="SetSAMode"/>
+        <Command Key="相位噪声测试模式" Value="CALC:DELT{0}:FUNC:PNO ON" Description="相位噪声测试模式,{0}DELT点"/>
+		<Command Key="关相位噪声测试模式" Value="CALC:DELT{0}:FUNC:PNO OFF" Description="关相位噪声测试模式,{0}DELT点"/>
+		<Command Key="读相位噪声" Value="CALC:DELT{0}:FUNC:PNO:RES?" Description="读相位噪声,{0}DELT点"/>
+		
+		<Command Key="测试点数" Value=":SWEep:POINts {0}" Description="设置扫描点,{0} integer扫描点"/>
+		<Command Key="测试点数读取" Value=":SWEep:POINts?" Description="查询扫描点"/>
+		
       </Commands>
     </DeviceCommand>
+	
+	 <DeviceCommand DeviceType="频谱仪">
+      <Models>
+        <string>MS2720T</string>
+      </Models>
+      <Commands>
+        <Command Key="仪器复位" Value="*RST" Description="复位"/>
+        <Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+        <Command Key="START" Value=":SENS:FREQ:STAR {0} MHz" Description="设置起始{0}频率,单位MHz"/>
+		<Command Key="读起始频率" Value=":SENS:FREQ:STAR?" Description="单位Hz,"/>
+		<Command Key="STEP" Value=":SENS:FREQ:STEP {0} MHz" Description="设置步进{0}频率,单位MHz"/>
+		<Command Key="读频率步进" Value=":SENS:FREQ:STEP?" Description="单位Hz,"/>
+        <Command Key="STOP" Value=":SENS:FREQ:STOP {0} MHz" Description="设置终止{0}频率,单位MHz"/>
+		<Command Key="读截止频率" Value=":SENS:FREQ:STOP?" Description="单位Hz,"/>
+        <Command Key="CENTER" Value=":SENS:FREQ:CENT {0} MHz" Description="设置中心{0}频率,单位MHz"/>
+		<Command Key="读中心频率" Value=":SENS:FREQ:CENT?" Description="单位Hz"/>
+        <Command Key="SPAN" Value=":SENS:FREQ:SPAN {0} MHz" Description="设置SPAN{0}频率,单位MHz"/>
+		<Command Key="读SPAN" Value=":SENS:FREQ:SPAN?" Description="单位Hz"/>
+		<Command Key="FullSPAN" Value=":SENS:FREQ:SPAN:FULL" Description="设置全带宽"/>	
+		<Command Key="ATT" Value=":SENS:POW:ATT {0}" Description="设置衰减值{0},单位dBm"/>	
+		<Command Key="读ATT" Value=":SENS:POW:ATT?" Description="查询衰减值{0},单位dBm"/>	
+		<Command Key="ATTAUTO" Value=":SENS:POW:ATT:AUTO 1" Description="设置衰减自动"/>	
+		<Command Key="读ATTAUTO" Value=":SENS:POW:ATT:AUTO?" Description="查询衰减自动状态"/>	
+		
+		<Command Key="REFAUTO" Value=":DISP:WIND:TRAC:Y:SCAL:ADJ" Description="设置参考电平自动,"/>
+        <Command Key="REF" Value=":DISP:WIND:TRAC:Y:SCAL:RLEV {0} dBm" Description="设置参考电平{0},单位dBm,range:With reference level offset = 0 dB: 30 dBm to –150 dBm"/>
+		<Command Key="读REF" Value=":DISP:WIND:TRAC:Y:SCAL:RLEV?" Description="查询参考电平,单位dBm"/>
+		<Command Key="SCALE" Value=":DISP:WIND:TRAC:Y:SCAL:PDIV {0} dBm" Description="设置SCALE{0},单位dBm"/>
+		<Command Key="读SCALE" Value=":DISP:WIND:TRAC:Y:SCAL:PDIV?" Description="查询SCALE,单位dBm"/>
+		<Command Key="OFFSET" Value=":DISP:WIND:TRAC:Y:SCAL:OFFS {0} dBm" Description="设置功率补偿值{0},单位dBm,range:–99.9 dB to +99.9 dB"/>
+		<Command Key="读OFFSET" Value=":DISP:WIND:TRAC:Y:SCAL:OFFS?" Description="查询功率补偿值,单位dBm"/>
+		
+		
+        <Command Key="RBW" Value=":SENSe:BWIDth:RES {0}" Description="设置RBW{0},单位Hz,range:1 Hz to 10 MHz in a 1:3 sequence"/>
+		<Command Key="读RBW" Value=":SENSe:BWIDth:RES?" Description="单位Hz"/>
+        <Command Key="VBW" Value=":SENSe:BWIDth:VID {0}" Description="设置VBW{0},单位Hz,range:1 Hz to 10 MHz in a 1:3 sequence"/>
+		<Command Key="读VBW" Value=":SENSe:BWIDth:VID?" Description="单位Hz"/>
+		<Command Key="RBWAUTO" Value=":BWIDth:RES:AUTO 1" Description="RBW自动"/>
+		<Command Key="读RBWAUTO" Value=":BWIDth:RES:AUTO?" Description="读RBW自动状态"/>
+        <Command Key="VBWAUTO" Value=":BWIDth:VID:AUTO 1" Description="VBW自动"/>
+		<Command Key="读VBWAUTO" Value=":BWIDth:VID:AUTO?" Description="读VBW自动状态"/>
+		<Command Key="设置BW线性类型" Value=":SENS:BWIDth:VID:TYPE LIN" Description="设置BW线性类型"/>
+		<Command Key="设置BW对数类型" Value=":SENS:BWIDth:VID:TYPE LOG" Description="设置BW对数类型"/>
+		<Command Key="读BW类型" Value=":SENS:BWIDth:VID:TYPE?" Description="读BW类型,LOGarithmic|LINear"/>
+		<Command Key="设置输入阻抗" Value=":SENS:CORR:IMP:INP:MAGN {0} Ohm" Description="设置输入阻抗,{0} 50|70"/>
+		<Command Key="读输入阻抗" Value=":SENS:CORR:IMP:INP:MAGN?" Description="查询输入阻抗,50|70,单位Ohm"/>
+		<Command Key="设置通道功率集成带宽" Value=":SENS:CHP:BWIDth:INT {0}" Description="设置通道功率集成带宽,{0} 频率,单位Hz"/>
+		<Command Key="读通道功率集成带宽" Value=":SENS:CHP:BWIDth:INT?" Description="查询通道功率集成带宽,单位Hz"/>
+		
+		<Command Key="多条曲线求平均值" Value=":SENS:AVER:COUNt {0}" Description="多条曲线求平均值,{0}曲线数量,2 to 65535"/>
+		<Command Key="设置曲线为Normal" Value=":SENS:AVER:TYPE NONE" Description="设置曲线为Normal"/>
+		<Command Key="设置曲线为Normal" Value=":TRACe{0}:OPERation NORMal" Description="设置曲线为Normal"/>
+		<Command Key="设置曲线为Average" Value=":SENS:AVER:TYPE SCAL" Description="设置曲线为Average"/>
+		<Command Key="设置曲线为Average" Value=":TRACe{0}:OPERation AVERage" Description="设置曲线为Average"/>
+		<Command Key="最大保持开" Value=":SENS:AVER:TYPE MAX" Description="设置曲线为Max Hold"/>
+		<Command Key="最大保持开" Value=":TRACe{0}:OPERation MAXHold" Description="设置曲线为Max Hold"/>
+		<Command Key="最小保持开" Value=":SENS:AVER:TYPE MIN" Description="设置曲线为Min Hold"/>
+		<Command Key="最小保持开" Value=":TRACe{0}:OPERation MINHold" Description="设置曲线为Min Hold"/>
+		<Command Key="查询曲线模式" Value=":SENS:AVER:TYPE?" Description="查询曲线模式,NONE|SCALar|MAXimum|MINimum"/>
+		<Command Key="查询曲线模式" Value=":TRACe{0}:OPERation?" Description="查询曲线模式, NORMal|MAXHold|MINHold|AVERage"/>
+						
+		<Command Key="配置通道为功率模式" Value=":CONFigure:CHPower" Description="配置通道为功率模式"/>
+		<Command Key="设置CHPowerON" Value=":SENS:CHP:STAT 1" Description="打开通道功率"/>
+		<Command Key="设置CHPowerOFF" Value=":SENS:CHP:STAT 0" Description="关闭通道功率"/>
+		<Command Key="查询CHPower状态" Value=":SENS:CHP:STAT?" Description="查询通道功率状态,0|1"/>
+		<Command Key="测量通道功率和功率谱密度" Value=":MEASure:ACPower?" Description="测量通道功率和功率谱密度,功率,功率谱密度"/>
+		<Command Key="测量通道功率" Value=":MEASure:CHPower:CHPower?" Description="测量通道功率,功率"/>
+		<Command Key="测量功率谱密度" Value=":MEASure:CHPower:DENSity?" Description="测量功率谱密度,功率谱密度"/>
+		<Command Key="读通道功率和功率谱密度" Value=":READ:CHPower?" Description="读通道功率和功率谱密度,功率,功率谱密度"/>
+		<Command Key="读功率谱密度" Value=":READ:CHPower:DENSity?" Description="读功率谱密度,功率谱密度"/>				
+		
+        <Command Key="PEAK" Value=":CALC:MARK{0}:MAX" Description="{0} MARK点,标记峰值."/>
+		<Command Key="NextPeak" Value=":CALC:MARK{0}:MAX:NEXT" Description="标记次峰值,{0}MARK点"/>
+		<Command Key="NextPeakLeft" Value=":CALC:MARK{0}:MAX:LEFT" Description="{0} MARK点,标记左峰值."/>
+		<Command Key="NextPeakRight" Value=":CALC:MARK{0}:MAX:RIGHt" Description="{0} MARK点,标记右峰值."/>
+		<Command Key="标记中心频点" Value=":CALC:MARK{0}:CENT" Description="{0}MARK点,标记中心频点"/>
+        <Command Key="MARK打开" Value=":CALC:MARK{0}:STAT ON" Description="{0} MARK点,打开MARK"/>
+		<Command Key="关闭所有MARK" Value=":CALC:MARK:AOFF" Description="关闭所有MARK"/>
+		<Command Key="读MARK状态" Value=":CALC:MARK{0}:STAT?" Description="{0} MARK点,读MARK状态"/>
+        <Command Key="读MARK功率" Value=":CALC:MARK{0}:Y?" Description="{0} MARK点,读MARK功率.单位dBm"/>
+        <Command Key="读MARK频率" Value=":CALC:MARK{0}:X?" Description="{0} MARK点,读MARK频率.单位Hz"/>
+        <Command Key="设置MARK频率" Value=":CALC:MARK{0}:X {1} MHz" Description="{0}MARK点,{1}频率点,单位MHz"/>
+		
+		<Command Key="测量相邻信道功率比" Value=":MEASure:ACPower?" Description="测量相邻信道功率比"/>
+						
+        <Command Key="设置MARK为NOISe" Value=":CALCulate:MARKer{0}:DELTa:NOISe 1" Description="打开标记噪声,{0},MARK点"/>
+        <Command Key="设置MARK为常规" Value=":CALCulate:MARKer{0}:DELTa:NOISe 0" Description="关闭标记噪声,{0},MARK点"/>
+		
+		<Command Key="标记DELT频率" Value=":CALCulate:MARKer{0}:DELTa:X {1}" Description="标记Delta频率,{0},MARK点,{1},频率,单位Hz"/>
+		<Command Key="查询DELT频率" Value=":CALCulate:MARKer{0}:DELTa:X?" Description="查询Delta频率,{0},MARK点,单位Hz"/>
+		<Command Key="读DELT功率" Value=":CALCulate:MARKer{0}:DELTa:Y?" Description="查询Delta,{0},MARK点,单位dB"/>		
+		<Command Key="DELT打开" Value=":CALCulate:MARKer{0}:DELTa 1" Description="打开Delta标记,{0},MARK点"/>
+		<Command Key="DELT" Value=":CALCulate:MARKer{0}:DELTa 0" Description="关闭Delta标记,{0},MARK点"/>
+		<Command Key="查询DELT标记状态" Value=":CALCulate:MARKer{0}:DELTa?" Description="查询Delta标记状态,{0},MARK点"/>
+
+		<Command Key="SingleOrCont" Value=":INITiate:CONTinuous {0}" Description="设置触发模式,{0} 0|1"/>
+        <Command Key="读曲线" Value="TRACe? TRACE1" Description="读曲线"/>
+		<Command Key="曲线显示开" Value=":TRACe{0}:DISPlay 1" Description="曲线显示,{0},Trace数"/>
+		<Command Key="曲线显示关" Value=":TRACe{0}:DISPlay 0" Description="曲线显示,{0},Trace数"/>
+		<Command Key="读曲线显示状态" Value=":TRACe{0}:DISPlay?" Description="读曲线显示状态,{0},Trace数"/>
+		
+		<Command Key="触发源FreeRun" Value=":TRIGger:SOURce IMMediate" Description="设置触发源为FreeRun"/>
+		<Command Key="触发源EXTernal" Value=":TRIGger:SOURce EXTernal" Description="设置触发源为EXTernal"/>
+		<Command Key="触发源VIDeo" Value=":TRIGger:SOURce EXTernal" Description="设置触发源为VIDeo"/>
+		<Command Key="查询触发源" Value=":TRIGger:SOURce?" Description="查询触发源IMMediate|EXTernal|VIDeo"/>
+		<Command Key="设置视频触发延时" Value=":TRIGger:VIDeo:DELay {0}" Description="设置视频触发延时,<percentage> or <time>,range:–100% to +200% (–1 ms to +2 ms)"/>
+		<Command Key="查询视频触发延时" Value=":TRIGger:VIDeo:DELay?" Description="查询视频触发延时"/>
+		<Command Key="设置视频触发电平" Value=":TRIGger:VIDeo:LEVel {0}" Description="设置视频触发电平,range:30 dBm to –150 dBm"/>
+		<Command Key="查询视频触发电平" Value=":TRIGger:VIDeo:LEVel?" Description="查询视频触发电平,range:30 dBm to –150 dBm"/>
+		<Command Key="设置视频触发位置" Value=":TRIGger:VIDeo:POSition {0}" Description="设置视频触发位置,range:0% to 100%"/>
+		<Command Key="查询视频触发位置" Value=":TRIGger:VIDeo:POSition?" Description="查询视频触发位置,range:0% to 100%"/>
+		
+      </Commands>
+    </DeviceCommand>
+    
+	
+	<DeviceCommand DeviceType="功率计">
+      <Models>
+        <string>E4417A</string>
+      </Models>
+      <Commands>
+		<Command Key="仪器复位" Value="*RST" Description="复位"/>
+        <Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+		
+		<Command Key="设置通道偏移" Value="SENSe{0}:CORRection:GAIN2 {1}" Description="设置通道偏移量,通道{0} 1|2 ,{1} 偏移量,单位dB"/>
+		<Command Key="打开通道偏移" Value="SENSe{0}:CORR:GAIN2:STATe ON" Description="打开通道偏移,通道{0} 1|2"/>
+		<Command Key="关闭通道偏移" Value="SENSe{0}:CORR:GAIN2:STATe OFF" Description="关闭通道偏移,通道{0} 1|2"/>
+		<Command Key="设置显示偏移" Value="CALCulate{0}:GAIN {1}" Description="设置显示偏移,通道{0} 1|2,{1} 偏移量,单位dB"/>
+		<Command Key="打开显示偏移" Value="CALCulate{0}:GAIN:STATe ON" Description="打开显示偏移,通道{0} 1|2"/>
+		<Command Key="关闭显示偏移" Value="CALCulate{0}:GAIN:STATe OFF" Description="关闭显示偏移,通道{0} 1|2"/>	
+		<Command Key="自动平均开" Value="SENSe{0}:AVERage:COUNt:AUTO ON" Description="自动平均开,通道{0} 1|2"/>
+		<Command Key="自动平均关" Value="SENSe{0}:AVERage:COUNt:AUTO OFF" Description="自动平均关,通道{0} 1|2"/>
+		
+		<Command Key="MEAS测量功率" Value="MEASure{0}?" Description="使用自动平均测试功率,{0} 1|2|3|4,1:上窗口上测量;2:下窗口上测量;3:上窗口下测量;4:下窗口下测量,"/>
+		<Command Key="Fetch测量功率" Value="FETCh{0}?" Description="Fetch测量功率,{0} 1|2|3|4,1:上窗口上测量;2:下窗口上测量;3:上窗口下测量;4:下窗口下测量"/>		
+		<Command Key="Read测量功率" Value="READ{0}?" Description="Read测量功率,{0} 1|2|3|4,1:上窗口上测量;2:下窗口上测量;3:上窗口下测量;4:下窗口下测量"/>
+		<Command Key="设置视频带宽" Value="SENSe{0}:BWIDth:VIDeo {1} KHZ" Description="设置视频带宽,通道{0} 1|2, 频率{1},单位KHz"/>
+		<Command Key="设置功率显示单位" Value="UNIT{0}:POW {1}" Description="设置功率显示单位,{0} 1|2|3|4,1:上窗口上测量;2:下窗口上测量;3:上窗口下测量;4:下窗口下测量, {1} W|DBM"/>
+		<Command Key="设置下限" Value="CALC{0}:LIM:LOW {1}" Description="设置下限,通道{0} 1|2|3|4,1:上窗口上测量;2:下窗口上测量;3:上窗口下测量;4:下窗口下测量, 功率{1},单位dBm"/>
+		<Command Key="设置上限" Value="CALC{0}:LIM:UPP {1}" Description="设置上限,通道{0} 1|2|3|4, 功率{1},单位dBm"/>
+		<Command Key="打开限制开关" Value="CALC{0}:LIM:STAT ON" Description="打开限制开关,{0} 1|2|3|4"/>
+		<Command Key="关闭限制开关" Value="CALC{0}:LIM:STAT OFF" Description="关闭限制开关,{0} 1|2|3|4"/>
+        <Command Key="单次触发" Value="INITiate{0}:CONTinuous OFF" Description="通道{0} 1|2"/>
+		<Command Key="连续触发" Value="INITiate{0}:CONTinuous ON" Description="通道{0} 1|2"/>
+      </Commands>
+    </DeviceCommand>
+	
+	<DeviceCommand DeviceType="功率计">
+      <Models>
+        <string>ML2487A</string>
+      </Models>
+      <Commands>
+		<Command Key="仪器复位" Value="*RST" Description="复位"/>
+        <Command Key="OPC" Value="*OPC?" Description="操作完成指出"/>
+		<Command Key="IDN" Value="*IDN?" Description="查询仪器标识符"/>
+		<Command Key="激活通道" Value="CHACTIV {0}" Description="激活通道,通道{0} 1|2"/>
+		<Command Key="通道输入配置" Value="CHCFG {0},{1}" Description="通道输入配置,通道{0} 1|2,传感器{1} A|B"/>
+		<Command Key="设置显示通道数量" Value="CHDISPN {0}" Description="设置显示通道数量,{0} 1|2"/>
+		<Command Key="设置通道测量模式" Value="CHMODE {0},{1}" Description="设置通道测量模式,通道{0} 1|2,模式{1} CW|PMOD"/>
+		<Command Key="设置通道显示小数位" Value="CHRES {0},{1}" Description="设置通道显示小数位,通道{0} 1|2,小数位{1}1~3"/>
+		<Command Key="设置通道单位" Value="CHUNIT {0},{1}" Description="设置通道单位,通道{0} 1|2,单位{1} DBM|DBMV|DBUV|DBW|W|V"/>
+		<Command Key="CWAUTO" Value="TRARMD {0},CW,AUTO" Description="设置通道CW自动触发,通道{0} 1|2"/>
+		<Command Key="CWSINGLE" Value="TRARMD {0},CW,SINGLE" Description="设置通道CW单次触发,通道{0} 1|2"/>
+		<Command Key="CW自动平均" Value="CWAVG {0},AUTO" Description="CW自动平均,通道{0} 1|2"/>
+		<Command Key="立即触发" Value="TR1 {0}" Description="立即触发,通道{0} 1|2"/>
+		<Command Key="设置FreeRun" Value="TR3" Description="将所有通道触发设置为FreeRun"/>
+		
+		<Command Key="复位通道峰值" Value="CHPIRST {0}" Description="复位通道峰值,通道{0} 1|2"/>
+		<Command Key="读光标的值" Value="TTMKRO {0}?" Description="读光标的值,通道{0} 1|2|1&2,(百分比,功率)"/>
+		<Command Key="设置测量点数" Value="YDRES {0}" Description="设置测量点数,{0} P200|P400"/>
+		<Command Key="查询测量点数" Value="YDRES?" Description="查询测量点数, P200|P400"/>
+		<Command Key="打开MARK" Value="MKSTATE {0},{1},ON" Description="打开MARK,通道{0} 1|2,MARK点{1}1~4"/>
+		<Command Key="标记最大值" Value="MKTMAX {0}" Description="标记最大值,通道{0} 1|2"/>
+		<Command Key="标记最小值" Value="MKTMIN {0}" Description="标记最小值,通道{0} 1|2"/>
+		
+		<Command Key="激活通道Marker" Value="MKACTN {0},{1}" Description="激活通道Marker数,通道{0} 1|2,MARK点{1} 1~4"/>
+		<Command Key="标记通道峰值" Value="CHPKS {0} ON" Description="标记通道峰值,通道{0} 1|2"/>
+		<Command Key="读MARK值" Value="MKACTO {0}" Description="读MARK值,包括的Maker数,Marker的功率,功率单位,功率读取时间,通道{0} 1|2"/>
+      </Commands>
+    </DeviceCommand>
+    
     <DeviceCommand DeviceType="程控电源">
       <Models>
         <string>IT6722</string>
@@ -124,6 +522,23 @@
         <Command Key="读取电流" Value=":MEAS:CURR?" Description="单位A"/>
       </Commands>
     </DeviceCommand>
+	
+	<DeviceCommand DeviceType="程控电源">
+      <Models>
+        <string>Z36-6</string>
+      </Models>
+      <Commands>
+        <Command Key="打开电源" Value="OUT 1" Description="打开电源输出"/>
+        <Command Key="关闭电源" Value="OUT 0" Description="关闭电源输出"/>
+		<Command Key="读电源输出状态" Value="OUT?" Description="电源输出状态"/>
+        <Command Key="设置电压" Value="PV {0}" Description="设置输出电压值,{0}电压值,单位V"/>
+        <Command Key="设置限流" Value="PC {0}" Description="设置输出电流值,{0}电流值,单位A"/>
+        <Command Key="读取电压" Value="MV?" Description="读取实际输出电压。单位V,返回一个6 位字符串。"/>
+        <Command Key="读取电流" Value="MC?" Description="读取实际输出电流。单位A,返回一个6 位字符串。"/>
+		<Command Key="设置过压保护" Value="OVP {0}" Description="设置过压保护,{0}电压值,单位V"/>
+      </Commands>
+    </DeviceCommand>
+	
     <DeviceCommand DeviceType="电子负载">
       <Models>
         <string>IT8811</string>
@@ -139,9 +554,11 @@
         <Command Key="设置恒压模式" Value="SOUR:FUNC VOLT" Description=""/>
       </Commands>
     </DeviceCommand>
+	
     <DeviceCommand DeviceType="矢量网络分析仪">
       <Models>
         <string>E5062A</string>
+        <string>N5234A</string>
       </Models>
       <Commands>
         <Command Key="仪器复位" Value=":SYSTem:PRESet" Description="{0}频率,单位MHz"/>
@@ -154,12 +571,32 @@
         <Command Key="MarkPeak" Value=":CALC{0}:MARK{1}:FUNC:EXEC" Description="{0}频率,单位MHz"/>
         <Command Key="Start" Value=":SENS{0}:FREQ:STAR {1}" Description="{0}频率,单位Hz"/>
         <Command Key="Stop" Value=":SENS{0}:FREQ:STOP {1}" Description="{0}频率,单位Hz"/>
-        <Command Key="power" Value="SOUR:POW1 {0}" Description="{0}频率,单位Hz"/>
+        <Command Key="power" Value="SOUR{0}:POW {1}" Description="{0}频率,单位Hz"/>
         <Command Key="outputON" Value="OUTP ON" Description="{0}频率,单位Hz"/>
         <Command Key="outputOFF" Value="OUTP OFF" Description="{0}频率,单位Hz"/>
         <Command Key="ATT" Value=":SOURce{0}:POWer:ATTenuation {1}" Description="{0}频率,单位Hz"/>
 
-        <Command Key="ATT" Value=":SOURce{0}:POWer:ATTenuation {1}" Description="{0}频率,单位Hz"/>
+        <Command Key="Cont" Value=":INITiate{0}:CONTinuous 1" Description="{0}频率,单位Hz"/>
+        <Command Key="IMM" Value=":TRIG:SOUR INT" Description="{0}频率,单位Hz"/>
+        <Command Key="MAX" Value=":CALC{0}:MARK1:FUNC:TYPE MAX" Description="{0}频率,单位Hz"/>
+        <Command Key="TRACK" Value=" :CALC{0}:MARK1:FUNC:TRAC 1" Description="{0}频率,单位Hz"/>
+       
+        <Command Key="MarkStart" Value=":CALC{0}:MARK1:FUNC:DOM:STAR {1}" Description="{0}频率,单位Hz"/>
+        <Command Key="MarkStop" Value=":CALC{0}:MARK1:FUNC:DOM:STOP {1}" Description="{0}频率,单位Hz"/>
+        <Command Key="SearchRange" Value=":CALC{0}:MARK:FUNC:DOM {1}" Description="{0}频率,单位Hz"/>
+
+        <Command Key="Save" Value=":MMEM:STOR {0}" Description="{0}频率,单位Hz"/>
+        <Command Key="Recall" Value=":MMEM:LOAD {0}" Description="{0}频率,单位Hz"/>
+
+        <Command Key="执行一次测试" Value=":INIT{0}"/>
+        <Command Key="读取Start" Value=":SENS{0}:FREQ:STAR?"/>
+        <Command Key="读取Stop" Value=":SENS{0}:FREQ:STOP?"/>
+        <Command Key="读取SweepPoints" Value=":SENSe{0}:SWEep:POINts?"/>
+        <Command Key="Single" Value=":INITiate{0}:CONTinuous 0" Description="{0}频率,单位Hz"/>
+        <Command Key="GetTrace" Value="CALC:DATA:FDATA?"/>
+        <Command Key="GetXvalue" Value="SENS:X?"/>
+        <Command Key="GetXvalue_待测试" Value="CALC:X?"/>
+        <Command Key="OPC" Value="*OPC?"/>
       </Commands>
     </DeviceCommand>
 
@@ -170,6 +607,7 @@
         <string>DSO-X 3054A</string>
       </Models>
       <Commands>
+        <Command Key="OPC" Value="*OPC?"/>
         <Command Key="RUN" Value=":RUN" Description="{0}频率,单位MHz"/>
         <Command Key="STOP" Value=":STOP" Description="{0}频率,单位MHz"/>
         <Command Key="Single" Value=":SINGle" Description="{0}频率,单位MHz"/>
@@ -188,10 +626,10 @@
         <Command Key="触发源" Value=":TRIGger:SOURce CHANnel{0}" Description="{0}电压值,单位V,CV模式下"/>
 
         <Command Key="清除测量方法" Value=":MEASure:CLEar" Description="{0}电压值,单位V,CV模式下"/>
-        <Command Key="相移测量" Value=":MEASure:PHASe" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="相移测量" Value=":MEASure:PHASe CHAN1,CHAN2" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="读取相移数据" Value=":MEASure:PHASe?" Description="{0}电压值,单位V,CV模式下"/>
 
-        <Command Key="峰峰值测量" Value=":MEASure:VPP" Description="{0}电压值,单位V,CV模式下"/>
+        <Command Key="峰峰值测量" Value=":MEASure:VPP CHAN2" Description="{0}电压值,单位V,CV模式下"/>
         <Command Key="读取峰峰值" Value=":MEASure:VPP?" Description="{0}电压值,单位V,CV模式下"/>
 
       </Commands>

BIN
exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.dll


BIN
exe/apps/Tps_LQ_Transmitter/Tps_LQ_Transmitter.pdb


+ 2 - 2
exe/apps/Tps_LQ_Transmitter/bundle.config

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <configuration>
   <!--DevHostApp.dll 与bundle.config在同一个目录下-->
-  <Activator BundleName="林泉发射机测试" Assembly="Tps_LQ_Transmitter.dll" Type="Tps_LQ_Transmitter.Bundle"/>
+  <Activator BundleName="发射机测试" Assembly="Tps_LQ_Transmitter.dll" Type="Tps_LQ_Transmitter.Bundle"/>
   <Extension Point="MainPage">
-    <Node Name="林泉发射机测试A" Page="测试项目" Group="测试项目" Text="发射机测试A" Type="Tps_LQ_Transmitter.FrmMain" Image="aa.png" IsLazyLoad="true" Order="2" />
+    <Node Name="发射机测试" Page="测试项目" Group="测试项目" Text="发射机测试" Type="Tps_LQ_Transmitter.FrmMain" Image="aa.png" IsLazyLoad="true" Order="2" />
   </Extension>
 </configuration>

BIN
exe/apps/Tps_LQ_Transmitter/config/ModulationMode.xlsx


BIN
exe/apps/Tps_LQ_Transmitter/config/测试#常温检查#发射机.xlsx


BIN
exe/apps/Tps_LQ_Transmitter/config/测试#常温测试#发射机.xlsx


+ 663 - 0
exe/logs/202108.log

@@ -78,3 +78,666 @@
 2021-08-06 18:22:31.2156 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
 2021-08-06 18:22:31.2156 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
 2021-08-06 18:22:31.2156 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-09 17:02:21.9050 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:02:22.0140 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:02:22.3140 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:02:22.3330 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:02:22.3490 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:02:22.3560 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:02:22.3560 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:02:22.3560 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:02:22.3560 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:02:25.3970 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:02:31.8920 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-09 17:02:31.8920 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:02:31.8920 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:02:34.6550 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-09 17:02:34.6550 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-09 17:02:34.6550 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-09 17:02:34.6550 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-09 17:02:34.6550 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-09 17:03:31.4480 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:03:31.5780 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:03:31.8960 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:03:31.9190 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:03:31.9450 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:03:31.9530 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:03:31.9530 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:03:31.9530 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:03:31.9530 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:03:34.1980 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:03:39.5410 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-09 17:03:39.5510 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:03:39.5510 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:03:45.0460 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-09 17:03:45.0460 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-09 17:03:45.0460 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-09 17:03:45.0460 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-09 17:03:45.0460 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-09 17:05:13.2000 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:05:13.3560 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:05:13.6810 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:05:13.6980 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:05:13.7130 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:05:13.7130 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:05:13.7130 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:05:13.7130 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:05:13.7220 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:05:15.8570 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:05:21.2170 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-09 17:05:21.2170 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:05:21.2170 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:06:48.3980 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:06:48.5770 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:06:49.0120 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:06:49.0800 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:06:49.1310 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:06:49.1380 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:06:49.1380 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:06:49.1380 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:06:49.1380 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:06:51.8220 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:06:57.1710 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-09 17:06:57.1710 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:06:57.1820 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:08:22.3930 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:08:22.5550 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:08:22.9390 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:08:22.9590 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:08:22.9940 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:08:23.0010 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:08:23.0010 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:08:23.0010 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:08:23.0010 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:08:25.2560 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:08:30.5860 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-09 17:08:30.5860 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:08:30.5860 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:10:38.1630 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:10:38.2750 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:10:38.5070 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:10:38.6920 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:10:38.7650 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:10:38.7650 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:10:38.7650 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:10:38.7650 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:10:38.7650 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:10:41.3330 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:10:46.7210 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-09 17:10:46.7210 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:10:46.7210 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:20:32.9530 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:20:33.0850 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:20:33.4450 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:20:33.4640 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:20:33.4870 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:20:33.4940 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:20:33.4940 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:20:33.4940 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:20:33.4940 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:20:35.7190 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:20:41.0250 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-09 17:20:41.0250 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:20:41.0250 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:24:30.0240 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:24:30.2020 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:24:30.4400 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:24:30.4550 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:24:30.4550 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:24:30.4730 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:24:30.4730 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:24:30.4730 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:24:30.4730 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:24:32.5750 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:24:37.8700 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-09 17:24:37.8790 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:24:37.8790 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:25:36.7920 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:25:36.9280 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:25:37.2230 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:25:37.2230 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:25:37.2660 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:25:37.2730 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:25:37.2730 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:25:37.2730 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:25:37.2730 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:25:39.4790 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:25:44.8270 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-09 17:25:44.8270 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:25:44.8270 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:28:09.0190 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:28:09.1640 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:28:09.5060 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:28:09.5260 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:28:09.5590 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:28:09.5590 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:28:09.5590 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:28:09.5590 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:28:09.5590 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:28:11.9070 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:28:17.2050 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-09 17:28:17.2050 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:28:17.2050 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:31:37.4350 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:31:37.5890 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:31:37.9170 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:31:38.0410 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:31:38.1270 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:31:38.1330 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:31:38.1330 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:31:38.1330 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:31:38.1330 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:31:40.8110 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:31:46.1620 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-09 17:31:46.1690 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:31:46.1690 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:35:29.3380 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:35:29.5040 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:35:30.0420 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:35:30.5710 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:35:30.7540 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:35:30.7600 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:35:30.7600 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:35:30.7600 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:35:30.7600 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:35:34.4610 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:35:40.1350 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-09 17:35:40.1350 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:35:40.1520 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:37:33.1910 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:37:33.3180 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:37:33.6880 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:37:33.7120 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:37:33.7390 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:37:33.7390 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:37:33.7390 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:37:33.7390 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:37:33.7390 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:37:35.8910 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:37:41.1820 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-09 17:37:41.1820 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:37:41.1820 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:38:58.8600 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:38:59.0780 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:38:59.4980 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:38:59.5180 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:38:59.6460 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:38:59.6460 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:38:59.6460 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:38:59.6460 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:38:59.6600 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:39:01.7950 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:39:07.1260 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-09 17:39:07.1360 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:39:07.1360 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-09 17:43:00.8980 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:43:01.0030 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:43:01.3980 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:43:01.4160 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:43:01.4480 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:43:01.4480 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:43:01.4480 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:43:01.4480 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:43:01.4480 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:43:03.6940 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:43:07.7000 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-09 17:43:07.7010 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-09 17:43:07.7010 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-09 17:43:07.7010 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-09 17:43:07.7010 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-09 17:47:34.1090 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-09 17:47:34.2390 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-09 17:47:34.5110 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-09 17:47:34.5280 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-09 17:47:34.5620 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-09 17:47:34.5620 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-09 17:47:34.5620 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-09 17:47:34.5620 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-09 17:47:34.5620 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-09 17:47:36.7110 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-09 17:47:42.0020 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-09 17:47:42.0020 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-09 17:47:42.0020 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 09:14:06.3316 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 09:14:06.4656 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 09:14:06.7466 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 09:14:06.7696 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 09:14:06.7866 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 09:14:06.7936 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 09:14:06.7936 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 09:14:06.7936 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 09:14:06.7936 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 09:14:08.9936 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 09:14:15.8766 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-10 09:14:15.8876 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 09:14:15.8876 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:09:58.0296 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:09:58.1646 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:09:58.4466 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:09:58.4646 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:09:58.4826 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:09:58.4886 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:09:58.4886 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:09:58.4886 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:09:58.4886 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:10:01.6236 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:10:08.6206 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-10 14:10:08.6296 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:10:08.6296 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:16:58.6876 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:16:58.8276 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:16:59.1546 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:16:59.1696 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:16:59.1826 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:16:59.1826 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:16:59.1826 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:16:59.1826 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:16:59.1906 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:17:01.3396 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:17:06.7786 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-10 14:17:06.7876 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:17:06.7876 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:23:16.5486 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 14:23:16.5486 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 14:23:16.5486 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 14:23:16.5486 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 14:23:16.5566 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 14:23:26.0636 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:23:26.2176 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:23:26.5066 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:23:26.5236 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:23:26.5856 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:23:26.6006 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:23:26.6156 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:23:26.6496 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:23:26.6516 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:23:28.9626 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:23:34.2906 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-10 14:23:34.2966 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:23:34.2966 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:23:45.6676 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 14:23:45.6676 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 14:23:45.6676 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 14:23:45.6676 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 14:23:45.6856 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 14:23:53.8026 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:23:53.9206 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:23:54.1836 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:23:54.2026 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:23:54.2276 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:23:54.2336 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:23:54.2336 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:23:54.2336 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:23:54.2336 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:23:56.3376 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:24:01.7196 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-10 14:24:01.7196 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:24:01.7196 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:24:54.9236 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 14:24:54.9236 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 14:24:54.9316 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 14:24:54.9316 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 14:24:54.9316 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 14:39:56.8976 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:39:57.0306 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:39:57.3746 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:39:57.3906 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:39:57.4116 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:39:57.4166 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:39:57.4166 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:39:57.4166 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:39:57.4166 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:39:59.5746 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:40:04.9036 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-10 14:40:04.9036 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:40:04.9036 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:40:28.7996 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 14:40:28.7996 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 14:40:28.7996 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 14:40:28.7996 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 14:40:28.7996 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 14:40:38.3256 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:40:38.4806 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:40:38.7076 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:40:38.7236 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:40:38.7446 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:40:38.7446 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:40:38.7526 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:40:38.7526 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:40:38.7526 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:40:40.9266 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:40:46.2296 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-10 14:40:46.2296 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:40:46.2296 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 14:41:23.9106 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 14:41:23.9106 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 14:41:23.9166 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 14:41:23.9166 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 14:41:23.9166 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 14:44:27.6166 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 14:44:27.7826 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 14:44:28.1546 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 14:44:28.2156 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 14:44:28.2406 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 14:44:28.2466 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 14:44:28.2466 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 14:44:28.2466 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 14:44:28.2466 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 14:44:30.4426 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 14:44:35.9016 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-10 14:44:35.9206 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 14:44:35.9226 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 15:21:29.4036 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 15:21:29.5366 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 15:21:29.9096 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 15:21:29.9256 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 15:21:29.9476 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 15:21:29.9536 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 15:21:29.9536 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 15:21:29.9536 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 15:21:29.9536 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 15:21:32.1796 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 15:21:37.5896 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-10 15:21:37.5996 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 15:21:37.5996 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 15:23:49.6586 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 15:23:49.6586 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 15:23:49.6586 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 15:23:49.6646 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 15:23:49.6646 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 15:31:24.1386 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 15:31:24.2936 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 15:31:24.5616 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 15:31:24.5806 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 15:31:24.6026 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 15:31:24.6026 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 15:31:24.6096 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 15:31:24.6096 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 15:31:24.6096 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 15:31:26.8696 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(42, 71)中有错误。 
+2021-08-10 15:31:32.2436 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-10 15:31:32.2546 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 15:31:32.2546 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 16:23:22.2306 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 16:23:22.2306 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 16:23:22.2306 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 16:23:22.2306 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 16:23:22.2306 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 16:28:24.7046 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 16:28:24.8526 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 16:28:25.2466 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 16:28:25.3446 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 16:28:25.3906 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 16:28:25.3906 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 16:28:25.3996 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 16:28:25.3996 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 16:28:25.3996 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 16:28:28.3936 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(55, 74)中有错误。 
+2021-08-10 16:28:34.1116 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-10 16:28:34.1286 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 16:28:34.1286 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 16:28:41.2996 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 16:28:41.2996 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 16:28:41.2996 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 16:28:41.2996 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 16:28:41.2996 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 16:32:07.1536 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 16:32:07.3016 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 16:32:07.6086 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 16:32:07.6086 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 16:32:07.6416 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 16:32:07.6416 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 16:32:07.6416 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 16:32:07.6416 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 16:32:07.6416 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 16:32:09.8476 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(55, 74)中有错误。 
+2021-08-10 16:32:15.1726 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-10 16:32:15.1846 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 16:32:15.1846 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 16:33:10.4546 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 16:33:10.4546 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 16:33:10.4606 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 16:33:10.4606 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 16:33:10.4606 Info:                [source]:runtime,[msg]:Runtime 关闭 
+2021-08-10 16:58:59.1966 Info:                [source]:runtime,[msg]:Runtime 启动 
+2021-08-10 16:58:59.3196 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DataApp\bundle.config" 
+2021-08-10 16:58:59.7036 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\bundle.config" 
+2021-08-10 16:58:59.7196 Info:                [source]:runtime,[msg]:加载插件"F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\Tps_LQ_Transmitter\bundle.config" 
+2021-08-10 16:58:59.7426 Info:                [source]:runtime,[msg]:AppHost 开始启动插件 
+2021-08-10 16:58:59.7426 Info:                [source]:runtime,[msg]:插件"数据管理"启动成功 
+2021-08-10 16:58:59.7426 Info:                [source]:runtime,[msg]:插件"资源管理器"启动成功 
+2021-08-10 16:58:59.7426 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"启动成功 
+2021-08-10 16:58:59.7426 Info:                [source]:runtime,[msg]:Runtime 启动完成 
+2021-08-10 16:59:01.8976 Error:                [source]:资源管理器 LoadDevice,[msg]:加载命令文件异常:F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\apps\DevicesApp\commands\程控命令.xml。原因:XML 文档(55, 74)中有错误。 
+2021-08-10 16:59:07.3346 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-10 16:59:07.3696 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::34::INSTR。 
+2021-08-10 16:59:07.3696 Info:                [source]:资源管理器 LoadDevice,[msg]:初始化设备成功:GPIB0::29::INSTR。 
+2021-08-10 17:15:46.9646 Info:                [source]:runtime,[msg]:AppHost 停止插件 
+2021-08-10 17:15:46.9646 Info:                [source]:runtime,[msg]:插件"数据管理"停止成功 
+2021-08-10 17:15:46.9646 Info:                [source]:runtime,[msg]:插件"资源管理器"停止成功 
+2021-08-10 17:15:46.9646 Info:                [source]:runtime,[msg]:插件"林泉发射机测试"停止成功 
+2021-08-10 17:15:46.9646 Info:                [source]:runtime,[msg]:Runtime 关闭 

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


+ 56 - 33
tps/TpsLabStudio/FrmMain.cs

@@ -155,17 +155,33 @@ namespace Tps_LQ_Transmitter
             frmDevice.ShowDevices(currFileNode.Tps.Devices);
         }
 
-        private void Tps_TestTableCellChanged(int row, int cell, object value)
+        private void Tps_TestTableCellChanged(int row, int cell,bool ok, object value)
         {
             this.Invoke(new Action(() => {
                 currFileNode.Tps.TestTable.Rows[row][cell] = value;
+                if (ok)
+                {
+                    dgvTestData.Rows[row].Cells[cell].Style.BackColor = Color.White;
+                }
+                else
+                {
+                    dgvTestData.Rows[row].Cells[cell].Style.BackColor = Color.Red;
+                }
             }));
         }
 
-        private void Tps_ManualTableCellChanged(int row, int cell, object value)
+        private void Tps_ManualTableCellChanged(int row, int cell, bool ok, object value)
         {
             this.Invoke(new Action(() => {
                 currFileNode.Tps.ManualTable.Rows[row][cell] = value;
+                if (ok)
+                {
+                    dgvTestData.Rows[row].Cells[cell].Style.BackColor = Color.White;
+                }
+                else
+                {
+                    dgvTestData.Rows[row].Cells[cell].Style.BackColor = Color.Red;
+                }
             }));
         }
 
@@ -230,12 +246,26 @@ namespace Tps_LQ_Transmitter
             //dgvManualData.DataSource = null;
             //dgvManualData.DataSource = currFileNode.Tps.ManualTable;
 
+            MainTps tps = new MainTps();
+
+            
+
             dgvTestData.DataSource = null;
             dgvTestData.DataSource = currFileNode.Tps.TestTable;
 
+
+          /*  //获取仪器
+            var DC = tps.GetDevice("程控电源");
+            DC.Write("设置过压保护", "36V");
+            DC.Write("设置电压","12V");
+            DC.Write("设置限流", "3A");
+            DC.Write("打开电源");
+          */
+
             task = new Task(new Action(() => {
                 //执行测试过程
                 currFileNode.Tps.Start(isOrderByChannel);
+                
 
                 this.Invoke(new Action(() => {
                     BtnLoadTpsConfig.Enabled = true;
@@ -244,28 +274,42 @@ namespace Tps_LQ_Transmitter
 
             }));
             task.Start();
+         //   DC.Write("关闭电源");
         }
 
+        public void DataTableFlush(DataTable data)
+        {
+            this.Invoke(new Action(() => {
+                dgvTestData.DataSource = null;
+                dgvTestData.DataSource = data;
+            }));
+        }
         private void BtnStop_Click(object sender, EventArgs e)
         {
+            MainTps tps = new MainTps();
+            //获取仪器
+            var DC = tps.GetDevice("程控电源");
             currFileNode.Tps.Stop();
-            if(task != null && task.IsCompleted == false)
-            {
-                //等待任务退出
-                task.Wait();
-            }
+            //if(task != null && task.IsCompleted == false)
+            //{
+            //    //等待任务退出
+            //    task.Wait();
+            //}
             BtnStart.Enabled = true;
             BtnLoadTpsConfig.Enabled = true;
+        //    DC.Write("关闭电源");
         }
 
         private void BtnDevice_Click(object sender, EventArgs e)
         {
-            if(currFileNode != null)
+            if (currFileNode != null)
             {
                 //点开按钮前检查仪器状态,并根据状态来显示不同背景颜色
                 currFileNode.Tps.CheckDevices();
             }
             frmDevice.ShowDialog();
+
+
         }
 
         private void BtnMessage_Click(object sender, EventArgs e)
@@ -402,18 +446,8 @@ namespace Tps_LQ_Transmitter
                 advTree1.Nodes.Add(parent);
             }
 
-            ////如果父节点只有一个,即只有一个通道,则不显示通道
-            //if(advTree1.Nodes.Count == 1)
-            //{
-            //    DevComponents.AdvTree.Node root = advTree1.Nodes[0];
-            //    advTree1.Nodes.Clear();
-            //    foreach (DevComponents.AdvTree.Node item in root.Nodes)
-            //    {
-            //        advTree1.Nodes.Add(item);
-            //    }
-            //}
             //如果父节点只有一个,即只有一个通道,则不显示通道
-            if (advTree1.Nodes.Count == 1)
+            if(advTree1.Nodes.Count == 1)
             {
                 DevComponents.AdvTree.Node root = advTree1.Nodes[0];
                 advTree1.Nodes.Clear();
@@ -423,25 +457,14 @@ namespace Tps_LQ_Transmitter
                 }
                 else
                 {
-                    List<DevComponents.AdvTree.Node> listtemp = new List<DevComponents.AdvTree.Node>();
                     foreach (DevComponents.AdvTree.Node item in root.Nodes)
                     {
-                        listtemp.Add(item);
-                    }
-                    for (int i = 0; i < listtemp.Count; i++)
-                    {
-                        DevComponents.AdvTree.Node temp;
-                        try
-                        {
-                            temp = (DevComponents.AdvTree.Node)listtemp[i];
-                            advTree1.Nodes.Add(temp);
-                        }
-                        catch (Exception ex)
-                        {
-                        }
+                        advTree1.Nodes.Add(item);
                     }
                 }
+               
             }
+
             treeCanSelect = true;
             advTree1.EndUpdate();
             advTree1.Refresh();

+ 29 - 8
tps/TpsLabStudio/MainTps.cs

@@ -13,7 +13,7 @@ using AppLibs.Devices;
 namespace Tps_LQ_Transmitter
 {
     public delegate void DltShowMsg(MsgType msgType, string msg);
-    public delegate void DltCellValueChanged(int row, int cell, object value);
+    public delegate void DltCellValueChanged(int row, int cell, bool ok, object value);
     /// <summary>
     /// 一个测试文件对应的测试项目
     /// </summary>
@@ -55,6 +55,11 @@ namespace Tps_LQ_Transmitter
         /// 自动测试表
         /// </summary>
         public DataTable TestTable;
+        /// <summary>
+        /// 测试值字典
+        /// </summary>
+        public Dictionary<string,double> TestValueDict;
+
         public event DltCellValueChanged ManualTableCellChanged;
         public event DltCellValueChanged TestTableCellChanged;
 
@@ -494,7 +499,7 @@ namespace Tps_LQ_Transmitter
 
             int num = rowIndex + 1;
             //默认最多30行
-            while (num++ < rowIndex + 30)
+            while (num++ < rowIndex + 200)
             {
                 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() : "";
@@ -588,6 +593,8 @@ namespace Tps_LQ_Transmitter
         {
             ShowMessage(MsgType.Info, string.Format("序列号:{0} 测试开始",Serial));
             isStop = false;
+            //清空测试数据
+           // BaseModel.TestResults.Clear();
             //选择勾选项
             List<TestNode> nodes = this.TestNodes.Where(x => x.IsSelected == true).ToList();
             if(isOrderByChannel)
@@ -603,8 +610,12 @@ namespace Tps_LQ_Transmitter
                             ShowMessage(MsgType.Info, string.Format("开始执行测试指标:{0}/{1}", testnode.Channel, testnode.Name));
                             if(testnode.TestModel != null)
                             {
-                                currModel = testnode.TestModel;
-                                testnode.TestModel.Start(testnode);
+                                //测试中途取消了勾选项
+                                if(testnode.IsSelected)
+                                {
+                                    currModel = testnode.TestModel;
+                                    testnode.TestModel.Start(testnode);
+                                }
                             }
                             else
                             {
@@ -723,16 +734,16 @@ namespace Tps_LQ_Transmitter
             }
         }
 
-        public void SetManualTableCellValue(int row, int col, object value)
+        public void SetManualTableCellValue(int row, int col, bool ok, object value)
         {
             if (ManualTableCellChanged != null)
-                ManualTableCellChanged(row, col, value);
+                ManualTableCellChanged(row, col,ok, value);
         }
 
-        public void SetTestTableCellValue(int row, int col, object value)
+        public void SetTestTableCellValue(int row, int col, bool ok, object value)
         {
             if (TestTableCellChanged != null)
-                TestTableCellChanged(row, col, value);
+                TestTableCellChanged(row, col, ok, value);
         }
 
         void SaveTestTable()
@@ -775,6 +786,16 @@ namespace Tps_LQ_Transmitter
             }
            
         }
+
+        //判断某个测试项是否勾选
+        public bool IsTestItemSelected(string channel , string name)
+        {
+            var node = this.TestNodes.FirstOrDefault(x => x.Channel == channel && x.Name == name);
+            if (node == null)
+                return false;
+
+            return node.IsSelected;
+        }
         #endregion
 
         #region 二次修改的方法

+ 15 - 3
tps/TpsLabStudio/TpsLabStudio.csproj

@@ -85,6 +85,7 @@
     <Compile Include="com\DeviceNode.cs" />
     <Compile Include="com\FileNode.cs" />
     <Compile Include="com\MsgType.cs" />
+    <Compile Include="com\SerialPort.cs" />
     <Compile Include="com\TestMessage.cs" />
     <Compile Include="com\TestNode.cs" />
     <Compile Include="com\TestParameters.cs" />
@@ -95,10 +96,15 @@
       <DependentUpon>FrmMain.cs</DependentUpon>
     </Compile>
     <Compile Include="MainTps.cs" />
+    <Compile Include="models\ModulationIndexAndMaxFreqOffset.cs" />
+    <Compile Include="models\NoisePowerDensity.cs" />
+    <Compile Include="models\NormalTemperatureTest.cs" />
+    <Compile Include="models\PhaseNoise.cs" />
+    <Compile Include="models\PowerAndFreqStability.cs" />
     <Compile Include="models\SpuriousSuppression.cs" />
     <Compile Include="models\HarmonicSuppression.cs" />
-    <Compile Include="models\GainTestModel.cs" />
     <Compile Include="models\BaseModel.cs" />
+    <Compile Include="models\VoltAndCurrent.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="views\FrmDevice.cs">
       <SubType>Form</SubType>
@@ -134,8 +140,14 @@
     <None Include="bundle.config">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
-    <None Include="config\测试#常温测试#发射机测试.xlsx">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    <None Include="config\ModulationMode.xlsx">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="config\测试#常温检查#发射机.xlsx">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="config\测试#常温测试#发射机.xlsx">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">

+ 1 - 1
tps/TpsLabStudio/TpsLabStudio.csproj.user

@@ -5,6 +5,6 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
     <StartAction>Program</StartAction>
-    <StartProgram>D:\000Code\0.TpsLabStudio_LTS\Master\exe\JGWorks.exe</StartProgram>
+    <StartProgram>F:\Code\Transmitter-1-New\TpsLabStudio_LTS\exe\JGWorks.exe</StartProgram>
   </PropertyGroup>
 </Project>

+ 2 - 2
tps/TpsLabStudio/bundle.config

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <configuration>
   <!--DevHostApp.dll 与bundle.config在同一个目录下-->
-  <Activator BundleName="林泉发射机测试" Assembly="Tps_LQ_Transmitter.dll" Type="Tps_LQ_Transmitter.Bundle"/>
+  <Activator BundleName="发射机测试" Assembly="Tps_LQ_Transmitter.dll" Type="Tps_LQ_Transmitter.Bundle"/>
   <Extension Point="MainPage">
-    <Node Name="林泉发射机测试A" Page="测试项目" Group="测试项目" Text="发射机测试A" Type="Tps_LQ_Transmitter.FrmMain" Image="aa.png" IsLazyLoad="true" Order="2" />
+    <Node Name="发射机测试" Page="测试项目" Group="测试项目" Text="发射机测试" Type="Tps_LQ_Transmitter.FrmMain" Image="aa.png" IsLazyLoad="true" Order="2" />
   </Extension>
 </configuration>

+ 51 - 0
tps/TpsLabStudio/com/SerialPort.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO.Ports;
+
+namespace Tps_LQ_Transmitter.com
+{
+    class TransmitterSerialPort
+    {
+        public void DUT_Transmitter_Ctrol(string PORT, byte FreqSelect)
+        {
+            SerialPort sp = new SerialPort(); //新建一个串口对象
+            sp.PortName = PORT;     //端口号设置为com_port的值
+            sp.BaudRate = 115200;
+            sp.DataBits = 8;
+            sp.StopBits = StopBits.One;//停止位设置为com_stop的值
+            sp.Parity = Parity.None;//获取奇偶校验选项的值
+            sp.ReadTimeout = 1000;    //读取等待时间无限长
+            sp.RtsEnable = true;
+            try
+            {
+                sp.Open();  //打开串口
+            }
+            catch (Exception e2)
+            {
+                Console.WriteLine("open err:" + e2.Message);
+            }
+            byte[] JGbuffer = new byte[4];
+         
+            int offset = 0;
+            JGbuffer[offset++] = 0xEB;
+            JGbuffer[offset++] = 0x90;
+            JGbuffer[offset++] = FreqSelect;//切频点
+            JGbuffer[offset++] = 0x55;
+
+            try
+            {
+                sp.Write(JGbuffer, 0, JGbuffer.Length);
+            }
+            catch (Exception ex)
+            {
+                throw new Exception($"write com error msg:{ex.Message}");
+            }
+            sp.Close();
+
+        }
+    }
+
+}

BIN
tps/TpsLabStudio/config/ModulationMode.xlsx


BIN
tps/TpsLabStudio/config/测试#常温检查#发射机.xlsx


exe/apps/Tps_LQ_Transmitter/config/测试#常温测试#发射机测试.xlsx → tps/TpsLabStudio/config/测试#常温测试#原.xlsx


BIN
tps/TpsLabStudio/config/测试#常温测试#发射机.xlsx


BIN
tps/TpsLabStudio/config/测试#常温测试#发射机测试.xlsx


+ 0 - 68
tps/TpsLabStudio/models/GainTestModel.cs

@@ -1,68 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using Tps_LQ_Transmitter.com;
-using AppLibs.Devices;
-
-namespace Tps_LQ_Transmitter.models
-{
-    /// <summary>
-    /// 增益测试测试模板,继承自指标测试模板基类
-    /// </summary>
-    public class GainTestModel : BaseModel
-    {
-        /// <summary>
-        /// 测试模板名称,测试指标配置表中的模板名称源自这个参数
-        /// </summary>
-        public GainTestModel()
-        {
-            //首先要定义模板名称,excel 自动测试项总表中的指标测试模板的名称要和这个名称一致
-            TemplateName = "增益测试模板"; 
-        }
-
-        /// <summary>
-        /// 重写的Run方法,当执行到这个测试指标项时,Run会被调用
-        /// </summary>
-        /// <param name="parameters"></param>
-        /// <returns></returns>
-        public override bool Run(TestNode parameters)
-        {
-            //检查当前指标需要的仪器是否OK,
-            var sig = this.tps.GetDevice("信号源1");
-            var spe = this.tps.GetDevice("频谱仪");
-            if(sig == null || spe == null)
-            {
-                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行",parameters.Channel,parameters.Name));
-                return false;
-            }
-
-            int[] values = parameters.Parameters.GetParameterToArray<int>("频率");
-            int delay  = parameters.Parameters.GetParameter<int>("通道延迟");
-
-            if (values == null)
-            {
-                ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行",parameters.Channel,parameters.Name));
-                return false;
-            }
-
-            //开始测试
-            this.tps.SetTestTableCellValue(0, 4, values[0]);
-            this.tps.SetTestTableCellValue(0, 5, values[1]);
-            this.tps.SetTestTableCellValue(0, 6, values[2]);
-            tps.SetManualTableCellValue(0, 2, delay);
-
-            //当测试过程比较久时,要走合适的地方检测IsRuning
-            if (IsRuning == false)
-            {
-                //过程中如果IsRunning为false,表示按了停止测试按钮,要退出程序运行
-                return false;
-            }
-
-            return true;
-        }
-
-    }
-}

+ 264 - 4
tps/TpsLabStudio/models/HarmonicSuppression.cs

@@ -2,22 +2,282 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using Tps_LQ_Transmitter.com;
 
 namespace Tps_LQ_Transmitter.models
 {
-    public class HarmonicSuppression : BaseModel
+    class HarmonicSupperssion : BaseModel
     {
-        public HarmonicSuppression()
+        public HarmonicSupperssion()
         {
             TemplateName = "谐波抑制测试";
         }
-
+        /// <summary>
+        /// 谐波抑制测试
+        /// </summary>
         public override bool Run(TestNode parameters)
         {
+            double y_value, x_value;
+            Random random = new Random();
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            OutData Data = new OutData();
+            DataType HarmonicSuppressionPrint = new DataType();
+
+            //if (SA == null)
+            //{
+            //    ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+            //    return false;
+            //}
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
+            PowerPara.SmallSignalREF = parameters.Parameters.GetParameter<string>("小信号参考电平(REF)");
+            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.HarmonicSuppressionLower = parameters.Parameters.GetParameter<double>("谐波抑制下限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.SPAN == null) || (PowerPara.REF == null) ||(PowerPara.SmallSignalREF==null)|| (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.HarmonicTime == null)
+                ||(PowerPara.HarmonicSuppressionLower==0))
+            {
+                ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            if (PowerPara.ControlDelay == 0)
+            {
+                PowerPara.ControlDelay = 10;
+            }
+            if (false)//需具备仪器
+            {
+                SA.Write("仪器复位"); SA.Query("OPC");
+                SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
+                SA.Write("VBW", PowerPara.VBW); SA.Query("OPC");
+                SA.Write("SingleOrCont", "0"); SA.Query("OPC");
+            }
+
+
+            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;
+            int harmonic_num;
+            double Power;
+            Data.HarmonicSuppression = new double[PowerPara.FrequencyNumber,PowerPara.HarmonicTime.Length];
+           
+            for (int point = 0; ; point++)
+            {
+
+                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                {
+                    break;
+                }
+                if(false)//需具备仪器
+                {
+                    //控制
+                    SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
+                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+
+                    SA.Write("REF", PowerPara.REF); SA.Query("OPC");
+                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    Power = y_value;
+
+                }
+
+
+                double[] HarmonicTimeVal = new double[PowerPara.HarmonicTime.Length];
+                double HarmonicMinTimeVal = 0;
+                if (false)//需具备仪器
+                {
+                    SA.Write("REF", PowerPara.SmallSignalREF); SA.Query("OPC");
+
+                    for (harmonic_num = 0; harmonic_num < PowerPara.HarmonicTime.Length; harmonic_num++)
+                    {
+                        SA.Write("CENTER", (CenterFreq * PowerPara.HarmonicTime[harmonic_num]).ToString()); SA.Query("OPC");//N次谐波
+                        PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                        Data.HarmonicSuppression[point, harmonic_num] = Math.Round(Power - y_value, 2);
+
+                        HarmonicTimeVal[harmonic_num] = Data.HarmonicSuppression[point, harmonic_num];
+                    }
+
+                    if (PowerPara.HarmonicTime.Length > 1)//计算几次谐波中的最小值
+                    {
+                        HarmonicMinTimeVal = HarmonicTimeVal.Min();
+                    }
+                    else
+                    {
+                        HarmonicMinTimeVal = HarmonicTimeVal[0];
+                    }
+
+                }
+
+
+                HarmonicSuppressionPrint.Lower = PowerPara.HarmonicSuppressionLower;
+                HarmonicSuppressionPrint.TestVal = HarmonicMinTimeVal;
+                HarmonicSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
+                if (HarmonicSuppressionPrint.TestVal >= HarmonicSuppressionPrint.Lower)
+                {
+                    HarmonicSuppressionPrint.Result = true;
+                }
+                else
+                {
+                    HarmonicSuppressionPrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    tps.SetTestTableCellValue(point, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    tps.SetTestTableCellValue(point + 15, 15, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);
+                }
+
+            }
+
+            
+            return true;
+        }
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置小信号参考电平
+            /// </summary>
+            public string SmallSignalREF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 谐波次数
+            /// </summary>
+            public int[] HarmonicTime { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 谐波抑制下限
+            /// </summary>
+            public double HarmonicSuppressionLower { set; get; }
+        }
+        public class OutData
+        {
+            /// <summary>
+            //谐波抑制
+            /// </summary>
+            public double[,] HarmonicSuppression { set; get; }
+           
+            
+
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
 
-            return IsPassed;
         }
     }
+    
+
 }

+ 438 - 0
tps/TpsLabStudio/models/ModulationIndexAndMaxFreqOffset.cs

@@ -0,0 +1,438 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.IO;
+using System.Threading.Tasks;
+using Tps_LQ_Transmitter.com;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class ModulationIndexAndMaxFreqOffset: BaseModel
+    {
+        public ModulationIndexAndMaxFreqOffset()
+        {
+            TemplateName = "调制指数及最大频偏指标测试";
+        }
+        /// <summary>
+        /// 功率及频率稳定度测试
+        /// </summary>
+        public override bool Run(TestNode parameters)
+        {
+            double y_value, x_value;
+            Random random = new Random();
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            OutData Data = new OutData();
+            DataType ModulationIndexPrint = new DataType();
+            DataType MaxFreqOffsetPrint = new DataType();
+
+            //if (SA == null)
+            //{
+            //    ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+            //    return false;
+            //}
+            MatchModulaPara CfigModuParas = new MatchModulaPara();
+            CfigModuParas = LoadModulationWorkBook();
+
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            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.ModulationIndexLower = parameters.Parameters.GetParameter<double>("调制系数下限");
+            PowerPara.ModulationIndexUpper = parameters.Parameters.GetParameter<double>("调制系数上限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (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 (false)//需具备仪器
+            {
+                SA.Write("仪器复位"); SA.Query("OPC");
+                SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                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("SingleOrCont", "0"); SA.Query("OPC");
+                SA.Write("MARK打开", "1"); SA.Query("OPC");
+                SA.Write("MARK打开", "2"); SA.Query("OPC");
+                SA.Write("DELT打开", "2"); SA.Query("OPC");
+            }
+
+
+            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[] PowerDelt = new double[PowerPara.FrequencyNumber];
+            Data.ModulationIndex = new string[PowerPara.FrequencyNumber];
+            Data.MaxFreqOffset = new string[PowerPara.FrequencyNumber];
+           
+            for (int point = 0;; point++)
+            {           
+                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                if (CenterFreq > PowerPara.StopFrequency ||( PowerPara.FrequencyNumber == 1 && point == 1))
+                {
+                    break;
+                }
+                if(false)//需具备仪器
+                {
+                    // 控制
+                    SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
+                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+
+
+
+                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("PEAK", "1"); SA.Query("OPC");
+                    SA.Write("NextPeak", "2"); SA.Query("OPC");
+
+                    if(SA.Query("IDN")=="N9030A")//N9030A型号频谱仪
+                    {
+                        PowerDelt[point] = double.Parse(SA.Query("读MARK功率", "2")); SA.Query("OPC");
+                    }
+                    else//其他型号频谱仪
+                    {
+                        PowerDelt[point] = double.Parse(SA.Query("读DELT功率", "2")); SA.Query("OPC");
+                    }
+                    
+
+                }
+
+                PowerDelt[point] = random.Next(500, 1200) / 100.0;//随机数
+                double temp = 30;
+                string RelativeVal= "0";
+                foreach (KeyValuePair<string, ModulationMatchParameter> kvp in CfigModuParas.ModulaParameters)
+                {
+                    if ((Math.Abs(PowerDelt[point] - double.Parse(kvp.Value.CfgRelative))) < temp)
+                    {
+                        temp = Math.Abs(PowerDelt[point] - double.Parse(kvp.Value.CfgRelative));
+                        RelativeVal = kvp.Value.CfgRelative;
+                    }                    
+                }
+
+                Data.ModulationIndex[point] = CfigModuParas.GetModulaParameter(RelativeVal);//调制系数
+               // Data.MaxFreqOffset[point] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//最大频偏
+
+                ModulationIndexPrint.Lower = PowerPara.ModulationIndexLower;
+                ModulationIndexPrint.Upper = PowerPara.ModulationIndexUpper;
+                ModulationIndexPrint.TestVal = double.Parse(Data.ModulationIndex[point]);
+                if (ModulationIndexPrint.TestVal >= ModulationIndexPrint.Lower && ModulationIndexPrint.TestVal <= ModulationIndexPrint.Upper)
+                {
+                    ModulationIndexPrint.Result = true;
+                }
+                else
+                {
+                    ModulationIndexPrint.Result = false;
+                }
+
+                if (parameters.Channel == "通道1")
+                {
+                    tps.SetTestTableCellValue(point, 9, ModulationIndexPrint.Result,Data.ModulationIndex[point]);
+                   // tps.SetTestTableCellValue(point, 6, Data.MaxFreqOffset[point]);
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    tps.SetTestTableCellValue(point + 15, 9, ModulationIndexPrint.Result, Data.ModulationIndex[point]);
+                    //tps.SetTestTableCellValue(point + 15, 6, Data.MaxFreqOffset[point]);
+                }
+
+            }
+            return true;
+        }
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public MatchModulaPara LoadModulationWorkBook()
+        {
+            MatchModulaPara pars = new MatchModulaPara();
+            string FileName = Path.Combine(Bundle.bundle.BundleDir, "config\\ModulationMode.xlsx");
+            if (!File.Exists(FileName))
+            {
+                ShowMessage(MsgType.Error, "找不到ModulationMode.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("功率变化(dB)"))
+                {
+                    List<ModulationMatchParameter> ModulationTable = ReadParameters(sheet, num);
+
+                    foreach (var item in ModulationTable)
+                    {
+                        if (pars.ModulaParameters.ContainsKey(item.CfgRelative))
+                        {
+                            ShowMessage(MsgType.Error, string.Format("调制对应表:{0} 存在同名参数:{1},无法重复添加参数", sheet.Name, item.CfgRelative));
+                            continue;
+                        }
+                        pars.ModulaParameters.Add(item.CfgRelative, item);
+                    } 
+                }
+            }
+            return pars;
+        }
+
+
+
+        List<ModulationMatchParameter> ReadParameters(Spire.Xls.Worksheet sheet, int rowIndex)
+        {
+            List<ModulationMatchParameter> ModulationTable = new List<ModulationMatchParameter>();
+            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() : "";
+        
+            if (!(col1 == "功率变化(dB)" && col2 == "调制指数(mf)" && col3 == "最大频偏(KHz)"))
+            {
+                ShowMessage(MsgType.Error, "'调制对应表'行首标题位置和格式不正确");
+                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() : "";          
+                if (string.IsNullOrEmpty(col1) || string.IsNullOrEmpty(col2) || string.IsNullOrEmpty(col3))
+                {
+                    break;
+                }
+                ModulationMatchParameter ObjModulation = new ModulationMatchParameter();
+                ObjModulation.CfgRelative = col1;
+                ObjModulation.CfgModulation = col2;
+                ObjModulation.CfgFreqOffset = col3;
+     
+                ModulationTable.Add(ObjModulation);
+            }
+            return ModulationTable;
+        }
+
+
+
+        /// <summary>
+        /// 一个调制指数的配置信息
+        /// </summary>
+        public class MatchModulaPara
+        {
+            public Dictionary<string, ModulationMatchParameter> ModulaParameters;
+            public MatchModulaPara()
+            {
+                ModulaParameters = new Dictionary<string, ModulationMatchParameter>();
+            }
+            public string GetModulaParameter(string name)
+            {
+                if (string.IsNullOrEmpty(name))
+                    return null;
+
+                if (this.ModulaParameters.ContainsKey(name) == false)
+                    return null;
+
+                string val1 = this.ModulaParameters[name].CfgModulation.Trim();
+                return val1;
+            }
+            public string GetFreqOffsetParameter(string name)
+            {
+                if (string.IsNullOrEmpty(name))
+                    return null;
+
+                if (this.ModulaParameters.ContainsKey(name) == false)
+                    return null;
+
+                string val2 = this.ModulaParameters[name].CfgFreqOffset.Trim();
+                return val2;
+            }
+        }
+        
+        /// <summary>
+        /// 调制指数3个对应项
+        /// </summary>
+        public class ModulationMatchParameter
+        {
+            
+            /// <summary>
+            /// 功率变化(dB)
+            /// </summary>
+            public string  CfgRelative{ get; set; }
+            /// <summary>
+            /// 调制指数(mf)
+            /// </summary>
+            public string CfgModulation { get; set; }
+            /// <summary>
+            /// 最大频偏(KHz)
+            /// </summary>
+            public string CfgFreqOffset { get; set; }
+
+          
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 调制系数下限
+            /// </summary>
+            public double ModulationIndexLower { get; set; }
+            /// <summary>
+            ///调制系数上限
+            /// </summary>
+            public double ModulationIndexUpper { get; set; }
+        }
+        public class OutData
+        {
+
+            /// <summary>
+            ///调制系数
+            /// </summary>
+            public string[] ModulationIndex { set; get; }
+            /// <summary>
+            /// 最大频偏
+            /// </summary>
+            public string[] MaxFreqOffset { set; get; }
+           
+
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+}

+ 234 - 0
tps/TpsLabStudio/models/NoisePowerDensity.cs

@@ -0,0 +1,234 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tps_LQ_Transmitter.com;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class NoisePowerDensity: BaseModel
+    {
+        public NoisePowerDensity()
+        {
+            TemplateName = "噪声功率谱密度测试";
+        }
+        /// <summary>
+        /// 噪声功率谱密度测试
+        /// </summary>
+        public override bool Run(TestNode parameters)
+        {
+            double y_value, x_value;
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+           
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            OutData Data = new OutData();
+            DataType NoisePowerPrint = new DataType();
+
+            if (SA == null)
+            {
+                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+
+            
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            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.NoisePowerUpper = parameters.Parameters.GetParameter<double>("噪声功率谱密度上限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.SPAN == 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;
+            }
+            SA.Write("仪器复位"); SA.Query("OPC");
+            SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+            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("SingleOrCont", "0"); SA.Query("OPC");
+            SA.Write("MARK打开", "1"); SA.Query("OPC");
+
+            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];
+        
+            for (int point = 0;; point++)
+            {      
+                
+                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            
+
+                SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                SA.Write("PEAK", "1"); SA.Query("OPC");
+                SA.Write("设置MARK为NOISe","1"); SA.Query("OPC");
+                Data.NoisePower[point] = SA.Query("读噪声功率谱密度", "1");
+             
+                NoisePowerPrint.Upper = PowerPara.NoisePowerUpper;
+                NoisePowerPrint.TestVal = Math.Round(double.Parse(Data.NoisePower[point]),2)  ;
+                if ( NoisePowerPrint.TestVal <= NoisePowerPrint.Upper)
+                {
+                    NoisePowerPrint.Result = true;
+                }
+                else
+                {
+                    NoisePowerPrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    //tps.SetTestTableCellValue(point, 9,  NoisePowerPrint.Result ,NoisePowerPrint.TestVal);                    
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    //tps.SetTestTableCellValue(point + 15, 9,  NoisePowerPrint.Result ,NoisePowerPrint.TestVal);                  
+                }
+            }
+            SA.Write("设置MARK为常规", "1"); SA.Query("OPC");
+            SA.Write("关闭所有MARK"); SA.Query("OPC");
+            return true;
+        }
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 噪声功率上限
+            /// </summary>
+            public double NoisePowerUpper{set;get;}
+        }
+        public class OutData
+        {
+
+            /// <summary>
+            ///噪声功率谱密度
+            /// </summary>
+            public string[] NoisePower { set; get; }
+            
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+}

+ 798 - 0
tps/TpsLabStudio/models/NormalTemperatureTest.cs

@@ -0,0 +1,798 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using System.Threading;
+using Tps_LQ_Transmitter.com;
+using System.Diagnostics;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class NormalTemperatureTest : BaseModel
+    {
+        public NormalTemperatureTest()
+        {
+            TemplateName = "常温检查测试";
+        }
+        public override bool Run(TestNode parameters)
+        {
+            DateTime currentTime1 = new DateTime();       
+            Random random = new Random();
+            
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪"); 
+            var DC = this.tps.GetDevice("程控电源");
+
+            /*
+            if (DC == null || SA == null)
+            {
+                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            */
+            ConfigParameter PowerPara = new ConfigParameter();
+            PowerPara.IntervalTime = parameters.Parameters.GetParameter<int>("相对时间");//min
+            PowerPara.TestTime = parameters.Parameters.GetParameter<int>("测试次数");//min
+            int IntervalTime = (int)(PowerPara.IntervalTime * 60);//将min转换成s        
+          
+            int time=0;
+            Stopwatch TimesCounter = new Stopwatch();
+           
+            while ( time < PowerPara.TestTime)
+            {
+                currentTime1 = DateTime.Now;
+                TimesCounter.Restart();
+                tps.SetTestTableCellValue(time, 3, true, currentTime1.Hour.ToString()+":"+ currentTime1.Minute.ToString());//测试时间
+                tps.SetTestTableCellValue(time + PowerPara.TestTime, 3, true, currentTime1.Hour.ToString() + ":" + currentTime1.Minute.ToString());//测试时间
+                MainTest(parameters,time);             
+                
+                while (TimesCounter.Elapsed.TotalSeconds <= IntervalTime && time!= PowerPara.TestTime-1)
+                {
+                    Thread.Sleep(100);
+                    if (IsRuning == false)
+                    {
+                        return false;
+                    }
+
+                }
+                TimesCounter.Stop();
+                time = time + 1;
+            }
+   
+            return true;
+        }
+        public bool MainTest(TestNode parameters,int time)
+        {
+           
+            Random random = new Random();
+            DataType VoltDataPrint = new DataType();
+            DataType CurrentDataPrint = new DataType();
+            DataType PowerPrint = new DataType();//功率(dBm)
+            DataType FreqPrint = new DataType();//实测频率
+            DataType FreqAccuracyPrint = new DataType();//频率稳定度
+            DataType PowerSumPrint = new DataType();//两路功率总和(w)
+            DataType PowerFlatnessPrint = new DataType();//两路功率不平度(dB)
+            DataType ModulationIndexPrint = new DataType();
+            DataType MaxFreqOffsetPrint = new DataType();
+            DataType DBMaxFreqOffsetPrint = new DataType();
+            DataType SpuriousSuppressionPrint = new DataType();
+            DataType HarmonicSuppressionPrint = new DataType();
+
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+            var DC = this.tps.GetDevice("程控电源");
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            TestPara Data = new TestPara();
+
+            /*
+            if (DC == null || SA == null)
+            {
+                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            */
+            MatchModulaPara CfigModuParas = new MatchModulaPara();
+            CfigModuParas = LoadModulationWorkBook();
+
+            ConfigParameter PowerPara = new ConfigParameter();
+            PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
+            PowerPara.OutLoss = parameters.Parameters.GetParameter<double>("输出损耗");
+            PowerPara.ChannelPara = 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.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
+            PowerPara.SmallSignalREF = parameters.Parameters.GetParameter<string>("小信号参考电平(REF)");
+            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.VoltLower = parameters.Parameters.GetParameter<double>("电压下限");
+            PowerPara.VoltUpper = parameters.Parameters.GetParameter<double>("电压上限");
+            PowerPara.CurrentLower = parameters.Parameters.GetParameter<double>("电流下限");
+            PowerPara.CurrentUpper = parameters.Parameters.GetParameter<double>("电流上限");
+            PowerPara.PowerLower = parameters.Parameters.GetParameter<double>("功率下限");
+            PowerPara.PowerUpper = parameters.Parameters.GetParameter<double>("功率上限");
+            //PowerPara.FreqAccuracyUpper = parameters.Parameters.GetParameter<double>("频率稳定度上限");
+           // PowerPara.PowerFlatnessUpper = parameters.Parameters.GetParameter<double>("功率不平度上限");
+          //  PowerPara.ModulationIndexLower = parameters.Parameters.GetParameter<double>("调制系数下限");
+          //  PowerPara.ModulationIndexUpper = parameters.Parameters.GetParameter<double>("调制系数上限");
+            PowerPara.MaxFreqOffsetLower = parameters.Parameters.GetParameter<double>("最大频偏(KHz)下限");
+            PowerPara.MaxFreqOffsetUpper = parameters.Parameters.GetParameter<double>("最大频偏(KHz)上限");
+            PowerPara.SpuriousSuppressionLower = parameters.Parameters.GetParameter<double>("杂波抑制下限");
+            PowerPara.HarmonicSuppressionLower = parameters.Parameters.GetParameter<double>("谐波抑制下限");
+
+
+            if ((PowerPara.StartFrequency == 0) ||(PowerPara.ChannelPara == 0) ||((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.PowerLower == 0)
+                || (PowerPara.PowerUpper == 0) || (PowerPara.MaxFreqOffsetLower == 0) || (PowerPara.MaxFreqOffsetUpper == 0) || (PowerPara.SpuriousSuppressionLower == 0)
+                ||(PowerPara.HarmonicSuppressionLower == 0))
+            {
+                ShowMessage(MsgType.Error, string.Format("配置文件中频率参数为空,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            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;
+            }
+            int channel = 0;
+            int point = 0;
+            bool Result;
+            double CenterFreq;
+            double[] PowerDelt = new double[PowerPara.FrequencyNumber];
+            Data.Power = new double[PowerPara.FrequencyNumber];
+            Data.Freq = new double[PowerPara.FrequencyNumber];
+            Data.FreqAccuracy = new double[PowerPara.FrequencyNumber];
+            Data.ModulationIndex = new string[PowerPara.FrequencyNumber];
+            Data.MaxFreqOffset = new string[PowerPara.FrequencyNumber];
+            Data.DBMaxFreqOffset = new string[PowerPara.FrequencyNumber];
+
+
+            for (channel = 0; channel < PowerPara.ChannelPara; channel++)
+            {
+                #region 输出功率、频率、电压、电流、调制频偏dB、调制频偏KHz测试
+                //SA.Write("仪器复位"); SA.Query("OPC");
+                //SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                //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("SingleOrCont", "0"); SA.Query("OPC");
+                //SA.Write("MARK打开", "1"); SA.Query("OPC");
+                //SA.Write("MARK打开", "2"); SA.Query("OPC");
+                //SA.Write("DELT打开", "2"); SA.Query("OPC");
+                for (point = 0; ; point++)
+                {
+                    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
+
+
+                    #region 电压、电流测试
+                    //Data.VoltVal[point] = DC.Query("读取电压");
+                    //Data.CurrentVal[point] = DC.Query("读取电流");
+                    VoltDataPrint.Lower = PowerPara.VoltLower;
+                    VoltDataPrint.Upper = PowerPara.VoltUpper;
+                    //VoltDataPrint.TestVal = double.Parse(Data.VoltVal[point]);
+                    VoltDataPrint.TestVal = random.Next(2500, 3000) / 100.0;//随机数
+                    Judge(VoltDataPrint.Lower, VoltDataPrint.Upper, VoltDataPrint.TestVal, out Result);
+                    VoltDataPrint.Result = Result;
+
+                    CurrentDataPrint.Lower = PowerPara.CurrentLower;
+                    CurrentDataPrint.Upper = PowerPara.CurrentUpper;
+                    //CurrentDataPrint.TestVal = double.Parse(Data.CurrentVal[point]);
+                    CurrentDataPrint.TestVal = random.Next(90, 160) / 100.0;
+                    Judge(CurrentDataPrint.Lower, CurrentDataPrint.Upper, CurrentDataPrint.TestVal, out Result);
+                    CurrentDataPrint.Result = Result;
+                    #endregion
+
+                    #region 输出功率、频率测试
+                    //SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    //SA.Write("PEAK", "1"); SA.Query("OPC");
+                    //SA.Write("NextPeak", "2"); SA.Query("OPC");
+                    // PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
+                    // Data.Power[point] = y_value + PowerPara.OutLoss;//功率
+                    Data.Power[point] = random.Next(3000, 4000) / 100.0;//随机数
+                  
+                    PowerPrint.TestVal = Math.Round(Math.Pow(10, (Data.Power[point] / 10)) / 1000, 2);//功率W                  
+                    Judge(PowerPara.PowerLower, PowerPara.PowerUpper, PowerPrint.TestVal, out Result);
+                    PowerPrint.Result = Result;
+
+
+
+
+                    FreqPrint.Lower = 0 - ((PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq);
+                    FreqPrint.Upper = (PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq;
+                    // FreqPrint.TestVal = Math.Round(x_value / 1000000, 3);//实测频率
+                    FreqPrint.TestVal = random.Next(-600, 6000) / 100.0 + CenterFreq;//随机数
+                    Judge(FreqPrint.Lower, FreqPrint.Upper, FreqPrint.TestVal, out Result);
+                    FreqPrint.Result = Result;
+
+                    #endregion
+
+                    #region 调制测试
+                    //PowerDelt[point] = double.Parse(SA.Query("读DELT功率", "2")); SA.Query("OPC");
+                    PowerDelt[point] = random.Next(500, 1200) / 100.0;//随机数
+                    double temp = 30;
+                    string RelativeVal = "0";
+                    foreach (KeyValuePair<string, ModulationMatchParameter> kvp in CfigModuParas.ModulaParameters)
+                    {
+                        if ((Math.Abs(PowerDelt[point] - double.Parse(kvp.Value.CfgRelative))) < temp)
+                        {
+                            temp = Math.Abs(PowerDelt[point] - double.Parse(kvp.Value.CfgRelative));
+                            RelativeVal = kvp.Value.CfgRelative;
+                        }
+                    }
+
+                    //Data.ModulationIndex[point] = CfigModuParas.GetModulaParameter(RelativeVal);//调制系数
+                 
+                    Data.MaxFreqOffset[point] = CfigModuParas.GetFreqOffsetParameter(RelativeVal);//最大频偏kHz
+                    Data.DBMaxFreqOffset[point] = PowerDelt[point].ToString();//最大频偏dB
+
+  
+                    //ModulationIndexPrint.TestVal = double.Parse(Data.ModulationIndex[point]);
+                    //Judge (PowerPara.ModulationIndexLower, PowerPara.ModulationIndexUpper, ModulationIndexPrint.TestVal, out Result);
+                    //ModulationIndexPrint.Result = Result;
+
+                    
+                    MaxFreqOffsetPrint.TestVal = double.Parse(Data.MaxFreqOffset[point]);
+                    DBMaxFreqOffsetPrint.TestVal = double.Parse(Data.DBMaxFreqOffset[point]);
+
+                    Judge(PowerPara.MaxFreqOffsetLower, PowerPara.MaxFreqOffsetUpper, MaxFreqOffsetPrint.TestVal, out Result);
+                    MaxFreqOffsetPrint.Result = Result;
+                    DBMaxFreqOffsetPrint.Result = Result;
+
+                    #endregion
+                    if (channel == 0)
+                    {
+                        //  tps.SetTestTableCellValue(point, 2, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//相对时间(min)
+                        //  tps.SetTestTableCellValue(point, 3, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//绝对时间
+                        tps.SetTestTableCellValue(point + time, 4, VoltDataPrint.Result, VoltDataPrint.TestVal);//供电电压(V)
+                        tps.SetTestTableCellValue(point + time, 5, CurrentDataPrint.Result, CurrentDataPrint.TestVal);//消耗电流(A)
+                        tps.SetTestTableCellValue(point + time, 6, FreqPrint.Result, FreqPrint.TestVal);//输出频率(kHz)
+                        tps.SetTestTableCellValue(point + time, 7, DBMaxFreqOffsetPrint.Result, DBMaxFreqOffsetPrint.TestVal);//调制频偏(dB)
+                        tps.SetTestTableCellValue(point + time, 8, MaxFreqOffsetPrint.Result, MaxFreqOffsetPrint.TestVal);//调制频偏(kHz)
+                        tps.SetTestTableCellValue(point + time, 9, PowerPrint.Result, PowerPrint.TestVal);//输出功率(W)
+
+                    }
+                    else if (channel == 1)
+                    {
+                        // tps.SetTestTableCellValue(point + 5, 2, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//相对时间(min)
+                        // tps.SetTestTableCellValue(point + 5, 3, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//绝对时间
+                        tps.SetTestTableCellValue(point + time + 5, 4, VoltDataPrint.Result, VoltDataPrint.TestVal);//供电电压(V)
+                        tps.SetTestTableCellValue(point + time + 5, 5, CurrentDataPrint.Result, CurrentDataPrint.TestVal);//消耗电流(A)
+                        tps.SetTestTableCellValue(point + time + 5, 6, FreqPrint.Result, FreqPrint.TestVal);//输出频率(kHz)
+                        tps.SetTestTableCellValue(point + time + 5, 7, DBMaxFreqOffsetPrint.Result, DBMaxFreqOffsetPrint.TestVal);//调制频偏(dB)
+                        tps.SetTestTableCellValue(point + time + 5, 8, MaxFreqOffsetPrint.Result, MaxFreqOffsetPrint.TestVal);//调制频偏(kHz)
+                        tps.SetTestTableCellValue(point + time + 5, 9, PowerPrint.Result, PowerPrint.TestVal);//输出功率(W)
+
+                    }
+                }
+
+                #endregion
+                #region 杂波抑制
+                //SA.Write("仪器复位"); SA.Query("OPC");
+                //SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                //SA.Write("REF", PowerPara.SmallSignalREF); SA.Query("OPC");
+                //SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
+                //SA.Write("VBW", PowerPara.VBW); SA.Query("OPC");
+                //SA.Write("SingleOrCont", "0"); SA.Query("OPC");
+                for (point = 0; ; point++)
+                {
+                    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               
+
+                    //SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    //PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    //Power = y_value;
+                    ////测主频左侧杂散
+                    //SA.Write("START", PowerPara.LeftStart.ToString()); SA.Query("OPC");
+                    //SA.Write("STOP", (CenterFreq - PowerPara.LeftOffset).ToString()); SA.Query("OPC");
+                    //PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    //PowerLeft = Power - y_value;
+                    ////测主频右侧杂散
+                    //SA.Write("START", (CenterFreq + PowerPara.RightOffset).ToString()); SA.Query("OPC");
+                    //SA.Write("STOP", PowerPara.RightStop.ToString()); SA.Query("OPC");
+                    //PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    //PowerRigth = Power - y_value;
+                    SpuriousSuppressionPrint.Lower = PowerPara.SpuriousSuppressionLower;
+                    //SpuriousSuppressionPrint.TestVal = Math.Round(Math.Min(PowerLeft, PowerRigth), 2);
+                    SpuriousSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
+                    Judge(SpuriousSuppressionPrint.Lower, 201, SpuriousSuppressionPrint.TestVal, out Result);
+                    SpuriousSuppressionPrint.Result = Result;
+                    if (channel == 0)
+                    {
+                        tps.SetTestTableCellValue(point + time, 10, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//杂波抑制(dBc)
+                      
+                    }
+                    else if (channel == 1)
+                    {
+                        tps.SetTestTableCellValue(point + time + 5, 10, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);//杂波抑制(dBc)
+                     
+                    }
+
+                }
+                #endregion
+                #region 谐波抑制
+                //SA.Write("仪器复位"); SA.Query("OPC");
+                //SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                //SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
+                //SA.Write("VBW", PowerPara.VBW); SA.Query("OPC");
+                //SA.Write("SingleOrCont", "0"); SA.Query("OPC");
+                for (point = 0; ; point++)
+                {
+                    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
+
+
+                    //SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    //PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    //Power = y_value;
+
+                    double[] HarmonicTimeVal = new double[PowerPara.HarmonicTime.Length];
+                    double HarmonicMinTimeVal = 0;
+
+                    //for ( harmonic_num = 0; harmonic_num < PowerPara.HarmonicTime.Length; harmonic_num++)
+                    //{
+                    //    SA.Write("CENTER", (CenterFreq * PowerPara.HarmonicTime[harmonic_num]).ToString()); SA.Query("OPC");//N次谐波
+                    //    PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    //    Data.HarmonicSuppression[point,harmonic_num] = Math.Round( Power - y_value,2 );
+
+                    //    HarmonicTimeVal[harmonic_num] = Data.HarmonicSuppression[point, harmonic_num];
+                    //}
+
+                    //if (PowerPara.HarmonicTime.Length > 1)//计算几次谐波中的最小值
+                    //{
+                    //    HarmonicMinTimeVal = HarmonicTimeVal.Min();
+                    //}
+                    //else
+                    //{
+                    //    HarmonicMinTimeVal = HarmonicTimeVal[0];
+                    //}
+                    HarmonicSuppressionPrint.Lower = PowerPara.HarmonicSuppressionLower;
+                    HarmonicSuppressionPrint.TestVal = HarmonicMinTimeVal;
+                    HarmonicSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
+                    Judge(HarmonicSuppressionPrint.Lower, 201, HarmonicSuppressionPrint.TestVal, out Result);
+                    HarmonicSuppressionPrint.Result = Result;
+                    if (channel == 0)
+                    {
+                       
+                        tps.SetTestTableCellValue(point + time, 11, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);//谐波抑制(dBc)
+                    }
+                    else if (channel == 1)
+                    {
+                        
+                        tps.SetTestTableCellValue(point + time + 5, 11, HarmonicSuppressionPrint.Result, HarmonicSuppressionPrint.TestVal);//谐波抑制(dBc)
+                    }
+                }
+                #endregion
+                
+            }
+            return true;
+        
+        }
+        /// <summary>
+        /// 判断上下限
+        /// </summary>
+        /// <returns></returns>
+        public void Judge(double Lower,double Upper,double TestValue,out bool JudgeResult)
+        {
+            if (Upper >= 200)
+            {
+                if (TestValue >= Lower)
+                {
+                    JudgeResult = true;
+                }
+                else
+                {
+                    JudgeResult = false;
+                }
+            }
+            else if (Lower <= -200)
+            {
+                if (TestValue <= Upper)
+                {
+                    JudgeResult = true;
+                }
+                else
+                {
+                    JudgeResult = false;
+                }
+            }
+            else
+            {
+                if (TestValue >= Lower && TestValue <= Upper)
+                {
+                    JudgeResult = true;
+                }
+                else
+                {
+                    JudgeResult = false;
+                }
+            }
+           
+        }
+
+        public MatchModulaPara LoadModulationWorkBook()
+        {
+            MatchModulaPara pars = new MatchModulaPara();
+            string FileName = Path.Combine(Bundle.bundle.BundleDir, "config\\ModulationMode.xlsx");
+            if (!File.Exists(FileName))
+            {
+                ShowMessage(MsgType.Error, "找不到ModulationMode.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("功率变化(dB)"))
+                {
+                    List<ModulationMatchParameter> ModulationTable = ReadParameters(sheet, num);
+
+                    foreach (var item in ModulationTable)
+                    {
+                        if (pars.ModulaParameters.ContainsKey(item.CfgRelative))
+                        {
+                            ShowMessage(MsgType.Error, string.Format("调制对应表:{0} 存在同名参数:{1},无法重复添加参数", sheet.Name, item.CfgRelative));
+                            continue;
+                        }
+                        pars.ModulaParameters.Add(item.CfgRelative, item);
+                    }
+                }
+            }
+            return pars;
+        }
+
+
+
+        List<ModulationMatchParameter> ReadParameters(Spire.Xls.Worksheet sheet, int rowIndex)
+        {
+            List<ModulationMatchParameter> ModulationTable = new List<ModulationMatchParameter>();
+            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() : "";
+
+            if (!(col1 == "功率变化(dB)" && col2 == "调制指数(mf)" && col3 == "最大频偏(KHz)"))
+            {
+                ShowMessage(MsgType.Error, "'调制对应表'行首标题位置和格式不正确");
+                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() : "";
+                if (string.IsNullOrEmpty(col1) || string.IsNullOrEmpty(col2) || string.IsNullOrEmpty(col3))
+                {
+                    break;
+                }
+                ModulationMatchParameter ObjModulation = new ModulationMatchParameter();
+                ObjModulation.CfgRelative = col1;
+                ObjModulation.CfgModulation = col2;
+                ObjModulation.CfgFreqOffset = col3;
+
+                ModulationTable.Add(ObjModulation);
+            }
+            return ModulationTable;
+        }
+
+
+
+        /// <summary>
+        /// 一个调制指数的配置信息
+        /// </summary>
+        public class MatchModulaPara
+        {
+            public Dictionary<string, ModulationMatchParameter> ModulaParameters;
+            public MatchModulaPara()
+            {
+                ModulaParameters = new Dictionary<string, ModulationMatchParameter>();
+            }
+            public string GetModulaParameter(string name)
+            {
+                if (string.IsNullOrEmpty(name))
+                    return null;
+
+                if (this.ModulaParameters.ContainsKey(name) == false)
+                    return null;
+
+                string val1 = this.ModulaParameters[name].CfgModulation.Trim();
+                return val1;
+            }
+            public string GetFreqOffsetParameter(string name)
+            {
+                if (string.IsNullOrEmpty(name))
+                    return null;
+
+                if (this.ModulaParameters.ContainsKey(name) == false)
+                    return null;
+
+                string val2 = this.ModulaParameters[name].CfgFreqOffset.Trim();
+                return val2;
+            }
+        }
+
+        /// <summary>
+        /// 调制指数3个对应项
+        /// </summary>
+        public class ModulationMatchParameter
+        {
+
+            /// <summary>
+            /// 功率变化(dB)
+            /// </summary>
+            public string CfgRelative { get; set; }
+            /// <summary>
+            /// 调制指数(mf)
+            /// </summary>
+            public string CfgModulation { get; set; }
+            /// <summary>
+            /// 最大频偏(KHz)
+            /// </summary>
+            public string CfgFreqOffset { get; set; }
+
+
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 通道数量
+            /// </summary>
+            public int ChannelPara { set; get; }
+            /// <summary>
+            /// 测试次数
+            /// </summary>
+            public int TestTime { set; get; }
+            /// <summary>
+            /// 相对时间
+            /// </summary>
+            public int IntervalTime { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置小信号参考电平
+            /// </summary>
+            public string SmallSignalREF { set; get; }
+
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 谐波次数
+            /// </summary>
+            public int[] HarmonicTime { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 功率下限
+            /// </summary>
+            public double PowerLower { set; get; }
+            /// <summary>
+            /// 功率上限
+            /// </summary>
+            public double PowerUpper { set; get; }
+            /// <summary>
+            /// 频率稳定度上限
+            /// </summary>
+            public double FreqAccuracyUpper { set; get; }
+            /// <summary>
+            /// 两路功率总和下限
+            /// </summary>
+            public double PowerSumLower { set; get; }
+            /// <summary>
+            /// 功率不平度上限
+            /// </summary>
+            public double PowerFlatnessUpper { set; get; }
+            /// <summary>
+            /// 调制系数下限
+            /// </summary>
+            public double ModulationIndexLower { get; set; }
+            /// <summary>
+            ///调制系数上限
+            /// </summary>
+            public double ModulationIndexUpper { get; set; }
+            /// <summary>
+            /// 最大频偏kHz下限
+            /// </summary>
+            public double MaxFreqOffsetLower { get; set; }
+            /// <summary>
+            ///最大频偏kHz调制系数上限
+            /// </summary>
+            public double MaxFreqOffsetUpper { get; set; }
+
+            /// <summary>
+            /// 杂波抑制下限
+            /// </summary>
+            public double SpuriousSuppressionLower { set; get; }
+            // <summary>
+            /// 谐波抑制下限
+            /// </summary>
+            public double HarmonicSuppressionLower { set; get; }
+
+            /// <summary>
+            /// 电压下限
+            /// </summary>
+            public double VoltLower { set; get; }
+            /// <summary>
+            /// 电压上限
+            /// </summary>
+            public double VoltUpper { set; get; }
+            /// <summary>
+            /// 电流下限
+            /// </summary>
+            public double CurrentLower { set; get; }
+            /// <summary>
+            /// 电流上限
+            /// </summary>
+            public double CurrentUpper { set; get; }
+
+        }
+        public class TestPara
+        {
+            /// <summary>
+            /// 读电压值
+            /// </summary>
+            public string[] VoltVal { set; get; }
+            /// <summary>
+            /// 读电流值
+            /// </summary>
+            public string[] CurrentVal { set; get; }
+            /// <summary>
+            /// 输出功率(W)
+            /// </summary>
+            public double[] Power { set; get; }
+            /// <summary>
+            /// 频率稳定度
+            /// </summary>
+            public double[] FreqAccuracy { set; get; }
+            /// <summary>
+            /// 实测频点
+            /// </summary>
+            public double[] Freq { set; get; }
+            /// <summary>
+            /// 两路功率总和(W)
+            /// </summary>
+            public double[] PowerSum { set; get; }
+            /// <summary>
+            /// 两路功率不平度(dB)
+            /// </summary>
+            public double[] PowerFlatness { set; get; }
+            /// <summary>
+            ///调制系数
+            /// </summary>
+            public string[] ModulationIndex { set; get; }
+            /// <summary>
+            /// 最大频偏KHz
+            /// </summary>
+            public string[] MaxFreqOffset { set; get; }
+            /// <summary>
+            /// 最大频偏dB
+            /// </summary>
+            public string[] DBMaxFreqOffset { set; get; }
+
+
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+   
+}

+ 289 - 0
tps/TpsLabStudio/models/PhaseNoise.cs

@@ -0,0 +1,289 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tps_LQ_Transmitter.com;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class PhaseNoise: BaseModel
+    {
+        public PhaseNoise()
+        {
+            TemplateName = "相位噪声测试";
+        }
+        /// <summary>
+        /// 相位噪声测试
+        /// </summary>
+        public override bool Run(TestNode parameters)
+        {
+            double y_value, x_value;
+            
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+           
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            DataType PhaseNoisePrint = new DataType();//相位噪声
+            OutData Data = new OutData();
+
+            if (SA == null)
+            {
+                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.PNosieOffsetFreq = parameters.Parameters.GetParameterToArray<double>("相位噪声偏置频率");
+            PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            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.PhaseNoiseUpper = parameters.Parameters.GetParameter<double >("相位噪声上限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (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;
+            }
+            SA.Write("仪器复位"); SA.Query("OPC");
+            SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+            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("SingleOrCont", "0"); SA.Query("OPC");
+            SA.Write("MARK打开", "1"); SA.Query("OPC");
+            if(SA.Query("IDN") == "N9030A")
+            {
+                SA.Write("MARK打开", "2"); SA.Query("OPC");
+                SA.Write("DELT打开", "2"); SA.Query("OPC");
+
+            }
+            
+
+            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.PhaseNoise = new double[PowerPara.FrequencyNumber, PowerPara.PNosieOffsetFreq.Length];
+           
+            for (int point = 0;; point++)
+            {
+               
+                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
+
+                if (SA.Query("IDN") == "N9030A")//N9030A型号频谱仪
+                {
+                    SA.Write("相位噪声测试模式");
+                    SA.Query("OPC");
+                    SA.Write("相位噪声载波频率设置", CenterFreq.ToString()); SA.Query("OPC");
+                    //Psa.Write("相位噪声stopOffset", "200000"); Psa.QueryTimeout("OPC", 3000);
+                    //Psa.Write("相位噪声startOffset", "20"); Psa.QueryTimeout("OPC", 3000);
+                    SA.Write("相位噪声关闭平均");
+                    SA.Query("OPC");
+                    SA.Write("相位噪声打开MarkTable");
+                    SA.Query("OPC");
+                    SA.Write("相位噪声测试");
+                    SA.Query("OPC");
+                }
+                else
+                {
+                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    SA.Write("PEAK", "1"); SA.Query("OPC");
+                    SA.Write("相位噪声测试模式", "2"); SA.Query("OPC");
+
+                }
+      
+                double[] PhaseNoiseOffsetVal = new double[PowerPara.PNosieOffsetFreq.Length];
+                double PhaseNoiseMaxOffsetVal = 0;
+                for ( int offset_num = 0; offset_num < PowerPara.PNosieOffsetFreq.Length; offset_num++)
+                {
+                    if (SA.Query("IDN") == "N9030A")//N9030A型号频谱仪
+                    {
+                        SA.Write("设置Mark频率Hz", "1", PowerPara.PNosieOffsetFreq[offset_num].ToString()); SA.Query("OPC");           
+                        double temp = Math.Round(double.Parse(SA.Query("读Mark相位噪声值", "1")), 2); 
+                    }
+                    else
+                    {
+                        SA.Write("设置DELT频率", "2", PowerPara.PNosieOffsetFreq[offset_num].ToString()); SA.Query("OPC");
+                        Data.PhaseNoise[point, offset_num] = Math.Round(double.Parse(SA.Query("读相位噪声", "1")), 2);
+
+                    }                    
+                    PhaseNoiseOffsetVal[offset_num] = Data.PhaseNoise[point, offset_num];
+                }
+                if (PowerPara.PNosieOffsetFreq.Length > 1)//计算相位噪声中的最大值
+                {
+                    PhaseNoiseMaxOffsetVal = PhaseNoiseOffsetVal.Max();
+                }
+                else
+                {
+                    PhaseNoiseMaxOffsetVal = PhaseNoiseOffsetVal[0];
+                }
+
+                PhaseNoisePrint.Upper = PowerPara.PhaseNoiseUpper;
+                PhaseNoisePrint.TestVal = PhaseNoiseMaxOffsetVal;
+                if (PhaseNoisePrint.TestVal <= PhaseNoisePrint.Upper)
+                {
+                    PhaseNoisePrint.Result = true;
+                }
+                else
+                {
+                    PhaseNoisePrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    //tps.SetTestTableCellValue(point, 15, PhaseNoisePrint.Result, PhaseNoisePrint.TestVal);
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    //tps.SetTestTableCellValue(point + 15, 15, PhaseNoisePrint.Result, PhaseNoisePrint.TestVal);
+                }
+            }
+            SA.Write("设置MARK为常规", "2"); SA.Query("OPC");
+            SA.Write("关闭所有MARK"); SA.Query("OPC");
+            return true;
+        }
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            /// 相位噪声偏置频率
+            /// </summary>
+            public double[] PNosieOffsetFreq { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 相位噪声上限
+            /// </summary>
+            public double  PhaseNoiseUpper{set;get;}
+        }
+        public class OutData
+        {
+
+            /// <summary>
+            /// 相位噪声
+            /// </summary>
+            public double[,] PhaseNoise { set; get; }
+           
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+}

+ 375 - 0
tps/TpsLabStudio/models/PowerAndFreqStability.cs

@@ -0,0 +1,375 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tps_LQ_Transmitter.com;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class PowerAndFreqStability: BaseModel
+    {
+        double[,] WTempPowerVal;
+        double[,] dBTempPowerVal;
+        string serial = "****";
+
+        public PowerAndFreqStability()
+        {
+            TemplateName = "功率及频率稳定度测试";
+        }
+        /// <summary>
+        /// 功率及频率稳定度测试
+        /// </summary>
+        public override bool Run(TestNode parameters)
+        {
+            double y_value, x_value;
+
+            Random random = new Random();
+
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            PowerAndFreqStabilityOutData Data = new PowerAndFreqStabilityOutData();
+            DataType PowerPrint = new DataType();//功率(dBm)
+            DataType FreqPrint = new DataType();//实测频率
+            DataType FreqAccuracyPrint = new DataType();//频率稳定度
+            DataType PowerSumPrint = new DataType();//两路功率总和(w)
+            DataType PowerFlatnessPrint = new DataType();//两路功率不平度(dB)
+
+            //if (SA == null)
+            //{
+            //    ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+            //    return false;
+            //}
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            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.PowerLower = parameters.Parameters.GetParameter<double>("功率下限");
+            PowerPara.PowerUpper = parameters.Parameters.GetParameter<double>("功率上限");
+            PowerPara.FreqAccuracyUpper = parameters.Parameters.GetParameter<double>("频率稳定度上限");
+            PowerPara.PowerSumLower = parameters.Parameters.GetParameter<double>("两路功率总和下限");
+            PowerPara.PowerFlatnessUpper = parameters.Parameters.GetParameter<double>("功率不平度上限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null) || (PowerPara.PowerLower == 0)
+                || (PowerPara.PowerUpper == 0) || (PowerPara.FreqAccuracyUpper == 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(false)//需具备仪器
+            {
+                SA.Write("仪器复位"); SA.Query("OPC");
+                SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                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("SingleOrCont", "0"); SA.Query("OPC");
+
+            }
+            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.Power = new double[PowerPara.FrequencyNumber];
+            Data.Freq = new double[PowerPara.FrequencyNumber];
+            Data.FreqAccuracy = new double[PowerPara.FrequencyNumber];
+            if (tps.Serial != serial)
+            {
+                WTempPowerVal = new double[2, PowerPara.FrequencyNumber] ;
+                dBTempPowerVal = new double[2, PowerPara.FrequencyNumber];
+                serial = tps.Serial;
+                for (int initVal1 = 0; initVal1 < 2; initVal1++)
+                {
+                    for (int initVal2 = 0; initVal2 < PowerPara.FrequencyNumber; initVal2++)
+                    {
+                        WTempPowerVal[initVal1, initVal2] = -100;
+                        dBTempPowerVal[initVal1, initVal2] = -100;
+                    }
+                }
+            }
+
+            for (int point = 0; ; point++)
+            {
+
+                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                {
+                    break;
+                }
+                if (false)//需具备仪器
+                {
+                    //控制
+                    SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
+                    Thread.Sleep(PowerPara.ControlDelay);//单位ms
+
+
+                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    PsaPeakValue_Tracedata(SA, out y_value, out x_value, true);
+                    Data.Power[point] = y_value + PowerPara.OutLoss;//功率
+
+                }
+
+                Data.Power[point] = random.Next(3000, 4000) / 100.0;//随机数
+
+                PowerPrint.Lower = PowerPara.PowerLower;
+                PowerPrint.Upper = PowerPara.PowerUpper;
+                PowerPrint.TestVal = Math.Round(Math.Pow(10, (Data.Power[point] / 10)) / 1000, 2);//功率W
+
+                if ((PowerPrint.TestVal >= PowerPrint.Lower) && (PowerPrint.TestVal <= PowerPrint.Upper))
+                {
+                    PowerPrint.Result = true;
+                }
+                else
+                {
+                    PowerPrint.Result = false;
+                }
+ 
+                FreqPrint.Lower =0-((PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq);
+                FreqPrint.Upper = (PowerPara.FreqAccuracyUpper * CenterFreq) + CenterFreq;
+               // FreqPrint.TestVal = Math.Round(x_value / 1000000, 3);//实测频率
+                FreqPrint.TestVal = random.Next(-600, 6000) / 100.0 + CenterFreq;//随机数
+                if ((FreqPrint.TestVal >= FreqPrint.Lower) && (FreqPrint.TestVal <= FreqPrint.Upper))
+                {
+                    FreqPrint.Result = true;
+                }
+                else
+                {
+                    FreqPrint.Result = false;
+                }
+
+               
+                FreqAccuracyPrint.Upper = PowerPara.FreqAccuracyUpper;
+                //FreqAccuracyPrint.TestVal = Math.Round(Math.Abs(x_value - CenterFreq * 1000000) / (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)
+                {
+                    FreqAccuracyPrint.Result = true;
+                }
+                else
+                {
+                    FreqAccuracyPrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    tps.SetTestTableCellValue(point, 10, PowerPrint.Result, PowerPrint.TestVal);
+                    tps.SetTestTableCellValue(point, 7, FreqPrint.Result, FreqPrint.TestVal);
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    tps.SetTestTableCellValue(point, 11, PowerPrint.Result, PowerPrint.TestVal);
+                    tps.SetTestTableCellValue(point+15, 7, FreqPrint.Result,FreqPrint.TestVal);
+                }
+
+                #region 功率不平度及两路功率总和计算
+                if (parameters.Channel == "通道1")
+                {
+                    WTempPowerVal[0, point] = PowerPrint.TestVal;//W
+                    dBTempPowerVal[0, point] = Data.Power[point];//dB
+                }
+                else
+                {
+                    WTempPowerVal[1, point] = PowerPrint.TestVal;//W
+                    dBTempPowerVal[1, point] = Data.Power[point];//dB
+                }
+
+                if (WTempPowerVal[0, point] > -100 && WTempPowerVal[1, point] > -100)
+                {
+                    PowerSumPrint.Lower = PowerPara.PowerSumLower;
+                    PowerSumPrint.TestVal = Math.Round(WTempPowerVal[0, point] + WTempPowerVal[1, point],2);//W
+                    if ((PowerSumPrint.TestVal >= PowerSumPrint.Lower) && (PowerSumPrint.TestVal <= PowerSumPrint.Upper))
+                    {
+                        PowerSumPrint.Result = true;
+                    }
+                    else
+                    {
+                        PowerSumPrint.Result = false;
+                    }
+
+                    PowerFlatnessPrint.Upper = PowerPara.PowerFlatnessUpper;
+                    PowerFlatnessPrint.TestVal = Math.Round(Math.Abs(dBTempPowerVal[0, point] - dBTempPowerVal[1, point]),2);//dB
+                    if ((PowerFlatnessPrint.TestVal >= PowerFlatnessPrint.Lower) && (PowerFlatnessPrint.TestVal <= PowerFlatnessPrint.Upper))
+                    {
+                        PowerFlatnessPrint.Result = true;
+                    }
+                    else
+                    {
+                        PowerFlatnessPrint.Result = false;
+                    }
+                    tps.SetTestTableCellValue(point, 12, PowerSumPrint.Result, PowerSumPrint.TestVal);
+                    tps.SetTestTableCellValue(point, 13, PowerFlatnessPrint.Result,PowerFlatnessPrint.TestVal);
+                   
+                }
+                #endregion
+            }
+            return true;
+        }
+
+        
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 功率下限
+            /// </summary>
+            public double  PowerLower { set; get; }
+            /// <summary>
+            /// 功率上限
+            /// </summary>
+            public double PowerUpper { set; get; }
+            /// <summary>
+            /// 频率稳定度上限
+            /// </summary>
+            public double FreqAccuracyUpper { set; get; }
+            /// <summary>
+            /// 两路功率总和下限
+            /// </summary>
+            public double PowerSumLower { set; get; }
+            /// <summary>
+            /// 功率不平度上限
+            /// </summary>
+            public double PowerFlatnessUpper { set; get; }
+
+        }
+
+        public class PowerAndFreqStabilityOutData
+        {
+            /// <summary>
+            /// 输出功率(W)
+            /// </summary>
+            public double[] Power { set; get; }
+           /// <summary>
+           /// 频率稳定度
+           /// </summary>
+            public double[] FreqAccuracy { set; get; }
+            /// <summary>
+            /// 实测频点
+            /// </summary>
+            public double[] Freq { set; get; }
+            /// <summary>
+            /// 两路功率总和(W)
+            /// </summary>
+            public double[] PowerSum { set; get; }
+            /// <summary>
+            /// 两路功率不平度(dB)
+            /// </summary>
+            public double[] PowerFlatness { set; get; }
+
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+}

+ 253 - 17
tps/TpsLabStudio/models/SpuriousSuppression.cs

@@ -2,41 +2,277 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using Tps_LQ_Transmitter.com;
 
 namespace Tps_LQ_Transmitter.models
 {
-    /// <summary>
-    /// 杂波抑制测试
-    /// 曾学友,2021-7-30创建
-    /// xxx,2021-8-30修改了xxxx
-    /// 
-    /// </summary>
-    public class SpuriousSuppression : BaseModel
+    class SpuriousSuppression : BaseModel
     {
         public SpuriousSuppression()
         {
             TemplateName = "杂波抑制测试";
         }
-
+        /// <summary>
+        /// 杂波抑制测试
+        /// </summary>
         public override bool Run(TestNode parameters)
         {
-            int[] freqs = parameters.Parameters.GetParameterToArray<int>("频率");
-            double REF = parameters.Parameters.GetParameter<double>("REF");
-            int[] channel = parameters.Parameters.GetParameterToArray<int>("开关通道");
-
-            if (freqs == null)
+            double y_value, x_value;
+            Random random = new Random();
+            //获取仪器
+            var SA = this.tps.GetDevice("频谱仪");
+           
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            OutData Data = new OutData();
+            DataType SpuriousSuppressionPrint = new DataType();
+          
+            //if (SA == null)
+            //{
+            //    ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+            //    return false;
+            //}
+            ConfigParameter PowerPara = new ConfigParameter();
+            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.LeftOffset = parameters.Parameters.GetParameter<double>("主频左侧偏移量");
+            PowerPara.LeftStart = parameters.Parameters.GetParameter<double>("主频左侧起始值");
+            PowerPara.RightOffset = parameters.Parameters.GetParameter<int>("主频右侧偏移量");
+            PowerPara.RightStop = parameters.Parameters.GetParameter<double>("主频右侧终止值");
+            PowerPara.SPAN = parameters.Parameters.GetParameter<string>("扫描带宽(SPAN)");
+            PowerPara.REF = parameters.Parameters.GetParameter<string>("参考电平(REF)");
+            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.SpuriousSuppressionLower = parameters.Parameters.GetParameter<double>("杂波抑制下限");
+            if ((PowerPara.StartFrequency == 0) || ((PowerPara.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.LeftOffset == 0) || (PowerPara.LeftStart == 0) || (PowerPara.RightOffset == 0) || (PowerPara.RightStop == 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(false)//需具备仪器
+            {
+                SA.Write("仪器复位"); SA.Query("OPC");
+                SA.Write("SPAN", PowerPara.SPAN); SA.Query("OPC");
+                SA.Write("RBW", PowerPara.RBW); SA.Query("OPC");
+                SA.Write("VBW", PowerPara.VBW); SA.Query("OPC");
+                SA.Write("SingleOrCont", "0"); SA.Query("OPC");
+            }
+
+
+            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 Power,PowerLeft, PowerRigth;
+            Data.SpuriousSuppression = new double[PowerPara.FrequencyNumber];
+            
+            for (int point = 0; ; point++)
+            {
+                            
+                CenterFreq = PowerPara.StartFrequency + PowerPara.StepFrequency * point;
+                if (CenterFreq > PowerPara.StopFrequency || (PowerPara.FrequencyNumber == 1 && point == 1))
+                {
+                    break;
+                }
+                if (false)//需具备仪器
+                {
+                    // 控制
+                    SerialClient.DUT_Transmitter_Ctrol(PowerPara.ComPort, Convert.ToByte(point + 1));
+                    Thread.Sleep(PowerPara.ControlDelay);//单位ms    
+
+                    SA.Write("REF", PowerPara.REF); SA.Query("OPC");
+                    SA.Write("CENTER", CenterFreq.ToString()); SA.Query("OPC");
+                    PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    Power = y_value;
+                    //测主频左侧杂散
+                    SA.Write("REF", PowerPara.SmallSignalREF); SA.Query("OPC");
+                    SA.Write("START", PowerPara.LeftStart.ToString()); SA.Query("OPC");
+                    SA.Write("STOP", (CenterFreq - PowerPara.LeftOffset).ToString()); SA.Query("OPC");
+                    PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    PowerLeft = Power - y_value;
+                    //测主频右侧杂散
+                    SA.Write("START", (CenterFreq + PowerPara.RightOffset).ToString()); SA.Query("OPC");
+                    SA.Write("STOP", PowerPara.RightStop.ToString()); SA.Query("OPC");
+                    PsaPeakValue_Tracedata(SA, out y_value, out x_value, false);
+                    PowerRigth = Power - y_value;
+
+                }
+                SpuriousSuppressionPrint.Lower = PowerPara.SpuriousSuppressionLower;
+                //SpuriousSuppressionPrint.TestVal = Math.Round(Math.Min(PowerLeft, PowerRigth), 2);
+                SpuriousSuppressionPrint.TestVal = random.Next(4000, 12000) / 100.0;//随机数
+                if (SpuriousSuppressionPrint.TestVal >= SpuriousSuppressionPrint.Lower)
+                {
+                    SpuriousSuppressionPrint.Result = true;
+                }
+                else
+                {
+                    SpuriousSuppressionPrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    tps.SetTestTableCellValue(point, 14, SpuriousSuppressionPrint.Result,SpuriousSuppressionPrint.TestVal);                
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    tps.SetTestTableCellValue(point + 15, 14, SpuriousSuppressionPrint.Result, SpuriousSuppressionPrint.TestVal);                
+                }
+            }
+            return true;
+        }
+
+        public void PsaPeakValue_Tracedata(AppLibs.Devices.IVISA psa, out double Y_Maxvalue, out double X_Maxvalue, bool IsReturnX = false)
+        {
+            System.Threading.Thread.Sleep(20);
+            X_Maxvalue = 0;
+            Y_Maxvalue = 0;
+
+            psa.Write("单次扫描");
+            psa.Query("OPC");
+            string tracedata = psa.Query("读曲线");
+            string[] tracedatas = tracedata.Split(',');
+            double[] tracedata_double = new double[tracedatas.Length];
+            for (int i = 0; i < tracedatas.Length; i++)
+            {
+                tracedata_double[i] = double.Parse(tracedatas[i]);
+            }
+            Y_Maxvalue = Math.Round(tracedata_double.Max(), 3);
+            if (IsReturnX)
+            {
+                int x = Array.IndexOf(tracedata_double, Y_Maxvalue);
+                double startfreq = double.Parse(psa.Query("读起始频率"));
+                double stopfreq = double.Parse(psa.Query("读截止频率"));
+                double counts = double.Parse(psa.Query("测试点数读取"));
+                X_Maxvalue = startfreq + (stopfreq - startfreq) * x / (counts - 1);
+            }
+        }
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }
+            /// <summary>
+            /// 输出损耗
+            /// </summary>
+            public double OutLoss { set; get; }
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            /// 主频左侧偏移量
+            /// </summary>
+            public double LeftOffset { set; get; }
+            /// <summary>
+            /// 主频左侧起始值
+            /// </summary>
+            public double LeftStart { set; get; }
+            /// <summary>
+            /// 主频右侧偏移量
+            /// </summary>
+            public double RightOffset { set; get; }
+            /// <summary>
+            /// 主频右侧终止值
+            /// </summary>
+            public double RightStop { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置小信号参考电平
+            /// </summary>
+            public string SmallSignalREF { set; get; }
+            
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 杂波抑制下限
+            /// </summary>
+            public double SpuriousSuppressionLower { set; get; }
+        }
 
-            var sig = this.tps.GetDevice("信号源1");
-            var spe = this.tps.GetDevice("频谱仪");
-            sig.Write("仪器复位");
+        public class OutData
+        {
+           
+            /// <summary>
+            /// 杂波抑制
+            /// </summary>
+            public double[] SpuriousSuppression { set; get; }
             
-            return IsPassed;
+        }
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
         }
     }
 }

+ 245 - 0
tps/TpsLabStudio/models/VoltAndCurrent.cs

@@ -0,0 +1,245 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tps_LQ_Transmitter.com;
+
+namespace Tps_LQ_Transmitter.models
+{
+    class VoltAndCurrent: BaseModel
+    {
+
+        public VoltAndCurrent()
+        {
+            TemplateName = "电压及电流测试";
+        }
+        /// <summary>
+        /// 功率及频率稳定度测试
+        /// </summary>
+        public override bool Run(TestNode parameters)
+        {
+            TestParameters result = new TestParameters();
+            Random random = new Random();
+            //获取仪器
+
+           // var DC = this.tps.GetDevice("程控电源");
+            TransmitterSerialPort SerialClient = new TransmitterSerialPort();
+            OutData Data = new OutData();
+
+            DataType VoltDataPrint = new DataType();
+            DataType CurrentDataPrint = new DataType();
+
+
+            /*
+            if (DC == null)
+            {
+                ShowMessage(MsgType.Error, string.Format("仪器不齐全,{0}/{1}无法运行", parameters.Channel, parameters.Name));
+                return false;
+            }
+            */
+            ConfigParameter PowerPara = new ConfigParameter();
+            PowerPara.ComPort = parameters.Parameters.GetParameter<string>("串口");
+            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)");
+            PowerPara.VBW = parameters.Parameters.GetParameter<string>("视频带宽(VBW)");
+            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.StepFrequency == 0) && (PowerPara.FrequencyNumber == 0)) || (PowerPara.StopFrequency == 0)
+                || (PowerPara.SPAN == null) || (PowerPara.REF == null) || (PowerPara.RBW == null) || (PowerPara.VBW == null) || (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.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++)
+            {
+
+                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
+                /*
+                Data.VoltVal[point] = DC.Query("读取电压");
+                Data.CurrentVal[point] = DC.Query("读取电流");
+                */
+                
+
+                VoltDataPrint.Lower = PowerPara.VoltLower;
+                VoltDataPrint.Upper = PowerPara.VoltUpper;
+                //VoltDataPrint.TestVal = double.Parse(Data.VoltVal[point]);
+                VoltDataPrint.TestVal = random.Next(2500, 3000) / 100.0;//随机数
+                if ((VoltDataPrint.TestVal >= VoltDataPrint.Lower) && (VoltDataPrint.TestVal <= VoltDataPrint.Upper))
+                {
+                    VoltDataPrint.Result = true;
+                }
+                else
+                {
+                    VoltDataPrint.Result = false;
+                }
+
+
+
+                //CurrentDataPrint.Test_name = parameters.Channel + "-电流测试-" + CenterFreq.ToString();
+                CurrentDataPrint.Lower = PowerPara.CurrentLower;
+                CurrentDataPrint.Upper = PowerPara.CurrentUpper;
+                //CurrentDataPrint.TestVal = double.Parse(Data.CurrentVal[point]);
+                CurrentDataPrint.TestVal = random.Next(90, 160) / 100.0;
+                if ((CurrentDataPrint.TestVal >= CurrentDataPrint.Lower) && (CurrentDataPrint.TestVal <= CurrentDataPrint.Upper))
+                {
+                    CurrentDataPrint.Result = true;
+                }
+                else
+                {
+                    CurrentDataPrint.Result = false;
+                }
+                if (parameters.Channel == "通道1")
+                {
+                    tps.SetTestTableCellValue(point, 5, VoltDataPrint.Result, VoltDataPrint.TestVal);
+                    tps.SetTestTableCellValue(point, 6, CurrentDataPrint.Result,CurrentDataPrint.TestVal);
+                }
+                else if (parameters.Channel == "通道2")
+                {
+                    tps.SetTestTableCellValue(point+15, 5, VoltDataPrint.Result, VoltDataPrint.TestVal);
+                    tps.SetTestTableCellValue(point+15, 6, CurrentDataPrint.Result,CurrentDataPrint.TestVal);
+                }
+  
+            }
+            return true;
+        }
+
+
+        public class ConfigParameter
+        {
+            /// <summary>
+            /// 串口
+            /// </summary>
+            public string ComPort { set; get; }        
+            /// <summary>
+            /// 产品测试的起始频率
+            /// </summary>
+            public double StartFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频率步进
+            /// </summary>
+            public double StepFrequency { set; get; }
+            /// <summary>
+            /// 产品测试的频点数量
+            /// </summary>
+            public int FrequencyNumber { set; get; }
+            /// <summary>
+            /// 产品的工作频带上限(终止频率)
+            /// 功能:用于判断从起始频率按一定的步进测试是否超出产品工作频段上限
+            /// </summary>
+            public double StopFrequency { set; get; }
+            /// <summary>
+            ///设置频谱仪的SPAN
+            /// </summary>
+            public string SPAN { set; get; }
+            /// <summary>
+            /// 设置参考电平
+            /// </summary>
+            public string REF { set; get; }
+            /// <summary>
+            /// 设置RBW
+            /// </summary>
+            public string RBW { set; get; }
+            /// <summary>
+            /// 设置VBW
+            /// </summary>
+            public string VBW { set; get; }
+            /// <summary>
+            /// 控制延时
+            /// </summary>
+            public int ControlDelay { set; get; }
+            /// <summary>
+            /// 电压下限
+            /// </summary>
+            public double VoltLower {set;get;}
+            /// <summary>
+            /// 电压上限
+            /// </summary>
+            public double VoltUpper { set; get; }
+            /// <summary>
+            /// 电流下限
+            /// </summary>
+            public double CurrentLower { set; get; }
+            /// <summary>
+            /// 电流上限
+            /// </summary>
+            public double CurrentUpper { set; get; }
+  
+
+        }
+
+        public class OutData
+        {
+           
+            /// <summary>
+            /// 读电压值
+            /// </summary>
+            public string[] VoltVal { set; get; }
+            /// <summary>
+            /// 读电流值
+            /// </summary>
+            public string[] CurrentVal { set; get; }
+        }
+
+        public class DataType
+        {
+
+            /// <summary>
+            /// 测试名称
+            /// </summary>
+            public string Test_name { set; get; }
+            /// <summary>
+            /// 指标下限
+            /// </summary>
+            public double Lower { set; get; }
+            /// <summary>
+            /// 指标上限
+            /// </summary>
+            public double Upper { set; get; }         
+            /// <summary>
+            /// 测试值
+            /// </summary>
+            public double TestVal { set; get; }
+            /// <summary>
+            /// 判断结果
+            /// </summary>
+            public bool Result { set; get; }
+
+
+        }
+    }
+}

BIN
tps/TpsLabStudio/obj/Debug/TpsLabStudio.csprojAssemblyReference.cache