Closedown

This commit is contained in:
x03daop
2016-09-20 11:56:01 +02:00
parent e90f627d02
commit 48267a500a
5 changed files with 17 additions and 13 deletions

View File

@@ -43,13 +43,15 @@ public class ManipulatorScan extends Panel {
dvpAcqTime.setDevice(scienta.getAcquisitionTime());
}
protected void onTimer(){
protected void onTimer(){
try{
int steps = radioSteps.isSelected() ?
(Integer)spinnerSteps.getValue():
(int)(Math.abs((Double)spinnerTo.getValue() - (Double)spinnerFrom.getValue()) / (Double)spinnerStepSize.getValue() + 1);
int seconds = (int) (Double.valueOf(dvpAcqTime.getLabel().getText()) * steps);
textTotalTime.setText(LocalTime.ofSecondOfDay(seconds).toString());
(Integer)spinnerSteps.getValue():
(int) ((radioRelative.isSelected()? ((Double)spinnerRange.getValue()).intValue():
(Math.abs((Double)spinnerTo.getValue() - (Double)spinnerFrom.getValue()) )) / (Double)spinnerStepSize.getValue() + 1);
int seconds = (int) (Double.valueOf(dvpAcqTime.getLabel().getText()) * steps);
int hours= seconds / (60 * 60);
textTotalTime.setText(hours >= 24 ? hours+"h": LocalTime.ofSecondOfDay(seconds).toString());
} catch (Exception ex){
textTotalTime.setText("");
}