1
0

6 Коммиты eda06f2199 ... bdb4512916

Автор SHA1 Сообщение Дата
  谢翼翔 bdb4512916 Oee界面代码完善 1 год назад
  谢翼翔 8c68860ea1 临时提交 1 год назад
  谢翼翔 de93b857da 更改提交 1 год назад
  谢翼翔 0f370cd079 查询报错修改 1 год назад
  谢翼翔 0a9700da67 临时提交 1 год назад
  谢翼翔 50cf49bb6d 临时提交 1 год назад
20 измененных файлов с 580 добавлено и 119 удалено
  1. BIN
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Doc/vertiv.sql
  2. 25 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OEEDataModel.cs
  3. 9 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OeeProperty.cs
  4. 66 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/QueryOeeModel.cs
  5. 91 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/SelectTime/selectTimeModel.cs
  6. 6 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/CustomerService.cs
  7. 12 12
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml
  8. 117 11
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml.cs
  9. 21 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeQuery.xaml
  10. 35 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeQuery.xaml.cs
  11. 1 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmHistoryQuery.xaml
  12. 6 3
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs
  13. 1 2
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml
  14. 50 49
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml.cs
  15. 35 25
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceChart.xaml
  16. 23 11
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceChart.xaml.cs
  17. 15 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml
  18. 53 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml.cs
  19. 2 1
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Env.cs
  20. 12 0
      skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj.user

BIN
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Doc/vertiv.sql


+ 25 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OEEDataModel.cs

@@ -5,6 +5,7 @@ using SCADA_DAQ.Customer.Models.DistinctTimePiece;
 using SqlSchema.DBNames;
 using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Drawing.Printing;
 using System.Linq;
 using System.Security.Cryptography.X509Certificates;
@@ -21,6 +22,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 设备名称
         /// </summary>
+        [AutoViewProperty("设备名称")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.Device_Str)]
         public string DeviceName
         {
@@ -40,6 +42,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 设备运行时间
         /// </summary>
+        [AutoViewProperty("设备运行时间")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.RunDayTime_Int)]
         public int RunTime
         {
@@ -59,6 +62,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 设备今日总时间
         /// </summary>
+        [AutoViewProperty("设备排产总时间")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.AllDayTime_Int)]
         public int DeviceDayTime
         {
@@ -78,6 +82,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 设备Oee百分比
         /// </summary>
+        [AutoViewProperty("设备Oee百分比")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.Duration_Dec)]
         public string OeePercentage
         {
@@ -97,6 +102,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 创建时间
         /// </summary>
+        [AutoViewProperty("设备创建时间")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.CreateTime_Dt)]
         public DateTime CreateTime
         {
@@ -112,6 +118,25 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         }
         private DateTime _CreateTime;
 
+
+        /// <summary>
+        /// 唯一码
+        /// </summary>
+        [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.StateId_Str)]
+        public string StateId
+        {
+            get { return _StateId; }
+            set
+            {
+                if (value != _StateId)
+                {
+                    _StateId = value;
+                    OnPropertyChanged(nameof(StateId));
+                }
+            }
+        }
+        private string _StateId;
+
     }
     
 }

+ 9 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OeeProperty.cs

@@ -1,4 +1,5 @@
-using System;
+using LiveCharts;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -10,6 +11,13 @@ namespace SCADA_DAQ.Customer.Models.OEEData
     {
         public List<double> DeviceEveryDayOeePercent { get; set; }
 
+        public new List<string> ChartOeeAxisXList =new List<string>();
 
+        public new ChartValues<double> ChartOeeAxisYList = new ChartValues<double>();
+        public List<string> DeviceList { get; set; } = new List<string> { "激光机", "西门子840D数冲", "倍福数冲机", "金方圆数控母线冲孔机", "高机母线冲剪机", 
+            "1号YaWei折弯机", "2号YaWei折弯机", "3号YaWei折弯机", "亚威PBC折弯机", "百超折弯机" };
+
+        public new ChartValues<double> ChartOeeAVGAxisYList = new ChartValues<double>();
     }
 }
+          

+ 66 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/QueryOeeModel.cs

@@ -0,0 +1,66 @@
+using SCADA.CommonLib.CommonModel;
+using SCADA.CommonLib;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SqlSchema.DBNames;
+
+namespace SCADA_DAQ.Customer.Models.OEEData
+{
+    public class QueryOeeModel:BaseQuery
+    {
+        private static SqlSchema.DIL.DILDB DAL = Env.SqlDAL;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public QueryOeeModel() : base(DAL.App_Vertiv_MachineInfoOeeData)
+        {
+
+        }
+        /// <summary>
+        /// 设备名称
+        /// </summary>
+        [AutoViewProperty("设备名称", OptionItemsSource = nameof(DeviceList), StringType = StringType.IsLimited)]
+        [Query(T_Col_Name.App_Vertiv_MachineInfoOeeData.Device_Str)]
+        public string DeviceName
+        {
+            get { return _DeviceName; }
+            set
+            {
+                if (value != _DeviceName)
+                {
+                    _DeviceName = value;
+                    OnPropertyChanged(nameof(DeviceName));
+                }
+            }
+        }
+        private string _DeviceName;
+        public List<string> DeviceList { get; set; } = new List<string> {null,"1号YaWei折弯机", "2号YaWei折弯机", "3号YaWei折弯机", "激光机", "高机母线冲剪机", "百超折弯机",
+            "倍福数冲机", "金方圆数控母线冲孔机", "西门子840D数冲", "亚威PBC折弯机" };
+
+
+
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        [AutoViewProperty("创建时间")]
+        [Query(T_Col_Name.App_Vertiv_MachineInfoOeeData.CreateTime_Dt)]
+        public DateRange CreateTime
+        {
+            get { return _CreateTime; }
+            set
+            {
+                if (value != _CreateTime)
+                {
+                    _CreateTime = value;
+                    OnPropertyChanged(nameof(CreateTime));
+                }
+            }
+        }
+        private DateRange _CreateTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.ThisDay };
+    }
+}

+ 91 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/SelectTime/selectTimeModel.cs

@@ -0,0 +1,91 @@
+using SCADA.CommonLib;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SCADA_DAQ.Customer.Models.SelectTime
+{
+    public class SelectTimeModel : ObservableObject
+    {
+        /// <summary>
+		/// 
+		/// </summary>
+		private int _Year = DateTime.Now.Year;
+        [Range(2000, 2200)]
+        [AutoViewProperty("年", Icon = "看板")]
+        public int Year
+        {
+            get { return _Year; }
+            set
+            {
+                if (value != _Year)
+                {
+                    _Year = value;
+                    OnPropertyChanged(nameof(Year));
+                }
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        private int _Month = DateTime.Now.Month;
+        [Range(1, 12)]
+        [AutoViewProperty("月", Icon = "看板")]
+        public int Month
+        {
+            get { return _Month; }
+            set
+            {
+                if (value != _Month)
+                {
+                    _Month = value;
+                    OnPropertyChanged(nameof(Month));
+                }
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        private int _Day = DateTime.Now.Day;
+        [Range(1, 31)]
+        [AutoViewProperty("日", Icon = "看板")]
+        public int Day
+        {
+            get { return _Day; }
+            set
+            {
+                if (value != _Day)
+                {
+                    _Day = value;
+                    OnPropertyChanged(nameof(Day));
+                }
+            }
+        }
+
+
+
+        private int _TimeChange = 0;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int TimeChange
+        {
+            get { return _TimeChange; }
+            set
+            {
+                if (value != _TimeChange)
+                {
+                    _TimeChange = value;
+                    OnPropertyChanged(nameof(TimeChange));
+                }
+            }
+        }
+    }
+}

+ 6 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Service/CustomerService.cs

@@ -529,17 +529,20 @@ namespace SCADA_DAQ.Customer.Service
         public IEnumerable<MachineInfoModel> OeeData { get; set; }
 
         public IEnumerable<OEEDataModel> DailyOeeData { get; set; }
+
+        public List<OEEDataModel> LastDeviceName { get; set; }
         public void GetOeeData()
         {
             var startDayTime = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
             var endDayTime = DateTime.Parse(DateTime.Now.ToString("23:59:59"));
             OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
             DailyOeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
-
+            LastDeviceName = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>();
         }
 
         public string OeeValue { get; set; }
 
+        public string HoldID { get; set; }
         public void OeePercent()
         {
             var deviceName = new List<string>{"高机母线冲剪机", "2号YaWei折弯机", "3号YaWei折弯机", "激光机", "1号YaWei折弯机", "百超折弯机",
@@ -550,7 +553,7 @@ namespace SCADA_DAQ.Customer.Service
                 var device = deviceName[i];
                 var deviceDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].Sum(t => t.DurationSec);
                 var deviceRunDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].ToLookup(t => t.StateCode)["运行标志位"].Sum(t => t.DurationSec);
-
+                var deviceNameList = LastDeviceName.ToLookup(t => t.DeviceName)[deviceName[i]].LastOrDefault();
                 if (deviceDayTIme == 0)
                 {
                     OeeValue = "0";
@@ -563,7 +566,7 @@ namespace SCADA_DAQ.Customer.Service
                 if (DailyOeeData.Count() != 0)
                 {
                     Env.SqlDAL.App_Vertiv_MachineInfoOeeData.Update(
-                       $"{T_Col_Name.App_Vertiv_MachineInfoOeeData.Device_Str} = '{deviceName[i]}'",
+                     $"{T_Col_Name.App_Vertiv_MachineInfoOeeData.StateId_Str} = '{deviceNameList.StateId}'",
                       new UpdateItem(T_Col_Name.App_Vertiv_MachineInfoOeeData.RunDayTime_Int, deviceRunDayTIme),
                       new UpdateItem(T_Col_Name.App_Vertiv_MachineInfoOeeData.AllDayTime_Int, deviceDayTIme),
                       new UpdateItem(T_Col_Name.App_Vertiv_MachineInfoOeeData.Duration_Dec, OeeValue));

+ 12 - 12
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml

@@ -13,8 +13,8 @@
             <RowDefinition/>
         </Grid.RowDefinitions>
         <Image x:Name="Image_Title" Grid.RowSpan="3" Stretch="Fill"/>
-        <TextBlock x:Name="LocalTime" Foreground="White" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-        <TextBlock Text="折弯机运行信息" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
+        <TextBlock x:Name="LocalTime" Foreground="White" FontSize="30" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
+        <TextBlock Text="时间稼动率月看板" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
         <Grid Grid.Row="1">
             <Grid.RowDefinitions>
                 <RowDefinition/>
@@ -27,16 +27,16 @@
                 <ColumnDefinition/>
                 <ColumnDefinition/>
             </Grid.ColumnDefinitions>
-            <uct:UctDeviceChart  x:Name="LaserDevice"/>
-            <uct:UctDeviceChart Grid.Row="1" x:Name="simenDevice"/>
-            <uct:UctDeviceChart Grid.Row="2" x:Name="BeiFuDevice"/>
-            <uct:UctDeviceChart Grid.Row="3" x:Name="KimFangyuanDevice"/>
-            <uct:UctDeviceChart Grid.Row="4" x:Name="HighDevice"/>
-            <uct:UctDeviceChart Grid.Column="1" x:Name="OneBendingDevice" />
-            <uct:UctDeviceChart Grid.Row="1" x:Name="TwoBendingDevice" Grid.Column="1"/>
-            <uct:UctDeviceChart Grid.Row="2" x:Name="ThreeBendingDevice" Grid.Column="1"/>
-            <uct:UctDeviceChart Grid.Row="3" x:Name="YaWeiPBCDevice" Grid.Column="1"/>
-            <uct:UctDeviceChart Grid.Row="4" x:Name="BaiChaoDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart  x:Name="LaserDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart Grid.Row="1" x:Name="simenDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart Grid.Row="2" x:Name="BeiFuDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart Grid.Row="3" x:Name="KimFangyuanDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart Grid.Row="4" x:Name="HighDevice" Grid.Column="1"/>
+            <uct:UctDeviceChart  x:Name="OneBendingDevice" />
+            <uct:UctDeviceChart Grid.Row="1" x:Name="TwoBendingDevice" />
+            <uct:UctDeviceChart Grid.Row="2" x:Name="ThreeBendingDevice" />
+            <uct:UctDeviceChart Grid.Row="3" x:Name="YaWeiPBCDevice" />
+            <uct:UctDeviceChart Grid.Row="4" x:Name="BaiChaoDevice"/>
         </Grid>
     </Grid>
 </wpfcontrol:BaseUctFrm>

+ 117 - 11
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml.cs

@@ -18,16 +18,22 @@ using System.Windows.Navigation;
 using System.Windows.Shapes;
 using SCADA_DAQ.Customer.Models.OEEData;
 using LiveCharts;
+using NPOI.POIFS.Properties;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using NPOI.HSSF.Record;
 
 namespace SCADA_DAQ.Customer
 {
     /// <summary>
     /// UctFrmDeviceOeeInformation.xaml 的交互逻辑
     /// </summary>
-    [UctMenu("设备OEE界面", Icon = "看板")]
+    [UctMenu("时间稼动率界面", Icon = "看板")]
     public partial class UctFrmDeviceOeeInformation : BaseUctFrm
     {
         public OeeProperty DeviceOeePercenValue = new OeeProperty();
+
+
         public UctFrmDeviceOeeInformation()
         {
             InitializeComponent();
@@ -35,18 +41,96 @@ namespace SCADA_DAQ.Customer
             ToolBar.Visibility = Visibility.Collapsed;
             Image_Title.Source = SCADA.CommonCtrl.WpfHelper.VisualHelper.ImageToImageSource(@"Icon\VertivBck.png");
             LocalTime.Text = DateTime.Now.ToString("dddd yyyy年MM月dd日 HH:mm");
-            //GetOeeData();
-            //OeePercent("高机母线冲剪机");
-            //var listdouble = OeePercent("高机母线冲剪机");
-            //HighDevice.OeeValue.Values = new ChartValues<double>();
-            //for (int i = 0; i < OeePercent("高机母线冲剪机").Count; i++)
-            //{
-            //    HighDevice.OeeValue.Values.Add(OeePercent("高机母线冲剪机")[i]);
-            //}
-          
+            GetOeeData();
+            TenOeeChart();
+            Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
+            LaserDevice.Title = new string[] { "单位:%", "激光机"};
+            simenDevice.Title = new string[] { "单位:%", "西门子数冲机" };
+            BeiFuDevice.Title = new string[] { "单位:%", "倍福数冲机" };
+            KimFangyuanDevice.Title = new string[] { "单位:%", "金方圆数控母线冲孔机" };
+            HighDevice.Title = new string[] { "单位:%", "高机母线冲剪机" };
+            OneBendingDevice.Title = new string[] { "单位:%", "1号YaWei折弯机" };
+            TwoBendingDevice.Title = new string[] { "单位:%", "2号YaWei折弯机" };
+            ThreeBendingDevice.Title = new string[] { "单位:%", "3号YaWei折弯机" };
+            YaWeiPBCDevice.Title = new string[] { "单位:%", "亚威PBC折弯机" };
+            BaiChaoDevice.Title = new string[] { "单位:%", "百超折弯机" };
+    
+
+        }
+
+        private void Schedual_DateTimeChanged(object sender, DateTimeChangedArgs e)
+        {
+            if (e.ChangeType == DateTimeChangeType.SecondChanged && e.TimeFlag.Second % 10 == 0)
+            {
+                Dispatcher.Invoke(new Action(() =>
+                {
+                    GetOeeData();
+                    TenOeeChart();
+                    //LaserDevice.OeeValueUpdate.Update();
+                    //simenDevice.OeeValueUpdate.Update();
+                    //BeiFuDevice.OeeValueUpdate.Update();
+                    //KimFangyuanDevice.OeeValueUpdate.Update();
+                    //HighDevice.OeeValueUpdate.Update();
+                    //OneBendingDevice.OeeValueUpdate.Update();
+                    //TwoBendingDevice.OeeValueUpdate.Update();
+                    //ThreeBendingDevice.OeeValueUpdate.Update();
+                    //YaWeiPBCDevice.OeeValueUpdate.Update();
+                    //BaiChaoDevice.OeeValueUpdate.Update();
+                }));
+            
+            }
+        }
+
+        public void TenOeeChart()
+        {
+            OeeChart("激光机", LaserDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, LaserDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("西门子840D数冲", simenDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, simenDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("倍福数冲机", BeiFuDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, BeiFuDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("金方圆数控母线冲孔机", KimFangyuanDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, KimFangyuanDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("高机母线冲剪机", HighDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, HighDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("1号YaWei折弯机", OneBendingDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, OneBendingDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("2号YaWei折弯机", TwoBendingDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, TwoBendingDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("3号YaWei折弯机", ThreeBendingDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, ThreeBendingDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList); ;
+            OeeChart("亚威PBC折弯机", YaWeiPBCDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, YaWeiPBCDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+            OeeChart("百超折弯机", BaiChaoDevice.Axisx.Labels = DeviceOeePercenValue.ChartOeeAxisXList, BaiChaoDevice.OeeValue.Values = DeviceOeePercenValue.ChartOeeAxisYList);
+
+            OeeAVGChart("激光机", LaserDevice.OeeValueAGV.Values= DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("西门子840D数冲", simenDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("倍福数冲机", BeiFuDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("金方圆数控母线冲孔机", KimFangyuanDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("高机母线冲剪机", HighDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("1号YaWei折弯机", OneBendingDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("2号YaWei折弯机", TwoBendingDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("3号YaWei折弯机", ThreeBendingDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("亚威PBC折弯机", YaWeiPBCDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+            OeeAVGChart("百超折弯机", BaiChaoDevice.OeeValueAGV.Values = DeviceOeePercenValue.ChartOeeAVGAxisYList);
+        }
+     
+        public void OeeChart(string deviceName, IList<string> DeviceAisxX, IChartValues DeviceAxisY)
+        {
+         
+            var listdouble = OeePercent(deviceName);
+            for (int i = 0; i < listdouble.Count; i++)
+            {
+                DeviceAxisY.Add(listdouble[i]);
+                DeviceAisxX.Add(((i + 1).ToString() + "日"));
+               
+            }
+            DeviceOeePercenValue.ChartOeeAxisYList = new ChartValues<double>();
+            DeviceOeePercenValue.ChartOeeAxisXList = new List<string>();
 
 
         }
+
+        public void OeeAVGChart(string deviceName , IChartValues DeviceAxisY)
+        {
+            var deviceAVG = OeePercentAVG(deviceName);
+            for (int i = 0; i < deviceAVG.Count(); i++)
+            {
+                DeviceAxisY.Add(deviceAVG[i]);
+            }
+            DeviceOeePercenValue.ChartOeeAVGAxisYList = new ChartValues<double>();
+        }
       
         public IEnumerable<OEEDataModel> OeeData { get; set; }
 
@@ -58,6 +142,7 @@ namespace SCADA_DAQ.Customer
             var last = DateTime.Parse(Days.Last().EndTime.ToString());
             OeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= first & t.CreateTime <= last);
 
+
         }
         public List<double> OeePercent(string deviceName)
         {
@@ -66,6 +151,8 @@ namespace SCADA_DAQ.Customer
             double dayRunTime = 0;
             for (int i = 0; i < Days.Count; i++)
             {
+                //var hourStartResult = Days[i].StartTime.Format();
+                //var hourEndResult = Days[i].EndTime.Format();
                 var hourStartResult = Days[i].StartTime.Format();
                 var hourEndResult = Days[i].EndTime.Format();
                 var OeePercentSting = OeeData.ToLookup(t => t.DeviceName)[deviceName]
@@ -82,10 +169,29 @@ namespace SCADA_DAQ.Customer
                         dayRunTime = double.Parse(OeePercentSting.First().OeePercentage.ToString());
                     }
                 }
-                allOeePercentage.Add(dayRunTime);
+                allOeePercentage.Add(dayRunTime*100);
                 dayRunTime = 0;
             }
             return allOeePercentage;
         }
+        public List<double> OeePercentAVG(string deviceName)
+        {
+            var hourStartResult = DateTime.Parse(Days.First().StartTime.ToString());
+            var hourEndResult = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
+            var OeePercentStingAVG = OeeData.ToLookup(t => t.DeviceName)[deviceName]
+           .Where(t => t.CreateTime >= DateTime.Parse(hourStartResult.Format()) & t.CreateTime < DateTime.Parse(hourEndResult.Format()));
+            double aVGValue = 0;
+            var aVGOeePercentage = new List<double>();
+           foreach (var item in OeePercentStingAVG)
+            {
+                aVGValue = double.Parse(item.OeePercentage) + aVGValue;
+            }
+            var allAVGValue = aVGValue / OeePercentStingAVG.Count();
+            for (int i = 0; i < Days.Count; i++)
+            {
+                aVGOeePercentage.Add(allAVGValue*100);
+            }
+            return aVGOeePercentage;
+        }
     }
 }

+ 21 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeQuery.xaml

@@ -0,0 +1,21 @@
+<wpfcontrol:BaseUctFrm  xmlns:wpfcontrol="clr-namespace:SCADA.CommonCtrl.WpfControl;assembly=SCADA.CommonCtrl" x:Class="SCADA_DAQ.Customer.UctFrmDeviceOeeQuery"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:SCADA_DAQ.Customer"
+      mc:Ignorable="d" 
+       xmlns:model="clr-namespace:SCADA_DAQ.Customer.Models.OEEData"
+      x:TypeArguments="model:QueryOeeModel"
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="UctFrmDeviceOeeQuery">
+    
+        <wpfcontrol:QueryFrm x:Name="FrmQuery">
+            <wpfcontrol:SmartGrid x:Name="MainGrid"   IsAutoUpdate="True" CanUserDeleteRows="{Binding IsAdmin,ElementName=this}" 
+                              IsReadOnly="{Binding IsReadOnly ,ElementName=this}"
+                              AutoGenerateColumns="True">
+
+            </wpfcontrol:SmartGrid>
+        </wpfcontrol:QueryFrm>
+    
+</wpfcontrol:BaseUctFrm>

+ 35 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeQuery.xaml.cs

@@ -0,0 +1,35 @@
+using SCADA.CommonCtrl.WpfControl;
+using SCADA_DAQ.Customer.Models.MachineMoldTime;
+using SCADA_DAQ.Customer.Models.OEEData;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SCADA_DAQ.Customer
+{
+    /// <summary>
+    /// UctFrmDeviceOeeQuery.xaml 的交互逻辑
+    /// </summary>
+    [UctMenu("设备Oee数据查询")]
+    public partial class UctFrmDeviceOeeQuery : BaseUctFrm<QueryOeeModel>
+    {
+        public UctFrmDeviceOeeQuery()
+        {
+            InitializeComponent();
+            FrmQuery.QueryModel = QueryModel;
+            MainGrid.SourceTable = QueryModel.SourceTable;   //指定绑定更新的表
+            MainGrid.DataTableColumnLables = SmartGridHeaderMapping.CreateMapping<OEEDataModel>();
+        }
+    }
+}

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmHistoryQuery.xaml

@@ -10,7 +10,7 @@
              x:Name="this"
              xmlns:model="clr-namespace:SCADA_DAQ.Customer.Models.MachineMoldTime"
              x:TypeArguments="model:QueryMachineMoldModel"
-                     d:DesignHeight="450" d:DesignWidth="800">
+             d:DesignHeight="450" d:DesignWidth="800">
     <wpfcontrol:QueryFrm x:Name="FrmQuery">
         <wpfcontrol:SmartGrid x:Name="MainGrid"   IsAutoUpdate="True" CanUserDeleteRows="{Binding IsAdmin,ElementName=this}" 
                               IsReadOnly="{Binding IsReadOnly ,ElementName=this}"

+ 6 - 3
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmPunchingMachineEquipmentKanban.xaml.cs

@@ -2,6 +2,7 @@
 using Microsoft.DwayneNeed.Win32.Gdi32;
 using NPOI.SS.Formula.Functions;
 using Opc.Ua;
+using SCADA.CNC.Syntec;
 using SCADA.CommonCtrl.WpfControl;
 using SCADA.CommonLib;
 using SCADA.CommonLib.Data.DIL;
@@ -325,6 +326,7 @@ namespace SCADA_DAQ.Customer
      
         private void Schedual_DateTimeChanged(object sender, SCADA.CommonLib.DateTimeChangedArgs e)
         {
+           
             if (e.ChangeType.HasFlag(DateTimeChangeType.MinuteChanged))
             {
                 Dispatcher.BeginInvoke(new Action(() =>
@@ -338,7 +340,8 @@ namespace SCADA_DAQ.Customer
             {
                 if (e.ChangeType == SCADA.CommonLib.DateTimeChangeType.SecondChanged  &&
                             e.TimeFlag.Second % 16 == 0)
-                {
+                 {
+                    System.GC.Collect(2);
                     GetDBData();
                     GetTableTime();
                     GetRepairTime();
@@ -347,8 +350,8 @@ namespace SCADA_DAQ.Customer
                     GetDeviceStopTime();
                      var kimFangyuanRepairTime = "倒计时" + DeviceRepairTime("金方圆铜排冲剪机").ToString() + "天";//金方圆铜排冲剪机设备保养信息
                     var highmachineRepairTime = "倒计时" + DeviceRepairTime("高机铜排冲剪机").ToString() + "天";//高机铜排冲剪机设备保养信息
-                                                                                                     //var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
-                                                                                                     // + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
+                     //var kimFangyuanArlamTimeSpanString = Convert.ToString(DevicMainTableTime("金方圆铜排冲剪机")
+                    // + TimeSpan.FromSeconds(DeviceTimeValue("金方圆数控母线冲孔机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("金方圆数控母线冲孔机")));//获取金方圆铜排冲剪机设备维修时间
 
                     //var highmachineArlamTimeSpanString = Convert.ToString((DevicMainTableTime("高机铜排冲剪机"))
                     //    + TimeSpan.FromSeconds(DeviceTimeValue("高机母线冲剪机", "维修时间")) + TimeSpan.FromSeconds(DeviceAlarmTime("高机母线冲剪机")));//获取高机铜排冲剪机设备维修时间

+ 1 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml

@@ -9,8 +9,7 @@
          d:DesignHeight="1080" d:DesignWidth="1920"
       Title="UctFrmRunHistory">
     <Grid >
-  
-   
+        <uct:UctTimeSelect x:Name="TimeSelect"/>
     </Grid>
 
 </wpfcontrol:BaseUctFrm>

+ 50 - 49
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmRunHistory.xaml.cs

@@ -30,6 +30,7 @@ using System.Windows.Media.Animation;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using Application = System.Windows.Application;
 using T_Col_Name = SqlSchema.DBNames.T_Col_Name;
 
 namespace SCADA_DAQ.Customer
@@ -48,59 +49,59 @@ namespace SCADA_DAQ.Customer
         public UctFrmRunHistory()
         {
             InitializeComponent();
-          var  uuu = Convert.ToDecimal(Math.Round(Convert.ToDouble(198) / 273, 4));
+            TimeSelect.SelectTimeChangeEvent += TimeSelect_SelectTimeChangeEvent; ;
+            TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;
+            Env.selectTimeModel.PropertyChanged += SelectTimeModel_PropertyChanged;
 
         }
-        //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;
+        private void SelectTimeModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName == "TimeChange")
+            {
+                Dispatcher.Invoke(() =>
+                {
+                    //UpdateDayView();
+                    //UpdateWeekView();
+                    //UpdateMonthView();
+                });
+            }
+        }
 
-        //        }
-        //        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;
-        //}
+        private void TimeSelect_ReturnTodayEvent(object sender, EventArgs e)
+        {
+            Env.selectTimeModel.TimeChange++;
+        }
 
+        private void TimeSelect_SelectTimeChangeEvent(object sender, EventArgs e)
+        {
+            ShowChildWindow(new AutoView(Env.selectTimeModel), "日期查询", () =>
+            {
+                Dispatcher.Invoke(() =>
+                {
+                    if (CheckTime())
+                    {
+                        Env.selectTimeModel.TimeChange++;
+                    }
+                });
+                return true;
+            });
+        }
+        public bool CheckTime()
+        {
+            try
+            {
+                var time = new DateTime(Env.selectTimeModel.Year, Env.selectTimeModel.Month, Env.selectTimeModel.Day);
+                return true;
+            }
+            catch (Exception)
+            {
+                ((IApp)Application.Current).ShowLongToast("输入日期有误!", ControlStyle.Danger);
+                Env.selectTimeModel.Year = DateTime.Now.Year;
+                Env.selectTimeModel.Month = DateTime.Now.Month;
+                Env.selectTimeModel.Day = DateTime.Now.Day;
+                return false;
+            }
+        }
 
     }
 

+ 35 - 25
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceChart.xaml

@@ -3,34 +3,44 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=SCADA.CommonCtrl"
+             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=SCADA.CommonCtrl" xmlns:dashboard="clr-namespace:SCADA_DAQ.Customer.Views.Dashboard"
              mc:Ignorable="d" 
              x:Name="this"
              d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-        <lvc:CartesianChart DisableAnimations="True" Margin="4" Grid.Row="1" DataClick="CartesianChart_DataClick">
-            <lvc:CartesianChart.AxisX>
-                <lvc:Axis x:Name="Axisx" ShowLabels="True" MinValue="1">
-                    <lvc:Axis.Separator>
-                        <lvc:Separator  x:Name="XSeparator" Stroke="{DynamicResource MahApps.Brushes.Gray8}" Step="1"/>
-                    </lvc:Axis.Separator>
-                </lvc:Axis>
-            </lvc:CartesianChart.AxisX>
+    <dashboard:DashboardCard Margin="2" >
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="1*"/>
+            </Grid.RowDefinitions>
+            <TextBlock Text="{Binding Title[0],ElementName=this}" FontSize="15" Foreground="Cyan" Grid.Row="1"/>
+            <local:UctMidcard Title="{Binding Title[1],ElementName=this}" FontSize="20" />
 
-            <lvc:CartesianChart.AxisY>
-                <lvc:Axis x:Name="AxisY" 
-                         MinValue="0" MaxValue="1" ShowLabels="True">
-                    <lvc:Axis.Separator >
-                        <lvc:Separator  x:Name="YSeparator" 
-                                            Step="1" 
-                                            Stroke="{DynamicResource MahApps.Brushes.Gray8}" />
-                    </lvc:Axis.Separator>
-                </lvc:Axis>
-             </lvc:CartesianChart.AxisY>
+            <lvc:CartesianChart DisableAnimations="True" Margin="4" Grid.Row="2" DataClick="CartesianChart_DataClick" x:Name="OeeValueUpdate" >
+                
+                <lvc:CartesianChart.AxisX>
+                    <lvc:Axis x:Name="Axisx" ShowLabels="True"  >
+                        <lvc:Axis.Separator>
+                            <lvc:Separator  x:Name="XSeparator"  Step="1" IsEnabled="False"/>
+                        </lvc:Axis.Separator>
+                    </lvc:Axis>
+                </lvc:CartesianChart.AxisX>
 
-            <lvc:CartesianChart.Series>
-                <lvc:LineSeries  x:Name ="OeeValue"  DataLabels="True" ScalesYAt="1" />
-            </lvc:CartesianChart.Series>
-        </lvc:CartesianChart>
-    </Grid>
+                <lvc:CartesianChart.AxisY>
+                    <lvc:Axis x:Name="AxisY" 
+                         MinValue="0" MaxValue="100" ShowLabels="True" >
+                        <lvc:Axis.Separator >
+                            <lvc:Separator  x:Name="YSeparator" IsEnabled="False"  />
+                        </lvc:Axis.Separator>
+                    </lvc:Axis>
+                </lvc:CartesianChart.AxisY>
+
+                <lvc:CartesianChart.Series>
+                    <lvc:LineSeries  x:Name ="OeeValue"  DataLabels="True"  PointGeometrySize="10" />
+                    <lvc:LineSeries  x:Name ="OeeValueAGV"  PointGeometrySize="5"/>
+                </lvc:CartesianChart.Series>
+            </lvc:CartesianChart>
+        </Grid>
+    </dashboard:DashboardCard>
 </UserControl>

+ 23 - 11
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctDeviceChart.xaml.cs

@@ -1,6 +1,7 @@
 using LiveCharts;
 using LiveCharts.Configurations;
 using LiveCharts.Wpf;
+using NPOI.SS.Formula.Functions;
 using SCADA_DAQ.Customer.Models.OEEData;
 using System;
 using System.Collections.Generic;
@@ -27,20 +28,31 @@ namespace SCADA_DAQ.Customer.Views.Uct
         public UctDeviceChart()
         {
             InitializeComponent();
-            var mapper = Mappers.Xy<OeeAxisXYModels>()
-                             .X(model => model.Indx)
-                             .Y(model => model.Value);
-            Charting.For<OeeAxisXYModels>(mapper);
-            OeeValue.Values = new ChartValues<OeeAxisXYModels>();
-            List<double> values = new List<double>() { 0.3, 0.4, 0.5, 0.6, 0.8 };
-            List<double> Indxvalues = new List<double>() { 1, 2, 3, 4, 5 };
-            for (int i = 0; i < values.Count(); i++)
+            OeeValue.FontSize = 10;
+            OeeValue.Foreground = new SolidColorBrush(Colors.White);
+            OeeValue.Title = "设备Oee";
+            OeeValueAGV.Title = "设备Oee平均值";
+            OeeValue.LabelPoint = t => string.Format("{0}%", t.Y);
+            OeeValueAGV.LabelPoint = t => string.Format("{0}%", t.Y);
+
+        }
+        public void Update()
+        {
+            OeeValueUpdate.Update(false, false);
+            if (OeeValueUpdate.Series.First() is Series cloSer)
             {
-                OeeValue.Values.Add(new OeeAxisXYModels { Indx = Indxvalues[i], Value = values[i] });
-            
+                cloSer.LabelPoint = chartPoint => string.Format("{0}", chartPoint.Y);
             }
-
         }
+        public string[] Title
+        {
+            get { return (string[])GetValue(TitleProperty); }
+            set { SetValue(TitleProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for Title.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty TitleProperty =
+            DependencyProperty.Register("Title", typeof(string[]), typeof(UctDeviceChart), new PropertyMetadata(null));
 
         private void CartesianChart_DataClick(object sender, LiveCharts.ChartPoint chartPoint)
         {

+ 15 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml

@@ -0,0 +1,15 @@
+<wpfcontrol:BaseUserControl x:Class="SCADA_DAQ.Customer.Views.Uct.UctTimeSelect"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:SCADA_DAQ.Customer.Views.Uct" xmlns:wpfcontrol="clr-namespace:SCADA.CommonCtrl.WpfControl;assembly=SCADA.CommonCtrl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
+            <wpfcontrol:IconButton ButtonKind="QueryButton" HorizontalAlignment="Right" Title="日期搜索" Margin="16,0" Click="IconButton_Click"/>
+            <wpfcontrol:IconButton ButtonKind="RigthButton" ButtonStyle="Success" HorizontalAlignment="Right" Title="转今日" Margin="16,0" Click="IconButton_Click_1"/>
+        </StackPanel>
+    </Grid>
+</wpfcontrol:BaseUserControl>

+ 53 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Views/Uct/UctTimeSelect.xaml.cs

@@ -0,0 +1,53 @@
+using SCADA.CommonCtrl.WpfControl;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SCADA_DAQ.Customer.Views.Uct
+{
+    /// <summary>
+    /// UctTimeSelect.xaml 的交互逻辑
+    /// </summary>
+    public partial class UctTimeSelect : BaseUserControl
+    {
+        public UctTimeSelect()
+        {
+            InitializeComponent();
+        }
+        public event EventHandler SelectTimeChangeEvent;
+
+        public event EventHandler ReturnTodayEvent;
+
+     
+        private void IconButton_Click(object sender, RoutedEventArgs e)
+        {
+            if (SelectTimeChangeEvent != null)
+            {
+                SelectTimeChangeEvent.Invoke(this, new EventArgs());
+            }
+
+        }
+
+        private void IconButton_Click_1(object sender, RoutedEventArgs e)
+        {
+            Env.selectTimeModel.Year = DateTime.Now.Year;
+            Env.selectTimeModel.Month = DateTime.Now.Month;
+            Env.selectTimeModel.Day = DateTime.Now.Day;
+            if (ReturnTodayEvent != null)
+            {
+                ReturnTodayEvent.Invoke(this, new EventArgs());
+            }
+        }
+    }
+}

+ 2 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Env.cs

@@ -8,6 +8,7 @@ using SCADA.CommonLib;
 using SCADA.CommonLib.Data.DIL;
 using SCADA.CommonLib.Data.DIL.Sqlite;
 using SCADA.CommonLib.Helper;
+using SCADA_DAQ.Customer.Models.SelectTime;
 using SCADA_DAQ.Plugin.Core.License;
 using SCADA_DAQ.Plugin.CoreUI;
 using SysManage.User;
@@ -37,7 +38,7 @@ namespace SCADA_DAQ
         public static bool EnvInitFinish = false;
 
         public static User NewUser;
-
+        public static SelectTimeModel selectTimeModel = new SelectTimeModel();
         public static Schedual Schedual { get; internal set; } = Schedual.Instance;
 
         internal static LicenseInfo LicenseInfo;

+ 12 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj.user

@@ -8,6 +8,9 @@
     <Compile Update="Customer\UctFrmDeviceOeeInformation.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Update="Customer\UctFrmDeviceOeeQuery.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Update="Customer\UctFrmDeviceScheduleStopMain.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -122,6 +125,9 @@
     <Compile Update="Customer\Views\Uct\UctSiemensDigitalPunchingEquipment.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Update="Customer\Views\Uct\UctTimeSelect.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Update="Customer\Views\Uct\UctTimeYield.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -138,6 +144,9 @@
     <Page Update="Customer\UctFrmDeviceOeeInformation.xaml">
       <SubType>Designer</SubType>
     </Page>
+    <Page Update="Customer\UctFrmDeviceOeeQuery.xaml">
+      <SubType>Designer</SubType>
+    </Page>
     <Page Update="Customer\UctFrmDeviceScheduleStopMain.xaml">
       <SubType>Designer</SubType>
     </Page>
@@ -258,6 +267,9 @@
     <Page Update="Customer\Views\Uct\UctScheduleStopHourMinaa.xaml">
       <SubType>Designer</SubType>
     </Page>
+    <Page Update="Customer\Views\Uct\UctTimeSelect.xaml">
+      <SubType>Designer</SubType>
+    </Page>
     <Page Update="Customer\Views\Uct\UctYaweiPressBrakeTwo.xaml">
       <SubType>Designer</SubType>
     </Page>