64 lines
1.2 KiB
C++
64 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
// C runtime header
|
|
#include <stdlib.h>
|
|
#include <malloc.h>
|
|
#include <memory.h>
|
|
#include <tchar.h>
|
|
#include <fstream>
|
|
|
|
// base header
|
|
#include "base/base.h"
|
|
#include "serial_port.h"
|
|
// duilib
|
|
#include "duilib/UIlib.h"
|
|
#include "lua_wraper.h"
|
|
#include "global.h"
|
|
|
|
class UartForm :
|
|
public ui::ChildBox,
|
|
LuaBindInterface
|
|
{
|
|
public:
|
|
UartForm(ui::Window* window,std::wstring name,
|
|
uint32_t baurate, UINT portnum,
|
|
uint8_t data_bits,
|
|
uint8_t stop_bits,
|
|
uint8_t verify,
|
|
uint8_t flow_control);
|
|
~UartForm();
|
|
|
|
void ShowDataInEdit(const char*) override;
|
|
void OnUpdateUart();
|
|
LuaDelegate* LuaVM();
|
|
/// 重写父类方法,提供个性化功能,请参考父类声明
|
|
virtual void Init() override;
|
|
void UpdateRecvEdit();
|
|
UINT m_portnum;
|
|
std::wstring m_name;
|
|
uint32_t m_baurate;
|
|
uint8_t m_data_bits;
|
|
uint8_t m_stop_bits;
|
|
uint8_t m_verify;
|
|
uint8_t m_flow_contro;
|
|
bool m_runing;
|
|
std::thread * m_thread_recv;
|
|
wstring m_show_recv;
|
|
|
|
ui::RichEdit* mEditSend;
|
|
ui::RichEdit* mEditRecv;
|
|
ui::RichEdit* mEditLua;
|
|
|
|
HWND m_hwnd;
|
|
LuaDelegate* mLua;
|
|
std::string mLuaScript;
|
|
std::ifstream mLuaFile;
|
|
std::ofstream mLuaFileEdit;
|
|
|
|
private:
|
|
virtual void HandleMessage(ui::EventArgs& msg);
|
|
};
|
|
|