Beispiel #1
0
        /// <summary>
        /// 开始秒表
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double STARTTIMER(CVariable var)
        {
            ControlA control = m_xml.FindControl(m_indicator.GetText(var.m_parameters[0]));

            control.StartTimer((int)m_indicator.GetValue(var.m_parameters[1]), (int)m_indicator.GetValue(var.m_parameters[2]));
            return(0);
        }
Beispiel #2
0
        /// <summary>
        /// 计算
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>结果</returns>
        public override double OnCalculate(CVariable var)
        {
            switch (var.m_functionID)
            {
            case STARTINDEX:
                return(IN(var));

            case STARTINDEX + 1:
                return(OUT(var));

            case STARTINDEX + 2:
                return(SLEEP(var));

            case STARTINDEX + 3:
            {
                double value = m_indicator.GetValue(var.m_parameters[0]);
                return(0);
            }

            default: return(0);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Windows下主板响
        /// </summary_
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double WIN_BEEP(CVariable var)
        {
            int frequency = 0, duration = 0;
            int vlen = var.m_parameters.Length;

            if (vlen >= 1)
            {
                frequency = (int)m_indicator.GetValue(var.m_parameters[0]);
            }
            if (vlen >= 2)
            {
                duration = (int)m_indicator.GetValue(var.m_parameters[1]);
            }
            Console.Beep(frequency, duration);
            return(0);
        }
Beispiel #4
0
 /// <summary>
 /// 睡眠
 /// </summary>
 /// <param name="var">变量</param>
 /// <returns>状态</returns>
 private double SLEEP(CVariable var)
 {
     Thread.Sleep((int)m_indicator.GetValue(var.m_parameters[0]));
     return(1);
 }
Beispiel #5
0
 /// <summary>
 /// 添加前缀
 /// </summary>
 /// <param name="var">变量</param>
 /// <returns>状态</returns>
 private double HTTP_ADDPORT(CVariable var)
 {
     DataCenter.NodeService.Port = (int)m_indicator.GetValue(var.m_parameters[0]);
     return(0);
 }
Beispiel #6
0
        /// <summary>
        /// 添加列
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double DATASOURCE_ADDCOLUMN(CVariable var)
        {
            int colName = (int)m_indicator.GetValue(var.m_parameters[0]);

            m_indicator.DataSource.AddColumn(colName);
            return(0);
        }
Beispiel #7
0
 /// <summary>
 /// 切换周期
 /// </summary>
 /// <param name="var">变量</param>
 /// <returns>结果</returns>
 public double SetCycle(CVariable var)
 {
     m_chart.ChangeCycle((int)m_indicator.GetValue(var.m_parameters[0]));
     return(1);
 }