using System;
using Microsoft.SPOT;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using CPF;

using System.Text;
using System.Threading;
using HWModules;
using SensorModules;
using SWModules;

namespace CPFUnitTests
{
    [TestClass]
    public class FLBBUnitTest
    {
        [TestMethod]
        public void TestFlbb()
        {
            HWModules.MotherBoard motherboard = MotherBoard.Instance;

            FLBB1 flbb1 = FLBB1.Instance;

            MessageQueue messageQ = MessageQueue.Instance;

            motherboard.DisableChannelPower((int)MotherBoard.ChannelNames.FLBBChannel);
            Thread.Sleep(5000);
            motherboard.EnableChannelPower((int)MotherBoard.ChannelNames.FLBBChannel);
            Thread.Sleep(2000);
            flbb1.init();

            Thread.Sleep(1500);
            
            for (int i = 0; i < 3; i++)
            {
                flbb1.sendRunCmd();

                for (int j = 0; j < 3; j++)
                {
                    messageQ.processQ();
                    Thread.Sleep(1000);
                }

                Thread.Sleep(1000);
            }
        }
    }
}