From e6d051c9a2aa405fddd8c43caba9edbf267e7f7e Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Wed, 27 Feb 2019 08:26:22 +0000 Subject: [PATCH] OmagVIEWPlus 2.1b1 : - Primo rilascio --- App.config | 6 + Application.xaml | 9 + Application.xaml.vb | 14 + Constants/ConstGen.vb | 52 +++ Constants/ConstIni.vb | 44 +++ Constants/ConstMsg.vb | 53 +++ MainWindow/MainWindowM.vb | 252 ++++++++++++++ MainWindow/MainWindowV.xaml | 24 ++ MainWindow/MainWindowV.xaml.vb | 38 +++ MainWindow/MainWindowVM.vb | 123 +++++++ My Project/AssemblyInfo.vb | 74 ++++ My Project/MyExtensions/MyWpfExtension.vb | 121 +++++++ My Project/Resources.Designer.vb | 63 ++++ My Project/Resources.resx | 117 +++++++ My Project/Settings.Designer.vb | 71 ++++ My Project/Settings.settings | 7 + NCCommunication/NCCommunication.vb | 323 ++++++++++++++++++ NCCommunication/Nc_Debug.vb | 56 +++ NCCommunication/Nc_Parent.vb | 19 ++ NCCommunication/Nc_Siemens.vb | 120 +++++++ OmagVIEWPlus.sln | 22 ++ OmagVIEWPlus.vbproj | 263 ++++++++++++++ Resources/LogoOmag.jpg | Bin 0 -> 10449 bytes Resources/Nastro.png | Bin 0 -> 3293 bytes Resources/OmagCUT.ico | Bin 0 -> 9158 bytes Resources/Pallet.png | Bin 0 -> 1412 bytes Resources/Rack.png | Bin 0 -> 1131 bytes Resources/Source/Pallet.svg | 124 +++++++ Resources/Tavola1.png | Bin 0 -> 2202 bytes UnloadingArea/UnloadingAreaV.xaml | 63 ++++ UnloadingArea/UnloadingAreaV.xaml.vb | 3 + UnloadingArea/UnloadingAreaVM.vb | 148 ++++++++ Utility/Dictionary.xaml | 398 ++++++++++++++++++++++ Utility/Dictionary.xaml.vb | 30 ++ Utility/Enums.vb | 14 + Utility/Map.vb | 51 +++ Warehouse/Box.vb | 133 ++++++++ Warehouse/WarehouseV.xaml | 45 +++ Warehouse/WarehouseV.xaml.vb | 21 ++ Warehouse/WarehouseVM.vb | 187 ++++++++++ 40 files changed, 3088 insertions(+) create mode 100644 App.config create mode 100644 Application.xaml create mode 100644 Application.xaml.vb create mode 100644 Constants/ConstGen.vb create mode 100644 Constants/ConstIni.vb create mode 100644 Constants/ConstMsg.vb create mode 100644 MainWindow/MainWindowM.vb create mode 100644 MainWindow/MainWindowV.xaml create mode 100644 MainWindow/MainWindowV.xaml.vb create mode 100644 MainWindow/MainWindowVM.vb create mode 100644 My Project/AssemblyInfo.vb create mode 100644 My Project/MyExtensions/MyWpfExtension.vb create mode 100644 My Project/Resources.Designer.vb create mode 100644 My Project/Resources.resx create mode 100644 My Project/Settings.Designer.vb create mode 100644 My Project/Settings.settings create mode 100644 NCCommunication/NCCommunication.vb create mode 100644 NCCommunication/Nc_Debug.vb create mode 100644 NCCommunication/Nc_Parent.vb create mode 100644 NCCommunication/Nc_Siemens.vb create mode 100644 OmagVIEWPlus.sln create mode 100644 OmagVIEWPlus.vbproj create mode 100644 Resources/LogoOmag.jpg create mode 100644 Resources/Nastro.png create mode 100644 Resources/OmagCUT.ico create mode 100644 Resources/Pallet.png create mode 100644 Resources/Rack.png create mode 100644 Resources/Source/Pallet.svg create mode 100644 Resources/Tavola1.png create mode 100644 UnloadingArea/UnloadingAreaV.xaml create mode 100644 UnloadingArea/UnloadingAreaV.xaml.vb create mode 100644 UnloadingArea/UnloadingAreaVM.vb create mode 100644 Utility/Dictionary.xaml create mode 100644 Utility/Dictionary.xaml.vb create mode 100644 Utility/Enums.vb create mode 100644 Utility/Map.vb create mode 100644 Warehouse/Box.vb create mode 100644 Warehouse/WarehouseV.xaml create mode 100644 Warehouse/WarehouseV.xaml.vb create mode 100644 Warehouse/WarehouseVM.vb diff --git a/App.config b/App.config new file mode 100644 index 0000000..3fa3cae --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Application.xaml b/Application.xaml new file mode 100644 index 0000000..5d37f51 --- /dev/null +++ b/Application.xaml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/Application.xaml.vb b/Application.xaml.vb new file mode 100644 index 0000000..d4b39fc --- /dev/null +++ b/Application.xaml.vb @@ -0,0 +1,14 @@ +Class Application + + ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException + ' can be handled in this file. + Protected Overrides Sub OnStartup(e As StartupEventArgs) + MyBase.OnStartup(e) + ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose + ' Creo la View principale + Me.MainWindow = New MainWindowV + ' Mostro la View principale + Me.MainWindow.Show() + End Sub + +End Class diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb new file mode 100644 index 0000000..4f8b30c --- /dev/null +++ b/Constants/ConstGen.vb @@ -0,0 +1,52 @@ +'---------------------------------------------------------------------------- +' EgalTech 2015-2017 +'---------------------------------------------------------------------------- +' File : ConstGen.vb Data : 10.04.17 Versione : 1.8d1 +' Contenuto : Modulo costanti generali. +' +' +' +' Modifiche : 10.04.17 DS Creazione modulo. +' +' +'---------------------------------------------------------------------------- + +Module ConstGen + + ' File con direttorio radice dei dati + Public Const DAT_FILE_NAME As String = "DataRoot.Ini" + Public Const S_DATA As String = "Data" + Public Const K_DATAROOT As String = "DataRoot" + + ' File con dati di licenza + Public Const LIC_FILE_NAME As String = "OmagVIEWPlus.lic" + Public Const S_LICENCE As String = "Licence" + Public Const K_KEY As String = "Key" + + ' Abilitazioni licenza + Friend Enum KEY_OPT As UInteger + CUT_BASE = 1 ' Prodotto OmagCUT + MAN_MANIP = 2 + AUTO_MANIP = 4 + MAN_PHOTO = 8 + AUTO_PHOTO = 16 + AUTO_NESTING = 32 + ENABLE_MILL = 64 + PROCUCTION_LINE = 128 + OFFICE_BASE = 256 ' Prodotto OmagOFFICE + VM_MULTI = 512 + UNDER_CUT = 1024 + CSV_SIMPLE = 2048 + PHOTO_BASE = 4096 ' Prodotto OmagPHOTO + TRF_IMPORT = 8192 + End Enum + + ' File di log generale + Public Const GENLOG_FILE_NAME As String = "OmagVIEWPlusLog#.txt" + + ' Sottodirettorio di configurazione + Public Const CONF_DIR As String = "Config" + ' Sottodirettorio temporaneo + Public Const TEMP_DIR As String = "Temp" + +End Module diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb new file mode 100644 index 0000000..acddb29 --- /dev/null +++ b/Constants/ConstIni.vb @@ -0,0 +1,44 @@ +'---------------------------------------------------------------------------- +' EgalTech 2015-2015 +'---------------------------------------------------------------------------- +' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3 +' Contenuto : Modulo costanti sezione e chiavi per file Ini. +' +' +' +' Modifiche : 12.02.15 DS Creazione modulo. +' +' +'---------------------------------------------------------------------------- + +Module ConstIni + + Public Const INI_FILE_NAME As String = "OmagVIEWPlus.ini" + + Public Const S_GENERAL As String = "General" + Public Const K_DEBUG As String = "Debug" + Public Const K_LICENCE As String = "Licence" + Public Const K_USERLEVEL As String = "UserLevel" + Public Const K_MAXINST As String = "MaxInstances" + Public Const K_INSTANCES As String = "Instances" + Public Const K_COMMANDLOG As String = "CommandLog" + Public Const K_MESSAGESDIR As String = "MessagesDir" + Public Const K_MESSAGES As String = "Messages" + Public Const K_WINPLACE As String = "WinPlace" + Public Const K_SUPPORT As String = "Support" + + Public Const S_LANGUAGES As String = "Languages" + Public Const K_LANGUAGE As String = "Language" + + Public Const S_NUMERICALCONTROL As String = "NumericalControl" + Public Const K_TYPE As String = "Type" + Public Const K_IP As String = "Ip" + Public Const K_RACK As String = "Rack" + Public Const K_SLOT As String = "Slot" + Public Const K_TIMERINTERVAL As String = "TimerInterval" + + Public Const S_VARIABLES As String = "Variables" + Public Const K_ACTIVEWAREHOUSE As String = "ActiveWarehouse" + + +End Module diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb new file mode 100644 index 0000000..f039130 --- /dev/null +++ b/Constants/ConstMsg.vb @@ -0,0 +1,53 @@ +Module ConstMsg + + Public Const MSG_SETUPERRORS As Integer = 5000 + 1470 + + Public Const MSG_MISSINGKEYWD As Integer = 10100 + Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200 + Public Const MSG_MESSAGEBOX As Integer = 15000 + + Public Const MSG_OMAGCUT As Integer = 90000 + Public Const MSG_GENERAL As Integer = MSG_OMAGCUT + Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100 + Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200 + Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220 + Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300 + Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330 + Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340 + Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360 + Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380 + Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400 + Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450 + Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490 + Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500 + Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535 + Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550 + Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600 + Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700 + Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720 + Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760 + Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800 + Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900 + Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 950 + Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 980 + Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100 + Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200 + + Public Const MSG_OMAGOFFICE As Integer = 91400 + Public Const MSG_OPTIONPANEL As Integer = MSG_OMAGOFFICE + Public Const MSG_MYMACHININGDBWINDOW As Integer = MSG_OMAGOFFICE + 50 + Public Const MSG_TOPCMDBAR As Integer = MSG_OMAGOFFICE + 100 + Public Const MSG_RAWPARTTAB As Integer = MSG_OMAGOFFICE + 150 + Public Const MSG_VEINMATCHING As Integer = MSG_OMAGOFFICE + 200 + Public Const MSG_GENERIC As Integer = MSG_OMAGOFFICE + 250 + + Public Const MSG_EGTWPFLIB5 As Integer = 30000 + Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTWPFLIB5 + 500 + Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTWPFLIB5 + 800 + Public Const MSG_TOOLDB As Integer = MSG_EGTWPFLIB5 + 1000 + Public Const MSG_TOOLDBERRORS As Integer = MSG_EGTWPFLIB5 + 1100 + Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200 + Public Const MSG_MACHININGDBERRORS As Integer = MSG_EGTWPFLIB5 + 1400 + Public Const MSG_SIMULATION As Integer = MSG_EGTWPFLIB5 + 1600 + +End Module diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb new file mode 100644 index 0000000..4fcec4d --- /dev/null +++ b/MainWindow/MainWindowM.vb @@ -0,0 +1,252 @@ +Imports System.Threading +Imports System.Math +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class MainWindowM + +#Region "FIELDS" + + Private m_sDataRoot As String = String.Empty + Friend ReadOnly Property sDataRoot As String + Get + Return m_sDataRoot + End Get + End Property + + Private m_sConfigDir As String = String.Empty + Public ReadOnly Property sConfigDir As String + Get + Return m_sConfigDir + End Get + End Property + + Private m_nDebug As Integer = 0 + + Private m_objMutex As Mutex + + Private m_bFirstInstance As Boolean = False + Friend ReadOnly Property bFirstInstance As Boolean + Get + Return m_bFirstInstance + End Get + End Property + + Private m_nInstance As Integer = 0 + Friend ReadOnly Property nInstance As Integer + Get + Return m_nInstance + End Get + End Property + + Private m_nUserLevel As Integer = 1 + Friend ReadOnly Property nUserLevel As Integer + Get + Return m_nUserLevel + End Get + End Property + + Private m_nKeyLevel As Integer = 0 + Friend ReadOnly Property nKeyLevel As Integer + Get + Return m_nKeyLevel + End Get + End Property + + Private m_nKeyOptions As UInteger = 0 + Friend ReadOnly Property nKeyOptions As Integer + Get + Return m_nKeyOptions + End Get + End Property + + Friend ReadOnly Property sVersion As String + Get + Return My.Application.Info.Version.Major.ToString() & "." & + My.Application.Info.Version.Minor.ToString() & + (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & + My.Application.Info.Version.Revision.ToString() + End Get + End Property + + Private m_sTempDir As String + Friend ReadOnly Property sTempDir As String + Get + Return m_sTempDir + End Get + End Property + Private m_sLogFile As String + Friend ReadOnly Property sLogFile As String + Get + Return m_sLogFile + End Get + End Property + +#End Region ' FIELDS + +#Region "CONSTRUCTOR" + + Sub New() + InitializeEgtEnvironment() + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Private Sub InitializeEgtEnvironment() + ' Impostazione path radice per i dati + m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory + If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then + m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory + End If + ' Impostazione direttorio di configurazione + m_sConfigDir = m_sDataRoot & "\" & CONF_DIR + ' Impostazione direttorio per file temporanei + m_sTempDir = m_sDataRoot & "\" & TEMP_DIR + ' Impostazione path Ini file + IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME + ' Verifico indice di istanza + ManageInstance() + ' Imposto tipo di chiave + EgtSetLockType(KEY_TYPE.HW) + ' Leggo e imposto chiave di protezione + Dim sLicFileName As String = String.Empty + GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName) + Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName + Dim sKey As String = String.Empty + EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) + EgtSetKey(sKey) + ' Recupero livello e opzioni della chiave + Dim bKey As Boolean = EgtGetKeyLevel(9423, 19, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 19, 1, m_nKeyOptions) + ' Verifico abilitazione prodotto + Dim bProd As Boolean = GetKeyOption(KEY_OPT.MAN_MANIP) And GetKeyOption(KEY_OPT.AUTO_MANIP) And GetKeyOption(KEY_OPT.PROCUCTION_LINE) + ' Inizializzazione generale di EgtInterface + m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) + m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) + Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & m_nInstance.ToString() & ")" & vbLf & + My.Application.Info.Title.ToString() & " ver. " & + My.Application.Info.Version.Major.ToString() & + "." & My.Application.Info.Version.Minor.ToString() & + (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() & + My.Application.Info.Version.Revision.ToString() + EgtInit(m_nDebug, m_sLogFile, sLogMsg) + EgtSetTempDir(m_sTempDir) + EgtSetIniFile(IniFile.m_sIniFile) + ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione) + Dim sMsgDir As String = String.Empty + If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then + sMsgDir = m_sConfigDir + End If + ' Leggo lingua corrente + Dim sLanguage As String = String.Empty + GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage) + ' Recupero nome file dei messaggi della lingua corrente + Dim sMsgName As String = "EgalTechIta.txt" + Dim nIndex As Integer = 1 + While True + Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex) + If IsNothing(ReadLanguage) Then Exit While + If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then + sMsgName = ReadLanguage.FilePath + Exit While + End If + nIndex += 1 + End While + If Not bKey Then + MessageBox.Show("Missing Protection Key. Insert Dongle and restart the program", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + 'End + End If + If Not bProd Then + MessageBox.Show("Program without licence. Load Licence and restart the program.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + 'End + End If + ' Leggo file messaggi + Dim sMsgFilePath As String = sMsgDir & "\" & sMsgName + If Not EgtLoadMessages(sMsgFilePath) Then + EgtOutLog("Error in EgtLoadMessages") + End If + ' Leggo e imposto livello utilizzatore + m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1)) + ' Info su opzioni chiave + EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString()) + End Sub + + Private Sub ManageInstance() + Dim bCreated As Boolean + Try + m_objMutex = New Mutex(False, "Global\OmagVIEWPlus", bCreated) + Catch + bCreated = False + End Try + m_bFirstInstance = bCreated + If bCreated Then + ' Prima istanza + m_nInstance = 1 + ' Aggiorno stato istanze attive + WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString()) + Else + ' Leggo il massimo numero di istanze ammesse + Const MAX_INST As Integer = 32 + Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1) + nMaxInst = Max(1, Min(nMaxInst, MAX_INST)) + ' Cerco il primo indice di istanza libero + Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0) + m_nInstance = 1 + Dim nMask As Integer = 1 + While (nTmp And nMask) <> 0 And m_nInstance < MAX_INST + m_nInstance += 1 + nMask *= 2 + End While + ' Se l'indice supera il massimo + If m_nInstance > nMaxInst Then + ' porto in primo piano la prima istanza + Dim bFound As Boolean = False + ' processi del programma a 32 bit + Dim localProc As Process() = Process.GetProcessesByName("OmagVIEWPlusR32") + For Each p As Process In localProc + If p.Id <> Process.GetCurrentProcess().Id Then + bFound = True + ShowWindow(p.MainWindowHandle, 1) + Exit For + End If + Next + ' se non trovati processi a 32 bit provo a 64 bit + If Not bFound Then + localProc = Process.GetProcessesByName("OmagVIEWPlusR64") + For Each p As Process In localProc + If p.Id <> Process.GetCurrentProcess().Id Then + bFound = True + ShowWindow(p.MainWindowHandle, SW.RESTORE) + Exit For + End If + Next + End If + ' esco dal programma + End + End If + ' Aggiorno stato istanze attive + nTmp += (1 << (m_nInstance - 1)) + WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString()) + End If + End Sub + + Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean + Return ((m_nKeyOptions And nKeyOpt) <> 0) + End Function + + Friend Sub Close() + ' Terminazione generale di EgtInterface + EgtExit() + ' Rilascio mutex + If Not IsNothing(m_objMutex) Then m_objMutex.Close() + ' Aggiorno istanze usate + Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0) + nTmp -= (1 << (m_nInstance - 1)) + WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString()) + End Sub + +#End Region ' METHODS + +End Class diff --git a/MainWindow/MainWindowV.xaml b/MainWindow/MainWindowV.xaml new file mode 100644 index 0000000..99c706d --- /dev/null +++ b/MainWindow/MainWindowV.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + diff --git a/MainWindow/MainWindowV.xaml.vb b/MainWindow/MainWindowV.xaml.vb new file mode 100644 index 0000000..35d4e68 --- /dev/null +++ b/MainWindow/MainWindowV.xaml.vb @@ -0,0 +1,38 @@ +Imports EgtWPFLib5 + +Class MainWindowV + + Private m_MainWindowVM As MainWindowVM + +#Region "CONSTRUCTOR" + + Sub New() + ' Funzione che interpreta l'xaml + InitializeComponent() + ' Assegno al riferimento locale al VM il VM preso dal DataContext + m_MainWindowVM = DirectCast(Me.DataContext, MainWindowVM) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "EVENTS" + + Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded + ' Carico e imposto posizione finestra + WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me) + End Sub + + Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered + m_MainWindowVM.ContentRendered() + End Sub + + Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing + ' Salvo posizione finestra (se non minimizzata) + If WindowState <> WindowState.Minimized Then + WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE) + End If + End Sub + +#End Region ' EVENTS + +End Class diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb new file mode 100644 index 0000000..79d7fcd --- /dev/null +++ b/MainWindow/MainWindowVM.vb @@ -0,0 +1,123 @@ +Imports EgtUILib +Imports EgtWPFLib5 +Imports System.IO + +Public Class MainWindowVM + Inherits VMBase + + ' Riferimento al Model della MainWindow + Private m_MainWindowM As MainWindowM + Friend ReadOnly Property MainWindowM As MainWindowM + Get + Return m_MainWindowM + End Get + End Property + + ' Dichiarazione della classe di connessione al PLC + Friend m_CNCommunication As NCCommunication + + ' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt) + Private m_bInitStatus As Boolean + Friend ReadOnly Property bInitStatus As Boolean + Get + Return m_bInitStatus + End Get + End Property + + ' Titolo + Private m_Title As String + Public Property Title As String + Get + Return m_Title + End Get + Set(value As String) + m_Title = value + NotifyPropertyChanged("Title") + End Set + End Property + + ' definizione comandi + Private m_cmdAboutBox As ICommand + Private m_cmdCloseApplication As ICommand + +#Region "CONSTRUCTOR" + + Sub New() + ' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM + Map.BeginInit(Me) + ' Creo Model della MainWindow + m_MainWindowM = New MainWindowM + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub SetTitle(sTitle As String) + m_Title = sTitle + NotifyPropertyChanged("Title") + End Sub + + Friend Sub ContentRendered() + ' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine + If Map.EndInit() Then + m_bInitStatus = True + ' altrimenti chiudo il programma + Else + m_bInitStatus = False + End If + ' Creazione gestore comunicazione con PLC + m_CNCommunication = New NCCommunication + SetTitle("OmagVIEWPlus") + End Sub + +#End Region ' METHODS + +#Region "COMMANDS" + +#Region "AboutBoxCommand" + + ' Returns a command that manage the MainWindow_Unloaded command + Public ReadOnly Property AboutBoxCommand() As ICommand + Get + If m_cmdAboutBox Is Nothing Then + m_cmdAboutBox = New Command(AddressOf AboutBox) + End If + Return m_cmdAboutBox + End Get + End Property + + ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. + Public Sub AboutBox(ByVal param As Object) + 'Dim AboutBoxWindow As New AboutBoxV + 'AboutBoxWindow.Owner = Application.Current.MainWindow + 'AboutBoxWindow.ShowDialog() + End Sub + +#End Region ' AboutBoxCommand + +#Region "CloseApplicationCommand" + + ' Returns a command that manage the MainWindow_Unloaded command + Public ReadOnly Property CloseApplicationCommand() As ICommand + Get + If m_cmdCloseApplication Is Nothing Then + m_cmdCloseApplication = New Command(AddressOf CloseApplication) + End If + Return m_cmdCloseApplication + End Get + End Property + + ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. + Public Sub CloseApplication(ByVal param As Object) + ' Termino il Model + m_MainWindowM.Close() + ' Termino il programma + Application.Current.Shutdown() + End Sub + +#End Region ' CloseApplicationCommand + +#End Region ' COMMANDS + +End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..d209cd9 --- /dev/null +++ b/My Project/AssemblyInfo.vb @@ -0,0 +1,74 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices +Imports System.Globalization +Imports System.Resources +Imports System.Windows + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + +#If PLATFORM = "x64" Then +#If DEBUG Then + + +#Else + + +#End if +#Else +#If DEBUG Then + + +#Else + + +#End If +#End If + + + + + + +'In order to begin building localizable applications, set +'CultureYouAreCodingWith in your .vbproj file +'inside a . For example, if you are using US english +'in your source files, set the to "en-US". Then uncomment the +'NeutralResourceLanguage attribute below. Update the "en-US" in the line +'below to match the UICulture setting in the project file. + +' + + +'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. +'1st parameter: where theme specific resource dictionaries are located +'(used if a resource is not found in the page, +' or application resource dictionaries) + +'2nd parameter: where the generic resource dictionary is located +'(used if a resource is not found in the page, +'app, and any theme specific resource dictionaries) + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/My Project/MyExtensions/MyWpfExtension.vb b/My Project/MyExtensions/MyWpfExtension.vb new file mode 100644 index 0000000..2f5639e --- /dev/null +++ b/My Project/MyExtensions/MyWpfExtension.vb @@ -0,0 +1,121 @@ +#If _MyType <> "Empty" Then + +Namespace My + ''' + ''' Module used to define the properties that are available in the My Namespace for WPF + ''' + ''' + _ + Module MyWpfExtension + Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer) + Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) + Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows) + Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log) + ''' + ''' Returns the application object for the running application + ''' + _ + Friend ReadOnly Property Application() As Application + Get + Return CType(Global.System.Windows.Application.Current, Application) + End Get + End Property + ''' + ''' Returns information about the host computer. + ''' + _ + Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer + Get + Return s_Computer.GetInstance() + End Get + End Property + ''' + ''' Returns information for the current user. If you wish to run the application with the current + ''' Windows user credentials, call My.User.InitializeWithWindowsUser(). + ''' + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User + Get + Return s_User.GetInstance() + End Get + End Property + ''' + ''' Returns the application log. The listeners can be configured by the application's configuration file. + ''' + _ + Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log + Get + Return s_Log.GetInstance() + End Get + End Property + + ''' + ''' Returns the collection of Windows defined in the project. + ''' + _ + Friend ReadOnly Property Windows() As MyWindows + _ + Get + Return s_Windows.GetInstance() + End Get + End Property + _ + _ + Friend NotInheritable Class MyWindows + _ + Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T + If Instance Is Nothing Then + If s_WindowBeingCreated IsNot Nothing Then + If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then + Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.") + End If + Else + s_WindowBeingCreated = New Global.System.Collections.Hashtable() + End If + s_WindowBeingCreated.Add(GetType(T), Nothing) + Return New T() + s_WindowBeingCreated.Remove(GetType(T)) + Else + Return Instance + End If + End Function + _ + _ + Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T) + instance = Nothing + End Sub + _ + _ + Public Sub New() + MyBase.New() + End Sub + Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyWindows) + End Function + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + End Class + End Module +End Namespace +Partial Class Application + Inherits Global.System.Windows.Application + _ + _ + Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo + _ + Get + Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly()) + End Get + End Property +End Class +#End If \ No newline at end of file diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb new file mode 100644 index 0000000..44192d8 --- /dev/null +++ b/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("OmagVIEWPlus.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/My Project/Resources.resx b/My Project/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb new file mode 100644 index 0000000..e9d8ca5 --- /dev/null +++ b/My Project/Settings.Designer.vb @@ -0,0 +1,71 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + + + _ +Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property +End Class + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.OmagVIEWPlus.MySettings + Get + Return Global.OmagVIEWPlus.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/My Project/Settings.settings b/My Project/Settings.settings new file mode 100644 index 0000000..2b428d2 --- /dev/null +++ b/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NCCommunication/NCCommunication.vb b/NCCommunication/NCCommunication.vb new file mode 100644 index 0000000..443adc0 --- /dev/null +++ b/NCCommunication/NCCommunication.vb @@ -0,0 +1,323 @@ +Imports System.Windows.Threading +Imports EgtWPFLib5 +Imports Sharp7 + +Public Class NCCommunication + + Public Enum Types As Integer + ' BIT = 0 + ' WORD = 1 + INT = 2 + ' DWORD = 3 + DINT = 4 + REAL = 5 + ' STRING_ = 6 + ' CHAR_ARRAY = 7 + End Enum + + Public Enum Connection_States As Integer + DEBUG = 0 + SIEMENS = 3 + End Enum + + Private m_bFirst As Boolean = True + + ' Timer + Private m_TimerIsBusy As Boolean = False + Private m_RefreshTimer As New DispatcherTimer + + Private m_NC As Nc_Parent = Nothing + Private Connection_State As Connection_States = Connection_States.DEBUG + + Private Sub ShowResult(ByVal Result As Integer) + ' This function returns a textual explaination of the error code + 'TextError.Text = Client.ErrorText(Result) + End Sub + + Public Sub New() + ' lettura tipo di PLC + Dim nType As Integer = GetMainPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0) + Select Case nType + Case Connection_States.DEBUG + Connection_State = Connection_States.DEBUG + Case Connection_States.SIEMENS + ' creazione classe Siemens + m_NC = New Nc_Siemens + ' connessione + Dim bOk As Boolean = m_NC.InitConnection() + If bOk Then + Connection_State = Connection_States.SIEMENS + Else + Connection_State = Connection_States.DEBUG + MessageBox.Show("Impossible connect to the PLC.") + End If + Case Else + Connection_State = Connection_States.DEBUG + End Select + If Connection_State = Connection_States.DEBUG Then + m_NC = New Nc_Debug + End If + ' lancio il timer di aggiornamento dell'interfaccia + 'AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_Tick + 'm_RefreshTimer.Interval = TimeSpan.FromMilliseconds(GetMainPrivateProfileInt(S_NUMERICALCONTROL, K_TIMERINTERVAL, 1000)) + 'm_RefreshTimer.Start() + ' Eseguo subito la prima lettura variabili + Refresh() + End Sub + + Private Sub RefreshTimer_Tick() + If Not m_TimerIsBusy Then + m_TimerIsBusy = True + m_RefreshTimer.Stop() + Refresh() + m_TimerIsBusy = False + m_RefreshTimer.Start() + End If + End Sub + + Private Sub Refresh() + 'Dim n1Value As Integer = 0 + 'Dim x As Boolean = m_NC.ReadInt(81, 0, n1Value) + 'Dim y As Boolean = m_NC.WriteInt(81, 0, 547) + ''Dim nValue As Integer = 0 + ''ReadInt32(81, 0, nValue) + 'Dim dValue As Double = 0 + 'm_NC.ReadReal(81, 2, dValue) + + 'Dim dVal As Double = 0 + 'Dim z As Boolean = m_NC.ReadReal(81, 2, dVal) + 'Dim e As Boolean = m_NC.WriteReal(81, 2, 635.8736) + 'Dim b As Boolean = False + 'x = TryCast(m_NC, Nc_Siemens).ReadBool(81, 6, b) + 'x = TryCast(m_NC, Nc_Siemens).WriteBool(81, 6, True) + 'Dim s As String = "" + 'x = TryCast(m_NC, Nc_Siemens).ReadString(81, 8, 6, s) + 'x = TryCast(m_NC, Nc_Siemens).WriteString(81, 8, "tres") + + + + + Dim nValue As Integer = 0 + Dim nValue2 As Integer = 0 + ' Leggo magazzino attivo + Dim ActiveStorage As Warehouses = Warehouses.A + If ReadInt("ActiveStorage", nValue) Then + If nValue >= 0 OrElse nValue < 3 Then ActiveStorage = DirectCast(nValue, Warehouses) + Map.refUnloadingAreaVM.SetActiveWarehouse(ActiveStorage) + End If + ' Calcolo magazzino non attivo + Dim NotActiveStorage As Warehouses = If(ActiveStorage = Warehouses.A, Warehouses.B, Warehouses.A) + ' Leggo box attivo + Dim ActiveBox As Integer = 0 + If ReadInt("ActiveBox", nValue) Then + If nValue >= 0 OrElse nValue <= 6 Then ActiveBox = nValue + Map.refUnloadingAreaVM.SetBoxIsActive(ActiveBox) + End If + If m_bFirst Then + ' Leggo se primo magazzino è pallet o rack + Dim Storage1_IsPallet As Boolean = True + If ReadInt("Storage1_IsPallet", nValue) Then + Storage1_IsPallet = (nValue <> 0) + Map.refUnloadingAreaVM.SetWarehouse_IsPallet(Warehouses.A, Storage1_IsPallet) + End If + ' Leggo se secondo magazzino è pallet o rack + Dim Storage2_IsPallet As Boolean = True + If ReadInt("Storage2_IsPallet", nValue) Then + Storage2_IsPallet = (nValue <> 0) + Map.refUnloadingAreaVM.SetWarehouse_IsPallet(Warehouses.B, Storage2_IsPallet) + End If + Else + 'Verifico se magazzino attivo + If ActiveStorage <> 0 Then + ' Leggo se magazzino attivo è pallet o rack + Dim Storage_IsPallet As Boolean = True + If ReadInt("Storage" & ActiveStorage & "_IsPallet", nValue) Then + Storage_IsPallet = (nValue <> 0) + Map.refUnloadingAreaVM.SetWarehouse_IsPallet(ActiveStorage, Storage_IsPallet) + End If + ' Scrivo se magazzino non attivo è pallet o rack + Storage_IsPallet = True + WriteInt("WStorage" & NotActiveStorage & "_IsPallet", If(Map.refUnloadingAreaVM.WarehouseList(NotActiveStorage - 1).IsPallet, 1, 0)) + ' Non c'è magazzino attivo + Else + WriteInt("WStorage1_IsPallet", If(Map.refUnloadingAreaVM.WarehouseList(Warehouses.A - 1).IsPallet, 1, 0)) + WriteInt("WStorage2_IsPallet", If(Map.refUnloadingAreaVM.WarehouseList(Warehouses.B - 1).IsPallet, 1, 0)) + End If + End If + ' Leggo stato primo magazzino + Dim Storage1_Stato As States = States.NOT_AVAILABLE + If ReadInt("Storage1_Stato", nValue) Then + If nValue >= 0 OrElse nValue <= 3 Then Storage1_Stato = DirectCast(nValue, States) + Map.refUnloadingAreaVM.WarehouseList(0).SetState(Storage1_Stato) + End If + ' Leggo stato secondo magazzino + Dim Storage2_Stato As States = States.NOT_AVAILABLE + If ReadInt("Storage2_Stato", nValue) Then + If nValue >= 0 OrElse nValue <= 3 Then Storage2_Stato = DirectCast(nValue, States) + Map.refUnloadingAreaVM.WarehouseList(1).SetState(Storage2_Stato) + End If + If m_bFirst Then + ' Leggo stati pallet/rack di entrambi i magazzini + Dim StorageX_BoxX_Stato As States = States.NOT_AVAILABLE + For StorageX As Integer = 1 To 2 + Dim MaxBoxX As Integer = If(Map.refUnloadingAreaVM.WarehouseList(StorageX - 1).IsPallet, 6, 3) + For BoxX As Integer = 1 To MaxBoxX + StorageX_BoxX_Stato = States.NOT_AVAILABLE + If ReadInt("Storage" & StorageX & "_Box" & BoxX & "_Stato", nValue) Then + If nValue >= 0 OrElse nValue <= 3 Then StorageX_BoxX_Stato = DirectCast(nValue, States) + Map.refUnloadingAreaVM.SetBoxState(If(StorageX = 1, Warehouses.A, Warehouses.B), BoxX, StorageX_BoxX_Stato) + End If + Next + Next + Else + 'Verifico se magazzino attivo + If ActiveStorage <> 0 Then + ' Leggo stati del magazzino attivo + Dim StorageX_BoxX_Stato As States = States.NOT_AVAILABLE + Dim MaxBoxX As Integer = If(Map.refUnloadingAreaVM.WarehouseList(ActiveStorage - 1).IsPallet, 6, 3) + For BoxX As Integer = 1 To MaxBoxX + StorageX_BoxX_Stato = States.NOT_AVAILABLE + If ReadInt("Storage" & ActiveStorage & "_Box" & BoxX & "_Stato", nValue) Then + If nValue >= 0 OrElse nValue <= 3 Then StorageX_BoxX_Stato = DirectCast(nValue, States) + Map.refUnloadingAreaVM.SetBoxState(If(ActiveStorage = 1, Warehouses.A, Warehouses.B), BoxX, StorageX_BoxX_Stato) + End If + Next + ' Scrivo stati del magazzino non attivo + MaxBoxX = If(Map.refUnloadingAreaVM.WarehouseList(NotActiveStorage - 1).IsPallet, 6, 3) + For BoxX As Integer = 1 To MaxBoxX + Dim nState As Integer = Map.refUnloadingAreaVM.WarehouseList(NotActiveStorage - 1).Boxes(BoxX - 1).State + WriteInt("WStorage" & NotActiveStorage & "_Box" & BoxX & "_Stato", nState) + Next + ' Non c'è magazzino attivo + Else + For StorageX As Integer = 1 To 2 + Dim MaxBoxX As Integer = If(Map.refUnloadingAreaVM.WarehouseList(StorageX - 1).IsPallet, 6, 3) + For BoxX As Integer = 1 To MaxBoxX + Dim nState As Integer = Map.refUnloadingAreaVM.WarehouseList(StorageX - 1).Boxes(BoxX - 1).State + WriteInt("WStorage" & StorageX & "_Box" & BoxX & "_Stato", nState) + Next + Next + End If + + End If + ' Leggo numero massimo righe e colonne + Dim MaxNRighe As Integer = 0 + Dim MaxNColonne As Integer = 0 + If ReadInt("MaxNRighe", nValue) AndAlso ReadInt("MaxNColonne", nValue2) Then + If nValue >= 0 Then MaxNRighe = nValue + If nValue2 >= 0 Then MaxNColonne = nValue2 + Map.refUnloadingAreaVM.MaxFillActiveBox(MaxNRighe, MaxNColonne) + End If + ' Leggo numero riga e colonna corrente su box attivo + Dim ActBox_Livello As Integer = 0 + Dim ActBox_Riga As Integer = 0 + If ReadInt("ActBox_Livello", nValue) AndAlso ReadInt("ActBox_Riga", nValue2) Then + If nValue >= 0 Then ActBox_Livello = nValue + If nValue2 >= 0 Then ActBox_Riga = nValue2 + Map.refUnloadingAreaVM.FillActiveBox(ActBox_Livello, ActBox_Riga) + End If + ' Leggo contatore 1 + Dim Table1Counter As Integer = 0 + If ReadInt("Table1Counter", nValue) Then + If nValue >= 0 Then Table1Counter = nValue + Map.refUnloadingAreaVM.SetTable1Counter(Table1Counter) + End If + ' Leggo contatore 2 + Dim Table2Counter As Integer = 0 + If ReadInt("Table2Counter", nValue) Then + If nValue >= 0 Then Table2Counter = nValue + Map.refUnloadingAreaVM.SetTable2Counter(Table2Counter) + End If + ' Leggo riga corrente tavolo 1 + Dim Table1CurrRow As Integer = 0 + Dim Table1NRow As Integer = 0 + If ReadInt("Table1CurrRow", nValue) AndAlso ReadInt("Table1NRow", nValue2) Then + If nValue >= 0 Then Table1CurrRow = nValue + If nValue2 >= 0 Then Table1NRow = nValue2 + Map.refUnloadingAreaVM.SetTable1Percentage(Table1CurrRow, Table1NRow) + End If + ' Leggo tipo di piastrella + Dim TipoPiastrella As Integer = 0 + If ReadInt("TipoPiastrella", nValue) Then + If nValue >= 1 OrElse nValue <= 5 Then TipoPiastrella = nValue + 'Map.refUnloadingAreaVM.SetBoxIsActive(TipoPiastrella) + End If + ' Leggo spessore + Dim DimensioneZ As Integer = 0 + If ReadInt("DimensioneZ", nValue) Then + If nValue >= 0 Then DimensioneZ = nValue + 'Map.refUnloadingAreaVM.SetBoxIsActive(TipoPiastrella) + End If + ' Leggo ultima lastra + Dim UltimaLastra As Integer = 0 + If ReadInt("UltimaLastra", nValue) Then + If nValue >= 0 Then UltimaLastra = nValue + 'Map.refUnloadingAreaVM.SetBoxIsActive(TipoPiastrella) + End If + ' se Debug, incremento tempo + If Connection_State = Connection_States.DEBUG Then TryCast(m_NC, Nc_Debug).IncrementTime() + + m_bFirst = False + End Sub + + Private Function ReadInt(sVarName As String, ByRef nValue As Integer) As Boolean + Dim bok As Boolean = True + Dim sVar As String = String.Empty + ' Lettura variabile + If GetMainPrivateProfileString(S_VARIABLES, sVarName, "", sVar) > 0 Then + ' Spezzatura nei componenti + Dim sVarSplit() As String = sVar.Split(","c) + If sVarSplit.Length = 3 Then + ' elimino spazi + For Each Var In sVarSplit + Var = Var.Trim + Next + Dim nType As Integer = 0 + Dim Type As Types = 0 + Integer.TryParse(sVarSplit(2), nType) + If nType >= 0 AndAlso nType <= 7 Then Type = DirectCast(nType, Types) + If Type = 2 Then + Dim DbNumber As Integer = 0 + Dim Start As Integer = 0 + Integer.TryParse(sVarSplit(0), DbNumber) + Integer.TryParse(sVarSplit(1), Start) + If m_NC.ReadInt(DbNumber, Start, nValue) Then + Return True + End If + End If + End If + End If + Return False + End Function + + Private Function WriteInt(sVarName As String, nValue As Integer) As Boolean + Dim bok As Boolean = True + Dim sVar As String = String.Empty + ' Lettura variabile + If GetMainPrivateProfileString(S_VARIABLES, sVarName, "", sVar) > 0 Then + ' Spezzatura nei componenti + Dim sVarSplit() As String = sVar.Split(","c) + If sVarSplit.Length = 3 Then + ' elimino spazi + For Each Var In sVarSplit + Var = Var.Trim + Next + Dim nType As Integer = 0 + Dim Type As Types = 0 + Integer.TryParse(sVarSplit(2), nType) + If nType >= 0 AndAlso nType <= 7 Then Type = DirectCast(nType, Types) + If Type = 2 Then + Dim DbNumber As Integer = 0 + Dim Start As Integer = 0 + Integer.TryParse(sVarSplit(0), DbNumber) + Integer.TryParse(sVarSplit(1), Start) + If m_NC.WriteInt(DbNumber, Start, nValue) Then + Return True + End If + End If + End If + End If + Return False + End Function + +End Class diff --git a/NCCommunication/Nc_Debug.vb b/NCCommunication/Nc_Debug.vb new file mode 100644 index 0000000..13490cb --- /dev/null +++ b/NCCommunication/Nc_Debug.vb @@ -0,0 +1,56 @@ +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class Nc_Debug + Inherits Nc_Parent + + Private m_sDebugFilePath As String = Map.refMainWindowVM.MainWindowM.sConfigDir & "\Nc_Debug.ini" + Private m_nTime As Integer = 1 + + Private IntBuffer As Integer = 0 + Private DoubleBuffer As Double = 0 + Private StringBuffer As String ' Buffer + + Friend Overrides Function InitConnection() As Boolean + Return True + End Function + + Friend Overrides Sub CloseConnection() + End Sub + + Friend Overrides Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + Value = GetPrivateProfileInt(m_nTime.ToString, DBNumber & "." & Start, 0, m_sDebugFilePath) + Return True + End Function + + Friend Overrides Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean + Return WritePrivateProfileString(m_nTime.ToString, DBNumber & "." & Start, Value.ToString, m_sDebugFilePath) + End Function + + Friend Overrides Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + Value = GetPrivateProfileInt(m_nTime.ToString, DBNumber & "." & Start, 0, m_sDebugFilePath) + Return True + End Function + + Friend Overrides Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean + Return WritePrivateProfileString(m_nTime.ToString, DBNumber & "." & Start, Value.ToString, m_sDebugFilePath) + End Function + + Friend Overrides Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean + Value = GetPrivateProfileDouble(m_nTime.ToString, DBNumber & "." & Start, 0, m_sDebugFilePath) + Return True + End Function + + Friend Overrides Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean + Return WritePrivateProfileString(m_nTime.ToString, DBNumber & "." & Start, DoubleToString(Value, 3), m_sDebugFilePath) + End Function + + Friend Sub SetTime(nTime As Integer) + m_nTime = nTime + End Sub + + Friend Sub IncrementTime() + m_nTime += 1 + End Sub + +End Class diff --git a/NCCommunication/Nc_Parent.vb b/NCCommunication/Nc_Parent.vb new file mode 100644 index 0000000..5f7b5b3 --- /dev/null +++ b/NCCommunication/Nc_Parent.vb @@ -0,0 +1,19 @@ +Public MustInherit Class Nc_Parent + + Friend MustOverride Function InitConnection() As Boolean + + Friend MustOverride Sub CloseConnection() + + Friend MustOverride Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + + Friend MustOverride Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean + + Friend MustOverride Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + + Friend MustOverride Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean + + Friend MustOverride Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean + + Friend MustOverride Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean + +End Class diff --git a/NCCommunication/Nc_Siemens.vb b/NCCommunication/Nc_Siemens.vb new file mode 100644 index 0000000..55c6f68 --- /dev/null +++ b/NCCommunication/Nc_Siemens.vb @@ -0,0 +1,120 @@ +Imports EgtWPFLib5 +Imports Sharp7 + +Public Class Nc_Siemens + Inherits Nc_Parent + + Private IntBuffer() As Byte = {0, 0} + Private BoolBuffer() As Byte = {0} + Private DIntBuffer() As Byte = {0, 0, 0, 0} + Private RealBuffer() As Byte = {0, 0, 0, 0} + Private StringBuffer(65536) As Byte ' Buffer + Private Client As New S7Client ' Client Object + + Friend Overrides Function InitConnection() As Boolean + Dim Result As Integer + Dim sIp As String = "" + GetMainPrivateProfileString(S_NUMERICALCONTROL, K_IP, "", sIp) + Dim nRack As Integer = GetMainPrivateProfileInt(S_NUMERICALCONTROL, K_RACK, 0) + Dim nSlot As Integer = GetMainPrivateProfileInt(S_NUMERICALCONTROL, K_SLOT, 0) + Result = Client.ConnectTo(sIp, nRack, nSlot) + Return Result = 0 + End Function + + Friend Overrides Sub CloseConnection() + Client.Disconnect() + End Sub + + Friend Overrides Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + ' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer. + Dim Result As Integer = Client.DBRead(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer + If Result = 0 Then + Value = S7.GetIntAt(IntBuffer, 0) + Return True + End If + Return False + End Function + + Friend Overrides Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean + S7.SetIntAt(IntBuffer, 0, Value) + ' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer. + Dim Result As Integer = Client.DBWrite(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer + Return Result = 0 + End Function + + Friend Function ReadBool(DBNumber As Integer, Start As Integer, ByRef Value As Boolean) As Boolean + ' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer. + Dim Result As Integer = Client.DBRead(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer + If Result = 0 Then + Value = BitConverter.ToBoolean(BoolBuffer, 0) + Return True + End If + Return False + End Function + + Friend Function WriteBool(DBNumber As Integer, Start As Integer, Value As Boolean) As Boolean + If Value Then + BoolBuffer(0) = &H1 + Else + BoolBuffer(0) = &H0 + End If + ' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer. + Dim Result As Integer = Client.DBWrite(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer + Return Result = 0 + End Function + + Friend Overrides Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean + ' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer. + Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer + If Result = 0 Then + Value = S7.GetDIntAt(DIntBuffer, 0) + Return True + End If + Return False + End Function + + Friend Overrides Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean + S7.SetDIntAt(DIntBuffer, 0, Value) + ' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer. + Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer + Return Result = 0 + End Function + + Friend Overrides Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean + ' Read 4 bytes from the DBNumber starting from Start and puts them into ReadBuffer. + Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer + If Result = 0 Then + Value = S7.GetRealAt(RealBuffer, 0) + Return True + End If + Return False + End Function + + Friend Overrides Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean + S7.SetRealAt(RealBuffer, 0, Value) + ' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer. + Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer + Return Result = 0 + End Function + + Friend Function ReadString(DBNumber As Integer, Start As Integer, Length As Integer, ByRef Value As String) As Boolean + ' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer. + Dim Result As Integer = Client.DBRead(DBNumber, Start, Length, StringBuffer) ' DbNumber, Start, Amount, Buffer + If Result = 0 Then + Value = S7.GetStringAt(StringBuffer, 0) + Return True + End If + Return False + End Function + + Friend Function WriteString(DBNumber As Integer, Start As Integer, Value As String) As Boolean + If Value.Length > 65535 Then + Return False + End If + S7.SetStringAt(StringBuffer, 0, 65535, Value) + ' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer. + Dim Result As Integer = Client.DBWrite(DBNumber, Start, Value.Length + 2, StringBuffer) ' DbNumber, Start, Amount, Buffer + Return Result = 0 + End Function + +End Class diff --git a/OmagVIEWPlus.sln b/OmagVIEWPlus.sln new file mode 100644 index 0000000..b9a1a10 --- /dev/null +++ b/OmagVIEWPlus.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OmagVIEWPlus", "OmagVIEWPlus.vbproj", "{14F465D6-9866-4DB4-AD9D-301B9E0C1338}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14F465D6-9866-4DB4-AD9D-301B9E0C1338}.Debug|x86.ActiveCfg = Debug|x86 + {14F465D6-9866-4DB4-AD9D-301B9E0C1338}.Debug|x86.Build.0 = Debug|x86 + {14F465D6-9866-4DB4-AD9D-301B9E0C1338}.Release|x86.ActiveCfg = Release|x86 + {14F465D6-9866-4DB4-AD9D-301B9E0C1338}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/OmagVIEWPlus.vbproj b/OmagVIEWPlus.vbproj new file mode 100644 index 0000000..21fe4ad --- /dev/null +++ b/OmagVIEWPlus.vbproj @@ -0,0 +1,263 @@ + + + + + Debug + AnyCPU + {14F465D6-9866-4DB4-AD9D-301B9E0C1338} + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + WinExe + OmagVIEWPlus + OmagVIEWPlus + v4.0 + Custom + Client + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + On + + + Binary + + + Off + + + On + + + bin\x64\Debug\ + + + true + + + None + x64 + MinimumRecommendedRules.ruleset + + + true + bin\x64\Release\ + + + true + + + pdbonly + x64 + MinimumRecommendedRules.ruleset + + + bin\x86\Debug\ + + + false + + + Full + x86 + MinimumRecommendedRules.ruleset + true + true + true + + + false + bin\x86\Release\ + + + true + + + None + x86 + MinimumRecommendedRules.ruleset + + + + ..\..\EgtProg\DllD32\EgtUILib.dll + + + ..\..\EgtProg\DllD32\EgtWPFLib5.dll + + + ..\..\EgtProg\OmagVIEWPlus\Sharp7.net.dll + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + Application.xaml + Code + + + + + + + + + UnloadingAreaV.xaml + + + + Dictionary.xaml + + + + + + + WarehouseV.xaml + + + + + + + + + + + + + + + + + + + + + + + + + + MainWindowV.xaml + + + + Code + + + Microsoft.VisualBasic.WPF.MyExtension + 1.0.0.0 + + + True + True + Resources.resx + + + True + Settings.settings + True + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + + + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + + + + False + Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 4.5 + true + + + + + + + + + + + + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagVIEWPlus\OmagVIEWPlusR32.exe +IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\OmagVIEWPlus\OmagVIEWPlusD32.exe + + \ No newline at end of file diff --git a/Resources/LogoOmag.jpg b/Resources/LogoOmag.jpg new file mode 100644 index 0000000000000000000000000000000000000000..394b44333a1d8b11d3c8ab4963990898e803986a GIT binary patch literal 10449 zcmb7qWl$X5wssH9;4(M_8{C3JaCdit1ql{B5Zv8DaA$D0;7$_UHArwL5Fj`tK!A_D z=bU?gd{wvZ-LZD#!w$r|}&08~`4d0Vx0x0pag_8sMi1 zL4iQPU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><;m$x?OKSydl6LZQ%iE(~bEjVTJ!{#^n|l|Z=ef1j=INWysR!gEtKZk(pSwKM zDq>pdmAzGkrV^H%hKI!#rJ-{UHw_z?Qh(bsQI_8t2Xld+FSAA!NG&~E_yeY$=W@Ajr)~*KgX=x&9?dV*Inzbzus5;Wv9`z+P~T5 z7It>?*xqXH{qEntLl5G$81esyIHAd>A%h8+)FEIIX9kSfp|*e#%2t@w0Lon;Fshhg zG&C4S(+0z6P8lr8X-mf5z^5XX1N!UiaVMpHk$$@_gI7 zSn>O+n8(E%_rJcl*!}N=2M?n59lmVR`zvm0YNX!X)f3MjefaR9ue~@sbJ^V&glY>tEHvek`m3aI~ fe-4C+JA3?RtN5$fRZ`@$1*Fo`)z4*}Q$iB}#k~a1 literal 0 HcmV?d00001 diff --git a/Resources/OmagCUT.ico b/Resources/OmagCUT.ico new file mode 100644 index 0000000000000000000000000000000000000000..cc99fc7d71e8c0e99488c687b68317ec7666a50d GIT binary patch literal 9158 zcmeHL2~?BE+J4k(tL3k>zf`MLv52D8TeP64b-^l%S}hVpiy~VAK@?;v)Y8`beqTsHYZVDUbCekF3E>cn#h8;UL0nuM0uz&wn3xEE zNeaAEQjkQ&dFxIDZQBM*sT8Yr?0{`vKC-j3v2*86q^2Fm_FXy1+O-Q(=|S)d3z3(X zhlIQm6jGa4RF2)dcSA0hLv;8sN=r*oytfYWvLlH2@+e}C9mSVNj^M zd1ud}wzd{^^=HvgUyqUt7jXXkc_@`ioVVwU!cRZ{jGuq`1-~%m`Exv{ z^0)o{2L4mufOb!_>TVouZL3vXX2tZoTUUSayczR8-}S_)`$;gF?e$W{jo;NOvcR8AI$bY{b2Cm zspk59UhDm;1)Gm!F}YW-zJ2@Z&r;>*a7;%`HZh@HOWkLif3V-t3_HcA`#2ROJ zxVX5$&CLz#Jv`XG_;o%X{{H?LE(pd<-*l`F491vHA!Y;%5fl`JnIRz+E!YiLnG8imMJOcy z?%jK^XU`tUsO%xX_x}CJE0&{h?_TVsvTxr$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et.png b/Resources/Pallet.png new file mode 100644 index 0000000000000000000000000000000000000000..2614b559bd9ce36541baa139beb46959afe09d94 GIT binary patch literal 1412 zcmeAS@N?(olHy`uVBq!ia0vp^CxCc42OE$K`6Vm}q*#ibJVQ8upoSx*1IXtr@Q5r1 zDFR_eek<8KK!#+AYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&3=FJ{o-U3d z6?5L+weOHgl{o(K``np-567BSm&aI4Ru+0)u%K6CqKOh`#`II?8d~RW6BOBa!Kzh& zO~gcd3*2PySMMo{N87F{nzG`#gaGQvoEWipE^_D=kuo@ z^Ydf)R^Pp2ZEW|nQtH;+_;|%#+q~ChS{>OPId5m@%br(k}y_inwkakuYI>mFgdjSP(r zq@jcN|2-<&dh2ZQYDUc+7czfagY2r9<#+td+Q@S!7QNQp@&{y(>6|6J^R0o-OBZk| zTs1rW_375DJkRHxo?CoAns3GGrNYOJ(%!z9X?^Yg`f|O;!rTHJEF_?=``cG-y58@* znsKw%H1D@>mRYBpzCug&-8y6G(w-jzjtu1wx+-x)s3^_qcoy~ycB=6&s{@6Iya zls)$GYWDVfTY$mZH?3k8+oqkdb=JqdZGLOZ-rs6fUoOM{^9U0Q6C-Kp|Ks%Or=AM$ zygBKR*0O?4FY}}4#-~3vvVFbBKHExVDLXfB{rwU*-?!&4dAmM4JFViKY|E;OytOC# z6FZ-?o@Ok5_vT`=dQSHF=QT-;OpOf0Bd3q)>$(00K5|>gm?v_}s!h6eVZ{b{_r)nY zI0_~B*2VpPD7yOd>o*yl&)KILn{7Y6{#kWrdftzB#{}m`G&m@bh92zSU6;9Q%M8=C zY-d(Q=xyCR8x;2iv&=r-nZJFGpwq6~nLn+8X>%1K;M4!zGhcuF>(fKgyo~?WZ~M0D zh`N}900#+3q@P_;?fDro#bpnimfOxZzjy3%iB($O*&;Ww*!+c0<)hB6Sp85X_s5-g zckfEJMEv-L Srx&0Slfl!~&t;ucLK6TG@gx5L literal 0 HcmV?d00001 diff --git a/Resources/Rack.png b/Resources/Rack.png new file mode 100644 index 0000000000000000000000000000000000000000..7e3af6c5d4fec9e5913fbea4de50532c02e00706 GIT binary patch literal 1131 zcmeAS@N?(olHy`uVBq!ia0vp^n-~}v893O0Eb;$3i+~hMv6E*A2N2Y7q;vrJoCO|{ z#X$Nf2s6r_-L(S9kSuYHC<)F_D=AMbN@XZ7FW1Y=%Pvk%EJ)SMFG`>N&PIxXf%%1} zi(^Q|oVT|evx-9*+8$O<4!M1(|J3zRT&>K%05p{33h*HJk;^Uv1zGXH6v zB+uiIKW5E)E`PrC{?V2{K(OQH9JBPEkMHaD|4&`$sgtq&cCAG6pOSUIZFD^_4aREQ z2op^Fe2qEo?!9|;GRbpF(zZs`?!22Z z^^7`P=l)v!wVrT*wsimee*5(4(~noCACs8BEb~`xqoq#Hyyssf9?vemTW+XmZ)f+f zu(U-!2kez?SV_0?D1nX~HR(gfe1Q1|ENio=@2 k?vzopr0GxiLSO5S3 literal 0 HcmV?d00001 diff --git a/Resources/Source/Pallet.svg b/Resources/Source/Pallet.svg new file mode 100644 index 0000000..97dcebe --- /dev/null +++ b/Resources/Source/Pallet.svg @@ -0,0 +1,124 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/Resources/Tavola1.png b/Resources/Tavola1.png new file mode 100644 index 0000000000000000000000000000000000000000..0135184863035e431a5ba59821b30a858b177f7b GIT binary patch literal 2202 zcmeAS@N?(olHy`uVBq!ia0y~yU>0FuVC>>x1By&7VDAP}EX7WqAsj$Z!;#Vf2?-qae&Edv@0fAVadmHKHUqKdq!Zu_%?Hyu4g5GcUV1Ik6yBFTW^#_B$IX1_lms zPZ!6KiaBqu8}c4DU|=}7ORMX_hd4II;D4K%7w&hN_)g%@ujF%;>$cYEGcYvR*M7Tq zT;g$cIR^v72b=f1nSo-@jeyQ`NYel^&jbLiow*Q57&$XCFr>6GF)*CqVP#;LAPMx2 xg7K)r(cl?P6r)*Tw4@j + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UnloadingArea/UnloadingAreaV.xaml.vb b/UnloadingArea/UnloadingAreaV.xaml.vb new file mode 100644 index 0000000..641b141 --- /dev/null +++ b/UnloadingArea/UnloadingAreaV.xaml.vb @@ -0,0 +1,3 @@ +Public Class UnloadingAreaV + +End Class diff --git a/UnloadingArea/UnloadingAreaVM.vb b/UnloadingArea/UnloadingAreaVM.vb new file mode 100644 index 0000000..dec8bd6 --- /dev/null +++ b/UnloadingArea/UnloadingAreaVM.vb @@ -0,0 +1,148 @@ +Imports System.Collections.ObjectModel +Imports EgtWPFLib5 + +Public Class UnloadingAreaVM + Inherits VMBase + + Private m_WarehouseList As New ObservableCollection(Of WarehouseVM) + Public ReadOnly Property WarehouseList As ObservableCollection(Of WarehouseVM) + Get + Return m_WarehouseList + End Get + End Property + + Private m_ActiveWarehouse As Warehouses + Public ReadOnly Property ActiveWarehouse As Warehouses + Get + Return m_ActiveWarehouse + End Get + End Property + + Private m_Table1CurrRow As Integer + Private m_Table1NRow As Integer + Public ReadOnly Property Table1Percentage As String + Get + Return DoubleToString(m_Table1CurrRow / m_Table1NRow * 100, 0) & "%" + End Get + End Property + + Private m_TileType As Integer + Public ReadOnly Property TileType As String + Get + Return m_TileType.ToString + End Get + End Property + Private m_Table1Counter As Integer + Public ReadOnly Property Table1Counter As String + Get + Return m_Table1Counter.ToString + End Get + End Property + Private m_Table2Counter As Integer + Public ReadOnly Property Table2Counter As String + Get + Return m_Table2Counter.ToString + End Get + End Property + Private m_TileThickness As Double + Public ReadOnly Property TileThickness As String + Get + Return LenToString(m_TileThickness, 1) + End Get + End Property + Private m_LastSlab As Boolean + Public ReadOnly Property LastSlab As Boolean + Get + Return m_LastSlab + End Get + End Property + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in CompoWindowMap + Map.SetRefUnloadingAreaVM(Me) + m_WarehouseList.Add(New WarehouseVM(Warehouses.A)) + m_WarehouseList.Add(New WarehouseVM(Warehouses.B)) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub SetActiveWarehouse(ActiveWarehouse As Warehouses) + m_ActiveWarehouse = ActiveWarehouse + If ActiveWarehouse = Warehouses.A Then + m_WarehouseList(0).SetIsActive(True) + m_WarehouseList(1).SetIsActive(False) + ElseIf ActiveWarehouse = Warehouses.B Then + m_WarehouseList(0).SetIsActive(False) + m_WarehouseList(1).SetIsActive(True) + End If + 'If ActiveWarehouse <> m_ActiveWarehouse Then + ' m_ActiveWarehouse = ActiveWarehouse + ' For Each Warehouse In m_WarehouseList + ' Warehouse.SetState(If(Warehouse.Id = ActiveWarehouse, States.ACTIVE, States.FULL)) + ' Next + ' m_WarehouseList(ActiveWarehouse - 1).SetState(States.ACTIVE) + 'End If + End Sub + + Friend Sub SetWarehouse_IsPallet(Warehouse As Warehouses, IsPallet As Boolean) + m_WarehouseList(Warehouse - 1).SetIsPallet(IsPallet) + End Sub + + Friend Sub SetBoxIsActive(BoxId As Integer) + If Not m_ActiveWarehouse > 0 AndAlso m_ActiveWarehouse <= 2 Then + m_WarehouseList(Warehouses.A).SetBoxIsActive(0) + m_WarehouseList(Warehouses.A).SetBoxIsActive(0) + End If + m_WarehouseList(m_ActiveWarehouse - 1).SetBoxIsActive(BoxId) + End Sub + + Friend Sub SetBoxState(Warehouse As Warehouses, Id As Integer, State As States) + m_WarehouseList(Warehouse - 1).SetBoxState(Id, State) + End Sub + + Friend Sub FillActiveBox(Livello As Integer, Riga As Integer) + m_WarehouseList(m_ActiveWarehouse - 1).FillActiveBox(Livello, Riga) + End Sub + + Friend Sub MaxFillActiveBox(MaxLivello As Integer, MaxRiga As Integer) + m_WarehouseList(m_ActiveWarehouse - 1).MaxFillActiveBox(MaxLivello, MaxRiga) + End Sub + + Friend Sub SetTable1Counter(Table1Counter As Integer) + m_Table1Counter = Table1Counter + NotifyPropertyChanged("Table1Counter") + End Sub + + Friend Sub SetTable2Counter(Table2Counter As Integer) + m_Table2Counter = Table2Counter + NotifyPropertyChanged("Table2Counter") + End Sub + + Friend Sub SetTable1Percentage(Table1CurrRow As Integer, Table1NRow As Integer) + m_Table1CurrRow = Table1CurrRow + m_Table1NRow = Table1NRow + NotifyPropertyChanged("Table1Percentage") + End Sub + + Friend Sub SetTileType(TyleType As Integer) + m_TileType = TyleType + NotifyPropertyChanged("TileType") + End Sub + + Friend Sub SetTileThickness(TileThickness As Double) + m_TileThickness = TileThickness + NotifyPropertyChanged("TileThickness") + End Sub + + Friend Sub SetLastSlab(LastSlab As Boolean) + m_LastSlab = LastSlab + NotifyPropertyChanged("LastSlab") + End Sub + +#End Region ' METHODS + +End Class diff --git a/Utility/Dictionary.xaml b/Utility/Dictionary.xaml new file mode 100644 index 0000000..487c294 --- /dev/null +++ b/Utility/Dictionary.xaml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utility/Dictionary.xaml.vb b/Utility/Dictionary.xaml.vb new file mode 100644 index 0000000..0690f86 --- /dev/null +++ b/Utility/Dictionary.xaml.vb @@ -0,0 +1,30 @@ +Public Class Dictionary + + Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM" + +#Region "Colors" + + Private m_Omag_Red As SolidColorBrush = Brushes.Red + Public ReadOnly Property Omag_Red As SolidColorBrush + Get + Return m_Omag_Red + End Get + End Property + + Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD") + Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush + Get + Return m_Button_Static_Background + End Get + End Property + + Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background") + Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush + Get + Return m_TabControl_Header_Background + End Get + End Property + +#End Region ' Colors + +End Class diff --git a/Utility/Enums.vb b/Utility/Enums.vb new file mode 100644 index 0000000..d7a5806 --- /dev/null +++ b/Utility/Enums.vb @@ -0,0 +1,14 @@ +Public Module Enums + + Public Enum Warehouses As Integer + A = 1 + B = 2 + End Enum + + Public Enum States As Integer + NOT_AVAILABLE = 0 + AVAILABLE = 1 + FULL = 2 + End Enum + +End Module diff --git a/Utility/Map.vb b/Utility/Map.vb new file mode 100644 index 0000000..9dd361d --- /dev/null +++ b/Utility/Map.vb @@ -0,0 +1,51 @@ +Imports EgtWPFLib5 + +Module Map + + Private m_refMainWindowVM As MainWindowVM + Private m_refUnloadingAreaVM As UnloadingAreaVM + +#Region "Get" + + Public ReadOnly Property refMainWindowVM As MainWindowVM + Get + Return m_refMainWindowVM + End Get + End Property + + Public ReadOnly Property refUnloadingAreaVM As UnloadingAreaVM + Get + Return m_refUnloadingAreaVM + End Get + End Property + +#End Region ' Get + +#Region "Set" + + 'Friend Function SetRefStatusBarVM(StatusBarVM As StatusBarVM) As Boolean + ' LibMap.SetRefStatusBarVM(StatusBarVM) + ' Return Not IsNothing(LibMap.refStatusBarVM) + 'End Function + + Friend Function SetRefUnloadingAreaVM(UnloadingAreaVM As UnloadingAreaVM) As Boolean + m_refUnloadingAreaVM = UnloadingAreaVM + Return Not IsNothing(m_refUnloadingAreaVM) + End Function + +#End Region ' Set + +#Region "Init" + + Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean + m_refMainWindowVM = MainWindowVM + Return Not IsNothing(m_refMainWindowVM) + End Function + Friend Function EndInit() As Boolean + ' Verifico se tutti i pezzi necessari sono stati caricati + Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refUnloadingAreaVM) ' AndAlso LibMap.EndInit() + End Function + +#End Region ' Init + +End Module diff --git a/Warehouse/Box.vb b/Warehouse/Box.vb new file mode 100644 index 0000000..fbbc3c8 --- /dev/null +++ b/Warehouse/Box.vb @@ -0,0 +1,133 @@ +Imports EgtWPFLib5 + +Public Class Box + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_refWarehouse As WarehouseVM + + Private m_Id As Integer + + Private m_State As States + Public ReadOnly Property State As States + Get + Return m_State + End Get + End Property + Public Property State_IsChecked As Boolean + Get + Return (m_State <> States.AVAILABLE) + End Get + Set(value As Boolean) + If value Then + m_State = States.NOT_AVAILABLE + Else + m_State = States.AVAILABLE + End If + End Set + End Property + + Private m_Livello As Integer + Private m_Fila As Integer + Private m_MaxLivello As Integer = 1 + Private m_MaxFila As Integer = 1 + + Private m_Warehouse_IsActive As Boolean + Private m_IsActive As Boolean = False + Friend ReadOnly Property IsActive As Boolean + Get + Return m_IsActive + End Get + End Property + + Private m_FillPercentage As Integer = 0 + Public ReadOnly Property nFillPercentage As Integer + Get + Return m_FillPercentage + End Get + End Property + Public ReadOnly Property FillPercentage As String + Get + Return If(m_State = States.NOT_AVAILABLE, "--", m_FillPercentage & " %") + End Get + End Property + + Private m_IsPallet As Boolean + Friend ReadOnly Property IsPallet As Boolean + Get + Return m_IsPallet + End Get + End Property + + Public ReadOnly Property Percentage_Visibility As Visibility + Get + Return If(m_Warehouse_IsActive, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + Public ReadOnly Property Image_Visibility As Visibility + Get + Return If(Not m_Warehouse_IsActive, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + +#End Region ' FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New(nId As Integer, bIsPallet As Boolean, Warehouse As WarehouseVM) + m_Id = nId + m_IsPallet = bIsPallet + m_refWarehouse = Warehouse + m_State = States.AVAILABLE + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub SetState(State As States) + m_State = State + Select Case m_State + Case States.AVAILABLE, States.NOT_AVAILABLE + m_FillPercentage = 0 + Case States.FULL + m_FillPercentage = 100 + End Select + NotifyPropertyChanged("FillPercentage") + End Sub + + Friend Sub SetWarehouse_IsActive(bIsActive As Boolean) + m_Warehouse_IsActive = bIsActive + NotifyPropertyChanged("Percentage_Visibility") + NotifyPropertyChanged("Image_Visibility") + End Sub + + Friend Sub SetIsActive(IsActive As Boolean) + m_IsActive = IsActive + End Sub + + Friend Sub FillBox(Livello As Integer, Fila As Integer) + m_Livello = Livello + m_Fila = Fila + If m_MaxLivello = 0 OrElse m_MaxFila = 0 Then + m_FillPercentage = 0 + Else + m_FillPercentage = CInt(Math.Round((((m_Livello - 1) * m_MaxFila) + m_Fila) / (m_MaxLivello * m_MaxFila) * 100)) + End If + NotifyPropertyChanged("FillPercentage") + End Sub + + Friend Sub MaxFillBox(MaxLivello As Integer, MaxFila As Integer) + m_MaxLivello = MaxLivello + m_MaxFila = MaxFila + End Sub + +#End Region ' METHODS + +#Region "COMMANDS" + +#End Region ' COMMANDS + +End Class \ No newline at end of file diff --git a/Warehouse/WarehouseV.xaml b/Warehouse/WarehouseV.xaml new file mode 100644 index 0000000..37e6473 --- /dev/null +++ b/Warehouse/WarehouseV.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Warehouse/WarehouseV.xaml.vb b/Warehouse/WarehouseV.xaml.vb new file mode 100644 index 0000000..0974ea0 --- /dev/null +++ b/Warehouse/WarehouseV.xaml.vb @@ -0,0 +1,21 @@ +Public Class WarehouseV + +End Class + +Public Class BoxTemplateSelector + Inherits DataTemplateSelector + + Public Overrides Function SelectTemplate(item As Object, container As DependencyObject) As DataTemplate + Dim element As FrameworkElement = TryCast(container, FrameworkElement) + If element IsNot Nothing AndAlso item IsNot Nothing AndAlso TypeOf item Is Box Then + Dim Box As Box = TryCast(item, Box) + If Box.IsPallet Then + Return TryCast(element.FindResource("PalletTemplate"), DataTemplate) + Else + Return TryCast(element.FindResource("RackTemplate"), DataTemplate) + End If + End If + Return MyBase.SelectTemplate(item, container) + End Function + +End Class \ No newline at end of file diff --git a/Warehouse/WarehouseVM.vb b/Warehouse/WarehouseVM.vb new file mode 100644 index 0000000..7e6ac4d --- /dev/null +++ b/Warehouse/WarehouseVM.vb @@ -0,0 +1,187 @@ +Imports System.Collections.ObjectModel +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class WarehouseVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_Id As Warehouses + Public ReadOnly Property Id As Warehouses + Get + Return m_Id + End Get + End Property + + Private m_State As States + Friend ReadOnly Property State As States + Get + Return m_State + End Get + End Property + + Private m_IsPallet As Boolean + Public Property IsPallet As Boolean + Get + Return m_IsPallet + End Get + Set(value As Boolean) + If value <> m_IsPallet Then + CreateBoxList(value) + m_IsPallet = value + End If + End Set + End Property + Public Property NotIsPallet As Boolean + Get + Return Not m_IsPallet + End Get + Set(value As Boolean) + If value = m_IsPallet Then + CreateBoxList(Not value) + m_IsPallet = Not value + End If + End Set + End Property + + Private m_IsActive As Boolean = True + Friend ReadOnly Property IsActive As Boolean + Get + Return m_IsActive + End Get + End Property + + Public ReadOnly Property IsEnabled As Boolean + Get + Return Not m_IsActive + End Get + End Property + + Private m_Boxes As New ObservableCollection(Of Box) + Public Property Boxes As ObservableCollection(Of Box) + Get + Return m_Boxes + End Get + Set(value As ObservableCollection(Of Box)) + m_Boxes = value + End Set + End Property + + Private m_ActiveBox_Index As Integer + Private m_ActiveBox As Box + + Public ReadOnly Property FillPercentage As String + Get + Dim Counter As Integer = 0 + Dim Fill As Integer = 0 + For Each Box In Boxes + If Box.State <> States.NOT_AVAILABLE Then + Counter += 1 + Fill += Box.nFillPercentage + End If + Next + Return DoubleToString(Fill / Counter, 0) & "%" + End Get + End Property + + Public ReadOnly Property FillPercentage_Visibility As Visibility + Get + Return If(m_IsActive, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + +#End Region ' FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New(nWarehouse As Warehouses) + m_Id = nWarehouse + NotifyPropertyChanged("Id") + ' valore da leggere da macchina + IsPallet = True + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Private Sub CreateBoxList(bIsPallet As Boolean) + m_Boxes.Clear() + ' aggiungo i box + Dim nBox As Integer = If(bIsPallet, 6, 3) + For Index = 1 To nBox + Boxes.Add(New Box(Index, bIsPallet, Me)) + Next + End Sub + + Friend Sub SetState(State As States) + m_State = State + End Sub + + Friend Sub SetIsActive(bIsActive As Boolean) + m_IsActive = bIsActive + For Index = 0 To m_Boxes.Count - 1 + m_Boxes(Index).SetWarehouse_IsActive(bIsActive) + Next + NotifyPropertyChanged("IsEnabled") + NotifyPropertyChanged("FillPercentage_Visibility") + End Sub + + Friend Sub SetIsPallet(IsPallet As Boolean) + Me.IsPallet = IsPallet + NotifyPropertyChanged("IsPallet") + NotifyPropertyChanged("NotIsPallet") + End Sub + + Friend Sub SetBoxState(Id As Integer, State As States) + m_Boxes(ConvertBoxIndex(Id) - 1).SetState(State) + End Sub + + Friend Sub SetBoxIsActive(Id As Integer) + If Id > 0 And Id <= 6 Then + m_ActiveBox_Index = Id - 1 + m_ActiveBox = Boxes(ConvertBoxIndex(Id) - 1) + End If + For Each Box In m_Boxes + Box.SetIsActive(Box Is m_ActiveBox) + Next + End Sub + + Friend Sub FillActiveBox(Livello As Integer, Fila As Integer) + m_ActiveBox.FillBox(Livello, Fila) + NotifyPropertyChanged("FillPercentage") + End Sub + + Friend Sub MaxFillActiveBox(MaxLivello As Integer, MaxFila As Integer) + m_ActiveBox.MaxFillBox(MaxLivello, MaxFila) + End Sub + + ' funzione che converte l'indice box che arriva dalla macchina nell'indice box della grafica + ' sono disposti diversamente! + Private Function ConvertBoxIndex(MachineIndex As Integer) As Integer + If IsPallet Then + Select Case MachineIndex + Case 1 + Return 4 + Case 2 + Return 1 + Case 3 + Return 5 + Case 4 + Return 2 + Case 5 + Return 6 + Case 6 + Return 3 + Case Else + Return 4 + End Select + Else + Return MachineIndex + End If + End Function + +#End Region + +End Class \ No newline at end of file