Exemplo n.º 1
0
        public override int Write(BinaryWriter bw)
        {
            bw.Write(Convert.ToUInt16(STDFRecordType.TSR));
            bw.Write(this.HEAD_NUM);
            bw.Write(this.SITE_NUM);
            bw.Write(this.TEST_TYP);
            bw.Write(this.TEST_NUM);
            bw.Write(this.EXEC_CNT);
            bw.Write(this.FAIL_CNT);
            bw.Write(this.ALRM_CNT);
            base.WriteString(bw, this.TEST_NAM);
            base.WriteString(bw, this.SEQ_NAME);
            base.WriteString(bw, this.TEST_LBL);
            uint num = ~this.OPT_FLAG;

            num &= 0xff;
            byte b = Convert.ToByte(num);

            if (b != 0)
            {
                bw.Write(this.OPT_FLAG);
                bw.Write(this.TEST_TIM);
                b = STDFManager.SetBit(b, 2, false);
                if (b == 0)
                {
                    return(0);
                }
                bw.Write(this.TEST_MIN);
                b = STDFManager.SetBit(b, 0, false);
                if (b == 0)
                {
                    return(0);
                }
                bw.Write(this.TEST_MAX);
                b = STDFManager.SetBit(b, 1, false);
                if (b == 0)
                {
                    return(0);
                }
                bw.Write(this.TST_SUMS);
                if (STDFManager.SetBit(b, 4, false) == 0)
                {
                    return(0);
                }
                bw.Write(this.TST_SQRS);
            }
            return(0);
        }
Exemplo n.º 2
0
 public PRRRecord() : base(STDFRecordType.PRR)
 {
     this.PART_FLG = 0;
     this.PART_FLG = STDFManager.SetBit(this.PART_FLG, 4, true);
 }
Exemplo n.º 3
0
        public override int Write(BinaryWriter bw)
        {
            bw.Write(Convert.ToUInt16(STDFRecordType.PTR));
            bw.Write(this.TEST_NUM);
            bw.Write(this.HEAD_NUM);
            bw.Write(this.SITE_NUM);
            bw.Write(this.TEST_FLG);
            bw.Write(this.PARM_FLG);
            bw.Write(this.RESULT);
            base.WriteString(bw, this.TEST_TXT);
            base.WriteString(bw, this.ALARM_ID);
            byte b = ~this.OPT_FLAG;

            if (STDFManager.GetBit(b, 4))
            {
                b = STDFManager.SetBit(b, 6, true);
            }
            if (STDFManager.GetBit(b, 6))
            {
                b = STDFManager.SetBit(b, 4, true);
            }
            if (STDFManager.GetBit(b, 5))
            {
                b = STDFManager.SetBit(b, 7, true);
            }
            if (STDFManager.GetBit(b, 7))
            {
                b = STDFManager.SetBit(b, 5, true);
            }
            byte num2 = 0;

            if (this.UNITS.Length != 0)
            {
                num2 = STDFManager.SetBit(num2, 0, true);
            }
            if (this.C_RESFMT.Length != 0)
            {
                num2 = STDFManager.SetBit(num2, 1, true);
            }
            if (this.C_LLMFMT.Length != 0)
            {
                num2 = STDFManager.SetBit(num2, 2, true);
            }
            if (this.C_HLMFMT.Length != 0)
            {
                num2 = STDFManager.SetBit(num2, 3, true);
            }
            bw.Write(this.OPT_FLAG);
            if ((b != 0) || (num2 != 0))
            {
                bw.Write(this.RES_SCAL);
                b = STDFManager.SetBit(b, 0, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                bw.Write(this.LLM_SCAL);
                b = STDFManager.SetBit(b, 4, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                bw.Write(this.HLM_SCAL);
                b = STDFManager.SetBit(b, 5, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                bw.Write(this.LO_LIMIT);
                b = STDFManager.SetBit(b, 6, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                bw.Write(this.HI_LIMIT);
                b = STDFManager.SetBit(b, 7, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                base.WriteString(bw, this.UNITS);
                num2 = STDFManager.SetBit(num2, 0, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                base.WriteString(bw, this.C_RESFMT);
                num2 = STDFManager.SetBit(num2, 1, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                base.WriteString(bw, this.C_LLMFMT);
                num2 = STDFManager.SetBit(num2, 2, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                base.WriteString(bw, this.C_HLMFMT);
                num2 = STDFManager.SetBit(num2, 3, false);
                if ((b == 0) && (num2 == 0))
                {
                    return(0);
                }
                bw.Write(this.LO_SPEC);
                if (STDFManager.SetBit(b, 2, false) == 0)
                {
                    return(0);
                }
                bw.Write(this.HI_SPEC);
            }
            return(0);
        }