コード例 #1
0
 public TickCollectionPADANIAN(DateTime low, DateTime high)
 {
     // TODO: refactor this part
     tickPositions = TickExperimentalPADANIAN.GetTicksForTime(low, high);
     tickLabels    = new string[tickPositions.Length];
     for (int i = 0; i < tickPositions.Length; i++)
     {
         tickLabels[i] = tickPositions[i].ToString();
     }
     cornerLabel = $"time multiplier"; // make this say minutes, seconds, etc
 }
コード例 #2
0
        public TickCollectionPADANIAN(double low, double high, double?tickSpacing = null)
        {
            if (tickSpacing == 0)
            {
                tickSpacing = null;
            }

            tickPositions = TickExperimentalPADANIAN.GetTicks(low, high);

            if (tickSpacing != null)
            {
                throw new NotImplementedException("manual tick spacing not yet supported");
            }

            TickExperimentalPADANIAN.GetMantissasExponentOffset(tickPositions, out double[] tickPositionsMantissas, out int tickPositionsExponent, out double offset);
            string multiplierString = TickExperimentalPADANIAN.GetMultiplierString(offset, tickPositionsExponent);

            tickLabels = new string[tickPositions.Length];
            for (int i = 0; i < tickPositions.Length; i++)
            {
                tickLabels[i] = tickPositionsMantissas[i].ToString();
            }

            if (USE_PADANIAN_CORNER_STRING)
            {
                cornerLabel = multiplierString;
            }
            else
            {
                string offsetLabel = offset.ToString();
                if (offset > 0)
                {
                    offsetLabel = "+" + offsetLabel;
                }
                offsetLabel = offsetLabel.Replace("E+", "E");
                cornerLabel = "";
                if (tickPositionsExponent != 0)
                {
                    cornerLabel = $"E{tickPositionsExponent}";
                }
                if (offset != 0)
                {
                    cornerLabel += $" {offsetLabel}";
                }
            }
        }