Commit 9cc48e7e LN

增加配置,默认进入过板模式不加载设备

1 个父辈 f453e1aa
......@@ -81,6 +81,11 @@ namespace TSA_V.Common
public static MyConfig<bool> Device_IsCycleDebug =false;
[MyConfigComment("侧挡气缸是否先移动")]
public static MyConfig<bool> Device_SideCylinderMoveFirst =true;
[MyConfigComment("是否自动进入过板模式")]
public static MyConfig<bool> Device_AutoGuoBan = false ;
[MyConfigComment("是否工作区域启动")]
public static MyConfig<bool> Work_WorkSingleStart = false;
[MyConfigComment("是否离线模式")]
......@@ -130,7 +135,7 @@ namespace TSA_V.Common
{
try
{
ConfigRead();
//配置迁移
if (!Soft_NeedChangeConfig)
{
......@@ -241,5 +246,21 @@ namespace TSA_V.Common
LogUtil.error("配置迁移出错:" + ex.ToString());
}
}
public static void ConfigRead()
{
try
{
Device_AutoGuoBan = ConfigAppSettings.GetBoolValue("Device_AutoGuoBan", Device_AutoGuoBan);
ConfigAppSettings.RemoveKey("Device_AutoGuoBan");
}
catch (Exception ex)
{
LogUtil.error("ConfigRead 出错: " + ex.ToString());
}
}
}
}
......@@ -87,6 +87,11 @@ namespace TSA_V.Common
}
public static bool GetBoolValue(string keyStr,bool defv=false )
{
int v=GetIntValue(keyStr,-1);
if (v == -1)
{
return defv;
}
return GetIntValue(keyStr).Equals(1);
}
......
......@@ -387,7 +387,7 @@ namespace TSA_V.LoadCSVLibrary
if (strarr.Length != intarr.Length)
{
MessageBox.Show($"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!");
LogUtil.error($"{com.PN}的数量分组{intarr.Length}和位置分组{strarr.Length},不统一!");
return new List<ComponetInfo>();
}
......
......@@ -194,6 +194,14 @@ namespace TSA_V.DeviceLibrary
{
try
{
if (Setting_NInit.Device_AutoGuoBan)
{
LogUtil.info(Name + " Device_AutoGuoBan 已配置,默认进入过板模式");
WorkModeUtil.AutoSelect(Name);
return;
}
if (!IOManager.ShuddenOK())
{
WarnMsg = GetTime() + ResourceControl.GetString("FrmBoardInfo_lblMsg_Text", "急停未开");
......
......@@ -241,9 +241,16 @@ namespace TSA_V
}
else
{
if (Setting_NInit.Device_AutoGuoBan)
{
}
else
{
LogUtil.info("未连接到IO模块,等待2000后重连!");
}
}
}
private void FrmMenu_FormClosing(object sender, FormClosingEventArgs e)
{
......
......@@ -132,7 +132,7 @@ namespace TSA_V
}
else if (TSAVBean.Status.Equals(TSAVStatus.Runing))
{
Work.MoveToBag(currPosition);
Work.MoveToBag(currPosition,currCom);
}
}
private void btnPre_Click(object sender, EventArgs e)
......
......@@ -9,7 +9,7 @@
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TSA_V</RootNamespace>
<AssemblyName>NEO STATION</AssemblyName>
<AssemblyName>Neo_Station</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!