项目 8 智慧校园管理平台:5 个任务的示例、自绘素材、WisdomCampus 数据库
- 示例 p8-t1…t5(代码逐个累加):主界面、校园环境界面、环境采集与分析(路灯手动 / 自动控制、 LED 推送、自动推送火情、7 天温度图表)、校园安防(入侵提示、摄像机方向、拍照入库)、历史图片 (按日期查询、左右切换),各有评分规则 - 按书补全参考工程里空着的"推送LED信息""自动控制",给"自动推送火情"绑定 CheckedChanged (书上第 23 步写成了 ch_autoLamp);任务 5 每次查询前清空 Keys - 素材:项目 8 的 20 多张图片全部自绘,名字和尺寸与教材一致(project8.py 生成 SVG, build-gallery.sh 渲染成 PNG;源文件移到 svg/) - 数据库 WisdomCampus 按教材的表结构建(EnvironmentData、SecurityData、Users),预置 7 天环境数据 - 测试:参考答案全部通过;没绑定"自动推送火情"、开灯换错背景图片时报出对应原因 - 文档:教材 8 个项目全部有示例,共 23 个 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b20db5721e
commit
65a1b3a81e
109 files changed
+7807
-9
No files matched your search
Generated
+142
@@ -0,0 +1,142 @@
|
||||
namespace 智慧校园
|
||||
{
|
||||
partial class Main
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.pic_exit = new System.Windows.Forms.PictureBox();
|
||||
this.pic_security = new System.Windows.Forms.PictureBox();
|
||||
this.pic_environment = new System.Windows.Forms.PictureBox();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_exit)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_security)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_environment)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(53)))), ((int)(((byte)(147)))), ((int)(((byte)(237)))));
|
||||
this.panel1.Controls.Add(this.pictureBox1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(1018, 100);
|
||||
this.panel1.TabIndex = 0;
|
||||
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = global::智慧校园.Properties.Resources.ico_title;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(57, 23);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(197, 54);
|
||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackgroundImage = global::智慧校园.Properties.Resources.bg_home;
|
||||
this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.panel2.Controls.Add(this.pic_exit);
|
||||
this.panel2.Controls.Add(this.pic_security);
|
||||
this.panel2.Controls.Add(this.pic_environment);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 100);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(1018, 516);
|
||||
this.panel2.TabIndex = 1;
|
||||
this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
|
||||
//
|
||||
// pic_exit
|
||||
//
|
||||
this.pic_exit.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pic_exit.Image = global::智慧校园.Properties.Resources.icon_04;
|
||||
this.pic_exit.Location = new System.Drawing.Point(660, 124);
|
||||
this.pic_exit.Name = "pic_exit";
|
||||
this.pic_exit.Size = new System.Drawing.Size(180, 210);
|
||||
this.pic_exit.TabIndex = 6;
|
||||
this.pic_exit.TabStop = false;
|
||||
this.pic_exit.Click += new System.EventHandler(this.pic_exit_Click);
|
||||
//
|
||||
// pic_security
|
||||
//
|
||||
this.pic_security.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pic_security.Image = global::智慧校园.Properties.Resources.icon_03;
|
||||
this.pic_security.Location = new System.Drawing.Point(404, 124);
|
||||
this.pic_security.Name = "pic_security";
|
||||
this.pic_security.Size = new System.Drawing.Size(180, 210);
|
||||
this.pic_security.TabIndex = 5;
|
||||
this.pic_security.TabStop = false;
|
||||
//
|
||||
// pic_environment
|
||||
//
|
||||
this.pic_environment.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pic_environment.Image = global::智慧校园.Properties.Resources.icon_02;
|
||||
this.pic_environment.Location = new System.Drawing.Point(133, 124);
|
||||
this.pic_environment.Name = "pic_environment";
|
||||
this.pic_environment.Size = new System.Drawing.Size(180, 210);
|
||||
this.pic_environment.TabIndex = 4;
|
||||
this.pic_environment.TabStop = false;
|
||||
//
|
||||
// Main
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1018, 616);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "Main";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Form1";
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_exit)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_security)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pic_environment)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.PictureBox pic_exit;
|
||||
private System.Windows.Forms.PictureBox pic_security;
|
||||
private System.Windows.Forms.PictureBox pic_environment;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
namespace 智慧校园
|
||||
{
|
||||
public partial class Main : Form
|
||||
{
|
||||
public Main()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void panel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void panel2_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void pic_exit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace 智慧校园
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Main());
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 项目资源(平台素材库)。在"项目资源"里添加或移除,不要手动修改这个文件。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace 智慧校园.Properties {
|
||||
|
||||
/// <summary>
|
||||
/// 项目资源:Properties.Resources.资源名
|
||||
/// </summary>
|
||||
internal class Resources {
|
||||
|
||||
/// <summary>标题:智慧校园</summary>
|
||||
internal static System.Drawing.Bitmap ico_title {
|
||||
get { return global::Sim.Host.ProjectResources.Image("ico_title.png"); }
|
||||
}
|
||||
|
||||
/// <summary>主界面背景:校园</summary>
|
||||
internal static System.Drawing.Bitmap bg_home {
|
||||
get { return global::Sim.Host.ProjectResources.Image("bg_home.png"); }
|
||||
}
|
||||
|
||||
/// <summary>图标:校园环境</summary>
|
||||
internal static System.Drawing.Bitmap icon_02 {
|
||||
get { return global::Sim.Host.ProjectResources.Image("icon_02.png"); }
|
||||
}
|
||||
|
||||
/// <summary>图标:校园安防</summary>
|
||||
internal static System.Drawing.Bitmap icon_03 {
|
||||
get { return global::Sim.Host.ProjectResources.Image("icon_03.png"); }
|
||||
}
|
||||
|
||||
/// <summary>图标:退出</summary>
|
||||
internal static System.Drawing.Bitmap icon_04 {
|
||||
get { return global::Sim.Host.ProjectResources.Image("icon_04.png"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
# 评分规则:书上评价表的功能项。每项单独启动一次程序,按步骤操作,核对结果。
|
||||
# 格式说明见 server/src/grading/checks.ts
|
||||
- title: 主界面显示标题和三个功能入口
|
||||
steps:
|
||||
- expect: { control: pictureBox1, image: ico_title, desc: 显示"智慧校园"标题图(ico_title) }
|
||||
- expect: { control: panel2, background: bg_home, desc: 背景是校园图片(bg_home) }
|
||||
- expect: { control: pic_environment, image: icon_02, desc: 显示"校园环境"图标(icon_02) }
|
||||
- expect: { control: pic_security, image: icon_03, desc: 显示"校园安防"图标(icon_03) }
|
||||
- expect: { control: pic_exit, image: icon_04, desc: 显示"退出"图标(icon_04) }
|
||||
|
||||
- title: 实现退出功能
|
||||
steps:
|
||||
- click: pic_exit
|
||||
- expect: { exited: true, desc: 点"退出"后关闭主窗体、程序退出 }
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"title": "项目8 任务1 制作管理平台的主界面",
|
||||
"source": "教材书 p157–159,界面和代码取自配套参考工程;图片是平台素材库里自绘的同名素材(尺寸和教材一致)"
|
||||
}
|
||||
Reference in new issue
Block a user