示例#1
0
        public LDAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_LD, container)
        {
            legend = (LegendRecord)rs.GetNext();
            rs.GetNext();//BeginRecord
            pos           = (PosRecord)rs.GetNext();
            attachedLabel = new AttachedLabelAggregate(rs, this);

            if (rs.PeekNextChartSid() == FrameRecord.sid)
            {
                frame = new FrameAggregate(rs, this);
            }
            if (rs.PeekNextChartSid() == CrtLayout12Record.sid)
            {
                crtLayout = (CrtLayout12Record)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
            {
                textProps = new TextPropsAggregate(rs, this);
            }
            if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                crtMlFrt = new CrtMlFrtAggregate(rs, this);
            }
            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
示例#2
0
        public AxisParentAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_AXISPARENT, container)
        {
            axisPraent = (AxisParentRecord)rs.GetNext();
            rs.GetNext();
            pos = (PosRecord)rs.GetNext();
            if (ChartFormatRecord.sid != rs.PeekNextChartSid())
            {
                try
                {
                    axes = new AxesAggregate(rs, this);
                }
                catch
                {
                    Debug.Print("not find axes rule records");
                    axes = null;
                }
            }
            Debug.Assert(ChartFormatRecord.sid == rs.PeekNextChartSid());
            while (ChartFormatRecord.sid == rs.PeekNextChartSid())
            {
                crtList.Add(new CRTAggregate(rs, this));
            }
            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
示例#3
0
        /// <summary>
        /// 获得自定义格式的消费记录
        /// </summary>
        /// <param name="t690Data">源数据</param>
        /// <returns></returns>
        private PosRecord GetPosRecord(T690ReadData t690Data)
        {
            PosRecord posRecord = new PosRecord();

            try
            {
                posRecord.CardNo      = t690Data.CardNo;
                posRecord.RecordIndex = t690Data.Record_Total / C_iTimesRate;
                posRecord.Consume     = (decimal)t690Data.flag / C_dMoneyRate;
                posRecord.Balance     = (decimal)t690Data.Consume / C_dMoneyRate;

                string strYear  = t690Data.TimeString.Substring(0, 4);
                string strMonth = t690Data.TimeString.Substring(4, 2);
                //返回的原始数据中,月份的十位数无法反映0以外的数字
                if (strMonth == "00" || strMonth == "01" || strMonth == "02")
                {
                    strMonth = DateTime.Now.Month.ToString().PadLeft('0');
                }
                string strDay     = t690Data.TimeString.Substring(6, 2);
                string strHour    = t690Data.TimeString.Substring(8, 2);
                string strMinute  = t690Data.TimeString.Substring(10, 2);
                string strSeconds = t690Data.TimeString.Substring(12, 2);
                posRecord.RecordTime = DateTime.Parse(strYear + "-" + strMonth + "-" + strDay + " " + strHour + ":" + strMinute + ":" + strSeconds);
            }
            catch (Exception)
            {
                //需添异常数据的记录
                return(null);
            }
            return(posRecord);
        }
示例#4
0
        private static PosRecord CreatePosRecord()
        {
            PosRecord r = new PosRecord();

            r.MDTopLt = PositionMode.MDPARENT;
            r.MdBotRt = PositionMode.MDPARENT;

            return(r);
        }
        public AttachedLabelAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_ATTACHEDLABEL, container)
        {
            ChartSheetAggregate cs = GetContainer <ChartSheetAggregate>(ChartRecordAggregate.RuleName_CHARTSHEET);

            _isFirst = cs.AttachLabelCount == 0;
            cs.AttachLabelCount++;
            text = (TextRecord)rs.GetNext();
            rs.GetNext();//BeginRecord
            pos = (PosRecord)rs.GetNext();
            if (rs.PeekNextChartSid() == FontXRecord.sid)
            {
                fontX = (FontXRecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == AlRunsRecord.sid)
            {
                alRuns = (AlRunsRecord)rs.GetNext();
            }
            brai = (BRAIRecord)rs.GetNext();
            if (rs.PeekNextChartSid() == SeriesTextRecord.sid)
            {
                seriesText = (SeriesTextRecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == FrameRecord.sid)
            {
                frame = new FrameAggregate(rs, this);
            }
            if (rs.PeekNextChartSid() == ObjectLinkRecord.sid)
            {
                objectLink = (ObjectLinkRecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == DataLabExtContentsRecord.sid)
            {
                dataLab = (DataLabExtContentsRecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == CrtLayout12Record.sid)
            {
                crtLayout = (CrtLayout12Record)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
            {
                textProps = new TextPropsAggregate(rs, this);
            }
            if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                crtMlFrt = new CrtMlFrtAggregate(rs, this);
            }
            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
示例#6
0
        public List <PosRecord> ER_GetAllRecord()
        {
            this._ListConsRecords = new List <T690ReadData>();

            procDelegate = ReceiveData;
            timeDelegate = TimeLapse;

            int res = ReadAllRecord(this._DevicePort, this._DevicePort, procDelegate, timeDelegate);

            List <PosRecord> listRecod = new List <PosRecord>();

            foreach (T690ReadData itemT690 in this._ListConsRecords)
            {
                PosRecord posRecord = GetPosRecord(itemT690);
                if (posRecord != null)
                {
                    listRecod.Add(posRecord);
                }
            }

            return(listRecod);
        }