Example #1
0
        public bool CanAddDataPoint(string dataPoint)
        {
            bool bCanAdd = true;

            if (!m_model.IsOccLocation())
            {
                if (m_model.CheckConfiguredByOcc(dataPoint))
                {
                    //display messgae box
                    string messageTxt = StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCDATASELECTOR_CANADDDP_MSG, EnglishString.CAN_ADD_DATAPOINT_MSG);

                    if (MessageBoxDialog.Show(string.Format(messageTxt, dataPoint), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "No")
                    {
                        bCanAdd = false;
                    }
                }
            }
            else
            {
                if (!m_model.CheckStationGrp(dataPoint, m_localIntervalGrpLocation))
                {
                    //Display message Box
                    string messageTxt = StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCDATASELECTOR_CANNOTADDDP_MSG, EnglishString.CANNOT_ADD_DATAPOINT_MSG);
                    MessageBoxDialog.Show(string.Format(messageTxt, dataPoint), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    bCanAdd = false;
                }
            }
            return(bCanAdd);
        }
Example #2
0
 public void TestCheckConfiguredByOcc01()
 {
     OPCDataSelectorModel oPCDataSelectorModel = new OPCDataSelectorModel();
     bool bConfigured = oPCDataSelectorModel.CheckConfiguredByOcc("dataPoint1");
     //Assert.IsTrue(bConfigured);
 }