示例#1
0
def build_sparse():
    """
    This builds a quick mock sparse datastore with 100 values for each
    discrete, coils, holding, and input bits/registers.
    """
    data = {
        'di' : sparblock([bool(x) for x in range(1, 100)]),
        'ci' : sparblock([bool(not x) for x in range(1, 100)]),
        'hr' : sparblock([int(x) for x in range(1, 100)]),
        'ir' : sparblock([int(2*x) for x in range(1, 100)]),
    }
    return data
示例#2
0
def build_sparse():
    """
    This builds a quick mock sparse datastore with 100 values for each
    discrete, coils, holding, and input bits/registers.
    """
    data = {
        'di': sparblock([bool(x) for x in range(1, 100)]),
        'ci': sparblock([bool(not x) for x in range(1, 100)]),
        'hr': sparblock([int(x) for x in range(1, 100)]),
        'ir': sparblock([int(2 * x) for x in range(1, 100)]),
    }
    return data