public override void Load(BinaryReader reader) { base.Load(reader); PresetValue = new ValueText(); PresetValue.Load(reader); VControl.SetValue(PresetValue); }
public override void Load(BinaryReader reader) { PresetValue = new ValueInteger(); base.Load(reader); MinValue = reader.ReadInt32(); MaxValue = reader.ReadInt32(); PresetValue.Load(reader); VControl.SetValue(PresetValue); }
/** basic load */ public override void Load(BinaryReader reader) { base.Load(reader); InputControlEnum c = new InputControlEnum(); String eName = reader.ReadString(); c.EnumContainer = EnumBank.Bank.Find(eName); VControl = c; PresetValue = new ValueInteger(); PresetValue.Load(reader); VControl.SetValue(PresetValue); }
static async Task MainAsync(string[] args) { //await Task.Delay(1); vControl = new VControl("172.18.0.9"); vControl.LoadUpdate += (int vid, float percent) => { Console.WriteLine($"Load #{vid} set to {percent}%"); }; vControl.TaskUpdate += (int vid, int state) => { Console.WriteLine($"Task #{vid} new state {state}"); }; vControl.ButtonUpdate += (int vid, ButtonModes mode) => { Console.WriteLine($"Button #{vid} {(mode == ButtonModes.Press ? "Pressed" : "Released")}"); }; vControl.LedUpdate += LedUpdateFn; //await vControl.ConnectAsync(); vControl.Connect(); Console.WriteLine("Getting load 219"); //vControl.UpdateLoad(219); Console.WriteLine(await vControl.Get.LoadAsync(219)); Console.ReadLine(); Console.WriteLine("Getting led 1591"); Console.WriteLine(await vControl.Get.LedAsync(1591)); Console.WriteLine("Setting to 0%"); vControl.Set.Load(219, 0); Console.ReadLine(); Console.WriteLine("Setting to 50%"); vControl.Set.Load(219, 50); Console.ReadLine(); Console.WriteLine("Setting to 200%"); vControl.Set.Load(219, 200); Console.ReadLine(); vControl.Close(); }