Commit 89760d0b LN

出库接口修改,增加料架参数

1 个父辈 ffd71118
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<add key="HumitureControllerType" value="0" /> <add key="HumitureControllerType" value="0" />
<add key="UseAIOBOX" value="1" /> <add key="UseAIOBOX" value="1" />
<!--流水线地址和端口配置--> <!--流水线地址和端口配置-->
<add key="LineServerIp" value="192.168.104.88" /> <add key="LineServerIp" value="192.168.8.108" />
<add key="LineServerPort" value="5246" /> <add key="LineServerPort" value="5246" />
<!--是否调试状态--> <!--是否调试状态-->
<add key="IsInDebug" value="1" /> <add key="IsInDebug" value="1" />
......
...@@ -372,7 +372,7 @@ namespace OnlineStore.ACSingleStore ...@@ -372,7 +372,7 @@ namespace OnlineStore.ACSingleStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartOutStoreMove(new InOutStoreParam("", selectPositionNum, ktk)); store.StartOutStoreMove(new InOutParam(new InOutPosInfo( "", selectPositionNum), ktk));
} }
else else
{ {
...@@ -386,7 +386,7 @@ namespace OnlineStore.ACSingleStore ...@@ -386,7 +386,7 @@ namespace OnlineStore.ACSingleStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
store.StartInStoreMove(new InOutStoreParam("", selectPositionNum, ktk)); store.StartInStoreMove(new InOutParam(new InOutPosInfo( "", selectPositionNum), ktk));
} }
else else
{ {
...@@ -904,7 +904,7 @@ namespace OnlineStore.ACSingleStore ...@@ -904,7 +904,7 @@ namespace OnlineStore.ACSingleStore
store.autoMsg = "自动出库:" + poText; store.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); LogUtil.info(LOGGER, store.StoreName + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//store.StartOutStoreMove(new InOutStoreParam("", poText)); //store.StartOutStoreMove(new InOutStoreParam("", poText));
store.StartInStoreMove(new InOutStoreParam("", poText)); store.StartInStoreMove(new InOutParam(new InOutPosInfo("AUTOINOUT", poText)));
} }
btnStartAuTo.Text = "停止自动出入库"; btnStartAuTo.Text = "停止自动出入库";
} }
...@@ -1300,6 +1300,15 @@ namespace OnlineStore.ACSingleStore ...@@ -1300,6 +1300,15 @@ namespace OnlineStore.ACSingleStore
ss = StoreStatus.Debugging; ss = StoreStatus.Debugging;
} }
StoreSendBean bean = new StoreSendBean(StoreManager.Config.Id, StoreManager.Config.CID, (int)ss, (int)StoreRunStatus.Runing, hasTray, (int)StoreAlarmType.None); StoreSendBean bean = new StoreSendBean(StoreManager.Config.Id, StoreManager.Config.CID, (int)ss, (int)StoreRunStatus.Runing, hasTray, (int)StoreAlarmType.None);
//bean.data.Add(ParamDefine.posId, cmbPosition.Text);
//bean.data.Add(ParamDefine.plateH, "8");
//bean.data.Add(ParamDefine.plateW, "7");
//bean.data.Add(ParamDefine.cutReel, false.ToString());
//bean.data.Add(ParamDefine.smallReel, true.ToString());
//bean.data.Add(ParamDefine.urgentReel, false.ToString());
//bean.data.Add(ParamDefine.rfid, "E99");
//bean.data.Add(ParamDefine.rfidLoc, 72.ToString());
//bean.data.Add(ParamDefine.barcode, "code");
LineConnect.SendHeart(bean); LineConnect.SendHeart(bean);
} }
} }
......
...@@ -9,4 +9,11 @@ ...@@ -9,4 +9,11 @@
//机器设备故障(非温湿度)报警 亮 灭 闪 //机器设备故障(非温湿度)报警 亮 灭 闪
在RC1246-ACSingleStore 项目基础上, 在RC1246-ACSingleStore 项目基础上,
新建分支RC1250-ACSingleStore,作为佳世达流水线单台料仓软件
\ No newline at end of file \ No newline at end of file
新建分支RC1250-ACSingleStore,作为佳世达流水线单台料仓软件
5 出库时根据StatusBean返回data中的参数决定料盘流转到哪里

urgentReel: true 表示紧急料,需要出到料串上
cutReel: true 表示分盘料,需要出到料串上
smallReel: true 小料(7x8),放置到小料架上
rfid: 分配的料架RFID
rfidLoc: 料架的架位,值为-1时,可以自由分配皮带线, 小料时,架位为1-46优先走1/2号皮带线,47-92优先走3/4号皮带线, 70,71,72时只能分配到3/4号皮带线;大料时,架位1-6优先走1/2号皮带线, 7-12优先走3/4号皮带线
\ No newline at end of file \ No newline at end of file
...@@ -199,6 +199,30 @@ namespace OnlineStore.Common ...@@ -199,6 +199,30 @@ namespace OnlineStore.Common
/// <summary> /// <summary>
/// 温度报警值 /// 温度报警值
/// </summary> /// </summary>
public static string maxTemperature = "temp"; public static string maxTemperature = "temp";
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public static string urgentReel = "urgentReel";
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public static string cutReel = "cutReel";
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public static string smallReel = "smallReel";
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public static string rfid = "rfid";
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
/// </summary>
public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode";
} }
} }
...@@ -91,5 +91,35 @@ namespace OnlineStore.Common ...@@ -91,5 +91,35 @@ namespace OnlineStore.Common
} }
return span.Hours.ToString().PadLeft(2, '0') + ":" + span.Minutes.ToString().PadLeft(2, '0') + ":" + seconds; return span.Hours.ToString().PadLeft(2, '0') + ":" + span.Minutes.ToString().PadLeft(2, '0') + ":" + seconds;
} }
public static bool GetBoolData(Dictionary<string, string> data, string key, bool defaultValue=false)
{
if (data.ContainsKey(key))
{
try
{
return Convert.ToBoolean(data[key]);
}
catch (Exception ex)
{
}
}
return defaultValue;
}
public static int GetIntData(Dictionary<string, string> data, string key, int defaultValue = 0)
{
if (data.ContainsKey(key))
{
try
{
return Convert.ToInt32(data[key]);
}
catch (Exception ex)
{
}
}
return defaultValue;
}
} }
} }
...@@ -76,8 +76,7 @@ ...@@ -76,8 +76,7 @@
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" /> <Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\FixtureCodeInfo.cs" /> <Compile Include="store\InOutParam.cs">
<Compile Include="store\InOrOutStoreParam.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="store\model\StoreMoveInfo.cs"> <Compile Include="store\model\StoreMoveInfo.cs">
......
...@@ -91,16 +91,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -91,16 +91,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return JsonHelper.SerializeObject(store)+"\r"; return JsonHelper.SerializeObject(store)+"\r";
} }
//private static string ToParamStr(List<object> paramList)
//{
// string result = "";
// foreach (object str in paramList)
// {
// result += str + cmd_spilt.ToString();
// }
// return result + "\r";
//}
private static void HandlerMsg(string message) private static void HandlerMsg(string message)
{ {
try try
...@@ -153,7 +144,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("处理流水线消息【"+ message +"】出错:" +ex.ToString() ); LogUtil.error("处理流水线消息【"+ message +"】出错:" +ex.ToString() );
} }
} }
public static char cmd_spilt = ';'; public static char cmd_spilt = ';';
public static string cmd_heart = "heart"; public static string cmd_heart = "heart";
private static string cmd_outend = "outend"; private static string cmd_outend = "outend";
...@@ -220,6 +211,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -220,6 +211,7 @@ namespace OnlineStore.DeviceLibrary
this.AlarmType = alarmType; this.AlarmType = alarmType;
this.Seq = LineConnect.nextSeq(); this.Seq = LineConnect.nextSeq();
this.WaitInStoreList = new List<string>(LineConnect.WaitInStoreList); this.WaitInStoreList = new List<string>(LineConnect.WaitInStoreList);
this.data = new Dictionary<string, string>();
// WaitInStoreList.Add("1#AC1_1_1"); // WaitInStoreList.Add("1#AC1_1_1");
} }
...@@ -231,10 +223,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -231,10 +223,37 @@ namespace OnlineStore.DeviceLibrary
public int SRunStatus = 0; public int SRunStatus = 0;
public int DoorHasTray = 0; public int DoorHasTray = 0;
public int AlarmType = 0; public int AlarmType = 0;
public string PosId = "";
public string PlateH = "0";
public string PlateW = "0";
public List<string> WaitInStoreList = new List<string>(); public List<string> WaitInStoreList = new List<string>();
public Dictionary<string, string> data = new Dictionary<string, string>();
//public string PosId = "";
//public string PlateH = "0";
//public string PlateW = "0";
///// <summary>
///// urgentReel: true 表示紧急料,需要出到料串上
///// </summary>
//public bool urgentReel = false;
///// <summary>
///// cutReel: true 表示分盘料,需要出到料串上
///// </summary>
//public bool cutReel = false;
///// <summary>
///// smallReel: true 小料(7x8),放置到小料架上
///// </summary>
//public bool smallReel = false;
///// <summary>
///// rfid: 分配的料架RFID
///// </summary>
//public string rfid = "";
///// <summary>
///// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
///// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
///// 70,71,72时只能分配到3 / 4号皮带线;
///// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
///// </summary>
//public int rfidLoc = 0;
} }
} }
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 出入仓参数(出入库操作时传入的参数类)
/// </summary>
public class InOutStoreParam
{
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InOutStoreParam()
{
ACStoreP = null;
this.WareNumber = "";
MoveP = null;
}
/// <summary>
/// 新建一个对象
/// </summary>
/// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param>
public InOutStoreParam(string wareNo, string posId)
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
MoveP = null;
IsSolderPaste = false;
}
public InOutStoreParam(string wareNo, string posId,string plateH,string plateW)
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
MoveP = null;
this.PlateW = plateW;
this.PlateH = plateH;
IsSolderPaste = false;
}
public InOutStoreParam(string wareNo, string posId, LineMoveP linePosition)
{
ACStoreP = null;
WareNumber = wareNo;
PositionNum = posId;
MoveP = linePosition;
IsSolderPaste = false;
ACStorePosition p = GetACPosition();
if (p != null)
{
PlateH = p.BagHigh.ToString();
PlateW = p.BagWidth.ToString();
}
}
//public InOutStoreParam(string wareNo, string posId, ACStorePosition movep)
//{
// ACStoreP = movep;
// WareNumber = wareNo;
// PositionNum = posId;
// MoveP = null;
// IsSolderPaste = false;
//}
private ACStorePosition ACStoreP = null;
public ACStorePosition GetACPosition()
{
try
{
if (ACStoreP == null)
{
ACStoreP = CSVPositionReader<ACStorePosition>.GetPositon(PositionNum);
}
}
catch (Exception ex)
{
LogUtil.error(log, "出入库获取库位信息GetKTKPosition出错:" + ex.ToString());
}
return ACStoreP;
}
/// <summary>
/// 物品二维码信息
/// </summary>
public string WareNumber { get; set; }
/// <summary>
/// 位置坐标名(对应配置表的位置)
/// </summary>
public string PositionNum { get; set; }
public LineMoveP MoveP { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
public string PlateH { get; set; }
/// <summary>
/// 料盘宽度
/// </summary>
public string PlateW { get; set; }
/// <summary>
/// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary>
public bool IsSolderPaste { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
}
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 出入仓参数(出入库操作时传入的参数类)
/// </summary>
public class InOutParam
{
public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public InOutParam()
{
ACStoreP = null;
this.PosInfo = new InOutPosInfo("", "");
MoveP = null;
}
public InOutParam(InOutPosInfo inoutInfo, LineMoveP linePosition = null)
{
ACStoreP = null; ;
MoveP = linePosition;
//WareNumber = wareNo;
//PositionNum = posId;
//this.PlateW = plateW;
//this.PlateH = plateH
this.PosInfo = inoutInfo;
}
//public InOutParam(inoup, LineMoveP linePosition=null)
//{
// ACStoreP = null;
// WareNumber = wareNo;
// PositionNum = posId;
// MoveP = linePosition;
// ACStorePosition p = GetACPosition();
// if (p != null)
// {
// PlateH = p.BagHigh.ToString();
// PlateW = p.BagWidth.ToString();
// }
//}
//public InOutStoreParam(string wareNo, string posId, ACStorePosition movep)
//{
// ACStoreP = movep;
// WareNumber = wareNo;
// PositionNum = posId;
// MoveP = null;
// IsSolderPaste = false;
//}
private ACStorePosition ACStoreP = null;
public ACStorePosition GetACPosition()
{
try
{
if (ACStoreP == null)
{
string posId = PosInfo != null ? PosInfo.PosId : "";
ACStoreP = CSVPositionReader<ACStorePosition>.GetPositon(posId);
}
}
catch (Exception ex)
{
LogUtil.error(log, "出入库获取库位信息GetKTKPosition出错:" + ex.ToString());
}
return ACStoreP;
}
///// <summary>
///// 物品二维码信息
///// </summary>
//public string WareNumber { get; set; }
///// <summary>
///// 位置坐标名(对应配置表的位置)
///// </summary>
//public string PositionNum { get; set; }
public InOutPosInfo PosInfo { get; set; }
public LineMoveP MoveP { get; set; }
///// <summary>
///// 料盘高度
///// </summary>
//public string PlateH { get; set; }
///// <summary>
///// 料盘宽度
///// </summary>
//public string PlateW { get; set; }
} /// <summary>
/// 夹具编码信息(保存夹具检测到的IO数值,和对应的料仓位置)
/// </summary>
public class InOutPosInfo
{
public InOutPosInfo(string barcode, string posId, string platew = "", string plateh = "", bool urgentReel = false , bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0)
{
this.barcode = barcode;
this.PosId = posId;
this.PlateW = platew;
this.PlateH = plateh;
this.urgentReel = urgentReel;
this.cutReel = cutReel;
this.smallReel = smallReel;
this.rfid = rfid;
this.rfidLoc = rfidLoc;
}
/// <summary>
/// 物品二维码
/// </summary>
public string barcode { get; set; }
/// <summary>
/// 库位号编码
/// </summary>
public string PosId { get; set; }
/// <summary>
/// 料盘宽
/// </summary>
public string PlateW { get; set; }
/// <summary>
/// 料盘高
/// </summary>
public string PlateH { get; set; }
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public bool urgentReel { get; set; }
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public bool cutReel { get; set; }
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public bool smallReel { get; set; }
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public string rfid { get; set; }
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
/// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线;
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary>
public int rfidLoc { get; set; }
public string ToStr()
{
return " barcode[" + barcode + "],PosId [" + PosId + "],plateW [" + PlateW + "],plateH [" + PlateH + "],urgentReel [" + urgentReel
+ "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]";
}
}
}
...@@ -388,7 +388,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -388,7 +388,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始出库运动 /// 开始出库运动
/// </summary> /// </summary>
public abstract bool StartOutStoreMove(InOutStoreParam param); public abstract bool StartOutStoreMove(InOutParam param);
protected abstract void OutStoreProcess(); protected abstract void OutStoreProcess();
#endregion #endregion
...@@ -396,7 +396,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -396,7 +396,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public abstract void StartInStoreMove(InOutStoreParam param); public abstract void StartInStoreMove(InOutParam param);
protected abstract void InStoreProcess(); protected abstract void InStoreProcess();
#endregion #endregion
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 夹具编码信息(保存夹具检测到的IO数值,和对应的料仓位置)
/// </summary>
public class FixtureCodeInfo
{
public FixtureCodeInfo(int trayCode, string wareNum, string posId)
{
this.TrayCode = trayCode;
this.WareNum = wareNum;
this.PosId = posId;
this.plateH = "";
this.plateW = "";
}
public FixtureCodeInfo(int trayCode, string wareNum, string posId,string platew,string plateh)
{
this.TrayCode = trayCode;
this.WareNum = wareNum;
this.PosId = posId;
this.plateW = platew;
this.plateH = plateh;
}
/// <summary>
/// 夹具编码值(1-6)
/// </summary>
public int TrayCode { get; set; }
/// <summary>
/// 物品二维码
/// </summary>
public string WareNum { get; set; }
/// <summary>
/// 库位号编码
/// </summary>
public string PosId { get; set; }
/// <summary>
/// 料盘宽
/// </summary>
public string plateW { get; set; }
/// <summary>
/// 料盘高
/// </summary>
public string plateH { get; set; }
public string ToStr()
{
return "TrayCode【" + TrayCode + "】,WareNum=【" + WareNum + "】,PosId=【" + PosId + "】,plateW=【" + plateW + "】,plateH=【" + plateH + "】";
}
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary>
/// <returns></returns>
public int GetStoreId()
{
if (!PosId.Equals(""))
{
string[] arr = PosId.Split('#');
if (arr.Length >= 2)
{
try
{
return int.Parse(arr[0]);
}
catch (Exception ex)
{
}
}
}
return -1;
}
}
}
...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveType = StoreMoveType.None; moveType = StoreMoveType.None;
MoveParam = new InOutStoreParam(); MoveParam = new InOutParam();
this.storeId = storeId; this.storeId = storeId;
this.moveStep = StoreMoveStep.Wait; this.moveStep = StoreMoveStep.Wait;
IsInWait = false; IsInWait = false;
...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///出入库参数 ///出入库参数
/// </summary> /// </summary>
public InOutStoreParam MoveParam { get; set; } public InOutParam MoveParam { get; set; }
/// <summary> /// <summary>
/// 当前运动是哪个料仓 /// 当前运动是哪个料仓
/// </summary> /// </summary>
...@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,7 +107,7 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>(); WaitList = new List<WaitResultInfo>();
MoveNum++; MoveNum++;
} }
public void NewMove(StoreMoveType type, InOutStoreParam param) public void NewMove(StoreMoveType type, InOutParam param)
{ {
moveStep = StoreMoveStep.Wait; moveStep = StoreMoveStep.Wait;
this.moveType = type; this.moveType = type;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!