8822da5d09
- Gestita dimensione eposizione finestra supervisor - Gestita visibilita' bottone cambio macchina da ini - Introdotto log degli eventi macchina - Disattivo bottoni macchina durante ricalcolo cn in supervisore - Agiunta lettura variabili E80000, E80001, E80002 per Num - Correzioni e migliorie a passaggio barre tra vieoptim e supervisore e vice versa - Corretto stato delle feature su ripartenza - Introduzione configurazione cartelle prod e proj da path per funzionamento in rete - Aggiunta impostazione ccartella condivisa per funzionamento in rete - Interruzione lettura statusmap durante ricaricamento progetto - Modificata finestra di blocco per gestione con salvataggio diretto se versione non di rete - Evidenziazione copie in visualizzazione struttura in visualizzatore - Aggiornamento dei risultati di verifica anche in ottimizzatore quando mandato programma cna alla macchina - Correzione a indica di modifica progetto in pagina view - Correzione aggiornamento titolo prod su salvataggio - Correzione a selezione pezzi su scena
80 lines
3.2 KiB
VB.net
80 lines
3.2 KiB
VB.net
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
Imports EgtBEAMWALL.Core
|
|
Imports EgtBEAMWALL.ViewerOptimizer
|
|
|
|
Public Module DbControllers
|
|
|
|
Friend m_SupervisorId As String = "1"
|
|
Private m_bNetwork As Boolean = False
|
|
Friend ReadOnly Property bNetwork As Boolean
|
|
Get
|
|
Return m_bNetwork
|
|
End Get
|
|
End Property
|
|
|
|
Public m_ProjController As DataLayer.Controllers.ProjController
|
|
Public m_ProdController As DataLayer.Controllers.ProdController
|
|
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
|
|
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
|
|
Public m_PartController As DataLayer.Controllers.PartController
|
|
|
|
Sub Init()
|
|
End Sub
|
|
|
|
Sub New()
|
|
|
|
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
|
|
|
|
Dim sKey = "", sUser = "", sPwd = ""
|
|
|
|
EgtGetKeyInfo(sKey)
|
|
sKey = sKey.Replace(" ", "")
|
|
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
|
|
sUser = sKey.Substring(3, 6)
|
|
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
|
|
End If
|
|
Try
|
|
Dim DbAddress As String = "127.0.0.1"
|
|
Dim DbMasterKey As Integer = 0
|
|
Dim sDbMasterKey As String = ""
|
|
Dim sSharedFolder As String = ""
|
|
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
|
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "", DbAddress)
|
|
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
|
|
If DbMasterKey > 0 Then
|
|
sDbMasterKey = DbMasterKey.ToString("000000")
|
|
End If
|
|
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
|
|
DbAddress = "127.0.0.1"
|
|
DbMasterKey = 0
|
|
Else
|
|
m_bNetwork = True
|
|
End If
|
|
End If
|
|
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
|
|
DataLayer.DbConfig.SetupLogDir(Map.refMainWindowVM.MainWindowM.sTempDir)
|
|
DataLayer.DbConfig.CheckUser(sUser, sPwd, Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
|
|
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) And bNetwork Then
|
|
' imposto cartella condivisa
|
|
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder)
|
|
Map.refMainWindowVM.MainWindowM.UpdatePathForNetwork(sSharedFolder)
|
|
Dim sSupervisorMachName As String = ""
|
|
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
|
|
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
|
|
End If
|
|
Catch ex As Exception
|
|
EgtOutLog("InitDb error: " & ex.ToString())
|
|
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
|
|
End
|
|
End Try
|
|
|
|
m_ProjController = New DataLayer.Controllers.ProjController
|
|
m_ProdController = New DataLayer.Controllers.ProdController
|
|
m_MachGroupController = New DataLayer.Controllers.MachGroupController
|
|
m_StatusMapController = New DataLayer.Controllers.StatusMapController
|
|
m_PartController = New DataLayer.Controllers.PartController
|
|
End Sub
|
|
|
|
End Module
|