示例#1
0
        /// <summary>
        /// 初始化点集
        /// </summary>
        private void InitPoints()
        {
            string[] usrName;
            string[] projName;
            string[] projDWName;

            numP = CConsLog.findLast7Cons(out usrName, out projName, out projDWName, out px, out py);

            //判定是否为中心点
            iscenter = new int[numP];
            //定义相似度矩阵
            similarmatrix = new double[numP, numP];
            //定义消息
            msga    = new double[numP, numP];
            msgr    = new double[numP, numP];
            oldmsga = new double[numP, numP];
            oldmsgr = new double[numP, numP];

            for (int k = 0; k < numP; k++)
            {
                iscenter[k] = 0;
            }
        }
示例#2
0
        //private void timerMessageBox_Tick(object sender, EventArgs e)
        //{
        //    //服务器读取消息;

        //    int count = CConsLog.refreshConsLog();
        //    if (count > 0)
        //    {
        //        Random random = new Random();

        //        string str = " ";
        //        for (int i = 0; i < 3; i++)
        //        {
        //            int n = random.Next(count) + random.Next(count) - count;
        //            if (n < 0) n = -n;
        //            if (CConsLog.mLogInfo[n] == null) continue;
        //            str += CConsLog.mLogInfo[n] + "\t" + CConsLog.mLogTime[n].ToShortTimeString() + "\n";
        //        }
        //        ToastNotification.Show(this, str, null, 3000,
        //            (eToastGlowColor)(eToastGlowColor.Red), (eToastPosition)(eToastPosition.BottomCenter));
        //    }
        //}

        //private void panelPrjOutline_VisibleChanged(object sender, EventArgs e)
        //{
        //    if (isGISLoaded)
        //    {
        //        if (panelPrjOutline.Visible)
        //        {
        //            int id = mNavigationControl.getCurrentPlaceIndex();
        //            showPrj2DListView(id);
        //            isAutoNav = false;
        //            timerNavCmdResponse.Interval = 20000;
        //            timerNavCmdResponse.Start();

        //        }
        //        else
        //        {
        //            isAutoNav = true;
        //            pictureBox1.Image = imgListCmd.Images[1];
        //            mNavigationControl.startNextPresentation();
        //            timerNavCmdResponse.Stop();
        //        }
        //    }

        //}



        private int asyncGetMsg()
        {
            return(CConsLog.refreshMsgLog());
        }
示例#3
0
        /// <summary>
        /// TODO 丁一明,显示聚类结果
        /// </summary>
        /// <param name="groupID"></param>
        public override void TECreate()
        {
            /* string[] usrName;
             * string[] projName;
             * string[] consDate;
             * double[] x;
             * double[] y;
             *
             * var sgworld = new SGWorld66();
             * var branch = sgworld.ProjectTree.FindItem(groupID);
             *
             * int num;
             * num = CConsLog.findLast365Cons(out usrName, out projName, out consDate, out x, out y);
             * for (int i = 0; i < num; i++)
             * {
             *   Console.WriteLine("{0} #\t: User {1}\t Project {2}\t  x {3}\t y  {4}\t  Date {5}", i, usrName[i], projName[i], x[i], y[i], consDate[i]);
             * }*/

            ///dym
            var sgworld = new SGWorld66();

            if (string.IsNullOrEmpty(mGroupIDDynamic))
            {
                mGroupIDDynamic = sgworld.ProjectTree.CreateGroup("Cons");
            }
            //var branch = sgworld.ProjectTree.FindItem(groupID);


            List <ConsLocation> ls;

            //ls = CConsLog.clusterConsByProj();
            ls = CConsLog.clusterConsFromWebByProj(mTEScene.fromDate.ToString("u"), mTEScene.toDate.ToString("u"));

            //int maxParticles = 100;
            //string imageName = "";
            //int rate = 2;
            //int shape = 0;

            //var branch = sgworld.ProjectTree.FindItem("Dying");
            //ITerrainEffect66 gParticleLabel = (ITerrainEffect66)sgworld.ProjectTree.GetObject(branch);
            //var xml = gParticleLabel.EffectXML;
            //Console.WriteLine(xml);

            //var particleText = "$$PARTICLE$$UserDefine: \r\n <?xml version='1.0' encoding='UTF-8'?> \r\n <Particle ID='Custom'>";
            //particleText += "<ParticleEmitter ID='Disc' NumParticles='130' Texture='d:\\Campfire.png'>\r\n";
            //particleText += "<Emitter Rate='13' Shape='Disc' SpeedShape='Disc' Scale='50,50,50' Speed='1,1,1' />\r\n";
            //particleText += "<Cycle Value='1' /><Sort Value='1' /><Rotation Speed='1' Time='2' Initial='0' />\r\n";
            //particleText += "<Render Value='Billboard' /><Gravity Value='0, 1, 0' /><Force Value='0' OverrideRotation='0' />\r\n";
            //particleText += "<Position Value='0, 0, 0' /><Life Value='3.06' /><Speed Value='1.41' />\r\n";
            //particleText += "<Color Value='0,0,255,255' /><Size Value='24,24' /><Drag Value='1' />\r\n";
            //particleText += "<Blend Type='' /><Fade FadeIn='0.47' FadeOut='0.65' MaxFade='0.28' /></ParticleEmitter>\r\n";
            //particleText += "</Particle>";

            //IPosition66 tp = sgworld.Creator.CreatePosition(118.086466892066, 36.9038495888797, 3, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
            //      0, -90.0, 0, 0);
            //ITerrainRegularPolygon66 tcircle = sgworld.Creator.CreateCircle(tp, 200, 0xFF0000FF, 0x00FF00FF, branch, "测试点");
            //tcircle.LineStyle.Width = -5.0;

            foreach (ConsLocation cl in ls)
            {
                IPosition66 p = sgworld.Creator.CreatePosition(cl.Longitude, cl.Latitude, 30, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
                                                               0, -90.0, 0, 0);
                ITerrainRegularPolygon66 circle = sgworld.Creator.CreateCircle(p, cl.number * 2 + 200, 0xFF0000FF, 0x00FF00FF, mGroupIDDynamic, cl.ProjName + cl.number);
                //  circle.de
                circle.LineStyle.Width = -5.0;
                circle.Visibility.MinVisibilityDistance = 100000;
                //circle.SetParam

                ITerrainLabel66 iLabel = sgworld.Creator.CreateLabel(p, cl.number + "", CGisDataSettings.gDataPath + @"Common\地标图片\worker.png", mTEStandard.mLabelStyleL2, mGroupIDDynamic, cl.ProjName);
                iLabel.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, cl.ToString(), MsgType.TYPE_TEXT, true).ID;
                //    circle.Message.MessageID = sgworld.Creator.CreateMessage(MsgTargetPosition.MTP_POPUP, cl.ToString(), MsgType.TYPE_TEXT, true).ID;


                //particleText += "<ParticleEmitter ID='ring' NumParticles='" + maxParticles + "' Texture='" + imageName + "'>" + "\r\n" +
                //  "<Emitter Rate='" + rate + "' Shape='" + shape + "' SpeedShape='" + speedShape + "' Scale='" + scaleX + "," + scaleY + "," + scaleZ + "' Speed='" + speedX + "," + speedY + "," + speedZ + "' />" + "\r\n" + // shape:(Cone, Sphere, ShellCone, ShellSphere, Ring, Disc, Cube), scale:the size of the shape in meters,  speed:(X,Alt,Z) disform the shape like it is in radius=1.
                //  "<Cycle Value='1' />" + "\r\n" + // 0=one time , 1=loop
                //  "<Sort Value='1' />" + "\r\n" +
                //  rotationNodeConditional +

                //  "<Render Value='" + render + "' />" + "\r\n" +
                //  "<Gravity Value='" + gravityX + ", " + gravityY + ", " + gravityZ + "' />" + "\r\n" + // Gravity in X, Altitude and Z directions
                //  "<Force Value='" + force + "' OverrideRotation='" + overrideRotation + "' />" + "\r\n" + // Gravity in X, Altitude and Z directions
                //  "<Position Value='0, 0, 0' />" + "\r\n" + // doesn;t work
                //  "<Life Value='" + timeSpan + "' />" + "\r\n" + // life of each particle in seconds
                //  "<Speed Value='" + particleSpeed + "' />" + "\r\n" + // this value multiply the Emitter speed values (x,y,z)
                //  "<Color Value='20," + colorR + "," + colorG + "," + colorB + "' />" + "\r\n" +
                //  "<Size Value='" + sizeWithRatioX /*size*/ + "," + sizeWithRatioY /*size * sizeRatio*/ + "' />" + "\r\n" + // size of the particle image 1=original image size. Format: SizeX, SizeY
                //  "<Drag Value='" + drag + "' />" + "\r\n" + // drag force (units like graviy)
                //  "<Blend Type='" + blend + "' />" + "\r\n" +
                //    //***   "<Rotation Speed='0' Time='1.7' />" + "\r\n" + // optional: should be in a checkbox
                //  "<Fade FadeIn='" + fadeIn + "' FadeOut='" + fadeOut + "' MaxFade='" + maxFade + "' />" + "\r\n" + // fade of each particle. FadeIn/fade out in seconds. Max fade - the maximum fade value (alpha 0-1)
                //"</ParticleEmitter>" + "\r\n";
                //particleText += "</Particle>";

                //ITerrainEffect66 ite = sgworld.Creator.CreateEffect(p, particleText, branch, cl.name + cl.number);

                //ite.EffectXML = particleText;
                //ite.Terrain.BBox


                //Console.WriteLine("x: {0} y {1} number {2}", cl.longitude, cl.latitude, cl.number);
            }

            //DBSCAN.Cluster();

            //for (int i = 0; i < DBSCAN.center.Count; i++)
            //{
            //    IPosition66 p = sgworld.Creator.CreatePosition(DBSCAN.center[i].longitude, DBSCAN.center[i].latitude, 0, AltitudeTypeCode.ATC_TERRAIN_RELATIVE,
            //      341, -90.0, 0, 445000);
            //    ITerrainRegularPolygon66 Circle = sgworld.Creator.CreateCircle(p, DBSCAN.p_count[i], 0x00FFFF, 0x00FF00, "", "");
            //    Circle.LineStyle.Width = -5.0;
            //   // sgworld.Creator.CreateCircle(p, DBSCAN.p_count[i]*100, 0x0000FF, 0x00FF00, "", "");
            //     //sgworld.Creator.CreateEllipse(p, DBSCAN.p_count[i], DBSCAN.p_count[i], 0x00FFFF, 0x00FF00, -1, "", "");

            //}
        }