using ICC4cPwmSdk.Device;
using ICC4cPwmSdk.Dtos;

namespace Icc4c_SimpleExample
{
    internal class Example
    {
        static void Main(string[] args)
        {
            var controller = new ICC4cPwmSdkDeviceController();
            // Change comport number to correct value
            controller.Connect(10);

            // List all connected devices
            var connectedDevices = controller.GetConnectedDeviceTypes();

            // Control lens connected to channel 0 
            // Set input system to Static input
            controller.InputStage.ChangeActiveSystem(EChannel.Channel0, EInputSignalStageSystem.StaticInput);
            // Set diopter to 2.45 diopters
            controller.InputStage.StaticValue.SetDiopter(EChannel.Channel0, 2.45f);

            // Set input conditioning transition rate input value per second (in this case dpt/sec)
            controller.InputConditioningStage.OffsetAndScale.SetTransitionRate(EChannel.Channel0, 0.5f);

            // Disconnect
            controller.Disconnect(true);
        }
    }
}
