From ea5a25af065a7d6e200b9ae40635c480522de668 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 22 Oct 2026 11:11:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AA=97=E4=BD=93=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=EF=BC=9A=E5=B7=A5=E5=85=B7=E7=AE=B1=E3=80=81=E6=8B=96=E6=94=BE?= =?UTF-8?q?=E3=80=81=E5=B1=9E=E6=80=A7=E4=B8=8E=E4=BA=8B=E4=BB=B6=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E8=AF=BB=E5=86=99=20VS=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=20Designer.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Designer.cs 在浏览器端解析为语句列表,未改动的语句保留原文: 教材 25 个参考窗体和全部示例读入再写出逐字节不变 - 编辑操作:添加 / 删除 / 移动 / 改名控件、属性、事件、列表项; 布局语句增删规则与 VS 一致(对全部现有文件执行无变化) - 双击控件或事件:绑定事件并在窗体代码末尾插入处理方法,跳到代码 - 预览复用运行时的 ControlView,设计时与运行时外观一致 - 修正:窗体属性 this.ClientSize = new Size(...) 被误认成创建控件; 示例 Designer.cs 的块头注释改为 VS 的 "// " 格式 - 测试:73 个(读写往返、布局规则、编辑操作、插入事件处理方法) Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +- docs/设计方案.md | 5 +- samples/p2-t1-LED显示屏/Form1.Designer.cs | 36 +- .../p2-t2-模拟量采集/frm_analog.Designer.cs | 52 +- .../p2-t3-LED推送模拟量/frm_LED.Designer.cs | 64 +- samples/p3-t1-ZigBee路灯/Form1.Designer.cs | 32 +- .../Form1.Designer.cs | 48 +- web/src/App.vue | 72 +- web/src/designer/FormDesigner.vue | 641 ++++++++++++++++++ web/src/designer/PropertyGrid.vue | 389 +++++++++++ web/src/designer/catalog.ts | 304 +++++++++ web/src/designer/code.test.ts | 41 ++ web/src/designer/code.ts | 76 +++ web/src/designer/document.test.ts | 41 ++ web/src/designer/document.ts | 316 +++++++++ web/src/designer/edit.test.ts | 130 ++++ web/src/designer/edit.ts | 365 ++++++++++ web/src/designer/preview.ts | 87 +++ web/src/designer/values.ts | 174 +++++ web/tsconfig.json | 22 +- 20 files changed, 2767 insertions(+), 132 deletions(-) create mode 100644 web/src/designer/FormDesigner.vue create mode 100644 web/src/designer/PropertyGrid.vue create mode 100644 web/src/designer/catalog.ts create mode 100644 web/src/designer/code.test.ts create mode 100644 web/src/designer/code.ts create mode 100644 web/src/designer/document.test.ts create mode 100644 web/src/designer/document.ts create mode 100644 web/src/designer/edit.test.ts create mode 100644 web/src/designer/edit.ts create mode 100644 web/src/designer/preview.ts create mode 100644 web/src/designer/values.ts diff --git a/README.md b/README.md index 81eed40..ae0ad0d 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ bun run dev:web # 启动前端(端口 5173),浏览器打开 ht ```bash cd server bun test # 端到端测试:编译并运行示例,模拟浏览器操作 +cd ../web && bun test src # 窗体设计器:Designer.cs 读写、编辑操作、插入事件处理方法 bun test/load.ts 100 # 压力测试:同时运行 100 个学生程序 ``` @@ -62,8 +63,9 @@ bun test/load.ts 100 # 压力测试:同时运行 100 个学生程序 - 新控件:CheckBox、RadioButton(事件顺序与 WinForms 一致),教材控件库的 Lamp、Alarm。 - 示例工程(按书上代码整理):项目 2 任务 1–3、项目 3 任务 1–2。网址带 `?sample=示例编号` 可直接打开指定示例。 - 代码编辑器(Monaco):C# 高亮、编译错误波浪线、点错误跳到对应行、F5 运行 / Shift+F5 停止、草稿自动保存在浏览器本地。 +- 窗体设计器(仿 VS):工具箱、拖放与改大小、属性窗口、事件窗口、双击生成事件处理方法;读写 VS 格式的 Designer.cs。 尚未完成: - 学生代码目前直接在本机进程里运行,**还没有沙箱**,只能在本机开发时使用;部署前要改为在 Docker 容器中运行。 -- 浏览器内的窗体设计器、账号和班级、自动评测。 +- 多窗体(新建窗体)、设计器的撤销 / 重做、账号和班级、自动评测。 diff --git a/docs/设计方案.md b/docs/设计方案.md index 6ab5d3c..ffc6ae3 100644 --- a/docs/设计方案.md +++ b/docs/设计方案.md @@ -36,7 +36,7 @@ 页面分为编辑和运行两种模式。编辑模式照着 Visual Studio 来做,学生以后换到真的 VS 上操作一致。 -**编辑模式**(窗体设计器尚未实现) +**编辑模式** - 左侧工具箱:常用控件(Button、Label、TextBox、CheckBox、ComboBox、Timer 等),以及"物联网"分组(教材的 Lamp、LED、Alarm、ShowMsg 等设备控件)。 - 中间「设计」和「代码」两个标签页:设计页拖放控件,窗体下方有组件栏(存放 Timer 和设备组件);代码页用 Monaco 编辑 `Form1.cs`。 @@ -227,7 +227,7 @@ IOT/ ```mermaid flowchart TB P0["阶段 0 · 技术验证(已完成 2026-10-22)
教材项目 2 任务 1 原样运行;实测编译、延迟、内存"] - P1["阶段 1 · MVP(进行中,约 3 个月)
虚拟实训台 ✔、项目 2–3 示例 ✔、代码编辑器 ✔
窗体设计器、多窗体、导入教材参考工程"] + P1["阶段 1 · MVP(进行中,约 3 个月)
虚拟实训台 ✔、项目 2–3 示例 ✔、代码编辑器 ✔、窗体设计器 ✔
多窗体、导入教材参考工程"] P2["阶段 2 · 教学闭环(约 2 个月)
班级码登录、提交作业、自动评测、老师看板、成绩导出;一个班试用"] P3["阶段 3 · 扩展(下学期)
教材项目 4–8:摄像头、线程、SQLite 模拟数据库、图表、虚拟时钟"] P4["阶段 4 · 进阶(之后)
校园街景场景、故障注入题库、导出 VS 工程"] @@ -255,6 +255,7 @@ flowchart TB - 2026-10-22:虚拟实训台(服务器统一保存状态,网页调节环境);CheckBox、RadioButton、Lamp、Alarm;教材项目 2、3 共 5 个任务的示例全部跑通。 - 2026-10-22:代码编辑器换成 Monaco:C# 语法高亮;编译错误以波浪线标在代码里,点错误信息跳到对应行;F5 运行、Shift+F5 停止(在整个页面生效,并阻止浏览器 F5 刷新);改过的代码自动保存在浏览器本地,可一键恢复原始代码。前端打包后 JS + CSS 压缩约 1.2 MB。 +- 2026-10-22:窗体设计器:工具箱拖放或双击添加控件,选中、拖动、改大小、拖进拖出分组框,Delete 删除、方向键微调;属性窗口和事件窗口;双击控件或事件生成事件处理方法并跳到代码;Timer 等组件显示在组件栏。Designer.cs 在浏览器端直接解析和生成:未改动的语句保留原文,教材 25 个参考窗体和全部示例读入再写出逐字节不变;布局语句(SuspendLayout / ResumeLayout / PerformLayout)的增删规则与 VS 一致。 ## 技术风险与待确认事项 diff --git a/samples/p2-t1-LED显示屏/Form1.Designer.cs b/samples/p2-t1-LED显示屏/Form1.Designer.cs index 7b787b6..b39ec91 100644 --- a/samples/p2-t1-LED显示屏/Form1.Designer.cs +++ b/samples/p2-t1-LED显示屏/Form1.Designer.cs @@ -38,16 +38,16 @@ namespace LED显示屏 this.label1 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); - // + // // led - // + // this.led.Location = new System.Drawing.Point(12, 12); this.led.Name = "led"; this.led.Size = new System.Drawing.Size(750, 121); this.led.TabIndex = 0; - // + // // groupBox1 - // + // this.groupBox1.Controls.Add(this.com_Port); this.groupBox1.Controls.Add(this.btn_Send); this.groupBox1.Controls.Add(this.label2); @@ -60,18 +60,18 @@ namespace LED显示屏 this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "LED控制"; - // + // // com_Port - // + // this.com_Port.FormattingEnabled = true; this.com_Port.Location = new System.Drawing.Point(101, 24); this.com_Port.Name = "com_Port"; this.com_Port.Size = new System.Drawing.Size(173, 20); this.com_Port.TabIndex = 6; this.com_Port.Click += new System.EventHandler(this.com_Port_Click); - // + // // btn_Send - // + // this.btn_Send.Location = new System.Drawing.Point(301, 91); this.btn_Send.Name = "btn_Send"; this.btn_Send.Size = new System.Drawing.Size(75, 23); @@ -79,25 +79,25 @@ namespace LED显示屏 this.btn_Send.Text = "推 送"; this.btn_Send.UseVisualStyleBackColor = true; this.btn_Send.Click += new System.EventHandler(this.btn_Send_Click); - // + // // label2 - // + // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(16, 67); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(71, 12); this.label2.TabIndex = 4; this.label2.Text = "推送LED信息"; - // + // // txt_SendText - // + // this.txt_SendText.Location = new System.Drawing.Point(101, 64); this.txt_SendText.Name = "txt_SendText"; this.txt_SendText.Size = new System.Drawing.Size(286, 21); this.txt_SendText.TabIndex = 3; - // + // // btn_Open - // + // this.btn_Open.Location = new System.Drawing.Point(301, 20); this.btn_Open.Name = "btn_Open"; this.btn_Open.Size = new System.Drawing.Size(86, 23); @@ -105,18 +105,18 @@ namespace LED显示屏 this.btn_Open.Text = "打 开"; this.btn_Open.UseVisualStyleBackColor = true; this.btn_Open.Click += new System.EventHandler(this.btn_Open_Click); - // + // // label1 - // + // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(16, 23); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(71, 12); this.label1.TabIndex = 0; this.label1.Text = "串 口"; - // + // // Form1 - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(774, 308); diff --git a/samples/p2-t2-模拟量采集/frm_analog.Designer.cs b/samples/p2-t2-模拟量采集/frm_analog.Designer.cs index c596e56..cda320d 100644 --- a/samples/p2-t2-模拟量采集/frm_analog.Designer.cs +++ b/samples/p2-t2-模拟量采集/frm_analog.Designer.cs @@ -43,9 +43,9 @@ namespace 模拟量采集 this.grp_show.SuspendLayout(); this.grp_config.SuspendLayout(); this.SuspendLayout(); - // + // // grp_show - // + // this.grp_show.Controls.Add(this.btn_get); this.grp_show.Controls.Add(this.txt_humidity); this.grp_show.Controls.Add(this.txt_temperature); @@ -59,9 +59,9 @@ namespace 模拟量采集 this.grp_show.TabIndex = 0; this.grp_show.TabStop = false; this.grp_show.Text = "数据显示"; - // + // // btn_get - // + // this.btn_get.Location = new System.Drawing.Point(209, 24); this.btn_get.Name = "btn_get"; this.btn_get.Size = new System.Drawing.Size(39, 83); @@ -69,57 +69,57 @@ namespace 模拟量采集 this.btn_get.Text = "获取"; this.btn_get.UseVisualStyleBackColor = true; this.btn_get.Click += new System.EventHandler(this.btn_get_Click); - // + // // txt_humidity - // + // this.txt_humidity.Location = new System.Drawing.Point(83, 86); this.txt_humidity.Name = "txt_humidity"; this.txt_humidity.Size = new System.Drawing.Size(100, 21); this.txt_humidity.TabIndex = 5; - // + // // txt_temperature - // + // this.txt_temperature.Location = new System.Drawing.Point(83, 54); this.txt_temperature.Name = "txt_temperature"; this.txt_temperature.Size = new System.Drawing.Size(100, 21); this.txt_temperature.TabIndex = 4; - // + // // txt_light - // + // this.txt_light.Location = new System.Drawing.Point(83, 24); this.txt_light.Name = "txt_light"; this.txt_light.Size = new System.Drawing.Size(100, 21); this.txt_light.TabIndex = 3; - // + // // lbl_humidity - // + // this.lbl_humidity.AutoSize = true; this.lbl_humidity.Location = new System.Drawing.Point(20, 89); this.lbl_humidity.Name = "lbl_humidity"; this.lbl_humidity.Size = new System.Drawing.Size(29, 12); this.lbl_humidity.TabIndex = 2; this.lbl_humidity.Text = "湿度"; - // + // // lbl_temperature - // + // this.lbl_temperature.AutoSize = true; this.lbl_temperature.Location = new System.Drawing.Point(20, 57); this.lbl_temperature.Name = "lbl_temperature"; this.lbl_temperature.Size = new System.Drawing.Size(29, 12); this.lbl_temperature.TabIndex = 1; this.lbl_temperature.Text = "温度"; - // + // // lbl_light - // + // this.lbl_light.AutoSize = true; this.lbl_light.Location = new System.Drawing.Point(20, 27); this.lbl_light.Name = "lbl_light"; this.lbl_light.Size = new System.Drawing.Size(41, 12); this.lbl_light.TabIndex = 0; this.lbl_light.Text = "光照度"; - // + // // grp_config - // + // this.grp_config.Controls.Add(this.btn_Open); this.grp_config.Controls.Add(this.com_port); this.grp_config.Controls.Add(this.lbl_port); @@ -129,9 +129,9 @@ namespace 模拟量采集 this.grp_config.TabIndex = 1; this.grp_config.TabStop = false; this.grp_config.Text = "配置"; - // + // // btn_Open - // + // this.btn_Open.Location = new System.Drawing.Point(149, 59); this.btn_Open.Name = "btn_Open"; this.btn_Open.Size = new System.Drawing.Size(75, 23); @@ -139,26 +139,26 @@ namespace 模拟量采集 this.btn_Open.Text = "开启"; this.btn_Open.UseVisualStyleBackColor = true; this.btn_Open.Click += new System.EventHandler(this.btn_Open_Click); - // + // // com_port - // + // this.com_port.FormattingEnabled = true; this.com_port.Location = new System.Drawing.Point(105, 33); this.com_port.Name = "com_port"; this.com_port.Size = new System.Drawing.Size(119, 20); this.com_port.TabIndex = 1; - // + // // lbl_port - // + // this.lbl_port.AutoSize = true; this.lbl_port.Location = new System.Drawing.Point(44, 36); this.lbl_port.Name = "lbl_port"; this.lbl_port.Size = new System.Drawing.Size(29, 12); this.lbl_port.TabIndex = 0; this.lbl_port.Text = "串口"; - // + // // frm_analog - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 262); diff --git a/samples/p2-t3-LED推送模拟量/frm_LED.Designer.cs b/samples/p2-t3-LED推送模拟量/frm_LED.Designer.cs index 3d69506..341a7e5 100644 --- a/samples/p2-t3-LED推送模拟量/frm_LED.Designer.cs +++ b/samples/p2-t3-LED推送模拟量/frm_LED.Designer.cs @@ -46,17 +46,17 @@ namespace LED推送模拟量 this.grp_show.SuspendLayout(); this.grp_config.SuspendLayout(); this.SuspendLayout(); - // + // // led - // + // this.led.BackColor = System.Drawing.Color.Black; this.led.Location = new System.Drawing.Point(19, 0); this.led.Name = "led"; this.led.Size = new System.Drawing.Size(800, 130); this.led.TabIndex = 0; - // + // // grp_show - // + // this.grp_show.Controls.Add(this.btn_get); this.grp_show.Controls.Add(this.txt_temperature); this.grp_show.Controls.Add(this.txt_humidity); @@ -70,9 +70,9 @@ namespace LED推送模拟量 this.grp_show.TabIndex = 1; this.grp_show.TabStop = false; this.grp_show.Text = "数据显示"; - // + // // btn_get - // + // this.btn_get.Location = new System.Drawing.Point(287, 47); this.btn_get.Name = "btn_get"; this.btn_get.Size = new System.Drawing.Size(51, 103); @@ -80,57 +80,57 @@ namespace LED推送模拟量 this.btn_get.Text = "获取"; this.btn_get.UseVisualStyleBackColor = true; this.btn_get.Click += new System.EventHandler(this.btn_get_Click); - // + // // txt_temperature - // + // this.txt_temperature.Location = new System.Drawing.Point(105, 85); this.txt_temperature.Name = "txt_temperature"; this.txt_temperature.Size = new System.Drawing.Size(147, 21); this.txt_temperature.TabIndex = 4; - // + // // txt_humidity - // + // this.txt_humidity.Location = new System.Drawing.Point(105, 129); this.txt_humidity.Name = "txt_humidity"; this.txt_humidity.Size = new System.Drawing.Size(147, 21); this.txt_humidity.TabIndex = 5; - // + // // txt_light - // + // this.txt_light.Location = new System.Drawing.Point(105, 47); this.txt_light.Name = "txt_light"; this.txt_light.Size = new System.Drawing.Size(147, 21); this.txt_light.TabIndex = 3; - // + // // lbl_humidity - // + // this.lbl_humidity.AutoSize = true; this.lbl_humidity.Location = new System.Drawing.Point(43, 132); this.lbl_humidity.Name = "lbl_humidity"; this.lbl_humidity.Size = new System.Drawing.Size(29, 12); this.lbl_humidity.TabIndex = 2; this.lbl_humidity.Text = "湿度"; - // + // // lbl_temperature - // + // this.lbl_temperature.AutoSize = true; this.lbl_temperature.Location = new System.Drawing.Point(43, 88); this.lbl_temperature.Name = "lbl_temperature"; this.lbl_temperature.Size = new System.Drawing.Size(29, 12); this.lbl_temperature.TabIndex = 1; this.lbl_temperature.Text = "温度"; - // + // // lbl_light - // + // this.lbl_light.AutoSize = true; this.lbl_light.Location = new System.Drawing.Point(43, 50); this.lbl_light.Name = "lbl_light"; this.lbl_light.Size = new System.Drawing.Size(41, 12); this.lbl_light.TabIndex = 0; this.lbl_light.Text = "光照度"; - // + // // grp_config - // + // this.grp_config.Controls.Add(this.com_ledPort); this.grp_config.Controls.Add(this.lbl_ledPort); this.grp_config.Controls.Add(this.btn_open); @@ -142,26 +142,26 @@ namespace LED推送模拟量 this.grp_config.TabIndex = 2; this.grp_config.TabStop = false; this.grp_config.Text = "配置"; - // + // // com_ledPort - // + // this.com_ledPort.FormattingEnabled = true; this.com_ledPort.Location = new System.Drawing.Point(127, 84); this.com_ledPort.Name = "com_ledPort"; this.com_ledPort.Size = new System.Drawing.Size(121, 20); this.com_ledPort.TabIndex = 3; - // + // // lbl_ledPort - // + // this.lbl_ledPort.AutoSize = true; this.lbl_ledPort.Location = new System.Drawing.Point(48, 87); this.lbl_ledPort.Name = "lbl_ledPort"; this.lbl_ledPort.Size = new System.Drawing.Size(47, 12); this.lbl_ledPort.TabIndex = 2; this.lbl_ledPort.Text = "LED串口"; - // + // // btn_open - // + // this.btn_open.Location = new System.Drawing.Point(173, 121); this.btn_open.Name = "btn_open"; this.btn_open.Size = new System.Drawing.Size(75, 23); @@ -169,26 +169,26 @@ namespace LED推送模拟量 this.btn_open.Text = "开启"; this.btn_open.UseVisualStyleBackColor = true; this.btn_open.Click += new System.EventHandler(this.btn_open_Click); - // + // // com_adamPort - // + // this.com_adamPort.FormattingEnabled = true; this.com_adamPort.Location = new System.Drawing.Point(127, 41); this.com_adamPort.Name = "com_adamPort"; this.com_adamPort.Size = new System.Drawing.Size(121, 20); this.com_adamPort.TabIndex = 1; - // + // // lbl_adamPort - // + // this.lbl_adamPort.AutoSize = true; this.lbl_adamPort.Location = new System.Drawing.Point(46, 44); this.lbl_adamPort.Name = "lbl_adamPort"; this.lbl_adamPort.Size = new System.Drawing.Size(65, 12); this.lbl_adamPort.TabIndex = 0; this.lbl_adamPort.Text = "模拟量串口"; - // + // // frm_LED - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(834, 380); diff --git a/samples/p3-t1-ZigBee路灯/Form1.Designer.cs b/samples/p3-t1-ZigBee路灯/Form1.Designer.cs index 9dc6bd5..509e34e 100644 --- a/samples/p3-t1-ZigBee路灯/Form1.Designer.cs +++ b/samples/p3-t1-ZigBee路灯/Form1.Designer.cs @@ -37,17 +37,17 @@ namespace ZigBee路灯 this.lbl_Lamp = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); - // + // // lamp1 - // + // this.lamp1.BackColor = System.Drawing.Color.White; this.lamp1.Location = new System.Drawing.Point(29, 28); this.lamp1.Name = "lamp1"; this.lamp1.Size = new System.Drawing.Size(105, 185); this.lamp1.TabIndex = 0; - // + // // rb_Open - // + // this.rb_Open.AutoSize = true; this.rb_Open.Location = new System.Drawing.Point(29, 222); this.rb_Open.Name = "rb_Open"; @@ -56,9 +56,9 @@ namespace ZigBee路灯 this.rb_Open.Text = "开"; this.rb_Open.UseVisualStyleBackColor = true; this.rb_Open.CheckedChanged += new System.EventHandler(this.rb_Open_CheckedChanged); - // + // // rb_Close - // + // this.rb_Close.AutoSize = true; this.rb_Close.Location = new System.Drawing.Point(99, 222); this.rb_Close.Name = "rb_Close"; @@ -67,9 +67,9 @@ namespace ZigBee路灯 this.rb_Close.Text = "关"; this.rb_Close.UseVisualStyleBackColor = true; this.rb_Close.CheckedChanged += new System.EventHandler(this.rb_Close_CheckedChanged); - // + // // groupBox1 - // + // this.groupBox1.Controls.Add(this.btn_open); this.groupBox1.Controls.Add(this.com_port); this.groupBox1.Controls.Add(this.lbl_Lamp); @@ -79,9 +79,9 @@ namespace ZigBee路灯 this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "配置"; - // + // // btn_open - // + // this.btn_open.Location = new System.Drawing.Point(145, 77); this.btn_open.Name = "btn_open"; this.btn_open.Size = new System.Drawing.Size(75, 23); @@ -89,26 +89,26 @@ namespace ZigBee路灯 this.btn_open.Text = "打开"; this.btn_open.UseVisualStyleBackColor = true; this.btn_open.Click += new System.EventHandler(this.btn_open_Click); - // + // // com_port - // + // this.com_port.FormattingEnabled = true; this.com_port.Location = new System.Drawing.Point(90, 34); this.com_port.Name = "com_port"; this.com_port.Size = new System.Drawing.Size(130, 20); this.com_port.TabIndex = 1; - // + // // lbl_Lamp - // + // this.lbl_Lamp.AutoSize = true; this.lbl_Lamp.Location = new System.Drawing.Point(21, 37); this.lbl_Lamp.Name = "lbl_Lamp"; this.lbl_Lamp.Size = new System.Drawing.Size(29, 12); this.lbl_Lamp.TabIndex = 0; this.lbl_Lamp.Text = "路灯"; - // + // // Form1 - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; diff --git a/samples/p3-t2-人体红外ZigBee联动/Form1.Designer.cs b/samples/p3-t2-人体红外ZigBee联动/Form1.Designer.cs index 9b3017a..9b240a1 100644 --- a/samples/p3-t2-人体红外ZigBee联动/Form1.Designer.cs +++ b/samples/p3-t2-人体红外ZigBee联动/Form1.Designer.cs @@ -42,17 +42,17 @@ namespace 人体红外ZigBee联动 this.timer1 = new System.Windows.Forms.Timer(this.components); this.groupBox1.SuspendLayout(); this.SuspendLayout(); - // + // // lamp1 - // + // this.lamp1.BackColor = System.Drawing.Color.White; this.lamp1.Location = new System.Drawing.Point(32, 22); this.lamp1.Name = "lamp1"; this.lamp1.Size = new System.Drawing.Size(105, 185); this.lamp1.TabIndex = 0; - // + // // btn_lampOpen - // + // this.btn_lampOpen.Location = new System.Drawing.Point(32, 213); this.btn_lampOpen.Name = "btn_lampOpen"; this.btn_lampOpen.Size = new System.Drawing.Size(33, 23); @@ -60,9 +60,9 @@ namespace 人体红外ZigBee联动 this.btn_lampOpen.Text = "开"; this.btn_lampOpen.UseVisualStyleBackColor = true; this.btn_lampOpen.Click += new System.EventHandler(this.btn_lampOpen_Click); - // + // // btn_lampClose - // + // this.btn_lampClose.Location = new System.Drawing.Point(104, 213); this.btn_lampClose.Name = "btn_lampClose"; this.btn_lampClose.Size = new System.Drawing.Size(33, 23); @@ -70,9 +70,9 @@ namespace 人体红外ZigBee联动 this.btn_lampClose.Text = "关"; this.btn_lampClose.UseVisualStyleBackColor = true; this.btn_lampClose.Click += new System.EventHandler(this.btn_lampClose_Click); - // + // // groupBox1 - // + // this.groupBox1.Controls.Add(this.ch_bodyInfrared); this.groupBox1.Controls.Add(this.com_environment); this.groupBox1.Controls.Add(this.lbl_environment); @@ -85,9 +85,9 @@ namespace 人体红外ZigBee联动 this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "配置"; - // + // // ch_bodyInfrared - // + // this.ch_bodyInfrared.AutoSize = true; this.ch_bodyInfrared.Location = new System.Drawing.Point(25, 81); this.ch_bodyInfrared.Name = "ch_bodyInfrared"; @@ -96,26 +96,26 @@ namespace 人体红外ZigBee联动 this.ch_bodyInfrared.Text = "人体开关"; this.ch_bodyInfrared.UseVisualStyleBackColor = true; this.ch_bodyInfrared.Click += new System.EventHandler(this.ch_bodyInfrared_Click); - // + // // com_environment - // + // this.com_environment.FormattingEnabled = true; this.com_environment.Location = new System.Drawing.Point(90, 51); this.com_environment.Name = "com_environment"; this.com_environment.Size = new System.Drawing.Size(130, 20); this.com_environment.TabIndex = 3; - // + // // lbl_environment - // + // this.lbl_environment.AutoSize = true; this.lbl_environment.Location = new System.Drawing.Point(23, 54); this.lbl_environment.Name = "lbl_environment"; this.lbl_environment.Size = new System.Drawing.Size(53, 12); this.lbl_environment.TabIndex = 2; this.lbl_environment.Text = "环境采集"; - // + // // btn_open - // + // this.btn_open.Location = new System.Drawing.Point(145, 77); this.btn_open.Name = "btn_open"; this.btn_open.Size = new System.Drawing.Size(75, 23); @@ -123,31 +123,31 @@ namespace 人体红外ZigBee联动 this.btn_open.Text = "打开"; this.btn_open.UseVisualStyleBackColor = true; this.btn_open.Click += new System.EventHandler(this.btn_open_Click); - // + // // com_lamp - // + // this.com_lamp.FormattingEnabled = true; this.com_lamp.Location = new System.Drawing.Point(90, 26); this.com_lamp.Name = "com_lamp"; this.com_lamp.Size = new System.Drawing.Size(130, 20); this.com_lamp.TabIndex = 1; - // + // // lbl_lamp - // + // this.lbl_lamp.AutoSize = true; this.lbl_lamp.Location = new System.Drawing.Point(21, 29); this.lbl_lamp.Name = "lbl_lamp"; this.lbl_lamp.Size = new System.Drawing.Size(29, 12); this.lbl_lamp.TabIndex = 0; this.lbl_lamp.Text = "路灯"; - // + // // timer1 - // + // this.timer1.Interval = 5000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // + // // Form1 - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; diff --git a/web/src/App.vue b/web/src/App.vue index e213c20..32d7fd8 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,8 +1,9 @@ + + + + diff --git a/web/src/designer/PropertyGrid.vue b/web/src/designer/PropertyGrid.vue new file mode 100644 index 0000000..f7b1b24 --- /dev/null +++ b/web/src/designer/PropertyGrid.vue @@ -0,0 +1,389 @@ + + +