hlp:桂林国际齿轮泵代码
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
|
||||
#ifndef MYINCLUDE_H
|
||||
#define MYINCLUDE_H
|
||||
#define FXCHG // FPGA 交替打印
|
||||
#define VARBOLD // 变量加粗
|
||||
#define SYS_LINUX 1
|
||||
#define TXTFILE 0
|
||||
#define PICFILE 1
|
||||
#define SCENE 2
|
||||
//#define _VX_ 1
|
||||
|
||||
#ifdef SYS_LINUX
|
||||
#define SYS_ROOT_DIR "/home/plg/"
|
||||
#else
|
||||
#define SYS_ROOT_DIR "./"
|
||||
#endif
|
||||
#include "qnamespace.h"
|
||||
|
||||
#define RANDDEBUG // 随机码导出功能
|
||||
#define SYNLENFLOAT // 支持小数喷印间隔
|
||||
|
||||
#define MIMA // 使用密码功能
|
||||
// #define VARCOLOR // 设置变量为字符型
|
||||
//
|
||||
#define CABLEUSER // 20140426 电缆用户
|
||||
|
||||
//#define UART1 // 手持机see namespace.h
|
||||
|
||||
//#define UART2 // 手持机see namespace.h
|
||||
|
||||
#ifdef UART2
|
||||
#define SOFTWARE_VER_NUM "R3.09" //支持16位ALT , 支持 UART2
|
||||
#else
|
||||
#define SOFTWARE_VER_NUM "A3.09"
|
||||
#endif
|
||||
|
||||
#ifdef CABLEUSER
|
||||
#define TST " Cables"
|
||||
#define FPAG_INIT_MAGIC_NUM 0x58 //用来判断是否读fpga成功
|
||||
#else
|
||||
#define TST " 管材行业"
|
||||
#define FPAG_INIT_MAGIC_NUM 0x53 //用来判断是否读fpga成功
|
||||
#endif
|
||||
|
||||
//#define DEBUG1
|
||||
//#define DEBUG2 // show maxMM
|
||||
#define MYSAVEFILEDLG // 定义自己的保存文件对话框,解决系统对话框按键不弹起问题
|
||||
|
||||
#ifdef __VX__
|
||||
#define __STC_POWER__ //使用STC 单片机当作电源管理
|
||||
#define __ADC_INPUT__ //使用AIN接口检测机箱温度/墨水温度
|
||||
#define __NETWORKMANAGER__ //使用网络功能
|
||||
#define __VX_OSC_VOL__ //使用网络功能
|
||||
#define LANINTERFACE_NAME "eth0"
|
||||
//#define __RFID_CARD
|
||||
//#define __com_485_
|
||||
//#define EnableArabic //界面语言切换为英文生效
|
||||
//#define EnableBangla
|
||||
|
||||
#endif
|
||||
#define TEST_MODE 0 //测试模式
|
||||
#define SIMULATE_PRINTING_MODE 0 //模拟打印模式
|
||||
|
||||
//按客户区分项目代号宏
|
||||
//#define PROJECT_PLC1 //成都周君的项目,PLC发送2位数字打印内容,转换7点左横和右横进行打印,项目代号PLC1
|
||||
|
||||
#ifdef __CONVERTERWIFI__
|
||||
#define __NETWORKMANAGER__ //使用网络功能
|
||||
#define LANINTERFACE_NAME "eth0"
|
||||
#endif
|
||||
|
||||
#ifdef __2451WIFI__
|
||||
#define LANINTERFACE_NAME "eth0"
|
||||
#endif
|
||||
#define __HV_FOR_WANG_DEBUG__
|
||||
|
||||
#define __FPGA_DEBUG__ // FPGA调试界面
|
||||
// 打开:使用的是旧管路 关闭:使用新管路
|
||||
//#define __AIR_RELEASE_OLD__
|
||||
|
||||
#define __DAC_ADJ_FUNCTION__ // 使用电压调整功能
|
||||
//#define __DAC_FOR_5DOT__ // 确定5点阵的电压
|
||||
//#define __DAC_FOR_7DOT__ // 确定7点阵的电压,机器一致性不解决,确定固定的电压无意义
|
||||
//#define __2_LINE_DAC_ // 使用2行 7x5 点阵,总共16点阵
|
||||
#define __2_LINE_DAC_FOR_DENG // 等总两行, 怡宝, 说第二行的第一个点电压降低
|
||||
|
||||
//#define ENCRYPT_VOL
|
||||
enum CRYS_FREQ{
|
||||
CRYS_64K,
|
||||
CRYS_76K,
|
||||
CRYS_96K,
|
||||
CRYS_128K
|
||||
};
|
||||
|
||||
//#define CRYS_64K 0
|
||||
//#define CRYS_76K 1
|
||||
//#define CRYS_83K 2
|
||||
//#define CRYS_96K 3
|
||||
//#define CRYS_128K 4
|
||||
enum PRINT_MODE{
|
||||
FAST_PRINT,
|
||||
STANDARD_PRINT,
|
||||
SLOW_PRINT_ONE,
|
||||
SLOW_PRINT_TWO,
|
||||
SLOW_PRINT_THR,
|
||||
SLOW_PRINT_FOR,
|
||||
SLOW_PRINT_FIV,
|
||||
SLOW_PRINT_SIX,
|
||||
SLOW_PRINT_SEV,
|
||||
SLOW_PRINT_EIG,
|
||||
SLOW_PRINT_NIE
|
||||
};
|
||||
|
||||
#endif
|
||||
// MYINCLUDE_H
|
||||
/*
|
||||
20140627:
|
||||
再改这功能,同步器状态下,不打印走米打钩时一直计米,取消打钩时按停止打印按钮不计米,按打印按钮一直计米与故障无关。
|
||||
目前1-都计米,2-高压故障时不计米,其它计米。
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* wpa_gui - AddInterface class
|
||||
* Copyright (c) 2008, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include "common/wpa_ctrl.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "wpagui.h"
|
||||
#include "addinterface.h"
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef WPA_KEY_ROOT
|
||||
#define WPA_KEY_ROOT HKEY_LOCAL_MACHINE
|
||||
#endif
|
||||
#ifndef WPA_KEY_PREFIX
|
||||
#define WPA_KEY_PREFIX TEXT("SOFTWARE\\wpa_supplicant")
|
||||
#endif
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
|
||||
AddInterface::AddInterface(WpaGui *_wpagui, QWidget *parent)
|
||||
: QDialog(parent), wpagui(_wpagui)
|
||||
{
|
||||
setWindowTitle(tr("Select network interface to add"));
|
||||
resize(400, 200);
|
||||
vboxLayout = new QVBoxLayout(this);
|
||||
|
||||
interfaceWidget = new QTreeWidget(this);
|
||||
interfaceWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
interfaceWidget->setUniformRowHeights(true);
|
||||
interfaceWidget->setSortingEnabled(true);
|
||||
interfaceWidget->setColumnCount(3);
|
||||
interfaceWidget->headerItem()->setText(0, tr("driver"));
|
||||
interfaceWidget->headerItem()->setText(1, tr("interface"));
|
||||
interfaceWidget->headerItem()->setText(2, tr("description"));
|
||||
interfaceWidget->setItemsExpandable(FALSE);
|
||||
interfaceWidget->setRootIsDecorated(FALSE);
|
||||
vboxLayout->addWidget(interfaceWidget);
|
||||
|
||||
connect(interfaceWidget,
|
||||
SIGNAL(itemActivated(QTreeWidgetItem *, int)), this,
|
||||
SLOT(interfaceSelected(QTreeWidgetItem *)));
|
||||
|
||||
addInterfaces();
|
||||
}
|
||||
|
||||
|
||||
void AddInterface::addInterfaces()
|
||||
{
|
||||
#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
struct wpa_ctrl *ctrl;
|
||||
int ret;
|
||||
char buf[2048];
|
||||
size_t len;
|
||||
|
||||
ctrl = wpa_ctrl_open(NULL);
|
||||
if (ctrl == NULL)
|
||||
return;
|
||||
|
||||
len = sizeof(buf) - 1;
|
||||
ret = wpa_ctrl_request(ctrl, "INTERFACE_LIST", 14, buf, &len, NULL);
|
||||
if (ret < 0) {
|
||||
wpa_ctrl_close(ctrl);
|
||||
return;
|
||||
}
|
||||
buf[len] = '\0';
|
||||
|
||||
wpa_ctrl_close(ctrl);
|
||||
|
||||
QString ifaces(buf);
|
||||
QStringList lines = ifaces.split(QRegExp("\\n"));
|
||||
for (QStringList::Iterator it = lines.begin();
|
||||
it != lines.end(); it++) {
|
||||
QStringList arg = (*it).split(QChar('\t'));
|
||||
if (arg.size() < 3)
|
||||
continue;
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(interfaceWidget);
|
||||
if (!item)
|
||||
break;
|
||||
|
||||
item->setText(0, arg[0]);
|
||||
item->setText(1, arg[1]);
|
||||
item->setText(2, arg[2]);
|
||||
}
|
||||
|
||||
interfaceWidget->resizeColumnToContents(0);
|
||||
interfaceWidget->resizeColumnToContents(1);
|
||||
interfaceWidget->resizeColumnToContents(2);
|
||||
#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
bool AddInterface::addRegistryInterface(const QString &ifname)
|
||||
{
|
||||
HKEY hk, ihk;
|
||||
LONG ret;
|
||||
int id, tmp;
|
||||
TCHAR name[10];
|
||||
DWORD val, i;
|
||||
|
||||
ret = RegOpenKeyEx(WPA_KEY_ROOT, WPA_KEY_PREFIX TEXT("\\interfaces"),
|
||||
0, KEY_ENUMERATE_SUB_KEYS | KEY_CREATE_SUB_KEY,
|
||||
&hk);
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return false;
|
||||
|
||||
id = -1;
|
||||
|
||||
for (i = 0; ; i++) {
|
||||
TCHAR name[255];
|
||||
DWORD namelen;
|
||||
|
||||
namelen = 255;
|
||||
ret = RegEnumKeyEx(hk, i, name, &namelen, NULL, NULL, NULL,
|
||||
NULL);
|
||||
|
||||
if (ret == ERROR_NO_MORE_ITEMS)
|
||||
break;
|
||||
|
||||
if (ret != ERROR_SUCCESS)
|
||||
break;
|
||||
|
||||
if (namelen >= 255)
|
||||
namelen = 255 - 1;
|
||||
name[namelen] = '\0';
|
||||
|
||||
#ifdef UNICODE
|
||||
QString s((QChar *) name, namelen);
|
||||
#else /* UNICODE */
|
||||
QString s(name);
|
||||
#endif /* UNICODE */
|
||||
tmp = s.toInt();
|
||||
if (tmp > id)
|
||||
id = tmp;
|
||||
}
|
||||
|
||||
id += 1;
|
||||
|
||||
#ifdef UNICODE
|
||||
wsprintf(name, L"%04d", id);
|
||||
#else /* UNICODE */
|
||||
os_snprintf(name, sizeof(name), "%04d", id);
|
||||
#endif /* UNICODE */
|
||||
ret = RegCreateKeyEx(hk, name, 0, NULL, 0, KEY_WRITE, NULL, &ihk,
|
||||
NULL);
|
||||
RegCloseKey(hk);
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return false;
|
||||
|
||||
#ifdef UNICODE
|
||||
RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ,
|
||||
(LPBYTE) ifname.unicode(),
|
||||
(ifname.length() + 1) * sizeof(TCHAR));
|
||||
|
||||
#else /* UNICODE */
|
||||
RegSetValueEx(ihk, TEXT("adapter"), 0, REG_SZ,
|
||||
(LPBYTE) ifname.toLocal8Bit(), ifname.length() + 1);
|
||||
#endif /* UNICODE */
|
||||
RegSetValueEx(ihk, TEXT("config"), 0, REG_SZ,
|
||||
(LPBYTE) TEXT("default"), 8 * sizeof(TCHAR));
|
||||
RegSetValueEx(ihk, TEXT("ctrl_interface"), 0, REG_SZ,
|
||||
(LPBYTE) TEXT(""), 1 * sizeof(TCHAR));
|
||||
val = 1;
|
||||
RegSetValueEx(ihk, TEXT("skip_on_error"), 0, REG_DWORD, (LPBYTE) &val,
|
||||
sizeof(val));
|
||||
|
||||
RegCloseKey(ihk);
|
||||
return true;
|
||||
}
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
|
||||
void AddInterface::interfaceSelected(QTreeWidgetItem *sel)
|
||||
{
|
||||
if (!sel)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
|
||||
struct wpa_ctrl *ctrl;
|
||||
int ret;
|
||||
char buf[20], cmd[256];
|
||||
size_t len;
|
||||
|
||||
/*
|
||||
* INTERFACE_ADD <ifname>TAB<confname>TAB<driver>TAB<ctrl_interface>TAB
|
||||
* <driver_param>TAB<bridge_name>
|
||||
*/
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"INTERFACE_ADD %s\t%s\t%s\t%s\t%s\t%s",
|
||||
sel->text(1).toAscii().constData(),
|
||||
"default",
|
||||
sel->text(0).toAscii().constData(),
|
||||
"yes", "", "");
|
||||
cmd[sizeof(cmd) - 1] = '\0';
|
||||
|
||||
ctrl = wpa_ctrl_open(NULL);
|
||||
if (ctrl == NULL)
|
||||
return;
|
||||
|
||||
len = sizeof(buf) - 1;
|
||||
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL);
|
||||
wpa_ctrl_close(ctrl);
|
||||
|
||||
if (ret < 0) {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Add interface command could not be "
|
||||
"completed."));
|
||||
return;
|
||||
}
|
||||
|
||||
buf[len] = '\0';
|
||||
if (buf[0] != 'O' || buf[1] != 'K') {
|
||||
QMessageBox::warning(this, "wpa_gui",
|
||||
tr("Failed to add the interface."));
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
|
||||
|
||||
#ifdef CONFIG_NATIVE_WINDOWS
|
||||
if (!addRegistryInterface(sel->text(1))) {
|
||||
QMessageBox::information(this, "wpa_gui",
|
||||
tr("Failed to add the interface into "
|
||||
"registry."));
|
||||
}
|
||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||
|
||||
wpagui->selectAdapter(sel->text(1));
|
||||
close();
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'dialogmodifypasswd.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 "../dialogmodifypasswd.h"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'dialogmodifypasswd.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_Dialogmodifypasswd[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
0, 0, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_Dialogmodifypasswd[] = {
|
||||
"Dialogmodifypasswd\0"
|
||||
};
|
||||
|
||||
void Dialogmodifypasswd::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
Q_UNUSED(_o);
|
||||
Q_UNUSED(_id);
|
||||
Q_UNUSED(_c);
|
||||
Q_UNUSED(_a);
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData Dialogmodifypasswd::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject Dialogmodifypasswd::staticMetaObject = {
|
||||
{ &QDialog::staticMetaObject, qt_meta_stringdata_Dialogmodifypasswd,
|
||||
qt_meta_data_Dialogmodifypasswd, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &Dialogmodifypasswd::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *Dialogmodifypasswd::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *Dialogmodifypasswd::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_Dialogmodifypasswd))
|
||||
return static_cast<void*>(const_cast< Dialogmodifypasswd*>(this));
|
||||
return QDialog::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int Dialogmodifypasswd::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QDialog::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
压缩机故障,请检查!
|
||||
Reference in New Issue
Block a user