quarchpy.connection_specific package¶
Subpackages¶
Submodules¶
quarchpy.connection_specific.connection_QIS module¶
- class quarchpy.connection_specific.connection_QIS.QisInterface(host='127.0.0.1', port=9722, connectionMessage=True)¶
Bases:
object
- GetQisModuleSelection(favouriteOnly=True, additionalOptions=[], scan=True)¶
- averageStripes(leftover, streamAverage, newStripes, f, remainingStripes=[])¶
- avgStringFromPwr(avgPwrTwo)¶
- closeConnection(sock=None, conString=None)¶
- connect(connectionMessage=True)¶
Connect() tries to open a socket on the host and port specified in the objects variables If successful it returns the backends welcome string. If it fails it returns a string saying unable to connect The backend should be running and host and port set before running this function. Normally it should be called at the beggining of talking to the backend and left open until finished talking when the disconnect() function should be ran
Param: connectionMessage: boolean, optional
Set to False if you don’t want a warning message to appear when an instance is already running on that port. Useful when using isQisRunning() from qisFuncs
- convertStreamAverage(streamAveraging)¶
- deviceDictSetup(module)¶
- deviceMulti(device)¶
- disconnect()¶
- getDeviceList(sock=None)¶
- getStreamXmlHeader(device, sock=None)¶
- interruptList()¶
- isXmlHeader(headerText)¶
- qis_scan_devices(scan=True, favouriteOnly=True)¶
- rxBytes(sock)¶
- scanIP(ipAddress)¶
Triggers QIS to look at a specific IP address for a quarch module
- Parameters
QisConnection (QpsInterface) – The interface to the instance of QPS you would like to use for the scan.
ipAddress (str) – The IP address of the module you are looking for eg ‘192.168.123.123’
sleep (int, optional) – This optional variable sleeps to allow the network to scan for the module before allowing new commands to be sent to QIS.
- sendAndReceiveCmd(sock=None, cmd='$help', device='', readUntilCursor=True, betweenCommandDelay=0.0)¶
- sendAndReceiveText(sock, sentText='$help', device='', readUntilCursor=True)¶
- sendCmd(device='', cmd='$help', sock=None, readUntilCursor=True, betweenCommandDelay=0.0, expectedResponse=True)¶
- sendText(sock, message='$help', device='')¶
- sortFavourite(foundDevices)¶
- startStream(module, fileName, fileMaxMB, streamName, streamAverage, releaseOnData, separator)¶
- startStreamThread(module, fileName, fileMaxMB, streamName, streamAverage, releaseOnData, separator)¶
- stopStream(module, blocking=True)¶
- streamBufferStatus(device, sock=None)¶
- streamGetStripesText(sock, device, numStripes=4096, skipStatusCheck=False)¶
- streamHeaderAverage(device, sock=None)¶
- streamHeaderFormat(device, sock=None)¶
- streamHeaderVersion(device, sock=None)¶
- streamInterrupt()¶
- streamRunningStatus(device, sock=None)¶
- waitStop()¶
quarchpy.connection_specific.connection_QPS module¶
- class quarchpy.connection_specific.connection_QPS.QpsInterface(host='127.0.0.1', port=9822)¶
Bases:
object
- closeConnection(conString=None)¶
- connect(targetDevice)¶
- disconnect(targetDevice)¶
- getDeviceList(scan=True)¶
- recv()¶
- scanIP(ipAddress, sleep=10)¶
Triggers QPS to look at a specific IP address for a quarch module
- Parameters
QpsConnection (QpsInterface) – The interface to the instance of QPS you would like to use for the scan.
ipAddress (str) – The IP address of the module you are looking for eg ‘192.168.123.123’
sleep (int, optional) – This optional variable sleeps to allow the network to scan for the module before allowing new commands to be sent to QPS.
- send(data)¶
- sendCmdVerbose(cmd, timeout=300)¶
quarchpy.connection_specific.connection_ReST module¶
quarchpy.connection_specific.connection_Serial module¶
- class quarchpy.connection_specific.connection_Serial.SerialConn(ConnTarget)¶
Bases:
object
- close()¶
- sendCommand(Command, expectedResponse=True)¶
- quarchpy.connection_specific.connection_Serial.serial_read_until(Port, Char, Timeout)¶
quarchpy.connection_specific.connection_TCP module¶
quarchpy.connection_specific.connection_Telnet module¶
quarchpy.connection_specific.connection_USB module¶
- class quarchpy.connection_specific.connection_USB.TQuarchUSB_IF(context)¶
Bases:
object
- BulkRead()¶
- BulkReadEP(ep, n)¶
- BulkReadEPTout(ep, n, timeOut)¶
- BulkReadN(n)¶
- CheckComms()¶
- ClosePort()¶
- DebugDump()¶
- FetchCmdReply()¶
- FetchCmdReplyTOut(timeout)¶
- GetExtendedInfo()¶
- GetIdn()¶
- GetLastError()¶
- GetSerialNumber()¶
- IsPortOpen()¶
- OpenPort()¶
- RunCommand(command, expectedResponse=True)¶
- SendCommand(command)¶
- SetTimeout(timeout)¶
- VerboseSendCmd(cmd)¶
- WriteZeroPacketCmd()¶
- clean_and_flush_stuck_usb_comms()¶
USB comms can become stuck if a command is sent out too quickly after the end of the previous one If this is the case, the module response buffer contains data which needs flushed. This command triggers a buffer return and performs a full read of all data. If possible, it returns the response of the previous command which caused the stuck buffer.
- lockUSBStr = '\x02\x00\x00\x01\x04\x01'¶
- unlockUSBStr = '\x02\x00\x00\x01\x03\x00'¶
- quarchpy.connection_specific.connection_USB.USB(SerID='')¶
- class quarchpy.connection_specific.connection_USB.USBConn(ConnTarget)¶
Bases:
object
- close()¶
- sendCommand(Command, expectedResponse=True)¶
- quarchpy.connection_specific.connection_USB.getUSBDeviceSerialNo(context, device)¶
- quarchpy.connection_specific.connection_USB.importUSB(version='None')¶