public TextOptionsDialog(Generator generator) { this.InitializeComponent(); this.m_generator = generator; this.m_pause = 0x7d0 / this.timer.Interval; this.SetScroll(generator.TextScrollDirection); this.SetPosition(generator.TextVertPosition, generator.TextVertPositionValue); this.SetExtent(generator.TextScrollExtent); this.numericUpDownTextHeight.Maximum = generator.BoardPixelHeight; this.numericUpDownTextHeight.Value = generator.TextHeight; }
public SetupDialog(XmlNode setupNode) { this.InitializeComponent(); try { this.m_setupNode = setupNode; this.m_generator = new Generator(); this.m_boardLayout = new Size(1, 1); XmlNode nodeAlways = Xml.GetNodeAlways(this.m_setupNode, "Boards"); if (nodeAlways.Attributes["width"] != null) { this.m_boardLayout.Width = int.Parse(nodeAlways.Attributes["width"].Value); } if (nodeAlways.Attributes["height"] != null) { this.m_boardLayout.Height = int.Parse(nodeAlways.Attributes["height"].Value); } this.textBoxMessage.Text = Xml.GetNodeAlways(this.m_setupNode, "Message", "[NAME]").InnerText; this.m_portAddress = int.Parse(Xml.GetNodeAlways(this.m_setupNode, "Address", "888").InnerText); XmlNode parentNode = this.m_setupNode["TextOptions"]; if (parentNode != null) { this.m_generator.LoadFromXml(parentNode); } XmlNode contextNode = Xml.GetNodeAlways(this.m_setupNode, "Virtual"); if (contextNode.Attributes["enabled"] != null) { this.SetVirtual(bool.Parse(contextNode.Attributes["enabled"].Value)); } else { this.SetVirtual(false); } if (this.checkBoxVirtualHardware.Checked) { this.m_ledSize = int.Parse(Xml.GetNodeAlways(contextNode, "LEDSize", "3").InnerText); this.m_ledColor = Color.FromArgb(int.Parse(Xml.GetNodeAlways(contextNode, "LEDColor", "-65536").InnerText)); this.m_dotPitch = int.Parse(Xml.GetNodeAlways(contextNode, "DotPitch", "9").InnerText); } else { this.m_ledSize = 3; this.m_ledColor = Color.Red; this.m_dotPitch = 9; } } catch (Exception exception) { MessageBox.Show(exception.Message + "\n" + exception.StackTrace); throw; } }
public void Startup() { if (this.m_hardware != null) { this.m_hardware.Stop(); this.m_hardware = null; } if (this.m_virtual) { this.m_hardware = new VirtualHardware(this.m_boardLayoutWidth, this.m_boardLayoutHeight, this.m_ledSize, this.m_ledColor, this.m_dotPitch); } else { this.m_hardware = new Hardware(this.m_portAddress, this.m_boardLayoutWidth, this.m_boardLayoutHeight); } this.m_generator = new Generator(); this.m_generator.TextScrollExtent = ScrollExtent.OnAndOff; this.m_generator.LoadFromXml(this.m_setupNode["TextOptions"]); this.m_generator.BoardPixelWidth = 0x30 * this.m_boardLayoutWidth; this.m_generator.BoardPixelHeight = 0x10 * this.m_boardLayoutHeight; this.m_hardware.Start(); this.StopThread(); this.m_updateThread = new Thread(new ThreadStart(this.FrameOutputThread)); this.m_updateThread.Start(); this.m_timer.Start(); }