wip open left overs.
This commit is contained in:
parent
db67a6c680
commit
8c02789a62
|
@ -55,7 +55,7 @@ abstract public class AbstractUnitXCGroupBuilder<P,T extends AbstractUnitXCGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
public B addQuantityId(String id) {
|
public B addQuantityId(String id) {
|
||||||
return make((v) -> v.addQuantity(new DefaultUnitXCGroupQuantity(null,"group."+v.getId()+".quantity",id)));
|
return make((v) -> v.addQuantity(new DefaultUnitXCGroupQuantity(null,"group."+v.getId()+".quantity",id))); // TODO: fix null bundle here
|
||||||
}
|
}
|
||||||
|
|
||||||
public B addQuantityIds(String...ids) {
|
public B addQuantityIds(String...ids) {
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
package net.forwardfire.unitxc.config.builder;
|
package net.forwardfire.unitxc.config.builder;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ import net.forwardfire.unitxc.model.UnitXCResourceBundle;
|
||||||
*/
|
*/
|
||||||
public class UnitXCConfigBuilder {
|
public class UnitXCConfigBuilder {
|
||||||
|
|
||||||
public static final String TYPE_FLAG_IMPERIAL = "IMPERIAL"; // todo move to ...
|
public static final String TYPE_FLAG_IMPERIAL = "IMPERIAL"; // TODO: move to ...
|
||||||
public static final String TYPE_FLAG_IMPERIAL_EXTRA = "IMPERIAL_EXTRA";
|
public static final String TYPE_FLAG_IMPERIAL_EXTRA = "IMPERIAL_EXTRA";
|
||||||
public static final String TYPE_FLAG_ALIAS = "ALIAS";
|
public static final String TYPE_FLAG_ALIAS = "ALIAS";
|
||||||
|
|
||||||
|
|
|
@ -129,9 +129,10 @@ public class UnitXCConverterStepTest {
|
||||||
result = unitManager.getConverter().convertStepped(50, "km/h", "mm",para);
|
result = unitManager.getConverter().convertStepped(50, "km/h", "mm",para);
|
||||||
//System.out.println("CONVERT-RESULT: "+result);
|
//System.out.println("CONVERT-RESULT: "+result);
|
||||||
|
|
||||||
int x=0;
|
long totalUnits=0;
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
buf.append("digraph G {\n");
|
buf.append("digraph G {\n");
|
||||||
|
|
||||||
//buf.append("\tsize = \"4,4\"\n");
|
//buf.append("\tsize = \"4,4\"\n");
|
||||||
for (UnitXCGroup typeGroup:unitManager.getConfig().getUnitGroups()) {
|
for (UnitXCGroup typeGroup:unitManager.getConfig().getUnitGroups()) {
|
||||||
UnitXCType baseType = unitManager.getUnitType(typeGroup.getBaseTypeId());
|
UnitXCType baseType = unitManager.getUnitType(typeGroup.getBaseTypeId());
|
||||||
|
@ -170,6 +171,8 @@ public class UnitXCConverterStepTest {
|
||||||
buf.append("color=red,label=\""+typeGroup.getUnitTypeSize()+"\"");
|
buf.append("color=red,label=\""+typeGroup.getUnitTypeSize()+"\"");
|
||||||
buf.append("];\n");
|
buf.append("];\n");
|
||||||
|
|
||||||
|
totalUnits += typeGroup.getUnitTypeSize();
|
||||||
|
|
||||||
// print relations
|
// print relations
|
||||||
for (String groupFrom:typeGroup.getDerivedFrom()) {
|
for (String groupFrom:typeGroup.getDerivedFrom()) {
|
||||||
buf.append("\t"+groupFrom+" -> "+typeGroup.getId());
|
buf.append("\t"+groupFrom+" -> "+typeGroup.getId());
|
||||||
|
@ -202,6 +205,9 @@ public class UnitXCConverterStepTest {
|
||||||
//}
|
//}
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buf.append("Stats[shape=box,color=\".9 0.2 0.8\",label=\"unit groups: "+unitManager.getConfig().getUnitGroups().size()+"\\ntotal units: "+totalUnits+"\",labelloc=b];\n");
|
||||||
|
|
||||||
buf.append("}\n");
|
buf.append("}\n");
|
||||||
System.out.println("dot: \n"+buf.toString());
|
System.out.println("dot: \n"+buf.toString());
|
||||||
FileUtils.write(new File("target/groups.dot"), buf.toString(), Charset.forName("UTF-8"), false);
|
FileUtils.write(new File("target/groups.dot"), buf.toString(), Charset.forName("UTF-8"), false);
|
||||||
|
|
Loading…
Reference in a new issue