Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }