예제 #1
0
 static public void HitMatch(byte[] addrs)
 {
     lock (agent_access)
     {
         foreach (byte addr in addrs)
         {
             if ((agent[addr] is WeighNode) && (agent[addr].status == NodeStatus.ST_IDLE))
             {
                 WeighNode wn = (agent[addr] as WeighNode);
                 wn.ClearWeight();
                 wn.cnt_match = -1;
                 if (wn.errlist != "")
                 {
                     wn.errlist = wn.errlist.Replace("err_om;", "");
                 }
             }
         }
     }
 }
예제 #2
0
 static public void IncMatchCount(byte addr)
 {
     if (agent[addr] is WeighNode)
     {
         WeighNode n = agent[addr] as WeighNode;
         n.cnt_match++;
         if (n.cnt_match > 50)
         {
             if (AlertWnd.b_turnon_alert)
             {
                 if (AlertWnd.b_manual_reset)              //manual reset
                 {
                     if (n.errlist.IndexOf("err_om;") < 0) //no matching for serveral times
                     {
                         n.errlist = n.errlist + "err_om;";
                     }
                 }
             }
         }
     }
 }
예제 #3
0
 static public void SetOverWeight(byte addr, bool ow)
 {
     lock (agent_access)
     {
         if (agent[addr] is WeighNode)
         {
             WeighNode n = agent[addr] as WeighNode;
             if (ow)
             {
                 if (n.errlist.IndexOf("err_ow;") < 0)
                 {
                     n.errlist = n.errlist + "err_ow;";
                 }
             }
             else
             {
                 if (n.errlist != "")
                 {
                     n.errlist = n.errlist.Replace("err_ow;", "");//reset overweight error
                 }
             }
         }
     }
 }