| | |
| | | <selectionStates> |
| | | <SelectionState runConfigName="app"> |
| | | <option name="selectionMode" value="DROPDOWN" /> |
| | | <DropdownSelection timestamp="2024-09-23T05:28:34.940591100Z"> |
| | | <DropdownSelection timestamp="2024-11-11T02:28:48.057319600Z"> |
| | | <Target type="DEFAULT_BOOT"> |
| | | <handle> |
| | | <DeviceId pluginId="Default" identifier="serial=192.168.1.106:5555;connection=9ecb2e58" /> |
| | | <DeviceId pluginId="Default" identifier="serial=192.168.1.113:5555;connection=edc26430" /> |
| | | </handle> |
| | | </Target> |
| | | </DropdownSelection> |
| | |
| | | defaultConfig { |
| | | minSdkVersion 17 |
| | | targetSdkVersion 30 |
| | | versionCode 6 |
| | | versionName "1.2.3" |
| | | versionCode 7 |
| | | versionName "1.2.4" |
| | | |
| | | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| | | ndk { |
| | |
| | | private int stateCommand;//读取状态码 |
| | | private int stateBackCommand;//读取状态返回码 |
| | | private int channelNum;//回路号 |
| | | private int deviceIndex;//序列号 |
| | | private int deviceSubnetID;//设备子网号 |
| | | private int deviceDeviceID;//设备号 |
| | | private int sourceSubnetID;//源子网号 |
| | |
| | | this.channelNum = channelNum; |
| | | } |
| | | |
| | | public int getDeviceIndex() { |
| | | return deviceIndex; |
| | | } |
| | | |
| | | public void setDeviceIndex(int deviceIndex) { |
| | | this.deviceIndex = deviceIndex; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | |
| | | ", stateCommand=" + stateCommand + |
| | | ", stateBackCommand=" + stateBackCommand + |
| | | ", channelNum=" + channelNum + |
| | | ", deviceIndex=" + deviceIndex + |
| | | ", deviceSubnetID=" + deviceSubnetID + |
| | | ", deviceDeviceID=" + deviceDeviceID + |
| | | ", sourceSubnetID=" + sourceSubnetID + |
| | |
| | | ", physicsChannelNum=" + physicsChannelNum + |
| | | ", intCurState=" + intCurState + |
| | | ", deviceKey='" + deviceKey + '\'' + |
| | | ", isGetDeviceStateSuccess=" + isGetDeviceStateSuccess + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | |
| | | public class ListRemarks { |
| | | boolean isCallBack; |
| | | private int sendCount; |
| | | AppliancesInfo appliancesInfo; |
| | | |
| | | public boolean isCallBack() { |
| | |
| | | isCallBack = callBack; |
| | | } |
| | | |
| | | public int getSendCount() { |
| | | return sendCount; |
| | | } |
| | | |
| | | public void setSendCount(int sendCount) { |
| | | this.sendCount = sendCount; |
| | | } |
| | | |
| | | public AppliancesInfo getAppliancesInfo() { |
| | | return appliancesInfo; |
| | | } |
| | |
| | | * @param commandType 命令类型 |
| | | */ |
| | | public static void handle(UdpDataBean getDatas, int commandType) { |
| | | // Log.e("panlili", "commandType=" + Integer.toHexString(commandType) + " sourceSubnetID=" + getDatas.sourceSubnetID + " sourceDeviceID=" + getDatas.sourceDeviceID); |
| | | Log.e("panlili", "commandType=" + Integer.toHexString(commandType) + " sourceSubnetID=" + getDatas.sourceSubnetID + " sourceDeviceID=" + getDatas.sourceDeviceID); |
| | | switch (commandType) { |
| | | case Configuration.SEARCH_GATEWAY_BACK_COMMAND: |
| | | break; |
| | |
| | | * |
| | | * @param getDatas |
| | | */ |
| | | private static void handleSearchData(UdpDataBean getDatas) { |
| | | private static synchronized void handleSearchData(UdpDataBean getDatas) { |
| | | |
| | | DevicesData devicesData = new DevicesData(); |
| | | devicesData.setSourceSubnetID(getDatas.sourceSubnetID); |
| | |
| | | EventBus.getDefault().post(new DiscoverNewDevicesEvent(devicesData)); |
| | | |
| | | //过滤掉背景音乐,背景音乐没有备注返回 |
| | | if (devicesDataList.get(devicesDataList.size() - 1).getAppliancesInfoList().get(0).getBigType() != Configuration.AUDIO_BIG_TYPE) { |
| | | for (int i = 0, len = devicesDataList.get(devicesDataList.size() - 1).getAppliancesInfoList().size(); i < len; i++) { |
| | | if (devicesData.getAppliancesInfoList().get(0).getBigType() != Configuration.AUDIO_BIG_TYPE) { |
| | | for (int i = 0, len = devicesData.getAppliancesInfoList().size(); i < len; i++) { |
| | | ListRemarks listRemarksTemp = new ListRemarks(); |
| | | listRemarksTemp.setCallBack(false); |
| | | listRemarksTemp.setAppliancesInfo(devicesDataList.get(devicesDataList.size() - 1).getAppliancesInfoList().get(i)); |
| | | AppliancesInfo appliancesInfo = devicesData.getAppliancesInfoList().get(i); |
| | | Log.d("panlili", "HDLDeviceManager.java:handleSearchData----->getChannelNum= " + appliancesInfo.getChannelNum() + " getDeviceKey=" + appliancesInfo.getDeviceKey()); |
| | | listRemarksTemp.setAppliancesInfo(appliancesInfo); |
| | | listRemarks.add(listRemarksTemp); |
| | | } |
| | | } |
| | |
| | | for (int appPos = 0, len2 = infos.size(); appPos < len2; appPos++) { |
| | | if ((infos.get(appPos).getDeviceSubnetID()) == (getDatas.addBytes[0] & 0xFF) |
| | | && (infos.get(appPos).getDeviceDeviceID()) == (getDatas.addBytes[1] & 0xFF) |
| | | && ((infos.get(appPos).getChannelNum()) == (getDatas.addBytes[2] & 0xFF)) |
| | | && ((infos.get(appPos).getDeviceIndex()) == (getDatas.addBytes[2] & 0xFF))//序号 |
| | | && (infos.get(appPos).getBigType()) == (getDatas.addBytes[3] & 0xFF) |
| | | && ((infos.get(appPos).getLittleType()) == (getDatas.addBytes[4] & 0xFF))) { |
| | | |
| | |
| | | HDLLog.I("remarkStr获取的备注名为:" + remarkStr); |
| | | devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).setChannelNum(getDatas.addBytes[5] & 0xFF); |
| | | devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).setRemarks(remarkStr); |
| | | // HDLLog.I("getRemarks():" + devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).getRemarks()); |
| | | |
| | | String key = "K" + devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).getBigType() |
| | | + "-" + devicesDataList.get(devPos).getAppliancesInfoList().get(appPos).getLittleType() |
| | |
| | | listRemarksOutter: |
| | | for (int lRPos = 0, len3 = listRemarks.size(); lRPos < len3; lRPos++) { |
| | | //找到F44B对应的设备回路,判断是否已经拿到了数据。 |
| | | |
| | | if (listRemarks.get(lRPos).getAppliancesInfo().getDeviceSubnetID() == (getDatas.addBytes[0] & 0xFF) |
| | | && listRemarks.get(lRPos).getAppliancesInfo().getDeviceDeviceID() == (getDatas.addBytes[1] & 0xFF) |
| | | && listRemarks.get(lRPos).getAppliancesInfo().getChannelNum() == (getDatas.addBytes[2] & 0xFF) |
| | | && listRemarks.get(lRPos).getAppliancesInfo().getDeviceIndex() == (getDatas.addBytes[2] & 0xFF) |
| | | && listRemarks.get(lRPos).getAppliancesInfo().getBigType() == (getDatas.addBytes[3] & 0xFF) |
| | | && listRemarks.get(lRPos).getAppliancesInfo().getLittleType() == (getDatas.addBytes[4] & 0xFF)) { |
| | | |
| | |
| | | } else { |
| | | HDLLog.I("不存在的设备备注,再次搜索备注。设备:子网号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceSubnetID() |
| | | + "设备号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceDeviceID() |
| | | + "回路号" + listRemarks.get(lRPos).getAppliancesInfo().getChannelNum() |
| | | + "序列号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceIndex() |
| | | + "备注:" + listRemarks.get(lRPos).getAppliancesInfo().getRemarks()); |
| | | HandleSearch.getDevRemarks(); |
| | | break listRemarksOutter; |
| | |
| | | } else { |
| | | HDLLog.I("返回备注设备:子网号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceSubnetID() |
| | | + ",设备号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceDeviceID() |
| | | + ",回路号" + listRemarks.get(lRPos).getAppliancesInfo().getChannelNum() |
| | | + ",序列号:" + listRemarks.get(lRPos).getAppliancesInfo().getDeviceIndex() |
| | | + ",备注:" + listRemarks.get(lRPos).getAppliancesInfo().getRemarks()); |
| | | listRemarks.get(lRPos).setCallBack(true); |
| | | HandleSearch.getDevRemarks(); |
| | |
| | | * @param mRemarks 备注 |
| | | * @return Boolean |
| | | */ |
| | | public static boolean addSecurityDevicesManually(int mSubnetID, int mDeviceID, int mChannelNum, String mRemarks) { |
| | | return addDevicesManuallyWithoutSearching(Configuration.SECURITY_BIG_TYPE, 0, mSubnetID, mDeviceID, mChannelNum, mRemarks); |
| | | public static boolean addSecurityDevicesManually(int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mRemarks) { |
| | | return addDevicesManuallyWithoutSearching(Configuration.SECURITY_BIG_TYPE, 0, mSubnetID, mDeviceID, mChannelNum, mIndex, mRemarks); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param mRemarks 备注 |
| | | * @return Boolean |
| | | */ |
| | | public static boolean addAudioDevicesManually(int mSubnetID, int mDeviceID, int mChannelNum, String mRemarks) { |
| | | return addDevicesManuallyWithoutSearching(Configuration.AUDIO_BIG_TYPE, 0, mSubnetID, mDeviceID, mChannelNum, mRemarks); |
| | | public static boolean addAudioDevicesManually(int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mRemarks) { |
| | | return addDevicesManuallyWithoutSearching(Configuration.AUDIO_BIG_TYPE, 0, mSubnetID, mDeviceID, mChannelNum, mIndex, mRemarks); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param mRemarks |
| | | * @return |
| | | */ |
| | | public static boolean addDevicesManuallyWithoutSearchingWithNewDevice(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, String mRemarks) { |
| | | public static boolean addDevicesManuallyWithoutSearchingWithNewDevice(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mRemarks) { |
| | | try { |
| | | DevicesData mDevicesData = DeviceParser.addDevicesManuallyWithoutSearching(mBigType, mLittleType, mSubnetID, mDeviceID, mChannelNum, mRemarks); |
| | | DevicesData mDevicesData = DeviceParser.addDevicesManuallyWithoutSearching(mBigType, mLittleType, mSubnetID, mDeviceID, mChannelNum, mIndex, mRemarks); |
| | | if (mDevicesData != null) { |
| | | devicesDataList.add(mDevicesData); |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | |
| | | * @param mRemarks |
| | | * @return |
| | | */ |
| | | public static boolean addDevicesManuallyWithoutSearching(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, String mRemarks) { |
| | | public static boolean addDevicesManuallyWithoutSearching(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mRemarks) { |
| | | try { |
| | | |
| | | if (!DeviceParser.isWantData(mBigType, mLittleType)) {//判断是否支持的大类小类 |
| | |
| | | DevicesData mDevicesData = devicesDataList.get(i); |
| | | bCanAdd = getIfCanAddDevice(mDevicesData.getAppliancesInfoList(), mBigType, mLittleType, mChannelNum); |
| | | if (bCanAdd) {//添加子网号 设备号 已存在,并且没有相同的子网号设备号 |
| | | AppliancesInfo mAppliancesInfo = DeviceParser.getDevicesInfo(mDevicesData, mBigType, mLittleType, mChannelNum, mRemarks, mRemarks); |
| | | AppliancesInfo mAppliancesInfo = DeviceParser.getDevicesInfo(mDevicesData, mBigType, mLittleType, mChannelNum, mIndex, mRemarks, mRemarks); |
| | | devicesDataList.get(i).getAppliancesInfoList().add(mAppliancesInfo); |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | | HDLLog.I("支持的设备,允许添加"); |
| | |
| | | } |
| | | |
| | | if (!bExistSubnetID) { |
| | | return addDevicesManuallyWithoutSearchingWithNewDevice(mBigType, mLittleType, mSubnetID, mDeviceID, mChannelNum, mRemarks); |
| | | return addDevicesManuallyWithoutSearchingWithNewDevice(mBigType, mLittleType, mSubnetID, mDeviceID, mChannelNum, mIndex, mRemarks); |
| | | } |
| | | |
| | | return bCanAdd; |
| | |
| | | */ |
| | | public class HDLSerialPortCore { |
| | | //串口设备路径名 |
| | | private static String mPathname = "/dev/ttyS4"; |
| | | private static String mPathname = "/dev/ttyS9"; |
| | | //波特率 |
| | | private static int mBaudrate = 115200; |
| | | |
| | |
| | | */ |
| | | public static void init(Context context, String mPathname, int mBaudrate) { |
| | | HDLDeviceManager.init(context); |
| | | HDLDeviceManager.setIsGetBusLightState(false);//根据是否bus网关设置 |
| | | HDLDeviceManager.setIsGetBusLightState(true);//根据是否bus网关设置 |
| | | HDLSerialPortCore.setIsModule(true);//根据是否带模组设置 |
| | | HDLSerialPortCore.initHDLSerialPort(mPathname, mBaudrate); |
| | | } |
| | |
| | | |
| | | import com.hdl.sdk.ttl.Config.Configuration; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.DevicesData; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.ListRemarks; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.RemarkTimes; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.Bean.SearchCountBean; |
| | | import com.hdl.sdk.ttl.HDLDeviceManger.EventBusEvent.DevicesInfoEvent; |
| | |
| | | remarkTimer.cancel(); |
| | | remarkTimer = null; |
| | | } |
| | | |
| | | if ((HDLDeviceManager.listRemarks != null && HDLDeviceManager.listRemarks.size() == 0) || isSearching) { |
| | | isRefreshAllDevicesState = false; |
| | | if (HDLDeviceManager.devicesDataList != null && HDLDeviceManager.devicesDataList.size() > 0) { |
| | |
| | | } |
| | | |
| | | //判断是否获取设备备注完全,若完全则返回所有设备列表。 |
| | | if (HDLDeviceManager.listRemarks != null && HDLDeviceManager.listRemarks.size() != 0 && pos == -1) { |
| | | if (pos == -1) { |
| | | if (!isRefreshAllDevicesState) { |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | | } else { |
| | |
| | | isRefreshAllDevicesState = false; |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | remarkTimer = new Timer(); |
| | | final int newPos = pos; |
| | | final RemarkTimes remarkTimes = new RemarkTimes(); |
| | | remarkTimes.setCount(0); |
| | | |
| | | if (remarkTimer == null) { |
| | | return; |
| | | } |
| | | ListRemarks listRemark = HDLDeviceManager.listRemarks.get(newPos); |
| | | remarkTimer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | if (remarkTimes.getCount() < 1) { |
| | | remarkTimes.setCount(remarkTimes.getCount() + 1); |
| | | listRemark.setSendCount(listRemark.getSendCount() + 1); |
| | | if (listRemark.getSendCount() < 3 && !listRemark.isCallBack()) { |
| | | if (newPos < HDLDeviceManager.listRemarks.size()) { |
| | | HDLLog.I("----->发送获取备注命令。共" + HDLDeviceManager.listRemarks.size() + "个模块。第" |
| | | + newPos + "个模块。第 " + (HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getChannelNum()) |
| | | + " 回路,子网号:" + HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getDeviceSubnetID() |
| | | + ",设备号:" + HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getDeviceDeviceID() |
| | | + " 第 " + remarkTimes.getCount() + " 次"); |
| | | HDLLog.I("----->发送获取备注命令。共" + HDLDeviceManager.listRemarks.size() + "个,第" |
| | | + newPos + "个模块。第 " + (listRemark.getAppliancesInfo().getDeviceIndex()) |
| | | + " 序号,子网号:" + listRemark.getAppliancesInfo().getDeviceSubnetID() |
| | | + ",设备号:" + listRemark.getAppliancesInfo().getDeviceDeviceID() |
| | | + " 第 " + listRemark.getSendCount() + " 次"); |
| | | HDLCommand.cusSendCommand(Configuration.DEVICES_READ_FROM_GATEWAY_COMMAND, |
| | | HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getSourceSubnetID() |
| | | , HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getSourceDeviceID(), |
| | | listRemark.getAppliancesInfo().getSourceSubnetID() |
| | | , listRemark.getAppliancesInfo().getSourceDeviceID(), |
| | | new byte[]{ |
| | | (byte) HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getDeviceSubnetID(), |
| | | (byte) HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getDeviceDeviceID(), |
| | | (byte) HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getChannelNum(), |
| | | (byte) HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getBigType(), |
| | | (byte) HDLDeviceManager.listRemarks.get(newPos).getAppliancesInfo().getLittleType(), |
| | | (byte) listRemark.getAppliancesInfo().getDeviceSubnetID(), |
| | | (byte) listRemark.getAppliancesInfo().getDeviceDeviceID(), |
| | | (byte) listRemark.getAppliancesInfo().getDeviceIndex(), |
| | | (byte) listRemark.getAppliancesInfo().getBigType(), |
| | | (byte) listRemark.getAppliancesInfo().getLittleType(), |
| | | }); |
| | | } |
| | | } else { |
| | | |
| | | if (HDLDeviceManager.listRemarks != null |
| | | && HDLDeviceManager.listRemarks.size() != 0 |
| | | && newPos < HDLDeviceManager.listRemarks.size()) { |
| | | HDLDeviceManager.listRemarks.get(newPos).setCallBack(true); |
| | | if (!listRemark.isCallBack()) { |
| | | HDLLog.I("----->获取备注命令超时 第 " + (listRemark.getAppliancesInfo().getDeviceIndex()) + " 序号,子网号:" + listRemark.getAppliancesInfo().getDeviceSubnetID() + ",设备号:" + listRemark.getAppliancesInfo().getDeviceDeviceID()); |
| | | } |
| | | listRemark.setCallBack(true); |
| | | getDevRemarks(); |
| | | } |
| | | } |
| | |
| | | |
| | | curCount++; |
| | | int curChannelNum = 0; |
| | | int index = 0; |
| | | while (curChannelNum < channelNum) { |
| | | curChannelNum++; |
| | | curChannelNum++;//有可能不是从1开始的,所以增加index判断 |
| | | index++; |
| | | if (isWantData(bigType, littleType)) { |
| | | AppliancesInfo appliancesInfo = new AppliancesInfo(); |
| | | appliancesInfo.setDeviceSubnetID(subnetID); |
| | |
| | | /**根据类别,赋值操作码等一些重要信息*/ |
| | | switch (bigType) { |
| | | case Configuration.LIGTH_BIG_TYPE: |
| | | parseLightData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseLightData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.CURTAIN_BIG_TYPE: |
| | | parseCurtainData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseCurtainData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.AIR_BIG_TYPE: |
| | | parseAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.AUDIO_BIG_TYPE: |
| | | parseAudioData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseAudioData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.LOGIC_BIG_TYPE: |
| | | parseLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.GLOBAL_LOGIC_BIG_TYPE: |
| | | parseGlobalLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseGlobalLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.SECURITY_BIG_TYPE://2019-7-29 新增 |
| | | parseSecurityData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseSecurityData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.SENSOR_BIG_TYPE: |
| | | parseSensorData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseSensorData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.COMMON_SWITCH_BIG_TYPE://2020-04-01 通用开关 |
| | | parseCommonSwitchData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseCommonSwitchData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.FRESH_AIR_BIG_TYPE://2020-07-20 新增新风 |
| | | parseFreshAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseFreshAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.GEOTHERMAL_BIG_TYPE://地热 |
| | | parseGeothermalData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseGeothermalData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.DOOR_MACHINE_BIG_TYPE://门锁 |
| | | parseDoorMachineData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseDoorMachineData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | default: |
| | | // appliancesInfo.setDeviceName(Configuration.UNKNOW_TYPE); |
| | |
| | | } |
| | | |
| | | |
| | | private static void parseLightData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseLightData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("调光回路"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.LIGTH_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private static void parseCurtainData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseCurtainData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("开合帘电机"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.CURTAIN_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setCtrlCommand(Configuration.CURTAIN_CTRL_COMMAND); |
| | |
| | | } |
| | | } |
| | | |
| | | private static void parseAirData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseAirData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("HVAC 模块"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.AIR_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | } |
| | | } |
| | | |
| | | private static void parseAudioData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseAudioData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("背景音乐模块"); |
| | |
| | | |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.AUDIO_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setCtrlCommand(Configuration.AUDIO_CTRL_READ_COMMAND); |
| | |
| | | HDLLog.I("音乐模块:" + parentRemarks); |
| | | } |
| | | |
| | | private static void parseLogicData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseLogicData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("逻辑模块"); |
| | |
| | | |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.LOGIC_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setCtrlCommand(Configuration.LOGIC_CTRL_COMMAND); |
| | |
| | | } |
| | | } |
| | | |
| | | private static void parseGlobalLogicData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseGlobalLogicData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("全局逻辑模块"); |
| | |
| | | |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.GLOBAL_LOGIC_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setCtrlCommand(Configuration.LOGIC_CTRL_COMMAND); |
| | |
| | | * @param port |
| | | * @param ipAddress |
| | | */ |
| | | private static void parseSecurityData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseSecurityData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("安防模块"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.SECURITY_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | |
| | | |
| | | // 2019-07-03 屏蔽 2019-11-5 传感器都改为干接点实现 |
| | | private static void parseSensorData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int curChannelNum, int port, String ipAddress) { |
| | | private static void parseSensorData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("传感器 干结点"); |
| | |
| | | |
| | | |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(curChannelNum); |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.SENSOR_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | |
| | |
| | | * 2020-07-20 |
| | | * 新风系统 |
| | | */ |
| | | private static void parseFreshAirData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseFreshAirData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("新风系统模块"); |
| | |
| | | |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.FRESH_AIR_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | /** |
| | | * 地热 |
| | | */ |
| | | private static void parseGeothermalData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseGeothermalData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("地热模块"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.GEOTHERMAL_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | /** |
| | | * 门锁 |
| | | */ |
| | | private static void parseDoorMachineData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseDoorMachineData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 4: |
| | | appliancesInfo.setDeviceName("门锁模块"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.DOOR_MACHINE_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | * @param port |
| | | * @param ipAddress |
| | | */ |
| | | private static void parseCommonSwitchData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int port, String ipAddress) { |
| | | private static void parseCommonSwitchData(int littleType, AppliancesInfo appliancesInfo, DevicesData devicesData, String parentRemarks, int channelNum, int index, String ipAddress) { |
| | | switch (littleType) { |
| | | case 0: |
| | | appliancesInfo.setDeviceName("通用开关"); |
| | |
| | | } |
| | | if (devicesData != null) { |
| | | appliancesInfo.setChannelNum(channelNum); |
| | | appliancesInfo.setDeviceIndex(index); |
| | | appliancesInfo.setBigType(Configuration.COMMON_SWITCH_BIG_TYPE); |
| | | appliancesInfo.setLittleType(littleType); |
| | | appliancesInfo.setSourceSubnetID(devicesData.getSourceSubnetID()); |
| | |
| | | * @param mRemarks |
| | | * @return |
| | | */ |
| | | public static DevicesData addDevicesManuallyWithoutSearching(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, String mRemarks) { |
| | | public static DevicesData addDevicesManuallyWithoutSearching(int mBigType, int mLittleType, int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mRemarks) { |
| | | boolean bWantData = false; |
| | | DevicesData mDevicesData = new DevicesData(); |
| | | mDevicesData.setSourceSubnetID(mSubnetID); |
| | |
| | | List<AppliancesInfo> appliancesInfoList = new ArrayList<>(); |
| | | if (isWantData(mBigType, mLittleType)) { |
| | | bWantData = true; |
| | | AppliancesInfo appliancesInfo = getDevicesInfo(mDevicesData, mBigType, mLittleType, mChannelNum, mRemarks, mRemarks); |
| | | AppliancesInfo appliancesInfo = getDevicesInfo(mDevicesData, mBigType, mLittleType, mChannelNum, mIndex, mRemarks, mRemarks); |
| | | |
| | | appliancesInfoList.add(appliancesInfo); |
| | | // HDLLog.I( "向模块添加回路:"+"大类:" + mBigType + " 小类:" + mLittleType +" 模块备注" + mRemarks ); |
| | |
| | | List<AppliancesInfo> appliancesInfoList = new ArrayList<>(); |
| | | if (isWantData(bigType, littleType)) { |
| | | for (int i = 0; i < parentRemarksList.size(); i++) { |
| | | appliancesInfoList.add(getDevicesInfo(devicesData, bigType, littleType, i + 1, parentRemarks, parentRemarksList.get(i))); |
| | | appliancesInfoList.add(getDevicesInfo(devicesData, bigType, littleType, i + 1, i+1, parentRemarks, parentRemarksList.get(i))); |
| | | } |
| | | bWantData = true; |
| | | |
| | |
| | | return devicesData; |
| | | } |
| | | |
| | | public static AppliancesInfo getDevicesInfo(DevicesData devicesData, int bigType, int littleType, int curChannelNum, String parentRemarks, String mRemarks) { |
| | | public static AppliancesInfo getDevicesInfo(DevicesData devicesData, int bigType, int littleType, int curChannelNum, int index, String parentRemarks, String mRemarks) { |
| | | AppliancesInfo appliancesInfo = new AppliancesInfo(); |
| | | /**根据类别,赋值操作码等一些重要信息*/ |
| | | switch (bigType) { |
| | | case Configuration.LIGTH_BIG_TYPE: |
| | | parseLightData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseLightData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.CURTAIN_BIG_TYPE: |
| | | parseCurtainData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseCurtainData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.AIR_BIG_TYPE: |
| | | parseAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.AUDIO_BIG_TYPE: |
| | | parseAudioData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseAudioData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.LOGIC_BIG_TYPE: |
| | | parseLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.GLOBAL_LOGIC_BIG_TYPE: |
| | | parseGlobalLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseGlobalLogicData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.SECURITY_BIG_TYPE://2019-7-29 新增 |
| | | parseSecurityData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseSecurityData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.SENSOR_BIG_TYPE: |
| | | parseSensorData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseSensorData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.COMMON_SWITCH_BIG_TYPE://2020-04-01 通用开关 |
| | | parseCommonSwitchData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseCommonSwitchData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.FRESH_AIR_BIG_TYPE://2020-07-20 新增新风 |
| | | parseFreshAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseFreshAirData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.GEOTHERMAL_BIG_TYPE://2020-07-20 地热 |
| | | parseGeothermalData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseGeothermalData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | case Configuration.DOOR_MACHINE_BIG_TYPE://2023-08-22 门锁 |
| | | parseDoorMachineData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, 0, ""); |
| | | parseDoorMachineData(littleType, appliancesInfo, devicesData, parentRemarks, curChannelNum, index, ""); |
| | | break; |
| | | default: |
| | | // appliancesInfo.setDeviceName(Configuration.UNKNOW_TYPE); |
| | |
| | | + "-" + appliancesInfo.getDeviceSubnetID() |
| | | + "-" + appliancesInfo.getDeviceDeviceID() |
| | | + "-" + appliancesInfo.getChannelNum(); |
| | | appliancesInfo.setRemarks(mRemarks); |
| | | // appliancesInfo.setRemarks(mRemarks); |
| | | HDLLog.I("---getDevicesInfo getRemarks():" + appliancesInfo.getRemarks()); |
| | | appliancesInfo.setDeviceKey(key);//2019-8-2 添加唯一标识key |
| | | return appliancesInfo; |
| | | |
| | |
| | | * @param parentRemarks |
| | | * @return |
| | | */ |
| | | public static DevicesData addDevicesListWithoutSearching(int bigType, int littleType, int mSubnetID, int mDeviceID, int mChannelNum, String mChannelRemark, String parentRemarks) { |
| | | public static DevicesData addDevicesListWithoutSearching(int bigType, int littleType, int mSubnetID, int mDeviceID, int mChannelNum, int mIndex, String mChannelRemark, String parentRemarks) { |
| | | // boolean bWantData = false; |
| | | if (isWantData(bigType, littleType)) { |
| | | DevicesData devicesData = new DevicesData(); |
| | |
| | | |
| | | |
| | | if (isFindDevicesData) { |
| | | AppliancesInfo mAppliancesInfo = getDevicesInfo(devicesData, bigType, littleType, mChannelNum, parentRemarks, mChannelRemark); |
| | | AppliancesInfo mAppliancesInfo = getDevicesInfo(devicesData, bigType, littleType, mChannelNum, mIndex, parentRemarks, mChannelRemark); |
| | | devicesDataList.get(index).getAppliancesInfoList().add(mAppliancesInfo); |
| | | devicesData = devicesDataList.get(index); |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | | } else { |
| | | List<AppliancesInfo> appliancesInfoList = new ArrayList<>(); |
| | | appliancesInfoList.add(getDevicesInfo(devicesData, bigType, littleType, mChannelNum, parentRemarks, mChannelRemark)); |
| | | appliancesInfoList.add(getDevicesInfo(devicesData, bigType, littleType, mChannelNum, mIndex, parentRemarks, mChannelRemark)); |
| | | devicesData.setAppliancesInfoList(appliancesInfoList); |
| | | devicesDataList.add(devicesData); |
| | | HandleSearch.OnDeviceListGetSuccessCallBack(); |
| | |
| | | */ |
| | | public class HDLApplication extends Application { |
| | | |
| | | public static final String HDL_UART_PATH = "/dev/ttyS4"; //串口设备路径名 |
| | | public static final String HDL_UART_PATH = "/dev/ttyS9"; //串口设备路径名 |
| | | public static final int HDL_BAUDRATE = 115200; //波特率 |
| | | |
| | | @Override |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | android:hint="回路号" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_index" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_marginTop="10dp" |
| | | android:inputType="number" |
| | | android:maxLength="3" |
| | | android:text="1" |
| | | android:hint="序列号" |
| | | /> |
| | | <EditText |
| | | android:id="@+id/et_remarks" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |