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
6cac440b
Commit
6cac440b
authored
Jun 19, 2018
by
wangjunqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复远程更新固件99%卡住问题
parent
bb1a29a3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
174 additions
and
155 deletions
+174
-155
GCModbusSlave.cs
GcDevicePc/Common/GCModbusSlave.cs
+134
-125
MethodBase.cs
GcDevicePc/ConfigDlg/MethodBase.cs
+3
-4
MDIBase.cs
GcDevicePc/MDIBase.cs
+3
-5
HMISearch.cs
GcDevicePc/ProThread/HMISearch.cs
+1
-1
RunTables.cs
GcDevicePc/RunTables.cs
+11
-7
UserConfig.cs
GcDevicePc/UserConfig.cs
+11
-1
auxtool.cs
GcDevicePc/auxtool.cs
+11
-12
No files found.
GcDevicePc/Common/GCModbusSlave.cs
View file @
6cac440b
...
@@ -109,13 +109,19 @@ namespace GcDevicePc.Common
...
@@ -109,13 +109,19 @@ namespace GcDevicePc.Common
//}
//}
}
}
if
(
address
>=
4
&&
address
<
20
)
if
(
address
>=
2
&&
address
<
20
)
{
{
switch
(
address
)
switch
(
address
)
{
{
case
2
:
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
break
;
case
3
:
case
3
:
{
{
value
=
SharedSpace
.
Data
.
change
==
true
?
(
ushort
)
1
:
(
ushort
)
0
;
value
=
SharedSpace
.
Data
.
change
==
true
?
(
ushort
)
1
:
(
ushort
)
0
;
}
}
break
;
break
;
case
4
:
case
4
:
...
@@ -135,7 +141,7 @@ namespace GcDevicePc.Common
...
@@ -135,7 +141,7 @@ namespace GcDevicePc.Common
break
;
break
;
case
7
:
//设备联机状态
case
7
:
//设备联机状态
{
{
value
=
(
ushort
)
(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmioffline
?
1
:
0
);
value
=
(
ushort
)
(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmioffline
?
1
:
0
);
}
}
break
;
break
;
case
8
:
//HMI状态
case
8
:
//HMI状态
...
@@ -147,7 +153,7 @@ namespace GcDevicePc.Common
...
@@ -147,7 +153,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
*
10
);
}
}
else
else
{
{
...
@@ -159,7 +165,7 @@ namespace GcDevicePc.Common
...
@@ -159,7 +165,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
*
10
);
}
}
else
else
{
{
...
@@ -171,7 +177,7 @@ namespace GcDevicePc.Common
...
@@ -171,7 +177,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
*
10
);
}
}
else
else
{
{
...
@@ -185,12 +191,13 @@ namespace GcDevicePc.Common
...
@@ -185,12 +191,13 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
0
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
0
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
}
else
}
else
{
{
value
=
0
;
value
=
0
;
}
}
...
@@ -207,11 +214,11 @@ namespace GcDevicePc.Common
...
@@ -207,11 +214,11 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
}
}
else
else
{
{
...
@@ -220,8 +227,9 @@ namespace GcDevicePc.Common
...
@@ -220,8 +227,9 @@ namespace GcDevicePc.Common
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
*
10
);
}
else
}
else
{
{
value
=
0
;
value
=
0
;
}
}
...
@@ -233,16 +241,17 @@ namespace GcDevicePc.Common
...
@@ -233,16 +241,17 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
*
10
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
*
10
);
}
else
}
else
{
{
value
=
0
;
value
=
0
;
}
}
...
@@ -281,7 +290,7 @@ namespace GcDevicePc.Common
...
@@ -281,7 +290,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFront
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFront
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
*
1000
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
*
1000
);
}
}
else
else
{
{
...
@@ -293,7 +302,7 @@ namespace GcDevicePc.Common
...
@@ -293,7 +302,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
iDetValue
*
1000
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
iDetValue
*
1000
);
}
}
else
else
{
{
...
@@ -305,7 +314,7 @@ namespace GcDevicePc.Common
...
@@ -305,7 +314,7 @@ namespace GcDevicePc.Common
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
)
{
{
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
bDetValue
*
1000
);
value
=
(
ushort
)
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
bDetValue
*
1000
);
}
}
else
else
{
{
...
...
GcDevicePc/ConfigDlg/MethodBase.cs
View file @
6cac440b
...
@@ -341,7 +341,6 @@ namespace GcDevicePc.ConfigDlg
...
@@ -341,7 +341,6 @@ namespace GcDevicePc.ConfigDlg
string
tmp
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
;
string
tmp
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
;
ret
=
mainclient
.
WtClientCopytoServer
(
"SingleAnal.ini"
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
,
globaldata
.
remoteFolder
+
"仪器方法\\"
);
ret
=
mainclient
.
WtClientCopytoServer
(
"SingleAnal.ini"
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
,
globaldata
.
remoteFolder
+
"仪器方法\\"
);
tmp
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
.
Substring
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
.
LastIndexOf
(
"\\"
)
+
1
);
tmp
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
.
Substring
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
.
LastIndexOf
(
"\\"
)
+
1
);
Thread
.
Sleep
(
1000
);
ret
=
mainclient
.
WtClientCopytoServer
(
tmp
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
,
globaldata
.
remoteFolder
+
"仪器方法\\"
);
ret
=
mainclient
.
WtClientCopytoServer
(
tmp
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_MethodName
,
globaldata
.
remoteFolder
+
"仪器方法\\"
);
mainclient
.
WtClientClose
();
mainclient
.
WtClientClose
();
...
@@ -355,8 +354,8 @@ namespace GcDevicePc.ConfigDlg
...
@@ -355,8 +354,8 @@ namespace GcDevicePc.ConfigDlg
sendupdatecmd
(
true
);
sendupdatecmd
(
true
);
}
}
string
message
=
"提交成功!"
;
//
string message = "提交成功!";
MessageBox
.
Show
(
message
,
"提示信息"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
//
MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
...
@@ -383,7 +382,7 @@ namespace GcDevicePc.ConfigDlg
...
@@ -383,7 +382,7 @@ namespace GcDevicePc.ConfigDlg
MessageBox
.
Show
(
message
,
"提示信息"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
MessageBox
.
Show
(
message
,
"提示信息"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
}
}
}
}
//
this.Close();
this
.
Close
();
}
}
private
void
MethodBase_Activated
(
object
sender
,
EventArgs
e
)
private
void
MethodBase_Activated
(
object
sender
,
EventArgs
e
)
...
...
GcDevicePc/MDIBase.cs
View file @
6cac440b
...
@@ -691,21 +691,19 @@ namespace GcDevicePc
...
@@ -691,21 +691,19 @@ namespace GcDevicePc
switch
(
runtype
)
switch
(
runtype
)
{
{
case
0
:
case
0
:
DataControl_Status
(
dest
[
5
],
0
);
DataControl_Status
(
dest
[
5
],
0
);
break
;
break
;
case
2
:
case
2
:
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
DataControl_Status
(
dest
[
5
],
2
);
DataControl_Status
(
dest
[
5
],
2
);
break
;
break
;
case
3
:
case
3
:
QuickRun_HeadInfo
();
QuickRun_HeadInfo
();
DataControl_Status
(
dest
[
5
],
1
);
DataControl_Status
(
dest
[
5
],
1
);
break
;
break
;
case
4
:
case
4
:
SingleRun_HeadInfo
();
SingleRun_HeadInfo
();
DataControl_Status
(
dest
[
5
],
1
);
break
;
break
;
default
:
default
:
...
...
GcDevicePc/ProThread/HMISearch.cs
View file @
6cac440b
...
@@ -172,7 +172,7 @@ namespace GcDevicePc.ProThread
...
@@ -172,7 +172,7 @@ namespace GcDevicePc.ProThread
//m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[20], pBuf[21], pBuf[22], pBuf[23]);
//m_DeviceInfo.Netmask = String.Format("{0}.{1}.{2}.{3}", pBuf[20], pBuf[21], pBuf[22], pBuf[23]);
//m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[24], pBuf[25], pBuf[26], pBuf[27]);
//m_DeviceInfo.Gateway = String.Format("{0}.{1}.{2}.{3}", pBuf[24], pBuf[25], pBuf[26], pBuf[27]);
m_DeviceInfo
.
MacAddr
=
String
.
Format
(
"{0
}:{1}:{2}:{3}:{4}:{5
}"
,
pBuf
[
106
],
pBuf
[
107
],
pBuf
[
108
],
pBuf
[
109
],
pBuf
[
110
],
pBuf
[
111
]);
m_DeviceInfo
.
MacAddr
=
String
.
Format
(
"{0
:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2
}"
,
pBuf
[
106
],
pBuf
[
107
],
pBuf
[
108
],
pBuf
[
109
],
pBuf
[
110
],
pBuf
[
111
]);
m_DeviceInfo
.
IpAddr
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
112
],
pBuf
[
113
],
pBuf
[
114
],
pBuf
[
115
]);
m_DeviceInfo
.
IpAddr
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
112
],
pBuf
[
113
],
pBuf
[
114
],
pBuf
[
115
]);
m_DeviceInfo
.
Netmask
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
116
],
pBuf
[
117
],
pBuf
[
118
],
pBuf
[
119
]);
m_DeviceInfo
.
Netmask
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
116
],
pBuf
[
117
],
pBuf
[
118
],
pBuf
[
119
]);
m_DeviceInfo
.
Gateway
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
120
],
pBuf
[
121
],
pBuf
[
122
],
pBuf
[
123
]);
m_DeviceInfo
.
Gateway
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
120
],
pBuf
[
121
],
pBuf
[
122
],
pBuf
[
123
]);
...
...
GcDevicePc/RunTables.cs
View file @
6cac440b
...
@@ -443,18 +443,22 @@ namespace GcDevicePc
...
@@ -443,18 +443,22 @@ namespace GcDevicePc
{
{
if
(
!
String
.
IsNullOrEmpty
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
)
&&
!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
if
(
!
String
.
IsNullOrEmpty
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
)
&&
!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
{
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
=
2
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
=
2
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
this
.
tabrun
.
Enabled
=
false
;
this
.
tabrun
.
Enabled
=
false
;
if
(
File
.
Exists
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
))
{
FileServerClient
bfclient
=
new
FileServerClient
();
FileServerClient
bfclient
=
new
FileServerClient
();
bfclient
.
WtClientInit
(
globaldata
.
connection_ip
,
globaldata
.
fileserverport
);
bfclient
.
WtClientInit
(
globaldata
.
connection_ip
,
globaldata
.
fileserverport
);
bfclient
.
WtClientCopytoServer
(
"RunMethod.ini"
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
,
globaldata
.
remoteFolder
+
"运行表\\"
);
bfclient
.
WtClientCopytoServer
(
"RunMethod.ini"
,
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
,
globaldata
.
remoteFolder
+
"运行表\\"
);
bfclient
.
WtClientClose
();
bfclient
.
WtClientClose
();
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_RunTab
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_RunTab
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
config_RunTab
;
}
sendupdatecmd
(
false
);
sendupdatecmd
(
false
);
this
.
tabrun
.
Enabled
=
true
;
this
.
tabrun
.
Enabled
=
true
;
...
...
GcDevicePc/UserConfig.cs
View file @
6cac440b
...
@@ -152,7 +152,17 @@ namespace GcDevicePc
...
@@ -152,7 +152,17 @@ namespace GcDevicePc
string
opensys
=
test
.
INIGetStringValue
(
"StartUp"
,
"打开系统"
,
null
);
string
opensys
=
test
.
INIGetStringValue
(
"StartUp"
,
"打开系统"
,
null
);
string
runtype
=
test
.
INIGetStringValue
(
"StartUp"
,
"运行类型"
,
null
);
string
runtype
=
test
.
INIGetStringValue
(
"StartUp"
,
"运行类型"
,
null
);
if
(
String
.
IsNullOrEmpty
(
MAC
))
{
this
.
label1
.
Text
=
"目前Mac(未绑定):"
;
this
.
label3
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
;
}
else
{
this
.
label3
.
Text
=
MAC
;
this
.
label3
.
Text
=
MAC
;
}
if
(
Convert
.
ToInt32
(
value
)
==
1
)
if
(
Convert
.
ToInt32
(
value
)
==
1
)
{
{
...
...
GcDevicePc/auxtool.cs
View file @
6cac440b
...
@@ -59,7 +59,7 @@ namespace GcDevicePc
...
@@ -59,7 +59,7 @@ namespace GcDevicePc
this
.
label4
.
Text
=
ipos
.
ToString
()
+
"/100"
;
this
.
label4
.
Text
=
ipos
.
ToString
()
+
"/100"
;
this
.
progressBar1
.
Value
=
Convert
.
ToInt32
(
ipos
);
this
.
progressBar1
.
Value
=
Convert
.
ToInt32
(
ipos
);
if
(
ipos
==
100
)
if
(
ipos
==
100
||
send_ok
)
{
{
this
.
label4
.
Text
=
"传输完成"
;
this
.
label4
.
Text
=
"传输完成"
;
this
.
runbtn
.
Enabled
=
true
;
this
.
runbtn
.
Enabled
=
true
;
...
@@ -180,7 +180,7 @@ namespace GcDevicePc
...
@@ -180,7 +180,7 @@ namespace GcDevicePc
this
.
localpath
=
file
;
// Path.GetDirectoryName(file);
this
.
localpath
=
file
;
// Path.GetDirectoryName(file);
//this.localstr.Text = this.localpath;
//this.localstr.Text = this.localpath;
//this.ProName.Text = this.updateexe;
//this.ProName.Text = this.updateexe;
this
.
ProName
.
Text
=
this
.
localpath
+
this
.
updateexe
;
this
.
ProName
.
Text
=
this
.
localpath
;
this
.
updatebtn
.
Enabled
=
true
;
this
.
updatebtn
.
Enabled
=
true
;
}
}
...
@@ -209,17 +209,17 @@ namespace GcDevicePc
...
@@ -209,17 +209,17 @@ namespace GcDevicePc
send_Thread
.
IsBackground
=
true
;
send_Thread
.
IsBackground
=
true
;
send_Thread
.
Start
();
send_Thread
.
Start
();
for
(
int
i
=
0
;
i
<
2
00
;
i
++)
for
(
int
i
=
0
;
i
<
1
00
;
i
++)
{
{
if
(
send_ok
)
if
(
send_ok
)
{
{
SetTextMesssage
(
100
,
i
.
ToString
()
+
"\r\n"
);
SetTextMesssage
(
100
,
i
.
ToString
()
+
"\r\n"
);
}
else
}
else
{
{
System
.
Threading
.
Thread
.
Sleep
(
1
00
);
Thread
.
Sleep
(
2
00
);
SetTextMesssage
(
100
*
i
/
200
,
i
.
ToString
()
+
"\r\n"
);
SetTextMesssage
(
i
,
i
.
ToString
()
+
"\r\n"
);
if
(
i
==
199
)
if
(
i
==
95
)
{
{
i
--;
i
--;
}
}
...
@@ -233,12 +233,11 @@ namespace GcDevicePc
...
@@ -233,12 +233,11 @@ namespace GcDevicePc
int
ret
;
int
ret
;
FileServerClient
singlesend
=
new
FileServerClient
();
FileServerClient
singlesend
=
new
FileServerClient
();
singlesend
.
WtClientInit
(
HmiIP
,
HmiPort
);
singlesend
.
WtClientInit
(
HmiIP
,
HmiPort
);
ret
=
singlesend
.
WtClientCopytoServer
(
this
.
updateexe
,
this
.
localpath
,
globaldata
.
exeremoteFolder
);
ret
=
singlesend
.
WtClientCopytoServer
NoDelay
(
this
.
updateexe
,
this
.
localpath
,
globaldata
.
exeremoteFolder
);
if
(
ret
==
1
)
if
(
ret
==
1
)
{
{
this
.
send_ok
=
true
;
this
.
send_ok
=
true
;
//MessageBox.Show("更新成功");
}
}
singlesend
.
WtClientClose
();
singlesend
.
WtClientClose
();
...
@@ -379,11 +378,11 @@ namespace GcDevicePc
...
@@ -379,11 +378,11 @@ namespace GcDevicePc
fullfilename
=
NextFile
.
FullName
;
fullfilename
=
NextFile
.
FullName
;
singlesend
.
WtClientCopytoServer
(
NextFile
.
Name
,
fullfilename
,
globaldata
.
updateremoteFolder
);
singlesend
.
WtClientCopytoServer
NoDelay
(
NextFile
.
Name
,
fullfilename
,
globaldata
.
updateremoteFolder
);
Console
.
WriteLine
(
NextFile
.
Name
);
//
Console.WriteLine(NextFile.Name);
Console
.
WriteLine
(
fullfilename
);
//
Console.WriteLine(fullfilename);
Console
.
WriteLine
(
globaldata
.
updateremoteFolder
);
//
Console.WriteLine( globaldata.updateremoteFolder);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
}
}
...
...
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