Exemple #1
0
        /// <summary>
        /// 清空元件配置
        /// </summary>
        private void ClearCellConfig()
        {
            Itemvm cfgItem = Itemvm.findItem(items, typeof(Config));
            Itemvm item    = Itemvm.findItem(items, typeof(CellConfig));

            item.Itemvms.Clear();
            appendLog("元件配置清空成功。\r\n");
        }
Exemple #2
0
        /// <summary>
        /// 清空接口配置
        /// </summary>
        private void ClearLinkerCfg()
        {
            Itemvm cfgItem = Itemvm.findItem(items, typeof(Config));
            Itemvm item    = Itemvm.findItem(items, typeof(LinkerCfg));

            cfgItem.Itemvms.Remove(item);
            appendLog("接口配置清空成功。\r\n");
        }
Exemple #3
0
        /// <summary>
        /// 清空元件清单表
        /// </summary>
        private void ClearCptRelationList()
        {
            Itemvm cfgItem = Itemvm.findItem(items, typeof(CellListConfig));
            Itemvm item    = Itemvm.findItem(items, typeof(CptRelationDisplay));

            cfgItem.Itemvms.Remove(item);
            pro.clearProject();
            appendLog("元件清单清空成功。\r\n");
        }
Exemple #4
0
 /// <summary>
 /// 按下启动或中止按钮所执行的操作
 /// </summary>
 /// <param name="obj"></param>
 private void SwitchState(string state)
 {
     if (manager.CurrentMode == Mode.Default)
     {
         manager.CurrentMode = modes[state];
         Messenger.Default.Send <IList <string> >(openPages, "SaveOpenPages");
         Itemvm graph = Itemvm.findItem(items, typeof(GraphGenerator));
         Task   task1 = new Task(() => { graph.Itemvms[0].DoubleClick(new Action <string>(appendLog)); Thread.Sleep(200); });
         Task   task  = task1;
         task1 = task1.ContinueWith(t => { graph.Itemvms[1].DoubleClick(new Action <string>(appendLog)); Thread.Sleep(200); });
         task1 = task1.ContinueWith(t => { graph.Itemvms[2].DoubleClick(new Action <string>(appendLog)); Thread.Sleep(200); });
         task1 = task1.ContinueWith(t => { graph.Itemvms[3].DoubleClick(new Action <string>(appendLog)); Thread.Sleep(200); });
         task1 = task1.ContinueWith(t =>
         {
             Messenger.Default.Send <Object>(null, "GraphCanNotClose");
             try
             {
                 CFDisplay output = manager.prepared();//初始化仿真器的输出源
                 Messenger.Default.Send <CFDisplay>(output, "ShowOutPutValue");
                 appendLog("CF接口输出源绑定成功。\r\n");
             }
             catch (Exception e)
             {
                 appendLog("CF接口输出源绑定失败。\r\n");
                 Console.WriteLine(e);
             }
         });
         task.Start();
     }
     else
     {
         Messenger.Default.Send <object>(openPages, "ExitWorkMode");
         manager.exit();
         manager.CurrentMode = Mode.Default;
     }
     appendLog("进入" + manager.CurrentMode + "模式.\r\n");
 }
Exemple #5
0
        private void ImportCellConfig()
        {
            Itemvm item = Itemvm.findItem(items, typeof(CellConfig));

            item.DoubleClick(new Action <string>(appendLog));
        }
Exemple #6
0
        private bool CanImportCellConfig()
        {
            Itemvm item = Itemvm.findItem(items, typeof(CellConfig));

            return(item.Itemvms.Count == 0);
        }