Ejemplo n.º 1
0
        public void Setup()
        {
            SetupDialog setupDialog = new SetupDialog(m_selectedPort, m_modules, m_startChannel + 1, int.Parse(m_setupNode.Attributes["to"].Value), m_holdPort, m_acOperation);

            if (setupDialog.ShowDialog() == DialogResult.OK)
            {
                XmlNode serialNode = Vixen.Xml.GetNodeAlways(m_setupNode, "Serial");
                m_selectedPort = setupDialog.SelectedPort;
                m_setupData.SetString(serialNode, "Name", m_selectedPort.PortName);
                m_setupData.SetInteger(serialNode, "Baud", m_selectedPort.BaudRate);
                m_setupData.SetString(serialNode, "Parity", m_selectedPort.Parity.ToString());
                m_setupData.SetInteger(serialNode, "Data", m_selectedPort.DataBits);
                m_setupData.SetString(serialNode, "Stop", m_selectedPort.StopBits.ToString());

                // Update the module nodes
                XmlNode modulesNode = Vixen.Xml.GetEmptyNodeAlways(m_setupNode, "Modules");

                for (int i = 0; i < 4; i++)
                {
                    XmlNode moduleNode = Vixen.Xml.SetNewValue(modulesNode, "Module", string.Empty);
                    Vixen.Xml.SetAttribute(moduleNode, "enabled", m_modules[i].Enabled.ToString());
                    Vixen.Xml.SetAttribute(moduleNode, "id", m_modules[i].ID.ToString());
                    if (m_modules[i].Enabled)
                    {
                        Vixen.Xml.SetAttribute(moduleNode, "start", m_modules[i].StartChannel.ToString());
                    }
                }

                m_holdPort    = setupDialog.HoldPort;
                m_acOperation = setupDialog.ACOperation;
                m_setupData.SetBoolean(m_setupNode, "HoldPort", m_holdPort);
                m_setupData.SetBoolean(m_setupNode, "ACOperation", m_acOperation);
            }
            setupDialog.Dispose();
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            SetupDialog dialog = new SetupDialog(this.m_selectedPort, this.m_modules, this.m_startChannel + 1, int.Parse(this.m_setupNode.Attributes["to"].Value), this.m_holdPort, this.m_acOperation);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                XmlNode nodeAlways = Xml.GetNodeAlways(this.m_setupNode, "Serial");
                this.m_selectedPort = dialog.SelectedPort;
                this.m_setupData.SetString(nodeAlways, "Name", this.m_selectedPort.PortName);
                this.m_setupData.SetInteger(nodeAlways, "Baud", this.m_selectedPort.BaudRate);
                this.m_setupData.SetString(nodeAlways, "Parity", this.m_selectedPort.Parity.ToString());
                this.m_setupData.SetInteger(nodeAlways, "Data", this.m_selectedPort.DataBits);
                this.m_setupData.SetString(nodeAlways, "Stop", this.m_selectedPort.StopBits.ToString());
                XmlNode emptyNodeAlways = Xml.GetEmptyNodeAlways(this.m_setupNode, "Modules");
                for (int i = 0; i < 4; i++)
                {
                    XmlNode node = Xml.SetNewValue(emptyNodeAlways, "Module", string.Empty);
                    Xml.SetAttribute(node, "enabled", this.m_modules[i].Enabled.ToString());
                    Xml.SetAttribute(node, "id", this.m_modules[i].ID.ToString());
                    if (this.m_modules[i].Enabled)
                    {
                        Xml.SetAttribute(node, "start", this.m_modules[i].StartChannel.ToString());
                    }
                }
                this.m_holdPort    = dialog.HoldPort;
                this.m_acOperation = dialog.ACOperation;
                this.m_setupData.SetBoolean(this.m_setupNode, "HoldPort", this.m_holdPort);
                this.m_setupData.SetBoolean(this.m_setupNode, "ACOperation", this.m_acOperation);
            }
            dialog.Dispose();
        }
Ejemplo n.º 3
0
 public void Setup()
 {
     SetupDialog dialog = new SetupDialog(this.m_selectedPort, this.m_modules, this.m_startChannel + 1, int.Parse(this.m_setupNode.Attributes["to"].Value), this.m_holdPort, this.m_acOperation);
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         XmlNode nodeAlways = Xml.GetNodeAlways(this.m_setupNode, "Serial");
         this.m_selectedPort = dialog.SelectedPort;
         this.m_setupData.SetString(nodeAlways, "Name", this.m_selectedPort.PortName);
         this.m_setupData.SetInteger(nodeAlways, "Baud", this.m_selectedPort.BaudRate);
         this.m_setupData.SetString(nodeAlways, "Parity", this.m_selectedPort.Parity.ToString());
         this.m_setupData.SetInteger(nodeAlways, "Data", this.m_selectedPort.DataBits);
         this.m_setupData.SetString(nodeAlways, "Stop", this.m_selectedPort.StopBits.ToString());
         XmlNode emptyNodeAlways = Xml.GetEmptyNodeAlways(this.m_setupNode, "Modules");
         for (int i = 0; i < 4; i++)
         {
             XmlNode node = Xml.SetNewValue(emptyNodeAlways, "Module", string.Empty);
             Xml.SetAttribute(node, "enabled", this.m_modules[i].Enabled.ToString());
             Xml.SetAttribute(node, "id", this.m_modules[i].ID.ToString());
             if (this.m_modules[i].Enabled)
             {
                 Xml.SetAttribute(node, "start", this.m_modules[i].StartChannel.ToString());
             }
         }
         this.m_holdPort = dialog.HoldPort;
         this.m_acOperation = dialog.ACOperation;
         this.m_setupData.SetBoolean(this.m_setupNode, "HoldPort", this.m_holdPort);
         this.m_setupData.SetBoolean(this.m_setupNode, "ACOperation", this.m_acOperation);
     }
     dialog.Dispose();
 }