Init - 初始化管廊物联网数据采集仓库

master
WenJY 3 days ago
parent 73126c24ed
commit 9ad893e7d9

@ -192,6 +192,15 @@ namespace Sln.Iot.Business
iotEnvInstant.vibrationTemp = (decimal)f_vibrationTemp; iotEnvInstant.vibrationTemp = (decimal)f_vibrationTemp;
break; break;
case CommParams.Displacement: //位移
byteBlock.Read(out byte[] displacement, 4);
base._stringChange.SwapBytes(ref displacement);
float f_displacement = BitConverter.ToSingle(displacement, 0);
ValueIsNan(ref f_displacement);
iotEnvInstant.displacement = (decimal)f_displacement;
break;
case CommParams.CJSJ: case CommParams.CJSJ:
byteBlock.Read(out byte[] b_CJSJ, 6); byteBlock.Read(out byte[] b_CJSJ, 6);
string strDateTime = "20" + b_CJSJ[5].ToString("x2") string strDateTime = "20" + b_CJSJ[5].ToString("x2")

@ -21,7 +21,7 @@ namespace Sln.Iot.Business
public void Init() public void Init()
{ {
var server = new Fleck.WebSocketServer($"ws://0.0.0.0:7181"); var server = new Fleck.WebSocketServer($"ws://0.0.0.0:7183");
server.Start(socket => server.Start(socket =>
{ {
socket.OnOpen = () => socket.OnOpen = () =>

@ -99,6 +99,12 @@ namespace Sln.Iot.Model.dao
[SugarColumn(ColumnName = "vibration_temp")] [SugarColumn(ColumnName = "vibration_temp")]
public decimal vibrationTemp { get; set; } public decimal vibrationTemp { get; set; }
/// <summary>
/// 位移
/// </summary>
[SugarColumn(ColumnName = "displacement")]
public decimal displacement{get;set;}
/// <summary> /// <summary>
/// 采集时间 /// 采集时间

@ -63,6 +63,11 @@ namespace Sln.Iot.Model.dto
/// </summary> /// </summary>
public const uint VibrationTemp = 0x8E54; public const uint VibrationTemp = 0x8E54;
/// <summary>
/// 位移
/// </summary>
public const uint Displacement = 0x8E58;
/// <summary> /// <summary>
/// 采集时间 /// 采集时间

@ -79,7 +79,7 @@ namespace Sln.Iot
} }
}; };
ServiceProvider.UseSerialPortExtensions(); //ServiceProvider.UseSerialPortExtensions();
await Task.Delay(-1); await Task.Delay(-1);
} }

@ -10,10 +10,10 @@
"SqlConfig": [ "SqlConfig": [
{ {
"configId": "tao_iot", //tao: "configId": "tao_iot", //tao:
"dbType": 0, //tidb mysql "dbType": 1, //tidb mysql
"isFlag": true, "isFlag": true,
//"connStr": "server=127.0.0.1;Port=4000;Database=tao_iot;Uid=root;" //Pwd=haiwei@123; //"connStr": "server=127.0.0.1;Port=4000;Database=tao_iot;Uid=root;" //Pwd=haiwei@123;
"connStr": "server=1.13.177.47;Port=3306;Database=tao_iot;Uid=root;Pwd=Haiwei123456;" "connStr": "server=119.45.202.115;uid=sa;pwd=haiwei@123;database=energy-visual;Encrypt=True;TrustServerCertificate=True;"
} }
], ],
"serialPortConfig": { "serialPortConfig": {

@ -190,12 +190,12 @@
| 0x8030 | 仪表数据采集时间 | | | | 0x8030 | 仪表数据采集时间 | | |
| 标识符类型 | 说明 | 标识符类型 | 说明 | | 标识符类型 | 说明 | 标识符类型 | 说明 |
| --- | --- | --- | --- | | --- | --- |--------| |
| 0x8E50 | 温湿度.温度 | 0x8E51 | 照度.流明 | | 0x8E50 | 温湿度.温度 | 0x8E51 | 照度.流明 |
| 0x8E52 | 温湿度.湿度 | 0x8E53 | 噪声.分贝 | | 0x8E52 | 温湿度.湿度 | 0x8E53 | 噪声.分贝 |
| 0x8E54 | 振动-速度 | 0x8E55 | 振动-位移 | | 0x8E54 | 振动-速度 | 0x8E55 | 振动-位移 |
| 0x8E56 | 振动-加速度 | 0x8E57 | 振动-温度 | | 0x8E56 | 振动-加速度 | 0x8E57 | 振动-温度 |
| 0x8030 | 仪表数据采集时间 | | | | 0x8030 | 仪表数据采集时间 | 0x8E58 | 位移 |
指令样例: 指令样例:

Loading…
Cancel
Save