public void TestVfd() { var pl = VfdWriter.EnumerateComPortName(); if (pl.Contains(ComPort)) { try { using (var w = new VfdWriterImpl(ComPort)) { var panel = new VfdPanel(w, Brightness); panel.Overwrite("Connected to", 0, 0); panel.Overwrite("Yuyushiki", 1, 11); panel.Update(); } } catch (Exception) { MessageBox.Show("Selected COM port is not ready.", "Yuyushiki", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { mainForm.ResetComPortComboBoxItems(); MessageBox.Show(ComPort + " is missing.", "Yuyushiki", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } mainForm.UpdateStatus(); }
private void PlayingSectionChanged(DateTime now) { if (currentSectionIdx < sections.Count) { var s = sections[currentSectionIdx]; s.AccumMilliJ = 0; s.PlayStartedAt = now; vfdFormat.TargetPower = s.TargetPower; vfdFormat.Desc = s.Desc; vfdFormat.LoopIndex = s.LoopIndex; vfdFormat.DurationString = Plan.BuildDurationString(s.Duration); } else { vfdPanel.Overwrite(" Plan Complete ", 0, 0); vfdPanel.Overwrite(" Yuyushiki ", 1, 0); } vfdPanel.Update(); PlayingSectionChangedUIThread(); }