Exemplo n.º 1
0
 public void downLoadWeight()
 {
     if (lastweight == curweight.ToString())
     {
         if (xiachuanFlag == 1)
         {
             return;
         }
         else
         {
             if (OPCHelp.GetInstance().setVal(L1ValId, curweight) == true)
             {
                 xiachuanFlag = 1;
             }
         }
     }
     else
     {
         xiachuanFlag = 0;
         lastweight   = curweight.ToString();
         if (OPCHelp.GetInstance().setVal(L1ValId, curweight) == true)
         {
             xiachuanFlag = 1;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取实例 (单例模式)
 /// </summary>
 /// <returns></returns>
 public static OPCHelp GetInstance()
 {
     if (_instance == null)
     {
         _instance = new OPCHelp();
     }
     return(_instance);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 根据变量ID获取变量的值
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public double getVal(int id)
 {
     return(Math.Round(OPCHelp.GetInstance().getVal(id), 2));
 }
Exemplo n.º 4
0
 public int getValueInt(int id)
 {
     return(OPCHelp.GetInstance().getValInt(id));
 }