| | |
| | | private EditText subnetIDEditText; |
| | | private EditText deviceIDEditText; |
| | | private EditText channelNumEditText; |
| | | private EditText indexEditText; |
| | | private EditText remarksEditText; |
| | | private Button addButton; |
| | | // private String subnetIDStr, deviceIDStr, channelNumStr, remarksStr; |
| | | private int subnetID, deviceID, channelNum; |
| | | private int subnetID, deviceID, channelNum, index; |
| | | private String remarksStr; |
| | | |
| | | private int deviceTypeId = 0; |
| | |
| | | subnetIDEditText = findViewById(R.id.et_subnetID); |
| | | deviceIDEditText = findViewById(R.id.et_deviceID); |
| | | channelNumEditText = findViewById(R.id.et_channelNum); |
| | | indexEditText = findViewById(R.id.et_index); |
| | | remarksEditText = findViewById(R.id.et_remarks); |
| | | |
| | | addButton = findViewById(R.id.btn_add); |
| | |
| | | boolean isSuccess = false; |
| | | if (deviceTypeId == 0) { |
| | | |
| | | isSuccess = HDLDeviceManager.addSecurityDevicesManually(subnetID, deviceID, channelNum, remarksStr); |
| | | isSuccess = HDLDeviceManager.addSecurityDevicesManually(subnetID, deviceID, channelNum, index, remarksStr); |
| | | } else if(deviceTypeId == 1) { |
| | | isSuccess = HDLDeviceManager.addAudioDevicesManually(subnetID, deviceID, channelNum, remarksStr); |
| | | isSuccess = HDLDeviceManager.addAudioDevicesManually(subnetID, deviceID, channelNum, index, remarksStr); |
| | | }else { |
| | | //指定大类和小类参数 区分模块类型 |
| | | isSuccess = HDLDeviceManager.addDevicesManuallyWithoutSearching(Configuration.SENSOR_BIG_TYPE,11 ,subnetID, deviceID, channelNum, remarksStr); |
| | | isSuccess = HDLDeviceManager.addDevicesManuallyWithoutSearching(Configuration.SENSOR_BIG_TYPE, 11, subnetID, deviceID, channelNum, index, remarksStr); |
| | | } |
| | | |
| | | if(isSuccess){ |
| | |
| | | return; |
| | | } |
| | | |
| | | String indexStr = indexEditText.getText().toString(); |
| | | if (TextUtils.isEmpty(indexStr)) { |
| | | showToast("序列号不能为空"); |
| | | return; |
| | | } |
| | | |
| | | String remarksString = remarksEditText.getText().toString(); |
| | | if (TextUtils.isEmpty(remarksString)) { |
| | | showToast("备注不能为空"); |
| | |
| | | subnetID = Integer.parseInt(subnetIDStr); |
| | | deviceID = Integer.parseInt(deviceIDStr); |
| | | channelNum = Integer.parseInt(channelNumStr); |
| | | index = Integer.parseInt(indexStr); |
| | | remarksStr = remarksString; |
| | | String mes = ""; |
| | | mes = "设备类型:" + deviceTypeItems[deviceTypeId]; |
| | | mes += "\n子网号:" + subnetIDStr +"\n设备号:" + deviceIDStr +"\n回路号:" + channelNumStr +"\n备注名:" + remarksStr; |
| | | mes += "\n子网号:" + subnetIDStr + "\n设备号:" + deviceIDStr + "\n回路号:" + channelNumStr + "\n序列号:" + indexStr + "\n备注名:" + remarksStr; |
| | | showTipDialog(mes); |
| | | |
| | | } |
| | |
| | | }).build(); |
| | | mMaterialDialog.show(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |