Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
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
潘栩锋
hemei
Commits
4032422a
Commit
4032422a
authored
Jan 23, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在 PLCProxySystem.plc_NameDataChanged 加入线程同步!!!
parent
b0445e04
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
PollModule.cs
Project.FLY.FObjSys/FObjSys/PollModule.cs
+3
-0
FLY.IBC.UI.Client.csproj
Project.FLY.IBC/FLY.IBC.UI.Client/FLY.IBC.UI.Client.csproj
+2
-2
ModbusMapper_Client.cs
...Mapper/FLY.ModbusMapper/WithThread/ModbusMapper_Client.cs
+1
-1
PLCProxySystem.cs
....FLY.OBJComponents/OBJComponents/Server/PLCProxySystem.cs
+12
-5
No files found.
Project.FLY.FObjSys/FObjSys/PollModule.cs
View file @
4032422a
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Threading
;
namespace
FObjBase
{
...
...
@@ -220,6 +221,7 @@ namespace FObjBase
}
static
DateTime
dt_last
=
DateTime
.
Now
;
System
.
Windows
.
Threading
.
DispatcherTimer
timer
;
public
Dispatcher
Dispatcher
;
/// <summary>
/// 不需要自己创建实例,因为已经创建了静态的对象
/// </summary>
...
...
@@ -236,6 +238,7 @@ namespace FObjBase
mylock
=
false
;
}
};
Dispatcher
=
timer
.
Dispatcher
;
}
bool
mylock
=
false
;
/// <summary>
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/FLY.IBC.UI.Client.csproj
View file @
4032422a
...
...
@@ -44,10 +44,10 @@
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"LiveCharts, Version=0.9.7.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL"
>
<HintPath>
..\packages\LiveCharts.0.9.7\lib\net40\LiveCharts.dll
</HintPath>
<HintPath>
..\
..\
packages\LiveCharts.0.9.7\lib\net40\LiveCharts.dll
</HintPath>
</Reference>
<Reference
Include=
"LiveCharts.Wpf, Version=0.9.7.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL"
>
<HintPath>
..\packages\LiveCharts.Wpf.0.9.7\lib\net40\LiveCharts.Wpf.dll
</HintPath>
<HintPath>
..\
..\
packages\LiveCharts.Wpf.0.9.7\lib\net40\LiveCharts.Wpf.dll
</HintPath>
</Reference>
<Reference
Include=
"PropertyChanged2, Version=2.5.13.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\PropertyChanged2.Fody.2.5.13\lib\net40\PropertyChanged2.dll
</HintPath>
...
...
Project.FLY.ModbusMapper/FLY.ModbusMapper/WithThread/ModbusMapper_Client.cs
View file @
4032422a
...
...
@@ -155,7 +155,7 @@ namespace FLY.Modbus.WithThread
TimeSpan
elapsed
=
stopwatch
.
Elapsed
;
ActUpdateInterval
=
elapsed
;
stopwatch
.
Restart
();
if
(!
UpdateReadData
())
{
if
(
cts
.
IsCancellationRequested
)
//可能是外部强制关闭
...
...
Project.FLY.OBJComponents/OBJComponents/Server/PLCProxySystem.cs
View file @
4032422a
...
...
@@ -5,6 +5,7 @@ using System.ComponentModel;
using
System.Linq
;
using
System.Text
;
using
FLY.Modbus
;
using
System.Windows.Threading
;
namespace
FLY.OBJComponents.Server
{
...
...
@@ -98,12 +99,18 @@ namespace FLY.OBJComponents.Server
//var plc = sender as Modbus.WithThread.ModbusMapper_Client;
//object value = plc.GetNameData(e.Owener, e.PropertyName);
//这是从PLC 更新过来的,不需要向PLC写入
isShield
=
true
;
//Misc.PropertiesManager.SetValue(e.Owener, e.PropertyName, value);
Misc
.
PropertiesManager
.
SetValue
(
dr
.
owner
,
dr
.
propertyName
,
dr
.
value
);
// ce.PropertyName, value);
isShield
=
false
;
}
FObjBase
.
PollModule
.
Current
.
Dispatcher
.
Invoke
(
new
SetValueHandler
((
owner
,
propertyname
,
value
)
=>
{
isShield
=
true
;
Misc
.
PropertiesManager
.
SetValue
(
dr
.
owner
,
dr
.
propertyName
,
dr
.
value
);
isShield
=
false
;
}),
dr
.
owner
,
dr
.
propertyName
,
dr
.
value
);
}
delegate
void
SetValueHandler
(
object
owner
,
string
propertyname
,
object
value
);
/// <summary>
/// 设置更新计划
/// </summary>
...
...
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