Example #1
0
 public void SetGiaTri_CO(long?v_CO, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
 {
     if (qualiti == eQualiti.OPCQualityGood)
     {
         countBad_CO = 0;
         OPC_CO      = v_CO;
     }
     else
     {
         if (countBad_CO <= MAX_COUNT)
         {
             countBad_CO++;
             if (countBad_CO > MAX_COUNT)
             {
                 OPC_H2 = null;
             }
             else
             {
                 return;
             }
         }
         else
         {
             return;
         }
     }
     CO          = OPC_CO;
     sCO         = CO.HasValue ? CO.Value.ToString($"#,##0.### {StaticDonVi.CO}") : "---";
     OPC_Qualiti = qualiti;
     UpdateTime  = time;
 }
Example #2
0
 public void SetGiaTri_CH4(long?v_CH4, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
 {
     if (qualiti == eQualiti.OPCQualityGood)
     {
         countBad_CH4 = 0;
         OPC_CH4      = v_CH4;
     }
     else
     {
         if (countBad_CH4 <= MAX_COUNT)
         {
             countBad_CH4++;
             if (countBad_CH4 > MAX_COUNT)
             {
                 OPC_H2 = null;
             }
             else
             {
                 return;
             }
         }
         else
         {
             return;
         }
     }
     CH4         = OPC_CH4 * 1F / 100;
     sCH4        = CH4.HasValue ? CH4.Value.ToString($"#,##0.### {StaticDonVi.CH4}") : "---";
     OPC_Qualiti = qualiti;
     UpdateTime  = time;
 }
Example #3
0
        public void SetGiaTri_O2(long?v_O2, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
        {
            if (qualiti == eQualiti.OPCQualityGood)
            {
                countBad_O2 = 0;

                OPC_O2 = v_O2;
            }
            else
            {
                if (countBad_O2 <= MAX_COUNT)
                {
                    countBad_O2++;
                    if (countBad_O2 > MAX_COUNT)
                    {
                        OPC_H2 = null;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            O2          = OPC_O2 * 1F / 10;
            sO2         = O2.HasValue ? O2.Value.ToString($"#,##0.### {StaticDonVi.O2}") : "---";
            OPC_Qualiti = qualiti;
            UpdateTime  = time;
        }
Example #4
0
        public void SetGiaTri_H2(long?v_H2, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
        {
            if (qualiti == eQualiti.OPCQualityGood)
            {
                countBad_H2 = 0;

                OPC_H2 = v_H2;
            }
            else
            {
                if (countBad_H2 <= MAX_COUNT)
                {
                    countBad_H2++;
                    if (countBad_H2 > MAX_COUNT)
                    {
                        OPC_H2 = null;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            H2          = OPC_H2;
            sH2         = H2.HasValue ? H2.Value.ToString($"#,##0.### {StaticDonVi.H2}") : "---";
            OPC_Qualiti = qualiti;
            UpdateTime  = time;
        }
Example #5
0
        public void SetGiaTri(long?value, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
        {
            if (qualiti == eQualiti.OPCQualityGood)
            {
                countBad_GiaTri = 0;
                OPC_GiaTri      = value;
            }
            else
            {
                if (countBad_GiaTri <= MAX_COUNT)
                {
                    countBad_GiaTri++;
                    if (countBad_GiaTri > MAX_COUNT)
                    {
                        OPC_GiaTri = null;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }

            OPC_Qualiti = qualiti;
            UpdateTime  = time;

            switch (TypeDiemDo)
            {
            case eTypeDiemDo.CH4:
                GiaTri = OPC_GiaTri * 1F / 100;
                break;

            case eTypeDiemDo.O2:
                GiaTri = OPC_GiaTri * 1F / 10;
                break;

            case eTypeDiemDo.CO:
            case eTypeDiemDo.H2:
            case eTypeDiemDo.NhietDo:
            case eTypeDiemDo.Gio:
            case eTypeDiemDo.Notset:
                GiaTri = OPC_GiaTri;
                break;

            default:
                throw new NotSupportedException(TypeDiemDo.ToString());
            }
            sGiaTri = GiaTri.HasValue ? GiaTri.Value.ToString("#,##0.###") : "---";
        }
Example #6
0
 public void SetGiaTri_CO(long?v_CO, DateTime time, eQualiti qualiti = eQualiti.OPCQualityGood)
 {
     _daThongSoObject.SetGiaTri_CO(v_CO, time, qualiti);
     Refresh();
 }
Example #7
0
 public void SetGiaTri(long?value, DateTime time, eQualiti qualiti)
 {
     _diemDoObject.SetGiaTri(value, time, qualiti);
     Refresh();
 }