//------------------------------------------------------------------------------
// Copyright (C) 2008 Invensys Systems Inc.  All rights reserved.
// 
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//------------------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;
using System.Collections;
using ArchestrA.Core;
using ArchestrA.Toolkit;
using ArchestrA.Toolkit.SystemPrimitive;

namespace ArchestrA.Toolkit.Watchdog
{
    #region Object Information - Toolkit generated code
    // Required region for Object Information - do not modify 
    // the contents of this region with the code editor.
    [AObject()]
    [Stats("Stats", true)]
    [Guid("d53d3f79-53f7-40c9-9718-531accb6bb6d")]
    [ObjectAttributes.Dictionary(@"WatchDog1.aaDCT")]
    [ObjectAttributes.ConfigtimeCLSID("0fba961c-3462-49d6-9963-11aac3c6e9d1")]
    [ObjectAttributes.RuntimeCLSID("886e73ad-ddb7-45ca-8ca2-e652e1e9bafd")]
    [ObjectAttributes.MajorVersion(1)]
    [ObjectAttributes.MinorVersion(1)]
	[ObjectAttributes.MinIASVersion("3.1.0")]
    [ObjectAttributes.Migrate("")]
    #endregion

    // Required attributes for Object Information.  
    // Changes made using the code editor will appear in the Toolkit Editor.
    [ObjectAttributes.Name("WatchDog")]
    [ObjectAttributes.Vendor("ArchestrA")]
    [ObjectAttributes.ShortDescription("This object raises an alarm when an input stops changing for too long.  It optionally maintains statistics.")]
    [ObjectAttributes.ToolsetName("AOT Samples")]
    [ObjectAttributes.Events()]
    [ObjectAttributes.IDEBehavior()]
    [AReusablePrimitiveRef(@"ArchestrA\InputPrimitive1.aaPri", "InputPrimitive1", "MonitoredBit", false)]
    [AReusablePrimitiveRef.AttrOverride("InputPrimitive1", "DataType", "LockStatus", true)]
    [AReusablePrimitiveRef.AttrOverride("InputPrimitive1", "DataType", "Value", MxDataType.MxBoolean)]

    /// <summary>
    /// Summary description for Watchdog
    /// </summary>
    public class WatchDog
    {
        [Attributes.AAttrName("Timeout.Limit")]
        [Attributes.AAttrSecurityClassification(MxSecurityClassification.MxSecurityTune)]
        [Attributes.AAttrFrequentlyAccessed(true)]
        [Attributes.AAttrCategory(MxAttributeCategory.MxCategoryWriteable_UC_Lockable)]
        public CMxElapsedTime Timeout_Limit = new CMxElapsedTime("00:00:05.0000000");

        [Attributes.AAttrName("Stats.Enable")]
        [Attributes.AAttrCategory(MxAttributeCategory.MxCategoryPackageOnly_Lockable)]
        public CMxBoolean Stats_Enable = new CMxBoolean();

        [SystemPrimitive.HistoryPrimitive.AttrOverride("TimeSinceChangeHistory", SystemPrimitive.HistoryPrimitive.EngineeringUnits, "LockStatus", true)]
        [SystemPrimitive.HistoryPrimitive("TimeSinceChangeHistory", Common.SystemPrimitive.ExtensionMode.VirtualEnable)]
        [Attributes.AAttrCategory(MxAttributeCategory.MxCategoryCalculated)]
        public CMxElapsedTime TimeSinceChange = new CMxElapsedTime();

        [SystemPrimitive.AlarmPrimitive.AttrOverride("TimeoutAlarm", SystemPrimitive.AlarmPrimitive.Value, "LockStatus", true)]
        [SystemPrimitive.AlarmPrimitive.AttrOverride("TimeoutAlarm", SystemPrimitive.AlarmPrimitive.Limit, "LockStatus", true)]
        [SystemPrimitive.AlarmPrimitive.AttrOverride("TimeoutAlarm", SystemPrimitive.AlarmPrimitive.EngineeringUnits, "LockStatus", true)]
        [SystemPrimitive.AlarmPrimitive.AttrOverride("TimeoutAlarm", SystemPrimitive.AlarmPrimitive.Category, "LockStatus", true)]
        [SystemPrimitive.AlarmPrimitive.AttrOverride("TimeoutAlarm", SystemPrimitive.AlarmPrimitive.Category, "Value", 12)]
        [SystemPrimitive.AlarmPrimitive("TimeoutAlarm", Common.SystemPrimitive.ExtensionMode.VirtualEnable)]
        [Attributes.AAttrCategory(MxAttributeCategory.MxCategoryCalculated)]
        public CMxBoolean Timeout = new CMxBoolean();
        public WatchDog()
        {
        }
    }
}

