using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

using GLNeuroTech.Devices.BioRadio.Configuration;

namespace SampleProject_BioRadio_XamarinSDK
{
    public static class InitialConfiguration
    {
        public static BioRadioConfiguration GetInitialConfiguration()
        {
            BioRadioConfiguration config = new BioRadioConfiguration();
            config.Name = "test";
            config.PatientGroundDriven = true;
            config.PerformLeadOffDetection = true;
            config.SampleRate = 500;
            config.Termination = BioPotentialTermination.SingleEnded;

            for (int i = 0; i < 8; i++)
            {
                BioPotentialChannelConfiguration channel = config.BioPotentialChannels[i];
                channel.ChannelIndex = i + 1;                
                channel.Coupling = CouplingType.DC;
                channel.Enabled = true;
                channel.Gain = 2;
                channel.OperationMode = BioPotentialChannelMode.Normal;
                channel.Name = "Channel_" + i;
                channel.PresetCode = 123;
                channel.Saved = false;
                channel.Streamed = true;
            }

            var eventChannel = config.EventMarkerChannel;

            eventChannel.ChannelIndex = 9;            
            eventChannel.Enabled = true;
            eventChannel.Name = "EventMarker";
            eventChannel.Saved = true;
            eventChannel.Streamed = true;            


            var memsChannel = config.MemsChannel;

            memsChannel.ChannelIndex = 10;            
            memsChannel.Enabled = true;            
            memsChannel.Name = "Mems";
            memsChannel.Saved = false;
            memsChannel.Streamed = true;


            config.ExternalSensors[0] = new AuxiliaryChannelConfiguration()
            {
                ChannelIndex = 11,
                PresetCode = (ushort)AuxiliaryTransducerType.ForcePlate,                
                Enabled = true,
                Streamed = true,
                Saved = true
            };

            config.ExternalSensors[1] = new PulseOxChannelConfiguration()
            {
                ChannelIndex = 12,
                Enabled = true,
                Streamed = true,
                Saved = true
            };

            config.ExternalSensors[2] = new AuxiliaryChannelConfiguration()
            {
                ChannelIndex = 13,
                Enabled = false,
                Streamed = true,
                Saved = true
            };

            config.ExternalSensors[3] = new PulseOxChannelConfiguration()
            {
                ChannelIndex = 14,                
                Enabled = false,
                Streamed = true,
                Saved = true
            };
            return config;
        }
    }
}