Exemple #1
0
 def _set_use_data_scale_max(self, check_state):
     use_scale = check_state == 2
     if self._current_map:
         if use_scale and self._get_current_map_config().scale.use_min:
             self._set_use_scale(2)
         else:
             new_scale = self._get_current_map_config().scale.get_updated(use_max=use_scale)
             self._controller.apply_action(SetMapScale(self._current_map, new_scale))
 def _set_use_data_scale_min(self, use_scale):
     if self._current_map:
         if use_scale and self._get_current_map_config().scale.use_max:
             self._set_use_scale(True)
         else:
             new_scale = self._get_current_map_config().scale.get_updated(
                 use_min=use_scale)
             self._controller.apply_action(
                 SetMapScale(self._current_map, new_scale))
 def _update_scale_max(self, value):
     if self._current_map:
         current_scale = self._get_current_map_config().scale
         if current_scale.use_min and current_scale.use_max and value < current_scale.vmin:
             new_scale = current_scale.get_updated(vmin=value, vmax=value)
         else:
             new_scale = current_scale.get_updated(vmax=value)
         self._controller.apply_action(
             SetMapScale(self._current_map, new_scale))
Exemple #4
0
 def _set_use_scale(self, check_state):
     use_scale = check_state == 2
     if self._current_map:
         current_scale = self._get_current_map_config().scale
         if use_scale and current_scale.vmax < current_scale.vmin:
             new_scale = current_scale.get_updated(use_min=use_scale, use_max=use_scale, vmax=current_scale.vmin)
         else:
             new_scale = current_scale.get_updated(use_min=use_scale, use_max=use_scale)
         self._controller.apply_action(SetMapScale(self._current_map, new_scale))
     self._update_scaling_delays()
Exemple #5
0
    def _update_scale_max(self, value):
        if self._current_map:
            current_scale = self._get_current_map_config().scale
            kwargs = dict(vmax=value)

            if current_scale.use_max and current_scale.use_min and value < current_scale.vmin:
                kwargs.update(dict(use_max=False))
                self._auto_enable_scale_max = True
            elif self._auto_enable_scale_max and value > current_scale.vmin:
                kwargs.update(dict(use_max=True))
                self._auto_enable_scale_max = False

            new_scale = current_scale.get_updated(**kwargs)
            self._controller.apply_action(SetMapScale(self._current_map, new_scale))