use of org.palladiosimulator.pcm.resourceenvironment.HDDProcessingResourceSpecification in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddHDDProcessingResourceSpecification method execute.
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
final Object parameter = parameters.get(NEW_HDD_PROCESSING_RESOURCE_SPECIFICATION);
if (parameter == null || !(parameter instanceof HDDProcessingResourceSpecification)) {
return;
}
final HDDProcessingResourceSpecification hddProcessingResourceSpecification = (HDDProcessingResourceSpecification) parameter;
// 1. dialog
final ProcessingResourceType prt = getResourceType(hddProcessingResourceSpecification);
if (prt != null) {
hddProcessingResourceSpecification.setActiveResourceType_ActiveResourceSpecification(prt);
} else {
return;
}
// set processing rate always to 1
final PCMRandomVariable processingRate = CoreFactory.eINSTANCE.createPCMRandomVariable();
processingRate.setSpecification("1");
hddProcessingResourceSpecification.setProcessingRate_ProcessingResourceSpecification(processingRate);
// 2. dialog
final PCMRandomVariable readProcessingRate = getReadProcessingRate();
if (readProcessingRate != null) {
hddProcessingResourceSpecification.setReadProcessingRate(readProcessingRate);
} else {
return;
}
// 3. dialog
final PCMRandomVariable writeProcessingRate = getWriteProcessingRate();
if (writeProcessingRate != null) {
hddProcessingResourceSpecification.setWriteProcessingRate(writeProcessingRate);
} else {
return;
}
// 4. dialog
final SchedulingPolicy sp = getSchedulingPolicy(hddProcessingResourceSpecification);
if (sp != null) {
hddProcessingResourceSpecification.setSchedulingPolicy(sp);
} else {
return;
}
}
Aggregations