Skip to content

Commit

Permalink
Fixed the rendered view of the control for minhdwy
Browse files Browse the repository at this point in the history
  • Loading branch information
cherneysp committed Jul 7, 2022
1 parent cb2ede8 commit 42104da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/cc/ctrl/proc/ProcCtrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public abstract class ProcCtrl
CHARS.put("X", new double[]{-0.1, -0.2, 0.1, 0.2, 0.0, 0.0, -0.1, 0.2, 0.1, -0.2});
CHARS.put("s", new double[]{0.1, 0.0, -0.1, 0.0, -0.1, -0.1, 0.1, -0.1, 0.1, -0.2, -0.1, -0.2});
CHARS.put(".", new double[]{0.1, -0.075, 0.1, -0.1, 0.075, -0.1, 0.075, -0.075, 0.1, -0.075});
CHARS.put("t", new double[]{-0.1, 0, 0.1, 0, 0.0, 0.0, 0.0, 0.2, 0.0, -0.2, 0.1, -0.2});
CHARS.put("f", new double[]{-0.1, 0, 0.1, 0, 0.0, 0.0, 0.0, -0.2, 0.0, 0.2, 0.1, 0.2});
}

public String m_sLineArcDir;
Expand Down
9 changes: 6 additions & 3 deletions src/cc/ctrl/proc/ProcHeadway.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import cc.ctrl.CtrlGeo;
import cc.ctrl.CtrlLineArcs;
import cc.ctrl.TrafCtrl;
import cc.ctrl.TrafCtrlEnums;
import cc.geosrv.Mercator;
import cc.util.Arrays;
import cc.util.FileUtil;
import cc.util.Geo;
import cc.util.MathUtil;
import cc.util.TileUtil;
import cc.util.Units;
import java.awt.geom.AffineTransform;
import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
Expand Down Expand Up @@ -73,7 +75,8 @@ public static void renderTiledData(ArrayList<TrafCtrl> oCtrls, ArrayList<int[]>
dSymbol1[0] = dSymbol1.length;
dSymbol2[0] = dSymbol2.length;
int nSymbolPts = SYMBOL.length / 2;

Units oUnits = Units.getInstance();
String[] sUnits = TrafCtrlEnums.UNITS[TrafCtrlEnums.getCtrl("minhdwy")];
for (int[] nTile : nTiles)
{
int nX = nTile[0];
Expand Down Expand Up @@ -134,8 +137,8 @@ public static void renderTiledData(ArrayList<TrafCtrl> oCtrls, ArrayList<int[]>
{
oLayer.add(new TdFeature(dSymbol1, nTags, oCtrl));
oLayer.add(new TdFeature(dSymbol2, nTags, oCtrl));

String sVal = oDf.format(MathUtil.bytesToInt(oCtrl.m_yControlValue)) + "s";
int nVal = (int)Math.round(oUnits.convert(sUnits[0], sUnits[1], MathUtil.bytesToInt(oCtrl.m_yControlValue)));
String sVal = oDf.format(nVal) + "ft";
int nLimit = sVal.length();
double dStep = -0.3;
double dOffset = -0.45 + (nLimit * 0.3);
Expand Down

0 comments on commit 42104da

Please sign in to comment.