Skip to content

MockModel attributes #167

@peendebak

Description

@peendebak

The MockModel is now a subclass of ServerManager. Is this necessary?
The result is that most methods of a MockModel do not work as expected.

One can use the .ask and .write methods, but the other attributes of a MockModel are not updated. For example

from toymodel import AModel, MockGates, MockSource, MockMeter, AverageGetter, AverageAndRaw

model = AModel()
gates = MockGates('gates', model=model)
meter = MockMeter('meter', model=model)

print('model._gates %s' % (model._gates, ))
print('model.gates_get(c0) %s' % (model.gates_get('c0') ))
print('chan0: %f'  % gates.chan0.get() )
print('meter.amplitude: %f'  % meter.amplitude.get() )

gates.chan0.set(2)

print('model._gates %s' % (model._gates, ))
print('model.gates_get(c0) %s' % (model.gates_get('c0') ))
print('chan0: %f'  % gates.chan0.get() )
print('meter.amplitude: %f'  % meter.amplitude.get() )

After setting gates.chan0 the model in the server is updated, but the model._gates and model.gates_get('c0') are not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions