/** * Sets the constant current target value. * * @param device_address The address of the device. * @param target_current The the curent you'd like to set the device to. * @return none */ public static async Task SetConstantCurrentTarget(IPAddress device_address, double target_current) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SetConstantCurrentTarget(client, target_current); } }
public static async Task SetDynamicMode(IPAddress device_address, int mode, double low_value, double high_value, double frequency, double duty_cycle) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SetDynamicMode(client, mode, low_value, high_value, frequency, duty_cycle); } }
public static async Task <string> QueryDynamicMode(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await QueryDynamicMode(client)); } }
public static async Task <double> GetConstantResistanceTarget(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await GetConstantResistanceTarget(client)); } }
public static async Task <double> GetMaximumSupportedSystemInputResistance(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await GetMaximumSupportedSystemInputResistance(client)); } }
public static async Task <double> QueryBatteryTestCapacityCounter(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await QueryBatteryTestCapacityCounter(client)); } }
//recall before querying public static async Task <string> QueryBatteryTestModeParameters(IPAddress device_address, int list_index) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await QueryBatteryTestModeParameters(client, list_index)); } }
public static async Task <bool> GetLoadInputSwitchState(IPAddress device_address) //true is on, false is off { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await GetLoadInputSwitchState(client)); } }
public static async Task RecallToUnit(IPAddress device_address, int location_index) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await RecallToUnit(client, location_index); } }
public static async Task SimulateTrigger(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SimulateTrigger(client); } }
public static async Task <double> MeasurePower(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await MeasurePower(client)); } }
public static async Task SetSystemMode(IPAddress device_address, int mode) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SetSystemMode(client, mode); } }
public static async Task <int> GetSystemMode(IPAddress device_address) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); return(await GetSystemMode(client)); } }
public static async Task SetDynamicMode_Flip(IPAddress device_address, double low_slope, double high_slope, double low_current, double high_current) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SetDynamicMode_Flip(client, low_slope, high_slope, low_current, high_current); } }
public static async Task SetBatteryTestModeParameters(IPAddress device_address, int list_index, double current_range, double discharge_current, double cutoff_voltage, double cutoff_capacity, double discharge_time) { using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(device_address, client); await SetBatteryTestModeParameters(client, list_index, current_range, discharge_current, cutoff_voltage, cutoff_capacity, discharge_time); } }
private static Task GenerateTrackerTask() { return(new Task(async() => { tracker_active = true; while (tracker_active) { try { address = await KEL103Tools.FindLoadAddress(); tracker_init_complete = true; //do work using (UdpClient client = new UdpClient(KEL103Persistance.Configuration.CommandPort)) { KEL103Tools.ConfigureClient(address, client); KEL103StateTracker.client = client; while (tracker_active) { Stopwatch q = new Stopwatch(); q.Start(); CheckoutClient(); var kel_state = new KEL103State(); var voltage = await KEL103Command.MeasureVoltage(client); var current = await KEL103Command.MeasureCurrent(client); var power = await KEL103Command.MeasurePower(client); var input_state = await KEL103Command.GetLoadInputSwitchState(client); var time_stame = DateTime.Now; CheckinClient(); q.Stop(); var retreval_span = TimeSpan.FromTicks(q.ElapsedTicks); kel_state.Voltage = voltage; kel_state.Current = current; kel_state.Power = power; kel_state.TimeStamp = time_stame; kel_state.InputState = input_state; kel_state.ValueAquisitionTimespan = retreval_span; NewKEL103StateAvailable(kel_state); //await Task.Delay(10); } } } catch (Exception ex) { } } })); }