Modifiche comunicazione tra Opt e Sup

Correzioni e migliorie
This commit is contained in:
Emmanuele Sassi
2021-08-02 15:32:39 +02:00
parent bf7300310b
commit d611f66d43
68 changed files with 4897 additions and 402 deletions
+119
View File
@@ -0,0 +1,119 @@
'----------------------------------------------------------------------------
' 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 = "EgtBEAMWALL.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_MAXCAMINST As String = "MaxCamInstances"
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_LASTPROJ As String = "LastProj"
Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
Public Const K_LASTIMPDIR As String = "LastImpDir"
Public Const K_PROJSINDEX As String = "ProjsIndex"
Public Const K_PRODSINDEX As String = "ProdsIndex"
Public Const K_SUPPORT As String = "Support"
Public Const K_WAREHOUSE As String = "Warehouse"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
Public Const S_LUA As String = "Lua"
Public Const K_LIBSDIR As String = "LibsDir"
Public Const K_BASELIB As String = "BaseLib"
Public Const S_GEOMDB As String = "GeomDB"
Public Const K_DEFAULTFONT As String = "DefaultFont"
Public Const K_NFEFONTDIR As String = "NfeFontDir"
Public Const K_DEFAULTCOLOR As String = "DefaultColor"
Public Const K_SAVETYPE As String = "SaveType"
Public Const S_OPENGL As String = "OpenGL"
Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
Public Const K_COLORBITS As String = "ColorBits"
Public Const K_DEPTHBITS As String = "DepthBits"
Public Const K_DRIVER As String = "Driver"
Public Const S_SCENE As String = "Scene"
Public Const K_BACKTOP As String = "BackTop"
Public Const K_BACKBOTTOM As String = "BackBottom"
Public Const K_SHOWGFRAME As String = "ShowGFrame"
Public Const K_MARK As String = "Mark"
Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_SHOWBUILDING As String = "ShowBuilding"
Public Const K_CURVEDIR As String = "CurveDir"
Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
Public Const K_SHOWZMAP As String = "ShowZmap"
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine"
Public Const K_MMUNITS As String = "MmUnits"
Public Const S_GRID As String = "Grid"
Public Const K_SHOWGRID As String = "ShowGrid"
Public Const K_SHOWFRAME As String = "ShowFrame"
Public Const K_SNAPSTEP As String = "SnapStep"
Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
Public Const K_MINLINESSTEP As String = "MinLineSStep"
Public Const K_MAJLINESSTEP As String = "MajLineSStep"
Public Const K_EXTSSTEP As String = "ExtSStep"
Public Const K_MINLNCOLOR As String = "MinLnColor"
Public Const K_MAJLNCOLOR As String = "MajLnColor"
Public Const S_IMPORT As String = "Import"
Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
Public Const K_CURRMACH As String = "CurrMach"
Public Const K_PASSWORD As String = "Password"
Public Const S_SIMUL As String = "Simul"
Public Const K_SLIDERX As String = "SliderX"
Public Const K_SLIDERVAL As String = "SliderVal"
Public Const S_BEAM As String = "Beam"
Public Const K_CALCPATH As String = "CalcPath"
Public Const K_BEAMBASEDIR As String = "BaseDir"
Public Const K_BEAMBWEEXEC As String = "BweExec"
Public Const S_WALL As String = "Wall"
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec"
Public Const S_NEST As String = "Nest"
Public Const K_NESTEXEC As String = "NestExec"
Public Const K_SECTIONTIME As String = "SectionTime"
Public Const K_PARTTIME As String = "PartTime"
Public Const S_BEAMWALL As String = "BeamWall"
Public Const K_BEAMWALLENABLE As String = "BtlEnable"
Public Const K_BEAMWALLBASEDIR As String = "BaseDir"
Public Const K_BEAMWALLBUTTON As String = "Button"
Public Const S_MRUPROJFILES As String = "MruProjFiles"
Public Const S_MRUPRODFILES As String = "MruProdFiles"
End Module
+6
View File
@@ -82,11 +82,16 @@
<Compile Include="BTL ViewModel\BTLFeatureVM.vb" />
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstIni.vb" />
<Compile Include="Constants\ConstMachComm.vb" />
<Compile Include="EgtDataGrid\EgtDataGrid.xaml.vb">
<DependentUpon>EgtDataGrid.xaml</DependentUpon>
</Compile>
<Compile Include="EgtDataGrid\DataGridColumnsIniFile.vb" />
<Compile Include="Integration\CalcProcessEndEventArgs.vb" />
<Compile Include="Integration\CalcResultEventArgs.vb" />
<Compile Include="Integration\CalcEndEventArgs.vb" />
<Compile Include="Integration\CalcIntegration.vb" />
<Compile Include="MachGroup Model\BeamMachGroupM.vb" />
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
@@ -145,6 +150,7 @@
<Compile Include="Utility\BTLIniFile.vb" />
<Compile Include="Utility\Command.vb" />
<Compile Include="Utility\CoreMap.vb" />
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\VMBase.vb" />
<Compile Include="WallM.vb" />
<Compile Include="WallMachGroupM.vb" />
@@ -0,0 +1,24 @@
Public Class CalcEndEventArgs
Inherits EventArgs
Public Enum Results As Integer
NULL = 0
OK = 1
ERROR_ = 2
End Enum
Public m_End As Results
Public Property End_ As Results
Get
Return m_End
End Get
Private Set(value As Results)
m_End = value
End Set
End Property
Sub New(Result As Results)
m_End = Result
End Sub
End Class
@@ -0,0 +1,458 @@
Imports System.IO
Imports System.Threading
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtBEAMWALL.Core
Public Module CalcIntegration
Private _thread As System.Threading.Thread
Public Event Calc_Ended As EventHandler(Of CalcEndEventArgs)
Public Event Calc_ProcessResult As EventHandler(Of CalcResultEventArgs)
Public Event Calc_ProcessEnd As EventHandler(Of CalcProcessEndEventArgs)
Public Enum CmdType As Integer
GENERATE = 0
MODIFY = 1
SIMULATE = 2
CHECK = 3
CHECKGEN = 4
POINT_CLOUD = 5
RAWPART = 6
End Enum
Private Structure MyProc
Public bEnable As Boolean
Public Proc As Process
Public nBar As Integer
End Structure
Private m_MaxCamInstances As Integer = 1
Public Sub SetMaxCamInstances(value As Integer)
m_MaxCamInstances = value
End Sub
Delegate Sub CallbackDlg(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
Public Sub Run(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg)
_thread = New Thread(Sub()
DoJob(vBar, sProjDirPath, callback)
End Sub)
_thread.Start()
End Sub
Private Sub DoJob(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg)
Dim bCancel As Boolean = False
callback(0, "Init", bCancel)
' creo progetti a seconda del tipo
For Each Bar In vBar
If Bar.nProgramPage = ProjectType.PROJ Then
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
ElseIf Bar.nProgramPage = ProjectType.PROD Then
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
End If
Next
Dim bIsSimulation As Boolean = False
' se sono in simulazione
If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdType.SIMULATE Then
bIsSimulation = True
callback(0, "Simulation opened", bCancel)
Else
callback(0.1, "", bCancel)
End If
Dim ExePath As String = String.Empty
GetMainPrivateProfileString(S_BEAM, K_CALCPATH, "", ExePath)
' Numero di barre
Dim numBars As Integer = vBar.Count
If numBars = 0 Then Return
' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
' Frazione di avanzamento del lavoro (in piu)
Dim dProgress As Double = 0
'indice incremento progress durante calcolo barra
Dim nPgsCurrBar As Integer = 0
Dim nPgsClock As Integer = 0
' Lancio in parallelo più processi (senza superare il numero di core logici presenti)
Dim vProc As MyProc() = New MyProc(nMaxThread - 1) {}
For j As Integer = 0 To nMaxThread - 1
vProc(j).nBar = -1
vProc(j).bEnable = True
Next
' Processo i Btl in parallelo
Dim nCurrBar As Integer = 0
Dim nDoneBar As Integer = 0
Dim nShiftBar As Integer = 0
Dim nActProc As Integer = 0
Dim bAllKO As Boolean
While nCurrBar < numBars + nShiftBar OrElse nActProc > 0
For j As Integer = 0 To nMaxThread - 1
If Not vProc(j).bEnable Then Continue For
Dim bDone As Boolean = False
If vProc(j).nBar = -1 Then
If nCurrBar < numBars + nShiftBar Then
If vBar(nCurrBar).bBarOk Then
vProc(j).Proc = New Process()
vProc(j).Proc.StartInfo.FileName = ExePath
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """ " &
"""" & vBar(nCurrBar).nProjType & """ " &
"""" & vBar(nCurrBar).nMachineName & """ " & vBar(nCurrBar).nCmdType
vProc(j).Proc.StartInfo.UseShellExecute = False
If vProc(j).Proc.Start() Then
vProc(j).nBar = nCurrBar
nCurrBar += 1
nActProc += 1
End If
Else
If vBar(nCurrBar).nCmdType = CmdType.CHECK OrElse vBar(nCurrBar).nCmdType = CmdType.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
ElseIf vBar(nCurrBar).nCmdType = CmdType.GENERATE Then
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
nCurrBar += 1
End If
End If
Else
If vProc(j).Proc.HasExited Then
' se terminato con successo
If vProc(j).Proc.ExitCode = 0 Then
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdType.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdType.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdType.GENERATE Then
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
nActProc -= 1
' se superato il numero di processi eseguibili in parallelo
ElseIf vProc(j).Proc.ExitCode = 1 Then
' aggiungo il pezzo in coda
If numBars + nShiftBar < numBars + nMaxThread Then
vBar(numBars + nShiftBar) = vBar(vProc(j).nBar)
nShiftBar += 1
End If
' disabilito il processo
vProc(j).bEnable = False
vProc(j).nBar = -1
nActProc -= 1
' altrimenti (errore generico di esecuzione)
Else
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdType.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdType.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdType.GENERATE Then
RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
nActProc -= 1
End If
Else
vProc(j).Proc.Refresh()
End If
End If
If bDone Then
' se non sono in simulazione
If bIsSimulation Then
callback(0, "Simulation closing", bCancel)
Else
' Dialog con Progress Bar
nDoneBar += 1
dProgress = 1 / numBars * nDoneBar
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
End If
If bCancel Then
' fine
callback(1, "", bCancel)
' riabilito interfaccia
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CalcEndEventArgs.Results.OK))
Return
End If
nPgsCurrBar = 0
nPgsClock = 0
Else
' se non sono in simulazione
If Not bIsSimulation Then
' aggiorno conteggio
If nPgsClock >= 100 AndAlso nPgsCurrBar < 149 Then
nPgsCurrBar += 1
dProgress = 1 / numBars * nDoneBar + 1 / numBars / 150 * nPgsCurrBar
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
nPgsClock = 0
End If
End If
End If
nPgsClock += 1
Thread.Sleep(1)
Next
' Verifico che i processi non siano andati tutti in errore
bAllKO = True
For j As Integer = 0 To nMaxThread - 1
If vProc(j).bEnable Then bAllKO = False
Next
If bAllKO Then
Exit While
End If
Thread.Sleep(10)
End While
Thread.Sleep(300)
' se sono in simulazione
If bIsSimulation Then
callback(1, "Simulation closed", bCancel)
Else
callback(1, "Done", bCancel)
End If
' riabilito interfaccia
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(If(bAllKO, CalcEndEventArgs.Results.ERROR_, CalcEndEventArgs.Results.OK)))
End Sub
Private Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
' Aggiorno identificativi per segnalazione errori
UpdateCutIdAndTaskId(nPartId)
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' Recupero visibilita' pezzo e lo imposto a visibile
Dim nOldPartMode As Integer
EgtGetMode(nPartId, nOldPartMode)
EgtSetMode(nPartId, GDB_MD.STD)
' Salvo pezzo nel suo progetto
Dim bOk As Boolean = False
Dim nPDN As Integer = 0
EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
Dim sPartFilePath As String = sProjDirPath & "\" & nPDN.ToString() & ".bwe"
bOk = EgtSaveObjToFile(nPartId, sPartFilePath, NGE.CMPTEXT)
' Ripristino visibilita' pezzo
EgtSetMode(nPartId, nOldPartMode)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
Return If(bOk, sPartFilePath, String.Empty)
End Function
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String) As String
' Aggiorno identificativi per segnalazione errori
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, 1) Then
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
While nPartId <> GDB_ID.NULL
UpdateCutIdAndTaskId(nPartId)
nPartId = EgtGetNextPartInRawPart(nPartId)
End While
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If nMachGroupId <> nOldMachGroup Then
If nOldMachGroup <> GDB_ID.NULL Then
EgtSetCurrMachGroup(nOldMachGroup)
Else
EgtResetCurrMachGroup()
End If
End If
' Salvo gruppo di lavorazione nel suo progetto
Dim sMachGroupName As String = ""
EgtGetMachGroupName(nMachGroupId, sMachGroupName)
Dim sMachGroupFilePath As String = sProjDirPath & "\" & sMachGroupName & ".bwe"
If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then
Return sMachGroupFilePath
End If
Return String.Empty
End Function
Private Function UpdateCutIdAndTaskId(nPartId As Integer) As Boolean
' Assegno Id a CutId per calcoli
EgtSetInfo(nPartId, "CUTID", nPartId, True)
' Assegno TASKID agli outline per calcoli
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
' verifico se ha un principale
Dim nMainOffsId As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_MAINID, nMainOffsId) Then
' assegno TASKID alla feature per calcoli
EgtSetInfo(nOutlineId, "TASKID", nOutlineId + nMainOffsId, True)
Else
' assegno TASKID alla feature per calcoli
EgtSetInfo(nOutlineId, "TASKID", nOutlineId, True)
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Assegno TASKID alle feature per calcoli
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
' verifico se ha un principale
Dim nMainOffsId As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_MAINID, nMainOffsId) Then
' assegno TASKID alla feature per calcoli
EgtSetInfo(nFeatureId, "TASKID", nFeatureId + nMainOffsId, True)
Else
' assegno TASKID alla feature per calcoli
EgtSetInfo(nFeatureId, "TASKID", nFeatureId, True)
End If
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
Return True
End Function
End Module
Public Class Bar
'Public piInfo As PatternInfo
Public nBarState As Integer
Public nBarId As Integer
Public sBarPath As String
Public bBarOk As Boolean
Public nCmdType As Integer
Public nProgramPage As ProjectType
Public nProjType As BWType
Public nMachineName As String
End Class
Public Class ProcessResult
Public Enum ProcessResultTypes As Integer
BAR = 1
PART = 2
TASKID = 3
FALL = 4
TIME = 5
End Enum
Private m_Type As ProcessResultTypes
Public ReadOnly Property Type As ProcessResultTypes
Get
Return m_Type
End Get
End Property
Private m_nCUTID As Integer
Public ReadOnly Property nCUTID As Integer
Get
Return m_nCUTID
End Get
End Property
Private m_nTASKID As Integer
Public ReadOnly Property nTASKID As Integer
Get
Return m_nTASKID
End Get
End Property
Private m_nERR As Integer
Public ReadOnly Property nERR As Integer
Get
Return m_nERR
End Get
End Property
Private m_sMSG As String
Public ReadOnly Property sMSG As String
Get
Return m_sMSG
End Get
End Property
Private m_dROT As Double
Public ReadOnly Property dROT As Double
Get
Return m_dROT
End Get
End Property
Public Sub SetROT(value As Double)
m_dROT = value
End Sub
Private m_nFALL As Integer
Public ReadOnly Property nFALL As Integer
Get
Return m_nFALL
End Get
End Property
Private m_nTIME As Integer
Public ReadOnly Property nTIME As Integer
Get
Return m_nTIME
End Get
End Property
Public Shared Function CreateTaskResult(CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double) As ProcessResult
If CUTID <> 0 Then
If TASKID = 0 Then
Return New ProcessResult(ProcessResultTypes.PART, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End If
Return New ProcessResult(ProcessResultTypes.TASKID, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End If
Return New ProcessResult(ProcessResultTypes.BAR, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End Function
Public Shared Function CreateFallResult(CUTID As Integer, ERR As Integer, MSG As String, FALL As Integer) As ProcessResult
Return New ProcessResult(ProcessResultTypes.FALL, CUTID, 0, ERR, MSG, 0, FALL, 0)
End Function
Public Shared Function CreateTimeResult(CUTID As Integer, TIME As Integer) As ProcessResult
Return New ProcessResult(ProcessResultTypes.TIME, CUTID, 0, 0, "", 0, 0, TIME)
End Function
Protected Sub New(Type As ProcessResultTypes, CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double, FALL As Integer, TIME As Integer)
m_Type = Type
m_nCUTID = CUTID
m_nTASKID = TASKID
m_nERR = ERR
m_sMSG = MSG
m_dROT = ROT
m_nFALL = FALL
m_nTIME = TIME
End Sub
End Class
@@ -0,0 +1,18 @@
Public Class CalcProcessEndEventArgs
Inherits EventArgs
Public m_Result As Bar
Public Property Result As Bar
Get
Return m_Result
End Get
Private Set(value As Bar)
m_Result = value
End Set
End Property
Sub New(Result As Bar)
m_Result = Result
End Sub
End Class
@@ -0,0 +1,24 @@
Public Class CalcResultEventArgs
Inherits EventArgs
Public Enum Results As Integer
NULL = 0
OK = 1
ERROR_ = 2
End Enum
Public m_Result As Bar
Public Property Result As Bar
Get
Return m_Result
End Get
Private Set(value As Bar)
m_Result = value
End Set
End Property
Sub New(Result As Bar)
m_Result = Result
End Sub
End Class
@@ -306,7 +306,11 @@ Public MustInherit Class MyMachGroupVM
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
Return Brushes.Green
ElseIf m_bToBeProduced Then ' barra in attesa
Return Brushes.Yellow
If m_bCNReCalculated Then
Return Brushes.Yellow
Else
Return Brushes.Purple
End If
Else ' barra in coda
Return Brushes.White
End If
@@ -369,7 +373,19 @@ Public MustInherit Class MyMachGroupVM
End Select
End Get
End Property
#End Region
Public ReadOnly Property Produce_IsEnabled As Boolean
Get
Select Case nProduction_State
Case ItemState.Assigned, ItemState.Confirmed
Return True
Case Else
Return False
End Select
End Get
End Property
#End Region ' Supervisor
' definizione comandi
Private m_cmdDeleteMachGroup As ICommand
@@ -398,6 +414,9 @@ Public MustInherit Class MyMachGroupVM
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
Public Overridable Sub CALCEnd()
End Sub
#End Region ' METHODS
Public MustOverride Sub RefreshPartList()
@@ -443,7 +462,7 @@ Public MustInherit Class MyMachGroupVM
End Sub
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcGlobalUpdate()
Public Overridable Sub CalcGlobalUpdate()
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
MyMachGroupM.nCALC_GlobalState = nCALC_State
For Each Part In MyMachGroupM.PartMList
@@ -0,0 +1,16 @@
Imports EgtUILib
Public Class DisableModifiedMgr
Private m_bOldEnMod As Boolean
Sub New()
m_bOldEnMod = EgtGetEnableModified()
If m_bOldEnMod Then EgtDisableModified()
End Sub
Public Sub ReEnable()
If m_bOldEnMod Then EgtEnableModified()
End Sub
End Class
@@ -48,6 +48,29 @@ Public Class BTLFeatureVM
#Region "METHODS"
' funzione che aggiorna lo stato e gli errori dopo calcolo
Friend Sub CalcFeatureUpdate(ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
m_BTLFeatureM.nCALC_ERR = ERR
m_BTLFeatureM.nCALC_ROT = ROT
m_BTLFeatureM.sCALC_MSG = MSG
If ERR = 0 Then
m_BTLFeatureM.nState = CalcStates.OK
ElseIf ERR = 17 Then
m_BTLFeatureM.nState = CalcStates.WARNING
ElseIf ERR > 0 Then
m_BTLFeatureM.nState = CalcStates.ERROR_
ElseIf ERR < 0 Then
m_BTLFeatureM.nState = Core.CalcStates.INFO
End If
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -0,0 +1,468 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class CALCPanelVM
Inherits VMBase
Private m_CALCPanel_IsEnabled As Boolean = True
Public Property CALCPanel_IsEnabled As Boolean
Get
Return m_CALCPanel_IsEnabled
End Get
Set(value As Boolean)
m_CALCPanel_IsEnabled = value
End Set
End Property
' Definizione comandi
Private m_cmdVerify As ICommand
Private m_cmdVerifyAll As ICommand
Private m_cmdSimulate As ICommand
#Region "Messages"
Public ReadOnly Property Verify_ToolTip As String
Get
Return EgtMsg(61901)
End Get
End Property
Public ReadOnly Property Simulate_ToolTip As String
Get
Return EgtMsg(61902)
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTORS"
Sub New()
' imposto riferimento in Map
Map.SetRefCALCPanelVM(Me)
Core.CalcIntegration.SetMaxCamInstances(1)
AddHandler Core.CalcIntegration.Calc_ProcessResult, AddressOf Calc_ProcessResult
AddHandler Core.CalcIntegration.Calc_Ended, AddressOf Calc_Ended
AddHandler Core.CalcIntegration.Calc_ProcessEnd, AddressOf Calc_ProcessEnded
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Sub SetCalcPanelIsEnabled(bIsEnabled As Boolean)
m_CALCPanel_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
End Sub
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
ProcessResults(e.m_Result)
End Sub
Private Sub Calc_Ended(sender As Object, e As CalcEndEventArgs)
If e.End_ <> CalcEndEventArgs.Results.OK Then
MessageBox.Show("Execution error (all processes are disabled)")
End If
Map.refProjectVM.ManageIsEnabled(True)
Map.refMyStatusBarVM.ResetStopProgress()
End Sub
Private Sub Calc_ProcessEnded(sender As Object, e As CalcProcessEndEventArgs)
Dim nRawid As Integer = e.m_Result.nBarId
If nRawid <= 0 Then Return
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nRawid)
Machgroup.CALCEnd()
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
Dim BtlPath As String = Bar.sBarPath
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
Dim bErrors As Boolean = False
Dim nLastErr As Integer = 0
Dim sLastMsg As String = ""
Dim nCurrCutId As Integer = 0
Dim nTotTime As Integer = 0
If File.Exists(ResPath) Then
Dim ProcessResultList As New List(Of ProcessResult)
Dim nErr As Integer = 0
Dim sMsg As String = ""
Dim dRot As Double = 0
Dim nFall As Integer = 0
Dim dPartRot As Double = 0
Dim dTotRot As Double = 0
Dim cutId As Integer = 0
Dim taskId As Integer = 0
Dim prevCutId As Integer = GDB_ID.NULL
Dim currPart As PartVM
Dim lines As String() = System.IO.File.ReadAllLines(ResPath)
For Each line As String In lines
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
cutId = 0
taskId = 0
ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
'End If
ElseIf Not String.IsNullOrWhiteSpace(line) AndAlso line <> "---" Then
sMsg = line
End If
Next
If ProcessResultList.Count > 0 Then
' Inizializzo i pezzi del gruppo di lavoro in verifica
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcPartUpdate(0, 0, "")
Next
Machgroup.CalcMachGroupUpdate(0, 0, "")
' Ciclo ...
Dim nCUTID As Integer = -1
Dim CurrPartVM As PartVM
Dim CurrMachgroupVM As MyMachGroupVM
Dim CurrBTLFeatureVM As BTLFeatureVM
For Each Line In ProcessResultList
' se necessario recupero part
If Line.nCUTID <> 0 Then
If Line.nCUTID <> nCUTID Then
nCUTID = Line.nCUTID
' aggiorno nuovo pezzo
CurrPartVM = GetPartVMFromPartId(Line.nCUTID)
End If
Else
' se CutId = 0
' riporto errore barra
CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
End If
' se necessario recupero feature
If Line.nTASKID <> 0 Then
CurrBTLFeatureVM = GetFeatureVMFromPartId(CurrPartVM, Line.nTASKID)
Else
CurrBTLFeatureVM = Nothing
End If
Select Case Line.Type
Case ProcessResult.ProcessResultTypes.BAR
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.PART
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
CurrPartVM.CalcFallUpdate(Line.nFALL)
Case ProcessResult.ProcessResultTypes.TIME
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End Select
Next
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
End If
Else
bErrors = True
nLastErr = 25
sLastMsg = "Execution Error"
End If
End Sub
Private Shared Function GetVal(sText As String, sKey As String) As Integer?
Dim sParts As String() = sText.Split("="c)
If String.Compare(sParts(0), sKey) <> 0 Then Return Nothing
Dim nVal As Integer = Nothing
If Not Integer.TryParse(sParts(1), nVal) Then
Return Nothing
Else
Return nVal
End If
End Function
Private Shared Sub ProcessResultAdd(PRList As List(Of ProcessResult), NewPR As ProcessResult, Bar As Bar)
Dim Prev As ProcessResult
Select Case NewPR.Type
Case ProcessResult.ProcessResultTypes.BAR
If Bar.nProgramPage = ProjectType.PROJ Then
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART)
Else
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.BAR)
End If
Case ProcessResult.ProcessResultTypes.PART
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART AndAlso x.nCUTID = NewPR.nCUTID)
Case ProcessResult.ProcessResultTypes.TASKID
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.TASKID AndAlso x.nCUTID = NewPR.nCUTID AndAlso x.nTASKID = NewPR.nTASKID)
End Select
If IsNothing(Prev) Then
PRList.Add(NewPR)
ElseIf NewPR.nERR = 22 Or (NewPR.nERR > 0 And Prev.nERR <= 0) Or (NewPR.nERR < 0 And Prev.nERR = 0) Then
If NewPR.dROT = 0 And Prev.dROT <> NewPR.dROT Then
NewPR.SetROT(Prev.dROT)
End If
PRList.Remove(Prev)
PRList.Add(NewPR)
ElseIf Prev.dROT = 0 And Prev.dROT <> NewPR.dROT Then
Prev.SetROT(NewPR.dROT)
End If
End Sub
Private Shared Function GetPartVMFromPartId(nPartId As Integer) As PartVM
For Each MachGroupVM As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
Dim PartVM As PartVM = MachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
If Not IsNothing(PartVM) Then Return PartVM
Next
End Function
Private Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
Return Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
End Function
Private Shared Function GetFeatureVMFromPartId(PartVM As PartVM, nFeatureId As Integer) As Core.BTLFeatureVM
Return PartVM.FeatureVMList.FirstOrDefault(Function(x) x.nFeatureId = nFeatureId)
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "Verify"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Verify_Command As ICommand
Get
If m_cmdVerify Is Nothing Then
m_cmdVerify = New Command(AddressOf Verify)
End If
Return m_cmdVerify
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Verify()
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
Dim ProjType As BWType = Map.refSupervisorManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar
If Not IsNothing(Map.refSupervisorMachGroupPanelVM.SelectedMachGroup) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(Map.refSupervisorMachGroupPanelVM.SelectedMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refSupervisorMachGroupPanelVM.SelectedMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Dim SelMachGroup As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.SelectedMachGroup
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
Friend Sub VerifyMachGroup(MachGroup As MyMachGroupVM)
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
Dim ProjType As BWType = Map.refSupervisorManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar
If Not IsNothing(MachGroup) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(MachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = MachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Select Case MachGroup.nGlobalState
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & MachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
#End Region ' Verify
#Region "VerifyAll"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property VerifyAll_Command As ICommand
Get
If m_cmdVerifyAll Is Nothing Then
m_cmdVerifyAll = New Command(AddressOf VerifyAll)
End If
Return m_cmdVerifyAll
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
Dim ProjType As BWType = Map.refSupervisorManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar
Dim TempBarList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1) As EgtBEAMWALL.Core.Bar
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(PartIndex) = Bar
Next
BarList = TempBarList
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
#End Region ' VerifyAll
#Region "Simulate"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Simulate()
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
Dim ProjType As BWType = Map.refSupervisorManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar
Dim SelMachGroup As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.SelectedMachGroup
If Not IsNothing(SelMachGroup) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
#End Region ' Simulate
#End Region ' COMMANDS
End Class
@@ -0,0 +1,36 @@
<EgtFloating:EgtFloatingPanel x:Class="CalcPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<!--<Button Content="V"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}">
--><!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>--><!--
</Button>
<Button Content="Vall"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}">
--><!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>--><!--
</Button>-->
<Button Content="S"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Simulate_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
</EgtFloating:EgtFloatingPanel>
@@ -0,0 +1,3 @@
Public Class CalcPanelV
End Class
@@ -0,0 +1,273 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!--<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/>
</UniformGrid>
</StackPanel>
</GroupBox>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="70"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="70"/>
<TextBlock Text="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="70"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Colonne tabelle">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:DGColumnsListV DataContext="{Binding}"
ItemsSource="{Binding DGColumnsList}"
SelectedItem="{Binding SelDGColumn}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:DGColumnsListV>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>-->
<!--</Button>-->
</Grid>
</DockPanel>
@@ -0,0 +1,5 @@
Public Class ConfigurationPageV
Private Sub ScrollViewer_Scroll(sender As Object, e As Primitives.ScrollEventArgs)
End Sub
End Class
@@ -0,0 +1,976 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class ConfigurationPageVM
Inherits VMBase
' ' flag modifica parametri Macchina
' Friend bModifyMachParam As Boolean
' ' Definizione comandi
' Private m_cmdSave As ICommand
' Public ReadOnly Property MachinePanelVM As MachinePanelVM
' Get
' Return Map.refMachinePanelVM
' End Get
' End Property
' Private m_ConfigMachTableList As New ObservableCollection(Of MachTable)
' Public Property ConfigMachTableList As ObservableCollection(Of MachTable)
' Get
' Return m_ConfigMachTableList
' End Get
' Set(value As ObservableCollection(Of MachTable))
' m_ConfigMachTableList = value
' End Set
' End Property
' Public ReadOnly Property Custom_Visibility As Visibility
' Get
' If QBTLParamVMList(0).bIsP Then
' Return Visibility.Collapsed
' Else
' Return Visibility.Visible
' End If
' End Get
' End Property
' ' lista dei parametri Q di un Process
' Private m_QBTLParamVMList_View As CollectionView = Nothing
' Protected m_QBTLParamVMList As New ObservableCollection(Of QBTLParamVM)
' Public Property QBTLParamVMList As ObservableCollection(Of QBTLParamVM)
' Get
' Return m_QBTLParamVMList
' End Get
' Set(value As ObservableCollection(Of QBTLParamVM))
' m_QBTLParamVMList = value
' End Set
' End Property
' Private m_PRCList As New ObservableCollection(Of PRC)
' Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
' Get
' Return m_PRCList
' End Get
' End Property
' Private m_LanguageList As New ObservableCollection(Of Language)
' Public ReadOnly Property LanguageList As ObservableCollection(Of Language)
' Get
' Return m_LanguageList
' End Get
' End Property
' Private m_UnitMeasureList As List(Of String) = New List(Of String)({"inch", "mm"})
' Public ReadOnly Property UnitMeasureList As List(Of String)
' Get
' Return m_UnitMeasureList
' End Get
' End Property
' Private m_SelectedLanguage As Language
' Public Property SelectedLanguage As Language
' Get
' Return m_SelectedLanguage
' End Get
' Set(value As Language)
' If value IsNot m_SelectedLanguage Then
' m_SelectedLanguage = value
' End If
' End Set
' End Property
' Public Property SelMeasureUnit As Integer
' Get
' Return If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH)
' End Get
' Set(value As Integer)
' ' salvo unità di misura precedente
' Dim PrevMeasureUnit As MeasureUnitOpt = If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH)
' If value <> PrevMeasureUnit Then
' ' cambio unità di misura
' EgtSetUiUnits(DirectCast(value, MeasureUnitOpt) = MeasureUnitOpt.MM)
' End If
' End Set
' End Property
' Private m_SectionTime As Double
' Public Property SectionTime As String
' Get
' Return DoubleToString(m_SectionTime, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToDouble(value, dVal) AndAlso dVal > 0 Then
' m_SectionTime = dVal
' End If
' End Set
' End Property
' Private m_PartTime As Double
' Public Property PartTime As String
' Get
' Return DoubleToString(m_PartTime, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToDouble(value, dVal) AndAlso dVal > 0 Then
' m_PartTime = dVal
' End If
' End Set
' End Property
' ' lista delle colonne con le relative proprietà della DataGrid
' Private m_DGColumnsList_View As CollectionView = Nothing
' Protected m_DGColumnsList As New ObservableCollection(Of IniDataGridColumn)
' Public Property DGColumnsList As ObservableCollection(Of IniDataGridColumn)
' Get
' Return m_DGColumnsList
' End Get
' Set(value As ObservableCollection(Of IniDataGridColumn))
' m_DGColumnsList = value
' End Set
' End Property
'#Region "Messages"
' Public ReadOnly Property L_Msg As String
' Get
' Return EgtMsg(61803)
' End Get
' End Property
' Public ReadOnly Property T_Msg As String
' Get
' Return EgtMsg(61804)
' End Get
' End Property
' Public ReadOnly Property PRC_Msg As String
' Get
' Return EgtMsg(61805)
' End Get
' End Property
' Public ReadOnly Property NAM_Msg As String
' Get
' Return EgtMsg(61608)
' End Get
' End Property
' Public ReadOnly Property Description_Msg As String
' Get
' Return EgtMsg(61603)
' End Get
' End Property
' Public ReadOnly Property Default_Msg As String
' Get
' Return EgtMsg(61802)
' End Get
' End Property
' Public ReadOnly Property Min_Msg As String
' Get
' Return EgtMsg(61616)
' End Get
' End Property
' Public ReadOnly Property Max_Msg As String
' Get
' Return EgtMsg(61617)
' End Get
' End Property
' Public ReadOnly Property CurrentLanguage_Msg As String
' Get
' Return EgtMsg(6501)
' End Get
' End Property
' Public ReadOnly Property LanguageAdvert_Msg As String
' Get
' Return EgtMsg(6502)
' End Get
' End Property
' Public ReadOnly Property MMUnits_Msg As String
' Get
' Return EgtMsg(6540)
' End Get
' End Property
' Public ReadOnly Property Nesting_Msg As String
' Get
' Return EgtMsg(61829)
' End Get
' End Property
' Public ReadOnly Property SectionTime_Msg As String
' Get
' Return EgtMsg(61806)
' End Get
' End Property
' Public ReadOnly Property PartTime_Msg As String
' Get
' Return EgtMsg(61807)
' End Get
' End Property
' Public ReadOnly Property DisplayIndex_Msg As String
' Get
' Return EgtMsg(61842)
' End Get
' End Property
' Public ReadOnly Property ColumnName_Msg As String
' Get
' Return EgtMsg(61843)
' End Get
' End Property
' Public ReadOnly Property CanUserReorder_Msg As String
' Get
' Return EgtMsg(61844)
' End Get
' End Property
' Public ReadOnly Property CanUserResize_Msg As String
' Get
' Return EgtMsg(61845)
' End Get
' End Property
' Public ReadOnly Property CanUserSort_Msg As String
' Get
' Return EgtMsg(61846)
' End Get
' End Property
' Public ReadOnly Property IsReadOnly_Msg As String
' Get
' Return EgtMsg(61847)
' End Get
' End Property
' Public ReadOnly Property Visible_Msg As String
' Get
' Return EgtMsg(61848)
' End Get
' End Property
'#End Region ' Messages
'#Region "Constructor"
' Sub New()
' ' imposto riferimento in Map
' Map.SetRefConfigurationPageVM(Me)
' ' Leggo nome lingua corrente
' Dim sLanguage As String = String.Empty
' GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
' ' Leggo elenco lingue disponibili da file ini e imposto lingua corrente
' Dim nIndex As Integer = 1
' While True
' Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
' If IsNothing(ReadLanguage) Then Exit While
' m_LanguageList.Add(ReadLanguage)
' If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
' m_SelectedLanguage = ReadLanguage
' End If
' nIndex += 1
' End While
' ' Inizializzo la lingua corrente
' m_SelectedLanguage = m_LanguageList(0)
' Dim sMsgName As String = String.Empty
' IniFile.GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
' For Each Language In m_LanguageList
' If Language.Name = sMsgName Then
' m_SelectedLanguage = Language
' Exit For
' End If
' Next
' ' leggo SectionTime e PartTime
' GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
' GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
' ' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
' ConfigMachTableList = CurrentMachine.MachTableList
' ' carico i parametri Q dei Process letti dall'ini
' GetQParamsList()
' ' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
' If Not IsNothing(QBTLParamVMList) Then
' QBTLParamVMList.Clear()
' End If
' For Each PRCItem In PRCList
' For Each QBTLParam In PRCItem.QBTLParamVMList
' QBTLParamVMList.Add(QBTLParam)
' Next
' Next
' NotifyPropertyChanged(NameOf(QBTLParamVMList))
' ' setto il grouping a 2 livelli (GRP e, sotto, PRC col nome completo) per la DataGrid
' m_QBTLParamVMList_View = CollectionViewSource.GetDefaultView(m_QBTLParamVMList)
' m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.GroupType)))
' m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.ghDesc)))
' ' carico la lista delle colonne delle DataGrid in ConfigurationPage
' LoadConfigDGColumns()
' ' setto il grouping ad 1 livello per la DataGrid
' m_DGColumnsList_View = CollectionViewSource.GetDefaultView(m_DGColumnsList)
' m_DGColumnsList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(IniDataGridColumn.ParentDataGridName)))
' End Sub
'#End Region ' Constructor
'#Region "SaveCommand"
' ''' <summary>
' ''' Returns a command that do Save.
' ''' </summary>
' Public ReadOnly Property SaveCommand As ICommand
' Get
' If m_cmdSave Is Nothing Then
' m_cmdSave = New Command(AddressOf Save)
' End If
' Return m_cmdSave
' End Get
' End Property
' ''' <summary>
' ''' Execute the Save. This method is invoked by the SaveCommand.
' ''' </summary>
' Public Sub Save()
' WriteMachParams()
' WriteProcessParams(PRCList.ToList())
' WriteDataGridColumns()
' WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
' WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
' WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
' WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
' End Sub
'#End Region ' SaveCommand
'#Region "Methods"
' ' funzione che scrive i parametri modificati sul file INI
' Public Sub WriteMachParams()
' For Each MachTableItem In ConfigMachTableList
' For Each MachParamItem In MachTableItem.MachParamList
' If MachParamItem.IsModified Then
' Dim sMachParamType As String = String.Empty
' Select Case MachParamItem.nType
' Case MachParamType.DOUBLE_
' sMachParamType = "d"
' Case MachParamType.STRING_
' sMachParamType = "s"
' Case MachParamType.LENGTH
' sMachParamType = "l"
' End Select
' Dim MachParamString As String = sMachParamType & "," & MachParamItem.sName & "," & MachParamItem.sValue & "," & MachParamItem.sDescription
' Dim bOk = WriteMachPrivateProfileString(MachParamItem.nParentTable, MachParamItem.nParamIndex, MachParamString)
' If Not bOk Then
' MessageBox.Show(EgtMsg(61859), EgtMsg(30007))
' Return
' End If
' MachParamItem.IsModifiedReset()
' End If
' Next
' Next
' End Sub
' ' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
' Friend Sub VerifyConfigPageModification()
' ' Prima ciclo sui parametri Macchina
' Dim bExitFor = False
' For Each MachTableItem In ConfigMachTableList
' For Each MachParamItem In MachTableItem.MachParamList
' If MachParamItem.IsModified Then
' If MessageBox.Show(EgtMsg(61860), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' ' scrivo i parametri Macchina
' WriteMachParams()
' Else
' ' se da non salvare li resetto ed esco dai For
' CreateMachParams()
' bExitFor = True
' Exit For
' End If
' End If
' Next
' If bExitFor Then Exit For
' Next
' ' Ora ciclo sui parametri Q
' Dim bAskToSaveDefaultValues As Boolean = False
' bExitFor = False
' For Each PRCItem In PRCList
' For Each QParam In PRCItem.QBTLParamVMList
' If QParam.bIsModified Then
' bAskToSaveDefaultValues = True
' ' esco dai For
' bExitFor = True
' Exit For
' End If
' Next
' If bExitFor Then Exit For
' Next
' ' se nel ciclo è stato trovato almeno un valore modificato chiedo il salvataggio
' If bAskToSaveDefaultValues Then
' If MessageBox.Show(EgtMsg(61861), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' ' se si è scelto di salvare i valori li scrivo
' WriteProcessParams(PRCList.ToList())
' End If
' ' in ogni caso ricarico i valori (in modo da resettare i flag di modifica)
' GetQParamsList()
' ' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
' If Not IsNothing(QBTLParamVMList) Then
' QBTLParamVMList.Clear()
' End If
' For Each PRCItem In PRCList
' For Each QBTLParam In PRCItem.QBTLParamVMList
' QBTLParamVMList.Add(QBTLParam)
' Next
' Next
' NotifyPropertyChanged(NameOf(QBTLParamVMList))
' End If
' ' verifico se i valori delle colonne DataGrid sono stati modificati
' For Each DGColumnItem In DGColumnsList
' If DGColumnItem.IsModified Then
' If MessageBox.Show(EgtMsg(61882), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' ' scrivo i valori delle colonne DataGrid modificate
' WriteDataGridColumns()
' Else
' ' se da non salvare li resetto ed esco dai For
' LoadConfigDGColumns()
' Exit For
' End If
' End If
' Next
' End Sub
' ' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
' Friend Function VerifyConfigPagePassword() As Boolean
' ' Display message, title, and default value.
' Dim sPwdInput = InputBox("Inserire Password: ", "Richiesta Pwd")
' ' Lettura PWD dall'INI e confronto
' Dim sPwdIni As String = String.Empty
' If GetMainPrivateProfileString(S_MACH, K_PASSWORD, "", sPwdIni) <> 0 Then
' If sPwdIni = sPwdInput Then Return True
' End If
' Return False
' End Function
' Public Sub GetQParamsList()
' m_PRCList.Clear()
' ' carico lista process
' Dim TempPRCList As New ObservableCollection(Of Integer)
' ' prima cerco i process L (GRPType = 0)
' Dim GRPType As Integer = 0
' GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
' For Each PRC In TempPRCList
' ' leggo gruppi
' Dim GRPList As New ObservableCollection(Of Integer)
' GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
' m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
' Next
' ' ora cerco i process T (GRPType = 1)
' GRPType = 1
' GetBeamPrivateProfileProcessList(GRPType, TempPRCList)
' For Each PRC In TempPRCList
' ' leggo gruppi
' Dim GRPList As New ObservableCollection(Of Integer)
' GetBeamPrivateProfileGRPList(GRPType, PRC, GRPList)
' m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), GRPType), PRC, GetBeamPrivateProfileName(GRPType, PRC), CreateProcessParams(GRPType, PRC, False)))
' Next
' End Sub
' ' funzione che crea l'elenco dei parametri P o Q di un Process
' Public Function CreateProcessParams(GRPType As Integer, PRC As Integer, IsP As Boolean)
' Dim ParamIndex As Integer = 1
' Dim TempList As New List(Of QBTLParamVM)
' Dim NewBTLParam As BTLParamM = Nothing
' ' leggo tutti i parametri P o Q del Process
' ParamIndex = 1
' TempList = New List(Of QBTLParamVM)
' While BTLIniFile.GetBeamPrivateProfileParam(GRPType, PRC, IsP, ParamIndex, Nothing, NewBTLParam)
' TempList.Add(New QBTLParamVM(NewBTLParam, GRPType, PRC))
' ParamIndex += 1
' End While
' Return TempList
' End Function
' ' funzione che scrive l'elenco dei parametri P o Q di un Process
' Public Sub WriteProcessParams(PRCList As List(Of PRC))
' For Each PRCItem In PRCList
' Dim nPRCParamIndex As Integer = 1
' For Each PRCParam In PRCItem.QBTLParamVMList
' If PRCParam.bIsModified Then
' ' costruisco la stringa da scrivere nel parametro
' Dim sType As String = ""
' If PRCParam.nType = 1 Then
' sType = "d"
' ElseIf PRCParam.nType = 4 Then
' sType = "l"
' End If
' Dim sPRCParam As String = sType & "," & If(PRCParam.bIsP, "P", "Q") & PRCParam.nId.ToString("D2") & "," & PRCParam.sMin & "," & PRCParam.sMax & "," & PRCParam.sDefault & "," & PRCParam.sDescription
' WritePrivateProfileString(PRCItem.nGRP & "." & PRCItem.nPRC, If(PRCParam.bIsP, "P", "Q") & nPRCParamIndex, sPRCParam, m_sBTLIniFile)
' End If
' nPRCParamIndex += 1
' Next
' Next
' End Sub
' ' funzione che carica la DataGrid di configurazione delle colonne delle EgtDataGrid
' Public Sub LoadConfigDGColumns()
' DGColumnsList.Clear()
' GetPrivateProfileColumns(S_FEATURELIST, DGColumnsList)
' GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
' GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
' GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
' GetPrivateProfileColumns(S_RAWPARTLIST_WALL, DGColumnsList)
' GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
' GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
' End Sub
' ' funzione per calcolare e scrivere la stringhe dei parametri delle colonne relative ad una ParentDataGridName nell'INI
' Public Sub SaveDataGridColumns(ParentDataGridName As String, DGColumnsList As ObservableCollection(Of IniDataGridColumn))
' For Each ColumnItem In DGColumnsList
' If ColumnItem.ParentDataGridName = ParentDataGridName Then
' Dim sColumnParams = String.Empty
' sColumnParams = ColumnItem.Name & "," & If(ColumnItem.CanUserReorder, 1, 0) & "," & If(ColumnItem.CanUserResize, 1, 0) & "," &
' If(ColumnItem.CanUserSort, 1, 0) & "," & If(ColumnItem.IsReadOnly, 1, 0) & "," & DoubleToString(ColumnItem.Width.Value, 6) & "," &
' ColumnItem.Width.UnitType & "," & If(ColumnItem.Visible, 1, 0) & "," & If(ColumnItem.CanUserEditVisible, 1, 0)
' WriteColumnPrivateProfileParam(ParentDataGridName, ColumnItem.m_DisplayIndex, sColumnParams)
' End If
' Next
' End Sub
' ' funzione che scrive i valori delle proprietà delle colonne customizzate delle EgtDataGrid nell'INI
' Public Sub WriteDataGridColumns()
' SaveDataGridColumns(S_FEATURELIST, DGColumnsList)
' SaveDataGridColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
' SaveDataGridColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
' SaveDataGridColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
' SaveDataGridColumns(S_RAWPARTLIST_WALL, DGColumnsList)
' SaveDataGridColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
' SaveDataGridColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
' For Each DGColumnItem In DGColumnsList
' DGColumnItem.IsModifiedReset()
' Next
' End Sub
'#End Region ' Methods
End Class
'Public Class MachParam
' Inherits VMBase
' ' table a cui appartiene il parametro
' Private m_nParentTable As Integer
' Friend ReadOnly Property nParentTable As Integer
' Get
' Return m_nParentTable
' End Get
' End Property
' ' indice del parametro
' Private m_nParamIndex As Integer
' Friend ReadOnly Property nParamIndex As Integer
' Get
' Return m_nParamIndex
' End Get
' End Property
' ' tipo della variabile
' Private m_nType As MachParamType
' Friend ReadOnly Property nType As MachParamType
' Get
' Return m_nType
' End Get
' End Property
' ' parametri da struttura
' Private m_sName As String
' Public Property sName As String
' Get
' Return m_sName
' End Get
' Set(value As String)
' m_sName = value
' End Set
' End Property
' ' parametri da geometria
' Private m_IsModifiedValue As Boolean = False
' Private m_dValue As Double
' Private m_sValue As String
' Public Property sValue As String
' Get
' Select Case nType
' Case MachParamType.DOUBLE_
' Return DoubleToString(m_dValue, 3)
' Case MachParamType.LENGTH
' Return LenToString(m_dValue, 3)
' Case Else ' stringhe
' Return m_sValue
' End Select
' Return If(nType = MachParamType.LENGTH, LenToString(m_dValue, 3), DoubleToString(m_dValue, 3))
' End Get
' Set(value As String)
' Dim dNewValue As Double
' ' verifico se valore immesso è diverso dall'originale
' If nParentTable > 0 Then
' Dim sOrigValue As String = String.Empty
' Dim dOrigValue As Double
' MachParamIniFile.GetMachPrivateProfileParamValue(nParentTable, nParamIndex, sOrigValue)
' ' trasformo valori
' Select Case nType
' Case MachParamType.DOUBLE_
' StringToDouble(value, dNewValue)
' StringToDouble(sOrigValue, dOrigValue)
' Case MachParamType.LENGTH
' StringToLen(value, dNewValue)
' StringToLen(sOrigValue, dOrigValue)
' Case Else
' ' per string non faccio nulla
' End Select
' m_IsModifiedValue = dNewValue <> dOrigValue
' End If
' ' se valore immesso è diverso e password non inserita
' If m_IsModifiedValue AndAlso Not Map.refConfigurationPageVM.bModifyMachParam Then
' Map.refConfigurationPageVM.bModifyMachParam = Map.refConfigurationPageVM.VerifyConfigPagePassword()
' If Not Map.refConfigurationPageVM.bModifyMachParam Then
' NotifyPropertyChanged("sValue")
' m_IsModifiedValue = False
' Return
' End If
' End If
' Select Case nType
' Case MachParamType.DOUBLE_, MachParamType.LENGTH
' UpdateParamValue(dNewValue, "")
' Case Else
' UpdateParamValue(0, value)
' End Select
' End Set
' End Property
' Public Property dValue As Double
' Get
' Return m_dValue
' End Get
' Set(value As Double)
' m_dValue = value
' NotifyPropertyChanged("sValue")
' End Set
' End Property
' ' descrizione del parametro
' Private m_sDescription As String
' Public Property sDescription As String
' Get
' Return m_sDescription
' End Get
' Set(value As String)
' m_sDescription = value
' End Set
' End Property
' Private Sub StdInit(nParentTable As Integer, nParamIndex As Integer, Type As MachParamType, sName As String, sDescription As String)
' m_nParentTable = nParentTable
' m_nParamIndex = nParamIndex
' m_nType = Type
' m_sName = sName
' m_sDescription = MsgToString(sDescription)
' End Sub
' ' new per double e length
' Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, dValue As Double, sDescription As String)
' StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
' m_dValue = dValue 'sValue = DoubleToString(dValue, 3)
' End Sub
' ' new per stringhe
' Sub New(nParentTable As Integer, nParamIndex As Integer, nType As MachParamType, sParamName As String, sDescription As String)
' StdInit(nParentTable, nParamIndex, nType, sParamName, sDescription)
' End Sub
' ' new per parametro vuoto
' Sub New(nType As MachParamType, nParamIndex As Integer, sParamName As String)
' StdInit(Nothing, nParamIndex, nType, sParamName, "")
' End Sub
' Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
' Select Case nType
' Case MachParamType.DOUBLE_, MachParamType.LENGTH
' m_dValue = dNewValue
' Case MachParamType.STRING_
' m_sValue = sNewValue
' End Select
' End Sub
' Public ReadOnly Property IsModified() As Boolean
' Get
' Return m_IsModifiedValue
' End Get
' End Property
' Public Sub IsModifiedReset()
' m_IsModifiedValue = False
' End Sub
'End Class
'Public Class MachTable
' Inherits VMBase
' ' nome della table
' Private m_sName As String
' Public Property sName As String
' Get
' Return m_sName
' End Get
' Set(value As String)
' m_sName = value
' End Set
' End Property
' Private m_MachParamList As New ObservableCollection(Of MachParam)
' Public Property MachParamList As ObservableCollection(Of MachParam)
' Get
' Return m_MachParamList
' End Get
' Set(value As ObservableCollection(Of MachParam))
' m_MachParamList = value
' End Set
' End Property
' Sub New(Name As String, ParamList As ObservableCollection(Of MachParam))
' sName = Name
' MachParamList = ParamList
' End Sub
'End Class
'Public Class IniDataGridColumn
' Private Property m_ParentDataGridName As String
' Public Property ParentDataGridName As String
' Get
' Return m_ParentDataGridName
' End Get
' Set(value As String)
' m_ParentDataGridName = value
' End Set
' End Property
' Private Property m_Name As String
' Public Property Name As String
' Get
' Return m_Name
' End Get
' Set(value As String)
' m_Name = value
' End Set
' End Property
' Private Property m_Width As DataGridLength
' Public Property Width As DataGridLength
' Get
' Return m_Width
' End Get
' Set(value As DataGridLength)
' m_Width = value
' End Set
' End Property
' Private m_IsModifiedDisplayIndex
' Friend Property m_DisplayIndex As Integer
' Public Property DisplayIndex As Integer
' Get
' Return If(Visible, m_DisplayIndex, -1)
' End Get
' Set(value As Integer)
' m_DisplayIndex = value
' m_IsModifiedDisplayIndex = (m_Name <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME))
' ' se DisplayIndex viene settato ad un valore che corrisponde a quello che aveva inizialmente aggiorno gli IsModified
' ' delle altre proprietà utilizzando il DisplayIndex attuale
' If Not m_IsModifiedDisplayIndex Then
' m_IsModifiedIsReadOnly = (m_IsReadOnly <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
' m_IsModifiedCanUserReorder = (m_CanUserReorder <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
' m_IsModifiedCanUserResize = (m_CanUserResize <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
' m_IsModifiedCanUserSort = (m_CanUserSort <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
' m_IsModifiedVisible = (m_Visible <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
' End If
' End Set
' End Property
' Private m_IsModifiedIsReadOnly As Boolean = False
' Private Property m_IsReadOnly As Boolean = True
' Public Property IsReadOnly As Boolean
' Get
' Return m_IsReadOnly
' End Get
' Set(value As Boolean)
' m_IsReadOnly = value
' m_IsModifiedIsReadOnly = (m_IsReadOnly <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
' End Set
' End Property
' Private m_IsModifiedCanUserReorder As Boolean = False
' Private m_CanUserReorder As Boolean
' Public Property CanUserReorder As Boolean
' Get
' Return m_CanUserReorder
' End Get
' Set(value As Boolean)
' m_CanUserReorder = value
' m_IsModifiedCanUserReorder = (m_CanUserReorder <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
' End Set
' End Property
' Private m_IsModifiedCanUserResize As Boolean = False
' Private m_CanUserResize As Boolean
' Public Property CanUserResize As Boolean
' Get
' Return m_CanUserResize
' End Get
' Set(value As Boolean)
' m_CanUserResize = value
' m_IsModifiedCanUserResize = (m_CanUserResize <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
' End Set
' End Property
' Private m_IsModifiedCanUserSort As Boolean = False
' Private m_CanUserSort As Boolean
' Public Property CanUserSort As Boolean
' Get
' Return m_CanUserSort
' End Get
' Set(value As Boolean)
' m_CanUserSort = value
' m_IsModifiedCanUserSort = (m_CanUserSort <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
' End Set
' End Property
' Private m_IsModifiedVisible As Boolean = False
' Private m_Visible As Boolean
' Public Property Visible As Boolean
' Get
' Return m_Visible
' End Get
' Set(value As Boolean)
' m_Visible = value
' ' Utilizzo OldDGIndex e NewDGIndex per muovere la Column tra il gruppo dei Visible (in alto) o il gruppo
' ' dei non Visible (in basso): in ambo i casi verrà sempre spostata in mezzo ai due raggruppamenti
' Dim OldDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Me)
' If value Then
' Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
' Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
' x.Visible = False))
' ' se NewDGIndex = -1 (ovvero ho settato l'ultima Column rimasta non Visible a Visible) oppure
' ' se il nuovo indice è subito dopo il vecchio non la sposto altrimenti viene spostata in maniera sbagliata
' If NewDGIndex <> -1 AndAlso NewDGIndex <> OldDGIndex + 1 Then Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex)
' Else
' Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
' Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
' x.Visible = False AndAlso
' x.Name <> Name))
' ' se NewDGIndex = -1 vuol dire che erano tutte settate a Visible perciò devo calcolare l'indice
' ' dell'ultima Column con quel ParentDataGridName e spostarlo lì
' If NewDGIndex = -1 Then
' Dim FirstIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
' Function(x) x.ParentDataGridName = ParentDataGridName))
' Dim LastIndex = FirstIndex
' While LastIndex < Map.refConfigurationPageVM.DGColumnsList.Count AndAlso Map.refConfigurationPageVM.DGColumnsList(LastIndex).ParentDataGridName = ParentDataGridName
' LastIndex += 1
' End While
' NewDGIndex = LastIndex
' End If
' Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex - 1)
' End If
' ' aggiorno i DisplayIndex di ciascuna Column della ParentDataGridName in questione
' Dim index = 0
' For Each DGColumnItem In Map.refConfigurationPageVM.DGColumnsList
' If DGColumnItem.ParentDataGridName = ParentDataGridName Then
' DGColumnItem.DisplayIndex = index
' index += 1
' End If
' Next
' ' uso il Move col medesimo valore per i 2 argomenti per refreshare i DisplayIndex delle Column
' ' della ParentDataGridName in questione appena riordinate
' For index = 0 To Map.refConfigurationPageVM.DGColumnsList.Count - 1
' If Map.refConfigurationPageVM.DGColumnsList(index).ParentDataGridName = ParentDataGridName Then
' Map.refConfigurationPageVM.DGColumnsList.Move(index, index)
' End If
' Next
' ' setto se il valore è stato modificato, a partire dalla verifica che il Nome e DisplayIndex combacino (altrimenti è per forza modificato)
' m_IsModifiedVisible = (m_Name <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME)) OrElse
' (If(m_Visible, 1, 0) <>
' GetPrivateProfileColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
' End Set
' End Property
' Private m_CanUserEditVisible As Boolean
' Public Property CanUserEditVisible As Boolean
' Get
' Return m_CanUserEditVisible
' End Get
' Set(value As Boolean)
' m_CanUserEditVisible = value
' End Set
' End Property
' Public ReadOnly Property IsModified() As Boolean
' Get
' Return m_IsModifiedDisplayIndex OrElse
' m_IsModifiedIsReadOnly OrElse
' m_IsModifiedCanUserReorder OrElse
' m_IsModifiedCanUserResize OrElse
' m_IsModifiedCanUserSort OrElse
' m_IsModifiedVisible
' End Get
' End Property
' Public Sub IsModifiedReset()
' m_IsModifiedDisplayIndex = False
' m_IsModifiedIsReadOnly = False
' m_IsModifiedCanUserReorder = False
' m_IsModifiedCanUserResize = False
' m_IsModifiedCanUserSort = False
' m_IsModifiedVisible = False
' End Sub
' Sub New(sName As String)
' m_Name = sName
' End Sub
' Sub New(sParentDG As String, nDisplayIndex As Integer, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
' m_ParentDataGridName = sParentDG
' m_DisplayIndex = nDisplayIndex
' m_Name = sName
' m_CanUserReorder = bCanUserReorder
' m_CanUserResize = bCanUserResize
' m_CanUserSort = bCanUserSort
' m_IsReadOnly = bIsReadOnly
' m_Width = Width
' m_Visible = bVisible
' m_CanUserEditVisible = bCanUserEditVisible
' End Sub
'End Class
'' Tipo parametro nel file di configurazione Macchina
'Public Enum MachParamType As Integer
' DOUBLE_ = 1
' STRING_ = 2
' COMBO = 3
' LENGTH = 4
' CHECKBOX = 5
'End Enum
@@ -0,0 +1,89 @@
<DataGrid x:Class="DGColumnsListV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.Columns>
<!--Indice-->
<!--<DataGridTextColumn Binding="{Binding DisplayIndex}"
Width="Auto"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.DisplayIndex_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>-->
<!--Nome colonna-->
<DataGridTextColumn Binding="{Binding Name}"
Width="Auto"
IsReadOnly="True">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ColumnName_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--CanUserReorder-->
<DataGridCheckBoxColumn Binding="{Binding CanUserReorder, UpdateSourceTrigger=PropertyChanged}"
Width="Auto">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.CanUserReorder_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
<!--CanUserResize-->
<DataGridCheckBoxColumn Binding="{Binding CanUserResize, UpdateSourceTrigger=PropertyChanged}"
Width="Auto">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.CanUserResize_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
<!--CanUserSort-->
<DataGridCheckBoxColumn Binding="{Binding CanUserSort, UpdateSourceTrigger=PropertyChanged}"
Width="Auto">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.CanUserSort_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>
<!--IsReadOnly-->
<!--<DataGridCheckBoxColumn Binding="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
Width="Auto">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.IsReadOnly_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
</DataGridCheckBoxColumn>-->
<!--Visible-->
<DataGridCheckBoxColumn Binding="{Binding Visible, UpdateSourceTrigger=PropertyChanged}"
Width="Auto">
<DataGridCheckBoxColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Visible_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridCheckBoxColumn.HeaderTemplate>
<DataGridCheckBoxColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="{Binding CanUserEditVisible}" />
</Style>
</DataGridCheckBoxColumn.CellStyle>
</DataGridCheckBoxColumn>
</DataGrid.Columns>
</DataGrid>
@@ -0,0 +1,3 @@
Public Class DGColumnsListV
End Class
@@ -217,7 +217,18 @@
<DependentUpon>AboutBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="BTLParam\BTLFeatureVM.vb" />
<Compile Include="CALCPanel\CalcPanelV.xaml.vb">
<DependentUpon>CalcPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="CALCPanel\CALCPanelVM.vb" />
<Compile Include="Comms\TPAComm.vb" />
<Compile Include="ConfigurationPage\ConfigurationPageV.xaml.vb">
<DependentUpon>ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\ConfigurationPageVM.vb" />
<Compile Include="ConfigurationPage\DGColumnsListV.xaml.vb">
<DependentUpon>DGColumnsListV.xaml</DependentUpon>
</Compile>
<Compile Include="Constants\ConstBeam.vb" />
<Compile Include="Constants\ConstCommVar.vb" />
<Compile Include="Constants\ConstGen.vb" />
@@ -225,6 +236,9 @@
<Compile Include="Constants\ConstMachIni.vb" />
<Compile Include="Constants\ConstMsg.vb" />
<Compile Include="Constants\ConstWarehouseIni.vb" />
<Compile Include="LeftPanel\FeatureInPartInRawPartListV.xaml.vb">
<DependentUpon>FeatureInPartInRawPartListV.xaml</DependentUpon>
</Compile>
<Compile Include="LeftPanel\LeftPanelV.xaml.vb">
<DependentUpon>LeftPanelV.xaml</DependentUpon>
</Compile>
@@ -251,6 +265,10 @@
<Compile Include="MachManagingThread\MachManaging.vb" />
<Compile Include="MachManagingThread\MachManagingThread.vb" />
<Compile Include="MachManagingThread\RWVariableManager.vb" />
<Compile Include="MainMenu\MainMenuV.xaml.vb">
<DependentUpon>MainMenuV.xaml</DependentUpon>
</Compile>
<Compile Include="MainMenu\MainMenuVM.vb" />
<Compile Include="MainWindow\MainWindowM.vb" />
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
<Compile Include="ProjectManager\ProdFileVM.vb" />
@@ -269,6 +287,10 @@
<Compile Include="ShowPanel\ShowPanelV.xaml.vb">
<DependentUpon>ShowPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="StatusBar\MyStatusBarVM.vb" />
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
</Compile>
<Compile Include="SupervisorManager\SupervisorManagerV.xaml.vb">
<DependentUpon>SupervisorManagerV.xaml</DependentUpon>
</Compile>
@@ -291,6 +313,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CALCPanel\CalcPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\DGColumnsListV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LeftPanel\FeatureInPartInRawPartListV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LeftPanel\LeftPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -311,6 +349,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainMenu\MainMenuV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainWindow\MainWindowV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -339,6 +381,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StatusBar\StatusBarV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SupervisorManager\SupervisorManagerV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -0,0 +1,89 @@
<UserControl x:Class="FeatureInPartInRawPartListV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor">
<!--<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>-->
<DataGrid ItemsSource="{Binding FeatureVMList}"
SelectedItem="{Binding SelFeatureVM}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.Columns>
<!--DO - Abilitazione-->
<DataGridCheckBoxColumn Binding="{Binding bDO}"
IsReadOnly="True"
Width="25">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Validità feature-->
<DataGridTemplateColumn Width="Auto">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_Background}"/>
<!--Width="{Binding ActualHeigth, Source=Self}"/>-->
<Grid Grid.Column="1"
HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ellipse Width="5"
Height="5"
Fill="Red"
Visibility="{Binding CALC_ROT_Visibility}"
HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1"
Text="{Binding CALC_ERR_Letter}"
Foreground="{Binding CALC_ERR_Foreground}"
TextAlignment="Center"
FontWeight="Bold"
FontSize="12"
Margin="0,-6,0,-2"/>
<!--<Ellipse Width="5"
Height="5"
Fill="Red"
Visibility="{Binding CALC_ROT_Visibility}"/>
<TextBlock Text="{Binding CALC_ERR_Letter}"
Foreground="{Binding CALC_ERR_Foreground}"
FontWeight="Bold"
FontSize="10"/>-->
<!--<TextBlock Text="&#x2794;"
Visibility="{Binding CALC_FALL_Visibility}"/>-->
</Grid>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Descrizione-->
<DataGridTextColumn Binding="{Binding sDesc}"
Width="1*"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class FeatureInPartInRawPartListV
End Class
@@ -0,0 +1,21 @@
Imports EgtUILib
Public Class FeatureInPartInRawPartListVM
#Region "Messages"
Public ReadOnly Property Description_Msg As String
Get
Return EgtMsg(61603)
End Get
End Property
Public ReadOnly Property DO_Msg As String
Get
Return EgtMsg(61610)
End Get
End Property
#End Region ' Messages
End Class
@@ -10,6 +10,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<UniformGrid Columns="2">
@@ -32,24 +33,35 @@
<StackPanel Grid.Row="2"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Button Content="˄"
<!--<Button Content="˄"
Command="{Binding MoveUpRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>
<Button Content="˅"
Command="{Binding MoveDownRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>-->
<Button Content="D"
Command="{Binding DoneRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>
<Button Content="C"
<Button Content="-"
Command="{Binding DeleteRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>
<Button Content="E"
Command="{Binding CompletedRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>
</StackPanel>
<EgtBEAMWALL:RawPartListV Grid.Row="3"
DataContext="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
<StackPanel Grid.Row="4"
Orientation="Horizontal"
HorizontalAlignment="Right">
<Button Content="D"
Command="{Binding DoneRawPart_Command}"
Style="{StaticResource LeftPanel_SmallButton}"/>
</StackPanel>
<EgtBEAMWALL:PartInRawPartListV Grid.Row="4"
DataContext="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
<UniformGrid Grid.Row="5"
Columns="2">
<EgtBEAMWALL:PartInRawPartListV DataContext="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"/>
<EgtBEAMWALL:FeatureInPartInRawPartListV DataContext="{Binding Tag.SelectedMachGroup.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
Visibility="{Binding FeatureList_Visibility}"/>
</UniformGrid>
</Grid>
@@ -25,7 +25,7 @@ Public Class LeftPanelVM
Private m_cmdDeleteRawPart As ICommand
Private m_cmdMoveUpRawPart As ICommand
Private m_cmdMoveDownRawPart As ICommand
Private m_cmdCompletedRawPart As ICommand
Private m_cmdDoneRawPart As ICommand
#End Region 'FIELDS & PROPERTIES
@@ -50,19 +50,19 @@ Public Class LeftPanelVM
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property CompletedRawPart_Command As ICommand
Public ReadOnly Property DoneRawPart_Command As ICommand
Get
If m_cmdCompletedRawPart Is Nothing Then
m_cmdCompletedRawPart = New Command(AddressOf CompletedRawPart)
If m_cmdDoneRawPart Is Nothing Then
m_cmdDoneRawPart = New Command(AddressOf DoneRawPart)
End If
Return m_cmdCompletedRawPart
Return m_cmdDoneRawPart
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub CompletedRawPart()
Public Sub DoneRawPart()
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
' scrivo tutti pezzi completati
@@ -82,6 +82,7 @@ Public Class LeftPanelVM
If Part.dtEndTime = DateTime.MinValue Then
Dim Time As DateTime = DateTime.Now()
DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, Time)
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.Produced)
Part.dtEndTime = Time
If PartIndex = SelMachGroup.PartVMList.Count - 1 Then
'aggiorno anche fine MachGroup
@@ -90,8 +91,8 @@ Public Class LeftPanelVM
SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Calc_Background))
End If
End If
' aggiorno status MachGroup
DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id, ItemState.Produced)
' aggiungere status!!
Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
Next
End Sub
@@ -37,6 +37,14 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Stato di produzione-->
<DataGridTemplateColumn Width="Auto">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border Background="{Binding Production_Background}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--NAM - Descrizione-->
<DataGridTextColumn Binding="{Binding sNAM}"
Width="1*"
@@ -95,7 +103,8 @@
</DataGridTextColumn>
<!--Off - Offset-->
<DataGridTextColumn Binding="{Binding sOffset}"
Width="65">
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="Offset"/>
</DataGridTextColumn.Header>
@@ -29,7 +29,8 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="P"
Command="{Binding ProduceMachGroup_Command}"/>
Command="{Binding ProduceMachGroup_Command}"
IsEnabled="{Binding Produce_IsEnabled}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
@@ -51,7 +52,8 @@
</DataGridTemplateColumn>
<!--STARTCUT - Ritaglio iniziale-->
<DataGridTextColumn Binding="{Binding sStartCut}"
Width="65">
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="Ritaglio iniziale"/>
</DataGridTextColumn.Header>
@@ -39,6 +39,14 @@ Public Class BeamMachGroupVM
Return Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & Name & ".cnc"
End Function
Public Overrides Sub CALCEnd()
' aggiorno stato per lancio in macchina
If MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.OK OrElse MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.INFO Then
m_bCNReCalculated = True
NotifyPropertyChanged(NameOf(Production_Background))
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -47,30 +55,28 @@ Public Class BeamMachGroupVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Overrides Sub ProduceMachGroup()
'' se lavorazione interrotta da reset
'If bResetWhileCutting Then
' ' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
' If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
' ' se ripresa, lancio finestra per definire da dove
' se gia' in produzione, non devo fare nulla
If m_bToBeProduced Then Return
' se lavorazione interrotta da reset
If bResetWhileCutting Then
' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
' se ripresa, lancio finestra per definire da dove
' End If
'End If
End If
End If
' cerco primo indice di pezzo non in produzione
Dim NewIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) DirectCast(x, MyMachGroupVM).dtStartTime = DateTime.MinValue AndAlso DirectCast(x, MyMachGroupVM).bToBeProduced = False))
' segno pezzo da produrre
m_bToBeProduced = True
' ricalcolo il CN
m_bCNReCalculated = True
NotifyPropertyChanged(NameOf(Production_Background))
' lancio ricalcolo del CN
Map.refCALCPanelVM.VerifyMachGroup(Me)
' sposto MachGroup in lista come ultimo dei pronti da produrre
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me)
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex)
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
NotifyPropertyChanged(NameOf(nCALC_State))
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
#End Region ' ProduceMachGroup
@@ -63,7 +63,7 @@ Public Class MyMachGroupPanelVM
' Imposto vista solo tavola
EgtSetMachineLook(MCH_LOOK.TAB)
Dim View As VT
For Each Mach As MyMachine In CoreMap.refMachinePanelVM.MachineList
For Each Mach As MyMachine In Map.refMachinePanelVM.MachineList
If Mach.Name = SelectedMachGroup.Machine Then
If Mach.nType = Core.ConstBeam.MachineType.BEAM Then
View = VT.ISO_SW
@@ -31,6 +31,8 @@ Public Class SupervisorMachGroupPanelVM
Sub New(MachGroupPanelM As MachGroupPanelM)
MyBase.New(MachGroupPanelM)
' riferimento su map
Map.SetRefSupervisorMachGroupPanelVM(Me)
BindingOperations.EnableCollectionSynchronization(m_MachGroupVMList, m_Lock_AddMachGroup)
End Sub
@@ -42,6 +44,8 @@ Public Class SupervisorMachGroupPanelVM
SyncLock (m_Lock_AddMachGroup)
MachGroupVMList.Add(MachGroup)
End SyncLock
' notifico stato
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
End Sub
Public Sub ReloadProjectFile()
@@ -117,6 +117,7 @@ Class MachManaging
' scrivo data start su Db pezzo
Dim dtStart As DateTime = DateTime.Now()
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
' recupero gruppo di lavorazione del pezzo
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' recupero pezzo
@@ -131,6 +132,7 @@ Class MachManaging
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nCALC_State = 1) Then
' scrivo data start su Db barra
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
' scrivo stato start
MachGroup.MyMachGroupM.SetProductionState(1)
MachGroup.dtStartTime = dtStart
@@ -142,6 +144,7 @@ Class MachManaging
' scrivo data end su Db pezzo
Dim dtEnd As DateTime = DateTime.Now()
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
' recupero gruppo di lavorazione del pezzo
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' recupero pezzo
@@ -156,6 +159,7 @@ Class MachManaging
If MachGroup.PartVMList.All(Function(x) x.nCALC_State >= 2) Then
' scrivo data end su Db barra
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
' scrivo stato end
MachGroup.MyMachGroupM.SetProductionState(2)
MachGroup.dtEndTime = dtEnd
@@ -0,0 +1,18 @@
<StackPanel x:Class="MainMenuV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Orientation="Horizontal"
IsEnabled="{Binding MainMenu_IsEnabled}">
<!--Barra superiore dei comandi-->
<UniformGrid Rows="1">
<RadioButton Content="{Binding Supervisor_Msg}"
IsChecked="{Binding Supervisor_IsChecked}"
Style="{StaticResource MainMenu_ToggleButton}"/>
<RadioButton Content="{Binding Configuration_Msg}"
IsChecked="{Binding Config_IsChecked}"
Style="{StaticResource MainMenu_ToggleButton}"/>
</UniformGrid>
</StackPanel>
@@ -0,0 +1,3 @@
Public Class MainMenuV
End Class
@@ -0,0 +1,211 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Imports EgtWPFLib5
Public Class MainMenuVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_MainMenu_IsEnabled As Boolean = True
Public ReadOnly Property MainMenu_IsEnabled As Boolean
Get
Return m_MainMenu_IsEnabled
End Get
End Property
Public Property Supervisor_IsChecked As Boolean
Get
Return m_SelPage = Pages.SUPERVISOR
End Get
Set(value As Boolean)
If value Then SelPage = Pages.SUPERVISOR
End Set
End Property
Public Property Config_IsChecked As Boolean
Get
Return m_SelPage = Pages.CONFIG
End Get
Set(value As Boolean)
If value Then SelPage = Pages.CONFIG
End Set
End Property
Private m_SelPage As Integer = -1
Public Property SelPage As Integer
Get
Return m_SelPage
End Get
Set(value As Integer)
' lancio selezione pagina con verifica file modificato
SetSelPage(value)
End Set
End Property
' funzione che permette di cambiare pagina
' bVerifyModification: se vero verifica modifiche su file e chiede di salvare
Friend Sub SetSelPage(Page As Pages, Optional bVerifyModification As Boolean = True)
Dim bOk As Boolean = True
' Esco dallo stato corrente
Select Case m_SelPage
Case Pages.SUPERVISOR
bOk = ExitSUPERVISOR(bVerifyModification)
Case Pages.CONFIG
bOk = ExitCONFIG()
End Select
If bOk Then
' Entro nel nuovo stato
m_SelPage = Page
Select Case m_SelPage
Case Pages.VIEW
' Map.refMachGroupPanelVM.SetMachGroupState(False)
InitSUPERVISOR()
'Map.refTopCommandBarVM.IsEnabled = False
Case Pages.CONFIG
InitCONFIG()
'Map.refMachGroupPanelVM.SetMachGroupState(False)
'Map.refCONFIGTabVM.InitCONFIGation()
'Map.refTopCommandBarVM.IsEnabled = False
End Select
End If
' aggiorno visualizzazione RadioButton
NotifyPropertyChanged(NameOf(Supervisor_IsChecked))
NotifyPropertyChanged(NameOf(Config_IsChecked))
End Sub
#Region "Messages"
Public ReadOnly Property Supervisor_Msg As String
Get
Return "Supervisor"
End Get
End Property
Public ReadOnly Property Optimizer_Msg As String
Get
Return EgtMsg(61831)
End Get
End Property
Public ReadOnly Property Configuration_Msg As String
Get
Return EgtMsg(61832)
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefMainMenuVM(Me)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub SetMainMenuIsEnabled(bIsEnabled As Boolean)
m_MainMenu_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
End Sub
Private Function InitSUPERVISOR() As Boolean
Map.refProjectVM.SetBottomPanel_Visibility(True)
Map.refProjectVM.SetLeftPanel_Visibility(True)
Map.refLeftPanelVM.UpdateView()
Map.refProjectVM.SetPartManager_Visibility(False)
Map.refProjectVM.SetFeatureManager_Visibility(True)
Map.refProjectVM.SetTopPanel_Visibility(False)
Map.refProjectVM.SetShowBeamPanel_Visibility(True)
Map.refProjectVM.SetProjManager_Visibility(True)
Map.refProjectVM.SetProdManager_Visibility(False)
Map.refProjectVM.NotifyAllPanelVisibility()
'' apro progetto proj
'If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
' If Map.refProjManagerVM.CurrProj.bReloadProject Then
' Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
' ' aggiorno le colonne in base al tipo progetto
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
' Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' Else
' Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
' Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
' End If
' DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
' ' aggiorno titolo
' Map.refMainWindowVM.UpdateTitle()
' Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
' Else
' ' verifico se il prod di provenienza ha piu' proj
' If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
' ' se si rigenero BTLStructure
' Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refProjManagerVM.CurrProj.nProjId))
' End If
' ' mostro tutti i pezzi
' Map.refShowBeamPanelVM.ShowAll()
' Map.refProjManagerVM.CurrProj.SetReloadProject(True)
' End If
' DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True)
'Else
' Map.refSceneHostVM.MainController.NewProject()
' Map.refProjectVM.BTLStructureVM = Nothing
' Map.refProjectVM.MachGroupPanelVM = Nothing
'End If
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
Return True
End Function
Private Function ExitSUPERVISOR(bVerifyModification As Boolean) As Boolean
''' verifico se progetto modificato, e chiedo se salvare
''If bVerifyModification Then
'' If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then
'' Return False
'' End If
''End If
Map.refProjectVM.SetBottomPanel_Visibility(False)
Map.refProjectVM.SetLeftPanel_Visibility(True)
Map.refProjectVM.SetPartManager_Visibility(False)
Map.refProjectVM.SetFeatureManager_Visibility(False)
Map.refProjectVM.SetTopPanel_Visibility(True)
Map.refProjectVM.SetShowBeamPanel_Visibility(False)
Map.refProjectVM.SetProjManager_Visibility(False)
Map.refProjectVM.SetProdManager_Visibility(True)
Return True
End Function
Private Function InitCONFIG() As Boolean
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
'' ricarico la lista delle colonne delle DataGrid in ConfigurationPage
'If Not IsNothing(Map.refConfigurationPageVM) Then Map.refConfigurationPageVM.LoadConfigDGColumns()
Return True
End Function
Private Function ExitCONFIG() As Boolean
'Map.refConfigurationPageVM.VerifyConfigPageModification()
'' resetto flag inserimento password
'Map.refConfigurationPageVM.bModifyMachParam = False
'' ricarico le EgtDataGrid del programma con le colonne customizzate
'Map.refFeatureListVM.FeatureColumns.Clear()
'GetPrivateProfileColumns(S_FEATURELIST, Map.refFeatureListVM.FeatureColumns)
'If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
' Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
'Else
' Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
' Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
'End If
Return True
End Function
#End Region ' METHODS
End Class
@@ -9,108 +9,33 @@
MinHeight="600" MinWidth="800"
AboutBoxCommand="{Binding AboutBox_Command}"
CloseCommand="{Binding CloseApplication_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<EgtWPFLib5:EgtCustomWindow.TitlePanel>
<EgtBEAMWALL:MainMenuV DataContext="{StaticResource MainMenuVM}"/>
</EgtWPFLib5:EgtCustomWindow.TitlePanel>
<Grid>
<Grid.RowDefinitions>
<!--<RowDefinition Height="Auto"/>-->
<RowDefinition Height="1*"/>
<!--<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>-->
</Grid.RowDefinitions>
<EgtBEAMWALL:ProjectV DataContext="{StaticResource ProjectVM}"/>
<!--Pannello principale -->
<DockPanel>
<!--<DataGrid Grid.Row="1"
ItemsSource="{Binding MachGroupList}"
SelectedItem="{Binding SelMachGroup}"
AutoGenerateColumns="False"
CanUserDeleteRows="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.Columns>
--><!--ID - Id gruppo--><!--
<DataGridTextColumn Binding="{Binding Name}"
Width="Auto"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="ID"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--Validità pezzo--><!--
<DataGridTemplateColumn Width="Auto">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border Background="{Binding Calc_Background}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
--><!--STARTCUT - Ritaglio iniziale--><!--
<DataGridTextColumn Binding="{Binding sStartCut}"
Width="65">
<DataGridTextColumn.Header>
<TextBlock Text="Ritaglio iniziale"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--W - Larghezza--><!--
<DataGridTextColumn Binding="{Binding dW}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="W"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--H - Altezza--><!--
<DataGridTextColumn Binding="{Binding dH}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="H"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--L - Lunghezza--><!--
<DataGridTextColumn Binding="{Binding dL}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="L"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--MAT - Materiale--><!--
<DataGridTextColumn Binding="{Binding dL}"
Width="1*"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="Materiale"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--% - % utilizzo--><!--
<DataGridTextColumn Binding="{Binding dUsage}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="% utilizzo"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
--><!--S - Scarti--><!--
<DataGridTextColumn Binding="{Binding dWaste}"
Width="65"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="Scarti"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
<!--StatusBar -->
<EgtBEAMWALL:StatusBarV DataContext="{StaticResource StatusBarVM}"
DockPanel.Dock="Bottom"/>
<!--Progetto corrente-->
<TabControl SelectedIndex="{Binding nSelTabPage}"
Padding="0"
Margin="0,-4,0,0">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem>
<EgtBEAMWALL:ProjectV DataContext="{StaticResource ProjectVM}"/>
</TabItem>
<TabItem>
<EgtBEAMWALL:ConfigurationPageV DataContext="{StaticResource ConfigurationPageVM}"/>
</TabItem>
</TabControl>
</DataGrid>-->
</Grid>
</DockPanel>
</EgtWPFLib5:EgtCustomWindow>
@@ -22,6 +22,15 @@ Public Class MainWindowVM
End Get
End Property
' proprietà che seleziona la giusta pagina del TabControl
Public Property nSelTabPage As Integer
Get
Return If(IsNothing(Map.refMainMenuVM.SelPage) OrElse Map.refMainMenuVM.SelPage = -1 OrElse Map.refMainMenuVM.SelPage = Pages.SUPERVISOR, 0, 1)
End Get
Set(value As Integer)
End Set
End Property
' Definizione comandi
Private m_cmdAboutBox As ICommand
Private m_cmdCloseApplication As ICommand
@@ -26,6 +26,7 @@
<!--<EgtBEAMWALL:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
<!--<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>-->
</EgtFloating:EgtFloatingTray>
@@ -153,5 +153,16 @@ Public Class ProjectVM
#End Region ' CONSTRUCTOR
Friend Sub ManageIsEnabled(bIsEnabled As Boolean)
'Map.refInstrumentPanelVM.SetInstrumentPanelIsEnabled(bIsEnabled)
Map.refCALCPanelVM.SetCalcPanelIsEnabled(bIsEnabled)
Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled)
'Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled)
Map.refSupervisorManagerVM.SetSupervisorManagerIsEnabled(bIsEnabled)
' aggiungere gestione colonne editabili delle tabelle
End Sub
End Class
@@ -0,0 +1,12 @@
<Window x:Class="RestartRawPartV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EgtBEAMWALL.Supervisor"
mc:Ignorable="d"
Title="RestartRawPartV" Height="450" Width="800">
<Grid>
</Grid>
</Window>
@@ -0,0 +1,3 @@
Public Class RestartRawPartV
End Class
@@ -0,0 +1,3 @@
Public Class RestartRawPartVM
End Class
@@ -0,0 +1,111 @@
Imports System.Runtime.InteropServices
Imports System.Threading
Imports EgtUILib
Imports EgtWPFLib5
Public Class MyStatusBarVM
Inherits EgtWPFLib5.StatusBarVM
' Funzioni di callback per output in interfaccia da LUA
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
Private m_bStopProgress As Boolean
Friend ReadOnly Property bStopProgress As Boolean
Get
Return m_bStopProgress
End Get
End Property
Public ReadOnly Property CurrMachine As String
Get
Return If(Not IsNothing(Map.refMachinePanelVM.SelectedMachine), Map.refMachinePanelVM.SelectedMachine.Name, "")
End Get
End Property
' Definizione comandi
Private m_cmdStopProgress As ICommand
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefMyStatusBarVM(Me)
' Installo funzione gestione eventi per lua
EgtSetProcessEvents(m_ProcEventsCallback)
' Installo funzione output testo su status per lua
EgtSetOutText(m_OutTextCallback)
End Sub
Friend Sub ResetStopProgress()
m_bStopProgress = False
End Sub
Public Function OutText(ByRef psText As IntPtr) As Boolean
' Assegno stringa
OutputMessage = (Marshal.PtrToStringUni(psText))
' Costringo ad aggiornare
UpdateUI()
Return True
End Function
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
' Se previsto, imposto progress
If nProg > 0 Then SetLoadingProgress(Math.Min(nProg, 100))
' Costringo ad aggiornare
UpdateUI()
' Eventuale attesa
Thread.Sleep(nPause)
' Ritorno eventuale stop
If m_bStopProgress Then
m_bStopProgress = False
Return 1
Else
Return 0
End If
End Function
Friend Sub StartLoading(sMessage As String, bIsStop As Boolean)
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(bIsStop)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(bIsStop)
Map.refMyStatusBarVM.SetOutputMessage(sMessage)
End Sub
Friend Sub EndLoading(sMessage As String, Optional nMessageTime As Integer = 3)
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sMessage, nMessageTime)
End Sub
Friend Sub RefreshMachName()
NotifyPropertyChanged(NameOf(CurrMachine))
End Sub
#Region "COMMANDS"
#Region "StopProgress"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property StopProgress_Command As ICommand
Get
If m_cmdStopProgress Is Nothing Then
m_cmdStopProgress = New Command(AddressOf StopProgress)
End If
Return m_cmdStopProgress
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub StopProgress(ByVal param As Object)
m_bStopProgress = True
End Sub
#End Region ' StopProgress
#End Region ' COMMANDS
End Class
@@ -0,0 +1,73 @@
<StatusBar x:Class="StatusBarV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{StaticResource Omag_LightGray}">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<!--Barra di caricamento-->
<StatusBarItem Grid.Column="0">
<ProgressBar Value="{Binding LoadingProgress}"
Height="20" Width="150"
Visibility="{Binding LoadingProgress_Visibility}"/>
</StatusBarItem>
<!--Bottone interruzione caricamento-->
<StatusBarItem Grid.Column="1">
<Button x:Name="StopLoadingBtn"
Command="{Binding StopProgress_Command}" Content="X"
IsEnabled="{Binding StopProgress_IsEnabled}"
Width="{Binding ActualHeight, ElementName=StopLoadingBtn}"
Visibility="{Binding StopProgress_IsVisible}"/>
</StatusBarItem>
<!--Stringa di output messaggi-->
<StatusBarItem Grid.Column="2">
<TextBlock Text="{Binding OutputMessage}"
Foreground="{Binding OutputMessage_Foreground}"/>
</StatusBarItem>
<!--Indica il tipo di punto notevole selezionato-->
<StatusBarItem Grid.Column="3">
<Button Content="{Binding SnapPointType}"
Background="{Binding SnapPointType_Background}"
Width="80"/>
</StatusBarItem>
<!--Indica la posizione del mouse quando è sulla scena-->
<StatusBarItem Grid.Column="4">
<TextBlock Text="{Binding CurrPos}"
TextAlignment="Right"
Foreground="{StaticResource Omag_Black}"
Width="250"/>
</StatusBarItem>
<!--Indica l'unità di misura-->
<StatusBarItem Grid.Column="5">
<TextBlock Text="{Binding MeasureUnit}"
Foreground="{StaticResource Omag_Black}"
Width="35"/>
</StatusBarItem>
<!--Indica la macchina corrente-->
<StatusBarItem Grid.Column="6">
<TextBlock Text="{Binding CurrMachine}"
Foreground="{StaticResource Omag_Black}"
Margin="0,0,5,0"/>
</StatusBarItem>
</StatusBar>
@@ -0,0 +1,3 @@
Public Class StatusBarV
End Class
@@ -4,6 +4,7 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False"
IsEnabled="{Binding SupervisorManager_IsEnabled}"
Style="{StaticResource ToolBar_EgtFloatingPanel}">
<!--Barra superiore dei comandi-->
@@ -11,6 +11,13 @@ Public Class SupervisorManagerVM
#Region "FIELDS & PROPERTIES"
Private m_SupervisorManager_IsEnabled As Boolean = True
Public ReadOnly Property SupervisorManager_IsEnabled As Boolean
Get
Return m_SupervisorManager_IsEnabled
End Get
End Property
Private m_CurrProd As ProdFileVM
Friend Property CurrProd As ProdFileVM
Get
@@ -72,6 +79,11 @@ Public Class SupervisorManagerVM
Return True
End Function
Friend Sub SetSupervisorManagerIsEnabled(bIsEnabled As Boolean)
m_SupervisorManager_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(SupervisorManager_IsEnabled))
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -148,8 +160,19 @@ Public Class SupervisorManagerVM
Next
' carico solo elementi passati al supervisore
Dim TempList As List(Of DataLayer.DatabaseModels.MachGroupModel) = DbControllers.m_MachGroupController.GetByProdSupervisor(Map.refSupervisorManagerVM.CurrProd.nProdId, m_SupervisorId)
For Each MachGroup In TempList
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroup.MachGroupId))
For Each DBMachGroup In TempList
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = DBMachGroup.MachGroupId)
' leggo dati da Db
MachGroup.dtStartTime = DBMachGroup.DtStart
MachGroup.dtEndTime = DBMachGroup.DtEnd
MachGroup.MyMachGroupM.SetProductionState(DBMachGroup.State)
For Each Part In MachGroup.PartVMList
Dim DBPart As PartModel = DbControllers.m_PartController.FindByPartId(Part.nPartId)
Part.dtStartTime = DBPart.DtStart
Part.dtEndTime = DBPart.DtEnd
Part.nProduction_State = DBPart.State
Next
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(MachGroup)
Next
Map.refProjectVM.SupervisorMachGroupPanelVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList))
m_bLoadingProd = False
@@ -24,9 +24,12 @@
<!--<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>-->
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
<EgtBEAMWALL:MachCommandMessagePanelVM x:Key="MachCommandMessagePanelVM"/>
<EgtBEAMWALL:MainMenuVM x:Key="MainMenuVM"/>
<EgtBEAMWALL:MyStatusBarVM x:Key="StatusBarVM"/>
<!--<EgtBEAMWALL:BottomPanelVM x:Key="BottomPanelVM"/>-->
<!--<EgtBEAMWALL:ConfigurationPageVM x:Key="ConfigurationPageVM"/>
<EgtBEAMWALL:TopPanelVM x:Key="TopPanelVM"/>
<EgtBEAMWALL:ConfigurationPageVM x:Key="ConfigurationPageVM"/>
<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
<!--<EgtBEAMWALL:TopPanelVM x:Key="TopPanelVM"/>
<EgtBEAMWALL:RawPartListVM x:Key="RawPartListVM"/>
<EgtBEAMWALL:OptimizePanelVM x:Key="OptimizePanelVM"/>-->
<!--<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
+41 -17
View File
@@ -3,11 +3,11 @@
Module Map
Private m_refMainWindowVM As MainWindowVM
'Private m_refMyStatusBarVM As MyStatusBarVM
Private m_refMyStatusBarVM As MyStatusBarVM
'Private m_refProjManagerVM As ProjManagerVM
Private m_refSupervisorManagerVM As SupervisorManagerVM
Private m_refProjectVM As ProjectVM
'Private m_refMainMenuVM As MainMenuVM
Private m_refMainMenuVM As MainMenuVM
Private m_refMachinePanelVM As MachinePanelVM
Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
Private m_refLeftPanelVM As LeftPanelVM
@@ -24,6 +24,8 @@ Module Map
'Private m_refMoveRawModeVM As MoveRawModeVM
'Private m_refSimulTabVM As SimulTabVM
Private m_refMachManaging As MachManaging
Private m_refCALCPanelVM As CALCPanelVM
Private m_refSupervisorMachGroupPanelVM As SupervisorMachGroupPanelVM
#Region "Get"
@@ -33,11 +35,11 @@ Module Map
End Get
End Property
'Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
' Get
' Return LibMap.refStatusBarVM
' End Get
'End Property
Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
Get
Return LibMap.refStatusBarVM
End Get
End Property
'Public ReadOnly Property refProjManagerVM As ProjManagerVM
' Get
@@ -68,11 +70,11 @@ Module Map
End Get
End Property
'Public ReadOnly Property refMainMenuVM As MainMenuVM
' Get
' Return m_refMainMenuVM
' End Get
'End Property
Public ReadOnly Property refMainMenuVM As MainMenuVM
Get
Return m_refMainMenuVM
End Get
End Property
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
Get
@@ -98,6 +100,18 @@ Module Map
End Get
End Property
Public ReadOnly Property refCALCPanelVM As CALCPanelVM
Get
Return m_refCALCPanelVM
End Get
End Property
Public ReadOnly Property refSupervisorMachGroupPanelVM As SupervisorMachGroupPanelVM
Get
Return m_refSupervisorMachGroupPanelVM
End Get
End Property
'Public ReadOnly Property refBottomPanelVM As BottomPanelVM
' Get
' Return m_refBottomPanelVM
@@ -180,7 +194,7 @@ Module Map
#Region "Set"
Friend Function SetRefStatusBarVM(StatusBarVM As StatusBarVM) As Boolean
Friend Function SetRefMyStatusBarVM(StatusBarVM As StatusBarVM) As Boolean
LibMap.SetRefStatusBarVM(StatusBarVM)
Return Not IsNothing(LibMap.refStatusBarVM)
End Function
@@ -200,10 +214,10 @@ Module Map
Return Not IsNothing(m_refProjectVM)
End Function
'Friend Function SetRefMainMenuVM(MainMenuVM As MainMenuVM) As Boolean
' m_refMainMenuVM = MainMenuVM
' Return Not IsNothing(m_refMainMenuVM)
'End Function
Friend Function SetRefMainMenuVM(MainMenuVM As MainMenuVM) As Boolean
m_refMainMenuVM = MainMenuVM
Return Not IsNothing(m_refMainMenuVM)
End Function
Friend Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
LibMap.SetRefSceneHostVM(SceneHostVM)
@@ -235,6 +249,16 @@ Module Map
Return Not IsNothing(m_refMachCommandMessagePanelVM)
End Function
Friend Function SetRefCALCPanelVM(CALCPanelVM As CALCPanelVM) As Boolean
m_refCALCPanelVM = CALCPanelVM
Return Not IsNothing(m_refCALCPanelVM)
End Function
Friend Function SetRefSupervisorMachGroupPanelVM(SupervisorMachGroupPanelVM As SupervisorMachGroupPanelVM) As Boolean
m_refSupervisorMachGroupPanelVM = SupervisorMachGroupPanelVM
Return Not IsNothing(m_refSupervisorMachGroupPanelVM)
End Function
'Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean
' m_refBottomPanelVM = BottomPanelVM
' Return Not IsNothing(m_refBottomPanelVM)
@@ -1,3 +1,582 @@
Public Class CALCPanelVM
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class CALCPanelVM
Inherits VMBase
Private m_CALCPanel_IsEnabled As Boolean = True
Public Property CALCPanel_IsEnabled As Boolean
Get
Return m_CALCPanel_IsEnabled
End Get
Set(value As Boolean)
m_CALCPanel_IsEnabled = value
End Set
End Property
' Definizione comandi
Private m_cmdVerify As ICommand
Private m_cmdVerifyAll As ICommand
Private m_cmdSimulate As ICommand
#Region "Messages"
Public ReadOnly Property Verify_ToolTip As String
Get
Return EgtMsg(61901)
End Get
End Property
Public ReadOnly Property Simulate_ToolTip As String
Get
Return EgtMsg(61902)
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTORS"
Sub New()
' imposto riferimento in Map
Map.SetRefCALCPanelVM(Me)
Core.CalcIntegration.SetMaxCamInstances(Map.refMainWindowVM.MainWindowM.GetMaxCamInstances())
AddHandler Core.CalcIntegration.Calc_ProcessResult, AddressOf Calc_ProcessResult
AddHandler Core.CalcIntegration.Calc_Ended, AddressOf Calc_Ended
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Sub SetCalcPanelIsEnabled(bIsEnabled As Boolean)
m_CALCPanel_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
End Sub
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
ProcessResults(e.m_Result)
End Sub
Private Sub Calc_Ended(sender As Object, e As CalcEndEventArgs)
If e.End_ <> CalcEndEventArgs.Results.OK Then
MessageBox.Show("Execution error (all processes are disabled)")
End If
Map.refProjectVM.ManageIsEnabled(True)
Map.refMyStatusBarVM.ResetStopProgress()
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
Dim BtlPath As String = Bar.sBarPath
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
Dim bErrors As Boolean = False
Dim nLastErr As Integer = 0
Dim sLastMsg As String = ""
Dim nCurrCutId As Integer = 0
Dim nTotTime As Integer = 0
If File.Exists(ResPath) Then
Dim ProcessResultList As New List(Of ProcessResult)
Dim nErr As Integer = 0
Dim sMsg As String = ""
Dim dRot As Double = 0
Dim nFall As Integer = 0
Dim dPartRot As Double = 0
Dim dTotRot As Double = 0
Dim cutId As Integer = 0
Dim taskId As Integer = 0
Dim prevCutId As Integer = GDB_ID.NULL
Dim currBTLPart As BTLPartVM = Nothing
Dim currPart As PartVM
Dim lines As String() = System.IO.File.ReadAllLines(ResPath)
For Each line As String In lines
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
cutId = 0
taskId = 0
ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
'End If
ElseIf Not String.IsNullOrWhiteSpace(line) AndAlso line <> "---" Then
sMsg = line
End If
Next
If ProcessResultList.Count > 0 Then
If Bar.nProgramPage = ProjectType.PROJ Then
' Inizializzo il pezzo in verifica
Dim BTLPart As BTLPartVM = GetBTLPartVMFromPartId(Bar.nBarId)
BTLPart.CalcPartUpdate(0, 0, "")
Else
' Inizializzo i pezzi del gruppo di lavoro in verifica
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcPartUpdate(0, 0, "")
Next
Machgroup.CalcMachGroupUpdate(0, 0, "")
End If
' Ciclo ...
Dim nCUTID As Integer = -1
Dim CurrBTLPartVM As BTLPartVM
Dim CurrPartVM As PartVM
Dim CurrMachgroupVM As MyMachGroupVM
Dim CurrBTLFeatureVM As BTLFeatureVM
For Each Line In ProcessResultList
' se necessario recupero part
If Line.nCUTID <> 0 Then
If Line.nCUTID <> nCUTID Then
nCUTID = Line.nCUTID
If Bar.nProgramPage = ProjectType.PROJ Then
' aggiorno nuovo pezzo
CurrBTLPartVM = GetBTLPartVMFromPartId(Line.nCUTID)
Else
' aggiorno nuovo pezzo
CurrPartVM = GetPartVMFromPartId(Line.nCUTID)
End If
End If
Else
' se CutId = 0
If Bar.nProgramPage = ProjectType.PROJ Then
' imposto unico pezzo presente
CurrBTLPartVM = GetBTLPartVMFromPartId(Bar.nBarId)
Else
' riporto errore barra
CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
End If
End If
' se necessario recupero feature
If Line.nTASKID <> 0 Then
If Bar.nProgramPage = ProjectType.PROJ Then
CurrBTLFeatureVM = GetBTLFeatureVMFromBTLPartId(CurrBTLPartVM, Line.nTASKID)
Else
CurrBTLFeatureVM = GetFeatureVMFromPartId(CurrPartVM, Line.nTASKID)
End If
Else
CurrBTLFeatureVM = Nothing
End If
Select Case Line.Type
Case ProcessResult.ProcessResultTypes.BAR
If Bar.nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Else
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.PART
If Bar.nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Else
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
If Bar.nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcFallUpdate(Line.nFALL)
Else
CurrPartVM.CalcFallUpdate(Line.nFALL)
End If
Case ProcessResult.ProcessResultTypes.TIME
If Bar.nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcTimeUpdate(Line.nTIME)
Else
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End If
End Select
Next
If Bar.nProgramPage = ProjectType.PROJ Then
' aggiorno il pezzo
Dim BTLPart As BTLPartVM = GetBTLPartVMFromPartId(Bar.nBarId)
BTLPart.CalcGlobalUpdate()
' lancio aggiornamento tempo su BTL
Map.refProjectVM.BTLStructureVM.CalcGlobalTime()
Else
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
' lancio aggiornamento tempo su MachgroupPanel
Map.refProjectVM.MachGroupPanelVM.CalcGlobalTime()
End If
End If
Else
bErrors = True
nLastErr = 25
sLastMsg = "Execution Error"
End If
End Sub
Private Shared Function GetVal(sText As String, sKey As String) As Integer?
Dim sParts As String() = sText.Split("="c)
If String.Compare(sParts(0), sKey) <> 0 Then Return Nothing
Dim nVal As Integer = Nothing
If Not Integer.TryParse(sParts(1), nVal) Then
Return Nothing
Else
Return nVal
End If
End Function
Private Shared Sub ProcessResultAdd(PRList As List(Of ProcessResult), NewPR As ProcessResult, Bar As Bar)
Dim Prev As ProcessResult
Select Case NewPR.Type
Case ProcessResult.ProcessResultTypes.BAR
If Bar.nProgramPage = ProjectType.PROJ Then
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART)
Else
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.BAR)
End If
Case ProcessResult.ProcessResultTypes.PART
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART AndAlso x.nCUTID = NewPR.nCUTID)
Case ProcessResult.ProcessResultTypes.TASKID
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.TASKID AndAlso x.nCUTID = NewPR.nCUTID AndAlso x.nTASKID = NewPR.nTASKID)
End Select
If IsNothing(Prev) Then
PRList.Add(NewPR)
ElseIf NewPR.nERR = 22 Or (NewPR.nERR > 0 And Prev.nERR <= 0) Or (NewPR.nERR < 0 And Prev.nERR = 0) Then
If NewPR.dROT = 0 And Prev.dROT <> NewPR.dROT Then
NewPR.SetROT(Prev.dROT)
End If
PRList.Remove(Prev)
PRList.Add(NewPR)
ElseIf Prev.dROT = 0 And Prev.dROT <> NewPR.dROT Then
Prev.SetROT(NewPR.dROT)
End If
End Sub
Private Shared Function GetBTLPartVMFromPartId(nPartId As Integer) As BTLPartVM
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
End Function
Private Shared Function GetPartVMFromPartId(nPartId As Integer) As PartVM
For Each MachGroupVM As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim PartVM As PartVM = MachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
If Not IsNothing(PartVM) Then Return PartVM
Next
End Function
Private Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
Return Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
End Function
Private Shared Function GetBTLFeatureVMFromBTLPartId(BTLPartVM As BTLPartVM, nFeatureId As Integer) As Core.BTLFeatureVM
Return BTLPartVM.BTLFeatureVMList.FirstOrDefault(Function(x) x.nFeatureId = nFeatureId)
End Function
Private Shared Function GetFeatureVMFromPartId(PartVM As PartVM, nFeatureId As Integer) As Core.BTLFeatureVM
Return PartVM.FeatureVMList.FirstOrDefault(Function(x) x.nFeatureId = nFeatureId)
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "Verify"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Verify_Command As ICommand
Get
If m_cmdVerify Is Nothing Then
m_cmdVerify = New Command(AddressOf Verify)
End If
Return m_cmdVerify
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Verify()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = Map.refProjManagerVM.CurrProj.nType
Else
ProjType = Map.refProdManagerVM.CurrProd.nType
End If
Dim BarList() As EgtBEAMWALL.Core.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(Map.refMachGroupPanelVM.SelectedMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refMachGroupPanelVM.SelectedMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
#End Region ' Verify
#Region "VerifyAll"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property VerifyAll_Command As ICommand
Get
If m_cmdVerifyAll Is Nothing Then
m_cmdVerifyAll = New Command(AddressOf VerifyAll)
End If
Return m_cmdVerifyAll
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = Map.refProjManagerVM.CurrProj.nType
Else
ProjType = Map.refProdManagerVM.CurrProd.nType
End If
Dim BarList() As EgtBEAMWALL.Core.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
Dim TempBarList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1) As EgtBEAMWALL.Core.Bar
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(PartIndex) = Bar
Next
BarList = TempBarList
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
#End Region ' VerifyAll
#Region "Simulate"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Simulate()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = Map.refProjManagerVM.CurrProj.nType
Else
ProjType = Map.refProdManagerVM.CurrProd.nType
End If
Dim BarList() As EgtBEAMWALL.Core.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState <> Core.CalcStates.OK Then
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(Map.refMachGroupPanelVM.SelectedMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refMachGroupPanelVM.SelectedMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
#End Region ' Simulate
#End Region ' COMMANDS
End Class
@@ -1,9 +1,9 @@
<EgtFloating:EgtFloatingPanel x:Class="CalcPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<Button Content="V"
FontSize="20"
@@ -11,16 +11,16 @@
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding InstrumentPanel_IsEnabled}">
IsEnabled="{Binding CALCPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
<Button Content="V All"
<Button Content="Vall"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding InstrumentPanel_IsEnabled}">
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
<Button Content="S"
@@ -29,7 +29,7 @@
ToolTip="{Binding Simulate_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding InstrumentPanel_IsEnabled}">
IsEnabled="{Binding CALCPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
@@ -115,8 +115,9 @@
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip">
<HintPath>..\..\..\EgtProg\DllD32\Ionic.Zip.dll</HintPath>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EgtProg\EgtBEAMWALL\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.10.9\lib\net40\MySql.Data.dll</HintPath>
@@ -31,25 +31,6 @@
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
<Button Content="V"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Verify_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding InstrumentPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
<Button Content="S"
FontSize="20"
FontWeight="Light"
ToolTip="{Binding Simulate_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding InstrumentPanel_IsEnabled}">
<!--<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>-->
</Button>
<ToggleButton Content="{Binding Statistics_Msg}"
Style="{StaticResource ToolBar_TextToggleButton}"
IsChecked="{Binding Statistics_IsChecked}">
@@ -64,8 +64,6 @@ Public Class MyInstrumentPanelVM
' Definizione comandi
Private m_cmdData As ICommand
Private m_cmdChangeParameter As ICommand
Private m_cmdVerify As ICommand
Private m_cmdSimulate As ICommand
Private m_cmdStatistics As ICommand
#Region "Messages"
@@ -76,18 +74,6 @@ Public Class MyInstrumentPanelVM
End Get
End Property
Public ReadOnly Property Verify_ToolTip As String
Get
Return EgtMsg(61901)
End Get
End Property
Public ReadOnly Property Simulate_ToolTip As String
Get
Return EgtMsg(61902)
End Get
End Property
Public ReadOnly Property Statistics_Msg As String
Get
Return EgtMsg(61923)
@@ -245,205 +231,6 @@ Public Class MyInstrumentPanelVM
#End Region ' ChangeParameter
#Region "Verify"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Verify_Command As ICommand
Get
If m_cmdVerify Is Nothing Then
m_cmdVerify = New Command(AddressOf Verify)
End If
Return m_cmdVerify
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Verify()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
Dim Calc As New CalcIntegration
Dim BarList() As CalcIntegration.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Then
Dim TempBarList As New List(Of CalcIntegration.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New CalcIntegration.Bar With {.nBarId = CurrPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
ElseIf Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As CalcIntegration.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
Calc.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Then
Dim TempBarList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1) As CalcIntegration.Bar
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
Dim Bar As New CalcIntegration.Bar With {.nBarId = CurrMachGroup.Id,
.nBarType = ProjectType.PROD,
.bBarOk = True}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(PartIndex) = Bar
Next
BarList = TempBarList
ElseIf Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim TempBarList(0) As CalcIntegration.Bar
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refMachGroupPanelVM.SelectedMachGroup.Id,
.nBarType = ProjectType.PROD,
.bBarOk = True}
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdType.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio calcolo
Calc.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
#End Region ' Verify
#Region "Simulate"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Simulate()
Dim Calc As New CalcIntegration
Dim BarList() As CalcIntegration.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As CalcIntegration.Bar
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState <> Core.CalcStates.OK Then
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists( sBTLPartFilePath) Then File.Delete( sBTLPartFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio simulazione
Calc.Run(BarList, Map.refProjManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim TempBarList(0) As CalcIntegration.Bar
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refMachGroupPanelVM.SelectedMachGroup.Id,
.nBarType = ProjectType.PROD,
.bBarOk = True,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists( sMachGroupFilePath) Then File.Delete( sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return
End If
' disabilito interfaccia
Map.refProjectVM.ManageIsEnabled(False)
' lancio simulazione
Calc.Run(BarList, Map.refProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
End Sub
#End Region ' Simulate
#End Region ' COMMANDS
End Class
@@ -68,6 +68,7 @@ Public Class BeamMachGroupVM
End Sub
Private Sub ReadProductionState()
If IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProdManagerVM.CurrProd.nProdId) Then Return
Dim MachGroupModel As MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProdManagerVM.CurrProd.nProdId, Id)
If Not IsNothing(MachGroupModel) Then
If Not String.IsNullOrEmpty(MachGroupModel.SupervisorId) Then
@@ -33,6 +33,7 @@
Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
</EgtFloating:EgtFloatingTray>
@@ -169,6 +169,7 @@
Friend Sub ManageIsEnabled(bIsEnabled As Boolean)
Map.refInstrumentPanelVM.SetInstrumentPanelIsEnabled(bIsEnabled)
Map.refCALCPanelVM.SetCalcPanelIsEnabled(bIsEnabled)
Map.refMainMenuVM.SetMainMenuIsEnabled(bIsEnabled)
Map.refPartManagerVM.SetPartManagerIsEnabled(bIsEnabled)
Map.refLeftPanelVM.SetLeftPanelIsEnabled(bIsEnabled)
@@ -20,6 +20,7 @@
<EgtBEAMWALL:ShowBeamPanelVM x:Key="ShowBeamPanelVM"/>
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
<EgtBEAMWALL:MyInstrumentPanelVM x:Key="InstrumentPanelVM"/>
<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
<EgtBEAMWALL:MachinePanelVM x:Key="MachinePanelVM"/>
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
+14 -1
View File
@@ -25,6 +25,7 @@ Module Map
Private m_refInstrumentPanelVM As InstrumentPanelVM
Private m_refTopPanelVM As TopPanelVM
Private m_refOptimizePanelVM As OptimizePanelVM
Private m_refCALCPanelVM As CALCPanelVM
'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
'Private m_refRawPartTabVM As RawPartTabVM
'Private m_refNestingTabVM As NestingTabVM
@@ -178,6 +179,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refCALCPanelVM As CALCPanelVM
Get
Return m_refCALCPanelVM
End Get
End Property
'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
' Get
' Return m_refOpenProjectFileDialogVM
@@ -345,6 +352,11 @@ Module Map
Return Not IsNothing(m_refOptimizePanelVM)
End Function
Friend Function SetRefCALCPanelVM(CALCPanelVM As CALCPanelVM) As Boolean
m_refCALCPanelVM = CALCPanelVM
Return Not IsNothing(m_refCALCPanelVM)
End Function
'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
' Return Not IsNothing(m_refOpenProjectFileDialogVM)
@@ -413,7 +425,8 @@ Module Map
Not IsNothing(m_refFreeContourManagerVM) AndAlso Not IsNothing(m_refFreeContourInputVM) AndAlso
Not IsNothing(m_refInstrumentPanelVM) AndAlso Not IsNothing(m_refTopPanelVM) AndAlso
Not IsNothing(m_refPartManagerVM) AndAlso Not IsNothing(m_refOptimizePanelVM) AndAlso
Not IsNothing(m_refShowBeamPanelVM) AndAlso LibMap.EndInit()
Not IsNothing(m_refShowBeamPanelVM) AndAlso Not IsNothing(m_refCALCPanelVM) AndAlso
LibMap.EndInit()
End Function
#End Region ' Init
+18
View File
@@ -13,40 +13,58 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgtBEAMWALL.Core", "EgtBEAM
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.ActiveCfg = Debug|x64
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.Build.0 = Debug|x64
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.ActiveCfg = Debug|x86
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.Build.0 = Debug|x86
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|Any CPU.Build.0 = Release|Any CPU
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.ActiveCfg = Release|x64
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.Build.0 = Release|x64
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.ActiveCfg = Release|x86
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.Build.0 = Release|x86
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.ActiveCfg = Debug|x64
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.Build.0 = Debug|x64
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.ActiveCfg = Debug|x86
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.Build.0 = Debug|x86
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|Any CPU.Build.0 = Release|Any CPU
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.ActiveCfg = Release|x64
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.Build.0 = Release|x64
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.ActiveCfg = Release|x86
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.Build.0 = Release|x86
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.ActiveCfg = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.Build.0 = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.ActiveCfg = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.Build.0 = Debug|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|Any CPU.Build.0 = Release|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.ActiveCfg = Release|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.Build.0 = Release|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.ActiveCfg = Release|Any CPU
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.Build.0 = Release|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.ActiveCfg = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.Build.0 = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.ActiveCfg = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.Build.0 = Debug|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|Any CPU.Build.0 = Release|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.ActiveCfg = Release|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.Build.0 = Release|Any CPU
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x86.ActiveCfg = Release|Any CPU
+35
View File
@@ -0,0 +1,35 @@
Imports EgtBEAMWALL.Core.ConstMachComm
Module MachCommConst
Public Enum PVars As Integer
PROD = 0
MACHGROUP = 1
PART = 2
STATE = 3
End Enum
' stati pezzo
Public Enum PartState As Integer
NULL = 0
START = 1
END_ = 2
End Enum
Public Delegate Sub ResultCallbackDlg(CommandType As CommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Params As String)
Public Delegate Sub CloseCallbackDlg(ByRef bCancel As Boolean)
Public Delegate Sub UpdateCallbackDlg(Param As String, Params As String)
Public Delegate Sub AlarmCallbackDlg(ByVal AlarmOperation As Integer, ByVal AlarmType As Integer, ByVal AlarmMessage As String, ByVal AlarmCode As String, ByVal AlarmDateTime As String)
Public Delegate Sub AxisCoordinatesCallbackDlg(ByVal AxisValue As Double, ByVal AxisIndex As Integer)
Public Delegate Sub OpStateCallbackDlg(ByVal newOpState As ISOCNC.Remoting.MachineOperatingState)
Public Delegate Sub ReadVarCallbackDlg(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String, VarType As Integer)
Friend m_ResultCallbackDlg As ResultCallbackDlg
Friend m_CloseCallbackDlg As CloseCallbackDlg
Friend m_UpdateCallbackDlg As UpdateCallbackDlg
Friend m_AlarmCallbackDlg As AlarmCallbackDlg
Friend m_AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg
Friend m_OpStateCallbackDlg As OpStateCallbackDlg
Friend m_ReadVarCallbackDlg As ReadVarCallbackDlg
End Module
+13
View File
@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
+35
View File
@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' 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
<Assembly: AssemblyTitle("TPAComm")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("TPAComm")>
<Assembly: AssemblyCopyright("Copyright © 2021")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("96833c20-2221-4ba9-9d8d-9c7fb47051f0")>
' 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:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
+62
View File
@@ -0,0 +1,62 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
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.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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("TPAComm.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
resourceCulture = value
End Set
End Property
End Module
End Namespace
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+73
View File
@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.TPAComm.My.MySettings
Get
Return Global.TPAComm.My.MySettings.Default
End Get
End Property
End Module
End Namespace
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+218
View File
@@ -0,0 +1,218 @@
Imports EgtBEAMWALL.Core.ConstMachComm
Imports EgtUILib
Imports EgtWPFLib5
Imports ISOCNC.Remoting
Public Class RWVariableManager
Private m_Tpa As TPAComm = Nothing
Friend ReadOnly Property Tpa As TPAComm
Get
Return m_Tpa
End Get
End Property
Private m_Proxy_VariableCommandExecutedEventHandler As New VariableCommandExecutedEventHandler(AddressOf RemoteObject_VariableCommandExecuted)
' lock per Synclock
Private m_CopyLock As New Object
Private m_ReadLock As New Object
' lista variabili in lettura
Private Shared m_ReadingVars(19) As CommVar
Public Shared ReadOnly Property ReadingVars As CommVar()
Get
Return m_ReadingVars
End Get
End Property
' lista variabili lette
Public Shared m_ReadedVars(19) As String
Protected Sub New()
End Sub
Friend Sub OnDispose()
RemoveHandler m_Tpa.eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
'RemoveHandler m_Tpa.MachManaging.Timer.Tick, AddressOf Timer_Tick
End Sub
'Friend Sub Timer_Tick(sender As Object, e As EventArgs)
' ' leggo tutte le variabili
' RefreshAllVars()
'End Sub
Friend Shared Function CreateRWVariableManager(Tpa As TPAComm)
Dim NewRWVariableManager As New RWVariableManager
NewRWVariableManager.m_Tpa = Tpa
AddHandler NewRWVariableManager.m_Tpa.eventProxy.VariableCommandExecuted, NewRWVariableManager.m_Proxy_VariableCommandExecutedEventHandler
Return NewRWVariableManager
End Function
Public Sub RefreshAllVars()
EgtOutLog("RefreshAllVars")
For Each Var In m_ReadingVars
' rileggo solo variabili continue
If Not IsNothing(Var) AndAlso Var.sType = CommVar.CommVarTypes.CONTINUOUS Then IntRefreshVar(Var.sAddress)
Next
End Sub
Public Shared Function InitVar(Name As String, Address As String, Type As CommVar.CommVarTypes) As Integer
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
m_ReadingVars(Index) = New CommVar(Name, Address, Type)
Return Index
End Function
Public Sub RefreshVar(Name As String)
Dim Var As CommVar = GetReadVarFromName(Name)
Var.ResetReading()
IntRefreshVar(Var.sAddress)
End Sub
Public Sub WriteVar(Name As String, Value As String)
IntWriteVar(GetReadVarFromName(Name).sAddress, Value)
End Sub
Private Sub IntRefreshVar(Address As String)
Tpa.remObject.SetVariableCommand(ISOCNC.Remoting.VariableCommands.ReadVar, Address, "")
End Sub
Private Sub IntWriteVar(Address As String, Value As String)
Tpa.remObject.SetVariableCommand(ISOCNC.Remoting.VariableCommands.WriteVar, Address, Value)
End Sub
Public Sub ReadVar(Name As String, ByRef Value As String)
Value = m_ReadedVars(GetIndexFromName(Name))
End Sub
Public Sub ReadVar(Name As String, ByRef Value As Integer)
Integer.TryParse(m_ReadedVars(GetIndexFromName(Name)), Value)
End Sub
Public Sub ReadVar(Name As String, ByRef Value As Double)
Value = StringToDouble(m_ReadedVars(GetIndexFromName(Name)), 5)
End Sub
Private Shared Function GetIndexFromName(Name As String) As Integer
Return Array.FindIndex(m_ReadingVars, Function(x) If(Not IsNothing(x), x.sName = Name, False))
End Function
Friend Shared Function GetReadVarFromName(Name As String) As CommVar
Return m_ReadingVars(GetIndexFromName(Name))
End Function
Private Shared Function GetIndexFromAddress(Address As String) As Integer
Return Array.FindIndex(m_ReadingVars, Function(x) If(Not IsNothing(x), x.sAddress = Address, False))
End Function
Friend Shared Function GetReadVarFromAddress(Address As String) As CommVar
Return m_ReadingVars(GetIndexFromAddress(Address))
End Function
Friend Shared Function GetReadVarNameFromAddress(Address As String) As String
Dim Var As CommVar = m_ReadingVars.FirstOrDefault(Function(x) If(Not IsNothing(x), x.sAddress = Address, False))
Return If(Not IsNothing(Var), Var.sName, "")
End Function
Private Sub UpdateContinuousVars()
Dim bReaded As Boolean = True
For Each Var In m_ReadingVars
If Not IsNothing(Var) AndAlso Var.sType = CommVar.CommVarTypes.CONTINUOUS AndAlso Not Var.bReaded Then
bReaded = False
Exit For
End If
Next
' se lette tutte
If bReaded Then
' aggiorno variabili
SyncLock m_CopyLock
For VarIndex = 0 To m_ReadingVars.Count - 1
If Not IsNothing(m_ReadingVars(VarIndex)) Then
m_ReadedVars(VarIndex) = m_ReadingVars(VarIndex).sValue
End If
Next
End SyncLock
End If
End Sub
Friend Sub UpdateVar(CommandExecutedCorrectly As Boolean, VarName As String, VarValue As String, VarType As Integer)
If CommandExecutedCorrectly Then
Dim Var As CommVar = GetReadVarFromAddress(VarName)
If Not IsNothing(Var) Then
'Dim bChangedVal As Boolean = ()
Var.SetValue(VarValue)
' se variabile ripetitiva lancio update variabili ripetitive
If Var.sType = CommVar.CommVarTypes.CONTINUOUS Then
EgtOutLog(CommandExecutedCorrectly & " . " & VarName & " . " & VarValue)
EgtOutLog(Var.sName & " . " & Var.sAddress & " . " & Var.sValue & " . " & Var.bReaded)
UpdateContinuousVars()
Else
m_ReadVarCallbackDlg(CommandExecutedCorrectly, VarName, VarValue, VarType)
End If
End If
End If
End Sub
Private Sub RemoteObject_VariableCommandExecuted(ByVal executedCommand As Integer, ByVal commandExecutedCorrectly As Boolean, ByVal varName As String, ByVal varValue As String, ByVal varType As Integer)
' riporto valore variabile su array
Select Case executedCommand
Case VariableCommands.Error
Case VariableCommands.NotExecuted
Case VariableCommands.ReadVar
UpdateVar(commandExecutedCorrectly, varName, varValue, varType)
Case VariableCommands.WriteVar
m_ResultCallbackDlg(CommandTypes.WRITE, CommandStates.OK, ResultTypes.RESULT, "")
Case VariableCommands.ReadAxis
Case VariableCommands.ReadAny
End Select
End Sub
End Class
Public Class CommVar
Public Enum CommVarTypes As Integer
ONETIME
CONTINUOUS
End Enum
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_sAddress As String
Public ReadOnly Property sAddress As String
Get
Return m_sAddress
End Get
End Property
Private m_nType As CommVarTypes
Public ReadOnly Property sType As CommVarTypes
Get
Return m_nType
End Get
End Property
Private m_sValue As String
Public ReadOnly Property sValue As String
Get
Return m_sValue
End Get
End Property
Public Sub SetValue(Value As String)
m_sValue = Value
m_bReaded = True
End Sub
Private m_bReaded As Boolean
Public ReadOnly Property bReaded As Boolean
Get
Return m_bReaded
End Get
End Property
Sub New(Name As String, Address As String, Type As CommVarTypes)
m_sName = Name
m_sAddress = Address
m_nType = Type
End Sub
Friend Sub ResetReading()
m_bReaded = False
End Sub
End Class
+244
View File
@@ -0,0 +1,244 @@
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Ipc
Imports System.Security.Permissions
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows
Imports ISOCNC.Remoting
Class TPAComm
' creo classe di gestione variabili
Private m_RWVariableManager As RWVariableManager
Friend ReadOnly Property RWVariableManager As RWVariableManager
Get
Return m_RWVariableManager
End Get
End Property
Private m_MachManaging As MachManaging
Friend ReadOnly Property MachManaging As MachManaging
Get
Return m_MachManaging
End Get
End Property
Private _axesVal As Double() = New Double(23) {}
Private _cmdActive As Integer = 0
Private m_opState As ISOCNC.Remoting.MachineOperatingState = ISOCNC.Remoting.MachineOperatingState.Unspecified
Public ReadOnly Property opState As ISOCNC.Remoting.MachineOperatingState
Get
Return m_opState
End Get
End Property
Private _remObject As ISOCNC.Remoting_Server
Public ReadOnly Property remObject As ISOCNC.Remoting_Server
Get
Return _remObject
End Get
End Property
Private serverURI As String = "ipc://localhost:9090/IRemoteObject.rem"
Private m_eventProxy As ISOCNC.Remoting.EventProxyManager
Friend ReadOnly Property eventProxy As ISOCNC.Remoting.EventProxyManager
Get
Return m_eventProxy
End Get
End Property
Private _rpc As Integer
Private _prgCount As Integer
Private _prgAtIndex As String
Private _prgList As String()
Private _prgListUpdated As Boolean
Private _errCycle As String
Private _iso As String
Private _message As String
Private _errSystem As String
Private m_Proxy_CommandExecutedEventHandler As New CommandExecutedEventHandler(AddressOf RemoteObject_CommandExecuted)
Private m_Proxy_ServerErrorEventHandler As New ServerErrorEventHandler(AddressOf RemoteObject_ServerError)
Private m_Proxy_AxesCoordinatesUpdateEventHandler As New AxesCoordinatesUpdateEventHandler(AddressOf RemoteObject_AxisCoordinatesUpdate)
Private m_Proxy_OpStateUpdateEventHandler As New OpStateUpdateEventHandler(AddressOf RemoteObject_OpStateUpdate)
Private m_Proxy_AlarmNotificationEventHandler As New AlarmNotificationEventHandler(AddressOf RemoteObject_AlarmNotification)
Private m_Proxy_ListInfoEventHandler As New ListInfoEventHandler(AddressOf RemoteObject_ListInfoResponse)
Private m_Proxy_RPCUpdateEventHandler As New RPCUpdateEventHandler(AddressOf RemoteObject_RPCUpdate)
Private m_Proxy_VariableCommandExecutedEventHandler As New VariableCommandExecutedEventHandler(AddressOf RemoteObject_VariableCommandExecuted)
Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
Private m_Rem_CommandExecutedEventHandler As CommandExecutedEventHandler
Private m_Rem_ServerErrorEventHandler As ServerErrorEventHandler
Private m_Rem_AxesCoordinatesUpdateEventHandler As AxesCoordinatesUpdateEventHandler
Private m_Rem_OpStateUpdateEventHandler As OpStateUpdateEventHandler
Private m_Rem_AlarmNotificationEventHandler As AlarmNotificationEventHandler
Private m_Rem_ListInfoEventHandler As ListInfoEventHandler
Private m_Rem_RPCUpdateEventHandler As RPCUpdateEventHandler
Private m_Rem_VariableCommandExecutedEventHandler As VariableCommandExecutedEventHandler
<SecurityPermission(SecurityAction.Demand)>
Public Sub New(Machmanaging As MachManaging)
m_MachManaging = Machmanaging
Dim properties As System.Collections.Hashtable = New System.Collections.Hashtable()
properties("name") = "remotingClient"
properties("priority") = "20"
properties("portName") = "67"
Dim clientProv As BinaryClientFormatterSinkProvider = New BinaryClientFormatterSinkProvider()
Dim serverProv As BinaryServerFormatterSinkProvider = New BinaryServerFormatterSinkProvider()
serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim channel As IpcChannel = New IpcChannel(properties, clientProv, serverProv)
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel, False)
Dim remoteType As System.Runtime.Remoting.WellKnownClientTypeEntry = New System.Runtime.Remoting.WellKnownClientTypeEntry(GetType(ISOCNC.Remoting_Server), serverURI)
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType(remoteType)
Dim objectUri As String
Dim messageSink As System.Runtime.Remoting.Messaging.IMessageSink = channel.CreateMessageSink("ipc://localhost:9090/IRemoteObject.rem", Nothing, objectUri)
Console.WriteLine("The URI of the message sink is {0}.", objectUri)
If messageSink IsNot Nothing Then
Console.WriteLine("The type of the message sink is {0}.", messageSink.[GetType]().ToString())
End If
m_eventProxy = New ISOCNC.Remoting.EventProxyManager()
AddHandler m_eventProxy.CommandExecuted, m_Proxy_CommandExecutedEventHandler
AddHandler m_eventProxy.ServerError, m_Proxy_ServerErrorEventHandler
AddHandler m_eventProxy.AxisCoordinatesUpdate, m_Proxy_AxesCoordinatesUpdateEventHandler
AddHandler m_eventProxy.OpStateUpdate, m_Proxy_OpStateUpdateEventHandler
AddHandler m_eventProxy.AlarmNotification, m_Proxy_AlarmNotificationEventHandler
AddHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
AddHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
AddHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
_remObject = CType(Activator.GetObject(GetType(ISOCNC.Remoting_Server), serverURI), ISOCNC.Remoting_Server)
Try
m_Rem_CommandExecutedEventHandler = New CommandExecutedEventHandler(AddressOf m_eventProxy.LocallyHandleCommandExecuted)
m_Rem_ServerErrorEventHandler = New ServerErrorEventHandler(AddressOf m_eventProxy.LocallyHandleServerError)
m_Rem_AxesCoordinatesUpdateEventHandler = New AxesCoordinatesUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleAxisCoordinatesUpdate)
m_Rem_OpStateUpdateEventHandler = New OpStateUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleOpStateUpdate)
m_Rem_AlarmNotificationEventHandler = New AlarmNotificationEventHandler(AddressOf m_eventProxy.LocallyHandleAlarmNotification)
m_Rem_ListInfoEventHandler = New ListInfoEventHandler(AddressOf m_eventProxy.LocallyHandleListInfo)
m_Rem_RPCUpdateEventHandler = New RPCUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleRPCUpdate)
m_Rem_VariableCommandExecutedEventHandler = New VariableCommandExecutedEventHandler(AddressOf m_eventProxy.LocallyHandleVariableCommandExecuted)
AddHandler _remObject.CommandExecuted, m_Rem_CommandExecutedEventHandler
AddHandler _remObject.ServerError, m_Rem_ServerErrorEventHandler
AddHandler _remObject.AxisCoordinatesUpdate, m_Rem_AxesCoordinatesUpdateEventHandler
AddHandler _remObject.OpStateUpdate, m_Rem_OpStateUpdateEventHandler
AddHandler _remObject.AlarmNotification, m_Rem_AlarmNotificationEventHandler
AddHandler _remObject.ListInfoResponse, m_Rem_ListInfoEventHandler
AddHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler
AddHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler
Catch ex As System.Runtime.Remoting.RemotingException
Dim dR As MessageBoxResult = MessageBox.Show(ex.Message)
End Try
' creo classe che gestisce variabili
m_RWVariableManager = RWVariableManager.CreateRWVariableManager(Me)
End Sub
Friend Sub OnDispose()
RemoveHandler _remObject.CommandExecuted, m_Rem_CommandExecutedEventHandler
RemoveHandler _remObject.ServerError, m_Rem_ServerErrorEventHandler
RemoveHandler _remObject.AxisCoordinatesUpdate, m_Rem_AxesCoordinatesUpdateEventHandler
RemoveHandler _remObject.OpStateUpdate, m_Rem_OpStateUpdateEventHandler
RemoveHandler _remObject.AlarmNotification, m_Rem_AlarmNotificationEventHandler
RemoveHandler _remObject.ListInfoResponse, m_Rem_ListInfoEventHandler
RemoveHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler
RemoveHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler
RemoveHandler m_eventProxy.CommandExecuted, m_Proxy_CommandExecutedEventHandler
RemoveHandler m_eventProxy.ServerError, m_Proxy_ServerErrorEventHandler
RemoveHandler m_eventProxy.AxisCoordinatesUpdate, m_Proxy_AxesCoordinatesUpdateEventHandler
RemoveHandler m_eventProxy.OpStateUpdate, m_Proxy_OpStateUpdateEventHandler
RemoveHandler m_eventProxy.AlarmNotification, m_Proxy_AlarmNotificationEventHandler
RemoveHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
RemoveHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
RemoveHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
End Sub
Private Sub RemoteObject_OpStateUpdate(ByVal newOpState As ISOCNC.Remoting.MachineOperatingState)
' resetto stato pending iniziale
If Map.refMachManaging.StartPending AndAlso newOpState = MachineOperatingState.Pending Then
MachManaging.ResetStartPending()
End If
m_opState = newOpState
m_OpStateCallbackDlg(newOpState)
End Sub
Private Sub RemoteObject_CommandExecuted(ByVal executedCommand As Integer)
Select Case executedCommand
Case CInt(ISOCNC.Remoting.Commands.NoCommand)
Case CInt(ISOCNC.Remoting.Commands.[End])
m_ResultCallbackDlg(CommandTypes.RESET, CommandStates.OK, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.[Error])
m_ResultCallbackDlg(CommandTypes.ERROR_, CommandStates.ERROR_, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.MDI_End)
Case CInt(ISOCNC.Remoting.Commands.MDI_Start)
Case CInt(ISOCNC.Remoting.Commands.MDI_Stop)
Case CInt(ISOCNC.Remoting.Commands.SetPoint)
m_ResultCallbackDlg(CommandTypes.SETPOINT, CommandStates.OK, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.Start)
m_ResultCallbackDlg(CommandTypes.START, CommandStates.OK, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.[Step])
m_ResultCallbackDlg(CommandTypes.STEP_, CommandStates.OK, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.[Stop])
m_ResultCallbackDlg(CommandTypes.STOP_, CommandStates.OK, ResultTypes.RESULT, "")
Case CInt(ISOCNC.Remoting.Commands.Start_Program_Soft)
m_ResultCallbackDlg(CommandTypes.SOFTSTART, CommandStates.OK, ResultTypes.RESULT, "")
Case Else
End Select
_cmdActive = CInt(executedCommand)
End Sub
Private Sub RemoteObject_ServerError(ByVal sender As Object, ByVal seEA As ISOCNC.Remoting.ServerErrorEventArgs)
m_ResultCallbackDlg(CommandTypes.ERROR_, CommandStates.ERROR_, ResultTypes.RESULT, "Server Error: " & seEA.[Error])
Dim dr As MessageBoxResult = MessageBox.Show("Server Error: " & seEA.[Error])
End Sub
Private Sub RemoteObject_AxisCoordinatesUpdate(ByVal axisValue As Double, ByVal axisIndex As Integer)
m_AxisCoordinatesCallbackDlg(axisValue, axisIndex)
End Sub
Private Sub RemoteObject_RPCUpdate(ByVal newRPC As UInteger)
_rpc = CInt(newRPC)
End Sub
Private Sub RemoteObject_ListInfoResponse(ByVal prgCount As Integer, ByVal prgAtIndex As String, ByVal prgList As String())
If prgCount >= 0 Then
_prgCount = prgCount
End If
If prgAtIndex <> "" Then
_prgAtIndex = prgAtIndex
End If
If prgList IsNot Nothing AndAlso prgList.Length > 0 Then
_prgList = prgList
_prgListUpdated = True
End If
End Sub
Private Sub RemoteObject_AlarmNotification(ByVal alarmOperation As Integer, ByVal alarmType As Integer, ByVal alarmMessage As String, ByVal alarmCode As String, ByVal alarmDateTime As String)
' restituisco errore ad interfaccia
m_AlarmCallbackDlg(alarmOperation, alarmType, alarmMessage, alarmCode, alarmDateTime)
End Sub
Private Sub RemoteObject_VariableCommandExecuted(ByVal executedCommand As Integer, ByVal commandExecutedCorrectly As Boolean, ByVal varName As String, ByVal varValue As String, ByVal varType As Integer)
' riporto valore variabile su array
Select Case executedCommand
Case VariableCommands.Error
Case VariableCommands.NotExecuted
Case VariableCommands.ReadVar
m_RWVariableManager.UpdateVar(commandExecutedCorrectly, varName, varValue, varType)
Case VariableCommands.WriteVar
m_ResultCallbackDlg(CommandTypes.WRITE, If(commandExecutedCorrectly, CommandStates.OK, CommandStates.ERROR_), ResultTypes.RESULT, varName & "=" & varValue)
Case VariableCommands.ReadAxis
Case VariableCommands.ReadAny
End Select
End Sub
Private Sub RemoteObject_TickUpdate(ByVal newTick As ULong)
End Sub
End Class
+107
View File
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{88965904-0382-4F05-AFAF-1A008C2A5A25}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TPAComm</RootNamespace>
<AssemblyName>TPAComm</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>TPAComm.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>TPAComm.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="ISOCNC.Remoting">
<HintPath>..\..\..\EgtProg\EgtBEAMWALL\ISOCNC.Remoting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>