Esempio n. 1
0
        public bool ResetMPList()
        {
            //Reset the MP description list
            measurePointDescriptions = new Dictionary <string, int>();

            //Check to see that given device exists and is connected
            if (v45 == null)
            {
                return(false);
            }

            if (!v45.Connected)
            {
                return(false);
            }

            //Try to loop through and get all text descriptions
            try
            {
                v45.Messenger.EndCalibration();
                UInt16[] availablemplist = v45.Messenger.GetAvailableMeasurePoints();
                foreach (UInt16 i in availablemplist)
                {
                    MeasurePointDefinition measurepointinfo =
                        (MeasurePointDefinition)v45.Messenger.GetMeasurePointInformation(i);
                    measurePointDescriptions.Add(measurepointinfo.ToString(), i);
                }
            }
            //If at any point connection is interrupted, return false
            catch
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public bool ResetSettingsList()
        {
            //Reset the MP settings list
            mpSettings = new Dictionary <string, int>();

            //Check to see that given device exists and is connected
            if (v45 == null)
            {
                return(false);
            }

            if (!v45.Connected)
            {
                return(false);
            }

            //Try to loop through and get all text descriptions
            try
            {
                ushort[] availableSettingsList = v45.Messenger.GetAvailableSettings().Settings;
                foreach (ushort i in availableSettingsList)
                {
                    MeasurePointDefinition measurepointinfo =
                        (MeasurePointDefinition)v45.Messenger.GetSettingInformation(i);
                    mpSettings.Add(measurepointinfo.ToString(), i);
                }
            }
            //If at any point connection is interrupted, return false
            catch
            {
                return(false);
            }
            return(true);
        }