# Path: pytripgui/field_vc/angles_standard.py
# class AnglesStandard(Enum):
#     TRIP = 1
#     IEC = 2
# 
# Path: pytripgui/view/qt_gui.py
# class UiFieldDialog(QtWidgets.QDialog):
#     def __init__(self, parent=None):
#         super(UiFieldDialog, self).__init__(parent)
#         ui_path = os.path.join(current_directory, 'field.ui')
#         uic.loadUi(ui_path, self)


from pytripgui.field_vc.angles_standard import AnglesStandard
from pytripgui.view.qt_gui import UiFieldDialog
import logging

    def exit(self):
        self.ui.close()

    def set_ok_callback(self, fun):
        self.ui.accept_ButtonBox.accepted.connect(fun)

    def set_cancel_callback(self, fun):
        self.ui.accept_ButtonBox.rejected.connect(fun)

    def set_gui_needs_update_callback(self, fun):
        self.ui.anglesStandardIEC_radio.toggled.connect(fun)

    def _setup_internal_callbacks(self):
        self.ui.manualIsocenter_checkBox.stateChanged.connect(self._isocenter_checkbox_callback)
        self.ui.gantry_pushButton_p90.clicked.connect(self._gantry_p90)  # +90 deg
        self.ui.gantry_pushButton_m90.clicked.connect(self._gantry_m90)  # -90 deg
        self.ui.couch_pushButton_p90.clicked.connect(self._couch_p90)  # +90 deg
        self.ui.couch_pushButton_m90.clicked.connect(self._couch_m90)  # -90 deg

    def _isocenter_checkbox_callback(self):
        checkbox_state = self.ui.manualIsocenter_checkBox.checkState()
        self.set_isocenter_state(checkbox_state)

    @property
    def angles_standard(self):
        checked_button = self.ui.anglesStandardGroup.checkedButton()
        if checked_button == self.ui.anglesStandardTRiP_radio:
            return AnglesStandard.TRIP
        if checked_button == self.ui.anglesStandardIEC_radio:

# Path: pytripgui/field_vc/angles_standard.py
# class AnglesStandard(Enum):
#     TRIP = 1
#     IEC = 2
# 
# Path: pytripgui/view/qt_gui.py
# class UiFieldDialog(QtWidgets.QDialog):
#     def __init__(self, parent=None):
#         super(UiFieldDialog, self).__init__(parent)
#         ui_path = os.path.join(current_directory, 'field.ui')
#         uic.loadUi(ui_path, self)


# Path: pytripgui/field_vc/field_view.py
from pytripgui.field_vc.angles_standard import AnglesStandard
from pytripgui.view.qt_gui import UiFieldDialog
import logging


    def exit(self):
        self.ui.close()

    def set_ok_callback(self, fun):
        self.ui.accept_ButtonBox.accepted.connect(fun)

    def set_cancel_callback(self, fun):
        self.ui.accept_ButtonBox.rejected.connect(fun)

    def set_gui_needs_update_callback(self, fun):
        self.ui.anglesStandardIEC_radio.toggled.connect(fun)

    def _setup_internal_callbacks(self):
        self.ui.manualIsocenter_checkBox.stateChanged.connect(self._isocenter_checkbox_callback)
        self.ui.gantry_pushButton_p90.clicked.connect(self._gantry_p90)  # +90 deg
        self.ui.gantry_pushButton_m90.clicked.connect(self._gantry_m90)  # -90 deg
        self.ui.couch_pushButton_p90.clicked.connect(self._couch_p90)  # +90 deg
        self.ui.couch_pushButton_m90.clicked.connect(self._couch_m90)  # -90 deg

    def _isocenter_checkbox_callback(self):
        checkbox_state = self.ui.manualIsocenter_checkBox.checkState()
        self.set_isocenter_state(checkbox_state)

    @property
    def angles_standard(self):
        checked_button = self.ui.anglesStandardGroup.checkedButton()
        if checked_button == self.ui.anglesStandardTRiP_radio:
            return AnglesStandard.TRIP
        if checked_button == self.ui.anglesStandardIEC_radio:

            return AnglesStandard.IEC