Commit b0fa6453 刘韬

完善翻译

1 个父辈 e81e9bdf
正在显示 51 个修改的文件 包含 974 行增加189 行删除
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -43,6 +45,9 @@ ...@@ -43,6 +45,9 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
...@@ -56,6 +61,7 @@ ...@@ -56,6 +61,7 @@
<Compile Include="CodeResourceControl.cs" /> <Compile Include="CodeResourceControl.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Init.cs" /> <Compile Include="Setting_Init.cs" />
<Compile Include="SQLiteHelper.cs" />
<Compile Include="util\ConfigAppSettings.cs" /> <Compile Include="util\ConfigAppSettings.cs" />
<Compile Include="util\FormUtil.cs" /> <Compile Include="util\FormUtil.cs" />
<Compile Include="util\JsonHelper.cs" /> <Compile Include="util\JsonHelper.cs" />
...@@ -73,7 +79,17 @@ ...@@ -73,7 +79,17 @@
<ItemGroup> <ItemGroup>
<WCFMetadata Include="Service References\" /> <WCFMetadata Include="Service References\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
......
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SQLite;
namespace OnlineStore.Common
{
public class SQLiteHelper
{
private static string connectionString = string.Empty;
/// <summary>
/// 根据数据源、密码、版本号设置连接字符串。
/// </summary>
/// <param name="datasource">数据源。</param>
/// <param name="password">密码。</param>
/// <param name="version">版本号(缺省为3)。</param>
public static void SetConnectionString(string datasource, int version = 3)
{
connectionString = string.Format("Data Source={0};Version={1};",
datasource, version);
}
/// <summary>
/// 创建一个数据库文件。如果存在同名数据库文件,则会覆盖。
/// </summary>
/// <param name="dbName">数据库文件名。为null或空串时不创建。</param>
/// <param name="password">(可选)数据库密码,默认为空。</param>
/// <exception cref="Exception"></exception>
public static void CreateDB(string dbName)
{
if (!string.IsNullOrEmpty(dbName))
{
try { SQLiteConnection.CreateFile(dbName); }
catch (Exception) { throw; }
}
}
/// <summary>
/// 对SQLite数据库执行增删改操作,返回受影响的行数。
/// </summary>
/// <param name="sql">要执行的增删改的SQL语句。</param>
/// <param name="parameters">执行增删改语句所需要的参数,参数必须以它们在SQL语句中的顺序为准。</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public int ExecuteNonQuery(string sql, params SQLiteParameter[] parameters)
{
int affectedRows = 0;
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand command = new SQLiteCommand(connection))
{
try
{
connection.Open();
command.CommandText = sql;
if (parameters.Length != 0)
{
command.Parameters.AddRange(parameters);
}
affectedRows = command.ExecuteNonQuery();
}
catch (Exception) { throw; }
}
}
return affectedRows;
}
/// <summary>
/// 批量处理数据操作语句。
/// </summary>
/// <param name="list">SQL语句集合。</param>
/// <exception cref="Exception"></exception>
public void ExecuteNonQueryBatch(List<KeyValuePair<string, SQLiteParameter[]>> list)
{
using (SQLiteConnection conn = new SQLiteConnection(connectionString))
{
try { conn.Open(); }
catch { throw; }
using (SQLiteTransaction tran = conn.BeginTransaction())
{
using (SQLiteCommand cmd = new SQLiteCommand(conn))
{
try
{
foreach (var item in list)
{
cmd.CommandText = item.Key;
if (item.Value != null)
{
cmd.Parameters.AddRange(item.Value);
}
cmd.ExecuteNonQuery();
}
tran.Commit();
}
catch (Exception) { tran.Rollback(); throw; }
}
}
}
}
/// <summary>
/// 执行查询语句,并返回第一个结果。
/// </summary>
/// <param name="sql">查询语句。</param>
/// <returns>查询结果。</returns>
/// <exception cref="Exception"></exception>
public object ExecuteScalar(string sql, params SQLiteParameter[] parameters)
{
using (SQLiteConnection conn = new SQLiteConnection(connectionString))
{
using (SQLiteCommand cmd = new SQLiteCommand(conn))
{
try
{
conn.Open();
cmd.CommandText = sql;
if (parameters.Length != 0)
{
cmd.Parameters.AddRange(parameters);
}
return cmd.ExecuteScalar();
}
catch (Exception) { throw; }
}
}
}
/// <summary>
/// 执行一个查询语句,返回一个包含查询结果的DataTable。
/// </summary>
/// <param name="sql">要执行的查询语句。</param>
/// <param name="parameters">执行SQL查询语句所需要的参数,参数必须以它们在SQL语句中的顺序为准。</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public DataTable ExecuteQuery(string sql, params SQLiteParameter[] parameters)
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
using (SQLiteCommand command = new SQLiteCommand(sql, connection))
{
if (parameters.Length != 0)
{
command.Parameters.AddRange(parameters);
}
SQLiteDataAdapter adapter = new SQLiteDataAdapter(command);
DataTable data = new DataTable();
try { adapter.Fill(data); }
catch (Exception) { throw; }
return data;
}
}
}
/// <summary>
/// 执行一个查询语句,返回一个关联的SQLiteDataReader实例。
/// </summary>
/// <param name="sql">要执行的查询语句。</param>
/// <param name="parameters">执行SQL查询语句所需要的参数,参数必须以它们在SQL语句中的顺序为准。</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public SQLiteDataReader ExecuteReader(string sql, params SQLiteParameter[] parameters)
{
SQLiteConnection connection = new SQLiteConnection(connectionString);
SQLiteCommand command = new SQLiteCommand(sql, connection);
try
{
if (parameters.Length != 0)
{
command.Parameters.AddRange(parameters);
}
connection.Open();
return command.ExecuteReader(CommandBehavior.CloseConnection);
}
catch (Exception) { throw; }
}
/// <summary>
/// 查询数据库中的所有数据类型信息。
/// </summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public DataTable GetSchema()
{
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
{
try
{
connection.Open();
return connection.GetSchema("TABLES");
}
catch (Exception) { throw; }
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.114.0" targetFramework="net461" />
<package id="System.Data.SQLite.Core" version="1.0.114.3" targetFramework="net461" />
</packages>
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,8 @@ using System.Threading.Tasks; ...@@ -9,6 +9,8 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class FilterMachine : MachineBase, IRobot public partial class FilterMachine : MachineBase, IRobot
{ {
private Config_Filter _config; private Config_Filter _config;
...@@ -21,7 +23,7 @@ namespace DeviceLibrary ...@@ -21,7 +23,7 @@ namespace DeviceLibrary
_config = value; _config = value;
} }
} }
public override string DeviceName { get; set; } = "分盘线"; public override string DeviceName { get; } = "分盘线";
public bool canRunning { get; set; } public bool canRunning { get; set; }
public bool isBusy { get; set; } public bool isBusy { get; set; }
public bool isAlarm { get; set; } public bool isAlarm { get; set; }
...@@ -105,22 +107,22 @@ namespace DeviceLibrary ...@@ -105,22 +107,22 @@ namespace DeviceLibrary
bool ok = true; bool ok = true;
if (alarmType == AlarmType.SuddenStop) if (alarmType == AlarmType.SuddenStop)
{ {
Msg.add("系统需要重置", MsgLevel.warning); Msg.add(crc.GetString("system_need_reset","系统需要重置"), MsgLevel.warning);
ok = false; ok = false;
} }
if (NGBox_Count >= Config.NG_BOX_MAXCOUNT) { if (NGBox_Count >= Config.NG_BOX_MAXCOUNT) {
Msg.add("NG箱已满", MsgLevel.warning); Msg.add(crc.GetString("ng_box_full", "NG箱已满"), MsgLevel.warning);
ok = false; ok = false;
} }
if (MSDBox_Count >= Config.MSD_BOX_MAXCOUNT) if (MSDBox_Count >= Config.MSD_BOX_MAXCOUNT)
{ {
Msg.add("MSD箱已满", MsgLevel.warning); Msg.add(crc.GetString("msd_box_full", "MSD箱已满"), MsgLevel.warning);
ok = false; ok = false;
} }
if (PaperBox_Count >= Config.PAPER_BOX_MAXCOUNT) if (PaperBox_Count >= Config.PAPER_BOX_MAXCOUNT)
{ {
Msg.add("Paper箱已满", MsgLevel.warning); Msg.add(crc.GetString("paper_box_full", "Paper箱已满"), MsgLevel.warning);
ok = false; ok = false;
} }
...@@ -134,7 +136,7 @@ namespace DeviceLibrary ...@@ -134,7 +136,7 @@ namespace DeviceLibrary
{ {
if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1) if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1)
{ {
Msg.add($"{configMoveAxis.DeviceName}:运动报警", MsgLevel.warning); Msg.add(crc.GetString("axis_run_alert","{0}:运动报警", configMoveAxis.Explain), MsgLevel.warning);
ok = false; ok = false;
} }
} }
......
...@@ -6,6 +6,7 @@ using System.Threading.Tasks; ...@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class FilterMachine public partial class FilterMachine
{ {
public bool isWaitReel { get => MoveInfo.MoveStep == MoveStep.Filter_01_WaitReel; } public bool isWaitReel { get => MoveInfo.MoveStep == MoveStep.Filter_01_WaitReel; }
...@@ -34,6 +35,7 @@ namespace DeviceLibrary ...@@ -34,6 +35,7 @@ namespace DeviceLibrary
//MoveInfo.ReelParam.ReelDest = ReelDest.String; //MoveInfo.ReelParam.ReelDest = ReelDest.String;
if (MoveInfo.ReelParam.ReelDest == ReelDest.NG || MoveInfo.ReelParam.ReelDest == ReelDest.Unknow) if (MoveInfo.ReelParam.ReelDest == ReelDest.NG || MoveInfo.ReelParam.ReelDest == ReelDest.Unknow)
{ {
RobotManage.DefectiveCount++;
MoveInfo.NextMoveStep(MoveStep.Filter_10_NGReel_PushOut); MoveInfo.NextMoveStep(MoveStep.Filter_10_NGReel_PushOut);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
} }
...@@ -53,11 +55,11 @@ namespace DeviceLibrary ...@@ -53,11 +55,11 @@ namespace DeviceLibrary
} }
else if (IOValue(IO_Filter_Type.NG_TaryStop_Check).Equals(IO_VALUE.HIGH) && preReelParam == null) else if (IOValue(IO_Filter_Type.NG_TaryStop_Check).Equals(IO_VALUE.HIGH) && preReelParam == null)
{ {
Msg.add("分盘线等待料盘信息", MsgLevel.warning); Msg.add(crc.GetString("wait_reelinfo", "{0}等待料盘信息", DeviceName), MsgLevel.warning);
} }
else else
{ {
Msg.add($"等待进入料盘", MsgLevel.info); Msg.add(crc.GetString("wait_reel_entry", "{0}等待料盘进入", DeviceName), MsgLevel.info);
} }
break; break;
///NG料送出 ///NG料送出
...@@ -146,7 +148,7 @@ namespace DeviceLibrary ...@@ -146,7 +148,7 @@ namespace DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(4000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(4000));
} }
else if (MoveInfo.IsTimeOut(10)) { else if (MoveInfo.IsTimeOut(10)) {
Msg.add("等待T1机构空闲", MsgLevel.warning); Msg.add(crc.GetString("wait_xx_free","等待{0}空闲", RobotManage.t1Machine.DeviceName), MsgLevel.warning);
} }
break; break;
case MoveStep.Filter_42_Reel_through_Wait: case MoveStep.Filter_42_Reel_through_Wait:
......
...@@ -143,7 +143,7 @@ namespace DeviceLibrary ...@@ -143,7 +143,7 @@ namespace DeviceLibrary
Point qrcenter = Label_Pix_Point; Point qrcenter = Label_Pix_Point;
//string file = @"D:\853string\Image_20210604173619489.bmp"; //string file = @"D:\853string\Image_20210604173619489.bmp";
//图像剪切范围矩形 //图像剪切范围矩形
var orgCrop = Rectangle.Inflate(new Rectangle(qrcenter, new Size(1, 1)), 450, 450); var orgCrop = Rectangle.Inflate(new Rectangle(qrcenter, new Size(1, 1)), 510, 510);
//计算剪切后的二维码中心坐标点 //计算剪切后的二维码中心坐标点
qrcenter.X = qrcenter.X - orgCrop.X; qrcenter.X = qrcenter.X - orgCrop.X;
qrcenter.Y = qrcenter.Y - orgCrop.Y; qrcenter.Y = qrcenter.Y - orgCrop.Y;
...@@ -174,6 +174,13 @@ namespace DeviceLibrary ...@@ -174,6 +174,13 @@ namespace DeviceLibrary
newlist.Add(t); newlist.Add(t);
MoveInfo.log($"s1:{s1}, s2:{s2} , {t.Text}"); MoveInfo.log($"s1:{s1}, s2:{s2} , {t.Text}");
} }
if (s1 > 0.9)
{
newlist.Clear();
newlist.Add(t);
MoveInfo.log($"s1:{s1}>0.93 , {t.Text}");
break;
}
} }
//List<Point> RightPoint //List<Point> RightPoint
Point labelPoint = Point.Empty; Point labelPoint = Point.Empty;
...@@ -246,7 +253,7 @@ namespace DeviceLibrary ...@@ -246,7 +253,7 @@ namespace DeviceLibrary
//换算为剪切前的像素位置 //换算为剪切前的像素位置
labelPoint.Offset(orgCrop.X, orgCrop.Y); labelPoint.Offset(orgCrop.X, orgCrop.Y);
//计算贴标像素点位与图像中心点的差 //计算贴标像素点位与图像中心点的差
Point p2 = new Point(labelPoint.X - Config.Right_Batch_X, labelPoint.Y - Config.Right_Batch_Y); Point p2 = new Point(labelPoint.X - Config.Right_Batch_X, labelPoint.Y - Config.Right_Batch_Y);
//MoveInfo.log($"计算结果,Label_R_360:{Config.Label_R_360},贴标角度:{labelAngle},R轴:{labelAxisPos},贴标计算像素位置:{labelPoint},换算全图像素位置:{p1}"); //MoveInfo.log($"计算结果,Label_R_360:{Config.Label_R_360},贴标角度:{labelAngle},R轴:{labelAxisPos},贴标计算像素位置:{labelPoint},换算全图像素位置:{p1}");
......
...@@ -9,6 +9,7 @@ using System.Threading.Tasks; ...@@ -9,6 +9,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class LabelMachine : MachineBase, IRobot public partial class LabelMachine : MachineBase, IRobot
{ {
private Config_Label _config; private Config_Label _config;
...@@ -20,7 +21,7 @@ namespace DeviceLibrary ...@@ -20,7 +21,7 @@ namespace DeviceLibrary
_config = value; _config = value;
} }
} }
public override string DeviceName { get; set; } = "贴标机构"; public override string DeviceName { get; } = "贴标机构";
public bool canRunning { get; set; } public bool canRunning { get; set; }
public bool isBusy { get; set; } public bool isBusy { get; set; }
public bool isAlarm { get; set; } public bool isAlarm { get; set; }
...@@ -121,16 +122,16 @@ namespace DeviceLibrary ...@@ -121,16 +122,16 @@ namespace DeviceLibrary
public bool DeviceCheck() public bool DeviceCheck()
{ {
bool ok = true; bool ok = true;
if (IOValue(IO_Label_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOManager.GetDIValue("", 0, 45).Equals(IO_VALUE.LOW))
{ {
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add("急停中", MsgLevel.warning); Msg.add(crc.GetString("emergency_stop", "急停中"), MsgLevel.warning);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
else if (alarmType == AlarmType.SuddenStop) else if (alarmType == AlarmType.SuddenStop)
{ {
Msg.add("系统需要重置", MsgLevel.warning); Msg.add(crc.GetString("system_need_reset", "系统需要重置"), MsgLevel.warning);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
...@@ -147,7 +148,7 @@ namespace DeviceLibrary ...@@ -147,7 +148,7 @@ namespace DeviceLibrary
{ {
if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1) if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1)
{ {
Msg.add($"{configMoveAxis.Explain}:运动报警", MsgLevel.warning); Msg.add(crc.GetString("axis_run_alert", "{0}:运动报警", configMoveAxis.Explain), MsgLevel.warning);
ok = false; ok = false;
} }
} }
......
...@@ -10,6 +10,7 @@ using OnlineStore.Common; ...@@ -10,6 +10,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class LabelMachine public partial class LabelMachine
{ {
//保存贴标位置调试图像 //保存贴标位置调试图像
...@@ -77,18 +78,18 @@ namespace DeviceLibrary ...@@ -77,18 +78,18 @@ namespace DeviceLibrary
// MoveInfo.log("检测到料盘 超时NG:没有等到料盘信息"); // MoveInfo.log("检测到料盘 超时NG:没有等到料盘信息");
//} //}
else if (Tray_Check.Equals(IO_VALUE.HIGH)) { else if (Tray_Check.Equals(IO_VALUE.HIGH)) {
Msg.add($"已检测到料盘, 等待料盘数据信息到位", MsgLevel.info); Msg.add(crc.GetString("label_detect_reel_wait_reelinfo", "已检测到料盘, 等待料盘数据信息到位"), MsgLevel.info);
} }
else if (Label_TaryStop_Check.Equals(IO_VALUE.HIGH)) else if (Label_TaryStop_Check.Equals(IO_VALUE.HIGH))
{ {
Msg.add("贴标区有料未送出", MsgLevel.warning); Msg.add(crc.GetString("label_has_reel", "贴标区有料未送出"), MsgLevel.warning);
MoveInfo.log("贴标区有料未送出"); MoveInfo.log("贴标区有料未送出");
MoveInfo.NextMoveStep(MoveStep.Lbl_01_Wait_ATray); MoveInfo.NextMoveStep(MoveStep.Lbl_01_Wait_ATray);
} }
else else
{ {
Msg.add($"等待上料区进入料盘", MsgLevel.info); Msg.add(crc.GetString("wait_reel_entry", "{0}等待料盘进入", DeviceNameShow), MsgLevel.info);
MoveInfo.log("等待上料区进入料盘"); MoveInfo.log("等待上料区进入料盘");
MoveInfo.NextMoveStep(MoveStep.Lbl_01_Wait_ATray); MoveInfo.NextMoveStep(MoveStep.Lbl_01_Wait_ATray);
} }
...@@ -101,6 +102,7 @@ namespace DeviceLibrary ...@@ -101,6 +102,7 @@ namespace DeviceLibrary
CylinderMove(MoveInfo, IO_Label_Type.TrayStop_Down, IO_Label_Type.TrayStop_Up, IO_VALUE.HIGH); CylinderMove(MoveInfo, IO_Label_Type.TrayStop_Down, IO_Label_Type.TrayStop_Up, IO_VALUE.HIGH);
CylinderMove(null, IO_Label_Type.Label_Stop_Down, IO_Label_Type.Label_Stop_Up, IO_VALUE.HIGH); CylinderMove(null, IO_Label_Type.Label_Stop_Down, IO_Label_Type.Label_Stop_Up, IO_VALUE.HIGH);
MoveInfo.log("NG盘直接通过"); MoveInfo.log("NG盘直接通过");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
return; return;
} }
...@@ -163,7 +165,7 @@ namespace DeviceLibrary ...@@ -163,7 +165,7 @@ namespace DeviceLibrary
MoveInfo.log("线体1,2开始运行"); MoveInfo.log("线体1,2开始运行");
RobotManage.Line1.LineRun("label", 999, "Lbl_03_LineRun"); RobotManage.Line1.LineRun("label", 999, "Lbl_03_LineRun");
RobotManage.Line2.LineRun("label", 999, "Lbl_03_LineRun"); RobotManage.Line2.LineRun("label", 999, "Lbl_03_LineRun");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case MoveStep.Lbl_03_StopDown_and_wait: case MoveStep.Lbl_03_StopDown_and_wait:
MoveInfo.NextMoveStep(MoveStep.Lbl_04_LineStopWait); MoveInfo.NextMoveStep(MoveStep.Lbl_04_LineStopWait);
...@@ -188,8 +190,9 @@ namespace DeviceLibrary ...@@ -188,8 +190,9 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.Lbl05); MoveInfo.NextMoveStep(MoveStep.Lbl05);
WaitCheckLabeltype = WaitCheckLabeltypeE.None; WaitCheckLabeltype = WaitCheckLabeltypeE.None;
ScanTask2 = ScanCode2(); ScanTask2 = ScanCode2();
Task.Delay(1000).Wait();
CylinderMove(MoveInfo, IO_Label_Type.Label_Stop_Down, IO_Label_Type.Label_Stop_Up, IO_VALUE.HIGH); CylinderMove(MoveInfo, IO_Label_Type.Label_Stop_Down, IO_Label_Type.Label_Stop_Up, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
break; break;
case MoveStep.Lbl05: case MoveStep.Lbl05:
if (VacuumMoveInfo.MoveStep == MoveStep.LblVacuum_end) if (VacuumMoveInfo.MoveStep == MoveStep.LblVacuum_end)
...@@ -245,18 +248,20 @@ namespace DeviceLibrary ...@@ -245,18 +248,20 @@ namespace DeviceLibrary
case MoveStep.Lbl13: case MoveStep.Lbl13:
MoveInfo.NextMoveStep(MoveStep.Lbl_BeginOut); MoveInfo.NextMoveStep(MoveStep.Lbl_BeginOut);
Label_Z_Axis.AbsMove(null, Config.Label_Z_P2, Config.Label_Z_P2_speed); Label_Z_Axis.AbsMove(null, Config.Label_Z_P2, Config.Label_Z_P2_speed);
MoveInfo.ReelParam.LabelState = "Ok";
MoveInfo.log("取标气缸上升."); MoveInfo.log("取标气缸上升.");
break; break;
case MoveStep.Lbl_WaitCheckLabel: case MoveStep.Lbl_WaitCheckLabel:
if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Scan_QRCode_Fail) == WaitCheckLabeltypeE.Scan_QRCode_Fail) if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Scan_QRCode_Fail) == WaitCheckLabeltypeE.Scan_QRCode_Fail)
Msg.add("未识别到有效二维码", MsgLevel.warning); Msg.add(crc.GetString("label_scan_qrcode_fail","未识别到有效二维码"), MsgLevel.warning);
if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Scan_Code_And_Print_are_different) == WaitCheckLabeltypeE.Scan_Code_And_Print_are_different) if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Scan_Code_And_Print_are_different) == WaitCheckLabeltypeE.Scan_Code_And_Print_are_different)
Msg.add("扫描到的Reelid与发出打印的可能不一致", MsgLevel.warning); Msg.add(crc.GetString("label_qrcode_different", "扫描到的Reelid与发出打印的可能不一致"), MsgLevel.warning);
if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Failed_to_extract_label) == WaitCheckLabeltypeE.Failed_to_extract_label) if ((WaitCheckLabeltype & WaitCheckLabeltypeE.Failed_to_extract_label) == WaitCheckLabeltypeE.Failed_to_extract_label)
Msg.add("标签吸取失败", MsgLevel.warning); Msg.add(crc.GetString("label_extract_fail", "标签吸取失败"), MsgLevel.warning);
MoveInfo.log("Lbl_WaitCheckLabel:"+ WaitCheckLabeltype.ToString()); MoveInfo.log("Lbl_WaitCheckLabel:"+ WaitCheckLabeltype.ToString());
if (IOValue(IO_Label_Type.Reset_BTN).Equals(IO_VALUE.HIGH)) { if (IOValue(IO_Label_Type.Reset_BTN).Equals(IO_VALUE.HIGH)) {
MoveInfo.ReelParam.LabelState = WaitCheckLabeltype.ToString();
MoveInfo.NextMoveStep(MoveStep.Lbl_BeginOut); MoveInfo.NextMoveStep(MoveStep.Lbl_BeginOut);
IOMove(IO_Label_Type.LabelCylinder_Work, IO_VALUE.LOW); IOMove(IO_Label_Type.LabelCylinder_Work, IO_VALUE.LOW);
RobotManage.Line2.LineRun("label", 999, "Lbl_WaitCheckLabel"); RobotManage.Line2.LineRun("label", 999, "Lbl_WaitCheckLabel");
...@@ -299,7 +304,7 @@ namespace DeviceLibrary ...@@ -299,7 +304,7 @@ namespace DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(30)) else if (MoveInfo.IsTimeOut(30))
{ {
Msg.add($"等待分盘线超时{MoveInfo.TimeOutSeconds}秒", MsgLevel.warning); Msg.add(crc.GetString("wait_xx_timeout", "等待{0}超时{1}秒",RobotManage.filterMachine.DeviceName, MoveInfo.TimeOutSeconds), MsgLevel.warning);
MoveInfo.log($"等待分盘线超时,SendOutMoveInfo:{SendOutMoveInfo.MoveStep}"); MoveInfo.log($"等待分盘线超时,SendOutMoveInfo:{SendOutMoveInfo.MoveStep}");
} }
break; break;
...@@ -333,11 +338,12 @@ namespace DeviceLibrary ...@@ -333,11 +338,12 @@ namespace DeviceLibrary
{ {
SendOutMoveInfo.NewMove(MoveStep.LblSendOut_03); SendOutMoveInfo.NewMove(MoveStep.LblSendOut_03);
RobotManage.Line2.LineStop("sendout", "LblSendOut_02"); RobotManage.Line2.LineStop("sendout", "LblSendOut_02");
RobotManage.filterMachine.preReelParam = null;
SendOutMoveInfo.log("等待料盘到达分盘线超时.完成贴标."); SendOutMoveInfo.log("等待料盘到达分盘线超时.完成贴标.");
} }
else if (MoveInfo.IsTimeOut(5)) else if (MoveInfo.IsTimeOut(5))
{ {
Msg.add($"等待到达分盘线", MsgLevel.warning); Msg.add(crc.GetString("wait_goto_xx", "等待料盘到达{0}",RobotManage.filterMachine.DeviceName), MsgLevel.warning);
SendOutMoveInfo.log("等待到达分盘线"); SendOutMoveInfo.log("等待到达分盘线");
} }
break; break;
...@@ -363,16 +369,16 @@ namespace DeviceLibrary ...@@ -363,16 +369,16 @@ namespace DeviceLibrary
} }
else if (VacuumMoveInfo.IsTimeOut(25)) else if (VacuumMoveInfo.IsTimeOut(25))
{ {
Msg.add($"标签打印超时{VacuumMoveInfo.TimeOutSeconds}秒", MsgLevel.warning); Msg.add(crc.GetString("label_print_timeout","标签打印超时{0}秒", VacuumMoveInfo.TimeOutSeconds), MsgLevel.warning);
VacuumMoveInfo.log("标签打印超时, 放弃贴标NG处理"); VacuumMoveInfo.log("标签打印超时, 放弃贴标NG处理");
MoveInfo.ReelParam.IsNg = true; MoveInfo.ReelParam.IsNg = true;
MoveInfo.ReelParam.NgMsg = "标签打印超时"; MoveInfo.ReelParam.NgMsg = "Label Print Timeout";
MoveInfo.ReelParam.logresult(); MoveInfo.ReelParam.logresult();
} }
else if (VacuumMoveInfo.IsTimeOut(15)) else if (VacuumMoveInfo.IsTimeOut(15))
{ {
Msg.add($"标签打印超时{VacuumMoveInfo.TimeOutSeconds}秒", MsgLevel.warning); Msg.add(crc.GetString("label_print_timeout", "标签打印超时{0}秒", VacuumMoveInfo.TimeOutSeconds), MsgLevel.warning);
VacuumMoveInfo.log("标签打印超时"); VacuumMoveInfo.log("标签打印超时");
} }
break; break;
......
...@@ -10,6 +10,7 @@ using System.Threading.Tasks; ...@@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class LabelMachine public partial class LabelMachine
{ {
public void InitPrint() public void InitPrint()
...@@ -117,11 +118,12 @@ namespace DeviceLibrary ...@@ -117,11 +118,12 @@ namespace DeviceLibrary
try try
{ {
Bitmap bitmap; Bitmap bitmap;
Task.Delay(700).Wait();
List<CodeInfo> LastCodeList = CodeManager.CameraScan(new List<string> { Config.CameraName }, out bitmap); List<CodeInfo> LastCodeList = CodeManager.CameraScan(new List<string> { Config.CameraName }, out bitmap);
if (LastCodeList.Count <= 0) if (LastCodeList.Count <= 0)
{ {
Task.Delay(500).Wait(); //Task.Delay(500).Wait();
LastCodeList = CodeManager.CameraScan(new List<string> { Config.CameraName }); //LastCodeList = CodeManager.CameraScan(new List<string> { Config.CameraName });
} }
if (LastCodeList.Count == 0) if (LastCodeList.Count == 0)
...@@ -135,7 +137,7 @@ namespace DeviceLibrary ...@@ -135,7 +137,7 @@ namespace DeviceLibrary
if (MoveInfo.ReelParam.WareCode != LastCodeList[0].CodeStr) if (MoveInfo.ReelParam.WareCode != LastCodeList[0].CodeStr)
{ {
MoveInfo.NextMoveStep(MoveStep.Lbl_WaitCheckLabel); MoveInfo.NextMoveStep(MoveStep.Lbl_WaitCheckLabel);
Msg.add($"扫描到的Reelid与发出打印的不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}", MsgLevel.warning); Msg.add(crc.GetString("label_qrcode_different", "扫描到的Reelid与发出打印的可能不一致"), MsgLevel.warning);
MoveInfo.log($"扫描到的Reelid与发出打印的不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}"); MoveInfo.log($"扫描到的Reelid与发出打印的不一致,系统:{MoveInfo.ReelParam.WareCode},实际:{LastCodeList[0].CodeStr}");
WaitCheckLabeltype = WaitCheckLabeltypeE.Scan_Code_And_Print_are_different; WaitCheckLabeltype = WaitCheckLabeltypeE.Scan_Code_And_Print_are_different;
//MoveInfo.ReelParam.IsNg = true; //MoveInfo.ReelParam.IsNg = true;
......
...@@ -7,10 +7,12 @@ using System.Threading.Tasks; ...@@ -7,10 +7,12 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public class MachineBase public class MachineBase
{ {
public virtual DeviceConfig Config { get; set; } public virtual DeviceConfig Config { get; set; }
public virtual string DeviceName { get; set; } public virtual string DeviceName { get; }
public virtual string DeviceNameShow { get=>crc.GetString(DeviceName, DeviceName); }
public virtual bool UserPause { get; set; } public virtual bool UserPause { get; set; }
public RunStatus runStatus { get; set; } = RunStatus.Stop; public RunStatus runStatus { get; set; } = RunStatus.Stop;
protected MoveInfo ResetMoveInfo; protected MoveInfo ResetMoveInfo;
...@@ -62,12 +64,39 @@ namespace DeviceLibrary ...@@ -62,12 +64,39 @@ namespace DeviceLibrary
} }
public bool SafeCheck() public bool SafeCheck()
{ {
bool ok = true;
if (UserPause) { if (UserPause) {
Msg.add("用户暂停设备", MsgLevel.warning); Msg.add(crc.GetString("device_user_pause","用户暂停设备"), MsgLevel.warning);
return false; DeviceSuddenStop();
ok = false;
}
if (IOManager.GetDIValue("",0,16).Equals(IO_VALUE.LOW))
{
ok = false;
DeviceSuddenStop();
Msg.add(crc.GetString("device_safedoor_open", "贴标或出料机构门禁被打开"), MsgLevel.warning);
} }
lastSafeCheckStatus = ok;
return ok;
}
bool lastSafeCheckStatus = true;
void DeviceSuddenStop()
{
if (lastSafeCheckStatus)
{
//lastSafeCheckStatus = false;
var al = new Dictionary<string, List<AxisBean>>(AxisBean.List);
return true; AxisBean.StopMultiAxis(AxisBean.List[RobotManage.labelMachine.DeviceName]);
AxisBean.StopMultiAxis(AxisBean.List[RobotManage.t1Machine.DeviceName]);
//AxisBean.StopMultiAxis();
MoveInfo.List.ForEach((m) => { m.CanWhileCount = 5; });
if (runStatus == RunStatus.HomeReset)
{
ResetMoveInfo.NewMove(MoveStep.H01_HomeReset);
}
}
} }
protected void ProcessMsgEventFire(List<Msg> msg) { protected void ProcessMsgEventFire(List<Msg> msg) {
ProcessMsgEvent?.Invoke(this,msg); ProcessMsgEvent?.Invoke(this,msg);
...@@ -199,7 +228,7 @@ namespace DeviceLibrary ...@@ -199,7 +228,7 @@ namespace DeviceLibrary
else if (wait.WaitType.Equals(WaitEnum.W002_IOValue)) else if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
NotOkMsg = " 等待【" + io.DisplayStr + "】=【" + wait.IoValue + "】"; NotOkMsg = $" {crc.GetString("wait","等待")}【" + io.DisplayStr + "】=【" + wait.IoValue + "】";
wait.IsEnd = IOManager.IOValue(wait.IoType,Config).Equals(wait.IoValue); wait.IsEnd = IOManager.IOValue(wait.IoType,Config).Equals(wait.IoValue);
if (!wait.IsEnd) if (!wait.IsEnd)
{ {
...@@ -207,7 +236,7 @@ namespace DeviceLibrary ...@@ -207,7 +236,7 @@ namespace DeviceLibrary
if (span.TotalMilliseconds > timeOutMs)// && NoAlarm()) if (span.TotalMilliseconds > timeOutMs)// && NoAlarm())
{ {
WarnMsg = DeviceName + "[" + MoveInfo.MoveStep + "] 等待(" + io.DisplayStr + "=" + wait.IoValue + ") 超时"; WarnMsg = DeviceNameShow + "[" + MoveInfo.MoveStep + $"] {crc.GetString("wait", "等待")}(" + io.DisplayStr + "=" + wait.IoValue + $"){crc.GetString("timeout","超时")}";
Alarm(AlarmType.IoSingleTimeOut, WarnMsg); Alarm(AlarmType.IoSingleTimeOut, WarnMsg);
Msg.add(WarnMsg, MsgLevel.warning); Msg.add(WarnMsg, MsgLevel.warning);
LogUtil.error(WarnMsg, logType + 14); LogUtil.error(WarnMsg, logType + 14);
...@@ -244,20 +273,29 @@ namespace DeviceLibrary ...@@ -244,20 +273,29 @@ namespace DeviceLibrary
{ {
LogUtil.debug(DeviceName + "CheckWaitResult 检测到" + axisBean.TargetIoType + "=" + axisBean.TargetIoValue + ",停止运行"); LogUtil.debug(DeviceName + "CheckWaitResult 检测到" + axisBean.TargetIoType + "=" + axisBean.TargetIoValue + ",停止运行");
axisBean.StopAxisCheckMove(); axisBean.StopAxisCheckMove();
if (AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1)) //if (AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1))
{ //{
axisBean.SuddenStop(); axisBean.SuddenStop();
} //}
wait.IsEnd = true; wait.IsEnd = true;
} }
else else
{ {
bool _isOk = AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(0); bool isbusy = AxisManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1);
if (_isOk) if (!isbusy)
{ {
//TODO 判断是否达到高度,如果未达到,继续上升 int outCount = AxisManager.GetActualtPosition(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue());
axisBean.StopAxisCheckMove(); int errorCount = Math.Abs(outCount - wait.TargetPosition);
wait.IsEnd = true; if (errorCount <= wait.AxisInfo.CanErrorCountMax)
{
axisBean.StopAxisCheckMove();
wait.IsEnd = true;
}
else
{
axisBean.AbsMove(null, wait.TargetPosition, wait.TargetSpeed);
wait.IsEnd = false;
}
} }
} }
} }
...@@ -285,7 +323,7 @@ namespace DeviceLibrary ...@@ -285,7 +323,7 @@ namespace DeviceLibrary
} }
else if (span.TotalSeconds > MoveInfo.TimeOutSeconds) else if (span.TotalSeconds > MoveInfo.TimeOutSeconds)
{ {
WarnMsg = DeviceName + "[" + MoveInfo.MoveStep + "]等待" + NotOkMsg + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; WarnMsg = DeviceNameShow + "[" + MoveInfo.MoveStep + $"]{crc.GetString("wait","等待")}" + NotOkMsg + $"{crc.GetString("timeout","超时")}[" + Math.Round(span.TotalSeconds, 1) + "s]";
int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10; int second = (int)(MoveInfo.TimeOutSeconds / span.TotalSeconds) * 10;
if (second > 120) if (second > 120)
......
...@@ -128,6 +128,11 @@ namespace DeviceLibrary ...@@ -128,6 +128,11 @@ namespace DeviceLibrary
LblVacuum_end, LblVacuum_end,
LblVacuum_failure, LblVacuum_failure,
LblVacuum_printfail, LblVacuum_printfail,
T1_08_UpReelFail,
T1_09_ReleaseReel_Fail,
T1_09_ReleaseReel_Test,
Shelf_19_LocationString,
Shelf_19_LocationString_wait,
} }
......
...@@ -13,6 +13,7 @@ using System.Windows.Forms; ...@@ -13,6 +13,7 @@ using System.Windows.Forms;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public static class RobotManage public static class RobotManage
{ {
public static XRayMachine xrayMachine; public static XRayMachine xrayMachine;
...@@ -40,8 +41,8 @@ namespace DeviceLibrary ...@@ -40,8 +41,8 @@ namespace DeviceLibrary
public static ReelLocation offlinereelLocation = new ReelLocation(); public static ReelLocation offlinereelLocation = new ReelLocation();
public static LineRunMonitor Line1; public static LineRunMonitor Line1;
public static LineRunMonitor Line2; public static LineRunMonitor Line2;
public static Stopwatch ProductivityStopwatch = new Stopwatch(); public static int ProductivityCount = 0;
public static List<float> Productivity = new List<float>(); public static int DefectiveCount = 0;
//static string baseDir = Application.StartupPath; //static string baseDir = Application.StartupPath;
public static void Init() { public static void Init() {
try try
...@@ -62,7 +63,7 @@ namespace DeviceLibrary ...@@ -62,7 +63,7 @@ namespace DeviceLibrary
if (!device.Init(out string msg)) if (!device.Init(out string msg))
{ {
IsLoadOk = false; IsLoadOk = false;
msgs += $"{device.DeviceName} Init Failed\n"; msgs += $"{device.DeviceNameShow} Init Failed\n";
} }
LogUtil.info(device.DeviceName + " init end"); LogUtil.info(device.DeviceName + " init end");
}); });
...@@ -72,7 +73,7 @@ namespace DeviceLibrary ...@@ -72,7 +73,7 @@ namespace DeviceLibrary
labelMachine.InitPrint(); labelMachine.InitPrint();
if (!XRay.Open(ConfigHelper.Config.Get("XRay_Port"), string.Format("{0:yyyy-MM-dd}", DateTime.Now))) if (!XRay.Open(ConfigHelper.Config.Get("XRay_Port"), string.Format("{0:yyyy-MM-dd}", DateTime.Now)))
{ {
msgs += $"X光管通讯失败:{ConfigHelper.Config.Get("XRay_Port")}\n"; msgs += crc.GetString("device_xray_open_failed","X光管通讯失败:{0}\n", ConfigHelper.Config.Get("XRay_Port"));
IsLoadOk = false; IsLoadOk = false;
} }
else else
...@@ -82,14 +83,14 @@ namespace DeviceLibrary ...@@ -82,14 +83,14 @@ namespace DeviceLibrary
if (!XRay.SetVC(ConfigHelper.Config.Get("XRay_Voltage"), ConfigHelper.Config.Get("XRay_Current"))) if (!XRay.SetVC(ConfigHelper.Config.Get("XRay_Voltage"), ConfigHelper.Config.Get("XRay_Current")))
{ {
msgs += $"X光电压电流设置失败:{ConfigHelper.Config.Get("XRay_Voltage")},{ConfigHelper.Config.Get("XRay_Current")}\n"; msgs += crc.GetString("device_xray_setvc_failed", "X光电压电流设置失败:{0},{1}\n", ConfigHelper.Config.Get("XRay_Voltage"), ConfigHelper.Config.Get("XRay_Current"));
IsLoadOk = false; IsLoadOk = false;
} }
else else
LogUtil.info($"xray V:{ConfigHelper.Config.Get("XRay_Voltage")} ,C:{ConfigHelper.Config.Get("XRay_Current")} set ok"); LogUtil.info($"xray V:{ConfigHelper.Config.Get("XRay_Voltage")} ,C:{ConfigHelper.Config.Get("XRay_Current")} set ok");
if (!xrayImage.Open()) { if (!xrayImage.Open()) {
msgs += $"图像平板打开失败\n"; msgs += crc.GetString("device_xrayimage_open_failed", $"图像平板打开失败\n");
IsLoadOk = false; IsLoadOk = false;
} }
//xrayImage.Close(); //xrayImage.Close();
...@@ -97,7 +98,7 @@ namespace DeviceLibrary ...@@ -97,7 +98,7 @@ namespace DeviceLibrary
var ElectricGripperPort = ConfigHelper.Config.Get("ElectricGripperPort"); var ElectricGripperPort = ConfigHelper.Config.Get("ElectricGripperPort");
electricGripper = new ElectricGripper(ElectricGripperPort); electricGripper = new ElectricGripper(ElectricGripperPort);
if (!electricGripper.OpenPort()) { if (!electricGripper.OpenPort()) {
msgs += $"电夹爪通讯失败:{ElectricGripperPort}\n"; msgs += crc.GetString("device_electricGripper_open_failed", "电夹爪通讯失败:{0}\n", ElectricGripperPort);
IsLoadOk = false; IsLoadOk = false;
} }
electricGripper.HomeReset(); electricGripper.HomeReset();
...@@ -105,7 +106,7 @@ namespace DeviceLibrary ...@@ -105,7 +106,7 @@ namespace DeviceLibrary
if (!IOManager.ConnectionIO()) if (!IOManager.ConnectionIO())
{ {
IsLoadOk = false; IsLoadOk = false;
msgs += "IO板卡初始化失败\n"; msgs += crc.GetString("device_io_open_failed", "IO板卡初始化失败\n");
} }
Line1 = new LineRunMonitor("line1", labelMachine.Config.DOList[IO_Label_Type.Line1_Run].GetIOAddr()); Line1 = new LineRunMonitor("line1", labelMachine.Config.DOList[IO_Label_Type.Line1_Run].GetIOAddr());
Line2 = new LineRunMonitor("line2", labelMachine.Config.DOList[IO_Label_Type.Line2_Run].GetIOAddr()); Line2 = new LineRunMonitor("line2", labelMachine.Config.DOList[IO_Label_Type.Line2_Run].GetIOAddr());
...@@ -117,7 +118,7 @@ namespace DeviceLibrary ...@@ -117,7 +118,7 @@ namespace DeviceLibrary
} }
} }
public static void LoadDebug() { public static void LoadDebug() {
LoadFinishEvent?.Invoke(true, "打开调试模式"); LoadFinishEvent?.Invoke(true, crc.GetString("open_debugmode","打开调试模式"));
} }
public static void Start() public static void Start()
{ {
......
...@@ -37,8 +37,10 @@ namespace DeviceLibrary ...@@ -37,8 +37,10 @@ namespace DeviceLibrary
RunningLed.LedState = LedState.off; RunningLed.LedState = LedState.off;
} }
if (ShelfInMoveInfo.MoveStep == MoveStep.Shelf_18_EmptyIn_WaitManCheck) { if (ShelfInMoveInfo.MoveStep == MoveStep.T1_08_UpReelFail
AlarmLed.LedState = LedState.on; || ShelfInMoveInfo.MoveStep == MoveStep.T1_09_ReleaseReel_Fail) {
//AlarmLed.LedState = LedState.on;
Alarm(AlarmType.IoSingleTimeOut);
} }
} }
else if (runStatus == RunStatus.HomeReset) else if (runStatus == RunStatus.HomeReset)
......
...@@ -10,6 +10,7 @@ using System.Threading.Tasks; ...@@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class T1Machine : MachineBase, IRobot public partial class T1Machine : MachineBase, IRobot
{ {
private Config_T1 _config; private Config_T1 _config;
...@@ -21,7 +22,7 @@ namespace DeviceLibrary ...@@ -21,7 +22,7 @@ namespace DeviceLibrary
_config = value; _config = value;
} }
} }
public override string DeviceName { get; set; } = "出料机构"; public override string DeviceName { get; } = "出料机构";
public bool canRunning { get; set; } public bool canRunning { get; set; }
public bool isBusy { get; set; } public bool isBusy { get; set; }
public bool isAlarm { get; set; } public bool isAlarm { get; set; }
...@@ -146,13 +147,13 @@ namespace DeviceLibrary ...@@ -146,13 +147,13 @@ namespace DeviceLibrary
if (IOValue(IO_T1_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOValue(IO_T1_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add("急停中", MsgLevel.warning); Msg.add(crc.GetString("emergency_stop", "急停中"), MsgLevel.warning);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
else if (alarmType == AlarmType.SuddenStop) else if (alarmType == AlarmType.SuddenStop)
{ {
Msg.add("系统需要重置", MsgLevel.info); Msg.add(crc.GetString("system_need_reset", "系统需要重置"), MsgLevel.info);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
...@@ -167,7 +168,7 @@ namespace DeviceLibrary ...@@ -167,7 +168,7 @@ namespace DeviceLibrary
{ {
if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1) if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1)
{ {
Msg.add($"{configMoveAxis.Explain}:运动报警", MsgLevel.warning); Msg.add(crc.GetString("axis_run_alert", "{0}:运动报警", configMoveAxis.Explain), MsgLevel.warning);
ok = false; ok = false;
} }
} }
......
...@@ -9,6 +9,7 @@ using OnlineStore.Common; ...@@ -9,6 +9,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class XRayMachine public partial class XRayMachine
{ {
...@@ -79,7 +80,7 @@ namespace DeviceLibrary ...@@ -79,7 +80,7 @@ namespace DeviceLibrary
else if (MoveInfo.IsTimeOut(10)) else if (MoveInfo.IsTimeOut(10))
{ {
FeedingMoveinfo.log($"等待Xray可以进入"); FeedingMoveinfo.log($"等待Xray可以进入");
Msg.add("等待Xray可以进入", MsgLevel.info); Msg.add(crc.GetString("wait_xx_free", "等待{0}空闲", RobotManage.xrayMachine.DeviceName), MsgLevel.info);
} }
break; break;
case MoveStep.Feeding_05_Wait_Man_Check: case MoveStep.Feeding_05_Wait_Man_Check:
...@@ -87,7 +88,7 @@ namespace DeviceLibrary ...@@ -87,7 +88,7 @@ namespace DeviceLibrary
{ {
if (IOValue(IO_XRay_Type.Tray_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_XRay_Type.Tray_Check).Equals(IO_VALUE.HIGH))
{ {
Msg.add("未识别出料盘, 请取走", MsgLevel.warning); Msg.add(crc.GetString("scancode_fail_takeout","未识别出料盘, 请取走"), MsgLevel.warning);
} }
else if (IOMonitor.IODebound(IO_XRay_Type.Tray_Check, Config, IO_VALUE.LOW, 1000)) else if (IOMonitor.IODebound(IO_XRay_Type.Tray_Check, Config, IO_VALUE.LOW, 1000))
{ {
......
...@@ -14,6 +14,7 @@ using System.Windows.Forms; ...@@ -14,6 +14,7 @@ using System.Windows.Forms;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
partial class XRayMachine partial class XRayMachine
{ {
const string xraydir = @"\Image\Xray"; const string xraydir = @"\Image\Xray";
...@@ -28,6 +29,7 @@ namespace DeviceLibrary ...@@ -28,6 +29,7 @@ namespace DeviceLibrary
case MoveStep.XRay_01_LocationDown: case MoveStep.XRay_01_LocationDown:
MoveInfo.StopwatchReset(); MoveInfo.StopwatchReset();
MoveInfo.NextMoveStep(MoveStep.XRay_02_RunIn); MoveInfo.NextMoveStep(MoveStep.XRay_02_RunIn);
RobotManage.ProductivityCount++;
MoveInfo.log($"定位气缸下降,打开点料机入口门"); MoveInfo.log($"定位气缸下降,打开点料机入口门");
CylinderMove(MoveInfo, IO_XRay_Type.Location_Cylinder_Down, IO_XRay_Type.Location_Cylinder_Up, IO_VALUE.LOW); CylinderMove(MoveInfo, IO_XRay_Type.Location_Cylinder_Down, IO_XRay_Type.Location_Cylinder_Up, IO_VALUE.LOW);
CylinderMove(null, IO_XRay_Type.Entry_Close, IO_XRay_Type.Entry_Open, IO_VALUE.HIGH); CylinderMove(null, IO_XRay_Type.Entry_Close, IO_XRay_Type.Entry_Open, IO_VALUE.HIGH);
...@@ -92,7 +94,7 @@ namespace DeviceLibrary ...@@ -92,7 +94,7 @@ namespace DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(30)) { else if (MoveInfo.IsTimeOut(30)) {
Msg.add("等待贴标机构入口空闲", MsgLevel.warning); Msg.add(crc.GetString("wait_xx_free", "等待{0}空闲", RobotManage.labelMachine.DeviceNameShow), MsgLevel.warning);
MoveInfo.log("等待贴标机构入口空闲"); MoveInfo.log("等待贴标机构入口空闲");
} }
break; break;
...@@ -109,7 +111,7 @@ namespace DeviceLibrary ...@@ -109,7 +111,7 @@ namespace DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(10)) else if (MoveInfo.IsTimeOut(10))
{ {
Msg.add("等待料盘到达贴标线入口", MsgLevel.warning); Msg.add(crc.GetString("wait_goto_xx", "等待料盘到达{0}",RobotManage.labelMachine.DeviceNameShow), MsgLevel.warning);
MoveInfo.log("等待料盘到达贴标线入口"); MoveInfo.log("等待料盘到达贴标线入口");
} }
break; break;
...@@ -206,7 +208,7 @@ namespace DeviceLibrary ...@@ -206,7 +208,7 @@ namespace DeviceLibrary
//tpDstImg = new API.EyemImage(); //tpDstImg = new API.EyemImage();
try try
{ {
string countStr = ""; int[] countStr = new int[4];
int result = 0; int result = 0;
int ShrinkOffset = ConfigHelper.Config.Get<int>("ShrinkOffset",100); int ShrinkOffset = ConfigHelper.Config.Get<int>("ShrinkOffset",100);
var type = Pn_Algo_Match.MatchPN(MoveInfo.ReelParam.PN); var type = Pn_Algo_Match.MatchPN(MoveInfo.ReelParam.PN);
...@@ -219,10 +221,11 @@ namespace DeviceLibrary ...@@ -219,10 +221,11 @@ namespace DeviceLibrary
type = "auto"; type = "auto";
} }
} }
Bitmap dst=null;
if (type == "auto") if (type == "auto")
{ {
result = XrayImage.GetLocalCount(xrayImagePath, ShrinkOffset, out countStr, out _); result = XrayImage.GetLocalCount(xrayImagePath, ShrinkOffset, out countStr, out dst);
MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCount 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + countStr + "】"); MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCount 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",",countStr) + "】");
} }
else if (type.StartsWith("IP_Template_PARTS")) else if (type.StartsWith("IP_Template_PARTS"))
{ {
...@@ -231,18 +234,19 @@ namespace DeviceLibrary ...@@ -231,18 +234,19 @@ namespace DeviceLibrary
{ {
template = type.Substring(17 + 1); template = type.Substring(17 + 1);
} }
result = XrayImage.GetLocalCountTemplate(xrayImagePath, ShrinkOffset, template, out countStr, out Bitmap dst); result = XrayImage.GetLocalCountTemplate(xrayImagePath, ShrinkOffset, template, out countStr, out dst);
MoveInfo.log("GetCountResult " + template + " 调用 GetLocalCountTemplate 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + countStr + "】"); MoveInfo.log("GetCountResult " + template + " 调用 GetLocalCountTemplate 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
if (dst != null)
{
dst.Save("ResOut\\" + Path.GetFileNameWithoutExtension(xrayImagePath) + "-Mark.png");
dst.Dispose();
}
} }
else else
{ {
result = XrayImage.GetLocalCountIrregular(xrayImagePath, ShrinkOffset, type.ToString(), out countStr, out _); result = XrayImage.GetLocalCountIrregular(xrayImagePath, ShrinkOffset, type.ToString(), out countStr, out dst);
MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCountIrregular 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + countStr + "】"); MoveInfo.log("GetCountResult " + type + " 调用 GetLocalCountIrregular 【" + xrayImagePath + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
}
if (dst != null)
{
dst.Save("ResOut\\" + Path.GetFileNameWithoutExtension(xrayImagePath) + "-Mark.png");
dst.Dispose();
} }
if (result != 0) if (result != 0)
{ {
...@@ -254,8 +258,8 @@ namespace DeviceLibrary ...@@ -254,8 +258,8 @@ namespace DeviceLibrary
if (countStr != null) if (countStr != null)
{ {
string[] array = countStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); //string[] array = countStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
count = (from a in array where int.TryParse(a, out _) && int.Parse(a) > 0 select int.Parse(a)).FirstOrDefault(); count = (from a in countStr where a > 0 select a).FirstOrDefault();
} }
else else
{ {
......
...@@ -10,6 +10,7 @@ using System.Threading.Tasks; ...@@ -10,6 +10,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public partial class XRayMachine : MachineBase, IRobot public partial class XRayMachine : MachineBase, IRobot
{ {
private Config_XRay _config; private Config_XRay _config;
...@@ -22,7 +23,7 @@ namespace DeviceLibrary ...@@ -22,7 +23,7 @@ namespace DeviceLibrary
_config = value; _config = value;
} }
} }
public override string DeviceName { get; set; } = "点料"; public override string DeviceName { get; } = "点料";
public bool canRunning { get; set; } public bool canRunning { get; set; }
public bool isBusy { get; set; } public bool isBusy { get; set; }
public bool isAlarm { get; set; } public bool isAlarm { get; set; }
...@@ -135,14 +136,14 @@ namespace DeviceLibrary ...@@ -135,14 +136,14 @@ namespace DeviceLibrary
if (IOValue(IO_XRay_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOValue(IO_XRay_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{ {
Alarm(AlarmType.SuddenStop); Alarm(AlarmType.SuddenStop);
Msg.add("急停中", MsgLevel.warning); Msg.add(crc.GetString("emergency_stop", "急停中"), MsgLevel.warning);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
else if (alarmType == AlarmType.SuddenStop) else if (alarmType == AlarmType.SuddenStop)
{ {
Msg.add("系统需要重置", MsgLevel.info); Msg.add(crc.GetString("system_need_reset", "系统需要重置"), MsgLevel.info);
Thread.Sleep(1000); Thread.Sleep(1000);
ok = false; ok = false;
} }
...@@ -155,7 +156,7 @@ namespace DeviceLibrary ...@@ -155,7 +156,7 @@ namespace DeviceLibrary
if (span.TotalSeconds > Config.AirCheckSeconds) if (span.TotalSeconds > Config.AirCheckSeconds)
{ {
ok = false; ok = false;
Msg.add("气压不足", MsgLevel.warning); Msg.add(crc.GetString("air_pressure_fail", "气压不足"), MsgLevel.warning);
} }
} }
else else
...@@ -172,7 +173,7 @@ namespace DeviceLibrary ...@@ -172,7 +173,7 @@ namespace DeviceLibrary
{ {
if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1) if (AxisManager.GetAlarmStatus(configMoveAxis.DeviceName, configMoveAxis.GetAxisValue()) == 1)
{ {
Msg.add($"{configMoveAxis.Explain}:运动报警", MsgLevel.warning); Msg.add(crc.GetString("axis_run_alert", "{0}:运动报警", configMoveAxis.Explain), MsgLevel.warning);
ok = false; ok = false;
} }
} }
......
...@@ -9,9 +9,10 @@ using System.Threading.Tasks; ...@@ -9,9 +9,10 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public class AxisBean public class AxisBean
{ {
static readonly Dictionary<string, List<AxisBean>> List = new Dictionary<string, List<AxisBean>>(); public static readonly Dictionary<string, List<AxisBean>> List = new Dictionary<string, List<AxisBean>>();
public ConfigMoveAxis Config = null; public ConfigMoveAxis Config = null;
public static int TimeoutInterval = 500; public static int TimeoutInterval = 500;
...@@ -189,7 +190,7 @@ namespace DeviceLibrary ...@@ -189,7 +190,7 @@ namespace DeviceLibrary
} }
else else
{ {
msg = $"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr},目标位置{targetPosition},当前位置{outCount},误差过大,需要报警"; msg = $"{MoveInfo.Name} {MoveInfo.MoveStep} "+crc.GetString("axis_absmove_error", "{0}:目标位置{1},当前位置{2},误差过大,需要报警", axis.DisplayStr, targetPosition, outCount);
LogUtil.error(msg, 600); LogUtil.error(msg, 600);
} }
} }
...@@ -252,7 +253,7 @@ namespace DeviceLibrary ...@@ -252,7 +253,7 @@ namespace DeviceLibrary
} }
else else
{ {
msg = MoveInfo.Name + " " + MoveInfo.MoveStep + axis.DisplayStr + ",收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警"; msg = MoveInfo.Name + " " + MoveInfo.MoveStep + crc.GetString("axis_homeback_error", "{0}:收到原点完成信号,当前位置[{1}],误差过大,需要报警", axis.DisplayStr, outCount);
LogUtil.error(msg); LogUtil.error(msg);
} }
} }
...@@ -343,7 +344,7 @@ namespace DeviceLibrary ...@@ -343,7 +344,7 @@ namespace DeviceLibrary
private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
TimeSpan pan = DateTime.Now - lastOkTime; TimeSpan pan = DateTime.Now - lastOkTime;
if (IsInProcess && pan.TotalMilliseconds < 100) { return; } if (IsInProcess && pan.TotalMilliseconds < 50) { return; }
try try
{ {
...@@ -351,9 +352,10 @@ namespace DeviceLibrary ...@@ -351,9 +352,10 @@ namespace DeviceLibrary
lastOkTime = DateTime.Now; lastOkTime = DateTime.Now;
if (IOManager.IOValue(TargetIoType, IOConfig).Equals(TargetIoValue)) if (IOManager.IOValue(TargetIoType, IOConfig).Equals(TargetIoValue))
{ {
SuddenStop();
StopAxisCheckMove(); StopAxisCheckMove();
LogUtil.info(AxisName + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动"); LogUtil.info(AxisName + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动");
SuddenStop();
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -10,7 +10,8 @@ namespace DeviceLibrary ...@@ -10,7 +10,8 @@ namespace DeviceLibrary
{ {
//List<ConfigMoveAxis> moveAxisList { get; set; } //List<ConfigMoveAxis> moveAxisList { get; set; }
DeviceConfig Config { get; set; } DeviceConfig Config { get; set; }
string DeviceName { get; set; } string DeviceName { get; }
string DeviceNameShow { get; }
bool canRunning { get; set; } bool canRunning { get; set; }
bool isBusy { get; set; } bool isBusy { get; set; }
......
...@@ -11,7 +11,6 @@ namespace DeviceLibrary ...@@ -11,7 +11,6 @@ namespace DeviceLibrary
{ {
public class ReelParam public class ReelParam
{ {
public static long uid = 0;
/// <summary> /// <summary>
/// 创建新出入库信息 /// 创建新出入库信息
/// </summary> /// </summary>
...@@ -22,8 +21,7 @@ namespace DeviceLibrary ...@@ -22,8 +21,7 @@ namespace DeviceLibrary
/// <param name="ngMsg">NG消息</param> /// <param name="ngMsg">NG消息</param>
public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "") public ReelParam(string wareNo = "", int platew = 0, int plateh = 0, bool _IsNg = false, string ngMsg = "")
{ {
uid++; UID = databaseProc.Current.GetID();
UID = uid.ToString();
ReeID = WareCode; ReeID = WareCode;
WareCode = wareNo; WareCode = wareNo;
PlateW = platew; PlateW = platew;
...@@ -34,7 +32,7 @@ namespace DeviceLibrary ...@@ -34,7 +32,7 @@ namespace DeviceLibrary
PN = "PN"; PN = "PN";
ReelDest = ReelDest.Unknow; ReelDest = ReelDest.Unknow;
} }
public string UID = "0"; public long UID = 0;
string _WareCode; string _WareCode;
/// <summary> /// <summary>
/// 物品二维码信息 /// 物品二维码信息
...@@ -84,6 +82,12 @@ namespace DeviceLibrary ...@@ -84,6 +82,12 @@ namespace DeviceLibrary
/// 入料NG消息 /// 入料NG消息
/// </summary> /// </summary>
public string NgMsg = ""; public string NgMsg = "";
/// <summary>
/// 贴标状态
/// </summary>
public string LabelState = "None";
/// <summary> /// <summary>
/// 料盘出口 /// 料盘出口
/// </summary> /// </summary>
...@@ -115,7 +119,7 @@ namespace DeviceLibrary ...@@ -115,7 +119,7 @@ namespace DeviceLibrary
string countfile = $"CountResult-{DateTime.Now:yyyy-MM-dd}.txt"; string countfile = $"CountResult-{DateTime.Now:yyyy-MM-dd}.txt";
if (!File.Exists(countfile)) { if (!File.Exists(countfile)) {
var sw1 = File.AppendText(countfile); var sw1 = File.AppendText(countfile);
sw1.WriteLine($"Date,ReeID,PN,WxH,ReelDest,NgMsg,QTY,2D_Barcode"); sw1.WriteLine($"Date,ReeID,PN,WxH,ReelDest,NgMsg,QTY,LabelState,2D_Barcode");
sw1.Close(); sw1.Close();
sw1.Dispose(); sw1.Dispose();
} }
...@@ -125,10 +129,11 @@ namespace DeviceLibrary ...@@ -125,10 +129,11 @@ namespace DeviceLibrary
// string s = $"\r\n{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{WareCode}"; // string s = $"\r\n{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{WareCode}";
//var b = Encoding.GetEncoding("gb2312").GetBytes(s); //var b = Encoding.GetEncoding("gb2312").GetBytes(s);
//sw.Write(b, 0, b.Length); //sw.Write(b, 0, b.Length);
sw.WriteLine($"{DateTime.Now:HH:mm:ss},{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{WareCode}"); sw.WriteLine($"{DateTime.Now:HH:mm:ss},{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{LabelState},{WareCode}");
sw.Close(); sw.Close();
sw.Dispose(); sw.Dispose();
} }
databaseProc.Current.InsertOrUpdateRI(UID, PN, ReeID, IsNg, NgMsg, QTY, LabelState, ReelDest.ToString(), WareCode);
} }
public string GetImgName() public string GetImgName()
{ {
......
...@@ -9,6 +9,7 @@ using System.Threading.Tasks; ...@@ -9,6 +9,7 @@ using System.Threading.Tasks;
namespace DeviceLibrary namespace DeviceLibrary
{ {
using crc = OnlineStore.CodeResourceControl;
public class MoveInfo public class MoveInfo
{ {
...@@ -21,12 +22,12 @@ namespace DeviceLibrary ...@@ -21,12 +22,12 @@ namespace DeviceLibrary
ReelParam = new ReelParam(); ReelParam = new ReelParam();
this.moveStep = MoveStep.Wait; this.moveStep = MoveStep.Wait;
IsInWait = false; IsInWait = false;
this.Name = name; this.name = name;
List.Add(this); List.Add(this);
} }
string name="";
public string Name { get; set; } public string Name { get => crc.GetString(this.name, this.name); set => name = value; }
public DateTime LastSetpTime { get; set; } public DateTime LastSetpTime { get; set; }
public bool OneWaitCanEndStep = false; public bool OneWaitCanEndStep = false;
...@@ -250,7 +251,7 @@ namespace DeviceLibrary ...@@ -250,7 +251,7 @@ namespace DeviceLibrary
} }
else if (WaitType.Equals(WaitEnum.W002_IOValue)) else if (WaitType.Equals(WaitEnum.W002_IOValue))
{ {
return "等待【" + IoType + "】=【" + IoValue + "】"; return $"{crc.GetString("wait", "等待")}【" + IoType + "】=【" + IoValue + "】";
} }
else if (WaitType.Equals(WaitEnum.W003_Time)) else if (WaitType.Equals(WaitEnum.W003_Time))
{ {
......
...@@ -9,11 +9,15 @@ namespace DeviceLibrary ...@@ -9,11 +9,15 @@ namespace DeviceLibrary
{ {
public class ServerConn public class ServerConn
{ {
const string host = "http://10.69.221.80"; static string inputCounterDataByXRayMachine_URL;
static string DetermineReelStorageLocation_URL;
static ServerConn()
{
inputCounterDataByXRayMachine_URL = ConfigAppSettings.GetValue("inputCounterDataByXRayMachine");
DetermineReelStorageLocation_URL = ConfigAppSettings.GetValue("DetermineReelStorageLocation");
}
public static CountResult inputCounterDataByXRayMachine(string TwoDBarcode, int qty) public static CountResult inputCounterDataByXRayMachine(string TwoDBarcode, int qty)
{ {
//string url = host + "/api/inputCounterDataByXRayMachine";
string url = host + "/SCTAEXTERNAL001/api/inputCounterDataByXRayMachine";
var wc = new MyWebClient(15000); var wc = new MyWebClient(15000);
if (string.IsNullOrEmpty(wc.Headers["Content-Type"])) if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8"); wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
...@@ -33,7 +37,7 @@ namespace DeviceLibrary ...@@ -33,7 +37,7 @@ namespace DeviceLibrary
retry: retry:
try try
{ {
result = wc.UploadString(url, "POST", json); result = wc.UploadString(inputCounterDataByXRayMachine_URL, "POST", json);
return JsonHelper.DeserializeJsonToObject<CountResult>(result); return JsonHelper.DeserializeJsonToObject<CountResult>(result);
} }
catch (Exception e) catch (Exception e)
...@@ -53,8 +57,6 @@ namespace DeviceLibrary ...@@ -53,8 +57,6 @@ namespace DeviceLibrary
public static ReelLocation DetermineReelStorageLocation(string TwoDBarcode) public static ReelLocation DetermineReelStorageLocation(string TwoDBarcode)
{ {
//string url = host + "/api/RLC/DetermineReelStorageLocation";
string url = host + "/SCTARLC001/api/RLC/DetermineReelStorageLocation";
var wc = new MyWebClient(15000); var wc = new MyWebClient(15000);
if (string.IsNullOrEmpty(wc.Headers["Content-Type"])) if (string.IsNullOrEmpty(wc.Headers["Content-Type"]))
wc.Headers.Add("Content-Type", "application/json;charset=UTF-8"); wc.Headers.Add("Content-Type", "application/json;charset=UTF-8");
...@@ -67,14 +69,14 @@ namespace DeviceLibrary ...@@ -67,14 +69,14 @@ namespace DeviceLibrary
data.data.Add("str2DBarcode", TwoDBarcode); data.data.Add("str2DBarcode", TwoDBarcode);
data.data.Add("labelPrinter", ConfigHelper.Config.Get("upload_labelPrinter")); data.data.Add("labelPrinter", ConfigHelper.Config.Get("upload_labelPrinter"));
string json = JsonHelper.SerializeObject(data); string json = JsonHelper.SerializeObject(data);
string result = ""; string result = "";
int retry = 0; int retry = 0;
retry: retry:
try try
{ {
result = wc.UploadString(url, "POST", json); result = wc.UploadString(DetermineReelStorageLocation_URL, "POST", json);
return JsonHelper.DeserializeJsonToObject<ReelLocation>(result); return JsonHelper.DeserializeJsonToObject<ReelLocation>(result);
} }
catch (Exception e) catch (Exception e)
......
<?xml version="1.0" encoding="UTF-8"?>
<config ver="10">
<item key="EnableBuzzer" ver="10" value="True" />
<item key="App_AutoRun" ver="10" value="True" />
</config>
\ No newline at end of file \ No newline at end of file
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,取料机构旋转轴,Take_Middle_Axis,0,HC,,500,1000,1000,100,200,1000,10,100,0,0
AXIS,,取料机构上下轴,Take_UpDown_Axis,1,HC,,1000,1000,1000,200,500,500,10,100,0,0
AXIS,,左轨道提升轴,Left_Batch_Axis,2,HC,,3000,1000,1000,200,1000,200,10,100,0,0
AXIS,,右轨道提升轴,Right_Batch_Axis,3,HC,,3000,1000,1000,200,1000,200,10,100,0,0
AXIS,,贴标移栽机构X轴,Label_X_Axis,4,HC,,100,700,700,50,250,500,10,100,0,0
AXIS,,贴标移栽机构Y轴,Label_Y_Axis,5,HC,,100,700,700,50,150,500,10,100,0,0
AXIS,,贴标移栽机构Z轴,Label_Z_Axis,6,HC,,100,800,800,50,150,500,10,100,0,0
AXIS,,贴标移栽机构R轴,Label_R_Axis,7,HC,,10,2000,2000,1,5,200,500,100,0,0
,,,,,,,,,,,,,,,,
PRO,30,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
PRO,30,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,20,右侧提升轴每毫米脉冲,Right_Batch_ChangeValue,5555,,,,,,,,,,,,
PRO,20,左侧提升轴每毫米脉冲,Left_Batch_ChangeValue,5555,,,,,,,,,,,,
PRO,30,右侧相机名称,RightCameraName,123123,,,,,,,,,,,,
PRO,30,右侧轴心坐标X,Right_Batch_X,222,,,,,,,,,,,,
PRO,30,右侧轴心坐标Y,Right_Batch_Y,333,,,,,,,,,,,,
PRO,30,贴标R轴0位角度差,Label_R_Angle_Diff,90,,,,,,,,,,,,
PRO,30,贴标R轴360度脉冲,Label_R_360,9,,,,,,,,,,,,
PRO,30,贴标X轴基准点,Label_X_Base,8,,,,,,,,,,,,
PRO,30,贴标Y轴基准点,Label_Y_Base,7,,,,,,,,,,,,
PRO,30,图像/X轴比值,Cam_Pixel_X_Ratio,6,,,,,,,,,,,,
PRO,30,图像/Y轴比值,Cam_Pixel_Y_Ratio,5,,,,,,,,,,,,
PRO,30,像素偏离位置7寸,Label_Offset_Pixel_7,200,,,,,,,,,,,,
PRO,30,像素偏离位置13寸,Label_Offset_Pixel_13,200,,,,,,,,,,,,
PRO,30,像素偏离位置15寸,Label_Offset_Pixel_15,200,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,10,取料旋转轴待机点P1,Take_Middle_P1,1,,,99,,,,,,,,,
PRO,10,取料旋转轴右取料点P2,Take_Middle_P2,2,,,99,,,,,,,,,
PRO,10,取料旋转轴左取料点P3,Take_Middle_P3,3,,,99,,,,,,,,,
PRO,10,取料旋转轴NG放料点P5,Take_Middle_P5,4,,,99,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,11,取料上下轴待机点P1,Take_UpDown_P1,6,,,88,,,,,,,,,
PRO,11,取料上下轴取料高点P2,Take_UpDown_P2,7,,,88,,,,,,,,,
PRO,11,取料上下轴取右料低点P3,Take_UpDown_P3,8,,,88,,,,,,,,,
PRO,11,取料上下轴取左料低点P4,Take_UpDown_P4,9,,,88,,,,,,,,,
PRO,11,取料上下轴NG放料点P5,Take_UpDown_P5,10,,,88,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,12,右提升轴低点P1,Right_Batch_P1,12,,,66,,,,,,,,,
PRO,12,右提升轴高点P2,Right_Batch_P2,13,,,66,,,,,,,,,
PRO,12,左提升轴低点P1,Left_Batch_P1,14,,,66,,,,,,,,,
PRO,12,左提升轴高点P2,Left_Batch_P2,15,,,66,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,13,贴标X轴待机点P1,Label_X_P1,17,,,77,,,,,,,,,
PRO,13,贴标X轴取标点P2,Label_X_P2,18,,,77,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,14,贴标Y轴待机点P1,Label_Y_P1,21,,,44,,,,,,,,,
PRO,14,贴标Y轴取标点P2,Label_Y_P2,22,,,44,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,15,贴标Z轴待机点P1,Label_Z_P1,25,,,44,,,,,,,,,
PRO,15,贴标Z轴取标点P2,Label_Z_P2,26,,,44,,,,,,,,,
PRO,15,贴标Z轴贴标点P3,Label_Z_P3,27,,,44,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,16,贴标R轴待机点P1,Label_R_P1,29,,,22,,,,,,,,,
PRO,16,贴标R轴取标点P2,Label_R_P2,30,,,22,,,,,,,,,
,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,HC,X00,,,,,,,,,,
DI,0,进料口确认按钮,Right_BTN,1,HC,X01,,,,,,,,,,
DI,0,出料口确认按钮,Left_BTN,2,HC,X02,,,,,,,,,,
DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
DI,0,后门右门禁,RightBackDoor_Check,4,HC,X04,,,,,,,,,,
DI,0,气压检测,Airpressure_Check,5,HC,X05,,,,,,,,,,
DI,0,光栅信号,GratingSignal_Check,6,HC,X06,,,,,,,,,,
DI,0,NG料箱检测,HasNgBox,7,HC,X07,,,,,,,,,,
DI,0,打印机到位检测,HasPrinter,8,HC,X08,,,,,,,,,,
DI,0,旋转臂进料侧检测,RightArm_Check,9,HC,X09,,,,,,,,,,
DI,0,旋转臂出料侧检测,LeftArm_Check,10,HC,X10,,,,,,,,,,
DI,0,进料口料车检测,RightCar_Check,11,HC,X11,,,,,,,,,,
DI,0,进料口前端料串检测,RightFornt_Check,12,HC,X12,,,,,,,,,,
DI,0,进料口料串到位检测,RightEnd_Check,13,HC,X13,,,,,,,,,,
DI,0,进料口阻挡气缸上升端,RightStopUP,14,HC,X14,,,,,,,,,,
DI,0,进料口阻挡气缸下降端,RightStopDown,15,HC,X15,,,,,,,,,,
DI,0,出料口料车检测,LeftCar_Check,16,HC,X16,,,,,,,,,,
DI,0,出料口前端料串检测,LeftFornt_Check,17,HC,X17,,,,,,,,,,
DI,0,出料口料串到位检测,LeftEnd_Check,18,HC,X18,,,,,,,,,,
DI,0,出料口阻挡气缸上升端,LeftStopUP,19,HC,X19,,,,,,,,,,
DI,0,出料口阻挡气缸下降端,LeftStopDown,20,HC,X20,,,,,,,,,,
DI,0,进料定位料盘检测,RightTop_Check,21,HC,X21,,,,,,,,,,
DI,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
DI,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
DI,0,吸嘴气缸后退端,LabelCylinder_Bck,26,HC,X26,,,,,,,,,,
,,,,,,,,,,,,,,,,
DO,0,自动指示灯,AutoRun_HddLed,0,HC,Y00,,,,,,,,,,
DO,0,故障指示灯,Alarm_HddLed,1,HC,Y01,,,,,,,,,,
DO,0,待机指示灯,RunSign_HddLed,2,HC,Y02,,,,,,,,,,
DO,0,报警蜂鸣器,Alarm_Buzzer,3,HC,Y03,,,,,,,,,,
DO,0,进料口状态指示灯,RightState_Led,4,HC,Y04,,,,,,,,,,
DO,0,出料口状态指示灯,LeftState_Led,5,HC,Y05,,,,,,,,,,
DO,0,设备照明,Device_Led,6,HC,Y06,,,,,,,,,,
DO,0,相机照明,Camera_Led,7,HC,Y07,,,,,,,,,,
DO,0,进料口电机启动,RightMoto_Run,8,HC,Y08,,,,,,,,,,
DO,0,进料口电机反转指令,RightMoto_Reverse,9,HC,Y09,,,,,,,,,,
DO,0,出料口电机启动,LeftMoto_Run,10,HC,Y10,,,,,,,,,,
DO,0,出料口电机反转指令,LeftMoto_Reverse,11,HC,Y11,,,,,,,,,,
DO,0,进料口阻挡气缸上升,RightStopUP,12,HC,Y12,,,,,,,,,,
DO,0,进料口阻挡气缸下降,RightStopDown,13,HC,Y13,,,,,,,,,,
DO,0,出料口阻挡气缸上升,LeftStopUP,14,HC,Y14,,,,,,,,,,
DO,0,出料口阻挡气缸下降,LeftStopDown,15,HC,Y15,,,,,,,,,,
DO,0,吸嘴气缸前进,LabelCylinder_Fwd,16,HC,Y16,,,,,,,,,,
DO,0,吸嘴气缸后退,LabelCylinder_Bck,17,HC,Y17,,,,,,,,,,
DO,0,吸嘴取标,LabelCylinder_Work,18,HC,Y18,,,,,,,,,,
,,,,,,,,,,,,,,,,
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
PRO,30,NG料盒最大容量,NG_BOX_MAXCOUNT,50,,,,,,,,,,,, PRO,30,NG料盒最大容量,NG_BOX_MAXCOUNT,50,,,,,,,,,,,,
PRO,30,MSD料盒最大容量,MSD_BOX_MAXCOUNT,50,,,,,,,,,,,, PRO,30,MSD料盒最大容量,MSD_BOX_MAXCOUNT,50,,,,,,,,,,,,
PRO,30,Paper料盒最大容量,PAPER_BOX_MAXCOUNT,50,,,,,,,,,,,, PRO,30,Paper料盒最大容量,PAPER_BOX_MAXCOUNT,50,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
DI,0,NG料阻挡料盘检测,NG_TaryStop_Check,26,HC,X26,,,,,,,,,, DI,0,NG料阻挡料盘检测,NG_TaryStop_Check,26,HC,X26,,,,,,,,,,
DI,0,NG料阻挡上升端,NG_TaryStop_Up,27,HC,X27,,,,,,,,,, DI,0,NG料阻挡上升端,NG_TaryStop_Up,27,HC,X27,,,,,,,,,,
DI,0,NG料阻挡下降端,NG_TaryStop_Down,28,HC,X28,,,,,,,,,, DI,0,NG料阻挡下降端,NG_TaryStop_Down,28,HC,X28,,,,,,,,,,
......
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位 类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,贴标移栽机构X轴,Label_X_Axis,3,HC,,20000,30000,30000,500,8000,25000,10,100,0,0 AXIS,,贴标移栽机构X轴,Label_X_Axis,3,HC,,90000,3000000,3000000,500,17000,50000,10,1000,0,0
AXIS,,贴标移栽机构Y轴,Label_Y_Axis,2,HC,,20000,30000,30000,500,8000,25000,10,100,0,0 AXIS,,贴标移栽机构Y轴,Label_Y_Axis,2,HC,,90000,3000000,3000000,500,17000,50000,10,1000,0,0
AXIS,,贴标移栽机构Z轴,Label_Z_Axis,4,HC,,35000,60000,60000,1000,5000,20000,10,100,0,0 AXIS,,贴标移栽机构Z轴,Label_Z_Axis,4,HC,,90000,3000000,3000000,1000,13000,40000,10,1000,0,0
AXIS,,贴标移栽机构R轴,Label_R_Axis,5,HC,,200,600,600,20,50,300,500,100,0,0 AXIS,,贴标移栽机构R轴,Label_R_Axis,5,HC,,700,8100,8100,20,50,300,500,100,0,0
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,30,相机名称,CameraName,GigE:MV-CE200-10GC (00E78064892),,,,,,,,,,,, PRO,30,相机名称,CameraName,GigE:MV-CE200-10GC (00E78064892),,,,,,,,,,,,
PRO,30,图像料盘中心坐标X,Right_Batch_X,3201,,,,,,,,,,,, PRO,30,图像料盘中心坐标X,Right_Batch_X,3205,,,,,,,,,,,,
PRO,30,图像料盘中心坐标Y,Right_Batch_Y,1892,,,,,,,,,,,, PRO,30,图像料盘中心坐标Y,Right_Batch_Y,1889,,,,,,,,,,,,
PRO,30,贴标R轴0位角度差,Label_R_Angle_Diff,180,,,,,,,,,,,, PRO,0,贴标R轴0位角度差,Label_R_Angle_Diff,0,,,,,,,,,,,,
PRO,30,图像/X轴比值,Cam_Pixel_X_Ratio,147,,,,,,,,,,,, PRO,30,图像/X轴比值,Cam_Pixel_X_Ratio,141,,,,,,,,,,,,
PRO,30,图像/Y轴比值,Cam_Pixel_Y_Ratio,147,,,,,,,,,,,, PRO,30,图像/Y轴比值,Cam_Pixel_Y_Ratio,141,,,,,,,,,,,,
PRO,30,像素偏离位置7寸,Label_Offset_Pixel_7,0,,,,,,,,,,,, PRO,30,像素偏离位置7寸,Label_Offset_Pixel_7,0,,,,,,,,,,,,
PRO,30,像素偏离位置13寸,Label_Offset_Pixel_13,-564,,,,,,,,,,,, PRO,30,像素偏离位置13寸,Label_Offset_Pixel_13,-595,,,,,,,,,,,,
PRO,30,像素偏离位置15寸,Label_Offset_Pixel_15,200,,,,,,,,,,,, PRO,30,像素偏离位置15寸,Label_Offset_Pixel_15,200,,,,,,,,,,,,
PRO,30,贴标R轴偏移像素,Label_R_Offset_Pixel,0,,,,,,,,,,,, PRO,30,贴标R轴偏移像素,Label_R_Offset_Pixel,70,,,,,,,,,,,,
PRO,30,贴标R轴原点角度,Label_R_Zero_Angle,0,,,,,,,,,,,, PRO,0,贴标R轴原点角度,Label_R_Zero_Angle,0,,,,,,,,,,,,
PRO,30,贴标Z轴高度转换系数(1mm对应的脉冲),Label_Z_Axis_ChangeValue,10000,,,,,,,,,,,, PRO,30,贴标Z轴高度转换系数(1mm对应的脉冲),Label_Z_Axis_ChangeValue,128,,,,,,,,,,,,
PRO,30,贴标标签偏移X像素,Label_Offset_X,170,,,,,,,,,,,, PRO,30,贴标标签偏移X像素,Label_Offset_X,250,,,,,,,,,,,,
PRO,30,贴标标签偏移Y像素,Label_Offset_Y,210,,,,,,,,,,,, PRO,30,贴标标签偏移Y像素,Label_Offset_Y,230,,,,,,,,,,,,
PRO,30,贴标R轴最大角度,Label_R_MaxAngle,330,,,,,,,,,,,, PRO,30,贴标R轴最大角度,Label_R_MaxAngle,330,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,12,贴标X轴待机点P1,Label_X_P1,90407,,,14000,,,,,,,,, PRO,13,贴标X轴待机点P1,Label_X_P1,244500,,,700000,,,,,,,,,
PRO,12,贴标X轴取标点P2,Label_X_P2,56163,,,14000,,,,,,,,, PRO,13,贴标X轴取标点P2,Label_X_P2,244500,,,700000,,,,,,,,,
PRO,12,贴标X轴料盘中心基准点,Label_X_Base,367195,,,14000,,,,,,,,, PRO,13,贴标X轴料盘中心基准点,Label_X_Base,359627,,,700000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,13,贴标Y轴待机点P1,Label_Y_P1,246005,,,14000,,,,,,,,, PRO,12,贴标Y轴待机点P1,Label_Y_P1,111830,,,700000,,,,,,,,,
PRO,13,贴标Y轴取标点P2,Label_Y_P2,246005,,,14000,,,,,,,,, PRO,12,贴标Y轴取标点P2,Label_Y_P2,49563,,,700000,,,,,,,,,
PRO,13,贴标Y轴料盘中心基准点,Label_Y_Base,358598,,,14000,,,,,,,,, PRO,12,贴标Y轴料盘中心基准点,Label_Y_Base,367433,,,700000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,14,贴标Z轴待机点P1,Label_Z_P1,78338,,,2000,,,,,,,,, PRO,14,贴标Z轴待机点P1,Label_Z_P1,78338,,,700000,,,,,,,,,
PRO,14,贴标Z轴取标前点P2,Label_Z_P2,78338,,,2000,,,,,,,,, PRO,14,贴标Z轴取标前点P2,Label_Z_P2,41000,,,700000,,,,,,,,,
PRO,14,贴标Z轴取标点P3,Label_Z_P3,96504,,,2000,,,,,,,,, PRO,14,贴标Z轴取标点P3,Label_Z_P3,99900,,,700000,,,,,,,,,
PRO,14,贴标Z轴贴标前点P4,Label_Z_P4,85226,,,2000,,,,,,,,, PRO,14,贴标Z轴贴标前点P4,Label_Z_P4,85226,,,700000,,,,,,,,,
PRO,14,贴标Z轴贴标点P5,Label_Z_P5,131924,,,2000,,,,,,,,, PRO,14,贴标Z轴贴标点P5,Label_Z_P5,132000,,,700000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,15,贴标R轴待机点P1,Label_R_P1,560,,,20,,,,,,,,, PRO,15,贴标R轴待机点P1,Label_R_P1,560,,,1200,,,,,,,,,
PRO,15,贴标R轴取标点P2,Label_R_P2,562,,,20,,,,,,,,, PRO,15,贴标R轴取标点P2,Label_R_P2,562,,,1200,,,,,,,,,
PRO,15,贴标R轴360度脉冲,Label_R_360,681,,,20,,,,,,,,, PRO,15,贴标R轴360度脉冲,Label_R_360,681,,,900,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
DI,0,急停(贴标设备),SuddenStop_BTN,16,HC,X16,,,,,,,,,, DI,0,急停(贴标设备),SuddenStop_BTN,16,HC,X16,,,,,,,,,,
DI,0,贴标机构复位,Reset_BTN,17,HC,X17,,,,,,,,,, DI,0,贴标机构复位,Reset_BTN,17,HC,X17,,,,,,,,,,
......
类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位 类型,分类编号,说明,名称,属性值,设备名称,电器定义,目标速度,加速时间,减速时间,原点低速度,原点高速,原点加速度,脉冲最小误差,脉冲最大误差,脉冲最小限位,脉冲最大限位
AXIS,,出料提升轴,T_Batch_Axis,6,HC,,8000,15000,15000,500,4000,15000,10,100,0,0 AXIS,,出料提升轴,T_Batch_Axis,6,HC,,8000,30000,30000,500,4000,15000,10,1000,0,0
AXIS,,出料移栽轴,T_Pan_Axis,7,HC,,20000,30000,30000,500,4000,15000,10,100,0,0 AXIS,,出料移栽轴,T_Pan_Axis,7,HC,,20000,200000,200000,500,4000,15000,10,1000,0,0
AXIS,,出料升降轴,T_Updown_Axis,8,HC,,20000,30000,30000,500,4000,15000,10,100,0,0 AXIS,,出料升降轴,T_Updown_Axis,8,HC,,20000,200000,200000,500,4000,15000,10,1000,0,0
AXIS,,皮带线出口定位,T_TrayPos_Axis,9,HC,,35000,60000,60000,1000,5000,20000,500,100,0,0 AXIS,,皮带线出口定位,T_TrayPos_Axis,9,HC,,35000,100000,100000,1000,5000,20000,500,100,0,0
AXIS,,出料移栽Y轴,T_Y_Axis,10,HC,,20000,30000,30000,500,4000,15000,10,100,0,0 AXIS,,出料移栽Y轴,T_Y_Axis,10,HC,,20000,30000,30000,500,4000,15000,10,100,0,0
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,16,提升轴待机点 P1,BatchAxis_P1,500,,,8000,,,,,,,,, PRO,16,提升轴待机点 P1,BatchAxis_P1,500,,,8000,,,,,,,,,
PRO,16,提升轴上升目标点_P2,BatchAxis_P2,77756,,,8000,,,,,,,,, PRO,16,提升轴上升目标点_P2,BatchAxis_P2,78451,,,8000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,17,横移待机取料点P1,Pan_P1,5700,,,20000,,,,,,,,, PRO,17,横移待机取料点P1,Pan_P1,5326,,,100000,,,,,,,,,
PRO,17,横移放料基准点P2,Pan_P2,77614,,,20000,,,,,,,,, PRO,17,横移放料点P2,Pan_P2,75933,,,100000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,20,Y轴待机取料点P1,Y_P1,5700,,,20000,,,,,,,,, PRO,20,Y轴待机取料点P1,Y_P1,51136,,,100000,,,,,,,,,
PRO,20,Y轴放料基准点P2,Y_P2,77614,,,20000,,,,,,,,, PRO,20,Y轴放料基准点P2,Y_P2,51136,,,100000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,18,升降轴待机点P1,UpdownAxis_P1,7,,,20000,,,,,,,,, PRO,18,升降轴待机点P1,UpdownAxis_P1,7,,,100000,,,,,,,,,
PRO,18,升降轴取料点P2,UpdownAxis_P2,38420,,,20000,,,,,,,,, PRO,18,升降轴取料点P2,UpdownAxis_P2,36905,,,100000,,,,,,,,,
PRO,18,升降轴放料点P3,UpdownAxis_P3,6699,,,20000,,,,,,,,, PRO,18,升降轴放料点P3,UpdownAxis_P3,6800,,,100000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,19,料盘定位待机点P1,TrayPos_P1,0,,,35000,,,,,,,,, PRO,19,料盘定位待机点P1,TrayPos_P1,0,,,50000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,30,提升轴高度转换系数(1mm对应的脉冲),BatchAxis_ChangeValue,1000,,,,,,,,,,,, PRO,30,提升轴高度转换系数(1mm对应的脉冲),BatchAxis_ChangeValue,128,,,,,,,,,,,,
PRO,30,升降轴高度转换系数(1mm对应的脉冲),UpdownAxis_ChangeValue,1000,,,,,,,,,,,, PRO,30,升降轴高度转换系数(1mm对应的脉冲),UpdownAxis_ChangeValue,128,,,,,,,,,,,,
PRO,30,入口阻挡定位列表,TrayPos_List,7=18164;13=5994;15=2347;,,,,,,,,,,,, PRO,30,入口阻挡定位列表,TrayPos_List,7=18164;13=5400;15=1600;,,,,,,,,,,,,
PRO,30,料串定位相机,String_Camera,GigE:MV-CE200-10GC (00F98806639),,,,,,,,,,,, PRO,30,料串定位相机,String_Camera,GigE:MV-CE200-10GC (00E78064926),,,,,,,,,,,,
PRO,30,料串中心点X坐标,String_Center_X,1000,,,,,,,,,,,, PRO,30,料串中心点X坐标,String_Center_X,721,,,,,,,,,,,,
PRO,30,料串中心点Y坐标,String_Center_Y,1000,,,,,,,,,,,, PRO,30,料串中心点Y坐标,String_Center_Y,800,,,,,,,,,,,,
PRO,30,料串允许偏离像素值,String_Offset_Range_Px,1000,,,,,,,,,,,, PRO,30,料串允许偏离像素值,String_Offset_Range_Px,60,,,,,,,,,,,,
PRO,30,料串图像/X轴比值,Cam_Pixel_X_Ratio,147,,,,,,,,,,,, PRO,30,料串图像/X轴比值,Cam_Pixel_X_Ratio,19,,,,,,,,,,,,
PRO,30,料串图像/Y轴比值,Cam_Pixel_Y_Ratio,147,,,,,,,,,,,, PRO,30,料串图像/Y轴比值,Cam_Pixel_Y_Ratio,143,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
DI,0,皮带线出口料盘检测,End_Line_Tray_Check,41,HC,X41,,,,,,,,,, DI,0,皮带线出口料盘检测,End_Line_Tray_Check,41,HC,X41,,,,,,,,,,
DI,0,皮带线出口顶升料盘检测,End_Lift_Tray_Check,42,HC,X42,,,,,,,,,, DI,0,皮带线出口顶升料盘检测,End_Lift_Tray_Check,42,HC,X42,,,,,,,,,,
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
AXIS,,入口皮带线,Line_Entry_Axis,0,HC,,500,2000,2000,50,100,500,10,100,0,0 AXIS,,入口皮带线,Line_Entry_Axis,0,HC,,500,2000,2000,50,100,500,10,100,0,0
AXIS,,中间皮带线,Line_In_Axis,1,HC,,500,2000,2000,50,100,500,10,100,0,0 AXIS,,中间皮带线,Line_In_Axis,1,HC,,500,2000,2000,50,100,500,10,100,0,0
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,10,入口伺服相对运动量,Line_Entry_Relative,4000,,,1000,,,,,,,,, PRO,10,入口伺服相对运动量,Line_Entry_Relative,4000,,,2000,,,,,,,,,
PRO,10,机内伺服相对运动量,Line_In_Relative,7000,,,1000,,,,,,,,, PRO,10,机内伺服相对运动量,Line_In_Relative,6300,,,2000,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,30,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,, PRO,30,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,
PRO,30,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,, PRO,30,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
......
{"20.K0767.008":"IP_Template_PARTS,CountTemplate\\4b47088a-e49a-439e-b5f5-01f01d041d8e.tpl","062.10007.0371":"IP_Template_PARTS,CountTemplate\\d548ffae-f6b4-40b4-8124-d767400241c9.tpl","66.22236.A4L":"IP_Template_PARTS,CountTemplate\\d548ffae-f6b4-40b4-8124-d767400241c9.tpl","78.10510.5SL":"auto"}
\ No newline at end of file \ No newline at end of file
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
<item key="AngleChange " ver="10" value="83" /> <item key="AngleChange " ver="10" value="83" />
<item key="ElectricGripperPort" ver="10" value="COM11" /> <item key="ElectricGripperPort" ver="10" value="COM11" />
<item key="XRay_Port" ver="10" value="COM5" /> <item key="XRay_Port" ver="10" value="COM5" />
<item key="XRay_Voltage" ver="10" value="060.0" /> <item key="XRay_Voltage" ver="10" value="60.0" />
<item key="XRay_Current" ver="10" value="0500" /> <item key="XRay_Current" ver="10" value="0500" />
<item key="ShrinkOffset" ver="10" value="150" />
<item key="upload_Counter" ver="10" value="X_RAY1" /> <item key="upload_Counter" ver="10" value="X_RAY1" />
<item key="upload_labelPrinter" ver="10" value="X_RAY1" /> <item key="upload_labelPrinter" ver="10" value="1" />
<item key="WistonAgvServerIP" ver="10" value="127.0.0.1" /> <item key="WistonAgvServerIP" ver="10" value="127.0.0.1" />
<item key="WistonAgvServerPort" ver="10" value="6065" /> <item key="WistonAgvServerPort" ver="10" value="6065" />
</config> </config>
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -58,6 +60,9 @@ ...@@ -58,6 +60,9 @@
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" /> <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.114.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath> <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
...@@ -102,6 +107,7 @@ ...@@ -102,6 +107,7 @@
<Compile Include="DeviceLibrary\CodeManager.cs" /> <Compile Include="DeviceLibrary\CodeManager.cs" />
<Compile Include="AutoScan\RobotManage.cs" /> <Compile Include="AutoScan\RobotManage.cs" />
<Compile Include="AutoScan\common\IRobot.cs" /> <Compile Include="AutoScan\common\IRobot.cs" />
<Compile Include="DeviceLibrary\databaseProc.cs" />
<Compile Include="DeviceLibrary\ElectricGripper.cs" /> <Compile Include="DeviceLibrary\ElectricGripper.cs" />
<Compile Include="DeviceLibrary\eyemlib.cs" /> <Compile Include="DeviceLibrary\eyemlib.cs" />
<Compile Include="DeviceLibrary\IAxisManager.cs" /> <Compile Include="DeviceLibrary\IAxisManager.cs" />
...@@ -174,4 +180,11 @@ ...@@ -174,4 +180,11 @@
</None> </None>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.114.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target>
</Project> </Project>
\ No newline at end of file \ No newline at end of file
...@@ -53,7 +53,7 @@ namespace DeviceLibrary ...@@ -53,7 +53,7 @@ namespace DeviceLibrary
} }
if (!IsBusy) if (!IsBusy)
{ {
axis.Push(50, 5.5f, 5); axis.Push(50, 5.5f, 50);
clampTimes++; clampTimes++;
if (moveInfo != null) if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
...@@ -81,7 +81,7 @@ namespace DeviceLibrary ...@@ -81,7 +81,7 @@ namespace DeviceLibrary
} }
if (!IsBusy) if (!IsBusy)
{ {
axis.MoveAbsolute(0.2f, 5, 15, 15, 1f); axis.MoveAbsolute(0.2f, 50, 150, 150, 1f);
clampTimes = 0; clampTimes = 0;
if (moveInfo != null) if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); moveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.114.0" targetFramework="net461" />
<package id="System.Data.SQLite.Core" version="1.0.114.3" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="AutoCountMachine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="DeviceLibrary.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="Conifg\" /> <add key="CodeParamPath" value="Conifg\" />
<add key="CodeCount" value="3" /> <add key="CodeCount" value="3" />
<add key="Code_Block_Size_List" value="11" /> <add key="Code_Block_Size_List" value="11" />
<add key="inputCounterDataByXRayMachine" value="http://10.69.221.80/SCTAEXTERNAL001/api/inputCounterDataByXRayMachine" />
<add key="DetermineReelStorageLocation" value="http://10.69.221.80/SCTARLC001/api/RLC/DetermineReelStorageLocation" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -27,6 +27,8 @@ namespace AutoCountMachine ...@@ -27,6 +27,8 @@ namespace AutoCountMachine
//OcrProcess.Run(); //OcrProcess.Run();
//ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9); //ServerConn.inputCounterDataByXRayMachine("20.K0784.008-615313|1KQ-2111|5000|A2061531315212446|PANASONIC", 9);
//return; //return;
databaseProc.Current.InsertOrUpdateRI(1, "123", "234", true, "abc", 345, "asd", "fgh", "try");
_ = new Mutex(true, Application.ProductName, out bool ret); _ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret) if (!ret)
......
...@@ -95,6 +95,12 @@ ...@@ -95,6 +95,12 @@
<DependentUpon>FrmPassword.cs</DependentUpon> <DependentUpon>FrmPassword.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UCCOMMON\Role.cs" /> <Compile Include="UCCOMMON\Role.cs" />
<Compile Include="SettingControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SettingControl.Designer.cs">
<DependentUpon>SettingControl.cs</DependentUpon>
</Compile>
<Compile Include="UCCOMMON\VerticalProgressBar.cs"> <Compile Include="UCCOMMON\VerticalProgressBar.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
...@@ -179,6 +185,9 @@ ...@@ -179,6 +185,9 @@
<EmbeddedResource Include="LabelControl.resx"> <EmbeddedResource Include="LabelControl.resx">
<DependentUpon>LabelControl.cs</DependentUpon> <DependentUpon>LabelControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingControl.resx">
<DependentUpon>SettingControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="XrayControl.resx"> <EmbeddedResource Include="XrayControl.resx">
<DependentUpon>XrayControl.cs</DependentUpon> <DependentUpon>XrayControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
using ConfigHelper;
using DeviceLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoCountMachine
{
using crc = OnlineStore.CodeResourceControl;
public partial class SettingControl : UserControl
{
public SettingControl()
{
InitializeComponent();
RoleManger.RoleChange += RoleManger_RoleChange;
this.VisibleChanged += SettingControl_VisibleChanged;
label_count.Text = "";
}
private void SettingControl_VisibleChanged(object sender, EventArgs e)
{
var t = DateTime.Now;
DateTime d = new DateTime(t.Year, t.Month, t.Day, 0, 0, 0);
dateTimePicker_start.Value = d;
dateTimePicker_end.Value = DateTime.Now;
}
private void cb_EnableBuzzer_CheckedChanged(object sender, EventArgs e)
{
Config.Set("EnableBuzzer", cb_EnableBuzzer.Checked);
Config.SaveChange();
AlarmBuzzer.Enable = cb_EnableBuzzer.Checked;
}
private void btn_setadminpassword_Click(object sender, EventArgs e)
{
FrmPassword frmPassword = new FrmPassword();
crc.LanguageProcess(frmPassword);
frmPassword.EditMode = true;
frmPassword.ShowDialog();
}
private void cb_autorun_CheckedChanged(object sender, EventArgs e)
{
if (cb_autorun.Checked)
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 1);
AutoRun(Application.ExecutablePath, true);
}
else
{
ConfigAppSettings.SaveValue(Setting_Init.App_AutoRun, 0);
AutoRun(Application.ExecutablePath, false);
}
}
public static void AutoRun(string strName, bool value)
{
try
{
//创建启动对象
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
//设置运行文件
startInfo.FileName = System.Windows.Forms.Application.StartupPath + "\\AuToRunManager.exe";
//设置启动参数
startInfo.Arguments = String.Join(" ", new string[2] { strName, value.ToString() });
//设置启动动作,确保以管理员身份运行
startInfo.Verb = "runas";
//如果不是管理员,则启动UAC
System.Diagnostics.Process.Start(startInfo);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void SettingControl_Load(object sender, EventArgs e)
{
if (DesignMode)
return;
cb_EnableBuzzer.Checked = Config.Get("EnableBuzzer", true);
cb_autorun.Checked = Config.Get("App_AutoRun", false);
this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged);
rb_datafilter_today.Checked = true;
}
private void RoleManger_RoleChange(object sender, Role e)
{
tabPage1.Enabled = false;
if (e != Role.Admin)
return;
tabPage1.Enabled = true;
}
private void rb_datafilter_today_CheckedChanged(object sender, EventArgs e)
{
var t = DateTime.Now;
DateTime d = new DateTime(t.Year, t.Month, t.Day, 0, 0, 0);
setData(d, DateTime.Now);
}
private void rb_datafilter_thismonth_CheckedChanged(object sender, EventArgs e)
{
var t = DateTime.Now;
DateTime d = new DateTime(t.Year, t.Month, 1, 0, 0, 0);
setData(d, DateTime.Now);
}
private void rb_datafilter_lastMonth_CheckedChanged(object sender, EventArgs e)
{
var t = DateTime.Now;
DateTime d = new DateTime(t.Year, t.Month, 1, 0, 0, 0);
DateTime ed = new DateTime(t.Year, t.Month, 1, 0, 0, 0);
setData(d, ed.AddMonths(1));
}
private void rb_datafilter_last30_CheckedChanged(object sender, EventArgs e)
{
setData(DateTime.Now.AddDays(-30), DateTime.Now);
}
void setData(DateTime startData, DateTime endDate)
{
DataTable dt = databaseProc.Current.GetDatabydate(startData, endDate);
dataGridView1.DataSource = dt;
dataGridView1.Columns[0].HeaderText = "";//crc.GetString("dataGrid_ID", "条码");
dataGridView1.Columns[1].HeaderText = "PN";//crc.GetString("dataGrid_Qty", "数量");
dataGridView1.Columns[2].HeaderText = "Reel ID"; //crc.GetString("dataGrid_Slot", "盘位");
dataGridView1.Columns[3].HeaderText = "Is NG"; //crc.GetString("dataGrid_DateTime", "时间");
dataGridView1.Columns[4].HeaderText = "Ng Msg";
dataGridView1.Columns[5].HeaderText = "QTY";
dataGridView1.Columns[6].HeaderText = "Label";
dataGridView1.Columns[7].HeaderText = "Orther Msg";
dataGridView1.Columns[8].HeaderText = "2D BarCode";
dataGridView1.Columns[9].HeaderText = "Date";
dataGridView1.Columns[9].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
dataGridView1.Columns[8].DisplayIndex = 9;
dataGridView1.Columns[0].Visible = false;
dataGridView1.Columns[6].Visible = false;
dataGridView1.Columns[7].Visible = false;
label_count.Text = crc.GetString("query_count","查询到{0}条结果.",dt.Rows.Count);
}
private void dateTimePicker_start_ValueChanged(object sender, EventArgs e)
{
if (rb_datafilter_custom.Checked && dateTimePicker_end.Value> dateTimePicker_start.Value)
setData(dateTimePicker_start.Value, dateTimePicker_end.Value);
}
private void dateTimePicker_end_ValueChanged(object sender, EventArgs e)
{
if (rb_datafilter_custom.Checked && dateTimePicker_end.Value > dateTimePicker_start.Value)
setData(dateTimePicker_start.Value, dateTimePicker_end.Value);
}
private void rb_datafilter_custom_CheckedChanged(object sender, EventArgs e)
{
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -69,7 +69,7 @@ namespace AutoCountMachine ...@@ -69,7 +69,7 @@ namespace AutoCountMachine
// //
// btn_NGClear // btn_NGClear
// //
this.btn_NGClear.Location = new System.Drawing.Point(143, 157); this.btn_NGClear.Location = new System.Drawing.Point(143, 121);
this.btn_NGClear.Name = "btn_NGClear"; this.btn_NGClear.Name = "btn_NGClear";
this.btn_NGClear.Size = new System.Drawing.Size(45, 40); this.btn_NGClear.Size = new System.Drawing.Size(45, 40);
this.btn_NGClear.TabIndex = 2; this.btn_NGClear.TabIndex = 2;
...@@ -79,7 +79,7 @@ namespace AutoCountMachine ...@@ -79,7 +79,7 @@ namespace AutoCountMachine
// //
// btn_MSDClear // btn_MSDClear
// //
this.btn_MSDClear.Location = new System.Drawing.Point(77, 157); this.btn_MSDClear.Location = new System.Drawing.Point(77, 121);
this.btn_MSDClear.Name = "btn_MSDClear"; this.btn_MSDClear.Name = "btn_MSDClear";
this.btn_MSDClear.Size = new System.Drawing.Size(45, 40); this.btn_MSDClear.Size = new System.Drawing.Size(45, 40);
this.btn_MSDClear.TabIndex = 2; this.btn_MSDClear.TabIndex = 2;
...@@ -89,7 +89,7 @@ namespace AutoCountMachine ...@@ -89,7 +89,7 @@ namespace AutoCountMachine
// //
// btn_PaperClear // btn_PaperClear
// //
this.btn_PaperClear.Location = new System.Drawing.Point(13, 157); this.btn_PaperClear.Location = new System.Drawing.Point(13, 121);
this.btn_PaperClear.Name = "btn_PaperClear"; this.btn_PaperClear.Name = "btn_PaperClear";
this.btn_PaperClear.Size = new System.Drawing.Size(45, 40); this.btn_PaperClear.Size = new System.Drawing.Size(45, 40);
this.btn_PaperClear.TabIndex = 2; this.btn_PaperClear.TabIndex = 2;
...@@ -101,14 +101,14 @@ namespace AutoCountMachine ...@@ -101,14 +101,14 @@ namespace AutoCountMachine
// //
this.PaperCountBar.Location = new System.Drawing.Point(13, 21); this.PaperCountBar.Location = new System.Drawing.Point(13, 21);
this.PaperCountBar.Name = "PaperCountBar"; this.PaperCountBar.Name = "PaperCountBar";
this.PaperCountBar.Size = new System.Drawing.Size(45, 130); this.PaperCountBar.Size = new System.Drawing.Size(45, 94);
this.PaperCountBar.TabIndex = 0; this.PaperCountBar.TabIndex = 0;
// //
// MsdCountBar // MsdCountBar
// //
this.MsdCountBar.Location = new System.Drawing.Point(77, 21); this.MsdCountBar.Location = new System.Drawing.Point(77, 21);
this.MsdCountBar.Name = "MsdCountBar"; this.MsdCountBar.Name = "MsdCountBar";
this.MsdCountBar.Size = new System.Drawing.Size(45, 130); this.MsdCountBar.Size = new System.Drawing.Size(45, 94);
this.MsdCountBar.TabIndex = 0; this.MsdCountBar.TabIndex = 0;
// //
// NgCountBar // NgCountBar
...@@ -117,7 +117,7 @@ namespace AutoCountMachine ...@@ -117,7 +117,7 @@ namespace AutoCountMachine
this.NgCountBar.Location = new System.Drawing.Point(143, 21); this.NgCountBar.Location = new System.Drawing.Point(143, 21);
this.NgCountBar.MarqueeAnimationSpeed = 0; this.NgCountBar.MarqueeAnimationSpeed = 0;
this.NgCountBar.Name = "NgCountBar"; this.NgCountBar.Name = "NgCountBar";
this.NgCountBar.Size = new System.Drawing.Size(45, 130); this.NgCountBar.Size = new System.Drawing.Size(45, 94);
this.NgCountBar.TabIndex = 0; this.NgCountBar.TabIndex = 0;
// //
// BoxResetControl // BoxResetControl
......
...@@ -215,6 +215,9 @@ namespace AutoCountMachine ...@@ -215,6 +215,9 @@ namespace AutoCountMachine
PropertyInfo pi = Config.GetType().GetProperty(textBox.Name); PropertyInfo pi = Config.GetType().GetProperty(textBox.Name);
if (pi != null) if (pi != null)
{ {
var cc = Config.configList.Find(new Predicate<ConfigBase>((c) => { return c.ProName == textBox.Name; }));
if (cc != null)
cc.ProValue = textBox.Text;
if (pi.PropertyType.Name == "Int32") if (pi.PropertyType.Name == "Int32")
pi.SetValue(Config, int.Parse(textBox.Text)); pi.SetValue(Config, int.Parse(textBox.Text));
else if (pi.PropertyType.Name == "Double") else if (pi.PropertyType.Name == "Double")
......
...@@ -13,6 +13,7 @@ using System.Windows.Forms; ...@@ -13,6 +13,7 @@ using System.Windows.Forms;
namespace AutoCountMachine namespace AutoCountMachine
{ {
using crc = OnlineStore.CodeResourceControl;
public class CylinderButton : Button public class CylinderButton : Button
{ {
Timer timer; Timer timer;
...@@ -38,7 +39,8 @@ namespace AutoCountMachine ...@@ -38,7 +39,8 @@ namespace AutoCountMachine
private void Timer_Tick(object sender, EventArgs e) private void Timer_Tick(object sender, EventArgs e)
{ {
StateUpdate(); if(Visible)
StateUpdate();
} }
private void RobotManage_LoadFinishEvent(bool state, string msg) private void RobotManage_LoadFinishEvent(bool state, string msg)
{ {
...@@ -114,12 +116,12 @@ namespace AutoCountMachine ...@@ -114,12 +116,12 @@ namespace AutoCountMachine
{ {
if (io_state.Equals(IO_VALUE.LOW)) if (io_state.Equals(IO_VALUE.LOW))
{ {
this.Text = configio_high.ElectricalDefinition+" "+configio_high.Explain; this.Text = configio_high.ElectricalDefinition+" "+crc.GetString(configio_high.ProName,configio_high.Explain);
this.BackColor = Color.White; this.BackColor = Color.White;
} }
else else
{ {
this.Text = configio_low.ElectricalDefinition + " "+configio_low.Explain; this.Text = configio_low.ElectricalDefinition + " "+ crc.GetString(configio_low.ProName,configio_low.Explain);
this.BackColor = Color.LightGreen; this.BackColor = Color.LightGreen;
} }
} }
...@@ -127,13 +129,13 @@ namespace AutoCountMachine ...@@ -127,13 +129,13 @@ namespace AutoCountMachine
{ {
if (io_state.Equals(IO_VALUE.LOW)) if (io_state.Equals(IO_VALUE.LOW))
{ {
this.Text = "(ON) " + configio_high.ElectricalDefinition + " " + configio_high.Explain; this.Text = "(ON) " + configio_high.ElectricalDefinition + " " + crc.GetString(configio_high.ProName, configio_high.Explain);
this.BackColor = Color.White; this.BackColor = Color.White;
} }
else if (configio_low == null) else if (configio_low == null)
{ {
this.Text = "(OFF) " + configio_high.ElectricalDefinition + " " + configio_high.Explain; this.Text = "(OFF) " + configio_high.ElectricalDefinition + " " + crc.GetString(configio_high.ProName, configio_high.Explain);
this.BackColor = Color.LightGreen; this.BackColor = Color.LightGreen;
} }
} }
......
...@@ -118,11 +118,11 @@ namespace AutoCountMachine ...@@ -118,11 +118,11 @@ namespace AutoCountMachine
private void LoadADIOList() private void LoadADIOList()
{ {
//ListViewItem lvi = new ListViewItem(new string[] { "", msg.datetime.ToString(), msg.msgtxt }); //ListViewItem lvi = new ListViewItem(new string[] { "", msg.datetime.ToString(), msg.msgtxt });
listView_adio.Columns.Add("名称",200); //listView_adio.Columns.Add("名称",200);
listView_adio.Columns.Add("定义", 150); listView_adio.Columns.Add("Define", 150);
listView_adio.Columns.Add(""); listView_adio.Columns.Add("Value");
listView_adio.Columns.Add("基准"); listView_adio.Columns.Add("Base");
listView_adio.Columns.Add("计算结果"); listView_adio.Columns.Add("Result");
t1.Start(); t1.Start();
} }
...@@ -138,7 +138,7 @@ namespace AutoCountMachine ...@@ -138,7 +138,7 @@ namespace AutoCountMachine
var v = IOManager.GetADIOValue("HC", 0, ushort.Parse(ioValue.ProValue)); var v = IOManager.GetADIOValue("HC", 0, ushort.Parse(ioValue.ProValue));
var Tray_ADIO_Value = ((Config_XRay)Config).Tray_ADIO_Value; var Tray_ADIO_Value = ((Config_XRay)Config).Tray_ADIO_Value;
var c = ((int)v- basevalue) / Tray_ADIO_Value; var c = ((int)v- basevalue) / Tray_ADIO_Value;
ListViewItem lvi = new ListViewItem(new string[] { ioValue.Explain, ioValue.ProName, v.ToString(), basevalue.ToString(), c.ToString() }); ListViewItem lvi = new ListViewItem(new string[] { /*ioValue.Explain,*/ioValue.ProName, v.ToString(), basevalue.ToString(), c.ToString() });
listView_adio.Items.Add(lvi); listView_adio.Items.Add(lvi);
} }
this.ResumeLayout(true); this.ResumeLayout(true);
......
evt_type: "byereal",
evt_dt: 1501546994645,
evt_pubBy: "nifi",
Site: "WKS",
Plant: "F230",
Dept: "FA",
Line: "CA3B",
MachineName: "Screwmachine inline",
MachineModel: "LN600D",
MachineSN: "LNSC000001",
MachineN0: "NO.0001",
MechineIP: "172.0.47.110",
Model: "LV115",
Program: "V115",
OperatorID: "K0312187",
Status: "Run",
Errcode: "SCR-C01001"
evt_type: "bypcs",
evt_dt: 1501546994645,
evt_pubBy: "nifi",
Site: "WKS",
Plant: "F230",
Dept: "FA",
Line: "CA3B",
MachineName: "Screwmachine inline",
MachineModel: "LN600D",
MachineSN: "LNSC000001",
MachineN0: "NO.0001",
MechineIP: "172.0.47.110",
Model: "LV115",
Program: "V115",
OperatorID: null,
USN:null,
StartTime:null,
EndTime:null,
CycleTime:null,
IsOK:"OK/NG"
Status: "Run",
Errcode: "SCR-C01001"
NGPICNO:USN+UTC
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!