Commit 4098afb9 LN

夹爪分开配置。

1 个父辈 0c67c918
20200428
20210510
夹爪脆盘和普通料盘参数分开配置
20200428
1.脆盘料号配置增加界面,修改后实时生效。
2.预扫码扫码失败照片保存到文件夹。
3.紧急料直接放入NG箱
......@@ -42,3 +45,6 @@ todesk 874075053 Acc123
线体转动方向
D7处无检测信号,如何判断出料口是否有料
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo(MoveInfo.MoveType + ":" + MoveInfo.SLog + ": 定位气缸下降 ,夹紧气缸放松");
LocationCylinderDown(MoveInfo);
//CylinderMove(MoveInfo, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo,LastCodeList.ToArray());
break;
case LineMoveStep.FR_15_TopDown:
RFIDData data = RFIDManager.GetShelfId(DeviceID);
......
......@@ -506,7 +506,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.FI_34_CylinderRelax);
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
//CylinderMove(MoveInfo, IO_Type.SL_ClampCylinder_Work, IO_Type.SL_ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, LastCodeList.ToArray());
}
else if (MoveInfo.IsStep(LineMoveStep.FI_34_CylinderRelax))
{
......
......@@ -364,7 +364,7 @@ namespace OnlineStore.DeviceLibrary
ClampCount = 1;
OutLog("出库 " + MoveInfo.SLog + ": 第一次未抓到料,重新抓一次,夹爪先放松", 1);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo,MoveInfo.MoveParam.WareCode);
}
else
{
......@@ -447,7 +447,7 @@ namespace OnlineStore.DeviceLibrary
//出库全部完成
MoveInfo.NextMoveStep(LineMoveStep.MO_61_CylinderRelax);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, MoveInfo.MoveParam.WareCode);
EDataManager.UpdateParam(DeviceID);
}
......@@ -640,7 +640,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MI_12_CylinderRelax);
InLog("入库 " + MoveInfo.SLog + ",夹料气缸放松");
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa.Relax(MoveInfo);
ClampJwa.Relax(MoveInfo, MoveInfo.MoveParam.WareCode);
EDataManager.UpdateParam(DeviceID);
}
else if (MoveInfo.IsStep(LineMoveStep.MI_12_CylinderRelax))
......
......@@ -24,24 +24,24 @@ namespace OnlineStore.DeviceLibrary
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public static LineBean Line = null;
public static Line_Config Config = null;
public static Line_Config Config = null;
public static Dictionary<int, DeviceConfig> allConfigMap = null;
public LineManager()
{
}
public static bool CheckEnum(Type type)
public static bool CheckEnum(Type type)
{
if (type.IsEnum)
{
{
List<int> valueList = new List<int>();
Array array = Enum.GetValues(type);
foreach (int item in array)
{
if (valueList.Contains(item))
{
LogUtil.error( type.Name + "枚举值:" + item + "重复存在,请检查代码!程序退出。");
LogUtil.error(type.Name + "枚举值:" + item + "重复存在,请检查代码!程序退出。");
Application.Exit();
return false;
return false;
}
valueList.Add(item);
}
......@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary
}
Dictionary<int, MoveEquip_Config> moveECMap = null;
Dictionary<int, FeedingEquip_Config> feedingECMap = null;
Dictionary<int, HYEquip_Config> HYECMap = null;
Dictionary<int, HYEquip_Config> HYECMap = null;
DeviceConfig.SubDIList = new Dictionary<int, Dictionary<string, ConfigIO>>();
DeviceConfig.SubDOList = new Dictionary<int, Dictionary<string, ConfigIO>>();
......@@ -86,9 +86,9 @@ namespace OnlineStore.DeviceLibrary
moveECMap = new Dictionary<int, MoveEquip_Config>();
feedingECMap = new Dictionary<int, FeedingEquip_Config>();
HYECMap = new Dictionary<int, HYEquip_Config>();
HYECMap = new Dictionary<int, HYEquip_Config>();
allConfigMap = new Dictionary<int, DeviceConfig>();
isInit = true;
string lineType = ConfigAppSettings.GetValue(Setting_Init.Line_Type);
......@@ -113,8 +113,8 @@ namespace OnlineStore.DeviceLibrary
}
MoveEquip_Config moveConfig = CSVConfigReader.LoadMoveConfig(i, DeviceType.MoveEquip, config);
moveConfig.ConfigSpeed(Config);
int subType = i;
moveECMap.Add(i, moveConfig);
int subType = i;
moveECMap.Add(i, moveConfig);
}
foreach (int i in moveECMap.Keys)
{
......@@ -126,7 +126,7 @@ namespace OnlineStore.DeviceLibrary
string feedingEquipConfig = ConfigAppSettings.GetValue(Setting_Init.ConfigPath_FeedingEquip);
for (int i = 1; i <= feedingEquipCount; i++)
{
int subType = 100 + i;
int subType = 100 + i;
string config = appPath + feedingEquipConfig.Replace(".csv", "_" + i + ".csv");
FeedingEquip_Config moveConfig = CSVConfigReader.LoadFeedingConfig(subType, DeviceType.FeedingEquip, config);
moveConfig.ConfigSpeed(Config);
......@@ -154,7 +154,7 @@ namespace OnlineStore.DeviceLibrary
HYECMap.Add(subType, moveConfig);
allConfigMap.Add(subType, moveConfig);
}
Config.SetIO(1000);
Line = new LineBean(Config, moveECMap, feedingECMap, HYECMap);
LogUtil.info("加载 完成!");
......@@ -174,8 +174,8 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
public static void SaveMoveEquipConfig(MoveEquip_Config config)
{
try
......@@ -185,14 +185,14 @@ namespace OnlineStore.DeviceLibrary
string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.ConfigPath_MoveEquip);
string configBase = appPath + moveEquipConfig;
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + config.Id.ToString().PadLeft(2,'0') + ".csv");
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + config.Id.ToString().PadLeft(2, '0') + ".csv");
allConfigMap[config.Id] = config;
if (!File.Exists(configStr))
{
LogUtil.info("复制配置文件【" + configBase + "】->【" + configStr + "】");
File.Copy(configBase, configStr);
}
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(MoveEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(MoveEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
public static void SaveFeedingEquipConfig(FeedingEquip_Config config)
......@@ -212,9 +212,9 @@ namespace OnlineStore.DeviceLibrary
string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.ConfigPath_FeedingEquip);
int id = config.Id - 100;
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + id+ ".csv");
string configStr = appPath + moveEquipConfig.Replace(".csv", "_" + id + ".csv");
allConfigMap[config.Id] = config;
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(FeedingEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(FeedingEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -222,7 +222,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
public static void SaveHYEquipConfig(HYEquip_Config config)
......@@ -241,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
File.Copy(configBase, configStr);
}
allConfigMap[config.Id] = config;
bool result = CSVConfigReader.SaveConfig(configStr, config,typeof(HYEquip_Config));
bool result = CSVConfigReader.SaveConfig(configStr, config, typeof(HYEquip_Config));
if (!result)
{
LogUtil.error("保存配置文件失败:" + configStr);
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("出错:",ex);
LogUtil.error("出错:", ex);
}
}
......@@ -298,25 +298,25 @@ namespace OnlineStore.DeviceLibrary
{
PnList.Add(s);
}
}
}
}
return PnList;
}
public static void UpdatePnList()
public static void UpdatePnList()
{
if (PnList == null)
{
return;
}
string str = "";
foreach(string obj in PnList)
foreach (string obj in PnList)
{
str += obj + "#";
}
ConfigAppSettings.SaveValue(Setting_Init.PNList, str);
LogUtil.info("更改脆盘料号集合:" + str);
}
public static void RemovePN(string pn)
public static void RemovePN(string pn)
{
if (PnList.Contains(pn))
{
......@@ -328,11 +328,12 @@ namespace OnlineStore.DeviceLibrary
{
if (!PnList.Contains(pn))
{
PnList.Add (pn);
PnList.Add(pn);
UpdatePnList();
}
}
public static bool NeedWaitHassReel(params string[] codes)
public static bool IsCrispReel(params string[] codes)
{
try
{
......@@ -347,13 +348,13 @@ namespace OnlineStore.DeviceLibrary
{
if (codePn.Equals(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code+"]料号["+ pn + "]是脆盘");
return false;
LogUtil.info("IsCrispReel:条码[" + code + "]料号[" + pn + "]是脆盘");
return true;
}
else if (codePn.StartsWith(pn))
{
LogUtil.info("夹爪不检测是否有料:条码[" + code + "]料号[" + pn + "]认为是脆盘");
return false;
LogUtil.info("IsCrispReel:条码[" + code + "]料号[" + pn + "]认为是脆盘");
return true;
}
}
}
......@@ -361,9 +362,14 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("NeedWaitHassReel出错:" + ex.ToString());
LogUtil.error("IsCrispReel 出错:" + ex.ToString());
}
return false;
}
public static bool NeedWaitHassReel(params string[] codes)
{
return true;
//return !IsCrispReel(codes);
}
}
}
......@@ -58,15 +58,27 @@ namespace OnlineStore.DeviceLibrary
}
public void ClampPush(LineMoveInfo moveInfo, bool checkHasReel, params string[] code)
{
bool iscrisp = LineManager.IsCrispReel(code);
float distance = config.Distance;
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.Push(config.Force, config.Distance, config.Velocity);
if (iscrisp)
{
distance = config.CrispDistance;
rmaxis.Push(config.CrispForce, config.CrispDistance, config.CrispPushVelocity);
}
else
{
distance = config.Distance;
rmaxis.Push(config.Force, config.Distance, config.PushVelocity);
}
}
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached((int)config.Distance));
if (checkHasReel && LineManager.NeedWaitHassReel(code))
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached((int)distance));
if (checkHasReel )
//if (checkHasReel && LineManager.NeedWaitHassReel(code))
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
//有一个到位就算到位
moveInfo.OneWaitCanEndStep = true;
......@@ -121,12 +133,20 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public void Relax(LineMoveInfo moveInfo = null)
public void Relax(LineMoveInfo moveInfo = null, params string[] code)
{
bool iscrisp = LineManager.IsCrispReel(code);
int p = 0;
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.MoveAbsolute(p);
if (iscrisp)
{
rmaxis.MoveAbsolute(p, config.CrispVelocity, config.CrispAddSpeed, config.CrispDelSpeed);
}
else
{
rmaxis.MoveAbsolute(p, config.Velocity, config.AddSpeed, config.DelSpeed);
}
}
if (moveInfo != null)
{
......@@ -196,7 +216,7 @@ namespace OnlineStore.DeviceLibrary
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
rmaxis.Push(force, distance, config.Velocity);
rmaxis.Push(force, distance, config.CrispVelocity);
}
}
......
......@@ -163,6 +163,28 @@ namespace OnlineStore.LoadCSVLibrary
public float Force { get; set; }
[CSVAttribute("距离")]
public float Distance { get; set; }
[CSVAttribute("推压速度")]
public float PushVelocity { get; set; }
[CSVAttribute("脆盘目标速度")]
public float CrispVelocity { get; set; }
[CSVAttribute("脆盘加速度")]
public float CrispAddSpeed { get; set; }
[CSVAttribute("脆盘减速度")]
public float CrispDelSpeed { get; set; }
[CSVAttribute("脆盘出力")]
public float CrispForce { get; set; }
[CSVAttribute("脆盘距离")]
public float CrispDistance { get; set; }
[CSVAttribute("脆盘推压速度")]
public float CrispPushVelocity { get; set; }
public string GetNameStr()
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!