#!/usr/bin/env python
################################################################################
# NAME     : pllss
# PURPOSE  : plot PLL open-loop/closed-loop S-domain, Z-domain transfer functions
# AUTHOR   : Richard Booth
# DATE     : Sat Nov  9 11:05:51 2013
# -----------------------------------------------------------------------------
# NOTES    : 
################################################################################
from __future__ import print_function
import sys
from decida.PLL import PLL
#-----------------------------------------------------------------------------
# usage
#-----------------------------------------------------------------------------
def usage() :
    print("""\
  usage :
      pllss ?options?
  options :
      -h       print help information
      -xmat    don't use matplotlib
    """)
    exit()
#-----------------------------------------------------------------------------
# command-line arguments
#-----------------------------------------------------------------------------
use_matplotlib = True
args = sys.argv[1:]
while len(args) > 0 :
    arg = args.pop(0)
    if   arg == "-h" or arg == "-help" :
        usage()
    elif arg == "-xmat" :
        use_matplotlib = False
    else :
        print("un-supported option: \"%s\"" % (arg))
        usage()
#-----------------------------------------------------------------------------
# invoke plotter
#-----------------------------------------------------------------------------
PLL(use_matplotlib=use_matplotlib)
