Esempio n. 1
0
 def get_result_row(self, i, r) -> ("Name", "Model", "Fit", "Unit"):
     return [
         TableItem(r.name),
         TableItem(r.model, name=r.name),
         TableItem(r.fit, name=r.name),
         TableItem(ui_units.label(r.name)),
     ]
Esempio n. 2
0
 def get_orm_row(self, i,
                 r) -> ("Steerer", "Monitor", "X [mm/mrad]", "Y [mm/mrad]"):
     return [
         TableItem(r.knob),
         TableItem(r.monitor),
         TableItem(r.x),  # TODO: set_value and delegate
         TableItem(r.y),
     ]
Esempio n. 3
0
 def get_corrector_row(self, i, c) -> ("Param", "Δ [rad]"):
     default = self.defaultSpinBox.value() or None
     return [
         TableItem(c.name),
         TableItem(self.d_phi.get(c.name.lower(), default),
                   set_value=self.set_delta,
                   delegate=delegates[float]),
     ]
Esempio n. 4
0
 def get_row(self, i, p) -> ("Param", "ACS value", "MAD-X value", "Unit"):
     style = [{}, {
         'font': bold(),
         'backgroundColor': QColor(Qt.gray),
     } if p.acs_value != p.mad_value else {}]
     return [
         TableItem(p.name),
         TableItem(p.acs_value, **style['acs' in self.highlight]),
         TableItem(p.mad_value, **style['mad' in self.highlight]),
         TableItem(p.unit),
     ]
Esempio n. 5
0
 def get_monitor_row(self, i, m) -> ("Monitor", "Δx", "Δy"):
     fg = get_monitor_textcolor(m)
     dx, dy = self._offsets.get(m.name.lower(), (0, 0))
     return [
         TableItem(m.name,
                   checkable=True,
                   foreground=fg,
                   checked=self.selected(m),
                   set_checked=self.set_monitor_show),
         TableItem(dx, name='posx', foreground=fg),
         TableItem(dy, name='posy', foreground=fg),
     ]
Esempio n. 6
0
 def get_monitor_row(self, i, m) -> ("Monitor", "x", "y", "Δx", "Δy"):
     fg = get_monitor_textcolor(m)
     return [
         TableItem(m.name,
                   checkable=True,
                   foreground=fg,
                   checked=self.selected(m),
                   set_checked=self.set_monitor_show),
         TableItem(m.posx, name='posx', foreground=fg),
         TableItem(m.posy, name='posy', foreground=fg),
         TableItem(m.envx, name='envx', foreground=fg),
         TableItem(m.envy, name='envy', foreground=fg),
     ]
Esempio n. 7
0
 def get_monitor_row(self, i, m) -> ("Monitor", ):
     return [
         TableItem(m),
     ]