Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/shimadzucbm20.py: 0%

67 statements  

« prev     ^ index     » next       coverage.py v7.6.5, created at 2024-11-15 02:12 +0000

1# -*- coding: utf-8 -*- 

2from marshmallow import Schema, fields 

3 

4from daiquiri.core.hardware.abstract import HardwareObject 

5from daiquiri.core.schema.hardware import HardwareSchema 

6from daiquiri.core.schema.validators import RequireEmpty 

7 

8import logging 

9 

10logger = logging.getLogger(__name__) 

11 

12 

13class VolumeParameters(Schema): 

14 volume = fields.Float() 

15 rate = fields.Float() 

16 

17 

18class PressureParameters(Schema): 

19 pmin = fields.Float() 

20 pmax = fields.Float() 

21 

22 

23class VialParameters(Schema): 

24 vial = fields.Float() 

25 vol = fields.Float() 

26 runtime = fields.Int() 

27 

28 

29class ShimadzuCBM20PumpSchema(Schema): 

30 on = fields.Boolean() 

31 flow_rate = fields.Float() 

32 min_pressure = fields.Float() 

33 max_pressure = fields.Float() 

34 port = fields.String() 

35 

36 

37class ShimadzuCBM20AutoSamplerSchema(Schema): 

38 on = fields.Boolean() 

39 temperature = fields.Float() 

40 temperature_setpoint = fields.Float() 

41 

42 

43class ShimadzuCBM20AutoPurgeSchema(Schema): 

44 on = fields.Boolean() 

45 

46 

47class ShimadzuCBM20StateSchema(Schema): 

48 pump = fields.Nested(ShimadzuCBM20PumpSchema, metadata={"readOnly": True}) 

49 auto_purge = fields.Nested( 

50 ShimadzuCBM20AutoPurgeSchema, metadata={"readOnly": True} 

51 ) 

52 auto_sampler = fields.Nested( 

53 ShimadzuCBM20AutoSamplerSchema, metadata={"readOnly": True} 

54 ) 

55 inject_from_vial = fields.Nested( 

56 VialParameters, metadata={"readOnly": True, "many": False} 

57 ) 

58 system_state = fields.Int(metadata={"readOnly": True}) 

59 

60 

61class ShimadzuCBM20CallablesSchema(HardwareSchema): 

62 connect_cbm20 = RequireEmpty(metadata={"readOnly": True}) 

63 disconnect_cbm20 = RequireEmpty(metadata={"readOnly": True}) 

64 start_pump = RequireEmpty(metadata={"readOnly": True}) 

65 stop_pump = RequireEmpty(metadata={"readOnly": True}) 

66 set_pump_max_pressure = fields.Float(metadata={"readOnly": True}) 

67 set_pump_min_pressure = fields.Float(metadata={"readOnly": True}) 

68 set_pump_flow = fields.Float(metadata={"readOnly": True}) 

69 set_pump_flow_threshold = fields.Float(metadata={"readOnly": True}) 

70 

71 set_flow_mode = fields.String(metadata={"readOnly": True}) 

72 select_solenoid_valve = fields.String(metadata={"readOnly": True}) 

73 

74 start_auto_purge = RequireEmpty(metadata={"readOnly": True}) 

75 stop_auto_purge = RequireEmpty(metadata={"readOnly": True}) 

76 inject_from_vial = fields.Nested( 

77 VialParameters, metadata={"readOnly": True, "many": False} 

78 ) 

79 stop_inject = RequireEmpty(metadata={"readOnly": True}) 

80 set_auto_sampler_temp = fields.Float(metadata={"readOnly": True}) 

81 pump_from_port = fields.String(metadata={"readOnly": True}) 

82 enable_auto_sampler = RequireEmpty(metadata={"readOnly": True}) 

83 disable_auto_sampler = RequireEmpty(metadata={"readOnly": True}) 

84 

85 

86class DataValueSchema(Schema): 

87 xdata = fields.List(fields.Float(), metadata={"many": True}) 

88 ydata = fields.List(fields.Float(), metadata={"many": True}) 

89 

90 

91class ShimadzuCBM20DataSchema(Schema): 

92 channels = fields.List(fields.String(), metadata={"many": True}) 

93 pressure = fields.Nested(DataValueSchema, metadata={"many": False}) 

94 flow_rate = fields.Nested(DataValueSchema, metadata={"many": False}) 

95 

96 

97class ShimadzuCBM20PropertiesSchema(HardwareSchema): 

98 state = fields.Nested(ShimadzuCBM20StateSchema, metadata={"readOnly": True}) 

99 data = fields.Nested(ShimadzuCBM20DataSchema, metadata={"readOnly": True}) 

100 

101 

102class ShimadzuCBM20(HardwareObject): 

103 _type = "shimadzucbm20" 

104 

105 _callables = ShimadzuCBM20CallablesSchema() 

106 _properties = ShimadzuCBM20PropertiesSchema()