瀏覽代碼

BatteryText "+" mit "-" getauscht

tolatesry 6 年之前
父節點
當前提交
cb90f3119e
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/classes/HolonBattery.java

+ 2 - 2
src/classes/HolonBattery.java

@@ -109,11 +109,11 @@ public class HolonBattery extends AbstractCpsObject{
 		float newStateOfCharge1 =  getStateOfChargeAtTimeStep(x);
 		if(newStateOfCharge1 > stateOfCharge1)
 		{
-			return "+" + Float.toString(newStateOfCharge1 - stateOfCharge1);
+			return "-" + Float.toString(newStateOfCharge1 - stateOfCharge1);
 		}
 		else if (newStateOfCharge1 < stateOfCharge1)
 		{
-			return Float.toString(newStateOfCharge1 - stateOfCharge1); // '"-" +' not needed because negative
+			return "+" +Float.toString(-(newStateOfCharge1 - stateOfCharge1)); // '"-" +' not needed because negative
 		}else
 		{
 			return "0";