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
20657021
Commit
20657021
authored
Mar 18, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
合并 glee08 修复20200317 bug
parents
f0822f1a
c315aef5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
171 additions
and
42 deletions
+171
-42
UC_AirRingShift.xaml
...st.Fix/FLY.HeatingHelper.UI/UIModule/UC_AirRingShift.xaml
+23
-19
UC_AirRingShift.xaml.cs
...Fix/FLY.HeatingHelper.UI/UIModule/UC_AirRingShift.xaml.cs
+7
-1
UC_FramePicker.xaml.cs
....Fix/FLY.HeatingHelper.UI/UIModule/UC_FramePicker.xaml.cs
+2
-2
UC_SelectData.xaml
...eatingHelper.UI/UIModule/UC_SelectData/UC_SelectData.xaml
+21
-9
UC_SelectData.xaml.cs
...ingHelper.UI/UIModule/UC_SelectData/UC_SelectData.xaml.cs
+12
-1
ViewModel_UC_SelectData.cs
...lper.UI/UIModule/UC_SelectData/ViewModel_UC_SelectData.cs
+40
-2
IThickHeatData.cs
....ThickHeatAnalyst.Fix/FLY.HeatingHelper/IThickHeatData.cs
+4
-0
ThickHeatData.cs
...Y.ThickHeatAnalyst.Fix/FLY.HeatingHelper/ThickHeatData.cs
+42
-4
ThickHeatData4SQLite_V2.cs
...tAnalyst.Fix/FLY.HeatingHelper/ThickHeatData4SQLite_V2.cs
+20
-4
No files found.
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_AirRingShift.xaml
View file @
20657021
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.HeatingHelper.UI.UIModule"
xmlns:local="clr-namespace:FLY.HeatingHelper.UI.UIModule"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:c1c="clr-namespace:C1.WPF.C1Chart;assembly=C1.WPF.C1Chart.4.5.2"
mc:Ignorable="d" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded" d:DesignHeight="450" d:DesignWidth="800">
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded">
<UserControl.Resources>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary.MergedDictionaries>
...
@@ -40,23 +41,26 @@
...
@@ -40,23 +41,26 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2">
<Border Grid.ColumnSpan="2">
<lvc:CartesianChart Series="{Binding VarSeries}" Margin="3"
<c1c:C1Chart Margin="5,0,0,0" FontSize="12">
DisableAnimations="True"
<c1c:C1Chart.Data>
Hoverable="False"
<c1c:ChartData>
DataTooltip="{x:Null}"
<c1c:DataSeries ValuesSource="{Binding DS_vthick}" ChartType="linesymbols" AxisY="ay0"
LegendLocation="Top"
SymbolSize="3,3"/>
FontSize="16">
<c1c:DataSeries ValuesSource="{Binding DS_vheat}" ChartType="linesymbols" AxisY="ay1"
<lvc:CartesianChart.AxisY>
SymbolSize="3,3"/>
<lvc:Axis Foreground="DodgerBlue" Title="厚度变化">
</c1c:ChartData>
</lvc:Axis>
</c1c:C1Chart.Data>
<lvc:Axis Foreground="IndianRed" Position="RightTop" Title="加热变化">
<c1c:C1Chart.View>
<lvc:Axis.Separator>
<c1c:ChartView>
<lvc:Separator IsEnabled="False"></lvc:Separator>
<c1c:ChartView.AxisY>
</lvc:Axis.Separator>
<c1c:Axis Name="ay0" Position="Near" Title="厚度变化"></c1c:Axis>
</lvc:Axis>
</c1c:ChartView.AxisY>
</lvc:CartesianChart.AxisY>
<c1c:Axis AxisType="Y" Name="ay1" Position="Far" Title="加热变化"
Min="-60" Max="60" MajorUnit="20"
</lvc:CartesianChart>
MajorGridStroke="Green"/>
</c1c:ChartView>
</c1c:C1Chart.View>
</c1c:C1Chart>
</Border>
</Border>
<!--<DockPanel Grid.Column="2">
<!--<DockPanel Grid.Column="2">
<TextBlock Text="锁定设置:" Style="{StaticResource TextBlockStyle_FieldHeader}" HorizontalAlignment="Center" DockPanel.Dock="Top"/>
<TextBlock Text="锁定设置:" Style="{StaticResource TextBlockStyle_FieldHeader}" HorizontalAlignment="Center" DockPanel.Dock="Top"/>
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_AirRingShift.xaml.cs
View file @
20657021
...
@@ -108,6 +108,9 @@ namespace FLY.HeatingHelper.UI.UIModule
...
@@ -108,6 +108,9 @@ namespace FLY.HeatingHelper.UI.UIModule
public
SeriesCollection
VarSeries
{
get
;
set
;
}
=
new
SeriesCollection
();
public
SeriesCollection
VarSeries
{
get
;
set
;
}
=
new
SeriesCollection
();
public
double
[]
DS_vthick
{
get
;
protected
set
;
}
=
null
;
public
double
[]
DS_vheat
{
get
;
protected
set
;
}
=
null
;
private
IThickHeatData
_data
;
private
IThickHeatData
_data
;
private
int
_airRingShift
=
0
;
private
int
_airRingShift
=
0
;
...
@@ -309,10 +312,13 @@ namespace FLY.HeatingHelper.UI.UIModule
...
@@ -309,10 +312,13 @@ namespace FLY.HeatingHelper.UI.UIModule
while
(
s
>=
cnt
)
s
-=
cnt
;
while
(
s
>=
cnt
)
s
-=
cnt
;
while
(
s
<
0
)
s
+=
cnt
;
while
(
s
<
0
)
s
+=
cnt
;
var
vth
=
DataHelper
.
VectorSub
(
vth1
,
vth2
);
var
vth
=
DataHelper
.
VectorSub
(
vth1
,
vth2
);
var
tmp
=
vth
.
Concat
(
vth
).
Skip
(
cnt
-
s
).
Take
(
cnt
);
var
tmp
=
vth
.
Concat
(
vth
).
Skip
(
cnt
-
s
).
Take
(
cnt
)
.
ToArray
()
;
var
vheat
=
DataHelper
.
VectorSub
(
vheat2
,
vheat1
);
var
vheat
=
DataHelper
.
VectorSub
(
vheat2
,
vheat1
);
DS_vthick
=
tmp
;
DS_vheat
=
vheat
;
tv
.
Clear
();
tv
.
AddRange
(
tmp
);
tv
.
Clear
();
tv
.
AddRange
(
tmp
);
hv
.
Clear
();
hv
.
AddRange
(
vheat
);
hv
.
Clear
();
hv
.
AddRange
(
vheat
);
if
(
VarSeries
.
Count
==
0
)
if
(
VarSeries
.
Count
==
0
)
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_FramePicker.xaml.cs
View file @
20657021
...
@@ -200,7 +200,7 @@ namespace FLY.HeatingHelper.UI.UIModule
...
@@ -200,7 +200,7 @@ namespace FLY.HeatingHelper.UI.UIModule
//private ChartValues<double> v1 = new ChartValues<double>();
//private ChartValues<double> v1 = new ChartValues<double>();
//private ChartValues<double> v2 = new ChartValues<double>();
//private ChartValues<double> v2 = new ChartValues<double>();
#
region
For
C1Chart
public
DoubleCollection
DS_thick
{
get
;
set
;
}
public
DoubleCollection
DS_thick
{
get
;
set
;
}
public
DoubleCollection
DS_heat
{
get
;
set
;
}
public
DoubleCollection
DS_heat
{
get
;
set
;
}
...
@@ -230,7 +230,7 @@ namespace FLY.HeatingHelper.UI.UIModule
...
@@ -230,7 +230,7 @@ namespace FLY.HeatingHelper.UI.UIModule
pe
.
Fill
=
new
SolidColorBrush
(
Colors
.
Red
);
pe
.
Fill
=
new
SolidColorBrush
(
Colors
.
Red
);
}
}
}
}
#
endregion
private
void
UpdateData
()
private
void
UpdateData
()
{
{
if
(
SelectedFrame
<
0
)
return
;
if
(
SelectedFrame
<
0
)
return
;
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_SelectData/UC_SelectData.xaml
View file @
20657021
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="15,0,15,0">
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="15,0,15,0">
<Controls:ToggleSwitch Content="过滤加热重复项" Margin="0,10,0,15" IsChecked="{Binding Path=Dat.IsDataFilter}" FontFamily="YouYuan" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}" FontSize="20"/>
<Controls:ToggleSwitch Content="过滤加热重复项" Margin="0,10,0,15" IsChecked="{Binding Path=Dat.IsDataFilter}" FontFamily="YouYuan" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}" FontSize="20"/>
<Controls:ToggleSwitch Content="过滤不稳定数据" Margin="0,10,0,15" IsChecked="{Binding Path=Dat.IsFilterUnstable}" FontFamily="YouYuan" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}" FontSize="20"/>
<Button Content="缺省数据范围" FontFamily="YouYuan" Margin="0,0,0,10"
<Button Content="缺省数据范围" FontFamily="YouYuan" Margin="0,0,0,10"
Style="{DynamicResource AccentedSquareButtonStyle}"
Style="{DynamicResource AccentedSquareButtonStyle}"
Command="{Binding DefaultLoadDataRange}"/>
Command="{Binding DefaultLoadDataRange}"/>
...
@@ -139,30 +140,41 @@
...
@@ -139,30 +140,41 @@
Style="{DynamicResource AccentedSquareButtonStyle}"/>
Style="{DynamicResource AccentedSquareButtonStyle}"/>
</Grid>
</Grid>
<Border Grid.Row="2" Margin="2,5,2,2">
<Border Grid.Row="2" Margin="2,5,2,2">
<c1c:C1Chart ChartType="Line" Margin="5,0,0,0">
<c1c:C1Chart Name="c1chart" ChartType="columnstacked"
Margin="5,0,0,0" FontSize="12" Loaded="C1chart_Loaded">
<c1c:C1Chart.Data>
<c1c:C1Chart.Data>
<c1c:ChartData>
<c1c:ChartData>
<az:AlarmZone Near="{Binding Dat.AnalystIndexFrom}"
<c1c:DataSeries ValuesSource="{Binding DS_2sigma}" RenderMode="Default" PlotElementLoaded="DataSeries_PlotElementLoaded"/>
<c1c:DataSeries ValuesSource="{Binding DS_2sigmaN}" RenderMode="Default" PlotElementLoaded="DataSeries_PlotElementLoaded"/>
<az:AlarmZone Near="{Binding Dat.AnalystIndexFrom}" AxisY="ay1"
Far="{Binding Dat.AnalystIndexTo}"
Far="{Binding Dat.AnalystIndexTo}"
LowExtent="-1"
LowExtent="-1"
UpperExtent="11"
UpperExtent="11"
ConnectionFill="AliceBlue"/>
ConnectionFill="AliceBlue"/>
<c1c:DataSeries ValuesSource="{Binding DS_thick}" AxisY="ay0" Label="厚度"/>
<c1c:DataSeries ValuesSource="{Binding DS_thick}" AxisY="ay0" Label="厚度" ChartType="line"/>
<c1c:DataSeries ValuesSource="{Binding DS_2sigma}" AxisY="ay1" Label="2Sigma"/>
</c1c:ChartData>
</c1c:ChartData>
</c1c:C1Chart.Data>
</c1c:C1Chart.Data>
<c1c:C1Chart.View>
<c1c:C1Chart.View>
<c1c:ChartView>
<c1c:ChartView>
<c1c:ChartView.PlotAreaRowDefinitions>
<c1c:PlotAreaRowDefinition Height="*"/>
<c1c:PlotAreaRowDefinition Height="*"/>
</c1c:ChartView.PlotAreaRowDefinitions>
<c1c:ChartView.PlotAreas>
<c1c:PlotArea/>
<c1c:PlotArea Row="1"/>
</c1c:ChartView.PlotAreas>
<c1c:ChartView.AxisY>
<c1c:ChartView.AxisY>
<c1c:Axis Visible="False" Min="0" Max="10"/>
<c1c:Axis Title="2Sigma" Position="Near"
Min="-0.09" Max="0.09" PlotAreaIndex="0" MajorGridStroke="Blue"
MajorUnit="0.03"/>
</c1c:ChartView.AxisY>
</c1c:ChartView.AxisY>
<c1c:ChartView.AxisX>
<c1c:ChartView.AxisX>
<c1c:Axis Max="{Binding RecordCount, Mode=OneWay}" />
<c1c:Axis Max="{Binding RecordCount, Mode=OneWay}"
Min="0"
/>
</c1c:ChartView.AxisX>
</c1c:ChartView.AxisX>
<c1c:Axis Name="ay0" AxisType="Y" Title="厚度" Position="Near"
<c1c:Axis Name="ay0" AxisType="Y" Title="厚度" Position="Near"
/>
PlotAreaIndex="1"/>
<c1c:Axis Name="ay1" AxisType="Y" Title="2Sigma" Position="Far"
<c1c:Axis Visible="False" Min="0" Max="10" PlotAreaIndex="1" Name="ay1"/>
Min="-2" Max="20"/>
</c1c:ChartView>
</c1c:ChartView>
</c1c:C1Chart.View>
</c1c:C1Chart.View>
</c1c:C1Chart>
</c1c:C1Chart>
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_SelectData/UC_SelectData.xaml.cs
View file @
20657021
using
System
;
using
C1.WPF.C1Chart
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
@@ -35,5 +36,15 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
...
@@ -35,5 +36,15 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
{
{
(
DataContext
as
ViewModel_UC_SelectData
).
OnLoaded
();
(
DataContext
as
ViewModel_UC_SelectData
).
OnLoaded
();
}
}
private
void
DataSeries_PlotElementLoaded
(
object
sender
,
EventArgs
e
)
{
(
DataContext
as
ViewModel_UC_SelectData
).
PlotElementLoaded
(
sender
,
e
);
}
private
void
C1chart_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
LineAreaOptions
.
SetOptimizationRadius
(
c1chart
,
5
);
}
}
}
}
}
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper.UI/UIModule/UC_SelectData/ViewModel_UC_SelectData.cs
View file @
20657021
using
GalaSoft.MvvmLight.Command
;
using
C1.WPF.C1Chart
;
using
GalaSoft.MvvmLight.Command
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
...
@@ -6,6 +7,7 @@ using System.Linq;
...
@@ -6,6 +7,7 @@ using System.Linq;
using
System.ServiceModel.Channels
;
using
System.ServiceModel.Channels
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Media
;
namespace
FLY.HeatingHelper.UI.UIModule.UC_SelectData
namespace
FLY.HeatingHelper.UI.UIModule.UC_SelectData
{
{
...
@@ -52,6 +54,7 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
...
@@ -52,6 +54,7 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
public
double
[]
DS_thick
{
get
;
set
;
}
public
double
[]
DS_thick
{
get
;
set
;
}
public
double
[]
DS_2sigma
{
get
;
set
;
}
public
double
[]
DS_2sigma
{
get
;
set
;
}
public
double
[]
DS_2sigmaN
{
get
;
set
;
}
public
DateTime
?
AnalystDataFrom
public
DateTime
?
AnalystDataFrom
{
{
...
@@ -92,10 +95,45 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
...
@@ -92,10 +95,45 @@ namespace FLY.HeatingHelper.UI.UIModule.UC_SelectData
{
{
if
(
RecordCount
<=
0
)
return
;
if
(
RecordCount
<=
0
)
return
;
DS_thick
=
Dat
.
Dat_Means
.
ToArray
();
DS_thick
=
Dat
.
Dat_Means
.
ToArray
();
DS_2sigma
=
Dat
.
Dat_Sigmas
.
ToArray
();
double
[]
tmp0
=
Dat
.
Dat_Sigmas
.
ToArray
();
int
cnt
=
tmp0
.
Count
();
double
[]
tmp
=
new
double
[
cnt
];
for
(
int
i
=
0
;
i
<
cnt
;
i
++)
{
if
(
double
.
IsNaN
(
DS_thick
[
i
]))
{
tmp
[
i
]
=
tmp0
[
i
]
=
double
.
NaN
;
}
if
(
Math
.
Abs
(
DS_thick
[
i
])
<
1
)
{
tmp
[
i
]
=
tmp0
[
i
]
=
double
.
NaN
;
}
tmp0
[
i
]
=
tmp0
[
i
]
/
DS_thick
[
i
];
tmp
[
i
]
=
-
tmp0
[
i
];
}
DS_2sigma
=
tmp0
;
DS_2sigmaN
=
tmp
;
}
}
#
endregion
#
endregion
public
void
PlotElementLoaded
(
object
s
,
EventArgs
e
)
{
PlotElement
pe
=
s
as
PlotElement
;
double
v
=
Math
.
Abs
(
pe
.
DataPoint
.
Value
);
if
(
v
<=
0.03
)
{
pe
.
Fill
=
new
SolidColorBrush
(
Colors
.
Green
);
}
else
if
(
v
<=
0.06
)
{
pe
.
Fill
=
new
SolidColorBrush
(
Colors
.
Yellow
);
}
else
{
pe
.
Fill
=
new
SolidColorBrush
(
Colors
.
Red
);
}
}
#
region
UI
界面按钮功能
(
Command
)
#
region
UI
界面按钮功能
(
Command
)
public
RelayCommand
DefaultLoadDataRange
{
get
;
internal
set
;
}
=
null
;
public
RelayCommand
DefaultLoadDataRange
{
get
;
internal
set
;
}
=
null
;
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper/IThickHeatData.cs
View file @
20657021
...
@@ -39,6 +39,10 @@ namespace FLY.HeatingHelper
...
@@ -39,6 +39,10 @@ namespace FLY.HeatingHelper
/// </summary>
/// </summary>
bool
IsDataFilter
{
get
;
set
;
}
bool
IsDataFilter
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 加载数据时是否过滤掉没有稳定的数据
/// </summary>
bool
IsFilterUnstable
{
get
;
set
;
}
/// <summary>
/// 重新设定加载数据的缺省范围
/// 重新设定加载数据的缺省范围
/// </summary>
/// </summary>
void
SetLoadDaTaDefault
();
void
SetLoadDaTaDefault
();
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper/ThickHeatData.cs
View file @
20657021
...
@@ -147,6 +147,11 @@ namespace FLY.HeatingHelper
...
@@ -147,6 +147,11 @@ namespace FLY.HeatingHelper
/// 加载数据时是否过滤掉加热相同的连续数据
/// 加载数据时是否过滤掉加热相同的连续数据
/// </summary>
/// </summary>
public
bool
IsDataFilter
{
get
;
set
;
}
=
true
;
public
bool
IsDataFilter
{
get
;
set
;
}
=
true
;
/// <summary>
/// 加载数据时是否过滤掉没有稳定的数据
/// </summary>
public
bool
IsFilterUnstable
{
get
;
set
;
}
=
true
;
/// <summary>
/// <summary>
/// 重新设定加载数据的缺省范围
/// 重新设定加载数据的缺省范围
/// </summary>
/// </summary>
...
@@ -445,8 +450,34 @@ namespace FLY.HeatingHelper
...
@@ -445,8 +450,34 @@ namespace FLY.HeatingHelper
}
}
}
}
public
int
AnalystIndexFrom
{
get
;
set
;
}
private
int
_analystIndexFrom
=
-
1
;
public
int
AnalystIndexTo
{
get
;
set
;
}
public
int
AnalystIndexFrom
{
get
=>
_analystIndexFrom
;
set
{
int
cnt
=
_dat_times
.
Count
();
if
(
cnt
<=
0
)
return
;
if
(
value
>=
0
&&
value
<
cnt
)
{
_analystIndexFrom
=
value
;
}
}
}
private
int
_analystIndexTo
=
-
1
;
public
int
AnalystIndexTo
{
get
=>
_analystIndexTo
;
set
{
int
cnt
=
_dat_times
.
Count
();
if
(
cnt
<=
0
)
return
;
if
(
value
>=
0
&&
value
<
cnt
)
{
_analystIndexTo
=
value
;
}
}
}
/// <summary>
/// <summary>
/// 设定缺省的分析数据范围
/// 设定缺省的分析数据范围
/// </summary>
/// </summary>
...
@@ -788,6 +819,7 @@ namespace FLY.HeatingHelper
...
@@ -788,6 +819,7 @@ namespace FLY.HeatingHelper
}
}
public
double
[]
GetThicksByIndex
(
int
idx
,
int
from
,
int
to
)
public
double
[]
GetThicksByIndex
(
int
idx
,
int
from
,
int
to
)
{
{
if
(
idx
<
0
)
return
null
;
int
cnt
=
_thicks
[
0
].
Count
();
int
cnt
=
_thicks
[
0
].
Count
();
if
((
to
>=
cnt
)
||
(
to
<
0
))
to
=
cnt
-
1
;
if
((
to
>=
cnt
)
||
(
to
<
0
))
to
=
cnt
-
1
;
if
((
from
<
0
)
||
(
from
>
to
))
from
=
0
;
if
((
from
<
0
)
||
(
from
>
to
))
from
=
0
;
...
@@ -817,6 +849,7 @@ namespace FLY.HeatingHelper
...
@@ -817,6 +849,7 @@ namespace FLY.HeatingHelper
}
}
public
double
[]
GetThicksByIndex
(
int
idx
,
int
newResetBolt
,
double
newAngle
)
public
double
[]
GetThicksByIndex
(
int
idx
,
int
newResetBolt
,
double
newAngle
)
{
{
if
(
idx
<
0
)
return
null
;
double
[]
ret
=
GetThicksByIndex
(
idx
,
-
1
,
-
1
);
double
[]
ret
=
GetThicksByIndex
(
idx
,
-
1
,
-
1
);
if
(
ret
is
null
)
return
null
;
if
(
ret
is
null
)
return
null
;
int
index
=
idx
;
int
index
=
idx
;
...
@@ -853,6 +886,7 @@ namespace FLY.HeatingHelper
...
@@ -853,6 +886,7 @@ namespace FLY.HeatingHelper
}
}
public
double
[]
GetHeatsByIndex
(
int
idx
,
int
from
,
int
to
)
public
double
[]
GetHeatsByIndex
(
int
idx
,
int
from
,
int
to
)
{
{
if
(
idx
<
0
)
return
null
;
int
cnt
=
_heats
[
0
].
Count
();
int
cnt
=
_heats
[
0
].
Count
();
if
((
to
>=
cnt
)
||
(
to
<
0
))
to
=
cnt
-
1
;
if
((
to
>=
cnt
)
||
(
to
<
0
))
to
=
cnt
-
1
;
if
((
from
<
0
)
||
(
from
>
to
))
from
=
0
;
if
((
from
<
0
)
||
(
from
>
to
))
from
=
0
;
...
@@ -873,6 +907,7 @@ namespace FLY.HeatingHelper
...
@@ -873,6 +907,7 @@ namespace FLY.HeatingHelper
}
}
public
int
GetResetBoltByIndex
(
int
idx
)
public
int
GetResetBoltByIndex
(
int
idx
)
{
{
if
(
idx
<
0
)
return
-
1
;
return
_resetBolts
[
idx
];
return
_resetBolts
[
idx
];
}
}
...
@@ -889,12 +924,12 @@ namespace FLY.HeatingHelper
...
@@ -889,12 +924,12 @@ namespace FLY.HeatingHelper
}
}
public
double
GetRotAngleByIndex
(
int
idx
)
public
double
GetRotAngleByIndex
(
int
idx
)
{
{
return
_rotAngles
[
idx
];
return
idx
<
0
?
-
1
:
_rotAngles
[
idx
];
}
}
public
int
Index2ID
(
int
idx
)
public
int
Index2ID
(
int
idx
)
{
{
if
(
idx
<
_ids
.
Count
())
return
_ids
[
idx
];
if
(
idx
>=
0
&&
idx
<
_ids
.
Count
())
return
_ids
[
idx
];
return
-
1
;
return
-
1
;
}
}
...
@@ -1492,7 +1527,10 @@ namespace FLY.HeatingHelper
...
@@ -1492,7 +1527,10 @@ namespace FLY.HeatingHelper
{
{
if
(
BeginUse
())
if
(
BeginUse
())
{
{
bool
tmp
=
IsFilterUnstable
;
IsFilterUnstable
=
true
;
RefreshData
();
RefreshData
();
IsFilterUnstable
=
tmp
;
EndUse
();
EndUse
();
Thread
.
Sleep
(
1000
*
60
);
Thread
.
Sleep
(
1000
*
60
);
}
}
...
...
Project.FLY.ThickHeatAnalyst.Fix/FLY.HeatingHelper/ThickHeatData4SQLite_V2.cs
View file @
20657021
...
@@ -69,13 +69,21 @@ namespace FLY.HeatingHelper
...
@@ -69,13 +69,21 @@ namespace FLY.HeatingHelper
string
cmdstr
;
string
cmdstr
;
if
(
reload
||
_ids
.
Count
()
==
0
)
if
(
reload
||
_ids
.
Count
()
==
0
)
{
{
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where IsStable=1 and Time>=\"{0}\" and Time<=\"{1}\""
,
if
(
IsFilterUnstable
)
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where IsStable=1 and Time>=\"{0}\" and Time<=\"{1}\""
,
(
LoadDataTo
-
LoadDataSpan
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
else
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where Time>=\"{0}\" and Time<=\"{1}\""
,
(
LoadDataTo
-
LoadDataSpan
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
(
LoadDataTo
-
LoadDataSpan
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
}
}
else
else
{
{
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\" and IsStable=1"
,
_ids
.
Last
());
if
(
IsFilterUnstable
)
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\" and IsStable=1"
,
_ids
.
Last
());
else
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\""
,
_ids
.
Last
());
}
}
dataTable
=
mSQLiteHelper
.
ExecuteReader
(
cmdstr
);
dataTable
=
mSQLiteHelper
.
ExecuteReader
(
cmdstr
);
//SQLiteDataAdapter dbDataAdapter = new SQLiteDataAdapter(cmdstr, connectionString);
//SQLiteDataAdapter dbDataAdapter = new SQLiteDataAdapter(cmdstr, connectionString);
...
@@ -215,13 +223,21 @@ namespace FLY.HeatingHelper
...
@@ -215,13 +223,21 @@ namespace FLY.HeatingHelper
if
((
reload
==
0
&&
_ids
.
Count
()
==
0
)
||
(
reload
==
1
))
if
((
reload
==
0
&&
_ids
.
Count
()
==
0
)
||
(
reload
==
1
))
{
{
clear
=
true
;
clear
=
true
;
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where IsStable=1 and Time>=\"{0}\" and Time<=\"{1}\""
,
if
(
IsFilterUnstable
)
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where IsStable=1 and Time>=\"{0}\" and Time<=\"{1}\""
,
LoadDataFrom
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
else
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where Time>=\"{0}\" and Time<=\"{1}\""
,
LoadDataFrom
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
LoadDataFrom
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
LoadDataTo
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
}
}
else
else
{
{
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\" and IsStable=1"
,
_ids
.
Last
());
if
(
IsFilterUnstable
)
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\" and IsStable=1"
,
_ids
.
Last
());
else
cmdstr
=
string
.
Format
(
"select * from [ThickHeat] where ID>\"{0}\""
,
_ids
.
Last
());
}
}
try
try
{
{
...
...
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