Selaa lähdekoodia

修改最小板件尺寸,开放参数

陈子杰 3 kuukautta sitten
vanhempi
commit
7ed71177ec

+ 2 - 2
SCADA_DAQ/Customer/Machines/SortMachine.cs

@@ -711,8 +711,8 @@ namespace SCADA_DAQ.Customer.Machines
             Labels = new ObservableCollection<LabelModel>(_Lbls);
             Env.DAL.App_Hold_SortingLabels.Delete("1=1");
 
-            var smallBoard = Labels.Where(t => Math.Min(t.ActualWidth, t.ActualLength) <= 80 ||
-                                                                Math.Max(t.ActualWidth, t.ActualLength) <= 250).ToList();
+            var smallBoard = Labels.Where(t => Math.Min(t.ActualWidth, t.ActualLength) < CustomerEnv.SortingMacConfigValue.ShortMinLength ||
+                                                                Math.Max(t.ActualWidth, t.ActualLength) < CustomerEnv.SortingMacConfigValue.LongMinLength).ToList();
             if (smallBoard != null && smallBoard.Count > 0)
             {
                 foreach (var t in smallBoard)

+ 13 - 0
SCADA_DAQ/Customer/Machines/SortingDeliveryMachine.cs

@@ -52,6 +52,7 @@ namespace SCADA_DAQ.Customer.Machines
         }
         private Queue<int> _LeftLoversOrAbnormal = new Queue<int>();
 
+        public string AlarmStr { get => string.Join(",", AlarmCollection.Select(t => t.Desc).ToList()); }
 
 
 
@@ -78,5 +79,17 @@ namespace SCADA_DAQ.Customer.Machines
             }
         }
 
+        protected override void AlarmReset(object sender, AlarmTriggedEventArgs e)
+        {
+            base.AlarmReset(sender, e);
+            OnPropertyChanged(nameof(AlarmStr));
+        }
+
+        protected override void AlarmTriggered(object sender, AlarmTriggedEventArgs e)
+        {
+            base.AlarmTriggered(sender, e);
+            OnPropertyChanged(nameof(AlarmStr));
+        }
+
     }
 }

+ 42 - 0
SCADA_DAQ/Customer/Models/SortingModel/SortingMacSettingModel.cs

@@ -192,6 +192,48 @@ namespace SCADA_DAQ.Customer.Models.SortingModel
         }
         private bool _IsCameraFailForceRun;
 
+        
+        /// <summary>
+        /// 上线短边最短长度
+        /// </summary>
+        /// 
+        [AutoViewProperty("上线板材短边最短长度", Icon = "MapMarkerDistance")]
+
+        public decimal ShortMinLength
+        {
+            get { return _ShortMinLength; }
+            set
+            {
+                if (value != _ShortMinLength)
+                {
+                    _ShortMinLength = value;
+                    OnPropertyChanged(nameof(ShortMinLength));
+                }
+            }
+        }
+        private decimal _ShortMinLength;
+
+
+        /// <summary>
+        /// 上线长边最短长度
+        /// </summary>
+        /// 
+        [AutoViewProperty("上线板材长边最短长度", Icon = "MapMarkerDistance")]
+
+        public decimal LongMinLength
+        {
+            get { return _LongMinLength; }
+            set
+            {
+                if (value != _LongMinLength)
+                {
+                    _LongMinLength = value;
+                    OnPropertyChanged(nameof(LongMinLength));
+                }
+            }
+        }
+        private decimal _LongMinLength;
+
 
 
 

+ 8 - 1
SCADA_DAQ/Customer/Views/Menu/UctFrmBackOfSortingDelivery/UctFrmSortingDelivery.xaml

@@ -5,7 +5,7 @@
       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.Menu.UctFrmBackOfSortingDelivery" 
-                        xmlns:uctpackagesorting="clr-namespace:SCADA_DAQ.Customer.Views.Uct.UctSortingDelivery" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
+                        xmlns:uctpackagesorting="clr-namespace:SCADA_DAQ.Customer.Views.Uct.UctSortingDelivery" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:uct="clr-namespace:SCADA_DAQ.Customer.Views.Uct"
                         mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
       Title="UctFrmSortingDelivery">
@@ -16,6 +16,10 @@
             <ColumnDefinition Width="0.5*"/>
             <ColumnDefinition Width="0.5*"/>
         </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition/>
+            <RowDefinition Height="auto"/>
+        </Grid.RowDefinitions>
         <Grid x:Name="LayoutGrid" Margin="10">
             <Grid.Resources>
                 <Style TargetType="wpfcontrol:IconButton">
@@ -152,5 +156,8 @@
 
             </WrapPanel>
         </GroupBox>
+
+        <uct:UctAlarmBar Grid.Row="1" x:Name="AlarmRoller"/>
+
     </Grid>
 </wpfcontrol:BaseUctFrm>

+ 1 - 0
SCADA_DAQ/Customer/Views/Menu/UctFrmBackOfSortingDelivery/UctFrmSortingDelivery.xaml.cs

@@ -51,6 +51,7 @@ namespace SCADA_DAQ.Customer.Views.Menu.UctFrmBackOfSortingDelivery
             AllowDeliveryRequest.DataContext = _PLC.GetListenReg(SortingDeliveryMachine.Tag_X31);
             LeftoversRequest.DataContext = _PLC.GetListenReg(SortingDeliveryMachine.Tag_Y12);
             AllowLeftoversRequest.DataContext = _PLC.GetListenReg(SortingDeliveryMachine.Tag_X32);
+            AlarmRoller.DataContext = _PLC;
             CodeInfo.BoardGrid.ItemsSource = _PLC.CodeQueue;
             ResetBtn.DataContext = _PLC.GetListenReg(SortingDeliveryMachine.Tag_Reset);
             ForceBtn.DataContext = _PLC.GetListenReg(SortingDeliveryMachine.Tag_ForceToCache);

+ 2 - 2
SCADA_DAQ/Customer/Views/Menu/UctFrmSorting/UctFrmSortingMain.xaml.cs

@@ -320,8 +320,8 @@ namespace SCADA_DAQ.Customer.Views.Menu.UctFrmSorting
         private void RestartBtn_Click(object sender, RoutedEventArgs e)
         {
             //plc.GetListenReg(SortMachine.Tag_StartSort).SetBit();
-            if (plc.Labels.Where(t => Math.Min(t.ActualWidth, t.ActualLength) <= 80 ||
-                                                                Math.Max(t.ActualWidth, t.ActualLength) <= 250).FirstOrDefault() != null)
+            if (plc.Labels.Where(t => Math.Min(t.ActualWidth, t.ActualLength) < CustomerEnv.SortingMacConfigValue.ShortMinLength ||
+                                                                Math.Max(t.ActualWidth, t.ActualLength) < CustomerEnv.SortingMacConfigValue.LongMinLength).FirstOrDefault() != null)
             {
                 plc.GetListenReg(SortMachine.Tag_SmallBoardManualConfirm).SetBit();
             }