コード例 #1
0
ファイル: Model.cs プロジェクト: UsixROFL/DVCP-TE
        //public static string ModelRoot
        //{
        //    get { return "gcr"; }
        //}

        //public static string ControllerPath(Controller controller)
        //{
        //    var number = controller.Number;
        //    var name = controller.Name.Substring(0,
        //                controller.Name.IndexOf(
        //                number.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal));

        //    return string.Join("/", new[] { ModelRoot,
        //                                    "TE Plant",
        //                                    name + " atk block",
        //                                    controller.Name + " attack controller"});
        //}

        public static string SetParameterCommand(Controller controller, ControllerProperties property, object value)
        {
            var number = controller.Number;
            var name = controller.Name.Substring(0,
                        controller.Name.IndexOf(
                        number.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal));
            return string.Format("set_{0}_ctrl_param({1}, {2}, {3});", name, number, property.ToStringValue(), value);
        }
コード例 #2
0
ファイル: Model.cs プロジェクト: winsday/DVCP-TE
        //public static string ModelRoot
        //{
        //    get { return "gcr"; }
        //}

        //public static string ControllerPath(Controller controller)
        //{
        //    var number = controller.Number;
        //    var name = controller.Name.Substring(0,
        //                controller.Name.IndexOf(
        //                number.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal));

        //    return string.Join("/", new[] { ModelRoot,
        //                                    "TE Plant",
        //                                    name + " atk block",
        //                                    controller.Name + " attack controller"});
        //}

        public static string SetParameterCommand(Controller controller, ControllerProperties property, object value)
        {
            var number = controller.Number;
            var name   = controller.Name.Substring(0,
                                                   controller.Name.IndexOf(
                                                       number.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal));

            return(string.Format("set_{0}_ctrl_param({1}, {2}, {3});", name, number, property.ToStringValue(), value));
        }