This commit is contained in:
2025-12-11 10:34:27 +08:00
parent a4cbc24e25
commit b3b165b521
15 changed files with 63 additions and 23 deletions

View File

@ -290,7 +290,7 @@ using Newtonsoft.Json;
try try
{ {
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(WindowsFormsApp.Form1.apiUrl + "/sdk/v1/dotmatrix/pen/add", content); HttpResponseMessage response = await client.PostAsync(WindowsFormsApp.InteractiveClassroomLocalDataScan.apiUrl + "/sdk/v1/dotmatrix/pen/add", content);
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync()); ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync());
if (sr.success) if (sr.success)

32
Form1.Designer.cs generated
View File

@ -1,6 +1,6 @@
namespace WindowsFormsApp namespace WindowsFormsApp
{ {
partial class Form1 partial class InteractiveClassroomLocalDataScan
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -30,6 +30,7 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -47,7 +48,6 @@
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timer2 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components);
this.button1 = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -61,10 +61,20 @@
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 360); this.flowLayoutPanel1.Size = new System.Drawing.Size(491, 364);
this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.TabIndex = 0;
this.flowLayoutPanel1.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel1_Paint); this.flowLayoutPanel1.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel1_Paint);
// //
// button1
//
this.button1.Location = new System.Drawing.Point(3, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "同步数据";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
@ -181,25 +191,15 @@
this.timer2.Interval = 1000; this.timer2.Interval = 1000;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick); this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
// //
// button1 // InteractiveClassroomLocalDataScan
//
this.button1.Location = new System.Drawing.Point(3, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "同步数据";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(600, 360); this.ClientSize = new System.Drawing.Size(491, 364);
this.ContextMenuStrip = this.contextMenuStrip1; this.ContextMenuStrip = this.contextMenuStrip1;
this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.flowLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "Form1"; this.Name = "InteractiveClassroomLocalDataScan";
this.Text = "Form1"; this.Text = "Form1";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);

View File

@ -21,7 +21,7 @@ using System.Net.Http;
using System.Xml.Linq; using System.Xml.Linq;
namespace WindowsFormsApp namespace WindowsFormsApp
{ {
public partial class Form1 : Form public partial class InteractiveClassroomLocalDataScan : Form
{ {
static DigitalPenAP digitalPenAP; static DigitalPenAP digitalPenAP;
@ -35,7 +35,7 @@ namespace WindowsFormsApp
//所有已连接笔的绘制窗口 //所有已连接笔的绘制窗口
Dictionary<string, PenDraw> AllPenDrawsDic = new Dictionary<string, PenDraw>(); Dictionary<string, PenDraw> AllPenDrawsDic = new Dictionary<string, PenDraw>();
public Form1() public InteractiveClassroomLocalDataScan()
{ {
InitializeComponent(); InitializeComponent();
// 加载 XML 文件 // 加载 XML 文件
@ -46,6 +46,7 @@ namespace WindowsFormsApp
SaveDataOperater.DeletePenStatus(); SaveDataOperater.DeletePenStatus();
//SaveDataOperater.DropAllPenTable(); //SaveDataOperater.DropAllPenTable();
WriteData(); WriteData();
this.Text = "互动课堂数据采集";
} }
public static async void WriteData() public static async void WriteData()
@ -727,7 +728,7 @@ namespace WindowsFormsApp
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(WindowsFormsApp.Form1.apiUrl + "/sdk/v1/dotmatrix/pen/report", content); HttpResponseMessage response = await client.PostAsync(WindowsFormsApp.InteractiveClassroomLocalDataScan.apiUrl + "/sdk/v1/dotmatrix/pen/report", content);
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync()); ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync());
} }
@ -755,7 +756,7 @@ namespace WindowsFormsApp
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
var content = new StringContent("", Encoding.UTF8, "application/json"); var content = new StringContent("", Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.GetAsync(WindowsFormsApp.Form1.apiUrl + "/sdk/v1/class/student/pens?classId=" + ClassID); HttpResponseMessage response = await client.GetAsync(WindowsFormsApp.InteractiveClassroomLocalDataScan.apiUrl + "/sdk/v1/class/student/pens?classId=" + ClassID);
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync()); ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync());
if (sr.success) if (sr.success)
@ -771,7 +772,7 @@ namespace WindowsFormsApp
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
var content = new StringContent("", Encoding.UTF8, "application/json"); var content = new StringContent("", Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.GetAsync(WindowsFormsApp.Form1.apiUrl + "/sdk/v1/dotmatrix/page/sync"); HttpResponseMessage response = await client.GetAsync(WindowsFormsApp.InteractiveClassroomLocalDataScan.apiUrl + "/sdk/v1/dotmatrix/page/sync");
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync()); ServerResult sr = JsonConvert.DeserializeObject<ServerResult>(await response.Content.ReadAsStringAsync());

View File

@ -15,7 +15,7 @@ namespace WindowsFormsApp
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new InteractiveClassroomLocalDataScan());
} }
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
fe4507efffa991a223aa4b00f56223e928a22ad38ba4bdb32bfe7b4707e8e9d8

View File

@ -0,0 +1,38 @@
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\WindowsFormsApp.exe.config
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\WindowsFormsApp.exe
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\WindowsFormsApp.pdb
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Dapper.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Fleck.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Newtonsoft.Json.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Buffers.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.IO.Pipelines.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Memory.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Numerics.Vectors.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Text.Encodings.Web.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Text.Json.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Threading.Tasks.Extensions.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\TStudyDigitalPen.AP.dll
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Dapper.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\Newtonsoft.Json.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Buffers.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.IO.Pipelines.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Memory.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Numerics.Vectors.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Text.Encodings.Web.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Text.Json.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\System.Threading.Tasks.Extensions.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\bin\Debug\TStudyDigitalPen.AP.xml
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\InteractiveClassroomLocalDataScan.csproj.AssemblyReference.cache
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.InteractiveClassroomLocalDataScan.resources
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.FrmSetPenName.resources
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.PenDraw.resources
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.Properties.Resources.resources
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\InteractiveClassroomLocalDataScan.csproj.GenerateResource.cache
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\InteractiveClassroomLocalDataScan.csproj.CoreCompileInputs.cache
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\Interact.494DFB82.Up2Date
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.exe
D:\tstudy_digital_pen_sdk_for_ap_1.7.5(2)\tstudy_digital_pen_sdk_for_ap_1.7.5\LiteVersionSDK\examples\interaction\Interaction_DigitalPenAP_Csharp_form_demo\obj\x86\Debug\WindowsFormsApp.pdb

Binary file not shown.

Binary file not shown.