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

master
WenJY 3 days ago
parent 73126c24ed
commit 9ad893e7d9

@ -192,6 +192,15 @@ namespace Sln.Iot.Business
iotEnvInstant.vibrationTemp = (decimal)f_vibrationTemp;
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:
byteBlock.Read(out byte[] b_CJSJ, 6);
string strDateTime = "20" + b_CJSJ[5].ToString("x2")

@ -21,7 +21,7 @@ namespace Sln.Iot.Business
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 =>
{
socket.OnOpen = () =>

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

@ -62,6 +62,11 @@ namespace Sln.Iot.Model.dto
/// 振动-温度
/// </summary>
public const uint VibrationTemp = 0x8E54;
/// <summary>
/// 位移
/// </summary>
public const uint Displacement = 0x8E58;
/// <summary>

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

@ -10,10 +10,10 @@
"SqlConfig": [
{
"configId": "tao_iot", //tao:
"dbType": 0, //tidb mysql
"dbType": 1, //tidb mysql
"isFlag": true,
//"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": {

@ -189,13 +189,13 @@
| 0x9010 | 正向有功总电能 | 0x9B0E | 仪表密度值 |
| 0x8030 | 仪表数据采集时间 | | |
| 标识符类型 | 说明 | 标识符类型 | 说明 |
| --- | --- | --- | --- |
| 标识符类型 | 说明 | 标识符类型 | 说明 |
| --- | --- |--------| |
| 0x8E50 | 温湿度.温度 | 0x8E51 | 照度.流明 |
| 0x8E52 | 温湿度.湿度 | 0x8E53 | 噪声.分贝 |
| 0x8E54 | 振动-速度 | 0x8E55 | 振动-位移 |
| 0x8E56 | 振动-加速度 | 0x8E57 | 振动-温度 |
| 0x8030 | 仪表数据采集时间 | | |
| 0x8030 | 仪表数据采集时间 | 0x8E58 | 位移 |
指令样例:

Loading…
Cancel
Save