//******************************************************************************************************
// HistorianViewUserControl.xaml.cs - Gbtc
//
// Copyright © 2010, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://www.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 12/22/2011 - Aniket Salver
// Generated original version of source code.
//
//******************************************************************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Xml;
using GSF.Collections;
using GSF.Configuration;
using GSF.Historian;
using GSF.Historian.Files;
using GSF.IO;
using GSF.PhasorProtocols.UI.Modal;
using Microsoft.Win32;
namespace GSF.PhasorProtocols.UI.UserControls
{
///
/// Interaction logic for HistorianViewUserControl.xaml
///
public partial class HistorianViewUserControl : UserControl
{
#region [ Members ]
// Nested Types
///
/// This is a wrapper around a MetadataRecord that allows auto-generation
/// of columns in the data grid based on the public properties of this class.
///
public class MetadataWrapper
{
private readonly MetadataRecord m_metadata;
///
/// Creates a new instance of the class.
///
/// The to be wrapped.
public MetadataWrapper(MetadataRecord metadata)
{
m_metadata = metadata;
}
///
/// Determines whether the measurement represented by this metadata record
/// should be exported to CSV by the Historian Data Viewer.
///
public bool Export
{
get;
set;
}
///
/// Determines whether the measurement represented by this metadata record
/// should be displayed on the Historian Data Viewer graph.
///
public bool Display
{
get;
set;
}
///
/// Gets the point number of the measurement.
///
public int PointNumber
{
get
{
return m_metadata.HistorianID;
}
}
///
/// Gets the name of the measurement.
///
public string Name
{
get
{
return m_metadata.Name;
}
}
///
/// Gets the description of the measurement.
///
public string Description
{
get
{
return m_metadata.Description;
}
}
///
/// Gets the first alternate name for the measurement.
///
public string Synonym1
{
get
{
return m_metadata.Synonym1;
}
}
///
/// Gets the second alternate name for the measurement.
///
public string Synonym2
{
get
{
return m_metadata.Synonym2;
}
}
///
/// Gets the third alternate name for the measurement.
///
public string Synonym3
{
get
{
return m_metadata.Synonym3;
}
}
///
/// Gets the system name.
///
public string System
{
get
{
return m_metadata.SystemName;
}
}
///
/// Gets the low range of the measurement.
///
public Single LowRange
{
get
{
return m_metadata.Summary.LowRange;
}
}
///
/// Gets the high range of the measurement.
///
public Single HighRange
{
get
{
return m_metadata.Summary.HighRange;
}
}
///
/// Gets the engineering units used to measure the values.
///
public string EngineeringUnits
{
get
{
return m_metadata.AnalogFields.EngineeringUnits;
}
}
///
/// Gets the unit number of the measurement.
///
public int Unit
{
get
{
return m_metadata.UnitNumber;
}
}
///
/// Returns the wrapped .
///
/// The wrapped metadata record.
public MetadataRecord GetMetadata()
{
return m_metadata;
}
}
// Fields
private string m_currentSessionPath;
private ICollection m_archiveFiles;
private readonly List m_metadata;
private DateTime m_startTime;
private DateTime m_endTime;
private readonly ICollection