Move sounding parameters drawing to draw_params()
This commit is contained in:
parent
85ccede7f0
commit
629bee25d9
1 changed files with 21 additions and 14 deletions
|
@ -236,20 +236,11 @@ class SkewTGraph():
|
|||
|
||||
cr.restore()
|
||||
|
||||
def draw(self,
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
sounding: Sounding):
|
||||
cr.rectangle(x, y, self.width, self.height)
|
||||
cr.clip()
|
||||
|
||||
self.draw_isotherms(cr, x, y)
|
||||
self.draw_isobars(cr, x, y)
|
||||
self.draw_adiabats(cr, x, y)
|
||||
|
||||
params = SoundingParameters.from_sounding(sounding)
|
||||
|
||||
def draw_params(self,
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
params: SoundingParameters):
|
||||
if self.opts.draw_lcl:
|
||||
self.draw_special_isobar(cr, x, y, params.lcl[1])
|
||||
|
||||
|
@ -271,6 +262,22 @@ class SkewTGraph():
|
|||
cr.set_source_rgb(0.8, 0.8, 1.0)
|
||||
self.draw_series(cr, x, y, params.saturated_mr_line)
|
||||
|
||||
def draw(self,
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
sounding: Sounding,
|
||||
params: SoundingParameters=None):
|
||||
cr.rectangle(x, y, self.width, self.height)
|
||||
cr.clip()
|
||||
|
||||
self.draw_isotherms(cr, x, y)
|
||||
self.draw_isobars(cr, x, y)
|
||||
self.draw_adiabats(cr, x, y)
|
||||
|
||||
if params is not None:
|
||||
self.draw_params(cr, x, y, params)
|
||||
|
||||
cr.set_source_rgb(1, 0, 0)
|
||||
self.draw_sounding(cr, x, y, sounding, lambda s: s.temp)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue