|
|
@ -4,6 +4,7 @@ import com.my.graphiteDigesterBg.diframe.DiTaskStepTaskBase; |
|
|
|
import com.my.graphiteDigesterBg.diframe.Task; |
|
|
|
import com.my.graphiteDigesterBg.model.MdbDigestionTask; |
|
|
|
import com.my.graphiteDigesterBg.model.MdbOperationLog; |
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlot; |
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
@ -13,6 +14,8 @@ public class TaskDigestion extends DiTaskStepTaskBase { |
|
|
|
public Integer id; |
|
|
|
// slot index |
|
|
|
public Integer slotIndex; |
|
|
|
// slot |
|
|
|
private ResHeatingTubeRackSlot slot; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void setup() { |
|
|
@ -22,8 +25,8 @@ public class TaskDigestion extends DiTaskStepTaskBase { |
|
|
|
} |
|
|
|
|
|
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
|
var slot = slotMan.getSlotByIndex(this.slotIndex); |
|
|
|
slot.digestionName = taskModel.name; |
|
|
|
this.slot = slotMan.getSlotByIndex(this.slotIndex); |
|
|
|
this.slot.digestionName = taskModel.name; |
|
|
|
|
|
|
|
this.loadStepsByJson(taskModel.steps); |
|
|
|
|
|
|
@ -32,8 +35,22 @@ public class TaskDigestion extends DiTaskStepTaskBase { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void afterRun() { |
|
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
|
var slot = slotMan.getSlotByIndex(this.slotIndex); |
|
|
|
slot.digestionName = null; |
|
|
|
this.slot.digestionName = null; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onError( Exception e ) { |
|
|
|
this.slot.digestionName = null; |
|
|
|
} |
|
|
|
|
|
|
|
// throw exception |
|
|
|
public void throwException(String message) { |
|
|
|
String msg = String.format("[试管架%d - %s] : %s", this.slotIndex, this.slot.digestionName, message); |
|
|
|
throw new RuntimeException(msg); |
|
|
|
} |
|
|
|
|
|
|
|
// get slot |
|
|
|
public ResHeatingTubeRackSlot getSlot() { |
|
|
|
return this.slot; |
|
|
|
} |
|
|
|
} |