using DevExpress.XtraEditors;
using DevExpress.XtraGauges.Win;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LFP_Manager.Controls
{
    public partial class UcFaultAlarm : DevExpress.XtraEditors.XtraUserControl
    {
        #region VARIABLES
        private int id = 0;
        #endregion

        #region CONSTRUCTOR
        public UcFaultAlarm()
        {
            InitializeComponent();

            gaugeFault.BackColor = SystemColors.Control;
            gaugeFault.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
            gaugeFault.LayoutPadding = new DevExpress.XtraGauges.Core.Base.Thickness(2, 2, 2, 2);
        }
        #endregion

        #region PUBLIC METHODS
        public void SetFaultName(int no, string nm)
        {
            id = no;
            LbFaultName.Text = nm;
        }
        public void SetFault(int alarm)
        {
            IndicatorFault.StateIndex = alarm;
        }
        public void SetControlFlag(bool flag)
        {
            if (flag)
                IndicatorFault.StateIndex = 3;
            else
                IndicatorFault.StateIndex = 0;
        }
        #endregion
    }
}
