コード例 #1
0
        private void TextureGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var texture = DataGridUtil.GetSelectedObject <TextureObject>(TextureGrid);

            if (texture == null)
            {
                return;
            }
            ClearAllSelectionsAndHighlightedObjects();

            DataGridUtil.MarkAsHighlighted(TextureGrid, texture, Colors.Chartreuse);
            var matLst = HighlightMaterialByTexture(texture, Colors.Chartreuse);

            foreach (var mat in matLst)
            {
                HighlightMeshByMaterial(mat, Colors.Chartreuse);
            }
        }
コード例 #2
0
        private void MeshGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var mesh = DataGridUtil.GetSelectedObject <MeshObject>(MeshGrid);

            if (mesh == null)
            {
                return;
            }
            ClearAllSelectionsAndHighlightedObjects();

            DataGridUtil.MarkAsHighlighted(MeshGrid, mesh, Colors.Chartreuse);
            var matLst = HighlightMaterialByMesh(mesh, Colors.Chartreuse);

            foreach (var mat in matLst)
            {
                HighlightTextureByMaterial(mat, Colors.Chartreuse);
            }
        }
コード例 #3
0
 public bool SaveParameter(out String Msg)
 {
     lock (ResManager.ui_lockObj)
     {
         Msg = "";
         if (!DataGridUtil.GetDataGridRowsHasError(dg))
         {
             var result = bjService.SaveBJ(BJObjList);
             if (!result)
             {
                 Msg = "保存失败!";
             }
             else
             {
                 IList <VBJ> tem = null;
                 if (Constants.BJDict.ContainsKey(T.Name))
                 {
                     tem = Constants.BJDict[T.Name];
                     Constants.BJDict.Remove(T.Name);
                 }
                 Constants.BJDict.Add(T.Name, bjService.QueryBJ(T.Name));
                 var rlist = Constants.BJDict[T.Name];
                 if (tem != null && rlist.Count == tem.Count)
                 {
                     for (int i = 0; i < rlist.Count; i++)
                     {
                         rlist[i].ChangedValueMap = tem[i].ChangedValueMap;
                         rlist[i].CopyValues(tem[i].Values);
                     }
                 }
                 Engine.getInstance().InitRes();
             }
             return(result);
         }
         else
         {
             Msg = "请检查数据";
             return(false);
         }
     }
 }
コード例 #4
0
ファイル: Effect.xaml.cs プロジェクト: zhukunqian/usmooth
        bool NetHandle_StressTestResult(eNetCmd cmd, UsCmd c)
        {
            string name     = c.ReadString();
            int    avgMS    = c.ReadInt32();
            int    maxMS    = c.ReadInt32();
            int    drawcall = c.ReadInt32();
            int    parCount = c.ReadInt32();

            EffectGrid.Dispatcher.Invoke(new Action(() =>
            {
                foreach (var item in EffectGrid.Items)
                {
                    EffectObject mo = item as EffectObject;
                    if (mo != null && mo.Name == name)
                    {
                        if (_highlighted != null)
                        {
                            DataGridUtil.ClearHighlighted(EffectGrid, _highlighted);
                        }

                        mo.MSAvg          = avgMS;
                        mo.MSMax          = maxMS;
                        mo.DrawCallCount  = drawcall;
                        mo.TotalParticles = parCount;

                        DataGridUtil.MarkAsHighlighted(EffectGrid, item, Colors.Chartreuse);
                        _highlighted = mo;

                        break;
                    }
                }
            }));

            RunNextEffectStressTest();

            return(true);
        }
コード例 #5
0
        private void bt_locate_Click(object sender, RoutedEventArgs e)
        {
            var mesh = DataGridUtil.GetSelectedObject <MeshObject>(MeshGrid);

            NetRequest_FlyToMesh(mesh);
        }
コード例 #6
0
        /// <summary>
        /// 确定 按钮
        /// </summary>
        /// <param name="dg"></param>
        public void ClickOK(DataGrid dg)
        {
            if (DataGridUtil.GetDataGridRowsHasError(dg))
            {
                SwitchTab(1);
                this.View.UpdateLayout();
                //windowManager.ShowMessageBox("请详细检查数据");
                dg.ShowHint(new MessageWin("请详细检查数据"));
                return;
            }
            SyncTubeName();
            SyncStep();
            unknown.Refresh();
            t_Gel.UnknownResult = unknown.ToString();

            var lastgel_list = gelService.QueryGelStepByGelId(t_Gel.ID);

            foreach (var lastgel in lastgel_list)
            {
                bool is_find = false;
                foreach (var gelstep in GelSteps)
                {
                    if (lastgel.ID == gelstep.ID)
                    {
                        is_find = true;
                        break;
                    }
                }
                if (is_find == false)
                {
                    gelService.DeleteGelStep(lastgel);
                }
            }

            var lastgelres_list = gelService.QueryResMapByGelId(t_Gel.ID);

            foreach (var lastresgel in lastgelres_list)
            {
                bool is_find = false;
                foreach (var resmap in t_Gel.ResultMaps)
                {
                    if (lastresgel.ID == resmap.ID)
                    {
                        is_find = true;
                        break;
                    }
                }
                if (is_find == false)
                {
                    gelService.DeleteGelResutMap(lastresgel);
                }
            }

            //按顺序排列setps
            for (int i = 0; i < t_Gel.GelSteps.Count; i++)
            {
                t_Gel.GelSteps[i].StepIndex = i;
            }
            if (gelService.InserOrUpdateGEL(t_Gel))
            {
                Engine.getInstance().InitRes();
                windowManager.ShowMessageBox("保存成功!");
            }
            else
            {
                windowManager.ShowMessageBox("保存失败!");
            }
        }