Commit 75f52895 LN

轨道调宽最宽不能超过原点

1 个父辈 abf7198d
...@@ -194,6 +194,19 @@ namespace TSA_V.DeviceLibrary ...@@ -194,6 +194,19 @@ namespace TSA_V.DeviceLibrary
return WPositionMap[targetWidth]; return WPositionMap[targetWidth];
} }
int targetP = (targetWidth - Line_HomeWidth) * Line_ChangeValue; int targetP = (targetWidth - Line_HomeWidth) * Line_ChangeValue;
//轨道位置不能超过原点
if (Line_ChangeValue > 0 && targetP > 0)
{
LogUtil.info($"调宽{targetWidth} 计算目标位置{targetP} 转换系数{Line_ChangeValue},不能超过原点,位置改为=0");
return 0;
}
else if (Line_ChangeValue < 0 && targetP < 0)
{
LogUtil.info($"调宽{targetWidth} 计算目标位置{targetP} 转换系数{Line_ChangeValue},不能超过原点,位置改为=0");
return 0;
}
return targetP; return targetP;
} }
public static Dictionary<int , int> WPositionMap = null; public static Dictionary<int , int> WPositionMap = null;
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
this.numTarget = new System.Windows.Forms.NumericUpDown(); this.numTarget = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnHomeM = new System.Windows.Forms.Button();
this.numChangeValue = new System.Windows.Forms.NumericUpDown(); this.numChangeValue = new System.Windows.Forms.NumericUpDown();
this.numHomeWidth = new System.Windows.Forms.NumericUpDown(); this.numHomeWidth = new System.Windows.Forms.NumericUpDown();
this.numSlv = new System.Windows.Forms.NumericUpDown(); this.numSlv = new System.Windows.Forms.NumericUpDown();
...@@ -52,7 +53,6 @@ ...@@ -52,7 +53,6 @@
this.btnDSave = new System.Windows.Forms.Button(); this.btnDSave = new System.Windows.Forms.Button();
this.txtWP = new System.Windows.Forms.TextBox(); this.txtWP = new System.Windows.Forms.TextBox();
this.lbWidthMap = new System.Windows.Forms.ListBox(); this.lbWidthMap = new System.Windows.Forms.ListBox();
this.btnHomeM = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numTarget)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numTarget)).BeginInit();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
...@@ -161,6 +161,7 @@ ...@@ -161,6 +161,7 @@
0, 0,
0}); 0});
this.numTarget.ValueChanged += new System.EventHandler(this.numTarget_ValueChanged); this.numTarget.ValueChanged += new System.EventHandler(this.numTarget_ValueChanged);
this.numTarget.Leave += new System.EventHandler(this.numTarget_Leave);
// //
// label5 // label5
// //
...@@ -189,6 +190,18 @@ ...@@ -189,6 +190,18 @@
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "轨道配置"; this.groupBox2.Text = "轨道配置";
// //
// btnHomeM
//
this.btnHomeM.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHomeM.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHomeM.Location = new System.Drawing.Point(32, 172);
this.btnHomeM.Name = "btnHomeM";
this.btnHomeM.Size = new System.Drawing.Size(128, 40);
this.btnHomeM.TabIndex = 296;
this.btnHomeM.Text = "原点返回";
this.btnHomeM.UseVisualStyleBackColor = true;
this.btnHomeM.Click += new System.EventHandler(this.btnHomeM_Click);
//
// numChangeValue // numChangeValue
// //
this.numChangeValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.numChangeValue.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -364,18 +377,6 @@ ...@@ -364,18 +377,6 @@
this.lbWidthMap.TabIndex = 319; this.lbWidthMap.TabIndex = 319;
this.lbWidthMap.SelectedIndexChanged += new System.EventHandler(this.listDetitalP2_SelectedIndexChanged); this.lbWidthMap.SelectedIndexChanged += new System.EventHandler(this.listDetitalP2_SelectedIndexChanged);
// //
// btnHomeM
//
this.btnHomeM.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHomeM.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHomeM.Location = new System.Drawing.Point(32, 172);
this.btnHomeM.Name = "btnHomeM";
this.btnHomeM.Size = new System.Drawing.Size(128, 40);
this.btnHomeM.TabIndex = 296;
this.btnHomeM.Text = "原点返回";
this.btnHomeM.UseVisualStyleBackColor = true;
this.btnHomeM.Click += new System.EventHandler(this.btnHomeM_Click);
//
// FrmChangeWidth // FrmChangeWidth
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......
...@@ -165,5 +165,14 @@ namespace TSA_V ...@@ -165,5 +165,14 @@ namespace TSA_V
LogUtil.info(Name+ "点击 原点返回"); LogUtil.info(Name+ "点击 原点返回");
PUSICANControl.HomeMove(LWidthManager.Line_NodeAddr, true); PUSICANControl.HomeMove(LWidthManager.Line_NodeAddr, true);
} }
private void numTarget_Leave(object sender, EventArgs e)
{
int value = (int)numTarget.Value;
int p = LWidthManager.GetWidthPosition(value);
txtTargetPosition.Text = p.ToString();
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!