Commit bca3ea01 authored by 潘栩锋's avatar 潘栩锋 🚴

风环添加 看到撤销记录的时间

parent cfc5fe73
...@@ -51,7 +51,7 @@ using System.Windows; ...@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.0.0")] [assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.1.0.0")] [assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: Guid("18607932-ECBC-4292-A3DE-5864B7FB14DB")] [assembly: Guid("18607932-ECBC-4292-A3DE-5864B7FB14DB")]
...@@ -63,11 +63,14 @@ ...@@ -63,11 +63,14 @@
<Style TargetType="Image"> <Style TargetType="Image">
<Setter Property="Height" Value="50"/> <Setter Property="Height" Value="50"/>
</Style> </Style>
<Style TargetType="TextBlock" >
<Style TargetType="TextBlock" x:Key="TitleStyle">
<Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontFamily" Value="YouYuan"/> <Setter Property="FontFamily" Value="YouYuan"/>
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>
</Style> </Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource TitleStyle}"/>
</ResourceDictionary> </ResourceDictionary>
</Grid.Resources> </Grid.Resources>
...@@ -130,7 +133,18 @@ ...@@ -130,7 +133,18 @@
<TextBlock Text="{Binding UndoIdx}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontFamily="Arial" FontSize="10"/> <TextBlock Text="{Binding UndoIdx}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontFamily="Arial" FontSize="10"/>
</Grid> </Grid>
</Grid> </Grid>
<TextBlock Text="撤销" /> <TextBlock >
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource TitleStyle}">
<Setter Property="Text" Value="撤销"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsInUndo}" Value="True">
<Setter Property="Text" Value="{Binding UndoTime,StringFormat={}{0:HH:mm}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel> </StackPanel>
</Button> </Button>
<Button x:Name="button_clear_h" Click="button_clear_h_click" Template="{StaticResource picture_button}" > <Button x:Name="button_clear_h" Click="button_clear_h_click" Template="{StaticResource picture_button}" >
......
...@@ -79,11 +79,6 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule ...@@ -79,11 +79,6 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule
grid_longpress.DataContext = lpress; grid_longpress.DataContext = lpress;
} }
private void Sysparam_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
throw new NotImplementedException();
}
void InitializeChart() void InitializeChart()
{ {
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
...@@ -713,58 +708,25 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule ...@@ -713,58 +708,25 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule
public class LongPress : INotifyPropertyChanged public class LongPress : INotifyPropertyChanged
{ {
private int progress = 0;
/// <summary> /// <summary>
/// 满9 /// 满9
/// </summary> /// </summary>
public int Progress public int Progress { get; set; }
{
get { return progress; } public bool IsOK => (Progress == Max);
set
{ public bool IsRunning => (Progress > 0);
if (progress != value)
{
progress = value;
NotifyPropertyChanged("Progress");
NotifyPropertyChanged("IsOK");
NotifyPropertyChanged("IsRunning");
}
}
}
private int max = 360;
/// <summary> /// <summary>
/// Progress 最大值 /// Progress 最大值
/// </summary> /// </summary>
public int Max public int Max { get; set; } = 360;
{
get { return max; }
set
{
if (max != value)
{
max = value;
NotifyPropertyChanged("Max");
}
}
}
private int intervalMs = 2000;
/// <summary> /// <summary>
/// 时间间隔 /// 时间间隔
/// </summary> /// </summary>
public int IntervalMs public int IntervalMs { get; set; } = 2000;
{
get { return intervalMs; }
set
{
if (intervalMs != value)
{
intervalMs = value;
NotifyPropertyChanged("IntervalMs");
}
}
}
public RoutedEventHandler LongClick; public RoutedEventHandler LongClick;
...@@ -829,20 +791,8 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule ...@@ -829,20 +791,8 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule
} }
} }
public bool IsOK
{
get
{
return (Progress == Max);
}
}
public bool IsRunning
{
get
{
return (Progress > 0);
}
}
public void Reset() public void Reset()
{ {
Progress = 0; Progress = 0;
...@@ -851,13 +801,6 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule ...@@ -851,13 +801,6 @@ namespace FLY.FeedbackRenZiJia.UI.Client.UIModule
#region INotifyPropertyChanged 成员 #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 #endregion
} }
......
...@@ -51,7 +51,7 @@ using System.Windows; ...@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: // 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.0.0")] [assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.1.0.0")] [assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: Guid("32104657-86E9-4380-9113-606589E6D812")] [assembly: Guid("32104657-86E9-4380-9113-606589E6D812")]
...@@ -140,14 +140,28 @@ namespace FLY.FeedbackRenZiJia.IService ...@@ -140,14 +140,28 @@ namespace FLY.FeedbackRenZiJia.IService
/// <param name="filename"></param> /// <param name="filename"></param>
void LoadHeatsFile(string productname); void LoadHeatsFile(string productname);
#region 撤销
/// <summary> /// <summary>
/// undo 的序号 /// 撤销的序号
/// </summary> /// </summary>
int UndoIdx { int UndoIdx { get; }
get; /// <summary>
} /// 撤销中
//读取 UndoIdx 的 加热 /// </summary>
bool IsInUndo { get; }
/// <summary>
/// 这次撤销动作的时间
/// </summary>
DateTime UndoTime { get; }
//UndoIdx--
void Undo(); void Undo();
/// <summary>
/// UndoIdx++
/// </summary>
void Redo();
#endregion
} }
......
...@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; ...@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// 内部版本号 // 内部版本号
// 修订号 // 修订号
// //
[assembly: AssemblyVersion("4.1.0.0")] [assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.1.0.0")] [assembly: AssemblyFileVersion("4.2.0.0")]
...@@ -215,8 +215,8 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -215,8 +215,8 @@ namespace FLY.FeedbackRenZiJia.Server
//记录改变!!!! //记录改变!!!!
mHeatChanged.Add(mHeatCell.Heats); mHeatChanged.Add(mHeatCell.Heats);
UndoIdx = mHeatChanged.mItem.Count() - 1; //复位undo模块
resetUndo();
//记录到数据库 //记录到数据库
if (lastLcThickHeat != null) if (lastLcThickHeat != null)
...@@ -230,7 +230,8 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -230,7 +230,8 @@ namespace FLY.FeedbackRenZiJia.Server
}; };
mHeatCell.AfterClearOffsetsEvent += (c) => { mHeatCell.AfterClearOffsetsEvent += (c) => {
UndoIdx = mHeatChanged.mItem.Count() - 1; //复位undo模块
resetUndo();
}; };
...@@ -406,7 +407,8 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -406,7 +407,8 @@ namespace FLY.FeedbackRenZiJia.Server
mHeatBuf.Init(NBolts, ChannelCnt); mHeatBuf.Init(NBolts, ChannelCnt);
mHeatCell.Init2(NBolts, ChannelCnt); mHeatCell.Init2(NBolts, ChannelCnt);
UndoIdx = mHeatChanged.mItem.Count() - 1; //复位undo模块
resetUndo();
mSnapShotBuf.Init(NBolts, ChannelCnt); mSnapShotBuf.Init(NBolts, ChannelCnt);
} }
...@@ -824,19 +826,42 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -824,19 +826,42 @@ namespace FLY.FeedbackRenZiJia.Server
/// <summary> /// <summary>
/// undo 的序号 /// undo 的序号
/// </summary> /// </summary>
public int UndoIdx { get; protected set; } public int UndoIdx { get; private set; }
/// <summary>
/// 在撤销中
/// </summary>
public bool IsInUndo { get; private set; }
/// <summary>
/// 这次撤销动作的时间
/// </summary>
public DateTime UndoTime { get; private set; }
//读取 UndoIdx 的 加热 //读取 UndoIdx 的 加热
public void Undo() public void Undo()
{ {
int idx = UndoIdx - 1; updateUodo(UndoIdx - 1);
}
public void Redo()
{
updateUodo(UndoIdx + 1);
}
void updateUodo(int idx)
{
if (idx < 0) if (idx < 0)
return; return;
else if (idx >= mHeatChanged.mItem.Count()) else if (idx >= mHeatChanged.mItem.Count())
return; return;
mHeatCell.ModifyPreHeats(mHeatChanged.mItem[idx].Heats); mHeatCell.ModifyPreHeats(mHeatChanged.mItem[idx].Heats);
UndoIdx--; UndoTime = mHeatChanged.mItem[idx].Time;
IsInUndo = idx <= mHeatChanged.mItem.Count() - 1;
UndoIdx = idx;
}
void resetUndo()
{
UndoIdx = mHeatChanged.mItem.Count() - 1;
UndoTime = DateTime.MinValue;
IsInUndo = false;
} }
#endregion #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