Browse Source

临时提交

谢翼翔 1 năm trước cách đây
mục cha
commit
eda06f2199

+ 50 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OeeAxisXYModels.cs

@@ -0,0 +1,50 @@
+using SCADA.CommonLib;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SCADA_DAQ.Customer.Models.OEEData
+{
+    public class OeeAxisXYModels:ObservableObject
+    {
+
+        private double _Indx;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public double Indx
+        {
+            get { return _Indx; }
+            set
+            {
+                if (value != _Indx)
+                {
+                    _Indx = value;
+                    OnPropertyChanged(nameof(Indx));
+                }
+            }
+        }
+
+
+        private double _Value;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public double Value
+        {
+            get { return _Value; }
+            set
+            {
+                if (value != _Value)
+                {
+                    _Value = value;
+                    OnPropertyChanged(nameof(Value));
+                }
+            }
+        }
+    }
+}

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

@@ -32,11 +32,11 @@
             <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.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"/>
         </Grid>
-        </Grid>
+    </Grid>
 </wpfcontrol:BaseUctFrm>

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

@@ -17,6 +17,7 @@ using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 using SCADA_DAQ.Customer.Models.OEEData;
+using LiveCharts;
 
 namespace SCADA_DAQ.Customer
 {
@@ -34,12 +35,19 @@ 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();
+            //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]);
+            //}
+          
 
-            DeviceOeePercenValue.DeviceEveryDayOeePercent= OeePercent("高机母线冲剪机");
 
-            
         }
+      
         public IEnumerable<OEEDataModel> OeeData { get; set; }
 
         public List<TimeSection> Days { get; set; }

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

@@ -5,11 +5,12 @@
              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"
              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 MaxValue="22" x:Name="Axisx" ShowLabels="True" >
+                <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>
@@ -18,17 +19,17 @@
 
             <lvc:CartesianChart.AxisY>
                 <lvc:Axis x:Name="AxisY" 
-                         MinValue="0" MaxValue="20" ShowLabels="True">
+                         MinValue="0" MaxValue="1" ShowLabels="True">
                     <lvc:Axis.Separator >
                         <lvc:Separator  x:Name="YSeparator" 
-                                            Step="20" 
+                                            Step="1" 
                                             Stroke="{DynamicResource MahApps.Brushes.Gray8}" />
                     </lvc:Axis.Separator>
                 </lvc:Axis>
              </lvc:CartesianChart.AxisY>
 
             <lvc:CartesianChart.Series>
-                <lvc:LineSeries  x:Name="Cloum1" Title="流量计:L/Min" DataLabels="True" ScalesYAt="1" />
+                <lvc:LineSeries  x:Name ="OeeValue"  DataLabels="True" ScalesYAt="1" />
             </lvc:CartesianChart.Series>
         </lvc:CartesianChart>
     </Grid>

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

@@ -1,4 +1,8 @@
-using System;
+using LiveCharts;
+using LiveCharts.Configurations;
+using LiveCharts.Wpf;
+using SCADA_DAQ.Customer.Models.OEEData;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -23,6 +27,19 @@ 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.Values.Add(new OeeAxisXYModels { Indx = Indxvalues[i], Value = values[i] });
+            
+            }
+
         }
 
         private void CartesianChart_DataClick(object sender, LiveCharts.ChartPoint chartPoint)