Browse Source

[feat] 更新震动服务命令

master
fajiao 1 year ago
parent
commit
c82e97ee9a
  1. 6
      EC.Util/CameraSDK/HiK/HiKSDK.cs
  2. 21
      EC.Util/CameraSDK/YuShi/YuShiSDK.cs
  3. 3
      EC.Util/Common/LogUnit.cs
  4. 10
      JiLinApp.Docking/FenceAlarm/Entity/UdpAlarmHost.cs
  5. 28
      JiLinApp.Docking/FenceAlarm/Service/UdpManager.cs
  6. 2
      JiLinApp.Docking/Military/Config.cs
  7. 13
      JiLinApp.Docking/Military/MilitaryService.cs
  8. 8
      JiLinApp.Docking/VibrateAlarm/Entity/ClientMessage.cs
  9. 117
      JiLinApp.Docking/VibrateAlarm/Service/TcpManager.cs
  10. 6
      JiLinApp/Components/CameraRealPlay.xaml
  11. 42
      JiLinApp/Pages/PtzManage/Main.xaml.cs
  12. 18
      JiLinApp/Pages/VibrateServerManage/Main.xaml.cs

6
EC.Util/CameraSDK/HiK/HiKSDK.cs

@ -126,7 +126,7 @@ public class HiKSDK : ICameraSDK
if (!ConnectSuccess()) return false;
int lChannel = 1;
bool flag = HiKOriSDK.NET_DVR_PTZControlWithSpeed_Other(LoginId, lChannel, (uint)cmd, (uint)stop, (uint)speed);
//if (flag) BuildException();
if (flag) BuildException();
return flag;
}
@ -134,7 +134,9 @@ public class HiKSDK : ICameraSDK
{
if (!ConnectSuccess()) return false;
int lChannel = 1;
return HiKOriSDK.NET_DVR_PTZPreset_Other(LoginId, lChannel, (uint)cmd, (uint)presetId);
bool flag = HiKOriSDK.NET_DVR_PTZPreset_Other(LoginId, lChannel, (uint)cmd, (uint)presetId);
if (flag) BuildException();
return flag;
}
#endregion Ptz Method

21
EC.Util/CameraSDK/YuShi/YuShiSDK.cs

@ -64,11 +64,9 @@ public class YuShiSDK : ICameraSDK
{
bool ret = ConnectSuccess();
if (!ret) return PtzInfo.Default;
YuShiOriSDK.NETDEV_PTZ_STATUS_S entity = new();
ret = YuShiOriSDK.NETDEV_PTZGetStatus(LoginId, 1, ref entity);
if (!ret) { BuildException(); return PtzInfo.Default; }
return PtzInfo.New(entity.fPanTiltX, entity.fPanTiltY, entity.fZoomX);
}
@ -76,11 +74,9 @@ public class YuShiSDK : ICameraSDK
{
bool ret = ConnectSuccess();
if (!ret) { ptzInfo = PtzInfo.Default; return false; }
YuShiOriSDK.NETDEV_PTZ_STATUS_S entity = new();
ret = YuShiOriSDK.NETDEV_PTZGetStatus(LoginId, 1, ref entity);
if (!ret) { BuildException(); ptzInfo = PtzInfo.Default; return false; }
ptzInfo = PtzInfo.New(entity.fPanTiltX, entity.fPanTiltY, entity.fZoomX);
return true;
}
@ -89,18 +85,21 @@ public class YuShiSDK : ICameraSDK
{
if (!ConnectSuccess()) return false;
if (stop == 1) cmd = YuShiOriSDK.ALLSTOP;
int channel = 1;
int flag = YuShiOriSDK.NETDEV_PTZControl_Other(LoginId, channel, cmd, speed);
//if (flag) BuildException();
return flag == YuShiOriSDK.TRUE;
int channel = 0;
int ret = YuShiOriSDK.NETDEV_PTZControl_Other(LoginId, channel, cmd, speed);
bool flag = ret == YuShiOriSDK.TRUE;
if (!flag) BuildException();
return flag;
}
public override bool PtzPreset(int cmd, int presetId)
{
if (!ConnectSuccess()) return false;
int channel = 1;
int flag = YuShiOriSDK.NETDEV_PTZPreset_Other(LoginId, channel, cmd, Array.Empty<byte>(), presetId);
return flag == YuShiOriSDK.TRUE;
int channel = 0;
int ret = YuShiOriSDK.NETDEV_PTZPreset_Other(LoginId, channel, cmd, Array.Empty<byte>(), presetId);
bool flag = ret == YuShiOriSDK.TRUE;
if (!flag) BuildException();
return flag;
}
#endregion Ptz Method

3
EC.Util/Common/LogUnit.cs

@ -9,7 +9,8 @@ public static class LogUnit
static LogUnit()
{
string fileName = Path.Combine("config", "log4net.Config");
string fileName = Path.Combine("config", "log4net.config");
if (!File.Exists(fileName)) throw new FileNotFoundException(fileName);
XmlConfigurator.Configure(new FileInfo(fileName));
logger = LogManager.GetLogger(typeof(LogUnit));
}

10
JiLinApp.Docking/FenceAlarm/Entity/UdpAlarmHost.cs

@ -112,6 +112,16 @@ public class UdpAlarmHost
public ConcurrentDictionary<int, SectorState> SectorDict { get; }
public bool SectorsEmpty
{
get
{
return SectorDict == null || SectorDict.IsEmpty;
}
}
public ReaderWriterLockSlim SectorsLock { get; } = new();
public int OnlineState { get; set; }//设备在线状态
public int KeepLive { get; set; }//设备在线状态

28
JiLinApp.Docking/FenceAlarm/Service/UdpManager.cs

@ -103,8 +103,8 @@ public class UdpManager
//解码
byte[] msg = AlarmEncode.DecodeMessage(e.Datagram);
bool vaild = msg.Length >= 8 && msg[2] == AlarmEncode.Head[0] && msg[3] == AlarmEncode.Head[1];
Console.WriteLine("Receive from {0}:{1} => {2}, {3}", ipep.Address.ToString(), ipep.Port, DataMessage.ToHexString(msg), vaild);
if (!vaild) return;
Console.WriteLine("Receive from {0}:{1} => {2}", ipep.Address.ToString(), ipep.Port, DataMessage.ToHexString(msg));
//解析
DeviceCmd deviceCmd = (DeviceCmd)msg[4];
switch (deviceCmd)
@ -158,7 +158,7 @@ public class UdpManager
OnlineState = 1,
KeepLive = Config.DeviceHeartKeep
};
AddDevice(deviceId, device);
AddDevice(deviceId, ref device);
}
byte defenceState = msg[17];
ProcessDeviceStateEvent(ref device, 1, defenceState);
@ -205,7 +205,7 @@ public class UdpManager
OnlineState = 1,
KeepLive = Config.DeviceHeartKeep
};
AddDevice(deviceId, device);
AddDevice(deviceId, ref device);
}
string alarmTime = $"20{GetBCD(msg[17])}-{GetBCD(msg[18])}-{GetBCD(msg[19])} " +
$"{GetBCD(msg[20])}:{GetBCD(msg[21])}:{GetBCD(msg[22])}";
@ -244,7 +244,7 @@ public class UdpManager
OnlineState = 1,
KeepLive = Config.DeviceHeartKeep
};
AddDevice(deviceId, device);
AddDevice(deviceId, ref device);
}
device.SectorTotal = msg[17] * 256 + msg[18];
int sectorNum = msg[19], startIndex = msg[20];
@ -283,7 +283,7 @@ public class UdpManager
OnlineState = 1,
KeepLive = Config.DeviceHeartKeep
};
AddDevice(deviceId, device);
AddDevice(deviceId, ref device);
}
}
@ -303,7 +303,7 @@ public class UdpManager
OnlineState = 1,
KeepLive = Config.DeviceHeartKeep
};
AddDevice(deviceId, device);
AddDevice(deviceId, ref device);
}
device.SectorTotal = msg[17] * 256 + msg[18];
}
@ -616,10 +616,24 @@ public class UdpManager
return DeviceDict.TryGetValue(deviceId, out device);
}
private bool AddDevice(int deviceId, UdpAlarmHost device)
private bool AddDevice(int deviceId, ref UdpAlarmHost device)
{
if (ContainsDevice(deviceId)) return false;
DeviceDict[deviceId] = device;
UdpAlarmHost innerDevice = DeviceDict[deviceId];
if (innerDevice.SectorsEmpty && innerDevice.SectorsLock.TryEnterWriteLock(1000))
{
Task.Run(() =>
{
innerDevice = DeviceDict[deviceId];
while (innerDevice.SectorsEmpty)
{
SearchAllSectorState(innerDevice.DeviceId);
Thread.Sleep(1000);
}
innerDevice.SectorsLock.ExitWriteLock();
});
}
return true;
}

2
JiLinApp.Docking/Military/Config.cs

@ -2,6 +2,8 @@
public class MilitaryConfig
{
//public bool Enable { get; set; }
public string Url { get; set; }
public string UserName { get; set; }

13
JiLinApp.Docking/Military/MilitaryService.cs

@ -28,6 +28,11 @@ public class MilitaryService
return Config.Url;
}
private IFlurlRequest WithToken(string url)
{
return url.WithHeader("X-Access-Token", Token);
}
#endregion Base
#region Cmd
@ -43,7 +48,7 @@ public class MilitaryService
JObject response = new();
for (int i = 0; i < Config.RequestRetryTime; i++)
{
response = url.PostJsonAsync(data).ReceiveJson<JObject>().Result;
response = WithToken(url).PostJsonAsync(data).ReceiveJson<JObject>().Result;
bool success = response["success"].ToBoolean();
if (!success)
{
@ -63,7 +68,7 @@ public class MilitaryService
JObject response = new();
for (int i = 0; i < Config.RequestRetryTime; i++)
{
response = url.GetAsync().ReceiveJson<JObject>().Result;
response = WithToken(url).GetAsync().ReceiveJson<JObject>().Result;
bool success = response["success"].ToBoolean();
if (!success)
{
@ -101,7 +106,7 @@ public class MilitaryService
JObject response = new();
for (int i = 0; i < Config.RequestRetryTime; i++)
{
response = url.WithHeader("X-Access-Token", Token).GetAsync().ReceiveJson<JObject>().Result;
response = WithToken(url).GetAsync().ReceiveJson<JObject>().Result;
bool success = response["success"].ToBoolean();
if (!success)
{
@ -120,7 +125,7 @@ public class MilitaryService
JObject response = new();
for (int i = 0; i < Config.RequestRetryTime; i++)
{
response = url.GetAsync().ReceiveJson<JObject>().Result;
response = WithToken(url).GetAsync().ReceiveJson<JObject>().Result;
bool success = response["success"].ToBoolean();
if (!success)
{

8
JiLinApp.Docking/VibrateAlarm/Entity/ClientMessage.cs

@ -33,6 +33,14 @@ public class ClientMessage
public int OnlineState { get; set; }//设备在线状态
public bool IsOnline
{
get
{
return Host != null && Host.Id >= 0 && OnlineState == 1;
}
}
public int SensorTotal
{
get

117
JiLinApp.Docking/VibrateAlarm/Service/TcpManager.cs

@ -91,6 +91,7 @@ public class TcpManager
{
foreach (var clientMsg in DeviceDict.Values)
{
if (!clientMsg.IsOnline) continue;
SendHostHeart_01(clientMsg);
}
}
@ -144,22 +145,20 @@ public class TcpManager
#endregion Events
#region Analysisbo
#region Analysis
private void AnalysisClientMessage(ref ClientMessage clientMsg)
{
//AA AA 01 C0 A8 01 05 28 23 C0 A8 01 64 88 13 7C 04 02 04 00 2B
//AA AA 01 C0 A8 01 64 88 13 C0 A8 01 05 28 23 24 14 04 0A 00 02 00 03
List<byte[]> msglist = clientMsg.GetMessageList();
if (msglist == null || msglist.Count == 0) return;
for (int i = 0; i < msglist.Count; i++)
{
byte[] msg = msglist[i];
bool vaild = msg.Length >= 19 && msg[0] == 0xAA && msg[1] == 0xAA;
Console.WriteLine("Receive from {0}:{1} => {2}, {3}", clientMsg.Ip, clientMsg.Port, DataMessage.ToHexString(msg), vaild);
if (!vaild) continue;
DataMessage mm = new();
mm.Decode(msglist[i]);
Console.WriteLine("Receive from {0}:{1} => {2}, {3}", clientMsg.Ip, clientMsg.Port, DataMessage.ToHexString(msglist[i]), JsonUtil.ToJson(mm));
switch (mm.FunctionNum)
{
case 0x00:
@ -168,26 +167,31 @@ public class TcpManager
{
clientMsg.Host = new() { Id = mm.DeviceId, Ip = mm.SendIp, Port = mm.SendPort.ToString() };
UpdateDevice(clientMsg.Ip, clientMsg.Host);
ProcessDeviceStateEvent(ref clientMsg, 1);
}
ProcessDeviceStateEvent(ref clientMsg, 1);
ResponseHostLogin_10(clientMsg, mm);
ClientMessage clientMsg2 = clientMsg;
if (clientMsg2.SensorsEmpty && clientMsg2.SensorsLock.TryEnterWriteLock(1000))
ClientMessage taskClientMsg = clientMsg;
if (taskClientMsg.SensorsEmpty && taskClientMsg.SensorsLock.TryEnterWriteLock(1000))
{
Task.Run(() =>
{
while (clientMsg2.SensorsEmpty)
while (taskClientMsg.SensorsEmpty)
{
RequestSensorList_07(clientMsg2);
RequestSensorList_07(taskClientMsg);
Thread.Sleep(1000);
}
clientMsg2.SensorsLock.ExitWriteLock();
taskClientMsg.SensorsLock.ExitWriteLock();
});
}
break;
case 0x01:
Console.WriteLine("心跳:{0}", clientMsg.Ip);
if (clientMsg.Host == null || clientMsg.Host.Id != mm.DeviceId)
{
clientMsg.Host = new() { Id = mm.DeviceId, Ip = mm.SendIp, Port = mm.SendPort.ToString() };
UpdateDevice(clientMsg.Ip, clientMsg.Host);
}
ProcessDeviceStateEvent(ref clientMsg, 1);
break;
@ -202,16 +206,11 @@ public class TcpManager
break;
case 0x14:
Console.WriteLine("传感器状态响应:{0}", clientMsg.Ip);
Console.WriteLine("传感器轮询状态响应:{0}", clientMsg.Ip);
int sensorAddr = mm.Data[0] + mm.Data[1] * 256;
int state = mm.Data[2] + mm.Data[3] * 256;
int online = state % 2;
int alarm = state / 2 % 2;
if (clientMsg.Host == null || clientMsg.Host.Id != mm.DeviceId)
{
clientMsg.Host = new() { Id = mm.DeviceId, Ip = mm.SendIp, Port = mm.SendPort.ToString() };
UpdateDevice(clientMsg.Ip, clientMsg.Host);
}
ProcessSensorStateEvent(ref clientMsg, mm, sensorAddr, online, alarm);
SetDataRequest(mm, 0x04);
break;
@ -223,11 +222,6 @@ public class TcpManager
case 0x17:
Console.WriteLine("返回传感器列表:{0}", clientMsg.Ip);
if (clientMsg.Host == null || clientMsg.Host.Id != mm.DeviceId)
{
clientMsg.Host = new() { Id = mm.DeviceId, Ip = mm.SendIp, Port = mm.SendPort.ToString() };
UpdateDevice(clientMsg.Ip, clientMsg.Host);
}
if (clientMsg.SensorsEmpty)
{
for (int j = 2; j < mm.Data.Length; j++)
@ -236,10 +230,16 @@ public class TcpManager
SensorState sensor = new(mm.DeviceId, sensorAddr, 0, 0);
clientMsg.SensorDict[sensorAddr] = sensor;
}
RequestSensorState_04(clientMsg);
RequestSensorsStateActively_08(clientMsg);
}
SetDataRequest(mm, 0x07);
break;
case 0x18:
Console.WriteLine("传感器主动状态响应:{0}", clientMsg.Ip);
SetDataRequest(mm, 0x08);
break;
}
}
}
@ -296,7 +296,7 @@ public class TcpManager
OnVibrateTcpAlarm?.Invoke(alarmMsg);
}
#endregion Analysisbo
#endregion Analysis
#region Send
@ -337,29 +337,40 @@ public class TcpManager
public bool SendHostHeart_01(ClientMessage client)
{
if (client.Host == null) return false;
if (!client.IsOnline) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x01, 1);
msg.Data = new byte[] { 0xFF };
return SendNoRequest(msg);
}
public bool RequestSensorChange_02(ClientMessage client)
public bool RequestSensorChange_02(ClientMessage client, int newSensorAddr)
{
if (client.Host == null || client.Host.Id < 0) return false;
if (!client.IsOnline) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x02, 4);
int channel = 10;
msg.Data = new byte[] { (byte)(channel % 256), (byte)(channel / 256), (100 % 256), (100 / 256) };
msg.Data = new byte[] { (byte)(newSensorAddr % 256), (byte)(newSensorAddr / 256), (100 % 256), (100 / 256) };
DataRequest request = new()
{
Request = msg
};
SendRequest(ref request);
return true;
return SendRequest(ref request);
}
public bool RequestSensorState_04(ClientMessage client, int sensorAddr)
{
if (!client.IsOnline) return false;
if (!client.SensorDict.TryGetValue(sensorAddr, out _)) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x04, 2);
msg.Data = new byte[] { (byte)(sensorAddr % 256), (byte)(sensorAddr / 256) };
DataRequest request = new()
{
Request = msg
};
return SendRequest(ref request);
}
public bool RequestSensorState_04(ClientMessage client)
public bool RequestSensorsState_04(ClientMessage client)
{
if (client.Host == null || client.Host.Id < 0) return false;
if (!client.IsOnline) return false;
if (client.SensorsEmpty) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x04, 2);
foreach (var item in client.SensorDict.Values)
@ -377,21 +388,20 @@ public class TcpManager
public bool RequestSensorReset_05(ClientMessage client, int sensorAddr)
{
if (client.Host == null || client.Host.Id < 0) return false;
if (client.SensorsEmpty) return false;
if (!client.IsOnline) return false;
if (!client.SensorDict.TryGetValue(sensorAddr, out _)) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x05, 2);
msg.Data = new byte[] { (byte)(sensorAddr % 256), (byte)(sensorAddr / 256) };
DataRequest request = new()
{
Request = msg
};
SendRequest(ref request);
return true;
return SendRequest(ref request);
}
public bool RequestSensorList_07(ClientMessage client)
{
if (client.Host == null || client.Host.Id < 0) return false;
if (!client.IsOnline) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x07, 0);
DataRequest request = new()
{
@ -400,9 +410,40 @@ public class TcpManager
return SendRequest(ref request);
}
public bool RequestSensorStateActively_08(ClientMessage client, int sensorAddr)
{
if (!client.IsOnline) return false;
if (!client.SensorDict.TryGetValue(sensorAddr, out _)) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x08, 2);
msg.Data = new byte[] { (byte)(sensorAddr % 256), (byte)(sensorAddr / 256) };
DataRequest request = new()
{
Request = msg
};
return SendRequest(ref request);
}
public bool RequestSensorsStateActively_08(ClientMessage client)
{
if (!client.IsOnline) return false;
if (client.SensorsEmpty) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x08, 2);
foreach (var item in client.SensorDict.Values)
{
int sensorAddr = item.Addr;
msg.Data = new byte[] { (byte)(sensorAddr % 256), (byte)(sensorAddr / 256) };
DataRequest request = new()
{
Request = msg
};
SendRequest(ref request);
}
return true;
}
public bool ResponseHostLogin_10(ClientMessage client, DataMessage mm)
{
if (client.Host == null) return false;
if (!client.IsOnline) return false;
DataMessage msg = GetSendMessageHead(client.Host.Id, client, 0x10, 0);
msg.FrameNum = mm.FrameNum;
return SendResponse(msg);

6
JiLinApp/Components/CameraRealPlay.xaml

@ -125,7 +125,7 @@
</StackPanel>
<StackPanel Grid.Row="6" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Name="IrisCloseBtn" Width="25" Height="25" Padding="0" Style="{StaticResource MaterialDesignOutlinedLightButton}">
<materialDesign:PackIcon Kind="MinusThick"/>
<materialDesign:PackIcon Kind="MinusThick" />
</Button>
</StackPanel>
@ -135,8 +135,8 @@
</ComboBox>
</StackPanel>
<StackPanel Grid.Row="9" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Name="GotoBtn" Content="前往预置点" Width="90" Height="30" Click="GotoBtn_Click" Style="{StaticResource MaterialDesignOutlinedLightButton}"
Padding="0" FontSize="11" Foreground="#000000" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Button Name="GotoBtn" Content="前往预置点" Width="90" Height="30" Click="GotoBtn_Click" Style="{StaticResource MaterialDesignOutlinedLightButton}"
Padding="0" FontSize="11" Foreground="#000000" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</StackPanel>
</Grid>
</StackPanel>

42
JiLinApp/Pages/PtzManage/Main.xaml.cs

@ -320,20 +320,24 @@ public partial class Main : UserControl
bool realPlay = AppConfig.AlarmPlatform.RealPlay;
string deviceId = alarm.LabelCode;
string sensorId = alarm.ChannelId;
CameraLinkageInfo cameraLinkage = GetCameraLinkage(sensorId);
if (cameraLinkage == null) { LogUnit.Error(this, $"CameraLinkageInfo(sensorId:{sensorId}) not found."); return; }
string cameraId = cameraLinkage.CameraId;
ICameraSDK cameraSdk = GetCameraSdk(cameraId);
if (cameraSdk == null) { LogUnit.Error(this, $"CameraSdk(cameraId:{cameraId}) not found."); return; }
if (realPlay) Dispatcher.Invoke(() => ShowLiveVideo(cameraSdk));
// TODO: 设计 PriorityQueue
int len = cameraLinkage.PresetIds.Length;
for (int i = 0; i < len; i++)
//CameraLinkageInfo cameraLinkage = GetCameraLinkage(sensorId);
List<CameraLinkageInfo> cameraLinkages = GetCameraLinkageList(sensorId);
foreach (var item in cameraLinkages)
{
int presetId = cameraLinkage.PresetIds[i];
PtzCameraCmd.PtzMove(cameraSdk, PtzCmdType.PresetGoto, new int[] { presetId });
if (i != len) Thread.Sleep(5000);
if (item == null) { LogUnit.Error(this, $"CameraLinkageInfo(sensorId:{sensorId}) not found."); return; }
string cameraId = item.CameraId;
ICameraSDK cameraSdk = GetCameraSdk(cameraId);
if (cameraSdk == null) { LogUnit.Error(this, $"CameraSdk(cameraId:{cameraId}) not found."); return; }
if (realPlay) Dispatcher.Invoke(() => ShowLiveVideo(cameraSdk));
// TODO: 设计 PriorityQueue
int len = item.PresetIds.Length;
for (int i = 0; i < len; i++)
{
int presetId = item.PresetIds[i];
PtzCameraCmd.PtzMove(cameraSdk, PtzCmdType.PresetGoto, new int[] { presetId });
if (i != len) Thread.Sleep(5000);
}
}
}
@ -377,6 +381,8 @@ public partial class Main : UserControl
{
List<CameraInfo> cameraList = MilitaryService.GetCameraList();
CameraLinkageList = MilitaryService.GetCameraLinkageList();
//List<CameraInfo> cameraList = new();
//CameraLinkageList = new();
TaskUtil.RunCatch(() => Dispatcher.Invoke(() => LoadCameraSdkDict(cameraList)));
}
@ -409,6 +415,16 @@ public partial class Main : UserControl
return null;
}
private List<CameraLinkageInfo> GetCameraLinkageList(string sensorId)
{
List<CameraLinkageInfo> list = new();
foreach (var item in CameraLinkageList)
{
if (sensorId.Equals(item.SensorId)) list.Add(item);
}
return list;
}
private ICameraSDK GetCameraSdk(string cameraId)
{
foreach (var item in CameraSdkDict.Values)

18
JiLinApp/Pages/VibrateServerManage/Main.xaml.cs

@ -122,14 +122,6 @@ public partial class Main : UserControl
onlineState = item.OnlineState
});
}
//for (int i = 1; i <= 5; i++)
//{
// respDeviceList.Add(new
// {
// id = i,
// onlineState = i % 2
// });
//}
AlarmService.SendDevices(DeviceType.Vibrate, respDeviceList);
}
@ -148,16 +140,6 @@ public partial class Main : UserControl
alarmState = item.AlarmState,
});
}
//for (int i = 1; i <= 7; i++)
//{
// respSensorList.Add(new
// {
// id = i,
// deviceId = deviceId,
// onlineState = i % 2,
// alarmState = i % 2,
// });
//}
AlarmService.SendSensors(DeviceType.Vibrate, deviceId, respSensorList);
}

Loading…
Cancel
Save