/// <summary>
        /// Set the frame type
        /// </summary>
        /// <param name="frameType">Frame type to set; see FrameType for types</param>
        /// <param name="forceReload">True to force a re-load of the data from the Frame_Parameters table</param>
        /// <returns>The number of frames in the file that have the given frame type</returns>
        public int SetCurrentFrameType(ReadFrameType frameType, bool forceReload = false)
        {
            // If the frame type is already correct, then we don't need to re-query the database
            if ((CurrentFrameType == frameType) && !forceReload)
            {
                return(ArrayFrameNum.Length);
            }

            CurrentFrameType = frameType;

            if (CurrentFrameType != ReadFrameType.AllFrames)
            {
                var frameNums = GetFrameNumbers((FrameType)frameType);
                if (frameNums.Length == 0)
                {
                    ArrayFrameNum = new IntSafeArray(0);
                    return(0);
                }

                ArrayFrameNum = new IntSafeArray(frameNums);
            }
            else
            {
                FrameTypeDict = GetMasterFrameList();
                if (FrameTypeDict.Count == 0)
                {
                    ArrayFrameNum = new IntSafeArray(0);
                    return(0);
                }

                ArrayFrameNum = new IntSafeArray(FrameTypeDict.Select(x => x.Key).OrderBy(x => x).ToArray());
            }

            this.CurrentFrameNum = this.ArrayFrameNum[0];
            this.UimfFrameParams = this.GetFrameParams(this.ArrayFrameNum[0]);
            this.MzCalibration   = this.GetMzCalibrator(this.UimfFrameParams);

            return(ArrayFrameNum.Count);
        }
 /// <summary>
 /// Note that calling this function will auto-update the current frame type to frametype
 /// </summary>
 /// <param name="frameType"></param>
 /// <returns></returns>
 public int GetNumberOfFrames(ReadFrameType frameType)
 {
     return(this.SetCurrentFrameType(frameType));
 }