Commit 119952f3 刘韬

1

1 个父辈 128626d0
正在显示 52 个修改的文件 包含 1376 行增加293 行删除
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Obfuscar.2.2.40\build\obfuscar.props" Condition="Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -12,6 +13,8 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -52,6 +55,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="bean\Bean.cs" />
<Compile Include="PosIDManger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Init.cs" />
<Compile Include="util\AcSerialBean.cs" />
......@@ -82,6 +86,12 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Obfuscar.2.2.40\build\obfuscar.props'))" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
......
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
namespace OnlineStore.Common
{
public static class PosIDManger
{
// Dictionary for storing POS information
public static DRAWERGroup APosList = new DRAWERGroup();
public static DRAWERGroup BPosList = new DRAWERGroup();
// File paths for the JSON data
private static readonly string APosFilePath = "E:\\data1List.json";
private static readonly string BPosFilePath = "E:\\data2List.json";
// Static constructor to initialize APosList and BPosList
static PosIDManger()
{
// Load the data from the JSON files if they exist, otherwise initialize from strings
APosList = LoadFromFile<DRAWERGroup>(APosFilePath) ?? CreatePosListFromString(APosString);
BPosList = LoadFromFile<DRAWERGroup>(BPosFilePath) ?? CreatePosListFromString(BPosString);
//if (BPosList == null)
//{
// BPosList = CreatePosListFromString(BPosString);
// foreach (var x in BPosList.DRAWER.Values)
// {
// x.Reverse();
// }
// LogUtil.error($"反转B面顺序");
// SaveToFile();
//}
// Merge with strings to ensure new POS are added
bool updated = false;
updated |= MergeWithPosString(APosList, APosString);
updated |= MergeWithPosString(BPosList, BPosString);
if (updated)
{
LogUtil.info($"新 POS 信息已添加,保存数据");
SaveToFile();
}
}
// Method to merge new POS from a string into an existing DRAWERGroup
private static bool MergeWithPosString(DRAWERGroup currentGroup, string posString)
{
var newGroup = CreatePosListFromString(posString);
bool updated = false;
foreach (var kvp in newGroup.DRAWER)
{
if (!currentGroup.DRAWER.ContainsKey(kvp.Key))
{
currentGroup.DRAWER[kvp.Key] = kvp.Value;
updated = true;
}
else
{
var existingList = currentGroup.DRAWER[kvp.Key];
foreach (var pos in kvp.Value)
{
if (!existingList.Any(p => p.PosID == pos.PosID))
{
existingList.Add(pos);
updated = true;
}
}
}
}
return updated;
}
// Method to load data from a file and deserialize it
private static T LoadFromFile<T>(string filePath)
{
try
{
if (File.Exists(filePath))
{
string json = File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<T>(json);
}
}
catch (Exception ex)
{
LogUtil.error($"Error loading from file {filePath}: {ex.Message}");
}
return default;
}
// Method to save data to a file (serialize to JSON)
public static void SaveToFile()
{
try
{
string aPosJson = JsonConvert.SerializeObject(APosList, Formatting.Indented);
string bPosJson = JsonConvert.SerializeObject(BPosList, Formatting.Indented);
File.WriteAllText(APosFilePath, aPosJson);
File.WriteAllText(BPosFilePath, bPosJson);
}
catch (Exception ex)
{
LogUtil.error($"Error saving to files: {ex.Message}");
}
}
// Method to clear HasReel and Barcode for all entries and save
public static void EmptyAllPos()
{
try
{
// Iterate through APosList and BPosList to update the properties
UpdatePosList(APosList);
UpdatePosList(BPosList);
// Save the changes back to the files
SaveToFile();
}
catch (Exception ex)
{
LogUtil.error($"Error while emptying all POS: {ex.Message}");
}
}
// Helper method to update the PosInfo objects
private static void UpdatePosList(DRAWERGroup posList)
{
if (posList == null || posList.DRAWER == null) return;
foreach (var drawer in posList.DRAWER.Values)
{
if (drawer == null) continue;
foreach (var pos in drawer)
{
if (pos == null) continue;
pos.HasReel = false;
pos.Barcode = string.Empty;
}
}
}
// Method to create PosInfo list from a string
private static DRAWERGroup CreatePosListFromString(string posString)
{
var drawerGroup = new DRAWERGroup();
int currentKey = 0;
var lines = posString.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
if (int.TryParse(line.Trim(), out int key))
{
// Update the current key
currentKey = key;
if (!drawerGroup.DRAWER.ContainsKey(currentKey))
{
drawerGroup.DRAWER[currentKey] = new List<PosInfo>();
}
}
else
{
// Add PosInfo to the current key
drawerGroup.DRAWER[currentKey].Add(new PosInfo
{
PosID = line.Trim(),
HasReel = false,
Barcode = string.Empty
});
}
}
return drawerGroup;
}
// New method to retrieve POS lists based on drawer index
public static void GetDarwerPoslist(int darwerindex, out string apos, out string bpos, out string aout, out string bout)
{
apos = string.Empty;
bpos = string.Empty;
aout = string.Empty;
bout = string.Empty;
if (APosList.DRAWER.TryGetValue(darwerindex, out var aDrawer))
{
var pos = aDrawer.FirstOrDefault(p => !p.HasReel);
var outPos = aDrawer.FirstOrDefault(p => p.HasReel);
apos = pos?.PosID ?? string.Empty;
aout = outPos?.PosID ?? string.Empty;
}
if (BPosList.DRAWER.TryGetValue(darwerindex, out var bDrawer))
{
var pos = bDrawer.FirstOrDefault(p => !p.HasReel);
var outPos = bDrawer.FirstOrDefault(p => p.HasReel);
bpos = pos?.PosID ?? string.Empty;
bout = outPos?.PosID ?? string.Empty;
}
}
// Method to update PosInfo based on PosID and HasReel
public static void UpdatePosinfo(string posid, bool hasreel)
{
LogUtil.info($"UpdatePosinfo {posid}={hasreel}");
foreach (var drawer in APosList.DRAWER.Values.Concat(BPosList.DRAWER.Values))
{
var pos = drawer.FirstOrDefault(p => p.PosID == posid);
if (pos != null)
{
pos.HasReel = hasreel;
SaveToFile(); // Save the updated data
return;
}
}
}
public static bool GetPosHasReel(string posid)
{
foreach (var drawer in APosList.DRAWER.Values.Concat(BPosList.DRAWER.Values))
{
var pos = drawer.FirstOrDefault(p => p.PosID == posid);
if (pos != null)
{
return pos.HasReel;
}
}
return true;
}
// APos and BPos string values
static string APosString = @"
1
01AA15060101
01AA15060103
01AA15060105
2
01BB01060220
01BB01060218
01BB01060216
3
01AA15060420
01AA15060418
01AA15060416
4
01BB01020220
01BB01020218
01BB01020216
5
01AA15040101
01AA15040103
01AA15040105
6
01BB15020220
01BB15020218
01BB15020216
7
01AA15020101
01AA15020103
01AA15020105
8
01BB14050401
01BB14050403
01BB14050405
9
01AA01040101
01AA01040103
01AA01040105
10
01BB01040220
01BB01040218
01BB01040216
11
01AA05060101
01AA05060103
01AA05060105
12
01BB15060220
01BB15060218
01BB15060216
13
01AA01060101
01AA01060103
01AA01060105
";
static string BPosString = @"
1
01BB05040220
01BB05040218
01BB05040216
2
01AA01020101
01AA01020103
01AA01020105
3
01BB05020220
01BB05020218
01BB05020216
4
01AA04040101
01AA04040103
01AA04040105
5
01BB05060220
01BB05060218
01BB05060216
6
01AA05040101
01AA05040103
01AA05040105
7
01BB04020220
01BB04020218
01BB04020216
8
01AA05020101
01AA05020103
01AA05020105
9
01BB04060220
01BB04060218
01BB04060216
10
01AA04060101
01AA04060103
01AA04060105
11
01BB15040220
01BB15040218
01BB15040216
12
01AA04020101
01AA04020103
01AA04020105
13
01BB04040220
01BB04040218
01BB04040216
";
}
[Serializable]
public class PosInfo
{
public string PosID { get; set; }
public bool HasReel { get; set; }
public string Barcode { get; set; }
}
[Serializable]
public class DRAWERGroup
{
public Dictionary<int, List<PosInfo>> DRAWER = new Dictionary<int, List<PosInfo>>();
}
}
......@@ -119,5 +119,7 @@ namespace OnlineStore.Common
/// </summary>
public static string DisSecurityAccess = "DisSecurityAccess";
public static string HeightLimit = "HeightLimit";
public static bool CycleMode = true;
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net40" requireReinstallation="true" />
<package id="Obfuscar" version="2.2.40" targetFramework="net48" developmentDependency="true" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\Obfuscar.2.2.40\build\obfuscar.props" Condition="Exists('..\..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -13,6 +14,8 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -78,5 +81,14 @@
<DependentUpon>AdvanceConfigForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Obfuscar.2.2.40\build\obfuscar.props'))" />
</Target>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Obfuscar" version="2.2.40" targetFramework="net48" developmentDependency="true" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Obfuscar.2.2.40\build\obfuscar.props" Condition="Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -12,6 +13,8 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -90,10 +93,14 @@
<Compile Include="storeBean\boxBean\BoxEquip_ConnectServerTimer.cs" />
<Compile Include="storeBean\boxBean\AutoInoutInfo.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_InExecute.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_InExecute_Partial.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_OutExecute.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_AutoFindPos.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_PosDebug.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_ServerPos.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_ShelfPos.cs" />
<Compile Include="storeBean\boxBean\EyemLibDemo.cs" />
<Compile Include="storeBean\boxBean\GetMovePFromServer.cs" />
<Compile Include="storeBean\boxBean\Humiture\HumitureBean.cs" />
<Compile Include="storeBean\boxBean\Humiture\HumitureController.cs" />
<Compile Include="storeBean\boxBean\MoveAxisDebug\BoxEquip_MoveAxisDebug.cs" />
......@@ -107,6 +114,7 @@
<Compile Include="storeBean\inputBean\InputEquip_InStore.cs" />
<Compile Include="storeBean\boxBean\BoxEquip.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_Partial.cs" />
<Compile Include="storeBean\inputBean\InputEquip_ServerCommunication.cs" />
<Compile Include="storeBean\XLRStoreBean.cs" />
<Compile Include="baan\AxisBean.cs" />
<Compile Include="baan\ClampJawBean.cs" />
......@@ -239,6 +247,12 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Obfuscar.2.2.40\build\obfuscar.props'))" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0"/>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup></configuration>
......@@ -121,6 +121,12 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public void AbsMove(DeviceMoveInfo MoveInfo, int targetPosition, int targetSpeed)
{
if (IsInPosition(targetPosition))
{
LogUtil.info(AxisName + $" 已在目标点:{targetPosition}");
return;
}
targetSpeed = (int)(targetSpeed * ConfigHelper.Config.Get<double>("SpeedRatio", 0.2));
bool rtn;
if (MoveInfo == null)
{
......@@ -154,6 +160,7 @@ namespace OnlineStore.DeviceLibrary
string state = AxisManager.instance.GetStatus(deviceName, axisNo);
//打印轴状态
LogUtil.info($" {MoveInfo.SLog}{MoveInfo.Name}{axis.DisplayStr},目标位置[{targetPosition}]当前位置[{outCount}]规划位置[{targetCount}]轴状态[{state}]");
axis.CanErrorCountMax = 1000;//**
if (errorCount <= axis.CanErrorCountMax)
{
return true;
......@@ -265,6 +272,7 @@ namespace OnlineStore.DeviceLibrary
}
public bool IsInPosition(int targetP, int canErrorMax = 0)
{
canErrorMax = 1000;
if (canErrorMax <= 0)
{
canErrorMax = Config.CanErrorCountMax;
......
......@@ -38,6 +38,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " OpenPort 失败");
}
}
LogUtil.info(Name + " OpenPort 成功");
return rmaxis.IsPortOpen;
}
......
......@@ -20,6 +20,7 @@ namespace OnlineStore.DeviceLibrary
}
public static void StartRecord(string camName, string fileName = "")
{
return;//**
Task.Factory.StartNew(delegate
{
//string url = $"{baseDir}/cam/startRecord?camName={camName}&filename={fileName}";
......
......@@ -20,7 +20,7 @@ namespace OnlineStore.DeviceLibrary
public static bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
private static bool isInit = false;
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public static event EventHandler<bool> Loadfinishevent;
public static XLRStoreBean XLRStore = null;
public static XLRStore_Config Config = null;
public static Dictionary<int, DeviceConfig> allConfigMap = null;
......@@ -86,6 +86,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(" 开始加载配置");
string appPath = Application.StartupPath;
//string appPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string CID = ConfigAppSettings.GetValue(Setting_Init.Line_CID);
string storeConfigPath = appPath + ConfigAppSettings.GetValue(Setting_Init.ConfigPath_XLRStore);
......@@ -111,6 +112,7 @@ namespace OnlineStore.DeviceLibrary
//CSVPositionReader<DrawerPosition>.AddCSVFile(drawConfigFile);
XLRStore = new XLRStoreBean(Config, inputConfig, boxConfig);
Loadfinishevent?.Invoke(null, true);
LogUtil.info("加载 完成!");
return true;
}
......@@ -129,6 +131,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
......
......@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
{
mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false;
mainTimer.Interval = 300;
mainTimer.Interval = 50;//**
mainTimer.Elapsed += mainTimer_Elapsed;
mainTimer.AutoReset = true;
......
......@@ -459,7 +459,54 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SI_20_ToStandby,
#endregion
#region 两侧同时进行取料
SIB_00_StartInstore,
/// <summary>
///料仓入库:料斗拉取进出轴先运动到P1
/// </summary>
SIB_01_PullAxis_Ready,
/// <summary>
///料仓入库:未在安全位置,行走机构先运动到P1
/// </summary>
SIB_01_MoveAxis_Ready,
/// <summary>
///料仓入库:移栽升降轴到上暂存区取料低点P3/P9
/// </summary>
SIB_01_Pull_Updown_ToPosition,
/// <summary>
/// 料仓入库:到料盘暂存区
/// 1. 行走机构到P2(进出料机构取放点)
/// 2. 移栽升降轴到P3(A上暂存区取料低点)
/// 3. A/B面移栽压紧轴到P2(压紧前点)
/// 4. A面移栽旋转轴到P2(进出料暂存区取放料水平点),同时检测X02=1
/// 或者 B面移栽旋转轴到P2(进出料暂存区取放料水平点),同时检测X03=1
/// </summary>
SIB_02_ToBufferArea,
/// <summary>
/// 料仓入库:确保暂存区有料盘
/// 如果无料盘则报警
/// </summary>
SIB_03_VerifyBufferState,
/// <summary>
/// 料仓入库:A/B面移栽X轴到P2(A/B进出料暂存区取放点)
/// </summary>
SIB_04_InOutToBuff,
/// <summary>
/// 料仓入库:取料盘
/// 1. 移栽升降轴到P2(A上暂存区取料高点)
/// 2. A/B面移栽压紧轴到P3压紧点
/// </summary>
SIB_05_GetReel,
/// <summary>
/// 料仓入库:A/B面移栽X轴到P1
/// </summary>
SIB_06_InOutBackToP1FromBuff,
/// <summary>
/// 料仓入库:清除缓存
/// </summary>
SIB_06_ClearBuffInfo,
#endregion
#region 存储机构自动对位功能 400开始
/// <summary>
/// 存储机构自动对位:开始对位
......
......@@ -58,6 +58,8 @@ namespace OnlineStore.DeviceLibrary
/// 0=未知,1=A侧料串,2=B侧料串
/// </summary>
public int ShelfType { get; set; } = 0;
public InOutPosInfo AOutPosInfo { get; set; } = null;
public InOutPosInfo BOutPosInfo { get; set; } = null;
}
/// <summary>
/// 出入库料盘信息
......@@ -264,17 +266,17 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("GetPositon[" + posId + "] =null,没有库位不能执行出入库");
}
PullAxis_Inout_P2_P4 = position.PullAxis_Inout_P2_P4;
PullAxis_Inout_P3_P5 = position.PullAxis_Inout_P3_P5;
PullAxis_Updown_P2 = position.PullAxis_Updown_P2;
PullAxis_Updown_P3 = position.PullAxis_Updown_P3;
PullAxis_Updown_P4 = position.PullAxis_Updown_P4;
Updown_P6_P12 = position.Updown_P6_P12;
Updown_P7_P13 = position.Updown_P7_P13;
XAxis_AB_P3 = position.XAxis_AB_P3;
ComAxis_AB_P2 = position.ComAxis_AB_P2;
ComAxis_AB_P3 = position.ComAxis_AB_P3;
MoveAxis_P3 = position.MoveAxis_P3;
PullAxis_Inout_P2_P4 = position.PullAxis_Inout_P2_P4;
PullAxis_Inout_P3_P5 = position.PullAxis_Inout_P3_P5;
PullAxis_Updown_P2 = position.PullAxis_Updown_P2;
PullAxis_Updown_P3 = position.PullAxis_Updown_P3;
PullAxis_Updown_P4 = position.PullAxis_Updown_P4;
Updown_P6_P12 = position.Updown_P6_P12;
Updown_P7_P13 = position.Updown_P7_P13;
XAxis_AB_P3 = position.XAxis_AB_P3;
ComAxis_AB_P2 = position.ComAxis_AB_P2;
ComAxis_AB_P3 = position.ComAxis_AB_P3;
MoveAxis_P3 = position.MoveAxis_P3;
}
/// <summary>
......@@ -282,31 +284,31 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public void LoadStaticPos(BoxEquip_Config equip_Config)
{
MoveAxis_P1 = equip_Config.MoveAxis_P1;
MoveAxis_P2 = equip_Config.MoveAxis_P2;
PullAxis_Inout_P1 = equip_Config.PullAxis_Inout_P1;
Updown_P1 = equip_Config.Updown_P1;
Updown_P2 = equip_Config.Updown_P2;
Updown_P3 = equip_Config.Updown_P3;
Updown_P4 = equip_Config.Updown_P4;
Updown_P5 = equip_Config.Updown_P5;
Updown_P8 = equip_Config.Updown_P8;
Updown_P9 = equip_Config.Updown_P9;
Updown_P10 = equip_Config.Updown_P10;
Updown_P11 = equip_Config.Updown_P11;
PullAxis_Updown_P1 = equip_Config.PullAxis_Updown_P1;
XAxis_A_P1 = equip_Config.XAxis_A_P1;
XAxis_A_P2 = equip_Config.XAxis_A_P2;
MiddleAxis_A_P1 = equip_Config.MiddleAxis_A_P1;
MiddleAxis_A_P2 = equip_Config.MiddleAxis_A_P2;
MiddleAxis_A_P3 = equip_Config.MiddleAxis_A_P3;
ComAxis_A_P1 = equip_Config.ComAxis_A_P1;
XAxis_B_P1 = equip_Config.XAxis_B_P1;
XAxis_B_P2 = equip_Config.XAxis_B_P2;
MiddleAxis_B_P1 = equip_Config.MiddleAxis_B_P1;
MiddleAxis_B_P2 = equip_Config.MiddleAxis_B_P2;
MiddleAxis_B_P3 = equip_Config.MiddleAxis_B_P3;
ComAxis_B_P1 = equip_Config.ComAxis_B_P1;
MoveAxis_P1 = equip_Config.MoveAxis_P1;
MoveAxis_P2 = equip_Config.MoveAxis_P2;
PullAxis_Inout_P1 = equip_Config.PullAxis_Inout_P1;
Updown_P1 = equip_Config.Updown_P1;
Updown_P2 = equip_Config.Updown_P2;
Updown_P3 = equip_Config.Updown_P3;
Updown_P4 = equip_Config.Updown_P4;
Updown_P5 = equip_Config.Updown_P5;
Updown_P8 = equip_Config.Updown_P8;
Updown_P9 = equip_Config.Updown_P9;
Updown_P10 = equip_Config.Updown_P10;
Updown_P11 = equip_Config.Updown_P11;
PullAxis_Updown_P1 = equip_Config.PullAxis_Updown_P1;
XAxis_A_P1 = equip_Config.XAxis_A_P1;
XAxis_A_P2 = equip_Config.XAxis_A_P2;
MiddleAxis_A_P1 = equip_Config.MiddleAxis_A_P1;
MiddleAxis_A_P2 = equip_Config.MiddleAxis_A_P2;
MiddleAxis_A_P3 = equip_Config.MiddleAxis_A_P3;
ComAxis_A_P1 = equip_Config.ComAxis_A_P1;
XAxis_B_P1 = equip_Config.XAxis_B_P1;
XAxis_B_P2 = equip_Config.XAxis_B_P2;
MiddleAxis_B_P1 = equip_Config.MiddleAxis_B_P1;
MiddleAxis_B_P2 = equip_Config.MiddleAxis_B_P2;
MiddleAxis_B_P3 = equip_Config.MiddleAxis_B_P3;
ComAxis_B_P1 = equip_Config.ComAxis_B_P1;
}
#region 固定轴移动点位信息
/// <summary>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
<package id="Obfuscar" version="2.2.40" targetFramework="net48" developmentDependency="true" />
</packages>
\ No newline at end of file
......@@ -493,7 +493,7 @@ namespace OnlineStore.DeviceLibrary
string msg = "";
int tLength = 15;
msg += "runS: " + runStatus + "\n";
msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n";
msg += "alarm: " + alarmType;//** + " " + LastAlarmTime.ToLongTimeString() + "\n";
msg += "MoveT:" + MoveInfo.MoveType + "\n";
msg += "MoveS :" + MoveInfo.MoveStep + "\n";
return msg;
......@@ -525,6 +525,7 @@ namespace OnlineStore.DeviceLibrary
CloseLed();
return;
}
return;//**
bool isNeedAlarmLed = false;
bool isInOut = false;
bool yellowMove = false;
......
......@@ -26,7 +26,6 @@ namespace OnlineStore.DeviceLibrary
public InputEquip inputEquip;
public BoxEquip boxEquip;
public Dictionary<int, EquipBase> equipsMap = new Dictionary<int, EquipBase>();
public XLRStore_Config Config = null;
private bool canStart = false;
//public SQLite sQLite = null;
......@@ -247,7 +246,7 @@ namespace OnlineStore.DeviceLibrary
{
runStatus = RunStatus.Runing;
MoveInfo.EndMove();
mainTimer.Interval = 300;
mainTimer.Interval = 100;//**
maxSeconds = 3;
AgvClient.SetCancelState(AgvClient.CurrCancelState);
LogUtil.info(Name + "复位完成 [" + FormUtil.GetSpanStr(span) + "]");
......
......@@ -202,6 +202,7 @@ namespace OnlineStore.DeviceLibrary
object locObj = new object();
void logColumnSig()
{
return;//**
if(Monitor.TryEnter(locObj))
{
try
......@@ -389,6 +390,9 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfo.EndMove();
return;
switch (MoveInfo.MoveStep)
{
//回零
......@@ -743,7 +747,7 @@ namespace OnlineStore.DeviceLibrary
private DateTime errUpperB = DateTime.Now;
private DateTime errUnderA = DateTime.Now;
private DateTime errUnderB = DateTime.Now;
int SigLastTime = 2;//5秒
int SigLastTime = 10;//5秒
protected override void OnTimerProcess()
{
if (!runStatus.Equals(RunStatus.Runing))
......@@ -794,11 +798,22 @@ namespace OnlineStore.DeviceLibrary
ClearSpecifiedAlarm("B出料下暂存区有料盘,但信号未亮");
errUnderB = DateTime.Now;
}
if (IOValue(IO_Type.UpperArea_Check_A).Equals(IO_VALUE.HIGH) && BufferDataManager.AInStoreInfo != null
&& IOValue(IO_Type.UpperArea_Check_B).Equals(IO_VALUE.HIGH) && BufferDataManager.BInStoreInfo != null
&& (BufferDataManager.AInStoreInfo.PlateW == BufferDataManager.BInStoreInfo.PlateW && BufferDataManager.AInStoreInfo.PlateH == BufferDataManager.BInStoreInfo.PlateH))
{
//**StartInstore(new InOutParam() { PosInfo = BufferDataManager.AInStoreInfo, PosInfoBack = BufferDataManager.BInStoreInfo });
return;
}
//检测A上暂存区是否有料盘
if (IOValue(IO_Type.UpperArea_Check_A).Equals(IO_VALUE.HIGH))
{
if (timeSpanA.TotalSeconds >= SigLastTime)
StartInstore(new InOutParam(BufferDataManager.AInStoreInfo));
//**if (timeSpanA.TotalSeconds >= SigLastTime)
//** StartInstore(new InOutParam(BufferDataManager.AInStoreInfo));
}
else
{
......@@ -808,8 +823,8 @@ namespace OnlineStore.DeviceLibrary
//检测B上暂存区是否有料盘
if (IOValue(IO_Type.UpperArea_Check_B).Equals(IO_VALUE.HIGH))
{
if (timeSpanB.TotalSeconds >= SigLastTime)
StartInstore(new InOutParam(BufferDataManager.BInStoreInfo));
//**if (timeSpanB.TotalSeconds >= SigLastTime)
//** StartInstore(new InOutParam(BufferDataManager.BInStoreInfo));
}
else
{
......
......@@ -66,6 +66,7 @@ namespace OnlineStore.DeviceLibrary
public const string boxBCamName = "box_B";
public void StartRecord(string fileName)
{
return;//**
StartBoxARecord(fileName);
StartBoxBRecord(fileName);
}
......@@ -87,6 +88,7 @@ namespace OnlineStore.DeviceLibrary
}
public void StopRecord()
{
return;//**
StopBoxARecord();
StopBoxBRecord();
}
......
......@@ -16,6 +16,7 @@ namespace OnlineStore.DeviceLibrary
public partial class BoxEquip
{
private System.Timers.Timer serverConnectTimer;
public bool IsServerConnected=false;
public void InitConnectServerTimer()
{
serverConnectTimer = new System.Timers.Timer();
......@@ -24,19 +25,24 @@ namespace OnlineStore.DeviceLibrary
serverConnectTimer.Enabled = false;
serverConnectTimer.Elapsed += server_connect_timer_Tick;
}
/// <summary>
/// 反馈状态
/// </summary>
/// <param name="posid"></param>
/// <param name="storeStatus"></param>
public void SendStoreState(string posid, DeviceStatus storeStatus)
{
Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid))
{
operation.boxStatus[1].data[ParamDefine.posId] = posid;
}
LogUtil.info($"SendStoreState,posid:{posid}, storeStatus:{storeStatus}");
operation.boxStatus[1].status = (int)storeStatus;
//Operation operation = getLineBoxStatus();
//if (!string.IsNullOrEmpty(posid))
//{
// operation.boxStatus[1].data[ParamDefine.posId] = posid;
//}
//LogUtil.info($"SendStoreState,posid:{posid}, storeStatus:{storeStatus}");
//operation.boxStatus[1].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation));
//LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
//Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
}
internal void SetConnectServerTimer(bool open)
......@@ -62,18 +68,12 @@ namespace OnlineStore.DeviceLibrary
lastConTime = DateTime.Now;
try
{
// humBean.HumidityProcess(this);
//if (IsDebug)
//{
// if (StoreManager.IsConnectServer && (runStatus.Equals(RunStatus.Runing)|| runStatus.Equals(RunStatus.Busy)))
// {
// //SendLineStatus();
// }
//}
//else
{
if (StoreManager.IsConnectServer && (runStatus.Equals(RunStatus.Runing)|| runStatus.Equals(RunStatus.Busy)))
{
SendLineStatus();
}
}
}
catch (Exception ex)
{
......@@ -185,32 +185,32 @@ namespace OnlineStore.DeviceLibrary
Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), lineOperation);
//LogUtil.info("resultOperation="+ JsonHelper.SerializeObject(resultOperation));
//发送状态信息到服务器
if (resultOperation == null || (resultOperation.op <= 0))
{
//判断服务端是否返回出库操作
return;
}
if (resultOperation.op.Equals(1))
{
//ReviceInStoreProcess("", resultOperation);
}
else if (resultOperation.op.Equals(2))
{
ReviceOutStoreProcess(resultOperation);
}
else if (resultOperation.op.Equals(5))
{
humBean.ProcessHumidityCMD(resultOperation);
}
else
{
LogUtil.error("收到服务器命令:op=" + resultOperation.op + ",未找到对应处理");
}
TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10)
{
LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
}
//if (resultOperation == null || (resultOperation.op <= 0))
//{
// //判断服务端是否返回出库操作
// return;
//}
//if (resultOperation.op.Equals(1))
//{
// //ReviceInStoreProcess("", resultOperation);
//}
//else if (resultOperation.op.Equals(2))
//{
// ReviceOutStoreProcess(resultOperation);
//}
//else if (resultOperation.op.Equals(5))
//{
// humBean.ProcessHumidityCMD(resultOperation);
//}
//else
//{
// LogUtil.error("收到服务器命令:op=" + resultOperation.op + ",未找到对应处理");
//}
//TimeSpan span = DateTime.Now - time;
//if (span.TotalMilliseconds > 10)
//{
// LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
//}
}
public bool ReviceInStoreCMD(string posId, int plateH, int plateW, string message)
{
......@@ -228,39 +228,39 @@ namespace OnlineStore.DeviceLibrary
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", this.DeviceID.ToString() } };
operation.data.Add("inPos", posId);
for (int i = 1; i <= 5; i++)
{
bool timeOut = false;
Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
LogUtil.info($"入库验证请求信息:【{JsonHelper.SerializeObject(operation)}】【{JsonHelper.SerializeObject(resultOperation)}】");
if (timeOut)
{
LogUtil.error(logName + " 第" + i + "次发送超时 ");
continue;
}
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.error(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
continue;
}
else if (resultOperation.op.Equals(1) && operation.seq.Equals(resultOperation.seq))
{
LogUtil.info(logName + " 成功" + $"【{JsonHelper.SerializeObject(resultOperation)}】");
return true;
}
else
{
LogUtil.info(logName + "服务器反馈 :" + JsonHelper.SerializeObject(resultOperation));
continue;
}
break;
}
//for (int i = 1; i <= 5; i++)
//{
// bool timeOut = false;
// Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
// LogUtil.info($"入库验证请求信息:【{JsonHelper.SerializeObject(operation)}】【{JsonHelper.SerializeObject(resultOperation)}】");
// if (timeOut)
// {
// LogUtil.error(logName + " 第" + i + "次发送超时 ");
// continue;
// }
// if (resultOperation == null)
// {
// // CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
// LogUtil.error(logName + " 没有收到服务器反馈 ");
// }
// else if (!string.IsNullOrEmpty(resultOperation.msg))
// {
// //如果有提示消息,直接显示提示
// LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
// continue;
// }
// else if (resultOperation.op.Equals(1) && operation.seq.Equals(resultOperation.seq))
// {
// LogUtil.info(logName + " 成功" + $"【{JsonHelper.SerializeObject(resultOperation)}】");
// return true;
// }
// else
// {
// LogUtil.info(logName + "服务器反馈 :" + JsonHelper.SerializeObject(resultOperation));
// continue;
// }
// break;
//}
}
catch (Exception ex)
{
......
using CodeLibrary;
using OnlineStore.Common;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms.VisualStyles;
namespace OnlineStore.DeviceLibrary
{
......@@ -23,7 +14,6 @@ namespace OnlineStore.DeviceLibrary
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P2, Config.ComAxis_FindPosSpeed);
ComAxis_B.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P2, Config.ComAxis_FindPosSpeed);
}
else
{
ComAxis_A.AbsMove(MoveInfo, MoveInfo.MoveParam.MoveP.ComAxis_AB_P2, Config.ComAxis_A_P2_Speed);
......@@ -148,49 +138,37 @@ namespace OnlineStore.DeviceLibrary
switch (MoveInfo.MoveStep)
{
case StepEnum.SIB_00_StartInstore:
PullAxisToP1("入库");
break;
case StepEnum.SIB_01_PullAxis_Ready:
SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
MoveInfo.NextMoveStep(StepEnum.SIB_01_Pull_Updown_ToPosition);
if (!IsMoveAxisInSafePos())
startTime = DateTime.Now;
//PullAxisToP1("入库");
MoveInfo.NextMoveStep(StepEnum.SIB_01_PullAxis_Ready);
if (PullAxis_Inout.GetAclPosition() < 197633 + 1200 && PullAxis_Inout.GetAclPosition() > -220714 - 1200)
{
MoveAxisToSafePos();
LogInfo($"入库 {MoveInfo.SLog}:行走机构不在安全位置,先到安全位置={Config.MoveAxis_SafePos}。当前位置{MoveAxis.GetAclPosition()}");
LogInfo($"入库 {MoveInfo.SLog}:抽屉拉取轴不干涉");
}
else
{
PullAxis_Inout_To_Cam();
LogInfo($"入库 {MoveInfo.SLog}:抽屉拉取轴干涉");
}
break;
case StepEnum.SIB_01_Pull_Updown_ToPosition:
MoveInfo.NextMoveStep(StepEnum.SIB_01_MoveAxis_Ready);
LogInfo($"入库 {MoveInfo.SLog}:到暂存区入料口," +
$"行走机构到待机点P1,料斗升降轴到P1点,移栽升降轴到上暂存区入库取料低点P3/P9,移栽压紧轴到压紧前点P2,移栽旋转轴到取放料水平点P2,移栽X轴到P1,料斗升降轴到P1点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
MoveAxisToP1();
case StepEnum.SIB_01_PullAxis_Ready:
//SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
MoveInfo.NextMoveStep(StepEnum.SIB_03_VerifyBufferState);
LogInfo($"入库 {MoveInfo.SLog}:到暂存区入料口," + $"行走机构到待机点P1,料斗升降轴到P1点,移栽升降轴到上暂存区入库取料低点P3/P9,移栽压紧轴到压紧前点P2,移栽旋转轴到取放料水平点P2,移栽X轴到P1,料斗升降轴到P1点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
MoveAxisToSafePos();
PullAxis_UpdownToP1();
UpdownAxisTo_P3_P9();
BothComAxis_To_P2();
BothMiddleAxis_To_P2();
BothXAxis_To_P1();
//BuffAreaInstoreDoor(true);
break;
case StepEnum.SIB_01_MoveAxis_Ready:
MoveInfo.NextMoveStep(StepEnum.SIB_02_ToBufferArea);
startTime = DateTime.Now;
break;
case StepEnum.SIB_02_ToBufferArea:
if (!InDoorBothCheck(MoveInfo.MoveParam))
{
SetWarnMsg($"入库 {MoveInfo.SLog}:AB入口料盘无入库信息, 任务取消");
LogInfo($"入库 {MoveInfo.SLog}:AB入口料盘因无入库信息,结束入库");
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfo.EndMove();
}
else
{
MoveInfo.NextMoveStep(StepEnum.SIB_03_VerifyBufferState);
LogInfo($"入库 {MoveInfo.SLog}:AB入料口入库信息确认,[barcode={MoveInfo.MoveParam.PosInfo.barcode},posId={MoveInfo.MoveParam.PosInfo.PosId}][barcode={MoveInfo.MoveParam.PosInfoBack.barcode},posId={MoveInfo.MoveParam.PosInfoBack.PosId}],开始取料");
}
PullAxis_Inout_To_Cam(needwait: false);
//if (!IsMoveAxisInSafePos())
//{
// LogInfo($"入库 {MoveInfo.SLog}:行走机构不在安全位置,先到安全位置={Config.MoveAxis_SafePos}。当前位置{MoveAxis.GetAclPosition()}");
//}
break;
case StepEnum.SIB_03_VerifyBufferState:
if (!CheckInputMiddleAxisInBuff())
if (true || !CheckInputMiddleAxisInBuff())
{
MoveInfo.NextMoveStep(StepEnum.SIB_04_InOutToBuff);
LogInfo($"入库 {MoveInfo.SLog}:移栽X轴到暂存区取放点P2,行走机构到取放点P2");
......@@ -214,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"入库 {MoveInfo.SLog}:移栽X轴到库位取放点P3,行走机构到待机点P1");
// XAxis_To_P1();
BothXAxis_To_P3();
MoveAxisToP1();
MoveAxisToSafePos();
break;
case StepEnum.SIB_06_InOutBackToP1FromBuff:
MoveInfo.NextMoveStep(StepEnum.SIB_06_ClearBuffInfo);
......
......@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
break;
case StepEnum.SO_01_PullAxis_Ready:
SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
//SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
MoveInfo.NextMoveStep(StepEnum.SO_01_MoveAxis_Ready);
if(!IsMoveAxisInSafePos())
{
......@@ -269,7 +269,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SO_18_PutReel);
LogInfo($"出库 {MoveInfo.SLog}:放料盘,移栽升降轴到下暂存区放料低点P5/P11");
executeTime = (DateTime.Now - startTime).TotalSeconds.ToString("f2");
SetBoxStatus(DeviceStatus.OutStoreBoxEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
//SetBoxStatus(DeviceStatus.OutStoreBoxEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
UpdownAxisTo_P5_P11();
break;
case StepEnum.SO_18_PutReel:
......@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
}
break;
case StepEnum.SO_20_Finish:
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
//SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
//停止记录
StopRecord();
MoveInfo.EndMove();
......
using System;
using DeviceLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -8,5 +10,141 @@ namespace OnlineStore.DeviceLibrary
{
public partial class BoxEquip
{
/// <summary>
/// 从服务器获取运动点位数据P1
/// </summary>
/// <param name="inOutParam"></param>
/// <returns></returns>
public int GetPullAxisUpdownToP1PosFromServer(InOutParam inOutParam)
{
//try
//{
//Dictionary<string, string> paramMap = new Dictionary<string, string>();
//paramMap.Add("PosInfo", JsonHelper.SerializeObject(inOutParam.PosInfo));
// string server = GetAddr("/service/store/GetPullAxisUpdownToP1PosFromServer", null);
// DateTime startTime = DateTime.Now;
// ResultData resultdata = HttpHelper.PostJson<Dictionary<string, string>, ResultData>(server, paramMap, 2000, true);
// LogUtil.info("GetPullAxisUpdownToP1PosFromServer " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】");
// if (resultdata == null)
// {
// LogUtil.info("GetPullAxisUpdownToP1PosFromServer【 " + movepos + "】 没有收到服务器反馈");
// return 0;
// }
// else if (resultdata.data != null)
// {
// var b = int.Parse(resultdata.data["pos"]);
// return int;
// }
// return 0;
//}
//catch (Exception ex)
//{
// LogUtil.error("GetPullAxisUpdownToP1PosFromServer: " + ex.ToString());
//}
//return string.Empty;
return 0;
}
/// <summary>
/// 从服务器获取运动点位数据P3
/// </summary>
/// <param name="inOutParam"></param>
/// <returns></returns>
public int GetPullAxisUpdownP3PosFromServer(InOutParam inOutParam)
{
//try
//{
//Dictionary<string, string> paramMap = new Dictionary<string, string>();
//paramMap.Add("PosInfo", JsonHelper.SerializeObject(inOutParam.PosInfo));
// string server = GetAddr("/service/store/GetPullAxisUpdownP3PosFromServer", null);
// DateTime startTime = DateTime.Now;
// ResultData resultdata = HttpHelper.PostJson<Dictionary<string, string>, ResultData>(server, paramMap, 2000, true);
// LogUtil.info("GetPullAxisUpdownP3PosFromServer " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】");
// if (resultdata == null)
// {
// LogUtil.info("GetPullAxisUpdownP3PosFromServer【 " + movepos + "】 没有收到服务器反馈");
// return 0;
// }
// else if (resultdata.data != null)
// {
// var b = int.Parse(resultdata.data["pos"]);
// return int;
// }
// return 0;
//}
//catch (Exception ex)
//{
// LogUtil.error("GetPullAxisUpdownP3PosFromServer: " + ex.ToString());
//}
//return string.Empty;
return 0;
}
/// <summary>
/// 从服务器获取运动点位数据P4
/// </summary>
/// <param name="inOutParam"></param>
/// <returns></returns>
public int GetPullAxisUpdownP4PosFromServer(InOutParam inOutParam)
{
//try
//{
//Dictionary<string, string> paramMap = new Dictionary<string, string>();
//paramMap.Add("PosInfo", JsonHelper.SerializeObject(inOutParam.PosInfo));
// string server = GetAddr("/service/store/GetPullAxisUpdownP4PosFromServer", null);
// DateTime startTime = DateTime.Now;
// ResultData resultdata = HttpHelper.PostJson<Dictionary<string, string>, ResultData>(server, paramMap, 2000, true);
// LogUtil.info("GetPullAxisUpdownP4PosFromServer " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】");
// if (resultdata == null)
// {
// LogUtil.info("GetPullAxisUpdownP4PosFromServer【 " + movepos + "】 没有收到服务器反馈");
// return 0;
// }
// else if (resultdata.data != null)
// {
// var b = int.Parse(resultdata.data["pos"]);
// return int;
// }
// return 0;
//}
//catch (Exception ex)
//{
// LogUtil.error("GetPullAxisUpdownP4PosFromServer: " + ex.ToString());
//}
//return string.Empty;
return 0;
}
/// <summary>
/// 从服务器获取运动点位数据P2
/// </summary>
/// <param name="inOutParam"></param>
/// <returns></returns>
public int GetPullAxisUpdownP2PosFromServer(InOutParam inOutParam)
{
//try
//{
//Dictionary<string, string> paramMap = new Dictionary<string, string>();
//paramMap.Add("PosInfo", JsonHelper.SerializeObject(inOutParam.PosInfo));
// string server = GetAddr("/service/store/GetPullAxisUpdownP2PosFromServer", null);
// DateTime startTime = DateTime.Now;
// ResultData resultdata = HttpHelper.PostJson<Dictionary<string, string>, ResultData>(server, paramMap, 2000, true);
// LogUtil.info("GetPullAxisUpdownP2PosFromServer " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】");
// if (resultdata == null)
// {
// LogUtil.info("GetPullAxisUpdownP2PosFromServer【 " + movepos + "】 没有收到服务器反馈");
// return 0;
// }
// else if (resultdata.data != null)
// {
// var b = int.Parse(resultdata.data["pos"]);
// return int;
// }
// return 0;
//}
//catch (Exception ex)
//{
// LogUtil.error("GetPullAxisUpdownP2PosFromServer: " + ex.ToString());
//}
//return string.Empty;
return 0;
}
}
}
using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public partial class BoxEquip
{
/// <summary>
/// 从服务器获取库位点位数据P1
/// </summary>
/// <param name="inOutParam"></param>
/// <returns></returns>
public LineMoveP GetMovePFromServer(BoxEquip_Config config, InOutPosInfo posInfo)
{
//try
//{
//Dictionary<string, string> paramMap = new Dictionary<string, string>();
//paramMap.Add("PosInfo", JsonHelper.SerializeObject(inOutParam.PosInfo));
// string server = GetAddr("/service/store/GetMovePFromServer", null);
// DateTime startTime = DateTime.Now;
// LineMoveP resultdata = HttpHelper.PostJson<Dictionary<string, string>, LineMoveP>(server, paramMap, 2000, true);
// LogUtil.info("GetMovePFromServer " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】");
// if (resultdata == null)
// {
// LogUtil.info("GetMovePFromServer【 " + movepos + "】 没有收到服务器反馈");
// return 0;
// }
// else if (resultdata.data != null)
// {
// return resultdata;
// }
// return 0;
//}
//catch (Exception ex)
//{
// LogUtil.error("GetMovePFromServer: " + ex.ToString());
//}
//return string.Empty;
return new LineMoveP();
}
}
}
using OnlineStore.LoadCSVLibrary;
namespace OnlineStore.DeviceLibrary
{
internal class GetMovePFromServer : LineMoveP
{
}
}
\ No newline at end of file
......@@ -71,13 +71,16 @@ namespace OnlineStore.DeviceLibrary
if (!MoveStop)
{
//LogUtil.info( Name+$" 启动料串1:{MoveInfo.MoveType},{Robot.MoveInfo.MoveType}");
if (MoveInfo.MoveType.Equals(MoveType.None))
{
if (Robot.MoveInfo.MoveType.Equals(MoveType.Reset) || Robot.MoveInfo.MoveType.Equals(MoveType.RHome))
{
LogUtil.info("启动料串1");
}
else
{
LogUtil.info("启动料串2");
if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{
StartInstore(new InOutParam());
......@@ -103,27 +106,27 @@ namespace OnlineStore.DeviceLibrary
}
//判断是否无料串
if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.LOW)
&& Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.LOW)
&& Robot.CylinderIsOk(Config.IO_Shelf_StopUp, Config.IO_Shelf_StopDown))
{
if (StoreManager.checkWatch(shelfWatch, 10000, true))
{
Asa.ClientAction action = AgvClient.GetAction(Config.AgvName);
var agvcallresult = AgvClient.NeedEnter(Config.AgvName, "", Asa.ClientLevel.High);
if (!action.Equals(Asa.ClientAction.NeedEnter))
{
WorkLog("无料串,:通知agv来送料串AgvName:" + Config.AgvName + ",send NeedEnter=:" + agvcallresult.ToString());
}
}
}
else if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH) && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH)
&& AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.NeedLeave && AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.MayLeave && AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.FinishLeave)
{
shelfWatch.Stop();
AgvClient.SetToNone(Config.AgvName);
}
////判断是否无料串
//if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.LOW)
// && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.LOW)
// && Robot.CylinderIsOk(Config.IO_Shelf_StopUp, Config.IO_Shelf_StopDown))
//{
// if (StoreManager.checkWatch(shelfWatch, 10000, true))
// {
// Asa.ClientAction action = AgvClient.GetAction(Config.AgvName);
// var agvcallresult = AgvClient.NeedEnter(Config.AgvName, "", Asa.ClientLevel.High);
// if (!action.Equals(Asa.ClientAction.NeedEnter))
// {
// WorkLog("无料串,:通知agv来送料串AgvName:" + Config.AgvName + ",send NeedEnter=:" + agvcallresult.ToString());
// }
// }
//}
//else if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH) && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH)
// && AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.NeedLeave && AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.MayLeave && AgvClient.GetAction(Config.AgvName) != Asa.ClientAction.FinishLeave)
//{
// shelfWatch.Stop();
// AgvClient.SetToNone(Config.AgvName);
//}
}
private Stopwatch shelfWatch = new Stopwatch();
public bool Reset(bool needStop = false, bool resetShelf = false)
......@@ -159,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NewMove(MoveType.Reset, new InOutParam());
MoveInfo.NextMoveStep(StepEnum.IBR01_StopDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
WorkLog("开始复位,定位气缸下降");
WorkLog($"开始复位,定位气缸下降,runStatus:{Robot.runStatus},AutoInput:{Robot.AutoInput},MoveStop:{MoveStop},alarmType:{Robot.alarmType},Robot.MoveStop:{Robot.MoveStop}");
StopDown(MoveInfo);
return true;
}
......@@ -186,9 +189,10 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
//return;//**
if (MoveInfo.IsStep(StepEnum.IBR01_StopDown))
{
MoveInfo.NextMoveStep(StepEnum.IBR02_LineRun);
WorkLog("复位:链条正转3秒");
LineRun(MoveInfo);
......
......@@ -29,27 +29,29 @@ namespace OnlineStore.DeviceLibrary
public bool StartInstore(InOutParam param)
{
if (ProcessShelfOut || ProcessShelfEnter)
{
return false;
}
LogUtil.info("启动料串4");
//if (ProcessShelfOut || ProcessShelfEnter)
//{
// return false;
//}
//if (!Robot.CanStartWork())
//{
// return false;
//}
if (AgvClient.GetAction(Config.AgvName) == ClientAction.NeedLeave || AgvClient.GetAction(Config.AgvName) == ClientAction.MayLeave)
{
//WorkLog("料串入料 :等待AGV来取空料串1");
return false;
}
UpdateShelf(1);
if (CurrShelf.ShelfState.Equals(3))
{
bool agvcallresult = AgvClient.NeedLeave(Config.AgvName, CurrShelf.ShelfRfid, ClientLevel.High);
LogUtil.info(Name + "StartInstore 失败,料串" + CurrShelf.ToStr() + "需要离开,NeedLeave:" + Config.AgvName + "," + CurrShelf.ShelfRfid + ",agvcallresult:" + agvcallresult.ToString());
return false;
}
else if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
//if (AgvClient.GetAction(Config.AgvName) == ClientAction.NeedLeave || AgvClient.GetAction(Config.AgvName) == ClientAction.MayLeave)
//{
// //WorkLog("料串入料 :等待AGV来取空料串1");
// return false;
//}
//UpdateShelf(1);
//if (CurrShelf.ShelfState.Equals(3))
//{
// bool agvcallresult = AgvClient.NeedLeave(Config.AgvName, CurrShelf.ShelfRfid, ClientLevel.High);
// LogUtil.info(Name + "StartInstore 失败,料串" + CurrShelf.ToStr() + "需要离开,NeedLeave:" + Config.AgvName + "," + CurrShelf.ShelfRfid + ",agvcallresult:" + agvcallresult.ToString());
// return false;
//}
//else
if (Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NewMove(MoveType.InStore, new InOutParam());
IB03_LineStart();
......@@ -134,6 +136,7 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
//return;//**
#region 入料:料串进入并开始检测托盘
if (MoveInfo.IsStep(StepEnum.IB01_Wait))
{
......@@ -178,6 +181,8 @@ namespace OnlineStore.DeviceLibrary
LineStop();
if (Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH))
{
CurrShelf = new ShelfInfo();//**
CurrShelf.ShelfState = 1;//**
if (CurrShelf != null && CurrShelf.ShelfState.Equals(2))
{
SendInShelfLeave(" 料串【" + CurrShelf.ToStr() + "】为出库中料串,不需要入库 ");
......@@ -298,6 +303,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StepEnum.IB17_WaitReelLeave))
{
MoveInfo.NextMoveStep(StepEnum.IB13_ScanOK);
WorkLog("未连接mes, 跳过扫码");
return;//**
CheckHasTray();
}
......@@ -347,6 +355,10 @@ namespace OnlineStore.DeviceLibrary
private Task<List<string>> scanTask = null;
private void IB11_ScanCode()
{
MoveInfo.NextMoveStep(StepEnum.IB13_ScanOK);
WorkLog("未连接mes, 跳过扫码");
return;//**
ClearWarnMsg("等待旋转轴离开料串超时");
MoveInfo.NextMoveStep(StepEnum.IB11_ScanCode);
LastCodeList = new List<string>();
......@@ -424,6 +436,10 @@ namespace OnlineStore.DeviceLibrary
if (Robot.IOValue(Config.IO_ReelCheck).Equals(IO_VALUE.HIGH) && MoveInfo.ShelfNoTray.Equals(false))
{
MoveInfo.NextMoveStep(StepEnum.IB13_ScanOK);
WorkLog("未连接mes, 跳过扫码");
return;//**
toBatchP4 = false;
//判断扫码点是否可用,可用,运动到扫码点
......
......@@ -177,9 +177,16 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
//LogInfo("复位完成");//**
//runStatus = RunStatus.Runing;//**
//MoveInfo.EndMove();//**
//return;//**
if (MoveInfo.IsStep(StepEnum.IR01_Wait))
{
MoveInfo.NextMoveStep(StepEnum.IR06_UpdownToP1);
LogInfo($"复位 {MoveInfo.SLog}:XXXXX");
return;
// 1,处于A,B,NG料口是,可以直接回取料升降轴。
// 2,处于A, B两个暂存区时,升降轴先运动到该暂存区的取放料高点,旋转轴再回原点或待机点。
//验证旋转轴位置 TODO
......@@ -295,12 +302,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.IR07_ClampRelax);
LogInfo($"复位{MoveInfo.SLog}:夹爪气缸放松");
ClampRelax(MoveInfo, MoveInfo.MoveParam.PosInfo.barcode);
UpdownAxis.AbsMove(MoveInfo, Config.Updown_P1, Config.Updown_P1_Speed);
}
else if (MoveInfo.IsStep(StepEnum.IR07_ClampRelax))
{
MoveInfo.NextMoveStep(StepEnum.IR08_WaitBatchMove);
LogInfo($"复位{MoveInfo.SLog}:等待左右批量轴模块复位完成");
MiddleAxis.AbsMove(MoveInfo, Config.Middle_P2_ATake, Config.Middle_P2_Speed);
}
else if (MoveInfo.IsStep(StepEnum.IR08_WaitBatchMove))
......@@ -308,6 +317,7 @@ namespace OnlineStore.DeviceLibrary
if ((BatchMove_A.MoveInfo.MoveType.Equals(MoveType.Reset).Equals(false))
&& (BatchMove_B.MoveInfo.MoveType.Equals(MoveType.Reset).Equals(false)))
{
ClampRelax(MoveInfo, MoveInfo.MoveParam.PosInfo.barcode);
LogInfo("复位完成");
runStatus = RunStatus.Runing;
MoveInfo.EndMove();
......@@ -421,19 +431,20 @@ namespace OnlineStore.DeviceLibrary
}
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
//若左侧或右侧在等待扫码结束的状态,需要开始去取料
foreach (BatchMoveBean moveBean in BatchMoveList)
{
if (moveBean.MoveInfo.MoveType.Equals(MoveType.InStore) && moveBean.MoveInfo.IsStep(StepEnum.IB13_ScanOK))
{
LogInfo(moveBean.Name + "开始取料:" + moveBean.GetInstoreParam().PosInfo.ToStr());
StartInstore(moveBean.GetInstoreParam());
break;
}
}
}
//if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
//{
// return;//**
// //若左侧或右侧在等待扫码结束的状态,需要开始去取料
// foreach (BatchMoveBean moveBean in BatchMoveList)
// {
// if (moveBean.MoveInfo.MoveType.Equals(MoveType.InStore) && moveBean.MoveInfo.IsStep(StepEnum.IB13_ScanOK))
// {
// LogInfo(moveBean.Name + "开始取料:" + moveBean.GetInstoreParam().PosInfo.ToStr());
// StartInstore(moveBean.GetInstoreParam());
// break;
// }
// }
//}
}
foreach (BatchMoveBean moveBean in BatchMoveList)
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Obfuscar.2.2.40\build\obfuscar.props" Condition="Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -13,6 +14,8 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -114,4 +117,10 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Obfuscar.2.2.40\build\obfuscar.props'))" />
</Target>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net461" />
<package id="Obfuscar" version="2.2.40" targetFramework="net48" developmentDependency="true" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Obfuscar.2.2.40\build\obfuscar.props" Condition="Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -12,6 +13,8 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -75,6 +78,12 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Obfuscar.2.2.40\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Obfuscar.2.2.40\build\obfuscar.props'))" />
</Target>
<!-- 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.
<Target Name="BeforeBuild">
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net40" requireReinstallation="true" />
<package id="Obfuscar" version="2.2.40" targetFramework="net48" developmentDependency="true" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/XLR-SO908.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<file value="logs/XLR-SO908.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
<file value="logs/rfid/TheRFID-line.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<file value="logs/rfid/TheRFID-line.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="Rmaxis" type="log4net.Appender.RollingFileAppender">
<file value="logs/rmaix/Rmaxis-line.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<file value="logs/rmaix/Rmaxis-line.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n"/>
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<logger name="RollingLogFileAppender">
<level value="Info"/>
<appender-ref ref="RollingLogFileAppender"/>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="TheRFID">
<level value="Info"/>
<appender-ref ref="TheRFID"/>
<level value="Info" />
<appender-ref ref="TheRFID" />
</logger>
<logger name="Rmaxis">
<level value="Info"/>
<appender-ref ref="Rmaxis"/>
<level value="Info" />
<appender-ref ref="Rmaxis" />
</logger>
<!--<root>
<level value="Info" />
......@@ -52,13 +52,13 @@
</root>-->
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0"/>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
......
......@@ -80,8 +80,8 @@ namespace OnlineStore.XLRStore
{
formLineStatus(false);
string title = ConfigAppSettings.GetValue(Setting_Init.App_Title);
this.Text = title;
this.notifyIcon1.Text = title;
this.Text = title + " - 设备维护版";
this.notifyIcon1.Text = title + " - 设备维护版";
int autoValue = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
StoreBean = StoreManager.XLRStore;
if (StoreBean == null)
......
......@@ -54,6 +54,15 @@ namespace OnlineStore.XLRStore
[STAThread]
static void Main(string[] Args)
{
// 创建一个新的事件源
if (!EventLog.SourceExists("XLRStore"))
{
// 如果不存在,则创建一个新的事件源
EventLog.CreateEventSource("XLRStore", "Application");
}
// 使用类型名来限定静态方法WriteEntry
EventLog.WriteEntry("XLRStore", "启动", EventLogEntryType.Information);
//string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600";
//string r = CodeManager.ReplaceCode(code);
......@@ -65,7 +74,7 @@ namespace OnlineStore.XLRStore
Process currentproc = Process.GetCurrentProcess();
Process[] processcollection = Process.GetProcessesByName(currentproc.ProcessName.Replace(".vshost", string.Empty));
// 该程序已经运行,
//PosIDManger.SaveToFile();
bool isShow = false;
if (processcollection.Length >= 1)
{
......@@ -100,6 +109,7 @@ namespace OnlineStore.XLRStore
{
System.Net.ServicePointManager.DefaultConnectionLimit = 512;
XmlConfigurator.Configure();
LogUtil.info("程序启动");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ManagerUtil.Init();
......
......@@ -214,6 +214,12 @@
<Compile Include="useControl\ClampJawControl.Designer.cs">
<DependentUpon>ClampJawControl.cs</DependentUpon>
</Compile>
<Compile Include="useControl\CT.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="useControl\CT.Designer.cs">
<DependentUpon>CT.cs</DependentUpon>
</Compile>
<Compile Include="useControl\ReelDataControl.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -295,6 +301,9 @@
<EmbeddedResource Include="useControl\ClampJawControl.resx">
<DependentUpon>ClampJawControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="useControl\CT.resx">
<DependentUpon>CT.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="useControl\ReelDataControl.resx">
<DependentUpon>ReelDataControl.cs</DependentUpon>
</EmbeddedResource>
......@@ -402,8 +411,10 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"$(Obfuscar)" obfuscar.xml</PostBuildEvent>
<PropertyGroup>
<PostBuildEvent>"$(Obfuscar)" obfuscar.xml
rem copy /y $(TargetDir)Obfuscator_Output\$(TargetFileName) $(TargetDir)$(TargetFileName)
rem copy /y $(TargetDir)Obfuscator_Output\DeviceLibrary.dll $(TargetDir)DeviceLibrary.dll</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
......
......@@ -191,6 +191,7 @@
this.label4 = new System.Windows.Forms.Label();
this.btnToPosPage = new System.Windows.Forms.Button();
this.groupBox18 = new System.Windows.Forms.GroupBox();
this.btn_outin = new System.Windows.Forms.Button();
this.btnOutstoreTest = new System.Windows.Forms.Button();
this.btnInstoreTest = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
......@@ -571,7 +572,7 @@
this.tabPage5.Location = new System.Drawing.Point(4, 26);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(1637, 350);
this.tabPage5.Size = new System.Drawing.Size(1637, 352);
this.tabPage5.TabIndex = 1;
this.tabPage5.Text = "A面移栽";
this.tabPage5.UseVisualStyleBackColor = true;
......@@ -1292,7 +1293,7 @@
this.tabPage3.Controls.Add(this.tableLayoutPanel3);
this.tabPage3.Location = new System.Drawing.Point(4, 26);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(990, 270);
this.tabPage3.Size = new System.Drawing.Size(990, 269);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "抽屉信号";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -1311,7 +1312,7 @@
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(990, 270);
this.tableLayoutPanel3.Size = new System.Drawing.Size(990, 269);
this.tableLayoutPanel3.TabIndex = 7;
//
// groupBox22
......@@ -1332,9 +1333,9 @@
this.groupBox22.Controls.Add(this.Row_Check_7);
this.groupBox22.Controls.Add(this.Row_Check_8);
this.groupBox22.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox22.Location = new System.Drawing.Point(3, 183);
this.groupBox22.Location = new System.Drawing.Point(3, 181);
this.groupBox22.Name = "groupBox22";
this.groupBox22.Size = new System.Drawing.Size(984, 84);
this.groupBox22.Size = new System.Drawing.Size(984, 85);
this.groupBox22.TabIndex = 2;
this.groupBox22.TabStop = false;
this.groupBox22.Text = "层信号";
......@@ -1484,9 +1485,9 @@
this.groupBox21.Controls.Add(this.Column_Check_B1);
this.groupBox21.Controls.Add(this.BHorizontal_Check);
this.groupBox21.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox21.Location = new System.Drawing.Point(3, 93);
this.groupBox21.Location = new System.Drawing.Point(3, 92);
this.groupBox21.Name = "groupBox21";
this.groupBox21.Size = new System.Drawing.Size(984, 84);
this.groupBox21.Size = new System.Drawing.Size(984, 83);
this.groupBox21.TabIndex = 1;
this.groupBox21.TabStop = false;
this.groupBox21.Text = "B面信号";
......@@ -1566,7 +1567,7 @@
this.groupBox20.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox20.Location = new System.Drawing.Point(3, 3);
this.groupBox20.Name = "groupBox20";
this.groupBox20.Size = new System.Drawing.Size(984, 84);
this.groupBox20.Size = new System.Drawing.Size(984, 83);
this.groupBox20.TabIndex = 0;
this.groupBox20.TabStop = false;
this.groupBox20.Text = "A面信号";
......@@ -1639,7 +1640,7 @@
this.tabPage7.Controls.Add(this.groupBox25);
this.tabPage7.Location = new System.Drawing.Point(4, 26);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Size = new System.Drawing.Size(990, 270);
this.tabPage7.Size = new System.Drawing.Size(990, 269);
this.tabPage7.TabIndex = 3;
this.tabPage7.Text = "参数配置";
this.tabPage7.UseVisualStyleBackColor = true;
......@@ -1861,6 +1862,7 @@
//
// groupBox18
//
this.groupBox18.Controls.Add(this.btn_outin);
this.groupBox18.Controls.Add(this.btnOutstoreTest);
this.groupBox18.Controls.Add(this.btnInstoreTest);
this.groupBox18.Controls.Add(this.label2);
......@@ -1874,6 +1876,17 @@
this.groupBox18.TabStop = false;
this.groupBox18.Text = "库位信息操作";
//
// btn_outin
//
this.btn_outin.Location = new System.Drawing.Point(238, 20);
this.btn_outin.Name = "btn_outin";
this.btn_outin.Size = new System.Drawing.Size(136, 32);
this.btn_outin.TabIndex = 15;
this.btn_outin.Text = "出入";
this.btn_outin.UseVisualStyleBackColor = true;
this.btn_outin.Visible = false;
this.btn_outin.Click += new System.EventHandler(this.btn_outin_Click);
//
// btnOutstoreTest
//
this.btnOutstoreTest.Location = new System.Drawing.Point(238, 68);
......@@ -2173,5 +2186,6 @@
private System.Windows.Forms.GroupBox groupBox27;
private System.Windows.Forms.TextBox txtPullAxis_Inout_CamB;
private System.Windows.Forms.Button btnInOutAxis_B_Cam;
private System.Windows.Forms.Button btn_outin;
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using OnlineStore.LoadCSVLibrary;
using System.IO;
using CodeLibrary;
namespace OnlineStore.XLRStore
{
......@@ -28,6 +29,10 @@ namespace OnlineStore.XLRStore
private void FrmAxisMove_Load(object sender, EventArgs e)
{
boxEquip = StoreManager.XLRStore.boxEquip;
//for (int i = 1; i <= 12; i++)
//{
// combBoxPosIds.Items.Add(i);
//}
combBoxPosIds.Items.AddRange(boxEquip.PositionNumList.ToArray());
combBoxPosIds.SelectedIndexChanged += CombBoxPosIds_SelectedIndexChanged;
InitShieldColData();
......@@ -719,9 +724,37 @@ namespace OnlineStore.XLRStore
/// <param name="e"></param>
private void btnInstoreTest_Click(object sender, EventArgs e)
{
InOutParam inoutParam = new InOutParam(new InOutPosInfo("TestIn", posId));
boxEquip.StartInstore(inoutParam);
//InOutParam inoutParam = new InOutParam(new InOutPosInfo("TestIn", posId));
//boxEquip.StartInstore(inoutParam);
//int drawerindex = int.Parse(cb_poslist.SelectedItem.ToString());
//PosIDManger.GetDarwerPoslist(drawerindex, out string apos, out string bpos, out string aout, out string bout);
LogUtil.info("手动入库测试...");
string apos = PosIDManger.APosList.DRAWER[12][0].PosID;
string aout = PosIDManger.APosList.DRAWER[12][1].PosID;
string bpos = PosIDManger.BPosList.DRAWER[12][0].PosID;
string bout = PosIDManger.BPosList.DRAWER[12][1].PosID;
LogUtil.info($"工作库位: apos:{apos}, bpos:{bpos}, aout:{aout}, bout:{bout}");
BufferDataManager.AInStoreInfo = new InOutPosInfo("STEST", apos, 7, 8);
BufferDataManager.BInStoreInfo = new InOutPosInfo("STEST", bpos, 7, 8);
var inp = new InOutParam() { PosInfo = BufferDataManager.AInStoreInfo, PosInfoBack = BufferDataManager.BInStoreInfo };
if (!string.IsNullOrEmpty(aout))
inp.AOutPosInfo = new InOutPosInfo("STEST", aout, 7, 8);
if (!string.IsNullOrEmpty(bout))
inp.BOutPosInfo = new InOutPosInfo("STEST", bout, 7, 8);
if (!StoreManager.XLRStore.boxEquip.StartInstore(inp))
{
MessageBox.Show("启动失败");
return;
}
}
/// <summary>
/// 出库测试
......@@ -730,6 +763,8 @@ namespace OnlineStore.XLRStore
/// <param name="e"></param>
private void btnOutstoreTest_Click(object sender, EventArgs e)
{
StoreManager.XLRStore.StopRun();
return;
InOutParam inoutParam = new InOutParam(new InOutPosInfo("TestOut", posId));
boxEquip.StartExecuctOut(inoutParam);
LogUtil.info("手动出库测试[posId]...");
......@@ -907,5 +942,37 @@ namespace OnlineStore.XLRStore
{
AxisABSMove(boxEquip.PullAxis_Inout, txtPullAxis_Inout_CamB, boxEquip.Config.PullAxis_Inout_P1_Speed);
}
private void btn_outin_Click(object sender, EventArgs e)
{
var selindex = 2;
LogUtil.info("手动入库测试...");
string apos = PosIDManger.APosList.DRAWER[selindex][0].PosID;
string aout = PosIDManger.APosList.DRAWER[selindex][1].PosID;
string bpos = PosIDManger.BPosList.DRAWER[selindex][0].PosID;
string bout = PosIDManger.BPosList.DRAWER[selindex][1].PosID;
LogUtil.info($"工作库位: apos:{apos}, bpos:{bpos}, aout:{aout}, bout:{bout}");
BufferDataManager.AInStoreInfo = new InOutPosInfo("STEST", apos, 7, 8);
BufferDataManager.BInStoreInfo = new InOutPosInfo("STEST", bpos, 7, 8);
var inp = new InOutParam() { PosInfo = BufferDataManager.AInStoreInfo, PosInfoBack = BufferDataManager.BInStoreInfo };
if (!string.IsNullOrEmpty(aout))
inp.AOutPosInfo = new InOutPosInfo("STEST", aout, 7, 8);
if (!string.IsNullOrEmpty(bout))
inp.BOutPosInfo = new InOutPosInfo("STEST", bout, 7, 8);
if (!StoreManager.XLRStore.boxEquip.StartInstore(inp))
{
MessageBox.Show("启动失败");
return;
}
else
{
StoreManager.XLRStore.boxEquip.MoveInfo.NextMoveStep(StepEnum.SO_15_ToBufferArea);
LogUtil.info($"直接前往缓存放料");
}
}
}
}
......@@ -16,6 +16,7 @@ using System.Reflection;
using UserFromControl;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
using System.Security.Cryptography;
namespace OnlineStore.XLRStore
......@@ -50,6 +51,14 @@ namespace OnlineStore.XLRStore
boxBean.camera_event += BoxBean_camera_event;
btnDebugAxis.Enabled = !boxBean.IsDebug;
IsLoad = true;
cb_poslist.Items.Clear();
for (int i = 1; i <= 13; i++)
{
cb_poslist.Items.Add(i);
}
//cb_poslist.Items.Add(20);
cb_poslist.SelectedIndex = 0;
}
/// <summary>
/// 监控相机采集图像事件
......@@ -580,6 +589,126 @@ namespace OnlineStore.XLRStore
{
boxBean.StopRecord();
}
private void btn_auto_Click(object sender, EventArgs e)
{
if (StoreManager.XLRStore.runStatus != RunStatus.Runing)
{
MessageBox.Show("请先启动设备, 并等待回原完成");
return;
}
if (StoreManager.XLRStore.boxEquip.IOValue(IO_Type.UpperArea_Check_A).Equals(IO_VALUE.HIGH)
&& StoreManager.XLRStore.boxEquip.IOValue(IO_Type.UpperArea_Check_B).Equals(IO_VALUE.HIGH))
{
MessageBox.Show("请在缓存位上放上料盘");
return;
}
int drawerindex =int.Parse(cb_poslist.SelectedItem.ToString());
string apos="", bpos = "", aout = "", bout = "";
//if (drawerindex == 20)
//{
// apos = "01AA15060420";
// bpos = "01BB14050401";
//}
//else
PosIDManger.GetDarwerPoslist(drawerindex, out apos, out bpos, out aout, out bout);
if (string.IsNullOrEmpty(apos))
{
MessageBox.Show($"位置{drawerindex} A侧没有可用库位");
return;
}
if (string.IsNullOrEmpty(bpos))
{
MessageBox.Show($"位置{drawerindex} B侧没有可用库位");
return;
}
if (PosIDManger.GetPosHasReel(apos))
{
MessageBox.Show($"库位{apos} 已有物料,不能入库");
return;
}
if (PosIDManger.GetPosHasReel(bpos))
{
MessageBox.Show($"库位{bpos} 已有物料,不能入库");
return;
}
LogUtil.info($"工作库位: apos:{apos}, bpos:{bpos}, aout:{aout}, bout:{bout}");
InOutParam inp;
if (apos.IndexOf("AA") > 0)
{
BufferDataManager.AInStoreInfo = new InOutPosInfo("STEST", apos, 7, 8);
BufferDataManager.BInStoreInfo = new InOutPosInfo("STEST", bpos, 7, 8);
inp = new InOutParam() { PosInfo = BufferDataManager.AInStoreInfo, PosInfoBack = BufferDataManager.BInStoreInfo };
if (!string.IsNullOrEmpty(aout))
inp.AOutPosInfo = new InOutPosInfo("STEST", aout, 7, 8);
if (!string.IsNullOrEmpty(bout))
inp.BOutPosInfo = new InOutPosInfo("STEST", bout, 7, 8);
}
else
{
BufferDataManager.AInStoreInfo = new InOutPosInfo("STEST", bpos, 7, 8);
BufferDataManager.BInStoreInfo = new InOutPosInfo("STEST", apos, 7, 8);
inp = new InOutParam() { PosInfo = BufferDataManager.BInStoreInfo, PosInfoBack = BufferDataManager.AInStoreInfo };
if (!string.IsNullOrEmpty(bout))
inp.AOutPosInfo = new InOutPosInfo("STEST", bout, 7, 8);
if (!string.IsNullOrEmpty(aout))
inp.BOutPosInfo = new InOutPosInfo("STEST", aout, 7, 8);
}
if (!StoreManager.XLRStore.boxEquip.StartInstore(inp)) {
MessageBox.Show("启动失败");
return;
}
//LogUtil.info("手动入库测试...");
//string apos = PosIDManger.APosList.DRAWER[selindex][0].PosID;
//string aout = PosIDManger.APosList.DRAWER[selindex][1].PosID;
//string bpos = PosIDManger.BPosList.DRAWER[selindex][0].PosID;
//string bout = PosIDManger.BPosList.DRAWER[selindex][1].PosID;
//LogUtil.info($"工作库位: apos:{apos}, bpos:{bpos}, aout:{aout}, bout:{bout}");
//BufferDataManager.AInStoreInfo = new InOutPosInfo("STEST", apos, 7, 8);
//BufferDataManager.BInStoreInfo = new InOutPosInfo("STEST", bpos, 7, 8);
//var inp = new InOutParam() { PosInfo = BufferDataManager.AInStoreInfo, PosInfoBack = BufferDataManager.BInStoreInfo };
//if (!string.IsNullOrEmpty(aout))
// inp.AOutPosInfo = new InOutPosInfo("STEST", aout, 7, 8);
//if (!string.IsNullOrEmpty(bout))
// inp.BOutPosInfo = new InOutPosInfo("STEST", bout, 7, 8);
//if (!StoreManager.XLRStore.boxEquip.StartInstore(inp))
//{
// MessageBox.Show("启动失败");
// return;
//}
//else
//{
// StoreManager.XLRStore.boxEquip.MoveInfo.NextMoveStep(StepEnum.SO_15_ToBufferArea);
// LogUtil.info($"直接前往缓存放料");
//}
}
private void btn_in_Click(object sender, EventArgs e)
{
}
private void btn_out_Click(object sender, EventArgs e)
{
}
private void chbMoveStop_CheckedChanged_1(object sender, EventArgs e)
{
}
}
}
......
......@@ -656,6 +656,11 @@ namespace OnlineStore.XLRStore
private void BtnInStoreTest_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
int startShelf = cmbInstoreShelf.SelectedIndex + 1;
string pos = cmbInstorePos.Text;
if (String.IsNullOrEmpty(pos))
......@@ -672,6 +677,11 @@ namespace OnlineStore.XLRStore
private void btnOutStoreTest_Click(object sender, EventArgs e)
{
if (!StoreManager.XLRStore.boxEquip.IsServerConnected)
{
MessageBox.Show("等待服务器通讯");
return;
}
int startShelf = cmbOutShelf.SelectedIndex + 1;
string pos = cmbOutstorePos.Text;
if (String.IsNullOrEmpty(pos))
......@@ -818,9 +828,18 @@ namespace OnlineStore.XLRStore
}
#endregion
#endregion
private void btn_ct_Click(object sender, EventArgs e)
{
BoxPosition posiiton = CSVPositionReader<BoxPosition>.GetPositon(PosIDManger.APosList.DRAWER[1][0].PosID);
InOutParam param = new InOutParam(new InOutPosInfo("InstoreSTEST", posiiton.PositionNum, posiiton.BagHigh, posiiton.BagWidth));
param.ShelfType = 1;
LogUtil.info("点击 " + BtnInStoreTest.Text + " :料串[" + 1 + "]->" + param.PosInfo.ToStr());
inputEquip.StartInstore(param);
}
}
}
......
......@@ -64,6 +64,7 @@
this.lblAxisPrfMode = new System.Windows.Forms.Label();
this.label50 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.btnIOJog = new System.Windows.Forms.Button();
this.btnEndHome = new System.Windows.Forms.Button();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.btnAxisStop = new System.Windows.Forms.Button();
......@@ -90,7 +91,6 @@
this.txtAxisDeviceName = new System.Windows.Forms.TextBox();
this.lblServerOn = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnIOJog = new System.Windows.Forms.Button();
this.groupAxis.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panel1.SuspendLayout();
......@@ -510,6 +510,17 @@
this.panel1.Size = new System.Drawing.Size(469, 236);
this.panel1.TabIndex = 219;
//
// btnIOJog
//
this.btnIOJog.BackColor = System.Drawing.Color.Red;
this.btnIOJog.Location = new System.Drawing.Point(13, 188);
this.btnIOJog.Name = "btnIOJog";
this.btnIOJog.Size = new System.Drawing.Size(134, 37);
this.btnIOJog.TabIndex = 335;
this.btnIOJog.Text = "IO点动";
this.btnIOJog.UseVisualStyleBackColor = false;
this.btnIOJog.Click += new System.EventHandler(this.btnIOJog_Click);
//
// btnEndHome
//
this.btnEndHome.BackColor = System.Drawing.SystemColors.Control;
......@@ -585,7 +596,7 @@
this.btnDelMove.BackColor = System.Drawing.SystemColors.Control;
this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(312, 181);
this.btnDelMove.Location = new System.Drawing.Point(312, 191);
this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(146, 45);
this.btnDelMove.TabIndex = 332;
......@@ -614,9 +625,9 @@
//
this.txtMiddleSpeed.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtMiddleSpeed.Location = new System.Drawing.Point(83, 156);
this.txtMiddleSpeed.MaxLength = 6;
this.txtMiddleSpeed.MaxLength = 8;
this.txtMiddleSpeed.Name = "txtMiddleSpeed";
this.txtMiddleSpeed.Size = new System.Drawing.Size(73, 26);
this.txtMiddleSpeed.Size = new System.Drawing.Size(141, 26);
this.txtMiddleSpeed.TabIndex = 331;
this.txtMiddleSpeed.Text = "100";
//
......@@ -641,7 +652,7 @@
this.btnAddMove.BackColor = System.Drawing.SystemColors.Control;
this.btnAddMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(160, 180);
this.btnAddMove.Location = new System.Drawing.Point(160, 191);
this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(146, 45);
this.btnAddMove.TabIndex = 330;
......@@ -840,17 +851,6 @@
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnIOJog
//
this.btnIOJog.BackColor = System.Drawing.Color.Red;
this.btnIOJog.Location = new System.Drawing.Point(13, 188);
this.btnIOJog.Name = "btnIOJog";
this.btnIOJog.Size = new System.Drawing.Size(134, 37);
this.btnIOJog.TabIndex = 335;
this.btnIOJog.Text = "IO点动";
this.btnIOJog.UseVisualStyleBackColor = false;
this.btnIOJog.Click += new System.EventHandler(this.btnIOJog_Click);
//
// AxisMoveControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!