Kaynağa Gözat

更改提交

谢翼翔 1 yıl önce
ebeveyn
işleme
de93b857da

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

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 
 namespace SCADA_DAQ.Customer.Models.SelectTime
 {
-    public class selectTimeModel:ObservableObject
+    public class SelectTimeModel : ObservableObject
     {
         /// <summary>
 		/// 

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

@@ -14,7 +14,7 @@
         </Grid.RowDefinitions>
         <Image x:Name="Image_Title" Grid.RowSpan="3" Stretch="Fill"/>
         <TextBlock x:Name="LocalTime" Foreground="White" FontSize="30" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,10,0" FontWeight="Bold"/>
-        <TextBlock Text="设备Oee信息看板" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
+        <TextBlock Text="时间稼动率月看板" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="White" FontWeight="Bold" />
         <Grid Grid.Row="1">
             <Grid.RowDefinitions>
                 <RowDefinition/>

+ 15 - 13
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmDeviceOeeInformation.xaml.cs

@@ -28,7 +28,7 @@ namespace SCADA_DAQ.Customer
     /// <summary>
     /// UctFrmDeviceOeeInformation.xaml 的交互逻辑
     /// </summary>
-    [UctMenu("设备OEE界面", Icon = "看板")]
+    [UctMenu("时间稼动率界面", Icon = "看板")]
     public partial class UctFrmDeviceOeeInformation : BaseUctFrm
     {
         public OeeProperty DeviceOeePercenValue = new OeeProperty();
@@ -44,16 +44,16 @@ namespace SCADA_DAQ.Customer
             GetOeeData();
             TenOeeChart();
             Env.Schedual.DateTimeChanged += Schedual_DateTimeChanged;
-            LaserDevice.Title = new string[] { "单位:%", "激光机设备OEE" };
-            simenDevice.Title = new string[] { "单位:%", "西门子数冲机设备OEE" };
-            BeiFuDevice.Title = new string[] { "单位:%", "倍福数冲机设备OEE" };
-            KimFangyuanDevice.Title = new string[] { "单位:%", "金方圆数控母线冲孔机设备OEE" };
-            HighDevice.Title = new string[] { "单位:%", "高机母线冲剪机设备OEE" };
-            OneBendingDevice.Title = new string[] { "单位:%", "1号YaWei折弯机设备OEE" };
-            TwoBendingDevice.Title = new string[] { "单位:%", "2号YaWei折弯机设备OEE" };
-            ThreeBendingDevice.Title = new string[] { "单位:%", "3号YaWei折弯机设备OEE" };
-            YaWeiPBCDevice.Title = new string[] { "单位:%", "亚威PBC折弯机设备OEE" };
-            BaiChaoDevice.Title = new string[] { "单位:%", "百超折弯机设备OEE" };
+            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[] { "单位:%", "百超折弯机" };
 
             var LASER = OeePercentAVG("激光机");
         }
@@ -149,6 +149,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]
@@ -165,7 +167,7 @@ namespace SCADA_DAQ.Customer
                         dayRunTime = double.Parse(OeePercentSting.First().OeePercentage.ToString());
                     }
                 }
-                allOeePercentage.Add(dayRunTime);
+                allOeePercentage.Add(dayRunTime*100);
                 dayRunTime = 0;
             }
             return allOeePercentage;
@@ -185,7 +187,7 @@ namespace SCADA_DAQ.Customer
             var allAVGValue = aVGValue / OeePercentStingAVG.Count();
             for (int i = 0; i < Days.Count; i++)
             {
-                aVGOeePercentage.Add(allAVGValue);
+                aVGOeePercentage.Add(allAVGValue*100);
             }
             return aVGOeePercentage;
         }

+ 38 - 21
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,9 +49,9 @@ namespace SCADA_DAQ.Customer
         public UctFrmRunHistory()
         {
             InitializeComponent();
-            //TimeSelect.SelectTimeChangeEvent += TimeSelect_SelectTimeChangeEvent; ;
-            //TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;
-            //Env.selectTimeModel.PropertyChanged += SelectTimeModel_PropertyChanged;
+            TimeSelect.SelectTimeChangeEvent += TimeSelect_SelectTimeChangeEvent; ;
+            TimeSelect.ReturnTodayEvent += TimeSelect_ReturnTodayEvent; ;
+            Env.selectTimeModel.PropertyChanged += SelectTimeModel_PropertyChanged;
 
         }
         private void SelectTimeModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -66,25 +67,41 @@ namespace SCADA_DAQ.Customer
             }
         }
 
-        //private void TimeSelect_ReturnTodayEvent(object sender, EventArgs e)
-        //{
-        //    Env.selectTimeModel.TimeChange++;
-        //}
+        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;
-        //    });
-        //}
+        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;
+            }
+        }
 
     }
 

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

@@ -7,39 +7,39 @@
              mc:Ignorable="d" 
              x:Name="this"
              d:DesignHeight="450" d:DesignWidth="800">
+    <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" />
 
-    <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" />
-        <dashboard:DashboardCard Margin="2" Grid.Row="2">
             <lvc:CartesianChart DisableAnimations="True" Margin="4" Grid.Row="2" DataClick="CartesianChart_DataClick" x:Name="OeeValueUpdate" >
-            <lvc:CartesianChart.AxisX>
+                <lvc:CartesianChart.AxisX>
                     <lvc:Axis x:Name="Axisx" ShowLabels="True"  >
-                    <lvc:Axis.Separator>
+                        <lvc:Axis.Separator>
                             <lvc:Separator  x:Name="XSeparator"  Step="1" IsEnabled="False"/>
-                    </lvc:Axis.Separator>
-                </lvc:Axis>
-            </lvc:CartesianChart.AxisX>
+                        </lvc:Axis.Separator>
+                    </lvc:Axis>
+                </lvc:CartesianChart.AxisX>
 
-            <lvc:CartesianChart.AxisY>
-                <lvc:Axis x:Name="AxisY" 
-                         MinValue="0" MaxValue="1" ShowLabels="True">
-                    <lvc:Axis.Separator >
-                            <lvc:Separator  x:Name="YSeparator" IsEnabled="False" />
-                    </lvc:Axis.Separator>
-                </lvc:Axis>
-             </lvc:CartesianChart.AxisY>
+                <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:CartesianChart.Series>
+                    <lvc:LineSeries  x:Name ="OeeValue"  DataLabels="True"  PointGeometrySize="10" />
                     <lvc:LineSeries  x:Name ="OeeValueAGV"  PointGeometrySize="5"/>
                 </lvc:CartesianChart.Series>
-        </lvc:CartesianChart>
-        </dashboard:DashboardCard>
-    </Grid>
+            </lvc:CartesianChart>
+        </Grid>
+    </dashboard:DashboardCard>
 </UserControl>

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

@@ -30,7 +30,9 @@ namespace SCADA_DAQ.Customer.Views.Uct
             InitializeComponent();
             OeeValue.FontSize = 15;
             OeeValue.Foreground = new SolidColorBrush(Colors.White);
-           
+            OeeValue.Title = "设备Oee";
+            OeeValueAGV.Title = "设备Oee平均值";
+            
         }
         public void Update()
         {

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

@@ -41,9 +41,9 @@ namespace SCADA_DAQ.Customer.Views.Uct
 
         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;
+            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;