Commit c7e73822 LN

1

1 个父辈 9c7f139d
......@@ -36,8 +36,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDLL\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID">
<HintPath>..\..\DoubleLineClient_3D\dll\Asa.RFID.dll</HintPath>
<Reference Include="Asa.RFID.PuYue">
<HintPath>..\SharedDLL\Asa.RFID.PuYue.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.8485.20895, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -86,7 +86,6 @@
<Compile Include="DeviceLibrary\LiftMonitor.cs" />
<Compile Include="DeviceLibrary\LineRunMonitor.cs" />
<Compile Include="DeviceLibrary\ReelParam.cs" />
<Compile Include="DeviceLibrary\RFIDManager.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="theMachine\ReelTransport.cs" />
......
......@@ -72,6 +72,7 @@ namespace DeviceLibrary
public Dictionary<string, ReelParam> NgPosMap = new Dictionary<string, ReelParam>();
public MainMachine(Robot_Config _config) {
Config = _config;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
......
......@@ -124,17 +124,17 @@ namespace DeviceLibrary
//放料:放料全部结束
PutReel05_End,
StoreIn01, //入库
StoreIn02,
StoreIn03,
StoreIn04,
StoreIn05,
StoreIn06,
StoreIn07,
A01_WaitReel,
A01_Ready, //入库
A02_StartPutOne,
A03_WaitRee2,
A04_WaitOneComplate,
A05_StartPutTwo,
A06_WaitTwoEnd,
A07_NextPos,
StoreIn08,
StoreIn09,
StoreOut10, //出库
A10_LastPos, //出库
StoreOut_NGPre,
StoreOut11,
StoreOut12,
......
......@@ -12,24 +12,17 @@ namespace DeviceLibrary
{
public class OutShelfBean
{
public string Name;
public static PuYueRFID_C2S RFID = null;
public string Name;
MoveInfo MoveInfo;
public string WarnMsg = "";
/// <summary>
/// 出料口定位气缸,high=up,low=down
/// </summary>
private CylinderManger locationCylinder;
//public string currShelfRfid;
public ShelfInfo CurrShelf;
private CylinderManger locationCylinder;
public ShelfInfo CurrShelf;
public string rfidIp;
public OutShelfBean(string name )
{
this.Name = name;
......@@ -46,6 +39,12 @@ namespace DeviceLibrary
Moto_Rwd = ioStr + Moto_Rwd;
locationCylinder = new CylinderManger(name + "出料口定位", Location_Up, Location_Down);
RFID = new PuYueRFID_C2S(rfidIp);
if (!RFID.Open())
{
LogUtil.info(name + " RFID 打开失败:" + rfidIp);
}
#endregion
}
public void Reset()
......@@ -250,22 +249,14 @@ namespace DeviceLibrary
locationCylinder.ToHigh(MoveInfo);
}
break;
case MoveStep.S05_LocationUp:
MoveInfo.NextMoveStep(MoveStep.S06_ReadRFID);
MoveInfo.log("读取RFID");
ReadShelfId();
if (CurrShelf.rfid == "")
{
S21_ShelfNeedLeave("未读取到RFID");
}
else
{
MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
MoveInfo.log("料架已准备完成");
}
case MoveStep.S05_LocationUp:
S06_ReadRFID();
break;
case MoveStep.S06_ReadRFID:
S06_ReadRFID();
break;
case MoveStep.S10_ShelfReady:
if (CurrShelf.IsNeedLeave)
{
......@@ -343,18 +334,58 @@ namespace DeviceLibrary
return false;
}
private void S06_ReadRFID()
{
MoveInfo.NextMoveStep(MoveStep.S06_ReadRFID);
MoveInfo.log("读取RFID");
if (ReadShelfId())
{
if (CurrShelf.rfid == "")
{
S21_ShelfNeedLeave("未读取到RFID");
}
else
{
MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
MoveInfo.log("料架已准备完成");
}
}
else
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
}
private void S21_ShelfNeedLeave(string leaveMsg)
{
MoveInfo.NewMove(MoveStep.S21_ShelfNeedLeave);
locationCylinder.ToLow(MoveInfo);
MoveInfo.log("料架[" + CurrShelf.ToStr() + "]需要离开:" + leaveMsg + ",定位气缸下降");
}
private string ReadShelfId()
private bool ReadShelfId()
{
string rfid = RFIDManager.ReadRFID(rfidIp).NumStr();
CurrShelf = new ShelfInfo(rfid);
LogUtil.info(Name + "读取料架号:" + CurrShelf.ToStr());
return CurrShelf.realRFID;
if (RFID.Open())
{
if (RFID.ReadByte(0x20, 16, out byte[] data))
{
string rfid = Encoding.ASCII.GetString(data).Trim();
CurrShelf = new ShelfInfo(rfid);
LogUtil.info(Name + "RFID["+rfidIp+"]读取到料架号:" + CurrShelf.ToStr());
return true;
}
else
{
//读取失败,重试之类
WarnMsg = "RFID[" + rfidIp + "]读取失败";
LogUtil.error(WarnMsg);
}
}
else
{
WarnMsg = "RFID[" + rfidIp + "]打开失败";
LogUtil.error(WarnMsg);
}
return false;
}
#region IO操作
......
......@@ -43,6 +43,19 @@ namespace DeviceLibrary
return _positionNumList;
}
}
static List<string> _allPosList = null;
public static List<string> AllPosList
{
get
{
if (_allPosList == null)
{
_allPosList = new List<string>(CSVPositionReader<ACStorePosition>.allPositionMap.Keys);
}
return _allPosList;
}
}
static string baseDir = Application.StartupPath;
static Thread mainThread;
public static bool haveFixpos=false;
......@@ -82,6 +95,9 @@ namespace DeviceLibrary
msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败")+ "\n";
}
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
}
......
此文件类型无法预览
......@@ -92,7 +92,7 @@ namespace TheMachine
listReelInfo.View = View.Details;
AddHeader(listReelInfo, "", 0);
AddHeader(listReelInfo, "位置", 200);
AddHeader(listReelInfo, "料盘信息", listReelInfo.Width-200);
AddHeader(listReelInfo, "料盘信息", listReelInfo.Width-200-3);
listReelInfo.ColumnWidthChanging += listView_ColumnWidthChanging;
#endregion
......
......@@ -110,7 +110,7 @@ namespace TheMachine
this.ioControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ioControl1.Location = new System.Drawing.Point(0, 0);
this.ioControl1.Name = "ioControl1";
this.ioControl1.Size = new System.Drawing.Size(975, 539);
this.ioControl1.Size = new System.Drawing.Size(904, 522);
this.ioControl1.TabIndex = 0;
this.ioControl1.Tag = "not";
this.ioControl1.Load += new System.EventHandler(this.ioControl1_Load);
......@@ -168,7 +168,7 @@ namespace TheMachine
this.Controls.Add(this.ioControl1);
this.Font = new System.Drawing.Font("新宋体", 9F);
this.Name = "IOControls";
this.Size = new System.Drawing.Size(975, 539);
this.Size = new System.Drawing.Size(904, 522);
this.ResumeLayout(false);
}
......
......@@ -108,9 +108,9 @@ namespace TheMachine
void checkVerify()
{
int finish = 0;
for (int i = 0; i < RobotManage.PositionNumList.Count; i++)
for (int i = 0; i < RobotManage.AllPosList.Count; i++)
{
var posid = RobotManage.PositionNumList[i];
var posid = RobotManage.AllPosList[i];
if (htpp.ContainsKey(posid) && posState.ContainsKey(posid))
{
var pps = (PosState)posState[posid];
......@@ -120,7 +120,7 @@ namespace TheMachine
}
}
}
double s = (double)finish * 100 / RobotManage.PositionNumList.Count;
double s = (double)finish * 100 / RobotManage.AllPosList.Count;
label_verify.Text = s.ToString("0.0") + "%";
}
Hashtable htpp = new Hashtable();
......@@ -193,9 +193,9 @@ namespace TheMachine
int currentRowIndex = 0;
int currentColIndex = -1;
string lastAB = "";
for (int i = 0; i < RobotManage.PositionNumList.Count; i++)
for (int i = 0; i < RobotManage.AllPosList.Count; i++)
{
string posname = RobotManage.PositionNumList[i];
string posname = RobotManage.AllPosList[i];
string ab = posname.Substring(0, 3);
if (posname.StartsWith("Sca") || posname.StartsWith("Doo"))
......@@ -285,16 +285,16 @@ namespace TheMachine
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"入库位:{cmbPosition.Text},index:{posindex}");
string posName = cmbPosition.Text;
LogUtil.info($"入库位:{cmbPosition.Text},posName:{posName}");
string startPosname = "IN_1";
if (radioButton2.Checked)
{
startPosname = "IN_2";
}
if (RobotManage.mainMachine.ManualIn(startPosname,posindex, out string errmsg))
if (RobotManage.mainMachine.ManualTest(startPosname, posName, out string errmsg))
{
LogUtil.info($"手动入库:{posindex}");
LogUtil.info($"手动入库:{posName}");
}
else
{
......@@ -309,22 +309,22 @@ namespace TheMachine
private void btnOutStore_Click(object sender, EventArgs e)
{
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"出库位:{cmbPosition.Text},index:{posindex}");
if (RobotManage.mainMachine.ManualOut(posindex,out string errmsg)) {
LogUtil.info($"手动出库:{posindex}");
}
else
{
MessageBox.Show(errmsg);
}
}
else
{
MessageBox.Show(crc.GetString("Res0213","请先启动料仓!"));
}
//if (RobotManage.mainMachine.runStatus == RunStatus.Running)
//{
// int posindex = RobotManage.AllPosList.IndexOf(cmbPosition.Text);
// LogUtil.info($"出库位:{cmbPosition.Text},index:{posindex}");
// if (RobotManage.mainMachine.ManualOut(posindex,out string errmsg)) {
// LogUtil.info($"手动出库:{posindex}");
// }
// else
// {
// MessageBox.Show(errmsg);
// }
//}
//else
//{
// MessageBox.Show(crc.GetString("Res0213","请先启动料仓!"));
//}
}
bool preOpen = false;
......@@ -386,20 +386,21 @@ namespace TheMachine
}
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
{
if (RobotManage.mainMachine.IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.LOW)|| RobotManage.mainMachine.IOValue(IO_Type.IN_2_Reel_Check).Equals(IO_VALUE.LOW))
{
MessageBox.Show(crc.GetString("Res0217","料盘没有准备好,请先点击[上料准备],无法启动"));
return;
}
}
DialogResult res = MessageBox.Show(crc.GetString("Res0218","确定开始自动库位测试?\n请确保料架库位全部为空."), crc.GetString("Res0167","提示"), MessageBoxButtons.YesNo);
if (res == DialogResult.No)
{
return;
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"库位:{cmbPosition.Text},index:{posindex}");
if (!RobotManage.mainMachine.StartAutoInOutTest(posindex,out string errmsg))
}
string posName = cmbPosition.Text;
//int posindex = RobotManage.AllPosList.IndexOf(cmbPosition.Text);
LogUtil.info($"库位:{cmbPosition.Text},index:{posName}");
if (!RobotManage.mainMachine.StartAutoTest(posName, out string errmsg))
{
MessageBox.Show(errmsg);
return;
......
......@@ -31,6 +31,9 @@ namespace TheMachine
{
this.components = new System.ComponentModel.Container();
this.groupInout = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.cb_inoutdebugmode = new System.Windows.Forms.CheckBox();
this.btn_autoinout = new System.Windows.Forms.Button();
this.btnInStore = new System.Windows.Forms.Button();
......@@ -42,12 +45,9 @@ namespace TheMachine
this.label_verify = new System.Windows.Forms.Label();
this.cb_fixpos = new System.Windows.Forms.ComboBox();
this.storePosControl1 = new TheMachine.StorePosControl();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.groupInout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// groupInout
......@@ -64,6 +64,40 @@ namespace TheMachine
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(15, 55);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(216, 52);
this.groupBox1.TabIndex = 104;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "料盘位置";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(125, 22);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(71, 16);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "下层料盘";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(7, 22);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(71, 16);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "上层料盘";
this.radioButton1.UseVisualStyleBackColor = true;
//
// cb_inoutdebugmode
//
this.cb_inoutdebugmode.AutoSize = true;
......@@ -78,7 +112,6 @@ namespace TheMachine
// btn_autoinout
//
this.btn_autoinout.BackColor = System.Drawing.SystemColors.Control;
this.btn_autoinout.Enabled = false;
this.btn_autoinout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_autoinout.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_autoinout.Location = new System.Drawing.Point(15, 161);
......@@ -92,7 +125,6 @@ namespace TheMachine
// btnInStore
//
this.btnInStore.BackColor = System.Drawing.SystemColors.Control;
this.btnInStore.Enabled = false;
this.btnInStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInStore.Location = new System.Drawing.Point(15, 118);
......@@ -198,40 +230,6 @@ namespace TheMachine
this.storePosControl1.TabIndex = 227;
this.storePosControl1.Tag = "not";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(15, 55);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(216, 52);
this.groupBox1.TabIndex = 104;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "料盘位置";
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(7, 22);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(71, 16);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "上层料盘";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(125, 22);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(71, 16);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "下层料盘";
this.radioButton2.UseVisualStyleBackColor = true;
//
// uc_boxdebug
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -248,9 +246,9 @@ namespace TheMachine
this.Size = new System.Drawing.Size(981, 785);
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!