master
杨威 1 month ago
parent 370e1445f7
commit 1ffcf1ba8d

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DNSD_Controls</RootNamespace>
<AssemblyName>DNSD_Controls</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HslLanternSimple.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -0,0 +1,300 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Net;
using System.Windows.Forms;
namespace DNSD_Controls
{
/// <summary>
/// 一个简约的灯控件,支持纯色和渐变色的设置
/// </summary>
// Token: 0x02000041 RID: 65
[Description("一个圆形的信号灯,支持设置颜色,是否渐变")]
public class HslLanternSimple : UserControl
{
/// <summary>
/// 实例化一个灯控件信息
/// </summary>
// Token: 0x0600058C RID: 1420 RVA: 0x00036A68 File Offset: 0x00034C68
public HslLanternSimple()
{
this.InitializeComponent();
this.sf = new StringFormat();
this.sf.Alignment = StringAlignment.Center;
this.sf.LineAlignment = StringAlignment.Center;
base.SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
base.SetStyle(ControlStyles.ResizeRedraw, true);
base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
}
/// <inheritdoc />
// Token: 0x0600058D RID: 1421 RVA: 0x00036B18 File Offset: 0x00034D18
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
this.PaintHslControls(e.Graphics, base.Width, base.Height);
base.OnPaint(e);
}
/// <inheritdoc cref="M:HslControls.HslArrow.PaintHslControls(System.Drawing.Graphics,System.Single,System.Single)" />
// Token: 0x0600058E RID: 1422 RVA: 0x00036B7C File Offset: 0x00034D7C
public void PaintHslControls(Graphics g, int width, int height)
{
if (true)
{
int num = Math.Min(width, height);
num--;
Point point = new Point(num / 2, num / 2);
g.TranslateTransform((float)point.X, (float)point.Y);
float num2 = (float)(point.X * 17) / 20f;
float num3 = (float)point.X / 20f;
bool flag2 = num2 < 2f;
if (!flag2)
{
RectangleF rect = new RectangleF(-num2 - 2f * num3, -num2 - 2f * num3, 2f * num2 + 4f * num3, 2f * num2 + 4f * num3);
RectangleF rect2 = new RectangleF(-num2, -num2, 2f * num2, 2f * num2);
using (Pen pen = new Pen(this.colorBackground, num3))
{
g.DrawEllipse(pen, rect);
}
bool flag3 = !this.UseGradientColor;
if (flag3)
{
g.FillEllipse(this.brushBackground, rect2);
}
else
{
GraphicsPath graphicsPath = new GraphicsPath();
graphicsPath.AddEllipse(-num2, -num2, 2f * num2, 2f * num2);
PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath);
pathGradientBrush.CenterPoint = new Point(0, 0);
pathGradientBrush.InterpolationColors = new ColorBlend
{
Positions = new float[]
{
0f,
1f
},
Colors = new Color[]
{
this.colorBackground,
this.centerColor
}
};
g.FillEllipse(pathGradientBrush, rect2);
using (Pen pen2 = new Pen(this.colorBackground))
{
g.DrawEllipse(pen2, -num2, -num2, 2f * num2, 2f * num2);
}
pathGradientBrush.Dispose();
graphicsPath.Dispose();
}
g.TranslateTransform((float)(-(float)point.X), (float)(-(float)point.Y));
bool flag4 = height - num > 0;
if (flag4)
{
bool flag5 = !string.IsNullOrEmpty(this.Text);
if (flag5)
{
using (Brush brush = new SolidBrush(this.ForeColor))
{
g.DrawString(this.Text, this.Font, brush, new Rectangle(0, num, num, height - num), this.sf);
}
}
}
}
}
}
/// <summary>
/// 获取或设置控件的背景色
/// </summary>
// Token: 0x170001B6 RID: 438
// (get) Token: 0x0600058F RID: 1423 RVA: 0x00036E34 File Offset: 0x00035034
// (set) Token: 0x06000590 RID: 1424 RVA: 0x00036E3C File Offset: 0x0003503C
[Browsable(true)]
[Description("获取或设置控件的背景色")]
[Category("HslControls")]
[DefaultValue(typeof(Color), "Transparent")]
[EditorBrowsable(EditorBrowsableState.Always)]
public override Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor = value;
}
}
/// <summary>
/// 获取或设置灯信号的前景色
/// </summary>
// Token: 0x170001B7 RID: 439
// (get) Token: 0x06000591 RID: 1425 RVA: 0x00036E48 File Offset: 0x00035048
// (set) Token: 0x06000592 RID: 1426 RVA: 0x00036E60 File Offset: 0x00035060
[Browsable(true)]
[Description("获取或设置信号灯的背景色")]
[Category("HslControls")]
[DefaultValue(typeof(Color), "LimeGreen")]
public Color LanternBackground
{
get
{
return this.colorBackground;
}
set
{
this.colorBackground = value;
Brush brush = this.brushBackground;
if (brush != null)
{
brush.Dispose();
}
this.brushBackground = new SolidBrush(this.colorBackground);
base.Invalidate();
}
}
/// <summary>
/// 获取或设置中心点的颜色当且仅当UseGradientColor属性为True时生效
/// </summary>
// Token: 0x170001B8 RID: 440
// (get) Token: 0x06000593 RID: 1427 RVA: 0x00036E94 File Offset: 0x00035094
// (set) Token: 0x06000594 RID: 1428 RVA: 0x00036EAC File Offset: 0x000350AC
[Browsable(true)]
[Description("获取或设置中心点的颜色当且仅当UseGradientColor属性为True时生效")]
[Category("HslControls")]
[DefaultValue(typeof(Color), "White")]
public Color CenterBackground
{
get
{
return this.centerColor;
}
set
{
this.centerColor = value;
base.Invalidate();
}
}
/// <summary>
/// 获取或设置当前的灯信号是否启用渐变色的画刷
/// </summary>
// Token: 0x170001B9 RID: 441
// (get) Token: 0x06000595 RID: 1429 RVA: 0x00036EC0 File Offset: 0x000350C0
// (set) Token: 0x06000596 RID: 1430 RVA: 0x00036ED8 File Offset: 0x000350D8
[Browsable(true)]
[Description("获取或设置当前的灯信号是否启用渐变色的画刷")]
[Category("HslControls")]
[DefaultValue(false)]
public bool UseGradientColor
{
get
{
return this.isUseGradientColor;
}
set
{
this.isUseGradientColor = value;
base.Invalidate();
}
}
/// <summary>
/// 获取或设置当前控件的文本
/// </summary>
// Token: 0x170001BA RID: 442
// (get) Token: 0x06000597 RID: 1431 RVA: 0x00036EEC File Offset: 0x000350EC
// (set) Token: 0x06000598 RID: 1432 RVA: 0x00036F04 File Offset: 0x00035104
[Browsable(true)]
[Description("获取或设置当前控件的文本")]
[Category("HslControls")]
[EditorBrowsable(EditorBrowsableState.Always)]
[Bindable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
base.Invalidate();
}
}
/// <summary>
/// 触发一次鼠标点击的事件
/// </summary>
// Token: 0x06000599 RID: 1433 RVA: 0x00036F16 File Offset: 0x00035116
public void PerformClick()
{
this.OnClick(new EventArgs());
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
// Token: 0x0600059A RID: 1434 RVA: 0x00036F28 File Offset: 0x00035128
protected override void Dispose(bool disposing)
{
bool flag = disposing && this.components != null;
if (flag)
{
this.components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
// Token: 0x0600059B RID: 1435 RVA: 0x00036F60 File Offset: 0x00035160
private void InitializeComponent()
{
base.SuspendLayout();
base.AutoScaleMode = AutoScaleMode.None;
this.BackColor = Color.Transparent;
base.Name = "HslLanternSimple";
base.Size = new Size(78, 94);
base.ResumeLayout(false);
}
// Token: 0x040002C7 RID: 711
private Color colorBackground = Color.LimeGreen;
// Token: 0x040002C8 RID: 712
private Brush brushBackground = new SolidBrush(Color.LimeGreen);
// Token: 0x040002C9 RID: 713
private StringFormat sf = null;
// Token: 0x040002CA RID: 714
private Color centerColor = Color.White;
// Token: 0x040002CB RID: 715
private bool isUseGradientColor = false;
/// <summary>
/// 必需的设计器变量。
/// </summary>
// Token: 0x040002CC RID: 716
private IContainer components = null;
}
}

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DNSD_Controls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DNSD_Controls")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -58,6 +58,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Mapper\StudentMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SQLiteContext.cs" />
<Compile Include="SqlLiteTool.cs" />

@ -1,7 +1,13 @@
namespace DNSD_DB.Mapper
using Chloe.Entity;
namespace DNSD_DB.Mapper
{
public class StudentMap
public class StudentMap:EntityTypeBuilder<Student>
{
public StudentMap()
{
this.MapTo("Student");
this.Property(a => a.ID).IsAutoIncrement().IsPrimaryKey();
}
}
}

@ -1,7 +1,9 @@
using Chloe;
using Chloe.Infrastructure;
using Chloe.RDBMS.DDL;
using Chloe.SQLite;
using Chloe.SQLite.DDL;
using DNSD_DB.Mapper;
namespace DNSD_DB
{
@ -11,6 +13,7 @@ namespace DNSD_DB
public static void CreateTable(string db)
{
DbConfiguration.UseTypeBuilders(typeof(StudentMap));
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
new SQLiteTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
}

@ -11,7 +11,7 @@ namespace DNSD_DB
[Column(IsPrimaryKey = true)]
[AutoIncrement]
[DisplayName("学生ID")]
public int StudentID { get; set; }
public int ID { get; set; }
/// <summary>
/// 班级ID

@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NDSD_TouchSocket", "NDSD-To
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DNSD_DB", "DNSD_DB\DNSD_DB.csproj", "{CA803C5B-CD45-478C-B427-DDA95C4BDFC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DNSD_Controls", "DNSD_Controls\DNSD_Controls.csproj", "{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -27,6 +29,10 @@ Global
{CA803C5B-CD45-478C-B427-DDA95C4BDFC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA803C5B-CD45-478C-B427-DDA95C4BDFC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA803C5B-CD45-478C-B427-DDA95C4BDFC3}.Release|Any CPU.Build.0 = Release|Any CPU
{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -104,6 +104,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DNSD_Controls\DNSD_Controls.csproj">
<Project>{EBD5CF3A-6B21-4EAD-8084-DC4D7DCB9483}</Project>
<Name>DNSD_Controls</Name>
</ProjectReference>
<ProjectReference Include="..\DNSD_DB\DNSD_DB.csproj">
<Project>{ca803c5b-cd45-478c-b427-dda95c4bdfc3}</Project>
<Name>DNSD_DB</Name>
@ -114,9 +118,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="ndsd.db">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ndsd.db" />
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

@ -44,9 +44,10 @@
//
// DOpenButton
//
this.DOpenButton.Location = new System.Drawing.Point(65, 48);
this.DOpenButton.Location = new System.Drawing.Point(73, 58);
this.DOpenButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DOpenButton.Name = "DOpenButton";
this.DOpenButton.Size = new System.Drawing.Size(100, 30);
this.DOpenButton.Size = new System.Drawing.Size(112, 36);
this.DOpenButton.TabIndex = 0;
this.DOpenButton.Text = "开启";
this.DOpenButton.UseVisualStyleBackColor = true;
@ -54,9 +55,10 @@
//
// DCloseButton
//
this.DCloseButton.Location = new System.Drawing.Point(65, 84);
this.DCloseButton.Location = new System.Drawing.Point(73, 101);
this.DCloseButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DCloseButton.Name = "DCloseButton";
this.DCloseButton.Size = new System.Drawing.Size(100, 30);
this.DCloseButton.Size = new System.Drawing.Size(112, 36);
this.DCloseButton.TabIndex = 1;
this.DCloseButton.Text = "关闭";
this.DCloseButton.UseVisualStyleBackColor = true;
@ -64,17 +66,19 @@
//
// DNoTextBox
//
this.DNoTextBox.Location = new System.Drawing.Point(65, 17);
this.DNoTextBox.Location = new System.Drawing.Point(73, 20);
this.DNoTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DNoTextBox.Name = "DNoTextBox";
this.DNoTextBox.Size = new System.Drawing.Size(100, 25);
this.DNoTextBox.Size = new System.Drawing.Size(112, 28);
this.DNoTextBox.TabIndex = 2;
this.DNoTextBox.Text = "1";
//
// DOpenAll
//
this.DOpenAll.Location = new System.Drawing.Point(65, 120);
this.DOpenAll.Location = new System.Drawing.Point(73, 144);
this.DOpenAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DOpenAll.Name = "DOpenAll";
this.DOpenAll.Size = new System.Drawing.Size(100, 30);
this.DOpenAll.Size = new System.Drawing.Size(112, 36);
this.DOpenAll.TabIndex = 3;
this.DOpenAll.Text = "全部开启";
this.DOpenAll.UseVisualStyleBackColor = true;
@ -82,9 +86,10 @@
//
// DCloseAll
//
this.DCloseAll.Location = new System.Drawing.Point(65, 156);
this.DCloseAll.Location = new System.Drawing.Point(73, 187);
this.DCloseAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DCloseAll.Name = "DCloseAll";
this.DCloseAll.Size = new System.Drawing.Size(100, 30);
this.DCloseAll.Size = new System.Drawing.Size(112, 36);
this.DCloseAll.TabIndex = 4;
this.DCloseAll.Text = "全部关闭";
this.DCloseAll.UseVisualStyleBackColor = true;
@ -92,17 +97,19 @@
//
// DelayTimeTextBox
//
this.DelayTimeTextBox.Location = new System.Drawing.Point(240, 17);
this.DelayTimeTextBox.Location = new System.Drawing.Point(270, 20);
this.DelayTimeTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DelayTimeTextBox.Name = "DelayTimeTextBox";
this.DelayTimeTextBox.Size = new System.Drawing.Size(100, 25);
this.DelayTimeTextBox.Size = new System.Drawing.Size(112, 28);
this.DelayTimeTextBox.TabIndex = 7;
this.DelayTimeTextBox.Text = "1";
//
// DelayButton
//
this.DelayButton.Location = new System.Drawing.Point(240, 48);
this.DelayButton.Location = new System.Drawing.Point(270, 58);
this.DelayButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DelayButton.Name = "DelayButton";
this.DelayButton.Size = new System.Drawing.Size(100, 30);
this.DelayButton.Size = new System.Drawing.Size(112, 36);
this.DelayButton.TabIndex = 5;
this.DelayButton.Text = "计时开启";
this.DelayButton.UseVisualStyleBackColor = true;
@ -111,26 +118,27 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 20);
this.label1.Location = new System.Drawing.Point(14, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 15);
this.label1.Size = new System.Drawing.Size(53, 18);
this.label1.TabIndex = 9;
this.label1.Text = "DO No";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(171, 20);
this.label3.Location = new System.Drawing.Point(192, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(63, 15);
this.label3.Size = new System.Drawing.Size(71, 18);
this.label3.TabIndex = 11;
this.label3.Text = "DO Time";
//
// AllTimeButton
//
this.AllTimeButton.Location = new System.Drawing.Point(240, 84);
this.AllTimeButton.Location = new System.Drawing.Point(270, 101);
this.AllTimeButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.AllTimeButton.Name = "AllTimeButton";
this.AllTimeButton.Size = new System.Drawing.Size(100, 30);
this.AllTimeButton.Size = new System.Drawing.Size(112, 36);
this.AllTimeButton.TabIndex = 12;
this.AllTimeButton.Text = "全部计时开";
this.AllTimeButton.UseVisualStyleBackColor = true;
@ -138,26 +146,27 @@
//
// DelaySpanTextBox
//
this.DelaySpanTextBox.Location = new System.Drawing.Point(240, 161);
this.DelaySpanTextBox.Location = new System.Drawing.Point(270, 193);
this.DelaySpanTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.DelaySpanTextBox.Name = "DelaySpanTextBox";
this.DelaySpanTextBox.Size = new System.Drawing.Size(100, 25);
this.DelaySpanTextBox.Size = new System.Drawing.Size(112, 28);
this.DelaySpanTextBox.TabIndex = 13;
this.DelaySpanTextBox.Text = "100";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(228, 143);
this.label2.Location = new System.Drawing.Point(256, 172);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(129, 15);
this.label2.Size = new System.Drawing.Size(152, 18);
this.label2.TabIndex = 14;
this.label2.Text = "全启间隔时间(ms)";
//
// ScrewdriverTest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(385, 202);
this.ClientSize = new System.Drawing.Size(433, 407);
this.Controls.Add(this.label2);
this.Controls.Add(this.DelaySpanTextBox);
this.Controls.Add(this.AllTimeButton);
@ -170,6 +179,7 @@
this.Controls.Add(this.DNoTextBox);
this.Controls.Add(this.DCloseButton);
this.Controls.Add(this.DOpenButton);
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "ScrewdriverTest";
this.Text = "螺丝刀测试";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ScrewdriverTest_FormClosed);

@ -9,6 +9,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using DNSD_DB;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
@ -23,6 +24,7 @@ namespace NDSD_Screwdriver
public ScrewdriverTest()
{
InitializeComponent();
SqlLiteTool.CreateTable(AppTool.GetDb());
DOperate = new DOperate();
if(!server.ServerOpen("192.168.0.101", "6001"))
{
@ -117,10 +119,8 @@ namespace NDSD_Screwdriver
private void AllTimeButton_Click(object sender, EventArgs e)
{
int span;
int.TryParse(DelaySpanTextBox.Text, out span);
int time;
int.TryParse(DelayTimeTextBox.Text, out time);
int.TryParse(DelaySpanTextBox.Text, out var span);
int.TryParse(DelayTimeTextBox.Text, out var time);
if (span <= 0 || time <= 0)
{
MessageBox.Show("属性值无效!");

Binary file not shown.
Loading…
Cancel
Save