public void DeletePreset(string name) { repo.DeletePreset(name); using (var mn = new MasterNetworker(mc.GetCurrentModule().Module.Name, logger)) { mn.PresetDeleted(name); } }
public void SavePreset(string name, IEnumerable <LedValue> leds) { repo.SavePreset(name, leds, DateTime.UtcNow); using (var mn = new MasterNetworker(mc.GetCurrentModule().Module.Name, logger)) { mn.PresetChanges(name); } }
public LanCommunicationService(ILogger logger) { this.logger = logger; mc = new ModuleController(logger); mod = mc.GetCurrentModule(); canceller = new CancellationTokenSource(); networker = new MasterNetworker(mod?.Module?.Name, logger); lc = new LedController(logger); }
public void AddFeature(int featureId, string interval) { var ts = TimeSpan.Parse(interval); mf.AddFeature(Module.Id, featureId, ts); using (var mn = new MasterNetworker(Module.Name, logger)) { mn.ModuleChanges(); } }
public void AddLedValues(int startIndex, double startX, double startY, int endIndex, double endX, double endY) { var ledValues = new List <LedValue>(); var numValues = endIndex - startIndex + 1; var xdiff = (endX - startX) / numValues; var ydiff = (endY - startY) / numValues; for (int i = 0; i < numValues; i++) { ledValues.Add(new LedValue { Index = startIndex + i, ModuleId = Module.Id, ModuleName = Module.Name, X = startX + xdiff * i, Y = startY + ydiff * i }); } mf.AddLedValues(ledValues); using (var mn = new MasterNetworker(Module.Name, logger)) { mn.ModuleChanges(); } }