Ver código fonte

BatteryText "+" mit "-" getauscht

tolatesry 6 anos atrás
pai
commit
cb90f3119e
1 arquivos alterados com 2 adições e 2 exclusões
  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";