Ejemplo n.º 1
0
 /// <summary>
 /// Get whether this entry is continuous.
 /// </summary>
 /// <param name="t">the log entry.</param>
 /// <returns>the flag whether this entry is continuous</returns>
 private EcellValue IsContinuous(TagData t)
 {
     string FullPN = t.Type + Constants.delimiterColon + t.M_key +
         Constants.delimiterColon + EcellProcess.ISCONTINUOUS;
     EcellValue v = m_dManager.GetEntityProperty(FullPN);
     return v;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Event when the logger entry is deleted.
        /// </summary>
        /// <param name="o">LoggerManager.</param>
        /// <param name="e">LoggerEventArgs</param>
        public void LoggerManager_LoggerDeleteEvent(object o, LoggerEventArgs e)
        {
            if (m_loggerWin != null)
                m_loggerWin.LoggerDeleted(e.Entry);

            LoggerEntry entry = e.Entry;
            TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
            tag.isLoaded = e.Entry.IsLoaded;
            tag.FileName = e.Entry.FileName;
            RemoveFromEntry(tag);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Invoke method to add the data to DataGridView.
        /// </summary>
        /// <param name="entry">the log entry</param>
        /// <param name="tag">tag data</param>
        void AddToEntry(LoggerEntry entry, TagData tag)
        {
            TagData tmp = tag;
            if (!m_tagList.ContainsKey(tag.ToString()))
            {
                m_entry.Add(tag, new List<TraceWindow>());
                m_tagList.Add(tag.ToString(), tag);
            }
            else
            {
                tmp = m_tagList[tag.ToString()];
            }

            if (m_win == null)
            {
                ShowTracerWindow(this, new EventArgs());
            }
            if (m_entry[tmp].Contains(m_win)) return;
            m_entry[tmp].Add(m_win);
            m_win.AddLoggerEntry(entry, tag);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Check whethere each objects is equal.
        /// </summary>
        /// <param name="t">check object.</param>
        /// <returns>check result. if each objects is equal, return true.</returns>
        public bool Equals(TagData t)
        {
            if (t == null) return false;

            if (t.M_modelID == m_modelID && t.M_key == m_key &&
                t.Type == m_type && t.M_path == m_path &&
                t.isLoaded == m_isLoaded &&
                (t.isLoaded == false || t.FileName == m_fileName))
                return true;
            return false;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Event when the logger entry is added.
        /// </summary>
        /// <param name="o">LoggerManager.</param>
        /// <param name="e">LoggerEventArgs</param>
        public void LoggerManager_LoggerAddEvent(object o, LoggerEventArgs e)
        {
            LoggerEntry entry = e.Entry;
            if (m_loggerWin != null)
                m_loggerWin.LoggerAdd(entry);

            EcellObject obj = m_dManager.GetEcellObject(entry.ModelID, entry.ID, entry.Type);
            bool isContinue = true;
            if (obj != null)
            {
                foreach (EcellData d in obj.Value)
                {
                    if (d.Name.Equals(EcellProcess.ISCONTINUOUS))
                    {
                        isContinue = (int)d.Value != 0;
                        break;
                    }
                }
            }
            TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, isContinue);
            tag.isLoaded = e.Entry.IsLoaded;
            tag.FileName = e.Entry.FileName;
            AddToEntry(entry, tag);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Remove logger entry from DataGridView,
        /// </summary>
        /// <param name="tag">logger entry.</param>
        public void RemoveLoggerEntry(TagData tag)
        {
            if (m_entryDic.ContainsKey(tag.ToShortString()))
            {
                if (!m_entryDic[tag.ToShortString()].IsLoaded) m_logCount--;
                string path = tag.M_path;
                m_entryDic[tag.ToShortString()].ClearPoint();
                m_zCnt.GraphPane.CurveList.Remove(m_entryDic[tag.ToShortString()].CurrentLineItem);
                m_zCnt.GraphPane.CurveList.Remove(m_entryDic[tag.ToShortString()].TmpLineItem);
                m_entryDic.Remove(tag.ToShortString());

                UpdateGraphCallBack dlg = new UpdateGraphCallBack(UpdateGraph);
                this.Invoke(dlg, new object[] { true });
            }
            if (m_tagDic.ContainsKey(tag.ToShortString()))
                m_tagDic.Remove(tag.ToShortString());
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Invoke method to remove the row from DataGridView.
 /// </summary>
 /// <param name="tag">delete row</param>
 void RemoveFromEntry(TagData tag)
 {
     if (m_tagList.ContainsKey(tag.ToString()))
     {
         TagData t = m_tagList[tag.ToString()];
         m_entry.Remove(t);
         m_tagList.Remove(tag.ToString());
     }
     if (m_win == null) return;
     foreach (TraceWindow t in m_winList)
     {
         t.RemoveLoggerEntry(tag);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Changed the logger object.
        /// </summary>
        /// <param name="orgFullPN">the orijinal FullPN.</param>
        /// <param name="entry">the logger object.</param>
        public void LoggerChanged(string orgFullPN, LoggerEntry entry)
        {
            TagData otag = new TagData(entry.ModelID, entry.ID, entry.Type, orgFullPN, true);
            TagData ntag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
            otag.isLoaded = entry.IsLoaded;
            otag.FileName = entry.FileName;
            ntag.isLoaded = entry.IsLoaded;
            ntag.FileName = entry.FileName;
            if (!m_entryDic.ContainsKey(otag.ToShortString()))
                return;

            if (orgFullPN != entry.FullPN)
            {
                m_entryDic[ntag.ToShortString()] = m_entryDic[otag.ToShortString()];
                m_entryDic[ntag.ToShortString()].Path = entry.FullPN;
                m_entryDic.Remove(otag.ToShortString());
            }

            m_entryDic[ntag.ToShortString()].SetStyle(entry.LineStyle);
            m_entryDic[ntag.ToShortString()].SetVisible(entry.IsShown);
            m_entryDic[ntag.ToShortString()].SetColor(entry.Color);
            m_entryDic[ntag.ToShortString()].SetLineWidth(entry.LineWidth);
            m_entryDic[ntag.ToShortString()].SetY2Axis(entry.IsY2Axis);
            if (entry.IsY2Axis)
            {
                m_zCnt.GraphPane.Y2Axis.IsVisible = true;
            }
            else
            {
                bool isHit = false;
                foreach (string entStr in m_entryDic.Keys)
                {
                    if (m_entryDic[entStr].IsY2)
                    {
                        m_zCnt.GraphPane.Y2Axis.IsVisible = true;
                        isHit = true;
                        break;

                    }
                }
                if (isHit == false)
                    m_zCnt.GraphPane.Y2Axis.IsVisible = false;
            }

            if (entry.IsShown)
            {
                if (!m_zCnt.GraphPane.IsZoomed)
                {
                    m_zCnt.AxisChange();
                }
            }
            m_zCnt.Refresh();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Get the flag whether this entry is displayed.
 /// </summary>
 /// <param name="entry">the logger entry.</param>
 /// <returns>Return true if </returns>
 public bool IsDisplay(LoggerEntry entry)
 {
     TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
     tag.isLoaded = entry.IsLoaded;
     tag.FileName = entry.FileName;
     if (m_entryDic.ContainsKey(tag.ToShortString())) return true;
     return false;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Process when user delete the logger.
        /// </summary>
        /// <param name="tag">the tag of logger entry.</param>
        public void DeleteTraceEntry(TagData tag)
        {
            EcellObject m_currentObj = m_owner.DataManager.GetEcellObject(tag.M_modelID, tag.M_key, tag.Type);
            // for load data.
            if (m_currentObj == null)
            {
                RemoveLoggerEntry(tag);
                m_tagDic.Remove(tag.ToShortString());
                if (m_logList.Contains(tag))
                    m_logList.Remove(tag);
                return;
            }

            foreach (EcellData d in m_currentObj.Value)
            {
                if (d.EntityPath == tag.M_path)
                {
                    d.Logged = false;
                }
            }

            m_owner.DataManager.DataChanged(m_currentObj.ModelID,
                m_currentObj.Key,
                m_currentObj.Type,
                m_currentObj);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Change the display status of data.
 /// </summary>
 /// <param name="entry">the log entry object.</param>
 /// <param name="isDisplay">the flag whether this entry is displayed.</param>
 public void ChangedDisplayStatus(LoggerEntry entry, bool isDisplay)
 {
     TagData tag = new TagData(entry.ModelID, entry.ID, entry.Type, entry.FullPN, true);
     tag.isLoaded = entry.IsLoaded;
     tag.FileName = entry.FileName;
     if (isDisplay)
     {
         AddLoggerEntry(entry, tag);
     }
     else
     {
         RemoveLoggerEntry(tag);
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Add logger entry to DataGridView and ZedGraphControl.
        /// Added logger entry is registed to m_paneDic.
        /// </summary>
        /// <param name="entry">the log entry</param>
        /// <param name="tag">the tag of logger entry</param>
        public void AddLoggerEntry(LoggerEntry entry, TagData tag)
        {
            LineItem i = m_zCnt.GraphPane.AddCurve(entry.FullPN,
                    new PointPairList(), entry.Color, SymbolType.None);
            i.Line.Width = entry.LineWidth;
            i.Line.Style = entry.LineStyle;
            LineItem i1 = m_zCnt.GraphPane.AddCurve(entry.FullPN,
                    new PointPairList(), entry.Color, SymbolType.None);
            i1.Line.Width = entry.LineWidth;
            i1.Line.Style = entry.LineStyle;
            m_entryDic.Add(tag.ToShortString(), new TraceEntry(tag.M_path, i, i1, tag.IsContinue, tag.isLoaded));
            m_tagDic.Add(tag.ToShortString(), tag.IsContinue);
            if (!tag.isLoaded)
            {
                if (m_logCount == 0 &&
                    (m_owner.PluginManager.Status == ProjectStatus.Running ||
                    m_owner.PluginManager.Status == ProjectStatus.Suspended ||
                    m_owner.PluginManager.Status == ProjectStatus.Stepping))
                    this.StartSimulation();
                m_logCount++;
            }
            else
            {
                LogData log = m_owner.DataManager.LoadSimulationResult(entry.FileName);

                string[] ele = log.propName.Split(new char[] { ':' });
                LogData newLog = new LogData(log.model, log.key, Constants.xpathLog, ele[ele.Length - 1], log.logValueList);
                newLog.IsLoaded = true;
                newLog.FileName = entry.FileName;
                List<LogData> logList = new List<LogData>();
                logList.Add(newLog);
                m_entryDic[tag.ToShortString()].SetVisible(entry.IsShown);
                AddPoints(log.logValueList[log.logValueList.Count - 1].time, log.logValueList[log.logValueList.Count - 1].time, logList, true);
            }
            m_logList.Add(tag);
            m_entryCount++;
        }