Esempio n. 1
0
 /// <summary>
 /// 插入新的预案
 /// </summary>
 /// <param name="mpm">新的预案</param>
 public void MeshPlanInsert(MeshPlanManage mpm)
 {
     context.Insert <MeshPlanManage>(() =>
                                     new MeshPlanManage()
     {
         GroupName  = mpm.GroupName,
         Alias      = mpm.Alias,
         MeshIP     = mpm.MeshIP,
         Model265IP = mpm.Model265IP,
         Model265ID = mpm.Model265ID,
         TCPToCOMIP = mpm.TCPToCOMIP,
         HKVideoIP  = mpm.HKVideoIP
     });
 }
Esempio n. 2
0
 /// <summary>
 /// 更新Mesh预案
 /// </summary>
 /// <param name="mpm"></param>
 /// <returns></returns>
 public int MeshPlanUpdate(MeshPlanManage mpm)
 {
     return(context.Update <MeshPlanManage>(m => m.ID == mpm.ID,
                                            u => new MeshPlanManage()
     {
         GroupName = mpm.GroupName,
         Alias = mpm.Alias,
         MeshIP = mpm.MeshIP,
         Model265ID = mpm.Model265ID,
         Model265IP = mpm.Model265IP,
         TCPToCOMIP = mpm.TCPToCOMIP,
         HKVideoIP = mpm.HKVideoIP
     }));
 }
Esempio n. 3
0
        private void Server_OnWelcomeMessage(TcpConnention conn)
        {
            MeshDeviceInfo meshInfo = null;
            string         toCOMip  = conn.ipAddr;
            MeshPlanManage plan     = SQLiteHelper.GetInstance().MeshPlanQuerByTCPToCOMIP(toCOMip);

            if (plan != null)
            {
                meshInfo = SQLiteHelper.GetInstance().MeshDeviceInfoQueryByIP(plan.MeshIP);
            }

            if ((meshInfo != null))
            {
                //TODO:是否考虑启动时即设置频率
                SendBytesTo(toCOMip, MeshTcpConfigManager.GetChangePowerBytesCommand((int)meshInfo.Power));
                SendBytesTo(toCOMip, MeshTcpConfigManager.GetChangeRateBytesCommand((int)meshInfo.Frequency, (int)meshInfo.BandWidth));
                // BindwidthCommandHelper.ChangeBindwidth(plan.MeshIP, (int)meshInfo.BandWidth);
            }
            //SendBytesTo(toCOMip, MeshTcpConfigManager.GetChangeRateBytesCommand(656));
            // SendBytesTo(toCOMip, MeshTcpConfigManager.GetChangeRateBytesCommand(616));
        }
Esempio n. 4
0
        /// <summary>
        /// 从数据库中读取并添加Mesh设备列表
        /// </summary>
        private void loadMeshDeviceFromDB()
        {
            advTreeMeshList.BeginUpdate();
            List <MeshDeviceInfo> mdiList = SQLiteHelper.GetInstance().MeshDeviceInfoAllQuery();

            foreach (MeshDeviceInfo item in mdiList)
            {
                foreach (Node node in advTreeMeshList.Nodes)
                {
                    if (node.Text.Equals(item.GroupName))
                    {
                        Node subNode = new Node();
                        subNode.Text       = item.Alias;
                        subNode.ImageIndex = 8;
                        Cell cellState = new Cell();
                        cellState.Text                  = "离线";
                        cellState.StyleNormal           = new DevComponents.DotNetBar.ElementStyle();
                        cellState.StyleNormal.TextColor = cellState.Text.Equals("离线") ? Color.Gray : Color.DarkGreen;
                        subNode.Cells.Add(cellState);
                        Cell cellGPS = new Cell();
                        cellGPS.Images.ImageIndex = 9;
                        cellGPS.ImageAlignment    = eCellPartAlignment.NearCenter;
                        subNode.Cells.Add(cellGPS);
                        Cell cellVideo = new Cell();
                        cellVideo.Images.ImageIndex = 11;
                        subNode.Cells.Add(cellVideo);
                        Cell cellGPSTrack = new Cell();
                        cellGPSTrack.Images.ImageIndex = 13;
                        cellGPSTrack.ImageAlignment    = eCellPartAlignment.NearBottom;
                        cellGPSTrack.Tag = false;  //标识是否在界面上绘制了历史轨迹
                        subNode.Cells.Add(cellGPSTrack);

                        MeshPlanManage mpm     = SQLiteHelper.GetInstance().MeshPlanQueryByMeshIP(item.IPV4);
                        MeshAllInfo    nodeMAI = new MeshAllInfo()
                        {
                            DeviceInfo      = item,
                            PlanInfo        = mpm,
                            MeshGPSInfo     = new GPSInfo(),
                            BuddyNode       = subNode,
                            BuddyBMeshPoint = new BMeshPoint()
                            {
                                GroupName    = item.GroupName,
                                Alias        = item.Alias,
                                IPV4         = item.IPV4,
                                Model265ID   = mpm.Model265ID,
                                Power        = item.Power,
                                Frequency    = item.Frequency,
                                BandWidth    = item.BandWidth,
                                Battery      = item.Battery,
                                IsOnline     = false,
                                Location     = new LatLngPoint(0, 0),
                                Expiration   = int.Parse(mFormMain.AllApplicationSetting[ApplicationSettingKey.GPSExpirationTime]),
                                ReceiveGPSDT = DateTime.Now
                            },
                            OfflineCount = 0,
                            WasOnline    = false
                        };
                        //添加进列表
                        mMeshAllInfo.Add(nodeMAI);
                        mBMeshPoints.Add(nodeMAI.BuddyBMeshPoint);
                        subNode.Tag = nodeMAI;
                        node.Nodes.Add(subNode);
                        break;
                    }
                }
            }
            //添加Mesh设备点到百度地图上
            if (BuddyBMapControl != null)
            {
                //BuddyBMapControl.AddMeshDevicePlaces(mBMeshPoints);
            }
            advTreeMeshList.EndUpdate();
        }