using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SPT.PTZ.Core;

namespace PTZController
{
    public partial class BoschAUXForm : PanelForm
    {
        const int AuxItemCount = 128;

        private AuxEventHandler m_onAuxEvent;

        /// <summary>
        /// Event for callback
        /// </summary>
        public AuxEventHandler AuxEvent
        {
            get { return m_onAuxEvent; }
            set { m_onAuxEvent = value; }
        }

        public BoschAUXForm()
        {
            InitializeComponent();
            _auxIndexSpin.Value = 0;
        }

        private void _onButton_Click(object sender, EventArgs e)
        {
            AuxEvent(PtzFunction.AuxiliaryOn, (int)_auxIndexSpin.Value);
        }

        private void _offButton_Click(object sender, EventArgs e)
        {
            AuxEvent(PtzFunction.AuxiliaryOff, (int)_auxIndexSpin.Value);
        }

        private void _openButton_Click(object sender, EventArgs e)
        {
            AuxEvent(PtzFunction.AuxiliaryLatchOn, (int)_auxIndexSpin.Value);
        }

        private void _closeButton_Click(object sender, EventArgs e)
        {
            AuxEvent(PtzFunction.AuxiliaryLatchOff, (int)_auxIndexSpin.Value);
        }
    }
}