提交 59a2b443 authored 作者: yangbinjay's avatar yangbinjay

vgs2.0

上级 44e18da5
...@@ -919,6 +919,7 @@ ...@@ -919,6 +919,7 @@
<Tips16>已对电源进行换向操作!</Tips16> <Tips16>已对电源进行换向操作!</Tips16>
<Tips17>停止设置成功!</Tips17> <Tips17>停止设置成功!</Tips17>
<Tips18>请先下电</Tips18> <Tips18>请先下电</Tips18>
<Tips19>请将校准后保存的文件,放置在安装文件夹!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>试验箱温度设置为#℃,是否继续</Tips1> <Tips1>试验箱温度设置为#℃,是否继续</Tips1>
...@@ -986,6 +987,7 @@ ...@@ -986,6 +987,7 @@
<Tips8>器件:</Tips8> <Tips8>器件:</Tips8>
<Tips9>老化板图</Tips9> <Tips9>老化板图</Tips9>
<Tips10>器件图</Tips10> <Tips10>器件图</Tips10>
<Tips11>Vg和Vgs不能同时存在</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>已启用</Tips1> <Tips1>已启用</Tips1>
......
...@@ -906,6 +906,7 @@ ...@@ -906,6 +906,7 @@
<Tips16>The power supply has been reversed!</Tips16> <Tips16>The power supply has been reversed!</Tips16>
<Tips17>Successfully stopped setting!</Tips17> <Tips17>Successfully stopped setting!</Tips17>
<Tips18>Please power off first</Tips18> <Tips18>Please power off first</Tips18>
<Tips19>Please place the files saved after calibration in the installation folder!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1> <Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1>
...@@ -967,6 +968,7 @@ ...@@ -967,6 +968,7 @@
<Tips8>Device:</Tips8> <Tips8>Device:</Tips8>
<Tips9>BIB Image</Tips9> <Tips9>BIB Image</Tips9>
<Tips10>Device Image</Tips10> <Tips10>Device Image</Tips10>
<Tips11>Vg and Vgs cannot exist simultaneously</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>Activated</Tips1> <Tips1>Activated</Tips1>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -401,8 +401,16 @@ namespace GKHTRBC16P.Bll ...@@ -401,8 +401,16 @@ namespace GKHTRBC16P.Bll
//station_Data._VR = power_Data[1] == null ? 0 : power_Data[1].Voltage; //station_Data._VR = power_Data[1] == null ? 0 : power_Data[1].Voltage;
if (CalculationAo.VgsList.ContainsKey(test_Parameter.Id)) if (CalculationAo.VgsList.ContainsKey(test_Parameter.Id))
{ {
station_Data.VgsP = Math.Round(-1 * (CalculationAo.VgsList[test_Parameter.Id].VgsP), CalculationAo.ThisDevConfig.DataLength.Length - 2); if (CalculationAo.ThorouVgs[test_Parameter.Id].TypeVgs == 0)
station_Data.VgsN = Math.Round(-1 * CalculationAo.VgsList[test_Parameter.Id].VgsN[0], CalculationAo.ThisDevConfig.DataLength.Length - 2); {
station_Data.VgsP = Math.Round(-1 * (CalculationAo.VgsList[test_Parameter.Id].VgsP), CalculationAo.ThisDevConfig.DataLength.Length - 2);
station_Data.VgsN = Math.Round(-1 * CalculationAo.VgsList[test_Parameter.Id].VgsN[0], CalculationAo.ThisDevConfig.DataLength.Length - 2);
}
else if (CalculationAo.ThorouVgs[test_Parameter.Id].TypeVgs == 1)
{
station_Data.VgsP = Math.Round((CalculationAo.VgsList[test_Parameter.Id].VgsP), CalculationAo.ThisDevConfig.DataLength.Length - 2);
station_Data.VgsN = Math.Round(CalculationAo.VgsList[test_Parameter.Id].VgsN[0], CalculationAo.ThisDevConfig.DataLength.Length - 2);
}
} }
station_Data.TemA = oven_Data.TemA; station_Data.TemA = oven_Data.TemA;
station_Data.TemB = oven_Data.TemB; station_Data.TemB = oven_Data.TemB;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GKHTRBC16P.Model
{
public class CalibrationParameter
{
public int Id { get; set; }
public string SetValue { get; set; }
public string Time { get; set; }
public string Offset { get; set; }
public string FtValue { get; set; }
}
}
...@@ -11,6 +11,7 @@ namespace GKHTRBC16P.Model ...@@ -11,6 +11,7 @@ namespace GKHTRBC16P.Model
public int Id { get; set; } public int Id { get; set; }
public int Tid { get; set; } public int Tid { get; set; }
public int TypeVgs { get; set; } public int TypeVgs { get; set; }
public string TypeVgsVar { get; set; }
public float UpperLimit { get; set; } public float UpperLimit { get; set; }
public float LowerLimit { get; set; } public float LowerLimit { get; set; }
public int IsVgs { get; set; } = 1; public int IsVgs { get; set; } = 1;
......
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
<Compile Include="Test_Parameter.cs" /> <Compile Include="Test_Parameter.cs" />
<Compile Include="Test_Type.cs" /> <Compile Include="Test_Type.cs" />
<Compile Include="Version_Log.cs" /> <Compile Include="Version_Log.cs" />
<Compile Include="CalibrationParameter.cs" />
<Compile Include="Vgs_Data.cs" /> <Compile Include="Vgs_Data.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
3fe978ae0b12a1eb83fd6e3f2db941aac60ea248a2ab5f161f509d17d4d4cccd 6811b7547ffba2874c34bd1ac33047245e50f415b0cb10673568c36023b6fc8a
using GKHTRBC16P.Toolbox;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GKHTRBC16P.Protocol.Driboard
{
public class VgsH2
{
private static readonly VgsH2 instance = new VgsH2();
private VgsH2() { }
public static VgsH2 Instance
{
get
{
return instance;
}
}
public ushort VgsBoarddataTest(Type t, int com, int Adr1, int cmd, int res, float VgsP, float VgsN, int Dev)
{
ushort result = 1;
ushort cnum = 3;
while (result > 0 && cnum > 0)
{
result = VgsBoarddata(t, com, Adr1, cmd, res, Dev, VgsP, VgsN);
if (result == 0)
{
return result;
}
cnum--;
}
return result;
}
public ushort VgsBoarddata(Type t, int Com, int Adr1, int cmd, int res, int Dev, float VgsP, float VgsN)
{
Monitor.Enter(SerialCom.ComWriteLock1[Com]);
int[] comdata = new int[511];
try
{
SerialCom.OpenSerial_Drive(true, Com, 19200);
byte[] num = new byte[72];
byte[] senchr = new byte[512];
num[1] = (byte)0xA5;
num[2] = (byte)0xA5;
num[3] = (byte)0x47;//高低位高位在前长度
num[4] = (byte)0;
num[5] = (byte)0XFF;
num[6] = (byte)0XFF;
num[7] = (byte)ConvertDataOpear.HexToInt(Adr1.ToString("X2"));//目标地址
num[8] = (byte)0;
num[9] = (byte)cmd;
num[10] = (byte)0;
num[11] = (byte)res;//Res:0-设置 1-回读
num[12] = (byte)0;
num[13] = (byte)0;
num[14] = (byte)0;
num[15] = (byte)0;
var VgsPStr = ConvertDataOpear.FloatToHexString(VgsP);
num[16] = (byte)ConvertDataOpear.HexToInt(VgsPStr.Substring(6, 2));
num[17] = (byte)ConvertDataOpear.HexToInt(VgsPStr.Substring(4, 2));
num[18] = (byte)ConvertDataOpear.HexToInt(VgsPStr.Substring(2, 2));
num[19] = (byte)ConvertDataOpear.HexToInt(VgsPStr.Substring(0, 2));
var VgsNStr = ConvertDataOpear.FloatToHexString(VgsN);
num[20] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[21] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[22] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[23] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[24] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[25] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[26] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[27] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[28] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[29] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[30] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[31] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[32] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[33] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[34] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[35] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[36] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[37] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[38] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[39] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[40] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[41] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[42] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[43] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[44] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[45] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[46] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[47] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[48] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[49] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[50] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[51] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[52] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[53] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[54] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[55] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[56] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[57] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[58] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[59] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[60] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[61] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[62] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[63] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[64] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(6, 2));
num[65] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(4, 2));
num[66] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(2, 2));
num[67] = (byte)ConvertDataOpear.HexToInt(VgsNStr.Substring(0, 2));
num[68] = (byte)0X13;
num[69] = (byte)0X0B;
List<byte> stu = new List<byte>();
for (int j = 1; j <= Dev - 2; j++)
{
stu.Add(Convert.ToByte(num[j].ToString("X2"), 16));
}
byte[] calcrc = ConvertDataOpear.CRCModelBus(stu);
num[Dev - 1] = calcrc[0];
num[Dev] = calcrc[1];
string cmdStr = ConvertDataOpear.GetBytesString(num, 1, Dev, " ");
uPublic.WriteLog("通道" + Adr1 + ",Send data:" + cmdStr, "VGS2");
SerialCom.SerialPort_Drive[Com].Write(num, 1, Dev);
//Thread.Sleep(300);
DateTime dt = DateTime.Now;
while (SerialCom.SerialPort_Drive[Com].BytesToRead < 75)
{
Thread.Sleep(10);
if (DateTime.Now.Subtract(dt).TotalMilliseconds > 400) //如果2秒后仍然无数据返回,则视为超时
{
LogisTrac.WriteLog(t, "设备未响应" + SerialCom.SerialPort_Drive[Com].PortName);
SerialCom.OpenSerial_Drive_Close(Com, false);//关闭
return 4;
}
}
senchr = new byte[80];
SerialCom.SerialPort_Drive[Com].Read(senchr, 0, 75);
string Str = ConvertDataOpear.GetBytesString(senchr, 0, 75, " ");
uPublic.WriteLog("通道" + Adr1 + ",receive data:" + Str, "VGS2");
if (senchr[0] != senchr[1] || senchr[0] != 166 || senchr[68] != 11 || senchr[67] != 19)
{
LogisTrac.WriteLog(t, "接收数据异常" + SerialCom.SerialPort_Drive[Com].PortName);
SerialCom.OpenSerial_Drive_Close(Com, false);//关闭
return 2;
}
for (int m = 0; m <= 75; m++)
{
comdata[m] = Convert.ToInt32(senchr[m]);
}
CalculationAo.VgsData[Adr1] = comdata;
SerialCom.OpenSerial_Drive_Close(Com, true);//关闭
return (ushort)comdata[10];
}
catch (Exception ex)
{
uPublic.WriteLog("VgsBoarddata error with message" + ex.StackTrace, "Error");
SerialCom.OpenSerial_Drive_Close(Com, false);//关闭
comdata[10] = 1;
LogisTrac.WriteLog(t, ex);
return 1;
}
finally
{
Monitor.Exit(SerialCom.ComWriteLock1[Com]);
}
}
}
}
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<Compile Include="Driboard\Rb40D.cs" /> <Compile Include="Driboard\Rb40D.cs" />
<Compile Include="Driboard\Routinedrac.cs" /> <Compile Include="Driboard\Routinedrac.cs" />
<Compile Include="Driboard\Vgs.cs" /> <Compile Include="Driboard\Vgs.cs" />
<Compile Include="Driboard\VgsH2.cs" />
<Compile Include="Powers\Aikefa.cs" /> <Compile Include="Powers\Aikefa.cs" />
<Compile Include="SerialCom.cs" /> <Compile Include="SerialCom.cs" />
<Compile Include="Driboard\H3trb.cs" /> <Compile Include="Driboard\H3trb.cs" />
......
afc5450dcc6170cec6fd004cc4d0ed022bc5fa887ddf24ea00eda52a7fc375f7 4e05ba76df49819a359639f6c0643802e761b5c3d385b1e602c92ed5e0d57624
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Windows.Forms;
namespace TheConfigurationFile namespace GKHTRBC16P.Toolbox
{ {
public class Ini_File public class Ini_File
{ {
public static readonly string p_IniPH = Application.StartupPath + "\\SystemFile.ini"; //配置文件的路径
[DllImport("kernel32")] [DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
[DllImport("kernel32")] [DllImport("kernel32")]
...@@ -43,7 +45,7 @@ namespace TheConfigurationFile ...@@ -43,7 +45,7 @@ namespace TheConfigurationFile
/// string strValue 标记名的默认值 /// string strValue 标记名的默认值
/// string strFileName 配置文件名称 /// string strFileName 配置文件名称
/// </summary> /// </summary>
public string IniReadValue(string Section, string strKey, string strValue, string strFileName) public static string IniReadValue(string Section, string strKey, string strValue, string strFileName)
{ {
StringBuilder sbTemp = new StringBuilder(1024); StringBuilder sbTemp = new StringBuilder(1024);
int i = GetPrivateProfileString(Section, strKey, strValue, sbTemp, 1024, strFileName); int i = GetPrivateProfileString(Section, strKey, strValue, sbTemp, 1024, strFileName);
...@@ -60,7 +62,7 @@ namespace TheConfigurationFile ...@@ -60,7 +62,7 @@ namespace TheConfigurationFile
/// string strValue 标记名的值 /// string strValue 标记名的值
/// string strFileName 配置文件名称 /// string strFileName 配置文件名称
/// </summary> /// </summary>
public void IniWriteValue(string Section, string strKey, string strValue, string strFileName) public static void IniWriteValue(string Section, string strKey, string strValue, string strFileName)
{ {
string strTmp = ""; string strTmp = "";
if (strValue != null) if (strValue != null)
...@@ -80,7 +82,7 @@ namespace TheConfigurationFile ...@@ -80,7 +82,7 @@ namespace TheConfigurationFile
/// <param name="strValue"></param> /// <param name="strValue"></param>
/// <param name="strFileName"></param> /// <param name="strFileName"></param>
/// <returns></returns> /// <returns></returns>
public string IniReadDefine(string Section, string strKey, string strValue, string strFileName) public static string IniReadDefine(string Section, string strKey, string strValue, string strFileName)
{ {
string strTmp = IniReadValue(Section, strKey, "", strFileName); string strTmp = IniReadValue(Section, strKey, "", strFileName);
if (strTmp.Length == 0) if (strTmp.Length == 0)
......
...@@ -7,7 +7,7 @@ using System.Text; ...@@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
using TheConfigurationFile; //using TheConfigurationFile;
namespace GKHTRBC16P.Toolbox namespace GKHTRBC16P.Toolbox
{ {
......
...@@ -523,19 +523,23 @@ namespace GKHTRBC16P ...@@ -523,19 +523,23 @@ namespace GKHTRBC16P
int BoardX = Convert.ToInt16(ten.Ids) - 1; int BoardX = Convert.ToInt16(ten.Ids) - 1;
if(CalculationAo.ThorouVgs.ContainsKey(BoardX + 1)) if(CalculationAo.ThorouVgs.ContainsKey(BoardX + 1))
{ {
if (ten.VgsP == 0 && ten.VgsP == 0) int[] vgsData = null;
{ switch (CalculationAo.ThorouVgs[BoardX + 1].TypeVgs)
float vgsP = float.Parse(ten.VgsP.ToString());
float vgsN = float.Parse(ten.VgsN.ToString());
DriverBoardCom.BoardNowVgs(this, BoardX, vgsP, vgsN);
}
else
{ {
DriverBoardCom.BoardNowVgs(this, BoardX, (float)ten.VgsP, (float)ten.VgsN); case 0:
DriverBoardCom.BoardNowVgs(this, BoardX, (float)ten.VgsP, (float)ten.VgsN);
if (CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS + 1, out vgsData))
DriverBoardRefresh.GetVgs(this, BoardX, vgsData);
break;
case 1:
DriverBoardCom.BoardNowVgsH2(this, BoardX, (float)ten.VgsP, (float)ten.VgsN);
if (CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS + 1, out vgsData))
DriverBoardRefresh.GetVgsH2(this, BoardX, vgsData);
break;
default:
break;
} }
int[] vgsData = null;
if (CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS + 1, out vgsData))
DriverBoardRefresh.GetVgs(this, BoardX, vgsData);
} }
Thread.Sleep(20); Thread.Sleep(20);
} }
...@@ -664,13 +668,26 @@ namespace GKHTRBC16P ...@@ -664,13 +668,26 @@ namespace GKHTRBC16P
} }
if (CalculationAo.ThorouVgs.ContainsKey(CalculationAo.BoardSS + 1)) if (CalculationAo.ThorouVgs.ContainsKey(CalculationAo.BoardSS + 1))
{ {
CalculationAo.VgsList.TryGetValue(CalculationAo.BoardSS + 1, out Vgs_Data value); if (CalculationAo.ThorouVgs[CalculationAo.BoardSS + 1].TypeVgs == 0)
float vgsP = float.Parse(ten.VgsP.ToString()); {
float vgsN = float.Parse(ten.VgsN.ToString()); CalculationAo.VgsList.TryGetValue(CalculationAo.BoardSS + 1, out Vgs_Data value);
DriverBoardCom.BoardNowVgs(this, CalculationAo.BoardSS, vgsP, vgsN); float vgsP = float.Parse(ten.VgsP.ToString());
int[] vgsData = null; float vgsN = float.Parse(ten.VgsN.ToString());
CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS+1, out vgsData); DriverBoardCom.BoardNowVgs(this, CalculationAo.BoardSS, vgsP, vgsN);
DriverBoardRefresh.DCERDataShowVGSFresh(this, ten, CalculationAo.BoardSS, vgsData); int[] vgsData = null;
CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS + 1, out vgsData);
DriverBoardRefresh.DCERDataShowVGSFresh(this, ten, CalculationAo.BoardSS, vgsData);
}
else if (CalculationAo.ThorouVgs[CalculationAo.BoardSS + 1].TypeVgs == 1)
{
CalculationAo.VgsList.TryGetValue(CalculationAo.BoardSS + 1, out Vgs_Data value);
float vgsP = float.Parse(ten.VgsP.ToString());
float vgsN = float.Parse(ten.VgsN.ToString());
DriverBoardCom.BoardNowVgsH2(this, CalculationAo.BoardSS, vgsP, vgsN);
int[] vgsData = null;
CalculationAo.VgsData.TryGetValue(CalculationAo.BoardSS + 1, out vgsData);
DriverBoardRefresh.DCERDataShowVGSFresh(this, ten, CalculationAo.BoardSS, vgsData);
}
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{ {
this.uiSymbolButton3 = new Sunny.UI.UISymbolButton(); this.uiSymbolButton3 = new Sunny.UI.UISymbolButton();
this.uiGroupBox6 = new Sunny.UI.UIGroupBox(); this.uiGroupBox6 = new Sunny.UI.UIGroupBox();
this.CheckBox_Vgs = new Sunny.UI.UICheckBox(); this.uiSymbolButton5 = new Sunny.UI.UISymbolButton();
this.uiSymbolButton2 = new Sunny.UI.UISymbolButton(); this.uiSymbolButton2 = new Sunny.UI.UISymbolButton();
this.uiSymbolButton4 = new Sunny.UI.UISymbolButton(); this.uiSymbolButton4 = new Sunny.UI.UISymbolButton();
this.Txt_ComPowerNum = new Sunny.UI.UITextBox(); this.Txt_ComPowerNum = new Sunny.UI.UITextBox();
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
// //
// uiGroupBox6 // uiGroupBox6
// //
this.uiGroupBox6.Controls.Add(this.CheckBox_Vgs); this.uiGroupBox6.Controls.Add(this.uiSymbolButton5);
this.uiGroupBox6.Controls.Add(this.uiSymbolButton2); this.uiGroupBox6.Controls.Add(this.uiSymbolButton2);
this.uiGroupBox6.Controls.Add(this.uiSymbolButton4); this.uiGroupBox6.Controls.Add(this.uiSymbolButton4);
this.uiGroupBox6.Controls.Add(this.Txt_ComPowerNum); this.uiGroupBox6.Controls.Add(this.Txt_ComPowerNum);
...@@ -115,18 +115,21 @@ ...@@ -115,18 +115,21 @@
this.uiGroupBox6.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; this.uiGroupBox6.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiGroupBox6.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.uiGroupBox6.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
// //
// CheckBox_Vgs // uiSymbolButton5
// //
this.CheckBox_Vgs.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton5.Cursor = System.Windows.Forms.Cursors.Hand;
this.CheckBox_Vgs.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiSymbolButton5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.CheckBox_Vgs.Location = new System.Drawing.Point(542, 31); this.uiSymbolButton5.Location = new System.Drawing.Point(542, 31);
this.CheckBox_Vgs.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton5.MinimumSize = new System.Drawing.Size(1, 1);
this.CheckBox_Vgs.Name = "CheckBox_Vgs"; this.uiSymbolButton5.Name = "uiSymbolButton5";
this.CheckBox_Vgs.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0); this.uiSymbolButton5.Size = new System.Drawing.Size(152, 35);
this.CheckBox_Vgs.Size = new System.Drawing.Size(152, 29); this.uiSymbolButton5.Symbol = 362792;
this.CheckBox_Vgs.TabIndex = 31; this.uiSymbolButton5.SymbolOffset = new System.Drawing.Point(-16, 0);
this.CheckBox_Vgs.Text = "Vgs"; this.uiSymbolButton5.TabIndex = 25;
this.CheckBox_Vgs.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.uiSymbolButton5.Text = "Vgs";
this.uiSymbolButton5.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton5.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.uiSymbolButton5.Click += new System.EventHandler(this.uiSymbolButton5_Click);
// //
// uiSymbolButton2 // uiSymbolButton2
// //
...@@ -819,8 +822,8 @@ ...@@ -819,8 +822,8 @@
private Sunny.UI.UITextBox uiTextBox1; private Sunny.UI.UITextBox uiTextBox1;
private Sunny.UI.UILabel uiLabel6; private Sunny.UI.UILabel uiLabel6;
private Sunny.UI.UIRadioButtonGroup Radio_Remote; private Sunny.UI.UIRadioButtonGroup Radio_Remote;
private Sunny.UI.UICheckBox CheckBox_Vgs;
private Sunny.UI.UILabel uiLabel7; private Sunny.UI.UILabel uiLabel7;
private Sunny.UI.UITextBox Txt_TestBoxNo; private Sunny.UI.UITextBox Txt_TestBoxNo;
private Sunny.UI.UISymbolButton uiSymbolButton5;
} }
} }
\ No newline at end of file
...@@ -79,21 +79,19 @@ namespace GKHTRBC16P.FunMov ...@@ -79,21 +79,19 @@ namespace GKHTRBC16P.FunMov
Txt_TestBoxNo.Text = dev_Config.TestBoxNo.ToString(); Txt_TestBoxNo.Text = dev_Config.TestBoxNo.ToString();
Radio_ProControl.SelectedIndex = dev_Config.ProControl; Radio_ProControl.SelectedIndex = dev_Config.ProControl;
txt_SaveVoltage.SelectedIndex = dev_Config.SaveVoltage; txt_SaveVoltage.SelectedIndex = dev_Config.SaveVoltage;
Com_ReportDisTemp.SelectedIndex = dev_Config.ReportDisTemp;
//Radio_Ishtrb.SelectedIndex = dev_Config.Ishtrb;
Radio_Remote.SelectedIndex = dev_Config.InterOpen;
uiTextBox1.Text = dev_Config.InterMap;
uiCom_PowerUnit.Text = dev_Config.PowerUnit;
if (dev_Config.IsVgs == 0) if (dev_Config.IsVgs == 0)
{ {
CheckBox_Vgs.Checked = true; uiSymbolButton5.Visible = true;
} }
else else
{ {
CheckBox_Vgs.Checked = false; uiSymbolButton5.Visible = false;
} }
CheckBox_Vgs.MouseClick += CheckBox_Vgs_CheckedChanged; Com_ReportDisTemp.SelectedIndex = dev_Config.ReportDisTemp;
//Radio_Ishtrb.SelectedIndex = dev_Config.Ishtrb;
Radio_Remote.SelectedIndex = dev_Config.InterOpen;
uiTextBox1.Text = dev_Config.InterMap;
uiCom_PowerUnit.Text = dev_Config.PowerUnit;
Txt_DataLength.Value = dev_Config.DataLength.Length - 2; Txt_DataLength.Value = dev_Config.DataLength.Length - 2;
Com_PowerId.SelectedValue = dev_Config.PowerId; Com_PowerId.SelectedValue = dev_Config.PowerId;
Txt_ComPowerNum.Text = dev_Config.ComPowerNum.ToString(); Txt_ComPowerNum.Text = dev_Config.ComPowerNum.ToString();
...@@ -185,21 +183,21 @@ namespace GKHTRBC16P.FunMov ...@@ -185,21 +183,21 @@ namespace GKHTRBC16P.FunMov
CalculationAo.ThisDevConfig.PowerId = Convert.ToInt16(Com_PowerId.SelectedValue); CalculationAo.ThisDevConfig.PowerId = Convert.ToInt16(Com_PowerId.SelectedValue);
CalculationAo.ThisDevConfig.ReportDisTemp = Convert.ToInt16(Com_ReportDisTemp.SelectedIndex); CalculationAo.ThisDevConfig.ReportDisTemp = Convert.ToInt16(Com_ReportDisTemp.SelectedIndex);
CalculationAo.ThisDevConfig.ComPowerNum = Convert.ToInt16(Txt_ComPowerNum.Text); CalculationAo.ThisDevConfig.ComPowerNum = Convert.ToInt16(Txt_ComPowerNum.Text);
if (CheckBox_Vgs.Checked) //if (CheckBox_Vgs.Checked)
{ //{
CalculationAo.ThisDevConfig.IsVgs = 0; // CalculationAo.ThisDevConfig.IsVgs = 0;
} //}
else //else
{ //{
CalculationAo.ThisDevConfig.IsVgs = 1; // CalculationAo.ThisDevConfig.IsVgs = 1;
var vgslist = devThorouBll.GetList().Where(x => x.IsVgs == 1); // var vgslist = devThorouBll.GetList().Where(x => x.IsVgs == 1);
foreach ( var v in vgslist ) // foreach ( var v in vgslist )
{ // {
v.IsVgs = 0; // v.IsVgs = 0;
devThorouBll.Update(v); // devThorouBll.Update(v);
} // }
CalculationAo.ThorouVgs = devThorouBll.GetList().Where(x => x.IsVgs == 1).ToDictionary(x => x.Tid, x => x); // CalculationAo.ThorouVgs = devThorouBll.GetList().Where(x => x.IsVgs == 1).ToDictionary(x => x.Tid, x => x);
} //}
string datav = ""; string datav = "";
for (int len = 1; len <= Txt_DataLength.Value; len++) for (int len = 1; len <= Txt_DataLength.Value; len++)
datav = datav + "0"; datav = datav + "0";
...@@ -325,18 +323,23 @@ namespace GKHTRBC16P.FunMov ...@@ -325,18 +323,23 @@ namespace GKHTRBC16P.FunMov
private void CheckBox_Vgs_CheckedChanged(object sender, EventArgs e) private void CheckBox_Vgs_CheckedChanged(object sender, EventArgs e)
{ {
if(CheckBox_Vgs.Checked) //if(CheckBox_Vgs.Checked)
{ //{
ThorouTypeVgs frm = new ThorouTypeVgs();
frm.Render();
frm.ShowDialog();
if (frm.DialogResult == DialogResult.OK)
{
} // return;
frm.Dispose(); //}
return; }
private void uiSymbolButton5_Click(object sender, EventArgs e)
{
ThorouTypeVgs frm = new ThorouTypeVgs();
frm.Render();
frm.ShowDialog();
if (frm.DialogResult == DialogResult.OK)
{
} }
frm.Dispose();
} }
} }
} }
...@@ -22,9 +22,11 @@ namespace GKHTRBC16P.FunMov ...@@ -22,9 +22,11 @@ namespace GKHTRBC16P.FunMov
InitializeComponent(); InitializeComponent();
} }
public DevThorouVgsBll devThorouBll; public DevThorouVgsBll devThorouBll;
public List<string> _Boboxes = null;
private void ThorouType_Load(object sender, EventArgs e) private void ThorouType_Load(object sender, EventArgs e)
{ {
uiDataGridView1.AutoGenerateColumns = false; uiDataGridView1.AutoGenerateColumns = false;
uiDataGridView1.EditMode = DataGridViewEditMode.EditOnEnter;
FirstBind(-1); FirstBind(-1);
MultiLanguage.LoadLanguage(this, CalculationAo.ThisDevConfig.Language); MultiLanguage.LoadLanguage(this, CalculationAo.ThisDevConfig.Language);
} }
...@@ -34,6 +36,10 @@ namespace GKHTRBC16P.FunMov ...@@ -34,6 +36,10 @@ namespace GKHTRBC16P.FunMov
{ {
devThorouBll = new DevThorouVgsBll(); devThorouBll = new DevThorouVgsBll();
var list = devThorouBll.GetList().OrderBy(x => x.Tid).ToList(); var list = devThorouBll.GetList().OrderBy(x => x.Tid).ToList();
_Boboxes = new List<string> {"1.0","2.0"};
DataGridViewComboBoxColumn column1 = uiDataGridView1.Columns[1] as DataGridViewComboBoxColumn;
column1.DataPropertyName = "TypeVgsVar";//对应数据源的字段
column1.DataSource = _Boboxes;
//uiDataGridView1.Rows.Clear(); //uiDataGridView1.Rows.Clear();
if (index < 0) if (index < 0)
{ {
...@@ -48,10 +54,16 @@ namespace GKHTRBC16P.FunMov ...@@ -48,10 +54,16 @@ namespace GKHTRBC16P.FunMov
dev_Thorou.UpperLimit = 2.2f; dev_Thorou.UpperLimit = 2.2f;
dev_Thorou.LowerLimit = 2.2f; dev_Thorou.LowerLimit = 2.2f;
dev_Thorou.TypeVgs = 0; dev_Thorou.TypeVgs = 0;
dev_Thorou.TypeVgsVar = _Boboxes[0];
dev_Thorou.ComId = 1; dev_Thorou.ComId = 1;
list.Add(dev_Thorou); list.Add(dev_Thorou);
} }
} }
else
{
for (int j = 0; j < list.Count; j++)
list[j].TypeVgsVar = _Boboxes[list[j].TypeVgs];
}
} }
uiDataGridView1.DataSource = list; uiDataGridView1.DataSource = list;
} }
...@@ -61,7 +73,19 @@ namespace GKHTRBC16P.FunMov ...@@ -61,7 +73,19 @@ namespace GKHTRBC16P.FunMov
ShowErrorTip(ex.Message); ShowErrorTip(ex.Message);
} }
} }
private int TypeBox(string type)
{
int ret = 0;
foreach (var m in _Boboxes)
{
if (m == type)
{
return ret;
}
ret++;
}
return ret;
}
private void uiSymbolButton2_Click(object sender, EventArgs e) private void uiSymbolButton2_Click(object sender, EventArgs e)
{ {
try try
...@@ -87,6 +111,7 @@ namespace GKHTRBC16P.FunMov ...@@ -87,6 +111,7 @@ namespace GKHTRBC16P.FunMov
foreach (var th in dev_ThorousVgs) foreach (var th in dev_ThorousVgs)
{ {
th.UserId = CalculationAo.ThisUser.Id; th.UserId = CalculationAo.ThisUser.Id;
th.TypeVgs = TypeBox(th.TypeVgsVar);
th.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); th.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
devThorouBll.Add(th); devThorouBll.Add(th);
} }
...@@ -125,10 +150,10 @@ namespace GKHTRBC16P.FunMov ...@@ -125,10 +150,10 @@ namespace GKHTRBC16P.FunMov
int count = Convert.ToInt16(uiDataGridView1.Rows.Count.ToString()); int count = Convert.ToInt16(uiDataGridView1.Rows.Count.ToString());
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if (e.ColumnIndex == 1 && i == e.RowIndex) if (e.ColumnIndex == 2 && i == e.RowIndex)
{ {
uiDataGridView1.EndEdit(); uiDataGridView1.EndEdit();
DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)uiDataGridView1.Rows[i].Cells[1]; DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)uiDataGridView1.Rows[i].Cells[2];
Boolean flag = Convert.ToBoolean(checkCell.Value); Boolean flag = Convert.ToBoolean(checkCell.Value);
if (flag == true) //查找被选择的数据行 if (flag == true) //查找被选择的数据行
{ {
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Column4 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
// //
this.uiSymbolButton1.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiSymbolButton1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiSymbolButton1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton1.Location = new System.Drawing.Point(329, 555); this.uiSymbolButton1.Location = new System.Drawing.Point(442, 555);
this.uiSymbolButton1.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolButton1.Name = "uiSymbolButton1"; this.uiSymbolButton1.Name = "uiSymbolButton1";
this.uiSymbolButton1.Size = new System.Drawing.Size(100, 35); this.uiSymbolButton1.Size = new System.Drawing.Size(100, 35);
...@@ -97,6 +98,7 @@ ...@@ -97,6 +98,7 @@
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1, this.Column1,
this.Column5,
this.Column4, this.Column4,
this.Column2, this.Column2,
this.Column3, this.Column3,
...@@ -134,7 +136,7 @@ ...@@ -134,7 +136,7 @@
this.uiDataGridView1.RowTemplate.Height = 23; this.uiDataGridView1.RowTemplate.Height = 23;
this.uiDataGridView1.ScrollBarRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); this.uiDataGridView1.ScrollBarRectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiDataGridView1.SelectedIndex = -1; this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(432, 509); this.uiDataGridView1.Size = new System.Drawing.Size(545, 458);
this.uiDataGridView1.TabIndex = 1; this.uiDataGridView1.TabIndex = 1;
this.uiDataGridView1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.uiDataGridView1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.uiDataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uiDataGridView1_CellContentClick); this.uiDataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uiDataGridView1_CellContentClick);
...@@ -185,6 +187,17 @@ ...@@ -185,6 +187,17 @@
this.Column1.ReadOnly = true; this.Column1.ReadOnly = true;
this.Column1.Width = 80; this.Column1.Width = 80;
// //
// Column5
//
this.Column5.DataPropertyName = "TypeVgsVar";
this.Column5.HeaderText = "协议";
this.Column5.Items.AddRange(new object[] {
"0",
"1"});
this.Column5.Name = "Column5";
this.Column5.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// Column4 // Column4
// //
this.Column4.DataPropertyName = "IsVgs"; this.Column4.DataPropertyName = "IsVgs";
...@@ -218,7 +231,7 @@ ...@@ -218,7 +231,7 @@
// ThorouTypeVgs // ThorouTypeVgs
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(432, 593); this.ClientSize = new System.Drawing.Size(545, 593);
this.Controls.Add(this.uiSymbolButton2); this.Controls.Add(this.uiSymbolButton2);
this.Controls.Add(this.uiSymbolButton1); this.Controls.Add(this.uiSymbolButton1);
this.Controls.Add(this.uiDataGridView1); this.Controls.Add(this.uiDataGridView1);
...@@ -244,6 +257,7 @@ ...@@ -244,6 +257,7 @@
private Sunny.UI.UIDataGridView uiDataGridView1; private Sunny.UI.UIDataGridView uiDataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1; private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewComboBoxColumn Column5;
private System.Windows.Forms.DataGridViewCheckBoxColumn Column4; private System.Windows.Forms.DataGridViewCheckBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2; private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
......
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
......
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
<Compile Include="RunLibrary\EntranceLampMain.cs" /> <Compile Include="RunLibrary\EntranceLampMain.cs" />
<Compile Include="RunLibrary\EntrancePowerMain.cs" /> <Compile Include="RunLibrary\EntrancePowerMain.cs" />
<Compile Include="RunLibrary\EntranceTempMain.cs" /> <Compile Include="RunLibrary\EntranceTempMain.cs" />
<Compile Include="RunLibrary\Ini_File.cs" /> <Compile Include="RunLibrary\Ini_Files.cs" />
<Compile Include="RunLibrary\LightControl.cs" /> <Compile Include="RunLibrary\LightControl.cs" />
<Compile Include="RunLibrary\PubMonirning.cs" /> <Compile Include="RunLibrary\PubMonirning.cs" />
<Compile Include="RunLibrary\RemoteControl.cs" /> <Compile Include="RunLibrary\RemoteControl.cs" />
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
this.uiLabel7 = new Sunny.UI.UILabel(); this.uiLabel7 = new Sunny.UI.UILabel();
this.uiDatetimePicker1 = new Sunny.UI.UIDatetimePicker(); this.uiDatetimePicker1 = new Sunny.UI.UIDatetimePicker();
this.uiCheckBox1 = new Sunny.UI.UICheckBox(); this.uiCheckBox1 = new Sunny.UI.UICheckBox();
this.CheckBox_Vgs = new Sunny.UI.UICheckBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// uiLabel1 // uiLabel1
...@@ -347,10 +348,24 @@ ...@@ -347,10 +348,24 @@
this.uiCheckBox1.Text = "是否开启电源烘箱自动控制"; this.uiCheckBox1.Text = "是否开启电源烘箱自动控制";
this.uiCheckBox1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.uiCheckBox1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
// //
// CheckBox_Vgs
//
this.CheckBox_Vgs.Cursor = System.Windows.Forms.Cursors.Hand;
this.CheckBox_Vgs.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.CheckBox_Vgs.Location = new System.Drawing.Point(46, 340);
this.CheckBox_Vgs.MinimumSize = new System.Drawing.Size(1, 1);
this.CheckBox_Vgs.Name = "CheckBox_Vgs";
this.CheckBox_Vgs.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
this.CheckBox_Vgs.Size = new System.Drawing.Size(106, 29);
this.CheckBox_Vgs.TabIndex = 32;
this.CheckBox_Vgs.Text = "Vgs";
this.CheckBox_Vgs.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// DeviceCode // DeviceCode
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(617, 391); this.ClientSize = new System.Drawing.Size(617, 391);
this.Controls.Add(this.CheckBox_Vgs);
this.Controls.Add(this.uiCheckBox1); this.Controls.Add(this.uiCheckBox1);
this.Controls.Add(this.uiDatetimePicker1); this.Controls.Add(this.uiDatetimePicker1);
this.Controls.Add(this.uiLabel7); this.Controls.Add(this.uiLabel7);
...@@ -407,5 +422,6 @@ ...@@ -407,5 +422,6 @@
private Sunny.UI.UILabel uiLabel7; private Sunny.UI.UILabel uiLabel7;
private Sunny.UI.UIDatetimePicker uiDatetimePicker1; private Sunny.UI.UIDatetimePicker uiDatetimePicker1;
private Sunny.UI.UICheckBox uiCheckBox1; private Sunny.UI.UICheckBox uiCheckBox1;
private Sunny.UI.UICheckBox CheckBox_Vgs;
} }
} }
\ No newline at end of file
...@@ -38,6 +38,7 @@ namespace GKHTRBC16P.Helpm ...@@ -38,6 +38,7 @@ namespace GKHTRBC16P.Helpm
uiTextBox5.Text = CalculationAo.ThisDevConfig.Editions.ToString(); uiTextBox5.Text = CalculationAo.ThisDevConfig.Editions.ToString();
uiTextBox6.Text = CalculationAo.ThisDevConfig.SoftName; uiTextBox6.Text = CalculationAo.ThisDevConfig.SoftName;
uiCheckBox1.Checked = CalculationAo.ThisDevConfig.AutoControl == 1 ? true : false; uiCheckBox1.Checked = CalculationAo.ThisDevConfig.AutoControl == 1 ? true : false;
CheckBox_Vgs.Checked = CalculationAo.ThisDevConfig.IsVgs == 0 ? true : false;
var ctime = DataEncryption.AESDecryptPub(CalculationAo.ThisDevConfig.EditionsDateTime); var ctime = DataEncryption.AESDecryptPub(CalculationAo.ThisDevConfig.EditionsDateTime);
DateTime dtc = DateTime.Now; DateTime dtc = DateTime.Now;
...@@ -60,6 +61,16 @@ namespace GKHTRBC16P.Helpm ...@@ -60,6 +61,16 @@ namespace GKHTRBC16P.Helpm
CalculationAo.ThisDevConfig.SoftName = uiTextBox6.Text.Trim(); CalculationAo.ThisDevConfig.SoftName = uiTextBox6.Text.Trim();
CalculationAo.ThisDevConfig.AutoControl = uiCheckBox1.Checked ? 1 : 0; CalculationAo.ThisDevConfig.AutoControl = uiCheckBox1.Checked ? 1 : 0;
CalculationAo.ThisDevConfig.EditionsDateTime = DataEncryption.AESEncryptPub("yb" + uiDatetimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss")); CalculationAo.ThisDevConfig.EditionsDateTime = DataEncryption.AESEncryptPub("yb" + uiDatetimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"));
CalculationAo.ThisDevConfig.IsVgs = CheckBox_Vgs.Checked ? 0 : 1;
if (!CheckBox_Vgs.Checked)
{
DevThorouVgsBll devThorouVgsBll = new DevThorouVgsBll();
foreach (var hm in CalculationAo.ThorouVgs.Values)
{
hm.IsVgs = 0;
devThorouVgsBll.Update(hm);
}
}
devConfigBll = new DevConfigBll(); devConfigBll = new DevConfigBll();
devConfigBll.Update(CalculationAo.ThisDevConfig); devConfigBll.Update(CalculationAo.ThisDevConfig);
MultiLanguage.UpdateConfig(CalculationAo.ThisDevConfig.SoftName); MultiLanguage.UpdateConfig(CalculationAo.ThisDevConfig.SoftName);
......
...@@ -919,6 +919,7 @@ ...@@ -919,6 +919,7 @@
<Tips16>已对电源进行换向操作!</Tips16> <Tips16>已对电源进行换向操作!</Tips16>
<Tips17>停止设置成功!</Tips17> <Tips17>停止设置成功!</Tips17>
<Tips18>请先下电</Tips18> <Tips18>请先下电</Tips18>
<Tips19>请将校准后保存的文件,放置在安装文件夹!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>试验箱温度设置为#℃,是否继续</Tips1> <Tips1>试验箱温度设置为#℃,是否继续</Tips1>
...@@ -986,6 +987,7 @@ ...@@ -986,6 +987,7 @@
<Tips8>器件:</Tips8> <Tips8>器件:</Tips8>
<Tips9>老化板图</Tips9> <Tips9>老化板图</Tips9>
<Tips10>器件图</Tips10> <Tips10>器件图</Tips10>
<Tips11>Vg和Vgs不能同时存在</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>已启用</Tips1> <Tips1>已启用</Tips1>
......
...@@ -906,6 +906,7 @@ ...@@ -906,6 +906,7 @@
<Tips16>The power supply has been reversed!</Tips16> <Tips16>The power supply has been reversed!</Tips16>
<Tips17>Successfully stopped setting!</Tips17> <Tips17>Successfully stopped setting!</Tips17>
<Tips18>Please power off first</Tips18> <Tips18>Please power off first</Tips18>
<Tips19>Please place the files saved after calibration in the installation folder!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1> <Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1>
...@@ -967,6 +968,7 @@ ...@@ -967,6 +968,7 @@
<Tips8>Device:</Tips8> <Tips8>Device:</Tips8>
<Tips9>BIB Image</Tips9> <Tips9>BIB Image</Tips9>
<Tips10>Device Image</Tips10> <Tips10>Device Image</Tips10>
<Tips11>Vg and Vgs cannot exist simultaneously</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>Activated</Tips1> <Tips1>Activated</Tips1>
......
using GKHTRBC16P.Bll; using Comon;
using GKHTRBC16P.Bll;
using GKHTRBC16P.FunMov; using GKHTRBC16P.FunMov;
using GKHTRBC16P.Model; using GKHTRBC16P.Model;
using GKHTRBC16P.Protocol.Boven; using GKHTRBC16P.Protocol.Boven;
...@@ -16,6 +17,7 @@ using System.Threading; ...@@ -16,6 +17,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Forms;
namespace GKHTRBC16P.RunLibrary namespace GKHTRBC16P.RunLibrary
{ {
...@@ -23,6 +25,7 @@ namespace GKHTRBC16P.RunLibrary ...@@ -23,6 +25,7 @@ namespace GKHTRBC16P.RunLibrary
{ {
private static AutoPowerCon instaion = null; private static AutoPowerCon instaion = null;
private static object objlock = new object(); private static object objlock = new object();
private static List<CalibrationParameter> calibrations = null;
private AutoPowerCon() private AutoPowerCon()
{ {
} }
...@@ -33,7 +36,34 @@ namespace GKHTRBC16P.RunLibrary ...@@ -33,7 +36,34 @@ namespace GKHTRBC16P.RunLibrary
lock (objlock) lock (objlock)
{ {
if (instaion is null) if (instaion is null)
{
instaion = new AutoPowerCon(); instaion = new AutoPowerCon();
if (CalculationAo.ThisDevConfig.IsVgs == 0)
{
var isvgsto2 = CalculationAo.ThorouVgs.Values.Where(x => x.TypeVgs == 1).ToList();
if (isvgsto2.Count() > 0)
{
if (System.IO.File.Exists(Ini_File.p_IniPH))
{
calibrations = new List<CalibrationParameter>();
for (int i = 0; i < 8; i++)
{
CalibrationParameter vgsCalht = new CalibrationParameter();
vgsCalht.Id = i + 1;
vgsCalht.SetValue = Ini_File.IniReadValue("SYS", "DATA" + i.ToString(), "", Ini_File.p_IniPH);
vgsCalht.Time = Ini_File.IniReadValue("SYS", "Time" + i.ToString(), "", Ini_File.p_IniPH);
vgsCalht.Offset = Ini_File.IniReadValue("SYS", "%" + i.ToString(), "", Ini_File.p_IniPH);
vgsCalht.FtValue = Ini_File.IniReadValue("SYS", "Value" + i.ToString(), "", Ini_File.p_IniPH);
calibrations.Add(vgsCalht);
}
}
else
{
UIMessageTip.ShowOk(uPublic.Prompt("Tips19", "RunSetting"));
}
}
}
}
return instaion; return instaion;
} }
} }
...@@ -56,6 +86,56 @@ namespace GKHTRBC16P.RunLibrary ...@@ -56,6 +86,56 @@ namespace GKHTRBC16P.RunLibrary
// SetAutoParmOven(3, tparm, devm); // SetAutoParmOven(3, tparm, devm);
// } // }
//} //}
public float VgsH2Caclrt(float tparm)
{
float X1 = 0;
float X2 = 0;
float Y1 = 0;
float Y2 = 0;
if (tparm > 0)
tparm = tparm * -1;
float sValue = tparm;
float K = 0;
if (calibrations.Count > 0)
{
int Ia = 0;
for (; Ia < calibrations.Count; Ia++)
{
if (Ia == 0) continue;
if (float.Parse(calibrations[Ia - 1].FtValue) <= sValue && float.Parse(calibrations[Ia].FtValue) > sValue)
{
X1 = float.Parse(calibrations[Ia - 1].SetValue);
X2 = float.Parse(calibrations[Ia].SetValue);
Y1 = float.Parse(calibrations[Ia - 1].FtValue) - X1;
Y2 = float.Parse(calibrations[Ia].FtValue) - X2;
}
}
if (X1 == 0)
{
if (float.Parse(calibrations[0].SetValue) < sValue)
{
X1 = float.Parse(calibrations[0].SetValue);
X2 = float.Parse(calibrations[1].SetValue);
Y1 = float.Parse(calibrations[0].FtValue) - float.Parse(calibrations[0].SetValue);
Y2 = float.Parse(calibrations[1].FtValue) - float.Parse(calibrations[1].SetValue);
}
else
{
X1 = float.Parse(calibrations[calibrations.Count - 1].SetValue);
X2 = float.Parse(calibrations[calibrations.Count - 2].SetValue);
Y1 = float.Parse(calibrations[calibrations.Count - 1].FtValue) - X1;
Y2 = float.Parse(calibrations[calibrations.Count - 2].FtValue) - X2;
}
}
K = ((sValue - X1) / (X2 - X1) * (Y2 - Y1) + Y1);
}
sValue = sValue - K;
return sValue;
//var V = Generic.gReverseStringByByte(Generic.FloatToHexString(sValue).PadLeft(8, '0'));
//string DataBlock = V + V + V + V + V + V + V + V + V + V + V + V + V;
}
public bool SetVgsStdoy(Test_Parameter tparm, int td,int statused) public bool SetVgsStdoy(Test_Parameter tparm, int td,int statused)
{ {
try try
...@@ -90,7 +170,14 @@ namespace GKHTRBC16P.RunLibrary ...@@ -90,7 +170,14 @@ namespace GKHTRBC16P.RunLibrary
} }
else else
{ {
if (Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN) == 0) var reslut2 = -1;
if (th.TypeVgs == 0)
reslut2 = Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN);
else
{
reslut2 = VgsH2.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN);
}
if (reslut2 == 0)
{ {
FrmMain.mainForm.ShowSuccessTip("vgs:栅压降压命令发送成功:" + td); FrmMain.mainForm.ShowSuccessTip("vgs:栅压降压命令发送成功:" + td);
LogisTrac.WriteLog(this.GetType(), "vgs:栅压降压命令发送成功,OK!"); LogisTrac.WriteLog(this.GetType(), "vgs:栅压降压命令发送成功,OK!");
...@@ -112,7 +199,16 @@ namespace GKHTRBC16P.RunLibrary ...@@ -112,7 +199,16 @@ namespace GKHTRBC16P.RunLibrary
} }
else else
{ {
if (Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN) == 0) var reslut2 = -1;
if (th.TypeVgs == 0)
reslut2 = Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN);
else
{
f_VgsP = VgsH2Caclrt(f_VgsP) * 1000;
f_VgsN = VgsH2Caclrt(f_VgsN) * 1000;
reslut2 = VgsH2.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, td, 1, 0, 71, f_VgsP, f_VgsN);
}
if (reslut2 == 0)
{ {
if (CalculationAo.VgsData[td][10] != 0) if (CalculationAo.VgsData[td][10] != 0)
{ {
......
...@@ -446,6 +446,23 @@ namespace GKHTRBC16P.RunLibrary ...@@ -446,6 +446,23 @@ namespace GKHTRBC16P.RunLibrary
LogisTrac.WriteLog(t, ex); LogisTrac.WriteLog(t, ex);
} }
} }
public static void BoardNowVgsH2(UIForm uIForm, int WayId, float Pvalue, float Nvalue)
{
Type t = uIForm.GetType();
try
{
var th = CalculationAo.ThorouVgs[WayId + 1];
if (VgsH2.Instance.VgsBoarddataTest(t, th.ComId - 1, WayId + 1, 1, 1, Pvalue, Nvalue, 71) == 0)
{
int resValue = CalculationAo.VgsData[WayId + 1][10];
}
}
catch (Exception ex)
{
LogisTrac.WriteLog(t, ex);
}
}
} }
......
...@@ -1157,12 +1157,20 @@ namespace GKHTRBC16P.RunLibrary ...@@ -1157,12 +1157,20 @@ namespace GKHTRBC16P.RunLibrary
} }
})); }));
} }
var SupplyRGPW = "";
if (tes.Id != 0)
{
if (tes.SupplyRGPW == 0)
SupplyRGPW = "+";
else
SupplyRGPW = "-";
}
if (CalculationAo.ThisDevConfig.SaveVoltage == 0 || CalculationAo.ThisDevConfig.SaveVoltage == 1) if (CalculationAo.ThisDevConfig.SaveVoltage == 0 || CalculationAo.ThisDevConfig.SaveVoltage == 1)
{ {
double v2 = (double)(ComRxdData[164] + ComRxdData[165] * 256) / 100; double v2 = (double)(ComRxdData[164] + ComRxdData[165] * 256) / 100;
double v1 = (double)(ComRxdData[162] + ComRxdData[163] * 256) / 100; double v1 = (double)(ComRxdData[162] + ComRxdData[163] * 256) / 100;
Home_Status.home_Status.inVokeText(Home_Status.home_Status.EB_INVol, v1.ToString("0.0") + "V"); Home_Status.home_Status.inVokeText(Home_Status.home_Status.EB_INVol, v1.ToString("0.0") + SupplyRGPW);
Home_Status.home_Status.inVokeText(Home_Status.home_Status.EdZFConfig, v2.ToString("0.0") + "V"); Home_Status.home_Status.inVokeText(Home_Status.home_Status.EdZFConfig, v2.ToString("0.0") + SupplyRGPW);
} }
else else
{ {
...@@ -1750,10 +1758,19 @@ namespace GKHTRBC16P.RunLibrary ...@@ -1750,10 +1758,19 @@ namespace GKHTRBC16P.RunLibrary
if (VgsData != null) if (VgsData != null)
{ {
//GetVgs(uIForm,WayId,VgsData); //GetVgs(uIForm,WayId,VgsData);
if (CalculationAo.VgsList.ContainsKey(WayId + 1)) if (CalculationAo.VgsList.ContainsKey(WayId + 1))
{ {
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsP, ConvertDataOpear.GetShowDouble(-1 * (CalculationAo.VgsList[WayId + 1].VgsP), CalculationAo.ThisDevConfig.DataLength)); if (CalculationAo.ThorouVgs[WayId + 1].TypeVgs == 0)
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsN, ConvertDataOpear.GetShowDouble(-1 * (CalculationAo.VgsList[WayId + 1].VgsN[0]), CalculationAo.ThisDevConfig.DataLength)); {
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsP, ConvertDataOpear.GetShowDouble(-1 * (CalculationAo.VgsList[WayId + 1].VgsP), CalculationAo.ThisDevConfig.DataLength));
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsN, ConvertDataOpear.GetShowDouble(-1 * (CalculationAo.VgsList[WayId + 1].VgsN[0]), CalculationAo.ThisDevConfig.DataLength));
}
else if (CalculationAo.ThorouVgs[WayId + 1].TypeVgs == 1)
{
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsP, ConvertDataOpear.GetShowDouble((CalculationAo.VgsList[WayId + 1].VgsP), CalculationAo.ThisDevConfig.DataLength));
Home_Status.home_Status.inVokeText(Home_Status.home_Status.Txt_VgsN, ConvertDataOpear.GetShowDouble((CalculationAo.VgsList[WayId + 1].VgsN[0]), CalculationAo.ThisDevConfig.DataLength));
}
} }
} }
else else
...@@ -1832,7 +1849,74 @@ namespace GKHTRBC16P.RunLibrary ...@@ -1832,7 +1849,74 @@ namespace GKHTRBC16P.RunLibrary
LogisTrac.WriteLog(uIForm.GetType(), ex); LogisTrac.WriteLog(uIForm.GetType(), ex);
} }
} }
public static void GetVgsH2(UIForm uIForm, int WayId, int[] VgsData)
{
try
{
float[] vgsN = new float[13];//13路
Vgs_Data vgs_Data = new Vgs_Data();
if (VgsData != null)
{
string vgsPHex = VgsData[15].ToString("X2") + VgsData[16].ToString("X2") + VgsData[17].ToString("X2") + VgsData[18].ToString("X2");
byte[] vgsPBytes = ConvertDataOpear.HexStringToByteArray(vgsPHex);
float vgsP = (float)Math.Round(BitConverter.ToSingle(vgsPBytes, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2)/1000;
vgs_Data.VgsP = vgsP > 0 ? vgsP * -1 : vgsP;
string vgsNHex1 = VgsData[19].ToString("X2") + VgsData[20].ToString("X2") + VgsData[21].ToString("X2") + VgsData[22].ToString("X2");
byte[] vgsNBytes1 = ConvertDataOpear.HexStringToByteArray(vgsNHex1);
vgsN[0] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes1, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
vgsN[0] = vgsN[0] > 0 ? vgsN[0] * -1 : vgsN[0];
string vgsNHex2 = VgsData[23].ToString("X2") + VgsData[24].ToString("X2") + VgsData[25].ToString("X2") + VgsData[26].ToString("X2");
byte[] vgsNBytes2 = ConvertDataOpear.HexStringToByteArray(vgsNHex2);
vgsN[1] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes2, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex3 = VgsData[27].ToString("X2") + VgsData[28].ToString("X2") + VgsData[29].ToString("X2") + VgsData[30].ToString("X2");
byte[] vgsNBytes3 = ConvertDataOpear.HexStringToByteArray(vgsNHex3);
vgsN[2] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes3, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex4 = VgsData[31].ToString("X2") + VgsData[32].ToString("X2") + VgsData[33].ToString("X2") + VgsData[34].ToString("X2");
byte[] vgsNBytes4 = ConvertDataOpear.HexStringToByteArray(vgsNHex4);
vgsN[3] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes4, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex5 = VgsData[35].ToString("X2") + VgsData[36].ToString("X2") + VgsData[37].ToString("X2") + VgsData[38].ToString("X2");
byte[] vgsNBytes5 = ConvertDataOpear.HexStringToByteArray(vgsNHex5);
vgsN[4] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes5, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex6 = VgsData[39].ToString("X2") + VgsData[40].ToString("X2") + VgsData[41].ToString("X2") + VgsData[42].ToString("X2");
byte[] vgsNBytes6 = ConvertDataOpear.HexStringToByteArray(vgsNHex6);
vgsN[5] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes6, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex7 = VgsData[43].ToString("X2") + VgsData[44].ToString("X2") + VgsData[45].ToString("X2") + VgsData[46].ToString("X2");
byte[] vgsNBytes7 = ConvertDataOpear.HexStringToByteArray(vgsNHex7);
vgsN[6] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes7, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex8 = VgsData[47].ToString("X2") + VgsData[48].ToString("X2") + VgsData[49].ToString("X2") + VgsData[50].ToString("X2");
byte[] vgsNBytes8 = ConvertDataOpear.HexStringToByteArray(vgsNHex8);
vgsN[7] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes8, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex9 = VgsData[51].ToString("X2") + VgsData[52].ToString("X2") + VgsData[53].ToString("X2") + VgsData[54].ToString("X2");
byte[] vgsNBytes9 = ConvertDataOpear.HexStringToByteArray(vgsNHex9);
vgsN[8] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes9, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex10 = VgsData[55].ToString("X2") + VgsData[56].ToString("X2") + VgsData[57].ToString("X2") + VgsData[58].ToString("X2");
byte[] vgsNBytes10 = ConvertDataOpear.HexStringToByteArray(vgsNHex10);
vgsN[9] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes10, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex11 = VgsData[59].ToString("X2") + VgsData[60].ToString("X2") + VgsData[61].ToString("X2") + VgsData[62].ToString("X2");
byte[] vgsNBytes11 = ConvertDataOpear.HexStringToByteArray(vgsNHex11);
vgsN[10] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes11, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex12 = VgsData[63].ToString("X2") + VgsData[64].ToString("X2") + VgsData[65].ToString("X2") + VgsData[66].ToString("X2");
byte[] vgsNBytes12 = ConvertDataOpear.HexStringToByteArray(vgsNHex12);
vgsN[11] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes12, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
string vgsNHex13 = VgsData[67].ToString("X2") + VgsData[68].ToString("X2") + VgsData[69].ToString("X2") + VgsData[70].ToString("X2");
byte[] vgsNBytes13 = ConvertDataOpear.HexStringToByteArray(vgsNHex12);
vgsN[12] = (float)Math.Round(BitConverter.ToSingle(vgsNBytes12, 0), CalculationAo.ThisDevConfig.DataLength.Length - 2) / 1000;
vgs_Data.VgsN = vgsN;
}
else
{
vgs_Data.VgsP = 0;
vgs_Data.VgsN = vgsN;
}
vgs_Data.TId = WayId + 1;
vgs_Data.CreateTime = DateTime.Now;
CalculationAo.VgsList[WayId + 1] = vgs_Data;
}
catch (Exception ex)
{
LogisTrac.WriteLog(uIForm.GetType(), ex);
}
}
/// <summary> /// <summary>
/// 将数据显示工位 /// 将数据显示工位
......
...@@ -3,7 +3,7 @@ using System.Text; ...@@ -3,7 +3,7 @@ using System.Text;
namespace TheConfigurationFile namespace TheConfigurationFile
{ {
class Ini_File class Ini_Files
{ {
[DllImport("kernel32")] [DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
......
...@@ -89,6 +89,7 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -89,6 +89,7 @@ namespace GKHTRBC16P.ToolLibrary
Txt_ReachTime.IntValue = 0; Txt_ReachTime.IntValue = 0;
Txt_HimiReachTime.IntValue = 0; Txt_HimiReachTime.IntValue = 0;
int isvg = 0;
if (CalculationAo.ThisDevConfig.IsVgs == 0) if (CalculationAo.ThisDevConfig.IsVgs == 0)
{ {
Txt_BackVol.Size = new Size(79, 29); Txt_BackVol.Size = new Size(79, 29);
...@@ -99,6 +100,20 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -99,6 +100,20 @@ namespace GKHTRBC16P.ToolLibrary
Txt_Vgsn.Visible = true; Txt_Vgsn.Visible = true;
Txt_Vgsp.DoubleValue = 0; Txt_Vgsp.DoubleValue = 0;
Txt_Vgsn.DoubleValue = 0; Txt_Vgsn.DoubleValue = 0;
isvg++;
Dev_ThorouVgs isVgs = CalculationAo.ThorouVgs.Values.FirstOrDefault(x => x.TypeVgs == 1);
if (isVgs == null)//1.0
{
Txt_Vgsp.Minimum = 0;
Txt_Vgsn.Minimum = 0;
Txt_Vgsp.MinimumEnabled = true;
Txt_Vgsn.MinimumEnabled = true;
}
else
{
Txt_Vgsp.MinimumEnabled = false;
Txt_Vgsn.MinimumEnabled = false;
}
} }
else else
{ {
...@@ -109,7 +124,23 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -109,7 +124,23 @@ namespace GKHTRBC16P.ToolLibrary
Txt_Vgsp.Visible = false; Txt_Vgsp.Visible = false;
Txt_Vgsn.Visible = false; Txt_Vgsn.Visible = false;
} }
Dev_Thorou isVg = CalculationAo.Thorous.Values.FirstOrDefault(x => x.Vg == 1);
if (isVg == null)
{
uiLabel23.Visible = false;
Txt_Vg.Visible = false;
}
else
{
uiLabel23.Visible = true;
Txt_Vg.Visible = true;
isvg++;
}
if (isvg >= 2)
{
LogisTrac.WriteLog(this.GetType(), "Vg和Vgs不能同时存在!");
ShowErrorTip(uPublic.Prompt("Tips11", "Devicelibrary"));
}
if (CalculationAo.ThisDevConfig.Language == "ChineseSimplified") if (CalculationAo.ThisDevConfig.Language == "ChineseSimplified")
{ {
if (CalculationAo.ThisDevConfig.Isbridge == 1) if (CalculationAo.ThisDevConfig.Isbridge == 1)
...@@ -136,7 +167,6 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -136,7 +167,6 @@ namespace GKHTRBC16P.ToolLibrary
uiLabel8.Text = "IR-max(" + CalculationAo.ThisDevConfig.PowerUnit.Substring(3, 2) + "):"; uiLabel8.Text = "IR-max(" + CalculationAo.ThisDevConfig.PowerUnit.Substring(3, 2) + "):";
} }
} }
//CalculationAo.Thorous.Values
} }
private void uiHeaderButton3_Click(object sender, EventArgs e) private void uiHeaderButton3_Click(object sender, EventArgs e)
......
...@@ -19,6 +19,8 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement; ...@@ -19,6 +19,8 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Sunny.UI.Win32; using Sunny.UI.Win32;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Comon;
using TheConfigurationFile;
namespace GKHTRBC16P.ToolLibrary namespace GKHTRBC16P.ToolLibrary
{ {
...@@ -33,6 +35,7 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -33,6 +35,7 @@ namespace GKHTRBC16P.ToolLibrary
public static RunSetting p_RunSetting = null; public static RunSetting p_RunSetting = null;
public List<Dev_Device> devicelist; public List<Dev_Device> devicelist;
private PowerOvenAutoBll powerOvenAutoBll; private PowerOvenAutoBll powerOvenAutoBll;
//private DevCorrespondenceBll devCorrespondenceBll; //private DevCorrespondenceBll devCorrespondenceBll;
//public List<Dev_Correspondence> CorrList; //public List<Dev_Correspondence> CorrList;
public RunSetting() public RunSetting()
...@@ -53,6 +56,7 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -53,6 +56,7 @@ namespace GKHTRBC16P.ToolLibrary
testParmBll = new TestParmBll(); testParmBll = new TestParmBll();
ParamterTimeBll = new ParamterTimeBll(); ParamterTimeBll = new ParamterTimeBll();
powerOvenAutoBll = new PowerOvenAutoBll(); powerOvenAutoBll = new PowerOvenAutoBll();
//devCorrespondenceBll = new DevCorrespondenceBll(); //devCorrespondenceBll = new DevCorrespondenceBll();
//CorrList = devCorrespondenceBll.GetList(); //CorrList = devCorrespondenceBll.GetList();
//FunMov.Home_Status.home_Status.Home_Main(); //FunMov.Home_Status.home_Status.Home_Main();
...@@ -1311,7 +1315,12 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -1311,7 +1315,12 @@ namespace GKHTRBC16P.ToolLibrary
} }
else else
{ {
if (Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 0x01, 0x00, 71, f_VgsP, f_VgsN) == 0) var reslut2 = -1;
if(th.TypeVgs == 0)
reslut2 = Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 0x01, 0x00, 71, f_VgsP, f_VgsN);
else
reslut2 = VgsH2.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 0x01, 0x00, 71, f_VgsP, f_VgsN);
if (reslut2 == 0)
{ {
ShowSuccessTip("栅压降压命令发送成功。"); ShowSuccessTip("栅压降压命令发送成功。");
...@@ -1330,7 +1339,12 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -1330,7 +1339,12 @@ namespace GKHTRBC16P.ToolLibrary
} }
else else
{ {
if (Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 1, 0, 71, f_VgsP, f_VgsN) == 0) var reslut2 = -1;
if (th.TypeVgs == 0)
reslut2 = Vgs.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 0x01, 0x00, 71, f_VgsP, f_VgsN);
else
reslut2 = VgsH2.Instance.VgsBoarddata(this.GetType(), th.ComId - 1, ChangeID + 1, 0x01, 0x00, 71, f_VgsP, f_VgsN);
if (reslut2 == 0)
{ {
if (CalculationAo.VgsData[ChangeID+1][10] != 0) if (CalculationAo.VgsData[ChangeID+1][10] != 0)
{ {
...@@ -1374,16 +1388,33 @@ namespace GKHTRBC16P.ToolLibrary ...@@ -1374,16 +1388,33 @@ namespace GKHTRBC16P.ToolLibrary
Txt_Vgsn.Items.Clear(); Txt_Vgsn.Items.Clear();
if (CalculationAo.ThorouVgs.ContainsKey(ChangeID + 1)) if (CalculationAo.ThorouVgs.ContainsKey(ChangeID + 1))
{ {
CalculationAo.VgsData.TryGetValue(ChangeID + 1, out int[] VgsData); if (CalculationAo.ThorouVgs[ChangeID + 1].TypeVgs == 0)
DriverBoardRefresh.GetVgs(FrmMain.mainForm, ChangeID, VgsData);
if (CalculationAo.VgsList.ContainsKey(ChangeID + 1))
{ {
var vgsdata = CalculationAo.VgsList[ChangeID + 1]; CalculationAo.VgsData.TryGetValue(ChangeID + 1, out int[] VgsData);
for (int i = 0; i < vgsdata.VgsN.Length; i++) DriverBoardRefresh.GetVgs(FrmMain.mainForm, ChangeID, VgsData);
if (CalculationAo.VgsList.ContainsKey(ChangeID + 1))
{ {
Txt_Vgsn.Items.Add(vgsdata.VgsN[i]); var vgsdata = CalculationAo.VgsList[ChangeID + 1];
for (int i = 0; i < vgsdata.VgsN.Length; i++)
{
Txt_Vgsn.Items.Add(vgsdata.VgsN[i]);
}
Txt_Vgsn.Refresh();
}
}
else if (CalculationAo.ThorouVgs[ChangeID + 1].TypeVgs == 1)
{
CalculationAo.VgsData.TryGetValue(ChangeID + 1, out int[] VgsData);
DriverBoardRefresh.GetVgsH2(FrmMain.mainForm, ChangeID, VgsData);
if (CalculationAo.VgsList.ContainsKey(ChangeID + 1))
{
var vgsdata = CalculationAo.VgsList[ChangeID + 1];
for (int i = 0; i < vgsdata.VgsN.Length; i++)
{
Txt_Vgsn.Items.Add(vgsdata.VgsN[i]);
}
Txt_Vgsn.Refresh();
} }
Txt_Vgsn.Refresh();
} }
} }
} }
......
...@@ -919,6 +919,7 @@ ...@@ -919,6 +919,7 @@
<Tips16>已对电源进行换向操作!</Tips16> <Tips16>已对电源进行换向操作!</Tips16>
<Tips17>停止设置成功!</Tips17> <Tips17>停止设置成功!</Tips17>
<Tips18>请先下电</Tips18> <Tips18>请先下电</Tips18>
<Tips19>请将校准后保存的文件,放置在安装文件夹!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>试验箱温度设置为#℃,是否继续</Tips1> <Tips1>试验箱温度设置为#℃,是否继续</Tips1>
...@@ -986,6 +987,7 @@ ...@@ -986,6 +987,7 @@
<Tips8>器件:</Tips8> <Tips8>器件:</Tips8>
<Tips9>老化板图</Tips9> <Tips9>老化板图</Tips9>
<Tips10>器件图</Tips10> <Tips10>器件图</Tips10>
<Tips11>Vg和Vgs不能同时存在</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>已启用</Tips1> <Tips1>已启用</Tips1>
......
...@@ -906,6 +906,7 @@ ...@@ -906,6 +906,7 @@
<Tips16>The power supply has been reversed!</Tips16> <Tips16>The power supply has been reversed!</Tips16>
<Tips17>Successfully stopped setting!</Tips17> <Tips17>Successfully stopped setting!</Tips17>
<Tips18>Please power off first</Tips18> <Tips18>Please power off first</Tips18>
<Tips19>Please place the files saved after calibration in the installation folder!</Tips19>
</RunSetting> </RunSetting>
<AutoTemper> <AutoTemper>
<Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1> <Tips1>The temperature of the test chamber is set to #℃, whether to continue?</Tips1>
...@@ -967,6 +968,7 @@ ...@@ -967,6 +968,7 @@
<Tips8>Device:</Tips8> <Tips8>Device:</Tips8>
<Tips9>BIB Image</Tips9> <Tips9>BIB Image</Tips9>
<Tips10>Device Image</Tips10> <Tips10>Device Image</Tips10>
<Tips11>Vg and Vgs cannot exist simultaneously</Tips11>
</Devicelibrary> </Devicelibrary>
<UserManager> <UserManager>
<Tips1>Activated</Tips1> <Tips1>Activated</Tips1>
......
fb491001ee7f1b12078f9ab5b41e90c0d98d7a4d87a80f347028d5b5bb401f5c c43bf161ddd8a4c2953396fbb147a0394d938af1b7cdefd6df032db4c803993e
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论