QP/C API 参考

QP/C API 链接:QP/C API Reference


API Reference


QEP (Hierarchical State Machines)

QEP is a universal, UML-compliant event processor that enables developers to code UML state machines in highly readable ANSI-C, in which every state machine element is mapped to code precisely, unambiguously, and exactly once (traceability). QEP fully supports hierarchical state nesting, which is the fundamental mechanism for reusing behavior across many states instead of repeating the same actions and transitions over and over again.

Hierarchical State Machines

QF (Active Object Framework)

QF is a portable, event-driven, real-time framework for execution of active objects (concurrent state machines) specifically designed for real-time embedded (RTE) systems.

Active Objects

Publish-Subscribe

Dynamic Events

Time Events

Event Queues (raw thread-safe)

Memory Pools

QS ("Quantum Spy" Software Tracing)

QS is a software tracing system that enables developers to monitor live event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code. QS is an ideal tool for testing, troubleshooting, and optimizing QP applications. QS can even be used to support acceptance testing in product manufacturing.

QS Initialization and Control

QS Receive-Channel (QS-RX)

QS Filters

QS Dictionaries

QS Application-Specific Records

QV (Cooperative Kernel)

QV is a simple cooperative kernel (previously called "Vanilla" kernel). This kernel executes active objects one at a time, with priority-based scheduling performed before processing of each event. Due to naturally short duration of event processing in state machines, the simple QV kernel is often adequate for many real-time systems.

The QV scheduler is engaged after every RTC step of any active object to choose the next active object to execute. The QV scheduler always chooses the highest-priority active object that has any events in its event queue. The QV scheduler then extracts the next event from this queue and dispatches it to the state machine associated with the active object. The state machine runs to completion, after which the QV scheduler runs and the cycle repeats.

Please note that because the state machines always return to the QV scheduler after each RTC step, a single stack can be used to process all state machines (memory-friendly architecture).

The QV scheduler can also very easily detect when all event queues are empty, at which point it can call the idle callback to let the application put the CPU and peripherals to a low-power sleep mode (power-friendly architecture).

Given the simplicity, portability, and low-resource consumption, the QV scheduler is very attractive. It allows you to partition the problem into active objects and execute these active objects orderly. The task-level response of this scheduler is the longest RTC step in the whole system, but because event-driven active objects don’t block, the RTC steps tend to be very short (typically just a few microseconds). Also, often you can break up longer RTC steps into shorter pieces, by posting an event to self and returning (“Reminder” state pattern). The self-posted event then triggers the continuation of longer processing.

Kernel Initialization and Control

QK (Preemptive Run-to-Completion Kernel)

QK is a tiny preemptive, priority-based, non-blocking kernel designed specifically for executing active objects. QK runs active objects in the same way as prioritized interrupt controller (such as NVIC in ARM Cortex-M) runs interrupts using the single stack. Active objects process their events in run-to-completion (RTC) fashion and remove themselves from the call stack, the same way as nested interrupts remove themselves from the stack upon completion. At the same time high-priority active objects can preempt lower-priority active objects, just like interrupts can preempt each other under a prioritized interrupt controller. QK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis RMA) and can be used in hard real-time systems.

Kernel Initialization and Control

Interrupt Management

QXK (Preemptive Dual-Mode RTOS Kernel)

QXK is a small, preemptive, priority-based, dual-mode blocking kernel that executes active objects like the QK kernel, but can also execute traditional blocking threads (extended threads). In this respect, QXK behaves exactly as a conventional RTOS (Real-Time Operating System). QXK has been designed specifically for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.

Kernel Initialization and Control

Interrupt Management

Extended Thread Management

Semaphores

Mutexes

Message Queues

Memory Pools

Thread-Local Storage

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
本文档是QT中文版本 内容详尽,下面是片段 信号 void activated ( int id ) 静态公有成员 QKeySequence shortcutKey ( const QString & str ) QString keyToString ( QKeySequence k ) (obsolete) QKeySequence stringToKey ( const QString & s ) (obsolete) 保护成员 virtual bool eventFilter ( QObject * o, QEvent * e ) -------------------------------------------------------------------------------- 详细描述 QAccel类用来处理键盘的加速键和快捷键。 键盘加速键是在某个组合键按下的时候出发一个动作,加速键可以处理窗口部件和它子部件里所有的键盘动作所以它不会被键盘焦点所影响。 在大多数情况下,你不需要直接使用这个类。使用QAction类建立的具有加速键的动作可以同时在菜单和工具栏里使用。如果你的兴趣只是在菜单里使用QMenuData::insertItem()或者QMenuData::setAccel()建立只作用在菜单里的加速键。那么许多窗口部件可以自动的生成加速键,比如QButton、QGroupBox、QLabel(使用QLabel::setBuddy())、QMenuBar和QTabBar。实例: QPushButton p( "&Exit", parent ); // 自动使用快捷键ALT+Key_E QPopupMenu *fileMenu = new fileMenu( parent ); fileMenu->insertItem( "Undo", parent, SLOT(undo()), CTRL+Key_Z ); QAccel包括一个加速键的列表,这个列表里的项目可以使用insertItem()、removeItem()、clear()、key()和findKey()。 每一个加速键项目是由一个标示符和 QKeySequence组成。一个单独的键组是由一个键盘码组合上改变符形成的(SHIFT,CTRL,ALT 或者 UNICODE_ACCEL)。例如,CTRL + Key_p可以作为文本打印的快捷键。这个键的键盘码在qnamespace.h里列出。还有,使用UNICODE_ACCEL可以使字符以统一码(unicode)的形式表现出来。例如 UNICODE_ACCEL + 'A' 所给出的加速键和Key_A是一样的。
DPP是Differential Pulse Code Modulation(差分脉冲编码调制)的缩写,在视频编码中常用于编码预测误差,以减少数据量和提高压缩效率。下面对QP/C中的DPP例程进行讲解: DPP的编码过程如下: 1.读取当前帧和参考帧的像素数据。 2.将参考帧的像素数据与当前帧的像素数据进行差分运算,得到预测误差。 3.对预测误差进行量化,得到量化误差。 4.对量化误差进行熵编码,得到二进制码流。 DPP的解码过程如下: 1.读取参考帧的像素数据。 2.对二进制码流进行熵解码,得到量化误差。 3.对量化误差进行反量化,得到预测误差。 4.将参考帧的像素数据与预测误差进行加和,得到当前帧的像素数据。 在QP/C中,DPP的编码和解码实现都在"DPP.C"文件中。其中,编码函数为"DppEncode",解码函数为"DppDecode"。 DppEncode函数的参数包括:当前帧的像素数据、参考帧的像素数据、图像宽度和高度、量化参数。 DppEncode函数的实现过程如下: 1.通过调用"GetDiff"函数,得到预测误差。 2.通过调用"Quantize"函数,对预测误差进行量化,得到量化误差。 3.通过调用"WriteCode"函数,对量化误差进行熵编码,得到二进制码流。 DppDecode函数的参数包括:参考帧的像素数据、图像宽度和高度、量化参数、二进制码流。 DppDecode函数的实现过程如下: 1.通过调用"ReadCode"函数,对二进制码流进行熵解码,得到量化误差。 2.通过调用"Dequantize"函数,对量化误差进行反量化,得到预测误差。 3.通过将参考帧的像素数据与预测误差进行加和,得到当前帧的像素数据。 综上所述,DPP在视频编码中起到了重要的作用,能够有效地减少数据量和提高压缩效率。在QP/C中,DPP的实现也相对简单,通过差分运算、量化、熵编码和反量化等步骤,实现了对预测误差的编码和解码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值