Uploaded by duy.truong170903

SW RS232 1

advertisement
SOFTWARE – GUI DESIGN
CONTENT
1 BASIC GUI PROGRAMMING WITH VISUAL C++
2 COMMUNICATION WITH EMBEDDED DEVICE
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ MFC Dialog project in VS2019
File → New Project
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ MFC Dialog project in VS2019
 Application Type Tab
• Application Type → Dialog Base
• Use of MFC → Use MFC in a shared dll
 Generated Class Tab
• Generateb tab → Dlg
• Finish to creat new project
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ MFC Dialog project in VS2019
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ Project Overview
 Default Dialog and Tool box
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ Project Overview
 File Tree
 Resource View
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ Project Overview
 Object-oriented inside VC ++
programming
• Function create inside MFCDemoDlg.h
class
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ Project Overview
 Object-oriented inside VC ++
programming
• Implement in MFCDemoDlg.cpp
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Create Receive Data Group
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Create Receive Data Group
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Create Receive Data Group
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Create Serial Control Group
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Control Event
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Changed in files MFCDemoDlg.h and MFCDemoDlg.cpp
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Changed in files MFCDemoDlg.h and MFCDemoDlg.cpp
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Name - Combo Box Objects
Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Baudrate - Combo Box Objects
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Baudrate - Combo Box Objects
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Baudrate - Combo Box Objects
Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Open Button – Button Objects
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Open Button – Button Objects
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Open Button – Button Objects
Control Event
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Open Button – Button Objects
Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl Library
Copy SerialCtrl file into project
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl Library
Add SerialCtrl into project
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl Library
SerialCtrl file tree
Drag SerialCtrl.cpp down to Source files
to easier management
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl Library
• Include SerialCtrl
• Inheritance SerialCtrl
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl Library
• Inheritance SerialCtrl
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 SerialCtrl library
• Implement inheritance
function in DemoDlg.cpp
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Create Serial Send Data Group
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Text Command - Edit Text Objects
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Text Command - Edit Text Objects
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Text Command - Edit Text Objects
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Button Send Command - ButtonObjects
Control ID
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Button Send Command - ButtonObjects
Control Variable
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Button Send Command - ButtonObjects
Control Event
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Port Button Send Command - ButtonObjects
Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Static Data Group
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Static Data Group
Object Control infomation
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Static Data Group
Add sample code in top file MFCDemoDlg.cpp
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Static Data Group
• POS Button –
Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Receive Data
• Create Process
Data function
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Receive Data
Call ProcessData in CMFCDemoDlg::OnEventRead
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Data by Timer
• Enable Timer
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Data by Timer
• Enable Timer
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Serial Send Data by Timer
• Add sample code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Control Timer by Radio Button
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Control Timer by Radio Button
• Control ID
• Control Event
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Control Timer by Radio Button
• Control Code
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Hardware Status with GUI and Protocol
• Hardware Status Group
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Hardware Status with GUI and Protocol
•
LED1 Status – Check Box Object
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Hardware Status with GUI and Protocol
•
Sample Protocol
1 BASIC GUI PROGRAMMING WITH VISUAL C++
■ GUI DESIGN
 Hardware Status with GUI and Protocol
•
Sample Protocol
Download