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

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

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