You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
223 lines
8.0 KiB
C#
223 lines
8.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Mesnac.Codd.Session;
|
|
using Mesnac.Action.Base;
|
|
|
|
namespace Mesnac.Action.Intake.Qingquan.Report
|
|
{
|
|
public partial class ReportChart : Form
|
|
{
|
|
public ReportChart()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
public ReportChart(string sid)
|
|
{
|
|
InitializeComponent();
|
|
SerialID = sid;
|
|
}
|
|
public void ChartInit()
|
|
{
|
|
DbHelper curveHelper = new DatabaseAction().NewDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
|
|
if (curveHelper == null)
|
|
{
|
|
return;
|
|
}
|
|
curveHelper.ClearParameter();
|
|
curveHelper.CommandType = CommandType.Text;
|
|
curveHelper.CommandText = "SELECT * FROM dbo.ppt_CurveData WHERE Serial_ID='" + SerialID.Trim() + "'";
|
|
DataTable chartdetail = curveHelper.ToDataTable();
|
|
|
|
if (chartdetail == null || chartdetail.Rows.Count == 0)
|
|
{
|
|
mc.Clear();
|
|
return;
|
|
}
|
|
|
|
mc.Clear();
|
|
//mc.Num = 1000;
|
|
string[] bypass1 = chartdetail.Rows[0]["Bypass1"].ToString().Split(':');
|
|
string[] bypass2 = chartdetail.Rows[0]["Bypass2"].ToString().Split(':');
|
|
string[] bypass3 = chartdetail.Rows[0]["Bypass3"].ToString().Split(':');
|
|
string[] bypass4 = chartdetail.Rows[0]["Bypass4"].ToString().Split(':');
|
|
string[] bypass5 = chartdetail.Rows[0]["Bypass5"].ToString().Split(':');
|
|
string[] bypass6 = chartdetail.Rows[0]["Bypass6"].ToString().Split(':');
|
|
string[] bypass7 = chartdetail.Rows[0]["Bypass7"].ToString().Split(':');
|
|
string[] bypass8 = chartdetail.Rows[0]["Bypass8"].ToString().Split(':');
|
|
string[] bypass9 = chartdetail.Rows[0]["Bypass9"].ToString().Split(':');
|
|
string[] bypass10 = chartdetail.Rows[0]["Bypass10"].ToString().Split(':');
|
|
string[] bypass11 = chartdetail.Rows[0]["TopAir"].ToString().Split(':');
|
|
string[] bypass12 = chartdetail.Rows[0]["ConveyAir"].ToString().Split(':');
|
|
|
|
|
|
List<int> byl = new List<int>();
|
|
byl.Add(bypass1.Length);
|
|
byl.Add(bypass2.Length);
|
|
byl.Add(bypass3.Length);
|
|
byl.Add(bypass4.Length);
|
|
byl.Add(bypass5.Length);
|
|
byl.Add(bypass6.Length);
|
|
byl.Add(bypass7.Length);
|
|
byl.Add(bypass8.Length);
|
|
byl.Add(bypass9.Length);
|
|
byl.Add(bypass10.Length);
|
|
byl.Add(bypass11.Length);
|
|
byl.Add(bypass12.Length);
|
|
int maxl=byl.Max();
|
|
|
|
int beginIndex = 0;
|
|
bool flag = true;
|
|
double pointValue1 = 0.0;
|
|
double pointValue2 = 0.0;
|
|
double pointValue3 = 0.0;
|
|
double pointValue4 = 0.0;
|
|
double pointValue5 = 0.0;
|
|
double pointValue6 = 0.0;
|
|
double pointValue7 = 0.0;
|
|
double pointValue8 = 0.0;
|
|
double pointValue9 = 0.0;
|
|
double pointValue10 = 0.0;
|
|
|
|
double pointValue11 = 0.0;
|
|
double pointValue12 = 0.0;
|
|
for (int i = beginIndex; i < bypass1.Length - 1; i++)
|
|
{
|
|
if (!String.IsNullOrEmpty(bypass1[i]))
|
|
{
|
|
if (bypass1[i] != "0.00")
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
mc.IsUseMixTime = !flag;
|
|
for (int i = beginIndex; i < maxl; i++)
|
|
{
|
|
mc.MixTime = i;
|
|
flag = false;
|
|
//if (!double.TryParse(bypass1[i], out mixTime)) flag = false;
|
|
if (bypass1.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass1[i], out pointValue1))
|
|
mc.PointValue1 = pointValue1;
|
|
|
|
}
|
|
if (bypass2.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass2[i], out pointValue2))
|
|
mc.PointValue2 = pointValue2;
|
|
|
|
}
|
|
if (bypass3.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass3[i], out pointValue3))
|
|
mc.PointValue3 = pointValue3;
|
|
|
|
}
|
|
if (maxl == bypass4.Length)
|
|
{
|
|
if (double.TryParse(bypass4[i], out pointValue4))
|
|
mc.PointValue4 = pointValue4;
|
|
|
|
}
|
|
if (bypass5.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass5[i], out pointValue5))
|
|
mc.PointValue5 = pointValue5;
|
|
|
|
}
|
|
if (bypass6.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass6[i], out pointValue6))
|
|
mc.PointValue6 = pointValue6;
|
|
|
|
}
|
|
if (bypass7.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass7[i], out pointValue7))
|
|
mc.PointValue7 = pointValue7;
|
|
}
|
|
if (bypass8.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass8[i], out pointValue8))
|
|
mc.PointValue8 = pointValue8;
|
|
}
|
|
if (bypass9.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass9[i], out pointValue9))
|
|
mc.PointValue9 = pointValue9;
|
|
}
|
|
if (bypass10.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass10[i], out pointValue10))
|
|
mc.PointValue10 = pointValue10;
|
|
|
|
}
|
|
if (bypass11.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass11[i], out pointValue11))
|
|
mc.PointValue11 = pointValue11;
|
|
|
|
}
|
|
if (bypass12.Length == maxl)
|
|
{
|
|
if (double.TryParse(bypass12[i], out pointValue12))
|
|
mc.PointValue12 = pointValue12;
|
|
}
|
|
}
|
|
}
|
|
private string _serialID;
|
|
|
|
public string SerialID
|
|
{
|
|
get { return _serialID; }
|
|
set { _serialID = value; }
|
|
}
|
|
|
|
private void ReportChart_Load(object sender, EventArgs e)
|
|
{
|
|
ChartInit();
|
|
Init();
|
|
}
|
|
|
|
private void Init()
|
|
{
|
|
DbHelper curveHelper = new DatabaseAction().NewDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
|
|
if (curveHelper == null)
|
|
{
|
|
return;
|
|
}
|
|
curveHelper.ClearParameter();
|
|
curveHelper.CommandType = CommandType.Text;
|
|
curveHelper.CommandText = "SELECT * FROM dbo.ppt_FeedingData WHERE Serial_ID='" + SerialID.Trim() + "'";
|
|
DataTable table = curveHelper.ToDataTable();
|
|
if (table != null && table.Rows.Count > 0)
|
|
{
|
|
lblName.Text = table.Rows[0]["mater_name"].ToString();
|
|
lblDate.Text = table.Rows[0]["Trans_Date"].ToString();
|
|
|
|
lblJlsj.Text = table.Rows[0]["Charge_Time"].ToString();
|
|
lblKSSJ.Text = table.Rows[0]["Start_Time"].ToString();
|
|
|
|
lblBYSJ.Text = table.Rows[0]["Airation_Time"].ToString();
|
|
lblYSSJ.Text = table.Rows[0]["Discharge_Time"].ToString();
|
|
|
|
lblQSSJ.Text = table.Rows[0]["Purge_Time"].ToString();
|
|
lblZSJ.Text = table.Rows[0]["Total_Time"].ToString();
|
|
|
|
lblYG.Text = table.Rows[0]["Source_Bin"].ToString();
|
|
lblMBG.Text = table.Rows[0]["Dest_Bin"].ToString();
|
|
lblJT.Text = table.Rows[0]["Equip_ID"].ToString();
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|