# Path: pytripgui/field_vc/angles_standard.py
# class AnglesStandard(Enum):
#     TRIP = 1
#     IEC = 2


import logging
from pytrip.res.point import angles_to_trip, angles_from_trip
from pytripgui.field_vc.angles_standard import AnglesStandard
        self.view.exit()

    def set_model_from_view(self):
        if self.view.is_isocenter_manually():
            self.model.isocenter = self.view.get_isocenter_value()
        else:
            self.model.isocenter = []

        self.model.angles_standard = self.view.angles_standard
        self.model.gantry_angle_trip98, self.model.couch_angle_trip98 = self._get_view_angles_in_trip_standard()

        self.model.fwhm = self.view.spot_size
        self.model.raster_step = self.view.raster_step
        self.model.dose_extension = self.view.dose_extension
        self.model.contour_extension = self.view.contour_extension
        self.model.zsteps = self.view.depth_steps

    def _get_view_angles_in_trip_standard(self):
        _gantry_angle, _couch_angle = self.view.gantry_angle, self.view.couch_angle

        if self.view.angles_standard == AnglesStandard.IEC:
            _gantry_angle, _couch_angle = angles_to_trip(_gantry_angle, _couch_angle)

        return _gantry_angle, _couch_angle

    def _recalculate_gui_values(self):
        self._set_view_angles_according_to_standard(self.view.angles_standard, self.view.gantry_angle,
                                                    self.view.couch_angle)

    def _set_view_angles_according_to_standard(self, standard, gantry_angle, couch_angle, init=False):

# Path: pytripgui/field_vc/angles_standard.py
# class AnglesStandard(Enum):
#     TRIP = 1
#     IEC = 2


# Path: pytripgui/field_vc/field_cont.py
import logging
from pytrip.res.point import angles_to_trip, angles_from_trip
from pytripgui.field_vc.angles_standard import AnglesStandard

        self.view.exit()

    def set_model_from_view(self):
        if self.view.is_isocenter_manually():
            self.model.isocenter = self.view.get_isocenter_value()
        else:
            self.model.isocenter = []

        self.model.angles_standard = self.view.angles_standard
        self.model.gantry_angle_trip98, self.model.couch_angle_trip98 = self._get_view_angles_in_trip_standard()

        self.model.fwhm = self.view.spot_size
        self.model.raster_step = self.view.raster_step
        self.model.dose_extension = self.view.dose_extension
        self.model.contour_extension = self.view.contour_extension
        self.model.zsteps = self.view.depth_steps

    def _get_view_angles_in_trip_standard(self):
        _gantry_angle, _couch_angle = self.view.gantry_angle, self.view.couch_angle

        if self.view.angles_standard == AnglesStandard.IEC:
            _gantry_angle, _couch_angle = angles_to_trip(_gantry_angle, _couch_angle)

        return _gantry_angle, _couch_angle

    def _recalculate_gui_values(self):
        self._set_view_angles_according_to_standard(self.view.angles_standard, self.view.gantry_angle,
                                                    self.view.couch_angle)

    def _set_view_angles_according_to_standard(self, standard, gantry_angle, couch_angle, init=False):

        if standard == AnglesStandard.IEC: