Commit 3f972f3f 刘韬

添加校准库位

1 个父辈 0611b64c
......@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore 83e877cb53ebc04ada5946366bce97c40db9a113")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore 0611b64cd55529e2d6f26d9a2b0f7b8a6a22700d")]
[assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
......
......@@ -131,7 +131,14 @@ namespace OnlineStore
}
public static Dictionary<string, string> LangName = new Dictionary<string, string>() {
{"zh-CN","简体中文" },
{"zh-TW","繁體中文" },
{ "en-US", "English" },
{ "ja-JP", "日本語" },
{ "fr-FR", "Français" },
{ "de-DE", "Deutsche" },
};
public static string GetChinaString(string id, params object[] param)
{
......
......@@ -111,6 +111,12 @@ namespace OnlineStore.ACSingleStore.useControl
public int col;
}
int PosCompare(string a, string b) {
if (a.StartsWith("fix"))
return -1;
if (b.StartsWith("fix"))
return 1;
string[] pa = a.Split('_');
string[] pb = b.Split('_');
......@@ -122,9 +128,16 @@ namespace OnlineStore.ACSingleStore.useControl
var pa1 = pa[1][0]+(pa[1][1].Equals('A') ? "1" : "2");
var pb1 = pb[1][0] + (pb[1][1].Equals('A') ? "1" : "2");
var pa2 = pa[2].Length==2? (pa[2][1].Equals('A') ? "1" : "2")+ pa[2][0] : pa[2];
var pb2 = pb[2].Length == 2 ? (pb[2][1].Equals('A') ? "1" : "2")+ pb[2][0] : pb[2];
var pa2 = pa[2];
var pb2 = pb[2];
if (pa[2].Length == 2 && pb[2].Length == 2)
{
if ((pa[2][1].Equals('A') || pa[2][1].Equals('B')) && (pb[2][1].Equals('A') || pb[2][1].Equals('B')))
{
pa2 = (pa[2][1].Equals('A') ? "1" : "2") + pa[2][0];
pb2 = (pb[2][1].Equals('A') ? "1" : "2") + pb[2][0];
}
}
var isa = Regex.Replace(pa[1], @"[^\d]*", "") + pa1 + pa2 + pa[3].PadLeft(2, '0');
var isb = Regex.Replace(pb[1], @"[^\d]*", "") + pb1 + pb2 + pb[3].PadLeft(2, '0');
......@@ -207,12 +220,22 @@ namespace OnlineStore.ACSingleStore.useControl
int ci = store.PositionNumList.Count-1 - i;
string posname = store.PositionNumList[ci];
if (posname.StartsWith("fix"))
continue;
string[] _posstr = posname.Split('_');
int col = int.Parse(Regex.Replace(_posstr[1], @"[^\d]*", ""));
string ab = "A";
if (_posstr[2].Length>1)
ab= _posstr[2][1].ToString();
if (ab != "A" && ab != "B")
{
if (ab == "1")
ab = "A";
else if (ab == "2")
ab = "B";
else
ab = "A";
}
if (col != lastcol || lastAB!= ab)
currentRowIndex = 0;
......@@ -251,6 +274,25 @@ namespace OnlineStore.ACSingleStore.useControl
}
if (dataGridView1.SelectedCells.Count>0)
setData(dataGridView1.SelectedCells[0].Tag.ToString());
if (store.PositionNumList[0].StartsWith("fix")) {
int RowIndex = 0;
if (dataGridView1[0, dataGridView1.RowCount - 2].Value == null)
{
RowIndex = dataGridView1.RowCount - 2;
}
else if (dataGridView1[0, dataGridView1.RowCount - 1].Value == null)
{
dataGridView1.Rows.Add();
RowIndex = dataGridView1.RowCount - 2;
}
var posname = store.PositionNumList[0];
dataGridView1[0, RowIndex].Value = posname;
dataGridView1[0, RowIndex].Tag = posname;
htpp.Add(posname, new PosPos() { Posid = posname, index = 0, row = RowIndex, col = 0 });
}
dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1);
setData(store.PositionNumList.Last());
}
......
......@@ -120,6 +120,9 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="StoreConfig\AC\linePositions - 复制.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\AC\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......
......@@ -598,6 +598,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
bool fixturestates = false;
LineMoveP movePfix = new LineMoveP();
protected override void OutStoreProcess()
{
if (!DoorIsClose() && IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
......@@ -661,20 +662,97 @@ namespace OnlineStore.DeviceLibrary
{
HIKCamera.Current.CameraGrabOne(HIKCamera.Current.GetFixtureStateFilename(StoreMove.MoveParam, StoreMove.MoveType, FixtureState.Out));
fixturestates = IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH);
//if (Config.IsUse_Tray_Check.Equals(1))
//{
// StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckTray);
// OutStoreLog("出库:SO_07 等待TrayCheck_Fixture=High ");
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.HIGH));
//}
//else
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点), ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix)
{
var fixposid = $"fix#{StoreMove.MoveParam.PlagtW}";
var fixposition = CSVPositionReader<ACStorePosition>.GetPositon(fixposid);
OutStoreLog($"出库 获取修正库位置{fixposid}={fixposition}");
if (fixposition != null)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
OutStoreLog("出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点), ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
OutStoreLog($"出库 找到对应修正库位 获取修正库位置{fixposid}={fixposition}");
movePfix.ComPress_P1 = Config.CompressAxis_P1_Position;
movePfix.InOut_P1 = Config.InOutAxis_P1_Position;
movePfix.Middle_P1 = Config.MiddleAxis_P1_Position;
movePfix.InOut_P2 = fixposition.InOutAxis_DoorPosition_P2;
movePfix.UpDown_P1 = Config.UpDownAxis_DoorOPosition_P1;
movePfix.UpDown_P8 = Config.UpDownAxis_DoorIBPosition_P8;
movePfix.UpDown_P2 = Config.UpDownAxis_DoorIPosition_P2;
movePfix.UpDown_P7 = Config.UpDownAxis_DoorOBPosition_P7;
movePfix.ComPress_P2 = fixposition.CompressAxis_Position_P2;
if (int.TryParse(StoreMove.MoveParam.PlateH, out int plateh))
{
var h = Config.GetComP2(plateh);
if (h > 0)
movePfix.ComPress_P2 = h;
}
movePfix.ComPress_P3 = fixposition.CompressAxis_CPosition_P3;
movePfix.InOut_P3 = fixposition.InOutAxis_Position_P3;
movePfix.Middle_P2 = fixposition.MiddleAxis_Position_P2;
movePfix.UpDown_P3 = fixposition.UpDownAxis_IHPosition_P3;
movePfix.UpDown_P4 = fixposition.UpDownAxis_ILPosition_P4;
movePfix.UpDown_P5 = fixposition.UpDownAxis_OHPosition_P5;
movePfix.UpDown_P6 = fixposition.UpDownAxis_OLPosition_P6;
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_01);
}
else
{
OutStoreLog($"出库 未找到对应修正库位 获取修正库位置{fixposid}");
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckTray);
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_01)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_02);
InStoreLog("出库:库位修正,旋转轴至P2(修正库位点),升降轴至P3(修正库位入库前点) ");
ACAxisMove(Config.Middle_Axis, movePfix.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, movePfix.UpDown_P3, Config.UpDownAxis_P3_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_02)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_03);
InStoreLog("出库:库位修正 叉子进入库位中,进出轴至Fix(修正库位取放料点) ");
int InOutFixPos = 0;
ACAxisMove(Config.InOut_Axis, movePfix.InOut_P3 + InOutFixPos, Config.InOutAxis_P3_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_03)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_04);
InStoreLog("出库:库位修正 压紧轴释放,升降轴到P4 ");
ComMoveToPosition(movePfix.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, movePfix.UpDown_P4, Config.UpDownAxis_P4_Speed);
}
//else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_04_inoutp3)
//{
// StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_04);
// InStoreLog("出库:库位修正 进出轴到P3 ");
// ACAxisMove(Config.InOut_Axis, movePfix.InOut_P3, Config.InOutAxis_P3_Speed);
//}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_04)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_05);
InStoreLog("出库:库位修正 压紧轴压紧,升降轴到P6 ");
ComMoveToPosition(movePfix.ComPress_P2, Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, movePfix.UpDown_P6, Config.UpDownAxis_P6_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_05)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckTray);
InStoreLog("出库:库位修正 进出轴返回P1 ");
InOutBackToP1(moveP.InOut_P1);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckTray)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_08_ToDoorPosition);
......@@ -725,11 +803,11 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor);
OutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) ");
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor)
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PositionNum : "";
lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStorEnd;
......
......@@ -80,6 +80,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, "加载位置文件:" + positionConfigFile);
CSVPositionReader<ACStorePosition>.ReloadCSVFile(positionConfigFile);
}
var fixposfile = Path.Combine(Path.GetDirectoryName(positionConfigFile), @"FixPositions.csv");
if (File.Exists(fixposfile))
{
LogUtil.info(LOGGER, "加载校准位置文件:" + fixposfile);
CSVPositionReader<ACStorePosition>.AddCSVFile(fixposfile);
}
Config = (AC_SA_Config)storeConfig;
Store = new AC_SA_BoxBean(Config);
Store.CID = CID;
......
......@@ -228,7 +228,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
AddAxisMoveTime(moveAxis);
var HomeAddSpeed = moveAxis.HomeAddSpeed > 0 ? moveAxis.HomeAddSpeed : moveAxis.HomeHighSpeed * 6;
var HomeAddSpeed = moveAxis.HomeAddSpeed > 0 ? moveAxis.HomeAddSpeed : moveAxis.HomeHighSpeed * 8;
var HomeLowSpeed = moveAxis.HomeLowSpeed > 0 ? moveAxis.HomeLowSpeed : moveAxis.HomeHighSpeed / 10;
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, HomeLowSpeed, HomeAddSpeed);
......
......@@ -228,46 +228,52 @@ namespace OnlineStore.DeviceLibrary
/// 料仓出库,,所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
/// </summary>
SO_08_ToDoorPosition = 108,
SO_07_CheckFix ,
SO_07_CheckFix_01 ,
SO_07_CheckFix_02 ,
SO_07_CheckFix_03 ,
SO_07_CheckFix_04 ,
SO_07_CheckFix_05,
SO_07_CheckFix_06,
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
SO_09_LocationCylinder_Down = 109,
SO_09_LocationCylinder_Down,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_091_WaitNoTray=120,
SO_091_WaitNoTray,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_10_DeviceToDoor = 110,
SO_10_DeviceToDoor ,
/// <summary>
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
SO_11_DevicePutWare = 111,
SO_11_DevicePutWare,
/// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SO_12_DeviceOutFromDoor = 112,
SO_12_DeviceOutFromDoor,
/// <summary>
/// 料仓出库:等待叉子无料盘
/// </summary>
SO_13_CheckTray=113,
SO_13_CheckTray,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary>
SO_14_GoBack = 114,
SO_14_GoBack ,
/// <summary>
/// 等待拿走物品
/// </summary>
SO_15_WaitTake=115,
SO_15_WaitTake,
/// <summary>
/// 料仓出库。。。等待200毫秒再次验证料盘是否拿走
/// </summary>
SO_16_CheckIsTake=116,
SO_16_CheckIsTake,
SO_TakeReelFaile,
#endregion
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!