Merge branch 'NicolaP'

This commit is contained in:
NicolaP
2021-08-30 15:27:38 +02:00
6 changed files with 160 additions and 24 deletions
+6
View File
@@ -36,6 +36,12 @@ Module ConstIni
Public Const K_PHOTODIR As String = "PhotoDir"
Public Const K_CAMERALINK As String = "CameraLink"
Public Const S_PRINTER As String = "Printer"
Public Const K_TEMPLATE As String = "Template"
Public Const K_DAT As String = "Dat"
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
Public Const K_ENABLE_PRINTER As String = "EnablePrinter"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
+63 -15
View File
@@ -93,6 +93,42 @@ Public Class MainWindowM
End Get
End Property
' l'indirizzo del file può essere modificato dalla pagina OptionPage
Private m_TemplateFilePrinter As String
Friend Property sTemplateFilePrinter As String
Get
Return m_TemplateFilePrinter
End Get
Set(value As String)
m_TemplateFilePrinter = value
' salvo il nome del nuovo file template in uso
WriteMainPrivateProfileString(S_PRINTER, K_TEMPLATE, m_TemplateFilePrinter)
' comunico alla librearia il nuovo nome del file in uso dal programma
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
End Set
End Property
Private m_DatFilePrinter As String
Friend ReadOnly Property DataFilePrinter As String
Get
Return m_DatFilePrinter
End Get
End Property
Private m_ZebraUtilitiesExe As String
Friend ReadOnly Property ZebraUtilitiesExe As String
Get
Return m_ZebraUtilitiesExe
End Get
End Property
Private m_PrinterIsVisible As Boolean = False
Friend ReadOnly Property PrinterIsVisible As Boolean
Get
Return m_PrinterIsVisible
End Get
End Property
Private m_sBackUpDir As String
Friend ReadOnly Property sBackUpDir As String
Get
@@ -140,8 +176,8 @@ Public Class MainWindowM
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2304, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2304, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2308, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2308, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.PHOTO_BASE)
' Inizializzazione generale di EgtInterface
@@ -200,6 +236,14 @@ Public Class MainWindowM
EgtLuaRequire(sLuaBaseLib)
' Leggo nome cartella delle foto
GetMainPrivateProfileString(S_GENERAL, K_PHOTODIR, sDataRoot & "\Data", m_sPhotoDir)
' leggo nome file prn (per stampante zebra)
GetMainPrivateProfileString(S_PRINTER, K_TEMPLATE, sDataRoot & "\Label\Default.prn", m_TemplateFilePrinter)
' leggo nome del direttorio in cui scrivere il file ini (per stampante zebra) -- solo se si desidera scrivere il file in un direttorio diverso
GetMainPrivateProfileString(S_PRINTER, K_DAT, sDataRoot & "\Temp", m_DatFilePrinter)
' leggo nome file exe (per stampante zebra)
GetMainPrivateProfileString(S_PRINTER, K_ZEBRAUTILITIES, System.AppDomain.CurrentDomain.BaseDirectory & "ZebraPrinterUtilitiesR32.exe", m_ZebraUtilitiesExe)
' verifico che sia abilitata la stampante con flag
m_PrinterIsVisible = (GetMainPrivateProfileInt(S_PRINTER, K_ENABLE_PRINTER, 0) = 1)
' Creo connessione al Db
If Not ManageDb.ConnectToDb(m_sPhotoDir & "\" & DB_FILENAME) Then
EgtOutLog("Error connecting to DB")
@@ -214,25 +258,29 @@ Public Class MainWindowM
EgtPHOTOLib.MainData.SetKeyOptions(m_nKeyOptions)
EgtPHOTOLib.MainData.SetPhotoDir(m_sPhotoDir)
EgtPHOTOLib.MainData.SetBackUpDir(m_sBackUpDir)
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
EgtPHOTOLib.MainData.SetDataFilePrinter(m_DatFilePrinter)
EgtPHOTOLib.MainData.SetZebraPrinterExe(m_ZebraUtilitiesExe)
EgtPHOTOLib.MainData.SetPrinterVisibility(m_PrinterIsVisible)
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
'' lancio il timer di aggiornamento dell'interfaccia, per la gestione di due OmagPHOTO che accedono allo stesso SQL
'AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_Tick
'm_RefreshTimer.Interval = TimeSpan.FromMilliseconds(2000)
'm_RefreshTimer.Start()
' lancio il timer di aggiornamento dell'interfaccia, per la gestione di due OmagPHOTO che accedono allo stesso SQL
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_Tick
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(2000)
m_RefreshTimer.Start()
End Sub
' per la gestione di due OmagPHOTO che accedono allo stesso SQL
'Private Sub RefreshTimer_Tick()
' If Not m_TimerIsBusy And PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST Then
' m_TimerIsBusy = True
' m_RefreshTimer.Stop()
' EgtPHOTOLib.PhotoMap.refListPageVM.RefreshLisPage()
' m_TimerIsBusy = False
' m_RefreshTimer.Start()
' End If
'End Sub
Private Sub RefreshTimer_Tick()
If Not m_TimerIsBusy And PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST Then
m_TimerIsBusy = True
m_RefreshTimer.Stop()
EgtPHOTOLib.PhotoMap.refListPageVM.RefreshLisPage()
m_TimerIsBusy = False
m_RefreshTimer.Start()
End If
End Sub
Private Sub ManageInstance()
Dim bCreated As Boolean
+2 -2
View File
@@ -59,5 +59,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.3.5.1")>
<Assembly: AssemblyFileVersion("2.3.5.1")>
<Assembly: AssemblyVersion("2.3.8.2")>
<Assembly: AssemblyFileVersion("2.3.8.2")>
+8 -5
View File
@@ -55,14 +55,17 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtPHOTOLib">
<Reference Include="EgtPHOTOLib, Version=2.3.1.1, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
</Reference>
<Reference Include="EgtUILib">
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
<Reference Include="EgtUILib, Version=2.3.4.5, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib5">
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
<Reference Include="EgtWPFLib5, Version=2.3.4.4, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite">
+20 -2
View File
@@ -18,6 +18,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="{Binding CurrentLanguageMsg}"
@@ -48,8 +49,25 @@
</UniformGrid>
</GroupBox>
<GroupBox Header="{Binding MaterialsMsg}" Grid.Column="0"
Grid.Row="2" Grid.ColumnSpan="2" Margin="0,0,0,5">
<GroupBox Header="{Binding LabelMsg}"
Grid.Row="2" Grid.ColumnSpan="2"
Visibility="{Binding LabelVisibility}"
Margin="0,0,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding LabelFileName}"/>
<Button Content="{Binding BrowseMsg}" Grid.Column="1"
Command="{Binding BrowseCommand}"
Style="{StaticResource OptionPanel_TextButton}"
Margin="2.5,0,0,0"/>
</Grid>
</GroupBox>
<GroupBox Header="{Binding MaterialsMsg}" Grid.Column="0"
Grid.Row="3" Grid.ColumnSpan="2" Margin="0,0,0,5">
<DockPanel>
+61
View File
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtPHOTOLib
@@ -62,6 +63,22 @@ Public Class OptionWindowVM
End Set
End Property
Public ReadOnly Property LabelFileName As String
Get
Return Map.refMainWindowVM.MainWindowM.sTemplateFilePrinter
End Get
End Property
Public ReadOnly Property LabelVisibility As Visibility
Get
If Map.refMainWindowVM.MainWindowM.PrinterIsVisible Then
Return Visibility.Visible
Else
Return Visibility.Collapsed
End If
End Get
End Property
Private m_ThicknessTolerance As Double
Public Property ThicknessTolerance As String
Get
@@ -192,11 +209,24 @@ Public Class OptionWindowVM
End Get
End Property
Public ReadOnly Property BrowseMsg As String
Get
Return EgtMsg(92058)
End Get
End Property
Public ReadOnly Property LabelMsg As String
Get
Return EgtMsg(92056)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdNewMat As ICommand
Private m_cmdRemoveMat As ICommand
Private m_cmdBrowse As ICommand
#End Region ' FIELDS & PROPERTIES
@@ -299,6 +329,37 @@ Public Class OptionWindowVM
#End Region ' RemoveMatCommand
#Region "Browse"
#End Region ' Browse
Public ReadOnly Property BrowseCommand As ICommand
Get
If m_cmdBrowse Is Nothing Then
m_cmdBrowse = New Command(AddressOf BrowseFile)
End If
Return m_cmdBrowse
End Get
End Property
Public Sub BrowseFile(ByVal Param As Object)
' recupero il nome del direttorio
Dim CurrDirectory As String = Path.GetDirectoryName(Map.refMainWindowVM.MainWindowM.sTemplateFilePrinter)
' Apro la finestra di dialogo aperta direttamente sulla cartella cercata
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
.InitialDirectory = CurrDirectory
}
OpenFileDialog.Filter = "prn files (*.prn)|*.prn"
If OpenFileDialog.ShowDialog() <> True Then
' se la risposta è diversa da OK esce
Else
' carico l'indirizzo del template che voglio aprire
Map.refMainWindowVM.MainWindowM.sTemplateFilePrinter = OpenFileDialog.FileName
NotifyPropertyChanged("LabelFileName")
End If
End Sub
#End Region ' COMMANDS
End Class