//******************************************************************************************************
// DeviceStateModels.cs - Gbtc
//
// Copyright © 2018, 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://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:
// ----------------------------------------------------------------------------------------------------
// 07/18/2018 - J. Ritchie Carroll
// Generated original version of source code.
// 27/11/2019 - C. Lackner
// Moved Adapter to GSF
//
//******************************************************************************************************
using System;
using System.ComponentModel.DataAnnotations;
using GSF.ComponentModel;
using GSF.Data.Model;
namespace GrafanaAdapters
{
///
/// Represents the Alarm State of a connected Device.
///
public class AlarmState
{
///
/// Unique ID.
///
[PrimaryKey(true)]
public int ID { get; set; }
///
/// Description of the .
///
[StringLength(50)]
public string State { get; set; }
///
/// Recommended Action for the User if a is in this
///
[StringLength(500)]
public string RecommendedAction { get; set; }
///
/// Color associated with the .
///
[StringLength(50)]
public string Color { get; set; }
}
///
/// Represents the a connected Device in an AlarmState.
///
public class AlarmDevice
{
///
/// Unique ID.
///
[PrimaryKey(true)]
public int ID { get; set; }
///
/// Device ID of the Alarmed Device.
///
public int DeviceID { get; set; }
///
/// ID of the .
///
public int StateID { get; set; }
///
/// Time of the last update.
///
[DefaultValueExpression("DateTime.UtcNow")]
[UpdateValueExpression("DateTime.UtcNow")]
public DateTime TimeStamp { get; set; }
///
/// String to display on the Grafana Alarm Dashboard.
///
[StringLength(10)]
public string DisplayData { get; set; }
}
///
/// Represents a Grafana Alarm Panel Block
///
public class AlarmDeviceStateView
{
///
/// Unique ID.
///
[PrimaryKey(true)]
public int ID { get; set; }
///
/// name of the Device.
///
public string Name { get; set; }
///
/// Description of the Device State.
///
public string State { get; set; }
///
/// Color of the Device State.
///
public string Color { get; set; }
///
/// Additional data to be displayed.
///
public string DisplayData { get; set; }
///
/// Device ID of the Alarmed Device.
///
public int DeviceID { get; set; }
}
}