deviceLabel.setText(model);
TangoKey attributeKey;
ImageViewerBox imageBox = new ImageViewerBox();
StringScalarBox stringBox = new StringScalarBox();
NumberScalarBox numberBox = new NumberScalarBox();
ChartViewerBox chartBox = new ChartViewerBox();
BooleanScalarBox booleanBox = new BooleanScalarBox();
TangoKey tangoKey = generateCommandKey("Start");
setWidgetModel(startButton, booleanBox, tangoKey);
startButton.setText("Start");
tangoKey = generateCommandKey("Stop");
setWidgetModel(stopButton, booleanBox, tangoKey);
stopButton.setText("Stop");
attributeKey = generateAttributeKey("data");
setWidgetModel(dataImage, imageBox, attributeKey);
dataImage.setAlwaysFitMaxSize(true);
attributeKey = generateReadOnlyAttributeKey("energyStep");
setWidgetModel(energyStepRead, stringBox, attributeKey);
stringBox.setUnitEnabled(energyStepRead, true);
attributeKey = generateWriteAttributeKey("energyStep");
setWidgetModel(energyStepWrite, numberBox, attributeKey);
attributeKey = generateAttributeKey("state");
setWidgetModel(stateLabel, stringBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("status");
setWidgetModel(statusArea, stringBox, attributeKey);
stringBox.setColorEnabled(statusArea, false);
attributeKey = generateAttributeKey("mode");
setWidgetModel(acquisitionModeCombo, stringBox, attributeKey);
ITextTarget acquisitionModeTarget = new ITextTarget() {
@Override
public void setText(String text) {
setEnergyLabelVisible(text);
}
@Override
public void removeMediator(Mediator<?> mediator) {
}
@Override
public void addMediator(Mediator<?> mediator) {
}
@Override
public String getText() {
return null;
}
};
setWidgetModel(acquisitionModeTarget, stringBox, attributeKey);
attributeKey = generateAttributeKey("energyScale");
setWidgetModel(energyScaleCombo, stringBox, attributeKey);
attributeKey = generateAttributeKey("passEnergy");
setWidgetModel(passEnergyCombo, stringBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("excitationEnergy");
setWidgetModel(excitationEnergyRead, stringBox, attributeKey);
stringBox.setUnitEnabled(excitationEnergyRead, true);
attributeKey = generateWriteAttributeKey("excitationEnergy");
setWidgetModel(excitationEnergyWrite, numberBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("stepTime");
setWidgetModel(stepTimeRead, stringBox, attributeKey);
stringBox.setUnitEnabled(stepTimeRead, true);
attributeKey = generateWriteAttributeKey("stepTime");
setWidgetModel(stepTimeWrite, numberBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("lowEnergy");
setWidgetModel(lowEnergyRead, stringBox, attributeKey);
stringBox.setUnitEnabled(lowEnergyRead, true);
attributeKey = generateWriteAttributeKey("lowEnergy");
setWidgetModel(lowEnergyWrite, numberBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("highEnergy");
setWidgetModel(highEnergyRead, stringBox, attributeKey);
stringBox.setUnitEnabled(highEnergyRead, true);
attributeKey = generateWriteAttributeKey("highEnergy");
setWidgetModel(highEnergyWrite, numberBox, attributeKey);
attributeKey = generateReadOnlyAttributeKey("fixEnergy");