Commit 022d033f LN

修改项目名

1 个父辈 5bda3d61
正在显示 66 个修改的文件 包含 909 行增加1297 行删除
......@@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\source\ACSingleStore\bin\</OutputPath>
<OutputPath>..\source\HCSingleStore\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
......
......@@ -3,30 +3,22 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ACSingleStore", "source\ACSingleStore\ACSingleStore.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "source\DeviceLibrary\DeviceLibrary.csproj", "{513BC1C9-800D-43A6-9499-3700BAEC3554}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserFromControl", "source\UserFromControl\UserFromControl.csproj", "{F018462A-D9BC-4365-97F2-F6D71751641E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "source\LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProCopyClient", "ProCopyClient\ProCopyClient.csproj", "{63ED00F8-B7E2-4674-859C-22B11625CAE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuichuanLibrary", "source\HuichuanLibrary\HuichuanLibrary.csproj", "{C9575C5E-9D4B-4B4F-BE41-926652B8985F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HCSingleStore", "source\HCSingleStore\HCSingleStore.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -35,22 +27,18 @@ Global
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{513BC1C9-800D-43A6-9499-3700BAEC3554}.Release|Any CPU.Build.0 = Release|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F018462A-D9BC-4365-97F2-F6D71751641E}.Release|Any CPU.Build.0 = Release|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.Build.0 = Debug|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Release|Any CPU.ActiveCfg = Release|Any CPU
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Release|Any CPU.Build.0 = Release|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63ED00F8-B7E2-4674-859C-22B11625CAE8}.Release|Any CPU.Build.0 = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9575C5E-9D4B-4B4F-BE41-926652B8985F}.Release|Any CPU.Build.0 = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
此文件类型无法预览
......@@ -14,93 +14,109 @@ namespace OnlineStore.Common
/// </summary>
public class HumitureController
{
public static bool IsRun = false;
public static string serialPort = "";
private static int bautRate = 4800;//波特率
private static Parity parity = Parity.None;//校验位
private static int dataBits = 8;//数据位
private static StopBits stopBits = StopBits.One; //停止位
private static AcSerialBean sb = null;
private static string LogName = "";
private static string LogName = "";
private static Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
public static bool Init(string port)
{
if (IsRun && port.Equals(serialPort))
if (serialBeanMap.ContainsKey(port))
{
return true;
}
else if (IsRun)
{
Release();
}
LogName = "温湿度传感器[" + port + "]";
if (sb == null)
{
serialPort = port;
LogName = "温湿度传感器[" + port + "]";
AcSerialBean sb = null;
if (HumitureControllerType.Equals(1))
{
bautRate = 9600;//波特率
}
sb = new AcSerialBean(serialPort, bautRate, parity, dataBits, stopBits);
}
sb = new AcSerialBean(port, bautRate, parity, dataBits, stopBits);
try
{
if (sb.openPort())
{
IsRun = true;
serialBeanMap.Add(port, sb);
return true;
}
else
{
LogUtil.error( LogName + "串口打开失败!");
IsRun = false;
LogUtil.error(LogName + "串口" + port + "打开失败!");
return false;
}
}
catch (Exception ex)
{
IsRun = false;
LogUtil.error("串口" + port + "打开失败:" + ex.ToString());
}
return true;
}
/// <summary>
/// 释放资源
/// </summary>
public static void Release()
public static void CloseAllPort()
{
List<string> kes = new List<string>(serialBeanMap.Keys);
foreach (string key in kes)
{
ClosePort(key);
}
}
public static void ClosePort(string portName)
{
AcSerialBean bean = GetSerialBean(portName);
if (bean == null)
{
LogUtil.info("串口【" + portName + "】未打开,不需要关闭");
return;
}
//清理缓存
bean.clearInBuffer();
bean.clearOutBuffer();
bean.closePort();
if (serialBeanMap.ContainsKey(portName))
{
if (sb != null)
serialBeanMap.Remove(portName);
}
LogUtil.info("温湿度控制器 关闭串口【" + portName + "】 ");
}
private static AcSerialBean GetSerialBean(string portName)
{
if (serialBeanMap.ContainsKey(portName))
{
sb.closePort();
return serialBeanMap[portName];
}
IsRun = false;
return null;
}
public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static ASTemperateParam QueryData()
// public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
public static HumitureParam QueryData(string port)
{
ASTemperateParam param = new ASTemperateParam(0, 0);
List<double> data = queryData();
HumitureParam param = new HumitureParam(0, 0);
List<double> data = queryData(port);
if (data.Count.Equals(2))
{
param = new ASTemperateParam(data[1], data[0]);
param = new HumitureParam(data[1], data[0]);
}
LastData = param;
return param;
}
/// <summary>
/// 返回温度和湿度
/// </summary>
/// <returns></returns>
private static List<double> queryData()
private static List<double> queryData(string port)
{
// 温度计算:
//当温度低于 0 ℃ 时温度数据以补码的形式上传。
//温度:FF9B H(十六进制)= -101 => 温度 = -10.1℃
//湿度计算:
//湿度:292 H(十六进制) = 658 => 湿度 = 65.8 % RH
if (IsRun.Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null)
{
return new List<double>();
}
......@@ -130,9 +146,10 @@ namespace OnlineStore.Common
}
public static int QueryHistoryCount()
public static int QueryHistoryCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
......@@ -164,9 +181,10 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static int QueryCurrCount()
public static int QueryCurrCount(string port)
{
if (IsRun.Equals(false) || HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return -1;
}
......@@ -187,10 +205,11 @@ namespace OnlineStore.Common
sb.SendCommand(sendData, ref reviceData, 100, out isOk);
return getReviceIntData(reviceData);
}
public static List<object> QueryHistory()
public static List<object> QueryHistory(string port)
{
List<object> list = new List<object>();
if (IsRun.Equals(false)||HumitureControllerType.Equals(2).Equals(false))
AcSerialBean sb = GetSerialBean(port);
if (sb == null || HumitureControllerType.Equals(2).Equals(false))
{
return list;
}
......@@ -272,7 +291,7 @@ namespace OnlineStore.Common
}
if (dataArray.Length >= 9)
{
string data = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6]+String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]) );
string data = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6] + String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]));
int tempV = Convert.ToInt32(data, 16);
return tempV;
}
......@@ -296,10 +315,10 @@ namespace OnlineStore.Common
if (dataArray.Length >= 9)
{
string temp = String.Format("{0:X2}", dataArray[3])+ String.Format("{0:X2}", dataArray[4]);
string temp = String.Format("{0:X2}", dataArray[3]) + String.Format("{0:X2}", dataArray[4]);
string hum = String.Format("{0:X2}", dataArray[5]) + String.Format("{0:X2}", dataArray[6]);
double tempV = (double)Convert.ToInt32(temp, 16)/10;
double humV =(double) Convert.ToInt32(hum, 16)/10;
double tempV = (double)Convert.ToInt32(temp, 16) / 10;
double humV = (double)Convert.ToInt32(hum, 16) / 10;
list.Add(tempV);
list.Add(humV);
}
......
......@@ -19,28 +19,28 @@ namespace OnlineStore.Common
/// <summary>
/// 最后一次接受到的温度信息,key=温湿度传感器IP地址
/// </summary>
public static Dictionary<string, ASTemperateParam> TemperateParamMap = new Dictionary<string, ASTemperateParam>();
public static Dictionary<string, HumitureParam> TemperateParamMap = new Dictionary<string, HumitureParam>();
/// <summary>
/// 根据IP 地址获得最后一次取到的温湿度
/// </summary>
public static ASTemperateParam GetTemperateParam(string ipAddr)
public static HumitureParam GetTemperateParam(string ipAddr)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
TemperateParamMap.TryGetValue(ipAddr, out temperate);
return temperate;
}
/// <summary>
/// 显示用的温湿度信息(改为计算平均温湿度)
/// </summary>
public static ASTemperateParam GetTemperateParam(List<string> ipAddrList)
public static HumitureParam GetTemperateParam(List<string> ipAddrList)
{
ASTemperateParam temperate = null;
HumitureParam temperate = null;
int allCount = 0;
double wenDu = 0;
double shiDu = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
allCount++;
......@@ -52,7 +52,7 @@ namespace OnlineStore.Common
{
double avgWendu = Math.Round(wenDu / allCount, 1);
double avgShidu = Math.Round(shiDu / allCount, 1);
temperate = new ASTemperateParam(avgWendu, avgShidu);
temperate = new HumitureParam(avgWendu, avgShidu);
}
return temperate;
}
......@@ -61,7 +61,7 @@ namespace OnlineStore.Common
double maxValue = 0;
foreach (string addr in ipAddrList)
{
ASTemperateParam param = GetTemperateParam(addr);
HumitureParam param = GetTemperateParam(addr);
if (param != null && param.IsValid())
{
if (param.Humidity > maxValue)
......@@ -140,7 +140,7 @@ namespace OnlineStore.Common
else
{
double newShiDu = GetRandomSD();
ASTemperateParam ast = new ASTemperateParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(add, deviceId, pwd, wendu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(add))
{
TemperateParamMap.Remove(add);
......@@ -164,7 +164,7 @@ namespace OnlineStore.Common
{
double newShiDu = GetRandomSD();
double newWenDu = GetRandomWD();
ASTemperateParam ast = new ASTemperateParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
HumitureParam ast = new HumitureParam(IP, "", "", newWenDu, newShiDu, DateTime.Now);
if (TemperateParamMap.ContainsKey(IP))
{
TemperateParamMap.Remove(IP);
......@@ -212,9 +212,9 @@ namespace OnlineStore.Common
/// <summary>
/// 奥松温湿度上传参数
/// </summary>
public class ASTemperateParam
public class HumitureParam
{
public ASTemperateParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
public HumitureParam(string clientipe, string add, string pwd, double wendu, double shidu, DateTime updateTime)
{
this.IpAddress = clientipe;
this.DeviceAddress = add;
......@@ -224,7 +224,7 @@ namespace OnlineStore.Common
this.UpdateTime = updateTime;
}
//获取平均值时使用此 参数,只做显示用
public ASTemperateParam(double wendu, double shidu)
public HumitureParam(double wendu, double shidu)
{
this.IpAddress = "";
this.DeviceAddress = "";
......
......@@ -13,13 +13,14 @@ namespace OnlineStore.DeviceLibrary
public bool IsShowMsg = false;
public static AxisManager instance;
public void Init()
public static bool UseHCBoard = true;
public static void Init()
{
bool UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
UseHCBoard = ConfigAppSettings.GetIntValue(Setting_Init.UseHCBoard).Equals(1);
if (UseHCBoard)
{
//instance = new HCAxisManager();
instance = new HCAxisManager();
}
else
{
......@@ -27,39 +28,38 @@ namespace OnlineStore.DeviceLibrary
}
}
#region 485通信方法
public abstract bool OpenPort(string portName);
public abstract void ColsePort(string portName);
public abstract void CloseAllPort();
public abstract bool ServerOnStatus(string portName, short slvAddr);
public abstract void ClearSpeed();
public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr);
public abstract void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed);
public abstract bool IsServeoOn(string portName, short slvAddr);
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
#endregion
public abstract bool IsHomeMoveEnd(string portName, short slvAddr);
public abstract bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError);
public abstract void ServoOn(string portName, short slvAddr);
public abstract void ServoOff(string portName, short slvAddr);
public abstract void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract void HomeMove(string portName, short slvAddr, int highVel, int lowVel, int acc);
public abstract void SpeedMove(string portName, short slvAddr, int speed);
public abstract void SuddenStop(string portName, short slvAddr);
public abstract bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false);
public abstract bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount, bool isLog = false);
public abstract void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed=0 , int ptpAcc=0, int ptpDec=0);
public abstract void AbsMove(string portName, short slvAddr, int targetPosition, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0);
public abstract void AlarmClear(string portName, short slvAddr);
public abstract int GetTargetPosition(string portName, short slvAddr);
public abstract int GetActualtPosition(string portName, short slvAddr);
public abstract int GetAlarmStatus(string portName, short slvAddr);
public abstract int GetBusyStatus(string portName, short slvAddr);
......
......@@ -19,7 +19,10 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager.ClearAxisSts((short)slvAddr);
}
public override bool OpenPort(string portName)
{
return true;
}
public override void ClearSpeed()
{
}
......@@ -33,6 +36,10 @@ namespace OnlineStore.DeviceLibrary
}
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
{
}
public override int GetActualtPosition(string portName, short slvAddr)
{
......@@ -67,8 +74,6 @@ namespace OnlineStore.DeviceLibrary
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.NEL;
}
public override int GetLimitPositiveSingle(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
......@@ -84,37 +89,21 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager.StartHomeMove(slvAddr,(uint) highVel, (uint)lowVel, (uint)acc);
}
public override void InitSlvAddr(string portName, short slvAddr)
{
}
public override void InitSlvAddr(string portName, short slvAddr, int targetSpeed, int addSpeed, int delSpeed)
{
}
public override bool IsHomeMoveEnd(string portName, short slvAddr)
{
return HCBoardManager.HomeingIsEnd(slvAddr);
}
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
{
return HCBoardManager.IsInPosition(Axis.GetAxisValue(), PPosition,Axis .CanErrorCountMax);
}
public override bool OpenPort(string portName)
public override bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount, bool isLog = false)
{
return true;
return HCBoardManager.IsInPosition(slvAddr, PPosition,canErrorCount );
}
public override void RelMove(string portName, short slvAddr, int position, int targetSpeed = 0, int ptpAcc = 0, int ptpDec = 0)
{
HCBoardManager.RelMove(slvAddr, position, targetSpeed, ptpAcc, ptpDec);
}
public override bool ServerOnStatus(string portName, short slvAddr)
public override bool IsServeoOn(string portName, short slvAddr)
{
AxisSts axisS = HCBoardManager.GetAxisSts(slvAddr);
return axisS.ServoOn.Equals(1);
......@@ -138,5 +127,19 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager.AxisStop(slvAddr);
}
public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError)
{
countError = false;
bool isOk = HCBoardManager.MoveIsEnd(axisNo);
if (HCBoardManager.IsInPosition(axisNo, targetPosition, canErrorCount))
{
return true;
}
else
{
countError = true;
}
return false;
}
}
}
......@@ -141,7 +141,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否成功打开伺服
/// </summary>
public override bool ServerOnStatus(string portName, short slvAddr)
public override bool IsServeoOn(string portName, short slvAddr)
{
if (!serialBeanMap.ContainsKey(portName))
{
......@@ -167,11 +167,7 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
public override void InitSlvAddr(string portName, short slvAddr)
{
InitSlvAddr(portName, slvAddr, 100, 30, 30);
//InitSlvAddr(portName, slvAddr, 100, 30, 30, 100, 50, 30);
}
//把数字转换为四位的字符串
public string SpeedToStr(int speed, int length)
{
......@@ -411,15 +407,16 @@ namespace OnlineStore.DeviceLibrary
OpenAndCloseSTB(portName, slvAddr);
}
public override bool isInPosition(ConfigMoveAxis Axis, int PPosition, bool isLog = false)
public override bool isInPosition(string portName, short slvAddr, int PPosition, int canErrorCount,bool isLog = false)
{
int outCount = GetActualtPosition(Axis.DeviceName, Axis.GetAxisValue());
string Name = "轴【" + portName + "_" + slvAddr + "】";
int outCount = GetActualtPosition(portName, slvAddr);
int errorCount = Math.Abs(outCount - PPosition);
if (errorCount <= Axis.CanErrorCountMin)
if (errorCount <= canErrorCount)
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return true");
LogUtil.info("【" + Name + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return true");
}
return true;
}
......@@ -427,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
{
if (isLog)
{
LogUtil.info("【" + Axis.GetNameStr() + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return false");
LogUtil.info("【" + Name + "】isInPosition【" + PPosition + "】,当前实时位置:【" + outCount + "】 return false");
}
return false;
}
......@@ -497,5 +494,24 @@ namespace OnlineStore.DeviceLibrary
//Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr);
}
public override bool AbsMoveIsEnd(string portName, short axisNo, int targetPosition, int canErrorCount, out bool countError)
{
countError = false;
bool isOk = AxisManager.instance.GetBusyStatus(portName, axisNo).Equals(0);
int CurrPosition = AxisManager.instance.GetActualtPosition(portName, axisNo);
int errorCount = Math.Abs(CurrPosition - targetPosition);
if (isOk)
{
if (errorCount <= canErrorCount)
{
return true;
}
else
{
countError = true;
}
}
return false;
}
}
}
......@@ -14,7 +14,6 @@ namespace OnlineStore.DeviceLibrary
{
private Dictionary<int, Dictionary<string, RegisterInfo>> LastDataMap = new Dictionary<int, Dictionary<string, RegisterInfo>>();
//private SerialBean bean = null;
private string strFromat = "{0:X2}";
private Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
......@@ -467,6 +466,7 @@ namespace OnlineStore.DeviceLibrary
byte[] reviceData = SendCommand(portName, dataArray, ReviceOutTimeMS, 6);
return GetCoilData(portName, reviceData, ACCMDManager.Home_Single);
}
}
/// <summary>
/// 记录最后一次获得的寄存器的值
......
......@@ -57,6 +57,7 @@
<Compile Include="acSingleStore\BoxBean.cs" />
<Compile Include="acSingleStore\BoxBean_Inventory.cs" />
<Compile Include="acSingleStore\BoxBean_Partial.cs" />
<Compile Include="acSingleStore\HumitureBean.cs" />
<Compile Include="acSingleStore\StoreBean.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="AXIS\AxisManager.cs" />
......
......@@ -14,7 +14,6 @@ namespace OnlineStore.DeviceLibrary
{
public partial class BoxBean : KTK_Store
{
private static bool IsIntSlvBlock = false;
public static bool IsRun = false;
public string CID = "";
......@@ -27,7 +26,8 @@ namespace OnlineStore.DeviceLibrary
private Dictionary<string, AxisAlarmInfo> AxisAlarmCodeMap = new Dictionary<string, AxisAlarmInfo>();
private bool UseCompress_Axis = true;
//public ScanSocket scanSocket = new ScanSocket();
public HumitureBean humBean = null;
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
private System.Timers.Timer readDITimer = new System.Timers.Timer();
......@@ -71,6 +71,7 @@ namespace OnlineStore.DeviceLibrary
}
}
humBean = new HumitureBean(config.Humiture_Port, Name);
mainTimer.Enabled = false;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
......@@ -102,7 +103,7 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
isInSuddenDown = true;
LogUtil.error( Name + "收到急停信号,报警急停");
LogUtil.error(Name + "收到急停信号,报警急停");
WarnMsg = Name + "收到急停信号,报警急停";
//报警时会关闭所有轴
......@@ -118,14 +119,12 @@ namespace OnlineStore.DeviceLibrary
private void ReadDITimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if(MoveInfo.MoveStep.Equals(StoreMoveStep.SC_03_MoveToHBag)&& IOManager.IOValue(IO_Type.CheckPos).Equals(IO_VALUE.HIGH))
if (MoveInfo.MoveStep.Equals(StoreMoveStep.SC_03_MoveToHBag) && IOManager.IOValue(IO_Type.CheckPos).Equals(IO_VALUE.HIGH))
{
reelIsExist = true;
}
}
/// <summary>
/// 配置速度,加减速时间
/// </summary>
public void MoveAxisConfig()
{
......@@ -144,12 +143,9 @@ namespace OnlineStore.DeviceLibrary
}
/// <summary>
/// 开始运行
/// </summary>
public override bool StartRun(bool IsDebug = false)
{
LogUtil.info( Name + "开始启动,启动时间:" + StartTime.ToString());
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString());
autoNext = false;
mainTimer.Enabled = false;
......@@ -159,10 +155,8 @@ namespace OnlineStore.DeviceLibrary
IO_VALUE suddenBtn = IOManager.IOValue(IO_Type.SuddenStop_BTN);
IO_VALUE airCheck = IOManager.IOValue(IO_Type.Airpressure_Check);
//if (suddenBtn == IO_VALUE.HIGH)
if (suddenBtn.Equals(IO_VALUE.HIGH) && (airCheck.Equals(IO_VALUE.HIGH)))
{
//lastAirValue = airCheck;
lastAirCloseTime = DateTime.Now;
if (!RunAxis(true))
{
......@@ -173,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.HomeMoving;
storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器
HumitureController.Init(StoreManager.Config.Humiture_Port);
HumitureController.Init(Config.Humiture_Port);
LineConnect.StartConnect();
ReturnHome();
......@@ -215,7 +209,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info( Name + "开始原点返回,先把进出轴回原点");
LogUtil.info(Name + "开始原点返回,先把进出轴回原点");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
}
......@@ -224,14 +218,11 @@ namespace OnlineStore.DeviceLibrary
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
MoveInfo.NewMove(StoreMoveType.StoreReset);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_InOutToP1);
LogUtil.info( Name + "到待机状态,进出轴到P1,判断叉子没有料盘");
LogUtil.info(Name + "到待机状态,进出轴到P1,判断叉子没有料盘");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
}
public override void Reset(bool isNeedClearAuto=true)
public override void Reset(bool isNeedClearAuto = true)
{
CurrInOutCount = 0;
CurrInOutACount = 0;
......@@ -261,25 +252,17 @@ namespace OnlineStore.DeviceLibrary
////打开四个轴
//if (!OpenAllAxis())
{
LogUtil.info( Name + "复位时打开轴失败,需要再次复位,直接报警停止复位");
LogUtil.info(Name + "复位时打开轴失败,需要再次复位,直接报警停止复位");
return;
}
InoutStartReset();
isInPro = false;
}
private void InoutStartReset()
{
string portName = Config.InOut_Axis.DeviceName;
int slvAddr = Config.InOut_Axis.GetAxisValue();
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info( Name + "复位中,进出轴开始原点返回");
LogUtil.info(Name + "复位中,进出轴开始原点返回");
ACAxisHomeMove(Config.InOut_Axis);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
isInPro = false;
}
/// <summary>
/// 复位处理
/// </summary>
......@@ -293,38 +276,38 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
switch (MoveInfo.MoveStep)
{
case StoreMoveStep.BOX_H_LocationCylinderBack:
InoutStartReset();
break;
case StoreMoveStep.BOX_H_InOutMove:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info( Name + "复位中:进出轴开始原点返回");
LogUtil.info(Name + "" + MoveInfo.MoveType + ":进出轴开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info( Name + "复位中:进出轴到待机点P1,关闭舱门");
LogUtil.info(Name + "" + MoveInfo.MoveType + ":进出轴到待机点P1,关闭舱门");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoor();
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
if (AxisManager.instance.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
LogUtil.error( "进出轴报警!复位失败,请检查!");
if (AxisManager.instance.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
WarnMsg = Name + "" + MoveInfo.MoveType + "进出轴报警!复位失败,请检查!";
LogUtil.error(Name + "" + MoveInfo.MoveType + "进出轴报警!复位失败,请检查!");
}
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info( Name + "复位中: 压紧轴,旋转轴,上下轴开始 原点返回");
LogUtil.info(Name + "" + MoveInfo.MoveType + ": 压紧轴,旋转轴,上下轴开始 原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
MoveInfo.TimeOutSeconds = 100;
if (UseCompress_Axis)
......@@ -337,14 +320,15 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_OtherAxisBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info( Name + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
LogUtil.info(Name + "" + MoveInfo.MoveType + ":旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info( Name + "复位完成");
LogUtil.info(Name + "" + MoveInfo.MoveType + "完成");
storeRunStatus = StoreRunStatus.Runing;
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
......@@ -356,7 +340,7 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_M_H_TOP1_InOutToP1:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome);
LogUtil.info( Name + "到待机状态,压紧轴回原点,关闭舱门");
LogUtil.info(Name + "到待机状态,压紧轴回原点,关闭舱门");
if (UseCompress_Axis)
{
ACAxisHomeMove(Config.Comp_Axis);
......@@ -366,13 +350,14 @@ namespace OnlineStore.DeviceLibrary
break;
case StoreMoveStep.BOX_M_H_TOP1_CompressHome:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1);
LogUtil.info( Name + "复位中:旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
LogUtil.info(Name + "" + MoveInfo.MoveType + ":旋转轴运动到P1,上下轴走到P1,压紧轴到P1!");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogUtil.info( Name + "到待机状态完成");
LogUtil.info(Name + "到待机状态完成");
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing;
......@@ -424,96 +409,15 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// 原点返回处理
/// </summary>
protected override void ReturnHomeProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait();
}
if (MoveInfo.IsInWait)
{
return;
}
switch (MoveInfo.MoveStep)
{
case StoreMoveStep.BOX_H_LocationCylinderBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info( Name + "原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info( Name + "原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘");
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear(Config.InOut_Axis);
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoor();
break;
case StoreMoveStep.BOX_H_InOutToP1:
//如果此时轴三还在报警,需要提示错误并等待
if (AxisManager.instance.GetAlarmStatus(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()) > 0)
{
WarnMsg = "进出轴报警!复位失败,请检查!";
LogUtil.error( "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info( Name + "原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (UseCompress_Axis)
{
ACAxisHomeMove(Config.Comp_Axis);
}
ACAxisHomeMove(Config.Middle_Axis);
ACAxisHomeMove(Config.UpDown_Axis);
break;
case StoreMoveStep.BOX_H_OtherAxisBack:
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info( Name + "回原点:旋转轴运动到P1,上下轴到P1,压紧轴到P1!");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_DoorOPosition_P1, Config.UpDownAxis_P1_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position, Config.CompAxis_P1_Speed);
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info( Name + "回原点完成");
storeRunStatus = StoreRunStatus.Runing;
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
WarnMsg = "";
break;
default: break;
}
}
#endregion
public bool RunAxis(bool isCheck)
{
IOManager.IOMove(IO_Type.Run_Signal, IO_VALUE.HIGH);
Thread.Sleep(1000);
//打开所有轴
foreach (ConfigMoveAxis moveAxis in moveAxisList)
{
string portName = moveAxis.DeviceName;
short slvAddr = moveAxis.GetAxisValue();
AxisManager.instance.OpenPort(portName);
Thread.Sleep(50);
//初始化串口
//AxisManager.instance.InitSlvAddr(portName, slvAddr);
if (!IsIntSlvBlock)
{
AxisManager.instance.InitSlvAddr(portName, slvAddr, moveAxis.TargetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
Thread.Sleep(100);
}
AxisManager.instance.AlarmClear(portName, slvAddr);
Thread.Sleep(50);
AxisManager.instance.ServoOn(portName, slvAddr);
......@@ -527,8 +431,6 @@ namespace OnlineStore.DeviceLibrary
return false;
}
}
IsIntSlvBlock = true;
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
return true;
}
/// <summary>
......@@ -540,28 +442,28 @@ namespace OnlineStore.DeviceLibrary
//判断轴是否正常
foreach (ConfigMoveAxis axis in moveAxisList)
{
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.IsServeoOn(axis.DeviceName, axis.GetAxisValue()))
{
LogUtil.info( Name + "成功打开轴:" + axis.Explain);
LogUtil.info(Name + "成功打开轴:" + axis.Explain);
}
else
{
//清理报警,再重新打开一次
LogUtil.info( Name + "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
LogUtil.info(Name + "第一次打开轴" + axis.Explain + "失败,先清理一下报警,再重新打开一次");
AxisManager.instance.AlarmClear(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(1200);
AxisManager.instance.ServoOn(axis.DeviceName, axis.GetAxisValue());
System.Threading.Thread.Sleep(100);
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.IsServeoOn(axis.DeviceName, axis.GetAxisValue()))
{
LogUtil.info( Name + "清理报警后重新打卡轴成功:" + axis.Explain);
LogUtil.info(Name + "清理报警后重新打卡轴成功:" + axis.Explain);
}
else
{
AxisManager.instance.ServoOff(axis.DeviceName, axis.GetAxisValue());
int alarmCode = GetAlarmCodeByAxis(axis);
WarnMsg = Name + "打开轴" + axis.Explain + "失败 ";
LogUtil.info( Name + WarnMsg);
LogUtil.info(Name + WarnMsg);
Alarm(StoreAlarmType.AxisAlarm, GetAlarmCodeByAxis(axis).ToString(), WarnMsg, MoveInfo.MoveType);
return false;
}
......@@ -572,16 +474,11 @@ namespace OnlineStore.DeviceLibrary
public void CloseAllAxis()
{
LogUtil.info(Name + "关闭刹车,关闭伺服");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
LogUtil.info(Name + "关闭所有轴");
foreach (ConfigMoveAxis axis in moveAxisList)
{
AxisManager.instance.ServoOff(axis.DeviceName, axis.GetAxisValue());
//关闭串口,等下次重新打开
// AxisManager.instance.ColsePort(axis.DeviceName);
}
Thread.Sleep(100);
IOManager.IOMove(IO_Type.Run_Signal, IO_VALUE.LOW);
}
private int GetAlarmCodeByAxis(ConfigMoveAxis axis)
......@@ -607,9 +504,7 @@ namespace OnlineStore.DeviceLibrary
return alarmCode;
}
/// <summary>
/// 停止运行
/// </summary>
public override void StopRun()
{
WarnMsg = "";
......@@ -630,7 +525,7 @@ namespace OnlineStore.DeviceLibrary
//ShuoKeControls.ClosePort();
}
LogUtil.info( Name + ",停止运行,总运行时间:" + span.ToString());
LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString());
}
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
......@@ -642,20 +537,20 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
LogUtil.error( Name + " 报警,报警类型:" + alarmType);
LogUtil.error(Name + " 报警,报警类型:" + alarmType);
this.alarmType = alarmType;
if (alarmType.Equals(StoreAlarmType.AxisAlarm) | alarmType.Equals(StoreAlarmType.AxisMoveError))
{
LogUtil.error( Name + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
LogUtil.error(Name + "轴报警,关闭刹车,停止运动,关闭轴,打开报警灯");
//IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
StopMove();
}
else if (alarmType == StoreAlarmType.SuddenStop)
{
isInSuddenDown = true;
LogUtil.error( Name + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 ");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
LogUtil.error(Name + "收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 ");
//IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
MoveInfo.EndMove();
StopMove();
storeStatus = StoreStatus.SuddenStop;
......@@ -663,8 +558,8 @@ namespace OnlineStore.DeviceLibrary
else if (alarmType.Equals(StoreAlarmType.NoAirCheck))
{
isNoAirCheck = true;
LogUtil.error( Name + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 ");
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
LogUtil.error(Name + " 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 ");
//IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
MoveInfo.EndMove();
StopMove();
storeStatus = StoreStatus.SuddenStop;
......@@ -746,9 +641,9 @@ namespace OnlineStore.DeviceLibrary
DateTime time = DateTime.Now;
bool isTemp30M = false;
if (TempOrHumidityIsAlarm)
if (humBean.TempOrHumidityIsAlarm)
{
TimeSpan span = DateTime.Now - TempAlarmTime;
TimeSpan span = DateTime.Now - humBean.TempAlarmTime;
if (span.Minutes > 30)
{
isTemp30M = true;
......@@ -800,7 +695,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
}
//黄灯
if (MoveInfo.MoveType.Equals(StoreMoveType.InStore) || MoveInfo.MoveType.Equals(StoreMoveType.OutStore) || TempOrHumidityIsAlarm || isTemp30M)
if (MoveInfo.MoveType.Equals(StoreMoveType.InStore) || MoveInfo.MoveType.Equals(StoreMoveType.OutStore) || humBean.TempOrHumidityIsAlarm || isTemp30M)
{
if (IOManager.IOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{
......@@ -821,7 +716,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + "灯处理定时器出错:"+ ex.ToString());
LogUtil.error(Name + "灯处理定时器出错:" + ex.ToString());
}
}
private IO_VALUE lastAutoRun = IO_VALUE.LOW;
......@@ -838,7 +733,7 @@ namespace OnlineStore.DeviceLibrary
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{
//没有启动时收到复位按钮,相当于启动按钮
LogUtil.info( Name + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
LogUtil.info(Name + "没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!");
bool result = StartRun();
if (result.Equals(false))
{
......@@ -870,18 +765,18 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(StoreMoveType.None))
{
LogUtil.info( "收到复位信号,当前无报警,且空闲中,只回到待机点");
LogUtil.info("收到复位信号,当前无报警,且空闲中,只回到待机点");
MoveToP1();
}
else
{
LogUtil.info( "收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
LogUtil.info("收到复位信号,当前无报警, 在" + MoveInfo.MoveType + "处理中,不处理复位");
}
}
else
{
//收到复位信号
LogUtil.info( "收到复位信号,自动复位");
LogUtil.info("收到复位信号,自动复位");
WarnMsg = "收到复位信号,自动复位";
Reset();
}
......@@ -912,7 +807,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error(Name + "定时处理出错:"+ ex.ToString());
LogUtil.error(Name + "定时处理出错:" + ex.ToString());
}
}
......@@ -957,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error( "IOTimeOutProcess出错:" + ex.ToString());
LogUtil.error("IOTimeOutProcess出错:" + ex.ToString());
}
}
......@@ -969,15 +864,15 @@ namespace OnlineStore.DeviceLibrary
try
{
bool noInStore = LineConnect.WaitInStoreList.Count <= 0;
if (CurrInOutACount >= this.Config.Box_ResetACount &&noInStore)
if (CurrInOutACount >= this.Config.Box_ResetACount && noInStore)
{
if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{
LogUtil.info( Name + "已经累计出入库" + CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
LogUtil.info(Name + "已经累计出入库" + CurrInOutACount + "次,当时当前正在忙碌中暂不复位");
}
else
{
LogUtil.info( Name + "已经累计出入库" + CurrInOutACount + "次,需要复位一下");
LogUtil.info(Name + "已经累计出入库" + CurrInOutACount + "次,需要复位一下");
Reset();
}
}
......@@ -985,11 +880,11 @@ namespace OnlineStore.DeviceLibrary
{
if (storeRunStatus < StoreRunStatus.Runing || MoveInfo.MoveType == StoreMoveType.InStore || MoveInfo.MoveType == StoreMoveType.OutStore)
{
LogUtil.info( Name + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
LogUtil.info(Name + "已经累计出入库" + CurrInOutCount + "次,当时当前正在忙碌中暂不复位旋转轴");
}
else
{
LogUtil.info( Name + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
LogUtil.info(Name + "已经累计出入库" + CurrInOutCount + "次,需要复位一下旋转轴");
}
}
else if (LineConnect.CanStartOut() || IsDebug)
......@@ -1006,12 +901,12 @@ namespace OnlineStore.DeviceLibrary
if (currInOutFixture != null)
{ //出库
LogUtil.info( Name + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】");
LogUtil.info(Name + "开始执行排队中的出库【" + currInOutFixture.ToStr() + "】");
bool result = StartOutStoreMove(new InOutParam(currInOutFixture));
//bool result = StartOutStoreMove(new InOutParam("", currInOutFixture.PosId, currInOutFixture.plateH, currInOutFixture.plateW));
if (!result)
{
LogUtil.info( Name + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
LogUtil.info(Name + " 执行排队中的出库【" + currInOutFixture.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(currInOutFixture);
}
}
......@@ -1019,14 +914,10 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error( "处理出入库排队列表出错:" + ex.ToString());
LogUtil.error("处理出入库排队列表出错:" + ex.ToString());
}
}
/// <summary>
/// 判断是否报警,返回 true表示报警 报警检测2秒钟检测一次
/// </summary>
/// <returns></returns>
private DateTime checkAlarmTime = DateTime.Now;
public bool CheckAxisAlarm()
{
......@@ -1073,7 +964,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!info.AlarmIoValue.Equals(alarmIo))
{
LogUtil.error( Name + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
LogUtil.error(Name + " 运动轴 " + axisInfo.Explain + ",报警已解除!");
info.AlarmIoValue = alarmIo;
}
}
......@@ -1083,13 +974,11 @@ namespace OnlineStore.DeviceLibrary
//判断报警状态
return isInAlarm;
}
/// <summary>
/// 停止所有运行
/// </summary>
public override void StopMove()
{
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
//IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
//运动版停止
AxisManager.instance.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
AxisManager.instance.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
......@@ -1098,18 +987,13 @@ namespace OnlineStore.DeviceLibrary
CloseAllAxis();
LogUtil.info( Name + "StopMove");
LogUtil.info(Name + "StopMove");
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
isInPro = false;
}
/// <summary>
/// 判断是可以开始出入库(当前在忙碌状态则需要排队等待)
/// </summary>
/// <returns></returns>
public bool CanStarInOut()
{
if (isInSuddenDown || isNoAirCheck ||
......@@ -1129,10 +1013,12 @@ namespace OnlineStore.DeviceLibrary
try
{
return Convert.ToInt32(str.Trim());
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error(Name + "转换["+str+"]出错:" + ex.ToString());
}return 0;
LogUtil.error(Name + "转换[" + str + "]出错:" + ex.ToString());
}
return 0;
}
private void ReviceInStoreProcess(string message, Operation resultOperation)
{
......@@ -1152,8 +1038,8 @@ namespace OnlineStore.DeviceLibrary
if (position == null)
{ //出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = "入库未找到库位:【" + inoutInfo.ToStr() + "】 ";
LogUtil.error( "收到服务器入库命令:入库未找到库位:【" + inoutInfo.ToStr() + "】");
LogUtil.info( "收到服务器入库命令:入库未找到库位:【" + inoutInfo.ToStr() + "】");
LogUtil.error("收到服务器入库命令:入库未找到库位:【" + inoutInfo.ToStr() + "】");
LogUtil.info("收到服务器入库命令:入库未找到库位:【" + inoutInfo.ToStr() + "】");
return;
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
......@@ -1162,11 +1048,11 @@ namespace OnlineStore.DeviceLibrary
InOutParam param = new InOutParam(inoutInfo);
StartInStoreMove(param);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info( Name + " 收到服务器入库命令:【" + inoutInfo.ToStr() + "】开始入库!");
LogUtil.info(Name + " 收到服务器入库命令:【" + inoutInfo.ToStr() + "】开始入库!");
}
else
{
LogUtil.info( Name + " 收到服务器入库命令:【" + inoutInfo.ToStr() + "】 正在忙碌中,无法入库!");
LogUtil.info(Name + " 收到服务器入库命令:【" + inoutInfo.ToStr() + "】 正在忙碌中,无法入库!");
}
}
......@@ -1181,7 +1067,7 @@ namespace OnlineStore.DeviceLibrary
if (storeRunStatus.Equals(StoreRunStatus.Wait))
{
LogUtil.info( logName + " 设备未启动,验证失败");
LogUtil.info(logName + " 设备未启动,验证失败");
return false;
}
//发送扫码内容到服务器进行入库操作
......@@ -1196,23 +1082,23 @@ namespace OnlineStore.DeviceLibrary
Operation resultOperation = HttpHelper.PostOP(StoreManager.GetPostApi(server), operation, out timeOut);
if (timeOut)
{
LogUtil.info( logName + " 第" + i + "次发送超时 ");
LogUtil.info(logName + " 第" + i + "次发送超时 ");
continue;
}
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info( logName + " 没有收到服务器反馈 ");
LogUtil.info(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info( logName + "服务器反馈 :" + resultOperation.msg);
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
}
else if (resultOperation.op.Equals(1))
{
LogUtil.info( logName + " 成功");
LogUtil.info(logName + " 成功");
return true;
}
break;
......@@ -1220,18 +1106,18 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.info( logName + " 出错:" + ex.ToString());
LogUtil.info(logName + " 出错:" + ex.ToString());
}
return false;
}
public void ReviceLineInStoreCMD(string posId, int plateH, int plateW, string message,string rfid)
public void ReviceLineInStoreCMD(string posId, int plateH, int plateW, string message, string rfid)
{
string logName = "流水线入库命令【 " + message + "】【" + posId + "】:";
if (!LineConnect.WaitInStoreList.Contains(posId))
{
LogUtil.error(logName + "库位未验证通过,重新验证库位");
bool result = ReviceLineCheckInStoreCMD(posId, plateH, plateW, message,rfid);
bool result = ReviceLineCheckInStoreCMD(posId, plateH, plateW, message, rfid);
if (!result)
{
return;
......@@ -1270,135 +1156,6 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
/// </summary>
private float Max_Humidity = 0;
/// <summary>
/// 温度标准,超过后需要报警
/// </summary>
private float Max_Temperature = 0;
private bool IsInBlowing = false;
private DateTime LastBeginBlowTime = DateTime.Now;
private DateTime LastEndBlowTime = new DateTime(1997, 1, 1);
private DateTime preLogTime = DateTime.Now;
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = "";
private void HumidityProcess()
{
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > 10)
{
preLogTime = DateTime.Now;
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
ASTemperateParam param = HumitureController.LastData;
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
//判断是否需要吹气
if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
{
//判断是否距离上次结束指定的时间
TimeSpan span = DateTime.Now - LastEndBlowTime;
if (span.TotalMinutes > this.Config.BlowAir_Interval)
{
LogUtil.info("当前最大湿度:" + currMaxHumidity.ToString() + ",开始吹气湿度:" + startBlowHumidity + ",当前不在吹气中,且间隔超过" + Config.BlowAir_Interval + "分钟,开始吹气!");
IsInBlowing = true;
//Thread.Sleep(100);
IOManager.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
LastBeginBlowTime = DateTime.Now;
LastEndBlowTime = DateTime.Now;
}
}
if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
{
LogUtil.info("当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
IsInBlowing = false;
IOManager.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
if (IsInBlowing)
{
//判断是否需要结束吹气
TimeSpan span = DateTime.Now - LastBeginBlowTime;
if (span.TotalMinutes > this.Config.BlowAir_Time)
{
LogUtil.info("已经吹气" + span.TotalMinutes + "分钟,超过配置的吹气时间" + Config.BlowAir_Time + "分钟,停止吹气!");
IsInBlowing = false;
//Thread.Sleep(100);
IOManager.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
LastEndBlowTime = DateTime.Now;
}
}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info("当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
//Thread.Sleep(100);
IOManager.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info("不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
//Thread.Sleep(100);
IOManager.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
if (TempOrHumidityIsAlarm)
{
return;
}
TempAlarmTime = DateTime.Now;
TempOrHumidityIsAlarm = true;
}
#endregion
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
......@@ -1427,7 +1184,7 @@ namespace OnlineStore.DeviceLibrary
{
ss = (int)StoreStatus.Debugging;
}
StoreSendBean store=new StoreSendBean(Config.DeviceID,Config.CID, (int)ss, (int)storeRunStatus, hasTray, (int)alarmType);
StoreSendBean store = new StoreSendBean(Config.DeviceID, Config.CID, (int)ss, (int)storeRunStatus, hasTray, (int)alarmType);
LineConnect.SendHeart(store);
}
if (StoreManager.IsConnectServer)
......@@ -1438,16 +1195,17 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("定时给服务器发送消息出错:"+ ex.ToString());
LogUtil.error("定时给服务器发送消息出错:" + ex.ToString());
}
}
HumitureController.QueryData();
HumidityProcess();
//HumitureController.QueryData();
//HumidityProcess();
LedProcess();
}catch(Exception ex)
}
catch (Exception ex)
{
LogUtil.error("server_connect_timer_Tick出错:"+ex.ToString());
LogUtil.error("server_connect_timer_Tick出错:" + ex.ToString());
}
finally
{
......@@ -1455,9 +1213,6 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// 获取整个料仓的状态
/// </summary>
public Operation getLineBoxStatus()
{
//构建发送给服务器的对象
......@@ -1515,7 +1270,7 @@ namespace OnlineStore.DeviceLibrary
boxStatus.status = (int)lastPosIdStatus;
if (lastPosId != "")
{
LogUtil.info( "给服务器发送出入库完成消息:" + Name + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
LogUtil.info("给服务器发送出入库完成消息:" + Name + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
}
lastPosId = "";
}
......@@ -1533,11 +1288,11 @@ namespace OnlineStore.DeviceLibrary
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.Temperate_Serveraddress);
ASTemperateParam param = HumitureController.LastData;
if (param != null)
//HumitureParam param = HumitureController.LastData;
if (humBean != null)
{
boxStatus.humidity = param.Humidity.ToString();
boxStatus.temperature = param.Temperate.ToString();
boxStatus.humidity = humBean.LastData.Humidity.ToString();
boxStatus.temperature = humBean.LastData.Temperate.ToString();
}
lineOperation.boxStatus.Add(1, boxStatus);
......@@ -1554,10 +1309,10 @@ namespace OnlineStore.DeviceLibrary
//构建发送给服务器的对象
Operation lineOperation = getLineBoxStatus();
//如果还没湿度范围,先获取
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
if (humBean.NeedGetTem())
{
lineOperation.op = 5;
LogUtil.info( Name + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op);
LogUtil.error(Name + "没有湿度预警范围,需要从服务器获取,发送OP=" + lineOperation.op, DeviceID + 105);
}
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
bool isTimeout = false;
......@@ -1579,7 +1334,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (resultOperation.op.Equals(5))
{
ProcessHumidityCMD(resultOperation);
humBean.ProcessHumidityCMD(resultOperation);
}
else
{
......@@ -1591,29 +1346,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
}
}
private void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error("转换温湿度失败:" + ex.ToString());
}
}
}
private void ReviceOutStoreProcess(Operation resultOperation) {
private void ReviceOutStoreProcess(Operation resultOperation)
{
DateTime time = DateTime.Now;
Dictionary<string, string> data = resultOperation.data;
......@@ -1626,8 +1362,8 @@ namespace OnlineStore.DeviceLibrary
string[] plateWArray = data[ParamDefine.plateW].Split(splitChar);
string[] plateHArray = data[ParamDefine.plateH].Split(splitChar);
bool urgentReel =FormUtil. GetBoolData( data,ParamDefine.urgentReel);
bool cutReel= FormUtil.GetBoolData(data, ParamDefine.cutReel);
bool urgentReel = FormUtil.GetBoolData(data, ParamDefine.urgentReel);
bool cutReel = FormUtil.GetBoolData(data, ParamDefine.cutReel);
bool smallReel = FormUtil.GetBoolData(data, ParamDefine.smallReel);
string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : "";
int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc);
......@@ -1639,7 +1375,7 @@ namespace OnlineStore.DeviceLibrary
//rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
string dataStr = JsonHelper.SerializeObject(data);
LogUtil.info( "收到服务器出库消息:【" + dataStr+"】");
LogUtil.info("收到服务器出库消息:【" + dataStr + "】");
int index = -1;
foreach (string posId in posIdArray)
......@@ -1658,7 +1394,7 @@ namespace OnlineStore.DeviceLibrary
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = Name + "未找到库位:【" + intouInfo.ToStr() + "】";
LogUtil.error( WarnMsg);
LogUtil.error(WarnMsg);
continue;
}
......@@ -1667,7 +1403,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否接收过此库位的出库信息
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PosInfo.PosId.Equals(posId))
{
LogUtil.info( Name + " 出库命令【" + intouInfo.ToStr() + "】重复,正在【" + posId + "】出库中");
LogUtil.info(Name + " 出库命令【" + intouInfo.ToStr() + "】重复,正在【" + posId + "】出库中");
continue;
}
else
......@@ -1677,7 +1413,7 @@ namespace OnlineStore.DeviceLibrary
reviceList = (from m in reviceList where m.PosId.Equals(posId) select m).ToList<InOutPosInfo>();
if (reviceList.Count > 0)
{
LogUtil.debug( Name + " 出库命令【" + intouInfo.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
LogUtil.debug(Name + " 出库命令【" + intouInfo.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
continue;
}
}
......@@ -1692,13 +1428,13 @@ namespace OnlineStore.DeviceLibrary
bool result = StartOutStoreMove(new InOutParam(intouInfo));
if (!result)
{
LogUtil.info( Name + " 执行出库【" + intouInfo.ToStr() + "】失败,加入等待队列");
LogUtil.info(Name + " 执行出库【" + intouInfo.ToStr() + "】失败,加入等待队列");
AddWaitOutInfo(intouInfo);
}
}
else
{
LogUtil.error( "执行出库【" + intouInfo.ToStr() + "】失败,当前在忙碌中,加入等待队列");
LogUtil.error("执行出库【" + intouInfo.ToStr() + "】失败,当前在忙碌中,加入等待队列");
AddWaitOutInfo(intouInfo);
}
......
......@@ -343,7 +343,9 @@ namespace OnlineStore.DeviceLibrary
}
private void SI_05_DeviceToDoor()
{
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1,true))
ConfigMoveAxis updown = Config.UpDown_Axis;
if (!AxisManager.instance.isInPosition(updown.DeviceName, updown.GetAxisValue(), MoveInfo.MoveParam.MoveP.UpDown_P1, updown.CanErrorCountMax,true))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -351,7 +353,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
return;
}
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1))
ConfigMoveAxis middle = Config.Middle_Axis;
if (!AxisManager.instance.isInPosition(middle.DeviceName, middle.GetAxisValue(), MoveInfo.MoveParam.MoveP.Middle_P1, middle.CanErrorCountMax, true))
{
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
......@@ -395,7 +398,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsTimeOut(10))
{
WarnMsg = Name + "入库 等待料仓门口检测到料盘 [" + MoveInfo.MoveParam.PosInfo.barcode + "] [" + MoveInfo.MoveParam.PosInfo.PosId + "] 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒 ";
LogUtil.error( WarnMsg, 100);
LogUtil.error(WarnMsg, 100);
Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, MoveInfo.MoveType);
//InStoreLog(" 入库:SI_00 入库等待仓门口料盘信号");
......@@ -428,7 +431,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
if (!AxisManager.instance.isInPosition(Config.UpDown_Axis, moveP.UpDown_P1))
ConfigMoveAxis updown = Config.UpDown_Axis;
if (!AxisManager.instance.isInPosition(updown.DeviceName, updown.GetAxisValue(), moveP.UpDown_P1, updown.CanErrorCountMax))
{
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
......@@ -436,7 +440,8 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog("入库:SI_03 升降轴已在P1[" + moveP.UpDown_P1 + "]");
}
if (!AxisManager.instance.isInPosition(Config.Middle_Axis, moveP.Middle_P1))
ConfigMoveAxis middle = Config.Middle_Axis;
if (!AxisManager.instance.isInPosition(middle.DeviceName, middle.GetAxisValue(), moveP.Middle_P1, middle.GetAxisValue()))
{
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
......@@ -499,11 +504,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_09_MoveToBag)
{
InStoreLog("入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) [" + moveP.InOut_P3 + "]");
MoveInfo.NextMoveStep(StoreMoveStep.SI_11_DeviceToBag);
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SI_10_LocationCylinder_Down)
{
......@@ -554,7 +557,7 @@ namespace OnlineStore.DeviceLibrary
{
TimeSpan span = DateTime.Now - startInStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : "";
LogUtil.info( Name + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!" );
LogUtil.info(Name + " 【" + posId + "】 整个入库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
//设备连接,入库后,BOX恢复原始状态
......@@ -563,7 +566,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogUtil.info( Name + " 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
LogUtil.info(Name + " 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
......
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class HumitureBean
{
private string PortName = "";
private string Name = "";
public HumitureParam LastData = new HumitureParam(0, 0);
internal HumitureBean(string port, string deviceName)
{
this.Name = deviceName;
this.PortName = port;
}
public HumitureParam QueryData()
{
HumitureParam param = HumitureController.QueryData(PortName);
LastData = param;
return LastData;
}
internal void ProcessHumidityCMD(Operation resultOperation)
{
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.maxHumidity) && data.ContainsKey(ParamDefine.maxTemperature))
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info(Name + "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info(Name + "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
LogUtil.error(Name + "转换温湿度失败:" + ex.ToString());
}
}
}
#region 温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
/// </summary>
private float Max_Humidity = 0;
/// <summary>
/// 温度标准,超过后需要报警
/// </summary>
private float Max_Temperature = 0;
private bool IsInBlowing = false;
private DateTime LastBeginBlowTime = DateTime.Now;
private DateTime LastEndBlowTime = new DateTime(1997, 1, 1);
private DateTime preLogTime = DateTime.Now;
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = "";
internal void HumidityProcess(BoxBean box)
{
try
{
if ((DateTime.Now - preLogTime).TotalSeconds > (8 + box.DeviceID))
{
preLogTime = DateTime.Now;
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
HumitureParam param = QueryData();
double humidity = 0;
double temp = 0;
if (param != null)
{
humidity = param.Humidity;
temp = param.Temperate;
currTempStr = Name + ("湿度:" + humidity.ToString() + ",温度:" + temp);
}
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
float stopBlowHumidity = Max_Humidity - StopBlowValue;
////判断是否需要吹气
//if (startBlowHumidity > 0 && startBlowHumidity < currMaxHumidity && IsInBlowing.Equals(false))
//{
// //判断是否距离上次结束指定的时间
// TimeSpan span = DateTime.Now - LastEndBlowTime;
// if (span.TotalMinutes > box.Config.BlowAir_Interval)
// {
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",开始吹气湿度:" + startBlowHumidity + ",当前不在吹气中,且间隔超过" + box.Config.BlowAir_Interval + "分钟,开始吹气!");
// IsInBlowing = true;
// //Thread.Sleep(100);
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.HIGH);
// LastBeginBlowTime = DateTime.Now;
// LastEndBlowTime = DateTime.Now;
// }
//}
//if (IsInBlowing && stopBlowHumidity > currMaxHumidity)
//{
// LogUtil.info(Name + "当前最大湿度:" + currMaxHumidity.ToString() + ",停止吹气湿度:" + stopBlowHumidity + ",停止吹气!");
// IsInBlowing = false;
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
//}
//if (IsInBlowing)
//{
// //判断是否需要结束吹气
// TimeSpan span = DateTime.Now - LastBeginBlowTime;
// if (span.TotalMinutes > box.Config.BlowAir_Time)
// {
// LogUtil.info(Name + "已经吹气" + span.TotalMinutes + "分钟,超过配置的吹气时间" + box.Config.BlowAir_Time + "分钟,停止吹气!");
// IsInBlowing = false;
// //Thread.Sleep(100);
// box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
// LastEndBlowTime = DateTime.Now;
// }
//}
bool needAlarm = false;
//如果开始吹气并且当前达到报警值
if (IsInBlowing && humidity > Max_Humidity)
{
needAlarm = true;
}
else if (temp > Max_Temperature && Max_Temperature > 0)
{
LogUtil.info(Name + "当前温度【" + param.Temperate + "】超过最高温度【" + Max_Temperature + "】,开始报警!");
needAlarm = true;
//box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
else if (temp < Max_Temperature)
{
if (IsInBlowing.Equals(false) && TempOrHumidityIsAlarm)
{
LogUtil.info(Name + "不在吹气中,且当前温度【" + param.Temperate + "】低于【" + Max_Temperature + "】,关闭报警!");
TempOrHumidityIsAlarm = false;
//box.IOMove(IO_Type.StartOrStopBlow, IO_VALUE.LOW);
}
}
else
{
TempOrHumidityIsAlarm = false;
}
if (needAlarm)
{
HTAlarm();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + "HumidityProcess出错:" + ex.ToString());
}
}
private void HTAlarm()
{
if (TempOrHumidityIsAlarm)
{
return;
}
TempAlarmTime = DateTime.Now;
TempOrHumidityIsAlarm = true;
}
internal bool NeedGetTem()
{
if (Max_Humidity <= 0 || (Max_Temperature <= 0))
{
return true;
}
return false;
}
#endregion
}
}
......@@ -14,14 +14,8 @@ using System.Timers;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 流水线自动料仓-流水线类
/// </summary>
public partial class StoreBean : KTK_Store
{
/// <summary>
/// 灯闪烁定时器
/// </summary>
private System.Timers.Timer ledProcessTimer = null;
public Dictionary<int, BoxConfig> BoxConfigMap { get; set; }
......@@ -49,25 +43,20 @@ namespace OnlineStore.DeviceLibrary
List<string> ioList = new List<string>();
IOManager.Init();
//AddDeviceName(ioList, Config.DIODeviceNameList);
AxisManager.Init();
foreach (BoxConfig config in configList.Values)
{
BoxBean equip = new BoxBean(config);
//增加站号名称
//AddDeviceName(ioList, config.DIODeviceNameList);
BoxMap.Add(config.DeviceID, equip);
BoxConfigMap.Add(config.DeviceID, config);
}
//先初始化设备
Task.Factory.StartNew(delegate
{
// RFIDManager.RfidReader.Open(rfidList.ToArray());
IOManager.instance.ConnectionIOList(ioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
......@@ -77,20 +66,9 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
mainTimer.Enabled = true;
canStart = true;
});
}
private void AddDeviceName(List<string> targetList, List<string> list)
{
foreach (string str in list)
{
if (!targetList.Contains(str))
{
targetList.Add(str);
}
}
}
public void InitTimer()
{
ledProcessTimer = new System.Timers.Timer();
......
......@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Text;
using System.Threading;
......@@ -115,9 +116,6 @@ namespace OnlineStore.DeviceLibrary
isInPro = false;
break;
case StoreMoveType.ReturnHome:
ReturnHomeProcess();
isInPro = false;
break;
case StoreMoveType.StoreReset:
ResetProcess();
isInPro = false;
......@@ -197,7 +195,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 停止所有运动
/// </summary>
public abstract void StopMove( );
public abstract void StopMove();
/// <summary>
/// 重置处理
......@@ -209,25 +207,15 @@ namespace OnlineStore.DeviceLibrary
protected virtual void InventoryProcess()
{
}
/// <summary>
/// 原点返回处理
/// </summary>
protected virtual void ReturnHomeProcess() { }
/// <summary>
/// 松下伺服轴原点返回运动,等待收到反馈后才会返回
/// </summary>
protected void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{
moveAxis.TargetPosition = 0;
LogUtil.info( moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
LogUtil.info(moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AxisManager.instance.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed,moveAxis.HomeLowSpeed,moveAxis.HomeAddSpeed);
AxisManager.instance.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
}
/// <summary>
/// 松下伺服电机运动
/// </summary>
protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
......@@ -235,38 +223,24 @@ namespace OnlineStore.DeviceLibrary
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
protected bool ACAxisMoveIsEnd(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed, out string msg)
{
msg = "";
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
//如果是进出轴,并且光栅被遮挡,直接返回false
//if (NeedCheckSafetyLight.Equals(2))
//{
// if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_10_DeviceToDoor) ||
// StoreMove.MoveStep.Equals(StoreMoveStep.SI_05_DeviceToDoor))
// {
// return false;
// }
//}
bool isOk = AxisManager.instance.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition);
if (isOk)
{
if (errorCount <= moveAxis.CanErrorCountMax)
bool countError = false;
bool IsOk = AxisManager.instance.AbsMoveIsEnd(deviceName, axisNo, targetPosition, moveAxis.CanErrorCountMax, out countError);
if (IsOk)
{
return true;
}
if (countError)
{
int outCount = AxisManager.instance.GetActualtPosition(deviceName, axisNo);
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
LogUtil.error( moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
LogUtil.error(moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
AxisManager.instance.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
......@@ -275,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
{
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警";
LogUtil.error( msg);
LogUtil.error(msg);
}
}
return false;
......
......@@ -122,10 +122,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
Wait = 0,
#region 料仓原点返回和重置步骤
/// <summary>
/// 料仓原点返回和重置步骤,,定位气缸下降
/// </summary>
BOX_H_LocationCylinderBack = 010,
///// <summary>
///// 料仓原点返回和重置步骤,,定位气缸下降
///// </summary>
//BOX_H_LocationCylinderBack = 010,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
......
......@@ -39,6 +39,7 @@
<!--是否调试状态-->
<add key="IsInDebug" value="1" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key ="App_AutoRun" value ="0"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -18,15 +18,11 @@ namespace OnlineStore.ACSingleStore
public partial class FrmAxisDebug : FrmBase
{
//private KTK_LA_BoxBean store;
private ConfigMoveAxis middle = null;
private ConfigMoveAxis updown = null;
//private ConfigMoveAxis compress = null;
private ConfigMoveAxis inout = null;
private ConfigMoveAxis comp = null;
//private int compress_Slv = 0;
private BoxBean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(BoxBean boxBean)
{
this.boxBean = boxBean;
......@@ -42,7 +38,7 @@ namespace OnlineStore.ACSingleStore
private void AxisMove(ConfigMoveAxis axis, int speed)
{
LogUtil.debug(LOGGER, "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
LogUtil.debug( "点动:deviceName=" + axis.DeviceName + ",axis=" + axis.GetAxisValue() + ",speed=" + speed);
AxisManager.instance.SpeedMove(axis.DeviceName, axis.GetAxisValue(), speed);
}
......
......@@ -83,6 +83,10 @@
this.btnUpDownP3 = new System.Windows.Forms.Button();
this.btnUpDownP4 = new System.Windows.Forms.Button();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button6 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.AutoCountClient.AxisMoveControl();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txt4Target = new System.Windows.Forms.TextBox();
......@@ -104,26 +108,8 @@
this.label1 = new System.Windows.Forms.Label();
this.label43 = new System.Windows.Forms.Label();
this.label42 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.btnClearLog = new System.Windows.Forms.Button();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.btnSelTemp = new System.Windows.Forms.Button();
this.txtHum = new System.Windows.Forms.TextBox();
this.label29 = new System.Windows.Forms.Label();
this.txtTemp = new System.Windows.Forms.TextBox();
this.label28 = new System.Windows.Forms.Label();
this.txtTempPort = new System.Windows.Forms.TextBox();
this.label27 = new System.Windows.Forms.Label();
this.btnTempClose = new System.Windows.Forms.Button();
this.btnTempInit = new System.Windows.Forms.Button();
this.btnOpenDoor = new System.Windows.Forms.Button();
this.btnCloseDoor = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button6 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.lblMoveEquipInfo = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lblMoveEquipInfo = new System.Windows.Forms.Label();
this.btnCon = new System.Windows.Forms.Button();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.lblThisSta = new System.Windows.Forms.Label();
......@@ -131,10 +117,8 @@
this.tabPage3.SuspendLayout();
this.groupInout.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
......@@ -148,7 +132,7 @@
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(899, 31);
this.chbDebug.Location = new System.Drawing.Point(911, 31);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(93, 25);
this.chbDebug.TabIndex = 271;
......@@ -203,7 +187,7 @@
// btnUpdown
//
this.btnUpdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdown.Location = new System.Drawing.Point(743, 64);
this.btnUpdown.Location = new System.Drawing.Point(588, 287);
this.btnUpdown.Name = "btnUpdown";
this.btnUpdown.Size = new System.Drawing.Size(118, 39);
this.btnUpdown.TabIndex = 14;
......@@ -214,7 +198,7 @@
// btnAxisOff
//
this.btnAxisOff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOff.Location = new System.Drawing.Point(872, 19);
this.btnAxisOff.Location = new System.Drawing.Point(717, 242);
this.btnAxisOff.Name = "btnAxisOff";
this.btnAxisOff.Size = new System.Drawing.Size(116, 39);
this.btnAxisOff.TabIndex = 11;
......@@ -225,7 +209,7 @@
// btnAxisOn
//
this.btnAxisOn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisOn.Location = new System.Drawing.Point(743, 19);
this.btnAxisOn.Location = new System.Drawing.Point(588, 242);
this.btnAxisOn.Name = "btnAxisOn";
this.btnAxisOn.Size = new System.Drawing.Size(116, 39);
this.btnAxisOn.TabIndex = 10;
......@@ -236,7 +220,7 @@
// btnAxisP
//
this.btnAxisP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAxisP.Location = new System.Drawing.Point(872, 64);
this.btnAxisP.Location = new System.Drawing.Point(717, 287);
this.btnAxisP.Name = "btnAxisP";
this.btnAxisP.Size = new System.Drawing.Size(116, 39);
this.btnAxisP.TabIndex = 8;
......@@ -252,18 +236,17 @@
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(6, 145);
this.tabControl1.Location = new System.Drawing.Point(4, 145);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1071, 505);
this.tabControl1.Size = new System.Drawing.Size(1083, 505);
this.tabControl1.TabIndex = 272;
//
// tabPage4
//
this.tabPage4.Location = new System.Drawing.Point(4, 29);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1063, 472);
this.tabPage4.Size = new System.Drawing.Size(1075, 472);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = " IO状态查看 ";
this.tabPage4.UseVisualStyleBackColor = true;
......@@ -273,7 +256,7 @@
this.tabPage3.Controls.Add(this.groupInout);
this.tabPage3.Location = new System.Drawing.Point(4, 29);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(1063, 472);
this.tabPage3.Size = new System.Drawing.Size(1075, 472);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = " 库位位置配置 ";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -330,7 +313,7 @@
this.groupInout.Enabled = false;
this.groupInout.Location = new System.Drawing.Point(3, 3);
this.groupInout.Name = "groupInout";
this.groupInout.Size = new System.Drawing.Size(1053, 419);
this.groupInout.Size = new System.Drawing.Size(1065, 413);
this.groupInout.TabIndex = 100;
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
......@@ -1016,6 +999,7 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.axisMoveControl1);
this.tabPage1.Controls.Add(this.btnUpdown);
this.tabPage1.Controls.Add(this.groupBox1);
......@@ -1025,16 +1009,62 @@
this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1063, 472);
this.tabPage1.Size = new System.Drawing.Size(1075, 472);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = " 伺服调试 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button3);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Location = new System.Drawing.Point(578, 149);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(476, 78);
this.groupBox2.TabIndex = 276;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "流水线通信测试";
this.groupBox2.Visible = false;
//
// button6
//
this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button6.Location = new System.Drawing.Point(317, 32);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(100, 33);
this.button6.TabIndex = 275;
this.button6.Text = "发送";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button3
//
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(64, 31);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(100, 33);
this.button3.TabIndex = 273;
this.button3.Text = "连接";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Location = new System.Drawing.Point(193, 32);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(100, 33);
this.button5.TabIndex = 274;
this.button5.Text = "停止";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// axisMoveControl1
//
this.axisMoveControl1.Location = new System.Drawing.Point(6, 6);
this.axisMoveControl1.Location = new System.Drawing.Point(4, 6);
this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(731, 429);
this.axisMoveControl1.Size = new System.Drawing.Size(562, 429);
this.axisMoveControl1.TabIndex = 218;
//
// groupBox1
......@@ -1059,42 +1089,42 @@
this.groupBox1.Controls.Add(this.label43);
this.groupBox1.Controls.Add(this.label42);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(603, 311);
this.groupBox1.Location = new System.Drawing.Point(578, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(487, 136);
this.groupBox1.Size = new System.Drawing.Size(476, 136);
this.groupBox1.TabIndex = 217;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
//
// txt4Target
//
this.txt4Target.Location = new System.Drawing.Point(389, 103);
this.txt4Target.Location = new System.Drawing.Point(377, 103);
this.txt4Target.Name = "txt4Target";
this.txt4Target.ReadOnly = true;
this.txt4Target.Size = new System.Drawing.Size(87, 23);
this.txt4Target.Size = new System.Drawing.Size(84, 23);
this.txt4Target.TabIndex = 270;
//
// lblTargetP4
//
this.lblTargetP4.Location = new System.Drawing.Point(389, 75);
this.lblTargetP4.Location = new System.Drawing.Point(377, 75);
this.lblTargetP4.Name = "lblTargetP4";
this.lblTargetP4.ReadOnly = true;
this.lblTargetP4.Size = new System.Drawing.Size(87, 23);
this.lblTargetP4.Size = new System.Drawing.Size(84, 23);
this.lblTargetP4.TabIndex = 269;
//
// lblActual4
//
this.lblActual4.Location = new System.Drawing.Point(389, 47);
this.lblActual4.Location = new System.Drawing.Point(377, 47);
this.lblActual4.Name = "lblActual4";
this.lblActual4.ReadOnly = true;
this.lblActual4.Size = new System.Drawing.Size(87, 23);
this.lblActual4.Size = new System.Drawing.Size(84, 23);
this.lblActual4.TabIndex = 268;
//
// label7
//
this.label7.AutoSize = true;
this.label7.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label7.Location = new System.Drawing.Point(386, 14);
this.label7.Location = new System.Drawing.Point(384, 20);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(71, 17);
this.label7.TabIndex = 267;
......@@ -1105,30 +1135,30 @@
this.txtMiddleTarget.Location = new System.Drawing.Point(105, 104);
this.txtMiddleTarget.Name = "txtMiddleTarget";
this.txtMiddleTarget.ReadOnly = true;
this.txtMiddleTarget.Size = new System.Drawing.Size(87, 23);
this.txtMiddleTarget.Size = new System.Drawing.Size(84, 23);
this.txtMiddleTarget.TabIndex = 262;
//
// txtInoutTarget
//
this.txtInoutTarget.Location = new System.Drawing.Point(294, 104);
this.txtInoutTarget.Location = new System.Drawing.Point(287, 104);
this.txtInoutTarget.Name = "txtInoutTarget";
this.txtInoutTarget.ReadOnly = true;
this.txtInoutTarget.Size = new System.Drawing.Size(87, 23);
this.txtInoutTarget.Size = new System.Drawing.Size(84, 23);
this.txtInoutTarget.TabIndex = 260;
//
// txtUpdownTarget
//
this.txtUpdownTarget.Location = new System.Drawing.Point(198, 104);
this.txtUpdownTarget.Location = new System.Drawing.Point(195, 104);
this.txtUpdownTarget.Name = "txtUpdownTarget";
this.txtUpdownTarget.ReadOnly = true;
this.txtUpdownTarget.Size = new System.Drawing.Size(87, 23);
this.txtUpdownTarget.Size = new System.Drawing.Size(84, 23);
this.txtUpdownTarget.TabIndex = 259;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label12.Location = new System.Drawing.Point(7, 107);
this.label12.Location = new System.Drawing.Point(17, 106);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(83, 17);
this.label12.TabIndex = 258;
......@@ -1139,7 +1169,7 @@
this.lblTargetP1.Location = new System.Drawing.Point(105, 76);
this.lblTargetP1.Name = "lblTargetP1";
this.lblTargetP1.ReadOnly = true;
this.lblTargetP1.Size = new System.Drawing.Size(87, 23);
this.lblTargetP1.Size = new System.Drawing.Size(84, 23);
this.lblTargetP1.TabIndex = 257;
//
// lblActual1
......@@ -1147,46 +1177,46 @@
this.lblActual1.Location = new System.Drawing.Point(105, 48);
this.lblActual1.Name = "lblActual1";
this.lblActual1.ReadOnly = true;
this.lblActual1.Size = new System.Drawing.Size(87, 23);
this.lblActual1.Size = new System.Drawing.Size(84, 23);
this.lblActual1.TabIndex = 256;
//
// lblTargetP3
//
this.lblTargetP3.Location = new System.Drawing.Point(294, 76);
this.lblTargetP3.Location = new System.Drawing.Point(287, 76);
this.lblTargetP3.Name = "lblTargetP3";
this.lblTargetP3.ReadOnly = true;
this.lblTargetP3.Size = new System.Drawing.Size(87, 23);
this.lblTargetP3.Size = new System.Drawing.Size(84, 23);
this.lblTargetP3.TabIndex = 178;
//
// lblActual3
//
this.lblActual3.Location = new System.Drawing.Point(294, 48);
this.lblActual3.Location = new System.Drawing.Point(287, 48);
this.lblActual3.Name = "lblActual3";
this.lblActual3.ReadOnly = true;
this.lblActual3.Size = new System.Drawing.Size(87, 23);
this.lblActual3.Size = new System.Drawing.Size(84, 23);
this.lblActual3.TabIndex = 177;
//
// lblTargetP2
//
this.lblTargetP2.Location = new System.Drawing.Point(199, 76);
this.lblTargetP2.Location = new System.Drawing.Point(195, 76);
this.lblTargetP2.Name = "lblTargetP2";
this.lblTargetP2.ReadOnly = true;
this.lblTargetP2.Size = new System.Drawing.Size(87, 23);
this.lblTargetP2.Size = new System.Drawing.Size(84, 23);
this.lblTargetP2.TabIndex = 176;
//
// lblActual2
//
this.lblActual2.Location = new System.Drawing.Point(198, 48);
this.lblActual2.Location = new System.Drawing.Point(195, 48);
this.lblActual2.Name = "lblActual2";
this.lblActual2.ReadOnly = true;
this.lblActual2.Size = new System.Drawing.Size(87, 23);
this.lblActual2.Size = new System.Drawing.Size(84, 23);
this.lblActual2.TabIndex = 175;
//
// label4
//
this.label4.AutoSize = true;
this.label4.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label4.Location = new System.Drawing.Point(291, 15);
this.label4.Location = new System.Drawing.Point(294, 20);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(71, 17);
this.label4.TabIndex = 100;
......@@ -1196,7 +1226,7 @@
//
this.label3.AutoSize = true;
this.label3.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label3.Location = new System.Drawing.Point(196, 15);
this.label3.Location = new System.Drawing.Point(202, 20);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 17);
this.label3.TabIndex = 99;
......@@ -1206,7 +1236,7 @@
//
this.label1.AutoSize = true;
this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label1.Location = new System.Drawing.Point(106, 15);
this.label1.Location = new System.Drawing.Point(112, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(71, 17);
this.label1.TabIndex = 97;
......@@ -1216,7 +1246,7 @@
//
this.label43.AutoSize = true;
this.label43.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label43.Location = new System.Drawing.Point(15, 50);
this.label43.Location = new System.Drawing.Point(29, 49);
this.label43.Name = "label43";
this.label43.Size = new System.Drawing.Size(59, 17);
this.label43.TabIndex = 23;
......@@ -1226,243 +1256,17 @@
//
this.label42.AutoSize = true;
this.label42.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label42.Location = new System.Drawing.Point(15, 77);
this.label42.Location = new System.Drawing.Point(29, 76);
this.label42.Name = "label42";
this.label42.Size = new System.Drawing.Size(59, 17);
this.label42.TabIndex = 24;
this.label42.Text = "规划位置:";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.btnClearLog);
this.tabPage2.Controls.Add(this.groupBox7);
this.tabPage2.Controls.Add(this.btnOpenDoor);
this.tabPage2.Controls.Add(this.btnCloseDoor);
this.tabPage2.Controls.Add(this.groupBox2);
this.tabPage2.Controls.Add(this.lblMoveEquipInfo);
this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1063, 475);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 温湿度 ";
this.tabPage2.UseVisualStyleBackColor = true;
//
// btnClearLog
//
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClearLog.Location = new System.Drawing.Point(301, 152);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 38);
this.btnClearLog.TabIndex = 224;
this.btnClearLog.Text = "清理日志";
this.btnClearLog.UseVisualStyleBackColor = true;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// groupBox7
//
this.groupBox7.Controls.Add(this.btnSelTemp);
this.groupBox7.Controls.Add(this.txtHum);
this.groupBox7.Controls.Add(this.label29);
this.groupBox7.Controls.Add(this.txtTemp);
this.groupBox7.Controls.Add(this.label28);
this.groupBox7.Controls.Add(this.txtTempPort);
this.groupBox7.Controls.Add(this.label27);
this.groupBox7.Controls.Add(this.btnTempClose);
this.groupBox7.Controls.Add(this.btnTempInit);
this.groupBox7.Location = new System.Drawing.Point(11, 6);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(534, 140);
this.groupBox7.TabIndex = 272;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "温控器调试";
//
// btnSelTemp
//
this.btnSelTemp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSelTemp.Location = new System.Drawing.Point(212, 82);
this.btnSelTemp.Name = "btnSelTemp";
this.btnSelTemp.Size = new System.Drawing.Size(157, 33);
this.btnSelTemp.TabIndex = 248;
this.btnSelTemp.Text = "查询实时数据";
this.btnSelTemp.UseVisualStyleBackColor = true;
this.btnSelTemp.Click += new System.EventHandler(this.btnSelTemp_Click);
//
// txtHum
//
this.txtHum.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtHum.Location = new System.Drawing.Point(95, 98);
this.txtHum.MaxLength = 10;
this.txtHum.Name = "txtHum";
this.txtHum.Size = new System.Drawing.Size(87, 26);
this.txtHum.TabIndex = 247;
this.txtHum.Text = "0";
//
// label29
//
this.label29.AutoSize = true;
this.label29.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label29.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label29.Location = new System.Drawing.Point(38, 101);
this.label29.Name = "label29";
this.label29.Size = new System.Drawing.Size(35, 17);
this.label29.TabIndex = 246;
this.label29.Text = "湿度:";
this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtTemp
//
this.txtTemp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtTemp.Location = new System.Drawing.Point(95, 63);
this.txtTemp.MaxLength = 10;
this.txtTemp.Name = "txtTemp";
this.txtTemp.Size = new System.Drawing.Size(87, 26);
this.txtTemp.TabIndex = 245;
this.txtTemp.Text = "0";
//
// label28
//
this.label28.AutoSize = true;
this.label28.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label28.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label28.Location = new System.Drawing.Point(38, 67);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(35, 17);
this.label28.TabIndex = 244;
this.label28.Text = "温度:";
this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtTempPort
//
this.txtTempPort.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtTempPort.Location = new System.Drawing.Point(95, 28);
this.txtTempPort.MaxLength = 10;
this.txtTempPort.Name = "txtTempPort";
this.txtTempPort.Size = new System.Drawing.Size(87, 26);
this.txtTempPort.TabIndex = 243;
this.txtTempPort.Text = "0";
//
// label27
//
this.label27.AutoSize = true;
this.label27.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label27.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label27.Location = new System.Drawing.Point(26, 33);
this.label27.Name = "label27";
this.label27.Size = new System.Drawing.Size(47, 17);
this.label27.TabIndex = 242;
this.label27.Text = "端口号:";
this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnTempClose
//
this.btnTempClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTempClose.Location = new System.Drawing.Point(322, 30);
this.btnTempClose.Name = "btnTempClose";
this.btnTempClose.Size = new System.Drawing.Size(100, 33);
this.btnTempClose.TabIndex = 89;
this.btnTempClose.Text = "断开";
this.btnTempClose.UseVisualStyleBackColor = true;
this.btnTempClose.Click += new System.EventHandler(this.btnTempClose_Click);
//
// btnTempInit
//
this.btnTempInit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTempInit.Location = new System.Drawing.Point(212, 30);
this.btnTempInit.Name = "btnTempInit";
this.btnTempInit.Size = new System.Drawing.Size(100, 33);
this.btnTempInit.TabIndex = 88;
this.btnTempInit.Text = "初始化";
this.btnTempInit.UseVisualStyleBackColor = true;
this.btnTempInit.Click += new System.EventHandler(this.btnTempInit_Click);
//
// btnOpenDoor
//
this.btnOpenDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDoor.Location = new System.Drawing.Point(20, 152);
this.btnOpenDoor.Name = "btnOpenDoor";
this.btnOpenDoor.Size = new System.Drawing.Size(105, 38);
this.btnOpenDoor.TabIndex = 257;
this.btnOpenDoor.Text = "打开仓门";
this.btnOpenDoor.UseVisualStyleBackColor = true;
this.btnOpenDoor.Click += new System.EventHandler(this.btnOpenDoor_Click);
//
// btnCloseDoor
//
this.btnCloseDoor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDoor.Location = new System.Drawing.Point(137, 152);
this.btnCloseDoor.Name = "btnCloseDoor";
this.btnCloseDoor.Size = new System.Drawing.Size(105, 38);
this.btnCloseDoor.TabIndex = 258;
this.btnCloseDoor.Text = "关闭仓门";
this.btnCloseDoor.UseVisualStyleBackColor = true;
this.btnCloseDoor.Click += new System.EventHandler(this.btnCloseDoor_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button3);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Location = new System.Drawing.Point(12, 217);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(533, 78);
this.groupBox2.TabIndex = 276;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "流水线通信测试";
this.groupBox2.Visible = false;
//
// button6
//
this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button6.Location = new System.Drawing.Point(317, 32);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(100, 33);
this.button6.TabIndex = 275;
this.button6.Text = "发送";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button3
//
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(64, 31);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(100, 33);
this.button3.TabIndex = 273;
this.button3.Text = "连接";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Location = new System.Drawing.Point(193, 32);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(100, 33);
this.button5.TabIndex = 274;
this.button5.Text = "停止";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// lblMoveEquipInfo
//
this.lblMoveEquipInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblMoveEquipInfo.AutoSize = true;
this.lblMoveEquipInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveEquipInfo.ForeColor = System.Drawing.Color.Blue;
this.lblMoveEquipInfo.Location = new System.Drawing.Point(562, 16);
this.lblMoveEquipInfo.Name = "lblMoveEquipInfo";
this.lblMoveEquipInfo.Size = new System.Drawing.Size(56, 17);
this.lblMoveEquipInfo.TabIndex = 272;
this.lblMoveEquipInfo.Text = "移栽状态";
//
// groupBox3
//
this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox3.Controls.Add(this.lblMoveEquipInfo);
this.groupBox3.Controls.Add(this.btnStoreHome);
this.groupBox3.Controls.Add(this.btnCon);
this.groupBox3.Controls.Add(this.chbDebug);
......@@ -1471,18 +1275,28 @@
this.groupBox3.Controls.Add(this.btnStoreStop);
this.groupBox3.Controls.Add(this.lblThisSta);
this.groupBox3.Controls.Add(this.btnStoreStart);
this.groupBox3.Location = new System.Drawing.Point(6, 2);
this.groupBox3.Location = new System.Drawing.Point(4, 2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(1071, 137);
this.groupBox3.Size = new System.Drawing.Size(1083, 137);
this.groupBox3.TabIndex = 268;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "设备状态";
//
// lblMoveEquipInfo
//
this.lblMoveEquipInfo.AutoSize = true;
this.lblMoveEquipInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveEquipInfo.ForeColor = System.Drawing.Color.Green;
this.lblMoveEquipInfo.Location = new System.Drawing.Point(728, 36);
this.lblMoveEquipInfo.Name = "lblMoveEquipInfo";
this.lblMoveEquipInfo.Size = new System.Drawing.Size(0, 17);
this.lblMoveEquipInfo.TabIndex = 274;
//
// btnCon
//
this.btnCon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCon.Location = new System.Drawing.Point(890, 80);
this.btnCon.Location = new System.Drawing.Point(902, 80);
this.btnCon.Name = "btnCon";
this.btnCon.Size = new System.Drawing.Size(175, 39);
this.btnCon.TabIndex = 273;
......@@ -1505,7 +1319,7 @@
this.lblThisSta.AutoSize = true;
this.lblThisSta.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblThisSta.ForeColor = System.Drawing.Color.Green;
this.lblThisSta.Location = new System.Drawing.Point(516, 36);
this.lblThisSta.Location = new System.Drawing.Point(483, 36);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(56, 17);
this.lblThisSta.TabIndex = 216;
......@@ -1532,13 +1346,9 @@
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
this.tabPage1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
......@@ -1612,17 +1422,6 @@
private System.Windows.Forms.Label lblTemp;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.Button btnSelTemp;
private System.Windows.Forms.TextBox txtHum;
private System.Windows.Forms.Label label29;
private System.Windows.Forms.TextBox txtTemp;
private System.Windows.Forms.Label label28;
private System.Windows.Forms.TextBox txtTempPort;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.Button btnTempClose;
private System.Windows.Forms.Button btnTempInit;
private System.Windows.Forms.Button btnStoreHome;
private System.Windows.Forms.Button btnSotreReset;
private System.Windows.Forms.Button btnStoreStop;
......@@ -1631,7 +1430,6 @@
private System.Windows.Forms.Button btnAxisOn;
private System.Windows.Forms.Button btnStoreStart;
private System.Windows.Forms.CheckBox chbDebug;
private System.Windows.Forms.Label lblMoveEquipInfo;
private System.Windows.Forms.Button btnUpdown;
private System.Windows.Forms.TextBox txt4Target;
private System.Windows.Forms.TextBox lblTargetP4;
......@@ -1640,9 +1438,6 @@
private System.Windows.Forms.Button btnCheckPos;
private System.Windows.Forms.Button btnStartAutoCheck;
private System.Windows.Forms.Button btnCon;
private System.Windows.Forms.Button btnClearLog;
private System.Windows.Forms.Button btnCloseDoor;
private System.Windows.Forms.Button btnOpenDoor;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button3;
......@@ -1650,6 +1445,7 @@
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private AutoCountClient.AxisMoveControl axisMoveControl1;
private System.Windows.Forms.Label lblMoveEquipInfo;
}
}
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACSingleStore
{
public BoxBean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmBox()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -46,7 +46,6 @@ namespace OnlineStore.ACSingleStore
groupBox3.Text = "设备["+boxBean.CID+"]状态";
this.Opacity = 1;
txtTempPort.Text = StoreManager.Config.Humiture_Port ;
LoadOk = true;
}
......@@ -55,7 +54,7 @@ namespace OnlineStore.ACSingleStore
//this.boxBean = StoreManager.InitStore();
if (boxBean == null)
{
LogUtil.error(LOGGER, "找不到对应的料仓");
LogUtil.error( "找不到对应的料仓");
this.Close();
return;
}
......@@ -122,27 +121,6 @@ namespace OnlineStore.ACSingleStore
#endregion
private void start_button_Click(object sender, EventArgs e)
{
boxBean.StartRun();
if (boxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{
StoreOpenStatus(true);
}
}
private void stop_button_Click(object sender, EventArgs e)
{
try
{
boxBean.StopRun();
StoreOpenStatus(false);
}
catch (Exception ex)
{
LogUtil.error(LOGGER, "出错:" + ex.StackTrace);
}
}
private bool preOpen = false;
public void StoreOpenStatus(bool isOpen)
{
......@@ -167,15 +145,14 @@ namespace OnlineStore.ACSingleStore
{
return;
}
// button6_Click(null, null);
// timer1.Interval = 300;
if (chbDebug.Checked.Equals(boxBean.IsDebug).Equals(false))
{
LoadOk = false;
chbDebug.Checked = boxBean.IsDebug;
LoadOk = true;
}
lblTemp.Text = boxBean.currTempStr;
lblTemp.Text = boxBean.humBean.currTempStr;
lblMoveEquipInfo.Text = "移栽状态:"+(LineConnect.CanStartOut() ? "可出库":"不可出库" )+" "+LineConnect.LastUpdateTime.ToLongTimeString()+"" ;
//忙碌状态不读取状态
if (!boxBean.storeRunStatus.Equals(StoreRunStatus.Busy))
......@@ -232,9 +209,9 @@ namespace OnlineStore.ACSingleStore
lblWarnMsg.Text = lblWarnMsg.Text + " 叉子料盘检测有料,请检查";
}
if (boxBean.TempOrHumidityIsAlarm)
if (boxBean.humBean.TempOrHumidityIsAlarm)
{
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + boxBean.TempAlarmTime.ToLongTimeString() + "]";
lblWarnMsg.Text = lblWarnMsg.Text + " 温湿度报警[" + boxBean.humBean.TempAlarmTime.ToLongTimeString() + "]";
}
if (lblWarnMsg.Text.Equals(""))
{
......@@ -269,6 +246,13 @@ namespace OnlineStore.ACSingleStore
}
}
catch (Exception ex) { }
if (AxisManager.UseHCBoard)
{
ReadA(boxBean.Config.Middle_Axis, lblActual1, lblTargetP1, lblTargetP1);
ReadA(boxBean.Config.UpDown_Axis, lblActual2, lblTargetP2, lblTargetP2);
ReadA(boxBean.Config.InOut_Axis, lblActual3, lblTargetP3, lblTargetP3);
ReadA(boxBean.Config.Comp_Axis, lblActual4, lblTargetP4, lblTargetP4);
}
}
else
{
......@@ -296,7 +280,7 @@ namespace OnlineStore.ACSingleStore
private void ReadA(ConfigMoveAxis axis,TextBox lblActual, TextBox lblTarget,TextBox lblT )
{
if (AxisManager.instance.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
if (AxisManager.instance.IsServeoOn(axis.DeviceName, axis.GetAxisValue()))
{
//sta.IOValue = AxisManager.instance.GetAlarmStatus(axis.DeviceName, axis.GetAxisValue());
int tP = AxisManager.instance.GetTargetPosition(axis.DeviceName, axis.GetAxisValue());
......@@ -603,14 +587,6 @@ namespace OnlineStore.ACSingleStore
}
}
private void btnMiddleP3_Click(object sender, EventArgs e)
{
if (InOutIsIsP1())
{
//int value = FormUtil.GetIntValue(txtMiddleP3);
// AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P2_Speed);
}
}
private void btnInOutP1_Click(object sender, EventArgs e)
{
......@@ -697,7 +673,7 @@ namespace OnlineStore.ACSingleStore
boxBean.AutoStartIndex = currIndex;
string poText = cmbPosition.Text;
boxBean.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, boxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
LogUtil.info( boxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText));
boxBean.StartInStoreMove(new InOutParam(new InOutPosInfo("AUTOINOUT", poText)));
}
......@@ -714,20 +690,18 @@ namespace OnlineStore.ACSingleStore
{
button1_Click(null, null);
}
private void 轴运动配置ToolStripMenuItem_Click(object sender, EventArgs e)
{
//FormManager.ShowAxisConfig(store);
}
private void 启动ToolStripMenuItem_Click(object sender, EventArgs e)
{
start_button_Click(null, null);
boxBean.StartRun();
if (boxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
{
StoreOpenStatus(true);
}
}
private void 停止ToolStripMenuItem_Click(object sender, EventArgs e)
{
stop_button_Click(null, null);
StopMove();
}
private void 复位ToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -735,20 +709,6 @@ namespace OnlineStore.ACSingleStore
this.boxBean.Reset();
btnSotreReset.Enabled = false;
}
private void 查看IOToolStripMenuItem_Click(object sender, EventArgs e)
{
FormManager.ShowIOShow(boxBean);
}
private void btnClearLog_Click(object sender, EventArgs e)
{
//this.richTextBox1.Text = "";
LogUtil.ClearLog();
}
private void 料仓运转ONToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Enabled = false;
......@@ -757,22 +717,12 @@ namespace OnlineStore.ACSingleStore
LogUtil.info("料仓运转ON完成");
}
private void 打开舱门ToolStripMenuItem_Click(object sender, EventArgs e)
{
boxBean.OpenDoor(false);
}
private void 料仓运转OFFToolStripMenuItem_Click(object sender, EventArgs e)
{
boxBean.CloseAllAxis();
LogUtil.info("料仓运转OFF完成");
}
private void 关闭仓门ToolStripMenuItem_Click(object sender, EventArgs e)
{
boxBean.CloseDoor(false);
}
private void 回待机点ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (boxBean.storeRunStatus >= StoreRunStatus.HomeMoving)
......@@ -816,11 +766,19 @@ namespace OnlineStore.ACSingleStore
this.btnMiddleP2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
axisMoveControl1.LoadData(boxBean);
}
private void StopMove()
{
try
{
boxBean.StopRun();
StoreOpenStatus(false);
}
catch (Exception ex)
{
LogUtil.error( "出错:" + ex.StackTrace);
}
}
private void ExitApp()
{
try
......@@ -831,30 +789,20 @@ namespace OnlineStore.ACSingleStore
}
if (this.btnStoreStop.Enabled)
{
stop_button_Click(null, null);
StopMove();
}
axisMoveControl1.StopTimer( );
IOManager.instance.CloseAllDO();
StoreOpenStatus(false);
IOManager.instance.CloseAllConnection();
//IOManager.instance.CloseAllDO();
//IOManager.instance.CloseAllConnection();
AxisManager.instance.CloseAllPort();
// KNDAIManager.CloseAllConnection();
//WCFControl.CloseWCF();
System.Environment.Exit(System.Environment.ExitCode);
//AxisManager.instance.CloseAllPort();
//System.Environment.Exit(System.Environment.ExitCode);
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
}
}
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
ExitApp();
LogUtil.error( ex.StackTrace);
}
}
private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e)
......@@ -862,58 +810,6 @@ namespace OnlineStore.ACSingleStore
ExitApp();
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("是否确定退出?", "提示", MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
ExitApp();
}
}
private void btnTempInit_Click(object sender, EventArgs e)
{
string port = txtTempPort.Text.ToString();
if (HumitureController.IsRun)
{
HumitureController.Release();
}
HumitureController.Init(port);
}
private void btnTempClose_Click(object sender, EventArgs e)
{
HumitureController.Release();
}
private void btnSelTemp_Click(object sender, EventArgs e)
{
ASTemperateParam param = HumitureController.QueryData();
txtTemp.Text = param.Temperate.ToString();
txtHum.Text = param.Humidity.ToString();
}
private void btnOpenDoor_Click(object sender, EventArgs e)
{
boxBean.OpenDoor(false);
}
private void btnClearL_Click(object sender, EventArgs e)
{
LogUtil.ClearLog();
}
private void button4_Click(object sender, EventArgs e)
{
FrmAbout about = new FrmAbout();
about.ShowDialog();
}
private void btnCloseDoor_Click(object sender, EventArgs e)
{
boxBean.CloseDoor(false);
}
private void button3_Click(object sender, EventArgs e)
{
LineConnect.StartConnect();
......@@ -986,26 +882,23 @@ namespace OnlineStore.ACSingleStore
private void btnUpdown_Click(object sender, EventArgs e)
{
string PortName = boxBean.Config.UpDown_Axis.DeviceName;
int slvAddr = boxBean.Config.UpDown_Axis.GetAxisValue();
string ioIP = "192.168.200.13";
int ioIndex = 0;
//string PortName = boxBean.Config.UpDown_Axis.DeviceName;
//int slvAddr = boxBean.Config.UpDown_Axis.GetAxisValue();
//string ioIP = "192.168.200.13";
//int ioIndex = 0;
// if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal))
if (boxBean.Config.DIList.ContainsKey(IO_Type.TrayCheck_Fixture))
if (boxBean.Config.DIList.ContainsKey(IO_Type.CheckPos))
{
ioIP = boxBean.Config.DIList[IO_Type.TrayCheck_Fixture].IO_IP;
ioIndex = boxBean.Config.DIList[IO_Type.TrayCheck_Fixture].GetIOAddr();
}
string ioIP = boxBean.Config.DIList[IO_Type.CheckPos].IO_IP;
int ioIndex = boxBean.Config.DIList[IO_Type.CheckPos].GetIOAddr();
FrmPositionTool frm = new FrmPositionTool(boxBean.Config.UpDown_Axis, ioIP, ioIndex);
frm.ShowDialog();
}
private void richTextBox1_VisibleChanged(object sender, EventArgs e)
else
{
LogUtil.UpdateLogbox();
MessageBox.Show("未配置激光检测信号");
}
}
/// <summary>
/// 盘点测试
/// </summary>
......@@ -1053,7 +946,7 @@ namespace OnlineStore.ACSingleStore
boxBean.AutoStartIndex = currIndex;
string poText = cmbPosition.Text;
boxBean.autoMsg = "自动盘点:" + poText;
LogUtil.info(LOGGER, boxBean.Name + "开启自动盘点模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",盘点开始!");
LogUtil.info( boxBean.Name + "开启自动盘点模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",盘点开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText));
boxBean.StartInventoryMove(new InOutParam(new InOutPosInfo("AUTOINOUT", poText)));
}
......
......@@ -18,16 +18,14 @@
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnOpenDo = new System.Windows.Forms.Button();
this.btnWriteSingleDO = new System.Windows.Forms.Button();
this.txtDOIndex = new System.Windows.Forms.TextBox();
this.txtDoName = new System.Windows.Forms.TextBox();
this.btnCloseAxisBreak = new System.Windows.Forms.Button();
this.label17 = new System.Windows.Forms.Label();
this.btnOpenAxisBreak = new System.Windows.Forms.Button();
this.label14 = new System.Windows.Forms.Label();
this.txtWriteTime = new System.Windows.Forms.TextBox();
this.btnLocationDown = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.btnLocationUp = new System.Windows.Forms.Button();
this.cmbWriteIO = new System.Windows.Forms.ComboBox();
this.btnCloseDoor = new System.Windows.Forms.Button();
this.btnOpenDoor = new System.Windows.Forms.Button();
......@@ -37,8 +35,6 @@
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnOpenDo = new System.Windows.Forms.Button();
this.btnWriteSingleDO = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -57,25 +53,47 @@
this.groupBox1.Controls.Add(this.btnWriteSingleDO);
this.groupBox1.Controls.Add(this.txtDOIndex);
this.groupBox1.Controls.Add(this.txtDoName);
this.groupBox1.Controls.Add(this.btnCloseAxisBreak);
this.groupBox1.Controls.Add(this.label17);
this.groupBox1.Controls.Add(this.btnOpenAxisBreak);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.btnLocationDown);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.btnLocationUp);
this.groupBox1.Controls.Add(this.cmbWriteIO);
this.groupBox1.Controls.Add(this.btnCloseDoor);
this.groupBox1.Controls.Add(this.btnOpenDoor);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(485, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(385, 352);
this.groupBox1.Size = new System.Drawing.Size(385, 365);
this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入";
//
// btnOpenDo
//
this.btnOpenDo.BackColor = System.Drawing.Color.White;
this.btnOpenDo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenDo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDo.Location = new System.Drawing.Point(124, 88);
this.btnOpenDo.Name = "btnOpenDo";
this.btnOpenDo.Size = new System.Drawing.Size(100, 35);
this.btnOpenDo.TabIndex = 274;
this.btnOpenDo.Text = "打开";
this.btnOpenDo.UseVisualStyleBackColor = false;
this.btnOpenDo.Click += new System.EventHandler(this.btnOpenDo_Click);
//
// btnWriteSingleDO
//
this.btnWriteSingleDO.BackColor = System.Drawing.Color.White;
this.btnWriteSingleDO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnWriteSingleDO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWriteSingleDO.Location = new System.Drawing.Point(228, 88);
this.btnWriteSingleDO.Name = "btnWriteSingleDO";
this.btnWriteSingleDO.Size = new System.Drawing.Size(100, 35);
this.btnWriteSingleDO.TabIndex = 273;
this.btnWriteSingleDO.Text = "关闭";
this.btnWriteSingleDO.UseVisualStyleBackColor = false;
this.btnWriteSingleDO.Click += new System.EventHandler(this.btnWriteSingleDO_Click);
//
// txtDOIndex
//
this.txtDOIndex.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -96,18 +114,6 @@
this.txtDoName.TabIndex = 241;
this.txtDoName.Text = "0";
//
// btnCloseAxisBreak
//
this.btnCloseAxisBreak.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAxisBreak.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAxisBreak.Location = new System.Drawing.Point(203, 234);
this.btnCloseAxisBreak.Name = "btnCloseAxisBreak";
this.btnCloseAxisBreak.Size = new System.Drawing.Size(120, 35);
this.btnCloseAxisBreak.TabIndex = 253;
this.btnCloseAxisBreak.Text = "关闭刹车";
this.btnCloseAxisBreak.UseVisualStyleBackColor = true;
this.btnCloseAxisBreak.Click += new System.EventHandler(this.btnCloseAxisBreak_Click);
//
// label17
//
this.label17.AutoSize = true;
......@@ -120,18 +126,6 @@
this.label17.Text = "设备IP:";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnOpenAxisBreak
//
this.btnOpenAxisBreak.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenAxisBreak.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAxisBreak.Location = new System.Drawing.Point(56, 234);
this.btnOpenAxisBreak.Name = "btnOpenAxisBreak";
this.btnOpenAxisBreak.Size = new System.Drawing.Size(120, 35);
this.btnOpenAxisBreak.TabIndex = 252;
this.btnOpenAxisBreak.Text = "打开刹车";
this.btnOpenAxisBreak.UseVisualStyleBackColor = true;
this.btnOpenAxisBreak.Click += new System.EventHandler(this.btnOpenAxisBreak_Click);
//
// label14
//
this.label14.AutoSize = true;
......@@ -154,18 +148,6 @@
this.txtWriteTime.TabIndex = 238;
this.txtWriteTime.Text = "0";
//
// btnLocationDown
//
this.btnLocationDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLocationDown.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationDown.Location = new System.Drawing.Point(203, 191);
this.btnLocationDown.Name = "btnLocationDown";
this.btnLocationDown.Size = new System.Drawing.Size(120, 35);
this.btnLocationDown.TabIndex = 251;
this.btnLocationDown.Text = "定位气缸下降";
this.btnLocationDown.UseVisualStyleBackColor = true;
this.btnLocationDown.Click += new System.EventHandler(this.btnLocationDown_Click);
//
// label5
//
this.label5.AutoSize = true;
......@@ -178,18 +160,6 @@
this.label5.Text = "定时(ms):";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// btnLocationUp
//
this.btnLocationUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLocationUp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationUp.Location = new System.Drawing.Point(56, 191);
this.btnLocationUp.Name = "btnLocationUp";
this.btnLocationUp.Size = new System.Drawing.Size(120, 35);
this.btnLocationUp.TabIndex = 250;
this.btnLocationUp.Text = "定位气缸上升";
this.btnLocationUp.UseVisualStyleBackColor = true;
this.btnLocationUp.Click += new System.EventHandler(this.btnLocationUp_Click);
//
// cmbWriteIO
//
this.cmbWriteIO.DisplayMember = "ProName";
......@@ -310,32 +280,6 @@
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 426);
this.tableLayoutPanel1.TabIndex = 102;
//
// btnOpenDo
//
this.btnOpenDo.BackColor = System.Drawing.Color.White;
this.btnOpenDo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenDo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenDo.Location = new System.Drawing.Point(124, 88);
this.btnOpenDo.Name = "btnOpenDo";
this.btnOpenDo.Size = new System.Drawing.Size(100, 35);
this.btnOpenDo.TabIndex = 274;
this.btnOpenDo.Text = "打开";
this.btnOpenDo.UseVisualStyleBackColor = false;
this.btnOpenDo.Click += new System.EventHandler(this.btnOpenDo_Click);
//
// btnWriteSingleDO
//
this.btnWriteSingleDO.BackColor = System.Drawing.Color.White;
this.btnWriteSingleDO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnWriteSingleDO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnWriteSingleDO.Location = new System.Drawing.Point(228, 88);
this.btnWriteSingleDO.Name = "btnWriteSingleDO";
this.btnWriteSingleDO.Size = new System.Drawing.Size(100, 35);
this.btnWriteSingleDO.TabIndex = 273;
this.btnWriteSingleDO.Text = "关闭";
this.btnWriteSingleDO.UseVisualStyleBackColor = false;
this.btnWriteSingleDO.Click += new System.EventHandler(this.btnWriteSingleDO_Click);
//
// FrmIOStatus
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -380,10 +324,6 @@
private System.Windows.Forms.TextBox txtDoName;
private System.Windows.Forms.Button btnCloseDoor;
private System.Windows.Forms.Button btnOpenDoor;
private System.Windows.Forms.Button btnLocationDown;
private System.Windows.Forms.Button btnLocationUp;
private System.Windows.Forms.Button btnCloseAxisBreak;
private System.Windows.Forms.Button btnOpenAxisBreak;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnOpenDo;
private System.Windows.Forms.Button btnWriteSingleDO;
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACSingleStore
{
private int StoreId = 1;
private BoxBean boxBean;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmIOStatus()
{
Control.CheckForIllegalCrossThreadCalls = false;
......@@ -49,7 +49,7 @@ namespace OnlineStore.ACSingleStore
this.tableLayoutPanel1.RowCount = boxBean.Config.DIList.Count;
foreach (ConfigIO ioValue in boxBean.Config.DIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
......@@ -95,7 +95,7 @@ namespace OnlineStore.ACSingleStore
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, "Exception(异常)", MessageBoxButtons.OK, MessageBoxIcon.Error);
LogUtil.error(LOGGER, ex.StackTrace);
LogUtil.error( ex.StackTrace);
}
}
......@@ -185,33 +185,12 @@ namespace OnlineStore.ACSingleStore
boxBean.CloseDoor(false);
}
private void btnLocationUp_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
}
private void btnLocationDown_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
{
timer1.Start();
}
private void btnOpenAxisBreak_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
}
private void btnCloseAxisBreak_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
......
......@@ -203,9 +203,9 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(241, 88);
this.logBox.Location = new System.Drawing.Point(241, 6);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(1085, 531);
this.logBox.Size = new System.Drawing.Size(1085, 613);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
......@@ -257,54 +257,54 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -399,19 +399,19 @@
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Size = new System.Drawing.Size(144, 26);
this.toolStripMenuItem3.Text = "料仓配置";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(141, 6);
//
// 版本号ToolStripMenuItem
//
this.版本号ToolStripMenuItem.Name = "版本号ToolStripMenuItem";
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.版本号ToolStripMenuItem.Text = "关于软件";
this.版本号ToolStripMenuItem.Click += new System.EventHandler(this.版本号ToolStripMenuItem_Click);
//
......
......@@ -7,8 +7,8 @@
<ProjectGuid>{0D2542F5-DD62-4352-82D0-383D9A045E74}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<AssemblyName>ACSingleStore</AssemblyName>
<RootNamespace>OnlineStore.HCSingleStore</RootNamespace>
<AssemblyName>HCSingleStore</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......@@ -69,6 +69,10 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="UserFromControl, Version=1.0.7592.26798, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\UserFromControl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="FormManager.cs" />
......@@ -207,10 +211,6 @@
<Project>{064bebf5-8faa-4ea2-a5f3-a06e6e7d9251}</Project>
<Name>LoadCSVLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\UserFromControl\UserFromControl.csproj">
<Project>{f018462a-d9bc-4365-97f2-f6d71751641e}</Project>
<Name>UserFromControl</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="AuToRunManager.exe">
......
......@@ -43,7 +43,7 @@ namespace OnlineStore.ACSingleStore
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
public const int SW_RESTORE = 9;
public static IntPtr formhwnd;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
......@@ -157,7 +157,7 @@ namespace OnlineStore.ACSingleStore
static void LogUnhandledException(object exceptionobj)
{
//这里可以进一步地写日志
LOGGER.Error(exceptionobj.ToString());
LogUtil.error(exceptionobj.ToString());
}
}
}
......@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.ACSingleStore.Properties {
namespace OnlineStore.HCSingleStore.Properties {
using System;
......@@ -19,7 +19,7 @@ namespace OnlineStore.ACSingleStore.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -39,7 +39,7 @@ namespace OnlineStore.ACSingleStore.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.ACSingleStore.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OnlineStore.HCSingleStore.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
......
......@@ -8,11 +8,11 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.ACSingleStore.Properties {
namespace OnlineStore.HCSingleStore.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.ACSingleStore
private short SlvAddr = 0;
private string IoIp = "";
private int IoIndex = 0;
public string Axis_Brake = IO_Type.Axis_Brake;
public string Axis_Brake = "";
private System.Timers.Timer toolTimer = new System.Timers.Timer();
private ConfigMoveAxis configAxis;
......@@ -89,7 +89,7 @@ namespace OnlineStore.ACSingleStore
SaveConfig(tSpeed, tPosition);
//判断伺服是否已经打开
bool isOn = AxisManager.instance.ServerOnStatus(PortName, SlvAddr);
bool isOn = AxisManager.instance.IsServeoOn(PortName, SlvAddr);
formStatus(isOn);
timer1.Start();
ioStatusControl1.IOName = ResourceCulture.GetString("检测信号");
......@@ -106,7 +106,7 @@ namespace OnlineStore.ACSingleStore
}
formStatus(true);
AxisManager.instance.InitSlvAddr(PortName, SlvAddr);
AxisManager.instance.InitSlvAddr(PortName, SlvAddr, configAxis.TargetSpeed, configAxis.AddSpeed, configAxis.DelSpeed);
Thread.Sleep(100);
AxisManager.instance.AlarmClear(PortName, SlvAddr);
AxisManager.instance.ServoOn(PortName, SlvAddr);
......
......@@ -184,7 +184,7 @@ namespace OnlineStore.AutoCountClient
this.txtHomeSingle.Text = AxisManager.instance.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = AxisManager.instance.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = AxisManager.instance.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
txtServoStatue.Text = AxisManager.instance.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
txtServoStatue.Text = AxisManager.instance.IsServeoOn(PortName, SlvAddr) ? "✔" : "✘";
}
......
......@@ -199,15 +199,15 @@ namespace HuichuanLibrary
return false;
}
public static bool AbsMoveIsEnd(short axisNo, double targetPos)
public static bool MoveIsEnd(short axisNo )
{
AxisSts sts = GetAxisSts(axisNo);
if (sts.BUSY.Equals(0) && sts.INP.Equals(0))
{
if (IsInPosition(axisNo, targetPos))
{
//if (IsInPosition(axisNo, targetPos))
//{
return true;
}
//}
}
return false;
}
......
......@@ -210,6 +210,11 @@ namespace OnlineStore.LoadCSVLibrary
string[] newArray = array;
string proName = array[2];
string proValue = array[3];
if (proName.ToUpper().Contains(BaseConfig.IOIP_Str.ToUpper()))
{
index++;
continue;
}
try
{
PropertyInfo prop = props.First(c => c.Name == proName);//获取同名属性
......@@ -227,6 +232,10 @@ namespace OnlineStore.LoadCSVLibrary
{
newLine = newLine + s + ",";
}
if (newLine.EndsWith(","))
{
newLine = newLine.Substring(0, newLine.Length - 1);
}
newLines[index] = newLine;
}
}
......
......@@ -131,7 +131,7 @@ namespace OnlineStore.LoadCSVLibrary
SubDIList[io.SubType].Add(io.ProName, io);
}
if (!ioTypeList.Contains(con.ProName))
//if (!ioTypeList.Contains(con.ProName))
{
AddBuffer(con, builder);
}
......@@ -165,7 +165,7 @@ namespace OnlineStore.LoadCSVLibrary
{
SubDOList[io.SubType].Add(io.ProName, io);
}
if (!ioTypeList.Contains(con.ProName))
//if (!ioTypeList.Contains(con.ProName))
{
AddBuffer(con, builder);
}
......
......@@ -200,6 +200,11 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("CompAxis_P3_Speed")]
public int CompAxis_P3_Speed { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true)]
public string Humiture_Port { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
......
......@@ -26,104 +26,193 @@ namespace OnlineStore.LoadCSVLibrary
return TypeList;
}
/// <summary>
/// 料仓,DI 急停 SuddenStop_BTN X01 DI-01
///// <summary>
///// 料仓,DI 急停 SuddenStop_BTN X01 DI-01
///// </summary>
//public static string SuddenStop_BTN = "SuddenStop_BTN";
///// <summary>
///// 料仓 DI 复位 Reset_BTN X02 DI-02
///// </summary>
//public static string Reset_BTN = "Reset_BTN";
///// <summary>
///// DI,盘点,CheckPos,2,PRO_AOI_IP_1,0,盘点,X03,DI-03,0,
///// </summary>
//public static string CheckPos = "CheckPos";
///// <summary>
/////DI 自动运行 AutoRun_Signal
///// </summary>
//// public static string AutoRun_Signal = "AutoRun_Signal";
///// <summary>
///// 料仓DI。气压检测(料仓) Airpressure_Check
///// </summary>
//public static string Airpressure_Check = "Airpressure_Check";
///// <summary>
///// DI 料仓门口料盘检测 TrayCheck_1
///// </summary>
//public static string TrayCheck_Door = "TrayCheck_Door";
///// <summary>
///// DI 叉子料盘检测 TrayCheck_Fixture
///// </summary>
//public static string TrayCheck_Fixture = "TrayCheck_Fixture";
///// <summary>
///// 料仓IO。定位气缸上升端(料仓) LocationCylinder_Up
///// </summary>
//public static string LocationCylinder_Up = "LocationCylinder_Up";
///// <summary>
/////料仓IO。 定位气缸下降端(料仓) LocationCylinder_Down
///// </summary>
//public static string LocationCylinder_Down = "LocationCylinder_Down";
///// <summary>
///// 料仓IO。定位气缸上升端(料仓) LocationCylinder2_Up
///// </summary>
//public static string LocationCylinder2_Up = "LocationCylinder2_Up";
///// <summary>
/////料仓IO。 定位气缸下降端(料仓) LocationCylinder2_Down
///// </summary>
//public static string LocationCylinder2_Down = "LocationCylinder2_Down";
///// <summary>
///// 料仓DO 。料仓运转ON Run_Signal
///// </summary>
//public static string Run_Signal = "Run_Signal";
///// <summary>
///// 料仓DO 。料仓轴2刹车ON Axis_Brake
///// </summary>
//public static string Axis_Brake = "Axis_Brake";
///// <summary>
///// 料仓DO 。料仓吹气SOL ON StartOrStopBlow
///// </summary>
//public static string StartOrStopBlow = "StartOrStopBlow";
///// <summary>
///// DO 自动指示灯 AutoRun_HddLed
///// </summary>
//public static string AutoRun_HddLed = "AutoRun_HddLed";
///// <summary>
///// DO 待机指示灯 RunSign_HddLed
///// </summary>
//public static string RunSign_HddLed = "RunSign_HddLed";
///// <summary>
/////DO 故障指示灯 Alarm_HddLed
///// </summary>
//public static string Alarm_HddLed = "Alarm_HddLed";
///// <summary>
///// 吹气SOL Blow_Single
///// </summary>
//public static string Blow_Single = "Blow_Single";
///// <summary>
///// 进出料口门上升端 Door_Up
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// 进出料口门下降端 Door_Down
///// </summary>
//public static string Door_Down = "Door_Down";
//public static string DoorLimit = "DoorLimit";
///// <summary>
///// DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y04,
///// </summary>
//public static string Alarm_Buzzer = "Alarm_Buzzer";
///// <summary>
///// DO,0,设备照明ON,Device_Led,8,HC,Y09,
///// </summary>
//public static string Device_Led = "Device_Led";
/// <summary>
/// DI,0,急停,SuddenStop_BTN,0,HC,X00,
/// </summary>
public static string SuddenStop_BTN = "SuddenStop_BTN";
/// <summary>
/// 料仓 DI 复位 Reset_BTN X02 DI-02
/// DI,0,复位,Reset_BTN,1,HC,X01,
/// </summary>
public static string Reset_BTN = "Reset_BTN";
/// <summary>
/// DI,盘点,CheckPos,2,PRO_AOI_IP_1,0,盘点,X03,DI-03,0,
/// </summary>
public static string CheckPos = "CheckPos";
/// <summary>
///DI 自动运行 AutoRun_Signal
/// </summary>
// public static string AutoRun_Signal = "AutoRun_Signal";
/// <summary>
/// 料仓DI。气压检测(料仓) Airpressure_Check
/// DI,0,气压检测,Airpressure_Check,2,HC,X02,
/// </summary>
public static string Airpressure_Check = "Airpressure_Check";
/// <summary>
/// DI 料仓门口料盘检测 TrayCheck_1
/// DI,1,左料仓进料口料盘检测,TrayCheck_Door,3,HC,X03,
/// </summary>
public static string TrayCheck_Door = "TrayCheck_Door";
/// <summary>
/// DI 叉子料盘检测 TrayCheck_Fixture
/// DI,1,左料仓料叉料盘检测,TrayCheck_Fixture,4,HC,X04,
/// </summary>
public static string TrayCheck_Fixture = "TrayCheck_Fixture";
/// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder_Up
/// DI,1,左料仓进料口门上升端,Door_Up,5,HC,X05,
/// </summary>
public static string LocationCylinder_Up = "LocationCylinder_Up";
/// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder_Down
/// </summary>
public static string LocationCylinder_Down = "LocationCylinder_Down";
/// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder2_Up
/// </summary>
public static string LocationCylinder2_Up = "LocationCylinder2_Up";
/// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder2_Down
/// </summary>
public static string LocationCylinder2_Down = "LocationCylinder2_Down";
/// <summary>
/// 料仓DO 。料仓运转ON Run_Signal
/// </summary>
public static string Run_Signal = "Run_Signal";
public static string Door_Up = "Door_Up";
/// <summary>
/// 料仓DO 。料仓轴2刹车ON Axis_Brake
/// DI,1,左料仓进料口门下降端,Door_Down,6,HC,X06,
/// </summary>
public static string Axis_Brake = "Axis_Brake";
public static string Door_Down = "Door_Down";
/// <summary>
/// 料仓DO 。料仓吹气SOL ON StartOrStopBlow
/// DI,1,左料仓激光检测,CheckPos,7,HC,X07,
/// </summary>
public static string StartOrStopBlow = "StartOrStopBlow";
/// <summary>
/// DO 自动指示灯 AutoRun_HddLed
public static string CheckPos = "CheckPos";
///// <summary>
///// DI,2,右料仓进料口料盘检测,TrayCheck_Door,8,HC,X08,
///// </summary>
//public static string TrayCheck_Door = "TrayCheck_Door";
///// <summary>
///// DI,2,右料仓料叉料盘检测,TrayCheck_Fixture,9,HC,X09,
///// </summary>
//public static string TrayCheck_Fixture = "TrayCheck_Fixture";
///// <summary>
///// DI,2,右料仓进料口门上升端,Door_Up,10,HC,X10,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DI,2,右料仓进料口门下降端,Door_Down,11,HC,X11,
///// </summary>
//public static string Door_Down = "Door_Down";
///// <summary>
///// DI,2,右料仓激光检测,CheckPos,12,HC,X12,
///// </summary>
//public static string CheckPos = "CheckPos";
/// <summary>
/// DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y01,
/// </summary>
public static string AutoRun_HddLed = "AutoRun_HddLed";
/// <summary>
/// DO 待机指示灯 RunSign_HddLed
/// </summary>
public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary>
///DO 故障指示灯 Alarm_HddLed
/// DO,0,故障指示灯,Alarm_HddLed,1,HC,Y02,
/// </summary>
public static string Alarm_HddLed = "Alarm_HddLed";
/// <summary>
/// 吹气SOL Blow_Single
/// DO,0,待机指示灯,RunSign_HddLed,2,HC,Y03,
/// </summary>
public static string Blow_Single = "Blow_Single";
/// <summary>
/// 进出料口门上升端 Door_Up
/// </summary>
public static string Door_Up = "Door_Up";
/// <summary>
/// 进出料口门下降端 Door_Down
/// </summary>
public static string Door_Down = "Door_Down";
public static string DoorLimit = "DoorLimit";
public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary>
/// DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y04,
/// </summary>
public static string Alarm_Buzzer = "Alarm_Buzzer";
///// <summary>
///// DO,1,左料仓进料口门上升SOL,Door_Up,4,HC,Y05,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DO,1,左料仓进料口门下降SOL,Door_Down,5,HC,Y06,
///// </summary>
//public static string Door_Down = "Door_Down";
///// <summary>
///// DO,2,右料仓进料口门上升SOL,Door_Up,6,HC,Y07,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DO,2,右料仓进料口门下降SOL,Door_Down,7,HC,Y08,
///// </summary>
//public static string Door_Down = "Door_Down";
/// <summary>
/// DO,0,设备照明ON,Device_Led,8,HC,Y09,
/// </summary>
......
......@@ -39,35 +39,30 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO 需要吹气的温度(温度标准) Max_Temperature 10
/// </summary>
[ConfigProAttribute("Max_Temperature", false)]
public int Max_Temperature { get; set; }
/// <summary>
/// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
/// </summary>
[ConfigProAttribute("Max_Humidity", false)]
public int Max_Humidity { get; set; }
///// <summary>
///// PRO 需要吹气的温度(温度标准) Max_Temperature 10
///// </summary>
//[ConfigProAttribute("Max_Temperature", false)]
//public int Max_Temperature { get; set; }
///// <summary>
///// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
///// </summary>
//[ConfigProAttribute("Max_Humidity", false)]
//public int Max_Humidity { get; set; }
/// <summary>
/// PRO 每次吹气的时间(分钟) BlowAir_Time 10
/// </summary>
[ConfigProAttribute("BlowAir_Time", false)]
public int BlowAir_Time { get; set; }
///// <summary>
///// PRO 每次吹气的时间(分钟) BlowAir_Time 10
///// </summary>
//[ConfigProAttribute("BlowAir_Time", false)]
//public int BlowAir_Time { get; set; }
/// <summary>
/// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
/// </summary>
[ConfigProAttribute("BlowAir_Interval", false)]
public int BlowAir_Interval { get; set; }
///// <summary>
///// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
///// </summary>
//[ConfigProAttribute("BlowAir_Interval", false)]
//public int BlowAir_Interval { get; set; }
public int InoutAxis_PositionMax { get; set; }
/// <summary>
/// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
/// </summary>
[ConfigProAttribute("Humiture_Port", true)]
public string Humiture_Port { get; set; }
public ushort GetDOLength(string ioIp)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!