Commit 6a94653a 刘韬

优化

1 个父辈 42429c38
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections> </configSections>
<appSettings> <appSettings>
<add key="EnableWindowsFormsHighDpiAutoResizing" value="false" />
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" /> <add key="App_AutoRun" value="1" />
<add key="App_Title" value="料仓_批量上下料" /> <add key="App_Title" value="料仓_批量上下料" />
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>box.ico</ApplicationIcon> <ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CodeLibrary, Version=1.0.7635.28877, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.7635.28877, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
...@@ -190,6 +193,7 @@ ...@@ -190,6 +193,7 @@
<EmbeddedResource Include="userControl\uc_boxdebug.resx"> <EmbeddedResource Include="userControl\uc_boxdebug.resx">
<DependentUpon>uc_boxdebug.cs</DependentUpon> <DependentUpon>uc_boxdebug.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
...@@ -1140,6 +1140,9 @@ namespace OnlineStore.AutoInOutStore ...@@ -1140,6 +1140,9 @@ namespace OnlineStore.AutoInOutStore
} }
IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode(); CodeLibrary.FrmCodeDecode frm = new FrmCodeDecode();
frm.chbZxing.Checked = false;
frm.chbZxing.Visible = false;
frm.ShowDialog(); frm.ShowDialog();
IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW); IOManager.IOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
} }
......
...@@ -94,6 +94,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -94,6 +94,7 @@ namespace OnlineStore.AutoInOutStore
if (!isShow) if (!isShow)
{ {
XmlConfigurator.Configure(); XmlConfigurator.Configure();
SetProcessDPIAware();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
#if PositionTool #if PositionTool
...@@ -113,6 +114,9 @@ namespace OnlineStore.AutoInOutStore ...@@ -113,6 +114,9 @@ namespace OnlineStore.AutoInOutStore
#endif #endif
} }
} }
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {
LogUnhandledException(e.ExceptionObject); LogUnhandledException(e.ExceptionObject);
......
...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices; ...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO815-AutoInOutStore-newui edf7e3d07d3c8cafa890a08f4b855e559a36d414")] [assembly: AssemblyProduct("SO815-AutoInOutStore-newui 42429c38bd4866dbdd9596cbe2cadc4059c732d2")]
[assembly: AssemblyCopyright("edf7e3d07d3c8cafa890a08f4b855e559a36d414")] [assembly: AssemblyCopyright("edf7e3d07d3c8cafa890a08f4b855e559a36d414")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.groupAxis = new System.Windows.Forms.GroupBox(); this.groupAxis = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblAlarmcode = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.lblhomeSts = new System.Windows.Forms.Label(); this.lblhomeSts = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
...@@ -99,7 +100,6 @@ ...@@ -99,7 +100,6 @@
this.txtAxisDeviceName = new System.Windows.Forms.TextBox(); this.txtAxisDeviceName = new System.Windows.Forms.TextBox();
this.lblServerOn = new System.Windows.Forms.Label(); this.lblServerOn = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblAlarmcode = new System.Windows.Forms.Label();
this.groupAxis.SuspendLayout(); this.groupAxis.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(4, 3); this.groupAxis.Location = new System.Drawing.Point(4, 3);
this.groupAxis.Name = "groupAxis"; this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(692, 395); this.groupAxis.Size = new System.Drawing.Size(696, 395);
this.groupAxis.TabIndex = 218; this.groupAxis.TabIndex = 218;
this.groupAxis.TabStop = false; this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动"; this.groupAxis.Text = "伺服运动";
...@@ -159,6 +159,17 @@ ...@@ -159,6 +159,17 @@
this.groupBox2.TabStop = false; this.groupBox2.TabStop = false;
this.groupBox2.Text = "轴状态监控"; this.groupBox2.Text = "轴状态监控";
// //
// lblAlarmcode
//
this.lblAlarmcode.AutoSize = true;
this.lblAlarmcode.Location = new System.Drawing.Point(433, 65);
this.lblAlarmcode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAlarmcode.Name = "lblAlarmcode";
this.lblAlarmcode.Size = new System.Drawing.Size(68, 17);
this.lblAlarmcode.TabIndex = 19;
this.lblAlarmcode.Text = "错误码:160";
this.lblAlarmcode.Visible = false;
//
// label4 // label4
// //
this.label4.AutoSize = true; this.label4.AutoSize = true;
...@@ -941,23 +952,12 @@ ...@@ -941,23 +952,12 @@
this.timer1.Interval = 1000; this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// lblAlarmcode
//
this.lblAlarmcode.AutoSize = true;
this.lblAlarmcode.Location = new System.Drawing.Point(433, 65);
this.lblAlarmcode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblAlarmcode.Name = "lblAlarmcode";
this.lblAlarmcode.Size = new System.Drawing.Size(68, 17);
this.lblAlarmcode.TabIndex = 19;
this.lblAlarmcode.Text = "错误码:160";
this.lblAlarmcode.Visible = false;
//
// AxisMoveControl // AxisMoveControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.groupAxis); this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl"; this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(699, 402); this.Size = new System.Drawing.Size(703, 402);
this.groupAxis.ResumeLayout(false); this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout(); this.groupAxis.PerformLayout();
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
......
...@@ -62,23 +62,72 @@ public partial class AxisTipControl : FrmBase ...@@ -62,23 +62,72 @@ public partial class AxisTipControl : FrmBase
comjSpeed.Items.Add(targetSpeed * i / 10); comjSpeed.Items.Add(targetSpeed * i / 10);
} }
comjSpeed.SelectedIndex = 4; comjSpeed.SelectedIndex = 4;
comjSpeed.KeyUp += ComjSpeed_KeyUp;
SetRelList((int)comjSpeed.SelectedItem);
//【2】读取轴状态,如果读取出错将关闭此定时器 //【2】读取轴状态,如果读取出错将关闭此定时器
AxisSts sts = HCBoardManager.GetAxisSts(SlvAddr); AxisSts sts = HCBoardManager.GetAxisSts(SlvAddr);
if (sts.ServoOn < 0) if (sts.ServoOn < 0)
{ {
showToolTip("伺服尚未使能",c); showToolTip("伺服尚未使能",c);
return; //return;
} }
if (sts.ALM != 0 || sts.WARN != 0 || sts.EMG != 0) { if (sts.ALM != 0 || sts.WARN != 0 || sts.EMG != 0) {
showToolTip("伺服警报状态中",c); showToolTip("伺服警报状态中",c);
return; //return;
} }
readPosition(); readPosition();
this.Show(); this.Show();
LanguageProcess(); LanguageProcess();
} }
private void ComjSpeed_KeyUp(object sender, KeyEventArgs e)
{
if (!int.TryParse(comjSpeed.Text, out _))
{
//e.Handled = false;
return;
}
SetRelList(int.Parse(comjSpeed.Text));
}
private void ComjSpeed_KeyPress(object sender, KeyPressEventArgs e)
{
}
void SetRelList(int speed) {
flowLayoutPanel1.Controls.Clear();
int[] zoom = new int[] { 1, 3, 5, 7, 9, 11 };
for (int i = 0; i < zoom.Length; i++) {
Button b = new Button();
b.Size = new Size(60, 30);
var bs = (int)Math.Floor(speed / (decimal)zoom[i]);
b.Text = "+" + bs.ToString();
b.Tag = bs;
b.Click += B_Click;
flowLayoutPanel1.Controls.Add(b);
}
for (int i = 0; i < zoom.Length; i++)
{
Button b = new Button();
b.Size = new Size(60, 30);
var bs = (int)Math.Floor(speed / (decimal)zoom[zoom.Length-i-1]) *-1;
b.Text = bs.ToString();
b.Tag = bs;
b.Click += B_Click;
flowLayoutPanel1.Controls.Add(b);
}
}
private void B_Click(object sender, EventArgs e)
{
var b = sender as Button;
int pos = (int)b.Tag;
LogUtil.info("【" + PortName + "_" + SlvAddr + "】相对运动: 点位:" + pos);
AxisManager.RelMove(PortName, SlvAddr, pos, targetSpeed, targetSpeed * 3, targetSpeed * 3);
}
void showToolTip(string txt,Control control) { void showToolTip(string txt,Control control) {
var m_ToolTip = new ToolTip(); var m_ToolTip = new ToolTip();
m_ToolTip.ToolTipIcon = ToolTipIcon.Warning; m_ToolTip.ToolTipIcon = ToolTipIcon.Warning;
...@@ -191,5 +240,15 @@ public partial class AxisTipControl : FrmBase ...@@ -191,5 +240,15 @@ public partial class AxisTipControl : FrmBase
c.Text = textBox_pos.Text; c.Text = textBox_pos.Text;
this.Close(); this.Close();
} }
private void AxisTipControl_Load(object sender, EventArgs e)
{
}
private void comjSpeed_SelectedIndexChanged(object sender, EventArgs e)
{
SetRelList((int)comjSpeed.SelectedItem);
}
} }
...@@ -36,17 +36,20 @@ partial class AxisTipControl ...@@ -36,17 +36,20 @@ partial class AxisTipControl
this.label_position = new System.Windows.Forms.Label(); this.label_position = new System.Windows.Forms.Label();
this.btn_ok = new System.Windows.Forms.Button(); this.btn_ok = new System.Windows.Forms.Button();
this.btn_cancel = new System.Windows.Forms.Button(); this.btn_cancel = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// comjSpeed // comjSpeed
// //
this.comjSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.comjSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.comjSpeed.FormattingEnabled = true; this.comjSpeed.FormattingEnabled = true;
this.comjSpeed.Location = new System.Drawing.Point(155, 8); this.comjSpeed.Location = new System.Drawing.Point(155, 8);
this.comjSpeed.Name = "comjSpeed"; this.comjSpeed.Name = "comjSpeed";
this.comjSpeed.Size = new System.Drawing.Size(116, 28); this.comjSpeed.Size = new System.Drawing.Size(116, 28);
this.comjSpeed.TabIndex = 339; this.comjSpeed.TabIndex = 339;
this.comjSpeed.SelectedIndexChanged += new System.EventHandler(this.comjSpeed_SelectedIndexChanged);
// //
// btnDelMove // btnDelMove
// //
...@@ -55,7 +58,7 @@ partial class AxisTipControl ...@@ -55,7 +58,7 @@ partial class AxisTipControl
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(155, 42); this.btnDelMove.Location = new System.Drawing.Point(155, 42);
this.btnDelMove.Name = "btnDelMove"; this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(116, 45); this.btnDelMove.Size = new System.Drawing.Size(116, 32);
this.btnDelMove.TabIndex = 338; this.btnDelMove.TabIndex = 338;
this.btnDelMove.Text = "点动-"; this.btnDelMove.Text = "点动-";
this.btnDelMove.UseVisualStyleBackColor = false; this.btnDelMove.UseVisualStyleBackColor = false;
...@@ -69,7 +72,7 @@ partial class AxisTipControl ...@@ -69,7 +72,7 @@ partial class AxisTipControl
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(14, 42); this.btnAddMove.Location = new System.Drawing.Point(14, 42);
this.btnAddMove.Name = "btnAddMove"; this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(116, 45); this.btnAddMove.Size = new System.Drawing.Size(116, 32);
this.btnAddMove.TabIndex = 337; this.btnAddMove.TabIndex = 337;
this.btnAddMove.Text = "点动+"; this.btnAddMove.Text = "点动+";
this.btnAddMove.UseVisualStyleBackColor = false; this.btnAddMove.UseVisualStyleBackColor = false;
...@@ -87,14 +90,14 @@ partial class AxisTipControl ...@@ -87,14 +90,14 @@ partial class AxisTipControl
// //
// textBox_pos // textBox_pos
// //
this.textBox_pos.Location = new System.Drawing.Point(155, 94); this.textBox_pos.Location = new System.Drawing.Point(155, 216);
this.textBox_pos.Name = "textBox_pos"; this.textBox_pos.Name = "textBox_pos";
this.textBox_pos.Size = new System.Drawing.Size(116, 23); this.textBox_pos.Size = new System.Drawing.Size(116, 23);
this.textBox_pos.TabIndex = 340; this.textBox_pos.TabIndex = 340;
// //
// label_position // label_position
// //
this.label_position.Location = new System.Drawing.Point(38, 94); this.label_position.Location = new System.Drawing.Point(38, 216);
this.label_position.Name = "label_position"; this.label_position.Name = "label_position";
this.label_position.Size = new System.Drawing.Size(111, 20); this.label_position.Size = new System.Drawing.Size(111, 20);
this.label_position.TabIndex = 336; this.label_position.TabIndex = 336;
...@@ -103,7 +106,7 @@ partial class AxisTipControl ...@@ -103,7 +106,7 @@ partial class AxisTipControl
// //
// btn_ok // btn_ok
// //
this.btn_ok.Location = new System.Drawing.Point(181, 123); this.btn_ok.Location = new System.Drawing.Point(181, 245);
this.btn_ok.Name = "btn_ok"; this.btn_ok.Name = "btn_ok";
this.btn_ok.Size = new System.Drawing.Size(90, 33); this.btn_ok.Size = new System.Drawing.Size(90, 33);
this.btn_ok.TabIndex = 341; this.btn_ok.TabIndex = 341;
...@@ -113,7 +116,7 @@ partial class AxisTipControl ...@@ -113,7 +116,7 @@ partial class AxisTipControl
// //
// btn_cancel // btn_cancel
// //
this.btn_cancel.Location = new System.Drawing.Point(16, 123); this.btn_cancel.Location = new System.Drawing.Point(16, 245);
this.btn_cancel.Name = "btn_cancel"; this.btn_cancel.Name = "btn_cancel";
this.btn_cancel.Size = new System.Drawing.Size(90, 33); this.btn_cancel.Size = new System.Drawing.Size(90, 33);
this.btn_cancel.TabIndex = 341; this.btn_cancel.TabIndex = 341;
...@@ -121,11 +124,30 @@ partial class AxisTipControl ...@@ -121,11 +124,30 @@ partial class AxisTipControl
this.btn_cancel.UseVisualStyleBackColor = true; this.btn_cancel.UseVisualStyleBackColor = true;
this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click); this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
// //
// flowLayoutPanel1
//
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 19);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(269, 108);
this.flowLayoutPanel1.TabIndex = 342;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.flowLayoutPanel1);
this.groupBox1.Location = new System.Drawing.Point(13, 80);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(275, 130);
this.groupBox1.TabIndex = 343;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "相对运动";
//
// AxisTipControl // AxisTipControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(293, 166); this.ClientSize = new System.Drawing.Size(300, 291);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btn_cancel); this.Controls.Add(this.btn_cancel);
this.Controls.Add(this.btn_ok); this.Controls.Add(this.btn_ok);
this.Controls.Add(this.textBox_pos); this.Controls.Add(this.textBox_pos);
...@@ -140,6 +162,8 @@ partial class AxisTipControl ...@@ -140,6 +162,8 @@ partial class AxisTipControl
this.Name = "AxisTipControl"; this.Name = "AxisTipControl";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.Load += new System.EventHandler(this.AxisTipControl_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -155,4 +179,6 @@ partial class AxisTipControl ...@@ -155,4 +179,6 @@ partial class AxisTipControl
private System.Windows.Forms.Label label_position; private System.Windows.Forms.Label label_position;
private System.Windows.Forms.Button btn_ok; private System.Windows.Forms.Button btn_ok;
private System.Windows.Forms.Button btn_cancel; private System.Windows.Forms.Button btn_cancel;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox groupBox1;
} }
...@@ -116,5 +116,7 @@ namespace OnlineStore.Common ...@@ -116,5 +116,7 @@ namespace OnlineStore.Common
public static string Tool_TargetSpeed = "Tool_TargetSpeed"; public static string Tool_TargetSpeed = "Tool_TargetSpeed";
public static string Tool_TargetPosition = "Tool_TargetPosition"; public static string Tool_TargetPosition = "Tool_TargetPosition";
public static string code_block_size_list= "code_block_size_list"; public static string code_block_size_list= "code_block_size_list";
public static string DisableFixTray = "DisableFixTray";
public static string InOutFixPos = "InOutFixPos";
} }
} }
...@@ -172,7 +172,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,7 +172,7 @@ namespace OnlineStore.DeviceLibrary
Bitmap bmp = null; Bitmap bmp = null;
try try
{ {
bool nohalcon = true; bool nohalcon = false;
ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp, nohalcon); ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp, nohalcon);
if (ho_Image == null && !nohalcon) if (ho_Image == null && !nohalcon)
{ {
...@@ -182,54 +182,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -182,54 +182,25 @@ namespace OnlineStore.DeviceLibrary
} }
LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码");
string r = ""; string r = "";
RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
foreach (int codesize in Code_Block_Size_List)
{ {
if (codeList.Count > 0) codeTypeList = codeTypeList.ToArray(),
break; codeCount = codeCount,
timeout = 4000
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp,null,codesize); };
foreach (CodeInfo code in tlci) var cc = RemoteDecodeHelper.DecodeRequest(bmp, remoteDecodeParam);
{ if (cc != null)
LogUtil.info(" 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr);
lock (codeList)
{
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##" + str;
}
}
}
}
/*
* List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{ {
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
}
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
{ {
string str = CodeManager.ReplaceCode(c.CodeStr); string str = CodeManager.ReplaceCode(c.CodeStr);
lock (codeList) if (!codeList.Contains(str))
{ {
if (!codeList.Contains(str)) codeList.Add(str);
{ r = r + "##" + str;
codeList.Add(str);
r = r + "##" + str;
}
} }
} }
} }
*/
if (codeList.Count() == 0) if (codeList.Count() == 0)
{ {
SaveImageToFile("mimo", cameraName, bmp); SaveImageToFile("mimo", cameraName, bmp);
......
...@@ -872,6 +872,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -872,6 +872,8 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
} }
bool DisableFixTray = ConfigAppSettings.GetIntValue(Setting_Init.DisableFixTray).Equals(1);
int InOutFixPos = ConfigAppSettings.GetIntValue(Setting_Init.InOutFixPos);
LineMoveP movePfix=new LineMoveP(); LineMoveP movePfix=new LineMoveP();
protected override void OutStoreProcess() protected override void OutStoreProcess()
{ {
...@@ -988,7 +990,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -988,7 +990,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix) else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix)
{ {
if (StoreMove.IsBatchInOutStore && StoreMove.MoveParam != null) if (!DisableFixTray && StoreMove.IsBatchInOutStore && StoreMove.MoveParam != null)
{ {
var fixposid = $"1#AC1_0A_99_{StoreMove.MoveParam.PlagtW}"; var fixposid = $"1#AC1_0A_99_{StoreMove.MoveParam.PlagtW}";
var fixposition = CSVPositionReader<AutoStorePosition>.GetPositon(fixposid); var fixposition = CSVPositionReader<AutoStorePosition>.GetPositon(fixposid);
...@@ -1007,8 +1009,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1007,8 +1009,8 @@ namespace OnlineStore.DeviceLibrary
movePfix.UpDown_P1 = Config.GetUpDownP1(StoreMove.MoveParam.PlateH); movePfix.UpDown_P1 = Config.GetUpDownP1(StoreMove.MoveParam.PlateH);
movePfix.ComPress_P2 = fixposition.CompressAxis_Position_P2; movePfix.ComPress_P2 = moveP.ComPress_P2;
movePfix.ComPress_P3 = fixposition.CompressAxis_CPosition_P3; movePfix.ComPress_P3 = moveP.ComPress_P3;
movePfix.InOut_P3 = fixposition.InOutAxis_Position_P3; movePfix.InOut_P3 = fixposition.InOutAxis_Position_P3;
movePfix.Middle_P2 = fixposition.MiddleAxis_Position_P2; movePfix.Middle_P2 = fixposition.MiddleAxis_Position_P2;
movePfix.UpDown_P3 = fixposition.UpDownAxis_IHPosition_P3; movePfix.UpDown_P3 = fixposition.UpDownAxis_IHPosition_P3;
...@@ -1039,16 +1041,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -1039,16 +1041,23 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_02) else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_02)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_03); StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_03);
InStoreLog("出库:库位修正 叉子进入库位中,进出轴至P3(修正库位取放料点) "); InStoreLog("出库:库位修正 叉子进入库位中,进出轴至Fix(修正库位取放料点) ");
ACAxisMove(Config.InOut_Axis, movePfix.InOut_P3, Config.InOutAxis_P3_Speed); ACAxisMove(Config.InOut_Axis, movePfix.InOut_P3+InOutFixPos, Config.InOutAxis_P3_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_03) else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_03)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_04); StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_04_inoutp3);
InStoreLog("出库:库位修正 压紧轴释放,升降轴到P4 "); InStoreLog("出库:库位修正 压紧轴释放,升降轴到P4 ");
ComMoveToPosition(movePfix.ComPress_P3, Config.CompAxis_P3_Speed); ComMoveToPosition(movePfix.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, movePfix.UpDown_P4, Config.UpDownAxis_P4_Speed); ACAxisMove(Config.UpDown_Axis, movePfix.UpDown_P4, Config.UpDownAxis_P4_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_04_inoutp3)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_04);
InStoreLog("出库:库位修正 进出轴到P3 ");
ACAxisMove(Config.InOut_Axis, movePfix.InOut_P3, Config.InOutAxis_P3_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_04) else if (StoreMove.MoveStep == StoreMoveStep.SO_07_CheckFix_04)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_05); StoreMove.NextMoveStep(StoreMoveStep.SO_07_CheckFix_05);
...@@ -1194,7 +1203,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1194,7 +1203,7 @@ namespace OnlineStore.DeviceLibrary
//如果可以直接下降,则不需要匀速上升 //如果可以直接下降,则不需要匀速上升
int targetValue = GetBatchTargetValue(StoreMove.MoveParam.MoveP.BatchAxis_DownValue); int targetValue = GetBatchTargetValue(StoreMove.MoveParam.MoveP.BatchAxis_DownValue);
if (targetValue >= 290600) if (targetValue >= (Config.BatchAxis_P3-Config.BatchAxis_P2)*0.1)
{ {
OutStoreLog("出库:SO_02 批量上下料轴直接下降后目标位置【" + targetValue + "】不需要匀速上升 "); OutStoreLog("出库:SO_02 批量上下料轴直接下降后目标位置【" + targetValue + "】不需要匀速上升 ");
} }
......
...@@ -215,6 +215,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -215,6 +215,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
bool isClearAlarm = false;
switch (StoreMove.MoveStep) switch (StoreMove.MoveStep)
{ {
case StoreMoveStep.AUTO_R00_Start: case StoreMoveStep.AUTO_R00_Start:
...@@ -224,13 +225,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -224,13 +225,21 @@ namespace OnlineStore.DeviceLibrary
// IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW); // IOManager.IOMove(IO_Type.SuckingDisc_Work, IO_VALUE.LOW);
AutomaticBaiting.CylinderMove(IO_Type.Clamping_Work, IO_Type.Clamping_Relax, StoreMove); AutomaticBaiting.CylinderMove(IO_Type.Clamping_Work, IO_Type.Clamping_Relax, StoreMove);
CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true); CylinderMove(IO_Type.ClampingDisc_Up, IO_Type.ClampingDisc_Down, true);
if (ACServerManager.GetAlarmStatus(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()).Equals(1))
{
isClearAlarm = true;
LogUtil.debug(Name + "复位中:批量上下料轴清理报警");
ACServerManager.AlarmClear(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
Thread.Sleep(100);
}
ACAxisRelMove(StoreManager.Config.Batch_Axis, AxisChangeValue*5, StoreManager.Config.BatchAxis_P2_Speed);
LogUtil.info(Name + "复位中:关闭门锁"); LogUtil.info(Name + "复位中:关闭门锁");
break; break;
case StoreMoveStep.AUTO_R01_CloseDoor: case StoreMoveStep.AUTO_R01_CloseDoor:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
StoreMove.TimeOutSeconds = 120; StoreMove.TimeOutSeconds = 120;
bool isClearAlarm = false; isClearAlarm = false;
if (ACServerManager.GetAlarmStatus(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()).Equals(1)) if (ACServerManager.GetAlarmStatus(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()).Equals(1))
{ {
isClearAlarm = true; isClearAlarm = true;
......
...@@ -34,9 +34,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -34,9 +34,16 @@ namespace OnlineStore.DeviceLibrary
moveAxis.TargetPosition = targetPosition; moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
} }
private static void ACAxisRelMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, int.MaxValue, targetSpeed));
moveAxis.TargetPosition = targetPosition;
ACServerManager.RelMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed, moveAxis.AddSpeed, moveAxis.DelSpeed);
}
private static void ACAxisHomeMove(ConfigMoveAxis moveAxis) private static void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{ {
moveAxis.TargetPosition = 0; moveAxis.TargetPosition = 0;
LogUtil.debug(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回"); LogUtil.debug(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed); ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true)); StoreMove.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
...@@ -59,7 +66,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -59,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
if (errorCount <= moveAxis.CanErrorCountMax) if (errorCount <= moveAxis.CanErrorCountMax)
{ {
LogUtil.info(Name + moveAxis.DisplayStr + "回原已到位,当前位置[" + outCount + "]最大允许误差[" + moveAxis.CanErrorCountMax + "]"); LogUtil.info(Name + moveAxis.DisplayStr + "回原已到位,当前位置[" + outCount + "]最大允许误差[" + moveAxis.CanErrorCountMax + "]");
//ACServerManager.SuddenStop(moveAxis); ACServerManager.SuddenStop(moveAxis);
return true; return true;
} }
//判断是否需要重新运动 //判断是否需要重新运动
...@@ -239,7 +246,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,7 +246,12 @@ namespace OnlineStore.DeviceLibrary
string deviceName = moveAxis.DeviceName; string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue(); short axisNo = moveAxis.GetAxisValue();
bool countError = false; bool countError = false;
bool IsOk = AxisManager.instance.AbsMoveIsEnd(deviceName, axisNo, targetPosition, moveAxis.CanErrorCountMax, out countError,out int IMP); bool IsOk;
int IMP=0;
if (targetPosition== int.MaxValue)
IsOk = AxisManager.instance.GetBusyStatus(deviceName, axisNo).Equals(0);
else
IsOk = AxisManager.instance.AbsMoveIsEnd(deviceName, axisNo, targetPosition, moveAxis.CanErrorCountMax, out countError,out IMP);
if (IsOk) if (IsOk)
{ {
return true; return true;
......
...@@ -246,6 +246,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -246,6 +246,7 @@ namespace OnlineStore.DeviceLibrary
SO_07_CheckFix_01 , SO_07_CheckFix_01 ,
SO_07_CheckFix_02 , SO_07_CheckFix_02 ,
SO_07_CheckFix_03 , SO_07_CheckFix_03 ,
SO_07_CheckFix_04_inoutp3,
SO_07_CheckFix_04 , SO_07_CheckFix_04 ,
SO_07_CheckFix_05 , SO_07_CheckFix_05 ,
/// <summary> /// <summary>
...@@ -291,11 +292,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -291,11 +292,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 升降轴走到门口位置 /// 升降轴走到门口位置
/// </summary> /// </summary>
SO_21_OpenDoor = 121, SO_21_OpenDoor ,
/// <summary> /// <summary>
/// 等待操作人员拿走料盘 /// 等待操作人员拿走料盘
/// </summary> /// </summary>
SO_22_WaitTrayGo = 122, SO_22_WaitTrayGo,
///// <summary> ///// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!