diff --git a/shuibiao/.vs/ShuiBiao/FileContentIndex/1455acc5-277f-4f91-9f4d-e9aa87b8333c.vsidx b/shuibiao/.vs/ShuiBiao/FileContentIndex/1455acc5-277f-4f91-9f4d-e9aa87b8333c.vsidx
deleted file mode 100644
index 17be861..0000000
Binary files a/shuibiao/.vs/ShuiBiao/FileContentIndex/1455acc5-277f-4f91-9f4d-e9aa87b8333c.vsidx and /dev/null differ
diff --git a/shuibiao/.vs/ShuiBiao/FileContentIndex/60bc20db-6ffb-4de9-b349-61e88c3d0425.vsidx b/shuibiao/.vs/ShuiBiao/FileContentIndex/60bc20db-6ffb-4de9-b349-61e88c3d0425.vsidx
new file mode 100644
index 0000000..cc03edf
Binary files /dev/null and b/shuibiao/.vs/ShuiBiao/FileContentIndex/60bc20db-6ffb-4de9-b349-61e88c3d0425.vsidx differ
diff --git a/shuibiao/.vs/ShuiBiao/FileContentIndex/b58b592e-e03e-49fe-acb7-9cc8e0fcca4c.vsidx b/shuibiao/.vs/ShuiBiao/FileContentIndex/b58b592e-e03e-49fe-acb7-9cc8e0fcca4c.vsidx
new file mode 100644
index 0000000..6ad3013
Binary files /dev/null and b/shuibiao/.vs/ShuiBiao/FileContentIndex/b58b592e-e03e-49fe-acb7-9cc8e0fcca4c.vsidx differ
diff --git a/shuibiao/.vs/ShuiBiao/FileContentIndex/d32e8f2f-1b91-40e3-8fe3-62670cb7fb15.vsidx b/shuibiao/.vs/ShuiBiao/FileContentIndex/d32e8f2f-1b91-40e3-8fe3-62670cb7fb15.vsidx
new file mode 100644
index 0000000..879beaa
Binary files /dev/null and b/shuibiao/.vs/ShuiBiao/FileContentIndex/d32e8f2f-1b91-40e3-8fe3-62670cb7fb15.vsidx differ
diff --git a/shuibiao/.vs/ShuiBiao/FileContentIndex/ec7f99a4-7bb8-429e-86f0-141a9ee63918.vsidx b/shuibiao/.vs/ShuiBiao/FileContentIndex/ec7f99a4-7bb8-429e-86f0-141a9ee63918.vsidx
new file mode 100644
index 0000000..a7246f2
Binary files /dev/null and b/shuibiao/.vs/ShuiBiao/FileContentIndex/ec7f99a4-7bb8-429e-86f0-141a9ee63918.vsidx differ
diff --git a/shuibiao/.vs/ShuiBiao/v17/.suo b/shuibiao/.vs/ShuiBiao/v17/.suo
index 8650966..ffce447 100644
Binary files a/shuibiao/.vs/ShuiBiao/v17/.suo and b/shuibiao/.vs/ShuiBiao/v17/.suo differ
diff --git a/shuibiao/ShuiBiao.cs b/shuibiao/ShuiBiao.cs
index 13cc87c..2ae5da1 100644
--- a/shuibiao/ShuiBiao.cs
+++ b/shuibiao/ShuiBiao.cs
@@ -1,4 +1,5 @@
-using System;
+using DataService.Model;
+using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
@@ -45,11 +46,11 @@ namespace ShuiBiao
//TCP
try
{
- var ip = "172.17.0.9";
- var port = 12303;
+ //var ip = "172.17.0.9";
+ //var port = 12301;
- //var ip = "127.0.0.1";
- //var port = 12303;
+ var ip = "127.0.0.1";
+ var port = 12301;
//调用socket(函数创建一个用于通信的套接字。
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@@ -167,7 +168,7 @@ namespace ShuiBiao
break;//结束线程
}
- if (length > 0)
+ if (length > 11)//bytes[11]为功能码位
{
var message = byteArrayToHexString(bytes, length);
log.Info("接收到 " + clientSocket.RemoteEndPoint + ": " + message);
@@ -178,6 +179,12 @@ namespace ShuiBiao
var LoginFrame = message[20].ToString() + message[21].ToString();//功能码C
JudgmentFunctionCode(LoginFrame, message, baseNum);
}
+ else
+ {
+ var message = byteArrayToHexString(bytes, length);
+ log.Info("报文格式错误: " + message);
+ Console.WriteLine("报文格式错误: " + message);
+ }
}
}
@@ -966,12 +973,12 @@ namespace ShuiBiao
///
- /// 基础解析【长度--采集时间】
+ /// 基础解析【数据部长度--此帧表数】
///
///
public static void basicsAnalysis(string message)
{
- #region 长度--采集时间
+ #region 数据部长度--此帧表数
StringBuilder DataLength = new StringBuilder("");//数据部长度L
for (int i = 4; i <= 7; i++)
@@ -1099,19 +1106,19 @@ namespace ShuiBiao
if (go.ToString() == "84")
{
Console.WriteLine();
- phenotype84(message, baseNum);
+ SCL61D5_84(message, baseNum, SimID);
dataFramesDecompilation(SimID, code);
}
else if ((go.ToString() == "83"))
{
Console.WriteLine();
- phenotype83(message, baseNum);
+ SCL61D5_83(message, baseNum, SimID);
dataFramesDecompilation(SimID, code);
}
else if ((go.ToString() == "81"))
{
Console.WriteLine();
- phenotype81(message, baseNum);
+ SCL61D5_81(message, baseNum, SimID);
dataFramesDecompilation(SimID, code);
}
}
@@ -1165,13 +1172,63 @@ namespace ShuiBiao
Console.WriteLine("采集时间:" + date);
}
+ ///
+ /// 0x81解析【站号、表型 、报警码、采集时间】
+ ///
+ ///
+ ///
+ ///
+ public static void shareAnalysis(string message, int multiplier, water_data wd)
+ {
+ StringBuilder platForm = new StringBuilder("");//站号 --十进制减去64 为实际数值
+ for (int i = 28 + multiplier; i <= 29 + multiplier; i++)
+ {
+ platForm.Append(message[i]);
+ }
+ var _platForm = int.Parse(hexStr2Str(platForm.ToString())) - 64;
+ Console.WriteLine("站号:" + _platForm);
+ wd.stop_number = _platForm.ToString();
+
+ StringBuilder phenotype = new StringBuilder("");//表型
+ for (int i = 30 + multiplier; i <= 31 + multiplier; i++)
+ {
+ phenotype.Append(message[i]);
+ }
+ StringBuilder _phenotype = new StringBuilder("");//--表型数字 81 83 84
+ _phenotype.Clear().Append(typePheno(phenotype));
+ wd.phenotype = "SCL61D6 单向不锈钢带温度流量计";
+
+ StringBuilder alarmCode = new StringBuilder("");//报警码
+ for (int i = 32 + multiplier; i <= 33 + multiplier; i++)
+ {
+ alarmCode.Append(message[i]);
+ }
+ wd.alarm_code = typeAlarmcode(alarmCode);
+
+
+
+ StringBuilder date = new StringBuilder("20");//采集时间 --(BCD 码)
+ for (int i = 34 + multiplier; i <= 43 + multiplier; i++)
+ {
+ if (i == 35 + multiplier || i == 37 + multiplier) date.Append(message[i] + "-");
+ else if (i == 39 + multiplier) date.Append(message[i] + " ");
+ else if (i == 41 + multiplier) date.Append(message[i] + ":");
+ else date.Append(message[i]);
+ }
+ Console.WriteLine("采集时间:" + date);
+ wd.acquisition_timeA = date.ToString();
+ }
+
///
/// 表型81
///
///
/// 基数【前置位设备数据总数和】
- public static void phenotype81(string message, int baseNum)
+ public static void SCL61D5_81(string message, int baseNum, StringBuilder SimID)
{
+ //new数据库
+ water_data wd = new water_data();
+
int multiplier;//基数(前所有位合计)
if (baseNum != 0)
{
@@ -1208,21 +1265,21 @@ namespace ShuiBiao
}
//Console.WriteLine("版本号:" + int.Parse(versionNum.ToString()));
- StringBuilder instantaneousFlow = new StringBuilder("");//瞬时流量 --浮点型,缩小 1000 倍为实际值,单位: m3/h
+ StringBuilder instantaneousFlow = new StringBuilder("");//瞬时流量 --浮点型,缩小 1000 倍为实际值,单位: m³/h
for (int i = 48 + multiplier; i <= 55 + multiplier; i++)
{
instantaneousFlow.Append(message[i]);
}
var _instantaneousFlow = byteToFloat(instantaneousFlow.ToString()) / 1000;
- //Console.WriteLine("瞬时流量" + _instantaneousFlow.ToString() + "m3/h");
+ //Console.WriteLine("瞬时流量" + _instantaneousFlow.ToString() + "m³/h");
- StringBuilder _positiveFlow = new StringBuilder("");//累积流量 --带符号整型,低字节在前,高字节在后,缩小 10 倍为实际数值,单位: m3。
+ StringBuilder _positiveFlow = new StringBuilder("");//累积流量 --带符号整型,低字节在前,高字节在后,缩小 10 倍为实际数值,单位: m³。
for (int i = 56 + multiplier; i <= 63 + multiplier; i++)
{
_positiveFlow.Append(message[i]);
}
int positiveFlow = int.Parse(/*hexStr2Str*/(interconvert(56 + multiplier, 63 + multiplier, _positiveFlow.ToString()))) / 10;//???
- //Console.WriteLine("累积流量:" + positiveFlow + "m3");
+ //Console.WriteLine("累积流量:" + positiveFlow + "m³");
StringBuilder waterTemperature = new StringBuilder("");//水温 --浮点型,单位: ℃
for (int i = 64 + multiplier; i <= 71 + multiplier; i++)
@@ -1294,38 +1351,54 @@ namespace ShuiBiao
}
if (binAccumulation(4 + multiplier, 111 + multiplier, message).ToUpper() != builder.ToString().ToUpper())
{
+ wd.IsValid = false;
Console.WriteLine("接收数据校验失败" + ": " + message);
log.Info("登录帧校验失败" + ": " + message);
Isgo(message, baseNum);
return;
}
+ else wd.IsValid = true;
- shareAnalysis(message, multiplier);
+
+ shareAnalysis(message, multiplier, wd);
if (validity.ToString() == "26")
{
Console.WriteLine("抄表数据有效");
+ wd.is_the_data_valid = "有效";
}
else
{
Console.WriteLine("抄表数据无效");
+ wd.is_the_data_valid = "无效";
}
Console.WriteLine("版本号:" + int.Parse(versionNum.ToString()));
- Console.WriteLine("瞬时流量" + _instantaneousFlow.ToString() + "m3/h");
- Console.WriteLine("累积流量:" + positiveFlow + "m3");
+ wd.version_number = versionNum.ToString();
+ Console.WriteLine("瞬时流量" + _instantaneousFlow.ToString() + "m³/h");
+ wd.instantaneous_delivery = (decimal)_instantaneousFlow;
+ Console.WriteLine("累积流量:" + positiveFlow + "m³");
+
Console.WriteLine("水温:" + _waterTemperature + "℃");
+ wd.water_temperature = (decimal)_waterTemperature;
Console.WriteLine("累积运行时间:" + RunTime + "h");
+ wd.cumulative_running_time = RunTime;
Console.WriteLine("电池电压:" + cellVoltage + "v");
+ wd.cell_voltage = (decimal)cellVoltage;
Console.WriteLine("管径:" + pipeSize + "mm");
- capacity.Clear().Append(interconvert(0, 0, capacity.ToString()));
- Console.WriteLine("量程:" + capacity);//???
- typeMalfunction(diagnose);
+ wd.caliber = (decimal)pipeSize;
+ var _capacity = (interconvert(0, 0, capacity.ToString()));
+ Console.WriteLine("量程:" + (_capacity));
+ wd.range = decimal.Parse(_capacity);
+ wd.fault_code = typeMalfunction(diagnose);
//数据校验 --版本号-故障代码
Console.WriteLine("数据校验:" + binAccumulation(46 + multiplier, 109 + multiplier, message));//版本号--故障码
Console.WriteLine("校验位CS:" + binAccumulation(4 + multiplier, 111 + multiplier, message));//数据部长度--数据校验
- Isgo(message, baseNum);
+ wd.client_address = SimID.ToString();
+ //指令采集完毕
+
+ Isgo(message, baseNum);
}
///
@@ -1333,7 +1406,7 @@ namespace ShuiBiao
///
///
/// 基数【前置位设备数据总数和】
- public static void phenotype83(string message, int baseNum)
+ public static void SCL61D5_83(string message, int baseNum, StringBuilder SimID)
{
int multiplier;
if (baseNum != 0)
@@ -1371,22 +1444,22 @@ namespace ShuiBiao
}
//Console.WriteLine("版本号:" + int.Parse(versionNum.ToString()));
- StringBuilder instantaneousFlow = new StringBuilder("");//瞬时流量 --浮点型,缩小 1000 倍为实际值,单位: m3/h
+ StringBuilder instantaneousFlow = new StringBuilder("");//瞬时流量 --浮点型,缩小 1000 倍为实际值,单位: m³/h
for (int i = 48 + multiplier; i <= 55 + multiplier; i++)
{
instantaneousFlow.Append(message[i]);
}
- //Console.WriteLine("瞬时流量" + float.Parse(instantaneousFlow.ToString()) / 1000 + "m3/h");//???
- //Console.WriteLine("瞬时流量" + byteToFloat(instantaneousFlow.ToString()) / 1000 + "m3/h");
+ //Console.WriteLine("瞬时流量" + float.Parse(instantaneousFlow.ToString()) / 1000 + "m³/h");//???
+ //Console.WriteLine("瞬时流量" + byteToFloat(instantaneousFlow.ToString()) / 1000 + "m³/h");
- StringBuilder _positiveFlow = new StringBuilder("");//正累积流量 --带符号整型,低字节在前,高字节在后,缩小 10 倍为实际数值,单位: m3
+ StringBuilder _positiveFlow = new StringBuilder("");//正累积流量 --带符号整型,低字节在前,高字节在后,缩小 10 倍为实际数值,单位: m³
for (int i = 56 + multiplier; i <= 63 + multiplier; i++)
{
_positiveFlow.Append(message[i]);
}
//int positiveFlow = int.Parse(hexStr2Str(interconvert(56 + multiplier, 63 + multiplier, _positiveFlow.ToString()))) / 10;//???
var positiveFlow = float.Parse(/*hexStr2Str*/(interconvert(56 + multiplier, 63 + multiplier, _positiveFlow.ToString()))) / 10;
- //Console.WriteLine("正累积流量:" + positiveFlow + "m3");
+ //Console.WriteLine("正累积流量:" + positiveFlow + "m³");
StringBuilder loseFlow = new StringBuilder("");//负累积流量 --BCD 码,缩小10 倍为实际数值,单位:m³
for (int i = 64 + multiplier; i <= 71 + multiplier; i++)
@@ -1394,7 +1467,7 @@ namespace ShuiBiao
loseFlow.Append(message[i]);
}
var _loseFlow = float.Parse(loseFlow.ToString()) / 10;
- //Console.WriteLine("负累积流量:" + _loseFlow + "m3");
+ //Console.WriteLine("负累积流量:" + _loseFlow + "m³");
StringBuilder loseRunTime = new StringBuilder("");//负累积运行时间 --BCD 码,单位: h。
for (int i = 72 + multiplier; i <= 79 + multiplier; i++)
@@ -1490,17 +1563,17 @@ namespace ShuiBiao
Console.WriteLine("抄表数据无效");
}
Console.WriteLine("版本号:" + int.Parse(versionNum.ToString()));
- Console.WriteLine("瞬时流量" + byteToFloat(instantaneousFlow.ToString()) / 1000 + "m3/h");
- Console.WriteLine("正累积流量:" + positiveFlow + "m3");
- Console.WriteLine("负累积流量:" + _loseFlow + "m3");
+ Console.WriteLine("瞬时流量" + byteToFloat(instantaneousFlow.ToString()) / 1000 + "m³/h");
+ Console.WriteLine("正累积流量:" + positiveFlow + "m³");
+ Console.WriteLine("负累积流量:" + _loseFlow + "m³");
Console.WriteLine("负累积运行时间:" + _loseRunTime + "h");
Console.WriteLine("水温:" + _waterTemperature + "℃");
Console.WriteLine("累积运行时间:" + RunTime + "h");
Console.WriteLine("电池电压:" + cellVoltage + "v");
Console.WriteLine("管径:" + pipeSize + "mm");
- capacity.Clear().Append(interconvert(0, 0, capacity.ToString()));
- Console.WriteLine("量程:" + capacity);//???
- //Console.WriteLine("阻尼系数:" + hexToASCII(dampingFactor.ToString()));
+ var _capacity = (interconvert(0, 0, capacity.ToString()));
+ Console.WriteLine("量程:" + (_capacity));
+ //Console.WriteLine("阻尼系数:" + hexToASCII(dampingFactor.ToString()));
typeMalfunction(diagnose);
//数据校验 --版本号-故障代码
@@ -1516,7 +1589,7 @@ namespace ShuiBiao
///
///
/// 基数【前置位设备数据总数和】
- public static void phenotype84(string message, int baseNum)
+ public static void SCL61D5_84(string message, int baseNum, StringBuilder SimID)
{
int multiplier;
if (baseNum != 0)
@@ -1565,22 +1638,22 @@ namespace ShuiBiao
//}
- StringBuilder instantaneousFlow = new StringBuilder(""); //瞬时流量 --缩小 1000 倍为实际值,单位: m3/h
+ StringBuilder instantaneousFlow = new StringBuilder(""); //瞬时流量 --缩小 1000 倍为实际值,单位: m³/h
for (int i = 48 + multiplier; i <= 55 + multiplier; i++)
{
instantaneousFlow.Append(message[i]);
}
var _instantaneousFlow = float.Parse(instantaneousFlow.ToString()) / 1000;
- //Console.WriteLine("瞬时流量:" + signDelivery + _instantaneousFlow + "m3/h");
+ //Console.WriteLine("瞬时流量:" + signDelivery + _instantaneousFlow + "m³/h");
- StringBuilder loseFlow = new StringBuilder("");//负累积流量 --缩小 10 倍为实际数值,单位: m3
+ StringBuilder loseFlow = new StringBuilder("");//负累积流量 --缩小 10 倍为实际数值,单位: m³
for (int i = 56 + multiplier; i <= 63 + multiplier; i++)
{
loseFlow.Append(message[i]);
}
var _loseFlow = float.Parse(loseFlow.ToString()) / 10;
- //Console.WriteLine("负累积流量:" + signDelivery + _loseFlow + "m3");
+ //Console.WriteLine("负累积流量:" + signDelivery + _loseFlow + "m³");
StringBuilder loseRunTime = new StringBuilder("");//负累积运行时间 --单位: h
@@ -1592,13 +1665,13 @@ namespace ShuiBiao
//Console.WriteLine("负累积运行时间:" + _loseRunTime + "h");
- StringBuilder positiveFlow = new StringBuilder("");//正累积流量 --缩小 10 倍为实际数值,单位: m3
+ StringBuilder positiveFlow = new StringBuilder("");//正累积流量 --缩小 10 倍为实际数值,单位: m³
for (int i = 72 + multiplier; i <= 79 + multiplier; i++)
{
positiveFlow.Append(message[i]);
}
var _positiveFlow = float.Parse(positiveFlow.ToString()) / 10;
- //Console.WriteLine("正累积流量:" + _positiveFlow + "m3");
+ //Console.WriteLine("正累积流量:" + _positiveFlow + "m³");
@@ -1671,10 +1744,10 @@ namespace ShuiBiao
signDelivery.Clear().Append("-");
Console.WriteLine("瞬时流量为负值");
}
- Console.WriteLine("瞬时流量:" + signDelivery + _instantaneousFlow + "m3/h");
- Console.WriteLine("负累积流量:" + signDelivery + _loseFlow + "m3");
+ Console.WriteLine("瞬时流量:" + signDelivery + _instantaneousFlow + "m³/h");
+ Console.WriteLine("负累积流量:" + signDelivery + _loseFlow + "m³");
Console.WriteLine("负累积运行时间:" + _loseRunTime + "h");
- Console.WriteLine("正累积流量:" + _positiveFlow + "m3");
+ Console.WriteLine("正累积流量:" + _positiveFlow + "m³");
Console.WriteLine("正累积运行时间:" + _positiveRunTime + "h");
Console.WriteLine("水温:" + _waterTemperature + "℃");
Console.WriteLine("压力:" + _pressure + "mpa");
@@ -1688,6 +1761,21 @@ namespace ShuiBiao
}
+ public static void SCL61D6_84(string message, int baseNum)
+ {
+ int multiplier;
+ if (baseNum != 0)
+ {
+ multiplier = baseNum;
+ baseNum += (64 + 16);
+ }
+ else
+ {
+ multiplier = 0;
+ baseNum = (64 + 16);
+ }
+ //44位开始
+ }
///
/// 判断功能码类型
@@ -1709,7 +1797,8 @@ namespace ShuiBiao
clockAnalysis(message);
break;
default:
- Console.WriteLine("无此功能码: " + str);
+ Console.WriteLine("无此功能码: " + str);
+ log.Info("报文: " + message + " 无此功能码: " + str);
break;
}
}
@@ -1783,45 +1872,49 @@ namespace ShuiBiao
/// 判断报警码**只在使用08 码上报数据时才会存在
///
///
- public static void typeAlarmcode(StringBuilder alarmCode)
+ public static string typeAlarmcode(StringBuilder alarmCode)
{
switch (alarmCode.ToString())
{
+ case "00":
+ alarmCode.Clear().Append("正常");
+ Console.WriteLine("报警码:" + alarmCode);
+ return alarmCode.ToString();
case "01":
alarmCode.Clear().Append("正向流量超上限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "02":
alarmCode.Clear().Append("正向流量超下限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "04":
alarmCode.Clear().Append("负向流量超上限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "08":
alarmCode.Clear().Append("负向流量超下限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "10":
alarmCode.Clear().Append("压力超上限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "20":
alarmCode.Clear().Append("压力超下限");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "40":
alarmCode.Clear().Append("预留");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
case "80":
alarmCode.Clear().Append("预留");
Console.WriteLine("报警码:" + alarmCode);
- break;
+ return alarmCode.ToString();
default:
Console.WriteLine($"无此报警码: {alarmCode}");
- break;
+ return "";
}
}
@@ -1829,52 +1922,52 @@ namespace ShuiBiao
/// 判断故障码**当设备上报 0x06 故障时,不应再上报其他故障。
///
///
- public static void typeMalfunction(StringBuilder diagnose)
+ public static string typeMalfunction(StringBuilder diagnose)
{
switch (diagnose.ToString())
{
case "01":
diagnose.Clear().Append("池电压低于3.37V,需要更换电池");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "02":
diagnose.Clear().Append("空管或者换能器故障无测量信号");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "03":
diagnose.Clear().Append("代码01 和代码02 同时发生");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "04":
diagnose.Clear().Append("电池电压低于3.3V,必须更换电池");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "05":
diagnose.Clear().Append("传感器和换能器之间通讯故障,无通讯");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "06":
diagnose.Clear().Append("E2PROM 损坏");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "10":
diagnose.Clear().Append("供水温度传感器故障(短路、开路)或供水温度低于2℃");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "20":
diagnose.Clear().Append("供水温度超出150℃");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "40":
diagnose.Clear().Append("回水温度传感器故障(短路、开路)或回水温度低于2℃");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
case "80":
diagnose.Clear().Append("回水温度超出150℃");
Console.WriteLine("故障码:" + diagnose);
- break;
+ return diagnose.ToString();
default:
- break;
+ return "";
}
}
diff --git a/shuibiao/ShuiBiao.csproj b/shuibiao/ShuiBiao.csproj
index 1744a3b..1bae8f7 100644
--- a/shuibiao/ShuiBiao.csproj
+++ b/shuibiao/ShuiBiao.csproj
@@ -69,6 +69,7 @@
+
diff --git a/shuibiao/bin/Debug/App_Data/Logs_20230225.txt b/shuibiao/bin/Debug/App_Data/Logs_20230225.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/shuibiao/bin/Debug/App_Data/Logs_20230227.txt b/shuibiao/bin/Debug/App_Data/Logs_20230227.txt
deleted file mode 100644
index 36b6973..0000000
--- a/shuibiao/bin/Debug/App_Data/Logs_20230227.txt
+++ /dev/null
@@ -1,13 +0,0 @@
- ------------------------------------------------
-2023-02-27 16:55:04,179 [4] INFO loginfo - յ 127.0.0.1:59905: 40 3A 00 46 15 13 32 70 24 76 01 46 00 23 02 27 10 55 05 00 01 41 01 4A 26 48 5A 47 39 36 5F 32 30 31 32 30 37 56 31 2D 31 2E 31 23 4B 18 4C 0E 10 4D 66 34 31 35 31 33 33 32 37 30 32 34 37 36 4F 07 00 00 00 00 00 00 00 17 0D 0A 40 3A 00 22 15 13 32 70 24 76 08 01 01 01 41 01 00 23 02 27 10 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 0D 0A
-2023-02-27 16:55:04,188 [4] INFO loginfo - ¼֡Уʧ: 403A0046151332702476014600230227105505000141014A26485A4739365F32303132303756312D312E31234B184C0E104D66343135313333323730323437364F0700000000000000170D0A403A0022151332702476080101014101002302271054000000000000000000000000000000830D0A
-2023-02-27 16:59:43,273 [4] INFO loginfo - յ 127.0.0.1:59905: 40 3A 00 46 15 13 32 70 24 76 01 46 00 23 02 27 10 55 05 00 01 41 01 4A 26 48 5A 47 39 36 5F 32 30 31 32 30 37 56 31 2D 31 2E 31 23 4B 18 4C 0E 10 4D 66 34 31 35 31 33 33 32 37 30 32 34 37 36 4F 07 00 00 00 00 00 00 00 17 0D 0A 40 3A 00 22 15 13 32 70 24 76 08 01 01 01 41 01 00 23 02 27 10 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 0D 0A
-2023-02-27 17:00:09,785 [4] INFO loginfo - ¼֡Уʧ: 403A0046151332702476014600230227105505000141014A26485A4739365F32303132303756312D312E31234B184C0E104D66343135313333323730323437364F0700000000000000170D0A403A0022151332702476080101014101002302271054000000000000000000000000000000830D0A
-2023-02-27 17:00:18,585 [4] INFO loginfo - յ 127.0.0.1:59905: 40 3A 00 46 15 13 32 70 24 76 01 46 00 23 02 27 10 55 05 00 01 41 01 4A 26 48 5A 47 39 36 5F 32 30 31 32 30 37 56 31 2D 31 2E 31 23 4B 18 4C 0E 10 4D 66 34 31 35 31 33 33 32 37 30 32 34 37 36 4F 07 00 00 00 00 00 00 00 17 0D 0A 40 3A 00 22 15 13 32 70 24 76 08 01 01 01 41 01 00 23 02 27 10 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 0D 0A
- ------------------------------------------------
-2023-02-27 17:01:28,034 [4] INFO loginfo - յ 127.0.0.1:59944: 40 3A 00 46 15 13 32 70 24 76 01 46 00 23 02 27 10 55 05 00 01 41 01 4A 26 48 5A 47 39 36 5F 32 30 31 32 30 37 56 31 2D 31 2E 31 23 4B 18 4C 0E 10 4D 66 34 31 35 31 33 33 32 37 30 32 34 37 36 4F 07 00 00 00 00 00 00 00 17 0D 0A 40 3A 00 22 15 13 32 70 24 76 08 01 01 01 41 01 00 23 02 27 10 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 83 0D 0A
- ------------------------------------------------
-2023-02-27 17:10:42,313 [4] INFO loginfo - յ 127.0.0.1:60011: 40 3A 00 3B 15 13 04 90 07 14 08 01 01 01 41 84 00 20 03 27 06 50 26 0A 00 00 01 76 00 00 15 23 00 00 01
- ------------------------------------------------
-2023-02-27 17:12:15,786 [4] INFO loginfo - յ 127.0.0.1:60017: 40 3A 00 46 15 13 04 90 07 14 01 49 00 20 03 27 06 50 46 00 01 41 84 4A 26 48 5A 47 39 36 5F 32 30 31 32 30 37 56 31 2D 31 2E 31 23 4B 18 4C 0E 10 4D 66 34 31 35 31 33 30 34 39 30 30 37 31 34 4F 07 00 00 00 00 00 00 00 3A 0D 0A
-2023-02-27 17:13:16,456 [5] INFO loginfo - յ 127.0.0.1:60022: 40 3A 00 3B 15 13 04 90 07 14 08 01 01 01 41 84 00 20 03 27 06 50 26 0A 00 00 01 76 00 00 15 23 00 00 01 00 00 00 12 00 00 00 01 50 00 00 28 32 00 00 09 01 10 91 CA 0D 0A
diff --git a/shuibiao/bin/Debug/ShuiBiao.exe b/shuibiao/bin/Debug/ShuiBiao.exe
index 8f5548b..559f4bb 100644
Binary files a/shuibiao/bin/Debug/ShuiBiao.exe and b/shuibiao/bin/Debug/ShuiBiao.exe differ
diff --git a/shuibiao/bin/Debug/ShuiBiao.pdb b/shuibiao/bin/Debug/ShuiBiao.pdb
index 3e03d06..83e2fc4 100644
Binary files a/shuibiao/bin/Debug/ShuiBiao.pdb and b/shuibiao/bin/Debug/ShuiBiao.pdb differ
diff --git a/shuibiao/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/shuibiao/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
index 8dda85d..81ae154 100644
Binary files a/shuibiao/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/shuibiao/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/shuibiao/obj/Debug/ShuiBiao.csproj.AssemblyReference.cache b/shuibiao/obj/Debug/ShuiBiao.csproj.AssemblyReference.cache
index a06375f..382c84a 100644
Binary files a/shuibiao/obj/Debug/ShuiBiao.csproj.AssemblyReference.cache and b/shuibiao/obj/Debug/ShuiBiao.csproj.AssemblyReference.cache differ
diff --git a/shuibiao/obj/Debug/ShuiBiao.csproj.CoreCompileInputs.cache b/shuibiao/obj/Debug/ShuiBiao.csproj.CoreCompileInputs.cache
index 0ef92dd..ca4765b 100644
--- a/shuibiao/obj/Debug/ShuiBiao.csproj.CoreCompileInputs.cache
+++ b/shuibiao/obj/Debug/ShuiBiao.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-4c45faaedcb9e5670ec8ff8478bc1367530a318d
+be9afcdc750fc7f7e2cb29de52e861e0b13d9617
diff --git a/shuibiao/obj/Debug/ShuiBiao.csproj.FileListAbsolute.txt b/shuibiao/obj/Debug/ShuiBiao.csproj.FileListAbsolute.txt
index 4da7d71..223b84e 100644
--- a/shuibiao/obj/Debug/ShuiBiao.csproj.FileListAbsolute.txt
+++ b/shuibiao/obj/Debug/ShuiBiao.csproj.FileListAbsolute.txt
@@ -18,3 +18,14 @@ D:\XM\C#\DianBiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.CoreCompileI
D:\XM\C#\DianBiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.CopyComplete
D:\XM\C#\DianBiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.exe
D:\XM\C#\DianBiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.pdb
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\bin\Debug\ShuiBiao.exe.config
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\bin\Debug\ShuiBiao.exe
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\bin\Debug\ShuiBiao.pdb
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\bin\Debug\log4net.dll
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\bin\Debug\log4net.xml
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.AssemblyReference.cache
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.SuggestedBindingRedirects.cache
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.CoreCompileInputs.cache
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.csproj.CopyComplete
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.exe
+D:\XM\C#\ZHshuibiao_TCP\ZHshuibiao\shuibiao\obj\Debug\ShuiBiao.pdb
diff --git a/shuibiao/obj/Debug/ShuiBiao.exe b/shuibiao/obj/Debug/ShuiBiao.exe
index 8f5548b..559f4bb 100644
Binary files a/shuibiao/obj/Debug/ShuiBiao.exe and b/shuibiao/obj/Debug/ShuiBiao.exe differ
diff --git a/shuibiao/obj/Debug/ShuiBiao.pdb b/shuibiao/obj/Debug/ShuiBiao.pdb
index 3e03d06..83e2fc4 100644
Binary files a/shuibiao/obj/Debug/ShuiBiao.pdb and b/shuibiao/obj/Debug/ShuiBiao.pdb differ
diff --git a/shuibiao/water_data.cs b/shuibiao/water_data.cs
new file mode 100644
index 0000000..d6d871e
--- /dev/null
+++ b/shuibiao/water_data.cs
@@ -0,0 +1,270 @@
+/** 版本信息模板在安装目录下,可自行修改。
+* water_data.cs
+*
+* 功 能: N/A
+* 类 名: water_data
+*
+* Ver 变更日期 负责人 变更内容
+* ───────────────────────────────────
+* V0.01 2023/2/26 20:48:51 N/A 初版
+*
+* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
+*┌──────────────────────────────────┐
+*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
+*│ 版权所有:动软卓越(北京)科技有限公司 │
+*└──────────────────────────────────┘
+*/
+using System;
+namespace DataService.Model
+{
+ ///
+ /// water_data:实体类(属性说明自动提取数据库字段的描述信息)
+ ///
+ [Serializable]
+ public partial class water_data
+ {
+ public water_data()
+ {}
+ #region Model
+ private string _water_id;
+ private string _stop_number;
+ private string _phenotype;
+ private string _client_address;
+ private string _version_number;
+ private decimal? _instantaneous_delivery;
+ private string _transient_flow_symbol;
+ private decimal? _cumulative_running_time;
+ private decimal? _positive_cumulative_traffic;
+ private decimal? _positive_cumulative_run_time;
+ private decimal? _negative_cumulative_traffic;
+ private decimal? _negative_cumulative_running_time;
+ private decimal? _water_temperature;
+ private decimal? _cell_voltage;
+ private decimal? _caliber;
+ private decimal? _range;
+ private string _fault_code;
+ private string _alarm_code;
+ private DateTime? _acquisition_time;
+ private string _diagnostic_code;
+ private string _is_the_data_valid;
+ private DateTime? _create_time;
+ private string _r1;
+ private string _r2;
+ private string _r3;
+ ///
+ /// 主键
+ ///
+ public string water_id
+ {
+ set{ _water_id=value;}
+ get{return _water_id;}
+ }
+ ///
+ /// 站号
+ ///
+ public string stop_number
+ {
+ set{ _stop_number=value;}
+ get{return _stop_number;}
+ }
+ ///
+ /// 表型
+ ///
+ public string phenotype
+ {
+ set{ _phenotype=value;}
+ get{return _phenotype;}
+ }
+ ///
+ /// 客户端地址A
+ ///
+ public string client_address
+ {
+ set{ _client_address=value;}
+ get{return _client_address;}
+ }
+ ///
+ /// 版本号
+ ///
+ public string version_number
+ {
+ set{ _version_number=value;}
+ get{return _version_number;}
+ }
+ ///
+ /// 瞬时流量
+ ///
+ public decimal? instantaneous_delivery
+ {
+ set{ _instantaneous_delivery=value;}
+ get{return _instantaneous_delivery;}
+ }
+ ///
+ /// 瞬时流量符号
+ ///
+ public string transient_flow_symbol
+ {
+ set{ _transient_flow_symbol=value;}
+ get{return _transient_flow_symbol;}
+ }
+ ///
+ /// 累积运行时间
+ ///
+ public decimal? cumulative_running_time
+ {
+ set{ _cumulative_running_time=value;}
+ get{return _cumulative_running_time;}
+ }
+ ///
+ /// 正累积流量
+ ///
+ public decimal? positive_cumulative_traffic
+ {
+ set{ _positive_cumulative_traffic=value;}
+ get{return _positive_cumulative_traffic;}
+ }
+ ///
+ /// 正累积运行时间
+ ///
+ public decimal? positive_cumulative_run_time
+ {
+ set{ _positive_cumulative_run_time=value;}
+ get{return _positive_cumulative_run_time;}
+ }
+ ///
+ /// 负累积流量
+ ///
+ public decimal? negative_cumulative_traffic
+ {
+ set{ _negative_cumulative_traffic=value;}
+ get{return _negative_cumulative_traffic;}
+ }
+ ///
+ /// 负累积运行时间
+ ///
+ public decimal? negative_cumulative_running_time
+ {
+ set{ _negative_cumulative_running_time=value;}
+ get{return _negative_cumulative_running_time;}
+ }
+ ///
+ /// 水温
+ ///
+ public decimal? water_temperature
+ {
+ set{ _water_temperature=value;}
+ get{return _water_temperature;}
+ }
+ ///
+ /// 电池电压
+ ///
+ public decimal? cell_voltage
+ {
+ set{ _cell_voltage=value;}
+ get{return _cell_voltage;}
+ }
+ ///
+ /// 管径
+ ///
+ public decimal? caliber
+ {
+ set{ _caliber=value;}
+ get{return _caliber;}
+ }
+ ///
+ /// 量程
+ ///
+ public decimal? range
+ {
+ set{ _range=value;}
+ get{return _range;}
+ }
+ ///
+ /// 故障代码
+ ///
+ public string fault_code
+ {
+ set{ _fault_code=value;}
+ get{return _fault_code;}
+ }
+ ///
+ /// 报警码
+ ///
+ public string alarm_code
+ {
+ set{ _alarm_code=value;}
+ get{return _alarm_code;}
+ }
+ ///
+ /// 采集时间
+ ///
+ public DateTime? acquisition_time
+ {
+ set{ _acquisition_time=value;}
+ get{return _acquisition_time;}
+ }
+ ///
+ /// 诊断代码
+ ///
+ public string diagnostic_code
+ {
+ set{ _diagnostic_code=value;}
+ get{return _diagnostic_code;}
+ }
+ ///
+ /// 数据是否有效
+ ///
+ public string is_the_data_valid
+ {
+ set{ _is_the_data_valid=value;}
+ get{return _is_the_data_valid;}
+ }
+ ///
+ /// 创建日期
+ ///
+ public DateTime? create_time
+ {
+ set{ _create_time=value;}
+ get{return _create_time;}
+ }
+ ///
+ /// 备用1
+ ///
+ public string r1
+ {
+ set{ _r1=value;}
+ get{return _r1;}
+ }
+ ///
+ /// 备用2
+ ///
+ public string r2
+ {
+ set{ _r2=value;}
+ get{return _r2;}
+ }
+ ///
+ /// 备用3
+ ///
+ public string r3
+ {
+ set{ _r3=value;}
+ get{return _r3;}
+ }
+ #endregion Model
+
+
+ private bool _isValid;
+ ///
+ /// 数据是否有效
+ ///
+ public bool IsValid { get { return _isValid; } set { _isValid = value; } }
+
+ private string _acquisition_timeA;
+ ///
+ /// 采集时间
+ ///
+ public string acquisition_timeA { get { return _acquisition_timeA; } set { _acquisition_timeA = value; } }
+ }
+}
+