
############################	version 3.4.7 FILTER SHADOW ADDITIONS	###################

FILE QUISK.PY CHANGES FOR FILTER SHADOW:
1.  Added the following lines at beginning of file.
	# NOTE:  THIS FILE HAD BEEN MODIFIED BY WB4JFI TO ADD A FILTER SHADOW
	#			ON THE DISPLAY TO INDICATE FILTER BANDWIDTH.  LINES WITH
	#			"WB4JFI" IN THE COMMENTS HAVE BEEN ADDED TO James
	#			Ahlstrom's ORIGINAL CODE.  DO NOT bug HIM ABOUT IT!!

2.  IN: class GraphDisplay(wx.Window):
		def __init__(self, parent, x, y, graph_width, height, chary):
		ADDED FOLLOWING LINES NEAR 640
    #line 655 reads:  self.tuningPen = wx.Pen('Red', 1)
    self.fltrPen = wx.Pen(conf.color_bandwidth, 1)				# WB4JFI ADD filter shadow
    self.fltrBrush = wx.Brush(conf.color_bandwidth, wx.SOLID)	# WB4JFI ADD filter shadow 
    self.fltr_disp_start = -100									# WB4JFI ADD filter shadow
    self.fltr_disp_size = 100									# WB4JFI ADD filter shadow
    self.fltr_disp_fill = -99									# WB4JFI ADD filter shadow
    self.fltr_disp_show = 0										# WB4JFI ADD filter shadow
    #old line 656 reads:  self.backgroundPen = wx.Pen(self.GetBackgroundColour(), 1)

3.  IN:  class GraphDisplay(wx.Window):
		 def OnPaint(self, event):
		ADDED AND CHANGED LINES TO:
    # line 667 reads: dc = wx.PaintDC(self)
    x = self.tune_x									# setx x to tune freq horizontal position
    self.UpdateFilterDisplay()									# WB4JFI ADD filter shadow
    if self.fltr_disp_show == 3:								# WB4JFI ADD filter shadow
        dc.SetPen(self.fltrPen)									# WB4JFI ADD filter shadow
        dc.SetBrush(self.fltrBrush)								# WB4JFI ADD filter shadow
        dc.DrawRectangle(x + self.fltr_disp_start, 0,			# WB4JFI ADD filter shadow
            self.fltr_disp_size, self.max_height)				# WB4JFI ADD filter shadow
        dc.FloodFill(x + self.fltr_disp_fill, 1, conf.color_bandwidth, 1) # WB4JFI ADD filter shadow
    dc.SetPen(wx.BLACK_PEN)
    dc.DrawLines(self.line)
		#    x = self.tune_x									# WB4JFI moved up for filter shadow
    dc.SetPen(self.tuningPen)
    #old line 668:  dc.DrawLine(x, 0, x, self.max_height)

4.  IN:  class GraphDisplay(wx.Window):
	add the following def section after line 716:
    # line 716 reads: self.Refresh() #rect=rect)
  def UpdateFilterDisplay(self):							# WB4JFI ADD - Update filter display
    if application.fltr_display:							# WB4JFI, check if OK to display filter
      self.fltr_disp_show = self.fltr_disp_show | 1			# set bit 0, show OK from OUTSIDE
    else:													# otherwise, OUTSIDE don't display
      self.fltr_disp_show = self.fltr_disp_show & 2			# by clearing bit 0
    if application.screen == application.graph or application.screen == application.waterfall:
      self.fltr_disp_show = self.fltr_disp_show | 2			# bit 1 shows proper screen to display
    else:
      self.fltr_disp_show = self.fltr_disp_show & 1			# clear bit 1 to indicate not proper display
    self.filter_pixels = (application.filterbw / (application.sample_rate /application.data_width) + 0.5)
    if self.filter_pixels < 2:								# if calculated less than 2 pixels
      self.filter_pixels = 2									# make it at least 2 pixels wide
    if application.mode == 'LSB' or application.mode == 'CWL':	# if filter on lower sideband...
      self.fltr_disp_start = -(self.filter_pixels - 1)			# set start to be at lower side
      self.fltr_disp_size = self.filter_pixels					# and set rectangle size
      self.fltr_disp_fill = self.fltr_disp_start				# start filling at rectangle start
    if application.mode == 'USB' or application.mode == 'CWU':	# if filter on upper sideband...
      self.fltr_disp_start = 0									# start is at tuning freq
      self.fltr_disp_size = self.filter_pixels					# set rectangle size
      self.fltr_disp_fill = 1									# start filling at beginning of tune
    if application.mode == 'AM' or application.mode == 'FM':	# if filter is centered at tune freq
      self.fltr_disp_start = -((self.filter_pixels - 1) /2)		# set start at 1/2 bandidth
      self.fltr_disp_size = self.filter_pixels					# set size to cover both sidebands
      self.fltr_disp_fill = self.filter_pixels					# start filling at lower edge
	#															# WB4JFI - end of filter add
  # previous line 717: def SetTuningLine(self, x):

5.  IN: class App(wx.App):
	  def OnInit(self):
		Add the following lines after line 1518
    # line 1518 reads: self.color_index = 0
    self.filterbw = 0								# WB4JFI Added for filter display
    self.fltr_display = conf.filter_display			# WB4JFI added filter display 1=OK, 0=do not display
    # old line 1519: dc = wx.ScreenDC()		# get the screen size

6.  IN:  class App(wx.App):
		def OnBtnFilter(self, event, bw=None):
		Add the following lines after line 2004:		
      # line 2004 reads: bw = int(btn.GetLabel())
    self.filterbw = int(self.filterButns.GetLabel())		# WB4JFI ADD - udate filter bandwidth
    application.graph.display.UpdateFilterDisplay()			# WB4JFI ADD - update the filter disp
    # old line 2005: mode = self.mode

7.  IN:
	  def OnBtnScreen(self, event, name=None):
		Add the following line after line 2032:
      # line 2032 reads: self.freqDisplay.Display(self.VFO + self.txFreq)
      application.graph.display.UpdateFilterDisplay()	# WB4JFI ADD - update the filter disp
    # old line 2033: elif name == 'WFall':

8.  IN:
	  def OnBtnScreen(self, event, name=None):
		Add the following line after line 2039:
      # line 2039 reads: sash = self.screen.GetSashPosition()
      application.graph.display.UpdateFilterDisplay()	# WB4JFI ADD - update the filter disp
    old line 2040: elif name == 'Scope':

9.  IN:
	  def OnBtnMode(self, event, mode=None):
		Add the following line after line 2284:
      # Line 2284 reads: self.OnBtnFilter(None, 12000)
    application.graph.display.UpdateFilterDisplay()		# WB4JFI ADD - update the filter disp
  # old line 2285: def OnBtnBand(self, event):


10.  IN FILE quisk_conf_defaults.py,
	Add the following line after 62:
	# Line 62 reads: filter_y_zero  = 0
filter_display = 0
	# old line 63 is a blank line

11	IN FILE quisk_conf_defaults.py,
	Add the following line after line 87:
# line 87 reads: color_entry		= color_freq		# frequency entry box
color_bandwidth	= 'lemonchiffon2'		# audio bandwidth on spectrum display # WB4JFI ADD filter shadow
# old line 88 is blank line




