Пример #1
0
        /// <summary>
        /// 设置参数文件
        /// </summary>
        public void SetParameterFile()
        {
            //存储到文件
            string sFileDir = AppConfigOperation.GetConfigurationValue("ApplicationFullPath") + @"\PathPlanning\Method\Parameter\" +
                              ((int)EPathPlanningMethod.RRTStar).ToString() + ".ini"; //参数文件地址

            IniOperation.WriteProfileString("PlanningStep", "StepType", ((int)(MStepType)).ToString(), sFileDir);
            IniOperation.WriteProfileString("PlanningStep", "Step", MStep.ToString(), sFileDir);
            IniOperation.WriteProfileString("PlanningStep", "FixedNearDistanceRatio", FixedNearDistanceRatio.ToString(), sFileDir);
            IniOperation.WriteProfileString("PlanningStep", "RandomStepMax", MRandomStepMax.ToString(), sFileDir);
            IniOperation.WriteProfileString("PlanningStep", "RandomStepMin", MRandomStepMin.ToString(), sFileDir);
            IniOperation.WriteProfileString("Extension", "SelectionType", ((int)MSelectionType).ToString(), sFileDir);
            IniOperation.WriteProfileString("Extension", "ChooseTargetThreshold", MChooseTargetThreshold.ToString(), sFileDir);
            IniOperation.WriteProfileString("Extension", "MaxNodeNumber", MMaxNodeNumber.ToString(), sFileDir);
            IniOperation.WriteProfileString("Extension", "ReachMode", ((int)MReachMode).ToString(), sFileDir);
            IniOperation.WriteProfileString("Others", "AutoOptimizeParameter", (Convert.ToInt32(MAutoOptimizeParameter)).ToString(), sFileDir);
            IniOperation.WriteProfileString("Others", "IsDrawingTree", (Convert.ToInt32(MIsDrawingTree)).ToString(), sFileDir);

            IniOperation.WriteProfileString("Others", "IsDubinsMode", (Convert.ToInt32(MIsDubinsMode)).ToString(), sFileDir);
            IniOperation.WriteProfileString("Others", "TurningRadius", TurningRadius.ToString(), sFileDir);

            #region NearNodesFilter
            IniOperation.WriteProfileString("NearNodesFilter", "NearNodesFilter", (Convert.ToInt32(NearNodesFilter)).ToString(), sFileDir);
            IniOperation.WriteProfileString("NearNodesFilter", "TriggerNum", TriggerNum.ToString(), sFileDir);
            #endregion
        }
Пример #2
0
 public void SetTrigger(int outNo, TriggerNum triggerNum)
 {
     try
     {
         if (controllerMode == ControllerMode.GenMode)
         {
             SetCommunicationMode();
         }
         int    tn      = (int)triggerNum;
         string command = "SW,OE,M," + outNo.ToString() + "," + tn.ToString("d1");
         Write(command, 100);
     }
     catch (Exception)
     {
         throw;
     }
 }