Commit f36d1d7b LN

所有的料盘都去XRay拍照,增加查询界面

1 个父辈 bb31ab79
<?xml version="1.0"?>
<doc>
<assembly>
<name>Retrospect</name>
</assembly>
<members>
<member name="T:BLL.SQLite">
<summary>
SQLite数据库
</summary>
</member>
<member name="M:BLL.SQLite.#ctor(System.String)">
<summary>
SQLite数据库
</summary>
<param name="path"></param>
</member>
<member name="P:BLL.SQLite.IsCon">
<summary>
是否连接
</summary>
</member>
<member name="P:BLL.SQLite.ErrInfo">
<summary>
错误信息
</summary>
</member>
<member name="M:BLL.SQLite.Create">
<summary>
创建数据库
</summary>
<returns></returns>
</member>
<member name="M:BLL.SQLite.Connect">
<summary>
连接到数据库
</summary>
<returns></returns>
</member>
<member name="M:BLL.SQLite.Close">
<summary>
关闭连接数据库
</summary>
</member>
<member name="M:BLL.SQLite.Insert(System.String,System.Int32,System.Int32,System.Int32,System.String)">
<summary>
插入数据
</summary>
<param name="qrCode"></param>
<param name="width"></param>
<param name="height"></param>
<param name="count"></param>
<param name="imagePath"></param>
<returns></returns>
</member>
<member name="M:BLL.SQLite.Select(System.String,System.String,System.String,System.String[][]@)">
<summary>
查询数据
</summary>
<param name="qrcode"></param>
<param name="dataLower"></param>
<param name="dataUpper"></param>
<param name="data"></param>
<returns></returns>
</member>
</members>
</doc>
此文件的差异太大,无法显示。
......@@ -51,6 +51,7 @@
<add key ="XRay_Data" value ="2020-6-2"/>
<add key ="ThresholdValue" value ="30"/>
<add key ="CounParamConfig" value ="\XRAY\countParam.csv"/>
<add key ="DataPath" value ="\data\DB.db3"/>
</appSettings>
<log4net>
......
......@@ -79,12 +79,16 @@
<Reference Include="log4net">
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="Retrospect">
<HintPath>..\..\dll\database\Retrospect.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
......@@ -105,6 +109,12 @@
<Compile Include="agvtest\FrmAgvTest.Designer.cs">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</Compile>
<Compile Include="FrmAnalyze.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmAnalyze.Designer.cs">
<DependentUpon>FrmAnalyze.cs</DependentUpon>
</Compile>
<Compile Include="useControl\AxisMoveControl.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -165,6 +175,9 @@
<EmbeddedResource Include="agvtest\FrmAgvTest.resx">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmAnalyze.resx">
<DependentUpon>FrmAnalyze.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="useControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource>
......@@ -202,6 +215,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="data\DB.db3">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......

using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.AutoCountClient
{
partial class FrmAnalyze : FrmBase
{
public FrmAnalyze()
{
InitializeComponent();
}
public static DateTime PreStartTime = new DateTime(0);
public static DateTime PreEndTime = new DateTime(0);
private void FrmAnalyze_Load(object sender, EventArgs e)
{
if (PreStartTime.Ticks > 0 && PreEndTime.Ticks > 0)
{
dtpStartTime.Value = PreStartTime;
dtpEndTime.Value = PreEndTime;
}
else
{
DateTime time1 = DateTime.Now.AddDays(-4);
dtpStartTime.Value = new DateTime(time1.Year, time1.Month, time1.Day, 0, 0, 0);
DateTime time = DateTime.Now.AddDays(-1);
dtpEndTime.Value = new DateTime(time.Year, time.Month, time.Day, 23, 59, 59);
dtpEndTime.Value = DateTime.Now;
}
}
private void btnSearch_Click(object sender, EventArgs e)
{
DateTime startTime = dtpStartTime.Value;
DateTime endTime = dtpEndTime.Value;
if (startTime < DateTime.Now.AddDays(-30))
{
MessageBox.Show("只能查询近30天的日志!");
dtpStartTime.Focus();
return;
}
if (endTime > DateTime.Now)
{
MessageBox.Show("只能查询近今天之前的日志!");
dtpEndTime.Focus();
return;
}
PreStartTime = startTime;
PreEndTime = endTime;
string code = txtCode.Text.Trim();
string[][] array = null;
bool result = RobotManager.robot.sQLite.Select(code, startTime.ToString(), endTime.ToLongTimeString(), out array);
LogUtil.error("查数据【" + code + "】【" + startTime.ToString() + "】【" + endTime.ToLongTimeString() + "】结果:" + result + "," + RobotManager.robot.sQLite.ErrInfo);
if (array != null && array.Length > 0)
{
}
}
private void btnBack_Click(object sender, EventArgs e)
{
this.Close();
}
}
public class XRayHistory
{
public string Code = "";
public int Height = 0;
public int Width = 0;
public int Count = 0;
public string FileName = "";
}
}
......@@ -69,6 +69,8 @@
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.标签编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.清空日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.复制日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
......@@ -429,37 +431,39 @@
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(160, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "AGV调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
//
// 标签编辑ToolStripMenuItem
//
this.标签编辑ToolStripMenuItem.Name = "标签编辑ToolStripMenuItem";
this.标签编辑ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.标签编辑ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.标签编辑ToolStripMenuItem.Text = "标签编辑";
this.标签编辑ToolStripMenuItem.Click += new System.EventHandler(this.标签编辑ToolStripMenuItem_Click);
//
// 帮助ToolStripMenuItem
//
this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem3,
this.toolStripSeparator5,
this.清空日志ToolStripMenuItem,
this.toolStripSeparator10,
this.复制日志ToolStripMenuItem,
......@@ -469,34 +473,46 @@
this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(69, 25);
this.帮助ToolStripMenuItem.Text = " 系统 ";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "历史记录";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
//
// 清空日志ToolStripMenuItem
//
this.清空日志ToolStripMenuItem.Name = "清空日志ToolStripMenuItem";
this.清空日志ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.清空日志ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.清空日志ToolStripMenuItem.Text = "清空日志";
this.清空日志ToolStripMenuItem.Click += new System.EventHandler(this.清空日志ToolStripMenuItem_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator10.Size = new System.Drawing.Size(177, 6);
//
// 复制日志ToolStripMenuItem
//
this.复制日志ToolStripMenuItem.Name = "复制日志ToolStripMenuItem";
this.复制日志ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复制日志ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复制日志ToolStripMenuItem.Text = "复制日志";
this.复制日志ToolStripMenuItem.Click += new System.EventHandler(this.复制日志ToolStripMenuItem_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator11.Size = new System.Drawing.Size(177, 6);
//
// 版本号ToolStripMenuItem
//
this.版本号ToolStripMenuItem.Name = "版本号ToolStripMenuItem";
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.版本号ToolStripMenuItem.Text = "关于软件";
this.版本号ToolStripMenuItem.Click += new System.EventHandler(this.版本号ToolStripMenuItem_Click);
//
......@@ -609,6 +625,8 @@
private System.Windows.Forms.Label lblCurrTray;
private System.Windows.Forms.Label lblOutTray;
private System.Windows.Forms.CheckBox chbOpenX;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
}
}
......@@ -54,6 +54,8 @@ namespace OnlineStore.AutoCountClient
FrmOutputEquip frm2 = new FrmOutputEquip(robot.outputEquip);
AddForm(" " + robot.outputEquip.Name + " ", frm2);
robot.XrayBean.GetImageEvent += EquipBean_GetImageEvent;
}
private void AddForm(string text, Form form)
{
......@@ -93,9 +95,6 @@ namespace OnlineStore.AutoCountClient
chbAutoRun.Checked = autoValue.Equals(1);
LoadStoreData();
LoadListView();
LogUtil.logBox = this.logBox;
LoadOk = true;
// HideForm();
......@@ -211,12 +210,13 @@ namespace OnlineStore.AutoCountClient
{
Camera._cam.CloseAll();
}
System.Environment.Exit(System.Environment.ExitCode);
robot.sQLite.Close();
}
catch (Exception ex)
{
LogUtil.error("退出出错:", ex);
}
System.Environment.Exit(System.Environment.ExitCode);
//this.Close();
}
}
......@@ -725,5 +725,11 @@ namespace OnlineStore.AutoCountClient
robot.XrayBean.OpenXLine = chbOpenX.Checked;
LogUtil.info("勾选:启用X射线点料 =" + chbOpenX.Checked);
}
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
FrmAnalyze frm = new FrmAnalyze();
frm.ShowDialog();
}
}
}
......@@ -85,5 +85,7 @@ namespace OnlineStore.Common
public static string ThresholdValue = "ThresholdValue";
public static string CounParamConfig = "CounParamConfig";
public static string DataPath = "DataPath";
}
}
......@@ -77,6 +77,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="Retrospect">
<HintPath>..\..\dll\database\Retrospect.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
......
......@@ -26,7 +26,7 @@ namespace OnlineStore.DeviceLibrary
public BatchMoveBean RightBatchMove = null;
public bool AutoInput = ConfigAppSettings.GetIntValue(Setting_Init.AutoInput).Equals(1);
public int DefautTargetP = 0;
public int DefautTargetP = 1;
public InputEquip(string cid, InputEquip_Config config)
{
......
......@@ -203,28 +203,29 @@ namespace OnlineStore.DeviceLibrary
// MoveInfo.MoveParam.TargetPosType = 1;
// WorkLog(" 右侧入口入料,直接放到XRay:" + MoveInfo.MoveParam.ToStr());
//}
else if (SServerManager.CanConnect())
{
Task task = Task.Factory.StartNew(delegate
{
int needPosition = 0;
string msg = SServerManager.Get_VMICheckRLC(Name, MoveInfo.MoveParam.WareCode, out needPosition);
if (needPosition >= 1 && needPosition <= 3)
{
MoveInfo.MoveParam.TargetPosType = needPosition;
WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】通过接口获取目标位置:" + needPosition);
}
// else if (!msg.Equals("") || needPosition.Equals(0))
else
{
WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】获取是否测值失败:" + msg);
MoveInfo.MoveParam.TargetPosType = 1;
MoveInfo.MoveParam.IsNgReel = true;
MoveInfo.MoveParam.NgMsg = msg;
}
});
}
//else if (SServerManager.CanConnect())
//{
// Task task = Task.Factory.StartNew(delegate
// {
// int needPosition = 0;
// string msg = SServerManager.Get_VMICheckRLC(Name, MoveInfo.MoveParam.WareCode, out needPosition);
// if (needPosition >= 1 && needPosition <= 3)
// {
// MoveInfo.MoveParam.TargetPosType = needPosition;
// WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】通过接口获取目标位置:" + needPosition);
// }
// // else if (!msg.Equals("") || needPosition.Equals(0))
// else
// {
// WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】获取是否测值失败:" + msg);
// MoveInfo.MoveParam.TargetPosType = 1;
// MoveInfo.MoveParam.IsNgReel = true;
// MoveInfo.MoveParam.NgMsg = msg;
// }
// });
//}
else
{
if (MoveInfo.MoveParam.TargetPosType.Equals(0))
......@@ -251,16 +252,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType);
Alarm(AlarmType.IoSingleTimeOut);
}
return;
}
else
{
//随机目标地址
Random r = new Random();
int targetP = r.Next(1, 100) % 3 + 1;
MoveInfo.MoveParam.TargetPosType = targetP;
WorkLog(" 随机放料目标:" + targetP);
////随机目标地址
//Random r = new Random();
//int targetP = r.Next(1, 100) % 3 + 1;
MoveInfo.MoveParam.TargetPosType = 1;
WorkLog(" 随机放料目标:" + 1);
}
}
if (MoveInfo.MoveParam.TargetPosType.Equals(1))
......
using log4net;
using BLL;
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -28,7 +29,7 @@ namespace OnlineStore.DeviceLibrary
public Robot_Config Config = null;
private bool canStart = false;
public SQLite sQLite = null;
public RobotBean(Robot_Config lineConfig, InputEquip_Config fconfig, XRay_Config xconfig, OutputEquip_Config pconfig)
{
equipsMap = new Dictionary<int, EquipBase>();
......@@ -71,6 +72,10 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = true;
canStart = true;
AgvClient.Init();
string dataFile =Application.StartupPath+ ConfigAppSettings.GetValue(Setting_Init.DataPath);
sQLite = new SQLite(dataFile);
bool result = sQLite.Connect();
LogUtil.info(Name + "连接【" + dataFile + "】结果: " + result+","+sQLite.ErrInfo);
});
}
......
......@@ -360,6 +360,8 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error("点料:未找到结果图片【" + outF + "】");
}
int c = RobotManager.robot.sQLite.Insert(Work_ReelInfo.WareCode, Work_ReelInfo.PlateW, Work_ReelInfo.PlateH, count, outF);
LogUtil.info("插入数据【" + Work_ReelInfo.WareCode + "】【" + count + "】结果:" + c + " ," + RobotManager.robot.sQLite.ErrInfo);
}
catch (Exception ex)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!