Commit b4fc74eb LN

侧挡气缸和底部气缸增加禁用功能

1 个父辈 64e1a1b2
...@@ -165,5 +165,9 @@ namespace TSA_V.Common ...@@ -165,5 +165,9 @@ namespace TSA_V.Common
/// 是否需要输入pcb条码 /// 是否需要输入pcb条码
/// </summary> /// </summary>
public static string NeedPCBCode = "NeedPCBCode"; public static string NeedPCBCode = "NeedPCBCode";
public static string DisableSideCylinder = "DisableSideCylinder";
public static string DisableBottomCylinder = "DisableBottomCylinder";
} }
} }
...@@ -21,6 +21,10 @@ namespace TSA_V.DeviceLibrary ...@@ -21,6 +21,10 @@ namespace TSA_V.DeviceLibrary
public static int DefaultPType = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointType); public static int DefaultPType = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointType);
public static int DefaultPSize = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointSize); public static int DefaultPSize = ConfigAppSettings.GetIntValue(Setting_Init.DefaultPointSize);
public static bool DisableSideCylinder = false;
public static bool DisableBottomCylinder = false;
private static string warnMsg = ""; private static string warnMsg = "";
public static string WarnMsg public static string WarnMsg
{ {
...@@ -66,6 +70,8 @@ namespace TSA_V.DeviceLibrary ...@@ -66,6 +70,8 @@ namespace TSA_V.DeviceLibrary
public static string LoadTSAV() public static string LoadTSAV()
{ {
LogUtil.info(Name + "开始加载电机配置。。"); LogUtil.info(Name + "开始加载电机配置。。");
DisableSideCylinder = ConfigAppSettings.GetBoolValue(Setting_Init.DisableSideCylinder);
DisableBottomCylinder = ConfigAppSettings.GetBoolValue(Setting_Init.DisableBottomCylinder);
if (workTimer == null) if (workTimer == null)
{ {
workTimer = new System.Timers.Timer(); workTimer = new System.Timers.Timer();
...@@ -570,7 +576,7 @@ namespace TSA_V.DeviceLibrary ...@@ -570,7 +576,7 @@ namespace TSA_V.DeviceLibrary
LogUtil.info("StopMove,停止所有运动"); LogUtil.info("StopMove,停止所有运动");
BottomCylinderDown(false); BottomCylinderDown(false);
CylinderMove(IOManager.StopCylinder_Down, IOManager.StopCylinder_Up, false); CylinderMove(IOManager.StopCylinder_Down, IOManager.StopCylinder_Up, false);
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, false); SideCyliderBack(false );
Work.StopWork(); Work.StopWork();
LineStep.EndMove(); LineStep.EndMove();
......
...@@ -55,7 +55,7 @@ namespace TSA_V.DeviceLibrary ...@@ -55,7 +55,7 @@ namespace TSA_V.DeviceLibrary
LogUtil.info("开始流水线转动:挡停气缸下降,侧挡气缸后退,底部气缸下降"); LogUtil.info("开始流水线转动:挡停气缸下降,侧挡气缸后退,底部气缸下降");
BottomCylinderDown(true ); BottomCylinderDown(true );
CylinderMove(IOManager.StopCylinder_Up, IOManager.StopCylinder_Down, true ); CylinderMove(IOManager.StopCylinder_Up, IOManager.StopCylinder_Down, true );
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, true ); SideCyliderBack(true );
} }
else else
{ {
...@@ -97,7 +97,7 @@ namespace TSA_V.DeviceLibrary ...@@ -97,7 +97,7 @@ namespace TSA_V.DeviceLibrary
LogUtil.info("检测到流水线前端信号:挡停气缸下降,侧挡气缸后退,底部气缸下降"); LogUtil.info("检测到流水线前端信号:挡停气缸下降,侧挡气缸后退,底部气缸下降");
BottomCylinderDown(true); BottomCylinderDown(true);
CylinderMove(IOManager.StopCylinder_Up, IOManager.StopCylinder_Down, true); CylinderMove(IOManager.StopCylinder_Up, IOManager.StopCylinder_Down, true);
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, true); SideCyliderBack(true);
} }
else else
{ {
...@@ -191,7 +191,7 @@ namespace TSA_V.DeviceLibrary ...@@ -191,7 +191,7 @@ namespace TSA_V.DeviceLibrary
{ {
LineStep.NextMoveStep(LineStepBean.LS06_SideCylindeMove); LineStep.NextMoveStep(LineStepBean.LS06_SideCylindeMove);
LineLog("流水线转动:侧挡气缸前进"); LineLog("流水线转动:侧挡气缸前进");
CylinderMove(IOManager.SideCylinder_Back, IOManager.SideCylinder_Forward, true); SideCyliderForward(true);
} }
else if (LineStep.lineStep.Equals(LineStepBean.LS06_SideCylindeMove)) else if (LineStep.lineStep.Equals(LineStepBean.LS06_SideCylindeMove))
{ {
...@@ -222,7 +222,7 @@ namespace TSA_V.DeviceLibrary ...@@ -222,7 +222,7 @@ namespace TSA_V.DeviceLibrary
LineStep.NextMoveStep(LineStepBean.LS09_StopBack); LineStep.NextMoveStep(LineStepBean.LS09_StopBack);
LineLog("流水线转动:底部气缸下降,侧挡后退,工作统计"); LineLog("流水线转动:底部气缸下降,侧挡后退,工作统计");
BottomCylinderDown(true); BottomCylinderDown(true);
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, true); SideCyliderBack(true);
} }
else if (LineStep.lineStep.Equals(LineStepBean.LS09_StopBack)) else if (LineStep.lineStep.Equals(LineStepBean.LS09_StopBack))
{ {
...@@ -338,24 +338,44 @@ namespace TSA_V.DeviceLibrary ...@@ -338,24 +338,44 @@ namespace TSA_V.DeviceLibrary
public static void BottomCylinderDown(bool isWait=false ) public static void BottomCylinderDown(bool isWait=false )
{ {
if (isWait) if (!DisableBottomCylinder)
{ {
LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down1, IO_VALUE.HIGH)); if (isWait)
LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down2, IO_VALUE.HIGH)); {
} LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down1, IO_VALUE.HIGH));
IOManager.IOMove(IOManager.BottomCylinder_Up, IO_VALUE.LOW); LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down2, IO_VALUE.HIGH));
IOManager.IOMove(IOManager.BottomCylinder_Down, IO_VALUE.HIGH); }
IOManager.IOMove(IOManager.BottomCylinder_Up, IO_VALUE.LOW);
IOManager.IOMove(IOManager.BottomCylinder_Down, IO_VALUE.HIGH);
}
} }
public static void BottomCylinderUp(bool isWait=false ) public static void BottomCylinderUp(bool isWait = false)
{ {
if (isWait) if (!DisableBottomCylinder)
{ {
LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down1, IO_VALUE.LOW)); if (isWait)
LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down2, IO_VALUE.LOW)); {
} LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down1, IO_VALUE.LOW));
IOManager.IOMove(IOManager.BottomCylinder_Down, IO_VALUE.LOW); LineStep.WaitList.Add(WaitResultInfo.WaitIO(IOManager.BottomCylinder_Down2, IO_VALUE.LOW));
IOManager.IOMove(IOManager.BottomCylinder_Up, IO_VALUE.HIGH); }
IOManager.IOMove(IOManager.BottomCylinder_Down, IO_VALUE.LOW);
IOManager.IOMove(IOManager.BottomCylinder_Up, IO_VALUE.HIGH);
}
}
public static void SideCyliderForward(bool isWait = false)
{
if (!DisableSideCylinder)
{
CylinderMove(IOManager.SideCylinder_Back, IOManager.SideCylinder_Forward, isWait);
}
}
public static void SideCyliderBack(bool isWait=false )
{
if (!DisableSideCylinder)
{
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, isWait);
}
} }
public static void CylinderMove( string lowType, string highType, bool isWait=false ) public static void CylinderMove( string lowType, string highType, bool isWait=false )
...@@ -372,7 +392,7 @@ namespace TSA_V.DeviceLibrary ...@@ -372,7 +392,7 @@ namespace TSA_V.DeviceLibrary
{ {
BottomCylinderDown(isWait); BottomCylinderDown(isWait);
CylinderMove(IOManager.StopCylinder_Down, IOManager.StopCylinder_Up, isWait); CylinderMove(IOManager.StopCylinder_Down, IOManager.StopCylinder_Up, isWait);
CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back, isWait); SideCyliderBack(isWait);
} }
} }
/// <summary> /// <summary>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<add key="Line_WidthPosition" value="" /> <add key="Line_WidthPosition" value="" />
<add key="Server_Log_Open" value="0" /> <add key="Server_Log_Open" value="0" />
<!--本地开放的http服务器端口号--> <!--本地开放的http服务器端口号-->
<!--<add key="WebServiceAddr" value="http://localhost:4090/rest/api/v1/station/" />--> <add key="WebServiceAddr" value="http://localhost:4090/rest/api/v1/station/" />
<!--组装完成后上传数据的服务器地址--> <!--组装完成后上传数据的服务器地址-->
<!--<add key="DCSServerAddr" value="http://192.168.8.1:1007/DCS_Integration/Cartridge.asmx?op=CartridgeInfo" />--> <!--<add key="DCSServerAddr" value="http://192.168.8.1:1007/DCS_Integration/Cartridge.asmx?op=CartridgeInfo" />-->
<!--组装工作前,需要输入pcb板条码--> <!--组装工作前,需要输入pcb板条码-->
......
...@@ -43,7 +43,8 @@ namespace TSA_V ...@@ -43,7 +43,8 @@ namespace TSA_V
{ {
LanguageProcess(); LanguageProcess();
this.chbISDebug.Checked = TSAVBean.IsDebug; this.chbISDebug.Checked = TSAVBean.IsDebug;
this.chbDisBottomCylinder.Checked = TSAVBean.DisableBottomCylinder;
this.chbDisSideCylinder.Checked = TSAVBean.DisableSideCylinder;
this.txtKNDIP.Text = IOManager.KNDIP.ToString(); this.txtKNDIP.Text = IOManager.KNDIP.ToString();
this.txtKNDPort.Text = IOManager.KNDPort.ToString(); this.txtKNDPort.Text = IOManager.KNDPort.ToString();
LoadCom(); LoadCom();
...@@ -106,10 +107,20 @@ namespace TSA_V ...@@ -106,10 +107,20 @@ namespace TSA_V
bool isDebug = chbISDebug.Checked; bool isDebug = chbISDebug.Checked;
ConfigAppSettings.SaveValue(Setting_Init.IsDebug, isDebug); ConfigAppSettings.SaveValue(Setting_Init.IsDebug, isDebug);
TSAVBean.IsDebug = isDebug; TSAVBean.IsDebug = isDebug;
bool disBottom = chbDisBottomCylinder.Checked;
ConfigAppSettings.SaveValue(Setting_Init.DisableBottomCylinder,disBottom);
TSAVBean.DisableBottomCylinder = disBottom;
bool disSide = chbDisSideCylinder.Checked;
ConfigAppSettings.SaveValue(Setting_Init.DisableSideCylinder, disSide);
TSAVBean.DisableSideCylinder = disSide;
string server = txtAddr.Text.Trim(); string server = txtAddr.Text.Trim();
ConfigAppSettings.SaveValue(Setting_Init.DCSServerAddr, server); ConfigAppSettings.SaveValue(Setting_Init.DCSServerAddr, server);
MesUtil.serverAddress = server; MesUtil.serverAddress = server;
LogUtil.info("保存配置成功: 调试[" + isDebug + "],地址["+server+"] "); LogUtil.info($"保存配置成功: 调试{ isDebug },禁用底部气缸{disBottom},禁用侧挡气缸{disSide},地址{server} ");
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SaveOk, "保存成功"));
} }
......
...@@ -2362,4 +2362,6 @@ ...@@ -2362,4 +2362,6 @@
<data name="ItemText_Disable" xml:space="preserve"> <data name="ItemText_Disable" xml:space="preserve">
<value>Disable</value> <value>Disable</value>
</data> </data>
<data name = "FrmDeviceConfig_chbDisSideCylinder_Text" xml:space = "preserve"> <value> Disable the side brake cylinder </value> </data>
<data name = "FrmDeviceConfig_chbDisBottonCylinder_Text" xml:space = "preserve"> <value> Disable bottom cylinder </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -2376,4 +2376,6 @@ ...@@ -2376,4 +2376,6 @@
<data name="ItemText_Disable" xml:space="preserve"> <data name="ItemText_Disable" xml:space="preserve">
<value>禁用</value> <value>禁用</value>
</data> </data>
<data name = "FrmDeviceConfig_chbDisSideCylinder_Text" xml:space = "preserve"> <value> 禁用侧挡气缸 </value> </data>
<data name = "FrmDeviceConfig_chbDisBottonCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -323,12 +323,12 @@ namespace TSA_V ...@@ -323,12 +323,12 @@ namespace TSA_V
private void btnSideForward_Click(object sender, EventArgs e) private void btnSideForward_Click(object sender, EventArgs e)
{ {
TSAVBean.CylinderMove(IOManager.SideCylinder_Back, IOManager.SideCylinder_Forward); TSAVBean.SideCyliderForward();
} }
private void btnSideBack_Click(object sender, EventArgs e) private void btnSideBack_Click(object sender, EventArgs e)
{ {
TSAVBean.CylinderMove(IOManager.SideCylinder_Forward, IOManager.SideCylinder_Back); TSAVBean.SideCyliderBack();
} }
private void btnBottomUp_Click(object sender, EventArgs e) private void btnBottomUp_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!