diff --git a/EC.Entity/CameraInfo/IpcInfo.cs b/EC.Entity/CameraInfo/IpcInfo.cs
new file mode 100644
index 0000000..7559013
--- /dev/null
+++ b/EC.Entity/CameraInfo/IpcInfo.cs
@@ -0,0 +1,40 @@
+#nullable disable
+
+using EC.Entity.PublicModel;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace EC.Entity.CameraInfo
+{
+ public partial class IpcInfo : BaseEntity
+ {
+ [NotMapped]
+ public int Number { get; set; }
+
+ public long IpcId { get; set; }
+ public string IpcName { get; set; }
+ public string NvrName { get; set; }
+ public string IpcType { get; set; }
+ public string IpcIp { get; set; }
+ public string OnvifAddr { get; set; }
+ public string MediaAddr { get; set; }
+ public string PtzAddr { get; set; }
+ public string RtspMain { get; set; }
+ public string RtspSub { get; set; }
+ public string IpcPosition { get; set; }
+ public string IpcImage { get; set; }
+ public long? IpcX { get; set; }
+ public long? IpcY { get; set; }
+ public string UserName { get; set; }
+ public string UserPwd { get; set; }
+ public string IpcEnable { get; set; }
+
+ [NotMapped]
+ public bool IpcEnableBool
+ {
+ get => IpcEnable != null && IpcEnable.Equals("启用");
+ set => IpcEnable = value ? "启用" : "禁用";
+ }
+
+ public string IpcAddr { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/CameraInfo/LogInfo.cs b/EC.Entity/CameraInfo/LogInfo.cs
new file mode 100644
index 0000000..2b1d47e
--- /dev/null
+++ b/EC.Entity/CameraInfo/LogInfo.cs
@@ -0,0 +1,15 @@
+#nullable disable
+
+namespace EC.Entity.CameraInfo
+{
+ public partial class LogInfo
+ {
+ public long LogId { get; set; }
+ public string TriggerTime { get; set; }
+ public string UserName { get; set; }
+ public string LogCh { get; set; }
+ public string LogType { get; set; }
+ public string LogContent { get; set; }
+ public string LogMark { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/CameraInfo/NvrInfo.cs b/EC.Entity/CameraInfo/NvrInfo.cs
new file mode 100644
index 0000000..203ef96
--- /dev/null
+++ b/EC.Entity/CameraInfo/NvrInfo.cs
@@ -0,0 +1,29 @@
+#nullable disable
+
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace EC.Entity.CameraInfo
+{
+ public partial class NvrInfo
+ {
+ [NotMapped]
+ public int Number { get; set; }
+
+ public long NvrId { get; set; }
+ public string NvrName { get; set; }
+ public string NvrType { get; set; }
+ public string NvrIp { get; set; }
+ public string UserName { get; set; }
+ public string UserPwd { get; set; }
+ public string NvrEnable { get; set; }
+
+ [NotMapped]
+ public bool NvrEnableBool
+ {
+ get => NvrEnable != null && NvrEnable.Equals("启用");
+ set => NvrEnable = value ? "启用" : "禁用";
+ }
+
+ public string NvrAddr { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/CameraInfo/PollInfo.cs b/EC.Entity/CameraInfo/PollInfo.cs
new file mode 100644
index 0000000..9716dfc
--- /dev/null
+++ b/EC.Entity/CameraInfo/PollInfo.cs
@@ -0,0 +1,12 @@
+#nullable disable
+
+namespace EC.Entity.CameraInfo
+{
+ public partial class PollInfo
+ {
+ public long PollId { get; set; }
+ public string PollGroup { get; set; }
+ public string RtspMain { get; set; }
+ public string RtspSub { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/CameraInfo/UserInfo.cs b/EC.Entity/CameraInfo/UserInfo.cs
new file mode 100644
index 0000000..7228fe7
--- /dev/null
+++ b/EC.Entity/CameraInfo/UserInfo.cs
@@ -0,0 +1,12 @@
+#nullable disable
+
+namespace EC.Entity.CameraInfo
+{
+ public partial class UserInfo
+ {
+ public string UserName { get; set; }
+ public string UserPwd { get; set; }
+ public string UserType { get; set; }
+ public string UserAdmin { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/EC.Entity.csproj b/EC.Entity/EC.Entity.csproj
new file mode 100644
index 0000000..626d577
--- /dev/null
+++ b/EC.Entity/EC.Entity.csproj
@@ -0,0 +1,23 @@
+
+
+
+ net5.0-windows7.0
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EC.Entity/PublicModel/BaseEntity.cs b/EC.Entity/PublicModel/BaseEntity.cs
new file mode 100644
index 0000000..9106b93
--- /dev/null
+++ b/EC.Entity/PublicModel/BaseEntity.cs
@@ -0,0 +1,80 @@
+using Newtonsoft.Json;
+using System;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Reflection;
+
+namespace EC.Entity.PublicModel
+{
+ public class BaseEntity : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public bool SetValue(string propertyName, string value)
+ {
+ if (!ContainProperty(propertyName)) { return false; }
+ try
+ {
+ Type type = GetType();
+ object objVal = Convert.ChangeType(value, type.GetProperty(propertyName).PropertyType);
+ type.GetProperty(propertyName).SetValue(this, objVal, null);
+ OnPropertyChanged(propertyName);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public object GetValue(string propertyName)
+ {
+ if (!ContainProperty(propertyName)) { return null; }
+ try
+ {
+ Type type = GetType();
+ object objVal = type.GetProperty(propertyName).GetValue(this, null);
+ return objVal;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// 利用反射来判断对象是否包含某个属性
+ ///
+ /// object
+ /// 需要判断的属性
+ /// 是否包含
+ public bool ContainProperty(string propertyName)
+ {
+ if (this != null && !string.IsNullOrEmpty(propertyName))
+ {
+ PropertyInfo _findedPropertyInfo = GetType().GetProperty(propertyName);
+ return _findedPropertyInfo != null;
+ }
+ return false;
+ }
+
+ [NotMapped]
+ public string FaultUri { get; set; } = "-1";
+
+ public virtual bool IsUriGain(string uri)
+ {
+ return !(string.IsNullOrEmpty(uri) || uri.Equals(FaultUri, StringComparison.Ordinal));
+ }
+
+ public virtual T DeepCopy()
+ {
+ string json = JsonConvert.SerializeObject(this);
+ return JsonConvert.DeserializeObject(json);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/PublicModel/Enums.cs b/EC.Entity/PublicModel/Enums.cs
new file mode 100644
index 0000000..b133fbe
--- /dev/null
+++ b/EC.Entity/PublicModel/Enums.cs
@@ -0,0 +1,22 @@
+namespace EC.Entity.PublicModel
+{
+ public enum VidoeType
+ {
+ Default,
+
+ ///
+ /// 海康
+ ///
+ HK,
+
+ ///
+ /// 大华
+ ///
+ DH,
+
+ ///
+ /// 宇视觉
+ ///
+ YS
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Video/MonitorCamera.cs b/EC.Entity/Video/MonitorCamera.cs
new file mode 100644
index 0000000..ab070b3
--- /dev/null
+++ b/EC.Entity/Video/MonitorCamera.cs
@@ -0,0 +1,232 @@
+using System;
+
+namespace EC.Entity.Video
+{
+ public class MonitorCamera
+ {
+ public MonitorCamera()
+ {
+ }
+
+ ///
+ /// 主键
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// 站点id
+ ///
+ public string SiteId { get; set; }
+
+ ///
+ /// 相机名称
+ ///
+ public string CameraName { get; set; }
+
+ ///
+ /// 相机类型
+ ///
+ public int Type { get; set; }
+
+ ///
+ /// 相机ip
+ ///
+ public string Ip { get; set; }
+
+ ///
+ /// 相机端口
+ ///
+ public int Port { get; set; }
+
+ ///
+ /// 认证用户名
+ ///
+ public string User { get; set; }
+
+ ///
+ /// 认证密码
+ ///
+ public string Password { get; set; }
+
+ ///
+ /// 纬度
+ ///
+ public decimal Latitude { get; set; }
+
+ ///
+ /// 经度
+ ///
+ public decimal Longitude { get; set; }
+
+ ///
+ /// 高度
+ ///
+ public decimal Height { get; set; }
+
+ ///
+ /// Rtsp地址
+ ///
+ public string PreRtsp { get; set; }
+
+ ///
+ /// 分析 Rtsp 地址
+ ///
+ public string AnalysisRtsp { get; set; }
+
+ ///
+ /// 录像 Rtsp 地址通道3
+ ///
+ public string RecordRtsp { get; set; }
+
+ ///
+ /// 云台控制ip
+ ///
+ public string CloudCtrlIp { get; set; }
+
+ ///
+ /// 云台控制端口
+ ///
+ public int CloudCtrlPort { get; set; }
+
+ ///
+ /// 流媒体服务器id
+ ///
+ public string StreamingMediaId { get; set; }
+
+ ///
+ /// 录像机id
+ ///
+ public string VideoRecorderId { get; set; }
+
+ ///
+ ///
+ ///
+ public int Factory { get; set; }
+
+ ///
+ /// 相机预览通道
+ ///
+ public int Channel { get; set; }
+
+ ///
+ /// 样式
+ ///
+ public int Style { get; set; }
+
+ ///
+ /// 左夹角
+ ///
+ public double LeftAngle { get; set; }
+
+ ///
+ /// 右夹角
+ ///
+ public double RightAngle { get; set; }
+
+ ///
+ /// 视野中央有效距离
+ ///
+ public double ViewDistance { get; set; }
+
+ ///
+ /// 采样帧率
+ ///
+ public int FrameRate { get; set; }
+
+ ///
+ /// 最大跟踪范围
+ ///
+ public int MaxRange { get; set; }
+
+ ///
+ /// 状态
+ ///
+ public int Status { get; set; }
+
+ ///
+ /// 零方位角(正北夹角)
+ ///
+ public double ZeroAzimuth { get; set; }
+
+ ///
+ /// 安装垂直角(上下-90°~90°)
+ ///
+ public double FixedAngle { get; set; }
+
+ ///
+ /// 最大仰角
+ ///
+ public double MaxElevation { get; set; }
+
+ ///
+ /// 最大可视距离
+ ///
+ public double MaxVisibleDistance { get; set; }
+
+ ///
+ /// 变倍因子
+ ///
+ public double ZoomFactor { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ public string CreateBy { get; set; }
+
+ ///
+ /// 创建日期
+ ///
+ public DateTime? CreateTime { get; set; }
+
+ ///
+ /// 更新人
+ ///
+ public string UpdateBy { get; set; }
+
+ ///
+ /// 更新日期
+ ///
+ public DateTime? UpdateTime { get; set; }
+
+ public MonitorCamera(string cameraIp, int port, string userName, string passWord, int factory = 0, int type = 0)
+ {
+ Ip = cameraIp;
+ Port = port;
+ User = userName;
+ Password = passWord;
+ Factory = factory;
+ Type = type;
+ }
+
+ public string RtspURL(int width = 640)
+ {
+ if (width < 1200)
+ {
+ if (!string.IsNullOrEmpty(RecordRtsp))
+ {
+ return RecordRtsp;
+ }
+ }
+ if (!string.IsNullOrEmpty(PreRtsp))
+ {
+ return PreRtsp;
+ }
+
+ string rtspformat = "rtsp://{0}:{1}@{2}:554";
+ //switch (Factory)
+ //{
+ // case (int)Video.HK:
+ // rtspformat = "rtsp://{0}:{1}@{2}:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2";
+ // break;
+ // case (int)VidoeType.DH:
+ // rtspformat = "rtsp://{0}:{1}@{2}:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif";
+ // break;
+ // //case VidoeType.YS:
+ // // return "";
+
+ //}
+ string url = string.Format(rtspformat, User, Password, Ip);
+ return url;
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Video/MsVideoRecorder.cs b/EC.Entity/Video/MsVideoRecorder.cs
new file mode 100644
index 0000000..0ceba6a
--- /dev/null
+++ b/EC.Entity/Video/MsVideoRecorder.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+
+namespace EC.Entity.Video
+{
+ public class MsVideoRecorder
+ {
+ public MsVideoRecorder()
+ {
+ }
+
+ ///
+ /// 主键
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// 所属部门
+ ///
+ public string SysOrgCode { get; set; }
+
+ ///
+ /// 设备名称
+ ///
+ public string DeviceName { get; set; }
+
+ ///
+ /// 设备类型
+ ///
+ public int DeviceType { get; set; }
+
+ ///
+ /// 设备编号
+ ///
+ public string DeviceNum { get; set; }
+
+ ///
+ /// 设备地址
+ ///
+ public string DeviceAddress { get; set; }
+
+ ///
+ /// 用户姓名
+ ///
+ public string UserName { get; set; }
+
+ ///
+ /// 用户密码
+ ///
+ public string UserPassword { get; set; }
+
+ ///
+ /// 是否启用
+ ///
+ public int IsEnable { get; set; }
+
+ ///
+ /// 安装位置
+ ///
+ public string FixedPosition { get; set; }
+
+ ///
+ ///
+ ///
+ public List MsCameraSettingList { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ public string CreateBy { get; set; }
+
+ ///
+ /// 创建日期
+ ///
+ public DateTime? CreateTime { get; set; }
+
+ ///
+ /// 更新人
+ ///
+ public string UpdateBy { get; set; }
+
+ ///
+ /// 更新日期
+ ///
+ public DateTime? UpdateTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Warning/DrawPoint.cs b/EC.Entity/Warning/DrawPoint.cs
new file mode 100644
index 0000000..885c57b
--- /dev/null
+++ b/EC.Entity/Warning/DrawPoint.cs
@@ -0,0 +1,14 @@
+namespace EC.Entity.Warning
+{
+ public class DrawPoint
+ {
+ public DrawPoint(double x, double y)
+ {
+ X = x;
+ Y = y;
+ }
+
+ public double X { get; set; }
+ public double Y { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Warning/DrawShape.cs b/EC.Entity/Warning/DrawShape.cs
new file mode 100644
index 0000000..a8222bf
--- /dev/null
+++ b/EC.Entity/Warning/DrawShape.cs
@@ -0,0 +1,39 @@
+using System.Collections.Generic;
+
+namespace EC.Entity.Warning
+{
+ public class DrawShape
+ {
+ public DrawShape()
+ {
+ PointList = new List();
+ }
+
+ //public DrawShapeModel(string ip, StrokeEx storke)
+ //{
+ // List stylusPoints = storke.StylusPoints.ToList();
+ // foreach (StylusPoint stylusPoint in stylusPoints)
+ // {
+ // }
+ //}
+
+ public string Ip { get; set; }
+
+ ///
+ /// 画图形状
+ ///
+ public int DrawType { get; set; }
+
+ ///
+ /// 预警级别
+ ///
+ public int WarningLevel { get; set; }
+
+ public List PointList { get; set; }
+
+ ///
+ /// 预警方向 Line 上(0)下(1)左(2)右(3)
+ ///
+ public int WaringDirection { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Warning/WarningBoxModel.cs b/EC.Entity/Warning/WarningBoxModel.cs
new file mode 100644
index 0000000..ca412d4
--- /dev/null
+++ b/EC.Entity/Warning/WarningBoxModel.cs
@@ -0,0 +1,40 @@
+namespace EC.Entity.Warning
+{
+ public class WarningBoxModel
+ {
+ ///
+ ///英文标签
+ ///
+ public string label { get; set; }
+
+ ///
+ /// 原标签位置
+ ///
+ public int cls { get; set; }
+
+ ///
+ /// 相似度
+ ///
+ public double conf { get; set; }
+
+ ///
+ /// 左上角x
+ ///
+ public double x { get; set; }
+
+ ///
+ /// 左上角Y
+ ///
+ public double y { get; set; }
+
+ ///
+ /// 右下角x
+ ///
+ public double x1 { get; set; }
+
+ ///
+ /// 右下角y
+ ///
+ public double y1 { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Entity/Warning/WarningModel.cs b/EC.Entity/Warning/WarningModel.cs
new file mode 100644
index 0000000..375f6d8
--- /dev/null
+++ b/EC.Entity/Warning/WarningModel.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace EC.Entity.Warning
+{
+ public class WarningModel
+ {
+ public int warninglevel { get; set; }
+ public string ip { get; set; }
+ public string filename { get; set; }
+ public int width { get; set; }
+ public int height { get; set; }
+ public List boxs { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/BaseDbContext.cs b/EC.Service/CameraInfo/BaseDbContext.cs
new file mode 100644
index 0000000..7b288a8
--- /dev/null
+++ b/EC.Service/CameraInfo/BaseDbContext.cs
@@ -0,0 +1,47 @@
+using EC.Service.Config;
+
+using Microsoft.EntityFrameworkCore;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace EC.Service.CameraInfo
+{
+ public partial class BaseDbContext : DbContext where T : class
+ {
+ public BaseDbContext()
+ {
+ }
+
+ public BaseDbContext(DbContextOptions> options)
+ : base(options)
+ {
+ }
+
+ public virtual DbSet Infos { get; set; }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ if (!optionsBuilder.IsConfigured)
+ {
+ optionsBuilder.UseSqlite(ConfigHelper.GetDbConnection());
+ }
+ }
+
+ protected void OnModelCreatingPartial(ModelBuilder modelBuilder)
+ {
+ }
+
+ #region Select
+
+ public Task> GetListAsync()
+ {
+ Task> task = Task.Run(() =>
+ {
+ return new List(Infos);
+ });
+ return task;
+ }
+
+ #endregion Select
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/IpcInfoContext.cs b/EC.Service/CameraInfo/IpcInfoContext.cs
new file mode 100644
index 0000000..ae44266
--- /dev/null
+++ b/EC.Service/CameraInfo/IpcInfoContext.cs
@@ -0,0 +1,62 @@
+using EC.Entity.CameraInfo;
+using Microsoft.EntityFrameworkCore;
+
+#nullable disable
+
+namespace EC.Service.CameraInfo
+{
+ public class IpcInfoContext : BaseDbContext
+ {
+ public IpcInfoContext()
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.IpcId);
+
+ entity.ToTable("IpcInfo");
+
+ entity.Property(e => e.IpcId).HasColumnName("IpcID");
+
+ entity.Property(e => e.IpcAddr).HasColumnType("VARCHAR (100)");
+
+ entity.Property(e => e.IpcEnable).HasColumnType("VARCHAR (2)");
+
+ entity.Property(e => e.IpcImage).HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.IpcName)
+ .IsRequired()
+ .HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.IpcPosition).HasColumnType("VARCHAR (50)");
+
+ entity.Property(e => e.IpcType).HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.IpcX).HasColumnType("INTEGER (4)");
+
+ entity.Property(e => e.IpcY).HasColumnType("INTEGER (4)");
+
+ entity.Property(e => e.MediaAddr).HasColumnType("VARCHAR (150)");
+
+ entity.Property(e => e.NvrName).HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.OnvifAddr).HasColumnType("VARCHAR (150)");
+
+ entity.Property(e => e.PtzAddr).HasColumnType("VARCHAR (150)");
+
+ entity.Property(e => e.RtspMain).HasColumnType("VARCHAR (250)");
+
+ entity.Property(e => e.RtspSub).HasColumnType("VARCHAR (250)");
+
+ entity.Property(e => e.UserName).HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.UserPwd).HasColumnType("VARCHAR (20)");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/LogInfoContext.cs b/EC.Service/CameraInfo/LogInfoContext.cs
new file mode 100644
index 0000000..8d92a5b
--- /dev/null
+++ b/EC.Service/CameraInfo/LogInfoContext.cs
@@ -0,0 +1,50 @@
+using EC.Entity.CameraInfo;
+using Microsoft.EntityFrameworkCore;
+
+#nullable disable
+
+namespace EC.Service.CameraInfo
+{
+ public class LogInfoContext : BaseDbContext
+ {
+ public LogInfoContext()
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LogId);
+
+ entity.ToTable("LogInfo");
+
+ entity.Property(e => e.LogId)
+ .ValueGeneratedNever()
+ .HasColumnName("LogID");
+
+ entity.Property(e => e.LogCh).HasColumnType("VARCHAR (50)");
+
+ entity.Property(e => e.LogContent)
+ .IsRequired()
+ .HasColumnType("VARCHAR (100)");
+
+ entity.Property(e => e.LogMark).HasColumnType("VARCHAR (200)");
+
+ entity.Property(e => e.LogType)
+ .IsRequired()
+ .HasColumnType("VARCHAR (10)");
+
+ entity.Property(e => e.TriggerTime)
+ .IsRequired()
+ .HasColumnType("VARCHAR (19)");
+
+ entity.Property(e => e.UserName)
+ .IsRequired()
+ .HasColumnType("VARCHAR (20)");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/NvrInfoContext.cs b/EC.Service/CameraInfo/NvrInfoContext.cs
new file mode 100644
index 0000000..cad3647
--- /dev/null
+++ b/EC.Service/CameraInfo/NvrInfoContext.cs
@@ -0,0 +1,75 @@
+using EC.Entity.CameraInfo;
+using Microsoft.EntityFrameworkCore;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+#nullable disable
+
+namespace EC.Service.CameraInfo
+{
+ public class NvrInfoContext : BaseDbContext
+ {
+ public NvrInfoContext()
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.NvrId);
+
+ entity.ToTable("NvrInfo");
+
+ entity.Property(e => e.NvrId).HasColumnName("NvrID");
+
+ entity.Property(e => e.NvrAddr).HasColumnType("VARCHAR (100)");
+
+ entity.Property(e => e.NvrEnable)
+ .IsRequired()
+ .HasColumnType("VARCHAR (2)");
+
+ entity.Property(e => e.NvrIp)
+ .IsRequired()
+ .HasColumnType("VARCHAR (18)")
+ .HasColumnName("NvrIP");
+
+ entity.Property(e => e.NvrName)
+ .IsRequired()
+ .HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.NvrType).HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.UserName).HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.UserPwd).HasColumnType("VARCHAR (20)");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+
+ #region Operate
+
+ public List GetNvrDeviceList()
+ {
+ List list = new() { "海康", "大华", "宇视", "深广", "泰杰", "其它" };
+ return list;
+ }
+
+ public async Task> GetNvrNameListAsync()
+ {
+ List list = new();
+ List infos = await GetListAsync();
+ foreach (NvrInfo info in infos)
+ {
+ if (!list.Contains(info.NvrName))
+ {
+ list.Add(info.NvrName);
+ }
+ }
+ return list;
+ }
+
+ #endregion Operate
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/PollInfoContext.cs b/EC.Service/CameraInfo/PollInfoContext.cs
new file mode 100644
index 0000000..521b24f
--- /dev/null
+++ b/EC.Service/CameraInfo/PollInfoContext.cs
@@ -0,0 +1,42 @@
+using EC.Entity.CameraInfo;
+using Microsoft.EntityFrameworkCore;
+
+#nullable disable
+
+namespace EC.Service.CameraInfo
+{
+ public class PollInfoContext : BaseDbContext
+ {
+ public PollInfoContext()
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.PollId);
+
+ entity.ToTable("PollInfo");
+
+ entity.Property(e => e.PollId)
+ .ValueGeneratedNever()
+ .HasColumnName("PollID");
+
+ entity.Property(e => e.PollGroup)
+ .IsRequired()
+ .HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.RtspMain)
+ .IsRequired()
+ .HasColumnType("VARCHAR (250)");
+
+ entity.Property(e => e.RtspSub)
+ .IsRequired()
+ .HasColumnType("VARCHAR (250)");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/CameraInfo/UserInfoContext.cs b/EC.Service/CameraInfo/UserInfoContext.cs
new file mode 100644
index 0000000..d343045
--- /dev/null
+++ b/EC.Service/CameraInfo/UserInfoContext.cs
@@ -0,0 +1,34 @@
+using EC.Entity.CameraInfo;
+using Microsoft.EntityFrameworkCore;
+
+#nullable disable
+
+namespace EC.Service.CameraInfo
+{
+ public class UserInfoContext : BaseDbContext
+ {
+ public UserInfoContext()
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.UserName);
+
+ entity.ToTable("UserInfo");
+
+ entity.Property(e => e.UserName).HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.UserAdmin).HasColumnType("VARCHAR (30)");
+
+ entity.Property(e => e.UserPwd).HasColumnType("VARCHAR (20)");
+
+ entity.Property(e => e.UserType).HasColumnType("VARCHAR (10)");
+ });
+
+ OnModelCreatingPartial(modelBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/Config/ConfigHelper.cs b/EC.Service/Config/ConfigHelper.cs
new file mode 100644
index 0000000..ff426f0
--- /dev/null
+++ b/EC.Service/Config/ConfigHelper.cs
@@ -0,0 +1,18 @@
+using EC.Utils.Config;
+
+namespace EC.Service.Config
+{
+ public class ConfigHelper : ConfigurationHelper
+ {
+ ///
+
+ #region 数据库
+
+ public static string GetDbConnection()
+ {
+ return ConfigurationHelper.GetDbConnection("ConnectionString");
+ }
+
+ #endregion 数据库
+ }
+}
\ No newline at end of file
diff --git a/EC.Service/EC.Service.csproj b/EC.Service/EC.Service.csproj
new file mode 100644
index 0000000..089f922
--- /dev/null
+++ b/EC.Service/EC.Service.csproj
@@ -0,0 +1,12 @@
+
+
+
+ net5.0-windows7.0
+
+
+
+
+
+
+
+
diff --git a/EC.UsingEventAggregator/EC.UsingEventAggregator.csproj b/EC.UsingEventAggregator/EC.UsingEventAggregator.csproj
new file mode 100644
index 0000000..0f3bdb4
--- /dev/null
+++ b/EC.UsingEventAggregator/EC.UsingEventAggregator.csproj
@@ -0,0 +1,16 @@
+
+
+
+ net5.0-windows7.0
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EC.UsingEventAggregator/FLogger.cs b/EC.UsingEventAggregator/FLogger.cs
new file mode 100644
index 0000000..9461804
--- /dev/null
+++ b/EC.UsingEventAggregator/FLogger.cs
@@ -0,0 +1,62 @@
+using System;
+
+namespace EC.UsingEventAggregator
+{
+ public enum LoggerLevel
+ {
+ Debug,
+ Info,
+ Error,
+ }
+
+ public class MyLogger
+ {
+ public MyLogger(string message, LoggerLevel level = LoggerLevel.Debug)
+ {
+ Message = message;
+ Level = level;
+ }
+
+ public string Message { get; set; }
+ public LoggerLevel Level { get; set; }
+ }
+
+ ///
+ /// 文件Logger
+ ///
+ public class FLogger
+ {
+ public static event Action SubMessage;
+
+ public static event Action SubLog;
+
+ //public static void PubMessge(string message)
+ //{
+ // SubMessage?.Invoke(message);
+ //}
+ public static void PubLog(string message, LoggerLevel level = LoggerLevel.Debug)
+ {
+ SubLog?.Invoke(new MyLogger(message, level));
+ }
+
+ public static void Debug(string message)
+ {
+ SubLog?.Invoke(new MyLogger(message, LoggerLevel.Debug));
+ }
+
+ public static void Info(string message)
+ {
+ SubLog?.Invoke(new MyLogger(message, LoggerLevel.Info));
+ }
+
+ public static void Error(string message)
+ {
+ SubLog?.Invoke(new MyLogger(message, LoggerLevel.Error));
+ }
+
+ public static void Error(Exception ex)
+ {
+ SubLog?.Invoke(new MyLogger(ex.Message, LoggerLevel.Error));
+ }
+ }
+}
\ No newline at end of file
diff --git a/EC.UsingEventAggregator/MessageSentEvent.cs b/EC.UsingEventAggregator/MessageSentEvent.cs
new file mode 100644
index 0000000..f1e5885
--- /dev/null
+++ b/EC.UsingEventAggregator/MessageSentEvent.cs
@@ -0,0 +1,82 @@
+using EC.Entity.CameraInfo;
+using EC.Entity.Warning;
+using EC.Onvif;
+using Prism.Events;
+using System.Collections.Generic;
+
+namespace EC.UsingEventAggregator
+{
+ public class LogModel
+ {
+ public LogModel(int level, string message, string remark = "")
+ {
+ this.level = level;
+ this.message = message;
+ this.remark = remark;
+ }
+
+ public int level { get; set; }
+ public string message { get; set; }
+ public string remark { get; set; }
+ }
+
+ public class MQModel
+ {
+ public int level { get; set; }
+ public string message { get; set; }
+ }
+
+ public class MessageSentEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// MQ消息
+ ///
+ public class MQMessageEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// 显示日志
+ ///
+ public class ShowMessageSentEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// 保存日志
+ ///
+ public class SaveLogEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// 在主窗体播放视频
+ ///
+ public class ShowVoideInMainEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// 预警视频数据
+ ///
+ public class WaningVoideEvent : PubSubEvent
+ {
+ }
+
+ ///
+ /// 预警分析图片数据
+ ///
+ public class WaningImageBytesEvent : PubSubEvent
+ {
+ }
+
+ public class SendOnvifClientEvent : PubSubEvent
+ {
+ }
+
+ public class SendIpcInfoListEvent : PubSubEvent>
+ {
+ }
+}
\ No newline at end of file
diff --git a/ECDefense.sln b/ECDefense.sln
new file mode 100644
index 0000000..e64fbbe
--- /dev/null
+++ b/ECDefense.sln
@@ -0,0 +1,213 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30804.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.Service", "EC.Service\EC.Service.csproj", "{C37542F7-5C6A-4998-8D1B-CED979560C8A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ECMonitor", "ECMonitor\ECMonitor.csproj", "{7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.UsingEventAggregator", "EC.UsingEventAggregator\EC.UsingEventAggregator.csproj", "{8E4EFE09-CB77-44A6-904E-B42639136385}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "视频处理", "视频处理", "{A09E2512-EFE0-4E69-B7D1-B964B6358887}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "公共库", "公共库", "{8B78A8FF-D59D-4E86-91F3-0D5A4332E3B1}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.Entity", "EC.Entity\EC.Entity.csproj", "{2242B8A5-3E25-499E-9B23-3E61517A543E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HKPlayers", "播放库\HKPlayers\HKPlayers.csproj", "{5EC832FA-4BD1-466C-B221-21BAE5A3D21F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.FFmpegAutoGen", "播放库\EC.FFmpegAutoGen\EC.FFmpegAutoGen.csproj", "{58B91E08-B095-4598-A0A4-74E3882F1881}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.Utils", "公共库\EC.Utils\EC.Utils.csproj", "{D651B7BC-B1B4-4D33-A409-3C8E6C52B207}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EC.Onvif", "公共库\EC.Onvif\EC.Onvif.csproj", "{EFEDF229-0330-46B4-B32E-3CA6BEA61E39}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|ARM.Build.0 = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|x64.Build.0 = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Debug|x86.Build.0 = Debug|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|ARM.ActiveCfg = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|ARM.Build.0 = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|ARM64.Build.0 = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|x64.ActiveCfg = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|x64.Build.0 = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|x86.ActiveCfg = Release|Any CPU
+ {C37542F7-5C6A-4998-8D1B-CED979560C8A}.Release|x86.Build.0 = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|ARM.Build.0 = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|x64.Build.0 = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Debug|x86.Build.0 = Debug|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|ARM.ActiveCfg = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|ARM.Build.0 = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|ARM64.Build.0 = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|x64.ActiveCfg = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|x64.Build.0 = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|x86.ActiveCfg = Release|Any CPU
+ {7F5DA7D9-8DCF-44C8-921D-B156C99D4F9B}.Release|x86.Build.0 = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|ARM.Build.0 = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|x64.Build.0 = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Debug|x86.Build.0 = Debug|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|ARM.ActiveCfg = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|ARM.Build.0 = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|ARM64.Build.0 = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|x64.ActiveCfg = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|x64.Build.0 = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|x86.ActiveCfg = Release|Any CPU
+ {8E4EFE09-CB77-44A6-904E-B42639136385}.Release|x86.Build.0 = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|ARM.Build.0 = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|x64.Build.0 = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Debug|x86.Build.0 = Debug|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|ARM.ActiveCfg = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|ARM.Build.0 = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|ARM64.Build.0 = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|x64.ActiveCfg = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|x64.Build.0 = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|x86.ActiveCfg = Release|Any CPU
+ {2242B8A5-3E25-499E-9B23-3E61517A543E}.Release|x86.Build.0 = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|ARM.Build.0 = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|x64.Build.0 = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Debug|x86.Build.0 = Debug|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|ARM.ActiveCfg = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|ARM.Build.0 = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|ARM64.Build.0 = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|x64.ActiveCfg = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|x64.Build.0 = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|x86.ActiveCfg = Release|Any CPU
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F}.Release|x86.Build.0 = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|ARM.Build.0 = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|x64.Build.0 = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Debug|x86.Build.0 = Debug|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|Any CPU.Build.0 = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|ARM.ActiveCfg = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|ARM.Build.0 = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|ARM64.Build.0 = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|x64.ActiveCfg = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|x64.Build.0 = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|x86.ActiveCfg = Release|Any CPU
+ {58B91E08-B095-4598-A0A4-74E3882F1881}.Release|x86.Build.0 = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|ARM.Build.0 = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|x64.Build.0 = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Debug|x86.Build.0 = Debug|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|ARM.ActiveCfg = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|ARM.Build.0 = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|ARM64.Build.0 = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|x64.ActiveCfg = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|x64.Build.0 = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|x86.ActiveCfg = Release|Any CPU
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207}.Release|x86.Build.0 = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|ARM.Build.0 = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|x64.Build.0 = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Debug|x86.Build.0 = Debug|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|ARM.ActiveCfg = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|ARM.Build.0 = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|ARM64.Build.0 = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|x64.ActiveCfg = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|x64.Build.0 = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|x86.ActiveCfg = Release|Any CPU
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {5EC832FA-4BD1-466C-B221-21BAE5A3D21F} = {A09E2512-EFE0-4E69-B7D1-B964B6358887}
+ {58B91E08-B095-4598-A0A4-74E3882F1881} = {A09E2512-EFE0-4E69-B7D1-B964B6358887}
+ {D651B7BC-B1B4-4D33-A409-3C8E6C52B207} = {8B78A8FF-D59D-4E86-91F3-0D5A4332E3B1}
+ {EFEDF229-0330-46B4-B32E-3CA6BEA61E39} = {8B78A8FF-D59D-4E86-91F3-0D5A4332E3B1}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {279F81E9-23B1-4D20-A450-2BADF996975B}
+ EndGlobalSection
+EndGlobal
diff --git a/ECMonitor/App.xaml b/ECMonitor/App.xaml
new file mode 100644
index 0000000..56ec7b6
--- /dev/null
+++ b/ECMonitor/App.xaml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #44494f
+ #40444d
+ #32363f
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ECMonitor/App.xaml.cs b/ECMonitor/App.xaml.cs
new file mode 100644
index 0000000..1f3d71c
--- /dev/null
+++ b/ECMonitor/App.xaml.cs
@@ -0,0 +1,91 @@
+using EC.UsingEventAggregator;
+using EC.Utils;
+using LibVLCSharp.Shared;
+using Prism.Ioc;
+using Prism.Modularity;
+using Prism.Unity;
+using System;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+
+namespace ECMonitor
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : PrismApplication
+ {
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ Core.Initialize();
+ base.OnStartup(e);
+ RegisterEvents();
+ LogFactory.GetLogger().Info("OnStartup");
+
+ // await new IpcInfoService().Test();//test sqlite
+ }
+
+ protected override Window CreateShell()
+ {
+ return Container.Resolve();
+ }
+
+ protected override void RegisterTypes(IContainerRegistry containerRegistry)
+ {
+ }
+
+ protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
+ {
+ moduleCatalog.AddModule();
+ }
+
+ //protected override IModuleCatalog CreateModuleCatalog()
+ //{
+ // return new ConfigurationModuleCatalog();
+ //}
+ protected override void OnExit(ExitEventArgs e)
+ {
+ base.OnExit(e);
+ }
+
+ private void RegisterEvents()
+ {
+ //TaskScheduler.UnobservedTaskException += (sender, args) =>
+ //{
+ // MessageBox.Show(args.Exception.Message);
+ // args.SetObserved();
+ //};
+ DispatcherUnhandledException += App_DispatcherUnhandledException;
+
+ TaskScheduler.UnobservedTaskException += new EventHandler<
+ UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);
+
+ AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
+ }
+
+ private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
+ {
+ FLogger.Error("Error encountered! Please contact support." + Environment.NewLine + e.Exception.Message);
+
+ e.Handled = true;
+ }
+
+ private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
+ {
+ foreach (Exception item in e.Exception.InnerExceptions)
+ {
+ FLogger.Error(string.Format("异常类型:{0}{1}来自:{2}{3}异常内容:{4}",
+ item.GetType(), Environment.NewLine, item.Source,
+ Environment.NewLine, item.Message));
+ }
+ //将异常标识为已经观察到
+ e.SetObserved();
+ }
+
+ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ FLogger.Error("Unhandled exception.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/AssemblyInfo.cs b/ECMonitor/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/ECMonitor/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/ECMonitor/Code/Config/ConfigHelper.cs b/ECMonitor/Code/Config/ConfigHelper.cs
new file mode 100644
index 0000000..02c91ae
--- /dev/null
+++ b/ECMonitor/Code/Config/ConfigHelper.cs
@@ -0,0 +1,103 @@
+using EC.Utils.Config;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ECMonitor
+{
+ public class ConfigHelper : ConfigurationHelper
+ {
+ #region
+ ///
+ /// 自动关闭预警窗体
+ ///
+ ///
+ public static bool? AutoWarningClose()
+ {
+ return GetValueInt("AutoWarningClose") == 1;
+ }
+ ///
+ /// AI 检索
+ ///
+ ///
+ public static bool? VideoAIDetection()
+ {
+ return GetValueInt("VideoAIDetection") == 1;
+ }
+
+ ///
+ /// WebSocketSvrPort
+ ///
+ ///
+ public static int WebSocketSvrPort()
+ {
+ return GetValueInt("WebSocketSvrPort");
+ }
+ public static string APIServer()
+ {
+ return GetValue("APIServer");
+ }
+ ///
+ /// 可选初始窗体图标 0:(1个窗体),1:4个窗体, 2:9个窗体
+ ///
+ ///
+ public static int MainBarButtonSelectedIndex()
+ {
+ return GetValueInt("MainBarButtonSelectedIndex");
+ }
+ public static string AIInputPath()
+ {
+ return GetValue("AIInputPath");
+ }
+ public static string AIOutPath()
+ {
+ return GetValue("AIOutPath");
+ }
+
+#endregion
+ #region ZMQ 配置
+
+ /// 发布地址
+ ///
+ ///
+ public static string PUBServer()
+ {
+ return GetMQValue("PUBServer");
+ }
+ ///
+ /// 订阅地址
+ ///
+ ///
+ public static string SUBServer()
+ {
+ return GetMQValue("SUBServer");
+ }
+ //AI服务地址
+ public static string AISvrServer()
+ {
+ return GetMQValue("AISvrServer");
+ }
+ ///
+ /// AI图片数据订阅 地址
+ ///
+ ///
+ public static string SUBImageServer()
+ {
+ return GetMQValue("SUBImageServer");
+ }
+
+ #endregion
+ ///
+ /// 数据库服务地址
+ ///
+ ///
+ public static string DBSvrServer()
+ {
+ return GetMQValue("DBSvrServer");
+ }
+
+
+ }
+}
diff --git a/ECMonitor/Code/DB/DBDataHelper.cs b/ECMonitor/Code/DB/DBDataHelper.cs
new file mode 100644
index 0000000..3a7c98d
--- /dev/null
+++ b/ECMonitor/Code/DB/DBDataHelper.cs
@@ -0,0 +1,106 @@
+
+using EC.Entity.PublicModel;
+using EC.Entity.Video;
+using EC.Entity.Warning;
+
+using EC.Utils;
+
+using EC.Utils.ZMQ;
+
+using NetMQ;
+using NetMQ.Sockets;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ECMonitor.Code.DB
+{
+ public class DBDataHelper
+ {
+ //public static string _apiUrl = ConfigHelper.APIServer();
+ public static string _dbSvrServer = ConfigHelper.DBSvrServer();
+ public static ZMQRequestHelper requestHelper=null;
+ public static ZMQRequestHelper RequestContext() {
+ if (requestHelper == null)
+ {
+ requestHelper = new ZMQRequestHelper(_dbSvrServer);
+
+ }
+ return requestHelper;
+ }
+ ///
+ /// 获取相机数据
+ ///
+ ///
+ public static List LoadCameraData()
+ {
+ List msVideoRecorderList = new List();
+ try
+ {
+ RequestModel requestModel = new RequestModel();
+ requestModel.method = DBMethod.GetGroupAndCameraList;
+ requestModel.jsonstr = "all";
+
+ ResultModel resultModel = RequestContext().RequestFromServer(requestModel);
+ if (resultModel.result == DBMethod.Success)
+ {
+ msVideoRecorderList = resultModel.jsonstr.ToObject>();
+ }
+
+ }
+ catch (Exception ex)
+ {
+ LogFactory.GetLogger().Error(ex);
+ }
+
+ return msVideoRecorderList;
+ }
+
+
+
+ ///
+ /// 保存预警划线
+ ///
+ ///
+ internal static bool SaveDrawShape(List drawShapeModelList)
+ {
+ RequestModel requestModel = new RequestModel();
+ requestModel.method = DBMethod.SaveDrawShape;
+ requestModel.jsonstr = drawShapeModelList.ToJson();
+ LogFactory.GetLogger().Debug(requestModel.jsonstr);
+ ResultModel resultModel =RequestContext().RequestFromServer(requestModel);
+ if (resultModel.result == DBMethod.Success)
+ {
+ return true;
+ }else
+ {
+ return false;
+ }
+
+ }
+ internal static List GetDrawShape(string ip)
+ {
+ List drawShapeModelList = new List();
+ try
+ {
+ RequestModel requestModel = new RequestModel();
+ requestModel.method = DBMethod.GetDrawShape;
+ requestModel.jsonstr = ip;
+ LogFactory.GetLogger().Debug(requestModel.jsonstr);
+ ResultModel resultModel = RequestContext().RequestFromServer(requestModel);
+ if (resultModel.result == DBMethod.Success)
+ {
+ drawShapeModelList = Json.ToObject>(resultModel.jsonstr);
+ }
+ }catch(Exception ex)
+ {
+ LogFactory.GetLogger().Debug(ex);
+ }
+
+ return drawShapeModelList;
+
+ }
+ }
+}
diff --git a/ECMonitor/Code/DB/LoadFromAPIServer.cs b/ECMonitor/Code/DB/LoadFromAPIServer.cs
new file mode 100644
index 0000000..7f83b9e
--- /dev/null
+++ b/ECMonitor/Code/DB/LoadFromAPIServer.cs
@@ -0,0 +1,43 @@
+using EC.Entity.Video;
+using EC.Utils;
+
+using System;
+using System.Collections.Generic;
+
+namespace ECMonitor.Code
+{
+ public class LoadFromAPIServer
+ {
+ public static string _apiUrl = ConfigHelper.APIServer();
+
+ ///
+ /// 获取相机数据
+ ///
+ ///
+ public static List LoadCameraData()
+ {
+ List msVideoRecorderList = new List();
+ try
+ {
+ var respStr = HttpMethods.HttpGet(_apiUrl);
+ var respObj = Json.ToJObject(respStr);
+ var success = (bool)respObj["success"];
+ if (success)
+ {
+ var message = (string)respObj["message"];
+ var code = (int)respObj["code"];
+ var timestamp = (string)respObj["timestamp"];
+ msVideoRecorderList = Json.ToList(respObj["result"]?.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ LogFactory.GetLogger().Error(ex);
+ }
+
+ return msVideoRecorderList;
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/Code/DB/RequestModel.cs b/ECMonitor/Code/DB/RequestModel.cs
new file mode 100644
index 0000000..3a7e411
--- /dev/null
+++ b/ECMonitor/Code/DB/RequestModel.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ECMonitor.Code.ServerData
+{
+ public class RequestModel
+ {
+ public string Key { get; set; }
+ public string jsonstr { get; set; }
+ }
+}
diff --git a/ECMonitor/Code/Models/BaseModel.cs b/ECMonitor/Code/Models/BaseModel.cs
new file mode 100644
index 0000000..3018ada
--- /dev/null
+++ b/ECMonitor/Code/Models/BaseModel.cs
@@ -0,0 +1,89 @@
+using EC.UsingEventAggregator;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System.Collections.Specialized;
+
+namespace ECMonitor.Code.Models
+{
+ public class BaseModel : BindableBase
+ {
+ public IRegionManager _regionManager { get; set; }
+ public IEventAggregator _ea { get; set; }
+
+ private string _title = "";
+
+ public string Title
+ {
+ get { return _title; }
+ set { SetProperty(ref _title, value); }
+ }
+
+ public DelegateCommand SendMessageCommand { get; private set; }
+
+ public BaseModel(IRegionManager regionManager, IEventAggregator ea)
+ {
+ _regionManager = regionManager;
+ _ea = ea;
+ _regionManager.Regions.CollectionChanged += Regions_CollectionChanged;
+
+ SendMessageCommand = new DelegateCommand(SendMessage);
+ _ea.GetEvent().Subscribe(MessageReceived);
+ }
+
+ public virtual void Regions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ var region = (IRegion)e.NewItems[0];
+ region.Views.CollectionChanged += Views_CollectionChanged;
+ }
+ }
+
+ public virtual void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ }
+ else if (e.Action == NotifyCollectionChangedAction.Remove)
+ {
+ }
+ }
+
+ public virtual void SendMessage(string message)
+ {
+ SendMessage(new LogModel(1, message));
+ }
+
+ ///
+ /// 发送消息
+ ///
+ ///
+ public virtual void SendMessage(LogModel log)
+ {
+ _ea.GetEvent().Publish(log);
+ }
+
+ public virtual void MessageReceived(LogModel log)
+ {
+ //Messages.Add(message);
+ }
+
+ #region 日志
+
+ public void Debug(string message)
+ {
+ }
+
+ public void Info(string message)
+ {
+ }
+
+ public void Error(string message)
+ {
+ }
+
+ #endregion 日志
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/Code/Models/VideoShowModel.cs b/ECMonitor/Code/Models/VideoShowModel.cs
new file mode 100644
index 0000000..e729ed8
--- /dev/null
+++ b/ECMonitor/Code/Models/VideoShowModel.cs
@@ -0,0 +1,46 @@
+using EC.Entity.Video;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ECMonitor.Code.Models
+{
+ public class VideoShowModel
+ {
+ public VideoShowModel()
+ {
+ UPDateTime();
+ }
+ public string Message { get; set; }
+ public string CameraIp { get; set; }
+ public MonitorCamera Camera { get; set; }
+ ///
+ /// 控件注册名称
+ ///
+ public string UCName { get; set; }
+ ///
+ /// 更新时间
+ ///
+ private DateTime upDateTime;
+ public void UPDateTime()
+ {
+ upDateTime = new DateTime();
+ }
+ ///
+ /// 判断预警是否接触
+ ///
+ ///
+ public bool IsTimeOut()
+ {
+ DateTime now = new DateTime();
+ double difSeconds = DateUnit.DateDiffSeconds(upDateTime, now);
+ return difSeconds > 30;
+ }
+ internal string RtspURL()
+ {
+ return Camera.RtspURL();
+ }
+ }
+}
diff --git a/ECMonitor/Code/StaticData.cs b/ECMonitor/Code/StaticData.cs
new file mode 100644
index 0000000..ea1a2fc
--- /dev/null
+++ b/ECMonitor/Code/StaticData.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ECMonitor.Code
+{
+ ///
+ /// 静态变量类
+ ///
+ public class StaticData
+ {
+ ///
+ /// 选中的播放器的IP
+ ///
+ public static string MainPlayerIp { get; set; }
+ }
+}
diff --git a/ECMonitor/Code/SysemNotifyIcon/WPFSystemTray.cs b/ECMonitor/Code/SysemNotifyIcon/WPFSystemTray.cs
new file mode 100644
index 0000000..c55fe2e
--- /dev/null
+++ b/ECMonitor/Code/SysemNotifyIcon/WPFSystemTray.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ECMonitor.Code.SysemNotifyIcon
+{
+ public class WPFSystemTray
+ {
+ ///
+ /// 设置系统托盘
+ ///
+ /// 最小化参数
+ ///
+ ///
+ public static NotifyIcon SetSystemTray(SystemTrayParameter pars, List menuList)
+ {
+ NotifyIcon notifyIcon = new NotifyIcon();
+ notifyIcon.Visible = true;
+ if (!string.IsNullOrWhiteSpace(pars.Icon))
+ {
+ notifyIcon.Icon = new System.Drawing.Icon(pars.Icon);//程序图标
+ }
+ if (!string.IsNullOrWhiteSpace(pars.MinText))
+ {
+ notifyIcon.Text = pars.MinText;//最小化到托盘时,鼠标悬浮时显示的文字
+ }
+ if (!string.IsNullOrWhiteSpace(pars.TipText))
+ {
+ notifyIcon.BalloonTipText = pars.TipText; //设置系统托盘启动时显示的文本
+ notifyIcon.ShowBalloonTip(pars.Time == 0 ? 100 : pars.Time);//显示时长
+ }
+ notifyIcon.MouseDoubleClick += pars.dbClick; //双击事件
+ notifyIcon.ContextMenuStrip = GetMenuStrip(menuList);
+ return notifyIcon;
+ }
+ ///
+ /// 设置系统托盘的菜单属性
+ ///
+ ///
+ ///
+ static ContextMenuStrip GetMenuStrip(List menus)
+ {
+ ContextMenuStrip menu = new ContextMenuStrip();
+ ToolStripMenuItem[] menuArray = new ToolStripMenuItem[menus.Count];
+ int i = 0;
+ foreach (SystemTrayMenu item in menus)
+ {
+ ToolStripMenuItem menuItem = new ToolStripMenuItem();
+ menuItem.Text = item.Txt;
+ menuItem.Click += item.Click;
+ if (!string.IsNullOrWhiteSpace(item.Icon) && System.IO.File.Exists(item.Icon)) { menuItem.Image = System.Drawing.Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + item.Icon); }
+ menuArray[i++] = menuItem;
+ }
+ menu.Items.AddRange(menuArray);
+ return menu;
+ }
+ }
+
+ ///
+ /// 系统托盘参数
+ ///
+ public class SystemTrayParameter
+ {
+ public SystemTrayParameter(string Icon, string MinText, string TipText, int Time, MouseEventHandler dbClick)
+ {
+ this.Icon = Icon;
+ this.MinText = MinText;
+ this.TipText = TipText;
+ this.Time = Time;
+ this.dbClick = dbClick;
+ }
+ ///
+ /// 托盘显示图标
+ ///
+ public string Icon { get; set; }
+ ///
+ /// 最小化悬浮时文本
+ ///
+ public string MinText { get; set; }
+ ///
+ /// 最小化启动时文本
+ ///
+ public string TipText { get; set; }
+ ///
+ /// 最小化启动时文本显示时长
+ ///
+ public int Time { get; set; }
+ ///
+ /// 最小化双击事件
+ ///
+ public MouseEventHandler dbClick { get; set; }
+ }
+ ///
+ /// 右键菜单
+ ///
+ public class SystemTrayMenu
+ {
+ ///
+ /// 菜单文本
+ ///
+ public string Txt { get; set; }
+ ///
+ /// 菜单图标
+ ///
+ public string Icon { get; set; }
+ ///
+ /// 菜单单击事件
+ ///
+ public EventHandler Click { get; set; }
+ }
+
+}
\ No newline at end of file
diff --git a/ECMonitor/ECMonitor.csproj b/ECMonitor/ECMonitor.csproj
new file mode 100644
index 0000000..9651365
--- /dev/null
+++ b/ECMonitor/ECMonitor.csproj
@@ -0,0 +1,161 @@
+
+
+
+ WinExe
+ net5.0-windows
+ true
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+
+ $(DefaultXamlRuntime)
+
+
+ $(DefaultXamlRuntime)
+ Designer
+
+
+ $(DefaultXamlRuntime)
+ Designer
+
+
+ $(DefaultXamlRuntime)
+
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ECMonitor/MVVM/ExtendCommand.cs b/ECMonitor/MVVM/ExtendCommand.cs
new file mode 100644
index 0000000..0638e3f
--- /dev/null
+++ b/ECMonitor/MVVM/ExtendCommand.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Windows.Input;
+
+namespace ECMonitor.MVVM
+{
+ public class ExtendCommand : ICommand
+ {
+ ///
+ /// 检查命令是否可以执行的事件,在UI事件发生导致控件状态或数据发生变化时触发
+ ///
+ public event EventHandler CanExecuteChanged
+ {
+ add
+ {
+ if (_canExecute != null)
+ {
+ CommandManager.RequerySuggested += value;
+ }
+ }
+ remove
+ {
+ if (_canExecute != null)
+ {
+ CommandManager.RequerySuggested -= value;
+ }
+ }
+ }
+
+ ///
+ /// 判断命令是否可以执行的方法
+ ///
+ private Func _canExecute;
+
+ ///
+ /// 命令需要执行的方法
+ ///
+ private Action _execute;
+
+ ///
+ /// 创建一个命令
+ ///
+ /// 命令要执行的方法
+ public ExtendCommand(Action execute) : this(execute, null)
+ {
+ }
+
+ ///
+ /// 创建一个命令
+ ///
+ /// 命令要执行的方法
+ /// 判断命令是否能够执行的方法
+ public ExtendCommand(Action execute, Func canExecute)
+ {
+ _execute = execute;
+ _canExecute = canExecute;
+ }
+
+ ///
+ /// 判断命令是否可以执行
+ ///
+ /// 命令传入的参数
+ /// 是否可以执行
+ public bool CanExecute(object parameter)
+ {
+ if (_canExecute == null) return true;
+ return _canExecute((T)parameter);
+ }
+
+ ///
+ /// 执行命令
+ ///
+ ///
+ public void Execute(object parameter)
+ {
+ if (_execute != null && CanExecute(parameter))
+ {
+ _execute((T)parameter);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/MVVM/ExtendEventCommand.cs b/ECMonitor/MVVM/ExtendEventCommand.cs
new file mode 100644
index 0000000..19a6b45
--- /dev/null
+++ b/ECMonitor/MVVM/ExtendEventCommand.cs
@@ -0,0 +1,45 @@
+using Microsoft.Xaml.Behaviors;
+using System.Windows;
+using System.Windows.Input;
+
+namespace ECMonitor.MVVM
+{
+ public class ExtendEventCommand : TriggerAction
+ {
+ ///
+ /// 事件要绑定的命令
+ ///
+ public ICommand Command
+ {
+ get { return (ICommand)GetValue(CommandProperty); }
+ set { SetValue(CommandProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for MsgName. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty CommandProperty =
+ DependencyProperty.Register("Command", typeof(ICommand), typeof(ExtendEventCommand), new PropertyMetadata(null));
+
+ ///
+ /// 绑定命令的参数,保持为空就是事件的参数
+ ///
+ public object CommandParateter
+ {
+ get { return (object)GetValue(CommandParateterProperty); }
+ set { SetValue(CommandParateterProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for CommandParateter. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty CommandParateterProperty =
+ DependencyProperty.Register("CommandParateter", typeof(object), typeof(ExtendEventCommand), new PropertyMetadata(null));
+
+ //执行事件
+ protected override void Invoke(object parameter)
+ {
+ if (CommandParateter != null)
+ parameter = CommandParateter;
+ var cmd = Command;
+ if (cmd != null)
+ cmd.Execute(parameter);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/MVVM/PasswordBoxHelper.cs b/ECMonitor/MVVM/PasswordBoxHelper.cs
new file mode 100644
index 0000000..fb6f9ce
--- /dev/null
+++ b/ECMonitor/MVVM/PasswordBoxHelper.cs
@@ -0,0 +1,87 @@
+using System.Windows;
+using System.Windows.Controls;
+
+namespace ECMonitor.MVVM
+{
+ public static class PasswordBoxHelper
+ {
+ public static readonly DependencyProperty PasswordProperty =
+ DependencyProperty.RegisterAttached("Password",
+ typeof(string), typeof(PasswordBoxHelper),
+ new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged));
+
+ public static readonly DependencyProperty AttachProperty =
+ DependencyProperty.RegisterAttached("Attach",
+ typeof(bool), typeof(PasswordBoxHelper), new PropertyMetadata(false, Attach));
+
+ private static readonly DependencyProperty IsUpdatingProperty =
+ DependencyProperty.RegisterAttached("IsUpdating", typeof(bool),
+ typeof(PasswordBoxHelper));
+
+ public static void SetAttach(DependencyObject dp, bool value)
+ {
+ dp.SetValue(AttachProperty, value);
+ }
+
+ public static bool GetAttach(DependencyObject dp)
+ {
+ return (bool)dp.GetValue(AttachProperty);
+ }
+
+ public static string GetPassword(DependencyObject dp)
+ {
+ return (string)dp.GetValue(PasswordProperty);
+ }
+
+ public static void SetPassword(DependencyObject dp, string value)
+ {
+ dp.SetValue(PasswordProperty, value);
+ }
+
+ private static bool GetIsUpdating(DependencyObject dp)
+ {
+ return (bool)dp.GetValue(IsUpdatingProperty);
+ }
+
+ private static void SetIsUpdating(DependencyObject dp, bool value)
+ {
+ dp.SetValue(IsUpdatingProperty, value);
+ }
+
+ private static void OnPasswordPropertyChanged(DependencyObject sender,
+ DependencyPropertyChangedEventArgs e)
+ {
+ PasswordBox passwordBox = sender as PasswordBox;
+ passwordBox.PasswordChanged -= PasswordChanged;
+ if (!(bool)GetIsUpdating(passwordBox))
+ {
+ passwordBox.Password = (string)e.NewValue;
+ }
+ passwordBox.PasswordChanged += PasswordChanged;
+ }
+
+ private static void Attach(DependencyObject sender,
+ DependencyPropertyChangedEventArgs e)
+ {
+ PasswordBox passwordBox = sender as PasswordBox;
+ if (passwordBox == null)
+ return;
+ if ((bool)e.OldValue)
+ {
+ passwordBox.PasswordChanged -= PasswordChanged;
+ }
+ if ((bool)e.NewValue)
+ {
+ passwordBox.PasswordChanged += PasswordChanged;
+ }
+ }
+
+ private static void PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ PasswordBox passwordBox = sender as PasswordBox;
+ SetIsUpdating(passwordBox, true);
+ SetPassword(passwordBox, passwordBox.Password);
+ SetIsUpdating(passwordBox, false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/MVVM/VerifyExceptionBehavior.cs b/ECMonitor/MVVM/VerifyExceptionBehavior.cs
new file mode 100644
index 0000000..413d065
--- /dev/null
+++ b/ECMonitor/MVVM/VerifyExceptionBehavior.cs
@@ -0,0 +1,6 @@
+namespace ECMonitor.MVVM
+{
+ internal class VerifyExceptionBehavior
+ {
+ }
+}
\ No newline at end of file
diff --git a/ECMonitor/MVVM/VerifyRule.cs b/ECMonitor/MVVM/VerifyRule.cs
new file mode 100644
index 0000000..afd1b1e
--- /dev/null
+++ b/ECMonitor/MVVM/VerifyRule.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+namespace ECMonitor.MVVM
+{
+ public class VerifyRule : ValidationRule
+ {
+ public VerifyRuleType Type { get; set; } = VerifyRuleType.Unknown;
+
+ public List