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
3fd8c736
Commit
3fd8c736
authored
Feb 25, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://private.flyautomation.net:82/panruising/thick_public
parents
1a7305cc
9aebc7dc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
107 additions
and
138 deletions
+107
-138
MaterialDesignIcons.xaml
...ibrary/FLY.ControlLibrary/Themes/MaterialDesignIcons.xaml
+5
-1
view-quilt.png
...ect.FLY.ControlLibrary/materialdesignicons/view-quilt.png
+0
-0
view-quilt.xaml
...ct.FLY.ControlLibrary/materialdesignicons/view-quilt.xaml
+1
-0
FLY.Thick.Base.UI.csproj
...FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
+0
-14
Window_MainSet.xaml
...Thick.Base/FLY.Thick.Base.UI/MainEdit/Window_MainSet.xaml
+4
-0
SysParam.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/SysParam.cs
+9
-39
COMMON.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UIModule/COMMON.cs
+1
-16
DynAreaIO.xaml.cs
...Y.Thick.Base/FLY.Thick.Base.UI/UIModule/DynAreaIO.xaml.cs
+1
-1
FLYLayout.cs
...ct.FLY.Thick.Base/FLY.Thick.Base.UI/UIModule/FLYLayout.cs
+6
-1
Window_PasswordEdit.xaml
...FLY.Thick.Base/FLY.Thick.Base.UI/Window_PasswordEdit.xaml
+12
-6
Window_PasswordEdit.xaml.cs
....Thick.Base/FLY.Thick.Base.UI/Window_PasswordEdit.xaml.cs
+68
-60
No files found.
Project.FLY.ControlLibrary/FLY.ControlLibrary/Themes/MaterialDesignIcons.xaml
View file @
3fd8c736
...
...
@@ -280,6 +280,10 @@
M16,15H12V18L7,13L12,8V11H16M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z
</Geometry>
<Geometry x:Key="Geometry_view-quilt">
M10,5V11H21V5M16,18H21V12H16M4,18H9V5H4M10,18H15V12H10V18Z
</Geometry>
</ResourceDictionary>
\ No newline at end of file
Project.FLY.ControlLibrary/materialdesignicons/view-quilt.png
0 → 100644
View file @
3fd8c736
411 Bytes
Project.FLY.ControlLibrary/materialdesignicons/view-quilt.xaml
0 → 100644
View file @
3fd8c736
<?xml version="1.0" encoding="UTF-8"?>
<Canvas
xmlns=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x=
"http://schemas.microsoft.com/winfx/2006/xaml"
Width=
"24"
Height=
"24"
><Path
Data=
"M10,5V11H21V5M16,18H21V12H16M4,18H9V5H4M10,18H15V12H10V18Z"
/></Canvas>
\ No newline at end of file
Project.FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
View file @
3fd8c736
...
...
@@ -189,9 +189,6 @@
<DependentUpon>
DynAreaSample.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"UIModule\FLYLayout.cs"
/>
<Compile
Include=
"UIModule\FixGraph.xaml.cs"
>
<DependentUpon>
FixGraph.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"UIModule\ScanGraph.xaml.cs"
>
<DependentUpon>
ScanGraph.xaml
</DependentUpon>
</Compile>
...
...
@@ -204,9 +201,6 @@
<Compile
Include=
"UIModule\TrendGraphConfig.xaml.cs"
>
<DependentUpon>
TrendGraphConfig.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"UIModule\FixGraphConfig.xaml.cs"
>
<DependentUpon>
FixGraphConfig.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"UIModule\DynAreaConnected.xaml.cs"
>
<DependentUpon>
DynAreaConnected.xaml
</DependentUpon>
</Compile>
...
...
@@ -376,10 +370,6 @@
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"UIModule\FixGraph.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"UIModule\ScanGraph.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
...
...
@@ -396,10 +386,6 @@
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"UIModule\FixGraphConfig.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"UIModule\DynAreaConnected.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/MainEdit/Window_MainSet.xaml
View file @
3fd8c736
...
...
@@ -81,6 +81,10 @@
</StackPanel>
</GroupBox>
<StackPanel Orientation="Horizontal" Margin="3" HorizontalAlignment="Right">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="隐藏主界面
Logo" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" IsChecked="{Binding IsLogoHidden}" HorizontalAlignment="Left"/>
</StackPanel>
<Button Style="{StaticResource ButtonStyle_empty}" HorizontalAlignment="Right" BorderThickness="0" VerticalAlignment="Bottom" Click="button_marksize_Click" Margin="5" Background="White">
<StackPanel Orientation="Vertical">
<Path Data="{StaticResource Geometry_group}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="50" Width="50" />
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/SysParam.cs
View file @
3fd8c736
...
...
@@ -64,55 +64,25 @@ namespace ThickTcpUiInWindow
}
}
string
warningTipPath
;
/// <summary>
/// 报警音乐路径
/// </summary>
public
string
WarningTipPath
{
get
{
return
warningTipPath
;
}
set
{
if
(
warningTipPath
!=
value
)
{
warningTipPath
=
value
;
NotifyPropertyChanged
(
"WarningTipPath"
);
}
}
}
public
string
WarningTipPath
{
get
;
set
;
}
bool
haveosk
=
false
;
/// <summary>
/// 使用虚拟键盘
/// </summary>
public
virtual
bool
HaveOSK
{
get
{
return
haveosk
;
}
set
{
if
(
haveosk
!=
value
)
{
haveosk
=
value
;
NotifyPropertyChanged
(
"HaveOSK"
);
}
}
}
bool
haveosk_mouse
=
false
;
public
virtual
bool
HaveOSK
{
get
;
set
;
}
/// <summary>
/// 虚拟键盘支持鼠标
/// </summary>
public
virtual
bool
HaveOSK_mouse
{
get
{
return
haveosk_mouse
;
}
set
{
if
(
haveosk_mouse
!=
value
)
{
haveosk_mouse
=
value
;
NotifyPropertyChanged
(
"HaveOSK_mouse"
);
}
}
}
public
virtual
bool
HaveOSK_mouse
{
get
;
set
;
}
#
endregion
/// <summary>
///
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UIModule/COMMON.cs
View file @
3fd8c736
...
...
@@ -8,25 +8,10 @@ namespace ThickTcpUiInWindow.UIModule
{
public
class
UIModuleParam
:
INotifyPropertyChanged
,
Misc
.
ISaveToXml
{
private
int
id
=
0
;
/// <summary>
/// 控件唯一标示
/// </summary>
public
int
ID
{
get
{
return
id
;
}
set
{
if
(
id
!=
value
)
{
id
=
value
;
NotifyPropertyChanged
(
"ID"
);
}
}
}
public
int
ID
{
get
;
set
;
}
protected
void
NotifyPropertyChanged
(
string
propertyName
)
{
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UIModule/DynAreaIO.xaml.cs
View file @
3fd8c736
...
...
@@ -90,7 +90,7 @@ namespace ThickTcpUiInWindow.UIModule
/// <param name="IDs"></param>
public
void
MatchParam
(
int
[]
IDs
)
{
FixGraphParams
.
Current
.
MatchParam
(
IDs
);
}
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UIModule/FLYLayout.cs
View file @
3fd8c736
...
...
@@ -54,6 +54,10 @@ namespace ThickTcpUiInWindow.UIModule
/// </summary>
public
bool
IsDynAreaVisible
{
get
;
set
;
}
=
true
;
/// <summary>
/// 隐藏 logo
/// </summary>
public
bool
IsLogoHidden
{
get
;
set
;
}
/// <summary>
/// 当前选了menu, 这个不需要保存
/// </summary>
...
...
@@ -129,7 +133,8 @@ namespace ThickTcpUiInWindow.UIModule
"ControllerStates"
,
"DynAreaItems"
,
"DynAreaWidth"
,
"IsDynAreaVisible"
,
"Left"
,
"Top"
,
"Width"
,
"Height"
,
"WindowState"
"Left"
,
"Top"
,
"Width"
,
"Height"
,
"WindowState"
,
"IsLogoHidden"
};
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Window_PasswordEdit.xaml
View file @
3fd8c736
...
...
@@ -11,7 +11,6 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<!--<ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Culture/StringResource.zh-CN.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
...
...
@@ -21,16 +20,23 @@
<Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" >
<StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="
{DynamicResource strPWModify}
" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="
密码修改
" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strPleaseIntoPW}" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="密码级别" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="(数值越大,权限越大)" />
</StackPanel>
<ComboBox ItemsSource="{Binding Levels}" SelectedItem="{Binding Level}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="请输入密码:" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK}" Tag="Full" MinWidth="400"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="
{DynamicResource strIntoAgain}
" />
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="
再次输入密码:
" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK2}" Tag="Full" MinWidth="400"/>
</StackPanel>
...
...
@@ -40,8 +46,8 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource ButtonStyle2}" Content="
{DynamicResource strOK}
" Width="200" Margin="5" Click="button_apply_Click" Background="#FF127300" />
<Button Grid.Column="1" Style="{StaticResource ButtonStyle2}" Content="
{DynamicResource strCancel}
" Width="200" Margin="5" Click="button_close_Click" Background="#FFEC0000" />
<Button Style="{StaticResource ButtonStyle2}" Content="
确定
" Width="200" Margin="5" Click="button_apply_Click" Background="#FF127300" />
<Button Grid.Column="1" Style="{StaticResource ButtonStyle2}" Content="
取消
" Width="200" Margin="5" Click="button_close_Click" Background="#FFEC0000" />
</Grid>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Window_PasswordEdit.xaml.cs
View file @
3fd8c736
...
...
@@ -22,43 +22,21 @@ namespace ThickTcpUiInWindow
/// </summary>
public
partial
class
Window_PasswordEdit
:
Window
,
INotifyPropertyChanged
{
PasswordService
mPasswordService
=
null
;
private
string
psk
;
public
string
PSK
{
get
{
return
psk
;
}
set
{
psk
=
value
;
NotifyPropertyChanged
(
"PSK"
);
}
}
private
string
psk2
;
public
string
PSK2
{
get
{
return
psk2
;
}
set
{
psk2
=
value
;
NotifyPropertyChanged
(
"PSK2"
);
}
}
PasswordEditViewModel
viewModel
;
PasswordService
mPasswordService
;
public
Window_PasswordEdit
()
{
InitializeComponent
();
}
public
void
Init
(
IPEndPoint
serverep
)
public
void
Init
(
IPEndPoint
serverep
,
UInt32
id
)
{
mPasswordService
=
new
PasswordService
(
FLY
.
Thick
.
Base
.
OBJ_INTERFACE
.
OBJ_INTERFACE_ID
.
PASSWORD_ID
);
viewModel
=
new
PasswordEditViewModel
();
mPasswordService
=
new
PasswordService
(
id
);
FObjBase
.
FObjSys
.
Current
.
Connect_to_Another_OBJSys
(
serverep
,
mPasswordService
.
ID
);
this
.
DataContext
=
this
;
viewModel
.
Init
(
mPasswordService
);
this
.
DataContext
=
viewModel
;
}
private
void
Window_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
...
...
@@ -70,54 +48,84 @@ namespace ThickTcpUiInWindow
}
private
void
button_apply_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
string
.
IsNullOrEmpty
(
PSK
))
if
(
viewModel
.
Apply
())
Close
();
}
private
void
Grid_MouseDown
(
object
sender
,
MouseButtonEventArgs
e
)
{
this
.
DragMove
();
}
private
void
button_close_Click
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
Close
();
}
#
region
INotifyPropertyChanged
成员
public
event
PropertyChangedEventHandler
PropertyChanged
;
#
endregion
}
public
class
PasswordEditViewModel
:
INotifyPropertyChanged
{
/// <summary>
/// 第1次输入
/// </summary>
public
string
PSK
{
get
;
set
;
}
/// <summary>
/// 重复输入
/// </summary>
public
string
PSK2
{
get
;
set
;
}
public
int
Level
{
get
;
set
;
}
public
int
[]
Levels
{
get
;
}
=
new
int
[]
{
0
,
1
};
PasswordService
mPasswordService
=
null
;
public
void
Init
(
PasswordService
passwordService
)
{
mPasswordService
=
passwordService
;
}
public
bool
Apply
()
{
if
(
string
.
IsNullOrEmpty
(
PSK
))
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"错误"
,
"密码为空"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
return
false
;
}
else
if
(
PSK
!=
PSK2
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"错误"
,
"两次输入不相同"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
return
false
;
}
else
if
(
mPasswordService
.
PWs
.
Exists
(
pw
=>
pw
.
Password
==
PSK
))
else
if
(
mPasswordService
.
PWs
.
Exists
(
pw
=>
pw
.
Password
==
PSK
))
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"错误"
,
"此密码已经存在"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
return
false
;
}
else
//else if (Level)
//{
// FLY.ControlLibrary.Window_WarningTip.Show("错误", "请选择密码级别",
// TimeSpan.FromSeconds(2));
// return false;
//}
//else
{
//删除全部level=1的密码
mPasswordService
.
PWs
.
RemoveAll
(
pw
=>
pw
.
Level
<=
1
);
mPasswordService
.
PWs
.
Add
(
new
PasswordCell
()
{
Password
=
PSK
,
Level
=
1
});
mPasswordService
.
PWs
.
RemoveAll
(
pw
=>
pw
.
Level
==
Level
);
mPasswordService
.
PWs
.
Add
(
new
PasswordCell
()
{
Password
=
PSK
,
Level
=
Level
});
mPasswordService
.
Apply
();
}
this
.
Close
();
}
private
void
Grid_MouseDown
(
object
sender
,
MouseButtonEventArgs
e
)
{
this
.
DragMove
();
}
private
void
button_close_Click
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
Close
();
return
true
;
}
#
region
INotifyPropertyChanged
成员
public
event
PropertyChangedEventHandler
PropertyChanged
;
protected
void
NotifyPropertyChanged
(
string
propertyname
)
{
if
(
PropertyChanged
!=
null
)
{
PropertyChanged
.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
propertyname
));
}
}
#
endregion
}
}
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