add protodebuger

This commit is contained in:
zcy 2021-09-26 23:30:37 +08:00
parent e0afe13a45
commit d99f89c44f
6 changed files with 51 additions and 1 deletions

View File

@ -100,7 +100,7 @@ void NewMonitorForm::InitWindow()
ui::Button* btn_add_new = dynamic_cast<ui::Button*>(FindControl(L"open_button"));
if (nullptr != btn_add_new) {
btn_add_new->AttachClick([this](ui::EventArgs*) {
if(m_uart_select_combo->GetText() != L""){
if(m_combo_type->GetText() == L"uart"){
UINT PortNum = 0;
for (int i = 3; m_uart_select_combo->GetText()[i] != '\0'; i++) //תťťÎŞĘý×Ö
{
@ -128,6 +128,10 @@ void NewMonitorForm::InitWindow()
}
}
if (m_combo_type->GetText() == L"tcp_client") {
}
return true;
});
}
@ -187,6 +191,7 @@ void NewMonitorForm::InitWindow()
m_ip_config_vbox = dynamic_cast<ui::VBox*>(FindControl(L"ip_config"));
m_uart_config_vbox = dynamic_cast<ui::VBox*>(FindControl(L"uart_config"));
m_uart_select_combo = dynamic_cast<ui::Combo*>(FindControl(L"uart_type"));
m_uart_select_combo->AttachAllEvents([this](ui::EventArgs* ev) {
if (ev->Type == 42) {
@ -196,6 +201,8 @@ void NewMonitorForm::InitWindow()
});
m_uart_baurate_select = dynamic_cast<ui::Combo*>(FindControl(L"uart_baurate_select"));
m_ip_select = dynamic_cast<ui::RichEdit*>(FindControl(L"ip_edit"));
m_port_select= dynamic_cast<ui::RichEdit*>(FindControl(L"port_input"));
m_combo_type->AttachAllEvents([this](ui::EventArgs* ev) {
if (nullptr != ev) {
@ -253,6 +260,9 @@ void NewMonitorForm::InitWindow()
(text == L"udp client") || (text == L"udp server")) {
this->m_ip_config_vbox->SetVisible(true);
this->m_uart_config_vbox->SetVisible(false);
m_ip_select->SetText(L"127.0.0.1");
m_port_select->SetText(L"9001");
}
}
}

View File

@ -46,6 +46,10 @@ private:
ui::VBox* m_uart_config_vbox;
ui::Combo* m_uart_select_combo;
ui::Combo* m_uart_baurate_select;
ui::RichEdit* m_ip_select;
ui::RichEdit* m_port_select;
ui::Combo* m_combo_type;
ui::Window* m_parent;

View File

@ -172,6 +172,9 @@
<ClInclude Include="uart_process.h" />
</ItemGroup>
<ItemGroup>
<Xml Include="..\Debug\resources\themes\default\basic\basic.xml" />
<Xml Include="..\Debug\resources\themes\default\basic\newmonitor.xml" />
<Xml Include="..\Debug\resources\themes\default\basic\uart_form.xml" />
<Xml Include="..\Debug\resources\themes\default\global.xml" />
</ItemGroup>
<ItemGroup>

View File

@ -55,6 +55,15 @@
<Xml Include="..\Debug\resources\themes\default\global.xml">
<Filter>资源文件</Filter>
</Xml>
<Xml Include="..\Debug\resources\themes\default\basic\basic.xml">
<Filter>资源文件</Filter>
</Xml>
<Xml Include="..\Debug\resources\themes\default\basic\newmonitor.xml">
<Filter>资源文件</Filter>
</Xml>
<Xml Include="..\Debug\resources\themes\default\basic\uart_form.xml">
<Filter>资源文件</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="proto_debuger.rc">

View File

@ -0,0 +1,24 @@
#pragma once
#pragma once
#include <string>
// C runtime header
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// base header
#include "base/base.h"
#include "serial_port.h"
// duilib
#include "duilib/UIlib.h"
class TcpclientForm : public ui::ChildBox
{
public:
};