Exemple #1
0
        public SetupForm(OneOfTwo aOneOfTwo, IItemBrowser aBrowser)
        {
            mOneOfTwo = aOneOfTwo;
            mBrowser  = aBrowser;
            InitializeComponent();

            if (mOneOfTwo.mSwitchItemHandle != -1)
            {
                itemEditBox_Switch.ItemName    = mBrowser.getItemNameByHandle(mOneOfTwo.mSwitchItemHandle);
                itemEditBox_Switch.ItemToolTip = mBrowser.getItemToolTipByHandle(mOneOfTwo.mSwitchItemHandle);
            }

            if (mOneOfTwo.mInput1ItemHandle != -1)
            {
                itemEditBox_In1.ItemName    = mBrowser.getItemNameByHandle(mOneOfTwo.mInput1ItemHandle);
                itemEditBox_In1.ItemToolTip = mBrowser.getItemToolTipByHandle(mOneOfTwo.mInput1ItemHandle);
            }

            if (mOneOfTwo.mInput2ItemHandle != -1)
            {
                itemEditBox_In2.ItemName    = mBrowser.getItemNameByHandle(mOneOfTwo.mInput2ItemHandle);
                itemEditBox_In2.ItemToolTip = mBrowser.getItemToolTipByHandle(mOneOfTwo.mInput2ItemHandle);
            }

            if (mOneOfTwo.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mOneOfTwo.mValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mOneOfTwo.mValueItemHandle);
            }

            spinEdit_In1ToIn2MS.Value = mOneOfTwo.In1ToIn2MS;
            spinEdit_In2ToIn1MS.Value = mOneOfTwo.In2ToIn1MS;
        }
        public SetupForm(Logic aLogic, IItemBrowser aBrowser)
        {
            mLogic   = aLogic;
            mBrowser = aBrowser;
            InitializeComponent();

            if (mLogic.mInput1ItemHandle != -1)
            {
                itemEditBox_In1.ItemName    = mBrowser.getItemNameByHandle(mLogic.mInput1ItemHandle);
                itemEditBox_In1.ItemToolTip = mBrowser.getItemToolTipByHandle(mLogic.mInput1ItemHandle);
            }

            checkBox_In1Inverse.Checked = mLogic.Input1Inverse;

            if (mLogic.mInput2ItemHandle != -1)
            {
                itemEditBox_In2.ItemName    = mBrowser.getItemNameByHandle(mLogic.mInput2ItemHandle);
                itemEditBox_In2.ItemToolTip = mBrowser.getItemToolTipByHandle(mLogic.mInput2ItemHandle);
            }

            checkBox_In2Inverse.Checked = mLogic.Input2Inverse;

            if (mLogic.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mLogic.mValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mLogic.mValueItemHandle);
            }

            comboBox_Operator.Items.AddRange(Enum.GetNames(typeof(EOperators)));
            comboBox_Operator.SelectedIndex = mLogic.OperatorIndex;
        }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteAttributeString("Input", mItemBrowser.getItemNameByHandle(mInputItemHandle));
     aXMLTextWriter.WriteAttributeString("LagMS", StringUtils.ObjectToString(LagMS));
     aXMLTextWriter.WriteAttributeString("Gain", StringUtils.ObjectToString(Gain));
 }
        public SetupForm(Generator aGenerator, IItemBrowser aBrowser)
        {
            mGenerator = aGenerator;
            mBrowser   = aBrowser;
            InitializeComponent();

            if (mGenerator.mOnItemHandle != -1)
            {
                itemEditBox_On.ItemName    = mBrowser.getItemNameByHandle(mGenerator.mOnItemHandle);
                itemEditBox_On.ItemToolTip = mBrowser.getItemToolTipByHandle(mGenerator.mOnItemHandle);
            }

            if (mGenerator.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mGenerator.mValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mGenerator.mValueItemHandle);
            }

            comboBox_Signal.Items.AddRange(Enum.GetNames(typeof(ESignals)));
            comboBox_Signal.SelectedIndex = mGenerator.SignalIndex;
            spinEdit_Bias.Value           = (decimal)mGenerator.Bias;
            spinEdit_Amplitude.Value      = (decimal)mGenerator.Amplitude;
            spinEdit_PeriodMS.Value       = mGenerator.PeriodMS;
            spinEdit_TurnMS.Value         = mGenerator.TurnMS;
            spinEdit_StartMS.Value        = mGenerator.StartMS;
        }
        public SetupForm(Generator aGenerator, IItemBrowser aBrowser)
        {
            mGenerator  = aGenerator;
            mBrowser    = aBrowser;
            InitializeComponent();

            if (mGenerator.mOnItemHandle != -1)
            {
                itemEditBox_On.ItemName     = mBrowser.getItemNameByHandle(mGenerator.mOnItemHandle);
                itemEditBox_On.ItemToolTip  = mBrowser.getItemToolTipByHandle(mGenerator.mOnItemHandle);
            }

            if (mGenerator.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName      = mBrowser.getItemNameByHandle(mGenerator.mValueItemHandle);
                itemEditBox_Value.ItemToolTip   = mBrowser.getItemToolTipByHandle(mGenerator.mValueItemHandle);
            }

            comboBox_Signal.Items.AddRange(Generator.Signals);
            comboBox_Signal.SelectedIndex   = mGenerator.SignalIndex;
            spinEdit_Bias.Value             = (decimal)mGenerator.Bias;
            spinEdit_Amplitude.Value        = (decimal)mGenerator.Amplitude;
            spinEdit_PeriodMS.Value         = mGenerator.PeriodMS;
            spinEdit_TurnMS.Value           = mGenerator.TurnMS;
        }
Exemple #6
0
        public SetupForm(Calculator aCalculator, IItemBrowser aBrowser)
        {
            mCalculator = aCalculator;
            mBrowser    = aBrowser;
            InitializeComponent();

            if (mCalculator.mInput1ItemHandle != -1)
            {
                itemEditBox_In1.ItemName    = mBrowser.getItemNameByHandle(mCalculator.mInput1ItemHandle);
                itemEditBox_In1.ItemToolTip = mBrowser.getItemToolTipByHandle(mCalculator.mInput1ItemHandle);
            }

            if (mCalculator.mInput2ItemHandle != -1)
            {
                itemEditBox_In2.ItemName    = mBrowser.getItemNameByHandle(mCalculator.mInput2ItemHandle);
                itemEditBox_In2.ItemToolTip = mBrowser.getItemToolTipByHandle(mCalculator.mInput2ItemHandle);
            }

            if (mCalculator.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mCalculator.mValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mCalculator.mValueItemHandle);
            }

            comboBox_Operation.Items.AddRange(Calculator.Operations);
            comboBox_Operation.SelectedIndex = mCalculator.OperationIndex;
        }
        public SetupForm(Move aMove, IItemBrowser aBrowser)
        {
            mMove    = aMove;
            mBrowser = aBrowser;
            InitializeComponent();

            if (mMove.mXValueItemHandle != -1)
            {
                itemEditBox_X.ItemName    = mBrowser.getItemNameByHandle(mMove.mXValueItemHandle);
                itemEditBox_X.ItemToolTip = mBrowser.getItemToolTipByHandle(mMove.mXValueItemHandle);
            }

            if (mMove.mYValueItemHandle != -1)
            {
                itemEditBox_Y.ItemName    = mBrowser.getItemNameByHandle(mMove.mYValueItemHandle);
                itemEditBox_Y.ItemToolTip = mBrowser.getItemToolTipByHandle(mMove.mYValueItemHandle);
            }

            if (mMove.mVisibleItemHandle != -1)
            {
                itemEditBox_Visible.ItemName    = mBrowser.getItemNameByHandle(mMove.mVisibleItemHandle);
                itemEditBox_Visible.ItemToolTip = mBrowser.getItemToolTipByHandle(mMove.mVisibleItemHandle);
            }

            if (mMove.mBmp != null)
            {
                mImgMemStrm      = mMove.mImgMemStrm;
                mBmp             = mMove.mBmp;
                pictureBox.Image = mMove.mBmp;
            }
        }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Operation", OperationString);
     aXMLTextWriter.WriteAttributeString("Input1", mItemBrowser.getItemNameByHandle(mInput1ItemHandle));
     aXMLTextWriter.WriteAttributeString("Input2", mItemBrowser.getItemNameByHandle(mInput2ItemHandle));
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
 }
Exemple #9
0
        public SetupForm(Trigger aTrigger, IItemBrowser aBrowser)
        {
            mTrigger = aTrigger;
            mBrowser = aBrowser;
            InitializeComponent();

            if (mTrigger.mValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mTrigger.mValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mTrigger.mValueItemHandle);
            }

            if (mTrigger.mSetItemHandle != -1)
            {
                itemEditBox_Set.ItemName    = mBrowser.getItemNameByHandle(mTrigger.mSetItemHandle);
                itemEditBox_Set.ItemToolTip = mBrowser.getItemToolTipByHandle(mTrigger.mSetItemHandle);
            }

            if (mTrigger.mResetItemHandle != -1)
            {
                itemEditBox_Reset.ItemName    = mBrowser.getItemNameByHandle(mTrigger.mResetItemHandle);
                itemEditBox_Reset.ItemToolTip = mBrowser.getItemToolTipByHandle(mTrigger.mResetItemHandle);
            }

            radioButton_SR.Checked = mTrigger.SR_RS;
            radioButton_RS.Checked = mTrigger.SR_RS == false;
        }
Exemple #10
0
        public SetupForm(Delay aDelay, IItemBrowser aBrowser)
        {
            mDelay   = aDelay;
            mBrowser = aBrowser;
            InitializeComponent();

            if (mDelay.mOnItemHandle != -1)
            {
                itemEditBox_On.ItemName    = mBrowser.getItemNameByHandle(mDelay.mOnItemHandle);
                itemEditBox_On.ItemToolTip = mBrowser.getItemToolTipByHandle(mDelay.mOnItemHandle);
            }

            if (mDelay.mInValueItemHandle != -1)
            {
                itemEditBox_In.ItemName    = mBrowser.getItemNameByHandle(mDelay.mInValueItemHandle);
                itemEditBox_In.ItemToolTip = mBrowser.getItemToolTipByHandle(mDelay.mInValueItemHandle);
            }

            if (mDelay.mOutValueItemHandle != -1)
            {
                itemEditBox_Out.ItemName    = mBrowser.getItemNameByHandle(mDelay.mOutValueItemHandle);
                itemEditBox_Out.ItemToolTip = mBrowser.getItemToolTipByHandle(mDelay.mOutValueItemHandle);
            }

            spinEdit_Delay.Value = (decimal)mDelay.DelayMS;
        }
Exemple #11
0
        private void            updateTable()
        {
            var lDataTable = new DataTable();

            lDataTable.Columns.Add("Item");

            foreach (int lHandle in mCloneItems)
            {
                lDataTable.Rows.Add(mBrowser.getItemNameByHandle(lHandle));
            }

            var lSort = dataGridView_Items.SortOrder;

            dataGridView_Items.DataSource = lDataTable;
            if (lSort != SortOrder.None)
            {
                if (lSort == SortOrder.Ascending)
                {
                    dataGridView_Items.Sort(dataGridView_Items.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
                }
                else
                {
                    dataGridView_Items.Sort(dataGridView_Items.Columns[0], System.ComponentModel.ListSortDirection.Descending);
                }
            }

            if (mDataTable != null)
            {
                mDataTable.Dispose();
            }
            mDataTable = lDataTable;
        }
        public SetupForm(Trigger aTrigger, IItemBrowser aBrowser)
        {
            mTrigger = aTrigger;
            mBrowser = aBrowser;
            InitializeComponent();

            if (mTrigger.mValueItemHandle != -1)
            {

                itemEditBox_Value.ItemName      = mBrowser.getItemNameByHandle(mTrigger.mValueItemHandle);
                itemEditBox_Value.ItemToolTip   = mBrowser.getItemToolTipByHandle(mTrigger.mValueItemHandle);
            }

            if (mTrigger.mSetItemHandle != -1)
            {
                itemEditBox_Set.ItemName    = mBrowser.getItemNameByHandle(mTrigger.mSetItemHandle);
                itemEditBox_Set.ItemToolTip = mBrowser.getItemToolTipByHandle(mTrigger.mSetItemHandle);
            }

            if (mTrigger.mResetItemHandle != -1)
            {
                itemEditBox_Reset.ItemName      = mBrowser.getItemNameByHandle(mTrigger.mResetItemHandle);
                itemEditBox_Reset.ItemToolTip   = mBrowser.getItemToolTipByHandle(mTrigger.mResetItemHandle);
            }

            radioButton_SR.Checked = mTrigger.SR_RS;
            radioButton_RS.Checked = mTrigger.SR_RS == false;
        }
        public SetupForm(Splitter aSplitter, IItemBrowser aBrowser)
        {
            mSplitter = aSplitter;
            mBrowser  = aBrowser;
            InitializeComponent();

            if (mSplitter.mBitsValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName    = mBrowser.getItemNameByHandle(mSplitter.mBitsValueItemHandle);
                itemEditBox_Value.ItemToolTip = mBrowser.getItemToolTipByHandle(mSplitter.mBitsValueItemHandle);
            }

            switch (mSplitter.mDataFlow)
            {
            case EDataFlow.FROM:    comboBox_DataFlow.SelectedIndex = 0; break;

            case EDataFlow.TO:      comboBox_DataFlow.SelectedIndex = 1; break;

            case EDataFlow.BOTH:    comboBox_DataFlow.SelectedIndex = 2; break;
            }

            for (int i = 0; i < mSplitter.mBitItemHandles.Length; i++)
            {
                if (mSplitter.mBitItemHandles[i] != -1)
                {
                    dataGridView_Bit.Rows.Add((decimal)i, mBrowser.getItemNameByHandle(mSplitter.mBitItemHandles[i]));
                }
            }

            if (dataGridView_Bit.RowCount == 0)
            {
                button_Delete.Enabled = false;
                button_Modify.Enabled = false;
            }
        }
        public SetupForm(AnalogSensor aAnalogSensor, IItemBrowser aBrowser)
        {
            mAnalogSensor   = aAnalogSensor;
            mBrowser        = aBrowser;
            InitializeComponent();

            comboBox_Operation.Items.AddRange(ValuesCompare.Operations);

            if (mAnalogSensor.mValueItemHandle != -1)
            {
                itemEditBox_Item.ItemName    = mBrowser.getItemNameByHandle(mAnalogSensor.mValueItemHandle);
                itemEditBox_Item.ItemToolTip = mBrowser.getItemToolTipByHandle(mAnalogSensor.mValueItemHandle);
            }

            textBox_Units.Text      = mAnalogSensor.Units;
            textBox_RawMin.Text     = StringUtils.ObjectToString(mAnalogSensor.mValueScale.InMin);
            textBox_RawMax.Text     = StringUtils.ObjectToString(mAnalogSensor.mValueScale.InMax);
            checkBox_Fault.Checked  = mAnalogSensor.mFault;
            textBox_FValue.Text     = StringUtils.ObjectToString(mAnalogSensor.mFaultValue);
            textBox_PMin.Text       = StringUtils.ObjectToString(mAnalogSensor.mValueScale.OutMin);
            textBox_PMax.Text       = StringUtils.ObjectToString(mAnalogSensor.mValueScale.OutMax);

            for (int i = 0; i < mAnalogSensor.mThdItemHandles.Length; i++)
            {
                dataGridView_Thd.Rows.Add(mAnalogSensor.mThdOperations[i].OperationName, StringUtils.ObjectToString(mAnalogSensor.Thresholds[i]), mBrowser.getItemNameByHandle(mAnalogSensor.mThdItemHandles[i]));
            }

            if (dataGridView_Thd.RowCount == 0)
            {
                button_Delete.Enabled = false;
                button_Modify.Enabled = false;
            }
        }
        public SetupForm(Splitter aSplitter, IItemBrowser aBrowser)
        {
            mSplitter   = aSplitter;
            mBrowser    = aBrowser;
            InitializeComponent();

            if (mSplitter.mBitsValueItemHandle != -1)
            {
                itemEditBox_Value.ItemName      = mBrowser.getItemNameByHandle(mSplitter.mBitsValueItemHandle);
                itemEditBox_Value.ItemToolTip   = mBrowser.getItemToolTipByHandle(mSplitter.mBitsValueItemHandle);
            }

            switch (mSplitter.mDataFlow)
            {
                case EDataFlow.FROM:    comboBox_DataFlow.SelectedIndex = 0; break;
                case EDataFlow.TO:      comboBox_DataFlow.SelectedIndex = 1; break;
                case EDataFlow.BOTH:    comboBox_DataFlow.SelectedIndex = 2; break;
            }

            for (int i = 0; i < mSplitter.mBitItemHandles.Length; i++)
            {
                if (mSplitter.mBitItemHandles[i] != -1)
                {
                    dataGridView_Bit.Rows.Add((decimal)i, mBrowser.getItemNameByHandle(mSplitter.mBitItemHandles[i]));
                }
            }

            if (dataGridView_Bit.RowCount == 0)
            {
                button_Delete.Enabled = false;
                button_Modify.Enabled = false;
            }
        }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Set", mItemBrowser.getItemNameByHandle(mSetItemHandle));
     aXMLTextWriter.WriteAttributeString("Reset", mItemBrowser.getItemNameByHandle(mResetItemHandle));
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteAttributeString("SR_RS", StringUtils.ObjectToString(SR_RS));
 }
 public void                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("On", mItemBrowser.getItemNameByHandle(mOnItemHandle));
     aXMLTextWriter.WriteAttributeString("InputItem", mItemBrowser.getItemNameByHandle(mInValueItemHandle));
     aXMLTextWriter.WriteAttributeString("OutputItem", mItemBrowser.getItemNameByHandle(mOutValueItemHandle));
     aXMLTextWriter.WriteAttributeString("DelayMS", StringUtils.ObjectToString(DelayMS));
 }
Exemple #18
0
 public void             saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Front", mFront.ToString());
     aXMLTextWriter.WriteAttributeString("PositiveIncrease", StringUtils.ObjectToString(mPositiveInc));
     aXMLTextWriter.WriteAttributeString("NegativeIncrease", StringUtils.ObjectToString(mNegativeInc));
     aXMLTextWriter.WriteAttributeString("Input", mItemBrowser.getItemNameByHandle(mInValueItemHandle));
     aXMLTextWriter.WriteAttributeString("Output", mItemBrowser.getItemNameByHandle(mOutValueItemHandle));
 }
Exemple #19
0
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("InputItem", mItemBrowser.getItemNameByHandle(mInValueItemHandle));
     aXMLTextWriter.WriteAttributeString("MaxInputValue", StringUtils.ObjectToString(mValueScale.InMax));
     aXMLTextWriter.WriteAttributeString("MinInputValue", StringUtils.ObjectToString(mValueScale.InMin));
     aXMLTextWriter.WriteAttributeString("OutputItem", mItemBrowser.getItemNameByHandle(mOutValueItemHandle));
     aXMLTextWriter.WriteAttributeString("MaxOutputValue", StringUtils.ObjectToString(mValueScale.OutMax));
     aXMLTextWriter.WriteAttributeString("MinOutputValue", StringUtils.ObjectToString(mValueScale.OutMin));
 }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("X", mItemBrowser.getItemNameByHandle(mXValueItemHandle));
     aXMLTextWriter.WriteAttributeString("Y", mItemBrowser.getItemNameByHandle(mYValueItemHandle));
     aXMLTextWriter.WriteAttributeString("Visible", mItemBrowser.getItemNameByHandle(mVisibleItemHandle));
     aXMLTextWriter.WriteStartElement("Image");
     aXMLTextWriter.WriteString(Convert.ToBase64String(mImgMemStrm.ToArray()));
     aXMLTextWriter.WriteEndElement();
 }
Exemple #21
0
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Operator", OperatorString);
     aXMLTextWriter.WriteAttributeString("Input1", mItemBrowser.getItemNameByHandle(mInput1ItemHandle));
     aXMLTextWriter.WriteAttributeString("Input1Inverse", StringUtils.ObjectToString(mInput1Inverse));
     aXMLTextWriter.WriteAttributeString("Input2", mItemBrowser.getItemNameByHandle(mInput2ItemHandle));
     aXMLTextWriter.WriteAttributeString("Input2Inverse", StringUtils.ObjectToString(mInput2Inverse));
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
 }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Switch", mItemBrowser.getItemNameByHandle(mSwitchItemHandle));
     aXMLTextWriter.WriteAttributeString("Input1", mItemBrowser.getItemNameByHandle(mInput1ItemHandle));
     aXMLTextWriter.WriteAttributeString("Input2", mItemBrowser.getItemNameByHandle(mInput2ItemHandle));
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteAttributeString("In2ToIn1MS", StringUtils.ObjectToString(mIn2ToIn1MS));
     aXMLTextWriter.WriteAttributeString("In1ToIn2MS", StringUtils.ObjectToString(mIn1ToIn2MS));
 }
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("On", mItemBrowser.getItemNameByHandle(mOnItemHandle));
     aXMLTextWriter.WriteAttributeString("Value", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteAttributeString("Signal", SignalString);
     aXMLTextWriter.WriteAttributeString("Bias", StringUtils.ObjectToString(mBias));
     aXMLTextWriter.WriteAttributeString("Amplitude", StringUtils.ObjectToString(mAmplitude));
     aXMLTextWriter.WriteAttributeString("PeriodMS", StringUtils.ObjectToString(mPeriodMS));
     aXMLTextWriter.WriteAttributeString("TurnMS", StringUtils.ObjectToString(mTurnMS));
 }
        private void            dataGridViewItems_CellMouseDoubleClick(object aSender, DataGridViewCellMouseEventArgs aEventArgs)
        {
            if (aEventArgs.RowIndex == -1)
            {
                return;
            }

            string lItem   = mDataTable.Rows[aEventArgs.RowIndex][1].ToString();
            int    lHandle = -1;

            if (String.IsNullOrWhiteSpace(lItem) == false)
            {
                lHandle = mBrowser.getItemHandleByName(lItem);
            }

            lHandle = mBrowser.getItemHandleByForm(lHandle, this);

            if (lHandle != -1)
            {
                mDataTable.Rows[aEventArgs.RowIndex][1] = mBrowser.getItemNameByHandle(lHandle);
            }
            else
            {
                mDataTable.Rows[aEventArgs.RowIndex][1] = "";
            }
        }
        public SetupForm(AnalogSensor aAnalogSensor, IItemBrowser aBrowser)
        {
            mAnalogSensor = aAnalogSensor;
            mBrowser      = aBrowser;
            InitializeComponent();

            comboBox_Operation.Items.AddRange(ValuesCompare.Operations);

            if (mAnalogSensor.mValueItemHandle != -1)
            {
                itemEditBox_Item.ItemName    = mBrowser.getItemNameByHandle(mAnalogSensor.mValueItemHandle);
                itemEditBox_Item.ItemToolTip = mBrowser.getItemToolTipByHandle(mAnalogSensor.mValueItemHandle);
            }

            textBox_Units.Text     = mAnalogSensor.Units;
            textBox_RawMin.Text    = StringUtils.ObjectToString(mAnalogSensor.mValueScale.InMin);
            textBox_RawMax.Text    = StringUtils.ObjectToString(mAnalogSensor.mValueScale.InMax);
            checkBox_Fault.Checked = mAnalogSensor.mFault;
            textBox_FValue.Text    = StringUtils.ObjectToString(mAnalogSensor.mFaultValue);
            textBox_PMin.Text      = StringUtils.ObjectToString(mAnalogSensor.mValueScale.OutMin);
            textBox_PMax.Text      = StringUtils.ObjectToString(mAnalogSensor.mValueScale.OutMax);

            for (int i = 0; i < mAnalogSensor.mThdItemHandles.Length; i++)
            {
                dataGridView_Thd.Rows.Add(mAnalogSensor.mThdOperations[i].OperationName, StringUtils.ObjectToString(mAnalogSensor.Thresholds[i]), mBrowser.getItemNameByHandle(mAnalogSensor.mThdItemHandles[i]));
            }

            if (dataGridView_Thd.RowCount == 0)
            {
                button_Delete.Enabled = false;
                button_Modify.Enabled = false;
            }
        }
Exemple #26
0
        public SetupForm(WriteToFile aWriteToFile, IItemBrowser aBrowser)
        {
            mWriteToFile = aWriteToFile;
            mBrowser     = aBrowser;
            InitializeComponent();

            if (mWriteToFile.mOnItemHandle != -1)
            {
                itemEditBox_On.ItemName    = mBrowser.getItemNameByHandle(mWriteToFile.mOnItemHandle);
                itemEditBox_On.ItemToolTip = mBrowser.getItemToolTipByHandle(mWriteToFile.mOnItemHandle);
            }

            buttonEdit_Path.Text          = mWriteToFile.mPath;
            textBox_FileName.Text         = mWriteToFile.mFileName;
            checkBox_WriteChanges.Checked = mWriteToFile.mWriteChangesOnly;
            textBox_Delimiter.Text        = mWriteToFile.mDelimiter;

            spinEdit_Timeout.Properties.MinValue = MiscUtils.TimeSlice;
            spinEdit_Timeout.Value = mWriteToFile.RateMS;

            for (int i = 0; i < mWriteToFile.mItems.Length; i++)
            {
                mCloneItems.Add(mWriteToFile.mItems[i]);
            }

            updateTable();
            updateButtons();
        }
Exemple #27
0
        public void                             saveToXML(XmlTextWriter aXMLTextWriter)
        {
            aXMLTextWriter.WriteAttributeString("Y", mItemBrowser.getItemNameByHandle(mValueItemHandle));
            aXMLTextWriter.WriteAttributeString("X", mItemBrowser.getItemNameByHandle(mInputItemHandle));

            aXMLTextWriter.WriteStartElement("Points");

            for (int i = 0; i < mXValues.Length; i++)
            {
                aXMLTextWriter.WriteStartElement("Point");
                aXMLTextWriter.WriteAttributeString("X", StringUtils.ObjectToString(mXValues[i]));
                aXMLTextWriter.WriteAttributeString("Y", StringUtils.ObjectToString(mYValues[i]));
                aXMLTextWriter.WriteEndElement();
            }

            aXMLTextWriter.WriteEndElement();
        }
Exemple #28
0
 public void                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Language", Language);
     aXMLTextWriter.WriteAttributeString("Item", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteStartElement("Commands");
     mHolder.saveToXML(aXMLTextWriter, "Comand");
     aXMLTextWriter.WriteEndElement();
 }
Exemple #29
0
        private void            ItemButtonClick(object aSender, EventArgs aEventArgs)
        {
            var lItemEditBox = (ItemEditBox)aSender;
            int lHandle      = mBrowser.getItemHandleByForm(mBrowser.getItemHandleByName(lItemEditBox.ItemName), this);

            lItemEditBox.ItemName    = mBrowser.getItemNameByHandle(lHandle);
            lItemEditBox.ItemToolTip = mBrowser.getItemToolTipByHandle(lHandle);
        }
        private void            Items_Click(object aSender, EventArgs aEventArgs)
        {
            int lHandle = mBrowser.getItemHandleByForm(-1, this);

            if (lHandle != -1)
            {
                fastColoredTextBox_Code.InsertText("'" + mBrowser.getItemNameByHandle(lHandle) + "'");
            }
        }
        public void                 saveToXML(XmlTextWriter aXMLTextWriter)
        {
            aXMLTextWriter.WriteAttributeString("On", mItemBrowser.getItemNameByHandle(mOnItemHandle));
            aXMLTextWriter.WriteAttributeString("Path", mPath);
            aXMLTextWriter.WriteAttributeString("FileName", mFileName);
            aXMLTextWriter.WriteAttributeString("Rate", StringUtils.ObjectToString(RateMS));
            aXMLTextWriter.WriteAttributeString("WriteChangesOnly", StringUtils.ObjectToString(mWriteChangesOnly));
            aXMLTextWriter.WriteAttributeString("Delimiter", mDelimiter);

            aXMLTextWriter.WriteStartElement("Items");
            foreach (int lHandle in mItems)
            {
                aXMLTextWriter.WriteStartElement("Item");
                aXMLTextWriter.WriteAttributeString("Name", mItemBrowser.getItemNameByHandle(lHandle));
                aXMLTextWriter.WriteEndElement();
            }
            aXMLTextWriter.WriteEndElement();
        }
Exemple #32
0
        public SetupForm(Robot aRobot, IItemBrowser aBrowser)
        {
            mRobot   = aRobot;
            mBrowser = aBrowser;
            InitializeComponent();

            mSP = new ItemEditBox[6] {
                itemEditBox_SP1, itemEditBox_SP2, itemEditBox_SP3, itemEditBox_SP4, itemEditBox_SP5, itemEditBox_SP6
            };
            mAngle = new ItemEditBox[6] {
                itemEditBox_Angle1, itemEditBox_Angle2, itemEditBox_Angle3, itemEditBox_Angle4, itemEditBox_Angle5, itemEditBox_Angle6
            };
            mMaxSpeed = new TextBox[6] {
                textBox_MaxSpeed1, textBox_MaxSpeed2, textBox_MaxSpeed3, textBox_MaxSpeed4, textBox_MaxSpeed5, textBox_MaxSpeed6
            };
            mMaxAngle = new TextBox[6] {
                textBox_MaxAngle1, textBox_MaxAngle2, textBox_MaxAngle3, textBox_MaxAngle4, textBox_MaxAngle5, textBox_MaxAngle6
            };
            mMinAngle = new TextBox[6] {
                textBox_MinAngle1, textBox_MinAngle2, textBox_MinAngle3, textBox_MinAngle4, textBox_MinAngle5, textBox_MinAngle6
            };

            for (int i = 0; i < 6; i++)
            {
                if (mRobot.mAxisSPItemHandle[i] != -1)
                {
                    mSP[i].ItemName    = mBrowser.getItemNameByHandle(mRobot.mAxisSPItemHandle[i]);
                    mSP[i].ItemToolTip = mBrowser.getItemToolTipByHandle(mRobot.mAxisSPItemHandle[i]);
                }

                if (mRobot.mAxisAngleItemHandle[i] != -1)
                {
                    mAngle[i].ItemName    = mBrowser.getItemNameByHandle(mRobot.mAxisAngleItemHandle[i]);
                    mAngle[i].ItemToolTip = mBrowser.getItemToolTipByHandle(mRobot.mAxisAngleItemHandle[i]);
                }

                mMaxSpeed[i].Text = StringUtils.ObjectToString(mRobot.mMaxSpeed[i]);
                mMaxAngle[i].Text = StringUtils.ObjectToString(mRobot.mMaxAngle[i]);
                mMinAngle[i].Text = StringUtils.ObjectToString(mRobot.mMinAngle[i]);
            }

            checkBox_Send.Checked = mRobot.SendData;
            spinEdit_Update.Value = mRobot.UpdateRoKiSimMS;
        }
        public void                         saveToXML(XmlTextWriter aXMLTextWriter)
        {
            aXMLTextWriter.WriteAttributeString("SendData", StringUtils.ObjectToString(SendData));
            aXMLTextWriter.WriteAttributeString("UpdateRoKiSimMS", StringUtils.ObjectToString(UpdateRoKiSimMS));

            aXMLTextWriter.WriteStartElement("Joints");
            for (int i = 0; i < 6; i++)
            {
                aXMLTextWriter.WriteStartElement("Joint");
                aXMLTextWriter.WriteAttributeString("Index", StringUtils.ObjectToString(i + 1));
                aXMLTextWriter.WriteAttributeString("SetPointItem", mItemBrowser.getItemNameByHandle(mAxisSPItemHandle[i]));
                aXMLTextWriter.WriteAttributeString("MaxSpeed", StringUtils.ObjectToString(mMaxSpeed[i]));
                aXMLTextWriter.WriteAttributeString("AngleItem", mItemBrowser.getItemNameByHandle(mAxisAngleItemHandle[i]));
                aXMLTextWriter.WriteAttributeString("MaxAngle", StringUtils.ObjectToString(mMaxAngle[i]));
                aXMLTextWriter.WriteAttributeString("MinAngle", StringUtils.ObjectToString(mMinAngle[i]));
                aXMLTextWriter.WriteEndElement();
            }
            aXMLTextWriter.WriteEndElement();
        }
Exemple #34
0
 public void                                         saveToXML(XmlTextWriter aXMLTextWriter)
 {
     aXMLTextWriter.WriteAttributeString("Item", mItemBrowser.getItemNameByHandle(mValueItemHandle));
     aXMLTextWriter.WriteAttributeString("TrueSpeech", mTrueSpeech);
     aXMLTextWriter.WriteAttributeString("FalseSpeech", mFalseSpeech);
     aXMLTextWriter.WriteAttributeString("TellTrue", StringUtils.ObjectToString(TellTrue));
     aXMLTextWriter.WriteAttributeString("LogTrue", StringUtils.ObjectToString(LogTrue));
     aXMLTextWriter.WriteAttributeString("TellFalse", StringUtils.ObjectToString(TellFalse));
     aXMLTextWriter.WriteAttributeString("LogFalse", StringUtils.ObjectToString(LogFalse));
 }
        public SetupForm(Delay aDelay, IItemBrowser aBrowser)
        {
            mDelay      = aDelay;
            mBrowser    = aBrowser;
            InitializeComponent();

            if (mDelay.mInValueItemHandle != -1)
            {
                itemEditBox_In.ItemName     = mBrowser.getItemNameByHandle(mDelay.mInValueItemHandle);
                itemEditBox_In.ItemToolTip  = mBrowser.getItemToolTipByHandle(mDelay.mInValueItemHandle);
            }

            if (mDelay.mOutValueItemHandle != -1)
            {
                itemEditBox_Out.ItemName    = mBrowser.getItemNameByHandle(mDelay.mOutValueItemHandle);
                itemEditBox_Out.ItemToolTip = mBrowser.getItemToolTipByHandle(mDelay.mOutValueItemHandle);
            }

            checkBox_Inverse.Checked    = mDelay.Inverse;
            spinEdit_On.Value           = mDelay.OnDelayMS;
            spinEdit_Off.Value          = mDelay.OffDelayMS;
        }
        public SetupForm(Pump aPump, IItemBrowser aBrowser)
        {
            mPump       = aPump;
            mBrowser    = aBrowser;
            InitializeComponent();

            checkBox_IgnoreCommands.Checked = mPump.IgnoreCommands;

            if (mPump.mOnCMDItemHandle != -1)
            {
                itemEditBox_OnCMD.ItemName      = mBrowser.getItemNameByHandle(mPump.mOnCMDItemHandle);
                itemEditBox_OnCMD.ItemToolTip   = mBrowser.getItemToolTipByHandle(mPump.mOnCMDItemHandle);
            }

            if (mPump.mOffCMDItemHandle != -1)
            {
                itemEditBox_OffCMD.ItemName     = mBrowser.getItemNameByHandle(mPump.mOffCMDItemHandle);
                itemEditBox_OffCMD.ItemToolTip  = mBrowser.getItemToolTipByHandle(mPump.mOffCMDItemHandle);
            }

            if (mPump.mEsdCMDItemHandle != -1)
            {
                itemEditBox_EsdCMD.ItemName     = mBrowser.getItemNameByHandle(mPump.mEsdCMDItemHandle);
                itemEditBox_EsdCMD.ItemToolTip  = mBrowser.getItemToolTipByHandle(mPump.mEsdCMDItemHandle);
            }

            spinEdit_On.Value    = mPump.OnMS;
            spinEdit_Off.Value   = mPump.OffMS;

            if (mPump.mOnItemHandle != -1)
            {
                itemEditBox_On.ItemName     = mBrowser.getItemNameByHandle(mPump.mOnItemHandle);
                itemEditBox_On.ItemToolTip  = mBrowser.getItemToolTipByHandle(mPump.mOnItemHandle);
            }

            if (mPump.mAlarmItemHandle != -1)
            {
                itemEditBox_Alarm.ItemName      = mBrowser.getItemNameByHandle(mPump.mAlarmItemHandle);
                itemEditBox_Alarm.ItemToolTip   = mBrowser.getItemToolTipByHandle(mPump.mAlarmItemHandle);
            }

            if (mPump.mPowerItemHandle != -1)
            {
                itemEditBox_Power.ItemName      = mBrowser.getItemNameByHandle(mPump.mPowerItemHandle);
                itemEditBox_Power.ItemToolTip   = mBrowser.getItemToolTipByHandle(mPump.mPowerItemHandle);
            }

            if (mPump.mRemoteItemHandle != -1)
            {
                itemEditBox_Remote.ItemName     = mBrowser.getItemNameByHandle(mPump.mRemoteItemHandle);
                itemEditBox_Remote.ItemToolTip  = mBrowser.getItemToolTipByHandle(mPump.mRemoteItemHandle);
            }

            if (mPump.mOnBtnItemHandle != -1)
            {
                itemEditBox_OnBtn.ItemName      = mBrowser.getItemNameByHandle(mPump.mOnBtnItemHandle);
                itemEditBox_OnBtn.ItemToolTip   = mBrowser.getItemToolTipByHandle(mPump.mOnBtnItemHandle);
            }

            if (mPump.mOffBtnItemHandle != -1)
            {
                itemEditBox_OffBtn.ItemName     = mBrowser.getItemNameByHandle(mPump.mOffBtnItemHandle);
                itemEditBox_OffBtn.ItemToolTip  = mBrowser.getItemToolTipByHandle(mPump.mOffBtnItemHandle);
            }
        }