Commit 9aebc7dc authored by 潘栩锋's avatar 潘栩锋 🚴

1.添加 materialdesignicon 添加view-quilt图标

2.添加 主界面 FLYLayout 添加 IsLogoHidden 用于隐藏“枫莱尔”商标
3.更新 Window_PasswordEdit 可以修改权限
parent 1d46f0f5
...@@ -280,6 +280,10 @@ ...@@ -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 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>
<Geometry x:Key="Geometry_view-quilt">
M10,5V11H21V5M16,18H21V12H16M4,18H9V5H4M10,18H15V12H10V18Z
</Geometry>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
<?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
...@@ -189,9 +189,6 @@ ...@@ -189,9 +189,6 @@
<DependentUpon>DynAreaSample.xaml</DependentUpon> <DependentUpon>DynAreaSample.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UIModule\FLYLayout.cs" /> <Compile Include="UIModule\FLYLayout.cs" />
<Compile Include="UIModule\FixGraph.xaml.cs">
<DependentUpon>FixGraph.xaml</DependentUpon>
</Compile>
<Compile Include="UIModule\ScanGraph.xaml.cs"> <Compile Include="UIModule\ScanGraph.xaml.cs">
<DependentUpon>ScanGraph.xaml</DependentUpon> <DependentUpon>ScanGraph.xaml</DependentUpon>
</Compile> </Compile>
...@@ -204,9 +201,6 @@ ...@@ -204,9 +201,6 @@
<Compile Include="UIModule\TrendGraphConfig.xaml.cs"> <Compile Include="UIModule\TrendGraphConfig.xaml.cs">
<DependentUpon>TrendGraphConfig.xaml</DependentUpon> <DependentUpon>TrendGraphConfig.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UIModule\FixGraphConfig.xaml.cs">
<DependentUpon>FixGraphConfig.xaml</DependentUpon>
</Compile>
<Compile Include="UIModule\DynAreaConnected.xaml.cs"> <Compile Include="UIModule\DynAreaConnected.xaml.cs">
<DependentUpon>DynAreaConnected.xaml</DependentUpon> <DependentUpon>DynAreaConnected.xaml</DependentUpon>
</Compile> </Compile>
...@@ -376,10 +370,6 @@ ...@@ -376,10 +370,6 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="UIModule\FixGraph.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UIModule\ScanGraph.xaml"> <Page Include="UIModule\ScanGraph.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -396,10 +386,6 @@ ...@@ -396,10 +386,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="UIModule\FixGraphConfig.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UIModule\DynAreaConnected.xaml"> <Page Include="UIModule\DynAreaConnected.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
......
...@@ -81,6 +81,10 @@ ...@@ -81,6 +81,10 @@
</StackPanel> </StackPanel>
</GroupBox> </GroupBox>
<StackPanel Orientation="Horizontal" Margin="3" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" Margin="3" HorizontalAlignment="Right">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="隐藏主界面&#x0a;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"> <Button Style="{StaticResource ButtonStyle_empty}" HorizontalAlignment="Right" BorderThickness="0" VerticalAlignment="Bottom" Click="button_marksize_Click" Margin="5" Background="White">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<Path Data="{StaticResource Geometry_group}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="50" Width="50" /> <Path Data="{StaticResource Geometry_group}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="50" Width="50" />
......
...@@ -64,55 +64,25 @@ namespace ThickTcpUiInWindow ...@@ -64,55 +64,25 @@ namespace ThickTcpUiInWindow
} }
} }
string warningTipPath;
/// <summary> /// <summary>
/// 报警音乐路径 /// 报警音乐路径
/// </summary> /// </summary>
public string WarningTipPath public string WarningTipPath { get; set; }
{
get { return warningTipPath; }
set
{
if (warningTipPath != value)
{
warningTipPath = value;
NotifyPropertyChanged("WarningTipPath");
}
}
}
bool haveosk = false;
/// <summary> /// <summary>
/// 使用虚拟键盘 /// 使用虚拟键盘
/// </summary> /// </summary>
public virtual bool HaveOSK public virtual bool HaveOSK { get; set; }
{
get { return haveosk; }
set
{
if (haveosk != value)
{
haveosk = value;
NotifyPropertyChanged("HaveOSK");
}
}
}
bool haveosk_mouse = false;
/// <summary> /// <summary>
/// 虚拟键盘支持鼠标 /// 虚拟键盘支持鼠标
/// </summary> /// </summary>
public virtual bool HaveOSK_mouse public virtual bool HaveOSK_mouse { get; set; }
{
get { return haveosk_mouse; }
set
{
if (haveosk_mouse != value)
{
haveosk_mouse = value;
NotifyPropertyChanged("HaveOSK_mouse");
}
}
}
#endregion #endregion
/// <summary> /// <summary>
/// ///
......
...@@ -8,25 +8,10 @@ namespace ThickTcpUiInWindow.UIModule ...@@ -8,25 +8,10 @@ namespace ThickTcpUiInWindow.UIModule
{ {
public class UIModuleParam : INotifyPropertyChanged, Misc.ISaveToXml public class UIModuleParam : INotifyPropertyChanged, Misc.ISaveToXml
{ {
private int id = 0;
/// <summary> /// <summary>
/// 控件唯一标示 /// 控件唯一标示
/// </summary> /// </summary>
public int ID public int ID { get; set; }
{
get
{
return id;
}
set
{
if (id != value)
{
id = value;
NotifyPropertyChanged("ID");
}
}
}
protected void NotifyPropertyChanged(string propertyName) protected void NotifyPropertyChanged(string propertyName)
{ {
......
...@@ -90,7 +90,7 @@ namespace ThickTcpUiInWindow.UIModule ...@@ -90,7 +90,7 @@ namespace ThickTcpUiInWindow.UIModule
/// <param name="IDs"></param> /// <param name="IDs"></param>
public void MatchParam(int[] IDs) public void MatchParam(int[] IDs)
{ {
FixGraphParams.Current.MatchParam(IDs);
} }
} }
......
...@@ -54,6 +54,10 @@ namespace ThickTcpUiInWindow.UIModule ...@@ -54,6 +54,10 @@ namespace ThickTcpUiInWindow.UIModule
/// </summary> /// </summary>
public bool IsDynAreaVisible { get; set; } = true; public bool IsDynAreaVisible { get; set; } = true;
/// <summary>
/// 隐藏 logo
/// </summary>
public bool IsLogoHidden { get; set; }
/// <summary> /// <summary>
/// 当前选了menu, 这个不需要保存 /// 当前选了menu, 这个不需要保存
/// </summary> /// </summary>
...@@ -129,7 +133,8 @@ namespace ThickTcpUiInWindow.UIModule ...@@ -129,7 +133,8 @@ namespace ThickTcpUiInWindow.UIModule
"ControllerStates", "ControllerStates",
"DynAreaItems", "DynAreaItems",
"DynAreaWidth","IsDynAreaVisible", "DynAreaWidth","IsDynAreaVisible",
"Left","Top","Width","Height","WindowState" "Left","Top","Width","Height","WindowState",
"IsLogoHidden"
}; };
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/> <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.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
...@@ -21,16 +20,23 @@ ...@@ -21,16 +20,23 @@
<Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" > <Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" >
<StackPanel Orientation="Vertical" Margin="5,20"> <StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5"> <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>
<StackPanel Orientation="Vertical" Margin="5"> <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"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK}" Tag="Full" MinWidth="400"/> <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK}" Tag="Full" MinWidth="400"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="{DynamicResource strIntoAgain}" /> <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="再次输入密码:" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK2}" Tag="Full" MinWidth="400"/> <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding PSK2}" Tag="Full" MinWidth="400"/>
</StackPanel> </StackPanel>
...@@ -40,8 +46,8 @@ ...@@ -40,8 +46,8 @@
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Style="{StaticResource ButtonStyle2}" Content="{DynamicResource strOK}" Width="200" Margin="5" Click="button_apply_Click" Background="#FF127300" /> <Button Style="{StaticResource ButtonStyle2}" Content="确定" 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 Grid.Column="1" Style="{StaticResource ButtonStyle2}" Content="取消" Width="200" Margin="5" Click="button_close_Click" Background="#FFEC0000" />
</Grid> </Grid>
......
...@@ -22,43 +22,21 @@ namespace ThickTcpUiInWindow ...@@ -22,43 +22,21 @@ namespace ThickTcpUiInWindow
/// </summary> /// </summary>
public partial class Window_PasswordEdit : Window, INotifyPropertyChanged public partial class Window_PasswordEdit : Window, INotifyPropertyChanged
{ {
PasswordService mPasswordService = null; PasswordEditViewModel viewModel;
private string psk; PasswordService mPasswordService;
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");
}
}
public Window_PasswordEdit() public Window_PasswordEdit()
{ {
InitializeComponent(); 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( FObjBase.FObjSys.Current.Connect_to_Another_OBJSys(
serverep, mPasswordService.ID); serverep, mPasswordService.ID);
this.DataContext = this; viewModel.Init(mPasswordService);
this.DataContext = viewModel;
} }
private void Window_Loaded(object sender, RoutedEventArgs e) private void Window_Loaded(object sender, RoutedEventArgs e)
{ {
...@@ -70,54 +48,84 @@ namespace ThickTcpUiInWindow ...@@ -70,54 +48,84 @@ namespace ThickTcpUiInWindow
} }
private void button_apply_Click(object sender, RoutedEventArgs e) 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("错误", "密码为空", FLY.ControlLibrary.Window_WarningTip.Show("错误", "密码为空",
TimeSpan.FromSeconds(2)); TimeSpan.FromSeconds(2));
return; return false;
} }
else if (PSK != PSK2) else if (PSK != PSK2)
{ {
FLY.ControlLibrary.Window_WarningTip.Show("错误", "两次输入不相同", FLY.ControlLibrary.Window_WarningTip.Show("错误", "两次输入不相同",
TimeSpan.FromSeconds(2)); 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("错误", "此密码已经存在", FLY.ControlLibrary.Window_WarningTip.Show("错误", "此密码已经存在",
TimeSpan.FromSeconds(2)); TimeSpan.FromSeconds(2));
return; return false;
} }
else //else if (Level)
//{
// FLY.ControlLibrary.Window_WarningTip.Show("错误", "请选择密码级别",
// TimeSpan.FromSeconds(2));
// return false;
//}
//else
{ {
//删除全部level=1的密码 //删除全部level=1的密码
mPasswordService.PWs.RemoveAll(pw => pw.Level <= 1); mPasswordService.PWs.RemoveAll(pw => pw.Level == Level);
mPasswordService.PWs.Add(new PasswordCell() { Password = PSK, Level = 1 }); mPasswordService.PWs.Add(new PasswordCell() { Password = PSK, Level = Level });
mPasswordService.Apply(); mPasswordService.Apply();
} }
this.Close(); return true;
}
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; public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment