Beispiel #1
0
        /// <summary>
        /// Update the stored data. This is not the graphical data
        /// </summary>
        private void ReadPosition()
        {
            lock (this)
            {
                LogAnnotationPosition  pos       = Component.Position;
                LogAnnotationContainer container = Component.Container;
                m_data.Clear();

                //Order position based on time and store the result (if time is available)
                if (Component.Component.LogAnnotation.TimeIdx >= 0)
                {
                    List <float>   t       = container.ParsedTimeValues;
                    List <Vector3> posData = container.GetPositionsFromView(pos);
                    for (int i = 0; i < posData.Count; i++)
                    {
                        m_data.Add(new AssociatedData()
                        {
                            Time = t[i], Pos = posData[i], Idx = i
                        });
                    }
                    m_data.Sort();
                }
                else
                {
                    List <Vector3> posData = container.GetPositionsFromView(pos);
                    for (int i = 0; i < posData.Count; i++)
                    {
                        m_data.Add(new AssociatedData()
                        {
                            Time = -1, Pos = posData[i], Idx = i
                        });
                    }
                }

                //Default y position : 0.5 + small offset
                if (Component.Component.Headers[2] < 0)
                {
                    for (int i = 0; i < m_data.Count; i++)
                    {
                        m_data[i].Pos.z = 0.505f;
                    }
                }

                m_updatePos = true;
            }
        }
Beispiel #2
0
 public void OnSetTime(LogAnnotationContainer container)
 {
     ReadPosition();
 }