public ChartPoint(CP.Code.IClassVarElement _codeElem, ICPLineData _lineData) { codeElem = _codeElem; codeElem.classVarChangedEvent += ClassVarChangedEventOn; codeElem.classVarDeletedEvent += ClassVarDeletedEventOn; data = CP.Utils.IClassFactory.GetInstance().CreateCPData(codeElem.name, codeElem.uniqueName, codeElem.type, true, EChartPointStatus.SwitchedOn, _lineData); }
public bool AddChartPoint(string varName, out IChartPoint chartPnt) { chartPnt = null; IClassElement codeClass = codeClassMethod.GetClass(); CP.Code.IClassVarElement codeElem = codeClass.GetVar(varName); if (codeElem != null) { return(AddChartPoint(codeElem, out chartPnt, false)); } return(false); }
public bool AddChartPoint(CP.Code.IClassVarElement codeElem, out IChartPoint chartPnt, bool checkExistance = true) { if (checkExistance) { chartPnt = GetChartPoint(codeElem.uniqueName); if (chartPnt != null) { return(false); } } chartPnt = CP.Utils.IClassFactory.GetInstance().CreateCP(codeElem, data); chartPoints.Add(chartPnt); chartPnt.cpStatusChangedEvent += OnCPStatusChanged; UpdateStatus(chartPnt); addCPEvent.Fire(new CPLineEvArgs(this, chartPnt)); return(true); }