コード例 #1
0
 public void Process(ScrapEvent _event)
 {
     try
     {
         this._Module._Heat.ScrapHistory.Add( _event);
     }
     catch { }
 }
コード例 #2
0
        private bool DoScrapEvent(int iIdxInPointLi)
        {
            bool bErg = false;

             try {
            ScrapEvent evScrap = new ScrapEvent();
            j = findPoint("SCRBUCKETID",0);
            if (j >= 0) {
               evScrap.BucketNumber = pointLi[j].iDataValue;
               j = findPoint("SCRKONVNR",0);
               if (j >= 0) {
                  evScrap.ConverterNumber = pointLi[j].iDataValue;
                  //evScrap.iCnvNr = pointLi[iIdxInPointLi].iCnvNr;
                  evScrap.iCnvNr = evScrap.ConverterNumber;
                  j = findPoint("SCRMATID0",0);
                  if (j >= 0) {
                     evScrap.ScrapType1 = pointLi[j].iDataValue;
                     j = findPoint("SCRMATID1",0);
                     if (j >= 0) {
                        evScrap.ScrapType2 = pointLi[j].iDataValue;
                        j = findPoint("SCRMATID2",0);
                        if (j >= 0) {
                           evScrap.ScrapType3 = pointLi[j].iDataValue;
                           j = findPoint("SCRMATID3",0);
                           if (j >= 0) {
                              evScrap.ScrapType4 = pointLi[j].iDataValue;
                              j = findPoint("SCRMATID4",0);
                              if (j >= 0) {
                                 evScrap.ScrapType5 = pointLi[j].iDataValue;
                                 j = findPoint("SCRMATID5",0);
                                 if (j >= 0) {
                                    evScrap.ScrapType6 = pointLi[j].iDataValue;
                                    j = findPoint("SCRMATID6",0);
                                    if (j >= 0) {
                                       evScrap.ScrapType7 = pointLi[j].iDataValue;
                                       j = findPoint("SCRMATID7",0);
                                       if (j >= 0) {
                                          evScrap.ScrapType8 = pointLi[j].iDataValue;
                                          j = findPoint("SCRWGT0",0);
                                          if (j >= 0) {
                                             evScrap.Weight1 = pointLi[j].iDataValue;
                                             j = findPoint("SCRWGT1",0);
                                             if (j >= 0) {
                                                evScrap.Weight2 = pointLi[j].iDataValue;
                                                j = findPoint("SCRWGT2",0);
                                                if (j >= 0) {
                                                   evScrap.Weight3 = pointLi[j].iDataValue;
                                                   j = findPoint("SCRWGT3",0);
                                                   if (j >= 0) {
                                                      evScrap.Weight4 = pointLi[j].iDataValue;
                                                      j = findPoint("SCRWGT4",0);
                                                      if (j >= 0) {
                                                         evScrap.Weight5 = pointLi[j].iDataValue;
                                                         j = findPoint("SCRWGT5",0);
                                                         if (j >= 0) {
                                                            evScrap.Weight6 = pointLi[j].iDataValue;
                                                            j = findPoint("SCRWGT6",0);
                                                            if (j >= 0) {
                                                               evScrap.Weight7 = pointLi[j].iDataValue;
                                                               j = findPoint("SCRWGT7",0);
                                                               if (j >= 0) {
                                                                  evScrap.Weight8 = pointLi[j].iDataValue;
                                                                  j = findPoint("SCRWGTTOTAL",0);
                                                                  if (j >= 0) {
                                                                     evScrap.TotalWeight = pointLi[j].iDataValue;
                                                                     sLfdEvtMsg = evScrap.ToString();
                                                                     mainGate.PushEvent(evScrap);
                                                                     AddLogg(evScrap.ToString());
                                                                     bErg = true;
                                                                     }
                                                                  else {
                                                                     AddLogg("При ScrapEvent не найдена точка SCRWGTTOTAL");
                                                                     }
                                                                  }
                                                               else {
                                                                  AddLogg("При ScrapEvent не найдена точка SCRWGT7");
                                                                  }
                                                               }
                                                            else {
                                                               AddLogg("При ScrapEvent не найдена точка SCRWGT6");
                                                               }
                                                            }
                                                         else {
                                                            AddLogg("При ScrapEvent не найдена точка SCRWGT5");
                                                            }
                                                         }
                                                      else {
                                                         AddLogg("При ScrapEvent не найдена точка SCRWGT4");
                                                         }
                                                      }
                                                   else {
                                                      AddLogg("При ScrapEvent не найдена точка SCRWGT3");
                                                      }
                                                   }
                                                else {
                                                   AddLogg("При ScrapEvent не найдена точка SCRWGT2");
                                                   }
                                                }
                                             else {
                                                AddLogg("При ScrapEvent не найдена точка SCRWGT1");
                                                }
                                             }
                                          else {
                                             AddLogg("При ScrapEvent не найдена точка SCRWGT0");
                                             }
                                          }
                                       else {
                                          AddLogg("При ScrapEvent не найдена точка SCRMATID7");
                                          }
                                       }
                                    else {
                                       AddLogg("При ScrapEvent не найдена точка SCRMATID6");
                                       }
                                    }
                                 else {
                                    AddLogg("При ScrapEvent не найдена точка SCRMATID5");
                                    }
                                 }
                              else {
                                 AddLogg("При ScrapEvent не найдена точка SCRMATID4");
                                 }
                              }
                           else {
                              AddLogg("При ScrapEvent не найдена точка SCRMATID3");
                              }
                           }
                        else {
                           AddLogg("При ScrapEvent не найдена точка SCRMATID2");
                           }
                        }
                     else {
                        AddLogg("При ScrapEvent не найдена точка SCRMATID1");
                        }
                     }
                  else {
                     AddLogg("При ScrapEvent не найдена точка SCRMATID0");
                     }
                  }
               else {
                  AddLogg("При ScrapEvent не найдена точка SCRKONVNR");
                  }
               }
            else {
               AddLogg("При ScrapEvent не найдена точка SCRBUCKETID");
               }
            }
             catch (Exception eXc) {
            sLfdEvtErr = eXc.Message;
            AddLogg("При ScrapEvent Exception: " + eXc.Message);
            }
             return bErg;
        }
コード例 #3
0
        private bool ProcessEvent(ScrapEvent _event)
        {
            int scrapPortionLastSend = Repositary.ContainsKey("ScrapPortionLastSend") ? (int)Repositary["ScrapPortionLastSend"] : 0;

            for (int i = scrapPortionLastSend; i < 8; i++)
            {

                try
                {
                    if ((int)_event.GetType().GetProperty("ScrapType" + (i + 1).ToString()).GetValue(_event, null) > 0)
                    {
                        DBWorker.Instance.Insert((int)HeatPassportOperations.ScrapEvent, _event.Time, m_ConverterNumber, HeatNumber,
                            _event.BucketNumber, _event.GetType().GetProperty("ScrapType" + (i + 1).ToString()).GetValue(_event, null),
                            _event.GetType().GetProperty("Weight" + (i + 1).ToString()).GetValue(_event, null));
                    }

                }
                catch { return false; }
                finally
                {
                    if (!Repositary.ContainsKey("ScrapPortionLastSend"))
                    {
                        Repositary.Add("ScrapPortionLastSend", i);
                    }
                    else
                    {
                        Repositary["ScrapPortionLastSend"] = i;
                    }
                }
            }
            Repositary.Remove("ScrapPortionLastSend");
            return true;
        }