Пример #1
0
 /// <summary>
 /// set datapoint row by a given datapoint entity
 /// </summary>
 /// <param name="dpRow">the datarow to be set</param>
 /// <param name="dataPoint">the datapoint entiy</param>
 private void setDataPointRowByEty(ref DataRow dpRow, EtyDataPoint dataPoint)
 {
     dpRow["DATA_PT_HOST"]        = dataPoint.DPHost;
     dpRow["DATA_PT_NAME"]        = dataPoint.DPName;
     dpRow["DATA_PT_TYPE"]        = TrendViewerHelper.convertLineTypeToDispLan(dataPoint.DPType);
     dpRow["DATA_PT_COLOR"]       = dataPoint.DPColor;
     dpRow["DATA_PT_SERVER"]      = dataPoint.DPServer;
     dpRow["DATA_PT_LBL_NAME"]    = dataPoint.DPLblName;
     dpRow["DATA_PT_ENABLED"]     = TrendViewerHelper.ChangeBoolToStr(dataPoint.DPEnabled);
     dpRow["DATA_PT_LBL_ENABLED"] = TrendViewerHelper.ChangeBoolToStr(dataPoint.DPLblEnabled);
     dpRow["DATA_PT_VISIBLE"]     = TrendViewerHelper.ChangeBoolToStr(dataPoint.DPVisible);
 }
        public void AddFormulaToList(EtyFormula formula)
        {
            DataRow formulaRow = m_FormulaTable.NewRow();

            formulaRow["DATA_PT_LBL_NAME"]    = formula.DPLblName;
            formulaRow["DATA_PT_TYPE"]        = TrendViewerHelper.convertLineTypeToDispLan(formula.DPType);
            formulaRow["DATA_PT_COLOR"]       = formula.DPColor;
            formulaRow["DATA_PT_ENABLED"]     = TrendViewerHelper.ChangeBoolToStr(formula.DPEnabled);
            formulaRow["DATA_PT_LBL_ENABLED"] = TrendViewerHelper.ChangeBoolToStr(formula.DPLblEnabled);
            formulaRow["DATA_PT_EQUATION"]    = formula.DPEquation;
            m_FormulaTable.Rows.Add(formulaRow);
            m_View.PopulateDataPointListDataGridView(1);
        }
Пример #3
0
        public void TestChangeBoolToStr02()
        {
            bool   b   = false;
            string str = TrendViewerHelper.ChangeBoolToStr(b);

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record(str);
            recorder.FinishRecording();
            #endregion
            #region Assertions
            Assert.AreEqual("N", str);
            #endregion
        }
 private void SetHistDataPointRowByEty(ref DataRow dpRow, EtyHistDataPoint dataPoint)
 {
     dpRow["DATA_PT_NAME"]        = dataPoint.DPName;
     dpRow["DATA_PT_TYPE"]        = TrendViewerHelper.convertLineTypeToDispLan(dataPoint.DPType);
     dpRow["DATA_PT_COLOR"]       = dataPoint.DPColor;
     dpRow["DATA_PT_SERVER"]      = dataPoint.DPServer;
     dpRow["DATA_PT_ENABLED"]     = TrendViewerHelper.ChangeBoolToStr(dataPoint.DPEnabled);
     dpRow["DATA_PT_LBL_ENABLED"] = TrendViewerHelper.ChangeBoolToStr(dataPoint.DPLblEnabled);
     dpRow["DATA_PT_LBL_NAME"]    = dataPoint.DPLblName;
     dpRow["DATA_PT_DT"]          = dataPoint.DPStartDateTime;
     dpRow["DATA_PT_HOST"]        = dataPoint.DPHost;
     dpRow["DATA_PT_DT_END"]      = dataPoint.DPEndDateTime;
     dpRow["ENTITYKEY"]           = dataPoint.EntityKey;
 }
        public void ModifyFormula(string FormulaName, EtyFormula formula)
        {
            foreach (DataRow formulaRow in m_FormulaTable.Rows)  //will only have 1 record
            {
                if (FormulaName == formulaRow["DATA_PT_LBL_NAME"].ToString())
                {
                    formulaRow["DATA_PT_LBL_NAME"]    = formula.DPLblName;
                    formulaRow["DATA_PT_TYPE"]        = formula.DPType;
                    formulaRow["DATA_PT_COLOR"]       = formula.DPColor;
                    formulaRow["DATA_PT_ENABLED"]     = TrendViewerHelper.ChangeBoolToStr(formula.DPEnabled);
                    formulaRow["DATA_PT_LBL_ENABLED"] = TrendViewerHelper.ChangeBoolToStr(formula.DPLblEnabled);
                    formulaRow["DATA_PT_EQUATION"]    = formula.DPEquation;
                }
            }

            m_View.PopulateDataPointListDataGridView(1);
        }
        public void SetFormulaTable(List <EtyFormula> formulaList)
        {
            m_FormulaTable.Rows.Clear();
            DataRow newDataPointFormulaRow = null;

            for (int i = 0; i < formulaList.Count; i++)
            {
                EtyFormula formula = formulaList[i];
                newDataPointFormulaRow = m_FormulaTable.NewRow();

                newDataPointFormulaRow["DATA_PT_LBL_NAME"]    = formula.DPLblName;
                newDataPointFormulaRow["DATA_PT_TYPE"]        = formula.DPType;
                newDataPointFormulaRow["DATA_PT_COLOR"]       = formula.DPColor;
                newDataPointFormulaRow["DATA_PT_ENABLED"]     = TrendViewerHelper.ChangeBoolToStr(formula.DPEnabled);
                newDataPointFormulaRow["DATA_PT_LBL_ENABLED"] = TrendViewerHelper.ChangeBoolToStr(formula.DPLblEnabled);
                newDataPointFormulaRow["DATA_PT_EQUATION"]    = formula.DPEquation;

                m_FormulaTable.Rows.Add(newDataPointFormulaRow);
            }
        }