修正主界面重复加载的错误
This commit is contained in:
@@ -9,19 +9,11 @@
|
||||
|
||||
<!--<add key="GlobalPaletteMode" value="Professionaloffice2003"/>-->
|
||||
<add key="LanguageCode" value="zh-CN"/>
|
||||
<!--<add key="LanguageCode" value="English"/>-->
|
||||
<add key="sqlmapConfigPath" value="Config/sqlmap.config"/>
|
||||
<!--MySql数据库连接字符串-->
|
||||
<add key="LeadMySql" value="Data Source = localhost; Port=3306;Initial Catalog = testasrs; Persist Security Info=True;User ID = root; Password=sa1234567;"/>
|
||||
<!--SqlServer数据库连接字符串-->
|
||||
<add key="LeadSqlServer" value="Data Source =localhost;Initial Catalog =NX_CLEAR_MAC;User Id = sa;Password =syl.syl503601;"/>
|
||||
<!--Oracle数据库连接字符串-->
|
||||
<add key="LeadOracle" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=LEADASRS; Password=LEADASRS;"/>
|
||||
<!--SQLite数据库连接字符串-->
|
||||
<!--SQLite数据库连接字符串-->
|
||||
<!--<add key="LeadSQLite" value="Data Source=|DataDirectory|\\clearMac.db;Pooling=true;FailIfMissing=false"/>-->
|
||||
<add key="LeadSQLite" value="Data Source=DataBase/clearMac.db"/>
|
||||
<!--串口名称-->
|
||||
<add key="PortName" value="COM3"/>
|
||||
<add key="PortName" value="COM2"/>
|
||||
<!--串口波特率-->
|
||||
<add key="BaudRate" value="9600"/>
|
||||
<!--串口数据位-->
|
||||
|
||||
@@ -108,8 +108,16 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
frmMainNew.SwitchFrmMenu(EnumFormType.Base, false);
|
||||
}
|
||||
|
||||
private bool isInit = false;
|
||||
|
||||
|
||||
private void frmMainDetail_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (isInit) return;
|
||||
isInit = true;
|
||||
|
||||
|
||||
this.SetFormControlText();
|
||||
try
|
||||
{
|
||||
@@ -325,6 +333,7 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
{
|
||||
|
||||
Console.WriteLine("数据变化");
|
||||
|
||||
cbt_RunStatusTran.BackColor = _device.CleanMacRunStatusNew ? Color.Lime : Color.Gray;
|
||||
cbt_Brush1StatusTran.BackColor = _device.Hairbrush1Selection ? Color.Lime : Color.Gray;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#if DEBUG
|
||||
|
||||
#define USE_LOCAL_TCP_DEBUG
|
||||
//#define USE_LOCAL_TCP_DEBUG
|
||||
#endif
|
||||
//启用心跳检查
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace CleanMachineHMI
|
||||
}
|
||||
|
||||
|
||||
public bool readIO { get;set; }= false;
|
||||
public bool readIO { get; set; } = false;
|
||||
|
||||
|
||||
|
||||
@@ -188,14 +188,14 @@ namespace CleanMachineHMI
|
||||
{
|
||||
if (_synchronization != null)
|
||||
{
|
||||
_synchronization.Post(this.DoOnReadFinish, null);
|
||||
_synchronization.Send(this.DoOnReadFinish, null);
|
||||
}
|
||||
}
|
||||
|
||||
HeartbeatDetection();
|
||||
// thEvent.Set();
|
||||
// ShowWarningMsg();
|
||||
int sleeptime = 100 - ts.Milliseconds;
|
||||
int sleeptime = 500 - ts.Milliseconds;
|
||||
if (sleeptime < 0)
|
||||
{
|
||||
sleeptime = 0;
|
||||
@@ -365,6 +365,7 @@ namespace CleanMachineHMI
|
||||
if (item.PlcItemValue != value)
|
||||
{
|
||||
haschange = true;
|
||||
Console.WriteLine(item.PlcItemCode + "数据变化");
|
||||
}
|
||||
item.PlcItemValue = value;
|
||||
Global.ShowSensorStatus(item, new EventArgs());
|
||||
@@ -447,9 +448,10 @@ namespace CleanMachineHMI
|
||||
{
|
||||
if (item.PlcItemValue != value)
|
||||
{
|
||||
if (item.PlcItemCode != "PlcHeartbeatWriteData")
|
||||
if (item.PlcItemCode != "PlcHeartbeatWriteData" && item.PlcItemCode != "PlcHeartbeatReadData")
|
||||
{
|
||||
haschange = true;
|
||||
Console.WriteLine(item.PlcItemCode + "数据变化");
|
||||
}
|
||||
item.PlcItemValue = value;
|
||||
|
||||
|
||||
@@ -890,7 +890,7 @@ namespace CleanMachineHMI
|
||||
|
||||
private void frmMainNew_Shown(object sender, EventArgs e)
|
||||
{
|
||||
InitControl();
|
||||
// InitControl();
|
||||
}
|
||||
private void InitControl()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user