新加协议
This commit is contained in:
parent
255a87096d
commit
faac4132e0
@ -565,6 +565,83 @@ namespace MonitoringTechnology.Ble
|
||||
_message = "系统校时失败";
|
||||
ReceiveValueChangedChanged(null, _message);
|
||||
}
|
||||
break;
|
||||
|
||||
//擦除历史数据功能
|
||||
case 0x08:
|
||||
switch (byteList[6])
|
||||
{
|
||||
case 0x00:
|
||||
_message += "擦除完成";
|
||||
ReceiveValueChangedChanged(null, _message);
|
||||
break;
|
||||
case 0x01:
|
||||
_message += "等待擦除";
|
||||
ReceiveValueChangedChanged(null, _message);
|
||||
break;
|
||||
case 0x02:
|
||||
_message += "擦除失败";
|
||||
ReceiveValueChangedChanged(null, _message);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
//查询历史数据
|
||||
case 0x04:
|
||||
//UTC时间
|
||||
if ((int)byteList[6] == 0 && (int)byteList[7] == 0 && (int)byteList[8] == 0 && (int)byteList[9] == 0)
|
||||
{
|
||||
dt = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = startTime.AddSeconds(Convert.ToInt32(byteList[6].ToString("X2") + byteList[7].ToString("X2") + byteList[8].ToString("X2") + byteList[9].ToString("X2"), 16));
|
||||
}
|
||||
monitoringSensorModel.f_CreateDate = time_DataBase;
|
||||
monitoringSensorModel._datetime_Sensor = dt;
|
||||
|
||||
//温度 10,11,12,13
|
||||
monitoringSensorModel._Tem = tools.bytetofloat(byteList, 10);
|
||||
|
||||
//湿度 14,15,16,17
|
||||
monitoringSensorModel._Hum = tools.bytetofloat(byteList, 14);
|
||||
|
||||
//气压 18,19,20,21
|
||||
monitoringSensorModel._pressure = tools.bytetofloat(byteList, 18);
|
||||
|
||||
//加速度X 22,23,24,25
|
||||
monitoringSensorModel._acceleration_X = tools.bytetofloat(byteList, 22);
|
||||
|
||||
//加速度Y 26,27,28,29
|
||||
monitoringSensorModel._acceleration_Y = tools.bytetofloat(byteList, 26);
|
||||
|
||||
//加速度Z 30,31,32,33
|
||||
monitoringSensorModel._acceleration_Z = tools.bytetofloat(byteList, 30);
|
||||
|
||||
//角速度X 34,35,36,37
|
||||
monitoringSensorModel._angularVelocity_X = tools.bytetofloat(byteList, 34);
|
||||
|
||||
//角速度Y 38,39,40,41
|
||||
monitoringSensorModel._angularVelocity_Y = tools.bytetofloat(byteList, 38);
|
||||
|
||||
//角速度Z 42,43,44,45
|
||||
monitoringSensorModel._angularVelocity_Z = tools.bytetofloat(byteList, 42);
|
||||
|
||||
//角度X 46,47,48,49
|
||||
monitoringSensorModel.degrees_x = tools.bytetofloat(byteList, 46);
|
||||
|
||||
//角度Y 50,51,52,53
|
||||
monitoringSensorModel.degrees_y = tools.bytetofloat(byteList, 50);
|
||||
|
||||
//角度Z 54,55,56,57
|
||||
monitoringSensorModel.degrees_z = tools.bytetofloat(byteList, 54);
|
||||
|
||||
//温度-主系统
|
||||
|
||||
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -222,7 +222,259 @@ namespace MonitoringTechnology.Models
|
||||
set { z = value; this.DoNotify(); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 温度--主系统
|
||||
/// </summary>
|
||||
private int tem;
|
||||
|
||||
public int Tem
|
||||
{
|
||||
get { return tem; }
|
||||
set { tem = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 湿度 --主系统
|
||||
/// </summary>
|
||||
private int hum;
|
||||
|
||||
public int Hum
|
||||
{
|
||||
get { return hum; }
|
||||
set { hum = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 气压 --主系统
|
||||
/// </summary>
|
||||
private int preeure;
|
||||
|
||||
public int Pressure
|
||||
{
|
||||
get { return preeure; }
|
||||
set { preeure = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压1 --主系统
|
||||
/// </summary>
|
||||
private int voltage1;
|
||||
|
||||
public int Voltage1
|
||||
{
|
||||
get { return voltage1; }
|
||||
set { voltage1 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压2 --主系统
|
||||
/// </summary>
|
||||
private int voltage2;
|
||||
|
||||
public int Voltage2
|
||||
{
|
||||
get { return voltage2; }
|
||||
set { voltage2 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压3 --主系统
|
||||
/// </summary>
|
||||
private int voltage3;
|
||||
|
||||
public int Voltage3
|
||||
{
|
||||
get { return voltage3; }
|
||||
set { voltage3 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压4 --主系统
|
||||
/// </summary>
|
||||
private int voltage4;
|
||||
|
||||
public int Voltage4
|
||||
{
|
||||
get { return voltage4; }
|
||||
set { voltage4 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压5 --主系统
|
||||
/// </summary>
|
||||
private int voltage5;
|
||||
|
||||
public int Voltage5
|
||||
{
|
||||
get { return voltage5; }
|
||||
set { voltage5 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压6 --主系统
|
||||
/// </summary>
|
||||
private int voltage6;
|
||||
|
||||
public int Voltage6
|
||||
{
|
||||
get { return voltage6; }
|
||||
set { voltage6 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压7 --主系统
|
||||
/// </summary>
|
||||
private int voltage7;
|
||||
|
||||
public int Voltage7
|
||||
{
|
||||
get { return voltage7; }
|
||||
set { voltage7 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压8 --主系统
|
||||
/// </summary>
|
||||
private int voltage8;
|
||||
|
||||
public int Voltage8
|
||||
{
|
||||
get { return voltage8; }
|
||||
set { voltage8 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压9 --主系统
|
||||
/// </summary>
|
||||
private int voltage9;
|
||||
|
||||
public int Voltage9
|
||||
{
|
||||
get { return voltage9; }
|
||||
set { voltage9 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电压10 --主系统
|
||||
/// </summary>
|
||||
private int voltage10;
|
||||
|
||||
public int Voltage10
|
||||
{
|
||||
get { return voltage10; }
|
||||
set { voltage10 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流1 --主系统
|
||||
/// </summary>
|
||||
private int current1;
|
||||
|
||||
public int Current1
|
||||
{
|
||||
get { return current1; }
|
||||
set { current1 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流2 --主系统
|
||||
/// </summary>
|
||||
private int current2;
|
||||
|
||||
public int Current2
|
||||
{
|
||||
get { return current2; }
|
||||
set { current2 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流3 --主系统
|
||||
/// </summary>
|
||||
private int current3;
|
||||
|
||||
public int Current3
|
||||
{
|
||||
get { return current3; }
|
||||
set { current3 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流4 --主系统
|
||||
/// </summary>
|
||||
private int current4;
|
||||
|
||||
public int Current4
|
||||
{
|
||||
get { return current4; }
|
||||
set { current4 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流5 --主系统
|
||||
/// </summary>
|
||||
private int current5;
|
||||
|
||||
public int Current5
|
||||
{
|
||||
get { return current5; }
|
||||
set { current5 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流6 --主系统
|
||||
/// </summary>
|
||||
private int current6;
|
||||
|
||||
public int Current6
|
||||
{
|
||||
get { return current6; }
|
||||
set { current6 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流7 --主系统
|
||||
/// </summary>
|
||||
private int current7;
|
||||
|
||||
public int Current7
|
||||
{
|
||||
get { return current7; }
|
||||
set { current7 = value; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 电流8 --主系统
|
||||
/// </summary>
|
||||
private int current8;
|
||||
|
||||
public int Current8
|
||||
{
|
||||
get { return current8; }
|
||||
set { current8 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流9 --主系统
|
||||
/// </summary>
|
||||
private int current9;
|
||||
|
||||
public int Current9
|
||||
{
|
||||
get { return current9; }
|
||||
set { current9 = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电流10 --主系统
|
||||
/// </summary>
|
||||
private int current10;
|
||||
|
||||
public int Current10
|
||||
{
|
||||
get { return current10; }
|
||||
set { current10 = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user