Show wire diameter in mm and in next to AWG gauge

This commit is contained in:
Branislav Stojkovic
2019-02-27 19:16:44 +01:00
parent 08aec6fa9b
commit 20e01762b8
3 changed files with 22 additions and 2 deletions
@@ -23,11 +23,15 @@ package org.diylc.components.connectivity;
public enum AWG {
_8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30;
_8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30, _32, _34, _36;
@Override
public String toString() {
return "#" + name().replace("_", "");
return "#" + name().replace("_", "") + " (" + String.format("%1$,.2f", diameterIn() * 25.4) + "mm / " + String.format("%1$,.5f", diameterIn()) + "in)";
}
public double diameterIn() {
return Math.pow(Math.E, -1.12436 - 0.11594 * getValue());
}
public int getValue() {