diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 2c8bcb6..9503e74 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -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" diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb index 4d557e6..4886cfc 100644 --- a/MainWindow/MainWindowM.vb +++ b/MainWindow/MainWindowM.vb @@ -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 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 1d0c5b1..681b0fe 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -59,5 +59,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OmagPHOTO.vbproj b/OmagPHOTO.vbproj index a61413c..4d4c62e 100644 --- a/OmagPHOTO.vbproj +++ b/OmagPHOTO.vbproj @@ -55,14 +55,17 @@ app.manifest - + + False ..\..\EgtProg\Dll32\EgtPHOTOLib.dll - - ..\..\EgtProg\DllD32\EgtUILib.dll + + False + ..\..\EgtProg\Dll32\EgtUILib.dll - - ..\..\EgtProg\DllD32\EgtWPFLib5.dll + + False + ..\..\EgtProg\Dll32\EgtWPFLib5.dll diff --git a/OptionWindow/OptionWindowV.xaml b/OptionWindow/OptionWindowV.xaml index baa3329..7087be1 100644 --- a/OptionWindow/OptionWindowV.xaml +++ b/OptionWindow/OptionWindowV.xaml @@ -18,6 +18,7 @@ + - + + + + + + + +