Пример #1
0
        private void DataRecordForm_Load(object sender, EventArgs e)
        {
            // Set up the current data records DIB field
            txtStorageNumber.Text       = currentDataRecord.GetStorageNumber().ToString();
            txtTariff.Text              = currentDataRecord.GetTariff().ToString();
            cmbBoxFunction.DataSource   = Enum.GetValues(typeof(Function));
            cmbBoxFunction.SelectedItem = currentDataRecord.GetFunction();
            txtSubunit.Text             = currentDataRecord.GetUnit().ToString();
            cmbBoxDataType.DataSource   = Enum.GetValues(typeof(DataType));
            cmbBoxDataType.SelectedItem = currentDataRecord.GetDataType();

            // Set up the current data records VIB field

            // Get current VIF
            cmbBoxValueType.DataSource = VIFTableRecord.VifVariableTable;
            if (currentDataRecord.GetVIF() != null)
            {
                cmbBoxValueType.SelectedItem = this.currentDataRecord.GetVIF();
            }

            // In case of VIF 0xFB, GET VIFE
            cmbBoxExtension.DataSource = VifeFbTableRecord.VifeFbTable;
            if (currentDataRecord.GetVIFE_FB() != null)
            {
                cmbBoxExtension.Enabled      = true;
                cmbBoxExtension.SelectedItem = currentDataRecord.GetVIFE_FB();
            }

            // In case of orthogonal VIF, get it
            cmbBoxOrthogonal.DataSource = VifeOrthogonalTableRecord.VifeOrthogonalTable;
            if (currentDataRecord.GetVIFE_O() != null)
            {
                cmbBoxOrthogonal.SelectedItem = currentDataRecord.GetVIFE_O();
            }

            // Get encoded data in HEX string format
            txtBoxData.Text = currentDataRecord.GetDataString();
        }