public async void ProcessInstruction(FlashInstruction f) { switch (f.TaperDirection) { case Taper.TaperType.UP: for (int i = 0; i < f.Duration; i += interval) { // SetPWM() await Task.Delay(interval); } break; case Taper.TaperType.DOWN: break; case Taper.TaperType.NONE: break; case Taper.TaperType.FLAT: break; default: break; } }
public void GenerateFlashSequence() { FlashInstructions = new List <FlashInstruction>(); Flash f = (from c in species.Flashes where c.sex == Sex select c).FirstOrDefault(); foreach (Taper t in f.Tapers) { FlashInstruction fi = new FlashInstruction(); fi.Duration = t.Duration; fi.EndIntensity = t.EndIntensity; fi.StartIntensity = t.StartIntensity; fi.TaperDirection = t.TaperDirection; FlashInstructions.Add(fi); } }