Beispiel #1
0
        public void TestGetGrpIDByDPName()
        {
            string dpName = "DT19.BMF.ATS.SERVER.diiATSSVR-StopRun.Value";

            DatalogDPTrendDAO.GetInstance().GetGrpIDByDPName(dpName);
            DatalogDPTrendDAO.GetInstance().GetOPCDataPointByName(dpName);
        }
Beispiel #2
0
        public void TestGetOPCDataPointByGrpId02()
        {
            //exception
            double grpId = 6;

            DatalogDPTrendDAO.GetInstance().GetOPCDataPointByGrpId(grpId);
        }
Beispiel #3
0
        public void TestUpdateDataPointDB01()
        {
            OPCSampleGrpConfigStartModel oPCSampleGrpConfigStartModel = OPCSampleGrpConfigStartModelFactory.CreateOPCSampleGrpConfigStartModel01();
            double sampleGrpID = double.MinValue;

            oPCSampleGrpConfigStartModel.UpdateDataPointDB(sampleGrpID);

            //Test2---Valid input
            #region TestSetup
            //insert testing group
            EtyDataLogDPGroupTrend etySampleGrp = new EtyDataLogDPGroupTrend();
            etySampleGrp.NewData       = true;
            etySampleGrp.SampleGrpName = "DOTTestParasoftTesting123";
            etySampleGrp.Interval      = 1;
            etySampleGrp.IntervalType  = "M";
            etySampleGrp.Disabled      = false;
            oPCSampleGrpConfigStartModel.InsertOPCSampleGrp(etySampleGrp);
            //getSampleId from DB
            List <EtyDataLogDPGroupTrend> list = oPCSampleGrpConfigStartModel.GetAllOPCSampelGrp(OPCSampleGrpConfigStart.OPCSAMPLEGRPDESC_COL_NAME, OPCSampleGrpConfigStart.OPCSAMPLEGRP_SORT_ASC);
            foreach (var item in list)
            {
                if (item.SampleGrpName.Equals("DOTTestParasoftTesting123"))
                {
                    etySampleGrp = item;
                    break;
                }
            }

            //insert testing Datapoint
            EtyDataLogDPTrend etyOPCDP = new EtyDataLogDPTrend();
            etyOPCDP.OPCDataPointName = "DOTTestParasoftDP1.Value";
            etyOPCDP.EntityKey        = 20099999;
            etyOPCDP.OPCSampleGrpId   = etySampleGrp.SampleGrpID;
            etyOPCDP.Disabled         = false;
            DatalogDPTrendDAO.GetInstance().InsertOPCDataPoint(etyOPCDP);
            #endregion

            //Test Procedure Call
            oPCSampleGrpConfigStartModel.UpdateDataPointDB(etySampleGrp.SampleGrpID);
            //Post Condition Check
            #region PostConditionCheck
            bool   bDisable       = false;
            string sampleGrpIDstr = etySampleGrp.SampleGrpID.ToString();
            //Get DataPoint from DB
            double sampleid = DatalogDPTrendDAO.GetInstance().GetGrpIDByDPName("DOTTestParasoftDP1.Value");
            //Assert.IsTrue(bDisable);
            Assert.AreEqual(sampleid, -1);
            #endregion

            #region CleanUp
            //Clean up inserted test data in DB
            //Delete testing DP
            string localSQL = "Delete from OPC_DT_PT where DATA_PT_NAME = 'DOTTestParasoftDP1.Value'";
            SimpleDatabase.GetInstance().ExecuteNonQuery(localSQL);

            //Delete Testing sampleGrp
            DatalogDPGroupTrendDAO.GetInstance().DeleteOPCSampleGroupById(etySampleGrp.SampleGrpID.ToString());
            #endregion
        }
Beispiel #4
0
        public void TestGetDataPointByName02()
        {
            //exception
            string opcServerName       = TestDBInit.OPCSERVER_NAME;
            string dataPointNameSubstr = "OCC";

            DatalogDPTrendDAO.GetInstance().GetDataPointByName(opcServerName, dataPointNameSubstr);
        }
Beispiel #5
0
        public void TestGetOPCDataPoint()
        {
            string opcServerName = TestDBInit.OPCSERVER_NAME;
            string filterString  = " AND  SAMPLE_GRP_ID =5"; //" AND  SAMPLE_GRP_ID =112"; //for my local Env

            DatalogDPTrendDAO.GetInstance().GetOPCDataPoint(opcServerName, filterString);
            DatalogDPTrendDAO.GetInstance().GetOPCDataPoint(opcServerName, "");
        }
Beispiel #6
0
        public void TestGetOPCDataPointByGrpId()
        {
            double grpId = 6;  // for my local Evn grpId =7

            DatalogDPTrendDAO.GetInstance().GetOPCDataPointByGrpId(grpId);

            grpId = 9999;
            DatalogDPTrendDAO.GetInstance().GetOPCDataPointByGrpId(grpId);
        }
Beispiel #7
0
        public void TestGetDataPointByName()
        {
            string opcServerName       = TestDBInit.OPCSERVER_NAME;
            string dataPointNameSubstr = "OCC";

            // SELECT et.PKEY,et.PARENTKEY,CONCAT(et.NAME,'.Value')as NAME ,et.DESCRIPTION,
            //dt.SAMPLE_GRP_ID FROM ENTITY et, OPC_DT_PT dt WHERE TYPEKEY = (SELECT PKEY FROM ENTITYTYPE WHERE NAME = 'DataPoint') AND UPPER(NAME) LIKE '%BMF.SWC%' AND et.PKEY = dt.KEYID(+)
            DatalogDPTrendDAO.GetInstance().GetDataPointByName(opcServerName, dataPointNameSubstr);
        }
Beispiel #8
0
        public void TestInsertOPCDataPoint_UpdateOPCDataPointByName()
        {
            EtyDataLogDPTrend etyDataLogDPTrend = new EtyDataLogDPTrend();

            etyDataLogDPTrend.OPCDataPointName = "DT18.LV.MSB.LF211.diiPWRC-MSBCBNotcloseClose.Value";
            etyDataLogDPTrend.OPCSampleGrpId   = 6;
            etyDataLogDPTrend.Disabled         = false;
            DatalogDPTrendDAO.GetInstance().InsertOPCDataPoint(etyDataLogDPTrend);
            DatalogDPTrendDAO.GetInstance().UpdateOPCDataPointByName(etyDataLogDPTrend);
        }
        /// <summary>
        /// Updates the specified Sample Group Datapoint Flag in database.
        /// </summary>
        /// <param name="opcSampleGrpId">Sample Group id</param>
        /// <param name="hasDataPoint">flag value to be updated</param>

        /* public void UpdateSampleGrpFlag(string opcSampleGrpId, bool hasDataPoint)
         * {
         *   //hasDataPoint = DatalogDPTrendDAO.GetInstance().GetOPCDataPointByGrpId(Convert.ToDouble(opcSampleGrpId));
         *   //DatalogDPGroupTrendDAO.GetInstance().UpdateGrpDataPointFlag(Convert.ToDouble(opcSampleGrpId), hasDataPoint);
         * }*/

        /// <summary>
        /// Returns the datapoints whose name contains specified
        /// DataPtNameSubStr and belongs to specified server name.
        /// </summary>
        /// <param name="opcServerName">Server name</param>
        /// <param name="DataPtNameSubStr">DataPtNameSubStr to be matched</param>
        /// <returns></returns>
        public List <EtyDataLogDPTrend> GetDataPointsByName(string opcServerName, string DataPtNameSubStr)
        {
            List <EtyDataLogDPTrend> etyOPCDataPointList = DatalogDPTrendDAO.GetInstance().GetDataPointByName(opcServerName, DataPtNameSubStr);
            //if exceeded 2000 datapoint, return first 2000 DataPoint only.
            int totalCount     = etyOPCDataPointList.Count;
            int maximumAllowed = 2000;

            if (totalCount > maximumAllowed)
            {
                etyOPCDataPointList.RemoveRange(maximumAllowed, totalCount - maximumAllowed);
            }
            return(etyOPCDataPointList);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataPoint"></param>
        /// <returns></returns>
        public bool CheckConfiguredByOcc(string dataPoint)
        {
            bool   bConfigured = false;
            double sampleGrpID = DatalogDPTrendDAO.GetInstance().GetGrpIDByDPName(dataPoint);

            if (sampleGrpID != -1)
            {
                EtyDataLogDPGroupTrend etySampleGrp = DatalogDPGroupTrendDAO.GetInstance().GetOPCGrpByID(sampleGrpID);
                if (etySampleGrp.LocationName.ToUpper() == DAOHelper.OCC_LOCATIONNAME)
                {
                    bConfigured = true;
                }
            }
            return(bConfigured);
        }
        /// <summary>
        /// Updates DataPoint values in database based on either name or sample group id.
        /// </summary>
        /// <param name="etyDataPoint">DataPoint entity with updated values</param>
        public bool UpdateDataPointDB(EtyDataLogDPTrend etyDataPoint)
        {
            bool bResult = true;

            if (etyDataPoint.OPCDataPointName == null)
            {
                //clears the sample group and datapoint link for specified sample group
                bResult = DatalogDPTrendDAO.GetInstance().UpdateOPCDataPointByGrpId(etyDataPoint.Disabled, etyDataPoint.OPCSampleGrpId);
            }
            else
            {
                bResult = DatalogDPTrendDAO.GetInstance().UpdateOPCDataPointByName(etyDataPoint);
            }
            return(bResult);
        }
Beispiel #12
0
        public void TestDisableGrpDataPoint()
        {
            double sampleGrpId = 18;

            DatalogDPTrendDAO.GetInstance().DisableGrpDataPoint(sampleGrpId);
        }
 /// <summary>
 /// Returns all DataPoints of specified server name matched to filterstring
 /// </summary>
 /// <param name="opcServerName">Server name</param>
 /// <param name="filterString">Filter string to be matached</param>
 /// <returns>DataPoint Entity List</returns>
 public List <EtyDataLogDPTrend> GetAllOPCDataPoints(string opcServerName, string filterString)
 {
     return(DatalogDPTrendDAO.GetInstance().GetOPCDataPoint(opcServerName, filterString));
 }
 public void UpdateDataPoints(EtyDataLogDPTrend sampleGrpEty, List <EtyDataLogDPTrend> selectedDataPoints)
 {
     DatalogDPTrendDAO.GetInstance().UpdateDataPoints(sampleGrpEty, selectedDataPoints);
 }
Beispiel #15
0
 public void TestUpdateOPCDataPointByGrpId()
 {
     DatalogDPTrendDAO.GetInstance().UpdateOPCDataPointByGrpId(true, 11);
 }
Beispiel #16
0
 public void TestReleaseInstance01()
 {
     DatalogDPTrendDAO.ReleaseInstance();
 }
Beispiel #17
0
 public void TestGetInstance01()
 {
     DatalogDPTrendDAO datalogDPTrendDAO = DatalogDPTrendDAO.GetInstance();
 }