CDBClient¶
-
public class
CDBClient
extends PythonAdapter¶ Jython-based adapter of python CDBClient. Threading: Each thread should acquire an instance of this class using getInstance(). Multiple calls in one thread result in returning the same object. There is no need of closing the connections, it happens automatically in garbage collector (this is forced when we run out of connections). However, you should not pass reference to one instance among different threads (if you cannot assure the threads will not use it concurrently). The methods map to Client/DAQClient python methods as closely as possible. Several methods have overloaded versions: 1) a totally generic one that accepts ParameterList (a “dictionary” of values) 2,…) more specific versions with frequently used sets of parameters. See pyCDB documentation.
Author: pipek
Methods¶
FS2CDB_ref¶
createComputer¶
createDAQChannel¶
createDAQChannel¶
-
public void
createDAQChannel
(ParameterList parameters)¶
createGenericSignal¶
createGenericSignal¶
-
public void
createGenericSignal
(ParameterList parameters)¶
createGenericSignalWhichReturnsLong¶
createGenericSignalWhichReturnsLong¶
-
public Long
createGenericSignalWhichReturnsLong
(ParameterList parameters)¶
createRecord¶
deleteSignal¶
-
public void
deleteSignal
(ParameterList parameters)¶
finalize¶
-
public void
finalize
()¶ Even if finalize is not always called, try to close the connection.
findGenericSignals¶
-
public List<GenericSignal>
findGenericSignals
(String aliasOrName, boolean useRegexp)¶
getAttachment¶
-
public ChannelAttachment
getAttachment
(long genericSignalId)¶
getAttachmentTable¶
-
public List<ChannelAttachment>
getAttachmentTable
(ParameterList parameters)¶
getAttachmentTable¶
-
public ChannelAttachment
getAttachmentTable
(long computerId, long boardId, long channelId)¶
getDataFile¶
-
public DataFile
getDataFile
(ParameterList parameters)¶
getFSSignal¶
-
public GenericSignal
getFSSignal
(String nodeId, String hardwareId, String parameterId)¶ Get current generic signal attached to node, board & parameter.
Returns: null if not found. Use Firesignal names.
getGenericSignal¶
-
public GenericSignal
getGenericSignal
(long genericSignalId)¶
getGenericSignal¶
-
public GenericSignal
getGenericSignal
(String strid)¶
getGenericSignals¶
-
public List<GenericSignal>
getGenericSignals
(ParameterList parameters)¶
getGenericSignals¶
-
public List<GenericSignal>
getGenericSignals
(String strid)¶
getInstance¶
-
public static synchronized CDBClient
getInstance
()¶ Get CDB client specific for current thread. It can serve a few hundred connections before problem arises. However, at that moment, there is a slight pause during which we try to close all unused connections (by hinting garbage connection) and obtain the connection for the second time. Only after this it eventually fails. Note: you should not pass CDBClient instances among threads or undefined behaviour results. But it is possible if you know what you are doing (e.g. in FS database controller).
Returns: null if not connected.
getInstance¶
-
public static synchronized CDBClient
getInstance
(ParameterList parameters)¶ Get CDB Client with specific construction parameters.
Parameters: - parameters – (host, user, passwd, db, port, log_level, data_root). If any of the parameters is not specified, default value (from env. variables, etc.) is taken. Warning: This version of constructor is not recommended for general use. It doesn’t use any clever method of preserving connections, memory, thread safety etc.
getRecordNumberFromFSEvent¶
getSignal¶
-
public Signal
getSignal
(ParameterList parameters)¶
getSignalCalibration¶
-
public SignalCalibration
getSignalCalibration
(String strId)¶
getSignalCalibration¶
-
public SignalCalibration
getSignalCalibration
(ParameterList parameters)¶
getSignalParameters¶
-
public SignalParameters
getSignalParameters
(ParameterList parameters)¶
getSignalReference¶
-
public SignalReference
getSignalReference
(long recordNumber, long genericSignalId, long revision)¶
getSignalReference¶
-
public SignalReference
getSignalReference
(long recordNumber, long genericSignalId)¶
getSignalReferences¶
-
public List<SignalReference>
getSignalReferences
(ParameterList parameters)¶
insert¶
insert¶
-
public Long
insert
(String tableName, ParameterList fields)¶
newDataFile¶
-
public DataFile
newDataFile
(ParameterList parameters)¶
newDataFile¶
storeLinearSignal¶
-
public SignalReference
storeLinearSignal
(long genericSignalId, long recordNumber, double time0, double coefficient, double offset)¶ Store signal of type LINEAR.
storeSignal¶
-
public SignalReference
storeSignal
(ParameterList parameters)¶
storeSignal¶
-
public SignalReference
storeSignal
(long genericSignalId, long recordNumber, String dataFileKey, long dataFileId, double time0, double coefficient, double offset, double coefficient_V2unit)¶ Store signal of type FILE. Underlying Python method ensures that computer, board and channel ids are correctly set.
storeSignal¶
updateSignal¶
-
public void
updateSignal
(ParameterList parameters)¶ Update signal.
Parameters: - parameters – As few parameters as needed.