def setUpClass(cls):
        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('DEBUG')
        cls.logger.addHandler(psysmon.getLoggerHandler(log_level = 'DEBUG'))

        cls.psybase = create_psybase()
Exemplo n.º 2
0
def run():
    if len(sys.argv) <= 2:
        print("At least 2 arguments required (project_file, username).\n")
        sys.exit()

    project_file = sys.argv[1]
    user_name = sys.argv[2]

    if len(sys.argv) == 4:
        user_pwd = sys.argv[3]
    else:
        user_pwd = ''

    logger = logging.getLogger('psysmon')
    logger.setLevel(psysmon.logConfig['level'])
    logger.addHandler(psysmon.getLoggerHandler())

    psybase = create_psybase()
    userdata = {}
    userdata['user'] = user_name
    userdata['pwd'] = user_pwd
    psybase.load_json_project(project_file, user_name, user_pwd)

    clear_project_database_tables(psybase.project)
    psybase.stop_project_server()
 def setUpClass(cls):
     logger = logging.getLogger('psysmon')
     logger.setLevel('DEBUG')
     logger.addHandler(psysmon.getLoggerHandler(log_level = 'DEBUG'))
     cls.packages_path = os.path.dirname(os.path.abspath(__file__))
     cls.packages_path = os.path.join(cls.packages_path, 'packages')
     cls.data_path = os.path.dirname(os.path.abspath(__file__))
     cls.data_path = os.path.join(cls.data_path, 'data')
Exemplo n.º 4
0
    def setUpClass(cls):
        print "In setUpClass...\n"
        logger = logging.getLogger('psysmon')
        logger.setLevel('DEBUG')
        logger.addHandler(psysmon.getLoggerHandler())

        cls.packages_path = os.path.dirname(os.path.abspath(__file__))
        cls.packages_path = os.path.join(cls.packages_path, 'packages')
Exemplo n.º 5
0
    def setUpClass(cls):
        cls.data_path = os.path.dirname(os.path.abspath(__file__))
        cls.data_path = os.path.join(cls.data_path, 'data')

        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('INFO')
        cls.logger.addHandler(psysmon.getLoggerHandler(log_level = 'INFO'))
Exemplo n.º 6
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('DEBUG')
        logger.addHandler(psysmon.getLoggerHandler())

        cls.data_path = os.path.dirname(os.path.abspath(__file__))
        cls.data_path = os.path.join(cls.data_path, 'data')
Exemplo n.º 7
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('DEBUG')
        logger.addHandler(psysmon.getLoggerHandler())

        cls.psybase = create_psybase()
        cls.project = create_full_project(cls.psybase)
        print "In setUpClass...\n"
Exemplo n.º 8
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('INFO')
        logger.addHandler(psysmon.getLoggerHandler())

        # Create an empty project.
        cls.psybase = create_psybase()
        cls.project = create_empty_project(cls.psybase)
        cls.project.dbEngine.echo = False
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('DEBUG')
        logger.addHandler(psysmon.getLoggerHandler())

        clean_unittest_database()

        cls.psybase = create_psybase()
        create_full_project(cls.psybase)
        cls.project = cls.psybase.project
        cls.project.dbEngine.echo = True
Exemplo n.º 10
0
    def setUpClass(cls):
        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('DEBUG')
        cls.logger.addHandler(psysmon.getLoggerHandler())

        # Clean the unittest database.
        test_util.clean_unittest_database()

        # Create the test project.
        cls.psybase = test_util.create_psybase()
        cls.project = test_util.create_full_project(cls.psybase)
Exemplo n.º 11
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('DEBUG')
        logger.addHandler(psysmon.getLoggerHandler())

        cls.data_path = os.path.dirname(os.path.abspath(__file__))
        cls.data_path = os.path.join(cls.data_path, 'data')

        cls.psybase = create_psybase()
        cls.project = create_empty_project(cls.psybase)
        cls.project.dbEngine.echo = True
Exemplo n.º 12
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('INFO')
        logger.addHandler(psysmon.getLoggerHandler())

        # Set the data path.
        cls.data_path = os.path.dirname(os.path.abspath(__file__))
        cls.data_path = os.path.join(cls.data_path, 'data')

        # Create an empty project.
        cls.psybase = create_psybase()
        cls.project = create_full_project(cls.psybase)
        cls.project.dbEngine.echo = False
Exemplo n.º 13
0
    def setUpClass(cls):
        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('DEBUG')
        cls.logger.addHandler(psysmon.getLoggerHandler(log_level='DEBUG'))

        drop_database_tables(db_dialect='mysql',
                             db_driver=None,
                             db_host='localhost',
                             db_name='psysmon_unit_test',
                             db_user='******',
                             db_pwd='test',
                             project_name='unit_test')

        cls.psybase = create_psybase()
        cls.project = create_empty_project(cls.psybase)
        cls.project.dbEngine.echo = False
Exemplo n.º 14
0
def run():
    if len(sys.argv) <= 2:
        print("At least 2 arguments required (project_file, username).\n")
        sys.exit()

    project_file = sys.argv[1]
    user_name = sys.argv[2]

    if len(sys.argv) == 4:
        user_pwd = sys.argv[3]
    else:
        user_pwd = ''

    logger = logging.getLogger('psysmon')
    logger.setLevel(psysmon.logConfig['level'])
    logger.addHandler(psysmon.getLoggerHandler())

    remove_project(project_file, user_name, user_pwd)
Exemplo n.º 15
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('INFO')
        logger.addHandler(psysmon.getLoggerHandler())

        test_util.drop_database_tables(db_dialect='mysql',
                                       db_driver=None,
                                       db_host='localhost',
                                       db_name='psysmon_unit_test',
                                       db_user='******',
                                       db_pwd='test',
                                       project_name='unit_test')

        cls.psybase = test_util.create_psybase()
        test_util.create_full_project(cls.psybase)
        cls.project = cls.psybase.project
        cls.project.dbEngine.echo = False
        logger.setLevel('DEBUG')
Exemplo n.º 16
0
    def setUpClass(cls):
        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('DEBUG')
        cls.logger.addHandler(psysmon.getLoggerHandler())

        # Create the test signal.
        sps = 100.
        f = 10.
        t = np.arange(0, 5, old_div(1, sps))
        win = psysmon.core.signal.tukey(len(t), 0.3)
        x_linear = np.sin(2 * np.pi * f * t) * win
        y_linear = np.zeros(len(x_linear))
        z_linear = x_linear.copy()

        x_circ = np.sin(2 * np.pi * f * t) * win
        y_circ = np.zeros(x_circ.shape)
        z_circ = np.sin(2 * np.pi * f * t + np.pi / 2.) * win

        x_ellip = np.sin(2 * np.pi * f * t + np.pi / 4.) * win
        y_ellip = np.zeros(x_ellip.shape)
        z_ellip = np.cos(2 * np.pi * f * t) * win

        x_toro = np.sin(2 * np.pi * f * t) * win
        y_toro = np.cos(2 * np.pi * f * t) * win
        z_toro = np.sin(2 * np.pi * 40. * t) * win

        x_rand = np.random.rand(len(t))
        x_rand = x_rand - np.mean(x_rand)
        x_rand = old_div(x_rand, np.abs(x_rand))
        y_rand = np.random.rand(len(t))
        y_rand = y_rand - np.mean(y_rand)
        y_rand = old_div(y_rand, np.abs(y_rand))
        z_rand = np.random.rand(len(t))
        z_rand = z_rand - np.mean(z_rand)
        z_rand = old_div(z_rand, np.abs(z_rand))

        cls.signal_x = np.hstack((x_linear, x_circ, x_ellip, x_toro, x_rand))
        cls.signal_y = np.hstack((y_linear, y_circ, y_ellip, y_toro, y_rand))
        cls.signal_z = np.hstack((z_linear, z_circ, z_ellip, z_toro, z_rand))
        cls.time = np.arange(0, old_div(len(cls.signal_x), sps),
                             old_div(1, sps))
Exemplo n.º 17
0
def prepare_project(test_case):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel(psysmon.logConfig['level'])
        logger.addHandler(psysmon.getLoggerHandler())

        # Get the pSysmon base directory.
        psyBaseDir = '/home/stefan/01_gtd/04_aktuelleProjekte/pSysmon/01_src/psysmon/lib/psysmon/'
        psyBaseDir = os.path.dirname(psyBaseDir)

        # Initialize the pSysmon base object.
        psyBase = Base(psyBaseDir)
        #psyBase.scan4Package()

        # Load the pSysmon test project.
        path = "/home/stefan/01_gtd/04_aktuelleProjekte/pSysmon/03_pSysmonProjects/test/test.ppr"
        psyBase.loadPsysmonProject(path)

        # Quest for the user and the database password.
        psyBase.project.setActiveUser('stefan','')

        # Load the database structure of the project packages.
        psyBase.project.loadDatabaseStructure(psyBase.packageMgr.packages)

        # Create the project waveclient.
        waveclient = PsysmonDbWaveClient('main client', psyBase.project)
        psyBase.project.addWaveClient(waveclient)
        waveclient = EarthwormWaveClient('earthworm localhost')
        psyBase.project.addWaveClient(waveclient)
        test_case.app =psygui.PSysmonApp()

        nodeTemplate = psyBase.packageMgr.getCollectionNodeTemplate('tracedisplay')
        test_case.node = copy.deepcopy(nodeTemplate)
        test_case.node.project = psyBase.project

        # Create the node logger. This is usually done in the collection.
        loggerName = __name__ + "." + test_case.node.__class__.__name__
        test_case.node.logger = logging.getLogger(loggerName)
Exemplo n.º 18
0
 def setUpClass(cls):
     # Configure the logger.
     logger = logging.getLogger('psysmon')
     logger.setLevel('DEBUG')
     logger.addHandler(psysmon.getLoggerHandler(log_level = 'DEBUG'))
Exemplo n.º 19
0
 def setUpClass(cls):
     # Configure the logger.
     logger = logging.getLogger('psysmon')
     logger.setLevel('INFO')
     logger.addHandler(psysmon.getLoggerHandler())