首次上传
This commit is contained in:
@@ -0,0 +1,354 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
using SciChart.Charting.Model.DataSeries;
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using Aitex.Core.Util;
|
||||
using System.Windows.Media;
|
||||
using System.Threading.Tasks;
|
||||
using SciChart.Charting.Visuals.Annotations;
|
||||
using System.Windows;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
public class ChartDataLineX : FastLineRenderableSeries, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private string[] _dbModules = { "PM1", "PM2" };
|
||||
|
||||
#region PropertyChanged
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
public void InvokePropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChangedEventArgs eventArgs = new PropertyChangedEventArgs(propertyName);
|
||||
PropertyChangedEventHandler changed = PropertyChanged;
|
||||
if (changed != null)
|
||||
{
|
||||
changed(this, eventArgs);
|
||||
}
|
||||
}
|
||||
public void InvokePropertyChanged()
|
||||
{
|
||||
Type t = this.GetType();
|
||||
var ps = t.GetProperties();
|
||||
foreach (var p in ps)
|
||||
{
|
||||
InvokePropertyChanged(p.Name);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public string Time { get; set; }
|
||||
|
||||
public string RecipeName { get; set; }
|
||||
|
||||
public string UniqueId { get; set; }
|
||||
|
||||
public string ProcessGuid { get; set; }
|
||||
|
||||
public string Module { get; set; }
|
||||
public string RecName { get; set; }
|
||||
|
||||
public List<Tuple<double, double>> Points
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
return _queueRawData.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string DataSource { get; set; }
|
||||
public string DataName { get; set; }
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataSeries.SeriesName;
|
||||
}
|
||||
set
|
||||
{
|
||||
DataSeries.SeriesName = value;
|
||||
}
|
||||
}
|
||||
public double LineThickness
|
||||
{
|
||||
get
|
||||
{
|
||||
return StrokeThickness;
|
||||
}
|
||||
set
|
||||
{
|
||||
var i = Convert.ToInt32(value);
|
||||
if (i < 1) i = 1;
|
||||
if (i > 100) i = 100;
|
||||
StrokeThickness = i;
|
||||
InvokePropertyChanged("LineThickness");
|
||||
}
|
||||
}
|
||||
|
||||
private double _dataFactor = 1.0;
|
||||
public double DataFactor
|
||||
{
|
||||
get => _dataFactor;
|
||||
set
|
||||
{
|
||||
if (Math.Abs(_dataFactor - value) > 0.001)
|
||||
{
|
||||
_dataFactor = value;
|
||||
InvokePropertyChanged(nameof(DataFactor));
|
||||
UpdateChartSeriesValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double _dataOffset = 0;
|
||||
public double DataOffset
|
||||
{
|
||||
get => _dataOffset;
|
||||
set
|
||||
{
|
||||
if (Math.Abs(_dataOffset - value) > 0.001)
|
||||
{
|
||||
_dataOffset = value;
|
||||
InvokePropertyChanged(nameof(DataOffset));
|
||||
UpdateChartSeriesValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
private double _dataxOffset = 0;
|
||||
public double DataXOffset
|
||||
{
|
||||
get => _dataxOffset;
|
||||
set
|
||||
{
|
||||
_dataxOffset = value;
|
||||
InvokePropertyChanged(nameof(DataXOffset));
|
||||
RePaintChartSeriesValue();
|
||||
}
|
||||
}
|
||||
|
||||
private int _capacity = 10000;
|
||||
|
||||
public int Capacity
|
||||
{
|
||||
get { return _capacity; }
|
||||
set
|
||||
{
|
||||
_capacity = value;
|
||||
//DataSeries.FifoCapacity = value;
|
||||
if (_queueRawData != null)
|
||||
{
|
||||
_queueRawData.FixedSize = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private object _lockData = new object();
|
||||
|
||||
private FixSizeQueue<Tuple<double, double>> _queueRawData;
|
||||
public List<Tuple<long, string>> _alarmData;
|
||||
|
||||
public ChartDataLineX(string dataName)
|
||||
: this(dataName, dataName, Colors.Blue)
|
||||
{
|
||||
Module = "System";
|
||||
foreach (var dbModule in _dbModules)
|
||||
{
|
||||
if (dataName.StartsWith(dbModule))
|
||||
{
|
||||
Module = dbModule;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ChartDataLineX(string dataName, string displayName, Color seriesColor)
|
||||
{
|
||||
UniqueId = Guid.NewGuid().ToString();
|
||||
|
||||
_queueRawData = new FixSizeQueue<Tuple<double, double>>(_capacity);
|
||||
_alarmData = new List<Tuple<long, string>>();
|
||||
|
||||
XAxisId = "DefaultAxisId";
|
||||
YAxisId = "DefaultAxisId";
|
||||
DataSeries = new XyDataSeries<double, double>(0);
|
||||
|
||||
DisplayName = displayName;
|
||||
|
||||
DataName = dataName;
|
||||
|
||||
Stroke = seriesColor;
|
||||
|
||||
IsVisible = true;
|
||||
DataOffset = 0;
|
||||
LineThickness = 1;
|
||||
DataFactor = 1;
|
||||
}
|
||||
|
||||
public void Append(double xvalue, double value)
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
_queueRawData.Enqueue(Tuple.Create(xvalue, value));
|
||||
var series = DataSeries as XyDataSeries<double, double>;
|
||||
if (series != null)
|
||||
{
|
||||
series.Append(xvalue, value * _dataFactor + _dataOffset);
|
||||
//while (series.Count > _capacity)
|
||||
//{
|
||||
// series.RemoveRange(0, series.Count - _capacity);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateChartSeriesValue()
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
using (DataSeries.SuspendUpdates())
|
||||
{
|
||||
XyDataSeries<double, double> s = DataSeries as XyDataSeries<double, double>;
|
||||
for (int i = 0; i < s.Count; i++)
|
||||
{
|
||||
s.Update(i, _queueRawData.ElementAt(i).Item2 * _dataFactor + _dataOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RePaintChartSeriesValue()
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
using (DataSeries.SuspendUpdates())
|
||||
{
|
||||
DataSeries.Clear();
|
||||
var series = DataSeries as XyDataSeries<double, double>;
|
||||
for (int i = 0; i < _queueRawData.Count; i++)
|
||||
{
|
||||
series.Append(_queueRawData.ElementAt(i).Item1 + DataXOffset, _queueRawData.ElementAt(i).Item2 * _dataFactor + _dataOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ClearData()
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
_queueRawData.Clear();
|
||||
(DataSeries as XyDataSeries<double, double>)?.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void AppedAlarm(long timeTicks, string alarmID)
|
||||
{
|
||||
_alarmData.Add(Tuple.Create<long, string>(timeTicks, alarmID));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private int _pointCount;
|
||||
public int PointCount
|
||||
{
|
||||
get { return _pointCount; }
|
||||
set
|
||||
{
|
||||
_pointCount = value;
|
||||
InvokePropertyChanged(nameof(PointCount));
|
||||
}
|
||||
}
|
||||
|
||||
private double _variance;
|
||||
public double Variance
|
||||
{
|
||||
get { return _variance; }
|
||||
set
|
||||
{
|
||||
_variance = value;
|
||||
InvokePropertyChanged(nameof(Variance));
|
||||
}
|
||||
}
|
||||
|
||||
private double _maxValue;
|
||||
public double MaxValue
|
||||
{
|
||||
get { return _maxValue; }
|
||||
set
|
||||
{
|
||||
_maxValue = value;
|
||||
InvokePropertyChanged(nameof(MaxValue));
|
||||
}
|
||||
}
|
||||
private double _minValue;
|
||||
public double MinValue
|
||||
{
|
||||
get { return _minValue; }
|
||||
set
|
||||
{
|
||||
_minValue = value;
|
||||
InvokePropertyChanged(nameof(MinValue));
|
||||
}
|
||||
}
|
||||
|
||||
private double _avgValue;
|
||||
public double AvgValue
|
||||
{
|
||||
get { return _avgValue; }
|
||||
set
|
||||
{
|
||||
_avgValue = value;
|
||||
InvokePropertyChanged(nameof(AvgValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Caculate(double x1,double x2)
|
||||
{
|
||||
//if (RecName == "RealTime")
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
double min = x1;
|
||||
double max = x2;
|
||||
if (x1 > x2)
|
||||
{
|
||||
min = x2;
|
||||
max = x1;
|
||||
}
|
||||
if (max - min < 10)
|
||||
{
|
||||
min = 0;
|
||||
max = 100000000;
|
||||
}
|
||||
|
||||
PointCount = Points.Where(a => a.Item1 >= min && a.Item1 <= max).Count();
|
||||
if (PointCount == 0)
|
||||
{
|
||||
MaxValue = 0;
|
||||
MinValue = 0;
|
||||
AvgValue = 0;
|
||||
Variance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxValue = Points.Where(a => a.Item1 >= min && a.Item1 <= max).Max(x => x.Item2);
|
||||
MinValue = Points.Where(a => a.Item1 >= min && a.Item1 <= max).Min(x => x.Item2);
|
||||
AvgValue = Points.Where(a => a.Item1 >= min && a.Item1 <= max).Average(x => x.Item2);
|
||||
Variance = Points.Where(a => a.Item1 >= min && a.Item1 <= max).Sum(x => Math.Pow(x.Item2 - AvgValue, 2)) / PointCount;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
using SciChart.Charting.Model.DataSeries;
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using System.Windows.Media;
|
||||
using System.Threading.Tasks;
|
||||
using SciChart.Charting.Visuals.Annotations;
|
||||
using System.Windows;
|
||||
using System.Collections.ObjectModel;
|
||||
using SciChart.Charting.Model.ChartSeries;
|
||||
using SciChart.Charting.Visuals.PointMarkers;
|
||||
using Aitex.Core.Util;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
public class ChartDataLineXV2 : LineRenderableSeriesViewModel, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private string[] _dbModules = { "PM1", "PM2" };
|
||||
|
||||
public string Time { get; set; }
|
||||
|
||||
public string RecipeName { get; set; }
|
||||
|
||||
public string UniqueId { get; set; }
|
||||
|
||||
public string ProcessGuid { get; set; }
|
||||
|
||||
public string Module { get; set; }
|
||||
public string RecName { get; set; }
|
||||
|
||||
public List<Tuple<double, double>> Points
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
return _queueRawData.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string DataSource { get; set; }
|
||||
public string DataName { get; set; }
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataSeries.SeriesName;
|
||||
}
|
||||
set
|
||||
{
|
||||
DataSeries.SeriesName = value;
|
||||
}
|
||||
}
|
||||
public double LineThickness
|
||||
{
|
||||
get
|
||||
{
|
||||
return StrokeThickness;
|
||||
}
|
||||
set
|
||||
{
|
||||
var i = Convert.ToInt32(value);
|
||||
if (i < 1) i = 1;
|
||||
if (i > 100) i = 100;
|
||||
StrokeThickness = i;
|
||||
OnPropertyChanged("LineThickness");
|
||||
}
|
||||
}
|
||||
|
||||
private double _dataFactor = 1.0;
|
||||
public double DataFactor
|
||||
{
|
||||
get => _dataFactor;
|
||||
set
|
||||
{
|
||||
if (Math.Abs(_dataFactor - value) > 0.001)
|
||||
{
|
||||
_dataFactor = value;
|
||||
OnPropertyChanged(nameof(DataFactor));
|
||||
UpdateChartSeriesValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double _dataOffset = 0;
|
||||
public double DataOffset
|
||||
{
|
||||
get => _dataOffset;
|
||||
set
|
||||
{
|
||||
if (Math.Abs(_dataOffset - value) > 0.001)
|
||||
{
|
||||
_dataOffset = value;
|
||||
OnPropertyChanged(nameof(DataOffset));
|
||||
UpdateChartSeriesValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
private double _dataxOffset = 0;
|
||||
public double DataXOffset
|
||||
{
|
||||
get => _dataxOffset;
|
||||
set
|
||||
{
|
||||
_dataxOffset = value;
|
||||
OnPropertyChanged(nameof(DataXOffset));
|
||||
RePaintChartSeriesValue();
|
||||
}
|
||||
}
|
||||
private int _capacity = 10000;
|
||||
|
||||
public int Capacity
|
||||
{
|
||||
get { return _capacity; }
|
||||
set
|
||||
{
|
||||
_capacity = value;
|
||||
//DataSeries.FifoCapacity = value;
|
||||
if (_queueRawData != null)
|
||||
{
|
||||
_queueRawData.FixedSize = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private object _lockData = new object();
|
||||
|
||||
private FixSizeQueue<Tuple<double, double>> _queueRawData;
|
||||
|
||||
public ChartDataLineXV2(string dataName)
|
||||
: this(dataName, dataName, Colors.Blue)
|
||||
{
|
||||
Module = "System";
|
||||
StyleKey = "LineStyle";
|
||||
foreach (var dbModule in _dbModules)
|
||||
{
|
||||
if (dataName.StartsWith(dbModule))
|
||||
{
|
||||
Module = dbModule;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ChartDataLineXV2(string dataName, string displayName, Color seriesColor)
|
||||
{
|
||||
UniqueId = Guid.NewGuid().ToString();
|
||||
|
||||
//PointMarker = new EllipsePointMarker() { Width = 5, Height = 5 };
|
||||
|
||||
_queueRawData = new FixSizeQueue<Tuple<double, double>>(_capacity);
|
||||
|
||||
XAxisId = "DefaultAxisId";
|
||||
YAxisId = "DefaultAxisId";
|
||||
DataSeries = new XyDataSeries<double, double>(0);
|
||||
|
||||
DisplayName = displayName;
|
||||
|
||||
DataName = dataName;
|
||||
|
||||
Stroke = seriesColor;
|
||||
|
||||
IsVisible = true;
|
||||
DataOffset = 0;
|
||||
LineThickness = 1;
|
||||
DataFactor = 1;
|
||||
}
|
||||
|
||||
public void Append(double xvalue, double value)
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
_queueRawData.Enqueue(Tuple.Create(xvalue, value));
|
||||
var series = DataSeries as XyDataSeries<double, double>;
|
||||
if (series != null)
|
||||
{
|
||||
series.Append(xvalue, value * _dataFactor + _dataOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateChartSeriesValue()
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
using (DataSeries.SuspendUpdates())
|
||||
{
|
||||
XyDataSeries<double, double> s = DataSeries as XyDataSeries<double, double>;
|
||||
for (int i = 0; i < s.Count; i++)
|
||||
{
|
||||
s.Update(i, _queueRawData.ElementAt(i).Item2 * _dataFactor + _dataOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RePaintChartSeriesValue()
|
||||
{
|
||||
lock (_lockData)
|
||||
{
|
||||
using (DataSeries.SuspendUpdates())
|
||||
{
|
||||
DataSeries.Clear();
|
||||
var series = DataSeries as XyDataSeries<double, double>;
|
||||
for (int i = 0; i < _queueRawData.Count; i++)
|
||||
{
|
||||
series.Append(_queueRawData.ElementAt(i).Item1 + DataXOffset, _queueRawData.ElementAt(i).Item2 * _dataFactor + _dataOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<UserControl x:Class="SicUI.Models.PMs.Charting.ChartingSelectDataView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
|
||||
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:micro="http://www.caliburn.org"
|
||||
xmlns:local="clr-namespace:SicUI.Models.PMs"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="650" d:DesignWidth="1300" Background="#91b0cd">
|
||||
<Grid Height="650" Width="1300">
|
||||
<Border BorderBrush="Gray" BorderThickness="1" Background="White" Padding="10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="5" Color="#3F000000" ShadowDepth="5"/>
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="120"/>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid >
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="5" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="70"/>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="70"/>
|
||||
<ColumnDefinition Width="180"/>
|
||||
<ColumnDefinition Width="70"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="40" Width="70">
|
||||
<TextBlock Text="Start" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" ></TextBlock>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="40" Width="70">
|
||||
<TextBlock Text="End" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
|
||||
<wf:DateTimePicker x:Name="wfTimeTo" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
|
||||
</wfi:WindowsFormsHost>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="2" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
<TextBlock Text="Chamber" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<toolkit:CheckComboBox x:Name="tbLoadPort" ItemsSource="{Binding SourcePM}" Width="150" FontFamily="Arial" FontSize="14" Height="30" Margin="5,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
SelectedValue="{Binding SelectedValuePM}" >
|
||||
</toolkit:CheckComboBox>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="2" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
<TextBlock Text="Recipe" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<TextBox Text="{Binding RecipeName}" Width="Auto"></TextBox>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="4" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
<TextBlock Text="Lot" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="5" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<TextBox Text="{Binding LotID}" Width="Auto"></TextBox>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="4" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
<TextBlock Text="Slot" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="5" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
|
||||
<TextBox Text="{Binding SourceSLot}" Width="Auto"></TextBox>
|
||||
</Border>
|
||||
|
||||
<Button Margin="5,0,0,0" Grid.Row="1" Grid.Column="6" Grid.RowSpan="2" Content="Search" Width="80" Height="80">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SearchRecipe">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
<DataGrid Grid.Column="0" Grid.Row="1" Margin="5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding Recipes}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTemplateColumn Header="Recipe Name" MinWidth="180">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Recipe}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Module Name" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Chamber}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Start Time" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding StartTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="End Time" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding EndTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Result" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Status}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Lot Name" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding LotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Slot" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding SlotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="" MinWidth="60">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Width="120">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
|
||||
<CheckBox VerticalAlignment="Center">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="CheckAllRecipe">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
<Button Content="Add" Margin="5,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Add">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="CheckRecipe">
|
||||
<micro:Parameter Value="{Binding }"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,29 @@
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
/// <summary>
|
||||
/// ChartingSelectDataView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ChartingSelectDataView : UserControl
|
||||
{
|
||||
public ChartingSelectDataView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using Sicentury.Core.Tree;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
public class ChartingSelectDataViewModel: UiViewModelBase
|
||||
{
|
||||
#region
|
||||
private const int MAX_PARAMETERS = 20;
|
||||
public DateTime BeginDate { get; set; }
|
||||
public DateTime StartDateTime { get; set; }
|
||||
public DateTime EndDateTime { get; set; }
|
||||
|
||||
public ObservableCollection<RecipeItemSic> Recipes { get; set; }
|
||||
public ObservableCollection<RecipeItemSic> SelectedRecipes { get; set; }
|
||||
|
||||
private ObservableCollection<TreeNode> _ParameterNodes;
|
||||
public ObservableCollection<TreeNode> ParameterNodes
|
||||
{
|
||||
get { return _ParameterNodes; }
|
||||
set { _ParameterNodes = value; NotifyOfPropertyChange("TreeNodes"); }
|
||||
}
|
||||
public ObservableCollection<string> SelectedParameters { get; set; }
|
||||
|
||||
object _lockSelection = new object();
|
||||
|
||||
public ObservableCollection<string> SourcePM { get; set; }
|
||||
public string SelectedValuePM { get; set; }
|
||||
public ObservableCollection<string> SourceSLot { get; set; }
|
||||
public string SelectedValueSLot { get; set; }
|
||||
public string RecipeName { get; set; }
|
||||
|
||||
public string LotID { get; set; }
|
||||
|
||||
public bool CheckAllRecipeFlag = false;
|
||||
|
||||
public ObservableCollection<TreeNode> ParameterNodes1 = new ObservableCollection<TreeNode>();
|
||||
|
||||
#endregion
|
||||
|
||||
public ChartingSelectDataViewModel()
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
this.StartDateTime = now;
|
||||
this.BeginDate = now;
|
||||
this.StartDateTime = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);
|
||||
this.EndDateTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, 999);
|
||||
|
||||
Recipes = new ObservableCollection<RecipeItemSic>();
|
||||
SelectedRecipes = new ObservableCollection<RecipeItemSic>();
|
||||
|
||||
SelectedParameters = new ObservableCollection<string>();
|
||||
ParameterNodes = ProcessHistoryProvider.Instance.GetParameters();
|
||||
|
||||
SourcePM = new ObservableCollection<string>(new[] { "PM1", "PM2" });
|
||||
|
||||
SourceSLot = new ObservableCollection<string>();
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
SourceSLot.Add((i + 1).ToString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded(object _view)
|
||||
{
|
||||
base.OnViewLoaded(_view);
|
||||
this.view = (ChartingSelectDataView)_view;
|
||||
this.view.wfTimeFrom.Value = this.StartDateTime;
|
||||
this.view.wfTimeTo.Value = this.EndDateTime;
|
||||
}
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
base.OnActivate();
|
||||
|
||||
ParameterNodes = ProcessHistoryProvider.Instance.GetParameters();
|
||||
foreach (var recipeItem in Recipes)
|
||||
{
|
||||
recipeItem.Selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
private ChartingSelectDataView view;
|
||||
|
||||
public void SearchRecipe()
|
||||
{
|
||||
Recipes.Clear();
|
||||
|
||||
this.StartDateTime = this.view.wfTimeFrom.Value;
|
||||
this.EndDateTime = this.view.wfTimeTo.Value;
|
||||
|
||||
if (StartDateTime > EndDateTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string sql = $"SELECT * FROM \"process_data\",\"cj_data\",\"pj_data\",\"wafer_data\" where \"process_data\".\"wafer_data_guid\"=\"wafer_data\".\"guid\"" +
|
||||
$" and \"wafer_data\".\"pj_data_guid\" =\"pj_data\".\"guid\" and \"cj_data\".\"guid\"=\"pj_data\".\"cj_data_guid\" and \"process_data\".\"process_begin_time\" >='{StartDateTime:yyyyMMdd HHmmss}' and \"process_data\".\"process_end_time\" <='{EndDateTime:yyyyMMdd HHmmss}'";
|
||||
if (!string.IsNullOrEmpty(SelectedValuePM))
|
||||
{
|
||||
string[] pms = SelectedValuePM.Split(',');
|
||||
if (pms.Length > 0)
|
||||
{
|
||||
sql += " and (FALSE ";
|
||||
foreach (var pm in pms)
|
||||
{
|
||||
sql += $" OR \"process_data\".\"process_in\"='{pm}' ";
|
||||
}
|
||||
sql += " ) ";
|
||||
}
|
||||
|
||||
ParameterNodes = ProcessHistoryProvider.Instance.GetParameters();
|
||||
bool pm1 = ((System.Collections.IList)pms).Contains("PM1");//True
|
||||
bool pm2 = ((System.Collections.IList)pms).Contains("PM2");//True
|
||||
|
||||
ParameterNodes1.Clear();
|
||||
if (pm1)
|
||||
ParameterNodes1.Add(ParameterNodes[0]);
|
||||
if (pm2)
|
||||
ParameterNodes1.Add(ParameterNodes[1]);
|
||||
ParameterNodes.Clear();
|
||||
ParameterNodes = ParameterNodes1;
|
||||
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(RecipeName))
|
||||
{
|
||||
sql += string.Format(" and lower( \"process_data\".\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(LotID))
|
||||
{
|
||||
sql += string.Format(" and lower(\"wafer_data\".\"lot_id\") like '%{0}%'", LotID.ToLower());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(SelectedValueSLot))
|
||||
{
|
||||
string[] pms = SelectedValueSLot.Split(',');
|
||||
if (pms.Length > 0)
|
||||
{
|
||||
sql += " and (FALSE ";
|
||||
foreach (var pm in pms)
|
||||
{
|
||||
sql += $" OR \"wafer_data\".\"create_slot\"='{pm}' ";
|
||||
}
|
||||
sql += " ) ";
|
||||
}
|
||||
}
|
||||
sql += " order by \"process_data\".\"process_begin_time\" ASC;";
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
RecipeItemSic item = new RecipeItemSic();
|
||||
|
||||
item.Recipe = dbData.Rows[i]["recipe_name"].ToString();
|
||||
item.LotID = dbData.Rows[i]["lot_id"].ToString();
|
||||
item.SlotID = dbData.Rows[i]["create_slot"].ToString();
|
||||
item.CjName = dbData.Rows[i]["name"].ToString();
|
||||
item.PjName = dbData.Rows[i]["name1"].ToString();
|
||||
item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
||||
item.Status = dbData.Rows[i]["process_status"].ToString();
|
||||
item.SyncStep = dbData.Rows[i]["sequence_name"].ToString();
|
||||
item.ProcessGuid = dbData.Rows[i]["guid"].ToString();
|
||||
|
||||
if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
||||
item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
||||
item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
Recipes.Add(item);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
public void CheckAllRecipe()
|
||||
{
|
||||
SelectedRecipes.Clear();
|
||||
CheckAllRecipeFlag = !CheckAllRecipeFlag;
|
||||
if (CheckAllRecipeFlag)
|
||||
{
|
||||
foreach (var recipe in Recipes)
|
||||
{
|
||||
recipe.Selected = true;
|
||||
SelectedRecipes.Add(recipe);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var recipe in Recipes)
|
||||
{
|
||||
recipe.Selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckRecipe(RecipeItemSic recipe)
|
||||
{
|
||||
if (recipe.Selected)
|
||||
{
|
||||
SelectedRecipes.Add(recipe);
|
||||
}
|
||||
else
|
||||
{
|
||||
RecipeItemSic item = SelectedRecipes.FirstOrDefault(t => t.Recipe == recipe.Recipe);
|
||||
if (item != null)
|
||||
SelectedRecipes.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void Preset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void UnSelect()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//public void ParameterCheck(TreeNode node)
|
||||
//{
|
||||
// bool result = RefreshTreeStatusToChild(node);
|
||||
// if (!result)
|
||||
// {
|
||||
// node.Selected = !node.Selected;
|
||||
// DialogBox.ShowWarning($"The max number of parameters is {MAX_PARAMETERS}.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// RefreshTreeStatusToParent(node);
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Refresh tree node status from current to children, and add data to SelectedData
|
||||
///// </summary>
|
||||
//private bool RefreshTreeStatusToChild(TreeNode node)
|
||||
//{
|
||||
// if (node.ChildNodes.Count > 0)
|
||||
// {
|
||||
// for (int i = 0; i < node.ChildNodes.Count; i++)
|
||||
// {
|
||||
// TreeNode n = node.ChildNodes[i];
|
||||
// n.Selected = node.Selected;
|
||||
|
||||
// if (!RefreshTreeStatusToChild(n))
|
||||
// {
|
||||
// //uncheck left node
|
||||
// for (int j = i; j < node.ChildNodes.Count; j++)
|
||||
// {
|
||||
// node.ChildNodes[j].Selected = !node.Selected;
|
||||
// }
|
||||
// node.Selected = !node.Selected;
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else //leaf node
|
||||
// {
|
||||
// lock (_lockSelection)
|
||||
// {
|
||||
// bool flag = SelectedParameters.Contains(node.Name);
|
||||
// if (node.Selected && !flag)
|
||||
// {
|
||||
// if (SelectedParameters.Count < MAX_PARAMETERS)
|
||||
// {
|
||||
// SelectedParameters.Add(node.Name);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// else if (!node.Selected && flag)
|
||||
// {
|
||||
// SelectedParameters.Remove(node.Name);
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Refresh tree node status from current to parent
|
||||
///// </summary>
|
||||
///// <param name="node"></param>
|
||||
///// <returns></returns>
|
||||
//private void RefreshTreeStatusToParent(TreeNode node)
|
||||
//{
|
||||
// if (node.ParentNode != null)
|
||||
// {
|
||||
// if (node.Selected)
|
||||
// {
|
||||
// bool flag = true;
|
||||
// for (int i = 0; i < node.ParentNode.ChildNodes.Count; i++)
|
||||
// {
|
||||
// if (!node.ParentNode.ChildNodes[i].Selected)
|
||||
// {
|
||||
// flag = false; //as least one child is unselected
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (flag)
|
||||
// node.ParentNode.Selected = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// node.ParentNode.Selected = false;
|
||||
// }
|
||||
// RefreshTreeStatusToParent(node.ParentNode);
|
||||
// }
|
||||
//}
|
||||
|
||||
public void OnTreeSelectedChanged(object obj)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Add()
|
||||
{
|
||||
this.TryClose(true);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
this.TryClose(false);
|
||||
}
|
||||
|
||||
public bool GetDbData(string chamber, DateTime from, DateTime to, IEnumerable<string> dataIdList,
|
||||
out Dictionary<string, List<Tuple<DateTime, double>>> returnDatas, ref double min, ref double max)
|
||||
{
|
||||
returnDatas = new Dictionary<string, List<Tuple<DateTime, double>>>();
|
||||
for (DateTime dfrom = new DateTime(from.Year, from.Month, from.Day); dfrom < to; dfrom += new TimeSpan(1, 0, 0, 0))
|
||||
{
|
||||
DateTime begin = (dfrom.Year == from.Year && dfrom.Month == from.Month && dfrom.Day == from.Day) ? from : new DateTime(dfrom.Year, dfrom.Month, dfrom.Day, 0, 0, 0, 0);
|
||||
DateTime end = (dfrom.Date == to.Date) ? to : new DateTime(dfrom.Year, dfrom.Month, dfrom.Day, 23, 59, 59, 999);
|
||||
//if (begin.Date > DateTime.Today)
|
||||
// continue;
|
||||
try
|
||||
{
|
||||
string sql = "select time AS InternalTimeStamp";
|
||||
foreach (var dataId in dataIdList)
|
||||
{
|
||||
if (!returnDatas.Keys.Contains(dataId) && dataId.StartsWith($"{chamber}."))
|
||||
{
|
||||
returnDatas[dataId] = new List<Tuple<DateTime, double>>();
|
||||
sql += "," + string.Format("\"{0}\"", dataId);
|
||||
}
|
||||
}
|
||||
|
||||
sql += string.Format(" from \"{0}\" where time > {1} and time <= {2} order by time asc;",
|
||||
begin.ToString("yyyyMMdd") + "." + chamber, begin.Ticks, end.Ticks);
|
||||
|
||||
using (var table = QueryDataClient.Instance.Service.QueryData(sql))
|
||||
{
|
||||
if (table == null || table.Rows.Count == 0)
|
||||
continue;
|
||||
DateTime dt = new DateTime();
|
||||
Dictionary<int, string> colName = new Dictionary<int, string>();
|
||||
for (int colNo = 0; colNo < table.Columns.Count; colNo++)
|
||||
colName.Add(colNo, table.Columns[colNo].ColumnName);
|
||||
for (int rowNo = 0; rowNo < table.Rows.Count; rowNo++)
|
||||
{
|
||||
var row = table.Rows[rowNo];
|
||||
|
||||
for (int i = 0; i < table.Columns.Count; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
long ticks = (long)row[i];
|
||||
dt = new DateTime(ticks);
|
||||
}
|
||||
else
|
||||
{
|
||||
string dataId = colName[i];
|
||||
double value = 0.0;
|
||||
if (row[i] is DBNull || row[i] == null)
|
||||
{
|
||||
value = 0.0;
|
||||
}
|
||||
else if (row[i] is bool)
|
||||
{
|
||||
value = (bool)row[i] ? 1.0 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = (double)float.Parse(row[i].ToString());
|
||||
}
|
||||
|
||||
returnDatas[dataId].Add(Tuple.Create(dt, value));
|
||||
if (value < min)
|
||||
min = value;
|
||||
if (value > max)
|
||||
max = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
table.Clear();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private string ConvertFileName(string str)
|
||||
{
|
||||
string ret = null;
|
||||
string specialkey = "[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#?……&*()——|{}??‘;:”“'?,?? -]";
|
||||
ret = System.Text.RegularExpressions.Regex.Replace(str, specialkey, "");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<UserControl x:Class="SicUI.Models.PMs.Charting.ChartingTemplateView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SicUI.Models.PMs"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:micro="http://www.caliburn.org"
|
||||
xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
|
||||
mc:Ignorable="d"
|
||||
Height="450" Width="700">
|
||||
<Grid Height="450">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="35"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Label Content="Save current data selection to:"/>
|
||||
<controls:TextBoxEx Height="25" Width="200" Margin="10,0" AllowBackgroundChange="False" Text="{Binding Path=CurrentFileName}" HorizontalAlignment="Stretch" ></controls:TextBoxEx>
|
||||
<Button Height="25" Width="80" Margin="5,0,0,0" Content="Save">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SaveToTemplate">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<DataGrid Grid.Column="3" Grid.Row="1" Margin="5,5,0,5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding TemplateInfos}" AutoGenerateColumns="False" SelectedItem="{Binding SelectTemplate}"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="690" >
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Name" MinWidth="240" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding TemplateName}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Create Time" MinWidth="240" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding TemplateCreateTime}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Load" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="Load" Margin="5,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Load">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Remove" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="Remove" Margin="5,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Remove">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Border Grid.Row="2" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
/// <summary>
|
||||
/// ChartingTemplateView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ChartingTemplateView : UserControl
|
||||
{
|
||||
public ChartingTemplateView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
using Aitex.Common.Util;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
public class ChartingTemplateViewModel : SicModuleUIViewModelBase, ISupportMultipleSystem
|
||||
{
|
||||
public class TemplateInfo
|
||||
{
|
||||
public string TemplateName
|
||||
{
|
||||
get;set;
|
||||
}
|
||||
|
||||
public string TemplateCreateTime
|
||||
{
|
||||
get;set;
|
||||
}
|
||||
}
|
||||
|
||||
public ChartingTemplateViewModel()
|
||||
{
|
||||
TemplateInfos = new ObservableCollection<TemplateInfo>();
|
||||
LoadTemplateInfo();
|
||||
}
|
||||
|
||||
public ObservableCollection<TemplateInfo> TemplateInfos { get; set; }
|
||||
|
||||
public List<PMNodeInfo> CurrentDataInfo { get; set; }
|
||||
|
||||
public TemplateInfo SelectTemplate { get; set; }
|
||||
|
||||
private string _currentFileName;
|
||||
public string CurrentFileName
|
||||
{
|
||||
get => _currentFileName;
|
||||
set { _currentFileName = value; NotifyOfPropertyChange(nameof(CurrentFileName)); }
|
||||
}
|
||||
|
||||
public void LoadTemplateInfo()
|
||||
{
|
||||
if (!Directory.Exists(PathManager.GetCfgDir() + @"ChartTemplate"))
|
||||
{
|
||||
Directory.CreateDirectory(PathManager.GetCfgDir() + @"ChartTemplate");
|
||||
}
|
||||
|
||||
var path = PathManager.GetCfgDir() + $"ChartTemplate";
|
||||
string[] allFile = Directory.GetFiles(path, "*.template");
|
||||
|
||||
if (TemplateInfos.Count > 0)
|
||||
{
|
||||
TemplateInfos.Clear();
|
||||
}
|
||||
for (int i = 0; i < allFile.Length; i++)
|
||||
{
|
||||
TemplateInfos.Add(new TemplateInfo()
|
||||
{
|
||||
TemplateName = Path.GetFileNameWithoutExtension(allFile[i]),
|
||||
TemplateCreateTime = File.GetCreationTime(allFile[i]).ToString("yyyy-MM-dd HH:mm:ss")
|
||||
}) ;
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveToTemplate()
|
||||
{
|
||||
if (CurrentDataInfo != null && CurrentDataInfo.Count>0)
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(PathManager.GetCfgDir() + @"ChartTemplate\" + CurrentFileName + ".template", false))
|
||||
{
|
||||
foreach (PMNodeInfo node in CurrentDataInfo)
|
||||
{
|
||||
if (node.Selected)
|
||||
{
|
||||
sw.WriteLine(node.NodeStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var temp = TemplateInfos.FirstOrDefault(x => x.TemplateName == CurrentFileName);
|
||||
if (temp == null)
|
||||
{
|
||||
TemplateInfos.Add(new TemplateInfo()
|
||||
{
|
||||
TemplateName = CurrentFileName,
|
||||
TemplateCreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
foreach(PMNodeInfo node in CurrentDataInfo)
|
||||
{
|
||||
node.Selected = false;
|
||||
}
|
||||
using (StreamReader sr = new StreamReader(PathManager.GetCfgDir() + @"ChartTemplate\" + SelectTemplate.TemplateName + ".template"))
|
||||
{
|
||||
string line;
|
||||
while ((line = sr.ReadLine()) != null)
|
||||
{
|
||||
foreach (PMNodeInfo node in CurrentDataInfo)
|
||||
{
|
||||
if (node.NodeStr == line)
|
||||
{
|
||||
node.Selected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.TryClose(true);
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
string curName = SelectTemplate.TemplateName;
|
||||
if (File.Exists(PathManager.GetCfgDir() + @"ChartTemplate\" + curName + ".template"))
|
||||
{
|
||||
File.Delete(PathManager.GetCfgDir() + @"ChartTemplate\" + curName + ".template");
|
||||
for (int i = 0; i < TemplateInfos.Count; i++)
|
||||
{
|
||||
if (TemplateInfos[i].TemplateName == curName)
|
||||
{
|
||||
TemplateInfos.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,699 @@
|
||||
<UserControl x:Class="SicUI.Models.PMs.Charting.PMChartingV2View"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
|
||||
xmlns:local="clr-namespace:SicUI.Models.PMs.Charting"
|
||||
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:micro="http://www.caliburn.org"
|
||||
xmlns:control="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
|
||||
xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter;assembly=MECF.Framework.UI.Client"
|
||||
xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="780" d:DesignWidth="1900" Background="#91b0cd"
|
||||
lex:LocalizeDictionary.DesignCulture="zh"
|
||||
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common">
|
||||
<UserControl.Resources>
|
||||
<converters:LineColorConverter x:Key="colorConverter"/>
|
||||
|
||||
<Style TargetType="Button" x:Key="ChartingButtonStyle">
|
||||
<Setter Property="Margin" Value="3" />
|
||||
<Setter Property="Background" Value="#FF323539" />
|
||||
<Setter Property="Foreground" Value="#FFF" />
|
||||
<Setter Property="Padding" Value="3" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="#FF5B5B5B" />
|
||||
<Setter Property="Width" Value="35" />
|
||||
<Setter Property="Height" Value="35" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Name="Border" Margin="{TemplateBinding Margin}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Opacity="0.6" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter Name="ContentHost" HorizontalAlignment="Center" VerticalAlignment="Center" ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Opacity" Value="1"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Line" x:Key="AnomationStyle">
|
||||
<Setter Property="Stroke" Value="Black"/>
|
||||
<Setter Property="StrokeThickness" Value="2"/>
|
||||
<Setter Property="StrokeDashArray" Value="2 2"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="RolloverTooltipTemplate1" DataType="s:SeriesInfo">
|
||||
<TextBlock FontSize="12">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}:{1}">
|
||||
<Binding Path="SeriesName"></Binding>
|
||||
<Binding Path="FormattedYValue"></Binding>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="s:FastLineRenderableSeries" x:Key="LineStyle">
|
||||
<Setter Property="s:RolloverModifier.TooltipTemplate" Value="{StaticResource RolloverTooltipTemplate1}"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid x:Name="gridMain">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="520"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="80"/>
|
||||
<RowDefinition Height="220"/>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="130" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="130" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Title}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{lex:Loc ID_TXT_StartTime}" />
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource Table_BG_Content}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<wfi:WindowsFormsHost
|
||||
Width="120"
|
||||
Height="25"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12">
|
||||
<wf:DateTimePicker
|
||||
x:Name="wfTimeFrom"
|
||||
CustomFormat="yyyy/MM/dd HH:mm:ss"
|
||||
Format="Custom"
|
||||
Value="2023-8-1" />
|
||||
</wfi:WindowsFormsHost>
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Title}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="1">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{lex:Loc ID_TXT_EndTime}" />
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource Table_BG_Content}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<wfi:WindowsFormsHost
|
||||
Width="120"
|
||||
Height="25"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12">
|
||||
<wf:DateTimePicker
|
||||
x:Name="wfTimeTo"
|
||||
CustomFormat="yyyy/MM/dd HH:mm:ss"
|
||||
Format="Custom"
|
||||
Value="2011-8-1" />
|
||||
</wfi:WindowsFormsHost>
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Title}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<TextBlock
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{lex:Loc ID_TXT_Chamber}" />
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.Column="3"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Content}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<toolkit:CheckComboBox
|
||||
x:Name="tbLoadPort"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="0,0,7,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
ItemsSource="{Binding SourcePM}"
|
||||
SelectedValue="{Binding SelectedValuePM}" />
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Title}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{lex:Loc ID_TXT_Recipe}" />
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Content}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<TextBox Width="Auto" Height="30" Text="{Binding RecipeName}" />
|
||||
</Border>
|
||||
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Grid.Column="4"
|
||||
Width="80"
|
||||
Height="40"
|
||||
Margin="0,0,0,0"
|
||||
FontSize="15"
|
||||
Content="{lex:Loc ID_BTN_Search_Content}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SearchRecipe" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
Margin="2"
|
||||
HorizontalAlignment="Left"
|
||||
AlternationCount="2"
|
||||
AutoGenerateColumns="False"
|
||||
BorderThickness="1"
|
||||
CanUserAddRows="False"
|
||||
CanUserResizeColumns="True"
|
||||
CanUserResizeRows="False"
|
||||
ColumnHeaderHeight="30"
|
||||
FontFamily="Arial"
|
||||
FontSize="12"
|
||||
ItemsSource="{Binding Recipes}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="50">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Text="{lex:Loc ID_TXT_Add}" Margin="0,0,5,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="CheckRecipe">
|
||||
<micro:Parameter Value="{Binding}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
MinWidth="100" Header="{lex:Loc ID_TXT_Mark}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding ProcessGuid}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
MinWidth="100" Header="{lex:Loc ID_TXT_Recipe}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding Recipe}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Width="60" Header="{lex:Loc ID_TXT_Module}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding Chamber}" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
MinWidth="100" Header="{lex:Loc ID_TXT_StartTime}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding StartTime}" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
MinWidth="100" Header="{lex:Loc ID_TXT_EndTime}">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding EndTime}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn MinWidth="60" Header="Result">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="{Binding Status}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Text="{lex:Loc ID_TXT_Filter}" VerticalAlignment="Bottom" FontSize="18" Height="30" Margin="5,0,5,0" HorizontalAlignment="Right"/>
|
||||
<TextBox x:Name="tbxkeyword" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="200" Height="30" Margin="5,0,5,0" Foreground="Black"/>
|
||||
<Button VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,5,0" Height="25">
|
||||
<Button.Background>
|
||||
<ImageBrush ImageSource="pack://application:,,,/Resources/Images/find.png" Stretch="Uniform"/>
|
||||
</Button.Background>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Find">
|
||||
<micro:Parameter Value="{Binding ElementName=tbxkeyword,Path=Text}"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,0">
|
||||
<Button Content="X" VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="RemoveAllLine">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border Grid.Row="3" BorderBrush="{DynamicResource MainFrame_BD_Highlight}" BorderThickness="1" SnapsToDevicePixels="True" Background="{DynamicResource Tab_BG}" Padding="2">
|
||||
<TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ConfigNodes}" >
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding PMNodeInfo}" >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ParameterCheck">
|
||||
<micro:Parameter Value="{Binding }"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
<TextBlock Text="{Binding NodeStr}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
|
||||
<Setter Property="Visibility" Value="{Binding Path=IsMatch, Mode=OneWay, Converter={StaticResource ResourceKey=BoolVisibilityConverter}}"></Setter>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Background="#eee">
|
||||
<Button Command="{Binding DefaultZoomCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Zoom"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
|
||||
<Button Command="{Binding ShowLegendCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Line"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Background="#eee" Grid.Row="1">
|
||||
<Button Command="{Binding DataDetailVisbleCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Data"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" >
|
||||
<s:SciChartSurface Name="sciChart" RenderableSeries="{s:SeriesBinding SelectedData}"
|
||||
s:ThemeManager.Theme="ExpressionLight"
|
||||
Padding="0,0,0,0"
|
||||
DebugWhyDoesntSciChartRender="false" BorderBrush="Black" Focusable="False" IsTabStop="False" ViewportManager="{Binding ViewportManager}">
|
||||
|
||||
<!-- 变更曲线起始点行为 -->
|
||||
<i:Interaction.Behaviors>
|
||||
<local:SciChartMouseDownChangingLocationBehavior
|
||||
Target="{Binding SelectedData}"
|
||||
XAxisInfo="{Binding ElementName=cm,Path= XAxisInfo}"
|
||||
YAxisInfo="{Binding ElementName=cm,Path= YAxisInfo}"/>
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<!-- Create an X Axis -->
|
||||
<s:SciChartSurface.XAxis>
|
||||
<s:NumericAxis DrawMinorTicks="False"
|
||||
DrawMinorGridLines="True" Focusable="False"
|
||||
TitleFontSize="15"
|
||||
FontSize="15"
|
||||
AutoRange="{Binding ChartAutoRange}"
|
||||
VisibleRangeLimit="{Binding VisibleRangeXLimit}"
|
||||
VisibleRange="{Binding VisibleRangeX}"
|
||||
Id="DefaultAxisId" TitleFontWeight="Normal" />
|
||||
|
||||
</s:SciChartSurface.XAxis>
|
||||
|
||||
<!-- Create a Y Axis -->
|
||||
<s:SciChartSurface.YAxis>
|
||||
<s:NumericAxis DrawMinorTicks="False" MinWidth="50"
|
||||
DrawMinorGridLines="True"
|
||||
AxisAlignment="Right"
|
||||
HorizontalAlignment="Center"
|
||||
CursorTextFormatting="0.#####"
|
||||
VisibleRange="{Binding VisibleRangeY}"
|
||||
VisibleRangeLimit="{Binding VisibleRangeYLimit}"
|
||||
Id="DefaultAxisId" MajorDelta="0.1"
|
||||
MinorDelta="0.1" DrawMajorBands="False" Focusable="False"
|
||||
BorderThickness="0" AutoRange="{Binding ChartAutoRange}"
|
||||
DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False">
|
||||
<s:NumericAxis.GrowBy>
|
||||
<s:DoubleRange Min="0.1" Max="0.1"/>
|
||||
</s:NumericAxis.GrowBy>
|
||||
</s:NumericAxis>
|
||||
</s:SciChartSurface.YAxis>
|
||||
|
||||
<s:SciChartSurface.ChartModifier>
|
||||
|
||||
<s:ModifierGroup>
|
||||
<s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True"
|
||||
IsXAxisOnly="False"
|
||||
ZoomExtentsY="True"
|
||||
IsAnimated="True" ExecuteOn="MouseLeftButton" ReceiveHandledEvents="True" />
|
||||
|
||||
<s:CursorModifier Name="cm" IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True"
|
||||
SourceMode="AllSeries" ShowTooltip="False" />
|
||||
|
||||
<s:LegendModifier ShowLegend="False" GetLegendDataFor="AllSeries" x:Name="legendModifier"/>
|
||||
|
||||
<s:ZoomExtentsModifier x:Name="zoomExtentsModifier" XyDirection="XYDirection" ExecuteOn="MouseDoubleClick"/>
|
||||
|
||||
<s:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True" ClipModeX="None" XyDirection="XYDirection" ExecuteOn="MouseRightButton" ZoomExtentsY="False" />
|
||||
|
||||
<s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" IsEnabled="True" XyDirection="XYDirection"/>
|
||||
|
||||
<s:RolloverModifier IsEnabled="True" DrawVerticalLine="True" ShowAxisLabels="False" x:Name="RolloverModifier"
|
||||
ShowTooltipOn="Always" SourceMode="AllSeries" ExecuteOn="MouseMove" >
|
||||
<s:RolloverModifier.LineOverlayStyle>
|
||||
<!-- The style for the rollover line -->
|
||||
<Style TargetType="Line">
|
||||
<Setter Property="Stroke" Value="Pink"/>
|
||||
<Setter Property="StrokeThickness" Value="2"/>
|
||||
<Setter Property="StrokeDashArray" Value="2 2"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
</Style>
|
||||
</s:RolloverModifier.LineOverlayStyle>
|
||||
</s:RolloverModifier>
|
||||
|
||||
<s:YAxisDragModifier DragMode="Scale"/>
|
||||
<s:XAxisDragModifier DragMode="Pan"/>
|
||||
<s:LegendModifier ShowLegend="{Binding ShowLegendInfo}"/>
|
||||
|
||||
</s:ModifierGroup>
|
||||
|
||||
</s:SciChartSurface.ChartModifier>
|
||||
</s:SciChartSurface>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Visibility="{Binding DataDetailVisbility}">
|
||||
<TabControl Grid.Row="1" Margin="5" MinHeight="300">
|
||||
<TabItem Height="24" VerticalAlignment="Top">
|
||||
<Grid>
|
||||
<DataGrid Margin="5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="1380">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="60">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{lex:Loc ID_TXT_Visible}" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_Mark}" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ProcessGuid}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_Recipe}" MinWidth="150">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding RecipeName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_Date}" MinWidth="150">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Time}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_Color}" MinWidth="60">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Style="{DynamicResource Color_Button}" Height="25" HorizontalAlignment="Stretch" Background="{Binding Stroke, Converter={StaticResource colorConverter}}" Width="50">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SelectColor">
|
||||
<micro:Parameter Value="{Binding}" ></micro:Parameter>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_Factor}" MinWidth="60">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataFactor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_YOffset}" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding DataOffset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
|
||||
Header="{lex:Loc ID_TXT_XOffset}" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding DataXOffset, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Header="{lex:Loc ID_TXT_Width}" MinWidth="60">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding LineThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="60">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
Text="{lex:Loc ID_TXT_Select}" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,104 @@
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using SciChart.Charting.Visuals;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interactivity;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using SciChart.Charting.Model.ChartSeries;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
/// <summary>
|
||||
/// PMChartingV2View.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PMChartingV2View : UserControl
|
||||
{
|
||||
public PMChartingV2View()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
public class SciChartMouseDownChangingLocationBehavior : Behavior<SciChartSurface>
|
||||
{
|
||||
|
||||
|
||||
|
||||
public AxisInfo YAxisInfo
|
||||
{
|
||||
get { return (AxisInfo)GetValue(YAxisInfoProperty); }
|
||||
set { SetValue(YAxisInfoProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty YAxisInfoProperty =
|
||||
DependencyProperty.Register("YAxisInfo", typeof(AxisInfo), typeof(SciChartMouseDownChangingLocationBehavior), new PropertyMetadata(null));
|
||||
|
||||
|
||||
|
||||
public AxisInfo XAxisInfo
|
||||
{
|
||||
get { return (AxisInfo)GetValue(XAxisInfoProperty); }
|
||||
set { SetValue(XAxisInfoProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for XAxisInfo. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty XAxisInfoProperty =
|
||||
DependencyProperty.Register("XAxisInfo", typeof(AxisInfo), typeof(SciChartMouseDownChangingLocationBehavior), new PropertyMetadata(null));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public ObservableCollection<IRenderableSeriesViewModel> Target
|
||||
{
|
||||
get { return (ObservableCollection<IRenderableSeriesViewModel>)GetValue(TargetProperty); }
|
||||
set { SetValue(TargetProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TargetProperty =
|
||||
DependencyProperty.Register("Target", typeof(ObservableCollection<IRenderableSeriesViewModel>), typeof(SciChartMouseDownChangingLocationBehavior), new PropertyMetadata(null));
|
||||
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
AssociatedObject.PreviewMouseDown += mousedown;
|
||||
}
|
||||
|
||||
private void mousedown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
foreach (IRenderableSeriesViewModel series in Target)
|
||||
{
|
||||
if (series.IsSelected)
|
||||
{
|
||||
double xvalue = 0, yvalue = 0;
|
||||
if (double.TryParse(XAxisInfo.CursorFormattedDataValue, out xvalue) && double.TryParse(YAxisInfo.CursorFormattedDataValue, out yvalue))
|
||||
{
|
||||
ChartDataLineXV2 s = series as ChartDataLineXV2;
|
||||
|
||||
s.DataXOffset = xvalue;
|
||||
s.DataOffset = yvalue;
|
||||
s.IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e.Handled = true; //不写会失去焦点
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,729 @@
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using SciChart.Charting.Common.Helpers;
|
||||
using SciChart.Charting.ViewportManagers;
|
||||
using SciChart.Charting.Visuals.Annotations;
|
||||
using SciChart.Charting.Visuals.Axes;
|
||||
using SciChart.Charting.Visuals.RenderableSeries;
|
||||
using SciChart.Data.Model;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows;
|
||||
using Cali = Caliburn.Micro;
|
||||
using MECF.Framework.UI.Client.CenterViews.DataLogs.ProcessHistory;
|
||||
using System.Reflection;
|
||||
using SciChart.Charting.Model.ChartSeries;
|
||||
using System.IO;
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Core.RT.Log;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
public class PMChartingV2ViewModel : SicModuleUIViewModelBase, ISupportMultipleSystem
|
||||
{
|
||||
private class QueryIndexer
|
||||
{
|
||||
public DateTime StartTime { get; set; }
|
||||
public DateTime EndTime { get; set; }
|
||||
public string Module { get; set; }
|
||||
public string ColumneName { get; set; }
|
||||
public string ProcessGuid { get; set; }
|
||||
public List<string> DateList { get; set; }
|
||||
public long currentTimeTicks { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ViewModel绑定的View对象
|
||||
/// </summary>
|
||||
private PMChartingV2View view;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化界面
|
||||
/// </summary>
|
||||
public PMChartingV2ViewModel()
|
||||
{
|
||||
DisplayName = "Process History";
|
||||
|
||||
var now = DateTime.Now;
|
||||
this.StartDateTime = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);
|
||||
this.EndDateTime = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, 999);
|
||||
|
||||
SourcePM = new ObservableCollection<string>(new[] { "PM1", "PM2" });
|
||||
|
||||
//sci按钮操作
|
||||
DataDetailVisbleCommand = new ActionCommand(SetDataDetailVisble);
|
||||
DefaultZoomCommand = new ActionCommand(Zoom);
|
||||
ShowLegendCommand = new ActionCommand(SetLegendAvalible);
|
||||
|
||||
//获取所有Device
|
||||
GetPMNode();
|
||||
|
||||
SelectedData = new ObservableCollection<IRenderableSeriesViewModel>();
|
||||
|
||||
SelectedRecipes = new ObservableCollection<RecipeItemSic>();
|
||||
Recipes = new ObservableCollection<RecipeItemSic>();
|
||||
|
||||
//x y always指zoom功能失效,总是自动调整大小
|
||||
//ChartAutoRange = AutoRange.Always;
|
||||
|
||||
VisibleRangeX = new DoubleRange(-1000, 10000);
|
||||
VisibleRangeY = new DoubleRange(-10, 500);
|
||||
VisibleRangeXLimit = new DoubleRange(-1000, 10000);
|
||||
VisibleRangeYLimit = new DoubleRange(-10, 500);
|
||||
|
||||
_thread = new PeriodicJob(300, MonitorHistoryData, "History", true);
|
||||
//_threadReal = new PeriodicJob(TrendInterval, MonitorRealTimeData, "RealTime", true);
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded(object _view)
|
||||
{
|
||||
//获取绑定的View(wpf没有默认的日期时间控件,Winform日期控件无法通过绑定属性获取)
|
||||
base.OnViewLoaded(_view);
|
||||
this.view = (PMChartingV2View)_view;
|
||||
this.view.wfTimeFrom.Value = this.StartDateTime;
|
||||
this.view.wfTimeTo.Value = this.EndDateTime;
|
||||
|
||||
}
|
||||
|
||||
private PeriodicJob _thread;
|
||||
//private PeriodicJob _threadReal;
|
||||
//DeviceTimer dt = new DeviceTimer();
|
||||
|
||||
//设置允许同时显示的最多曲线数
|
||||
private const int MAX_PARAMETERS = 20;
|
||||
|
||||
/// <summary>
|
||||
/// sci图表的视图管理类
|
||||
/// </summary>
|
||||
private readonly IViewportManager _viewportManager = new DefaultViewportManager();
|
||||
public IViewportManager ViewportManager
|
||||
{
|
||||
get { return _viewportManager; }
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// 搜索条件:Recipe开始时间
|
||||
/// </summary>
|
||||
public DateTime StartDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 搜索条件:Recipe结束时间
|
||||
/// </summary>
|
||||
public DateTime EndDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 搜索条件:PM腔
|
||||
/// </summary>
|
||||
public string SelectedValuePM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 搜索条件:PM腔
|
||||
/// </summary>
|
||||
public ObservableCollection<string> SourcePM { get; set; }
|
||||
/// <summary>
|
||||
/// 搜索条件:Recipe
|
||||
/// </summary>
|
||||
public string RecipeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询曲线用点位组,每次有曲线变动时入队,生成曲线后出队
|
||||
/// </summary>
|
||||
ConcurrentBag<QueryIndexer> _lstTokenTimeData = new ConcurrentBag<QueryIndexer>();
|
||||
|
||||
public ObservableCollection<DataDetail> QueryDataDetail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户选中的曲线组,前台treeview和chart调用
|
||||
/// </summary>
|
||||
public ObservableCollection<IRenderableSeriesViewModel> SelectedData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件搜索的recipe
|
||||
/// </summary>
|
||||
public ObservableCollection<RecipeItemSic> Recipes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户选中查阅的recipe
|
||||
/// </summary>
|
||||
public ObservableCollection<RecipeItemSic> SelectedRecipes { get; set; }
|
||||
|
||||
|
||||
private List<PMNodeInfo> Nodes = new List<PMNodeInfo>();
|
||||
/// <summary>
|
||||
/// 获取设备需要监控的Device点
|
||||
/// </summary>
|
||||
private ObservableCollection<PMNodeInfo> _configNodes = new ObservableCollection<PMNodeInfo>();
|
||||
public ObservableCollection<PMNodeInfo> ConfigNodes
|
||||
{
|
||||
get { return _configNodes; }
|
||||
set { _configNodes = value; NotifyOfPropertyChange("ConfigNodes"); }
|
||||
}
|
||||
|
||||
private double _maxYValue = 0, _minYValue = 0;
|
||||
|
||||
private IRange _visibleRangeXLimit;
|
||||
public IRange VisibleRangeXLimit
|
||||
{
|
||||
get { return _visibleRangeXLimit;}
|
||||
set { _visibleRangeXLimit = value; NotifyOfPropertyChange(nameof(VisibleRangeXLimit)); }
|
||||
}
|
||||
|
||||
private IRange _visibleRangeYLimit;
|
||||
public IRange VisibleRangeYLimit
|
||||
{
|
||||
get { return _visibleRangeYLimit; }
|
||||
set { _visibleRangeYLimit = value; NotifyOfPropertyChange(nameof(VisibleRangeYLimit)); }
|
||||
}
|
||||
|
||||
private IRange _visibleRangeX;
|
||||
public IRange VisibleRangeX
|
||||
{
|
||||
get { return _visibleRangeX; }
|
||||
set { _visibleRangeX = value; NotifyOfPropertyChange(nameof(VisibleRangeX)); }
|
||||
}
|
||||
private IRange _visibleRangeY;
|
||||
public IRange VisibleRangeY
|
||||
{
|
||||
get { return _visibleRangeY; }
|
||||
set { _visibleRangeY = value; NotifyOfPropertyChange(nameof(VisibleRangeY)); }
|
||||
}
|
||||
|
||||
private AutoRange _chartAutoRange = AutoRange.Never;
|
||||
public AutoRange ChartAutoRange
|
||||
{
|
||||
get { return _chartAutoRange; }
|
||||
set
|
||||
{
|
||||
_chartAutoRange = value;
|
||||
NotifyOfPropertyChange(nameof(ChartAutoRange));
|
||||
}
|
||||
}
|
||||
|
||||
private Visibility _dataDetailVisbility = Visibility.Collapsed;
|
||||
public Visibility DataDetailVisbility
|
||||
{
|
||||
get { return _dataDetailVisbility; }
|
||||
set
|
||||
{
|
||||
_dataDetailVisbility = value;
|
||||
NotifyOfPropertyChange(nameof(DataDetailVisbility));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showLegendInfo;
|
||||
public bool ShowLegendInfo
|
||||
{
|
||||
get { return _showLegendInfo; }
|
||||
set
|
||||
{
|
||||
_showLegendInfo = value;
|
||||
NotifyOfPropertyChange(nameof(ShowLegendInfo));
|
||||
}
|
||||
}
|
||||
|
||||
private Queue<Color> colorQueue = new Queue<Color>(new Color[]{Color.Red,Color.Orange,Color.Green,Color.Blue,Color.Purple,Color.Aqua,Color.Bisque,Color.Brown,Color.BurlyWood,Color.CadetBlue,
|
||||
Color.CornflowerBlue,Color.DarkBlue,Color.DarkCyan,Color.DarkGray,Color.DarkGreen,Color.DarkKhaki,Color.DarkMagenta,Color.DarkOliveGreen, Color.DarkOrange,
|
||||
Color.DarkSeaGreen,Color.DarkSlateBlue,Color.DarkSlateGray,Color.DarkViolet,Color.DeepPink,Color.DeepSkyBlue,Color.DimGray, Color.DodgerBlue,Color.ForestGreen, Color.Gold,
|
||||
Color.Gray,Color.GreenYellow,Color.HotPink,Color.Indigo,Color.Khaki,
|
||||
Color.LimeGreen,Color.MediumOrchid,Color.MediumPurple,Color.MediumSeaGreen,Color.MediumSlateBlue,Color.MediumSpringGreen,
|
||||
Color.MediumTurquoise,Color.Moccasin,Color.NavajoWhite,Color.Olive,Color.OliveDrab,Color.OrangeRed,Color.Orchid,Color.PaleGoldenrod,Color.PaleGreen,
|
||||
Color.PeachPuff,Color.Peru,Color.Plum,Color.PowderBlue,Color.RosyBrown,Color.RoyalBlue,Color.SaddleBrown,Color.Salmon,Color.SeaGreen, Color.Sienna,
|
||||
Color.SkyBlue,Color.SlateBlue,Color.SlateGray,Color.SpringGreen,Color.Teal,Color.Aquamarine,Color.Tomato,Color.Turquoise,Color.Violet,Color.Wheat, Color.YellowGreen});
|
||||
|
||||
#endregion Properties
|
||||
|
||||
|
||||
#region 界面按钮
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重新搜索Recipe
|
||||
/// </summary>
|
||||
public void SearchRecipe()
|
||||
{
|
||||
this.StartDateTime = this.view.wfTimeFrom.Value;
|
||||
this.EndDateTime = this.view.wfTimeTo.Value;
|
||||
|
||||
if (StartDateTime > EndDateTime)
|
||||
{
|
||||
MessageBox.Show("Time range invalid, start time should be early than end time");
|
||||
return;
|
||||
}
|
||||
|
||||
Recipes.Clear();
|
||||
RemoveAllLine();
|
||||
|
||||
try
|
||||
{
|
||||
string sql = $"SELECT * FROM \"process_data\" where \"process_data\".\"process_begin_time\" >='{StartDateTime:yyyyMMdd HHmmss}' and \"process_data\".\"process_end_time\" <='{EndDateTime:yyyyMMdd HHmmss}'";
|
||||
if (!string.IsNullOrEmpty(SelectedValuePM))
|
||||
{
|
||||
string[] pms = SelectedValuePM.Split(',');
|
||||
if (pms.Length > 0)
|
||||
{
|
||||
sql += " and (FALSE ";
|
||||
foreach (var pm in pms)
|
||||
{
|
||||
sql += $" OR \"process_data\".\"process_in\"='{pm}' ";
|
||||
}
|
||||
sql += " ) ";
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(RecipeName))
|
||||
{
|
||||
sql += string.Format(" and lower( \"process_data\".\"recipe_name\") like '%{0}%'", RecipeName.ToLower());
|
||||
}
|
||||
|
||||
sql += " order by \"process_data\".\"process_begin_time\" ASC;";
|
||||
|
||||
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
if (dbData == null || dbData.Rows.Count == 0)
|
||||
return;
|
||||
|
||||
double maxXValue = 0;
|
||||
|
||||
for (int i = 0; i < dbData.Rows.Count; i++)
|
||||
{
|
||||
RecipeItemSic item = new RecipeItemSic();
|
||||
|
||||
item.Recipe = dbData.Rows[i]["recipe_name"].ToString();
|
||||
item.Chamber = dbData.Rows[i]["process_in"].ToString();
|
||||
item.Status = dbData.Rows[i]["process_status"].ToString();
|
||||
//item.ProcessGuid = dbData.Rows[i]["guid"].ToString();
|
||||
item.ProcessGuid = "Recipe"+i.ToString().PadLeft(3,'0');
|
||||
|
||||
if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
|
||||
item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
|
||||
item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy/MM/dd HH:mm:ss.fff");
|
||||
|
||||
long curTickCount = (DateTime.Parse(item.EndTime).Ticks - DateTime.Parse(item.StartTime).Ticks) / 10000000;
|
||||
if (maxXValue < curTickCount)
|
||||
{
|
||||
maxXValue = curTickCount;
|
||||
}
|
||||
//正确设置范围,否则曲线不显示
|
||||
VisibleRangeX = new DoubleRange(-0.2*maxXValue, maxXValue * 1.2);
|
||||
VisibleRangeXLimit = new DoubleRange(-0.2 * maxXValue, maxXValue * 1.2);//X轴拉伸1.2倍
|
||||
|
||||
Recipes.Add(item);
|
||||
}
|
||||
}));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.Write(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择Recipe
|
||||
/// </summary>
|
||||
public void CheckRecipe(RecipeItemSic recipe)
|
||||
{
|
||||
if (recipe.Selected) //选中配方
|
||||
{
|
||||
SelectedRecipes.Add(recipe);
|
||||
//刷新曲线
|
||||
//GetXRange();
|
||||
foreach (PMNodeInfo node in ConfigNodes)
|
||||
{
|
||||
if (node.Selected)
|
||||
{
|
||||
ParameterCheck(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
else //取消配方
|
||||
{
|
||||
RecipeItemSic item = SelectedRecipes.FirstOrDefault(t => t.Recipe == recipe.Recipe);
|
||||
if (item != null)
|
||||
SelectedRecipes.Remove(item);
|
||||
RemoveRecipeRelated(recipe); //移除配方相关曲线
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除配方相关曲线
|
||||
/// </summary>
|
||||
/// <param name="recipe"></param>
|
||||
private void RemoveRecipeRelated(RecipeItemSic recipe)
|
||||
{
|
||||
lock (_lockSelection) //递减法移除列表内项,不会删错
|
||||
{
|
||||
for (int i = SelectedData.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if ((SelectedData[i] as ChartDataLineXV2).ProcessGuid.Contains(recipe.ProcessGuid))
|
||||
{
|
||||
SelectedData.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有选择的节点
|
||||
/// </summary>
|
||||
public void RemoveAllLine()
|
||||
{
|
||||
this.SelectedData.Clear();
|
||||
foreach (PMNodeInfo node in ConfigNodes)
|
||||
{
|
||||
node.Selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 界面按钮
|
||||
|
||||
private void SelectedDataChanged()
|
||||
{
|
||||
foreach (var item in SelectedData)
|
||||
{
|
||||
if (item.Stroke.Equals(System.Windows.Media.Color.FromArgb(255, 0, 0, 255)))
|
||||
{
|
||||
Color drawingColor = colorQueue.Peek();
|
||||
item.Stroke = System.Windows.Media.Color.FromRgb(drawingColor.R, drawingColor.G, drawingColor.B);
|
||||
colorQueue.Enqueue(colorQueue.Dequeue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载PM的Device名称
|
||||
/// </summary>
|
||||
private void GetPMNode()
|
||||
{
|
||||
Nodes.Clear();
|
||||
ConfigNodes.Clear();
|
||||
List<string> dataList = (List<string>)QueryDataClient.Instance.Service.GetConfig("System.NumericDataList");
|
||||
dataList.Sort();
|
||||
List<string> lstNode = new List<string>();
|
||||
foreach (string dataName in dataList)
|
||||
{
|
||||
string[] nodeName = dataName.Split('.');
|
||||
if (nodeName.Length > 1 && nodeName[0].IndexOf("PM") == 0)
|
||||
{
|
||||
string nodeStr = dataName.Substring(dataName.IndexOf('.') + 1);
|
||||
if (!lstNode.Contains(nodeStr)) //不显示重复项
|
||||
{
|
||||
lstNode.Add(nodeStr);
|
||||
Nodes.Add(new PMNodeInfo() { NodeStr = nodeStr });
|
||||
ConfigNodes.Add(new PMNodeInfo() { NodeStr = nodeStr });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Find(string keyword)
|
||||
{
|
||||
ConfigNodes.Clear();
|
||||
//遍历所有node,隐藏不符合条件项
|
||||
foreach (var node in Nodes)
|
||||
{
|
||||
node.ApplyCriteria(keyword);
|
||||
if (node.IsMatch)
|
||||
{
|
||||
ConfigNodes.Add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void SetDataDetailVisble()
|
||||
{
|
||||
if (DataDetailVisbility == Visibility.Collapsed)
|
||||
{
|
||||
DataDetailVisbility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
DataDetailVisbility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
#region 获取HistoryData
|
||||
|
||||
private object _lockSelection = new object();
|
||||
|
||||
protected bool MonitorHistoryData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_lstTokenTimeData.Count > 0)
|
||||
{
|
||||
lock (_lockSelection)
|
||||
{
|
||||
foreach (var item in _lstTokenTimeData)
|
||||
{
|
||||
DateTime timeFrom = item.StartTime;
|
||||
DateTime timeTo = item.EndTime;
|
||||
|
||||
GetHistoryData(item.DateList, timeFrom, timeTo, item.Module, item.ColumneName, item.ProcessGuid);
|
||||
_lstTokenTimeData.TryTake(out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Error(ex.Message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void GetHistoryData(List<string> lstDayStr, DateTime from, DateTime to, string module, string colName, string processGuid)
|
||||
{
|
||||
Dictionary<string, List<DataDetail>> historyData = new Dictionary<string, List<DataDetail>>();
|
||||
List<DataDetail> lstDataDetail = new List<DataDetail>();
|
||||
|
||||
//db获取对应字段数据
|
||||
foreach (string cDate in lstDayStr)
|
||||
{
|
||||
string sql = String.Format("select time AS InternalTimeStamp,\"{0}\"", colName);
|
||||
sql += string.Format(" from \"{0}\" where time > {1} and time <= {2} order by time asc",
|
||||
cDate + "." + module, from.Ticks, to.Ticks);
|
||||
|
||||
DataTable dataTable = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
if (dataTable == null || dataTable.Rows.Count == 0 || dataTable.Columns.Count < 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < dataTable.Rows.Count; i++)
|
||||
{
|
||||
DataDetail data = new DataDetail();
|
||||
long ticks = (long)dataTable.Rows[i][0] - from.Ticks;
|
||||
data.xValue = ticks / 10000000;
|
||||
if (dataTable.Rows[i][1] is DBNull || dataTable.Rows[i][1] is null)
|
||||
{
|
||||
data.yValue = 0;
|
||||
}
|
||||
else if (dataTable.Rows[i][1] is bool)
|
||||
{
|
||||
data.yValue = (bool)dataTable.Rows[i][1] ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.yValue = float.Parse(dataTable.Rows[i][1].ToString());
|
||||
}
|
||||
if (data.yValue > _maxYValue)
|
||||
{
|
||||
_maxYValue = data.yValue;
|
||||
}
|
||||
if (data.yValue < _minYValue)
|
||||
{
|
||||
_minYValue = data.yValue;
|
||||
}
|
||||
lstDataDetail.Add(data);
|
||||
}
|
||||
}
|
||||
//正确设置范围,否则曲线不显示
|
||||
VisibleRangeY = new DoubleRange(_minYValue - _maxYValue * 0.5, _maxYValue * 2.1);
|
||||
VisibleRangeYLimit = new DoubleRange(_minYValue - _maxYValue * 0.5, _maxYValue * 2.1);//Y轴拉伸1.2倍
|
||||
|
||||
//所有数据内存
|
||||
historyData.Add(processGuid, lstDataDetail);
|
||||
|
||||
//数据绑定到曲线中
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in SelectedData)
|
||||
{
|
||||
var seriesItem = item as ChartDataLineXV2;
|
||||
|
||||
if (seriesItem == null)
|
||||
continue;
|
||||
foreach (var data in historyData)
|
||||
{
|
||||
if (data.Key != seriesItem.ProcessGuid)
|
||||
continue;
|
||||
|
||||
seriesItem.Capacity += data.Value.Count;
|
||||
|
||||
foreach (var detailDataItem in data.Value)
|
||||
{
|
||||
seriesItem.Append(detailDataItem.xValue, detailDataItem.yValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
}));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新Data变化
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
/// <returns></returns>
|
||||
public bool ParameterCheck(PMNodeInfo node)
|
||||
{
|
||||
if (SelectedRecipes.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (node.Selected)
|
||||
{
|
||||
foreach (RecipeItemSic itemSic in SelectedRecipes)
|
||||
{
|
||||
string nodeStr = itemSic.Chamber + "." + node.NodeStr; //字段名称
|
||||
string nodeStr_1 = itemSic.LotID; //显示名称
|
||||
string nodeWithGuid = node.NodeStr + "_" + itemSic.ProcessGuid; //字段名+ Guid (唯一ID)
|
||||
DateTime dtStartTime = DateTime.Parse(itemSic.StartTime);
|
||||
DateTime dtEndTime = DateTime.Parse(itemSic.EndTime);
|
||||
|
||||
lock (_lockSelection)
|
||||
{
|
||||
bool isExist = SelectedData.FirstOrDefault(x => (x as ChartDataLineXV2).ProcessGuid == nodeWithGuid) != null;
|
||||
if (!isExist)
|
||||
{
|
||||
if (SelectedData.Count < MAX_PARAMETERS)
|
||||
{
|
||||
var line = new ChartDataLineXV2(nodeWithGuid);
|
||||
line.Time=itemSic.StartTime+"-"+itemSic.EndTime;
|
||||
line.RecipeName = new DirectoryInfo(itemSic.Recipe).Name;
|
||||
if (itemSic.Chamber.StartsWith("PM1"))
|
||||
line.Module = "PM1";
|
||||
else if (itemSic.Chamber.StartsWith("PM2"))
|
||||
line.Module = "PM2";
|
||||
else
|
||||
line.Module = "System";
|
||||
line.ProcessGuid = nodeWithGuid;
|
||||
line.RecName = nodeStr_1;
|
||||
line.Tag = node;
|
||||
SelectedData.Add(line);
|
||||
SelectedDataChanged();
|
||||
QueryIndexer indexer = _lstTokenTimeData.FirstOrDefault(x => x.ProcessGuid == line.ProcessGuid);
|
||||
|
||||
if (indexer == null)
|
||||
{
|
||||
indexer = new QueryIndexer()
|
||||
{
|
||||
Module = line.Module,
|
||||
StartTime = dtStartTime,
|
||||
EndTime = dtEndTime,
|
||||
ProcessGuid = line.ProcessGuid,
|
||||
ColumneName = nodeStr,
|
||||
DateList = GetDateList(dtStartTime, dtEndTime)
|
||||
};
|
||||
|
||||
_lstTokenTimeData.Add(indexer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (_lockSelection)
|
||||
{
|
||||
for (int i = SelectedData.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if ((SelectedData[i] as ChartDataLineXV2).DataName.Contains(node.NodeStr))
|
||||
{
|
||||
SelectedData.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SelectColor(ChartDataLineXV2 cp)
|
||||
{
|
||||
if (cp == null)
|
||||
return;
|
||||
|
||||
var dlg = new System.Windows.Forms.ColorDialog();
|
||||
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
cp.Stroke = new System.Windows.Media.Color() { A = dlg.Color.A, B = dlg.Color.B, G = dlg.Color.G, R = dlg.Color.R };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取开始时间和结束时间之间的所有日期
|
||||
/// </summary>
|
||||
/// <param name="timeStart"></param>
|
||||
/// <param name="timeEnd"></param>
|
||||
/// <returns></returns>
|
||||
private List<string> GetDateList(DateTime timeStart, DateTime timeEnd)
|
||||
{
|
||||
List<string> lstTime = new List<string>();
|
||||
string dtEndStr = timeEnd.ToString("yyyyMMdd");
|
||||
int timeSpan = (int)(timeEnd - timeStart).TotalDays + 1;
|
||||
for (int i = 0; i <= timeSpan; i++)
|
||||
{
|
||||
string dt = timeStart.AddDays(i).ToString("yyyyMMdd");
|
||||
lstTime.Add(dt);
|
||||
if (dt == dtEndStr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return lstTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有的列名
|
||||
/// </summary>
|
||||
private List<string> GetColumnList(string modleName)
|
||||
{
|
||||
List<string> _seletedItemName = new List<string>();
|
||||
foreach (PMNodeInfo node in ConfigNodes)
|
||||
{
|
||||
if (node.Selected)
|
||||
{
|
||||
_seletedItemName.Add("\"" + modleName + "." + node.NodeStr + "\"");
|
||||
}
|
||||
}
|
||||
return _seletedItemName;
|
||||
}
|
||||
|
||||
public ActionCommand DefaultZoomCommand { get; private set; }
|
||||
public ActionCommand ShowLegendCommand { get; private set; }
|
||||
public ActionCommand DataDetailVisbleCommand { get; private set; }
|
||||
public ActionCommand ShowAlarmCommand { get; private set; }
|
||||
|
||||
|
||||
private void SetLegendAvalible()
|
||||
{
|
||||
ShowLegendInfo = !ShowLegendInfo;
|
||||
}
|
||||
|
||||
private void Zoom()
|
||||
{
|
||||
ViewportManager.AnimateZoomExtents(TimeSpan.FromMilliseconds(500));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,818 @@
|
||||
<UserControl x:Class="SicUI.Models.PMs.Charting.PMChartingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
|
||||
xmlns:micro="http://www.caliburn.org"
|
||||
xmlns:control="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
|
||||
xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter;assembly=MECF.Framework.UI.Client"
|
||||
xmlns:cv="clr-namespace:MECF.Framework.UI.Core.Converters;assembly=MECF.Framework.UI.Core"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="780" d:DesignWidth="1900" Background="#91b0cd">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="Button" x:Key="ChartingButtonStyle">
|
||||
<Setter Property="Margin" Value="3" />
|
||||
<Setter Property="Background" Value="#FF323539" />
|
||||
<Setter Property="Foreground" Value="#FFF" />
|
||||
<Setter Property="Padding" Value="3" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="#FF5B5B5B" />
|
||||
<Setter Property="Width" Value="35" />
|
||||
<Setter Property="Height" Value="35" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Name="Border" Margin="{TemplateBinding Margin}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Opacity="0.6" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter Name="ContentHost" HorizontalAlignment="Center" VerticalAlignment="Center" ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Opacity" Value="1"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Line" x:Key="AnomationStyle">
|
||||
<Setter Property="Stroke" Value="Black"/>
|
||||
<Setter Property="StrokeThickness" Value="2"/>
|
||||
<Setter Property="StrokeDashArray" Value="2 2"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="LegendTemplate">
|
||||
<Border HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Background="#88444444"
|
||||
BorderBrush="#88EEEEEE"
|
||||
BorderThickness="1"
|
||||
CornerRadius="3">
|
||||
<TextBlock Margin="5"
|
||||
FontSize="16"
|
||||
Foreground="#eee"
|
||||
Text="{Binding DataContext.ThresholdX1,
|
||||
StringFormat='Threshold = {0:#0.00}',
|
||||
RelativeSource={RelativeSource AncestorType=s:SciChartSurface}}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</UserControl.Resources>
|
||||
<Grid x:Name="gridMain">
|
||||
<TabControl x:Name="TabMain" Background="Transparent" Height="{Binding ElementName=gridMain, Path=ActualHeight}" Width="{Binding ElementName=gridMain, Path=ActualWidth}" VerticalAlignment="Top" >
|
||||
<TabItem Header="Data Source" Height="25">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.ColumnSpan="5" Orientation="Horizontal" VerticalAlignment="Bottom" >
|
||||
<Button Height="30" Width="100" Margin="5,0" Content="Add">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Add">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button Height="30" Width="100" Content="Remove All">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="RemoveAllProcessData">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="1" Margin="5,5,0,5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding Recipes}" SelectedItem="{Binding SelectedProcessData}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="1800">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTemplateColumn Header="Recipe Name" MinWidth="180">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Recipe}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Module" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Chamber}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Start Time" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding StartTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="End Time" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding EndTime}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Status" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Status}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Lot Name" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding LotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Slot Number" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding SlotID}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Sync Step" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding SyncStep}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Delete" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="Delete" Margin="5,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="DeleteProcessData">
|
||||
<micro:Parameter Value="{Binding }"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="450"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0" Margin="10,0,0,5">
|
||||
<TextBox VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="250" Height="30" Text="{Binding Path=CurrentCriteria, UpdateSourceTrigger=PropertyChanged}" Foreground="Black"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="20,0,0,5" >
|
||||
<Button Height="30" Width="100" Margin="5,0,0,0" Content="Remove All">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="RemoveAllLine">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button Height="30" Width="100" Margin="5,0,0,0" Content="Template">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Template">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button Height="30" Width="110" Margin="500,0,0,0" Content="Goto Charting" Click="Button_Click">
|
||||
<!--<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="GotoCharting">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>-->
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="450"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border BorderBrush="{DynamicResource MainFrame_BD_Highlight}" BorderThickness="1" SnapsToDevicePixels="True" Background="{DynamicResource Tab_BG}" Padding="2">
|
||||
<TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ConfigNodes}" >
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding PMNodeInfo}" >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ParameterCheck">
|
||||
<micro:Parameter Value="{Binding }"/>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
<TextBlock Text="{Binding NodeStr}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
|
||||
<Setter Property="Visibility" Value="{Binding Path=IsMatch, Mode=OneWay, Converter={StaticResource ResourceKey=BoolVisibilityConverter}}"></Setter>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
</Border>
|
||||
|
||||
<DataGrid Grid.Column="2" Margin="20,0,0,0" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="1300" Grid.ColumnSpan="2" >
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="60">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Visible" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Source" MinWidth="280">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Name" MinWidth="300" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding RecName}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Color" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Style="{DynamicResource Color_Button}" HorizontalAlignment="Stretch" Background="{Binding Stroke, Converter={StaticResource colorConverter}}" Width="50">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SelectColor">
|
||||
<micro:Parameter Value="{Binding}" ></micro:Parameter>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Factor" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataFactor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Offset" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Width" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding LineThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="120">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="120">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem Header="Charting View">
|
||||
<Grid x:Name="MainGrid">
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Background="#eee">
|
||||
<Button Command="{Binding DefaultZoomCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Zoom"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
|
||||
<Button Command="{Binding ShowLegendCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Legend"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
<Button Command="{Binding ShowAlarmCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Alarm"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Background="#eee" Grid.Row="1">
|
||||
<Button Command="{Binding DataDetailVisbleCommand}"
|
||||
Padding="0"
|
||||
FontSize="11"
|
||||
Content="Data"
|
||||
Style="{StaticResource ChartingButtonStyle}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1" >
|
||||
<s:SciChartSurface Name="sciChart" RenderableSeries="{Binding SelectedData}" Annotations="{Binding AlarmAnnotation}"
|
||||
s:ThemeManager.Theme="ExpressionLight"
|
||||
Padding="0,0,0,0"
|
||||
DebugWhyDoesntSciChartRender="False" BorderBrush="Gray" Focusable="False" IsTabStop="False" ViewportManager="{Binding ViewportManager}">
|
||||
|
||||
|
||||
<!--<s:SciChartSurface.Annotations>
|
||||
<s:VerticalLineAnnotation HorizontalAlignment="Stretch" Visibility="{Binding StatAnnotationVisibility}"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
IsEditable="True"
|
||||
LabelPlacement="Axis"
|
||||
LabelTextFormatting="0.00"
|
||||
ShowLabel="True"
|
||||
Stroke="Blue"
|
||||
StrokeThickness="2"
|
||||
X1="{Binding ThresholdX1,
|
||||
Mode=TwoWay,
|
||||
FallbackValue=5.6}" />
|
||||
<s:VerticalLineAnnotation HorizontalAlignment="Stretch" Visibility="{Binding StatAnnotationVisibility}"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
IsEditable="True"
|
||||
LabelPlacement="Axis"
|
||||
LabelTextFormatting="0.00"
|
||||
ShowLabel="True"
|
||||
Stroke="Blue"
|
||||
StrokeThickness="2"
|
||||
X1="{Binding ThresholdX2,
|
||||
Mode=TwoWay,
|
||||
FallbackValue=50}" />
|
||||
</s:SciChartSurface.Annotations>-->
|
||||
|
||||
|
||||
<!-- Create an X Axis -->
|
||||
<s:SciChartSurface.XAxis>
|
||||
<s:NumericAxis DrawMinorTicks="False"
|
||||
DrawMinorGridLines="True" Focusable="False"
|
||||
Margin="0,0,0,0"
|
||||
TitleFontSize="15"
|
||||
FontSize="20"
|
||||
AutoRange="{Binding ChartAutoRange}"
|
||||
VisibleRangeLimit="{Binding VisibleRangeXLimit}"
|
||||
VisibleRange="{Binding VisibleRangeX}"
|
||||
Id="DefaultAxisId" TitleFontWeight="Normal" />
|
||||
|
||||
</s:SciChartSurface.XAxis>
|
||||
|
||||
<!-- Create a Y Axis -->
|
||||
<s:SciChartSurface.YAxis>
|
||||
<s:NumericAxis DrawMinorTicks="False"
|
||||
DrawMinorGridLines="True"
|
||||
AxisAlignment="Right"
|
||||
MinWidth="35" MaxWidth="35"
|
||||
HorizontalAlignment="Center"
|
||||
CursorTextFormatting="0.######"
|
||||
VisibleRange="{Binding VisibleRangeY}"
|
||||
VisibleRangeLimit="{Binding VisibleRangeYLimit}"
|
||||
Id="DefaultAxisId" MajorDelta="0.1"
|
||||
MinorDelta="0.1" DrawMajorBands="False" Focusable="False"
|
||||
BorderThickness="0" AutoRange="{Binding ChartAutoRange}"
|
||||
DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False">
|
||||
<s:NumericAxis.GrowBy>
|
||||
<s:DoubleRange Min="0.1" Max="0.1"/>
|
||||
</s:NumericAxis.GrowBy>
|
||||
</s:NumericAxis>
|
||||
</s:SciChartSurface.YAxis>
|
||||
|
||||
<s:SciChartSurface.ChartModifier>
|
||||
|
||||
<s:ModifierGroup >
|
||||
<s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True"
|
||||
IsXAxisOnly="False"
|
||||
ZoomExtentsY="True"
|
||||
IsAnimated="True" ExecuteOn="MouseLeftButton" ReceiveHandledEvents="True" />
|
||||
|
||||
<s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True"
|
||||
SourceMode="AllSeries" ShowTooltip="False" />
|
||||
|
||||
<s:LegendModifier ShowLegend="False" GetLegendDataFor="AllSeries" x:Name="legendModifier"/>
|
||||
|
||||
<s:ZoomExtentsModifier x:Name="zoomExtentsModifier" XyDirection="XYDirection" ExecuteOn="MouseDoubleClick"/>
|
||||
|
||||
<s:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True" ClipModeX="None" XyDirection="XYDirection" ExecuteOn="MouseRightButton" ZoomExtentsY="False" />
|
||||
|
||||
<s:RolloverModifier x:Name="rolloverModifier"
|
||||
UseInterpolation="False" FontSize="9" IsEnabled="True"
|
||||
DrawVerticalLine="False" FontFamily="Arial,SimSun"
|
||||
SnapsToDevicePixels="False"
|
||||
ShowAxisLabels="False" />
|
||||
|
||||
<s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" XyDirection="XYDirection"/>
|
||||
|
||||
<s:RolloverModifier IsEnabled="True" DrawVerticalLine="True" ShowAxisLabels="False" x:Name="RolloverModifier"
|
||||
ShowTooltipOn="Always" SourceMode="AllSeries" ExecuteOn="MouseMove" >
|
||||
<s:RolloverModifier.LineOverlayStyle>
|
||||
<!-- The style for the rollover line -->
|
||||
<Style TargetType="Line">
|
||||
<Setter Property="Stroke" Value="Pink"/>
|
||||
<Setter Property="StrokeThickness" Value="2"/>
|
||||
<Setter Property="StrokeDashArray" Value="2 2"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
</Style>
|
||||
</s:RolloverModifier.LineOverlayStyle>
|
||||
</s:RolloverModifier>
|
||||
|
||||
<s:YAxisDragModifier DragMode="Scale"/>
|
||||
<s:XAxisDragModifier DragMode="Pan"/>
|
||||
<s:LegendModifier ShowLegend="{Binding ShowLegendInfo}"/>
|
||||
|
||||
</s:ModifierGroup>
|
||||
|
||||
</s:SciChartSurface.ChartModifier>
|
||||
|
||||
|
||||
</s:SciChartSurface>
|
||||
|
||||
<StackPanel Margin="30,30" Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding RealTimeMode, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<StackPanel.Effect>
|
||||
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Color="#FFB3E8F6"/>
|
||||
</StackPanel.Effect>
|
||||
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Canvas Name="layer1" Width="20" Height="20" Margin="12,34,10,0">
|
||||
<Canvas.RenderTransform>
|
||||
<ScaleTransform CenterX="-6" CenterY="-6" ScaleX="2" ScaleY="2" />
|
||||
</Canvas.RenderTransform>
|
||||
<Path Data="m 0 0 c -4 -4 -8.866933 -10.79431 -10 -15 0 0 0 -5 5 -5 5 0 5 5 5 5 0 0 0 -5 5 -5 5 0 5.242535 4.02986 5 5 -1 4 -6 11 -10 15 z" Fill="#4e72b8"/>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="ArialBlack" FontSize="36" FontWeight="Bold" Foreground="#4e72b8" Text="{Binding RealTimeX}"/>
|
||||
<!--<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="ArialBlack" FontSize="36" FontWeight="Bold" Foreground="#4e72b8" Text="RealTime"/>-->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Visibility="{Binding DataDetailVisbility}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1410"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TabControl Margin="5" >
|
||||
<TabItem Header="Data Line" Height="24" VerticalAlignment="Top">
|
||||
<Grid>
|
||||
<DataGrid Margin="5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="1380">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="60">
|
||||
<DataGridTemplateColumn.HeaderTemplate >
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Visible" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Source" MinWidth="280">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Name" MinWidth="300" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding RecName}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Color" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Style="{DynamicResource Color_Button}" Height="25" HorizontalAlignment="Stretch" Background="{Binding Stroke, Converter={StaticResource colorConverter}}" Width="50">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SelectColor">
|
||||
<micro:Parameter Value="{Binding}" ></micro:Parameter>
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Factor" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataFactor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="YOffset" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="XOffset" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataXOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Width" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding LineThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Data Statistics" Height="24" VerticalAlignment="Top">
|
||||
<Grid>
|
||||
<DataGrid Margin="5" HorizontalAlignment="Left" BorderThickness="1"
|
||||
AlternationCount="2" ColumnHeaderHeight="30"
|
||||
ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False"
|
||||
CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12" Width="1380">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Source" MinWidth="280">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Name" MinWidth="300" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding RecName}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="PointCount" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding PointCount}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="MaxValue" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding MaxValue,StringFormat={}{0:F4}}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="MinValue" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding MinValue,StringFormat={}{0:F4}}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="AvgValue" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding AvgValue,StringFormat={}{0:F4}}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="Variance" MinWidth="100" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Variance,StringFormat={}{0:F4}}" Margin="5,0" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Grid Grid.Column="1" Margin="15,25,0,0" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="26"/>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
<ColumnDefinition Width="95"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Trend Chart Setting" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="4" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1">
|
||||
<TextBlock Text="YValueRange" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{Binding AlignerStatusBackground}" Grid.Row="1" Grid.Column="1" Padding="5,1" Grid.ColumnSpan="1">
|
||||
<controls:TextBoxEx MinValue="0" MaxValue="10000000" Text="{Binding UseSetY1, Mode=TwoWay}" Validation.ErrorTemplate="{x:Null}" Width="110" Height="25"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{Binding AlignerStatusBackground}" Grid.Row="1" Grid.Column="2" Padding="5,1" Grid.ColumnSpan="1">
|
||||
<controls:TextBoxEx MinValue="0" MaxValue="10000000" Text="{Binding UseSetY2, Mode=TwoWay}" Validation.ErrorTemplate="{x:Null}" Width="110" Height="25"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="3" Padding="5,1" >
|
||||
<Button Content="Set" Width="70" Height="25" Margin="5,0,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SetYValue">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</Border>
|
||||
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="2" Padding="5,1">
|
||||
<TextBlock Text="XValueRange" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{Binding AlignerStatusBackground}" Grid.Row="2" Grid.Column="1" Padding="5,1" Grid.ColumnSpan="1">
|
||||
<controls:TextBoxEx MinValue="0" MaxValue="10000000" Text="{Binding UseSetX1, Mode=TwoWay}" Validation.ErrorTemplate="{x:Null}" Width="110" Height="25"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{Binding AlignerStatusBackground}" Grid.Row="2" Grid.Column="2" Padding="5,1" Grid.ColumnSpan="1">
|
||||
<controls:TextBoxEx MinValue="0" MaxValue="10000000" Text="{Binding UseSetX2, Mode=TwoWay}" Validation.ErrorTemplate="{x:Null}" Width="110" Height="25"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="2" Grid.Column="3" Padding="5,1" >
|
||||
<Button Content="Set" Width="70" Height="25" Margin="5,0,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SetXValue">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Grid.Column="0" Padding="5,1" >
|
||||
<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
|
||||
<CheckBox IsChecked="{Binding RealTimeMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="RealTime" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Grid.Column="1" Padding="5,1" >
|
||||
<TextBlock Text="Interval(ms):" HorizontalAlignment="Right" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Grid.Column="2" Padding="5,1" >
|
||||
<controls:TextBoxEx EditBoxMode="UnSignInteger" MinValue="2000" MaxValue="60000" Text="{Binding TrendInterval, Mode=TwoWay}" Validation.ErrorTemplate="{x:Null}" Width="100" Height="25"/>
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Grid.Column="3" Padding="5,1" Grid.ColumnSpan="3">
|
||||
<Button Content="Set" Width="70" Height="25" Margin="5,0,0,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SetTimeSpan">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</Border>
|
||||
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="4" Padding="5,1">
|
||||
<TextBlock Text="Statistics" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Padding="5,1" >
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Content="Statistics" Width="80" Height="25" Margin="10,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="DataStatistics">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button Content="Reset" Width="80" Height="25" Margin="10,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="DataStatisticsReset">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<!--<Button Content="Current" Width="80" Height="25" Margin="10,0">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="DataStatisticsCurrent">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SicUI.Models.PMs.Charting
|
||||
{
|
||||
/// <summary>
|
||||
/// PMCharting.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PMChartingView : UserControl
|
||||
{
|
||||
public PMChartingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.TabMain.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
private void ShowDataPanel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.MainGrid.RowDefinitions[2].Height.Value < 300)
|
||||
{
|
||||
this.MainGrid.RowDefinitions[2].Height = new GridLength(300, GridUnitType.Pixel);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.MainGrid.RowDefinitions[2].Height = new GridLength(0, GridUnitType.Pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user