Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
GC_Branch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周磊
GC_Branch
Commits
2ba0fd40
Commit
2ba0fd40
authored
May 11, 2018
by
wangjunqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复开机时启动界面卡死bug
parent
05093bee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
92 deletions
+17
-92
AppInit.cs
GcDevicePc/AppInit.cs
+11
-6
MDIBase.cs
GcDevicePc/MDIBase.cs
+6
-86
No files found.
GcDevicePc/AppInit.cs
View file @
2ba0fd40
...
...
@@ -109,6 +109,7 @@ namespace GcDevicePc
{
FileTools
filecheck
=
new
FileTools
();
FileServerClient
mainclient
=
new
FileServerClient
();
mainclient
.
WtClientInit
(
globaldata
.
connection_ip
,
globaldata
.
fileserverport
);
for
(
int
i
=
0
;
i
<
filename
.
Count
;
i
++)
{
String
getfile
=
localfoldername
[
i
]
+
filename
[
i
];
...
...
@@ -120,14 +121,18 @@ namespace GcDevicePc
}
else
if
(
checkflag
==
1
)
{
mainclient
.
WtClientInit
(
globaldata
.
connection_ip
,
globaldata
.
fileserverport
);
ret
=
mainclient
.
WtClientCopyfromServer
(
filename
[
i
],
getfile
,
foldername
[
i
]);
checkflag
=
filecheck
.
IsUse
(
getfile
);
while
(
checkflag
!=
0
)
{
Thread
.
Sleep
(
200
);
checkflag
=
filecheck
.
IsUse
(
getfile
);
ret
=
mainclient
.
WtClientCopyfromServer
(
filename
[
i
],
getfile
,
foldername
[
i
]);
Thread
.
Sleep
(
500
);
//checkflag = filecheck.IsUse(getfile);
//while (checkflag != 0)
//{
// Thread.Sleep(200);
// checkflag = filecheck.IsUse(getfile);
//}
if
(
ret
==
0
)
{
Log
.
Info
(
filename
[
i
].
ToString
()
+
" 同步成功"
);
}
}
else
...
...
GcDevicePc/MDIBase.cs
View file @
2ba0fd40
...
...
@@ -591,7 +591,6 @@ namespace GcDevicePc
break
;
}
// LogHelper.I("HMI状态获取", "Run.....");
dest
[
0
]
=
globaldata
.
m_hmibuffer
.
gcinfo
.
batno
;
dest
[
1
]
=
globaldata
.
m_hmibuffer
.
gcinfo
.
batruncount
;
dest
[
2
]
=
globaldata
.
m_hmibuffer
.
gcinfo
.
oneruntime
;
...
...
@@ -602,10 +601,6 @@ namespace GcDevicePc
dest
[
7
]
=
globaldata
.
m_hmibuffer
.
gcinfo
.
hmistatus
;
dest
[
8
]
=
globaldata
.
m_hmibuffer
.
gcinfo
.
runtime
;
//LogHelper.I("methodstatus", dest[5].ToString());
//if(globaldata.connection_ip !=null)
// ret = m_modbus.ReadHoldingReg(144, 9, globaldata.connection_ip, globaldata.datamodbusport, ref dest);
// //ret = globaldata.m_modbus.ReadHoldingReg(144, 9, globaldata.connection_ip, globaldata.datamodbusport, ref dest);
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
)
status_flag
=
dest
[
5
];
...
...
@@ -619,108 +614,42 @@ namespace GcDevicePc
globaldata
.
RunTime_Now
=
dest
[
2
];
globaldata
.
RunTotal_Now
=
dest
[
8
];
//Console.WriteLine("+++++++++++调试信息++++++++++++++");
//Console.WriteLine("批处理序号:" + dest[0].ToString());
//Console.WriteLine("运行次数:" + dest[1].ToString());
//Console.WriteLine("运行多少秒:" + dest[2].ToString());
//Console.WriteLine("单次运行:" + dest[3].ToString());
//Console.WriteLine("运行运行表:" + dest[4].ToString());
//Console.WriteLine("当前运行方法状态:" + dest[5].ToString());
////Console.WriteLine("打开当前方法,等待开始指令:" + dest[6].ToString());
//Console.WriteLine("机器运行状态:" + dest[7].ToString());
////Console.WriteLine("运行总时间:" + dest[8].ToString());
// LogHelper.I("当前运行方法状态", dest[5].ToString());
//Console.WriteLine("+++++++++++错误信息++++++++++++++");
//Console.WriteLine("通讯板错误报警:" + globaldata.m_hmibuffer.gcinfo.ErrorStatus[0].ToString());
//Console.WriteLine("检测板错误报警:" + globaldata.m_hmibuffer.gcinfo.ErrorStatus[1].ToString());
//Console.WriteLine("电源板错误报警:" + globaldata.m_hmibuffer.gcinfo.ErrorStatus[2].ToString());
//Console.WriteLine("异常温度错误报警:" + globaldata.m_hmibuffer.gcinfo.ErrorStatus[3].ToString());
//Console.WriteLine("与主机通讯异常:" + globaldata.m_hmibuffer.gcinfo.ErrorStatus[4].ToString());
if
(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmioffline
)
{
status_flag
=
9
;
// globaldata.connection_ip = null;
}
//if(dest[5] == 3 && dest[7] == 4)
//{
// Console.WriteLine("已就绪!!!!!!!");
//}
if
((
dest
[
5
]
==
4
||
dest
[
5
]
==
5
)
&&
dest
[
7
]
==
4
&&
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
!=
1
)
{
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
=
0
;
// invokeDelegate update_ButtonStatus = () =>
//{
// ChangeButton(2);
//};
//Invoke(update_ButtonStatus);
// startbtn();
}
//点火失败或着火焰熄灭,停止系统
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue && globaldata.m_hmibuffer.gcinfo.FireStatus[0] == 3 && globaldata.m_hmibuffer.gcinfo.methodstatus == 0 && globaldata.m_hmibuffer.gcinfo.hmistatus == 0)
//{
// invokeDelegate auto_close = () =>
// {
// autoclosesys_Click();
// };
// Invoke(auto_close);
//}
//if ( (dest[5] ==0 || dest[5] == 6 || dest[5] == 7 ) && dest[7] == 0 && globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue == 1)
//{
// Console.WriteLine("已就绪,下位机按了停止!!");
//}
//if (dest[5] == 0)
//{
// globaldata.work_Statue = 0;
//}
switch
(
runtype
)
{
case
0
:
//ButtonControl_Status(dest[5], 0);
DataControl_Status
(
dest
[
5
],
0
);
break
;
case
2
:
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
// ButtonControl_Status(dest[5], 2);
DataControl_Status
(
dest
[
5
],
2
);
break
;
case
3
:
QuickRun_HeadInfo
();
// ButtonControl_Status(dest[5], 1);
DataControl_Status
(
dest
[
5
],
1
);
break
;
case
4
:
SingleRun_HeadInfo
();
// ButtonControl_Status(dest[5], 0);
// DataControl_Status(dest[5], 0);
break
;
case
7
:
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
DataControl_Status
(
dest
[
5
],
7
);
break
;
default
:
Common_HeadInfo
();
break
;
}
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
0
)
{
ButtonControl_Status
(
status_flag
);
}
else
{
ButtonControl_Status
(
100
);
}
Status_Show
(
status_flag
,
ref
status_flag_old
);
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
2
)
...
...
@@ -907,11 +836,6 @@ namespace GcDevicePc
if
(
oldflag
!=
flag
)
{
//invokeDelegate update_statustext = () =>
//{
// SetTitleStatueName(status_text, color_flag);
//};
//Invoke(update_statustext);
oldflag
=
flag
;
}
}
...
...
@@ -1536,14 +1460,10 @@ namespace GcDevicePc
globaldata
.
m_configDlg
.
m_RealColDlg
.
reflashContent
();
globaldata
.
m_configDlg
.
m_det
.
reflashContent
();
globaldata
.
m_configDlg
.
m_AuxDlg
.
reflashContent
();
// globaldata.m_configDlg.m_SignalDlg.reflashContent();
// globaldata.m_configDlg.changenameforup -= new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
// globaldata.m_configDlg.changenameforup += new ConfigDlg.ChangeMNameForUp(SetMainFormMethodName);
globaldata
.
m_configDlg
.
sendupdatecmd
-=
new
ConfigDlg
.
SendUpdateCMD
(
SendPCCMD
);
globaldata
.
m_configDlg
.
sendupdatecmd
+=
new
ConfigDlg
.
SendUpdateCMD
(
SendPCCMD
);
globaldata
.
m_configDlg
.
Show
();
// globaldata.m_configDlg.m_RunTableDlg.reflashContent();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment