Commit dfbc8272 刘韬

稳定版

1 个父辈 d4b24431
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.Common</RootNamespace> <RootNamespace>OnlineStore.Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -99,8 +99,8 @@ namespace OnlineStore.Common ...@@ -99,8 +99,8 @@ namespace OnlineStore.Common
public static string CodeCount = "CodeCount"; public static string CodeCount = "CodeCount";
public static string CurrShelfNum = "CurrShelfNum"; //public static string CurrShelfNum = "CurrShelfNum";
public static string CurrShelfType = "CurrShelfType"; //public static string CurrShelfType = "CurrShelfType";
//是否有T4进出轴 //是否有T4进出轴
public static string HasT4Axis = "HasT4Axis"; public static string HasT4Axis = "HasT4Axis";
...@@ -110,6 +110,7 @@ namespace OnlineStore.Common ...@@ -110,6 +110,7 @@ namespace OnlineStore.Common
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 InstoreEndSendShelf = "InstoreEndSendShelf"; public static string InstoreEndSendShelf = "InstoreEndSendShelf";
public static string OutstoreEndSendShelf= "OutstoreEndSendShelf"; public static string OutstoreEndSendShelf= "OutstoreEndSendShelf";
public static string LastOutShelfType= "LastOutShelfType"; public static string ElectricGripperForce = "ElectricGripperForce";
//public static string LastOutShelfType= "LastOutShelfType";
} }
} }
...@@ -27,6 +27,8 @@ namespace OnlineStore.Common ...@@ -27,6 +27,8 @@ namespace OnlineStore.Common
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType); public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
public static bool Init(string port) public static bool Init(string port)
{ {
lock (serialBeanMap)
{
if (serialBeanMap.ContainsKey(port)) if (serialBeanMap.ContainsKey(port))
{ {
return true; return true;
...@@ -48,7 +50,7 @@ namespace OnlineStore.Common ...@@ -48,7 +50,7 @@ namespace OnlineStore.Common
} }
else else
{ {
LogUtil.error( LogName + "串口" + port + "打开失败!"); LogUtil.error(LogName + "串口" + port + "打开失败!");
return false; return false;
} }
} }
...@@ -58,6 +60,7 @@ namespace OnlineStore.Common ...@@ -58,6 +60,7 @@ namespace OnlineStore.Common
} }
return true; return true;
} }
}
/// <summary> /// <summary>
/// 释放资源 /// 释放资源
/// </summary> /// </summary>
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="OnlineStore.DUOStore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections> </configSections>
<appSettings> <appSettings>
<!--是否开机自动启动料仓--> <!--是否开机自动启动料仓-->
...@@ -60,8 +63,9 @@ ...@@ -60,8 +63,9 @@
<add key="HasT4Axis" value="true"/> <add key="HasT4Axis" value="true"/>
<add key="AgvServerIp" value="192.168.11.11"/> <add key="AgvServerIp" value="192.168.11.11"/>
<add key="Code_Block_Size_List" value="17,19"/> <add key="Code_Block_Size_List" value="17,19"/>
<add key="InstoreEndSendShelf" value="1" /> <add key="InstoreEndSendShelf" value="1"/>
<add key="OutstoreEndSendShelf" value="1" /> <add key="OutstoreEndSendShelf" value="1"/>
<add key="ElectricGripperForce" value="50"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
...@@ -128,4 +132,17 @@ ...@@ -128,4 +132,17 @@
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup> </startup>
<userSettings>
<OnlineStore.DUOStore.Properties.Settings>
<setting name="CurrShelfNum" serializeAs="String">
<value/>
</setting>
<setting name="CurrShelfType" serializeAs="String">
<value>0</value>
</setting>
<setting name="LastOutShelfType" serializeAs="String">
<value>0</value>
</setting>
</OnlineStore.DUOStore.Properties.Settings>
</userSettings>
</configuration> </configuration>
...@@ -38,7 +38,10 @@ ...@@ -38,7 +38,10 @@
<ApplicationIcon>box.ico</ApplicationIcon> <ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Agv, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> <Reference Include="Agv, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\775-agv-net4.6.1\Agv.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.7380.18241, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.7380.18241, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath> <HintPath>..\..\..\GeneralClassLibrary\CodeLibraryProject\CodeLibrary\bin\Debug\CodeLibrary.dll</HintPath>
...@@ -127,6 +130,11 @@ ...@@ -127,6 +130,11 @@
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
<Compile Include="useControl\AxisMoveControl.cs"> <Compile Include="useControl\AxisMoveControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -193,6 +201,10 @@ ...@@ -193,6 +201,10 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<None Include="Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config"> <None Include="App.config">
......
...@@ -28,6 +28,8 @@ namespace OnlineStore.DUOStore ...@@ -28,6 +28,8 @@ namespace OnlineStore.DUOStore
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAxisMove)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAxisMove));
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupInout = new System.Windows.Forms.GroupBox(); this.groupInout = new System.Windows.Forms.GroupBox();
this.txtInOutP6 = new System.Windows.Forms.TextBox();
this.btnInOutP6 = new System.Windows.Forms.Button();
this.btnSaveP = new System.Windows.Forms.Button(); this.btnSaveP = new System.Windows.Forms.Button();
this.txtT2P4 = new System.Windows.Forms.TextBox(); this.txtT2P4 = new System.Windows.Forms.TextBox();
this.btnT2P4 = new System.Windows.Forms.Button(); this.btnT2P4 = new System.Windows.Forms.Button();
...@@ -65,8 +67,7 @@ namespace OnlineStore.DUOStore ...@@ -65,8 +67,7 @@ namespace OnlineStore.DUOStore
this.btnMiddleP3 = new System.Windows.Forms.Button(); this.btnMiddleP3 = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.DUOStore.AxisMoveControl(); this.axisMoveControl1 = new OnlineStore.DUOStore.AxisMoveControl();
this.btnSotreReset = new System.Windows.Forms.Button(); this.btnSotreReset = new System.Windows.Forms.Button();
this.txtInOutP6 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button();
this.btnInOutP6 = new System.Windows.Forms.Button();
this.groupInout.SuspendLayout(); this.groupInout.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -122,6 +123,40 @@ namespace OnlineStore.DUOStore ...@@ -122,6 +123,40 @@ namespace OnlineStore.DUOStore
this.groupInout.TabStop = false; this.groupInout.TabStop = false;
this.groupInout.Text = "提升机构位置信息"; this.groupInout.Text = "提升机构位置信息";
// //
// txtInOutP6
//
this.txtInOutP6.AcceptsReturn = true;
this.txtInOutP6.BackColor = System.Drawing.SystemColors.Window;
this.txtInOutP6.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtInOutP6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtInOutP6.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtInOutP6.Location = new System.Drawing.Point(583, 185);
this.txtInOutP6.MaxLength = 0;
this.txtInOutP6.Name = "txtInOutP6";
this.txtInOutP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInOutP6.Size = new System.Drawing.Size(89, 23);
this.txtInOutP6.TabIndex = 316;
this.txtInOutP6.Text = "999999";
//
// btnInOutP6
//
this.btnInOutP6.AutoSize = true;
this.btnInOutP6.BackColor = System.Drawing.SystemColors.Control;
this.btnInOutP6.Cursor = System.Windows.Forms.Cursors.Default;
this.btnInOutP6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInOutP6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInOutP6.ForeColor = System.Drawing.Color.DarkGoldenrod;
this.btnInOutP6.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnInOutP6.Location = new System.Drawing.Point(372, 180);
this.btnInOutP6.Name = "btnInOutP6";
this.btnInOutP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnInOutP6.Size = new System.Drawing.Size(205, 33);
this.btnInOutP6.TabIndex = 315;
this.btnInOutP6.Text = "T4_进出轴13寸取料点进入前点P6";
this.btnInOutP6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnInOutP6.UseVisualStyleBackColor = false;
this.btnInOutP6.Click += new System.EventHandler(this.btnInOutP6_Click);
//
// btnSaveP // btnSaveP
// //
this.btnSaveP.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSaveP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
...@@ -717,45 +752,23 @@ namespace OnlineStore.DUOStore ...@@ -717,45 +752,23 @@ namespace OnlineStore.DUOStore
this.btnSotreReset.UseVisualStyleBackColor = true; this.btnSotreReset.UseVisualStyleBackColor = true;
this.btnSotreReset.Click += new System.EventHandler(this.btnSotreReset_Click); this.btnSotreReset.Click += new System.EventHandler(this.btnSotreReset_Click);
// //
// txtInOutP6 // button1
//
this.txtInOutP6.AcceptsReturn = true;
this.txtInOutP6.BackColor = System.Drawing.SystemColors.Window;
this.txtInOutP6.Cursor = System.Windows.Forms.Cursors.IBeam;
this.txtInOutP6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtInOutP6.ForeColor = System.Drawing.SystemColors.WindowText;
this.txtInOutP6.Location = new System.Drawing.Point(583, 185);
this.txtInOutP6.MaxLength = 0;
this.txtInOutP6.Name = "txtInOutP6";
this.txtInOutP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.txtInOutP6.Size = new System.Drawing.Size(89, 23);
this.txtInOutP6.TabIndex = 316;
this.txtInOutP6.Text = "999999";
// //
// btnInOutP6 this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
// this.button1.Location = new System.Drawing.Point(182, 414);
this.btnInOutP6.AutoSize = true; this.button1.Name = "button1";
this.btnInOutP6.BackColor = System.Drawing.SystemColors.Control; this.button1.Size = new System.Drawing.Size(128, 39);
this.btnInOutP6.Cursor = System.Windows.Forms.Cursors.Default; this.button1.TabIndex = 276;
this.btnInOutP6.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Text = "夹爪测试";
this.btnInOutP6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button1.UseVisualStyleBackColor = true;
this.btnInOutP6.ForeColor = System.Drawing.Color.DarkGoldenrod; this.button1.Click += new System.EventHandler(this.button1_Click);
this.btnInOutP6.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnInOutP6.Location = new System.Drawing.Point(372, 180);
this.btnInOutP6.Name = "btnInOutP6";
this.btnInOutP6.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnInOutP6.Size = new System.Drawing.Size(205, 33);
this.btnInOutP6.TabIndex = 315;
this.btnInOutP6.Text = "T4_进出轴13寸取料点进入前点P6";
this.btnInOutP6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnInOutP6.UseVisualStyleBackColor = false;
this.btnInOutP6.Click += new System.EventHandler(this.btnInOutP6_Click);
// //
// FrmAxisMove // FrmAxisMove
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1323, 559); this.ClientSize = new System.Drawing.Size(1323, 559);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnSotreReset); this.Controls.Add(this.btnSotreReset);
this.Controls.Add(this.groupInout); this.Controls.Add(this.groupInout);
this.Controls.Add(this.axisMoveControl1); this.Controls.Add(this.axisMoveControl1);
...@@ -815,6 +828,7 @@ namespace OnlineStore.DUOStore ...@@ -815,6 +828,7 @@ namespace OnlineStore.DUOStore
private System.Windows.Forms.Button btnSotreReset; private System.Windows.Forms.Button btnSotreReset;
public System.Windows.Forms.TextBox txtInOutP6; public System.Windows.Forms.TextBox txtInOutP6;
public System.Windows.Forms.Button btnInOutP6; public System.Windows.Forms.Button btnInOutP6;
private System.Windows.Forms.Button button1;
} }
} }
...@@ -18,6 +18,7 @@ using System.IO.Ports; ...@@ -18,6 +18,7 @@ using System.IO.Ports;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using CodeLibrary; using CodeLibrary;
using UserFromControl; using UserFromControl;
using System.Threading.Tasks;
namespace OnlineStore.DUOStore namespace OnlineStore.DUOStore
{ {
...@@ -233,6 +234,29 @@ namespace OnlineStore.DUOStore ...@@ -233,6 +234,29 @@ namespace OnlineStore.DUOStore
} }
} }
private void button1_Click(object sender, EventArgs e)
{
Task.Run(()=> {
bool isclamp = false;
int i = 0;
var ec = StoreManager.Store.electricClamp;
ec.OpenPort(StoreManager.Config.Clamp1Port);
while (i < 50)
{
i++;
LogUtil.info($"electricClamp [{i}] isclamp:{isclamp},Action:{(isclamp?"Release":"Clamp")}, IsMoving:{ec.IsMoving}, IsPushEmpty:{ec.IsPushEmpty}, IsReached:{ec.IsReached}, ErrorCode:{ec.ErrorCode}");
if (isclamp) {
if (ec.Release()) {
isclamp = false;
}
}
else if (ec.Clamp()) {
isclamp = true;
}
Task.Delay(100).Wait();
}
});
}
} }
} }
...@@ -842,7 +842,10 @@ namespace OnlineStore.DUOStore ...@@ -842,7 +842,10 @@ namespace OnlineStore.DUOStore
private void btn_clearTimeout_Click(object sender, EventArgs e) private void btn_clearTimeout_Click(object sender, EventArgs e)
{ {
if (BoxBean.alarmType == AlarmType.IoSingleTimeOut) if (BoxBean.alarmType == AlarmType.IoSingleTimeOut)
{
LogUtil.info("用户点击清除IO等待 ");
BoxBean.MoveInfo.EndStepWait(); BoxBean.MoveInfo.EndStepWait();
} }
} }
}
} }
...@@ -522,11 +522,16 @@ namespace OnlineStore.DUOStore ...@@ -522,11 +522,16 @@ namespace OnlineStore.DUOStore
UpdateListBox(); UpdateListBox();
lblWarnMsg.Text = msg; lblWarnMsg.Text = msg;
//if (StoreManager.FrontDoorOpen) {
// lblWarnMsg.Text += "\r\n前门打开, 系统暂停运行,关门后请按复位按钮继续.";
//}
lblAgv.Text = "AGV状态:\n"; lblAgv.Text = "AGV状态:\n";
lblAgv.Text += $" 入口{StoreManager.Store.Config.AgvInName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvInName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvInName)}\n"; lblAgv.Text += $" 入口{StoreManager.Store.Config.AgvInName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvInName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvInName)}\n";
lblAgv.Text += $" 出口{StoreManager.Store.Config.AgvOutName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvOutName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvOutName)}\n"; lblAgv.Text += $" 出口{StoreManager.Store.Config.AgvOutName}:{AgvClient.GetAction(StoreManager.Store.Config.AgvOutName)},{AgvClient.GetShelf(StoreManager.Store.Config.AgvOutName)}\n";
//StoreManager.Store.electricClamp.IsBusy
LogM(); LogM();
} }
......
...@@ -22,5 +22,41 @@ namespace OnlineStore.DUOStore.Properties { ...@@ -22,5 +22,41 @@ namespace OnlineStore.DUOStore.Properties {
return defaultInstance; return defaultInstance;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string CurrShelfNum {
get {
return ((string)(this["CurrShelfNum"]));
}
set {
this["CurrShelfNum"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int CurrShelfType {
get {
return ((int)(this["CurrShelfType"]));
}
set {
this["CurrShelfType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int LastOutShelfType {
get {
return ((int)(this["LastOutShelfType"]));
}
set {
this["LastOutShelfType"] = value;
}
}
} }
} }
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OnlineStore.DUOStore.Properties" GeneratedClassName="Settings">
<Profiles> <Profiles />
<Profile Name="(Default)" /> <Settings>
</Profiles> <Setting Name="CurrShelfNum" Type="System.String" Scope="User">
<Settings /> <Value Profile="(Default)" />
</Setting>
<Setting Name="CurrShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="LastOutShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile> </SettingsFile>
\ No newline at end of file \ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.DUOStore {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
public static Settings1 Default {
get {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>
...@@ -109,6 +109,11 @@ ...@@ -109,6 +109,11 @@
<Compile Include="device\halcon\CodeManager.cs" /> <Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" /> <Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="device\IO\IOManager.cs" /> <Compile Include="device\IO\IOManager.cs" />
<Compile Include="Properties\Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
<Compile Include="store\AutoInoutInfo.cs" /> <Compile Include="store\AutoInoutInfo.cs" />
<Compile Include="store\LineMoveP.cs" /> <Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs"> <Compile Include="store\LineAlarm.cs">
...@@ -144,6 +149,11 @@ ...@@ -144,6 +149,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
<None Include="StoreConfig\box_1_Camera.json"> <None Include="StoreConfig\box_1_Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace OnlineStore.DeviceLibrary.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
public static Settings1 Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string CurrShelfNum {
get {
return ((string)(this["CurrShelfNum"]));
}
set {
this["CurrShelfNum"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int CurrShelfType {
get {
return ((int)(this["CurrShelfType"]));
}
set {
this["CurrShelfType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int LastOutShelfType {
get {
return ((int)(this["LastOutShelfType"]));
}
set {
this["LastOutShelfType"] = value;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OnlineStore.DeviceLibrary.Properties" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="CurrShelfNum" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="CurrShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="LastOutShelfType" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file \ No newline at end of file
...@@ -51,7 +51,7 @@ DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,, ...@@ -51,7 +51,7 @@ DI,0,设备左侧防护门关闭端,LeftDoor_Close,36,HC,X36,*,,,,,,,,,
DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,, DI,0,设备右侧防护门打开端,RightDoor_Open,37,HC,X37,*,,,,,,,,,
DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,, DI,0,设备右侧防护门关闭端,RightDoor_Close,38,HC,X38,*,,,,,,,,,
DI,0,15寸料盘宽度检测,TrayCheck_15,39,HC,X39,*,,,,,,,,, DI,0,15寸料盘宽度检测,TrayCheck_15,39,HC,X39,*,,,,,,,,,
DI,0,卡爪范围确认,Clamp_InRange,40,HC,X40,*,,,,,,,,, DI,0,前门门禁信号,FrontDoor_Check,40,HC,X40,*,,,,,,,,,
DI,0,卡爪动作中,Clamp_Busy,41,HC,X41,*,,,,,,,,, DI,0,卡爪动作中,Clamp_Busy,41,HC,X41,*,,,,,,,,,
DI,0,卡爪异常代码1,Clamp_Abnormal1,42,HC,X42,*,,,,,,,,, DI,0,卡爪异常代码1,Clamp_Abnormal1,42,HC,X42,*,,,,,,,,,
DI,0,卡爪异常代码2,Clamp_Abnormal2,43,HC,X43,*,,,,,,,,, DI,0,卡爪异常代码2,Clamp_Abnormal2,43,HC,X43,*,,,,,,,,,
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="OnlineStore.DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<userSettings>
<OnlineStore.DeviceLibrary.Properties.Settings1>
<setting name="CurrShelfNum" serializeAs="String">
<value/>
</setting>
<setting name="CurrShelfType" serializeAs="String">
<value>0</value>
</setting>
<setting name="LastOutShelfType" serializeAs="String">
<value>0</value>
</setting>
</OnlineStore.DeviceLibrary.Properties.Settings1>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
...@@ -161,13 +161,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -161,13 +161,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.info(" 【" + cameraName + "】取图片完成,开始扫码");
string r = ""; string r = "";
foreach (int codesize in Code_Block_Size_List) //foreach (int codesize in Code_Block_Size_List)
{ {
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp, null, codesize); List<CodeInfo> tlci = EyemDecode2.Decoder(ref bmp, null);
foreach (CodeInfo code in tlci) foreach (CodeInfo code in tlci)
{ {
LogUtil.info(" 【" + cameraName + $"】[eyemDecode blocksize:{codesize}]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr); LogUtil.info(" 【" + cameraName + $"】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr); string str = CodeManager.ReplaceCode(code.CodeStr);
lock (codeList) lock (codeList)
{ {
...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -190,7 +190,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000); cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2500);
} }
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
{ {
......
...@@ -116,6 +116,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -116,6 +116,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
LogInfo("开始启动,启动时间:" + StartTime.ToString()); LogInfo("开始启动,启动时间:" + StartTime.ToString());
WarnMsg = "";
AutoInout.StopAuto(); AutoInout.StopAuto();
mainTimer.Enabled = false; mainTimer.Enabled = false;
alarmType = AlarmType.None; alarmType = AlarmType.None;
...@@ -393,7 +394,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -393,7 +394,7 @@ namespace OnlineStore.DeviceLibrary
&& IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.LOW)) && IOValue(IO_Type.OutDoor_SafeSignal).Equals(IO_VALUE.LOW))
{ {
OutDoorCloseCountDown--; OutDoorCloseCountDown--;
while (OutDoorCloseCountDown == 0) if (OutDoorCloseCountDown == 0)
{ {
CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down); CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
LogInfo("料已被取走,关门"); LogInfo("料已被取走,关门");
......
...@@ -55,19 +55,40 @@ namespace OnlineStore.DeviceLibrary ...@@ -55,19 +55,40 @@ namespace OnlineStore.DeviceLibrary
camera.Dispose(); camera.Dispose();
} }
void CameraGrabOne(string filename) { void CameraGrabOne(string filename) {
LogUtil.info(Name + "库位文件名:"+ filename); try
return; {
if (!camera.IsOpen[0]) { LogUtil.info(Name + "库位文件名:" + filename);
//return;
if (!camera.IsOpen[0])
{
camera.Open(0); camera.Open(0);
LogUtil.error(Name + "打开监控相机失败2"); LogUtil.error(Name + "打开监控相机失败2");
} }
var rtn = camera.GrabOne(0, out Bitmap bmp); var rtn = camera.GrabOne(0, out Bitmap bmp);
if (rtn) if (rtn)
{ {
bmp.Save(filename,ImageFormat.Jpeg); if (File.Exists(filename))
File.Delete(filename);
bmp.Save(filename, ImageFormat.Jpeg);
bmp.Dispose();
}
else {
rtn = camera.GrabOne(0, out bmp);
if (rtn)
{
if (File.Exists(filename))
File.Delete(filename);
bmp.Save(filename, ImageFormat.Jpeg);
bmp.Dispose(); bmp.Dispose();
} }
} }
}
catch (Exception e) {
LogUtil.error(Name + e.ToString());
}
}
string GetFixtureStateFilename(InOutParam inOutParam, FixtureState fixtureState) { string GetFixtureStateFilename(InOutParam inOutParam, FixtureState fixtureState) {
string dir = $"\\image\\Fixture\\{inOutParam.moveType}\\BOX{ID}\\{inOutParam.PosID}\\"; string dir = $"\\image\\Fixture\\{inOutParam.moveType}\\BOX{ID}\\{inOutParam.PosID}\\";
Directory.CreateDirectory(dir); Directory.CreateDirectory(dir);
...@@ -81,6 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -81,6 +102,7 @@ namespace OnlineStore.DeviceLibrary
enum FixtureState { enum FixtureState {
In, In,
Up, Up,
Down,
Out Out
} }
} }
......
...@@ -162,7 +162,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack)) else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack))
{ {
if (true || StoreManager.Store.BoxDoorFree(ID)) if (StoreManager.Store.BoxDoorFree(ID))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2); MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2);
InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] "); InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] ");
...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_03_InoutToP2)) else if (MoveInfo.IsStep(StoreMoveStep.SI_03_InoutToP2))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.In));
MoveInfo.NextMoveStep(StoreMoveStep.SI_04_GetReel); MoveInfo.NextMoveStep(StoreMoveStep.SI_04_GetReel);
InOutStoreLog(outType + "升降轴到入料口高点P2 [" + moveP.UpDown_P2 + "],压紧轴到P2 [" + moveP.ComPress_P2 + "] "); InOutStoreLog(outType + "升降轴到入料口高点P2 [" + moveP.UpDown_P2 + "],压紧轴到P2 [" + moveP.ComPress_P2 + "] ");
ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed); ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
...@@ -186,14 +186,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -186,14 +186,14 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_04_GetReel)) else if (MoveInfo.IsStep(StoreMoveStep.SI_04_GetReel))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.Up));
MoveInfo.NextMoveStep(StoreMoveStep.SI_05_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.SI_05_InoutToP1);
InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] "); InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_05_InoutToP1)) else if (MoveInfo.IsStep(StoreMoveStep.SI_05_InoutToP1))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.Out));
MoveInfo.NextMoveStep(StoreMoveStep.SI_06_FixtureCheck); MoveInfo.NextMoveStep(StoreMoveStep.SI_06_FixtureCheck);
InOutStoreLog(outType + "等待料叉检测信号 "); InOutStoreLog(outType + "等待料叉检测信号 ");
if (Config.IsUse_Tray_Check.Equals(1)) if (Config.IsUse_Tray_Check.Equals(1))
...@@ -227,6 +227,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -227,6 +227,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_07_InoutToP3)) else if (MoveInfo.IsStep(StoreMoveStep.SI_07_InoutToP3))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.In));
MoveInfo.NextMoveStep(StoreMoveStep.SI_08_PutReel); MoveInfo.NextMoveStep(StoreMoveStep.SI_08_PutReel);
InOutStoreLog(outType + "升降轴到P4[" + moveP.UpDown_P4 + "],压紧轴到P3[" + moveP.ComPress_P3 + "]"); InOutStoreLog(outType + "升降轴到P4[" + moveP.UpDown_P4 + "],压紧轴到P3[" + moveP.ComPress_P3 + "]");
...@@ -240,6 +241,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -240,6 +241,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_08_PutReel)) else if (MoveInfo.IsStep(StoreMoveStep.SI_08_PutReel))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.Down));
MoveInfo.NextMoveStep(StoreMoveStep.SI_09_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.SI_09_InoutToP1);
InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] "); InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
...@@ -247,6 +249,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -247,6 +249,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.SI_09_InoutToP1)) else if (MoveInfo.IsStep(StoreMoveStep.SI_09_InoutToP1))
{ {
CameraGrabOne(GetFixtureStateFilename(MoveInfo.MoveParam, FixtureState.Out));
MoveInfo.NextMoveStep(StoreMoveStep.SI_10_GoBack); MoveInfo.NextMoveStep(StoreMoveStep.SI_10_GoBack);
InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],"); InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],");
//ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed); //ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
...@@ -300,7 +303,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -300,7 +303,7 @@ namespace OnlineStore.DeviceLibrary
OutDoorReelType = 2; OutDoorReelType = 2;
else else
OutDoorReelType = 1; OutDoorReelType = 1;
InOutStoreLog(outType + "打开出料口门 "); InOutStoreLog(outType + "打开出料口门 OutDoor_Check:" + IOValue(IO_Type.OutDoor_Check).ToString());
CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up); CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.OutDoor_Check, IO_VALUE.LOW));
} }
...@@ -543,14 +546,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -543,14 +546,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.SO_06A_04_FixDisk); MoveInfo.NextMoveStep(StoreMoveStep.SO_06A_04_FixDisk);
InOutStoreLog(outType + "[修正]升降轴到P4[" + fixMoveP.UpDown_P4 + "],压紧轴到P3[" + moveP.ComPress_P3 + "]"); InOutStoreLog(outType + "[修正]升降轴到P4[" + fixMoveP.UpDown_P4 + "],压紧轴到P3[" + moveP.ComPress_P3 + "]");
ComAxis.AbsMove(MoveInfo, fixMoveP.ComPress_P3, Config.CompAxis_P3_Speed * 3); ComAxis.AbsMove(MoveInfo, fixMoveP.ComPress_P3, Config.CompAxis_P3_Speed * 3);
UpdownAxis.AbsMove(MoveInfo, fixMoveP.UpDown_P4, Config.UpDownAxis_P4_Speed * 3); UpdownAxis.AbsMove(MoveInfo, fixMoveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_06A_04_FixDisk)) else if (MoveInfo.IsStep(StoreMoveStep.SO_06A_04_FixDisk))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_06A_05_FixDisk); MoveInfo.NextMoveStep(StoreMoveStep.SO_06A_05_FixDisk);
InOutStoreLog(outType + "[修正]升降轴到P6[" + fixMoveP.UpDown_P6 + "],压紧轴到P2[" + fixMoveP.ComPress_P2 + "]"); InOutStoreLog(outType + "[修正]升降轴到P6[" + fixMoveP.UpDown_P6 + "],压紧轴到P2[" + fixMoveP.ComPress_P2 + "]");
ComAxis.AbsMove(MoveInfo, fixMoveP.ComPress_P2, Config.CompAxis_P2_Speed * 3); ComAxis.AbsMove(MoveInfo, fixMoveP.ComPress_P2, Config.CompAxis_P2_Speed * 3);
UpdownAxis.AbsMove(MoveInfo, fixMoveP.UpDown_P6, Config.UpDownAxis_P6_Speed * 3); UpdownAxis.AbsMove(MoveInfo, fixMoveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
} }
else if (MoveInfo.IsStep(StoreMoveStep.SO_06A_05_FixDisk)) else if (MoveInfo.IsStep(StoreMoveStep.SO_06A_05_FixDisk))
{ {
......
using OnlineStore.LoadCSVLibrary; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
...@@ -10,8 +12,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -10,8 +12,12 @@ namespace OnlineStore.DeviceLibrary
public class ElectricGripper public class ElectricGripper
{ {
private int subType = 0; private int subType = 0;
private Neotel.Rmaxis axis; public Neotel.Rmaxis axis;
private int Force=50;
public Enum GripperType = GripperTypeE.None; public Enum GripperType = GripperTypeE.None;
public ElectricGripper(int force){
Force = force;
}
public bool OpenPort(string port) public bool OpenPort(string port)
{ {
axis = new Neotel.Rmaxis(); axis = new Neotel.Rmaxis();
...@@ -22,47 +28,56 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,47 +28,56 @@ namespace OnlineStore.DeviceLibrary
public void ClosePort() { public void ClosePort() {
axis.ClosePort(); axis.ClosePort();
} }
public void Clamp(StoreMoveInfo moveInfo = null,int plateW=7) public bool Clamp(StoreMoveInfo moveInfo = null,int plateW=7)
{ {
GripperType = GripperTypeE.Gripper; GripperType = GripperTypeE.Gripper;
if (!IsBusy) if (!IsBusy)
{ {
//if (plateW > 7) //if (plateW > 7)
if (true) try
{ {
axis.Push(99, 7, 10); axis.Push(Force, 4.5f, 15);
} }
else catch(Exception e) {
{ LogUtil.info(e.ToString());
axis.Push(50, 7, 10); return false;
} }
if (moveInfo!=null) if (moveInfo!=null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
return true;
} }
if (moveInfo != null) if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction))); moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
return false;
} }
public bool Release(StoreMoveInfo moveInfo = null) public bool Release(StoreMoveInfo moveInfo = null)
{ {
GripperType = GripperTypeE.Release; GripperType = GripperTypeE.Release;
if (!IsBusy) if (!IsBusy)
{ {
axis.GoHome(); //axis.StopAxis();
//Thread.Sleep(500);
axis.MoveAbsolute(0, 30, 500, 500, 0.1f);
if (moveInfo != null) if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
return true; return true;
} }
else else
{ {
//axis.StopAxis();
//Thread.Sleep(500);
//axis.GoHome();
if (moveInfo != null) if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction))); moveInfo.WaitList.Add(WaitResultInfo.WaitAction(new Func<WaitResultInfo, bool>(WaitAction)));
return false; return false;
} }
} }
public void HomeReset(StoreMoveInfo moveInfo = null) { public void HomeReset(StoreMoveInfo moveInfo = null)
{
GripperType = GripperTypeE.Reset; GripperType = GripperTypeE.Reset;
//if (!IsBusy) //if (!IsBusy)
//{ //{
axis.StopAxis();
axis.ResetError(); axis.ResetError();
axis.GoHome(); axis.GoHome();
// } // }
...@@ -71,9 +86,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -71,9 +86,19 @@ namespace OnlineStore.DeviceLibrary
} }
public bool IsBusy { public bool IsBusy {
get { get {
//axis.GetPosition(); LogUtil.info($"ElectricGripper IsReached:{axis.IsReached},IsMoving:{axis.IsMoving},Pos:{axis.GetPosition()}");
//return false;
try
{
return !axis.IsReached; return !axis.IsReached;
} }
catch (Exception e)
{
LogUtil.info(e.ToString());
return true;
}
}
} }
public bool IsClamp { public bool IsClamp {
get get
...@@ -82,6 +107,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,6 +107,10 @@ namespace OnlineStore.DeviceLibrary
return !axis.IsPushEmpty; return !axis.IsPushEmpty;
} }
} }
public bool IsPushEmpty { get => axis.IsPushEmpty; }
public bool IsMoving { get => axis.IsMoving; }
public bool IsReached { get => axis.IsReached; }
public int ErrorCode { get => axis.ErrorCode; }
bool WaitAction(WaitResultInfo w) bool WaitAction(WaitResultInfo w)
{ {
......
...@@ -72,7 +72,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -72,7 +72,12 @@ namespace OnlineStore.DeviceLibrary
{ {
InProcess = true; InProcess = true;
stopwatch.Restart(); stopwatch.Restart();
if (!StoreManager.FrontDoorOpen)
TimerProcess(); TimerProcess();
else
{
WarnMsg="前维护门打开,系统暂停运行.";
}
ShowTimeLog("TimerProcess"); ShowTimeLog("TimerProcess");
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -67,11 +67,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,11 +67,14 @@ namespace OnlineStore.DeviceLibrary
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue); private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue); private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
public string currTempStr = ""; public string currTempStr = "";
Random num = new Random();
internal void HumidityProcess(BoxBean box) internal void HumidityProcess(BoxBean box)
{ {
try try
{ {
if ((DateTime.Now - preLogTime).TotalSeconds > 10) int rad = num.Next(9, 13);
if ((DateTime.Now - preLogTime).TotalSeconds > rad)
{ {
preLogTime = DateTime.Now; preLogTime = DateTime.Now;
HumitureParam param = QueryData(); HumitureParam param = QueryData();
......
...@@ -24,8 +24,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -24,8 +24,18 @@ namespace OnlineStore.DeviceLibrary
public static string LastVisualRfid = ""; public static string LastVisualRfid = "";
public volatile static bool ShelfNeedOut = false; public volatile static bool ShelfNeedOut = false;
public StoreManager()
public static bool FrontDoorOpen = false;
public static DateTime AgvNeedEmptyTime = DateTime.Now;
static StoreManager()
{ {
//var CurrShelfNum = Properties.Settings1.Default.CurrShelfNum;
//Properties.Settings1.Default.CurrShelfNum = "12";
//Properties.Settings1.Default.Save();
//CurrShelfNum = Properties.Settings1.Default.CurrShelfNum;
} }
#region 配置文件加载更新 #region 配置文件加载更新
...@@ -345,6 +355,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -345,6 +355,7 @@ namespace OnlineStore.DeviceLibrary
} }
private static string spiltStr = "##"; private static string spiltStr = "##";
private static string Addr_PosForPutin = "/service/store/emptyPosForPutin"; private static string Addr_PosForPutin = "/service/store/emptyPosForPutin";
private static bool r=false;
public static GetPosResult GetPosId(string deviceName, List<string> codeList, int height, int width, string shelfNum) public static GetPosResult GetPosId(string deviceName, List<string> codeList, int height, int width, string shelfNum)
{ {
GetPosResult result = new GetPosResult(); GetPosResult result = new GetPosResult();
...@@ -367,18 +378,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -367,18 +378,22 @@ namespace OnlineStore.DeviceLibrary
// 参数:cids: 多个 cid // 参数:cids: 多个 cid
//code: 条码内容 //code: 条码内容
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
string cids = ""; List<string> cids = new List<string>();
foreach(int k in Store.BoxMap.Keys) foreach(int k in Store.BoxMap.Keys)
{ {
//if (Store.BoxMap[k].runStatus > StoreRunStatus.Wait && Store.BoxMap[k].IOValue(IO_Type.InDoor_Check).Equals(IO_VALUE.LOW))
if (!Store.BoxMap[k].IsDebug && !Store.BoxMap[k].Disabled && Store.BoxMap[k].runStatus > StoreRunStatus.Wait) if (!Store.BoxMap[k].IsDebug && !Store.BoxMap[k].Disabled && Store.BoxMap[k].runStatus > StoreRunStatus.Wait)
{ {
cids += Store.BoxMap[k].CID+","; cids.Add(Store.BoxMap[k].CID);
} }
} }
cids = cids.TrimEnd(','); if (r)
{
paramMap.Add("cids", cids); r = false;
cids.Reverse();
}
else
r = true;
paramMap.Add("cids", string.Join(",",cids.ToArray()));
paramMap.Add("code", codeStr); paramMap.Add("code", codeStr);
paramMap.Add(ParamDefine.rfid, shelfNum); paramMap.Add(ParamDefine.rfid, shelfNum);
......
...@@ -485,7 +485,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -485,7 +485,7 @@ namespace OnlineStore.DeviceLibrary
string msg = ""; string msg = "";
foreach (AxisBean axis in axisArray) foreach (AxisBean axis in axisArray)
{ {
bool result = axis.Open(false, out msg); bool result = axis.Open(true, out msg);
if (!result || (!String.IsNullOrEmpty(msg))) if (!result || (!String.IsNullOrEmpty(msg)))
{ {
SetWarnMsg(Name + msg); SetWarnMsg(Name + msg);
......
...@@ -626,6 +626,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -626,6 +626,11 @@ namespace OnlineStore.DeviceLibrary
BOX_H03_SendOut_04, BOX_H03_SendOut_04,
BOX_H03_SendOut_05, BOX_H03_SendOut_05,
LO_20_UpdownUp_wait, LO_20_UpdownUp_wait,
LO_15b_UpdownUp,
LI_25a_UpdownUp,
LO_15c_UpdownUp,
LO_20a_UpdownUp,
LO_20b_UpdownUp,
#endregion #endregion
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace> <RootNamespace>OnlineStore.LoadCSVLibrary</RootNamespace>
<AssemblyName>LoadCSVLibrary</AssemblyName> <AssemblyName>LoadCSVLibrary</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
......
...@@ -260,15 +260,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -260,15 +260,11 @@ namespace OnlineStore.LoadCSVLibrary
///DI 0 15寸料盘宽度检测 X39 ///DI 0 15寸料盘宽度检测 X39
/// </summary> /// </summary>
public static string TrayCheck_15 = "TrayCheck_15"; public static string TrayCheck_15 = "TrayCheck_15";
/*
/// <summary>
///DI 0 卡爪到位确认 X39
/// </summary>
public static string Clamp_OnPosition = "Clamp_OnPosition";
/// <summary> /// <summary>
///DI 0 卡爪范围确认 X40 ///DI 0 前门门禁信号 X40
/// </summary> /// </summary>
public static string Clamp_InRange = "Clamp_InRange"; public static string FrontDoor_Check = "FrontDoor_Check";
/*
/// <summary> /// <summary>
///DI 0 卡爪动作中 X41 ///DI 0 卡爪动作中 X41
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!