Example #1
0
	Then, draw_table is called to append the table values to the interface (later, this method may be called to refresh screen)
	Values and header info is are hardcoded here and in ConsoleInterface declaration, respectively.

"""

from table import Table
from interface import ConsoleInterface

data = Table('data')

time = ['19:00:32', '19:00:32', '19:00:33', '19:00:34']
temp = ['23.0', '23.0', '23.0', '23.0']
fbar = ['0.0', '12.0', '87.2', '0.0']
ilux = ['60.1', '69.1', '62.1', '62.1']

console = ConsoleInterface(data)  # binds data table to interface object
console.init_interface()  # prints header


def build_rows(ptime, ptemp, pfbar, pilux):
    rows = []
    if len(ptime) == len(ptemp) == len(pfbar) == len(pilux):
        for x, val in enumerate(ptime):
            rows.append([ptime[x], ptemp[x], pfbar[x], pilux[x]])
    else:
        print 'ERROR: Data values not the same lenght.'

    return rows


data.add_rows(build_rows(time, temp, fbar, ilux))
Example #2
0
    #temp_values = [float(y) for y in m_temp]
    #fbar_values = [float(y) for y in m_fbar]
    #lint_values = [float(y) for y in m_lint]

    row = [str(m_time), m_temp, m_fbar, m_lint]  #data are float values

    return row


#### Code itself ####

# Objects declaration
ard = SerialArduino(port, baud_rate)
txt = FileHandler(user_file)
dat = Table('data')
cli = ConsoleInterface(dat)  # binds data table to interface object

cli.init_interface()  # prints header
op = cli.start_menu()

if op.upper() == 'Y':
    #cli.setup_interface()
    user_file = raw_input('Type TXT file name: ')
    txt.set_name(user_file)

    cli.show_warning('Hit Ctrl-C to stop acquisition')
    cli.getch()

    ### !!! BIG INCONSISTENCY RIGHT HERE !!!

    ard.write('C0')  # stops Arduino just in case
Example #3
0
    # temp_values = [float(y) for y in m_temp]
    # fbar_values = [float(y) for y in m_fbar]
    # lint_values = [float(y) for y in m_lint]

    row = [str(m_time), m_temp, m_fbar, m_lint]  # data are float values

    return row


#### Code itself ####

# Objects declaration
ard = SerialArduino(port, baud_rate)
txt = FileHandler(user_file)
dat = Table("data")
cli = ConsoleInterface(dat)  # binds data table to interface object

cli.init_interface()  # prints header
op = cli.start_menu()

if op.upper() == "Y":
    # cli.setup_interface()
    user_file = raw_input("Type TXT file name: ")
    txt.set_name(user_file)

    cli.show_warning("Hit Ctrl-C to stop acquisition")
    cli.getch()

    ### !!! BIG INCONSISTENCY RIGHT HERE !!!

    ard.write("C0")  # stops Arduino just in case
Example #4
0
	Then, draw_table is called to append the table values to the interface (later, this method may be called to refresh screen)
	Values and header info is are hardcoded here and in ConsoleInterface declaration, respectively.

"""

from table import Table
from interface import ConsoleInterface

data = Table("data")

time = ["19:00:32", "19:00:32", "19:00:33", "19:00:34"]
temp = ["23.0", "23.0", "23.0", "23.0"]
fbar = ["0.0", "12.0", "87.2", "0.0"]
ilux = ["60.1", "69.1", "62.1", "62.1"]

console = ConsoleInterface(data)  # binds data table to interface object
console.init_interface()  # prints header


def build_rows(ptime, ptemp, pfbar, pilux):
    rows = []
    if len(ptime) == len(ptemp) == len(pfbar) == len(pilux):
        for x, val in enumerate(ptime):
            rows.append([ptime[x], ptemp[x], pfbar[x], pilux[x]])
    else:
        print "ERROR: Data values not the same lenght."

    return rows


data.add_rows(build_rows(time, temp, fbar, ilux))