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
bb89f0e3
Commit
bb89f0e3
authored
Jan 08, 2022
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成 IBC 升级为 V7
parent
95a11ca0
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
539 additions
and
259 deletions
+539
-259
FLY.IBC.UI.Client.csproj
Project.FLY.IBC/FLY.IBC.UI.Client/FLY.IBC.UI.Client.csproj
+4
-0
PgMenu.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/PgMenu.xaml.cs
+2
-3
PgMenu2.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/PgMenu2.xaml.cs
+2
-3
PgSystem.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/PgSystem.xaml.cs
+2
-1
PgSystem2.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/PgSystem2.xaml.cs
+3
-1
PgTempAreaParam.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/PgTempAreaParam.xaml.cs
+4
-1
MainPanel2.xaml.cs
...ect.FLY.IBC/FLY.IBC.UI.Client/UIModule/MainPanel2.xaml.cs
+2
-1
MainPanel3.xaml.cs
...ect.FLY.IBC/FLY.IBC.UI.Client/UIModule/MainPanel3.xaml.cs
+2
-1
DynAreaIbc.xaml
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/DynAreaIbc.xaml
+2
-36
DynAreaIbc.xaml.cs
...ect.FLY.IBC/FLY.IBC.UI.Client/UiModule/DynAreaIbc.xaml.cs
+10
-119
MainPanel.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/MainPanel.xaml.cs
+2
-1
TempAreaPanel.xaml.cs
....FLY.IBC/FLY.IBC.UI.Client/UiModule/TempAreaPanel.xaml.cs
+4
-2
WdK123.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/WdK123.xaml.cs
+12
-9
WdTempAreaSet.xaml.cs
....FLY.IBC/FLY.IBC.UI.Client/UiModule/WdTempAreaSet.xaml.cs
+4
-1
FLY.IBC.UI.Server.csproj
Project.FLY.IBC/FLY.IBC.UI.Server/FLY.IBC.UI.Server.csproj
+21
-0
MainWindow.xaml
Project.FLY.IBC/FLY.IBC.UI.Server/MainWindow.xaml
+7
-37
MainWindow.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Server/MainWindow.xaml.cs
+24
-18
PgLoading.xaml
Project.FLY.IBC/FLY.IBC.UI.Server/PgLoading.xaml
+12
-0
PgLoading.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Server/PgLoading.xaml.cs
+36
-0
PgMain.xaml
Project.FLY.IBC/FLY.IBC.UI.Server/PgMain.xaml
+56
-0
PgMain.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Server/PgMain.xaml.cs
+142
-0
AssemblyInfo.cs
Project.FLY.IBC/FLY.IBC.UI.Server/Properties/AssemblyInfo.cs
+4
-4
WdDRList.xaml
Project.FLY.IBC/FLY.IBC.UI.Server/WdDRList.xaml
+12
-0
WdDRList.xaml.cs
Project.FLY.IBC/FLY.IBC.UI.Server/WdDRList.xaml.cs
+141
-0
IbcSystemServiceClient.cs
Project.FLY.IBC/FLY.IBC/Client/IbcSystemServiceClient.cs
+1
-7
OBJProxy.cs
Project.FLY.IBC/FLY.IBC/Server.OBJProxy/OBJProxy.cs
+3
-1
IBCSystem.cs
Project.FLY.IBC/FLY.IBC/Server/IBCSystem.cs
+2
-2
TDGage.cs
Project.FLY.IBC/FLY.IBC/Server/TDGage.cs
+23
-11
No files found.
Project.FLY.IBC/FLY.IBC.UI.Client/FLY.IBC.UI.Client.csproj
View file @
bb89f0e3
...
...
@@ -289,6 +289,10 @@
<Project>
{119c3adc-f8e1-4f72-b89b-006236ff8586}
</Project>
<Name>
FLY.ControlLibrary
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\thick_public\Project.FLY.FObjSys\FObjBaseReflect\FObjBase.Reflect.csproj"
>
<Project>
{15F40C32-D546-4B2A-8D80-B3DDBCDAA690}
</Project>
<Name>
FObjBase.Reflect
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\thick_public\Project.FLY.FObjSys\FObjSys\FObjBase.csproj"
>
<Project>
{abfe87d4-b692-4ae9-a8c0-1f470b8acbb8}
</Project>
<Name>
FObjBase
</Name>
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/PgMenu.xaml.cs
View file @
bb89f0e3
...
...
@@ -49,9 +49,8 @@ namespace FLY.IBC.UI.Client
private
void
button_error_Click
(
object
sender
,
RoutedEventArgs
e
)
{
PgErrorTable2
p
=
new
PgErrorTable2
();
var
warningReasonWindow
=
container
.
Resolve
<
WarningReasonWindow
>(
"ibcWarningReasonWindow"
);
var
warningService
=
container
.
Resolve
<
IWarningService
>(
"ibcWarningService"
);
p
.
Init
(
container
,
warningService
,
warningReasonWindow
);
var
warningService
=
container
.
Resolve
<
IWarningSystem2Service
>(
"ibcWarningService"
);
p
.
Init
(
container
,
warningService
);
NavigationService
.
Navigate
(
p
);
}
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/PgMenu2.xaml.cs
View file @
bb89f0e3
...
...
@@ -55,9 +55,8 @@ namespace FLY.IBC.UI.Client
private
void
button_error_Click
(
object
sender
,
RoutedEventArgs
e
)
{
PgErrorTable2
p
=
new
PgErrorTable2
();
var
warningReasonWindow
=
container
.
Resolve
<
WarningReasonWindow
>(
"ibcWarningReasonWindow"
);
var
warningService
=
container
.
Resolve
<
IWarningService
>(
"ibcWarningService"
);
p
.
Init
(
container
,
warningService
,
warningReasonWindow
);
var
warningService
=
container
.
Resolve
<
IWarningSystem2Service
>(
"ibcWarningService"
);
p
.
Init
(
container
,
warningService
);
NavigationService
.
Navigate
(
p
);
}
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/PgSystem.xaml.cs
View file @
bb89f0e3
...
...
@@ -40,9 +40,10 @@ namespace FLY.IBC.UI.Client
grid_ibc
.
DataContext
=
iBCSystemClient
.
Item
;
//注册属性更新计划
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
iBCSystemClient
.
PLCos
,
iBCSystemClient
.
Item
,
objname
,
new
string
[]
{
nameof
(
FLY
.
IBC
.
Common
.
IBCData
.
SampleInterval
),
nameof
(
FLY
.
IBC
.
Common
.
IBCData
.
Area1Set
),
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/PgSystem2.xaml.cs
View file @
bb89f0e3
...
...
@@ -40,9 +40,11 @@ namespace FLY.IBC.UI.Client
grid_ibc
.
DataContext
=
iBCSystemClient
.
Item
;
//注册属性更新计划
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
iBCSystemClient
.
PLCos
,
iBCSystemClient
.
Item
,
objname
,
new
string
[]
{
nameof
(
FLY
.
IBC
.
Common
.
IBCData
.
SampleInterval
),
nameof
(
FLY
.
IBC
.
Common
.
IBCData
.
Area1Set
),
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/PgTempAreaParam.xaml.cs
View file @
bb89f0e3
...
...
@@ -75,9 +75,12 @@ namespace FLY.IBC.UI.Client
this
.
ibcSystemService
=
iBCSystemService
;
//注册属性更新计划
int
index
=
iBCSystemService
.
TAreas
.
IndexOf
(
tempArea
);
string
objname
=
$"
{
nameof
(
IIbcSystemService
.
TAreas
)}
[
{
index
}
]"
;
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
iBCSystemService
.
PLCos
,
tempArea
,
objname
,
update_propertynames
);
this
.
tempArea
=
tempArea
;
this
.
DataContext
=
tempArea
;
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UIModule/MainPanel2.xaml.cs
View file @
bb89f0e3
...
...
@@ -43,9 +43,10 @@ namespace FLY.IBC.UI.Client.UiModule
this
.
ibcSystemService
=
ibcSystemService
;
grid_ibc
.
DataContext
=
ibcSystemService
.
Item
;
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
ibcSystemService
.
PLCos
,
ibcSystemService
.
Item
,
objname
,
new
string
[]
{
nameof
(
IBC
.
Common
.
IBCData
.
IsIBCAuto
),
nameof
(
IBC
.
Common
.
IBCData
.
FilmWidth
),
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UIModule/MainPanel3.xaml.cs
View file @
bb89f0e3
...
...
@@ -43,9 +43,10 @@ namespace FLY.IBC.UI.Client.UiModule
this
.
ibcSystemService
=
ibcSystemService
;
grid_ibc
.
DataContext
=
ibcSystemService
.
Item
;
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
ibcSystemService
.
PLCos
,
ibcSystemService
.
Item
,
objname
,
new
string
[]
{
nameof
(
IBC
.
Common
.
IBCData
.
IsIBCAuto
),
nameof
(
IBC
.
Common
.
IBCData
.
FilmWidth
),
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/DynAreaIbc.xaml
View file @
bb89f0e3
...
...
@@ -26,16 +26,14 @@
<Setter Property="SnapsToDevicePixels" Value="True"/>
</Style>
<local:DynAreaViewModelParams x:Key="unitests_props" IsError="False" Error="报警MSG"/>
</ResourceDictionary>
</UserControl.Resources>
<Button Style="{StaticResource
ButtonStyle_empty}" Background="Transparent" Click="Button_Click"
>
<Button Style="{StaticResource
Styles.Button.Empty}" Background="Transparent"
>
<Grid Height="125">
<Grid x:Name="grid_ibc" d:DataContext="{StaticResource unitests_ibc}"/>
<Grid x:Name="grid_error" d:DataContext="{StaticResource unitests_props}"/>
<Border Style="{StaticResource
BorderStyle_module
}"
<Border Style="{StaticResource
Styles.Module.Border
}"
DataContext="{Binding DataContext,ElementName=grid_ibc}"
Background="{StaticResource Color_background}">
<Grid>
...
...
@@ -105,38 +103,6 @@
</Grid>
</Grid>
</Border>
<Border Style="{StaticResource BorderStyle_module}" Background="{StaticResource Brushes.Validation}"
DataContext="{Binding DataContext,ElementName=grid_error}"
Visibility="{Binding IsError,Converter={StaticResource visbilityconv}}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Path Margin="5" Fill="White" Stretch="Uniform" Width="60" Height="60" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}" >
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding IsError}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever" >
<DoubleAnimation BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="00:00:01" />
<DoubleAnimation BeginTime="0:0:1" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="00:00:01" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<TextBlock Grid.Column="1" Margin="5" VerticalAlignment="Center" TextWrapping="Wrap" FontSize="22" Foreground="White" Text="{Binding Error}"/>
</Grid>
</Border>
</Grid>
</Button>
</UserControl>
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/DynAreaIbc.xaml.cs
View file @
bb89f0e3
...
...
@@ -23,6 +23,7 @@ using FLY.OBJComponents.Common;
using
FLY.OBJComponents.IService
;
using
FLY.Thick.Base.UI
;
using
FObjBase
;
using
FObjBase.Reflect
;
using
MultiLayout
;
using
MultiLayout.UiModule
;
using
Unity
;
...
...
@@ -41,11 +42,6 @@ namespace FLY.IBC.UI.Client.UiModule
IUnityContainer
container
;
IIbcSystemService
ibcSystemService
;
WarningReasonWindow
warningReasonWindow
;
IWarningService
warningService
;
DispatcherTimer
timer_error
;
DynAreaViewModelParams
props
=
new
DynAreaViewModelParams
();
SetPLCUpdatePlan
setPlan
;
public
DynAreaIbc
()
{
...
...
@@ -55,134 +51,29 @@ namespace FLY.IBC.UI.Client.UiModule
[
InjectionMethod
]
public
void
Init
(
IUnityContainer
container
,
[
Dependency
(
"ibcWarningReasonWindow"
)]
WarningReasonWindow
warningReasonWindow
,
[
Dependency
(
"ibcWarningService"
)]
IWarningService
warningService
,
IIbcSystemService
ibcSystemService
)
{
this
.
container
=
container
;
this
.
ibcSystemService
=
ibcSystemService
;
//创建窗口观察 报警原因列表
this
.
warningReasonWindow
=
warningReasonWindow
;
this
.
warningService
=
warningService
;
//报警原因轮流显示
timer_error
=
new
DispatcherTimer
();
timer_error
.
Interval
=
TimeSpan
.
FromSeconds
(
3
);
timer_error
.
Tick
+=
(
s
,
e
)
=>
{
reason_list_index
--;
if
(
reason_list_index
<
0
)
reason_list_index
=
warningReasonWindow
.
Record
.
Count
();
updateError
();
};
warningReasonWindow
.
Record
.
CollectionChanged
+=
Record_CollectionChanged
;
grid_ibc
.
DataContext
=
this
.
ibcSystemService
.
Item
;
grid_error
.
DataContext
=
props
;
//注册属性更新计划
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
this
.
ibcSystemService
.
PLCos
,
this
.
ibcSystemService
.
Item
,
objname
,
new
string
[]
{
"FilmWidth"
,
"IsInletAirOn"
,
"InletAirFreq"
,
"IsOutletAirOn"
,
"OutletAirFreq"
});
this
.
ibcSystemService
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
"IsConnected"
)
{
updateError01
();
}
};
updateError01
();
}
private
void
Record_CollectionChanged
(
object
sender
,
System
.
Collections
.
Specialized
.
NotifyCollectionChangedEventArgs
e
)
{
reason_list_index
=
warningReasonWindow
.
Record
.
Count
()
-
1
;
updateError01
();
}
void
updateError01
()
{
FObjBase
.
PollModule
.
Current
.
Poll_JustOnce
(
new
FObjBase
.
PollModule
.
PollHandler
(
delegate
()
{
reason_list_index
=
warningReasonWindow
.
Record
.
Count
()
-
1
;
updateError
();
}),
this
,
MARKNO_UPDATEERROR
);
}
void
updateError
()
{
if
(
ibcSystemService
is
FObjServiceClient
)
{
var
objClient
=
ibcSystemService
as
FObjServiceClient
;
if
(!
objClient
.
IsConnected
)
{
props
.
Error
=
"IBC服务器连接断开"
;
props
.
IsError
=
true
;
reason_list_index
=
-
1
;
timer_error
.
Stop
();
return
;
}
}
if
(
warningReasonWindow
.
Record
.
Count
==
0
)
{
props
.
IsError
=
false
;
props
.
Error
=
""
;
reason_list_index
=
-
1
;
timer_error
.
Stop
();
return
;
}
if
(
reason_list_index
>=
warningReasonWindow
.
Record
.
Count
)
reason_list_index
=
warningReasonWindow
.
Record
.
Count
-
1
;
else
if
(
reason_list_index
<
0
)
reason_list_index
=
0
;
props
.
Error
=
warningReasonWindow
.
Record
[
reason_list_index
].
Description
;
props
.
IsError
=
true
;
timer_error
.
Start
();
}
private
int
reason_list_index
=
-
1
;
private
void
Button_Click
(
object
sender
,
RoutedEventArgs
e
)
{
PgErrorTable2
p
=
new
PgErrorTable2
();
p
.
Init
(
container
,
warningService
,
warningReasonWindow
);
FlyLayoutManager
.
NavigationService
.
Navigate
(
p
);
nameof
(
IIbcSystemService
.
Item
.
FilmWidth
),
nameof
(
IIbcSystemService
.
Item
.
IsInletAirOn
),
nameof
(
IIbcSystemService
.
Item
.
InletAirFreq
),
nameof
(
IIbcSystemService
.
Item
.
IsOutletAirOn
),
nameof
(
IIbcSystemService
.
Item
.
OutletAirFreq
)
});
}
}
public
class
DynAreaViewModelParams
:
INotifyPropertyChanged
{
/// <summary>
/// 有异常
/// </summary>
public
bool
IsError
{
get
;
set
;
}
/// <summary>
/// 异常消息
/// </summary>
public
string
Error
{
get
;
set
;
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
}
public
class
UiModule2_DynAreaIbc
:
IUiModule2
{
/// <summary>
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/MainPanel.xaml.cs
View file @
bb89f0e3
...
...
@@ -43,9 +43,10 @@ namespace FLY.IBC.UI.Client.UiModule
this
.
ibcSystemService
=
ibcSystemService
;
grid_ibc
.
DataContext
=
ibcSystemService
.
Item
;
string
objname
=
nameof
(
IIbcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
ibcSystemService
.
PLCos
,
ibcSystemService
.
Item
,
objname
,
new
string
[]
{
nameof
(
IBC
.
Common
.
IBCData
.
IsIBCAuto
),
nameof
(
IBC
.
Common
.
IBCData
.
FilmWidth
),
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/TempAreaPanel.xaml.cs
View file @
bb89f0e3
...
...
@@ -56,9 +56,10 @@ namespace FLY.IBC.UI.Client.UiModule
for
(
int
i
=
0
;
i
<
this
.
ibcSystemService
.
TAreas
.
Count
();
i
++)
{
string
objname
=
$"
{
nameof
(
IIbcSystemService
.
TAreas
)}
[
{
i
}
]"
;
SetPLCUpdatePlan
plan
=
new
SetPLCUpdatePlan
(
this
.
ibcSystemService
.
PLCos
,
this
.
ibcSystemService
.
TAreas
[
i
]
,
objname
,
update_propertynames
);
setPlan_items
.
Add
(
plan
);
}
...
...
@@ -88,9 +89,10 @@ namespace FLY.IBC.UI.Client.UiModule
int
add_cnt
=
-
remove_cnt
;
for
(
int
i
=
0
;
i
<
add_cnt
;
i
++)
{
string
objname
=
$"
{
nameof
(
IIbcSystemService
.
TAreas
)}
[
{
i
+
start_idx
}
]"
;
SetPLCUpdatePlan
plan
=
new
SetPLCUpdatePlan
(
this
.
ibcSystemService
.
PLCos
,
this
.
ibcSystemService
.
TAreas
[
start_idx
+
i
]
,
objname
,
update_propertynames
);
setPlan_items
.
Add
(
plan
);
}
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/WdK123.xaml.cs
View file @
bb89f0e3
...
...
@@ -31,18 +31,21 @@ namespace FLY.IBC.UI.Client.UiModule
[
InjectionMethod
]
public
void
Init
(
IIbcSystemService
ibcSystemService
)
{
grid_ibc
.
DataContext
=
ibcSystemService
.
Item
;
string
objname
=
nameof
(
ibcSystemService
.
Item
);
setPlan
=
new
FLY
.
OBJComponents
.
Client
.
SetPLCUpdatePlan
(
ibcSystemService
.
PLCos
,
ibcSystemService
.
Item
,
objname
,
new
string
[]
{
"BubbleCorrR"
,
"BubbleCorrA"
,
"BubbleCorrB"
,
"BubbleCorrC"
,
"L"
,
"K1"
,
"K2"
,
"K3"
nameof
(
IIbcSystemService
.
Item
.
BubbleCorrR
)
,
nameof
(
IIbcSystemService
.
Item
.
BubbleCorrA
)
,
nameof
(
IIbcSystemService
.
Item
.
BubbleCorrB
)
,
nameof
(
IIbcSystemService
.
Item
.
BubbleCorrC
)
,
nameof
(
IIbcSystemService
.
Item
.
L
)
,
nameof
(
IIbcSystemService
.
Item
.
K1
)
,
nameof
(
IIbcSystemService
.
Item
.
K2
)
,
nameof
(
IIbcSystemService
.
Item
.
K3
)
});
}
}
...
...
Project.FLY.IBC/FLY.IBC.UI.Client/UiModule/WdTempAreaSet.xaml.cs
View file @
bb89f0e3
...
...
@@ -56,9 +56,12 @@ namespace FLY.IBC.UI.Client.UiModule
this
.
tempArea
=
tempArea
;
this
.
DataContext
=
tempArea
;
int
index
=
ibcSystemService
.
TAreas
.
IndexOf
(
tempArea
);
string
objname
=
$"
{
nameof
(
ibcSystemService
.
TAreas
)}
[
{
index
}
]"
;
setPlan_item
=
new
SetPLCUpdatePlan
(
this
.
ibcSystemService
.
PLCos
,
this
.
tempArea
,
objname
,
update_propertynames
);
tempArea
.
PropertyChanged
+=
TempArea_PropertyChanged
;
...
...
Project.FLY.IBC/FLY.IBC.UI.Server/FLY.IBC.UI.Server.csproj
View file @
bb89f0e3
...
...
@@ -62,6 +62,15 @@
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</ApplicationDefinition>
<Compile
Include=
"PgLoading.xaml.cs"
>
<DependentUpon>
PgLoading.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"PgMain.xaml.cs"
>
<DependentUpon>
PgMain.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"WdDRList.xaml.cs"
>
<DependentUpon>
WdDRList.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"WdSetup.xaml.cs"
>
<DependentUpon>
WdSetup.xaml
</DependentUpon>
</Compile>
...
...
@@ -77,6 +86,18 @@
<DependentUpon>
MainWindow.xaml
</DependentUpon>
<SubType>
Code
</SubType>
</Compile>
<Page
Include=
"PgLoading.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"PgMain.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"WdDRList.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"WdSetup.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
...
...
Project.FLY.IBC/FLY.IBC.UI.Server/MainWindow.xaml
View file @
bb89f0e3
<Window x:Class="FLY.IBC.UI.Server.MainWindow"
<NavigationWindow x:Class="FLY.IBC.UI.Server.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.IBC.UI.Server"
mc:Ignorable="d"
Title="MainWindow" SizeToContent="WidthAndHeight">
<Grid>
<Grid x:Name="grid_plc"/>
<Grid x:Name="grid_plcos"/>
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<TextBlock Text="更新速度" />
<TextBlock Text="{Binding ActUpdateInterval}" FontSize="20"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plcos}">
<TextBlock Text="PLC连接状态" />
<TextBlock Text="{Binding IsConnectedWithPLC}" FontSize="20"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/>
<TextBlock Text="/"/>
<TextBlock Text="{Binding DRCnt}" FontSize="20"/>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button>
</StackPanel>
</Grid>
</Window>
ResizeMode="CanMinimize"
Title="MainWindow" SizeToContent="WidthAndHeight" MinWidth="400" MinHeight="200"
ShowsNavigationUI="False"
Loaded="NavigationWindow_Loaded">
</NavigationWindow>
Project.FLY.IBC/FLY.IBC.UI.Server/MainWindow.xaml.cs
View file @
bb89f0e3
using
System
;
using
FLY.IBC.Server
;
using
FLY.IBC.Server.OBJProxy
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Reflection
;
...
...
@@ -19,38 +21,42 @@ namespace FLY.IBC.UI.Server
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public
partial
class
MainWindow
:
Window
public
partial
class
MainWindow
:
Navigation
Window
{
FLY
.
AppHelper
.
WindowNotifyIconHelper
notifyiconhelper
;
FLY
.
IBC
.
Server
.
TDGage
gage
;
FLY
.
IBC
.
Server
.
OBJProxy
.
OBJProxy
objProxy
;
TDGage
gage
;
OBJProxy
objProxy
;
public
MainWindow
()
{
InitializeComponent
();
PgLoading
p
=
new
PgLoading
();
this
.
Navigate
(
p
);
this
.
Title
=
(
new
Misc
.
Ver
()
{
SrcType
=
typeof
(
MainWindow
)
}).
ToString
();
notifyiconhelper
=
new
AppHelper
.
WindowNotifyIconHelper
(
this
,
this
.
Title
);
this
.
Hide
();
FObjBase
.
PollModule
.
Current
.
Start
();
gage
=
new
FLY
.
IBC
.
Server
.
TDGage
(
"Gage1"
);
objProxy
=
new
IBC
.
Server
.
OBJProxy
.
OBJProxy
(
0
,
gage
);
}
private
async
void
NavigationWindow_Loaded
(
object
sender
,
RoutedEventArgs
_e
)
{
gage
=
new
TDGage
(
"Gage1"
);
await
gage
.
Init
(
);
FLY
.
OBJComponents
.
Server
.
PLCProxySystem
plsos
=
gage
.
mData
.
PLCos
as
FLY
.
OBJComponents
.
Server
.
PLCProxySystem
;
grid_plcos
.
DataContext
=
plsos
;
grid_plc
.
DataContext
=
plsos
.
PLCs
[
0
];
plsos
.
PLCs
[
0
].
UpdateInterval
=
1000
;
}
private
void
btnSetupClick
(
object
sender
,
RoutedEventArgs
e
)
{
WdSetup
w
=
new
WdSetup
();
w
.
Owner
=
this
;
w
.
ShowDialog
();
objProxy
=
new
OBJProxy
(
0
,
gage
);
FObjBase
.
PollModule
.
Current
.
Start
();
this
.
Hide
();
PgMain
p
=
new
PgMain
();
p
.
Init
(
gage
);
this
.
Navigate
(
p
);
this
.
NavigationService
.
RemoveBackEntry
();
}
}
}
Project.FLY.IBC/FLY.IBC.UI.Server/PgLoading.xaml
0 → 100644
View file @
bb89f0e3
<Page x:Class="FLY.IBC.UI.Server.PgLoading"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="PgLoading" >
<Grid>
<TextBlock x:Name="message" VerticalAlignment="Center" HorizontalAlignment="Center" Text="初始化中......" FontSize="24"/>
</Grid>
</Page>
\ No newline at end of file
Project.FLY.IBC/FLY.IBC.UI.Server/PgLoading.xaml.cs
0 → 100644
View file @
bb89f0e3
using
System
;
using
System.Windows.Controls
;
using
System.Windows.Threading
;
namespace
FLY.IBC.UI.Server
{
/// <summary>
/// PgLoading.xaml 的交互逻辑
/// </summary>
public
partial
class
PgLoading
:
Page
{
DispatcherTimer
timer
;
public
PgLoading
()
{
InitializeComponent
();
timer
=
new
DispatcherTimer
();
timer
.
Interval
=
TimeSpan
.
FromSeconds
(
1
);
timer
.
Tick
+=
Timer_Tick
;
timer
.
Start
();
Timer_Tick
(
null
,
null
);
}
int
cnt
=
0
;
private
void
Timer_Tick
(
object
sender
,
EventArgs
e
)
{
string
str
=
""
;
for
(
int
i
=
0
;
i
<
cnt
;
i
++)
{
str
+=
"."
;
}
message
.
Text
=
"初始化中"
+
str
;
cnt
++;
if
(
cnt
>
6
)
cnt
=
0
;
}
}
}
Project.FLY.IBC/FLY.IBC.UI.Server/PgMain.xaml
0 → 100644
View file @
bb89f0e3
<Page x:Class="FLY.IBC.UI.Server.PgMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.IBC.UI.Server"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="PgMain">
<Page.Resources>
<local:TimeSpan2msConverter x:Key="timespan2msConv"/>
<local:PgMainVmUt x:Key="viewModel"/>
</Page.Resources>
<Grid d:DataContext="{StaticResource viewModel}">
<StackPanel>
<ItemsControl x:Name="itemcontrol" ItemsSource="{Binding PLCs}" Margin="5">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" >
<TextBlock Text="更新速度" />
<TextBlock FontSize="20">
<Run Text="{Binding ActUpdateInterval,Converter={StaticResource timespan2msConv}, Mode=OneWay}" />
<Run Text="ms" FontSize="15"/>
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="{Binding Client.RemoteAddr,Mode=OneWay}" />
<TextBlock >
连接状态[<Run Text="{Binding Client.IsConnected,Mode=OneWay}" FontSize="20"/>]
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="异常次数" />
<TextBlock Text="{Binding ErrorCnt}" FontSize="20"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20">
<Run Text="{Binding DRNeedUpdateCnt,Mode=OneWay}"/>/<Run Text="{Binding DRCnt,Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</StackPanel>
<Button Margin="4" Content="..." Height="40" Width="40" Tag="{Binding .}" Click="btnMoreClick"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button>
</StackPanel>
</Grid>
</Page>
Project.FLY.IBC/FLY.IBC.UI.Server/PgMain.xaml.cs
0 → 100644
View file @
bb89f0e3
using
FLY.IBC.Server
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
FLY.IBC.UI.Server
{
/// <summary>
/// PgMain.xaml 的交互逻辑
/// </summary>
public
partial
class
PgMain
:
Page
{
public
PgMain
()
{
InitializeComponent
();
}
public
void
Init
(
TDGage
gage
)
{
FLY
.
OBJComponents
.
Server
.
PLCProxySystem
plsos
=
gage
.
mData
.
PLCos
as
FLY
.
OBJComponents
.
Server
.
PLCProxySystem
;
this
.
itemcontrol
.
ItemsSource
=
plsos
.
PLCs
;
}
private
void
btnSetupClick
(
object
sender
,
RoutedEventArgs
e
)
{
WdSetup
w
=
new
WdSetup
();
w
.
Owner
=
App
.
Current
.
MainWindow
;
w
.
ShowDialog
();
}
private
void
btnMoreClick
(
object
sender
,
RoutedEventArgs
e
)
{
Button
button
=
sender
as
Button
;
var
plc
=
button
.
Tag
as
Modbus
.
WithThread
.
ModbusMapper_Client
;
WdDRList
w
=
new
WdDRList
();
w
.
Init
(
plc
);
w
.
ShowDialog
();
}
}
public
class
PgMainVmUt
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
List
<
ModbusMapperClientView
>
PLCs
{
get
;
set
;
}
public
PgMainVmUt
()
{
PLCs
=
new
List
<
ModbusMapperClientView
>()
{
new
ModbusMapperClientView
(){
ActUpdateInterval
=
TimeSpan
.
FromMilliseconds
(
623
),
Client
=
new
TcpClientView
(){
IsConnected
=
true
,
RemoteAddr
=
"127.168.50.1:502"
},
DRCnt
=
130
,
DRNeedUpdateCnt
=
30
,
ErrorCnt
=
2
},
new
ModbusMapperClientView
(){
ActUpdateInterval
=
TimeSpan
.
FromMilliseconds
(
2623
),
Client
=
new
TcpClientView
(){
IsConnected
=
false
,
RemoteAddr
=
"127.168.50.2:502"
},
DRCnt
=
45
,
DRNeedUpdateCnt
=
40
,
ErrorCnt
=
2
},
new
ModbusMapperClientView
(){
ActUpdateInterval
=
TimeSpan
.
FromMilliseconds
(
123
),
Client
=
new
TcpClientView
(){
IsConnected
=
true
,
RemoteAddr
=
"127.168.50.3:502"
},
DRCnt
=
10
,
DRNeedUpdateCnt
=
3
,
ErrorCnt
=
0
}
};
}
}
public
class
ModbusMapperClientView
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
/// <summary>
/// 实际更新间隔
/// </summary>
public
TimeSpan
ActUpdateInterval
{
get
;
set
;
}
public
int
ErrorCnt
{
get
;
set
;
}
public
int
DRNeedUpdateCnt
{
get
;
set
;
}
public
int
DRCnt
{
get
;
set
;
}
public
TcpClientView
Client
{
get
;
set
;
}
}
public
class
TcpClientView
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
string
RemoteAddr
{
get
;
set
;
}
public
bool
IsConnected
{
get
;
set
;
}
}
public
class
TimeSpan2msConverter
:
IValueConverter
{
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
if
(!(
value
is
TimeSpan
))
return
null
;
return
(
int
)(((
TimeSpan
)
value
).
TotalMilliseconds
);
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
Project.FLY.IBC/FLY.IBC.UI.Server/Properties/AssemblyInfo.cs
View file @
bb89f0e3
...
...
@@ -7,12 +7,12 @@ using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("
FLY.IBC.UI.Server
")]
[assembly: AssemblyTitle("
枫莱尔--IBC服务器
")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("佛山市枫莱尔自动化技术有限公司")]
[assembly: AssemblyProduct("枫莱尔--IBC服务器")]
[assembly: AssemblyCopyright("Copyright © 202
1
FLYAutomation")]
[assembly: AssemblyCopyright("Copyright © 202
2
FLYAutomation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
...
...
@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("
6.36
.0.0")]
[assembly: AssemblyFileVersion("
6.36
.0.0")]
[assembly: AssemblyVersion("
7.0
.0.0")]
[assembly: AssemblyFileVersion("
7.0
.0.0")]
[assembly: Guid("47D1FF95-69E3-40E5-B094-D7DAEAA87AD9")]
Project.FLY.IBC/FLY.IBC.UI.Server/WdDRList.xaml
0 → 100644
View file @
bb89f0e3
<Window x:Class="FLY.IBC.UI.Server.WdDRList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.IBC.UI.Server"
mc:Ignorable="d"
Title="DRList" Height="450" Width="800">
<Grid>
<DataGrid x:Name="dataGrid" AutoGenerateColumns="True" IsReadOnly="True"/>
</Grid>
</Window>
Project.FLY.IBC/FLY.IBC.UI.Server/WdDRList.xaml.cs
0 → 100644
View file @
bb89f0e3
using
FLY.Modbus
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
FLY.IBC.UI.Server
{
/// <summary>
/// DRList.xaml 的交互逻辑
/// </summary>
public
partial
class
WdDRList
:
Window
{
ObservableCollection
<
DataToRegsView
>
dataToRegsViews
=
new
ObservableCollection
<
DataToRegsView
>();
Modbus
.
WithThread
.
ModbusMapper_Client
plc
;
public
WdDRList
()
{
InitializeComponent
();
}
public
void
Init
(
Modbus
.
WithThread
.
ModbusMapper_Client
plc
)
{
this
.
plc
=
plc
;
for
(
int
i
=
0
;
i
<
plc
.
DRmap
.
Count
();
i
++)
{
var
dr
=
plc
.
DRmap
[
i
];
//获取描述
var
type
=
dr
.
owner
.
GetType
();
var
propertyInfo
=
type
.
GetProperty
(
dr
.
propertyName
);
var
attributes
=
propertyInfo
.
GetCustomAttributes
(
typeof
(
DescriptionAttribute
),
false
);
string
description
=
""
;
if
(
attributes
.
Length
>
0
)
{
description
=
(
attributes
.
First
()
as
DescriptionAttribute
).
Description
;
}
dataToRegsViews
.
Add
(
new
DataToRegsView
()
{
dr
=
dr
,
Addr
=
dr
.
addr
,
DataArea
=
dr
.
dataArea
,
IsNeedUpdate
=
dr
.
isNeedUpdate
,
PropertyName
=
dr
.
propertyName
,
Description
=
description
,
Value
=
dr
.
value
});
}
plc
.
PropertyChanged
+=
Plc_PropertyChanged
;
plc
.
NameDataChanged
+=
Plc_NameDataChanged
;
dataGrid
.
ItemsSource
=
dataToRegsViews
;
}
private
void
Plc_NameDataChanged
(
object
sender
,
DataToRegs
dr
)
{
var
drViews
=
from
_drView
in
dataToRegsViews
where
_drView
.
dr
==
dr
select
_drView
;
if
(
drViews
.
Count
()
==
0
)
return
;
var
drView
=
drViews
.
First
();
drView
.
Value
=
dr
.
value
;
}
private
void
Plc_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
nameof
(
plc
.
PlanUpdateTime
))
{
for
(
int
i
=
0
;
i
<
plc
.
DRmap
.
Count
();
i
++)
{
var
dr
=
plc
.
DRmap
[
i
];
dataToRegsViews
[
i
].
IsNeedUpdate
=
dr
.
isNeedUpdate
;
}
}
}
}
/// <summary>
/// 数据映射的类;
/// Data: PC 属性
/// Regs: PLC 对象(寄存器、线圈)
/// </summary>
public
class
DataToRegsView
:
INotifyPropertyChanged
{
public
DataToRegs
dr
;
/// <summary>
/// 对应 PLC寄存器区 coil or register
/// </summary>
public
PLCAddressArea
DataArea
{
get
;
set
;
}
/// <summary>
/// PLC 首地址
/// </summary>
public
int
Addr
{
get
;
set
;
}
/// <summary>
/// object 的 property 名称, 只能是 数字类型都是double, 剩下就是 bool
/// </summary>
public
string
PropertyName
{
get
;
set
;
}
/// <summary>
/// property 描述
/// </summary>
public
string
Description
{
get
;
set
;
}
/// <summary>
/// property 的值, 没有缩小. 只有 double 与 bool
/// </summary>
public
object
Value
{
get
;
set
;
}
/// <summary>
/// 需要从PLC读取数据更新
/// </summary>
public
bool
IsNeedUpdate
{
get
;
set
;
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
/// <summary>
///
/// </summary>
/// <returns></returns>
public
override
string
ToString
()
{
return
PropertyName
+
" ["
+
((
int
)
DataArea
).
ToString
()
+
"]("
+
Addr
+
")"
;
}
}
}
Project.FLY.IBC/FLY.IBC/Client/IbcSystemServiceClient.cs
View file @
bb89f0e3
...
...
@@ -96,12 +96,8 @@ namespace FLY.IBC.Client
//--------------------------------------------------------------
//PLC代理,用于添加更新任务
Dictionary
<
string
,
INotifyPropertyChanged
>
objnames2
=
new
Dictionary
<
string
,
INotifyPropertyChanged
>();
objnames2
.
Add
(
nameof
(
Item
),
Item
);
for
(
int
i
=
0
;
i
<
TAreas
.
Count
();
i
++)
objnames2
.
Add
(
$"
{
nameof
(
TAreas
)}
[
{
i
}
]"
,
TAreas
[
i
]);
PLCos
=
new
PLCProxySystemServiceClient
(
mServerID
+
2
,
objnames2
);
PLCos
=
new
PLCProxySystemServiceClient
(
mServerID
+
2
);
this
.
PropertyChanged
+=
IbcSystemClient_PropertyChanged
;
...
...
@@ -196,7 +192,6 @@ namespace FLY.IBC.Client
{
string
objname
=
$"
{
nameof
(
TAreas
)}
[
{
i
}
]"
;
syncPropServiceClient
.
Add
(
objname
,
TAreas
[
i
]);
PLCos
.
ObjNames
.
Add
(
objname
,
TAreas
[
i
]);
}
}
else
...
...
@@ -206,7 +201,6 @@ namespace FLY.IBC.Client
{
string
objname
=
$"
{
nameof
(
TAreas
)}
[
{
i
}
]"
;
syncPropServiceClient
.
Remove
(
objname
);
PLCos
.
ObjNames
.
Remove
(
objname
);
}
}
...
...
Project.FLY.IBC/FLY.IBC/Server.OBJProxy/OBJProxy.cs
View file @
bb89f0e3
using
FLY.IBC.IService
;
using
FLY.IBC.Server.Model
;
using
FLY.OBJComponents.IService
;
using
FLY.OBJComponents.Server.OBJProxy
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -24,9 +25,10 @@ namespace FLY.IBC.Server.OBJProxy
typeof
(
IBulkDbWidthService
),
gage
.
mHistoryDb
.
WidthBuffer
);
var
mWarnSystemOBJProxy
=
new
WarningSystem_OBJ
Proxy
(
var
mWarnSystemOBJProxy
=
new
FObjBase
.
Reflect
.
Reflect_
Proxy
(
objsys_idx
,
OBJ_INTERFACE
.
OBJ_INTERFACE
.
WARNING_OBJ_ID
,
typeof
(
IWarningSystem2Service
),
gage
.
mWarning
);
ibcSystemOBJProxy
.
CurrObjSys
.
Start_Conn_Server
(
...
...
Project.FLY.IBC/FLY.IBC/Server/IBCSystem.cs
View file @
bb89f0e3
...
...
@@ -48,7 +48,7 @@ namespace FLY.IBC.Server
/// <summary>
/// 报警系统
/// </summary>
WarningSystem
warning
;
WarningSystem
2
warning
;
/// <summary>
/// 记录到数据库
/// </summary>
...
...
@@ -70,7 +70,7 @@ namespace FLY.IBC.Server
//step 1 加载PLC寄存器 文件
AddConfigFile
();
}
public
void
Init
(
HistoryDb
historyDb
,
WarningSystem
warning
)
public
void
Init
(
HistoryDb
historyDb
,
WarningSystem
2
warning
)
{
this
.
historyDb
=
historyDb
;
this
.
warning
=
warning
;
...
...
Project.FLY.IBC/FLY.IBC/Server/TDGage.cs
View file @
bb89f0e3
...
...
@@ -22,7 +22,7 @@ namespace FLY.IBC.Server
Model
.
DbModel
mDbModel
;
public
Model
.
HistoryDb
mHistoryDb
;
public
WarningSystem
mWarning
;
public
WarningSystem
2
mWarning
;
public
TDGage
(
string
nam
)
{
...
...
@@ -35,27 +35,39 @@ namespace FLY.IBC.Server
}
System
.
Environment
.
CurrentDirectory
=
mParamDirectory
;
Init1
();
mSysParam
=
new
SysParam
();
mData
=
new
IBCSystem
();
mDbModel
=
new
DbModel
();
mHistoryDb
=
new
HistoryDb
();
mWarning
=
new
WarningSystem2
();
}
#
region
Init
登陆服务器初始化
----------------------------------------------------
/// <summary>
/// 第1步, 加载本地数据
/// </summary>
public
void
Init1
()
public
async
Task
Init
()
{
mSysParam
=
new
SysParam
();
mData
=
new
IBCSystem
();
//---------------------------------------------------------------------------------------------------------------
//数据库
mDbModel
=
new
DbModel
();
mDbModel
.
Init
();
mDbModel
.
KeepDBSize
(
mSysParam
.
DBKeepMonth
);
mHistoryDb
=
new
HistoryDb
();
await
Task
.
Factory
.
StartNew
(()
=>
{
//初始数据库(加载 MaxId)
mDbModel
.
Init
();
//删除不需要的备份数据
mDbModel
.
KeepBackupSize
(
12
);
//备份上一个月之前的数据到 yyyy-MM 文件夹
mDbModel
.
BackupBbInSize
(
12
);
//当前的数据库只保存上个月与这个月的数据
mDbModel
.
KeepDBSize
(
1
);
});
mHistoryDb
.
Init
(
mDbModel
);
mWarning
=
new
WarningSystem
();
mWarning
.
Init
(
mHistoryDb
.
ErrorBuffer
);
mData
.
Init
(
mHistoryDb
,
mWarning
);
...
...
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