FrmAnalyze.cs
4.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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)
{
if (RobotManager.robot.sQLite == null)
{
MessageBox.Show("数据未初始化完成,请稍后!");
return;
}
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.ToString(), out array);
LogUtil.error("查数据【" + code + "】【" + startTime.ToString() + "】【" + endTime.ToString() + "】结果:" + result + "," + RobotManager.robot.sQLite.ErrInfo);
if (array != null && array.Length > 0)
{
LogUtil.info("共查询到【" + array.Length + "】行数据");
this.dataGridView1.Rows.Clear();
foreach (string[] a in array)
{
DataGridViewRow view = new DataGridViewRow();
view.CreateCells(dataGridView1);
for(int i = 0; i < a.Length; i++)
{
view.Cells[i].Value = a[i];
}
//view.Cells[0].Value = point.pointNum.ToString();
//view.Cells[1].Value = point.PartNum.ToString();
//view.Cells[2].Value = point.pointName;
//view.Cells[3].Value = point.PositionX.ToString();
//view.Cells[4].Value = point.PositionY.ToString();
//view.Cells[5].Value = point.NodePositionX.ToString();
//view.Cells[6].Value = point.NodePositionY.ToString();
//view.Cells[7].Value = point.PositionNum.ToString();
//view.Cells[8].Value = point.NeedSoldering;
//view.Cells[9].Value = point.WeldTemp;
dataGridView1.Rows.Add(view);
}
}
}
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 = "";
}
}