Darien Figueroa / Mbed OS Final_Program

Dependencies:   USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IAutoScaleAxisCalculator.cs Source File

IAutoScaleAxisCalculator.cs

00001 /*******************************************************************************
00002 * Copyright (C) 2016 Maxim Integrated Products, Inc., All rights Reserved.
00003 * 
00004 * This software is protected by copyright laws of the United States and
00005 * of foreign countries. This material may also be protected by patent laws
00006 * and technology transfer regulations of the United States and of foreign
00007 * countries. This software is furnished under a license agreement and/or a
00008 * nondisclosure agreement and may only be used or reproduced in accordance
00009 * with the terms of those agreements. Dissemination of this information to
00010 * any party or parties not specified in the license agreement and/or
00011 * nondisclosure agreement is expressly prohibited.
00012 *
00013 * The above copyright notice and this permission notice shall be included
00014 * in all copies or substantial portions of the Software.
00015 *
00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00017 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00019 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00020 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00022 * OTHER DEALINGS IN THE SOFTWARE.
00023 *
00024 * Except as contained in this notice, the name of Maxim Integrated
00025 * Products, Inc. shall not be used except as stated in the Maxim Integrated
00026 * Products, Inc. Branding Policy.
00027 *
00028 * The mere transfer of this software does not imply any licenses
00029 * of trade secrets, proprietary technology, copyrights, patents,
00030 * trademarks, maskwork rights, or any other form of intellectual
00031 * property whatsoever. Maxim Integrated Products, Inc. retains all
00032 * ownership rights.
00033 *******************************************************************************
00034 */
00035 
00036 using System;
00037 using System.Collections.Generic;
00038 using System.Linq;
00039 using System.Text;
00040 using System.Threading.Tasks;
00041 
00042 namespace Maxim.Charting
00043 {
00044     interface IAutoScaleAxisCalculator
00045     {
00046         /// <summary>
00047         /// Maximum possible data point
00048         /// </summary>
00049         double Maximum { get; set; }
00050         /// <summary>
00051         /// Minimum possible data point
00052         /// </summary>
00053         double Minimum { get; set; }
00054 
00055         /// <summary>
00056         /// Number of y-axis chart interval grid lines
00057         /// </summary>
00058         int Intervals { get; set; }
00059 
00060         /// <summary>
00061         /// Previous maximum interval result
00062         /// </summary>
00063         double LastMaximum { get; }
00064         /// <summary>
00065         /// Previous minimum interval result
00066         /// </summary>
00067         double LastMinimum { get; }
00068 
00069         /// <summary>
00070         /// Full scale range should be larger than this value
00071         /// </summary>
00072         double MinimumRange { get; set; }
00073 
00074         /// <summary>
00075         /// Trigger rescale value when data exceeds fraction of full scale. For example, a value of 0.8 will rescale on 10% (0.5 - 0.8/2) and 90% (0.5 + 0.8/2) of full scale.
00076         /// </summary>
00077         double ScaleTrigger { get; set; }
00078 
00079         /// <summary>
00080         /// Rescale data to be within a certain fraction of full scale. For example, a value of 0.25 will rescale so that the data minimum and maximum occupy 25% of the full scale.
00081         /// </summary>
00082         double RescaleTargetRange { get; set; }
00083 
00084         /// <summary>
00085         /// Calculate the round axis minimum and maximum value. Maximum range needs to be larger than 1 for this to function.
00086         /// </summary>
00087         /// <param name="dataMinimum">minimum value of data set</param>
00088         /// <param name="dataMaximum">maximum value of data set</param>
00089         /// <returns>minimum value, maximum value</returns>
00090         Tuple<double, double> Interval(double dataMinimum, double dataMaximum);
00091         
00092         /// <summary>
00093         /// Calculate the round axis minimum and maximum value. Maximum range needs to be larger than 1 for this to function.
00094         /// </summary>
00095         /// <param name="dataMinimum">minimum value of data set</param>
00096         /// <param name="dataMaximum">maximum value of data set</param>
00097         /// <param name="chartMinimum">minimum value of current chart</param>
00098         /// <param name="chartMaximum">maximum value of current chart</param>
00099         /// <returns>minimum value, maximum value</returns>
00100         Tuple<double, double> Interval(double dataMinimum, double dataMaximum, double chartMinimum, double chartMaximum);
00101     }
00102 }