/// <summary>
        /// This function adds the given CalibrationInfo structure pointed to by the argument to the end of the calibration
        /// list.
        /// </summary>
        /// <remarks>
        /// This function was first introduced in WFDB library version 6.0.
        /// </remarks>
        /// <param name="calibration">The calibration data to put in the calibration list.</param>
        /// <returns>A value indicating whether or not the operation was successful.</returns>
        public static bool PutCalibration(CalibrationInfo calibration)
        {
            int ret = PInvoke.putcal(ref calibration);

            if (ret == -1)
            {
                return(false);
            }
            return(true);
        }
        /// <summary>
        /// This function attempts to find calibration data for signals of type description, having physical
        /// units as given by units.
        /// </summary>
        /// <param name="description">signal's description</param>
        /// <param name="units">physical units</param>
        /// <returns>
        /// If successful, it fills in the contents of the CalibrationInfo structure.
        /// </returns>
        /// <remarks>
        /// Caller must not modify the contents of the strings addressed by the <see cref="SignalType"/> and <see cref="Units"/> fields of the CalibrationInfo structure
        /// after GetCalibration returns. GetCalibration returns data from the first entry in the calibration list that
        /// contains a <see cref="SignalType"/> field that is either an exact match or a prefix of description, and a <see cref="Units"/>
        /// field that is an exact match of units; if either description or units is NULL, however, it is ignored
        /// for the purpose of finding a match. GetCalibration cannot succeed unless the calibration list has
        /// been initialized by a previous invocation of <see cref="Open"/> or <see cref="PutCalibration"/>.
        /// (This function was first introduced in WFDB library version 6.0.)
        /// </remarks>
        public static CalibrationInfo?GetCalibration(string description, string units)
        {
            var cal = new CalibrationInfo();
            var ret = PInvoke.getcal(description, units, ref cal);

            if (ret == -1) // no match found
            {
                return(null);
            }
            return(cal);
        }
Example #3
0
 public static extern int getcal(string desc, string units, ref CalibrationInfo cal);
Example #4
0
 public static extern int putcal(ref CalibrationInfo cal);
 /// <summary>
 /// This function adds the given CalibrationInfo structure pointed to by the argument to the end of the calibration
 /// list.
 /// </summary>
 /// <remarks>
 /// This function was first introduced in WFDB library version 6.0.
 /// </remarks>
 /// <param name="calibration">The calibration data to put in the calibration list.</param>
 /// <returns>A value indicating whether or not the operation was successful.</returns>
 public static bool PutCalibration(CalibrationInfo calibration)
 {
     int ret = PInvoke.putcal(ref calibration);
     if (ret == -1)
         return false;
     return true;
 }
 /// <summary>
 /// This function attempts to find calibration data for signals of type description, having physical
 /// units as given by units. 
 /// </summary>
 /// <param name="description">signal's description</param>
 /// <param name="units">physical units</param>
 /// <returns>
 /// If successful, it fills in the contents of the CalibrationInfo structure.
 /// </returns>
 /// <remarks>
 /// Caller must not modify the contents of the strings addressed by the <see cref="SignalType"/> and <see cref="Units"/> fields of the CalibrationInfo structure
 /// after GetCalibration returns. GetCalibration returns data from the first entry in the calibration list that
 /// contains a <see cref="SignalType"/> field that is either an exact match or a prefix of description, and a <see cref="Units"/>
 /// field that is an exact match of units; if either description or units is NULL, however, it is ignored
 /// for the purpose of finding a match. GetCalibration cannot succeed unless the calibration list has
 /// been initialized by a previous invocation of <see cref="Open"/> or <see cref="PutCalibration"/>. 
 /// (This function was first introduced in WFDB library version 6.0.)
 /// </remarks>
 public static CalibrationInfo? GetCalibration(string description, string units)
 {
     var cal = new CalibrationInfo();
     var ret = PInvoke.getcal(description, units, ref cal);
     if (ret == -1) // no match found
         return null;
     return cal;
 }
 public static extern int getcal(string desc, string units, ref CalibrationInfo cal);
 public static extern int putcal(ref CalibrationInfo cal);