This module contains the ProductionSystem class – the cornerstone of the application.
A class that provides high-level control over an FCI-7011 fiber coupler production system (the device). Each instance of this class wraps a DeviceInterface object (which handles the communication with the device) and complements the low-level functionality it provides with a number of high-level services:
Instances hold calibration data for the device. If this calibration data is complete, clients can interact with the device in terms of heating temperatures rather than temperature sensor voltages and heating currents by using its temperature property and startHeatingToTemperature() method. The calibration data itself is stored in a CalibrationData object, and can be accessed using the calibrationData property.
The necessary data can be gathered by performing a calibration procedure, which requires the application’s user to take a series of temperature measurements, and may take several hours. A calibration procedure can be started by calling startCalibration(). See the documentation for ops.calibration.manager for further information
To check whether an instance has a complete set of calibration data for its device, use isCalibrated.
Instances monitor the device’s temperature and temperature sensor voltage. If either exceeds its safe limits (maxSafeTemperature and maxSafeTemperatureSensorVoltage, respectively), the instance is switched into its safe mode. In safe mode, the device’s heating current is set to heatingCurrentInSafeMode, and the instance’s isInSafeMode flag is set. The instance leaves safe mode when a new new heating procedure is started.
Instances can be locked. While an instance is locked, clients cannot perform any operations on the device without providing the appropriate key. This ensures that different operations do not interfere with each other.
To lock or unlock an instance, use the lock() and unlock() methods. To check whether an instance is locked, use the isLocked property.
An ops.simulation.SimulatedDeviceInterface object can be substituted for the DeviceInterface in order to test the application without using an actual device.
Instantiates a new instance of this class.
mediator is used to set mediator.
interface is the DeviceInterface the instance uses to communicate with the device it controls, a SimulatedDeviceInterface, or None, in which case a new SimulatedDeviceInterface object is used.
Locks the instance with the given key. While it is locked, clients cannot perform any operations on the device without providing the appropriate key.
Any object other than None may be used as the key. If the instance is already locked, a SystemLockedError is raised.
A CalibrationData object that holds the resuts of the calibration procedure of the device the instance controls.
May be modified, but the new calibration data object may not be currently used by another ProductionSystem (that is, its system property must be None), or an ApplicationError is raised.
Starts a calibration procedure. currents is a list of the heating currents (in mA) for which measurements are to be taken. The actual work is done by ops.calibration.manager.CalibrationManager. See that class for further documentation.
This method is asynchronous. The calibration procedure itself may take several hours to complete, but the method returns immediately.
The instance is locked for the duration of the calibration procedure. If the instance is already locked when this method is called, a SystemLockedError is raised.
During the calibration procedure, the application’s user needs to be available to take a series of temperature measurements.
See also
Switches the instance into its safe mode. In safe mode, the device’s heating current is set to heatingCurrentInSafeMode, and the instance’s isInSafeMode flag is set. The instance leaves safe mode when a new new heating procedure is started.
Calling this method on a locked instance does not require a key; operations must be able to deal with the fact that the instance may unexpectedly enter safe mode while they are running. Entering safe mode does not unlock the instance, however.
The voltage reported by the temperature sensor, in V. Read-only.
In most cases, clients will want to use temperature instead.
Note
If the heater is not in its foremost position (see heaterPosition), the returned voltage will not be an accurate reflection of the heater’s temperature. If the user has moved the temperature sensor aside, it will be unrelated to the heater’s temperature.
The heating temperature that corresponds to the measured temperature sensor voltage, in °C, or None if the device isn’t calibrated. Read-only.
Note
The returned temperature is only accurate if the temperature sensor can get an accurate reading. If the heater is not in its foremost position (see heaterPosition), the returned temperature will be inaccurate. If the user has moved the temperature sensor aside, it will be unrelated to the actual heating temperature.
The temperature the heater is being heated to, in °C, or None if it is not being heated to a particular temperature.
Read-only. To change the target temperature, or start heating towards a particular temperature, use the startHeatingToTemperature() method.
Changing the heating current using startHeatingWithCurrent() resets this property to None.
The lowest target temperature that can be passed to startHeatingToTemperature(), in °C, or None if the device is not calibrated.
The value is equal to the lowest temperature measured during the calibration procedure. Read-only.
The highest target temperature that can be passed to startHeatingToTemperature(), in °C, or None if the device is not calibrated.
The value is equal to the lowest of maxSafeTemperature, the temperature that can be reached with a heating current equal to maxHeatingCurrent, or the highest temperature measured during the calibration procedure. Read-only.
Indicates whether the given temperature (in °C) can be passed to startHeatingToTemperature(), that is, whether it lies between minTargetTemperature and maxTargetTemperature.
If the device is not calibrated, a NotCalibratedError is raised.
Sets the device’s heating current to current, in mA. Also clears the isInSafeMode flag and sets targetTemperature to None.
If the instance is locked, the appropriate key must be passed, otherwise a SystemLockedError is raised. If the wrong key is passed, a WrongKeyError is raised. If a key is passed even though the instance is not locked, a SystemNotLockedError is raised.
If current is negative or exceeds maxHeatingCurrent, an InvalidHeatingCurrentError is raised.
Sets the device’s heating current to a value that should result in the heater reaching, but not exceeding, targetTemperature, in °C. The device must be calibrated for this method to be usable. Also clears the isInSafeMode flag and sets targetTemperature to targetTemperature.
If the instance is locked, the appropriate key must be passed, otherwise a SystemLockedError is raised. If the wrong key is passed, a WrongKeyError is raised. If a key is passed even though the instance is not locked, a SystemNotLockedError is raised.
If the device is not calibrated, a NotCalibratedError is raised.
If targetTemperature is less than minTargetTemperature or greater then maxTargetTemperature, an InvalidTargetTemperatureError is raised.
The temperature sensor is not used by the heating procedure started by this method at all. The current used is determined from the temperature measurements taken during the calibration procedure, and no second-guessing based on the temperature sensor voltages reported during the heating procedure takes place. This means this method is not affected by the issues mentioned in the documentation for the temperature property.
This method is asynchronous. It will take some time for the heater to reach the target temperature, but the method will return immediately.
Sets the device’s heating current to heatingCurrentWhileIdle.
If the instance is locked, the appropriate key must be passed, otherwise a SystemLockedError is raised. If the wrong key is passed, a WrongKeyError is raised. If a key is passed even though the instance is not locked, a SystemNotLockedError is raised.
The position the heater is supposed to be at, as a fraction of the distance between rearmost position (0.0) and foremost position (1.0).
If heaterTargetPosition is not equal to heaterPosition, the heater is still moving to its target position.
Read-only. To change the heater’s target position, use the startHeaterMovement() method.
Moves the heater to the given position, expressed as a fraction of the distance between rearmost position (0.0) and foremost position (1.0).
If the instance is locked, the appropriate key must be passed, otherwise a SystemLockedError is raised. If the wrong key is passed, a WrongKeyError is raised. If a key is passed even though the instance is not locked, a SystemNotLockedError is raised.
If targetPosition is less than 0.0 or greater than 1.0, an InvalidHeaterPositionError is raised.
This method is asynchronous. Moving the heater can take several seconds, but this method returns immediately.
To check which position the heater is currently moving to, use heaterTargetPosition; to get its actual position use heaterPosition.
The factor by which all operations performed with the device are sped up. Setting this property to, say, 5.0 greatly reduces the time required to test the application. Mutable.
This property is intended for testing purposes only. If the instance wraps a real DeviceInterface, any attempt to acess it raises a RequiresSimulationError.
Creates a CalibrationData object using the parameters of the SimulatedDeviceInterface used by the instance, and assigns it to calibrationData. Unlike a real calibration procedure, magic calibration is instant. The CalibrationManager is not used.
This method is intended for testing purposes only. If the instance wraps a real DeviceInterface, this method raises a RequiresSimulationError.
Magic calibration will generate measurements for heating currents starting at heatingCurrentWhileIdle and increasing in steps of 2 mA until they would exceed maxHeatingCurrent or the temperature sensor voltage reached with this current would exceed maxSafeTemperatureSensorVoltage.