code: def setPixelScale(self, pxms):
          
          pxms = float(pxms)/2
          self.pixelsPerms = pxms
          if pxms*self.gridms < GRID_PIXEL_MIN:
              self.gridms = self.gridms*2
          elif pxms*self.gridms > GRID_PIXEL_MAX:
              self.gridms = self.gridms/2
          self._viewIsDirty = True
          self.viewport().update()
  
          return self.gridms
docs: Sets the zoom scale
  
          :param pxms: number of pixels per ms
          :type pxms: int
          :returns: float -- the miliseconds between grid lines