Commit 90ec3dc4 几米阳光

界面显示增加密码框。

旋转轴和升降轴移动时,叉子需要在待机位
1 个父辈 c2ca5243
...@@ -85,6 +85,12 @@ ...@@ -85,6 +85,12 @@
<Compile Include="FrmIOStatus.Designer.cs"> <Compile Include="FrmIOStatus.Designer.cs">
<DependentUpon>FrmIOStatus.cs</DependentUpon> <DependentUpon>FrmIOStatus.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmPwd.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmPwd.Designer.cs">
<DependentUpon>FrmPwd.cs</DependentUpon>
</Compile>
<Compile Include="FrmStoreBox.cs"> <Compile Include="FrmStoreBox.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -106,6 +112,9 @@ ...@@ -106,6 +112,9 @@
<EmbeddedResource Include="FrmIOStatus.resx"> <EmbeddedResource Include="FrmIOStatus.resx">
<DependentUpon>FrmIOStatus.cs</DependentUpon> <DependentUpon>FrmIOStatus.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmPwd.resx">
<DependentUpon>FrmPwd.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmStoreBox.resx"> <EmbeddedResource Include="FrmStoreBox.resx">
<DependentUpon>FrmStoreBox.cs</DependentUpon> <DependentUpon>FrmStoreBox.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" /> <add key="CodeParamPath" value="\CodeParam\" />
<add key ="AI_ConvertPosition" value ="55"/> <add key ="AI_ConvertPosition" value ="55"/>
<add key ="InOutDefaultPosition" value ="3000"/>
<add key ="Config_Pwd" value ="123456"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -51,9 +51,31 @@ namespace OnlineStore.ACSingleStore ...@@ -51,9 +51,31 @@ namespace OnlineStore.ACSingleStore
txtComSpeed.Text = ACStoreManager.store.Config.CompressAxis_EndSpeed.ToString(); txtComSpeed.Text = ACStoreManager.store.Config.CompressAxis_EndSpeed.ToString();
timer1.Start(); timer1.Start();
} }
/// <summary>
/// 判断进出轴是否在P1点
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
if (InOutDefaultPosition > 3000 || InOutDefaultPosition.Equals(0))
{
InOutDefaultPosition = 3000;
}
int currValue = ACServerManager.GetActualtPosition(inout.DeviceName, inout.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
}
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位!", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
private void btnMiddleMove_MouseDown(object sender, MouseEventArgs e) private void btnMiddleMove_MouseDown(object sender, MouseEventArgs e)
{ {
if (!InOutIsIsP1())
{
return;
}
if (btnMiddleMove.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnMiddleMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtMiddleSpeed); int speed = FormUtil.GetIntValue(txtMiddleSpeed);
...@@ -79,6 +101,10 @@ namespace OnlineStore.ACSingleStore ...@@ -79,6 +101,10 @@ namespace OnlineStore.ACSingleStore
private void btnUpDownMove_MouseDown(object sender, MouseEventArgs e) private void btnUpDownMove_MouseDown(object sender, MouseEventArgs e)
{ {
if (!InOutIsIsP1())
{
return;
}
if (btnUpDownMove.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnUpDownMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtUpDownSpeed); int speed = FormUtil.GetIntValue(txtUpDownSpeed);
...@@ -133,6 +159,10 @@ namespace OnlineStore.ACSingleStore ...@@ -133,6 +159,10 @@ namespace OnlineStore.ACSingleStore
} }
private void btnMiddleMovej_MouseDown(object sender, MouseEventArgs e) private void btnMiddleMovej_MouseDown(object sender, MouseEventArgs e)
{ {
if (!InOutIsIsP1())
{
return;
}
if (btnMiddleMovej.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnMiddleMovej.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtMiddleSpeed); int speed = FormUtil.GetIntValue(txtMiddleSpeed);
...@@ -158,6 +188,10 @@ namespace OnlineStore.ACSingleStore ...@@ -158,6 +188,10 @@ namespace OnlineStore.ACSingleStore
private void btnUpDownMovej_MouseDown(object sender, MouseEventArgs e) private void btnUpDownMovej_MouseDown(object sender, MouseEventArgs e)
{ {
if (!InOutIsIsP1())
{
return;
}
if (btnUpDownMovej.BackColor .Equals( System.Drawing.SystemColors.Control)) if (btnUpDownMovej.BackColor .Equals( System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtUpDownSpeed); int speed = FormUtil.GetIntValue(txtUpDownSpeed);
......
namespace OnlineStore.ACSingleStore
{
partial class FrmPwd
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.btnNext = new System.Windows.Forms.Button();
this.btnBack = new System.Windows.Forms.Button();
this.txtPwd = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(153, 61);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(126, 25);
this.label1.TabIndex = 0;
this.label1.Text = "请输入密码:";
//
// btnNext
//
this.btnNext.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNext.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNext.Location = new System.Drawing.Point(221, 163);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(120, 45);
this.btnNext.TabIndex = 275;
this.btnNext.Text = "确定";
this.btnNext.UseVisualStyleBackColor = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnBack
//
this.btnBack.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(95, 163);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(120, 45);
this.btnBack.TabIndex = 274;
this.btnBack.Text = "返回";
this.btnBack.UseVisualStyleBackColor = false;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// txtPwd
//
this.txtPwd.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtPwd.Location = new System.Drawing.Point(112, 97);
this.txtPwd.Name = "txtPwd";
this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(215, 33);
this.txtPwd.TabIndex = 276;
this.txtPwd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPwd_KeyDown);
//
// FrmPwd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(437, 268);
this.Controls.Add(this.txtPwd);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.label1);
this.Name = "FrmPwd";
this.Text = "请输入密码";
this.Load += new System.EventHandler(this.FrmPwd_Load);
this.Shown += new System.EventHandler(this.FrmPwd_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmPwd_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Button btnBack;
private System.Windows.Forms.TextBox txtPwd;
}
}
\ No newline at end of file \ No newline at end of file

using OnlineStore.Common;
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 OnlineStore.ACSingleStore
{
public partial class FrmPwd : FrmBase
{
public delegate void PwdOK(int type);
public event PwdOK PwdOKFun;
private int OpenType = 0;
public FrmPwd(int type)
{
OpenType = type;
InitializeComponent();
}
private void FrmPwd_Load(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
}
private void btnNext_Click(object sender, EventArgs e)
{
string pwd = txtPwd.Text;
string configPwd = ConfigAppSettings.GetValue(Setting_Init.Config_Pwd);
if (configPwd.Equals(""))
{
configPwd = "123456";
ConfigAppSettings.SaveValue(Setting_Init.Config_Pwd,configPwd);
}
if (pwd.Equals(configPwd))
{
this.DialogResult = DialogResult.OK;
//if (OpenType.Equals(1))
//{
// FrmDebugMenu main = new FrmDebugMenu();
// main.ShowDialog();
//}
//else if (OpenType.Equals(2))
//{
// FrmProgramList board = new FrmProgramList();
// board.ShowDialog();
//}
//else if (OpenType.Equals(3))
//{
// FrmBoardList board = new FrmBoardList();
// board.ShowDialog();
//}
PwdOKFun?.Invoke(OpenType);
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
// this.DialogResult = DialogResult.No;
MessageBox.Show("请输入正确的密码");
txtPwd.Focus();
}
}
private void btnBack_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void FrmPwd_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.Enter))
{
btnNext_Click(null, null);
}
}
private void txtPwd_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.Enter))
{
btnNext_Click(null, null);
}else if (e.KeyCode.Equals(Keys.Escape))
{
btnBack_Click(null, null);
}
}
private void FrmPwd_Shown(object sender, EventArgs e)
{
txtPwd.Focus();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -1690,55 +1690,55 @@ ...@@ -1690,55 +1690,55 @@
// 启动ToolStripMenuItem // 启动ToolStripMenuItem
// //
this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem"; this.启动ToolStripMenuItem.Name = "启动ToolStripMenuItem";
this.启动ToolStripMenuItem.Size = new System.Drawing.Size(144, 26); this.启动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动ToolStripMenuItem.Text = "启动"; this.启动ToolStripMenuItem.Text = "启动";
this.启动ToolStripMenuItem.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click); this.启动ToolStripMenuItem.Click += new System.EventHandler(this.启动ToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
// //
// 停止ToolStripMenuItem // 停止ToolStripMenuItem
// //
this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem"; this.停止ToolStripMenuItem.Name = "停止ToolStripMenuItem";
this.停止ToolStripMenuItem.Size = new System.Drawing.Size(144, 26); this.停止ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止ToolStripMenuItem.Text = "停止"; this.停止ToolStripMenuItem.Text = "停止";
this.停止ToolStripMenuItem.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click); this.停止ToolStripMenuItem.Click += new System.EventHandler(this.停止ToolStripMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
// //
// 复位ToolStripMenuItem // 复位ToolStripMenuItem
// //
this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem"; this.复位ToolStripMenuItem.Name = "复位ToolStripMenuItem";
this.复位ToolStripMenuItem.Size = new System.Drawing.Size(144, 26); this.复位ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位ToolStripMenuItem.Text = "复位"; this.复位ToolStripMenuItem.Text = "复位";
this.复位ToolStripMenuItem.Click += new System.EventHandler(this.复位ToolStripMenuItem_Click); this.复位ToolStripMenuItem.Click += new System.EventHandler(this.复位ToolStripMenuItem_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
// //
// 回待机点ToolStripMenuItem // 回待机点ToolStripMenuItem
// //
this.回待机点ToolStripMenuItem.Name = "回待机点ToolStripMenuItem"; this.回待机点ToolStripMenuItem.Name = "回待机点ToolStripMenuItem";
this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(144, 26); this.回待机点ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.回待机点ToolStripMenuItem.Text = "回待机点"; this.回待机点ToolStripMenuItem.Text = "回待机点";
this.回待机点ToolStripMenuItem.Click += new System.EventHandler(this.回待机点ToolStripMenuItem_Click); this.回待机点ToolStripMenuItem.Click += new System.EventHandler(this.回待机点ToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
// //
// 退出ToolStripMenuItem // 退出ToolStripMenuItem
// //
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem"; this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(144, 26); this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出系统"; this.退出ToolStripMenuItem.Text = "退出系统";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click); this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
// //
...@@ -1830,43 +1830,43 @@ ...@@ -1830,43 +1830,43 @@
// 轴卡点动ToolStripMenuItem // 轴卡点动ToolStripMenuItem
// //
this.轴卡点动ToolStripMenuItem.Name = "轴卡点动ToolStripMenuItem"; this.轴卡点动ToolStripMenuItem.Name = "轴卡点动ToolStripMenuItem";
this.轴卡点动ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.轴卡点动ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.轴卡点动ToolStripMenuItem.Text = "轴卡点动"; this.轴卡点动ToolStripMenuItem.Text = "轴卡点动";
this.轴卡点动ToolStripMenuItem.Click += new System.EventHandler(this.轴卡点动ToolStripMenuItem_Click); this.轴卡点动ToolStripMenuItem.Click += new System.EventHandler(this.轴卡点动ToolStripMenuItem_Click);
// //
// toolStripSeparator9 // toolStripSeparator9
// //
this.toolStripSeparator9.Name = "toolStripSeparator9"; this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
// //
// 扫码测试ToolStripMenuItem // 扫码测试ToolStripMenuItem
// //
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem"; this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试"; this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click); this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
// //
// toolStripSeparator10 // toolStripSeparator10
// //
this.toolStripSeparator10.Name = "toolStripSeparator10"; this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator10.Size = new System.Drawing.Size(177, 6);
// //
// 摄像机调试ToolStripMenuItem // 摄像机调试ToolStripMenuItem
// //
this.摄像机调试ToolStripMenuItem.Name = "摄像机调试ToolStripMenuItem"; this.摄像机调试ToolStripMenuItem.Name = "摄像机调试ToolStripMenuItem";
this.摄像机调试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.摄像机调试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.摄像机调试ToolStripMenuItem.Text = "摄像机调试"; this.摄像机调试ToolStripMenuItem.Text = "摄像机调试";
this.摄像机调试ToolStripMenuItem.Click += new System.EventHandler(this.摄像机调试ToolStripMenuItem_Click); this.摄像机调试ToolStripMenuItem.Click += new System.EventHandler(this.摄像机调试ToolStripMenuItem_Click);
// //
// toolStripSeparator11 // toolStripSeparator11
// //
this.toolStripSeparator11.Name = "toolStripSeparator11"; this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(157, 6); this.toolStripSeparator11.Size = new System.Drawing.Size(177, 6);
// //
// 学习二维码ToolStripMenuItem // 学习二维码ToolStripMenuItem
// //
this.学习二维码ToolStripMenuItem.Name = "学习二维码ToolStripMenuItem"; this.学习二维码ToolStripMenuItem.Name = "学习二维码ToolStripMenuItem";
this.学习二维码ToolStripMenuItem.Size = new System.Drawing.Size(160, 26); this.学习二维码ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.学习二维码ToolStripMenuItem.Text = "学习二维码"; this.学习二维码ToolStripMenuItem.Text = "学习二维码";
this.学习二维码ToolStripMenuItem.Click += new System.EventHandler(this.学习二维码ToolStripMenuItem_Click); this.学习二维码ToolStripMenuItem.Click += new System.EventHandler(this.学习二维码ToolStripMenuItem_Click);
// //
...@@ -2003,9 +2003,9 @@ ...@@ -2003,9 +2003,9 @@
this.groupBox4.Controls.Add(this.label25); this.groupBox4.Controls.Add(this.label25);
this.groupBox4.Controls.Add(this.comboBoxPortName); this.groupBox4.Controls.Add(this.comboBoxPortName);
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(510, 563); this.groupBox4.Location = new System.Drawing.Point(510, 562);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(512, 187); this.groupBox4.Size = new System.Drawing.Size(512, 160);
this.groupBox4.TabIndex = 271; this.groupBox4.TabIndex = 271;
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "压紧轴"; this.groupBox4.Text = "压紧轴";
......
...@@ -514,7 +514,14 @@ namespace OnlineStore.ACSingleStore ...@@ -514,7 +514,14 @@ namespace OnlineStore.ACSingleStore
{ {
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (portName.Equals(store.Config.Middle_Axis.DeviceName) || portName.Equals(store.Config.UpDown_Axis.DeviceName))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【绝对运动】,端口号【"+ portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【绝对运动】,端口号【"+ portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.AbsMove(portName, SlvAddr, position, speed ); ACServerManager.AbsMove(portName, SlvAddr, position, speed );
} }
...@@ -529,6 +536,13 @@ namespace OnlineStore.ACSingleStore ...@@ -529,6 +536,13 @@ namespace OnlineStore.ACSingleStore
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (portName.Equals(store.Config.Middle_Axis.DeviceName) || portName.Equals(store.Config.UpDown_Axis.DeviceName))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【匀速运动】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】"); LogUtil.info("点击【匀速运动】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.SpeedMove(portName, SlvAddr, speed); ACServerManager.SpeedMove(portName, SlvAddr, speed);
} }
...@@ -553,6 +567,13 @@ namespace OnlineStore.ACSingleStore ...@@ -553,6 +567,13 @@ namespace OnlineStore.ACSingleStore
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return; return;
} }
else if (portName.Equals(store.Config.Middle_Axis.DeviceName) || portName.Equals(store.Config.UpDown_Axis.DeviceName))
{
if (!InOutIsIsP1())
{
return;
}
}
LogUtil.info("点击【相对运动】,端口号【" + portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】"); LogUtil.info("点击【相对运动】,端口号【" + portName + "】地址【" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
ACServerManager.RelMove(portName, SlvAddr, position, speed); ACServerManager.RelMove(portName, SlvAddr, position, speed);
} }
...@@ -688,7 +709,24 @@ namespace OnlineStore.ACSingleStore ...@@ -688,7 +709,24 @@ namespace OnlineStore.ACSingleStore
Thread.Sleep(100); Thread.Sleep(100);
ACServerManager.ServoOn(portName, SlvAddr); ACServerManager.ServoOn(portName, SlvAddr);
} }
/// <summary>
/// 判断进出轴是否在P1点
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
if (InOutDefaultPosition > 3000 || InOutDefaultPosition.Equals(0))
{
InOutDefaultPosition = 3000;
}
int currValue = ACServerManager.GetActualtPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
}
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位!", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
private void btnCloseAxis_Click(object sender, EventArgs e) private void btnCloseAxis_Click(object sender, EventArgs e)
{ {
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
...@@ -703,63 +741,91 @@ namespace OnlineStore.ACSingleStore ...@@ -703,63 +741,91 @@ namespace OnlineStore.ACSingleStore
} }
private void btnUpDownP1_Click(object sender, EventArgs e) private void btnUpDownP1_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP1); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P1_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP1);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P1_Speed);
}
} }
private void btnUpDownP2_Click(object sender, EventArgs e) private void btnUpDownP2_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP2); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P2_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP2);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P2_Speed);
}
} }
private void btnUpDownP7_Click(object sender, EventArgs e) private void btnUpDownP7_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP7); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P7_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP7);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P7_Speed);
}
} }
private void btnUpDownP8_Click(object sender, EventArgs e) private void btnUpDownP8_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP8); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P8_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP8);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P8_Speed);
}
} }
private void btnUpDownP3_Click(object sender, EventArgs e) private void btnUpDownP3_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP3); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P3_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP3);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P3_Speed);
}
} }
private void btnUpDownP4_Click(object sender, EventArgs e) private void btnUpDownP4_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP4); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P4_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP4);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P4_Speed);
}
} }
private void btnUpDownP5_Click(object sender, EventArgs e) private void btnUpDownP5_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP5); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P5_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP5);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P5_Speed);
}
} }
private void btnUpDownP6_Click(object sender, EventArgs e) private void btnUpDownP6_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtUpDownP6); if (InOutIsIsP1())
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P6_Speed); {
int value = FormUtil.GetIntValue(txtUpDownP6);
AxisABSMove(store.Config.UpDown_Axis, value, store.Config.UpDownAxis_P6_Speed);
}
} }
private void btnMiddleP1_Click(object sender, EventArgs e) private void btnMiddleP1_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMiddleP1); if (InOutIsIsP1())
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P1_Speed); {
int value = FormUtil.GetIntValue(txtMiddleP1);
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P1_Speed);
}
} }
private void btnMiddleP2_Click(object sender, EventArgs e) private void btnMiddleP2_Click(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMiddleP2); if (InOutIsIsP1())
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P2_Speed); {
int value = FormUtil.GetIntValue(txtMiddleP2);
AxisABSMove(store.Config.Middle_Axis, value, store.Config.MiddleAxis_P2_Speed);
}
} }
private void btnInOutP1_Click(object sender, EventArgs e) private void btnInOutP1_Click(object sender, EventArgs e)
...@@ -1101,6 +1167,19 @@ namespace OnlineStore.ACSingleStore ...@@ -1101,6 +1167,19 @@ namespace OnlineStore.ACSingleStore
{ {
string portName = txtAxisDeviceName.Text; string portName = txtAxisDeviceName.Text;
short SlvAddr = FormUtil.GetShortValue(txtAxisValue); short SlvAddr = FormUtil.GetShortValue(txtAxisValue);
if (portName.Equals(store.Config.InOut_Axis.DeviceName) && (store.InOutAxisCanMove().Equals(false)))
{
MessageBox.Show("定位气缸不在下降端,不能移动进出轴", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (portName.Equals(store.Config.Middle_Axis.DeviceName) || portName.Equals(store.Config.UpDown_Axis.DeviceName))
{
if (!InOutIsIsP1())
{
return;
}
}
int speed = FormUtil.GetIntValue(txtASpeed); int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【原点返回】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】"); LogUtil.info("点击【原点返回】,端口号【" + portName + "】地址【" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.HomeMove(portName, SlvAddr, speed); ACServerManager.HomeMove(portName, SlvAddr, speed);
...@@ -1159,6 +1238,13 @@ namespace OnlineStore.ACSingleStore ...@@ -1159,6 +1238,13 @@ namespace OnlineStore.ACSingleStore
private void 显示ToolStripMenuItem_Click(object sender, EventArgs e) private void 显示ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
FrmPwd fw = new FrmPwd(10);
DialogResult result = fw.ShowDialog();
if (!result.Equals(DialogResult.OK))
{
LogUtil.info("切换界面显示时,没有正确输入密码");
return;
}
this.Visible = true; this.Visible = true;
this.WindowState = FormWindowState.Maximized; this.WindowState = FormWindowState.Maximized;
this.notifyIcon1.Visible = false; this.notifyIcon1.Visible = false;
......
...@@ -24,6 +24,20 @@ ...@@ -24,6 +24,20 @@
//机器未启动 灭 灭 灭 //机器未启动 灭 灭 灭
//机器设备故障(非温湿度)报警 亮 灭 闪 //机器设备故障(非温湿度)报警 亮 灭 闪
20181115
界面显示增加密码框
旋转轴和升降轴移动时,叉子需要在待机位
......
...@@ -65,5 +65,11 @@ namespace OnlineStore.Common ...@@ -65,5 +65,11 @@ namespace OnlineStore.Common
/// 高度传感器转换系数 /// 高度传感器转换系数
/// </summary> /// </summary>
public static string AI_ConvertPosition = "AI_ConvertPosition"; public static string AI_ConvertPosition = "AI_ConvertPosition";
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// </summary>
public static string InOutDefaultPosition = "InOutDefaultPosition";
public static string Config_Pwd = "Config_Pwd";
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!