コード例 #1
0
        //更新相位位置信息
        private void updatePhasePosition()
        {
            int phaseRecordsSize = phaseRecords.Count;

            for (int i = positionSetIndex; i < phaseRecordsSize; ++i)
            {
                PhaseRecord phaseRecord         = phaseRecords[i];
                ulong       phaseTimestamp      = phaseRecord.timestamp;
                int         positionRecordsSize = positionRecords.Count;
                int         j = 0;
                // Console.WriteLine("phaseTimestamp=" + phaseTimestamp);
                for (j = positionRecordsSize - 1; j > 0; --j)
                {
                    PositionRecord positionRecord = positionRecords[j];
                    //   Console.WriteLine("positionRecordTimestamp=" + positionRecord.timestamp);
                    if (phaseTimestamp > positionRecord.timestamp)
                    {
                        if (j < positionRecordsSize - 1)
                        {
                            //找到时间区间
                            PositionRecord tmpPositionRecord = estimatePosition(positionRecords[j], positionRecords[j + 1], phaseTimestamp);
                            phaseRecord.angle = tmpPositionRecord.angle;
                            phaseRecord.x     = tmpPositionRecord.x;

                            tagsWithPosTable.addTagInfo(phaseRecord.epc, phaseRecord.phase, phaseRecord.x, phaseRecord.angle, phaseRecord.timestamp);
                            //将标签和位置信息加入队列
                            double radAngle = phaseRecord.angle / (360 * 60) * 2 * Math.PI;
                            double xDiff    = 0.35 * Math.Cos(radAngle);
                            double zDiff    = 0.35 * Math.Sin(radAngle);
                            TagPos tagPos   = new TagPos(phaseRecord.tagInfo, new Tuple <double, double, double>(phaseRecord.x / 1000 - 0.02 + xDiff, 1.4, zDiff));
                            SARParameter.tagPosQueue.Enqueue(tagPos);
                            positionSetIndex++;
                        }
                        break;
                    }
                }
                if (j <= 0)
                {
                    positionSetIndex++;
                    break;
                }
            }
        }
コード例 #2
0
        //添加相位记录
        public void addPhaseRecord(TagInfo tagInfo)
        {
            PhaseRecord phaseRecord = new PhaseRecord(tagInfo);

            phaseRecords.Add(phaseRecord);
        }