Commit 3768325d LN

1

1 个父辈 eda8bcfe
......@@ -37,6 +37,10 @@ namespace OnlineStore.Common
[MyConfigComment("屏蔽出入库时料叉检测")]
public static MyConfig<bool> Device_Disable_INOUT_FixtureCheck = false;
[MyConfigComment("二维码扫码超时毫秒")]
public static MyConfig<int> Device_RfidServer_Port = 30001;
[MyConfigComment("管理员密码")]
public static MyConfig<string> User_AdminPassword = "123456";
[MyConfigComment("启用管理员密码")]
......@@ -61,6 +65,7 @@ namespace OnlineStore.Common
public static MyConfig<int> CameraScan_CodeTimeOut = 3000;
public static MyConfig<bool> Runtime_IsInStore;
public static MyConfig<string> Runtime_PosID;
public static MyConfig<string> Runtime_WareCode;
......
......@@ -73,10 +73,11 @@ namespace OnlineStore.Common
}
public static string Post(string url, string paramData, int timeOut = 10000)
{
return Post(url, paramData, Encoding.UTF8, timeOut);
bool IsTimeOut = false;
return Post(url, paramData, Encoding.UTF8, timeOut, out IsTimeOut);
}
public static string Post(string url, string paramData, Encoding encoding, int timeOut = 10000)
public static string Post(string url, string paramData, Encoding encoding, int timeOut ,out bool IsTimeOut )
{
string result = "";
......@@ -86,7 +87,7 @@ namespace OnlineStore.Common
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback((sender, certificate, chain, errors) => { return true; });
}
IsTimeOut = false;
try
{
using (var wc = new MyWebClient(timeOut))
......@@ -101,6 +102,11 @@ namespace OnlineStore.Common
result = wc.UploadString(url, "POST", paramData);
}
//LogUtil.info(result);
}
catch (WebException ex)
{
IsTimeOut = true;
LogUtil.error("POST [" + url + "] WebException :" + ex.ToString() );
}
catch (Exception e)
{
......
......@@ -36,6 +36,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDLL\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID">
<HintPath>..\..\DoubleLineClient_3D\dll\Asa.RFID.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.8485.20895, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDLL\CodeLibrary.dll</HintPath>
......@@ -64,6 +67,7 @@
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
......@@ -76,23 +80,24 @@
<Compile Include="DeviceLibrary\AcSerialBean.cs" />
<Compile Include="DeviceLibrary\Camera.cs" />
<Compile Include="DeviceLibrary\CylinderManger.cs" />
<Compile Include="DeviceLibrary\HttpServer.cs" />
<Compile Include="DeviceLibrary\IOMonitor.cs" />
<Compile Include="DeviceLibrary\I_SafetyDevice.cs" />
<Compile Include="DeviceLibrary\LiftMonitor.cs" />
<Compile Include="DeviceLibrary\LineRunMonitor.cs" />
<Compile Include="DeviceLibrary\C8WeightSensor.cs" />
<Compile Include="DeviceLibrary\OKLEController.cs" />
<Compile Include="DeviceLibrary\ReelParam.cs" />
<Compile Include="DeviceLibrary\RFIDManager.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="theMachine\BoxTransport.cs" />
<Compile Include="theMachine\ReelTransport.cs" />
<Compile Include="theMachine\Common.cs" />
<Compile Include="theMachine\InReelBean.cs" />
<Compile Include="theMachine\JobList.cs" />
<Compile Include="theMachine\LabelParam.cs" />
<Compile Include="theMachine\MainMachine _BtnProcess.cs" />
<Compile Include="theMachine\MainMachine _Common.cs" />
<Compile Include="theMachine\MainMachine _AutoInOutTest.cs" />
<Compile Include="theMachine\MainMachine_Store.cs" />
<Compile Include="theMachine\MainMachine_PutReel.cs" />
<Compile Include="theMachine\MainMachine _IOMonitor.cs" />
<Compile Include="theMachine\MainMachine _LedProcess.cs" />
<Compile Include="theMachine\MainMachine.cs" />
......@@ -100,6 +105,7 @@
<Compile Include="theMachine\MoveStep.cs" />
<Compile Include="DeviceLibrary\AlarmBuzzer.cs" />
<Compile Include="DeviceLibrary\CodeManager.cs" />
<Compile Include="theMachine\OutShelfBean.cs" />
<Compile Include="theMachine\RobotManage.cs" />
<Compile Include="theMachine\IRobot.cs" />
<Compile Include="DeviceLibrary\IAxisManager.cs" />
......
......@@ -371,6 +371,16 @@ namespace DeviceLibrary
}
return message;
}
public static string ProcessCode(List<CodeInfo> codeInfos)
{
string codeStr = "";
foreach(CodeInfo code in codeInfos)
{
codeStr += ReplaceCode(code.CodeStr)+"#";
}
return codeStr;
}
public static bool HasChinese(string str)
{
return Regex.IsMatch(str, @"[\u4e00-\u9fa5]");
......

using Asa.RFID;
using OnlineStore.Common;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
public class RFIDManager
{
private static ReadAll readAll = new ReadAll("TheRFID");
private static bool IsOpen = false;
private static ConcurrentDictionary<string, string> LastRfidMap = new ConcurrentDictionary<string, string>();
public static void Open()
{
if (IsOpen)
{
return;
}
try
{
int port = Setting_Init.Device_RfidServer_Port;
if (port <= 0)
{
port = 13000;
}
LogUtil.info("RFID Server Open,port=" + port);
readAll.Start(port);
IsOpen = true;
}
catch (Exception ex)
{
LogUtil.error("Open 出错:" + ex.ToString());
}
}
private static void ReadAll_Log(string ip, string log)
{
LogUtil.LOGGER.Info("RFID : [" + ip + "] " + log);
}
public static RFIDData ReadRFID(string ip, bool isClear = false)
{
try
{
if (String.IsNullOrEmpty(ip).Equals(false))
{
if (isClear)
{
readAll.Clear(ip);
}
Thread.Sleep(1000);
string outValue = readAll.Read(ip);
if (outValue.Equals("000"))
{
// LogUtil.error("ReadRFID[" + ip + "]=" + outValue);
}
RFIDData data = new RFIDData(outValue);
return data;
}
}
catch (Exception ex)
{
LogUtil.error("ReadRFID[" + ip + "] [" + isClear + "] 出错:" + ex.ToString());
}
return new RFIDData();
}
public static void Close()
{
try
{
if (readAll != null)
{
readAll.Stop();
}
}
catch (Exception ex)
{
LogUtil.error("关闭RFID出错:" + ex.ToString());
}
}
}
public class RFIDData
{
public string StrData = "";
public RFIDData(string data="00")
{
if (String.IsNullOrEmpty(data))
{
data = "00";
}
this.StrData = data;
}
public string NumStr()
{
return StrData;
}
internal static bool IsRealRfid(string shelfRfid)
{
//判断料架号是否是真实的料架号
//混合料架用F
if (shelfRfid.StartsWith("F"))
//if (shelfRfid.StartsWith("C") || shelfRfid.StartsWith("D"))
{
int num = -1;
try
{
num = Convert.ToInt32(shelfRfid.Substring(1, shelfRfid.Length - 1));
}
catch (Exception ex)
{
}
if (num > 0)
{
return true;
}
}
return false;
}
}
}
......@@ -10,21 +10,32 @@ using System.Threading.Tasks;
[Serializable]
public class ReelParam
{
/// <summary>
/// 创建新出入库信息
/// </summary>
/// <param name="wareNo">二维码内容</param>
/// <param name="platew">宽度</param>
/// <param name="plateh">高度</param>
/// <param name="IsNg">是否是入库NG料</param>
/// <param name="ngMsg">NG消息</param>
public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "")
///// <summary>
///// 创建新出入库信息
///// </summary>
///// <param name="wareNo">二维码内容</param>
///// <param name="platew">宽度</param>
///// <param name="plateh">高度</param>
///// <param name="IsNg">是否是入库NG料</param>
///// <param name="ngMsg">NG消息</param>
//public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "")
//{
// WareCode = wareNo;
// PlateW = platew;
// PlateH = plateh;
// IsNg = _IsNg;
// NgMsg = ngMsg;
// codeInfos = new List<CodeInfo>();
//}
public ReelParam(string wareNo = "", int platew = 0, int plateh = 0,string startPos="",string pos="", bool _IsNg = false, string ngMsg = "")
{
WareCode = wareNo;
PlateW = platew;
PlateH = plateh;
IsNg = _IsNg;
NgMsg = ngMsg;
this.StartPos = startPos;
this.TargetPos = TargetPos;
codeInfos = new List<CodeInfo>();
}
/// <summary>
......@@ -32,9 +43,13 @@ public class ReelParam
/// </summary>
public string WareCode { get; set; }
/// <summary>
/// 取料位置
/// </summary>
public string StartPos { get; set; }
/// <summary>
/// 库位号
/// </summary>
public string PosID { get; set; }
public string TargetPos { get; set; }
public string bitmapfilename = "";
public List<CodeInfo> codeInfos { get; set; }
/// <summary>
......@@ -108,7 +123,7 @@ public class ReelParam
else
{
return $":[{PosID}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
return $":[{TargetPos}][{WareCode}][{RFID}][{PlateW}x{PlateH}]";
}
}
bool islog = false;
......
......@@ -645,13 +645,12 @@ namespace DeviceLibrary
}
public class ResultData
{
//{"code":0,"msg":"ok","data":"7"}
{
public int code { get; set; }
public string msg { get; set; }
public Dictionary<string, string> data { get; set; }
public Dictionary<string, Object> data { get; set; }
}
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
......
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class InReelBean
{
//设备名称
public string Name;
//料盘检测信号
public string Reel_Check = "Reel_Check";
MoveInfo MoveInfo;
public string ErrMsgTxt = "";
//private string LastCode;
private List<CodeLibrary.CodeInfo> LastCode;
public TrayInfo CurrTray = null;
public string PosName;
public InReelBean(string name )
{
this.Name = name;
this.PosName = name;
MoveInfo = new MoveInfo(name, false);
#region 初始化IO
string ioStr = name + "_";
Reel_Check = ioStr + Reel_Check;
#endregion
}
public void Reset()
{
MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.log("执行重置,清理当前条码:"+LastCode);
LastCode = new List<CodeLibrary.CodeInfo>();
ErrMsgTxt = "";
}
public bool ReelReady()
{
if (MoveInfo.MoveStep.Equals(MoveStep.IN05_ReelReady))
{
return true;
}
return false;
}
public void ReelLeave()
{
MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.log("料盘已离开:执行重置,清理当前条码:" + LastCode);
LastCode = new List<CodeLibrary.CodeInfo> ();
ErrMsgTxt = "";
}
bool pause = false;
public void Pause()
{
pause = true;
}
public void Resume()
{
pause = false;
}
private Stopwatch reelCheckWatch = new Stopwatch();
public bool Process()
{
if (pause)
return false;
if (RobotManage.mainMachine.CheckWait(MoveInfo))
{
return false;
}
switch (MoveInfo.MoveStep)
{
case MoveStep.Wait:
//判断定位气缸是否下降到位
if (IOManager.IOValue(Reel_Check).Equals(IO_VALUE.HIGH))
{
if (RobotManage.checkWatch(reelCheckWatch, 1000, true))
{
//默认是进来的料架
MoveInfo.NewMove(MoveStep.IN01_WaitCheck);
MoveInfo.log("检测到料盘信号");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Reel_Check, IO_VALUE.HIGH));
ErrMsgTxt = "";
}
}
else
{
reelCheckWatch.Reset();
}
break;
case MoveStep.IN01_WaitCheck:
IN02_ScanCode();
break;
case MoveStep.IN02_ScanCode:
if (ScanCodeTask == null || ScanCodeTask.IsCompleted)
{
MoveInfo.NewMove(MoveStep.IN03_GetPos);
MoveInfo.log("获取库位号");
}
else if (MoveInfo.IsTimeOut(60))
{
ErrMsgTxt = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
}
break;
case MoveStep.IN03_GetPos:
if (GetPosTask == null || GetPosTask.IsCompleted)
{
MoveInfo.NewMove(MoveStep.IN05_ReelReady);
MoveInfo.log("料盘已准备好,等待取料");
}
else if (MoveInfo.IsTimeOut(60))
{
ErrMsgTxt = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 获取库位号超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
}
break;
case MoveStep.IN05_ReelReady:
break;
default:
MoveInfo.log($" 未找到对应步骤:{MoveInfo.MoveStep}");
return true;
}
return false;
}
private Task ScanCodeTask = null;
private Task GetPosTask = null;
private void IN02_ScanCode()
{
try
{
MoveInfo.NewMove(MoveStep.IN02_ScanCode);
MoveInfo.log("开始扫码");
ScanCodeTask = Task.Factory.StartNew(delegate
{
string[] cameraName=Setting_Init.CameraScan_IN_2;
if (Name.Contains("1"))
{
cameraName = Setting_Init.CameraScan_IN_1;
}
LastCode= CodeManager.CameraScan(cameraName.ToList());
MoveInfo.log("扫码完成:");
});
}
catch (Exception ex)
{
LogUtil.error("IN02_ScanCode 扫码出错:", ex);
}
}
private void IN03_GetPos()
{
try
{
MoveInfo.NewMove(MoveStep.IN03_GetPos);
string codestr = CodeManager.ProcessCode(LastCode);
if (LastCode.Count <= 0 || codestr.Equals(""))
{
CurrTray = TrayInfo.newNgTray(codestr, "扫码失败");
MoveInfo.log("未扫到条码,直接NG ");
}
else
{
MoveInfo.log("获取库位号: " + codestr);
GetPosTask = Task.Factory.StartNew(delegate
{
while (MoveInfo.MoveStep.Equals(MoveStep.IN03_GetPos))
{
string shelfRfid = RobotManage.mainMachine.getReadyShelf();
if (String.IsNullOrEmpty(shelfRfid))
{
//无可用料架
ErrMsgTxt = $"{Name}:{codestr}暂无可用料架";
MoveInfo.errlog("获取库位号: " + ErrMsgTxt + ",等待3秒后重新获取");
Thread.Sleep(3000);
}
else
{
ClearWarnMsg("暂无可用料架");
//获取库位号
string outMsg = "";
CurrTray = HttpServer.GetLocation(codestr, shelfRfid, out outMsg);
//需要取放料,且料架已准备好
if (outMsg.Equals(""))
{
ClearWarnMsg("getLocation");
MoveInfo.log("获取位置成功:" + CurrTray.ToStr());
}
else
{
ErrMsgTxt = " getLocation " + outMsg;
}
break;
}
}
});
}
}
catch (Exception ex)
{
LogUtil.error("IN03_GetPos 扫码出错:", ex);
}
}
private void ClearWarnMsg(string v)
{
if (ErrMsgTxt.Contains(v))
{
ErrMsgTxt = "";
}
}
bool movelock = false;
internal void Lock()
{
movelock = true;
}
internal void Unlock()
{
movelock = false;
}
}
}
......@@ -12,102 +12,6 @@ using System.Threading.Tasks;
namespace DeviceLibrary
{
//[Serializable]
//public class ReelParam
//{
// /// <summary>
// /// 创建新出入库信息
// /// </summary>
// /// <param name="wareNo">二维码内容</param>
// /// <param name="platew">宽度</param>
// /// <param name="plateh">高度</param>
// /// <param name="IsNg">是否是入库NG料</param>
// /// <param name="ngMsg">NG消息</param>
// public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "")
// {
// WareCode = wareNo;
// PlateW = platew;
// PlateH = plateh;
// IsNg = _IsNg;
// NgMsg = ngMsg;
// }
// /// <summary>
// /// 物品二维码信息
// /// </summary>
// public string WareCode { get; set; }
// /// <summary>
// /// 库位号
// /// </summary>
// public string PosID { get; set; }
// public string bitmapfilename = "";
// public List<CodeInfo> codeInfos { get; set; }
// /// <summary>
// /// 料盘高度
// /// </summary>
// public int PlateH { get; set; }
// /// <summary>
// /// 料盘宽度
// /// </summary>
// public int PlateW { get; set; }
// /// <summary>
// /// 是否是入料NG料
// /// </summary>
// public bool IsNg = false;
// /// <summary>
// /// 入料NG消息
// /// </summary>
// public string NgMsg = "";
// /// <summary>
// /// 物料编码
// /// </summary>
// public string PN { get; set; }
// /// <summary>
// /// 数量
// /// </summary>
// public int QTY { get; set; } = 0;
// /// <summary>
// /// 厂家代码
// /// </summary>
// public string FC { get; set; }
// /// <summary>
// /// 唯一序列号
// /// </summary>
// public string RI { get; set; }
// /// <summary>
// /// 批次号
// /// </summary>
// public string Batch { get; set; }
// public bool ReelOnFixture { get; internal set; } = false;
// public int HeightPos = 0;
// public ReelParam clone()
// {
// ReelParam dstobject;
// using (MemoryStream mStream = new MemoryStream())
// {
// BinaryFormatter bf = new BinaryFormatter();
// bf.Serialize(mStream, this);
// mStream.Seek(0, SeekOrigin.Begin);//指定当前流的位置为流的开头。
// dstobject = (ReelParam)bf.Deserialize(mStream);
// mStream.Close();
// }
// return dstobject;
// }
// public string ToStr()
// {
// if (IsNg)
// {
// return crc.GetString(L.in_store_ng,"入库NG")+ $":{NgMsg}[{WareCode}]";
// }
// else
// {
// return crc.GetString(L.posnum, "库位号") + $":[{PosID}][{WareCode}] ";
// }
// }
//}
[Serializable]
class BoxStorePosition {
......
......@@ -121,7 +121,7 @@ namespace DeviceLibrary
var ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex];
var reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.InStore))
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AutoInOutTest = false;
......@@ -177,7 +177,7 @@ namespace DeviceLibrary
AIOTMoveInfo.log($"开始转运料盘第二盘");
ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 1];
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.InStore))
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AutoInOutTest = false;
......@@ -224,7 +224,7 @@ namespace DeviceLibrary
}
var ac2 = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 2];
reel = new ReelParam("auto", ac2.BagWidth, ac2.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac1, reel), new BoxStorePosition(Config, ac2, reel), StoreMoveType.InStore))
if (!boxTransport.Start(new BoxStorePosition(Config, ac1, reel), new BoxStorePosition(Config, ac2, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AutoInOutTest = false;
......
......@@ -76,5 +76,15 @@ namespace DeviceLibrary
LogUtil.info("按下启动按钮");
ProcessMsgEvent?.Invoke(Msg.get());
}
private void LeftNgDoorOpen()
{
clearNgPos("NG_1");
}
private void RightNgDoorOpen()
{
clearNgPos("NG_7");
}
}
}
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
namespace DeviceLibrary
{
partial class MainMachine
{
private bool canStartMove()
{
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
{
Msg.add(crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
return false;
}
else
{
Msg.add(crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning);
return false;
}
}
return true;
}
void StoreProcess()
{
if (CheckWait(StoreMoveInfo))
return;
//常规上料扫码流程
switch (StoreMoveInfo.MoveStep)
{
case MoveStep.Wait:
foreach (InReelBean inReel in inReelBeans)
{
if (inReel.ReelReady())
{
TrayInfo tray = inReel.CurrTray;
//取料
if (tray.ngReel)
{
//NG门关上再放料
if (IOManager.IOValue(IO_Type.Left_NGDoor_Close_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.Right_NGDoor_Close_Check).Equals(IO_VALUE.HIGH))
{
string ngPos = getNextNgPos();
if (ngPos == "")
{
//暂无NG空位
}
else
{
//送料到NG
StoreMoveInfo.NewMove(MoveStep.PutReel01_Ready);
StoreMoveInfo.MoveParam = new ReelParam(tray.barcode, tray.plateW, tray.plageH, inReel.PosName, ngPos, tray.ngReel, tray.ngMsg);
StoreMoveInfo.log("准备放料:" + StoreMoveInfo.MoveParam.ToStr());
break;
}
}
}
else
{
//获取料架
string pos = GetShelfPosId(tray);
}
}
}
break;
// //放料,准备放料
// PutReel01_Ready,
////放料:开始移库
//PutReel02_StartM,
////放料:等待取料完成
//PutReel03_GetReelEnd,
////放料:等待放料完成
//PutReel04_PutReelEnd,
////放料:放料全部结束
//PutReel05_End,
case MoveStep.PutReel01_Ready:
ACStorePosition startP = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.StartPos);
ACStorePosition targetP = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.TargetPos);
bool result = boxTransport.Start(new BoxStorePosition(Config, startP, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, targetP, StoreMoveInfo.MoveParam), StoreMoveType.PutReel, true);
if (result)
{
StoreMoveInfo.NewMove(MoveStep.PutReel02_StartM);
StoreMoveInfo.log("开始放料:" + StoreMoveInfo.MoveParam.ToStr());
}
break;
case MoveStep.PutReel02_StartM:
if (boxTransport.IsTakedReel)
{
StoreMoveInfo.NewMove(MoveStep.PutReel03_GetReelEnd);
StoreMoveInfo.log("取料完成:" + StoreMoveInfo.MoveParam.ToStr());
}
break;
case MoveStep.PutReel03_GetReelEnd:
if (boxTransport.IsPutOnOut|| boxTransport.IsComplateOrFree)
{
StoreMoveInfo.NewMove(MoveStep.PutReel04_PutReelEnd);
StoreMoveInfo.log("放料完成:" + StoreMoveInfo.MoveParam.ToStr());
//TODO 通知服务器
}
break;
case MoveStep.PutReel04_PutReelEnd:
if (boxTransport.IsComplateOrFree)
{
StoreMoveInfo.NewMove(MoveStep.PutReel05_End);
StoreMoveInfo.log("放料结束:" + StoreMoveInfo.MoveParam.ToStr());
}
break;
case MoveStep.PutReel05_End:
StoreMoveInfo.EndMove();
break;
default:
StoreMoveInfo.log($"未找到对应步骤:{StoreMoveInfo.MoveStep}");
break;
}
}
string StoreState()
{
string state = crc.GetString("Res0162", "空闲中");
if (StoreMoveInfo.MoveStep == MoveStep.PutReel01_Ready)
{
state = crc.GetString("Res0072","准备放料") + ":[]->[" + StoreMoveInfo.MoveParam.TargetPos+"]";
}
else if (StoreMoveInfo.MoveStep >= MoveStep.PutReel03_GetReelEnd)
{
state = crc.GetString("Res0163", "取料中") + ":" + StoreMoveInfo.MoveParam.TargetPos;
}
else if (StoreMoveInfo.MoveStep >= MoveStep.PutReel05_End)
{
state = crc.GetString("Res0164", "放料中") + ":" + StoreMoveInfo.MoveParam.TargetPos;
}
return state;
}
}
}
\ No newline at end of file
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
public bool IsInStoreReady
{
get => IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.HIGH)
|| StoreMoveInfo.MoveStep == MoveStep.Wait || StoreMoveInfo.MoveStep == MoveStep.InWaitServerCallback;
}
StoreJobList OutStoreJobList = new StoreJobList("");
public void AddOutStoreTask(string warecode, string posId, int plateW, int plateH)
{
JobInfo jobInfo = new JobInfo(warecode, posId, plateW, plateH);
OutStoreJobList.Enqueue(jobInfo);
LogUtil.info($"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}");
}
void StoreProcess()
{
if (CheckWait(StoreMoveInfo))
return;
//常规上料扫码流程
switch (StoreMoveInfo.MoveStep)
{
case MoveStep.Wait:
//判断有没有出库任务, 需要入库空闲, 出口空闲
if (OutStoreJobList.Count > 0 && boxTransport.IsComplateOrFree)
{
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
{
Msg.add(crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
}
else
Msg.add(crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查"), MsgLevel.warning);
return;
}
else
boxTransport.IgnoreX09 = false;
if (OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut10);
StoreMoveInfo.MoveParam.WareCode = jobInfo.WareNum;
StoreMoveInfo.MoveParam.PosID = jobInfo.PosId;
StoreMoveInfo.MoveParam.PlateH = jobInfo.plateH;
StoreMoveInfo.MoveParam.PlateW = jobInfo.plateW;
StoreMoveInfo.MoveParam.IsNg = jobInfo.isNG;
StoreMoveInfo.MoveParam.NgMsg = jobInfo.NgMsg;
Setting_Init.Runtime_IsInStore = false;
Setting_Init.Runtime_PosID = StoreMoveInfo.MoveParam.PosID;
Setting_Init.Runtime_PlateH = StoreMoveInfo.MoveParam.PlateH;
Setting_Init.Runtime_PlateW = StoreMoveInfo.MoveParam.PlateW;
Setting_Init.Runtime_WareCode = StoreMoveInfo.MoveParam.WareCode;
Setting_Init.Runtime_IsNg = StoreMoveInfo.MoveParam.IsNg;
Setting_Init.Runtime_NgMsg = StoreMoveInfo.MoveParam.NgMsg;
StoreMoveInfo.log($"开始出库任务:" + jobInfo.ToStr());
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
return;
}
}
break;
case MoveStep.InWaitServerCallback:
if (StoreMoveInfo.IsTimeOut(10))
{
StoreMoveInfo.log("入口料盘,获取库位失败");
StoreMoveInfo.MoveParam.IsNg = true;
StoreMoveInfo.MoveParam.NgMsg = $"[{CID}]" + crc.GetString("Res0018","无信息物料");
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut_WaitMT);
}
break;
case MoveStep.StoreIn01:
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreExecute))
{
Msg.add(crc.GetString("Res0156", "服务器连接异常"), MsgLevel.warning);
return;
}
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn02);
break;
case MoveStep.StoreIn02:
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
var ac = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
if (ac == null)
{
StoreMoveInfo.log($"找不到库位:" + StoreMoveInfo.MoveParam.PosID);
}
boxTransport.Start(new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true);
StoreMoveInfo.log($"开始转运料盘");
break;
case MoveStep.StoreIn03:
if (boxTransport.IsTakedReel)
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn04);
StoreMoveInfo.log($"料盘已取走");
}
else
{
Msg.add(crc.GetString("Res0154", "单料口等待料盘离开."), MsgLevel.info);
}
break;
case MoveStep.StoreIn04:
if (boxTransport.IsPutOnOut)
{
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd))
{
StoreMoveInfo.CanWhileCount--;
///Msg.add(crc.GetString("Res0156", "服务器连接异常"), MsgLevel.warning);
if (StoreMoveInfo.CanWhileCount>0)
return;
StoreMoveInfo.log($"服务器连接异常");
}
StoreMoveInfo.log($"料盘已到达目的地");
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn05);
}
else
{
Msg.add(crc.GetString("Res0157", "等待料盘送到指定位置."), MsgLevel.info);
}
break;
case MoveStep.StoreIn05:
if (boxTransport.IsComplateOrFree)
{
StoreMoveInfo.log($"料盘已到达目的地");
if (!ServerCM.tryposQuery(StoreMoveInfo.MoveParam.PosID,""))
{
StoreMoveInfo.log($"无法确认入库成功NG处理");
JobInfo jobInfo = new JobInfo(StoreMoveInfo.MoveParam.WareCode, StoreMoveInfo.MoveParam.PosID, StoreMoveInfo.MoveParam.PlateW, StoreMoveInfo.MoveParam.PlateH);
jobInfo.isNG=true;
jobInfo.NgMsg= "Inbound confirmation failed.";
OutStoreJobList.Enqueue(jobInfo);
}
StoreMoveInfo.EndMove();
OutStoreJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID);
}
break;
default:
StoreMoveInfo.log($"未找到对应步骤:{StoreMoveInfo.MoveStep}");
break;
}
}
string StoreState()
{
string state = crc.GetString("Res0162", "空闲中");
if (StoreMoveInfo.MoveStep == MoveStep.WaitInStore)
{
state = crc.GetString("Res0072","等待入库物料") + ":" + StoreMoveInfo.MoveParam.PosID;
}
else if (StoreMoveInfo.MoveStep >= MoveStep.StoreOut10)
{
state = crc.GetString("Res0163", "出库中") + ":" + StoreMoveInfo.MoveParam.PosID;
}
else if (StoreMoveInfo.MoveStep >= MoveStep.StoreIn01)
{
state = crc.GetString("Res0164", "入库中") + ":" + StoreMoveInfo.MoveParam.PosID;
}
return state;
}
}
}
\ No newline at end of file
......@@ -113,7 +113,7 @@ namespace DeviceLibrary
}
string lastmsg = "";
public void log(string msg) {
msg = $"[{Name}][{moveStep}][{MoveParam.PosID}-{MoveParam.WareCode}]{msg}";
msg = $"[{Name}][{moveStep}][{MoveParam.TargetPos}-{MoveParam.WareCode}]{msg}";
if (String.Compare(lastmsg,msg, StringComparison.Ordinal)!=0)
{
......@@ -381,11 +381,11 @@ namespace DeviceLibrary
/// <summary>
/// 入库
/// </summary>
InStore = 1,
PutReel = 1,
/// <summary>
/// 出库
/// </summary>
OutStore = 2,
OutStore=2,
/// <summary>
/// 原点返回
/// </summary>
......@@ -393,14 +393,6 @@ namespace DeviceLibrary
/// <summary>
/// 重置
/// </summary>
StoreReset = 4,
///// <summary>
///// 移栽装置的停止,需要先远点返回,然后停止
///// </summary>
//StopMove=5,
///// <summary>
///// 移栽检测托盘
///// </summary>
//CheckFixture=6,
StoreReset = 4,
}
}
\ No newline at end of file
......@@ -113,7 +113,16 @@ namespace DeviceLibrary
Out11,
OutReset,
//放料,准备放料
PutReel01_Ready,
//放料:开始移库
PutReel02_StartM,
//放料:等待取料完成
PutReel03_GetReelEnd,
//放料:等待放料完成
PutReel04_PutReelEnd,
//放料:放料全部结束
PutReel05_End,
StoreIn01, //入库
......@@ -160,7 +169,61 @@ namespace DeviceLibrary
StoreTS16,
StoreTS17,
StoreTS_WaitOutProcess,
StoreTS_Continue
StoreTS_Continue,
//复位:定位气缸下降
SR01_LocationDown,
//出料口:AGV检测到小车
S01_AgvDetect,
//电机正传
S02_LineFRun,
//料架到位
//S03_Shelf_Front_Check,
//等待1秒后停止电机正传,
S04_WaitTime,
//定位气缸上升,
S05_LocationUp,
//读取RFID,
S06_ReadRFID,
//料架准备好,可放料,
S10_ShelfReady,
//放料中
S11_PutReel,
//料架需要离开
S21_ShelfNeedLeave,
//呼叫agv拉料
S22_WaitAGV,
//agv到位
S23_AgvDetect,
//定位气缸下降
S24_LocationDown,
//电机反转
S25_LineRRun,
//等待前端料格检测 On变OFF
S26_ShelfBackHigh,
//等待前端料格检测 On变OFF
S27_ShelfBackLow,
//电机反转延时2秒OFF
S28_WaitTime,
//料盘:等待信号检测
IN01_WaitCheck,
//料盘:扫码
IN02_ScanCode,
//料盘:获取库位号
IN03_GetPos,
//料盘:料盘已准备好,等待取料
IN05_ReelReady,
//料盘:料盘已拿走
IN06_ReelLeave,
}
......
......@@ -76,7 +76,7 @@ namespace DeviceLibrary
To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}");
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
MoveInfo.MoveParam.TargetPos = $"NA=>{To.posid}";
}
else
{
......@@ -87,7 +87,7 @@ namespace DeviceLibrary
MoveInfo.NewMove(MoveStep.StoreTS01);
MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}");
MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}";
MoveInfo.MoveParam.TargetPos = $"{From.posid}=>{To.posid}";
MoveInfo.MoveParam.ReelOnFixture = From.Reel.ReelOnFixture;
}
if (To.posid == BoxStorePosition.ngdoor)
......@@ -252,7 +252,7 @@ namespace DeviceLibrary
IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS16);
MoveInfo.log($"{storeMoveType}:安全检查");
InOutEndProcess(StoreMoveType.InStore, To.posid);
InOutEndProcess(StoreMoveType.PutReel, To.posid);
}
break;
case MoveStep.StoreTS16:
......
......@@ -3,6 +3,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
......@@ -166,6 +167,23 @@ namespace DeviceLibrary
else
LogUtil.info("用户取消忽略安全光栅");
}
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
{
watch.Restart();
return false;
}
else if (watch.ElapsedMilliseconds >= targetMs)
{
if (isStop)
{
watch.Stop();
}
return true;
}
return false;
}
}
public enum StoreType {
......
......@@ -54,7 +54,7 @@ DO,0,出料口2电机反转,U2_Moto_Rwd,8,HC,Y08,,,,,,,,,,
DO,0,出料口3电机正转,U3_Moto_Fwd,9,HC,Y09,,,,,,,,,,
DO,0,出料口3电机反转,U3_Moto_Rwd,10,HC,Y10,,,,,,,,,,
DO,0,出料口4电机正转,U4_Moto_Fwd,11,HC,Y11,,,,,,,,,,
DO,0,出料口4电机反转,U5_Moto_Rwd,12,HC,Y12,,,,,,,,,,
DO,0,出料口4电机反转,U4_Moto_Rwd,12,HC,Y12,,,,,,,,,,
DO,0,出料口1定位上升,U1_Location_Up,13,HC,Y13,,,,,,,,,,
DO,0,出料口1定位下降,U1_Location_Down,14,HC,Y14,,,,,,,,,,
DO,0,出料口2定位上升,U2_Location_Up,15,HC,Y15,,,,,,,,,,
......
......@@ -7,7 +7,7 @@ using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class StorePostionBase
{
{
/// <summary>
/// 位置
/// </summary>
......
......@@ -196,9 +196,9 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
public static string U4_Moto_Fwd = "U4_Moto_Fwd";
/// <summary>
/// DO,0,出料口4电机反转,U5_Moto_Rwd,12,HC,Y12,,,,,,,,,,
/// DO,0,出料口4电机反转,U4_Moto_Rwd,12,HC,Y12,,,,,,,,,,
/// </summary>
public static string U5_Moto_Rwd = "U5_Moto_Rwd";
public static string U4_Moto_Rwd = "U4_Moto_Rwd";
}
public enum IO_VALUE
......
......@@ -35,49 +35,58 @@ namespace TheMachine
this.btn_stop = new System.Windows.Forms.Button();
this.cylinderButton7 = new TheMachine.CylinderButton();
this.ioControl1 = new TheMachine.IOControl();
this.btnLocationStop = new System.Windows.Forms.Button();
this.btnDown = new System.Windows.Forms.Button();
this.btnUp = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// cb_motolist
//
this.cb_motolist.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_motolist.Font = new System.Drawing.Font("新宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cb_motolist.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cb_motolist.FormattingEnabled = true;
this.cb_motolist.Location = new System.Drawing.Point(565, 230);
this.cb_motolist.Name = "cb_motolist";
this.cb_motolist.Size = new System.Drawing.Size(224, 24);
this.cb_motolist.Size = new System.Drawing.Size(267, 29);
this.cb_motolist.TabIndex = 2;
//
// btn_fwd
//
this.btn_fwd.BackColor = System.Drawing.Color.White;
this.btn_fwd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_fwd.Location = new System.Drawing.Point(566, 260);
this.btn_fwd.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_fwd.Location = new System.Drawing.Point(566, 272);
this.btn_fwd.Name = "btn_fwd";
this.btn_fwd.Size = new System.Drawing.Size(67, 33);
this.btn_fwd.Size = new System.Drawing.Size(126, 33);
this.btn_fwd.TabIndex = 3;
this.btn_fwd.Text = "正转";
this.btn_fwd.UseVisualStyleBackColor = true;
this.btn_fwd.Text = "电机正转";
this.btn_fwd.UseVisualStyleBackColor = false;
this.btn_fwd.Click += new System.EventHandler(this.btn_fwd_Click);
//
// btn_rwd
//
this.btn_rwd.BackColor = System.Drawing.Color.White;
this.btn_rwd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_rwd.Location = new System.Drawing.Point(644, 260);
this.btn_rwd.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_rwd.Location = new System.Drawing.Point(566, 311);
this.btn_rwd.Name = "btn_rwd";
this.btn_rwd.Size = new System.Drawing.Size(67, 33);
this.btn_rwd.Size = new System.Drawing.Size(126, 33);
this.btn_rwd.TabIndex = 3;
this.btn_rwd.Text = "反转";
this.btn_rwd.UseVisualStyleBackColor = true;
this.btn_rwd.Text = "电机反转";
this.btn_rwd.UseVisualStyleBackColor = false;
this.btn_rwd.Click += new System.EventHandler(this.btn_rwd_Click);
//
// btn_stop
//
this.btn_stop.BackColor = System.Drawing.Color.White;
this.btn_stop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_stop.Location = new System.Drawing.Point(722, 260);
this.btn_stop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_stop.Location = new System.Drawing.Point(566, 350);
this.btn_stop.Name = "btn_stop";
this.btn_stop.Size = new System.Drawing.Size(67, 33);
this.btn_stop.Size = new System.Drawing.Size(126, 33);
this.btn_stop.TabIndex = 3;
this.btn_stop.Text = "停止";
this.btn_stop.UseVisualStyleBackColor = true;
this.btn_stop.Text = "电机停止";
this.btn_stop.UseVisualStyleBackColor = false;
this.btn_stop.Click += new System.EventHandler(this.btn_stop_Click);
//
// cylinderButton7
......@@ -106,9 +115,51 @@ namespace TheMachine
this.ioControl1.Tag = "not";
this.ioControl1.Load += new System.EventHandler(this.ioControl1_Load);
//
// btnLocationStop
//
this.btnLocationStop.BackColor = System.Drawing.Color.White;
this.btnLocationStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLocationStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationStop.Location = new System.Drawing.Point(706, 350);
this.btnLocationStop.Name = "btnLocationStop";
this.btnLocationStop.Size = new System.Drawing.Size(126, 33);
this.btnLocationStop.TabIndex = 4;
this.btnLocationStop.Text = "定位停止";
this.btnLocationStop.UseVisualStyleBackColor = false;
this.btnLocationStop.Click += new System.EventHandler(this.btnLocationStop_Click);
//
// btnDown
//
this.btnDown.BackColor = System.Drawing.Color.White;
this.btnDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDown.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDown.Location = new System.Drawing.Point(706, 311);
this.btnDown.Name = "btnDown";
this.btnDown.Size = new System.Drawing.Size(126, 33);
this.btnDown.TabIndex = 5;
this.btnDown.Text = "定位下降";
this.btnDown.UseVisualStyleBackColor = false;
this.btnDown.Click += new System.EventHandler(this.btnDown_Click);
//
// btnUp
//
this.btnUp.BackColor = System.Drawing.Color.White;
this.btnUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUp.Location = new System.Drawing.Point(706, 272);
this.btnUp.Name = "btnUp";
this.btnUp.Size = new System.Drawing.Size(126, 33);
this.btnUp.TabIndex = 6;
this.btnUp.Text = "定位上升";
this.btnUp.UseVisualStyleBackColor = false;
this.btnUp.Click += new System.EventHandler(this.btnUp_Click);
//
// IOControls
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.btnLocationStop);
this.Controls.Add(this.btnDown);
this.Controls.Add(this.btnUp);
this.Controls.Add(this.btn_stop);
this.Controls.Add(this.btn_rwd);
this.Controls.Add(this.btn_fwd);
......@@ -130,5 +181,8 @@ namespace TheMachine
private System.Windows.Forms.Button btn_fwd;
private System.Windows.Forms.Button btn_rwd;
private System.Windows.Forms.Button btn_stop;
private System.Windows.Forms.Button btnLocationStop;
private System.Windows.Forms.Button btnDown;
private System.Windows.Forms.Button btnUp;
}
}
......@@ -34,8 +34,8 @@ namespace TheMachine
private void ioControl1_Load(object sender, EventArgs e)
{
for (int i = 1;i<=5; i++)
cb_motolist.Items.Add(new KeyValuePair<string, string>($"出料口{i}电机正转", i.ToString()));
for (int i = 1;i<=4; i++)
cb_motolist.Items.Add(new KeyValuePair<string, string>($"出料口_U{i}", i.ToString()));
cb_motolist.SelectedIndex = 0;
}
......@@ -69,5 +69,30 @@ namespace TheMachine
LogUtil.info($"手动点击 U{u.Value} 电机停止");
}
private void btnUp_Click(object sender, EventArgs e)
{
var u = (KeyValuePair<string, string>)cb_motolist.SelectedItem;
IOManager.IOMove($"U{u.Value}_Location_Up", IO_VALUE.HIGH);
IOManager.IOMove($"U{u.Value}_Location_Down", IO_VALUE.LOW);
LogUtil.info($"手动点击 U{u.Value} 定位上升");
}
private void btnDown_Click(object sender, EventArgs e)
{
var u = (KeyValuePair<string, string>)cb_motolist.SelectedItem;
IOManager.IOMove($"U{u.Value}_Location_Down", IO_VALUE.HIGH);
IOManager.IOMove($"U{u.Value}_Location_Up", IO_VALUE.LOW);
LogUtil.info($"手动点击 U{u.Value} 定位下降");
}
private void btnLocationStop_Click(object sender, EventArgs e)
{
var u = (KeyValuePair<string, string>)cb_motolist.SelectedItem;
IOManager.IOMove($"U{u.Value}_Location_Up", IO_VALUE.LOW);
IOManager.IOMove($"U{u.Value}_Location_Down", IO_VALUE.LOW);
LogUtil.info($"手动点击 U{u.Value} 定位停止");
}
}
}
......@@ -49,7 +49,7 @@ namespace TheMachine
{
InitializeComponent();
Setting_Init.Device_DisableUpdownProtect=false;
positionConfigFile = Path.Combine(appPath, "StoreConfig\\linePositions.csv");
positionConfigFile = Path.Combine(appPath, "config\\Magzine.csv");
}
public void Init()
......@@ -75,7 +75,7 @@ namespace TheMachine
//LogUtil.info($"出入库完成状态:{arg2},库位:{arg1}");
int InStoreCheck = 0;
int OutStoreCheck = 0;
if (arg2 == StoreMoveType.InStore)
if (arg2 == StoreMoveType.PutReel)
InStoreCheck = 1;
else if (arg2 == StoreMoveType.OutStore)
OutStoreCheck = 1;
......@@ -209,14 +209,20 @@ namespace TheMachine
{
currentRowIndex = 0;
currentColIndex++;
string headerText = crc.GetString("Res0090", "其他取放料口");
lastAB = ab;
string[] posArray = posname.Split('_');
if (posArray.Length >= 2)
{
headerText = posArray[0];
}
//if (posname.StartsWith("L"))
//{
// dataGridView1.Columns[currentColIndex].HeaderText = crc.GetString(memo, memo) + "(" + posname.Substring(0, 2) + ")";
//}
//else
{
dataGridView1.Columns[currentColIndex].HeaderText = crc.GetString("Res0090", "其他取放料口");
dataGridView1.Columns[currentColIndex].HeaderText = headerText;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!