|
@@ -48,58 +48,11 @@ namespace SCADA_DAQ.Customer
|
|
|
public UctFrmRunHistory()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- var uuu = Convert.ToDecimal(Math.Round(Convert.ToDouble(198) / 273, 4));
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
- //public List<MachineInfoModel> OeeData { get; set; }
|
|
|
-
|
|
|
- //public List<TimeSection> Days { get; set; }
|
|
|
- //public void GetOeeData()
|
|
|
- //{
|
|
|
- // Days = DateTimeHelper.GetDays(DateTimeHelper.ToMonthStart(DateTime.Now), DateTimeHelper.ToMonthEnd(DateTime.Now));
|
|
|
- // var first = DateTime.Parse(Days.First().StartTime.ToString());
|
|
|
- // var last = DateTime.Parse(Days.Last().EndTime.ToString());
|
|
|
- // OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>();
|
|
|
- // var deviceMonthTime = OeeData.Where(t => t.CreateTime >= first & t.CreateTime <= last);
|
|
|
- //}
|
|
|
- //public List<double> OeePercent(string deviceName, string deviceCode)
|
|
|
- //{
|
|
|
- // var allTime = new List<double>();
|
|
|
- // var dayAllTime = 0;
|
|
|
- // var runTime = new List<double>();
|
|
|
- // var dayRunTime = 0;
|
|
|
- // for (int i = 0; i < Days.Count; i++)
|
|
|
- // {
|
|
|
- // var hourStartResult = Days[i].StartTime.Format();
|
|
|
- // var hourEndResult = Days[i].EndTime.Format();
|
|
|
- // var deviceDayTIme = OeeData.ToLookup(t => t.Device)[deviceName]
|
|
|
- // .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult) & t.CreateTime < DateTime.Parse(hourEndResult));
|
|
|
- // foreach (var item in deviceDayTIme)
|
|
|
- // {
|
|
|
- // dayAllTime = item.DurationSec + dayAllTime;
|
|
|
-
|
|
|
- // }
|
|
|
- // var deviceRunDayTIme = OeeData.ToLookup(t => t.Device)[deviceName].ToLookup(t => t.StateCode)[deviceCode]
|
|
|
- // .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult) & t.CreateTime < DateTime.Parse(hourEndResult));
|
|
|
- // foreach (var item in deviceRunDayTIme)
|
|
|
- // {
|
|
|
- // dayRunTime = item.DurationSec + dayRunTime;
|
|
|
- // }
|
|
|
- // if (dayAllTime != 0)
|
|
|
- // {
|
|
|
- // var oeeValue = Convert.ToDouble(dayRunTime) / dayAllTime;
|
|
|
- // //var percentOeeValue = oeeValue.ToString("0.##%");
|
|
|
- // allTime.Add(Math.Round(oeeValue, 2));
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // allTime.Add(0);
|
|
|
- // }
|
|
|
- // dayAllTime = 0;
|
|
|
- // dayRunTime = 0;
|
|
|
- // }
|
|
|
- // return allTime;
|
|
|
- //}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|