| | |
| | | Short[] values2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| | | List<Short> state = new ArrayList<>(Arrays.asList(values2)); |
| | | |
| | | Boolean[] values = { false, true, true, true, true, true, true, true, true, |
| | | true, true, true, true, true, true, true, true, true, true, true, true, true, true, |
| | | true, false, true }; |
| | | List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values)); |
| | | // Boolean[] values = { false, true, true, true, true, true, true, true, true, |
| | | // true, true, true, true, true, true, true, true, true, true, true, true, true, |
| | | // true, |
| | | // true, false, true }; |
| | | // List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values)); |
| | | |
| | | short[] sholist = new short[paramlist.size()]; |
| | | // short[] sholist = new short[paramlist.size()]; |
| | | |
| | | for (int i = 0; i < paramlist.size(); i++) { |
| | | boolean value = paramlist.get(i); |
| | | sholist[i] = value ? (short) 1 : (short) 0; |
| | | } |
| | | // for (int i = 0; i < paramlist.size(); i++) { |
| | | // boolean value = paramlist.get(i); |
| | | // sholist[i] = value ? (short) 1 : (short) 0; |
| | | // } |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5} |
| | |
| | | |
| | | jsonObject.append("params", arraylist); |
| | | jsonObject.append("state", state); |
| | | jsonObject.append("action", sholist); |
| | | // jsonObject.append("action", sholist); |
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter"); |
| | | if (sendwServer != null) { |
| | | sendwServer.sendMessage(jsonObject.toString()); |