# 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
    def set_view_from_model(self):
        if self._is_isocenter_manually():
            self.view.set_isocenter_values(self.model.isocenter)
            self.view.set_isocenter_state(True)
        else:
            self.view.set_isocenter_state(False)

        self._setup_ok_and_cancel_buttons_callbacks()

        self.view.angles_standard = self.model.angles_standard
        self._set_view_angles_according_to_standard(self.model.angles_standard, self.model.gantry_angle_trip98,
                                                    self.model.couch_angle_trip98, True)

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

    def _is_isocenter_manually(self):
        return len(self.model.isocenter) == 3

    def _setup_ok_and_cancel_buttons_callbacks(self):
        self.view.set_ok_callback(self._save_and_exit)
        self.view.set_cancel_callback(self._exit)
        self.view.set_gui_needs_update_callback(self._recalculate_gui_values)

    def _save_and_exit(self):
        self.set_model_from_view()
        self.user_clicked_save = True

# 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

    def set_view_from_model(self):
        if self._is_isocenter_manually():
            self.view.set_isocenter_values(self.model.isocenter)
            self.view.set_isocenter_state(True)
        else:
            self.view.set_isocenter_state(False)

        self._setup_ok_and_cancel_buttons_callbacks()

        self.view.angles_standard = self.model.angles_standard
        self._set_view_angles_according_to_standard(self.model.angles_standard, self.model.gantry_angle_trip98,
                                                    self.model.couch_angle_trip98, True)

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

    def _is_isocenter_manually(self):
        return len(self.model.isocenter) == 3

    def _setup_ok_and_cancel_buttons_callbacks(self):
        self.view.set_ok_callback(self._save_and_exit)
        self.view.set_cancel_callback(self._exit)
        self.view.set_gui_needs_update_callback(self._recalculate_gui_values)

    def _save_and_exit(self):
        self.set_model_from_view()
        self.user_clicked_save = True

        self.view.exit()