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
93976f41
Commit
93976f41
authored
Apr 11, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 AB补偿助手 与 B补偿助手 合并
parent
46f31678
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
194 additions
and
0 deletions
+194
-0
FLY.Thick.Base.UI.csproj
...FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
+7
-0
WdAbHelper.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper.xaml.cs
+2
-0
WdAbHelper2.xaml
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper2.xaml
+76
-0
WdAbHelper2.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper2.xaml.cs
+109
-0
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
View file @
93976f41
...
...
@@ -239,6 +239,9 @@
<Compile
Include=
"UiModule\MenuSetting.xaml.cs"
>
<DependentUpon>
MenuSetting.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"WdAbHelper2.xaml.cs"
>
<DependentUpon>
WdAbHelper2.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"WdAbHelper.xaml.cs"
>
<DependentUpon>
WdAbHelper.xaml
</DependentUpon>
</Compile>
...
...
@@ -415,6 +418,10 @@
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"WdAbHelper2.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"WdAbHelper.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper.xaml.cs
View file @
93976f41
...
...
@@ -106,6 +106,8 @@ namespace FLY.Thick.Base.UI
public
double
B
{
get
;
set
;
}
public
bool
IsJustB
{
get
;
set
;
}
public
event
PropertyChangedEventHandler
PropertyChanged
;
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper2.xaml
0 → 100644
View file @
93976f41
<flyctrllib:WindowBigClose x:Class="FLY.Thick.Base.UI.WdAbHelper2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:local="clr-namespace:FLY.Thick.Base.UI"
Background="WhiteSmoke"
mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<local:WdAbHelperVm x:Key="viewmodel" IsJustB="True"/>
</ResourceDictionary>
</Window.Resources>
<Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" d:DataContext="{StaticResource viewmodel}">
<StackPanel Margin="{StaticResource ControlMargin}">
<Grid Height="20"/>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="只修正平移B"/>
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsJustB}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="实际值1" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Y1}" />
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="显示值1" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding X1}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding IsJustB,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="实际值2" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Y2}" />
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="显示值2"/>
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding X2}"/>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource Styles.Button.Square2}" Click="button_cal_Click" Content="计算"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="结果"/>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Visibility="{Binding IsJustB,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}">
<Run Text= "斜率K="/>
<Run Text= "{Binding A, StringFormat={}{0:F3}}"/>
</TextBlock>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" >
<Run Text= "平移B="/>
<Run Text= "{Binding B, StringFormat={}{0:F2}}"/>
</TextBlock>
</StackPanel>
</StackPanel>
<Button Style="{StaticResource Styles.Button.Apply}" Click="button_apply_Click" />
</StackPanel>
</Grid>
</flyctrllib:WindowBigClose>
Project.FLY.Thick.Base/FLY.Thick.Base.UI/WdAbHelper2.xaml.cs
0 → 100644
View file @
93976f41
using
Misc
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
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.Thick.Base.UI
{
/// <summary>
/// Window_AHelper.xaml 的交互逻辑
/// </summary>
public
partial
class
WdAbHelper2
:
FLY
.
ControlLibrary
.
WindowBigClose
{
WdAbHelperVm
viewModel
;
public
double
A
{
get
{
return
viewModel
.
A
;
}
}
public
double
B
{
get
{
return
viewModel
.
B
;
}
}
//外部值
private
double
a
;
private
double
b
;
public
WdAbHelper2
()
{
InitializeComponent
();
viewModel
=
new
WdAbHelperVm
();
this
.
DataContext
=
viewModel
;
}
public
void
Init
(
double
a
,
double
b
,
ParamDictionary
paramDictionary
)
{
this
.
a
=
a
;
this
.
b
=
b
;
viewModel
.
A
=
a
;
viewModel
.
B
=
b
;
paramDictionary
.
SetBinding
(
viewModel
,
nameof
(
viewModel
.
IsJustB
),
"AbHelper.IsJustB"
,
true
);
}
private
void
button_cal_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
viewModel
.
IsJustB
)
{
//只是平移补偿
//只有X1,Y1
viewModel
.
A
=
a
;
viewModel
.
B
=
viewModel
.
Y1
-
viewModel
.
X1
+
b
;
}
else
{
if
((
viewModel
.
X2
==
viewModel
.
X1
)
&&
(
viewModel
.
Y2
!=
viewModel
.
Y1
))
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"异常!!!!"
,
"X2 == X1 但 Y2 != Y1"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
}
if
((
viewModel
.
X2
!=
viewModel
.
X1
)
&&
(
viewModel
.
Y2
==
viewModel
.
Y1
))
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"异常!!!!"
,
"X2 != X1 但 Y2 == Y1"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
}
else
if
(
a
==
0
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"异常!!!!"
,
"A==0"
,
TimeSpan
.
FromSeconds
(
2
));
return
;
}
if
((
viewModel
.
X2
==
viewModel
.
X1
)
&&
(
viewModel
.
Y2
==
viewModel
.
Y1
))
{
viewModel
.
A
=
a
;
viewModel
.
B
=
viewModel
.
Y2
-
viewModel
.
X2
+
b
;
}
else
{
double
x2
=
(
viewModel
.
X2
-
b
)
/
a
;
double
x1
=
(
viewModel
.
X1
-
b
)
/
a
;
viewModel
.
A
=
(
viewModel
.
Y2
-
viewModel
.
Y1
)
/
(
x2
-
x1
);
viewModel
.
B
=
viewModel
.
Y2
-
viewModel
.
A
*
x2
;
}
}
FLY
.
ControlLibrary
.
Window_Tip
.
Show
(
"成功"
,
"计算成功"
,
TimeSpan
.
FromSeconds
(
2
));
}
private
void
button_apply_Click
(
object
sender
,
RoutedEventArgs
e
)
{
this
.
DialogResult
=
true
;
}
}
}
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