Unit Tests
This commit is contained in:
@ -4,6 +4,7 @@ import fabrik.simulator.pic16f84.interfaces.*;
|
||||
public class Commands extends PICComponent implements CommandInterface {
|
||||
private int wRegister;
|
||||
private long totalExecutionTime;
|
||||
private double executionTimeMultiplier = 1;
|
||||
|
||||
public Commands(){
|
||||
super();
|
||||
@ -22,7 +23,7 @@ public class Commands extends PICComponent implements CommandInterface {
|
||||
}
|
||||
|
||||
public double getTotalExecutionTime() {
|
||||
return (totalExecutionTime * frontendController.getExecutionTimeMultiplier());
|
||||
return (totalExecutionTime * getExecutionTimeMultiplier());
|
||||
}
|
||||
|
||||
public void resetTotalExecutionTime() {
|
||||
@ -248,8 +249,6 @@ public class Commands extends PICComponent implements CommandInterface {
|
||||
else{
|
||||
System.out.println("Nicht gefunden!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void SLEEP() {
|
||||
@ -557,9 +556,39 @@ public class Commands extends PICComponent implements CommandInterface {
|
||||
}
|
||||
}
|
||||
|
||||
public double getExecutionTimeMultiplier(){
|
||||
return executionTimeMultiplier;
|
||||
}
|
||||
|
||||
public void setExecutionTimeMultiplier(String option){
|
||||
switch (option) {
|
||||
case "8 MHZ":
|
||||
executionTimeMultiplier = 0.5;
|
||||
break;
|
||||
|
||||
case "4 MHZ":
|
||||
executionTimeMultiplier = 1;
|
||||
break;
|
||||
case "1 MHZ":
|
||||
executionTimeMultiplier = 4;
|
||||
break;
|
||||
case "500 HZ":
|
||||
executionTimeMultiplier = 8;
|
||||
break;
|
||||
|
||||
case "100 HZ":
|
||||
executionTimeMultiplier = 40;
|
||||
break;
|
||||
|
||||
case "32 HZ":
|
||||
executionTimeMultiplier = 125;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(PICComponents picComponents) {
|
||||
System.out.println("Commands");
|
||||
super.initialize(picComponents);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user