Exemplo n.º 1
0
        public DmxOutPut(Fixture pFixture)
        {
            //mFrameWork = pFrameWork;
            mFixture = pFixture;
            InitializeComponent();
            this.TabText = pFixture.Name;
            this.Text    = pFixture.Name;
            List <DmxFramework.Channels.Channel> channels = pFixture.Channels;

            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.AutoScroll  = true;

            for (int i = 0; i < channels.Count; i++)
            {
                Control.DmxOutputCtrl ctrl = new DmxSoft.Control.DmxOutputCtrl(channels[i]);
                ctrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)));
                ctrl.MaximumSize = new System.Drawing.Size(49, 0);
                ctrl.MinimumSize = new System.Drawing.Size(49, 100);
                ctrl.Name        = "dmxOutputCtrl" + i;
                ctrl.Size        = new System.Drawing.Size(49, 100);
                ctrl.TabIndex    = i;
                tableLayoutPanel1.Controls.Add(ctrl);

                this.tableLayoutPanel1.ColumnCount++;
            }
        }
Exemplo n.º 2
0
        public void SetScene(Fixture pFixture, Scene pScene)
        {
            mColumnOrderChanged = false;
            mScene       = pScene;
            mSelectedRow = -1;
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Columns.Clear();

            if (pScene.Channels.Count == 0)
            {
                return;
            }

            tableLayoutPanel1.Controls.Clear();
            tableLayoutPanel1.ColumnCount = 1;
            //int num = 1;
            foreach (string chan in pScene.ChannelNames)
            {
                int index = this.dataGridView1.Columns.Add(chan, GetChannelShortName(chan));


                this.dataGridView1.Columns[index].ToolTipText = chan;

                //num++;
            }

            foreach (Step step in pScene.Steps)
            {
                int index = this.dataGridView1.Rows.Add();

                DataGridViewRow row = this.dataGridView1.Rows[index];
                for (int i = 0; (i < step.Values.Length && i < row.Cells.Count); i++)
                {
                    row.Cells[i].Value = step.Values[i];
                }
            }

            this.tableLayoutPanel1.AutoScroll = true;;
            for (int i = 0; i < pScene.Channels.Count; i++)
            {
                Control.DmxOutputCtrl ctrl = new DmxSoft.Control.DmxOutputCtrl((Channel)pScene.Channels[i]);
                ctrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Right)));
                ctrl.MaximumSize = new System.Drawing.Size(49, 0);
                ctrl.MinimumSize = new System.Drawing.Size(49, 100);
                ctrl.Name        = "dmxOutputCtrl" + i;
                ctrl.Size        = new System.Drawing.Size(49, 100);
                ctrl.TabIndex    = i;
                tableLayoutPanel1.Controls.Add(ctrl);

                this.tableLayoutPanel1.ColumnCount++;
            }

            if (pScene.Steps.Count != 0)
            {
                LoadStep(0);
            }
        }
Exemplo n.º 3
0
        public void SetChannels(DmxFramework.Channels.Channel[] pChannels)
        {
            for (int i = 0; i < pChannels.Length; i++)
            {
                Control.DmxOutputCtrl ctrl = new DmxSoft.Control.DmxOutputCtrl(pChannels[i]);
                ctrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)));
                ctrl.MaximumSize = new System.Drawing.Size(49, 0);
                ctrl.MinimumSize = new System.Drawing.Size(49, 100);
                ctrl.Name        = "dmxOutputCtrl" + i;
                ctrl.Size        = new System.Drawing.Size(49, 100);
                ctrl.TabIndex    = i;
                tableLayoutPanel1.Controls.Add(ctrl);

                this.tableLayoutPanel1.ColumnCount++;
            }
        }
Exemplo n.º 4
0
        public DmxOutPut(DmxFramework.Framework pFrameWork)
        {
            mFrameWork = pFrameWork;
            InitializeComponent();
            mFixture = null;
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.AutoScroll  = true;

            for (int i = 0; i < 20; i++)
            {
                Control.DmxOutputCtrl ctrl = new DmxSoft.Control.DmxOutputCtrl(i + 1);
                ctrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)));
                ctrl.MaximumSize = new System.Drawing.Size(49, 0);
                ctrl.MinimumSize = new System.Drawing.Size(49, 100);
                ctrl.Name        = "dmxOutputCtrl" + i;
                ctrl.Size        = new System.Drawing.Size(49, 100);
                ctrl.TabIndex    = i;
                tableLayoutPanel1.Controls.Add(ctrl);

                this.tableLayoutPanel1.ColumnCount++;
            }
        }
Exemplo n.º 5
0
        public AdvancedForm(Fixture pFixture)
        {
            mFixture = pFixture;
            InitializeComponent();
            MySoundModeStateChangedDelegate = new delegate_SoundModeStateChanged(SoundModeChanged);
            if (mFixture.Channels == null || mFixture.Channels.Count == 0)
            {
                return;
            }

            mWasVisible = false;

            mDefaultBtnColor = this.btn_Music.BackColor;


            this.TabText = pFixture.Name;
            this.Text    = pFixture.Name;

            //reset layout
            this.tableLayoutPanel1.Controls.Clear();
            this.tableLayoutPanel1.ColumnCount = 0;
            this.tableLayoutPanel1.ColumnStyles.Clear();

            Channel Pan  = mFixture.PanChannel;
            Channel Tilt = mFixture.TiltChannel;

            bool HasPanTilt = (Pan != null && Tilt != null);

            if (HasPanTilt)
            {
                this.tableLayoutPanel1.ColumnCount = pFixture.Channels.Count - 1;
            }
            else
            {
                this.tableLayoutPanel1.ColumnCount = pFixture.Channels.Count;
            }

            float width = 100 / pFixture.Channels.Count;

            if (HasPanTilt)
            {
                Control.PanTiltCtrl pan = new DmxSoft.Control.PanTiltCtrl();
                pan.Dock = DockStyle.Fill;
                pan.SetChannel(Pan, Tilt);
                this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, width));
                this.tableLayoutPanel1.Controls.Add(pan);
            }
            else
            {
                this.btn_Automatic.Visible   = false;
                this.btn_Music.Visible       = false;
                this.btn_PresetAuto1.Visible = false;
                this.btn_PresetAuto2.Visible = false;
            }

            //determine if the fixture has a pan/tilt ...
            foreach (Channel chan in mFixture.Channels)
            {
                if (HasPanTilt && (chan.Function == ChannelFunction.Pan || chan.Function == ChannelFunction.Tilt))
                {
                    continue;
                }

                if (chan.Function == ChannelFunction.Btn)
                {
                    Control.ChannelButtonCtrl ctrl = new DmxSoft.Control.ChannelButtonCtrl();
                    ctrl.SetChannel(chan);
                    ctrl.Dock = DockStyle.Fill;
                    this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, width));
                    this.tableLayoutPanel1.Controls.Add(ctrl);
                }
                else if (chan.Function == ChannelFunction.List)
                {
                    Control.ListCtrl ctrl = new DmxSoft.Control.ListCtrl();
                    ctrl.SetChannel(chan);
                    ctrl.Dock = DockStyle.Fill;
                    this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, width));
                    this.tableLayoutPanel1.Controls.Add(ctrl);
                }
                else
                {
                    Control.DmxOutputCtrl ctrl = new DmxSoft.Control.DmxOutputCtrl(chan);
                    ctrl.Dock = DockStyle.Fill;
                    this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, ctrl.MinimumSize.Width));
                    this.tableLayoutPanel1.Controls.Add(ctrl);
                }
            }

            if (mFixture.Type == FixtureType.Virtual)
            {
                this.btn_Poursuit.Visible = false;
            }
            else
            {
                if (((RealFixture)mFixture).Poursuite.IsActive)
                {
                    this.btn_Poursuit.BackColor = Color.NavajoWhite;
                }
            }


            if (mFixture.IsMusicalDetection)
            {
                this.btn_Music.BackColor = Color.NavajoWhite;
            }

            mFixture.OnBeatDetectionStateChanged += new OnBeatDetectionStateChangedHandler(mFixture_OnBeatDetectionStateChanged);

            if (mFixture.IsAutoMode)
            {
                this.btn_Automatic.BackColor = Color.NavajoWhite;
            }

            mFixture.OnAutoModeStateChanged += new OnAutoModeStateChangedHandler(mFixture_OnAutoModeStateChanged);;
        }