wip open left overs.

This commit is contained in:
Willem 2018-03-25 17:03:53 +02:00
parent db67a6c680
commit 8c02789a62
3 changed files with 9 additions and 4 deletions

View file

@ -55,7 +55,7 @@ abstract public class AbstractUnitXCGroupBuilder<P,T extends AbstractUnitXCGroup
}
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) {

View file

@ -23,7 +23,6 @@
package net.forwardfire.unitxc.config.builder;
import java.util.Collections;
import java.util.Locale;
import java.util.ResourceBundle;
@ -45,7 +44,7 @@ import net.forwardfire.unitxc.model.UnitXCResourceBundle;
*/
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_ALIAS = "ALIAS";

View file

@ -129,9 +129,10 @@ public class UnitXCConverterStepTest {
result = unitManager.getConverter().convertStepped(50, "km/h", "mm",para);
//System.out.println("CONVERT-RESULT: "+result);
int x=0;
long totalUnits=0;
StringBuilder buf = new StringBuilder();
buf.append("digraph G {\n");
//buf.append("\tsize = \"4,4\"\n");
for (UnitXCGroup typeGroup:unitManager.getConfig().getUnitGroups()) {
UnitXCType baseType = unitManager.getUnitType(typeGroup.getBaseTypeId());
@ -170,6 +171,8 @@ public class UnitXCConverterStepTest {
buf.append("color=red,label=\""+typeGroup.getUnitTypeSize()+"\"");
buf.append("];\n");
totalUnits += typeGroup.getUnitTypeSize();
// print relations
for (String groupFrom:typeGroup.getDerivedFrom()) {
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");
System.out.println("dot: \n"+buf.toString());
FileUtils.write(new File("target/groups.dot"), buf.toString(), Charset.forName("UTF-8"), false);