package be.iminds.ilabt.jfed.experimenter_gui.slice;

import be.iminds.ilabt.jfed.experiment.SfaExperimentPart;
import be.iminds.ilabt.jfed.ui.javafx.FXMLUtil;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import org.controlsfx.control.Rating;

/**
 * User: twalcari
 * Date: 1/11/2016
 * Time: 13:53
 */
public class ExperimentPartQoe extends GridPane {

    private final SfaExperimentPart experimentPart;

    @FXML
    private Label partNameLabel;
    @FXML
    private Rating overallRating;
    @FXML
    private Rating qualityRating;
    @FXML
    private Rating availabilityRating;

    public ExperimentPartQoe(SfaExperimentPart experimentPart) {
        this.experimentPart = experimentPart;
        FXMLUtil.injectFXML(this);

        partNameLabel.setText(experimentPart.getName());
    }

    public QoeDialog.QoeReply getResult(){
        return new QoeDialog.QoeReply(experimentPart,
                (int)overallRating.getRating(),
                (int)qualityRating.getRating(),
                (int)availabilityRating.getRating());
    }


}
