fix - 添加PLC未连接提示,理顺代码准备开工

master
SoulStar 3 months ago
parent e908ac42ab
commit f4a984f396

@ -0,0 +1,4 @@
[*.{cs,vb}]
# IDE0044: 添加只读修饰符
dotnet_style_readonly_field = false

@ -22,7 +22,7 @@ namespace HighWayIot.Plc.PlcHelper
int point = 0x600;
//选择是哪个小车
point += deviceNo * 32;
point += (deviceNo - 1) * 32;
//选择是小车的哪个点位
point += rgvStationNo;

@ -28,7 +28,7 @@ namespace HighWayIot.Rfid
}
/// <summary>
/// 接受02H盘点数据 (默认EPC 12位)
/// 接受02H盘点数据 (默认EPC 4位)
/// </summary>
/// <param name="bytes"></param>
/// <returns></returns>

@ -75,7 +75,7 @@ namespace HighWayIot.Winform.Business
public WorkStationBusiness()
{
_readerSetting = _readerService.GetReaderInfos();
CreateAllRFIDClient();
this.CreateAllRFIDClient();
_touchSocketTcpClient.GetMessageAction += ReciveRFIDSingal;
timer = new Timer(new System.Threading.TimerCallback(SingalMonitor), null, 0, 2000);
}

@ -15,6 +15,9 @@
<Role PageName = "日报表" RoleIndex = "9" />
<Role PageName = "机台物料信息绑定" RoleIndex = "10" />
<Role PageName = "生产排程" RoleIndex = "11" />
<Role PageName = "RFID参数配置" RoleIndex = "12" />
<Role PageName = "设备参数配置" RoleIndex = "13" />
<Role PageName = "PLC测试页面" RoleIndex = "14" />
</RoleConfig>
</root>

@ -249,6 +249,7 @@ namespace HighWayIot.Winform.MainForm
this.DeviceParamManageToolStripMenuItem.Name = "DeviceParamManageToolStripMenuItem";
this.DeviceParamManageToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.DeviceParamManageToolStripMenuItem.Text = "设备参数配置";
this.DeviceParamManageToolStripMenuItem.Click += new System.EventHandler(this.StripMenuItemClick);
//
// UserControlTabs
//
@ -329,7 +330,7 @@ namespace HighWayIot.Winform.MainForm
// LogInformationToolStrip
//
this.LogInformationToolStrip.Name = "LogInformationToolStrip";
this.LogInformationToolStrip.Size = new System.Drawing.Size(1064, 17);
this.LogInformationToolStrip.Size = new System.Drawing.Size(1095, 17);
this.LogInformationToolStrip.Spring = true;
this.LogInformationToolStrip.Text = "message";
//
@ -370,7 +371,7 @@ namespace HighWayIot.Winform.MainForm
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "BaseForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "大连软控开炼机成型机数据管理系统";
this.Text = "厦门正新轮胎实心胎上位机";
this.MainMenu.ResumeLayout(false);
this.MainMenu.PerformLayout();
this.statusStrip1.ResumeLayout(false);

@ -144,7 +144,7 @@ namespace HighWayIot.Winform.MainForm
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "LoginForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "大连软控开炼机成型机数据管理系统 - 登录界面";
this.Text = "厦门正新轮胎实心胎上位机 - 登录界面";
this.Load += new System.EventHandler(this.LoginForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();

@ -59,7 +59,7 @@ namespace HighWayIot.Winform.MainForm
/// <param name="e"></param>
private void LoginForm_Load(object sender, EventArgs e)
{
Login_Click(sender, e);
//Login_Click(sender, e);
}
}
}

@ -111,6 +111,10 @@ namespace HighWayIot.Winform.UserControlPages
this.Position2RadioButton = new System.Windows.Forms.RadioButton();
this.Position1RadioButton = new System.Windows.Forms.RadioButton();
this.groupbox5 = new System.Windows.Forms.GroupBox();
this.PlcSpecNameLabel = new System.Windows.Forms.Label();
this.label34 = new System.Windows.Forms.Label();
this.PlcSpecNoLabel = new System.Windows.Forms.Label();
this.label32 = new System.Windows.Forms.Label();
this.label30 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
this.label29 = new System.Windows.Forms.Label();
@ -150,10 +154,6 @@ namespace HighWayIot.Winform.UserControlPages
this.UpdateWeightButton = new System.Windows.Forms.Button();
this.AddWeightButton = new System.Windows.Forms.Button();
this.DeleteWeightButton = new System.Windows.Forms.Button();
this.PlcSpecNoLabel = new System.Windows.Forms.Label();
this.label32 = new System.Windows.Forms.Label();
this.PlcSpecNameLabel = new System.Windows.Forms.Label();
this.label34 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.WeightDataGridView)).BeginInit();
this.ButtonPanel.SuspendLayout();
this.groupBox1.SuspendLayout();
@ -1058,6 +1058,46 @@ namespace HighWayIot.Winform.UserControlPages
this.groupbox5.TabStop = false;
this.groupbox5.Text = "公共参数";
//
// PlcSpecNameLabel
//
this.PlcSpecNameLabel.AutoSize = true;
this.PlcSpecNameLabel.Font = new System.Drawing.Font("宋体", 9F);
this.PlcSpecNameLabel.Location = new System.Drawing.Point(477, 143);
this.PlcSpecNameLabel.Name = "PlcSpecNameLabel";
this.PlcSpecNameLabel.Size = new System.Drawing.Size(23, 12);
this.PlcSpecNameLabel.TabIndex = 68;
this.PlcSpecNameLabel.Text = "N/A";
//
// label34
//
this.label34.AutoSize = true;
this.label34.Font = new System.Drawing.Font("宋体", 9F);
this.label34.Location = new System.Drawing.Point(397, 143);
this.label34.Name = "label34";
this.label34.Size = new System.Drawing.Size(83, 12);
this.label34.TabIndex = 67;
this.label34.Text = "PLC规格名称";
//
// PlcSpecNoLabel
//
this.PlcSpecNoLabel.AutoSize = true;
this.PlcSpecNoLabel.Font = new System.Drawing.Font("宋体", 9F);
this.PlcSpecNoLabel.Location = new System.Drawing.Point(477, 121);
this.PlcSpecNoLabel.Name = "PlcSpecNoLabel";
this.PlcSpecNoLabel.Size = new System.Drawing.Size(23, 12);
this.PlcSpecNoLabel.TabIndex = 66;
this.PlcSpecNoLabel.Text = "N/A";
//
// label32
//
this.label32.AutoSize = true;
this.label32.Font = new System.Drawing.Font("宋体", 9F);
this.label32.Location = new System.Drawing.Point(397, 121);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(71, 12);
this.label32.TabIndex = 65;
this.label32.Text = "PLC规格号";
//
// label30
//
this.label30.AutoSize = true;
@ -1444,46 +1484,6 @@ namespace HighWayIot.Winform.UserControlPages
this.DeleteWeightButton.UseVisualStyleBackColor = true;
this.DeleteWeightButton.Click += new System.EventHandler(this.DeleteWeightButton_Click);
//
// PlcSpecNoLabel
//
this.PlcSpecNoLabel.AutoSize = true;
this.PlcSpecNoLabel.Font = new System.Drawing.Font("宋体", 9F);
this.PlcSpecNoLabel.Location = new System.Drawing.Point(477, 121);
this.PlcSpecNoLabel.Name = "PlcSpecNoLabel";
this.PlcSpecNoLabel.Size = new System.Drawing.Size(23, 12);
this.PlcSpecNoLabel.TabIndex = 66;
this.PlcSpecNoLabel.Text = "N/A";
//
// label32
//
this.label32.AutoSize = true;
this.label32.Font = new System.Drawing.Font("宋体", 9F);
this.label32.Location = new System.Drawing.Point(397, 121);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(71, 12);
this.label32.TabIndex = 65;
this.label32.Text = "PLC规格号";
//
// PlcSpecNameLabel
//
this.PlcSpecNameLabel.AutoSize = true;
this.PlcSpecNameLabel.Font = new System.Drawing.Font("宋体", 9F);
this.PlcSpecNameLabel.Location = new System.Drawing.Point(477, 143);
this.PlcSpecNameLabel.Name = "PlcSpecNameLabel";
this.PlcSpecNameLabel.Size = new System.Drawing.Size(23, 12);
this.PlcSpecNameLabel.TabIndex = 68;
this.PlcSpecNameLabel.Text = "N/A";
//
// label34
//
this.label34.AutoSize = true;
this.label34.Font = new System.Drawing.Font("宋体", 9F);
this.label34.Location = new System.Drawing.Point(397, 143);
this.label34.Name = "label34";
this.label34.Size = new System.Drawing.Size(83, 12);
this.label34.TabIndex = 67;
this.label34.Text = "PLC规格名称";
//
// RecipeConfigPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

@ -117,13 +117,15 @@ namespace HighWayIot.Winform.UserControlPages
NowRecipeCode = RecipeDataGridView.Rows[0].Cells["RecipeCode"].Value.ToString();
InitPositionEntities();
if(PlcConnect.IsConnect1 == true)
{
//读取SPEC编号
PlcSpecNoLabel.Text = PlcConnect.ReadUInt321("D206").ToString();
//读取SPEC名称
PlcSpecNameLabel.Text = PlcConnect.ReadString1("D290", 10).Trim();
}
}
#region 配方信息
@ -1010,6 +1012,11 @@ namespace HighWayIot.Winform.UserControlPages
{
return;
}
if (!PlcConnect.IsConnect1)
{
MessageBox.Show("PLC未连接");
return;
}
GetPublicParaValue();
GetPrivateParaValue(GetSelectIndex());
if (recipeParaHelper.UploadToPLC(zxRecipeParaEntity, zxRecipePositionParaEntity))
@ -1035,6 +1042,11 @@ namespace HighWayIot.Winform.UserControlPages
{
return;
}
if (!PlcConnect.IsConnect1)
{
MessageBox.Show("PLC未连接");
return;
}
zxRecipePositionParaEntity = recipeParaHelper.DownLoadFormPlc(ref zxRecipeParaEntity);
SetPublicParaValue(zxRecipeParaEntity);
SetPrivateParaValue(zxRecipePositionParaEntity.First(x => x.Position == GetSelectIndex()));

@ -19,6 +19,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HighWayIot.TouchSocket", "H
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HighWayIot.Rfid", "HighWayIot.Rfid\HighWayIot.Rfid.csproj", "{29813574-49C0-4979-A5A6-47EB7C4288A0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A81E7321-F724-4581-BD1C-76916601470F}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

Loading…
Cancel
Save