19 |
20 | QT_BEGIN_NAMESPACE
21 |
22 | class Ui_shuoming
23 | {
24 | public:
25 | QTextBrowser *textBrowser;
26 |
27 | void setupUi(QWidget *shuoming)
28 | {
29 | if (shuoming->objectName().isEmpty())
30 | shuoming->setObjectName(QStringLiteral("shuoming"));
31 | shuoming->resize(256, 392);
32 | textBrowser = new QTextBrowser(shuoming);
33 | textBrowser->setObjectName(QStringLiteral("textBrowser"));
34 | textBrowser->setGeometry(QRect(0, 0, 256, 391));
35 |
36 | retranslateUi(shuoming);
37 |
38 | QMetaObject::connectSlotsByName(shuoming);
39 | } // setupUi
40 |
41 | void retranslateUi(QWidget *shuoming)
42 | {
43 | shuoming->setWindowTitle(QApplication::translate("shuoming", "Form", Q_NULLPTR));
44 | textBrowser->setHtml(QApplication::translate("shuoming", "\n"
45 | "\n"
48 | "\345\270\270\347\224\250\346\223\215\344\275\234\346\265\201\347\250\213
\n"
49 | "\344\270\200.\351\235\240\350\277\221\350\242\253\346\265\213\344\273\266
\n"
50 | "1.\351"
51 | "\246\226\345\205\210\346\213\250\345\212\250\346\211\213\350\275\256\357\274\214\344\275\277\351\241\266\346\235\206\345\244\247\347\272\246\351\235\240\350\277\221\350\242\253\346\265\213\344\273\266\357\274\233
\n"
52 | "2.\351\200\211\344\270\255\343\200\220\345\211\215\350\277\233\343\200\221\346\214\211\351\222\256\357\274\214\345\215\225\345\207\273[\347\247\273\345\212\250]\346\214\211\351\222\256\345\271\266\347\241\256\350\256\244\357\274\233\346\255\244\346\227\266\351\241\266\346\235\206\350\207\252\345\212\250\351\235\240\350\277\221\350\242\253\346\265\213\344\273\266\357\274\214\345\234\250\350\275\273\350\275\273\351\235\240\344\270\212\345\220\216\357\274\214\347\273\277\350\211\262\346\214"
53 | "\207\347\244\272\347\201\257\347\206\204\347\201\255\357\274\214\345\201\234\346\255\242\347\247\273\345\212\250\357\274\233
\n"
54 | "
\344\272\214\343\200\201\345\274\200\345\247\213\346\265\213\351\207\217
\n"
55 | "1.\350\256\276\345\256\232\351\235\242\346\235\277\344\270\255\347\232\204\345\217\202\346\225\260\357\274\233\357\274\210\345\273\272\350\256\256\345\217\202\346\225\260\357\274\232\357\274\211
\n"
56 | "2.\347\202\271\345\207\273\343\200"
57 | "\220\351\233\266\347\202\271\346\240\207\345\256\232\343\200\221\346\214\211\351\222\256\350\256\276\347\275\256\345\275\223\345\211\215\344\275\215\347\275\256\344\270\272\345\256\236\351\252\214\344\275\215\347\247\273\351\233\266\347\202\271\357\274\233
\n"
58 | "3.\347\202\271\345\207\273\343\200\220\345\274\200\345\247\213\345\256\236\351\252\214\343\200\221\346\214\211\351\222\256\357\274\214\345\274\200\345\247\213\346\265\213\351\207\217\343\200\202
\344\270\211\343\200\201\346\225\260\346\215\256\345\210\206\346\236\220\345\222\214\346\211\223\345\215\260
\n"
59 | "1.\350\256\276\347\275\256\345\210\232\345\272\246\345\220\210\346\240\274\350\214\203\345\233\264\357\274\233
\n"
61 | "2.\346\240\271\346\215\256\346\225\260\346\215\256\347\211\271\347\202\271\350\256\276\347\275\256\350\265\267\345\247\213\347\202\271\344\275\215\347\275\256\357\274\210\344\270\200\350\210\254\344\270\2720\345\215\263\345\217\257\357\274\211\357\274\233
\n"
62 | "3.\347\202\271\345\207\273\343\200\220\350\256\241\347\256\227\345\210\232\345\272\246\343\200\221\346\214\211\351\222\256\357\274\214\350\256\241\347\256\227\345\210\232\345\272\246\345\200\274\357\274\233<"
63 | "/span>
\n"
64 | "4.\347\202\271\345\207\273\343\200\220\344\277\235\345\255\230\345\210\260\346\211\223\345\215\260\345\210\227\350\241\250\343\200\221\357\274\214\345\260\206\345\210\232\350\256\241\347\256\227\345\207\272\347\232\204\345\210\232\345\272\246\345\200\274\346\224\276\345\205\245\345\276\205\346\211\223\345\215\260\345\210\227\350\241\250\357\274\233
\345\233\233\343\200\201\345\244\215\344\275\215
\n"
65 | "1.\347\202\271\345\207\273\343\200\220\346\270\205\347\251\272\345\233\276\346\240\207\343\200\221\345\210\240\351\231\244\347\225\214\351\235\242\344\270\255"
66 | "\345\233\276\350\241\250\344\270\255\347\232\204\347\232\204\346\225\260\346\215\256\357\274\233
\n"
67 | "2.\350\275\273\350\275\273\346\213\250\345\212\250\346\211\213\350\275\256\346\210\226\350\200\205\351\200\211\344\270\255\343\200\220\345\220\216\351\200\200\343\200\221\345\271\266\347\247\273\345\212\250\357\274\214\345\260\206\351\241\266\346\235\206\351\200\200\345\207\272\357\274\233
", Q_NULLPTR));
68 | } // retranslateUi
69 |
70 | };
71 |
72 | namespace Ui {
73 | class shuoming: public Ui_shuoming {};
74 | } // namespace Ui
75 |
76 | QT_END_NAMESPACE
77 |
78 | #endif // UI_SHUOMING_H
79 |
--------------------------------------------------------------------------------
/ui_widget.h:
--------------------------------------------------------------------------------
1 | /********************************************************************************
2 | ** Form generated from reading UI file 'widget.ui'
3 | **
4 | ** Created by: Qt User Interface Compiler version 5.9.1
5 | **
6 | ** WARNING! All changes made in this file will be lost when recompiling UI file!
7 | ********************************************************************************/
8 |
9 | #ifndef UI_WIDGET_H
10 | #define UI_WIDGET_H
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 | QT_BEGIN_NAMESPACE
23 |
24 | class Ui_Widget
25 | {
26 | public:
27 | QLabel *label_2;
28 | QDoubleSpinBox *doubleSpinBox_1;
29 | QPushButton *pushButton_2;
30 | QPushButton *pushButton;
31 | QLabel *label_3;
32 | QDoubleSpinBox *doubleSpinBox_2;
33 | QLabel *label;
34 | QDoubleSpinBox *doubleSpinBox;
35 |
36 | void setupUi(QWidget *Widget)
37 | {
38 | if (Widget->objectName().isEmpty())
39 | Widget->setObjectName(QStringLiteral("Widget"));
40 | Widget->resize(400, 300);
41 | label_2 = new QLabel(Widget);
42 | label_2->setObjectName(QStringLiteral("label_2"));
43 | label_2->setGeometry(QRect(180, 116, 48, 16));
44 | doubleSpinBox_1 = new QDoubleSpinBox(Widget);
45 | doubleSpinBox_1->setObjectName(QStringLiteral("doubleSpinBox_1"));
46 | doubleSpinBox_1->setGeometry(QRect(180, 90, 58, 20));
47 | pushButton_2 = new QPushButton(Widget);
48 | pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
49 | pushButton_2->setGeometry(QRect(170, 180, 75, 23));
50 | pushButton = new QPushButton(Widget);
51 | pushButton->setObjectName(QStringLiteral("pushButton"));
52 | pushButton->setGeometry(QRect(70, 180, 75, 23));
53 | label_3 = new QLabel(Widget);
54 | label_3->setObjectName(QStringLiteral("label_3"));
55 | label_3->setGeometry(QRect(90, 145, 48, 16));
56 | doubleSpinBox_2 = new QDoubleSpinBox(Widget);
57 | doubleSpinBox_2->setObjectName(QStringLiteral("doubleSpinBox_2"));
58 | doubleSpinBox_2->setGeometry(QRect(90, 119, 58, 20));
59 | label = new QLabel(Widget);
60 | label->setObjectName(QStringLiteral("label"));
61 | label->setGeometry(QRect(91, 86, 48, 16));
62 | doubleSpinBox = new QDoubleSpinBox(Widget);
63 | doubleSpinBox->setObjectName(QStringLiteral("doubleSpinBox"));
64 | doubleSpinBox->setGeometry(QRect(91, 60, 58, 20));
65 |
66 | retranslateUi(Widget);
67 |
68 | QMetaObject::connectSlotsByName(Widget);
69 | } // setupUi
70 |
71 | void retranslateUi(QWidget *Widget)
72 | {
73 | Widget->setWindowTitle(QApplication::translate("Widget", "Widget", Q_NULLPTR));
74 | label_2->setText(QApplication::translate("Widget", "\350\241\245\345\201\277\345\210\232\345\272\246", Q_NULLPTR));
75 | pushButton_2->setText(QApplication::translate("Widget", "\344\277\235\345\255\230", Q_NULLPTR));
76 | pushButton->setText(QApplication::translate("Widget", "\346\240\241\345\207\206", Q_NULLPTR));
77 | label_3->setText(QApplication::translate("Widget", "\346\265\213\351\207\217\345\210\232\345\272\246", Q_NULLPTR));
78 | label->setText(QApplication::translate("Widget", "\346\240\207\345\207\206\345\210\232\345\272\246", Q_NULLPTR));
79 | } // retranslateUi
80 |
81 | };
82 |
83 | namespace Ui {
84 | class Widget: public Ui_Widget {};
85 | } // namespace Ui
86 |
87 | QT_END_NAMESPACE
88 |
89 | #endif // UI_WIDGET_H
90 |
--------------------------------------------------------------------------------
/widget.cpp:
--------------------------------------------------------------------------------
1 | #include "widget.h"
2 | #include "ui_widget.h"
3 | #include
4 | #include
5 |
6 | Widget::Widget(QWidget *parent) :
7 | QWidget(parent),
8 | ui(new Ui::Widget)
9 | {
10 | ui->setupUi(this);
11 |
12 |
13 | }
14 |
15 |
16 |
17 | Widget::~Widget()
18 | {
19 | delete ui;
20 | }
21 |
22 | void Widget::get_sti()
23 | {
24 | sti_std = ui->doubleSpinBox->value();
25 | sti_real = ui->doubleSpinBox_2->value();
26 | sti_makeup = (sti_std * sti_real)/(sti_std - sti_real);
27 | }
28 |
29 | void Widget::on_pushButton_2_clicked()
30 | {
31 | qfile = new QFile("C:/Users/Administrator/Desktop/Em2018.1.19/Em2018.1.16/Em2018.1.14/Em/sti_makeup");
32 |
33 | if(!qfile->open(QFile::WriteOnly|QFile::Text))
34 | {
35 | QMessageBox::warning(this,"warning","cannot open",QMessageBox::Yes);
36 | this->close();
37 | }
38 |
39 |
40 | out_sti = new QTextStream(qfile);
41 |
42 | (*out_sti)<flush();
44 |
45 | }
46 |
47 | void Widget::on_pushButton_clicked()
48 | {
49 | get_sti();
50 | qDebug()<<"sti_makeup:"<doubleSpinBox_1->setValue(sti_makeup);
52 | }
53 |
--------------------------------------------------------------------------------
/widget.h:
--------------------------------------------------------------------------------
1 | #ifndef WIDGET_H
2 | #define WIDGET_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | namespace Ui {
9 | class Widget;
10 | }
11 |
12 | class Widget : public QWidget
13 | {
14 | Q_OBJECT
15 |
16 | public:
17 | explicit Widget(QWidget *parent = 0);
18 | ~Widget();
19 | double sti_makeup;
20 |
21 | private slots:
22 |
23 | void on_pushButton_2_clicked();
24 |
25 | void on_pushButton_clicked();
26 |
27 | private:
28 | Ui::Widget *ui;
29 |
30 | void get_sti();
31 | double sti_std;
32 | double sti_real;
33 | QFile *qfile;
34 | QTextStream *out_sti;
35 |
36 | };
37 |
38 | #endif // WIDGET_H
39 |
--------------------------------------------------------------------------------
/widget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Widget
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 300
11 |
12 |
13 |
14 | Widget
15 |
16 |
17 |
18 |
19 | 180
20 | 116
21 | 48
22 | 16
23 |
24 |
25 |
26 | 补偿刚度
27 |
28 |
29 |
30 |
31 |
32 | 180
33 | 90
34 | 58
35 | 20
36 |
37 |
38 |
39 |
40 |
41 |
42 | 170
43 | 180
44 | 75
45 | 23
46 |
47 |
48 |
49 | 保存
50 |
51 |
52 |
53 |
54 |
55 | 70
56 | 180
57 | 75
58 | 23
59 |
60 |
61 |
62 | 校准
63 |
64 |
65 |
66 |
67 |
68 | 90
69 | 145
70 | 48
71 | 16
72 |
73 |
74 |
75 | 测量刚度
76 |
77 |
78 |
79 |
80 |
81 | 90
82 | 119
83 | 58
84 | 20
85 |
86 |
87 |
88 |
89 |
90 |
91 | 91
92 | 86
93 | 48
94 | 16
95 |
96 |
97 |
98 | 标准刚度
99 |
100 |
101 |
102 |
103 |
104 | 91
105 | 60
106 | 58
107 | 20
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/winio.h:
--------------------------------------------------------------------------------
1 | #ifndef WINIO_H
2 | #define WINIO_H
3 |
4 | #include "winio_nt.h"
5 |
6 | #ifndef WINIO_DLL
7 | //#define WINIO_API _declspec(dllimport)
8 | #else
9 | #define WINIO_API
10 | #endif
11 | #define WINIO_API
12 |
13 | extern "C"
14 | {
15 | WINIO_API bool _stdcall InitializeWinIo();
16 | WINIO_API void _stdcall ShutdownWinIo();
17 | WINIO_API PBYTE _stdcall MapPhysToLin(tagPhysStruct &PhysStruct);
18 | WINIO_API bool _stdcall UnmapPhysicalMemory(tagPhysStruct &PhysStruct);
19 | WINIO_API bool _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal);
20 | WINIO_API bool _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal);
21 | WINIO_API bool _stdcall GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize);
22 | WINIO_API bool _stdcall SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize);
23 | WINIO_API bool _stdcall InstallWinIoDriver(PWSTR pszWinIoDriverPath, bool IsDemandLoaded = false);
24 | WINIO_API bool _stdcall RemoveWinIoDriver();
25 | }
26 |
27 | extern HANDLE hDriver;
28 | extern bool IsWinIoInitialized;
29 | extern bool g_Is64BitOS;
30 |
31 | bool _stdcall StartWinIoDriver();
32 | bool _stdcall StopWinIoDriver();
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/winio_nt.h:
--------------------------------------------------------------------------------
1 | #ifndef WINIONT_H
2 | #define WINIONT_H
3 |
4 | // Define the various device type values. Note that values used by Microsoft
5 | // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
6 | // by customers.
7 |
8 | #define FILE_DEVICE_WINIO 0x00008010
9 |
10 | // Macro definition for defining IOCTL and FSCTL function control codes.
11 | // Note that function codes 0-2047 are reserved for Microsoft Corporation,
12 | // and 2048-4095 are reserved for customers.
13 |
14 | #define WINIO_IOCTL_INDEX 0x810
15 |
16 | // Define our own private IOCTL
17 |
18 | #define IOCTL_WINIO_MAPPHYSTOLIN CTL_CODE(FILE_DEVICE_WINIO, \
19 | WINIO_IOCTL_INDEX, \
20 | METHOD_BUFFERED, \
21 | FILE_ANY_ACCESS)
22 |
23 | #define IOCTL_WINIO_UNMAPPHYSADDR CTL_CODE(FILE_DEVICE_WINIO, \
24 | WINIO_IOCTL_INDEX + 1, \
25 | METHOD_BUFFERED, \
26 | FILE_ANY_ACCESS)
27 |
28 | #define IOCTL_WINIO_ENABLEDIRECTIO CTL_CODE(FILE_DEVICE_WINIO, \
29 | WINIO_IOCTL_INDEX + 2, \
30 | METHOD_BUFFERED, \
31 | FILE_ANY_ACCESS)
32 |
33 | #define IOCTL_WINIO_DISABLEDIRECTIO CTL_CODE(FILE_DEVICE_WINIO, \
34 | WINIO_IOCTL_INDEX + 3, \
35 | METHOD_BUFFERED, \
36 | FILE_ANY_ACCESS)
37 |
38 | #define IOCTL_WINIO_READPORT CTL_CODE(FILE_DEVICE_WINIO, \
39 | WINIO_IOCTL_INDEX + 4, \
40 | METHOD_BUFFERED, \
41 | FILE_ANY_ACCESS)
42 |
43 | #define IOCTL_WINIO_WRITEPORT CTL_CODE(FILE_DEVICE_WINIO, \
44 | WINIO_IOCTL_INDEX + 5, \
45 | METHOD_BUFFERED, \
46 | FILE_ANY_ACCESS)
47 |
48 | #pragma pack(push)
49 | #pragma pack(1)
50 |
51 | struct tagPhysStruct
52 | {
53 | DWORD64 dwPhysMemSizeInBytes;
54 | DWORD64 pvPhysAddress;
55 | DWORD64 PhysicalMemoryHandle;
56 | DWORD64 pvPhysMemLin;
57 | DWORD64 pvPhysSection;
58 | };
59 |
60 | struct tagPortStruct
61 | {
62 | USHORT wPortAddr;
63 | ULONG dwPortVal;
64 | UCHAR bSize;
65 | };
66 |
67 | #pragma pack(pop)
68 |
69 | #endif
70 |
--------------------------------------------------------------------------------