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..5028241 --- /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..4c3378a --- /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..48b70a1 --- /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 = "EgtDOORProbe.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 = "EgtDOORProbeLog#.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..b4629e0 --- /dev/null +++ b/Constants/ConstIni.vb @@ -0,0 +1,50 @@ +'---------------------------------------------------------------------------- +' 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 = "EgtDOORProbe.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_COMMANDLOG As String = "CommandLog" + 'Public Const K_MESSAGESDIR As String = "MessagesDir" + 'Public Const K_MESSAGES As String = "Messages" + Public Const K_EGTCAM5PATH As String = "EgtCAM5Path" + Public Const K_CNCFILEPATH As String = "CncFilePath" + Public Const K_DATAFILEPATH As String = "DataFilePath" + Public Const K_CHECKFILENAME As String = "CheckFileName" + Public Const K_DATAFILENAME As String = "DataFileName" + Public Const K_PARTPROGRAMFILENAME As String = "PartProgramFileName" + Public Const K_PROBINGTIMEOUT As String = "ProbingTimeout" + 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_DOORS As String = "Doors" + Public Const K_DDFENABLE As String = "DdfEnable" + Public Const K_BASEDIR As String = "BaseDir" + Public Const K_DDFEXEC As String = "DdfExec" + Public Const K_DDFFUNCTION As String = "DdfFun" + Public Const K_DDFDIR As String = "DdfDir" + Public Const K_DDFDEFAULTDIR As String = "DdfDefaultDir" + Public Const K_DDFMACHEXEC As String = "DdfMachExec" + Public Const K_TABLESDIR As String = "TablesDir" + Public Const K_CURRMTABLE As String = "CurrMTable" + Public Const K_MTABLEWINPLACE As String = "MTableWinPlace" + +End Module diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb new file mode 100644 index 0000000..1f8d2d1 --- /dev/null +++ b/Constants/ConstMsg.vb @@ -0,0 +1,52 @@ +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_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/EgtDOORProbe.sln b/EgtDOORProbe.sln new file mode 100644 index 0000000..3c1834e --- /dev/null +++ b/EgtDOORProbe.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}") = "EgtDOORProbe", "EgtDOORProbe.vbproj", "{F1514999-464B-4EB2-A5BA-EF50F31286A0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F1514999-464B-4EB2-A5BA-EF50F31286A0}.Debug|x86.ActiveCfg = Debug|x86 + {F1514999-464B-4EB2-A5BA-EF50F31286A0}.Debug|x86.Build.0 = Debug|x86 + {F1514999-464B-4EB2-A5BA-EF50F31286A0}.Release|x86.ActiveCfg = Release|x86 + {F1514999-464B-4EB2-A5BA-EF50F31286A0}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/EgtDOORProbe.vbproj b/EgtDOORProbe.vbproj new file mode 100644 index 0000000..7db1428 --- /dev/null +++ b/EgtDOORProbe.vbproj @@ -0,0 +1,216 @@ + + + + + Debug + AnyCPU + {F1514999-464B-4EB2-A5BA-EF50F31286A0} + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + WinExe + EgtDOORProbe + EgtDOORProbe + 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 + + + true + true + true + bin\x86\Debug\ + EgtDOORProbe.xml + + + full + x86 + MinimumRecommendedRules.ruleset + true + + + true + bin\x86\Release\ + EgtDOORProbe.xml + true + + + pdbonly + x86 + MinimumRecommendedRules.ruleset + true + + + Resources\EgtDOORProbe.ico + + + + False + ..\..\EgtProg\DllD32\EgtUILib.dll + + + ..\..\EgtProg\DllD32\EgtWPFLib5.dll + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + ProbingPanelV.xaml + + + + StatusBarV.xaml + + + + MSBuild:Compile + Designer + + + Application.xaml + Code + + + + + + MainWindowV.xaml + Code + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + 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\EgtDOORProbe\EgtDOORProbeR32.exe +IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtDOORProbe\EgtDOORProbeD32.exe + + + \ No newline at end of file diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb new file mode 100644 index 0000000..5d12155 --- /dev/null +++ b/MainWindow/MainWindowM.vb @@ -0,0 +1,205 @@ +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_sMachinesRoot As String + 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() + ' Verifico sia l'unica istanza + ManageSingleIstance() + ' 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 + ' 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.OFFICE_BASE) + '' 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 + '' 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 ManageSingleIstance() + Dim bCreated As Boolean + Try + m_objMutex = New Mutex(False, "Global\EgtDOORProbe", bCreated) + Catch + bCreated = False + End Try + If Not bCreated 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("EgtDOORProbeR32") + 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("EgtDOORProbeR64") + 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 + 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() + End Sub + +#End Region ' METHODS + +End Class diff --git a/MainWindow/MainWindowV.xaml b/MainWindow/MainWindowV.xaml new file mode 100644 index 0000000..6a47eec --- /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..ebde47b --- /dev/null +++ b/MainWindow/MainWindowVM.vb @@ -0,0 +1,82 @@ +Imports EgtWPFLib5 + +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 + + ' 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 + +#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 + ' imposto titolo finestra + m_Title = "EgtDOORProbe" + NotifyPropertyChanged("Title") + 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 + ' Se istanza oltre la prima, chiedo cosa aprire + If Not m_MainWindowM.bFirstInstance Then + ' OmagOFFICEMap.refTopCommandBarVM.Open() + ' ' altrimenti verifico se richiesto ultimo progetto + 'ElseIf GetMainPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0) = 1 Then + ' Dim sLastProjectPath As String = String.Empty + ' GetMainPrivateProfileString(S_GENERAL, K_LASTPROJ, String.Empty, sLastProjectPath) + ' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then + ' OmagOFFICEMap.refTopCommandBarVM.OpenProject(sLastProjectPath) + ' Else + ' OmagOFFICEMap.refTopCommandBarVM.NewCmd() + ' End If + ' altrimenti nuovo progetto + End If + End Sub + +#End Region ' METHODS + +End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..31f6b2b --- /dev/null +++ b/My Project/AssemblyInfo.vb @@ -0,0 +1,64 @@ +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 DEBUG Then + + +#Else + + +#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..84df411 --- /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("EgtDOORProbe.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..38a3b20 --- /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.EgtDOORProbe.MySettings + Get + Return Global.EgtDOORProbe.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/ProbingPanel/ProbingPanelV.xaml b/ProbingPanel/ProbingPanelV.xaml new file mode 100644 index 0000000..e21f9b9 --- /dev/null +++ b/ProbingPanel/ProbingPanelV.xaml @@ -0,0 +1,63 @@ + + +