Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
4d992ecc22
@ -21,7 +21,7 @@ public class TerminalMessageEventHandler implements EventHandler<TerminalMessage
|
||||
private ConcurrentHashMap<String, CompletableFuture<TerminalMessage>> callbackMap = new ConcurrentHashMap<>(16);
|
||||
@Override
|
||||
public void onEvent(TerminalMessage terminalMessage, long sequence, boolean endOfBatch) throws Exception {
|
||||
log.info("收到消息: {}", terminalMessage.toJsonString());
|
||||
// log.info("收到消息: {}", terminalMessage.toJsonString());
|
||||
if (callbackMap.containsKey(terminalMessage.getCmdId())){
|
||||
//如果是回调函数,推送到回调函数
|
||||
callbackMap.get(terminalMessage.getCmdId()).complete(terminalMessage);
|
||||
|
@ -59,7 +59,6 @@ public class NodeMessageHandler extends TextWebSocketHandler {
|
||||
String cmd = msg.getCmd();
|
||||
JsonNode data = msg.getData();
|
||||
log.info("收到 Node:{} 命令: {}", nodeId, cmd);
|
||||
log.debug("内容: {}", data.toString());
|
||||
if (dataService == null){
|
||||
dataService = SpringUtil.getBean(DataService.class);
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
`/das` - 系统根目录
|
||||
|
||||
`/das/install` - 系统安装包存放目录
|
||||
|
||||
`/das/data` - 系统数据目录
|
||||
|
||||
`/das/data/tddata` - TDEngine3数据目录
|
||||
|
BIN
docs/deploy/asserts/image-1.png
Normal file
BIN
docs/deploy/asserts/image-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
BIN
docs/deploy/asserts/image.png
Normal file
BIN
docs/deploy/asserts/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
docs/deploy/asserts/image1.png
Normal file
BIN
docs/deploy/asserts/image1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
docs/deploy/asserts/image2.png
Normal file
BIN
docs/deploy/asserts/image2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -2,3 +2,62 @@
|
||||
|
||||
> 当前版本: 3.3.2.0
|
||||
|
||||
## 安装包确认
|
||||
|
||||
请确认安装包是否已经在`/das/install`目录下
|
||||
|
||||
`TDengine-server-3.3.2.0-Linux-x64.tar.gz` - TDEngine 3.3.2.0 官方安装包
|
||||
|
||||
`td3.3.2.13_openeuler_patch.tar.gz` - TDEngine 3.3.2.13 OpenEuler补丁包
|
||||
|
||||
## TDEngine3安装
|
||||
|
||||
1. 先解压TDEngine3官方安装包
|
||||
|
||||
```shell
|
||||
cd /das/install/
|
||||
|
||||
tar zxvf TDengine-server-3.3.2.0-Linux-x64.tar.gz
|
||||
```
|
||||
|
||||
2. 运行安装脚本
|
||||
|
||||
```shell
|
||||
cd TDengine-server-3.3.2.0
|
||||
|
||||
./install.sh
|
||||
```
|
||||
|
||||

|
||||
|
||||
这里输入服务器的IP地址。
|
||||
|
||||

|
||||
|
||||
这里直接回车即可。
|
||||
|
||||

|
||||
|
||||
继续回车。
|
||||
|
||||

|
||||
|
||||
看到上图的内容,TDEngine官方安装包就安装完毕了,下面运行补丁。
|
||||
|
||||
```shell
|
||||
cd /das/install
|
||||
|
||||
tar zxvf td3.3.2.13_openeuler_patch.tar.gz
|
||||
```
|
||||
|
||||
执行补丁脚本
|
||||
|
||||
```shell
|
||||
cd patch
|
||||
|
||||
./apply_patch.sh
|
||||
```
|
||||
|
||||
> PS. 此脚本会更改TDEngine的默认数据目录为/das/data/tddata
|
||||
|
||||
这样就完成了TDEngine3.3.2.13的安装。
|
@ -1,8 +1,16 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
export const sendValueReq = (data: any) => {
|
||||
export const sendValue146Req = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/api/node/link/deviceControl',
|
||||
url: '/api/node/link/setPoint',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
export const sendValue147Req = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/api/node/link/command',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="controlPage" v-loading="loading" element-loading-text="提交中...">
|
||||
<h1 class="pageName">遥调遥控调试</h1>
|
||||
<div class="control">
|
||||
<el-form :model="serviceType147Form" :rules="validData(147)" ref="serviceType147Ref">
|
||||
<el-form :model="serviceType147Form" :rules="validData147" ref="serviceType147Ref">
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<div class="title">遥控</div>
|
||||
@ -35,7 +35,7 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<br />
|
||||
<el-form :model="serviceType146Form" :rules="validData(146)" ref="serviceType146Ref">
|
||||
<el-form :model="serviceType146Form" :rules="validData146" ref="serviceType146Ref">
|
||||
<el-row>
|
||||
<el-col :span="2">
|
||||
<div class="title">遥调</div>
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { sendValueReq } from '/@/api/backend/control/request'
|
||||
import { sendValue146Req, sendValue147Req } from '/@/api/backend/control/request'
|
||||
import { ElMessage, FormInstance } from 'element-plus'
|
||||
import { getModelServiceListReq } from '/@/api/backend/deviceModel/request'
|
||||
|
||||
@ -95,8 +95,6 @@ const loading = ref(false)
|
||||
const serviceType147Ref = ref<FormInstance>()
|
||||
const serviceType146Ref = ref<FormInstance>()
|
||||
const serviceType147Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
@ -104,8 +102,6 @@ const serviceType147Form = ref({
|
||||
})
|
||||
|
||||
const serviceType146Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
@ -131,70 +127,87 @@ const init = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const validData = (type: number) => {
|
||||
if (type === 147) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择操作值',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
}
|
||||
} else if (type === 146) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入操作值',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9]+$/,
|
||||
message: '请输入数字',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
const validData147 = {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择操作值',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const validData146 = {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入操作值',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9]+(\.[0-9]+)?$/,
|
||||
message: '请输入数字',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const submit = (type: number) => {
|
||||
if (type === 147) {
|
||||
serviceType147Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType147Form.value)
|
||||
sendValue147(serviceType147Form.value)
|
||||
}
|
||||
})
|
||||
} else if (type === 146) {
|
||||
serviceType146Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType146Form.value)
|
||||
sendValue146(serviceType146Form.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const sendValue = (data: any) => {
|
||||
const sendValue146 = (data: any) => {
|
||||
const val = JSON.parse(JSON.stringify(data))
|
||||
val.deviceId = props.deviceId
|
||||
sendValueReq(val)
|
||||
console.log(val, 146)
|
||||
|
||||
sendValue146Req(val)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
ElMessage.success('发送成功!')
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error('发送失败!')
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const sendValue147 = (data: any) => {
|
||||
const val = JSON.parse(JSON.stringify(data))
|
||||
val.deviceId = props.deviceId
|
||||
console.log(val, 147)
|
||||
|
||||
sendValue147Req(val)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
ElMessage.success('发送成功!')
|
||||
@ -226,12 +239,10 @@ watch(
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
serviceType147Form.value = {
|
||||
nodeId: '1',
|
||||
serviceName: '',
|
||||
opValue: null,
|
||||
}
|
||||
serviceType146Form.value = {
|
||||
nodeId: '1',
|
||||
serviceName: '',
|
||||
opValue: null,
|
||||
}
|
||||
|
@ -218,7 +218,6 @@ watch(
|
||||
if (newVal) {
|
||||
if (!autoUpdateTimer) {
|
||||
autoUpdateTimer = setInterval(() => {
|
||||
console.log('刷新')
|
||||
getCompleteData()
|
||||
}, 2000)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user