#! /usr/bin/env python
# -*- coding: utf-8 -*-

import faster_module_path

import time

from optparse         import OptionParser
from crrc4_mosahr_one import CRRC4_MOSAHR_One


if (__name__ == "__main__"):

  usage = "usage:\n   %prog --help\n   %prog [options] filename.cfg\n"

  parser = OptionParser(usage)

  parser.add_option("-c", "--ch_num", type="int", dest="ch_num", default=0, help="Channel number [1|2|3|4] in single channel mode")
  parser.add_option("-f", "--fixed-label", action="store_true", dest="fixed_label", default=False, help="Labels aren't editable.")
  parser.add_option("-t", "--title", dest="title", default="CRRC4 Spectro MOSAHR One", help="Title of the window.")
  parser.add_option("--ch1_title", dest="ch1_title", default="Spectro 1 ", help="Name of channel 1.")
  parser.add_option("--ch2_title", dest="ch2_title", default="Spectro 2 ", help="Name of channel 2.")
  parser.add_option("--ch3_title", dest="ch3_title", default="Spectro 3 ", help="Name of channel 3.")
  parser.add_option("--ch4_title", dest="ch4_title", default="Spectro 4 ", help="Name of channel 4.")

  (options, args) = parser.parse_args()

  if len(args) != 1:
    parser.error("incorrect number of arguments")
  #

  time.sleep (0.05)

  ihm = CRRC4_MOSAHR_One (args[0],
                          singleChannel = options.ch_num,
                          title         = options.title,
                          title_ch1     = options.ch1_title,
                          title_ch2     = options.ch2_title,
                          title_ch3     = options.ch3_title,
                          title_ch4     = options.ch4_title,
                          fixed_label   = options.fixed_label,
                          forceCounters = False)

  ihm.mainloop()


#
