From dc7a2a72736b64aad33d095029c6b9c56e31aff3 Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 19 Jan 2017 21:18:03 +0000 Subject: [PATCH] B2017-008 - If the scale entered for an axis is reversed (maximum to minimum) the code will correctly print the axis. Prior to this fix the axis was not printed. --- PROMS/XYPlots/XYPlots.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index d0eaa540..aa05b592 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -332,7 +332,7 @@ namespace XYPlots { int retval; string np = NextPiece(); - np = Regex.Replace(np, "[^0-9]", ""); + np = Regex.Replace(np, "[^-0-9]", ""); retval = Convert.ToInt32(np, 10); return retval; } @@ -1610,6 +1610,8 @@ namespace XYPlots newmaximum = ((int)(maximum[flag] / delta[flag])) * delta[flag]; if (newmaximum < maximum[flag] - (delta[flag] * 0.001)) newmaximum += delta[flag]; + // B2017-008 Support a reverse Axis which goes from a larger value to a smaller value. + if (newmaximum < newminimum) delta[flag] = -delta[flag]; minimum[flag] = newminimum; maximum[flag] = newmaximum; } @@ -1877,6 +1879,18 @@ namespace XYPlots //VG.VG_Arc.iColor = 0; //#endif } + private int _OffsetX = 0; + public int OffsetX + { + get { return _OffsetX; } + set { _OffsetX = value; } + } + private int _OffsetY = 0; + public int OffsetY + { + get { return _OffsetY; } + set { _OffsetY = value; } + } public void Setup() { char Command, PrevCommand = ' '; @@ -1890,6 +1904,10 @@ namespace XYPlots ShadowFlag = 0; switch (Command) { + case 'O': + OffsetX = getint(); + OffsetY = getint(); + break; case 'T': ShadowFlag += 2; // 2 for no box GetBoxParameters();