Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
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
潘栩锋
Thick-Common
Commits
7df48248
Commit
7df48248
authored
Jan 13, 2023
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 根据AD盒V3,V2 版本号, 显示IO口的编号, V3是从X0~X15, V2是i1~i12
parent
42531211
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
196 additions
and
96 deletions
+196
-96
CtMicroGage.xaml
...Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGage.xaml
+8
-7
CtMicroGage.xaml.cs
...ck.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGage.xaml.cs
+33
-0
CtMicroGageStyle.xaml
....Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGageStyle.xaml
+1
-1
CtMicroGageVm.cs
...Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGageVm.cs
+2
-0
WdIOTip.xaml
...ect.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml
+1
-1
WdIOTip.xaml.cs
....FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml.cs
+36
-43
DynAreaIO.xaml
....FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml
+8
-8
DynAreaIO.xaml.cs
...Y.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
+38
-0
DynAreaIO2.xaml
...FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO2.xaml
+7
-6
DynArea.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Common/DynArea.cs
+4
-0
FlyADIODefine.cs
...ect.FLY.Thick.Base/FLY.Thick.Base/Common/FlyADIODefine.cs
+58
-29
IFlyAdIoDefineService.cs
...ick.Base/FLY.Thick.Base/IService/IFlyAdIoDefineService.cs
+0
-1
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGage.xaml
View file @
7df48248
...
...
@@ -14,13 +14,14 @@
<ResourceDictionary Source="CtMicroGageStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<local:IO2BitColorConverter x:Key="io2bitcolorconv"/>
<local:IONumberConverter x:Key="ioNumberConv"/>
<local:CtMircoGageVmUt x:Key="viewModel"
Thick="300.3" AD="12000" ADMax="65535" Position="5001" PosLength="8900" PosMm="500.1" Velocity="5.1" ControllerState="定点"
OStatus="0x0005"
IStatus="0xff7f"
IsError="False"
ErrMsg="枫莱尔控制器连接断开"
IsIOShowNo ="False"
/>
</ResourceDictionary>
</UserControl.Resources>
...
...
@@ -130,7 +131,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=13}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=12}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
13
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=12}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -139,7 +140,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=9}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=8}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
9
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=8}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -148,7 +149,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -157,7 +158,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
...
...
@@ -176,7 +177,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -185,7 +186,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGage.xaml.cs
View file @
7df48248
...
...
@@ -4,6 +4,7 @@ using FLY.Thick.Base.Common;
using
FLY.Thick.Base.IService
;
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -88,4 +89,36 @@ namespace FLY.Thick.Base.UI
throw
new
NotImplementedException
();
}
}
public
class
IONumberConverter
:
IValueConverter
{
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
bool
isIOShowNo
=
true
;
int
idx
=
0
;
if
(
value
is
bool
)
{
isIOShowNo
=
(
bool
)
value
;
}
if
(!(
parameter
is
string
))
{
return
null
;
}
if
(!
int
.
TryParse
((
string
)
parameter
,
out
idx
))
{
return
null
;
}
if
(
isIOShowNo
)
{
return
(
idx
+
1
).
ToString
();
}
else
{
return
(
idx
).
ToString
();
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGageStyle.xaml
View file @
7df48248
...
...
@@ -50,7 +50,7 @@
<Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Accent}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="
10
"/>
<Setter Property="FontSize" Value="
8
"/>
</Style>
<Style x:Key="IconStyle" TargetType="{x:Type Control}" >
<Setter Property="Margin" Value="6"/>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CtMicroGage/CtMicroGageVm.cs
View file @
7df48248
...
...
@@ -28,6 +28,7 @@ namespace FLY.Thick.Base.UI
public
double
Thick
{
get
;
set
;
}
public
int
AD
{
get
;
set
;
}
public
int
ADMax
{
get
;
set
;
}
public
bool
IsIOShowNo
{
get
;
set
;
}
=
true
;
public
int
Position
{
get
;
set
;
}
public
int
PosLength
{
get
;
set
;
}
...
...
@@ -113,6 +114,7 @@ namespace FLY.Thick.Base.UI
});
Misc
.
BindingOperations
.
SetBinding
(
this
.
initParam
,
nameof
(
CtMicroGageVm
.
initParam
.
PosLength
),
this
,
nameof
(
PosLength
));
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IsIOShowNo
),
this
,
nameof
(
IsIOShowNo
));
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
OStatus
),
this
,
nameof
(
OStatus
));
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IStatus
),
this
,
nameof
(
IStatus
));
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml
View file @
7df48248
...
...
@@ -26,7 +26,7 @@
</Style>
<Style x:Key="IOTextStyle" TargetType="TextBlock" BasedOn="{StaticResource Styles.Text.FieldContent}">
<Setter Property="FontSize" Value="20"/>
<Setter Property="Width" Value="
3
0" />
<Setter Property="Width" Value="
4
0" />
<Setter Property="Margin" Value="3" />
</Style>
<local:WdIoTipVmUt x:Key="viewModel"/>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml.cs
View file @
7df48248
...
...
@@ -59,37 +59,16 @@ namespace FLY.Thick.Base.UI
this
.
dynArea
=
dynArea
;
this
.
iODefineService
=
iODefineService
;
for
(
int
i
=
0
;
i
<
12
;
i
++)
{
IStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"i
{
i
+
1
}
"
});
};
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
OStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"o
{
i
+
1
}
"
});
};
if
(
this
.
iODefineService
is
FObjBase
.
FObjServiceClient
)
{
var
client
=
this
.
iODefineService
as
FObjBase
.
FObjServiceClient
;
if
(
client
.
IsConnected
)
{
update
();
}
client
.
PropertyChanged
+=
Client_PropertyChanged
;
}
else
{
update
();
}
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IsIOShowNo
),
update
);
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IStatus
),
updateIsOn_In
);
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
OStatus
),
updateIsOn_Out
);
}
void
updateIsOn_In
()
...
...
@@ -122,16 +101,16 @@ namespace FLY.Thick.Base.UI
{
iODefineService
.
GetIODefine
((
asyncContext
,
retData
)
=>
{
var
reponse
=
retData
as
IODefineCollection
;
if
(
reponse
==
null
)
{
var
re
s
ponse
=
retData
as
IODefineCollection
;
if
(
re
s
ponse
==
null
)
{
return
;
}
var
list
=
reponse
.
List
;
var
list
=
re
s
ponse
.
List
;
if
(
list
==
null
||
list
.
Count
()
==
0
)
return
;
update
(
IODefine
.
IOTYPE
.
Input
,
IStatus
,
re
ponse
.
InCount
,
list
);
update
(
IODefine
.
IOTYPE
.
Output
,
OStatus
,
re
ponse
.
OutCount
,
list
);
update
(
IODefine
.
IOTYPE
.
Input
,
IStatus
,
dynArea
.
IsIOShowNo
,
res
ponse
.
InCount
,
list
);
update
(
IODefine
.
IOTYPE
.
Output
,
OStatus
,
dynArea
.
IsIOShowNo
,
res
ponse
.
OutCount
,
list
);
updateIsOn_In
();
updateIsOn_Out
();
...
...
@@ -141,24 +120,38 @@ namespace FLY.Thick.Base.UI
void
update
(
IODefine
.
IOTYPE
ioType
,
ObservableCollection
<
FlyAdIoStatus
>
ioStatus
,
bool
isShowNo
,
int
ioCnt
,
List
<
IODefine
>
list
)
{
//补够数量
if
(
ioStatus
.
Count
()
!=
ioCnt
&&
ioCnt
>
0
)
{
while
(
ioStatus
.
Count
()
>
ioCnt
)
ioStatus
.
Clear
();
for
(
int
i
=
0
;
i
<
ioCnt
;
i
++)
{
string
number
;
if
(
isShowNo
)
{
ioStatus
.
RemoveAt
(
ioStatus
.
Count
()
-
1
);
if
(
ioType
==
IODefine
.
IOTYPE
.
Input
)
{
number
=
$"i
{
i
+
1
}
"
;
}
else
{
number
=
$"o
{
i
+
1
}
"
;
}
}
while
(
ioStatus
.
Count
()
<
ioCnt
)
{
int
i
=
ioStatus
.
Count
();
ioStatus
.
Add
(
new
FlyAdIoStatus
()
else
{
if
(
ioType
==
IODefine
.
IOTYPE
.
Input
)
{
number
=
$"X
{
i
}
"
;
}
else
{
Number
=
$"i
{
i
+
1
}
"
}
);
number
=
$"Y
{
i
}
"
;
}
}
ioStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
number
});
}
//获取中文
...
...
@@ -216,18 +209,18 @@ namespace FLY.Thick.Base.UI
public
WdIoTipVmUt
()
{
for
(
int
i
=
0
;
i
<
1
2
;
i
++)
for
(
int
i
=
0
;
i
<
1
6
;
i
++)
{
IStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"
i
{
i
+
1
}
"
Number
=
$"
X
{
i
}
"
});
};
for
(
int
i
=
0
;
i
<
4
;
i
++)
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
OStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"
o
{
i
+
1
}
"
Number
=
$"
Y
{
i
}
"
});
};
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml
View file @
7df48248
...
...
@@ -27,8 +27,8 @@
</Style>
<local:DynAreaIOVmUt x:Key="ioVm" />
<local:DynAreaErrorVm x:Key="errorVm" IsError="
Tru
e" ErrMsg="枫莱尔控制器连接断开 枫莱尔控制器连接断开"/>
<local:DynAreaErrorVm x:Key="errorVm" IsError="
Fals
e" ErrMsg="枫莱尔控制器连接断开 枫莱尔控制器连接断开"/>
<local:IONumberConverter x:Key="ioNumberConv"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid Height="100" >
...
...
@@ -44,7 +44,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=13}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=12}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
13
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=12}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -53,7 +53,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=9}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=8}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
9
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=8}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -62,7 +62,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -71,7 +71,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
</StackPanel>
...
...
@@ -88,7 +88,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -97,7 +97,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
</StackPanel>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
View file @
7df48248
...
...
@@ -24,6 +24,7 @@ using MultiLayout;
using
FLY.OBJComponents.IService
;
using
GalaSoft.MvvmLight.Command
;
using
FObjBase.Reflect
;
using
System.Globalization
;
namespace
FLY.Thick.Base.UI.UiModule
{
...
...
@@ -65,6 +66,7 @@ namespace FLY.Thick.Base.UI.UiModule
public
UInt16
IStatus
{
get
;
set
;
}
=
0xffff
;
public
UInt16
OStatus
{
get
;
set
;
}
=
0x000f
;
public
bool
IsIOShowNo
{
get
;
set
;
}
=
true
;
public
int
Hrs
{
get
;
set
;
}
=
3
;
/// <summary>
...
...
@@ -94,7 +96,9 @@ namespace FLY.Thick.Base.UI.UiModule
Misc
.
BindingOperations
.
SetBinding
(
this
.
dynArea
,
nameof
(
this
.
dynArea
.
IStatus
),
this
,
nameof
(
IStatus
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
dynArea
,
nameof
(
this
.
dynArea
.
OStatus
),
this
,
nameof
(
OStatus
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
dynArea
,
nameof
(
this
.
dynArea
.
IsIOShowNo
),
this
,
nameof
(
IsIOShowNo
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
dynArea
,
nameof
(
this
.
dynArea
.
Hrs
),
this
,
nameof
(
Hrs
));
UpdateIsForever
();
this
.
dynArea
.
PropertyChanged
+=
(
s
,
e
)
=>
...
...
@@ -400,4 +404,38 @@ namespace FLY.Thick.Base.UI.UiModule
}
}
public
class
IONumberConverter
:
IValueConverter
{
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
bool
isIOShowNo
=
true
;
int
idx
=
0
;
if
(
value
is
bool
)
{
isIOShowNo
=
(
bool
)
value
;
}
if
(!(
parameter
is
string
))
{
return
null
;
}
if
(!
int
.
TryParse
((
string
)
parameter
,
out
idx
))
{
return
null
;
}
if
(
isIOShowNo
)
{
return
(
idx
+
1
).
ToString
();
}
else
{
return
(
idx
).
ToString
();
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO2.xaml
View file @
7df48248
...
...
@@ -26,6 +26,7 @@
</Style>
<local:DynAreaIOVm x:Key="ioVm" IStatus = "0xff7f" OStatus = "0x0005" Hrs = "2000" IsForever="False"/>
<local:IONumberConverter x:Key="ioNumberConv"/>
</ResourceDictionary>
</UserControl.Resources>
<Button Style="{StaticResource Styles.Button.Empty}" d:DataContext="{StaticResource ioVm}" Command="{Binding OpenIoTipCmd}">
...
...
@@ -40,7 +41,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=13}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=12}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
13
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=12}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -49,7 +50,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=9}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=8}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
9
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=8}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -58,7 +59,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -67,7 +68,7 @@
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
</StackPanel>
...
...
@@ -84,7 +85,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
5
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=4}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0">
...
...
@@ -93,7 +94,7 @@
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="
1
" Style="{StaticResource IOTextStyle}"/>
<TextBlock Text="
{Binding IsIOShowNo,Converter={StaticResource ioNumberConv},ConverterParameter=0}
" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
</StackPanel>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Common/DynArea.cs
View file @
7df48248
...
...
@@ -107,6 +107,10 @@ namespace FLY.Thick.Base.Common
public
UInt16
OStatus
{
get
;
set
;
}
=
0xffff
;
/// <summary>
/// I/O 显示编号1~16
/// </summary>
public
bool
IsIOShowNo
{
get
;
set
;
}
=
true
;
#
endregion
#
region
系统
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Common/FlyADIODefine.cs
View file @
7df48248
using
FLY.Thick.Base.IService
;
using
FlyADBase
;
using
FObjBase
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -31,8 +32,15 @@ namespace FLY.Thick.Base.Common
/// 子类 需要 重新 把子类对象 赋值给 Instance, 确保整个环境只用一个版本的 单例
/// </summary>
public
static
FlyADIODefine
Instance
=>
instance
;
#
region
输入口
/// <summary>
/// 扫描按钮信号
/// </summary>
[
Description
(
"扫描按钮信号"
)]
public
int
InNo_Scan
{
get
;
protected
set
;
}
=
1
-
1
;
/// <summary>
/// 归零信号
/// </summary>
...
...
@@ -95,6 +103,13 @@ namespace FLY.Thick.Base.Common
#
endregion
#
region
输出口
/// <summary>
/// 扫描动作中
/// </summary>
[
Description
(
"扫描动作中"
)]
public
int
OutNo_Scan
{
get
;
protected
set
;
}
=
1
-
1
;
/// <summary>
/// 变频器反转 VF0 是松下的变频器牌子
/// </summary>
...
...
@@ -132,30 +147,29 @@ namespace FLY.Thick.Base.Common
#
endregion
private
int
version
=
2
;
/// <summary>
/// 根据AD盒的版本,设置
/// </summary>
/// <param name="version"></param>
public
virtual
void
SerVersion
(
int
version
)
IFlyAD
flyAD
;
public
virtual
void
SetFlyAD
(
IFlyAD
_flyAD
)
{
this
.
version
=
version
;
if
(
this
.
version
==
3
)
this
.
flyAD
=
_flyAD
;
Misc
.
BindingOperations
.
SetBinding
(
flyAD
,
nameof
(
flyAD
.
HardwareVersion
),
()
=>
{
InNo_Org
=
13
-
1
;
InNo_Limit_Forw
=
14
-
1
;
InNo_Limit_Backw
=
16
-
1
;
if
(
this
.
flyAD
.
HardwareVersion
<
3
)
{
InNo_Org
=
2
-
1
;
InNo_Limit_Forw
=
3
-
1
;
InNo_Limit_Backw
=
4
-
1
;
InNo_Roll
=
15
-
1
;
}
else
{
InNo_Org
=
2
-
1
;
InNo_Limit_Forw
=
3
-
1
;
InNo_Limit_Backw
=
4
-
1
;
InNo_Roll
=
11
-
1
;
}
else
{
InNo_Org
=
13
-
1
;
InNo_Limit_Forw
=
14
-
1
;
InNo_Limit_Backw
=
16
-
1
;
InNo_Roll
=
11
-
1
;
}
InNo_Roll
=
15
-
1
;
}
});
}
/// <summary>
...
...
@@ -201,23 +215,37 @@ namespace FLY.Thick.Base.Common
public
void
GetIODefine
(
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
//获取全部带 Description 的属性,且名字 InNo_XXX 或 OutNo_XXX
IODefineCollection
reponse
=
new
IODefineCollection
();
IODefineCollection
re
s
ponse
=
new
IODefineCollection
();
List
<
IODefine
>
list
=
new
List
<
IODefine
>();
reponse
.
List
=
list
;
if
(
version
==
3
)
re
s
ponse
.
List
=
list
;
if
(
flyAD
.
HardwareVersion
<
3
)
{
re
ponse
.
InCount
=
16
;
re
ponse
.
OutCount
=
8
;
re
sponse
.
InCount
=
12
;
re
sponse
.
OutCount
=
4
;
}
else
{
re
ponse
.
InCount
=
12
;
re
ponse
.
OutCount
=
4
;
re
sponse
.
InCount
=
16
;
re
sponse
.
OutCount
=
8
;
}
var
inputPropertyNames
=
GetInputPropertyNames
();
var
outputPropertyNames
=
GetOutputPropertyNames
();
if
(
flyAD
.
MotorType
!=
FlyADBase
.
MOTORTYPE
.
VF0
)
{
//把 变频器 接口删除
outputPropertyNames
.
Remove
(
nameof
(
OutNo_VF0_Forw
));
outputPropertyNames
.
Remove
(
nameof
(
OutNo_VF0_Backw
));
outputPropertyNames
.
Remove
(
nameof
(
OutNo_VF0_Slow
));
}
if
(
flyAD
.
MotorType
==
FlyADBase
.
MOTORTYPE
.
VF0
)
{
//变频器 模式 没有扫描状态灯
outputPropertyNames
.
Remove
(
nameof
(
OutNo_Scan
));
}
Type
t
=
this
.
GetType
();
foreach
(
var
propertyName
in
inputPropertyNames
)
...
...
@@ -240,6 +268,7 @@ namespace FLY.Thick.Base.Common
Index
=
index
,
Description
=
desp
};
list
.
Add
(
iodefine
);
}
...
...
@@ -266,7 +295,7 @@ namespace FLY.Thick.Base.Common
list
.
Add
(
iodefine
);
}
asyncDelegate
?.
Invoke
(
asyncContext
,
reponse
);
asyncDelegate
?.
Invoke
(
asyncContext
,
re
s
ponse
);
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyAdIoDefineService.cs
View file @
7df48248
...
...
@@ -32,7 +32,6 @@ namespace FLY.Thick.Base.IService
/// 输出口数量
/// </summary>
public
int
OutCount
;
/// <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