Commit eac4b66e 刘韬
2 个父辈 a67b93fe 80107032
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.30907.101 VisualStudioVersion = 17.5.33414.496
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject EndProject
......
...@@ -38,11 +38,37 @@ namespace OnlineStore.Common ...@@ -38,11 +38,37 @@ namespace OnlineStore.Common
public static string FixBuffInfo = "FixBuffInfo"; public static string FixBuffInfo = "FixBuffInfo";
[MyConfigComment("进出轴运动负载阈值")] [MyConfigComment("进出轴运动负载阈值")]
public static MyConfig<float> Device_InOutMaxLoadRate=50; public static MyConfig<float> Device_InOutMaxLoadRate = 50;
[MyConfigComment("管理员密码")] [MyConfigComment("管理员密码")]
public static MyConfig<string> User_AdminPassword = "123456"; public static MyConfig<string> User_AdminPassword = "123456";
[MyConfigComment("启用管理员密码")] [MyConfigComment("启用管理员密码")]
public static MyConfig<bool> User_Enable = false; public static MyConfig<bool> User_Enable = false;
#region 料盘高度计算参数
[MyConfigComment("启用自定义厚度计算策略")]
public static MyConfig<bool> Switch_UseCustHeightList = false;
/// <summary>
/// 宽度15料盘,厚度自减mm
/// </summary>
[MyConfigComment("宽度15料盘,厚度自减mm")]
public static MyConfig<int> Param_CalHeight_Width15HeightSubVal = 2;
/// <summary>
/// 宽度13料盘,厚度自减mm
/// </summary>
[MyConfigComment("宽度13料盘,厚度自减mm")]
public static MyConfig<int> Param_CalHeight_Width13HeightSubVal = 1;
[MyConfigComment("如果计算出的厚度小于指定值,都归类为8mm")]
public static MyConfig<int> Param_CalHeight_Height8MaxVal = 12;
[MyConfigComment("自定义厚度列表")]
public static MyConfig<string[]> Param_CalHeight_HeightList = new string[] { "12=12#16", "16=16#24", "24=24#32", "32=32#44", "44=44#56", "56=56#60" };
#endregion
[MyConfigComment("出库厚度检测下偏差的值")]
public static MyConfig<int> OutstoreHeightCheckLowerDeviation = 5;
[MyConfigComment("出库厚度检测上偏差的值")]
public static MyConfig<int> OutstoreHeightCheckUpperDeviation = 3;
[MyConfigComment("出库料盘定位信号对射触发位置高度偏差")]
public static MyConfig<int> ReelCheckTriggerDeviation = 5;
} }
} }
...@@ -141,6 +141,7 @@ namespace OnlineStore.Common ...@@ -141,6 +141,7 @@ namespace OnlineStore.Common
tray_detect_reel_01, tray_detect_reel_01,
system_running_cantmove, system_running_cantmove,
before_FrmPositionTool_stopmuchine, before_FrmPositionTool_stopmuchine,
temp temp,
outstore_abnormal_reel
} }
} }
...@@ -22,188 +22,15 @@ namespace OnlineStore.Common ...@@ -22,188 +22,15 @@ namespace OnlineStore.Common
Interlocked.Increment(ref seq); Interlocked.Increment(ref seq);
return seq; return seq;
} }
public static string GetValue(string keyStr, string storeStr)
{
string key = keyStr + storeStr;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
return GetValue(keyStr);
}
else
{
return config.AppSettings.Settings[key].Value;
}
}
public static decimal GetNumValue(string keyStr, string storeStr) public static T GetValue<T>(string key, T defaultVal = default(T), string comment = "")
{
string key = keyStr + storeStr;
decimal a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
return GetNumValue(keyStr);
}
else
{
{
Decimal.TryParse(config.AppSettings.Settings[key].Value, out a);
}
}
return a;
}
public static int GetIntValue(string keyStr, string storeStr)
{
string key = keyStr + storeStr;
int a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
return GetIntValue(keyStr);
}
else
{
{
Int32.TryParse(config.AppSettings.Settings[key].Value, out a);
}
} return a;
}
public static string GetValue(string key)
{
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return "";
}
else
{
return config.AppSettings.Settings[key].Value;
}
}
public static decimal GetNumValue(string key)
{
decimal a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
{
{
Decimal.TryParse(config.AppSettings.Settings[key].Value, out a);
}
}
return a;
}
public static int GetIntValue(string key)
{
int a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{ {
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!"); ConfigHelper.Config.SetComment(key, comment);
return a; return ConfigHelper.Config.Get(key, defaultVal);
} }
else public static void SetValue<T>(string key, T defaultVal = default(T))
{ {
{ ConfigHelper.Config.Set(key, defaultVal);
Int32.TryParse(config.AppSettings.Settings[key].Value, out a);
}
} return a;
}
public static void SaveValue(string key, int value)
{
SaveValue(key, value.ToString());
}
public static void SaveValue(string key, string value)
{
try
{
if (key.Equals("") || value.Equals(""))
{
return;
}
//增加的内容写在appSettings段下 <add key="RegCode" value="0"/>
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
SetValue(key, value);
}
else
{
UpdateConfig(key, value);
}
}
catch (Exception ex)
{
LogUtil.error( "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + ",",ex);
}
}
public static string GetValue(object debugDeviceId)
{
throw new NotImplementedException();
}
/// <summary>
/// 更新配置文件信息
/// </summary>
/// <param name="name">配置文件字段名称</param>
/// <param name="Xvalue">值</param>
private static void UpdateConfig(string name, string Xvalue)
{
try
{
XmlDocument doc = new XmlDocument();
doc.Load(Application.ExecutablePath + ".config");
XmlNode node = doc.SelectSingleNode(@"//add[@key='" + name + "']");
XmlElement ele = (XmlElement)node;
ele.SetAttribute("value", Xvalue);
doc.Save(Application.ExecutablePath + ".config");
}
catch (Exception ex)
{
LogUtil.error( "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + ",",ex);
}
}
///<summary>
///向.config文件的appKey结写入信息AppValue 保存设置
///</summary>
///<param name="AppKey">节点名</param>
///<param name="AppValue">值</param>
private static void SetValue(String AppKey, String AppValue)
{
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(System.Windows.Forms.Application.ExecutablePath + ".config");
XmlNode xNode;
XmlElement xElem1;
XmlElement xElem2;
xNode = xDoc.SelectSingleNode("//appSettings");
xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']");
if (xElem1 != null)
xElem1.SetAttribute("value", AppValue);
else
{
xElem2 = xDoc.CreateElement("add");
xElem2.SetAttribute("key", AppKey);
xElem2.SetAttribute("value", AppValue);
xNode.AppendChild(xElem2);
}
xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
}
catch (Exception ex)
{
LogUtil.error( "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + ",",ex);
}
} }
} }
} }
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="AGVLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\DLL\AGVLib\AGVLib\bin\Debug\AGVLib.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.8384.25672, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.8384.25672, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\CodeLibrary.dll</HintPath> <HintPath>..\DLL\CodeLibrary.dll</HintPath>
...@@ -90,6 +94,7 @@ ...@@ -90,6 +94,7 @@
<Compile Include="theMachine\Common.cs" /> <Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\JobList.cs" /> <Compile Include="theMachine\JobList.cs" />
<Compile Include="theMachine\LabelParam.cs" /> <Compile Include="theMachine\LabelParam.cs" />
<Compile Include="theMachine\MainMachine_AGV.cs" />
<Compile Include="theMachine\MainMachine_ServerControl.cs" /> <Compile Include="theMachine\MainMachine_ServerControl.cs" />
<Compile Include="theMachine\MainMachine _BtnProcess.cs" /> <Compile Include="theMachine\MainMachine _BtnProcess.cs" />
<Compile Include="theMachine\MainMachine _Common.cs" /> <Compile Include="theMachine\MainMachine _Common.cs" />
......
...@@ -160,6 +160,7 @@ namespace DeviceLibrary ...@@ -160,6 +160,7 @@ namespace DeviceLibrary
var DelSpeed = Config.DelSpeed > 0 ? Config.DelSpeed : targetSpeed * 4; var DelSpeed = Config.DelSpeed > 0 ? Config.DelSpeed : targetSpeed * 4;
AxisManager.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed, AddSpeed, DelSpeed);// Config.AddSpeed, Config.DelSpeed); AxisManager.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed, AddSpeed, DelSpeed);// Config.AddSpeed, Config.DelSpeed);
} }
LogUtil.info(AxisName + $" AbsMove:{targetPosition},{targetSpeed}");
} }
public void SpeedMove(int targetSpeed) public void SpeedMove(int targetSpeed)
......
...@@ -191,6 +191,7 @@ namespace DeviceLibrary ...@@ -191,6 +191,7 @@ namespace DeviceLibrary
ConfigHelper.Config.Get("CamTestReel_Ability", false); ConfigHelper.Config.Get("CamTestReel_Ability", false);
ConfigHelper.Config.Set("CamTestReel_debug", false); ConfigHelper.Config.Set("CamTestReel_debug", false);
ConfigHelper.Config.Get("Device_1315_ReelHeight_Compensation", 0); ConfigHelper.Config.Get("Device_1315_ReelHeight_Compensation", 0);
initAgv();
} }
private void Crc_LanguageChangeEvent(object sender, EventArgs e) private void Crc_LanguageChangeEvent(object sender, EventArgs e)
...@@ -275,6 +276,7 @@ namespace DeviceLibrary ...@@ -275,6 +276,7 @@ namespace DeviceLibrary
if (runStatus == RunStatus.Running) if (runStatus == RunStatus.Running)
{ {
ioMonitor(); ioMonitor();
AGVProcess();
StringProcess(); StringProcess();
ClampProcess(); ClampProcess();
boxTransport.Process(); boxTransport.Process();
...@@ -646,11 +648,11 @@ namespace DeviceLibrary ...@@ -646,11 +648,11 @@ namespace DeviceLibrary
//ok = false; //ok = false;
StringDoorSuddenStop(); StringDoorSuddenStop();
} }
//else if (!lastStringSafetyStatus) else if (!lastStringDoorSafetyStatus)
//{ {
// StringDoor.ResumeSingle(); // StringDoor.ResumeSingle();
// lastStringSafetyStatus = true; lastStringDoorSafetyStatus = true;
//} }
} }
if (!ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false)) if (!ConfigHelper.Config.Get("Device_Disable_DoorSafeCheck", false))
{ {
...@@ -711,9 +713,10 @@ namespace DeviceLibrary ...@@ -711,9 +713,10 @@ namespace DeviceLibrary
} }
} }
} }
bool lastStringDoorSafetyStatus=true;
void StringDoorSuddenStop() void StringDoorSuddenStop()
{ {
//if (lastSafeCheckStatus) if (lastStringDoorSafetyStatus)
{ {
AxisBean axis = StringDoor.axisBean; AxisBean axis = StringDoor.axisBean;
AxisBean.StopMultiAxis(new List<AxisBean> { axis }); AxisBean.StopMultiAxis(new List<AxisBean> { axis });
...@@ -723,6 +726,7 @@ namespace DeviceLibrary ...@@ -723,6 +726,7 @@ namespace DeviceLibrary
{ {
ResetMoveInfo.NewMove(MoveStep.H01_HomeReset); ResetMoveInfo.NewMove(MoveStep.H01_HomeReset);
} }
lastStringDoorSafetyStatus=false;
} }
} }
/// <summary> /// <summary>
......
...@@ -104,9 +104,9 @@ namespace DeviceLibrary ...@@ -104,9 +104,9 @@ namespace DeviceLibrary
break; break;
case MoveStep.ReelClamp_04: case MoveStep.ReelClamp_04:
ClampMoveInfo.NextMoveStep(MoveStep.ReelClamp_05); ClampMoveInfo.NextMoveStep(MoveStep.ReelClamp_05);
ClampMoveInfo.log($"关闭翻板门,检测盘宽");
//CylinderMove(ClampMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH); //CylinderMove(ClampMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
ClampMoveInfo.MoveParam.PlateW = GetWidth(); ClampMoveInfo.MoveParam.PlateW = GetWidth();
ClampMoveInfo.log($"关闭翻板门,检测盘宽={ClampMoveInfo.MoveParam.PlateW}");
CloseFlipDoor(ClampMoveInfo); CloseFlipDoor(ClampMoveInfo);
break; break;
case MoveStep.ReelClamp_05: case MoveStep.ReelClamp_05:
...@@ -122,8 +122,8 @@ namespace DeviceLibrary ...@@ -122,8 +122,8 @@ namespace DeviceLibrary
else else
{ {
ClampErrorCount = 0; ClampErrorCount = 0;
ReelGetted();
ClampMoveInfo.log($"检测到盘,盘宽:{ClampMoveInfo.MoveParam.PlateW},通知料串料已取走"); ClampMoveInfo.log($"检测到盘,盘宽:{ClampMoveInfo.MoveParam.PlateW},通知料串料已取走");
ReelGetted();
} }
break; break;
case MoveStep.ReelClamp_WaitGaugeHeight: case MoveStep.ReelClamp_WaitGaugeHeight:
......
...@@ -69,7 +69,7 @@ namespace DeviceLibrary ...@@ -69,7 +69,7 @@ namespace DeviceLibrary
// //RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查")); // //RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
//} //}
//else //else
Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查")); RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
return; return;
} }
...@@ -101,7 +101,7 @@ namespace DeviceLibrary ...@@ -101,7 +101,7 @@ namespace DeviceLibrary
// //RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查"); // //RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
//} //}
//else //else
Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning); Msg.add(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm);
RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查")); RobotManage.UserPause(crc.GetString("Res0004", "收到出库任务,但料叉上有料,无法启动,请检查"));
return; return;
} }
......
...@@ -157,6 +157,26 @@ namespace DeviceLibrary ...@@ -157,6 +157,26 @@ namespace DeviceLibrary
StoreTS16, StoreTS16,
StoreTS17, StoreTS17,
StoreTS18, StoreTS18,
//AGV
AGV_In01,
AGV_In02,
AGV_In03,
AGV_In04,
AGV_In05,
AGV_In06,
AGV_In07,
AGV_In08,
AGV_Out01,
AGV_Out02,
AGV_Out03,
AGV_Out04,
AGV_Out05,
AGV_Out06,
AGV_Out07,
AGV_OpenDoor,
AGV_DetachOK,
AGV_CloseDoor,
} }
......
...@@ -25,7 +25,7 @@ namespace TheMachine ...@@ -25,7 +25,7 @@ namespace TheMachine
InitializeComponent(); InitializeComponent();
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent; RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
//chbAutoRun.Enabled = false; //chbAutoRun.Enabled = false;
chbAutoRun.Checked = Convert.ToBoolean(ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun)); chbAutoRun.Checked = Convert.ToBoolean(ConfigAppSettings.GetValue(Setting_Init.App_AutoRun,0, "系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要"));
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged); this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
//chbAutoRun.Enabled = true; //chbAutoRun.Enabled = true;
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
...@@ -80,12 +80,12 @@ namespace TheMachine ...@@ -80,12 +80,12 @@ namespace TheMachine
{ {
if (chbAutoRun.Checked) if (chbAutoRun.Checked)
{ {
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 1); ConfigAppSettings.SetValue(Setting_Init.App_AutoRun, 1);
AutoRun(Application.ExecutablePath, true); AutoRun(Application.ExecutablePath, true);
} }
else else
{ {
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 0); ConfigAppSettings.SetValue(Setting_Init.App_AutoRun, 0);
AutoRun(Application.ExecutablePath, false); AutoRun(Application.ExecutablePath, false);
} }
} }
......
...@@ -401,3 +401,4 @@ l_flipDoor_no_work 左侧翻板水平信号未亮 The left flap horizontal signa ...@@ -401,3 +401,4 @@ l_flipDoor_no_work 左侧翻板水平信号未亮 The left flap horizontal signa
r_flipDoor_no_work 右侧翻板水平信号未亮 The right flap horizontal signal is not lit r_flipDoor_no_work 右侧翻板水平信号未亮 The right flap horizontal signal is not lit
reel_not_in_right_status 料盘放置异常 The reel is placed abnormally reel_not_in_right_status 料盘放置异常 The reel is placed abnormally
confirm_no_reel_in_com 请确保料盘已从库位中取出 Make sure that the reel has been removed from the location confirm_no_reel_in_com 请确保料盘已从库位中取出 Make sure that the reel has been removed from the location
outstore_abnormal_reel The material tray is not successfully put into the string, please check
\ No newline at end of file \ No newline at end of file
...@@ -403,3 +403,4 @@ l_flipDoor_no_work 左侧翻板水平信号未亮 左フラップ水平信号が ...@@ -403,3 +403,4 @@ l_flipDoor_no_work 左侧翻板水平信号未亮 左フラップ水平信号が
r_flipDoor_no_work 右侧翻板水平信号未亮 右フラップ水平信号が点灯しない r_flipDoor_no_work 右侧翻板水平信号未亮 右フラップ水平信号が点灯しない
reel_not_in_right_status 料盘放置异常 リールが異常に配置されている reel_not_in_right_status 料盘放置异常 リールが異常に配置されている
confirm_no_reel_in_com 请确保料盘已从库位中取出 リールがその場所から取り外されていることを確認してください confirm_no_reel_in_com 请确保料盘已从库位中取出 リールがその場所から取り外されていることを確認してください
outstore_abnormal_reel 倉庫を出るとき、材料トレイがひもにうまく入れられていません、確認してください
\ No newline at end of file \ No newline at end of file
...@@ -376,7 +376,7 @@ string_not_onposition 回原时X09,X10信号异常,料串可能不在正确位 ...@@ -376,7 +376,7 @@ string_not_onposition 回原时X09,X10信号异常,料串可能不在正确位
tray_detect_reel_01 料叉传感器X30感应到有料,请人工确认 料叉传感器X30感应到有料,请人工确认 tray_detect_reel_01 料叉传感器X30感应到有料,请人工确认 料叉传感器X30感应到有料,请人工确认
system_running_cantmove 系统正在运行,不能手动控制伺服 system_running_cantmove 系统正在运行,不能手动控制伺服
before_FrmPositionTool_stopmuchine 运行库位校准程序前,需要先停止料仓的运行 before_FrmPositionTool_stopmuchine 运行库位校准程序前,需要先停止料仓的运行
outstore_abnormal_reel 出库时料盘未成功放入料串,请检查
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!