コード例 #1
0
        /// <summary>
        /// 获取选中的计划
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double PLAN_GETSELECTED(CVariable var)
        {
            PlanWindow planWindow = DataCenter.PlanWindow;
            String     id         = planWindow.GetSelectedPlanID();

            if (id != null && id.Length > 0)
            {
                CPlan plan = new CPlan();
                DataCenter.PlanService.GetPlan(id, ref plan);
                CVariable newVar = new CVariable(m_indicator);
                newVar.m_expression = "'" + id + "'";
                m_indicator.SetVariable(var.m_parameters[0], newVar);
                CVariable newVar2 = new CVariable(m_indicator);
                newVar2.m_expression = "'" + plan.m_name + "'";
                m_indicator.SetVariable(var.m_parameters[1], newVar2);
                CVariable newVar3 = new CVariable(m_indicator);
                newVar3.m_expression = "'" + new DateTime(plan.m_nextTime).ToString("yyyy-MM-dd HH:mm:ss") + "'";
                m_indicator.SetVariable(var.m_parameters[2], newVar3);
                CVariable newVar4 = new CVariable(m_indicator);
                newVar4.m_expression = "'" + plan.m_member + "'";
                m_indicator.SetVariable(var.m_parameters[3], newVar4);
                CVariable newVar5 = new CVariable(m_indicator);
                newVar5.m_expression = "'" + plan.m_command + "'";
                m_indicator.SetVariable(var.m_parameters[4], newVar5);
                return(1);
            }
            else
            {
                return(0);
            }
        }
コード例 #2
0
ファイル: CFunctionUI.cs プロジェクト: ralex1975/dataquery
        /// <summary>
        /// 获取鼠标按键
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        public int GETMOUSEPOINT(CVariable var)
        {
            POINT     mousePoint = m_xml.Event.MousePoint;
            CVariable newVar     = new CVariable(m_indicator);

            newVar.m_expression = mousePoint.x.ToString();
            m_indicator.SetVariable(var.m_parameters[0], newVar);
            CVariable newVar2 = new CVariable(m_indicator);

            newVar2.m_expression = mousePoint.y.ToString();
            m_indicator.SetVariable(var.m_parameters[1], newVar2);
            return(1);
        }
コード例 #3
0
        /// <summary>
        /// 输入函数
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double IN(CVariable var)
        {
            CVariable newVar = new CVariable(m_indicator);

            newVar.m_expression = "'" + Console.ReadLine() + "'";
            m_indicator.SetVariable(var.m_parameters[0], newVar);
            return(0);
        }
コード例 #4
0
        /// <summary>
        /// 获取内容类型方法
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double HTTP_GETCONTENTTYPE(CVariable var)
        {
            CVariable newVar = new CVariable(m_indicator);

            newVar.m_expression = "'" + m_data.m_contentType + "'";
            m_indicator.SetVariable(var.m_parameters[0], newVar);
            return(0);
        }