Ejemplo n.º 1
0
        public void SetRealFixture(RealFixture pFixture)
        {
            try
            {
                mFixture = pFixture;
                ((RealFixture)mFixture).ToSave = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "File is corrupt.\r\nDelete the fixture and try again ...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                DmxCreator.Main.LogException(ex);
            }

            this.grp_Group1.Text    = "Constructor";
            this.txt_1.Text         = ((RealFixture)mFixture).LightConstructor;
            this.grp_Group1.Enabled = false;
            this.grp_Group1.Visible = true;

            this.grp_Group2.Text    = "Fixture Name";
            this.txt_2.Text         = ((RealFixture)mFixture).LightName;
            this.grp_Group2.Enabled = false;
            this.grp_Group2.Visible = true;

            this.grp_Image.Visible = true;
            if (((RealFixture)mFixture).Image != null && File.Exists(((RealFixture)mFixture).Image))
            {
                this.pictureBox1.Image = Image.FromFile(((RealFixture)mFixture).Image);
            }
            this.channelCtrl1.SetFixture(mFixture);
        }
Ejemplo n.º 2
0
        private void poursuitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //mSelectedNode = e.Node;
            RealFixture fix = (RealFixture)mSelectedNode.Tag;

            Forms.PoursuitEditor dlg = new PoursuitEditor(fix);
            //dlg.DockPanel = this.DockPanel;
            dlg.Show();
        }
Ejemplo n.º 3
0
        public void SetFixture(RealFixture pFixture)
        {
            mFixture = pFixture;
            this.txt_Address.Text     = pFixture.StartAddress + "";
            this.txt_Constructor.Text = pFixture.LightConstructor;
            this.txt_Product.Text     = pFixture.LightName;
            this.txt_Name.Text        = pFixture.Name;

            dmxAdressCtrl1.SetAdress(pFixture.StartAddress);
        }
Ejemplo n.º 4
0
        private void applyChangeInWorkspaceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.treeView1.SelectedNode.Tag == null)
            {
                return;
            }

            RealFixture fix = (RealFixture)this.treeView1.SelectedNode.Tag;

            DmxFramework.Framework.Fixtures.RefreshFixture(fix);
        }
Ejemplo n.º 5
0
 public void Save()
 {
     foreach (TreeNode CompanyNode in this.treeView1.Nodes)
     {
         foreach (TreeNode FictureNode in CompanyNode.Nodes)
         {
             RealFixture fix = (RealFixture)FictureNode.Tag;
             if (fix == null)
             {
                 continue;
             }
             if (fix.ToSave)
             {
                 fix.Save();
             }
         }
     }
 }
Ejemplo n.º 6
0
        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            this.treeView1.SelectedNode = e.Node;
            if (e.Button == MouseButtons.Right)
            {
                if (e.Node.Parent == null)
                {
                    this.contextMenuStrip1.Show(this.treeView1, e.Location);
                }
                else
                {
                    this.contextMenuStrip2.Show(this.treeView1, e.Location);
                }
            }
            else
            {
                if (e.Node.Parent == null)
                {
                    return;
                }

                if (e.Node.Tag != null)
                {
                    /*string ConstructorName = e.Node.Parent.Text;
                     * string LightName = e.Node.Text;
                     *
                     *
                     *
                     * /*if (OnRealFixtureSelected != null)*/
                    RealFixture fix = (RealFixture)e.Node.Tag;

                    OnRealFixtureSelected(fix);
                }
                else
                {
                    string ConstructorName = e.Node.Parent.Text;
                    string LightName       = e.Node.Text;

                    RealFixture fix = new RealFixture(ConstructorName, LightName);
                    e.Node.Tag = fix;
                    OnRealFixtureSelected(fix);
                }
            }
        }
Ejemplo n.º 7
0
        private void addFixtureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Dialog.AddFixture dlg = new DmxCreator.Dialog.AddFixture();
            DialogResult      res = dlg.ShowDialog(this);

            if (res == DialogResult.OK && dlg.FixtureName != null && dlg.FixtureName != "")
            {
                RealFixture fix  = new RealFixture(this.treeView1.SelectedNode.Text, dlg.FixtureName);
                TreeNode    node = new TreeNode(fix.LightName);
                node.Tag = fix;

                DirectoryInfo Root = new DirectoryInfo(Constant.FixtureDir + "/" + this.treeView1.SelectedNode.Text);

                if (!Directory.Exists(Constant.FixtureDir + "/" + this.treeView1.SelectedNode.Text + "/" + dlg.FixtureName))
                {
                    Root.CreateSubdirectory(dlg.FixtureName);
                }


                this.treeView1.SelectedNode.Nodes.Add(node);
                this.treeView1.SelectedNode.Expand();
                this.treeView1.SelectedNode = node;
            }
        }
Ejemplo n.º 8
0
 private void fixtureTree1_OnRealFixtureSelected(RealFixture pFixture)
 {
     mFixture = pFixture;
 }