本文整理汇总了Python中PyQt4.QtCore.qCritical方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.qCritical方法的具体用法?Python QtCore.qCritical怎么用?Python QtCore.qCritical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore
的用法示例。
在下文中一共展示了QtCore.qCritical方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: got_packet
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qCritical [as 别名]
def got_packet(self, packet):
if packet.stream_idx != self.channel:
return
samples = packet.samples
interval = packet.sample_interval_seconds
pi = self.plotWidget.getPlotItem()
x_range = len(samples) * interval
if x_range != self._last_x_range:
self._last_x_range = x_range
pi.setRange(xRange=(0, self._last_x_range), padding = 0)
self._add_extra_items_from_dict()
if self._use_trigger():
try:
samples = samples[packet.trigger_offset:]
except IndexError:
QtC.qCritical('Invalid trigger offset {} (have: {} samples)'.
format(packet.trigger_offset, len(samples)))
sample_times = np.linspace(0, (len(samples) - 1) * interval, len(samples))
self._plot_curve.setData(sample_times, samples)
示例2: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qCritical [as 别名]
def __init__(self, zmq_ctx, host_addr, resource):
QtC.QObject.__init__(self)
self.resource = resource
self._zmq_ctx = zmq_ctx
self._host_addr = host_addr
self._pending_rpc_request = None
self._rpc_request_queue = []
self._active_stream_sockets = {}
self._reg_idx_to_object = {}
self._rpc_socket = qtzmq.Socket(zmq_ctx, zmq.REQ)
self._rpc_socket.received_msg.connect(
lambda m: QtC.qCritical(
'Unhandled message on RPC socket: {}'.format(m)))
self._rpc_socket.error.connect(self._socket_error)
self._rpc_socket.connect(self._remote_endpoint(resource.port))
self._heartbeat_send_timer = QtC.QTimer()
self._heartbeat_send_timer.timeout.connect(self._send_heartbeat)
self._heartbeat_timeout_timer = QtC.QTimer()
self._heartbeat_timeout_timer.timeout.connect(self._heartbeat_timed_out)
self._stream_ports = []
self._stream_subscriber_count = {}
self._stream_acquisition_config = None
self._invoke_rpc('notificationPort', [], self._got_notification_port)
示例3: createPositionsList
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qCritical [as 别名]
def createPositionsList(self):
""" Populates the _positions list.
If the route is invalid, it leaves the _positions list empty.
Also completes the _directions map, with obvious directions."""
cur = self._positions[0].next()
it = 1
while not cur.isOut():
if cur == self._positions[-1]:
return True
self._positions.insert(it, cur)
it += 1
if cur.trackItem.tiType.startswith("P"):
if cur.previousTI == cur.trackItem.normalItem:
self._directions[cur.trackItem.tiId] = 0
elif cur.previousTI == cur.trackItem.reverseItem:
self._directions[cur.trackItem.tiId] = 1
elif cur.previousTI == cur.trackItem.commonItem \
and cur.trackItem.tiId not in self._directions:
self._directions[cur.trackItem.tiId] = 0
cur = cur.next(0, self._directions.get(cur.trackItem.tiId, -1))
QtCore.qCritical(self.tr("Invalid route %i. "
"Impossible to link beginSignal with endSignal"
% self.routeNum))
return False