Example #1
0
 private void SetPropertyGridVisibility()
 {
     if (_viewModel.IsSettingsEditorVisible)
     {
         PropertyGrid.Show();
     }
     else
     {
         PropertyGrid.Hide();
     }
 }
Example #2
0
        public void InitialTPLayer()
        {
            tpProperty.Hide();
            tpDataGrid.Hide();
            mainTree.Nodes.Clear();
            tpMessageInfo.Clear();

            tpDataGrid.AllowUserToResizeColumns = true;

            tpDataGrid.ColumnCount = 19;

            tpDataGrid.Columns[ADDRESS_MODE_INDEX].Name         = "AddressMode";
            tpDataGrid.Columns[ADDRESS_MODE_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[ADDRESS_MODE_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[USE_FLOW_CONTROL_INDEX].Name         = "UseFlowControl";
            tpDataGrid.Columns[USE_FLOW_CONTROL_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[USE_FLOW_CONTROL_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[USE_BLOCK_SIZE_INDEX].Name         = "UseBlockSize";
            tpDataGrid.Columns[USE_BLOCK_SIZE_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[USE_BLOCK_SIZE_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[USE_STMIN_INDEX].Name         = "UseSTmin";
            tpDataGrid.Columns[USE_STMIN_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[USE_STMIN_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[BLOCK_SIZE_INDEX].Name         = "BlockSize";
            tpDataGrid.Columns[BLOCK_SIZE_INDEX].ValueType    = typeof(Byte);
            tpDataGrid.Columns[BLOCK_SIZE_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[STMIN_INDEX].Name         = "STmin";
            tpDataGrid.Columns[STMIN_INDEX].ValueType    = typeof(Byte);
            tpDataGrid.Columns[STMIN_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[FIRST_SN_INDEX].Name         = "FirstSN";
            tpDataGrid.Columns[FIRST_SN_INDEX].ValueType    = typeof(Byte);
            tpDataGrid.Columns[FIRST_SN_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[SEND_MSG_ID_INDEX].Name         = "SendMsgID";
            tpDataGrid.Columns[SEND_MSG_ID_INDEX].ValueType    = typeof(uint);
            tpDataGrid.Columns[SEND_MSG_ID_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[RECEIVE_MSG_ID_INDEX].Name         = "ReceiveMsgID";
            tpDataGrid.Columns[RECEIVE_MSG_ID_INDEX].ValueType    = typeof(uint);
            tpDataGrid.Columns[RECEIVE_MSG_ID_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[SEND_MSG_NAME_INDEX].ReadOnly     = true;
            tpDataGrid.Columns[SEND_MSG_NAME_INDEX].Name         = "SendMsgName";
            tpDataGrid.Columns[SEND_MSG_NAME_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[SEND_MSG_NAME_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[RECEIVE_MSG_NAME_INDEX].ReadOnly     = true;
            tpDataGrid.Columns[RECEIVE_MSG_NAME_INDEX].Name         = "ReceiveMsgName";
            tpDataGrid.Columns[RECEIVE_MSG_NAME_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[RECEIVE_MSG_NAME_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[N_AS_TIMEOUT_INDEX].Name         = "N_AS";
            tpDataGrid.Columns[N_AS_TIMEOUT_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[N_AS_TIMEOUT_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[N_BS_TIMEOUT_INDEX].Name         = "N_BS";
            tpDataGrid.Columns[N_BS_TIMEOUT_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[N_BS_TIMEOUT_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[N_AR_TIMEOUT_INDEX].Name         = "N_AR";
            tpDataGrid.Columns[N_AR_TIMEOUT_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[N_AR_TIMEOUT_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[N_CR_TIMEOUT_INDEX].Name         = "N_CR";
            tpDataGrid.Columns[N_CR_TIMEOUT_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[N_CR_TIMEOUT_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[WAIT_MODE_INDEX].Name         = "WaitMode";
            tpDataGrid.Columns[WAIT_MODE_INDEX].ValueType    = typeof(string);
            tpDataGrid.Columns[WAIT_MODE_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[WFTMAX_INDEX].Name         = "WFTMAX_COUNT";
            tpDataGrid.Columns[WFTMAX_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[WFTMAX_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[WFTMAX_TIME_INDEX].Name         = "WFTMAX_TIME";
            tpDataGrid.Columns[WFTMAX_TIME_INDEX].ValueType    = typeof(ushort);
            tpDataGrid.Columns[WFTMAX_TIME_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

            tpDataGrid.Columns[PAD_DATA_INDEX].Name         = "PAD";
            tpDataGrid.Columns[PAD_DATA_INDEX].ValueType    = typeof(Byte);
            tpDataGrid.Columns[PAD_DATA_INDEX].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;;
        }