接收工控机状态

This commit is contained in:
zhangjunwen 2024-06-04 09:27:38 +08:00
parent 43b6757722
commit 03461081fb
3 changed files with 184 additions and 57 deletions

View File

@ -418,6 +418,9 @@ public class IpcDataProcess implements Runnable {
fields.put("opr_bottom_dis", results.getValue(26));
//传动侧底缸位移
fields.put("driven_bottom_dis", results.getValue(27));
//工控机参数
fields.put("ipc_status", results.getValue(300));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则
@ -518,6 +521,8 @@ public class IpcDataProcess implements Runnable {
// 十一压区流量
fields.put("flw11", results.getValue(53));
//工控机参数
fields.put("ipc_status", results.getValue(301));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则
@ -616,7 +621,8 @@ public class IpcDataProcess implements Runnable {
fields.put("flw10", results.getValue(88));
// 十一压区流量
fields.put("flw11", results.getValue(89));
//工控机参数
fields.put("ipc_status", results.getValue(302));
//报警处理
List<IpcAlarmRules> rulesList = alarmRulesService.selectIpcAlarmRulesConfigListByCache(equipId);
alarmRecordList.addAll(ipcUtil.dealRealTimeData(fields, tags, Constant.RUNNING, rulesList));//TODO 根据运行状态确定规则

View File

@ -55,6 +55,7 @@ public class DataQueryService implements IDataQueryService {
resMap.put("systemp",list.get(0).get("sys_temp") == null ? 0.0 : list.get(0).get("sys_temp"));//系统温度
resMap.put("syshumid",list.get(0).get("oil_water") == null ? 0.0 : list.get(0).get("oil_water"));//系统湿度
resMap.put("sysvisc",list.get(0).get("visc") == null ? 0.0 : list.get(0).get("visc"));//系统粘度
resMap.put("visctemp",list.get(0).get("visc_temp") == null ? 0.0 : list.get(0).get("visc_temp"));//系统粘度温度
//系统颗粒度
resMap.put("sysgran4",list.get(0).get("gran4") == null ? 0.0 : list.get(0).get("gran4"));
@ -78,6 +79,8 @@ public class DataQueryService implements IDataQueryService {
double pressure = (double)resMap.get("sysprs") == 0 ? 0.0 : (double)resMap.get("sysprs");
resMap.put("syseff",power == 0 ? 0.0 : pressure * sysflw/power*100);
resMap.put("ipcstatus", list.get(0).get("ipc_status") == null ? 0 : list.get(0).get("ipc_status"));
List<Object> syscur = new ArrayList<>();//系统电流
List<Object> oprsoftflw = new ArrayList<>();//操作侧软辊流量
@ -232,11 +235,13 @@ public class DataQueryService implements IDataQueryService {
List<Object> columnList = new ArrayList<>();
List<String> timelist = new ArrayList<>();
List<Integer> statusList = new ArrayList<>();
if(intervalHours > 6){
columnName = "mean";
}
for (Map<String, Object> data : list) {
columnList.add(data.get(columnName));
statusList.add((Integer) data.get("ipc_status"));
LocalDateTime time = InfluxdbTimeUtil.utcToCst(data.get("time").toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
timelist.add(time.format(formatter));
@ -244,7 +249,7 @@ public class DataQueryService implements IDataQueryService {
resMap.put("y", columnList);
resMap.put("x", timelist);
resMap.put("status", statusList);
return resMap;
}
@ -389,7 +394,7 @@ public class DataQueryService implements IDataQueryService {
* @return 数据
*/
private List<Map<String, Object>> selectDataByColumnNameandDate(String tableName, String columnName, String startTime, String endTime){
String sql = "select time," + columnName + " from " + tableName + " where time >= '" + startTime + "' and time <= '" + endTime + "'";
String sql = "select time," + columnName + ",ipc_status from " + tableName + " where time >= '" + startTime + "' and time <= '" + endTime + "'";
return influxDBUtils.queryResultProcess(influxDBUtils.query(sql));
}
@ -398,7 +403,7 @@ public class DataQueryService implements IDataQueryService {
* @return
*/
private List<Map<String, Object>> selectLongTimeDataByColumnNameandDate(String tableName, String columnName, String startTime, String endTime, String interval){
String sql = "select time, mean(" + columnName + ") from " + tableName + " where time >= '" + startTime + "' and time <= '" + endTime + "' group by time(" + interval +")";
String sql = "select time, ipc_status, mean(" + columnName + ") from " + tableName + " where time >= '" + startTime + "' and time <= '" + endTime + "' group by time(" + interval +")";
return influxDBUtils.queryResultProcess(influxDBUtils.query(sql));
}
@ -421,7 +426,7 @@ public class DataQueryService implements IDataQueryService {
resMap.put("systemp",list.get(0).get("sys_temp") == null ? 0.0 : (double) list.get(0).get("sys_temp"));//系统温度
resMap.put("syshumid",list.get(0).get("oil_water") == null ? 0.0 : (double) list.get(0).get("oil_water"));//系统湿度
resMap.put("sysvisc",list.get(0).get("visc") == null ? 0.0 : (double) list.get(0).get("visc"));//系统粘度
resMap.put("visctemp",list.get(0).get("visc_temp") == null ? 0.0 : list.get(0).get("visc_temp"));//系统粘度温度
//系统颗粒度
resMap.put("sysgran4",list.get(0).get("gran4") == null ? 0.0 : (double) list.get(0).get("gran4"));
resMap.put("sysgran6",list.get(0).get("gran6") == null ? 0.0 : (double) list.get(0).get("gran6"));
@ -438,6 +443,8 @@ public class DataQueryService implements IDataQueryService {
double pressure = (double)resMap.get("sysprs");
resMap.put("syseff",power == 0 ? 0.0 : pressure * sysflw/power);
resMap.put("ipcstatus", list.get(0).get("ipc_status") == null ? 0 : list.get(0).get("ipc_status"));//工控机状态
List<Object> syscur = new ArrayList<>();//系统电流
List<Object> flw1 = new ArrayList<>();//一区流量

View File

@ -458,7 +458,7 @@
<el-main class="main">
<el-row style="height: 40%">
<el-col
:span="12"
:span="8"
style="height: 100%;"
>
<div
@ -469,7 +469,18 @@
></div>
</el-col>
<el-col
:span="12"
:span="8"
style="height: 100%;"
>
<div
id="cyldlndtemp"
style="width: 100%;height: 100%;cursor:pointer;"
@click="trendClick('visc_temp'
,'温度','')"
></div>
</el-col>
<el-col
:span="8"
style="height: 100%"
>
<div
@ -1297,7 +1308,7 @@
<el-main class="main">
<el-row style="height: 40%">
<el-col
:span="12"
:span="8"
style="height: 100%"
>
<div
@ -1308,7 +1319,18 @@
></div>
</el-col>
<el-col
:span="12"
:span="8"
style="height: 100%"
>
<div
id="dlndtemp"
style="width: 100%;height: 100%;cursor:pointer"
@click="trendClick('visc_temp'
,'温度','')"
></div>
</el-col>
<el-col
:span="8"
style="height: 100%"
>
<div
@ -2138,7 +2160,7 @@
<el-main class="main">
<el-row style="height: 40%">
<el-col
:span="12"
:span="8"
style="height: 100%"
>
<div
@ -2149,7 +2171,18 @@
></div>
</el-col>
<el-col
:span="12"
:span="8"
style="height: 100%"
>
<div
id="bsdlndtemp"
style="width: 100%;height: 100%;cursor:pointer;"
@click="trendClick('visc_temp'
,'温度','')"
></div>
</el-col>
<el-col
:span="8"
style="height: 100%"
>
<div
@ -2619,6 +2652,7 @@ export default {
cylyykld21: 0,
// 湿
cyldlndCharts: null,
cyldlndtempCharts: null,
cylxdsdCharts: null,
//
intervalTask: null,
@ -2634,6 +2668,7 @@ export default {
cdcdgwytxCharts: null,
czcdgwytxCharts: null,
dlndCharts: null,
dlndtempCharts: null,
yykldtxCharts: null,
xdsdCharts: null,
//
@ -2700,6 +2735,7 @@ export default {
bszdjdl: 0,
// 湿
bsdlndCharts: null,
bsdlndtempCharts: null,
bsxdsdCharts: null,
//
@ -2829,6 +2865,11 @@ export default {
const oneHoursAgo = new Date(now.getTime() - 1 * 60 * 60 * 1000);
return [this.formatDateTime(oneHoursAgo), this.formatDateTime(now)];
},
getTimeRangeByHours(h) {
const now = new Date();
const hoursAgo = new Date(now.getTime() - h * 60 * 60 * 1000);
return [this.formatDateTime(hoursAgo), this.formatDateTime(now)];
},
formatDateTime(date) {
return (
date.getFullYear() +
@ -2847,10 +2888,19 @@ export default {
padZero(num) {
return num < 10 ? "0" + num : num;
},
handleQuery() {
handleQuery(key) {
this.loading = true;
if (this.datetime == null) {
this.datetime = this.getDefaultTimeRange();
if (key != null) {
if (
key === "driven_soft_flw" ||
key === "driven_hot_flw" ||
key === "opr_soft_flw" ||
key === "opr_hot_flw"
) {
this.datetime = this.getTimeRangeByHours(5);
} else {
this.datetime = this.getDefaultTimeRange();
}
}
let startTime = new Date(this.datetime[0]);
this.queryParams.startTime = this.formatDateTime(startTime);
@ -3066,7 +3116,7 @@ export default {
this.unit = unit;
this.queryParams.columnName = key;
// this.initchart([], [], "", "");
this.handleQuery();
this.handleQuery(key);
},
queryAlarmRecordData(equipId) {
let query = {
@ -3429,7 +3479,7 @@ export default {
bgColor: "023E44",
name: "系统压力",
value: this.bsxtyl,
limit: 0.8,
limit: 250,
unit: "bar",
}),
true,
@ -3447,7 +3497,7 @@ export default {
bgColor: "0D3F62",
name: "系统液温",
value: this.xtyw,
limit: 0.8,
limit: 200,
unit: "℃",
}),
true,
@ -3459,7 +3509,7 @@ export default {
const xtywei = document.getElementById("bsxtywei"); //
this.bsxtyweiCharts = echarts.init(xtywei);
let yMax = 1;
let yMax = 1500;
let option = {
grid: {
bottom: "20%",
@ -3524,7 +3574,7 @@ export default {
bgColor: "023953",
name: "泵输出流量",
value: this.bszbscll,
limit: 0.8,
limit: 200,
unit: "L/min",
}),
true,
@ -3542,7 +3592,7 @@ export default {
bgColor: "2C2864",
name: "输出效率",
value: this.bsscxl,
limit: 0.8,
limit: 100,
unit: "%",
}),
true,
@ -3560,7 +3610,7 @@ export default {
bgColor: "373341",
name: "主电机实际功率",
value: this.bszdjsjgl,
limit: 0.8,
limit: 60,
unit: "KW",
}),
true,
@ -3597,7 +3647,7 @@ export default {
// data: this.XDATA,
// },
// ],
yAxis: { name: "P (bar)" },
yAxis: { name: "P (bar)", min: 0, max: 210 },
tooltip: {
trigger: "axis",
axisPointer: {
@ -3700,7 +3750,7 @@ export default {
this.bszdjdlCharts = echarts.init(zdjdl);
this.bszdjdlCharts.setOption(
this.generateOptions({
yAxis: { name: "I(A)" },
yAxis: { name: "I(A)", min: 0, max: 100 },
grid: {
left: "10%",
top: "12%",
@ -3750,7 +3800,7 @@ export default {
// data: this.XDATA,
// },
// ],
yAxis: { name: "Q (L/min)" },
yAxis: { name: "Q (L/min)", min: 0, max: 30 },
tooltip: {
trigger: "axis",
axisPointer: {
@ -3866,7 +3916,7 @@ export default {
yAxis: {
name: "PM",
min: 0,
max: 1,
max: 26,
interval: 0.2, //
},
series: [
@ -3906,7 +3956,7 @@ export default {
bgColor: "87a6a8",
name: "粘度",
value: parseFloat(this.showdata.sysvisc).toFixed(2),
limit: 0.8,
limit: 200,
unit: "mm2/s",
}),
true,
@ -3915,6 +3965,24 @@ export default {
window.addEventListener("resize", () => {
this.bsdlndCharts && this.bsdlndCharts.resize();
});
//
const dlndtemp = document.getElementById("bsdlndtemp"); //
this.bsdlndtempCharts = echarts.init(dlndtemp);
this.bsdlndtempCharts.setOption(
this.generateGaugeOption2({
color: ["00F28D", "00FFDD", "00BFFF"],
bgColor: "87a6a8",
name: "温度",
value: parseFloat(this.showdata.visctemp).toFixed(2),
limit: 200,
unit: "℃",
}),
true,
true
);
window.addEventListener("resize", () => {
this.bsdlndtempCharts && this.bsdlndtempCharts.resize();
});
//xdsd 湿
const xdsd = document.getElementById("bsxdsd"); //
this.bsxdsdCharts = echarts.init(xdsd);
@ -3924,7 +3992,7 @@ export default {
bgColor: "87a6a8",
name: "湿度",
value: parseFloat(this.showdata.syshumid).toFixed(2),
limit: 0.8,
limit: 100,
unit: "%",
}),
true,
@ -4189,6 +4257,11 @@ export default {
this.showdata.sysvisc
).toFixed(2);
this.dlndCharts.setOption(dlndOption);
let dlndtempOption = this.dlndtempCharts.getOption();
dlndtempOption.series[0].data[0].value = parseFloat(
this.showdata.visctemp
).toFixed(2);
this.dlndCharts.setOption(dlndtempOption);
let xdsdOption = this.xdsdCharts.getOption();
xdsdOption.series[0].data[0].value = parseFloat(
this.showdata.syshumid
@ -4223,7 +4296,7 @@ export default {
bgColor: "023E44",
name: "系统压力",
value: this.xtyl,
limit: 0.8,
limit: 250,
unit: "bar",
}),
true,
@ -4241,7 +4314,7 @@ export default {
bgColor: "0D3F62",
name: "系统液温",
value: this.xtyw,
limit: 0.8,
limit: 200,
unit: "℃",
}),
true,
@ -4253,7 +4326,7 @@ export default {
const xtywei = document.getElementById("xtywei"); //
this.xtyweiCharts = echarts.init(xtywei);
let yMax = 1;
let yMax = 1500;
let option = {
grid: {
bottom: "20%",
@ -4279,6 +4352,7 @@ export default {
yAxis: {
show: false,
max: yMax,
min: 0,
},
series: [
{
@ -4318,7 +4392,7 @@ export default {
bgColor: "023953",
name: "泵输出流量",
value: this.zbscll,
limit: 0.8,
limit: 200,
unit: "L/min",
}),
true,
@ -4336,7 +4410,7 @@ export default {
bgColor: "2C2864",
name: "输出效率",
value: this.scxl,
limit: 0.8,
limit: 100,
unit: "%",
}),
true,
@ -4354,7 +4428,7 @@ export default {
bgColor: "373341",
name: "主电机实际功率",
value: this.zdjsjgl,
limit: 0.8,
limit: 60,
unit: "KW",
}),
true,
@ -4391,7 +4465,7 @@ export default {
// data: this.XDATA,
// },
// ],
yAxis: { name: "P (bar)" },
yAxis: { name: "P (bar)", min: 0, max: 210 },
tooltip: {
trigger: "axis",
axisPointer: {
@ -4494,7 +4568,7 @@ export default {
this.zdjdlCharts = echarts.init(zdjdl);
this.zdjdlCharts.setOption(
this.generateOptions({
yAxis: { name: "I(A)" },
yAxis: { name: "I(A)", min: 0, max: 100 },
grid: {
left: "10%",
top: "12%",
@ -4544,7 +4618,7 @@ export default {
// data: this.XDATA,
// },
// ],
yAxis: { name: "Q (L/min)" },
yAxis: { name: "Q (L/min)", min: 0, max: 30 },
tooltip: {
trigger: "axis",
axisPointer: {
@ -4660,7 +4734,7 @@ export default {
yAxis: {
name: "PM",
min: 0,
max: 1,
max: 26,
interval: 0.2, //
},
series: [
@ -4695,7 +4769,7 @@ export default {
bgColor: "87a6a8",
name: "粘度",
value: parseFloat(this.showdata.sysvisc).toFixed(2),
limit: 0.8,
limit: 250,
unit: "mm2/s",
}),
true,
@ -4704,6 +4778,24 @@ export default {
window.addEventListener("resize", () => {
this.dlndCharts && this.dlndCharts.resize();
});
//
const dlndtemp = document.getElementById("dlndtemp"); //
this.dlndtempCharts = echarts.init(dlndtemp);
this.dlndtempCharts.setOption(
this.generateGaugeOption2({
color: ["00F28D", "00FFDD", "00BFFF"],
bgColor: "87a6a8",
name: "温度",
value: parseFloat(this.showdata.visctemp).toFixed(2),
limit: 200,
unit: "℃",
}),
true,
true
);
window.addEventListener("resize", () => {
this.dlndtempCharts && this.dlndtempCharts.resize();
});
//xdsd 湿
const xdsd = document.getElementById("xdsd"); //
this.xdsdCharts = echarts.init(xdsd);
@ -4713,7 +4805,7 @@ export default {
bgColor: "87a6a8",
name: "湿度",
value: parseFloat(this.showdata.syshumid).toFixed(2),
limit: 0.8,
limit: 100,
unit: "%",
}),
true,
@ -4864,6 +4956,10 @@ export default {
this.showdata.sysvisc
).toFixed(2);
this.cyldlndCharts.setOption(dlndOption);
let cyldlndtempOption = this.cyldlndtempCharts.getOption();
cyldlndtempOption.series[0].data[0].value = parseFloat(
this.showdata.visctemp
).toFixed(2);
let xdsdOption = this.cylxdsdCharts.getOption();
xdsdOption.series[0].data[0].value = parseFloat(
this.showdata.syshumid
@ -4977,7 +5073,7 @@ export default {
bgColor: "023E44",
name: "系统压力",
value: this.cylxtyl,
limit: 0.8,
limit: 250,
unit: "bar",
}),
true,
@ -4995,7 +5091,7 @@ export default {
bgColor: "0D3F62",
name: "系统液温",
value: this.cylxtyw,
limit: 0.8,
limit: 200,
unit: "℃",
}),
true,
@ -5007,7 +5103,7 @@ export default {
const xtywei = document.getElementById("cylxtywei"); //
this.cylxtyweiCharts = echarts.init(xtywei);
let yMax = 1;
let yMax = 1500;
let option = {
grid: {
bottom: "10%",
@ -5072,7 +5168,7 @@ export default {
bgColor: "023953",
name: "泵输出流量",
value: this.bscll,
limit: 0.8,
limit: 200,
unit: "L/min",
}),
true,
@ -5090,7 +5186,7 @@ export default {
bgColor: "2C2864",
name: "输出效率",
value: this.cylscxl,
limit: 0.8,
limit: 100,
unit: "%",
}),
true,
@ -5108,7 +5204,7 @@ export default {
bgColor: "373341",
name: "主电机实际功率",
value: this.cylzdjsjgl,
limit: 0.8,
limit: 60,
unit: "KW",
}),
true,
@ -5134,7 +5230,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "P(bar)" },
yAxis: { name: "P(bar)", min: 0, max: 210 },
series: [
{
name: "软辊实际压力",
@ -5213,7 +5309,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "Q(L/min)" },
yAxis: { name: "Q(L/min)", min: 0, max: 200 },
series: [
{
name: "软辊",
@ -5256,7 +5352,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "P(bar)" },
yAxis: { name: "P(bar)", min: 0, max: 210 },
series: [
{
name: "软辊实际压力",
@ -5335,7 +5431,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "Q(L/min)" },
yAxis: { name: "Q(L/min)", min: 0, max: 200 },
series: [
{
name: "软辊",
@ -5369,7 +5465,7 @@ export default {
this.cylzdjdlCharts = echarts.init(zdjdl);
this.cylzdjdlCharts.setOption(
this.generateOptions({
yAxis: { name: "I(A)" },
yAxis: { name: "I(A)", min: 0, max: 100 },
grid: {
left: "10%",
top: "12%",
@ -5409,7 +5505,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "P(bar)" },
yAxis: { name: "P(bar)", min: 0, max: 210 },
series: [
{
name: "底缸加压实际压力",
@ -5452,7 +5548,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "P(bar)" },
yAxis: { name: "P(bar)", min: 0, min: 210 },
series: [
{
name: "底缸加压实际压力",
@ -5495,7 +5591,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "L(mm)" },
yAxis: { name: "L(mm)", min: 0, max: 350 },
series: [
{
name: "位移",
@ -5529,7 +5625,7 @@ export default {
fontSize: 16,
},
},
yAxis: { name: "L(mm)" },
yAxis: { name: "L(mm)", min: 0, max: 350 },
series: [
{
name: "位移",
@ -5558,7 +5654,7 @@ export default {
bgColor: "87a6a8",
name: "粘度",
value: parseFloat(this.showdata.sysvisc).toFixed(2),
limit: 0.8,
limit: 200,
unit: "mm2/s",
}),
true,
@ -5567,6 +5663,24 @@ export default {
window.addEventListener("resize", () => {
this.cyldlndCharts && this.cyldlndCharts.resize();
});
//
const dlndtemp = document.getElementById("cyldlndtemp"); //
this.cyldlndtempCharts = echarts.init(dlndtemp);
this.cyldlndtempCharts.setOption(
this.generateGaugeOption2({
color: ["00F28D", "00FFDD", "00BFFF"],
bgColor: "87a6a8",
name: "温度",
value: parseFloat(this.showdata.visctemp).toFixed(2),
limit: 200,
unit: "℃",
}),
true,
true
);
window.addEventListener("resize", () => {
this.cyldlndtempCharts && this.cyldlndtempCharts.resize();
});
//yykldtx
const yykldtx = document.getElementById("cylyykldtx");
this.cylyykldtxCharts = echarts.init(yykldtx);
@ -5588,7 +5702,7 @@ export default {
yAxis: {
name: "PM",
min: 0,
max: 1,
max: 26,
interval: 0.2, //
},
series: [
@ -5628,7 +5742,7 @@ export default {
bgColor: "87a6a8",
name: "湿度",
value: parseFloat(this.showdata.syshumid).toFixed(2),
limit: 0.8,
limit: 100,
unit: "%",
}),
true,