hlp:桂林国际齿轮泵代码
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'dlgselectinputlanguage.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 4.8.5
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_DLGSELECTINPUTLANGUAGE_H
|
||||
#define UI_DLGSELECTINPUTLANGUAGE_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QRadioButton>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_DlgSelectInputLanguage
|
||||
{
|
||||
public:
|
||||
QWidget *gridLayoutWidget;
|
||||
QGridLayout *gridLayout;
|
||||
QRadioButton *radioButtonChinese;
|
||||
QRadioButton *radioButtonEnglish;
|
||||
QRadioButton *radioButtonVietnam;
|
||||
|
||||
void setupUi(QDialog *DlgSelectInputLanguage)
|
||||
{
|
||||
if (DlgSelectInputLanguage->objectName().isEmpty())
|
||||
DlgSelectInputLanguage->setObjectName(QString::fromUtf8("DlgSelectInputLanguage"));
|
||||
DlgSelectInputLanguage->resize(291, 162);
|
||||
DlgSelectInputLanguage->setFocusPolicy(Qt::StrongFocus);
|
||||
gridLayoutWidget = new QWidget(DlgSelectInputLanguage);
|
||||
gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget"));
|
||||
gridLayoutWidget->setGeometry(QRect(20, 10, 241, 131));
|
||||
gridLayout = new QGridLayout(gridLayoutWidget);
|
||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||
gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
radioButtonChinese = new QRadioButton(gridLayoutWidget);
|
||||
radioButtonChinese->setObjectName(QString::fromUtf8("radioButtonChinese"));
|
||||
|
||||
gridLayout->addWidget(radioButtonChinese, 0, 0, 1, 1);
|
||||
|
||||
radioButtonEnglish = new QRadioButton(gridLayoutWidget);
|
||||
radioButtonEnglish->setObjectName(QString::fromUtf8("radioButtonEnglish"));
|
||||
|
||||
gridLayout->addWidget(radioButtonEnglish, 1, 0, 1, 1);
|
||||
|
||||
radioButtonVietnam = new QRadioButton(gridLayoutWidget);
|
||||
radioButtonVietnam->setObjectName(QString::fromUtf8("radioButtonVietnam"));
|
||||
|
||||
gridLayout->addWidget(radioButtonVietnam, 2, 0, 1, 1);
|
||||
|
||||
|
||||
retranslateUi(DlgSelectInputLanguage);
|
||||
|
||||
QMetaObject::connectSlotsByName(DlgSelectInputLanguage);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QDialog *DlgSelectInputLanguage)
|
||||
{
|
||||
DlgSelectInputLanguage->setWindowTitle(QApplication::translate("DlgSelectInputLanguage", "Dialog", 0, QApplication::UnicodeUTF8));
|
||||
radioButtonChinese->setText(QApplication::translate("DlgSelectInputLanguage", "\346\261\211\350\257\255(Chinese)", 0, QApplication::UnicodeUTF8));
|
||||
radioButtonEnglish->setText(QApplication::translate("DlgSelectInputLanguage", "\350\213\261\350\257\255(English)", 0, QApplication::UnicodeUTF8));
|
||||
radioButtonVietnam->setText(QApplication::translate("DlgSelectInputLanguage", "\350\266\212\345\215\227\350\257\255(Vietnam)", 0, QApplication::UnicodeUTF8));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class DlgSelectInputLanguage: public Ui_DlgSelectInputLanguage {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_DLGSELECTINPUTLANGUAGE_H
|
||||
@@ -0,0 +1,119 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'MemDisplayAndEdit.h'
|
||||
**
|
||||
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.5)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../MemDisplayAndEdit.h"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'MemDisplayAndEdit.h' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 63
|
||||
#error "This file was generated using the moc from 4.8.5. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_MemDisplayAndEdit[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
9, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
24, 19, 18, 18, 0x08,
|
||||
66, 18, 18, 18, 0x08,
|
||||
95, 18, 18, 18, 0x08,
|
||||
125, 18, 18, 18, 0x08,
|
||||
153, 18, 18, 18, 0x08,
|
||||
185, 18, 18, 18, 0x08,
|
||||
217, 18, 18, 18, 0x08,
|
||||
245, 18, 18, 18, 0x08,
|
||||
278, 18, 18, 18, 0x08,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_MemDisplayAndEdit[] = {
|
||||
"MemDisplayAndEdit\0\0arg1\0"
|
||||
"on_comboBoxBaseAddress_activated(QString)\0"
|
||||
"on_radioButtonRead_pressed()\0"
|
||||
"on_radioButtonWrite_pressed()\0"
|
||||
"on_pushButtonEdit_pressed()\0"
|
||||
"on_pushButtonLastPage_pressed()\0"
|
||||
"on_pushButtonNextPage_pressed()\0"
|
||||
"onLineEditEditingFinished()\0"
|
||||
"on_lineEditDec_editingFinished()\0"
|
||||
"on_lineEditHex_editingFinished()\0"
|
||||
};
|
||||
|
||||
void MemDisplayAndEdit::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Q_ASSERT(staticMetaObject.cast(_o));
|
||||
MemDisplayAndEdit *_t = static_cast<MemDisplayAndEdit *>(_o);
|
||||
switch (_id) {
|
||||
case 0: _t->on_comboBoxBaseAddress_activated((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 1: _t->on_radioButtonRead_pressed(); break;
|
||||
case 2: _t->on_radioButtonWrite_pressed(); break;
|
||||
case 3: _t->on_pushButtonEdit_pressed(); break;
|
||||
case 4: _t->on_pushButtonLastPage_pressed(); break;
|
||||
case 5: _t->on_pushButtonNextPage_pressed(); break;
|
||||
case 6: _t->onLineEditEditingFinished(); break;
|
||||
case 7: _t->on_lineEditDec_editingFinished(); break;
|
||||
case 8: _t->on_lineEditHex_editingFinished(); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData MemDisplayAndEdit::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject MemDisplayAndEdit::staticMetaObject = {
|
||||
{ &QWidget::staticMetaObject, qt_meta_stringdata_MemDisplayAndEdit,
|
||||
qt_meta_data_MemDisplayAndEdit, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &MemDisplayAndEdit::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *MemDisplayAndEdit::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *MemDisplayAndEdit::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_MemDisplayAndEdit))
|
||||
return static_cast<void*>(const_cast< MemDisplayAndEdit*>(this));
|
||||
if (!strcmp(_clname, "ParaSettingUI"))
|
||||
return static_cast< ParaSettingUI*>(const_cast< MemDisplayAndEdit*>(this));
|
||||
return QWidget::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int MemDisplayAndEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QWidget::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 9)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 9;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
@@ -0,0 +1,391 @@
|
||||
/*
|
||||
* PrintTextDisplay.cpp
|
||||
*
|
||||
* Created on: Jul 9, 2013
|
||||
* Author: yiyu
|
||||
* QQ:1036184468
|
||||
* Descriptoin:
|
||||
|
||||
*/
|
||||
|
||||
#include "PrintTextDisplay.h"
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <QBrush>
|
||||
#include <QPaintEvent>
|
||||
#include <QDebug>
|
||||
#include <QColor>
|
||||
#include <QRect>
|
||||
#include "Public.h"
|
||||
#include <QChar>
|
||||
#include<string>
|
||||
#include<iostream>
|
||||
|
||||
PrintTextDisplay::PrintTextDisplay(QWidget *parent):
|
||||
QWidget(parent){
|
||||
setPalette(QPalette(Qt::white));
|
||||
setAutoFillBackground(true);
|
||||
scaleRatio = 2;
|
||||
origWidth = 0;
|
||||
origHeight = 0;
|
||||
setAttribute(Qt::WA_OpaquePaintEvent,true); //背景不自动重画
|
||||
updateDigitalOnly = false;
|
||||
}
|
||||
|
||||
PrintTextDisplay::~PrintTextDisplay(){
|
||||
|
||||
}
|
||||
|
||||
void PrintTextDisplay::updateSysParaToUI(){
|
||||
|
||||
}
|
||||
|
||||
void PrintTextDisplay::updateSysStatusToUI(){
|
||||
updateDigitalOnly = true;
|
||||
update(); //表示只更新变量而已,该区域一定要包含实际的打印区域,否则显示不出来
|
||||
}
|
||||
|
||||
void PrintTextDisplay::enlargeDisplay(){
|
||||
if(scaleRatio < 10){
|
||||
scaleRatio ++;
|
||||
resize(scaleRatio*origWidth,scaleRatio*origHeight);
|
||||
update();
|
||||
|
||||
}
|
||||
}
|
||||
void PrintTextDisplay::scroll_update()
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
void PrintTextDisplay::reduceDisplay(){
|
||||
if(scaleRatio > 1){
|
||||
scaleRatio --;
|
||||
resize(scaleRatio*origWidth,scaleRatio*origHeight);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
//#define H02 2
|
||||
//#define H04 4
|
||||
|
||||
void PrintTextDisplay::setDisplaySize(int w,int h){
|
||||
origHeight = h;
|
||||
|
||||
origWidth = w;
|
||||
|
||||
resize(scaleRatio*origWidth,scaleRatio*(origHeight));
|
||||
}
|
||||
void PrintTextDisplay::setScaleRatio(int ratio)
|
||||
{
|
||||
if(ratio > 1)
|
||||
{
|
||||
if(ratio > 10) ratio =10;
|
||||
scaleRatio =ratio;
|
||||
resize(scaleRatio*origWidth,scaleRatio*origHeight);
|
||||
update();
|
||||
}
|
||||
}
|
||||
void PrintTextDisplay::paintEvent(QPaintEvent *event){
|
||||
QRect updateRect = event->rect();
|
||||
//2019/11/11 prevent pic shadow
|
||||
updateRect.setY(0);
|
||||
|
||||
static int r_altermode=-1;
|
||||
|
||||
if(sysPara)
|
||||
{
|
||||
QPainter p(this);
|
||||
p.scale(scaleRatio,scaleRatio);
|
||||
p.setPen(Qt::NoPen);
|
||||
|
||||
if(sysPara->para.AlterMode!=r_altermode) updateDigitalOnly=false;
|
||||
r_altermode=sysPara->para.AlterMode;
|
||||
//if(!updateDigitalOnly)
|
||||
{ //尽量减少不必要的刷屏动作
|
||||
|
||||
int x = updateRect.x()/scaleRatio;
|
||||
int end_x = (( sysPara->status.addSpace?2:1)*(updateRect.x() + updateRect.width())/scaleRatio) + 1;
|
||||
int w= end_x - x;
|
||||
int y = updateRect.y()/scaleRatio;
|
||||
int end_y = (updateRect.y() + updateRect.height())/scaleRatio + 1;
|
||||
int h = end_y - y;;
|
||||
p.setBrush(QColor(Qt::white));
|
||||
int y0=0;
|
||||
if(sysPara->para.AlterMode<2) y0=0;
|
||||
|
||||
else if(sysPara->para.AlterMode==2) y0=y;
|
||||
|
||||
if(sysPara->status.addSpace)
|
||||
p.drawRect(x>>1,y0,w/2,h);
|
||||
else
|
||||
p.drawRect(x,y0,w,h);
|
||||
|
||||
p.setBrush(QColor(Qt::green));
|
||||
|
||||
if(sysPara->para.AlterMode<2)
|
||||
{
|
||||
|
||||
}
|
||||
else if(sysPara->para.AlterMode==2)
|
||||
{
|
||||
y = end_y;
|
||||
end_y = end_y+h;
|
||||
}
|
||||
//qDebug()<<"updateRect"<<updateRect.x()<<updateRect.y()<<w<<h<<end_x<<x;
|
||||
unsigned char *dat;
|
||||
bool MaxCol4000;
|
||||
if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1)
|
||||
MaxCol4000 = false;
|
||||
else
|
||||
MaxCol4000 = true;
|
||||
if(MaxCol4000){
|
||||
dat =sysPara->status.printDat_Normal;
|
||||
}else{
|
||||
dat =sysPara->status.printDat;
|
||||
}
|
||||
for(int i = 0; i < h && (i +y)< MAX_PRINT_ROW_NUM; i ++){
|
||||
for(int j = x; j < end_x && j < (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide); j++){
|
||||
if(dat[j*MAX_PRINT_ROW_BYTE_NUM + (i+y)/8] & (1<<((i+y)%8))){
|
||||
if(sysPara->status.addSpace){
|
||||
p.drawRect(j/2,i+y0,1,1);j++;
|
||||
}
|
||||
else
|
||||
p.drawRect(j,i+y0,1,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//sysPara->para.qrOption.DisplayUpdate=1;
|
||||
// 二维码显示
|
||||
//if(sysPara->para.qrOption.DisplayUpdate==1)
|
||||
if(sysPara->para.qrOption.DisplayUpdate==1 && sysPara->print.QRvars[0].type != BAR) //lich fix
|
||||
{
|
||||
sysPara->para.qrOption.DisplayUpdate=0;
|
||||
int varNum=0;
|
||||
for( varNum=0;varNum<sysPara->status.QRvariNum;varNum++){
|
||||
int x = sysPara->print.QRvars[varNum].startColPos;
|
||||
int w = sysPara->print.QRvars[varNum].width;
|
||||
int end_x = x+w;
|
||||
int h = sysPara->print.QRvars[varNum].height;
|
||||
int end_y=sysPara->print.QRvars[varNum].endRowPos;
|
||||
int y = sysPara->print.QRvars[varNum].startRowPos;
|
||||
p.setBrush(QColor(Qt::white));
|
||||
|
||||
//p.drawRect(x,y,w,h);
|
||||
if(sysPara->status.addSpace)
|
||||
p.drawRect(x/2,y,w,h);
|
||||
else
|
||||
p.drawRect(x,y,w,h);
|
||||
|
||||
p.setBrush(QColor(Qt::black));
|
||||
// p.setBrush(QColor(Qt::green));
|
||||
//qDebug()<<"PrintfTextDiaplay:"<<x<<y<<end_x<<end_y;
|
||||
unsigned char *dat;
|
||||
bool MaxCol4000;
|
||||
if(!sysPara->status.flagOfNo67FPGA && sysPara->status.FPGAVersionType == 0 && sysPara->status.FPGAChipType != 1)
|
||||
MaxCol4000 = false;
|
||||
else
|
||||
MaxCol4000 = true;
|
||||
if(MaxCol4000){
|
||||
dat =sysPara->status.printDat_Normal;
|
||||
}else{
|
||||
dat =sysPara->status.printDat;
|
||||
}
|
||||
for(int i = y; i < end_y && (i +y)< MAX_PRINT_ROW_NUM; i ++){
|
||||
for(int j = x; j < end_x && j < (MaxCol4000?MAX_PRINT_COL_NUM_Normal:MAX_PRINT_COL_NUM_Wide); j++){
|
||||
if(dat[j*MAX_PRINT_ROW_BYTE_NUM + (i)/8] & (1<<((i)%8))){
|
||||
//p.drawRect(j,i,1,1);
|
||||
if(sysPara->status.addSpace){
|
||||
p.drawRect(j>>1,i,1,1);//j++;
|
||||
}
|
||||
else
|
||||
p.drawRect(j,i,1,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
for(int i = 0; i < sysPara->status.ExpiryVarNum; i++){
|
||||
int x,w,end_x,h,end_y,y;
|
||||
if(i == 0)
|
||||
{
|
||||
if(sysPara->print.CurDateVar.type = CURDATE)
|
||||
{
|
||||
x = sysPara->print.CurDateVar.startColPos;
|
||||
w = sysPara->print.CurDateVar.width;
|
||||
end_x = x+w;
|
||||
h = sysPara->print.CurDateVar.height;
|
||||
end_y = sysPara->print.CurDateVar.endRowPos;
|
||||
y = sysPara->print.CurDateVar.startRowPos;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// 变量显示
|
||||
for(int i = 0; i < sysPara->status.variNum; i++){
|
||||
vars_t *p_var = &sysPara->status.vars[i];
|
||||
int val = p_var->currVal;
|
||||
//val = 6569;
|
||||
int x = p_var->startColPos;
|
||||
int y = p_var->startRowPos;
|
||||
int rowDiff = p_var->endRowPos - p_var->startRowPos;
|
||||
int digitalNum = p_var->digitalNum;
|
||||
|
||||
if(sysPara->para.AlterMode==2){
|
||||
if(y<sysPara->status.currAlterPrintRow) continue;
|
||||
y = p_var->startRowPos-sysPara->status.currAlterPrintRow-1;
|
||||
|
||||
}
|
||||
|
||||
else if(sysPara->para.AlterMode==1){
|
||||
|
||||
if(y>=sysPara->status.currAlterPrintRow) continue;
|
||||
|
||||
}
|
||||
int base = 1; int j=0,jmin=0;
|
||||
QString str="";
|
||||
int Num=0;
|
||||
|
||||
if(digitalNum<=8 || Public::getType(p_var->type) < 9 || p_var->type == 37 || p_var->type == 38 \
|
||||
|| Public::getType(p_var->type) == 13 || Public::getType(p_var->type) == 14 || Public::getType(p_var->type) == 15) // 0-8 变量 显示刷新
|
||||
{
|
||||
for(int j = 0; j < digitalNum;j ++){
|
||||
if(val>base-1)jmin=digitalNum-j-1;
|
||||
base *= 10;
|
||||
}
|
||||
str= QString("%1").arg(val%base,digitalNum,10,QLatin1Char('0'));
|
||||
|
||||
//20240626: 以下3个判断条件为处理计米显示小数点位数,最多可显示3位
|
||||
if(!sysPara->para.rrr_nc && sysPara->para.printNumPoint && p_var->type == 7)
|
||||
{
|
||||
val /= 1000;
|
||||
str= QString("%1").arg(val%base,digitalNum,10,QLatin1Char('0'));
|
||||
str.insert(str.length()-1,".");
|
||||
str.remove(0,1);
|
||||
|
||||
}
|
||||
else if(sysPara->para.rrr_nc && !sysPara->para.printNumPoint && p_var->type == 7)
|
||||
{
|
||||
val /= 100;
|
||||
str= QString("%1").arg(val%base,digitalNum,10,QLatin1Char('0'));
|
||||
str.insert(str.length()-2,".");
|
||||
str.remove(0,1);
|
||||
}
|
||||
else if(sysPara->para.rrr_nc && sysPara->para.printNumPoint && p_var->type == 7)
|
||||
{
|
||||
val /= 10;
|
||||
str= QString("%1").arg(val%base,digitalNum,10,QLatin1Char('0'));
|
||||
str.insert(str.length()-3,".");
|
||||
str.remove(0,1);
|
||||
}
|
||||
else if(sysPara->status.specialVarPrint.MeterEnable && p_var->type == 15)
|
||||
{
|
||||
str.remove(0,1);
|
||||
str += "m";
|
||||
}
|
||||
}
|
||||
|
||||
else { // 大于 9 是什么变量呢? 随机数 显示刷新
|
||||
base = 1; j=0,jmin=0;
|
||||
for(int j = 0; j < 8;j ++){
|
||||
if(val>base-1)jmin=8-j-1;
|
||||
base *= 10;
|
||||
}
|
||||
str= QString("%1").arg(val%base,8,10,QLatin1Char('0'));
|
||||
val = QString::number( sysPara->status.calandar_and_dat.RandomValue2 ,16).toInt();
|
||||
Num = digitalNum-8;
|
||||
base = 1;
|
||||
jmin=0;
|
||||
for(int j = 0; j < Num;j ++){
|
||||
if(val>base-1)jmin=Num-j-1;
|
||||
base *= 10;
|
||||
}
|
||||
str= QString("%1").arg(val%base,Num,10,QLatin1Char('0'))+str;
|
||||
}
|
||||
|
||||
|
||||
if(!sysPara->para.Cnt1NatureValue) jmin=0;
|
||||
|
||||
p.setBrush(QColor(Qt::white));
|
||||
if(sysPara->status.addSpace)
|
||||
p.drawRect(x/2,y,p_var->width/2,p_var->height);
|
||||
else p.drawRect(x,y,p_var->width,p_var->height);
|
||||
|
||||
//p.setBrush(QColor(Qt::red));//之前都是红色
|
||||
if(p_var->type==7 || p_var->type==37 || p_var->type==57|| p_var->type==67) p.setBrush(QColor(Qt::black));//变量1
|
||||
else if(p_var->type==8 || p_var->type==38 || p_var->type==58 || p_var->type==68) p.setBrush(QColor(Qt::blue));//变量2
|
||||
else if(p_var->type==13) p.setBrush(QColor(Qt::red));//变量3
|
||||
else p.setBrush(QColor(Qt::red)); //其他
|
||||
|
||||
|
||||
|
||||
|
||||
QChar *qchar = str.data();
|
||||
int charWidth;
|
||||
if(sysPara->para.flagOfModuleDecimal || sysPara->para.flagOfModuleHide)
|
||||
charWidth = p_var->datWidth/13;
|
||||
else
|
||||
charWidth = p_var->datWidth/10;
|
||||
|
||||
for( j = jmin; j < digitalNum; j++){
|
||||
int digitalIndex;
|
||||
if(!sysPara->para.rrr_nc && sysPara->para.printNumPoint && p_var->type == 7 && j == (digitalNum-2))
|
||||
{
|
||||
digitalIndex = 10;
|
||||
}
|
||||
else if(sysPara->para.rrr_nc && !sysPara->para.printNumPoint && p_var->type == 7 && j == (digitalNum-3))
|
||||
{
|
||||
digitalIndex = 10;
|
||||
}
|
||||
else if(sysPara->para.rrr_nc && sysPara->para.printNumPoint && p_var->type == 7 && j == (digitalNum-4))
|
||||
{
|
||||
digitalIndex = 10;
|
||||
}
|
||||
else if(sysPara->status.specialVarPrint.MeterEnable && p_var->type == 15 && j == (digitalNum-1))
|
||||
{
|
||||
digitalIndex = 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
digitalIndex = qchar[j].toAscii() - '0';
|
||||
}
|
||||
unsigned char *pAaddr = p_var->dat + (digitalIndex*charWidth)*p_var->rowByteNum;
|
||||
|
||||
for(int k = 0; k < rowDiff; k++){
|
||||
for(int l = 0; l < charWidth; l++){
|
||||
if(pAaddr[l*p_var->rowByteNum + k/8] & (1<<(k%8))){
|
||||
//p.drawRect(x + j*charWidth + l,y + k,1,1);
|
||||
if(sysPara->status.addSpace){
|
||||
p.drawRect((x + j*charWidth + l)/2,y + k,1,1);l++;
|
||||
}
|
||||
else
|
||||
p.drawRect(x + j*charWidth + l,y + k,1,1);
|
||||
#ifdef DEBUG3
|
||||
printf("0");
|
||||
}
|
||||
else
|
||||
printf(".");
|
||||
}
|
||||
printf("\n");
|
||||
#else
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
updateDigitalOnly = false;
|
||||
// update();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user