Commit 5229fc72 张东亮

治具出入库更改

1 个父辈 7c97fdf2
正在显示 43 个修改的文件 包含 561 行增加451 行删除

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
# Visual Studio Version 17
VisualStudioVersion = 17.5.33414.496
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject
......@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "source\Lo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ACPackingStore", "source\ACPackingStore\ACPackingStore.csproj", "{0D2542F5-DD62-4352-82D0-383D9A045E74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigHelper", "..\..\..\CSharp-Workspace\MyProject\DLL\ConfigHelper\ConfigHelper\ConfigHelper.csproj", "{290182DB-D949-434E-9FF7-C59BDE3F433A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -39,6 +41,10 @@ Global
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D2542F5-DD62-4352-82D0-383D9A045E74}.Release|Any CPU.Build.0 = Release|Any CPU
{290182DB-D949-434E-9FF7-C59BDE3F433A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{290182DB-D949-434E-9FF7-C59BDE3F433A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{290182DB-D949-434E-9FF7-C59BDE3F433A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{290182DB-D949-434E-9FF7-C59BDE3F433A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -181,6 +181,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\CSharp-Workspace\MyProject\DLL\ConfigHelper\ConfigHelper\ConfigHelper.csproj">
<Project>{290182DB-D949-434E-9FF7-C59BDE3F433A}</Project>
<Name>ConfigHelper</Name>
</ProjectReference>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name>
......
......@@ -3,64 +3,6 @@
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<appSettings>
<!--是否开机自动启动料仓-->
<add key="App_AutoRun" value="1" />
<add key="App_Title" value="包装料料仓" />
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<add key="StartBlowValue" value="4" />
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<add key="StopBlowValue" value="4" />
<!--Server address-->
<add key="http.server" value="http://10.85.160.25/myproject/" />
<!--storeType-->
<add key="store_count" value="2" />
<add key="Store_ConfigPath" value="\StoreConfig\StoreConfig.csv" />
<!--start one store config-->
<add key="Shelf_Position_Config" value="\StoreConfig\shelfPosition.csv" />
<add key="Store_Position_Config" value="\StoreConfig\linePositions.csv" />
<add key="BOX_ConfigPath" value="\StoreConfig\BoxConfig.csv" />
<add key="Store_Type" value="RC_AC_PA" />
<add key="Store_CID" value="packing-store" />
<add key="Store_CID_1" value="packing-19" />
<add key="Store_CID_2" value="packing-20" />
<!--end one store config-->
<add key="ACBaudRate" value="115200" />
<add key="InOutDefaultPosition" value="52000" />
<add key="Config_Pwd" value="123456" />
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<add key="CodeType" value="QR Code#Data Matrix ECC 200" />
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\" />
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="1" />
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="0" />
<add key="UseAIOBOX" value="1" />
<add key="DIMS" value="60" />
<add key="DOMS" value="300" />
<!--流水线地址和端口配置-->
<add key="LineServerIp" value="192.168.101.11" />
<add key="LineServerPort" value="5246" />
<!--是否调试状态-->
<add key="IsInDebug" value="1" />
<add key="UseBuzzer" value="0" />
<!--IO模块是否主动上传-->
<add key="AIOAutoUpload" value="0" />
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="10.85.160.20" />
<add key="CodeCount" value="3" />
<add key="Tool_P3_Offset" value="7000" />
<add key="Tool_P4_Offset" value="-2000" />
<add key="Tool_P5_Offset" value="-2000" />
<add key="Tool_P6_Offset" value="7000" />
<add key="Tool_TargetSpeed" value="20" />
<add key="Tool_TargetPosition" value="1835000" />
<!--是否启用入料口移门,1=启用,0=禁用-->
<add key="UseDoor" value="1" />
<add key="Agv_Log_Open" value="1" />
<add key="AutoShelfInstore" value="1" />
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/Packing-store-19-20.log" />
......@@ -69,7 +11,7 @@
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
<conversionPattern value="[%d][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
......@@ -79,7 +21,7 @@
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
<conversionPattern value="[%d][%t]%-5p %m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender">
......@@ -87,13 +29,9 @@
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="TheRFID">
<level value="Debug" />
<level value="info" />
<appender-ref ref="TheRFID" />
</logger>
<root>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
......
......@@ -59,6 +59,7 @@
this.lblVersion.TabIndex = 276;
this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblVersion.Click += new System.EventHandler(this.lblVersion_Click);
//
// lblTime
//
......@@ -94,7 +95,7 @@
//
// FrmAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(553, 222);
this.Controls.Add(this.btnCopy);
......
......@@ -37,5 +37,10 @@ namespace OnlineStore.ACPackingStore
{
Clipboard.SetDataObject(GetCodeNum(), true);
}
private void lblVersion_Click(object sender, EventArgs e)
{
ConfigHelper.AdvanceConfigForm.ShowEditDialog(this);
}
}
}
......@@ -61,7 +61,7 @@ namespace OnlineStore.ACPackingStore
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int InOutDefaultPosition = Setting_Init.InOutDefaultPosition;
//if (InOutDefaultPosition > 3000 || InOutDefaultPosition.Equals(0))
//{
// InOutDefaultPosition = 3000;
......
......@@ -383,7 +383,7 @@ namespace OnlineStore.ACPackingStore
//位置配置
string appPath = Application.StartupPath;
//如果总配置文件存在,保存到总的配置文件
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
string positionConfigFile = appPath + Setting_Init.Store_Position_Config;
if (!File.Exists(positionConfigFile))
{
string nameStr = BoxBean.DeviceID.ToString();
......@@ -476,7 +476,7 @@ namespace OnlineStore.ACPackingStore
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int InOutDefaultPosition = Setting_Init.InOutDefaultPosition;
int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
......@@ -869,7 +869,7 @@ namespace OnlineStore.ACPackingStore
pso.UpDownAxis_HP102 = FormUtil.GetIntValue(txtUpdownP102);
}
//位置配置
string positionConfigFile = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.Shelf_Position_Config);
string positionConfigFile = Application.StartupPath + Setting_Init.Shelf_Position_Config;
if (!File.Exists(positionConfigFile))
{
string nameStr = BoxBean.DeviceID.ToString();
......@@ -970,10 +970,10 @@ namespace OnlineStore.ACPackingStore
private void btnSaveCID_Click(object sender, EventArgs e)
{
string cid = txtCID.Text.Trim();
DialogResult result = MessageBox.Show("确定将CID修改为【" + cid + "】,修改后需要重启生效", "", MessageBoxButtons.YesNo);
DialogResult result = MessageBox.Show("确定将CID修改为【" + cid + "】", "", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes))
{
ConfigAppSettings.SaveValue(Setting_Init.Store_CID + "_" + BoxBean.DeviceID, cid);
ConfigAppSettings.SaveValue("Store_CID" + "_" + BoxBean.DeviceID, cid);
}
}
......@@ -1019,7 +1019,7 @@ namespace OnlineStore.ACPackingStore
{
string appPath = Application.StartupPath;
//如果总配置文件存在,保存到总的配置文件
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
string positionConfigFile = appPath + Setting_Init.Store_Position_Config;
if (!File.Exists(positionConfigFile))
{
string nameStr = BoxBean.DeviceID.ToString();
......
......@@ -31,11 +31,11 @@ namespace OnlineStore.ACPackingStore
private void btnNext_Click(object sender, EventArgs e)
{
string pwd = txtPwd.Text;
string configPwd = ConfigAppSettings.GetValue(Setting_Init.Config_Pwd);
string configPwd = Setting_Init.Config_Pwd;
if (configPwd.Equals(""))
{
configPwd = "123456";
ConfigAppSettings.SaveValue(Setting_Init.Config_Pwd,configPwd);
Setting_Init.Config_Pwd=configPwd;
}
if (pwd.Equals(configPwd))
{
......
......@@ -9,6 +9,8 @@ using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using OnlineStore.DeviceLibrary;
using log4net.Repository.Hierarchy;
namespace OnlineStore.ACPackingStore
{
......@@ -59,9 +61,8 @@ namespace OnlineStore.ACPackingStore
// 因为方法三只能是最小化的窗体显示出来,如果隐藏到托盘中则不能把运行的程序显示出来
Process currentproc = Process.GetCurrentProcess();
Process[] processcollection = Process.GetProcessesByName(currentproc.ProcessName.Replace(".vshost", string.Empty));
bool isShow=false;
// 该程序已经运行,
bool isShow = false;
if (processcollection.Length >= 1)
{
foreach (Process process in processcollection)
......@@ -71,7 +72,7 @@ namespace OnlineStore.ACPackingStore
// 如果进程的句柄为0,即代表没有找到该窗体,即该窗体隐藏的情况时
if (process.MainWindowHandle.ToInt32().Equals(0))
{
string formTitle = ConfigAppSettings.GetValue(Setting_Init.App_Title);
string formTitle = Setting_Init.App_Title;
// 获得窗体句柄
formhwnd = FindWindow(null, formTitle);
// 重新显示该窗体并切换到带入到前台
......@@ -94,6 +95,7 @@ namespace OnlineStore.ACPackingStore
if (!isShow)
{
System.Net.ServicePointManager.DefaultConnectionLimit = 512;
Setting_Init.Init();
XmlConfigurator.Configure();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
......
......@@ -66,12 +66,12 @@ namespace OnlineStore.ACPackingStore
IOManager.instance.ConnectionIOList(new List<string> { /*IoIp*/ });
}
P3Offset = ConfigAppSettings.GetIntValue(Setting_Init.Tool_P3_Offset);
P4Offset = ConfigAppSettings.GetIntValue(Setting_Init.Tool_P4_Offset);
P5Offset = ConfigAppSettings.GetIntValue(Setting_Init.Tool_P5_Offset);
P6Offset = ConfigAppSettings.GetIntValue(Setting_Init.Tool_P6_Offset);
int tSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Tool_TargetSpeed);
int tPosition = ConfigAppSettings.GetIntValue(Setting_Init.Tool_TargetPosition);
P3Offset = Setting_Init.Tool_P3_Offset;
P4Offset = Setting_Init.Tool_P4_Offset;
P5Offset = Setting_Init.Tool_P5_Offset;
P6Offset = Setting_Init.Tool_P6_Offset;
int tSpeed = Setting_Init.Tool_TargetSpeed;
int tPosition = Setting_Init.Tool_TargetPosition;
if (P3Offset.Equals(0)) P3Offset = 6000;
if (P4Offset.Equals(0)) P4Offset = -6000;
......@@ -197,12 +197,12 @@ namespace OnlineStore.ACPackingStore
private void SaveConfig(int speed, int position)
{
//保存配置
ConfigAppSettings.SaveValue(Setting_Init.Tool_P3_Offset, P3Offset);
ConfigAppSettings.SaveValue(Setting_Init.Tool_P4_Offset, P4Offset);
ConfigAppSettings.SaveValue(Setting_Init.Tool_P5_Offset, P5Offset);
ConfigAppSettings.SaveValue(Setting_Init.Tool_P6_Offset, P6Offset);
ConfigAppSettings.SaveValue(Setting_Init.Tool_TargetSpeed, speed);
ConfigAppSettings.SaveValue(Setting_Init.Tool_TargetPosition, position);
Setting_Init.Tool_P3_Offset= P3Offset;
Setting_Init.Tool_P4_Offset=P4Offset;
Setting_Init.Tool_P5_Offset=P5Offset;
Setting_Init.Tool_P6_Offset=P6Offset;
Setting_Init.Tool_TargetSpeed=speed;
Setting_Init.Tool_TargetPosition= position;
}
private void btnAbsMove_Click(object sender, EventArgs e)
{
......
......@@ -66,7 +66,7 @@ namespace OnlineStore.ACPackingStore
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int InOutDefaultPosition = Setting_Init.InOutDefaultPosition;
int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
......
......@@ -74,6 +74,12 @@
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\CSharp-Workspace\MyProject\DLL\ConfigHelper\ConfigHelper\ConfigHelper.csproj">
<Project>{290182db-d949-434e-9ff7-c59bde3f433a}</Project>
<Name>ConfigHelper</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConfigHelper;
namespace OnlineStore.Common
{
......@@ -11,97 +8,92 @@ namespace OnlineStore.Common
/// </summary>
public class Setting_Init
{
public static string Agv_Log_Open = "Agv_Log_Open";
public static string Server_Log_Open = "Server_Log_Open";
/// <summary>
/// 系统启动时自动启动料仓,=1时自动启动,并隐藏窗口,=0时不需要
/// </summary>
public static string App_AutoRun = "App_AutoRun";
/// <summary>
/// 系统主界面标题
/// </summary>
public static string App_Title = "App_Title";
public static string http_server = "http.server";
public static string Store_CID = "Store_CID";
public static void Init()
{
ConfigHelper.Config.MyConfig = typeof(Setting_Init);
}
[MyConfigComment("是否打开AGV日志")]
public static MyConfig<bool> Log_OpenAgv = true;
[MyConfigComment("是否打开AGV日志")]
public static MyConfig<bool> Log_OpenServer = true;
[MyConfigComment("系统启动时自动启动料仓,true时自动启动,并隐藏窗口;false时不需要")]
public static MyConfig<bool> App_AutoRun = true;
[MyConfigComment("系统主界面标题")]
public static MyConfig<string> App_Title = "包装料仓";
[MyConfigComment("料仓配置路径")]
public static MyConfig<string> BOX_ConfigPath = "\\StoreConfig\\BoxConfig.csv";
[MyConfigComment("料仓点位配置路径")]
public static MyConfig<string> Store_Position_Config = "\\StoreConfig\\linePositions.csv";
/// <summary>
/// 料仓数量
/// </summary>
public static string store_count = "store_count";
/// <summary>
/// 料仓类型,1=在线料仓
/// </summary>
public static string Store_Type = "Store_Type";
public static string BOX_ConfigPath = "BOX_ConfigPath";
public static string Store_Position_Config = "Store_Position_Config";
/// <summary>
/// 摄像机名称,多个中间使用#分割
/// </summary>
public static string CameraName = "CameraName";
/// <summary>
/// 需要识别的二维码类型,多个中间使用#分割
/// </summary>
public static string CodeType = "CodeType";
[MyConfigComment("服务器地址")]
public static MyConfig<string> http_server = "http://172.16.77.86/myproject/";
[MyConfigComment("料仓CID,每个仓唯一")]
public static MyConfig<string> Store_CID = "packing-store";
/// <summary>
/// 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)
/// </summary>
public static string StartBlowValue = "StartBlowValue";
/// <summary>
/// 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)
/// </summary>
public static string StopBlowValue = "StopBlowValue";
[MyConfigComment("软件上料仓数量")]
public static MyConfig<int> store_count = 2;
[MyConfigComment("料仓类型")]
public static MyConfig<string> Store_Type = "RC_AC_PA";
/// <summary>
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
public static string CodeParamPath = "CodeParamPath";
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// </summary>
public static string InOutDefaultPosition = "InOutDefaultPosition";
[MyConfigComment("摄像机名称,多个中间使用#分割")]
public static MyConfig<string> CameraName = "";
[MyConfigComment("需要识别的二维码类型,多个中间使用#分割")]
public static MyConfig<string> CodeType = "QR Code#Data Matrix ECC 200";
[MyConfigComment("是否开启吹气")]
public static MyConfig<bool> OpenBlow = false;
[MyConfigComment("开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)")]
public static MyConfig<int> StartBlowValue = 4;
[MyConfigComment("停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)")]
public static MyConfig<int> StopBlowValue = 4;
[MyConfigComment("二维码参数文件所在路径,文件名与二维码类型名一样")]
public static MyConfig<string> CodeParamPath = "\\CodeParam\\";
public static string Config_Pwd = "Config_Pwd";
/// <summary>
/// 出库等待料盘拿走的时间,秒
/// </summary>
public static string OutStoreWaitSeconds = "OutStoreWaitSeconds";
[MyConfigComment("进出轴最大待机点,需要小于3000")]
public static MyConfig<int> InOutDefaultPosition = 52000;
[MyConfigComment("配置的登录密码")]
public static MyConfig<string> Config_Pwd = "123456";
/// <summary>
/// 温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪
/// </summary>
public static string HumitureControllerType = "HumitureControllerType";
[MyConfigComment("出库等待料盘拿走的时间,秒")]
public static MyConfig<int> OutStoreWaitSeconds = 30;
public static string UseAIOBOX = "UseAIOBOX";
[MyConfigComment("温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪")]
public static MyConfig<int> HumitureControllerType = 0;
public static string LineServerIp = "LineServerIp";
public static string LineServerPort = "LineServerPort";
[MyConfigComment("是否使用零点IO模块")]
public static MyConfig<bool> UseAIOBOX = true;
public static string ACBaudRate = "ACBaudRate";
[MyConfigComment("伺服通讯波特率")]
public static MyConfig<int> ACBaudRate = 115200;
public static string Store_ConfigPath = "Store_ConfigPath";
public static string UseBuzzer = "UseBuzzer";
public static string Shelf_Position_Config = "Shelf_Position_Config";
[MyConfigComment("料仓配置文件路径")]
public static MyConfig<string> Store_ConfigPath = "\\StoreConfig\\StoreConfig.csv";
public static string Tool_P3_Offset = "Tool_P3_Offset";
public static string Tool_P4_Offset = "Tool_P4_Offset";
public static string Tool_P5_Offset = "Tool_P5_Offset";
public static string Tool_P6_Offset = "Tool_P6_Offset";
[MyConfigComment("是否使用蜂鸣器")]
public static MyConfig<bool> UseBuzzer = false;
[MyConfigComment("料架点位配置文件路径")]
public static MyConfig<string> Shelf_Position_Config = "\\StoreConfig\\shelfPosition.csv";
public static string Tool_TargetSpeed = "Tool_TargetSpeed";
public static string Tool_TargetPosition = "Tool_TargetPosition";
[MyConfigComment("")]
public static MyConfig<int> Tool_P3_Offset = 7000;
[MyConfigComment("")]
public static MyConfig<int> Tool_P4_Offset = -2000;
[MyConfigComment("")]
public static MyConfig<int> Tool_P5_Offset = -2000;
[MyConfigComment("")]
public static MyConfig<int> Tool_P6_Offset = 7000;
public static string AgvServerIp = "AgvServerIp";
public static string CodeCount = "CodeCount";
public static string AutoShelfInstore = "AutoShelfInstore";
public static string UseDoor = "UseDoor";
[MyConfigComment("")]
public static MyConfig<int> Tool_TargetSpeed = 20;
[MyConfigComment("")]
public static MyConfig<int> Tool_TargetPosition = 1835000;
[MyConfigComment("AGV调度服务器IP")]
public static MyConfig<string> AgvServerIp = "172.16.77.76";
[MyConfigComment("条码数量")]
public static MyConfig<int> CodeCount = 3;
[MyConfigComment("是否检测到料架自动入库")]
public static MyConfig<bool> AutoShelfInstore = true;
[MyConfigComment("是否启用入料口移门")]
public static MyConfig<bool> UseDoor = true;
}
}
......@@ -12,7 +12,7 @@ namespace OnlineStore.Common
{
public class ConfigAppSettings
{
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static int seq = 1;
......@@ -25,53 +25,19 @@ namespace OnlineStore.Common
}
Interlocked.Increment(ref seq);
return seq;
}
public static string GetValue(string key)
}
public static string GetValue(string key,string defaultVal="")
{
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return "";
}
else
{
return config.AppSettings.Settings[key].Value;
}
return ConfigHelper.Config.Get(key, defaultVal);
}
public static decimal GetNumValue(string key)
{
decimal a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
{
{
Decimal.TryParse(config.AppSettings.Settings[key].Value, out a);
}
}
return a;
return ConfigHelper.Config.Get<decimal>(key);
}
public static int GetIntValue(string key)
public static int GetIntValue(string key,int val=0)
{
int a = 0;
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a;
}
else
{
{
Int32.TryParse(config.AppSettings.Settings[key].Value, out a);
}
} return a;
return ConfigHelper.Config.Get<int>(key,val);
}
public static void SaveValue(string key, int value)
{
......@@ -79,81 +45,7 @@ namespace OnlineStore.Common
}
public static void SaveValue(string key, string value)
{
try
{
if (key.Equals("") || value.Equals(""))
{
return;
}
//增加的内容写在appSettings段下 <add key="RegCode" value="0"/>
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null)
{
SetValue(key, value);
}
else
{
UpdateConfig(key, value);
}
}
catch (Exception ex)
{
LogUtil.error( "SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace);
}
}
/// <summary>
/// 更新配置文件信息
/// </summary>
/// <param name="name">配置文件字段名称</param>
/// <param name="Xvalue">值</param>
private static void UpdateConfig(string name, string Xvalue)
{
try
{
XmlDocument doc = new XmlDocument();
doc.Load(Application.ExecutablePath + ".config");
XmlNode node = doc.SelectSingleNode(@"//add[@key='" + name + "']");
XmlElement ele = (XmlElement)node;
ele.SetAttribute("value", Xvalue);
doc.Save(Application.ExecutablePath + ".config");
}
catch (Exception ex)
{
LogUtil.error( "UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace);
}
}
///<summary>
///向.config文件的appKey结写入信息AppValue 保存设置
///</summary>
///<param name="AppKey">节点名</param>
///<param name="AppValue">值</param>
private static void SetValue(String AppKey, String AppValue)
{
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(System.Windows.Forms.Application.ExecutablePath + ".config");
XmlNode xNode;
XmlElement xElem1;
XmlElement xElem2;
xNode = xDoc.SelectSingleNode("//appSettings");
xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']");
if (xElem1 != null)
xElem1.SetAttribute("value", AppValue);
else
{
xElem2 = xDoc.CreateElement("add");
xElem2.SetAttribute("key", AppKey);
xElem2.SetAttribute("value", AppValue);
xNode.AppendChild(xElem2);
}
xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
}
catch (Exception ex)
{
LogUtil.error( "SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
}
ConfigHelper.Config.Set(key, value);
}
}
}
......@@ -120,12 +120,11 @@ namespace OnlineStore.Common
}
return null;
}
private static int isLog = ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open);
public static string LastServerMsg = "";
private static string PostJson(string url, string paramData, Encoding encoding, out bool isTimeOut)
{
isTimeOut = false;
if (isLog == 1)
if (Setting_Init.Log_OpenServer)
{
LogUtil.info("给服务器发送数据【" + paramData + "】 ");
}
......@@ -156,7 +155,7 @@ namespace OnlineStore.Common
{
LogUtil.error("POST ERROR:" + ex.ToString(), 1);
}
if (isLog == 1)
if (Setting_Init.Log_OpenServer)
{
LogUtil.info("收到服务器数据【" + result + "】");
}
......@@ -186,7 +185,7 @@ namespace OnlineStore.Common
}
IsTimeOut = false;
if (isLog == 1)
if (Setting_Init.Log_OpenServer)
{
LogUtil.info("给服务器发送数据【" + url + "】【" + paramData + "】 ");
}
......@@ -216,7 +215,7 @@ namespace OnlineStore.Common
LogUtil.error("POST [" + url + "] ERROR:" + e.ToString(), 101);
}
if (isLog == 1)
if (Setting_Init.Log_OpenServer)
{
LogUtil.info("收到服务器数据【" + result + "】");
}
......
......@@ -24,7 +24,7 @@ namespace OnlineStore.Common
private static string LogName = "";
private static Dictionary<string, AcSerialBean> serialBeanMap = new Dictionary<string, AcSerialBean>();
public static int HumitureControllerType = ConfigAppSettings.GetIntValue(Setting_Init.HumitureControllerType);
public static int HumitureControllerType = Setting_Init.HumitureControllerType;
public static bool Init(string port)
{
if (serialBeanMap.ContainsKey(port))
......
using System;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using System.Reflection;
using System.Drawing;
namespace OnlineStore.Common
{
public class LogUtil
{
public static readonly ILog AIOLog = LogManager.GetLogger("AIOBOXLog");
private static LogUtil instance = new LogUtil();
public delegate void ShowLog(string msg, Color color);
public static readonly ILog LOGGER = LogManager.GetLogger("RollingLogFileAppender");
......@@ -29,19 +23,7 @@ namespace OnlineStore.Common
log.Info(" - " + msg);
AddToBox(msg, Color.Black);
}
public static void info(ILog log, string msg, Color color)
{
log.Info(" - " + msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(" - " + msg);
if (debug_opened)
{
AddToBox(msg, color);
}
}
public static void debug(ILog log, string msg)
{
log.Debug(" - " + msg);
......@@ -125,18 +107,23 @@ namespace OnlineStore.Common
LastText = text;
if (logBox.Visible)
{
logBox.Text = text;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
logBox.Invoke(new Action(() =>
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
logBox.Text = text;
logBox.ForeColor = color;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
));
}
}
catch (Exception ex)
......@@ -184,7 +171,7 @@ namespace OnlineStore.Common
public static void error(string errorMsg, Exception ex = null)
{
if (ex == null)
{
{
error(LOGGER, errorMsg);
}
else
......
......@@ -69,13 +69,18 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ACPackingStore\AC_BOX_Bean.cs" />
<Compile Include="ACPackingStore\AC_BOX_Bean_Partial.cs" />
<Compile Include="ACPackingStore\AC_BOX_Bean_Shelf.cs" />
<Compile Include="ACPackingStore\EnteryDoorBean.cs" />
<Compile Include="ACPackingStore\HumitureBean.cs" />
<Compile Include="ACPackingStore\PackingStoreBean.cs" />
<Compile Include="ACPackingStore\StoreManager.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_server_connect.cs" />
<Compile Include="PackingStore\AC_BOX_Bean.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_OutStore.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_InStore.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_Partial.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_AGV.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_ScanCode.cs" />
<Compile Include="PackingStore\AC_BOX_Bean_Shelf.cs" />
<Compile Include="PackingStore\EnteryDoorBean.cs" />
<Compile Include="PackingStore\HumitureBean.cs" />
<Compile Include="PackingStore\PackingStoreBean.cs" />
<Compile Include="PackingStore\StoreManager.cs" />
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
......@@ -96,7 +101,7 @@
<Compile Include="store\InOutParam.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\model\StoreMoveInfo.cs">
<Compile Include="store\model\DeviceMoveInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\KTK_Store.cs" />
......@@ -110,6 +115,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\CSharp-Workspace\MyProject\DLL\ConfigHelper\ConfigHelper\ConfigHelper.csproj">
<Project>{290182DB-D949-434E-9FF7-C59BDE3F433A}</Project>
<Name>ConfigHelper</Name>
</ProjectReference>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{43cdd09e-fcf3-4960-a01d-3bbfe9933122}</Project>
<Name>Common</Name>
......
......@@ -45,6 +45,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public bool WaitShelfEnter=false;
private int logType = 1000;
/// <summary>
/// 当前料架编号
/// </summary>
private string CurrShelfID = "";
public AC_BOX_Bean(AC_BOX_Config config)
{
Init();
......@@ -92,8 +97,7 @@ namespace OnlineStore.DeviceLibrary
}
}
mainTimer.Enabled = false;
int isAuto = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
if (isAuto == 1)
if (Setting_Init.App_AutoRun)
{
mainTimer.Enabled = true;
}
......@@ -266,7 +270,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LineStop();
ACAxisHomeMove(Config.InOut_Axis);
AgvClient.SetStatus(Config.AgvNodeName,"","",ClientAction.None,ClientLevel.High,true);
setAgvStatus("","",ClientAction.None,ClientLevel.High,true);
}
/// <summary>
......@@ -460,7 +464,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public override void StopRun()
{
AgvClient.SetStatus(Config.AgvNodeName);
setAgvStatus();
lastPosId = "";
lastPosIdStatus = StoreStatus.StoreOnline;
WarnMsg = "";
......@@ -698,7 +702,7 @@ namespace OnlineStore.DeviceLibrary
}
if (IsDebug)
{
AgvClient.SetStatus(Config.AgvNodeName);
setAgvStatus();
}
else
{
......@@ -836,7 +840,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public override void StopMove()
{
AgvClient.SetStatus(Config.AgvNodeName);
setAgvStatus();
DoorBean.Stop();
IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
MoveInfo.EndMove();
......
using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public partial class AC_BOX_Bean
{
/// <summary>
/// 设置出入口AGV状态
/// </summary>
/// <param name="mark"></param>
/// <param name="shelfId"></param>
/// <param name="action"></param>
/// <param name="level"></param>
/// <param name="isMust"></param>
void setAgvStatus(string mark = "0", string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low, bool isMust = false)
{
AgvClient.SetStatus(Config.AgvNodeName, mark, shelfId, action, level, isMust);
}
internal bool ProcessAGVAction(string name, string rfid, ClientAction action)
{
string logN = name + "收到调度" + name + "=" + action + ",RFID[" + rfid + "]";
//Arrive收到后打开门
if (!action.Equals(ClientAction.Arrive))
{
LogUtil.info(Name + logN + " ,未找到相关处理");
return false;
}
//出库处理中不处理
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitEmptyAgv))
{
if (!rfid.Equals(""))
{
string mark = GetMarkInfo();
LogUtil.error(Name + logN + " 当前 BS_03_WaitEmptyAgv,RFID[" + rfid + "]不是空车,不处理agv,重发 NeedLeave [" + mark + "][" + CurrShelfID + "]");
Task.Factory.StartNew(new Action(()=> {
setAgvStatus(mark, CurrShelfID, ClientAction.MayNot, ClientLevel.High, true);
Thread.Sleep(10000);
setAgvStatus(mark, CurrShelfID, ClientAction.NeedLeave, ClientLevel.High, true);
}));
return false;
}
//等待空车到达
LogUtil.info(Name + logN + ",当前 BS_03_WaitEmptyAgv,正在等待料架到达");
MoveInfo.NextMoveStep(StoreMoveStep.BS_04_DoorOpen);
InOutStoreLog("送出料架等待空车,agv到达,打开入料口移门");
DoorBean.StartOpen(MoveInfo);
return true;
}
else if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveStep.Equals(StoreMoveStep.BI_00_ReadyShelf))
{
if (rfid.Equals(""))
{
string mark = GetMarkInfo();
LogUtil.error(Name + logN + " 当前出库中 BI_00_ReadyShelf,RFID无效,不处理agv,重发 NeedEnter [" + mark + "][" + MoveInfo.MoveParam.rfid + "]");
Task.Factory.StartNew(new Action(() => {
setAgvStatus(mark, CurrShelfID, ClientAction.MayNot, ClientLevel.High, true);
Thread.Sleep(10000);
setAgvStatus(mark, MoveInfo.MoveParam.rfid, ClientAction.NeedEnter, ClientLevel.High, true);
}));
return false;
}
//出库等待料架到达
LogUtil.info(Name + logN + ",当前出库中 BI_00_ReadyShelf,正在等待料架到达");
MoveInfo.NextMoveStep(StoreMoveStep.BI_01_DoorOpen);
InOutStoreLog("出库等待料架,agv已到达,打开入料口移门");
DoorBean.StartOpen(MoveInfo);
return true;
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing) &&
MoveInfo.MoveType.Equals(StoreMoveType.None) &&
IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
{
//agv到达,开始处理
if (rfid.Equals(""))
{
LogUtil.error(Name + logN + " ,RFID无效,不需要入库处理");
return false;
}
LogUtil.info(Name + logN + " ,检测到料架,开始料架入库");
StartShelfInStore();
return true;
}
else
{
LogUtil.error(Name + logN + " ,[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]未找到相关处理");
}
return false;
}
}
}
......@@ -101,9 +101,9 @@ namespace OnlineStore.DeviceLibrary
}
}
public bool StartOpen(StoreMoveInfo moveInfo)
public bool StartOpen(DeviceMoveInfo moveInfo)
{
bool UseDoor = ConfigAppSettings.GetIntValue(Setting_Init.UseDoor).Equals(1);
bool UseDoor = Setting_Init.UseDoor;
if (!UseDoor)
{
return false;
......@@ -124,9 +124,9 @@ namespace OnlineStore.DeviceLibrary
return Start(IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Open);
}
public bool StartClose(StoreMoveInfo moveInfo)
public bool StartClose(DeviceMoveInfo moveInfo)
{
bool UseDoor = ConfigAppSettings.GetIntValue(Setting_Init.UseDoor).Equals(1);
bool UseDoor = Setting_Init.UseDoor;
if (!UseDoor)
{
return false;
......
......@@ -65,8 +65,8 @@ namespace OnlineStore.DeviceLibrary
public bool TempOrHumidityIsAlarm = false;
public DateTime TempAlarmTime = DateTime.Now;
private float StartBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StartBlowValue);
private float StopBlowValue = (float)ConfigAppSettings.GetNumValue(Setting_Init.StopBlowValue);
private float StartBlowValue = (float)Setting_Init.StartBlowValue;
private float StopBlowValue = (float)Setting_Init.StopBlowValue;
public string currTempStr = "";
internal void HumidityProcess(AC_BOX_Bean box)
{
......
......@@ -29,8 +29,11 @@ namespace OnlineStore.DeviceLibrary
public Dictionary<int, AC_BOX_Bean> BoxMap = new Dictionary<int, AC_BOX_Bean>();
public Store_Config Config { get; set; }
public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
public bool AutoShelfInstore = ConfigAppSettings.GetIntValue(Setting_Init.AutoShelfInstore).Equals(1);
public bool UseBuzzer = Setting_Init.UseBuzzer;
/// <summary>
/// 入口有料架自动入库
/// </summary>
public bool AutoShelfInstore = Setting_Init.AutoShelfInstore;
List<string> rfidList = new List<string>();
#region 初始化
......@@ -49,7 +52,7 @@ namespace OnlineStore.DeviceLibrary
this.Config = lineConfig;
this.DeviceID = lineConfig.DeviceID;
MoveInfo = new StoreMoveInfo(DeviceID);
MoveInfo = new DeviceMoveInfo(DeviceID);
Name = (" Store_" + Config.CID + " ").ToUpper();
List<string> ioList = new List<string>();
......@@ -324,7 +327,7 @@ namespace OnlineStore.DeviceLibrary
{
//取新的Io状态
IO_VALUE autoSingle = IOValue(IO_Type.Reset_BTN);
if (ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun).Equals(1))
if (Setting_Init.App_AutoRun)
{
if (autoSingle.Equals(IO_VALUE.HIGH) && lastAutoRun.Equals(IO_VALUE.LOW))
{
......
......@@ -23,7 +23,7 @@ namespace OnlineStore.DeviceLibrary
public static Store_Config Config = null;
public static Dictionary<int, BaseConfig> AllConfigMap = null;
private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public static bool IsConnectServer = !Setting_Init.http_server.Equals("");
public StoreManager()
{
}
......@@ -55,7 +55,7 @@ namespace OnlineStore.DeviceLibrary
BaseConfig.ProIOIpMap = new Dictionary<string, string>();
if (!isInit)
{
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
string server = Setting_Init.http_server;
if (server.Equals(""))
{
IsConnectServer = false;
......@@ -69,31 +69,29 @@ namespace OnlineStore.DeviceLibrary
CheckEnum(typeof(StoreRunStatus));
isInit = true;
string storeType = ConfigAppSettings.GetValue(Setting_Init.Store_Type);
int count = ConfigAppSettings.GetIntValue(Setting_Init.store_count);
string storeType = Setting_Init.Store_Type;
int count = Setting_Init.store_count;
LogUtil.info("配置的料仓 类型=" + storeType + ",开始加载料仓配置");
string appPath = Application.StartupPath;
string CID = ConfigAppSettings.GetValue(Setting_Init.Store_CID);
Dictionary<int, AC_BOX_Config> storeConfig = new Dictionary<int, AC_BOX_Config>();
if (storeType == StoreType.RC_AC_PA)
{
string linefilePath = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
Config = CSVConfigReader.LoadLineConfig(0, CID, "Line", linefilePath);
string linefilePath = appPath + Setting_Init.Store_ConfigPath;
Config = CSVConfigReader.LoadLineConfig(0, Setting_Init.Store_CID, "Line", linefilePath);
AllConfigMap.Add(0, Config);
string moveEquipConfig = ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
string moveEquipConfig = Setting_Init.BOX_ConfigPath;
for (int i = 1; i <= count; i++)
{
string nameStr = i.ToString().PadLeft(1, '0');
string config = appPath + moveEquipConfig.Replace(".csv", "_" + nameStr + ".csv");
string storeIdConfig = Setting_Init.Store_CID + "_" + i;
string boxCid = ConfigAppSettings.GetValue(storeIdConfig);
string boxCid = ConfigAppSettings.GetValue("Store_CID" + "_" + i, "packing-");
AC_BOX_Config moveConfig = CSVConfigReader.LoadBoxConfig(i, boxCid, "BOX", config);
AllConfigMap.Add(i, moveConfig);
storeConfig.Add(i, moveConfig);
}
string positionConfigFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_Position_Config);
string positionConfigFile = appPath + Setting_Init.Store_Position_Config;
if (count > 1 || (!File.Exists(positionConfigFile)))
{
for (int i = 1; i <= count; i++)
......@@ -111,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
}
string shelfConfig = appPath + ConfigAppSettings.GetValue(Setting_Init.Shelf_Position_Config);
string shelfConfig = appPath + Setting_Init.Shelf_Position_Config;
//if (File.Exists(shelfConfig))
//{
// CSVPositionReader<ShelfPosition>.AddCSVFile(shelfConfig);
......@@ -150,7 +148,7 @@ namespace OnlineStore.DeviceLibrary
{
//位置配置到文件中
string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.BOX_ConfigPath);
string configFile = appPath + Setting_Init.BOX_ConfigPath;
if (!Directory.Exists(configFile))
{
......@@ -191,10 +189,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false;
}
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(param.ShelfPosID);
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(param.CurShelfPosID);
if (sp == null && needCheckShelf)
{
LogUtil.error(box.Name + "GetPositon[" + param.ShelfPosID + "]=null,没有库位不能执行出入库");
LogUtil.error(box.Name + "GetPositon[" + param.CurShelfPosID + "]=null,没有库位不能执行出入库");
return false;
}
if (param.PlateH <= 0)
......@@ -256,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
{
if (host == "")
{
host = ConfigAppSettings.GetValue(Setting_Init.http_server);
host = Setting_Init.http_server;
}
if (!host.StartsWith("http://"))
{
......@@ -270,7 +268,7 @@ namespace OnlineStore.DeviceLibrary
}
private static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
string server = Setting_Init.http_server;
if (server.EndsWith("/"))
{
server = server.Substring(0, server.Length - 1);
......@@ -559,6 +557,54 @@ namespace OnlineStore.DeviceLibrary
return msg;
}
private static string Addr_findRealRfid = "/rest/api/qisda/device/findRealRfid";
/// <summary>
/// 根据tempRfid查找真实rfid
///
/// </summary>
/// <param name="tempRfid"></param>
/// <returns>"":未找到真实料架,即改任务还未出库</returns>
public static string FindRealRfidByTempRfid(string tempRfid)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("tempRfid", tempRfid);
string server = GetAddr(Addr_findRealRfid, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("根据虚拟rfid【" + tempRfid + "】 查询包装料架绑定情况 " + " 【" + server + "】【" + resultStr + "】");
RfidData serverResult = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (serverResult == null)
{
msg = "虚拟rfid【" + tempRfid + "】没有收到服务器反馈";
LogUtil.error(msg);
return "";
}
if (serverResult.data["realRfid"].Equals("")) //虚拟料架未绑定料架
{
msg = "虚拟rfid【" + tempRfid + "】 未绑定真实料架";
LogUtil.debug(msg);
return "";
}
else //虚拟料架绑定料架
{
LogUtil.debug("虚拟rfid【" + tempRfid + "】 已绑定真实料架" + serverResult.data["realRfid"]);
return serverResult.data["realRfid"];
}
}
catch (Exception ex)
{
LogUtil.error(ex.Message);
}
return "";
}
private static string Addr_getShelfLockInfo = "/rest/api/qisda/device/getShelfLockInfo"; //包装仓获取料架锁定状态地址
public static bool GetShelfLockInfo(string deviceName, string cid, string rfid, out List<ShelfLockData> shelfLockDatas)
......@@ -624,10 +670,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 检查是否是入库料架
/// </summary>
/// <param name="deviceName"></param>
/// <param name="cid"></param>
/// <param name="rfid"></param>
/// <param name="shelfLockDatas"></param>
/// <returns></returns>
public static bool CheckShelfInfo(string rfid)
{
......
using Asa;
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
......@@ -14,7 +9,6 @@ namespace OnlineStore.DeviceLibrary
{
public static bool CurrCancelState = false ;
// public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp);
private static Asa.AgvClient agvClient;
private static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>();
public static List<string> NodeList = new List<string>();
......@@ -26,7 +20,7 @@ namespace OnlineStore.DeviceLibrary
if (!isInit)
{
isInit = true;
agvClient = new Asa.AgvClient(ServerIp);
agvClient = new Asa.AgvClient(Setting_Init.AgvServerIp);
agvClient.CancelState = true;
agvClient.Log += AgvClient_Log;
agvClient.Arrive += AgvClient_Arrive;
......@@ -50,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("初始化agvClient " + ServerIp + " 出错:"+ ex.ToString());
LogUtil.error("初始化agvClient " + Setting_Init.AgvServerIp + " 出错:"+ ex.ToString());
}
}
......@@ -183,10 +177,9 @@ namespace OnlineStore.DeviceLibrary
{
try
{
bool isLog = ConfigAppSettings.GetIntValue(Setting_Init.Agv_Log_Open).Equals(1);
if (isLog)
if (Setting_Init.Log_OpenAgv)
{
LogUtil. debug(" AGV " + ServerIp + " Log : " + s);
LogUtil. debug(" AGV " + Setting_Init.AgvServerIp + " Log : " + s);
}
}
catch (Exception ex)
......@@ -225,7 +218,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("释放 agvClient " + ServerIp + " 出错:"+ ex.ToString());
LogUtil.error("释放 agvClient " + Setting_Init.AgvServerIp + " 出错:"+ ex.ToString());
}
}
}
......
......@@ -134,12 +134,12 @@ namespace OnlineStore.DeviceLibrary
{
DOValueMap.Remove(ioIp);
}
int DIMS = ConfigAppSettings.GetIntValue("DIMS");
int DIMS = ConfigAppSettings.GetIntValue("DIMS",60);
if (DIMS < 20)
{
DIMS = 20;
}
int DOMS = ConfigAppSettings.GetIntValue("DOMS");
int DOMS = ConfigAppSettings.GetIntValue("DOMS",300);
if (DOMS < 200)
{
DOMS = 200;
......@@ -220,14 +220,6 @@ namespace OnlineStore.DeviceLibrary
private DateTime lastLogTime = DateTime.Now;
private void AioBox_Log_Out_Event(AIOBOX box, string[] s)
{
foreach (string str in s)
{
LogUtil.AIOLog.Debug("[" + box.IP + "]" + str);
}
}
private void AioBox_DI_Changed_Event(AIOBOX box, Box_Sta[] sta)
{
try
......
......@@ -148,7 +148,7 @@ namespace OnlineStore.DeviceLibrary
#endregion
public static void Init()
{
bool isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX).Equals(1);
bool isAIOBox = Setting_Init.UseAIOBOX;
if (isAIOBox)
{
instance = new AIOBOXManager();
......
......@@ -86,7 +86,7 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
int ACBaudRate = ConfigAppSettings.GetIntValue(Setting_Init.ACBaudRate);
int ACBaudRate = Setting_Init.ACBaudRate;
if (ACBaudRate <= 0)
{
ACBaudRate = 9600;
......
......@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static void LoadConfig()
{
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
string codeStr = Setting_Init.CodeType;
codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender";
try
......@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
}
private static int ScanCount = 0;
private static int codeCount = ConfigAppSettings.GetIntValue(Setting_Init.CodeCount);
private static int codeCount = Setting_Init.CodeCount;
[HandleProcessCorruptedStateExceptions]
public static List<string> CameraScan(List<string> cameraList, string deviceName, int timeOut = 1500)
{
......@@ -272,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
public static string GetCodeParamFilePath(string codePath)
{
string appPath = Application.StartupPath;
string path = appPath + ConfigAppSettings.GetValue(Setting_Init.CodeParamPath);
string path = appPath + Setting_Init.CodeParamPath;
string filePath = path + codePath + ".dcm";
if (File.Exists(filePath))
{
......
......@@ -17,6 +17,7 @@ namespace OnlineStore.DeviceLibrary
{
public InOutParam(string wareNo="", string posId="", string ShelfPosID="", int platew = 0, int plateh =0, bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0,int taskCount=0,string realRfid="")
{
this.CurShelfPosID = ShelfPosID;
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
PosID = posId;
......@@ -34,6 +35,7 @@ namespace OnlineStore.DeviceLibrary
public InOutParam(string wareNo, string posId, string ShelfPosID,LineMoveP linePosition )
{
WareCode = wareNo;
this.CurShelfPosID = ShelfPosID;
this.ShelfPosID = ShelfPosID;
PosID = posId;
MoveP = linePosition;
......@@ -50,7 +52,7 @@ namespace OnlineStore.DeviceLibrary
}
public InOutParam NewParam()
{
InOutParam newp = new InOutParam(WareCode,PosID,ShelfPosID, PlateW, PlateH, urgentReel,cutReel,smallReel,rfid,rfidLoc,taskCount,realRfid);
InOutParam newp = new InOutParam(WareCode,PosID,CurShelfPosID, PlateW, PlateH, urgentReel,cutReel,smallReel,rfid,rfidLoc,taskCount,realRfid);
return newp;
}
/// <summary>
......@@ -62,7 +64,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public string PosID { get; set; }
/// <summary>
/// 料架对应的库位号
/// 当前料架对应的库位号
/// </summary>
public string CurShelfPosID = "";
/// <summary>
/// 需要取放的料架对应的库位号
/// </summary>
public string ShelfPosID = "";
public LineMoveP MoveP { get; set; }
......@@ -145,21 +151,21 @@ namespace OnlineStore.DeviceLibrary
}
public string ToStr()
{
return " 库位 [" + PosID + "] [" + ShelfPosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ," +
return " 库位 [" + PosID + "] [" + CurShelfPosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ," +
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],taskCount ["+ taskCount + "]";
}
public string ToShortStr()
{
return "["+rfid+"][" + PosID + "][" + ShelfPosID + "][" + PlateW + "x" + PlateH + "][" + WareCode + "]";
return "["+rfid+"][" + PosID + "][" + CurShelfPosID + "][" + PlateW + "x" + PlateH + "][" + WareCode + "]";
}
internal void UpdateShelfPosId(string pId)
{
this.ShelfPosID = pId;
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(ShelfPosID);
this.CurShelfPosID = pId;
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(CurShelfPosID);
if (sp == null)
{
LogUtil.error( "GetPositon[" + ShelfPosID + "]=null,没有库位不能执行出入库");
LogUtil.error( "GetPositon[" + CurShelfPosID + "]=null,没有库位不能执行出入库");
}
MoveP.InOut_P101 = sp.InoutAxis_P101;
......@@ -168,7 +174,21 @@ namespace OnlineStore.DeviceLibrary
MoveP.Middle_P101 = sp.MiddleAxis_P101;
}
internal void RestoreShelfPosId()
{
this.CurShelfPosID = ShelfPosID;
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(CurShelfPosID);
if (sp == null)
{
LogUtil.error("GetPositon[" + CurShelfPosID + "]=null,没有库位不能执行出入库");
}
MoveP.InOut_P101 = sp.InoutAxis_P101;
MoveP.UpDown_LP101 = sp.UpDownAxis_LP101;
MoveP.UpDown_HP102 = sp.UpDownAxis_HP102;
MoveP.Middle_P101 = sp.MiddleAxis_P101;
}
internal void UpdatePosId(string message, string posId, int plateW, int plateH,int comP2,int comP3)
{
this.WareCode = message;
......@@ -196,7 +216,7 @@ namespace OnlineStore.DeviceLibrary
internal void UpdatePosIdAndShelfId(string wareNo,string rfid,string posId, string ShelfPosID)
{
WareCode = wareNo;
this.ShelfPosID = ShelfPosID;
this.CurShelfPosID = ShelfPosID;
this.rfid = rfid;
ShelfPosition sp = CSVPositionReader<ShelfPosition>.GetPositon(ShelfPosID);
if (sp == null)
......
using log4net;
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -7,6 +7,7 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web.UI.WebControls;
namespace OnlineStore.DeviceLibrary
......@@ -30,7 +31,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 日志颜色
/// </summary>
protected static Color storeMoveColor = Color.Blue;
protected static Color storeMoveColor = Color.Blue;
public string Name { get; set; }
public int DeviceID { get; set; }
public BaseConfig baseConfig = null;
......@@ -45,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
private bool isInit = false;
public bool IsDebug = false;
public bool IsDebug = false;
public KTK_Store()
{
......@@ -67,7 +68,7 @@ namespace OnlineStore.DeviceLibrary
/// 是否没有检测到气压
/// </summary>
public bool isNoAirCheck = false;
/// <summary>
/// 是否再报警中
/// </summary>
......@@ -116,7 +117,7 @@ namespace OnlineStore.DeviceLibrary
{
return new TimeSpan(0);
}
}
}
/// <summary>
/// 运动处理
/// </summary>
......@@ -219,13 +220,13 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 停止所有运动
/// </summary>
public abstract void StopMove( );
public abstract void StopMove();
/// <summary>
/// 重置处理
/// </summary>
protected abstract void ResetProcess();
/// <summary>
/// 松下伺服轴原点返回运动,等待收到反馈后才会返回
......@@ -233,8 +234,8 @@ namespace OnlineStore.DeviceLibrary
protected void ACAxisHomeMove(ConfigMoveAxis moveAxis)
{
moveAxis.TargetPosition = 0;
LogUtil.info(Name+ moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
LogUtil.info(Name + moveAxis.DisplayStr + "speed[" + moveAxis.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, true));
ACServerManager.HomeMove(moveAxis.DeviceName, (short)moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
}
......@@ -244,7 +245,7 @@ namespace OnlineStore.DeviceLibrary
protected void ACAxisMove(ConfigMoveAxis moveAxis, int targetPosition, int targetSpeed)
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(moveAxis, targetPosition, targetSpeed));
moveAxis.TargetPosition = targetPosition;
moveAxis.TargetPosition = targetPosition;
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
}
......@@ -256,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
msg = "";
string deviceName = moveAxis.DeviceName;
short axisNo = moveAxis.GetAxisValue();
bool isOk = ACServerManager.GetBusyStatus(deviceName, axisNo).Equals(0);
int outCount = ACServerManager.GetActualtPosition(deviceName, axisNo);
int errorCount = Math.Abs(outCount - targetPosition);
......@@ -269,7 +270,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
LogUtil.error(Name+ moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
LogUtil.error(Name + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
......@@ -278,7 +279,7 @@ namespace OnlineStore.DeviceLibrary
{
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount
+ "],误差过大,需要报警";
LogUtil.error(Name+ msg);
LogUtil.error(Name + msg);
}
}
return false;
......@@ -298,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
LogUtil.error(Name+ moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
LogUtil.error(Name + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + MoveInfo.CanWhileCount + "]次");
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
MoveInfo.CanWhileCount--;
......@@ -306,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
else
{
msg = Name + " storeMoveStep=" + MoveInfo.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
LogUtil.error(Name+ msg);
LogUtil.error(Name + msg);
}
}
return false;
......@@ -324,7 +325,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!isInit)
{
MoveInfo = new StoreMoveInfo(DeviceID);
MoveInfo = new DeviceMoveInfo(DeviceID);
mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false;
......@@ -350,7 +351,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 移动信息
/// </summary>
public StoreMoveInfo MoveInfo = null;
public DeviceMoveInfo MoveInfo = null;
/// <summary>
/// 定时处理,监听信号,监听IO
......@@ -449,8 +450,8 @@ namespace OnlineStore.DeviceLibrary
return sta;
}
}
public void CylinderMove(StoreMoveInfo moveInfo, string IoLowType, string IoHighType)
{
public void CylinderMove(DeviceMoveInfo moveInfo, string IoLowType, string IoHighType)
{
IOMove(IoLowType, IO_VALUE.LOW);
IOMove(IoHighType, IO_VALUE.HIGH);
if (moveInfo != null)
......@@ -472,27 +473,35 @@ namespace OnlineStore.DeviceLibrary
/// </summary>c
protected bool WaitIo(string ioType, IO_VALUE value, int timeOut, string errName = "")
{
return WaitUtil.Wait(timeOut, delegate () {
return WaitUtil.Wait(timeOut, delegate ()
{
return value.Equals(IOValue(ioType));
}, errName);
}
public void LogInfo(string logInfo)
public void LogError(string msg)
{
LogUtil.info(Name + logInfo);
LogUtil.info($"{Name}{MoveInfo?.MoveType}{msg}");
}
protected void InOutStoreLog(string msg,bool isDebug=false )
public void LogInfo(string msg)
{
string posId = MoveInfo.MoveParam != null ? "["+MoveInfo.MoveParam.PosID+"]" : "";
string shelfId = MoveInfo.MoveParam != null ? "[" + MoveInfo.MoveParam.ShelfPosID+"]" : "";
if (isDebug)
{
LogUtil.debug (Name + " " + posId + "" + shelfId + " :" + msg);
}
else
{
LogInfo(" " + posId + "" + shelfId + " :" + msg);
}
LogUtil.info($"{Name}{MoveInfo?.MoveType}{msg}");
}
public void LogRunStepInfo(string msg)
{
LogInfo($"{MoveInfo?.SLog}{msg}");
}
public void LogRunStepError(string msg)
{
LogError($"{MoveInfo?.SLog}{msg}");
}
protected void InOutStoreLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? "[" + MoveInfo.MoveParam.PosID + "]" : "";
string shelfId = MoveInfo.MoveParam != null ? "[" + MoveInfo.MoveParam.CurShelfPosID + "]" : "";
LogRunStepInfo($"posId={posId} shelfId={shelfId}: {msg}");
}
protected int GetAlarmCodeByAxis(ConfigMoveAxis axis)
{
int alarmCode = LineAlarm.InOutAxisAlarm;
......@@ -529,4 +538,4 @@ namespace OnlineStore.DeviceLibrary
}
}
}
......@@ -206,6 +206,102 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 检查出库料架上是否有治具
/// <summary>
/// 出库料架检查:开始循环从第一个空位逐个取料盘
/// </summary>
SO_PreCheck_01_StartGetTray,
/// <summary>
/// 出库料架检查:叉子后退到待机点P1
/// </summary>
SO_PreCheck_02_InoutToP1,
/// <summary>
/// 出库料架检查:升降轴移动到P101低点,旋转轴移动到P101点,压紧轴到压紧前点
/// </summary>
SO_PreCheck_03_MoveToShelf,
/// <summary>
/// 出库料架检查:叉子前进到P101点
/// </summary>
SO_PreCheck_04_InoutToP101,
/// <summary>
/// 出库料架检查:升降轴上升到P102点
/// </summary>
SO_PreCheck_05_UpdownToP102,
/// <summary>
/// 出库料架检查:压紧轴开始缓慢压紧
/// </summary>
SO_PreCheck_06_StartCompress,
/// <summary>
/// 出库料架检查:检测到料叉压紧确认信号,再次向下压紧指定的值
/// </summary>
SO_PreCheck_07_ComDownMove,
/// <summary>
/// 出库料架检查:记录压紧高度,叉子后退到P1
/// </summary>
SO_PreCheck_08_InoutBack,
/// <summary>
/// 到扫码位置:升降轴移动到P2,旋转轴移动到P1
/// </summary>
SO_PreCheck_09_ToScanPosition,
/// <summary>
/// 到扫码位置:进出轴到P2
/// </summary>
SO_PreCheck_10_InOutToP2,
/// <summary>
/// 到扫码位置:升降轴缓慢下降到P1,压紧轴返回压紧前点
/// </summary>
SO_PreCheck_11_PutTrayDown,
/// <summary>
/// 到扫码位置:进出轴返回待机点
/// </summary>
SO_PreCheck_12_InOutToP1,
/// <summary>
/// 检查治具:检查是否有治具
/// </summary>
SO_PreCheck_13_CheckFix,
/// <summary>
/// 检查治具:检查完成,获取结果
/// 有治具,将该治具返回料架位置
/// 无治具,到下一个位置
/// </summary>
SO_PreCheck_14_GetCheckResult,
/// <summary>
/// 检查治具:有治具
/// </summary>
SO_PreCheck_15_InoutToP2,
/// <summary>
/// 检查治具:升降轴到P1,压紧轴压紧
/// </summary>
SO_PreCheck_16_GetScanPTray,
/// <summary>
/// 检查治具:进出轴返回
/// </summary>
SO_PreCheck_17_InoutBackP1,
/// <summary>
/// 检查治具:有治具,返回料架位置
/// </summary>
SO_PreCheck_18_ToShelfPosition,
/// <summary>
/// 检查治具:叉子到料架,进出轴至P20
/// /// </summary>
SO_PreCheck_19_ToShelf,
/// <summary>
/// 检查治具:把物品放下,压紧轴到P1,升降轴至P20
/// </summary>
SO_PreCheck_20_PutReel,
/// <summary>
/// 检查治具:叉子从出料口返回,,进出轴到P1
/// 不再检查下一个位置,料架直接作为NG返回
/// </summary>
SO_PreCheck_21_InoutBack,
SO_PreCheck_22_GoBack,
#endregion
#region 出库步骤 2000开始
......
......@@ -11,15 +11,15 @@ using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 料仓当前运动信息类(出入库状态,步骤记录)
/// 设备当前运动信息类(出入库状态,步骤记录)
/// </summary>
public class StoreMoveInfo
public class DeviceMoveInfo
{
/// <summary>
/// 超时时间
/// </summary>
public int TimeOutSeconds = 60;
public StoreMoveInfo(int storeId)
public DeviceMoveInfo(int storeId)
{
moveType = StoreMoveType.None;
......@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
public string SLog
{
get { return " " + MoveStep + " "; }
get { return $" {MoveStep} "; }
}
......@@ -138,9 +138,9 @@ namespace OnlineStore.DeviceLibrary
WaitList = new List<WaitResultInfo>();
CanWhileCount = 0;
}
public StoreMoveInfo clone()
public DeviceMoveInfo clone()
{
return (StoreMoveInfo)this.MemberwiseClone();
return (DeviceMoveInfo)this.MemberwiseClone();
}
public List<WaitResultInfo> WaitList = new List<WaitResultInfo>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!