Przeglądaj źródła

Logikal/V6 Glass UOM is now Height/Width
Fixed PDF Preview on Staging Panel

frankvandenbos 4 miesięcy temu
rodzic
commit
292bdbee42

+ 3 - 3
prs.classes/Integrations/Logikal/LogikalSettings.cs

@@ -142,9 +142,9 @@ namespace Comal.Classes
         {
             public override Filter<ProductDimensionUnit> DefineFilter(LogikalSettings[] items)
             {
-                return new Filter<ProductDimensionUnit>(x => x.HasLength).IsEqualTo(true)
-                    .And(x=>x.HasWidth).IsEqualTo(true)
-                    .And(x=>x.HasHeight).IsEqualTo(false)
+                return new Filter<ProductDimensionUnit>(x=>x.HasWidth).IsEqualTo(true)
+                    .And(x=>x.HasHeight).IsEqualTo(true)
+                    .And(x => x.HasLength).IsEqualTo(false)
                     .And(x=>x.HasQuantity).IsEqualTo(false);
             }
         }

+ 2 - 2
prs.classes/Integrations/V6/V6Settings.cs

@@ -159,9 +159,9 @@ namespace Comal.Classes
         {
             public override Filter<ProductDimensionUnit> DefineFilter(LogikalSettings[] items)
             {
-                return new Filter<ProductDimensionUnit>(x => x.HasLength).IsEqualTo(true)
+                return new Filter<ProductDimensionUnit>(x=>x.HasHeight).IsEqualTo(true)
                     .And(x=>x.HasWidth).IsEqualTo(true)
-                    .And(x=>x.HasHeight).IsEqualTo(false)
+                    .And(x => x.HasLength).IsEqualTo(false)
                     .And(x=>x.HasQuantity).IsEqualTo(false);
             }
         }

+ 18 - 13
prs.desktop/Panels/Staging/StagingPanel.xaml

@@ -7,7 +7,6 @@
              xmlns:local="clr-namespace:PRSDesktop"
              xmlns:wpf="clr-namespace:InABox.Wpf;assembly=InABox.Wpf"
              xmlns:sf="http://schemas.syncfusion.com/wpf"
-             xmlns:pdfViewer="clr-namespace:Syncfusion.Windows.PdfViewer;assembly=Syncfusion.PdfViewer.WPF"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
 
@@ -56,11 +55,17 @@
                             </Grid.RowDefinitions>
 
                             <Border BorderBrush="Gray" BorderThickness="0.75" Background="White">
-                                    <pdfViewer:PdfDocumentView x:Name="Viewer" Background="Transparent" ZoomMode="FitWidth" BorderThickness="0" >
-                                        <pdfViewer:PdfDocumentView.PageBorder>
-                                            <pdfViewer:PageBorder IsVisible="False"/>
-                                        </pdfViewer:PdfDocumentView.PageBorder>
-                                    </pdfViewer:PdfDocumentView>
+                                <ScrollViewer VerticalScrollBarVisibility="Auto" Background="Whitesmoke">
+                                    <ItemsControl x:Name="DocumentViewer" Margin="5">
+                                        <ItemsControl.ItemTemplate>
+                                            <DataTemplate>
+                                                <Border Background="White" BorderBrush="Gray" BorderThickness="0.75" Padding="0" Margin="0,0,0,5">
+                                                    <Image Source="{Binding .}" />
+                                                </Border>
+                                            </DataTemplate>
+                                        </ItemsControl.ItemTemplate>
+                                    </ItemsControl>
+                                </ScrollViewer>
                             </Border>
                             
                             <DockPanel Grid.Row="1" LastChildFill="False" Height="30" Margin="0,2,0,0">
@@ -144,8 +149,7 @@
                                            PreviewStyle="{StaticResource HorizontalSplitterPreview}"/>
                         <local:StagingSetoutComponentGrid x:Name="SetoutComponentGrid"
                                                   Grid.Row="2"
-                                                  Margin="0,5,0,0"
-                                                  OnSelectItem="SetoutComponentGrid_OnOnSelectItem"/>
+                                                  Margin="0,5,0,0"/>
                         <DockPanel 
                                 LastChildFill="False"
                                 Grid.Row="3"
@@ -179,16 +183,17 @@
                                 </StackPanel>
                             </Border>
                             
-                            <Button 
+                            <Button
                                 DockPanel.Dock="Left"
                                 Content="Distribute"
                                 x:Name="Distribute"
                                 Margin="5,0,0,0"
                                 Padding="20,0"
-                                IsEnabled = "false"
-                                BorderBrush="Gray" BorderThickness="0.75" 
-                                Click="DistributeProducts_Click"
-                                />
+                                IsEnabled="False"
+                                BorderBrush="Gray"
+                                BorderThickness="0.75"
+                                Click="DistributeProducts_Click" />
+                            
                         </DockPanel>
                     </Grid>
                 </dynamicgrid:DynamicSplitPanel.Detail>

+ 20 - 14
prs.desktop/Panels/Staging/StagingPanel.xaml.cs

@@ -18,6 +18,7 @@ using System.Reflection;
 using System.Collections.Immutable;
 using StagingManufacturingPacketComponent = Comal.Classes.StagingManufacturingPacketComponent;
 using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
 using Columns = InABox.Core.Columns;
 using MemoryStream = System.IO.MemoryStream;
 
@@ -257,32 +258,37 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
     private void ClearDocuments()
     {
         Document = null;
-        RenderDocument(null);
+        RenderDocuments(null);
     }
 
-    private byte[]? GetDocuments(StagingSetoutDocument? document)
+    private List<byte[]> GetDocuments(StagingSetoutDocument? document)
     {
         if(document is null)
-        {
-            return null;
-        }
+            return new List<byte[]>();
         var table = new Client<Document>().Query(
             new Filter<Document>(x => x.ID).IsEqualTo(document.DocumentLink.ID),
             Columns.None<Document>().Add(x => x.Data));
         var first = table.Rows.FirstOrDefault();
         if (first is null)
-            return null;
+            return new List<byte[]>();
         _documentdata = first.Get<Document, byte[]>(x => x.Data);
-        return _documentdata; //ImageUtils.RenderPDFToImageBytes(_documentdata);
+        return ImageUtils.RenderPDFToImageBytes(_documentdata);
     }
     
-    private void RenderDocument(byte[]? document)
+    private void RenderDocuments(List<byte[]>? documents)
     {
-        if (document is null)
-            return;
-        using (var ms = new MemoryStream(document))     
-            Viewer.Load(ms); 
-
+        List<BitmapImage> _images = new List<BitmapImage>();
+        //DocumentViewer.Children.Clear();
+        if(documents is not null)
+        {
+            foreach (var document in documents)
+            {
+                var image = ImageUtils.LoadImage(document);
+                if (image is not null)
+                    _images.Add(image);
+            }
+        }
+        DocumentViewer.ItemsSource = _images;
     }
 
     private void ProcessButton_Click(object sender, RoutedEventArgs e)
@@ -814,7 +820,7 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
                     DocumentMode.Locked;
 
         docTask.Wait();
-        RenderDocument(docTask.Result);
+        RenderDocuments(docTask.Result);
 
         SetMode(mode);
     }

+ 1 - 1
prs.desktop/prsdesktop.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Desktop"
-#define MyAppVersion "8.34"
+#define MyAppVersion "8.34a"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSDesktop.exe"

+ 1 - 1
prs.licensing/PRSLicensing.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Licensing"
-#define MyAppVersion "8.34"
+#define MyAppVersion "8.34a"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSLicensing.exe"

+ 1 - 1
prs.server/PRSServer.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Server"
-#define MyAppVersion "8.34"
+#define MyAppVersion "8.34a"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSServer.exe"

+ 1 - 1
prs.server/install.bat

@@ -1,4 +1,4 @@
-rem @echo off
+@echo off
 
 echo ###################################################################################
 echo (Frank: 29/12/22) I made some tweaks to streamline the install process: