Commit 39d691c8 刘韬

选项StringDoor_InOut_Roller_Mode

料串进出滚筒模式选择, 适配西门子后的新设备
1 个父辈 0bb8f3ac
using ConfigHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.Common
......@@ -197,6 +193,8 @@ namespace OnlineStore.Common
public static MyConfig<int> StringDoor_UpOverTimeMS = 0;
[MyConfigComment("料串门光栅触发处理方式:0-设备急停;1-仅料串门停止")]
public static MyConfig<int> StringDoor_SafetyLightCurtainsProcStrategy = 1;
[MyConfigComment("料串进出滚筒控制模式,SingleIoIn_SingleIoOut=242405之前的设备单IO进出,SingleIoIn_DoubltIoOut之后的设备双IO反转")]
public static MyConfig<InOut_Roller_Mode> StringDoor_InOut_Roller_Mode = InOut_Roller_Mode.SingleIoIn_SingleIoOut;
[MyConfigComment("库位高低点最大相差的值")]
......@@ -228,4 +226,9 @@ namespace OnlineStore.Common
[MyConfigComment("监控上传功能_图像质量")]
public static MyConfig<int> UploadVideo_ImgQuality = 100;
}
public enum InOut_Roller_Mode
{
SingleIoIn_SingleIoOut = 0,
SingleIoIn_DoubltIoOut = 1
}
}
......@@ -16,11 +16,13 @@ namespace DeviceLibrary
string Name;
ushort LineIO;
ushort LineRevIO;
int Rev_type = 0;
bool isIOon = false;
public LineRunMonitor(string name, ushort io, ushort rev_io=0) {
public LineRunMonitor(string name, ushort io, ushort rev_io=0, int rev_type=0) {
Name = name;
LineIO = io;
LineRevIO = rev_io;
Rev_type = rev_type;
LineInit();
SafetyDevice.AddDevice(this);
}
......@@ -96,7 +98,10 @@ namespace DeviceLibrary
if (Reversal)
{
DOMove(LineIO, IO_VALUE.LOW);
if (Rev_type==0)
DOMove(LineIO, IO_VALUE.LOW);
else
DOMove(LineIO, IO_VALUE.HIGH);
DOMove(LineRevIO, IO_VALUE.HIGH);
}
else
......
......@@ -13,7 +13,8 @@ namespace DeviceLibrary
{
partial class MainMachine
{
public bool StartAutoInOutTest(string posname, out string errmsg)
int CurrentReelHeight = 0;
public bool StartAutoInOutTest(string posname,int reelh , out string errmsg)
{
errmsg = "";
if (!boxTransport.IsComplateOrFree)
......@@ -27,7 +28,7 @@ namespace DeviceLibrary
// return false;
//}
CurrentReelHeight = reelh;
poslist = RobotManage.PositionNumList.Select(a => { return CSVPositionReader<ACStorePosition>.allPositionMap[a]; }).ToList();//CSVPositionReader<ACStorePosition>.getPositionList();
poslist.RemoveAll(x => { return x.PositionNum.StartsWith("fix#"); });
CurrentPosIndex = poslist.FindIndex(x => x.PositionNum == posname);
......@@ -70,8 +71,9 @@ namespace DeviceLibrary
break;
case MoveStep.AIOTest_02_Pause1:
AIOTMoveInfo.NextMoveStep(MoveStep.AIOTest_03_FirstReady);
CloseSingleDoor(AIOTMoveInfo);
var ac = poslist[CurrentPosIndex];
var reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
var reel = new ReelParam("auto", ac.BagWidth, CurrentReelHeight);
if (!boxTransport.Start(new BoxStorePosition(Config, StoreSide.NGDoor, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.InStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
......@@ -107,6 +109,7 @@ namespace DeviceLibrary
return;
}
CloseFlipDoor(AIOTMoveInfo);
OpenSingleDoor(AIOTMoveInfo);
}
break;
case MoveStep.AIOTest_05_Pause2:
......@@ -116,9 +119,10 @@ namespace DeviceLibrary
break;
case MoveStep.AIOTest_06_SecondReady:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn05);
CloseSingleDoor(AIOTMoveInfo);
AIOTMoveInfo.log($"开始转运料盘第二盘");
ac = poslist[CurrentPosIndex - 1];
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
reel = new ReelParam("auto", ac.BagWidth, CurrentReelHeight);
if (!boxTransport.Start(new BoxStorePosition(Config, StoreSide.NGDoor, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.InStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
......@@ -243,7 +247,14 @@ namespace DeviceLibrary
return;
}
var ac2 = poslist[CurrentPosIndex - 2];
reel = new ReelParam("auto", ac2.BagWidth, ac2.BagHigh);
reel = new ReelParam("auto", ac2.BagWidth, CurrentReelHeight);
if (ac2.BagHigh < CurrentReelHeight)
{
StopAutoInOut = true;
AIOTMoveInfo.log($"下一个库位的尺寸小于盘高,停止自动测试");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut10);
}
if (!boxTransport.Start(new BoxStorePosition(Config, ac1, reel), new BoxStorePosition(Config, ac2, reel), StoreMoveType.InStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
......@@ -273,7 +284,7 @@ namespace DeviceLibrary
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut11);
CurrentPosIndex--;
ac = poslist[CurrentPosIndex];
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
reel = new ReelParam("auto", ac.BagWidth, CurrentReelHeight);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, StoreSide.NGDoor, reel), StoreMoveType.OutStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
......@@ -308,7 +319,7 @@ namespace DeviceLibrary
case MoveStep.StoreOut13:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut14);
ac = poslist[CurrentPosIndex - 1];
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
reel = new ReelParam("auto", ac.BagWidth, CurrentReelHeight);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, StoreSide.NGDoor, reel), StoreMoveType.OutStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
......
......@@ -22,7 +22,7 @@ namespace DeviceLibrary
void Reset_BTN()
{
LogUtil.info("按下复位按钮");
if (!lastSuddenStop && IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.HIGH))
{
Msg.add(crc.GetString(L.reset_press, "按下复位按钮."), MsgLevel.info, ErrInfo.ResetBtn);
}
......
......@@ -113,7 +113,7 @@ namespace DeviceLibrary
Clamp_Axis.interference += Clamp_Axis_interference;
Crc_LanguageChangeEvent(null, EventArgs.Empty);
#endregion
Line = new LineRunMonitor($"料串进出机构", Config.DOList[IO_Type.LineRun].GetIOAddr(), Config.DOList[IO_Type.LineRev].GetIOAddr());
Line = new LineRunMonitor($"料串进出机构", Config.DOList[IO_Type.LineRun].GetIOAddr(), Config.DOList[IO_Type.LineRev].GetIOAddr(),(int)(Setting_Init.StringDoor_InOut_Roller_Mode.Val));
SingleDoor = new CylinderManger($"单料门", IO_Type.NGDoor_Open, IO_Type.NGDoor_Close);
//检测翻板门是否为鸣志点击伺服控制
if (Config.FlipDoor_L_Axis == null && Config.FlipDoor_R_Axis == null)
......@@ -282,7 +282,7 @@ namespace DeviceLibrary
ioMonitor();
AGVProcess();
StringProcess();
ClampProcess();
ClampProcess();
boxTransport.Process();
if (AutoInOutTest)
AutoInOutTestProcess();
......@@ -353,6 +353,7 @@ namespace DeviceLibrary
Alarm(AlarmType.None);
StopMove(true);
IOMove(IO_Type.LineRun, IO_VALUE.LOW);
IOMove(IO_Type.LineRev, IO_VALUE.LOW);
LedProcess(null);
SoundsController.StopPlay();
LogUtil.info("开始停止系统3.");
......
......@@ -30,7 +30,7 @@ namespace DeviceLibrary
}
void ReelTaked()
{
ClampMoveInfo.NextMoveStep(MoveStep.ReelTaked);
ClampMoveInfo.NextMoveStep(MoveStep.ReelTaked);
}
public void NGPuted(string msg)
{
......@@ -81,6 +81,8 @@ namespace DeviceLibrary
switch (ClampMoveInfo.MoveStep)
{
case MoveStep.Wait:
if (AutoInOutTest)
return;
if (IsGetReelReady && StoreMoveInfo.MoveStep < MoveStep.StoreOut10 && OutSingleJobList.Count == 0)
{
ClampMoveInfo.NewMove(MoveStep.ReelClamp_01);
......
......@@ -178,13 +178,13 @@ namespace TheMachine
const int tabpagecount = 4;
void addTablePage()
{
this.SuspendLayout();
//this.SuspendLayout();
AddForm("tab_io", crc.GetString(L.tab_io, "IO调试"), ioc);
AddForm("tab_axis", crc.GetString(L.tab_axis, "伺服调试"), ac);
AddForm("tab_store", crc.GetString(L.tab_store, "库位调试"), bd);
AddForm("tab_setting", crc.GetString(L.tab_setting, "相关设置"), sc);
this.ResumeLayout(true);
this.PerformLayout();
//this.ResumeLayout(true);
//this.PerformLayout();
crc.LanguageProcess(this);
}
......@@ -276,7 +276,7 @@ namespace TheMachine
(sender as ToolStripMenuItem).Text = !RobotManage.IsConfigMode ? crc.GetString(L.enable_config_mode, "启用配置模式") : crc.GetString(L.disable_config_mode, "停用配置模式");
showDebugTabPages(RobotManage.IsConfigMode);
this.WindowState = FormWindowState.Maximized;
//if (RobotManage.IsConfigMode)
//{
// //RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
......@@ -420,7 +420,7 @@ namespace TheMachine
Task.Run(() =>
{
Task.Delay(1000).Wait();
if (!RobotManage.isRunning)
if (!RobotManage.isRunning || RobotManage.IsUserPause)
btn_run_Click(this, EventArgs.Empty);
});
......
......@@ -31,7 +31,9 @@ namespace TheMachine
{
this.components = new System.ComponentModel.Container();
this.groupInout = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.cb_inoutdebugmode = new System.Windows.Forms.CheckBox();
this.cb_plateheight = new System.Windows.Forms.ComboBox();
this.btn_autoinout = new System.Windows.Forms.Button();
this.btnInStore = new System.Windows.Forms.Button();
this.btnOutStore = new System.Windows.Forms.Button();
......@@ -48,7 +50,9 @@ namespace TheMachine
//
// groupInout
//
this.groupInout.Controls.Add(this.label1);
this.groupInout.Controls.Add(this.cb_inoutdebugmode);
this.groupInout.Controls.Add(this.cb_plateheight);
this.groupInout.Controls.Add(this.btn_autoinout);
this.groupInout.Controls.Add(this.btnInStore);
this.groupInout.Controls.Add(this.btnOutStore);
......@@ -59,6 +63,15 @@ namespace TheMachine
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(19, 139);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 12);
this.label1.TabIndex = 228;
this.label1.Text = "Reel H:";
//
// cb_inoutdebugmode
//
this.cb_inoutdebugmode.AutoSize = true;
......@@ -70,6 +83,27 @@ namespace TheMachine
this.cb_inoutdebugmode.UseVisualStyleBackColor = true;
this.cb_inoutdebugmode.CheckedChanged += new System.EventHandler(this.cb_inoutdebugmode_CheckedChanged);
//
// cb_plateheight
//
this.cb_plateheight.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_plateheight.Enabled = false;
this.cb_plateheight.FormattingEnabled = true;
this.cb_plateheight.Items.AddRange(new object[] {
"8",
"16",
"20",
"24",
"32",
"40",
"44",
"48",
"56",
"72"});
this.cb_plateheight.Location = new System.Drawing.Point(72, 136);
this.cb_plateheight.Name = "cb_plateheight";
this.cb_plateheight.Size = new System.Drawing.Size(54, 20);
this.cb_plateheight.TabIndex = 227;
//
// btn_autoinout
//
this.btn_autoinout.BackColor = System.Drawing.SystemColors.Control;
......@@ -90,7 +124,7 @@ namespace TheMachine
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(6, 70);
this.btnInStore.Location = new System.Drawing.Point(6, 42);
this.btnInStore.Name = "btnInStore";
this.btnInStore.Size = new System.Drawing.Size(117, 32);
this.btnInStore.TabIndex = 102;
......@@ -104,7 +138,7 @@ namespace TheMachine
this.btnOutStore.Enabled = false;
this.btnOutStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOutStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOutStore.Location = new System.Drawing.Point(6, 108);
this.btnOutStore.Location = new System.Drawing.Point(6, 80);
this.btnOutStore.Name = "btnOutStore";
this.btnOutStore.Size = new System.Drawing.Size(117, 32);
this.btnOutStore.TabIndex = 101;
......@@ -227,5 +261,7 @@ namespace TheMachine
private System.Windows.Forms.Button btn_autoinout;
private System.Windows.Forms.Label label_verify;
private System.Windows.Forms.ComboBox cb_fixpos;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cb_plateheight;
}
}
......@@ -320,7 +320,7 @@ namespace TheMachine
ACStorePosition ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(posid);
cmbPosition.Text = posid;
label_size.Text = $"[{ktkPosition.BagWidth}x{ktkPosition.BagHigh}]";
cb_plateheight.Text = ktkPosition.BagHigh.ToString();
storePosControl1.LoadPos(ktkPosition);
}
......@@ -425,6 +425,7 @@ namespace TheMachine
btnInStore.Enabled= cb_inoutdebugmode.Checked;
btnOutStore.Enabled= cb_inoutdebugmode.Checked;
btn_autoinout.Enabled=cb_inoutdebugmode.Checked;
cb_plateheight.Enabled = cb_inoutdebugmode.Checked;
}
private void btn_autoinout_Click(object sender, EventArgs e)
......@@ -441,7 +442,10 @@ namespace TheMachine
DialogResult res = MessageBox.Show(crc.GetString(L.autotest_msg_02, "确定开始自动库位测试?\n请确保料仓库位全部为空."), crc.GetString(L.tips, "提示"), MessageBoxButtons.YesNo);
if (res == DialogResult.No)
return;
if (!RobotManage.mainMachine.StartAutoInOutTest(cmbPosition.Text, out string errmsg))
var a = cb_plateheight.SelectedItem.ToString();
int.TryParse(a, out int h);
if (!RobotManage.mainMachine.StartAutoInOutTest(cmbPosition.Text, h, out string errmsg))
{
MessageBox.Show(errmsg);
return;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!