Commit a413bcc3 LN

升降盘P3增加详细位置配置

1 个父辈 73f9bc4a
...@@ -63,6 +63,7 @@ namespace OnlineStore.AssemblyLine ...@@ -63,6 +63,7 @@ namespace OnlineStore.AssemblyLine
lblName.Text = equipBean.Name; lblName.Text = equipBean.Name;
this.Text = equipBean.Name; this.Text = equipBean.Name;
LoadDP2(); LoadDP2();
LoadDP3();
LoadDOBtn(groupDO); LoadDOBtn(groupDO);
if (equipBean.OnlyProOutTray) if (equipBean.OnlyProOutTray)
...@@ -524,7 +525,27 @@ namespace OnlineStore.AssemblyLine ...@@ -524,7 +525,27 @@ namespace OnlineStore.AssemblyLine
lblP2.Text = "P2列表:" + equipBean.Config.UpDownP2List; lblP2.Text = "P2列表:" + equipBean.Config.UpDownP2List;
lblP3List.Text = "P3列表:" + equipBean.Config.UpDownP3List; lblP3List.Text = "P3列表:" + equipBean.Config.UpDownP3List;
} }
private void LoadDP3()
{
cmbP3Height.Items.Clear();
foreach (int heigth in LineManager.GetTrayList())
{
cmbP3Height.Items.Add(heigth);
}
cmbP3Width.Items.Clear();
cmbP3Width.Items.AddRange(new object[] { 7, 11, 13, 15 });
cmbP3Width.SelectedIndex = 0;
cmbP3Height.SelectedIndex = 0;
listP3.Items.Clear();
Dictionary<string, int> DP3Map = equipBean.Config.LoadP3DetialMap();
foreach (string key in DP3Map.Keys)
{
listP3.Items.Add(key + "=" + DP3Map[key]);
}
txtlP3.Text = txtP3.Text;
}
private void btnDSave_Click(object sender, EventArgs e) private void btnDSave_Click(object sender, EventArgs e)
{ {
...@@ -715,6 +736,47 @@ namespace OnlineStore.AssemblyLine ...@@ -715,6 +736,47 @@ namespace OnlineStore.AssemblyLine
txtPosId.Clear(); txtPosId.Clear();
} }
} }
private void cmbP3Width_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
if (cmbP3Width.SelectedIndex < 0 || cmbP3Height.SelectedIndex < 0)
{
return;
}
int size = Convert.ToInt32(cmbP3Width.Text);
int height = Convert.ToInt32(cmbP3Height.Text);
int position = equipBean.Config.GetUpdownP3Detial(height, size);
txtlP3.Text = position.ToString();
}
private void btnP3Save_Click(object sender, EventArgs e)
{
int size = Convert.ToInt32(cmbP3Width.Text);
int height = Convert.ToInt32(cmbP3Height.Text);
int position = FormUtil.GetIntValue(txtlP3);
DialogResult result = MessageBox.Show("保存后只能修改不能删除,是否确定保存?", "确定保存", MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
equipBean.Config.UpdateUpdownP3Detial(size, height, position);
LineManager.SaveMoveEquipConfig(equipBean.Config);
LogUtil.info(equipBean.Name + "用户操作:尺寸:" + size + ",高度:" + height + ",P3值:" + position + ",保存成功");
MessageBox.Show("保存成功!");
listP3.Items.Clear();
Dictionary<string, int> DP3Map = equipBean.Config.LoadP3DetialMap();
foreach (string key in DP3Map.Keys)
{
listP3.Items.Add(key + "=" + DP3Map[key]);
}
}
}
} }
} }
......
...@@ -8,6 +8,7 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,8000,, ...@@ -8,6 +8,7 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,8000,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=8000;,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=8000;,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,, PRO,0,移栽上下轴P1速度,UpdownAxis_P1Speed,400,,
PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,300,, PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,300,,
PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,300,, PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,300,,
\ No newline at end of file \ No newline at end of file
...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,,,,,,,,,,, ...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,,,,,,,,,,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,,,,,,,,,,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,,,,,,,,,,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,,,,,,,,,,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,,,,,,,,,,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,,,,,,,,,,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,,,,,,,,,,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,, ...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
\ No newline at end of file \ No newline at end of file
...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,, ...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
\ No newline at end of file \ No newline at end of file
...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,, ...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
\ No newline at end of file \ No newline at end of file
...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,, ...@@ -8,3 +8,4 @@ PRO,0,移栽上下轴待机点 P1,UpDownAxisP1,100,,
PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,, PRO,0,移栽上下轴流水线上方位置P2,UpDownP2List,0=8000,,
PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,, PRO,0,移栽上下轴料仓门口位置P3,UpDownP3List,0=9000,,
PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,, PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,7X8=8000,,
PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
\ No newline at end of file \ No newline at end of file
...@@ -311,12 +311,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -311,12 +311,12 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down); CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
} }
} }
private void UpdownDownP3Move(int trayHeight) private void UpdownDownP3Move(int trayHeight, int traySize)
{ {
if (UseAxis) if (UseAxis)
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int position = Config.GetUpdownP3(trayHeight); int position = Config.GetUpdownP3Detial(trayHeight, traySize);
UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P3Speed); UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P3Speed);
} }
else else
......
...@@ -283,7 +283,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -283,7 +283,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 "); OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 ");
UpdownDownP3Move(MoveInfo.MoveParam.PlateH); UpdownDownP3Move(MoveInfo.MoveParam.PlateH,MoveInfo.MoveParam.PlateW);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down); // CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
} }
else else
...@@ -324,7 +324,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -324,7 +324,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MO_52_CylinderDown);
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 "); OutLog("出库 " + MoveInfo.SLog + ": 上下气缸下降 ");
UpdownDownP3Move(MoveInfo.MoveParam.PlateH); UpdownDownP3Move(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
} }
else if (MoveInfo.IsStep(LineMoveStep.MO_55_CylinderUp)) else if (MoveInfo.IsStep(LineMoveStep.MO_55_CylinderUp))
{ {
...@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(LineMoveStep.MI_11_CylinderDown); MoveInfo.NextMoveStep(LineMoveStep.MI_11_CylinderDown);
InLog("入库 " + MoveInfo.SLog + " ,上下气缸下降"); InLog("入库 " + MoveInfo.SLog + " ,上下气缸下降");
UpdownDownP3Move(MoveInfo.MoveParam.PlateH); UpdownDownP3Move(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
} }
else else
{ {
......
...@@ -82,6 +82,13 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -82,6 +82,13 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary> /// </summary>
[ConfigProAttribute("UpDownP2DetialList", false)] [ConfigProAttribute("UpDownP2DetialList", false)]
public string UpDownP2DetialList { get; set; } public string UpDownP2DetialList { get; set; }
/// <summary>
/// PRO,0,移栽上下轴仓门口取放点P3详细位置,UpDownP3DetialList,0X0=0;,,
/// </summary>
[ConfigProAttribute("UpDownP3DetialList", false)]
public string UpDownP3DetialList { get; set; }
#region P2
private Dictionary<string, int> UpdownP2DetialMap = null; private Dictionary<string, int> UpdownP2DetialMap = null;
...@@ -153,6 +160,81 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -153,6 +160,81 @@ namespace OnlineStore.LoadCSVLibrary
UpDownP2DetialList = newPositionStr; UpDownP2DetialList = newPositionStr;
} }
#endregion
#region P3
private Dictionary<string, int> UpdownP3DetialMap = null;
public Dictionary<string, int> LoadP3DetialMap()
{
try
{
if (UpdownP3DetialMap == null)
{
UpdownP3DetialMap = new Dictionary<string, int>();
string[] arrayList = UpDownP3DetialList.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('=');
if (arrStr.Length == 2)
{
string key = arrStr[0].Trim().ToUpper();
if (key.Equals("0X0"))
{
continue;
}
int length = Convert.ToInt32(arrStr[1].Trim());
UpdownP3DetialMap.Add(key, length);
}
}
}
}
catch (Exception ex)
{
}
return UpdownP3DetialMap;
}
public int GetUpdownP3Detial(int trayHeight, int traySize = 8)
{
LoadP3DetialMap();
string fkey = traySize + "X" + trayHeight;
if (UpdownP3DetialMap.ContainsKey(fkey))
{
return UpdownP3DetialMap[fkey];
}
else
{
return GetUpdownP3(trayHeight);
}
return -1;
}
public void UpdateUpdownP3Detial(int size, int height, int sizePosition)
{
string fkey = size + "X" + height;
string newPositionStr = "";
if (UpdownP3DetialMap.ContainsKey(fkey))
{
UpdownP3DetialMap[fkey] = sizePosition;
}
else
{
UpdownP3DetialMap.Add(fkey, sizePosition);
}
foreach (string key in UpdownP3DetialMap.Keys)
{
newPositionStr += key + "=" + UpdownP3DetialMap[key] + ";";
}
newPositionStr = newPositionStr.Substring(0, newPositionStr.Length - 1);
UpDownP3DetialList = newPositionStr;
}
#endregion
public void ConfigSpeed(Line_Config config) public void ConfigSpeed(Line_Config config)
{ {
if (this.UpdownAxis_P1Speed <= 0) if (this.UpdownAxis_P1Speed <= 0)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!