-pulizia codice

This commit is contained in:
Demetrio Cassarino
2024-08-07 14:10:51 +02:00
parent 05b2b1d73f
commit 46f82e0286
31 changed files with 230 additions and 248 deletions
+6 -8
View File
@@ -832,7 +832,7 @@ Public Class BTLPartM
If pTo >= 0 Then
NewBTLPart.m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom),
NewBTLPart.ocREFSIDEFIXCLAMP),
NewBTLPart.ocREFSIDEFIXCLAMP)
NewBTLPart.ocREFSIDEFIXCLAMP)
End If
Dim EnumIndex As Integer = 0
@@ -891,18 +891,16 @@ Public Class BTLPartM
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 2 Then
NewBTLPart.m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), NewBTLPart.ocALIGNLOCATION),
NewBTLPart.ocALIGNLOCATION)
NewBTLPart.m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(),
NewBTLPart.ocALIGNENDTYPE),
NewBTLPart.ocALIGNENDTYPE)
NewBTLPart.ocALIGNLOCATION)
NewBTLPart.m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(), NewBTLPart.ocALIGNENDTYPE),
NewBTLPart.ocALIGNENDTYPE)
End If
EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 1 Then
NewBTLPart.m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0),
NewBTLPart.ocMATERIALTYPEGRP),
NewBTLPart.ocMATERIALTYPEGRP)
NewBTLPart.m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), NewBTLPart.ocMATERIALTYPEGRP),
NewBTLPart.ocMATERIALTYPEGRP)
If sValArray.Count() >= 2 Then NewBTLPart.m_sMATERIALTYPESPEC = sValArray(1).Trim()
End If
+4 -4
View File
@@ -174,7 +174,7 @@ Public Class BTLStructureM
End Property
Public m_ocRANGE As New List(Of Object)({New IdNameStruct(Range.STANDARD, EgtMsg(61710)),
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
Public ReadOnly Property ocRANGE As List(Of Object)
Get
Return m_ocRANGE
@@ -192,8 +192,8 @@ Public Class BTLStructureM
End Property
Public m_ocPROCESSINGQUALITY As New List(Of Object)({New IdNameStruct(ProcessingQuality.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
Public ReadOnly Property ocPROCESSINGQUALITY As List(Of Object)
Get
Return m_ocPROCESSINGQUALITY
@@ -251,7 +251,7 @@ Public Class BTLStructureM
End Property
Public m_ocRECESS As New List(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
Public ReadOnly Property ocRECESS As List(Of Object)
Get
Return m_ocRECESS
+8 -6
View File
@@ -43,17 +43,19 @@ Public Class MachGroupM
End Function
Public Shared Function CreateMachGroup(nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
Dim NewMachGroupM As New MachGroupM With {
.m_Id = nId,
.m_Name = sName,
.m_Machine = sMachine
}
Return NewMachGroupM
End Function
Public Shared Function CreateMachGroup(sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MachGroupM
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
Dim NewMachGroupM As New MachGroupM With {
.m_Id = EgtAddMachGroup(sName, sMachine)
}
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
+7 -6
View File
@@ -83,16 +83,17 @@ Public Class MachGroupPanelM
Public Shared Function CreateMachGroupPanel(IsMultiMachGroup As Boolean,
MachineList As List(Of Machine), DefaultMachine As String,
Optional sBaseName As String = "MachGroup_1") As MachGroupPanelM
Dim NewMachGroupPanelM As New MachGroupPanelM
NewMachGroupPanelM.m_IsMultiMachGroup = IsMultiMachGroup
' Assegno nome base
NewMachGroupPanelM.m_BaseName = sBaseName
' Recupero lista macchine
NewMachGroupPanelM.m_MachineList = MachineList
' Assegno macchina di default
NewMachGroupPanelM.m_DefaultMachine = DefaultMachine
' recupero i MachGroup
NewMachGroupPanelM.m_MachGroupMList = LoadMachGroups()
Dim NewMachGroupPanelM As New MachGroupPanelM With {
.m_IsMultiMachGroup = IsMultiMachGroup,
.m_BaseName = sBaseName,
.m_MachineList = MachineList,
.m_DefaultMachine = DefaultMachine,
.m_MachGroupMList = LoadMachGroups()
}
Return NewMachGroupPanelM
End Function
+10 -12
View File
@@ -1,8 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtUILib
Imports EgtWPFLib5
Public Class MyMachGroupM
@@ -301,11 +297,12 @@ Public Class MyMachGroupM
End Function
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MyMachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
NewMachGroupM.m_nType = Type
Dim NewMachGroupM As New MyMachGroupM With {
.m_Id = nId,
.m_Name = sName,
.m_Machine = sMachine,
.m_nType = Type
}
If NewMachGroupM.m_nType = MachineType.BEAM Then
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
@@ -333,8 +330,9 @@ Public Class MyMachGroupM
End Function
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MyMachGroupM
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
Dim NewMachGroupM As New MyMachGroupM With {
.m_Id = EgtAddMachGroup(sName, sMachine)
}
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
@@ -11,14 +11,15 @@ Public Class MyMachGroupPanelM
#Region "CONSTRUCTOR"
Public Shared Function CreateMyMachGroupPanel(MachineList As List(Of Machine)) As MachGroupPanelM
Dim NewMyMachGroupPanelM As New MyMachGroupPanelM
NewMyMachGroupPanelM.m_IsMultiMachGroup = False
' Assegno nome base
NewMyMachGroupPanelM.m_BaseName = ""
' Recupero lista macchine
NewMyMachGroupPanelM.m_MachineList = MachineList
' Assegno macchina di default
NewMyMachGroupPanelM.m_DefaultMachine = ""
Dim NewMyMachGroupPanelM As New MyMachGroupPanelM With {
.m_IsMultiMachGroup = False,
.m_BaseName = "",
.m_MachineList = MachineList,
.m_DefaultMachine = ""
}
' aggiorno copie
UpdateAllDuplo()
' recupero i MachGroup
+4 -3
View File
@@ -463,9 +463,10 @@ Public Class PartM
End Sub
Public Shared Function CreatePart(Type As BWType, nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As PartM
Dim NewPartM As New PartM(nParentMachGroup, nPartId)
NewPartM.m_nType = Type
NewPartM.m_nRawPartId = nRawPartId
Dim NewPartM As New PartM(nParentMachGroup, nPartId) With {
.m_nType = Type,
.m_nRawPartId = nRawPartId
}
' leggo info pezzo
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewPartM.m_nProjId)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewPartM.m_nPDN)
@@ -436,8 +436,6 @@ Public MustInherit Class MyMachGroupVM
m_SupervisorId = SupervisorId
End Sub
Private m_cc As StateChangeEventArgs
Public ReadOnly Property IsReadOnly As Boolean
Get
Return String.IsNullOrEmpty(m_SupervisorId)
@@ -474,10 +472,6 @@ Public MustInherit Class MyMachGroupVM
Public MustOverride Sub RefreshGroupData()
Public Overridable Function Copy() As MyMachGroupVM
Return Nothing
End Function
Public Sub UpdateUsage()
If nType = BWType.BEAM Then
MyMachGroupM.SetMatForPart(0)
+27 -25
View File
@@ -49,36 +49,38 @@
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean) As ProdFileM
Dim NewProjectFileM As New ProdFileM
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_nProjIdList = nProjIdList
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_sName = sName
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_sLockedBy = sLockedBy
NewProjectFileM.m_dtLock = dtLock
NewProjectFileM.m_bIsActive = bIsActive
NewProjectFileM.m_bIsProduced = bIsProduced
NewProjectFileM.m_bIsArchived = bIsArchived
Dim NewProjectFileM As New ProdFileM With {
.m_nProdId = nProdId,
.m_nProjIdList = nProjIdList,
.m_dtCreateDate = dtCreateProjDate,
.m_sName = sName,
.m_nType = nType,
.m_sMachine = sMachine,
.m_sLockedBy = sLockedBy,
.m_dtLock = dtLock,
.m_bIsActive = bIsActive,
.m_bIsProduced = bIsProduced,
.m_bIsArchived = bIsArchived
}
Return NewProjectFileM
End Function
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdFileM
Dim NewProjectFileM As New ProdFileM
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_nProjIdList = nProjIdList
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_sName = sName
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_sLockedBy = sLockedBy
NewProjectFileM.m_dtLock = dtLock
NewProjectFileM.m_bIsActive = bIsActive
NewProjectFileM.m_bIsProduced = bIsProduced
NewProjectFileM.m_bIsArchived = bIsArchived
NewProjectFileM.m_ProjMList = ProjMList
Dim NewProjectFileM As New ProdFileM With {
.m_nProdId = nProdId,
.m_nProjIdList = nProjIdList,
.m_dtCreateDate = dtCreateProjDate,
.m_sName = sName,
.m_nType = nType,
.m_sMachine = sMachine,
.m_sLockedBy = sLockedBy,
.m_dtLock = dtLock,
.m_bIsActive = bIsActive,
.m_bIsProduced = bIsProduced,
.m_bIsArchived = bIsArchived,
.m_ProjMList = ProjMList
}
Return NewProjectFileM
End Function
+15 -14
View File
@@ -45,20 +45,21 @@
End Function
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean) As ProjFileM
Dim NewProjectFileM As New ProjFileM
NewProjectFileM.m_nProjId = nProjId
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_dtExportDate = dtExportDate
NewProjectFileM.m_sListName = sListName
NewProjectFileM.m_sBTLFileName = sBTLFileName
NewProjectFileM.m_sDescription = sDescription
NewProjectFileM.m_bIsNew = IsNew
NewProjectFileM.m_bIsLocked = IsLocked
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_bIsActive = bIsActive
NewProjectFileM.m_bIsArchived = bIsArchived
Dim NewProjectFileM As New ProjFileM With {
.m_nProjId = nProjId,
.m_nProdId = nProdId,
.m_dtCreateDate = dtCreateProjDate,
.m_dtExportDate = dtExportDate,
.m_sListName = sListName,
.m_sBTLFileName = sBTLFileName,
.m_sDescription = sDescription,
.m_bIsNew = IsNew,
.m_bIsLocked = IsLocked,
.m_nType = nType,
.m_sMachine = sMachine,
.m_bIsActive = bIsActive,
.m_bIsArchived = bIsArchived
}
Return NewProjectFileM
End Function
@@ -1,8 +1,4 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ProjFileVM
Public Class ProjFileVM
Inherits ProjectFileVM
Public ReadOnly Property ProjFileM As ProjFileM
@@ -1,6 +1,4 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtUILib
Imports EgtWPFLib5
Public Class ProjectFileVM
@@ -1,5 +1,4 @@
Imports System.Windows
Imports System.Windows.Controls
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
+47 -42
View File
@@ -198,50 +198,55 @@
#Region "Internal Methods"
Public Shared Function CreateAlarmLog(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.ALARM
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmCode = AlarmCode
Dim NewMachLog As New MachLog With {
.m_CommandType = LogCommandTypes.ALARM,
.m_AlarmOperation = AlarmOperation,
.m_AlarmType = AlarmType,
.m_AlarmMessage = AlarmMessage,
.m_AlarmCode = AlarmCode
}
DateTime.TryParse(AlarmDateTime, NewMachLog.m_AlarmDateTime)
Return NewMachLog
End Function
Public Shared Function CreateOPStateLog(newOpState As Integer)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.NEWOP
NewMachLog.m_newOpState = newOpState
NewMachLog.m_AlarmDateTime = DateTime.Now()
Dim NewMachLog As New MachLog With {
.m_CommandType = LogCommandTypes.NEWOP,
.m_newOpState = newOpState,
.m_AlarmDateTime = DateTime.Now()
}
Return NewMachLog
End Function
Public Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandTypes.READ_TPA
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
NewMachLog.m_VarAddress = VarAddress
NewMachLog.m_VarValue = VarValue
NewMachLog.m_AlarmDateTime = DateTime.Now()
Dim NewMachLog As New MachLog With {
.m_CommandType = CommandTypes.READ_TPA,
.m_CommandExecutedCorrectly = CommandExecutedCorrectly,
.m_VarAddress = VarAddress,
.m_VarValue = VarValue,
.m_AlarmDateTime = DateTime.Now()
}
Return NewMachLog
End Function
Public Shared Function CreateResultLog(CommandType As LogCommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_CommandState = CommandState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_Description = Description
NewMachLog.m_AlarmDateTime = DateTime.Now()
Dim NewMachLog As New MachLog With {
.m_CommandType = CommandType,
.m_CommandState = CommandState,
.m_ResultType = ResultType,
.m_Description = Description,
.m_AlarmDateTime = DateTime.Now()
}
Return NewMachLog
End Function
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
Dim NewMachEvent As New MachLog
NewMachEvent.m_ResultType = EventType
NewMachEvent.m_AlarmDateTime = EventDateTime
NewMachEvent.m_VarValue = Value
NewMachEvent.m_VarAddress = SupervisorID
Dim NewMachEvent As New MachLog With {
.m_ResultType = EventType,
.m_AlarmDateTime = EventDateTime,
.m_VarValue = Value,
.m_VarAddress = SupervisorID
}
Return NewMachEvent
End Function
@@ -250,21 +255,21 @@
#Region "Public Methods"
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
Dim NewMachLog As New MachLog
NewMachLog.m_AlarmCode = AlarmCode
NewMachLog.m_AlarmDateTime = AlarmDateTime
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
NewMachLog.m_CommandState = CommandState
NewMachLog.m_CommandType = CommandType
NewMachLog.m_Description = Description
NewMachLog.m_newOpState = newOpState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_VarAddress = VarAddress
NewMachLog.m_VarValue = VarValue
Dim NewMachLog As New MachLog With {
.m_AlarmCode = AlarmCode,
.m_AlarmDateTime = AlarmDateTime,
.m_AlarmMessage = AlarmMessage,
.m_AlarmOperation = AlarmOperation,
.m_AlarmType = AlarmType,
.m_CommandExecutedCorrectly = CommandExecutedCorrectly,
.m_CommandState = CommandState,
.m_CommandType = CommandType,
.m_Description = Description,
.m_newOpState = newOpState,
.m_ResultType = ResultType,
.m_VarAddress = VarAddress,
.m_VarValue = VarValue
}
Return NewMachLog
End Function
@@ -447,10 +447,10 @@ Public Class CALCPanelVM
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}
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
@@ -497,11 +497,11 @@ Public Class CALCPanelVM
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.CmdTypes.SIMULATE}
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
+6 -6
View File
@@ -737,12 +737,12 @@ Public Class NUMAxiumComm
If Not String.IsNullOrWhiteSpace(objLine.ToString()) Then
' lo aggiungo
Dim NewMessage As ReadMessages = New ReadMessages(0,
OpMsgErrType.ToString(),
"",
"",
"",
objLine,
"")
OpMsgErrType.ToString(),
"",
"",
"",
objLine,
"")
NewMessage.bFound = True
m_ReadOperatorMessages.Add(NewMessage)
m_NUMAlarmCallbackDlg(0, 0, OpMsgErrType.ToString(), "", "", "", objLine, "")
@@ -532,8 +532,8 @@ Public Class NUMAxiumPcToolkitComm
If nType = eVarious4.E30000 Then
Dim Group As UInt16 = 0
Dim ObjectList As New tDNC20_ObjectList With {.ElemNum = 3,
.First = nAddressNumber,
.Quantity = 1}
.First = nAddressNumber,
.Quantity = 1}
EgtOutLog("E30000 var trovata, valori: " & nPortVariables & " " & Group & "" & ObjectList.First & " " & nRes)
nRet = DNC20_ReadExxxxx(nPortVariables, Group, 1, ObjectList, nRes, SYN)
@@ -980,12 +980,12 @@ Public Class NUMAxiumPcToolkitComm
If Not String.IsNullOrWhiteSpace(objLine.ToString()) Then
' lo aggiungo
Dim NewMessage As ReadMessages = New ReadMessages(0,
OpMsgErrType.ToString(),
"",
"",
"",
objLine,
"")
OpMsgErrType.ToString(),
"",
"",
"",
objLine,
"")
NewMessage.bFound = True
m_ReadOperatorMessages.Add(NewMessage)
m_NUMAlarmCallbackDlg(0, 0, OpMsgErrType.ToString(), "", "", "", objLine, "")
+12 -12
View File
@@ -501,12 +501,12 @@ Public Class NUMFlexiumComm
Else
' lo aggiungo
Dim NewMessage As ReadMessages = New ReadMessages(AplCnCNumber,
AplErrorType(index).ToString(),
AplErrorIndex(index).ToString(),
AplErrorNumber(index).ToString(),
AplErrorLine(index).ToString(),
AplErrorMessage(index).ToString(),
AplErrorAdditional(index).ToString())
AplErrorType(index).ToString(),
AplErrorIndex(index).ToString(),
AplErrorNumber(index).ToString(),
AplErrorLine(index).ToString(),
AplErrorMessage(index).ToString(),
AplErrorAdditional(index).ToString())
NewMessage.bFound = True
m_ReadFXMessages.Add(NewMessage)
m_NUMAlarmCallbackDlg(AplCnCNumber, 0, AplErrorType(index).ToString(), AplErrorIndex(index).ToString(), AplErrorNumber(index).ToString(), AplErrorLine(index).ToString(), AplErrorMessage(index).ToString(), AplErrorAdditional(index).ToString())
@@ -752,12 +752,12 @@ Public Class NUMFlexiumComm
If Not String.IsNullOrWhiteSpace(objLine(index).ToString()) Then
' lo aggiungo
Dim NewMessage As ReadMessages = New ReadMessages(0,
OpMsgErrType.ToString(),
"",
objMsgNumber(index).ToString(),
"",
objLine(index).ToString(),
"")
OpMsgErrType.ToString(),
"",
objMsgNumber(index).ToString(),
"",
objLine(index).ToString(),
"")
NewMessage.bFound = True
m_ReadOperatorMessages.Add(NewMessage)
m_NUMAlarmCallbackDlg(0, 0, OpMsgErrType.ToString(), "", objMsgNumber(index).ToString(), "", objLine(index).ToString(), "")
+1 -7
View File
@@ -1,12 +1,6 @@
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Runtime.Remoting.Channels
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 EgtBEAMWALL.Core.ConstMachComm
Imports ISOCNC.Remoting
+17 -25
View File
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Globalization
Imports System.IO
Imports System.Windows.Threading
@@ -422,25 +421,21 @@ Public Class LeftPanelVM
' carico stati della macchina
Select Case NCType
Case NCTypes.TPA
m_OPStateList = New List(Of OPState) From {
New OPState("Start", OPStates.Start),
New OPState("Stop", OPStates.Stop),
New OPState("Reset", OPStates.End),
New OPState("SetPoint", OPStates.SetPoint),
New OPState("Pending", OPStates.Pending),
New OPState("Unspecified", OPStates.Unspecified)
m_OPStateList = New List(Of OPState) From {New OPState("Start", OPStates.Start),
New OPState("Stop", OPStates.Stop),
New OPState("Reset", OPStates.End),
New OPState("SetPoint", OPStates.SetPoint),
New OPState("Pending", OPStates.Pending),
New OPState("Unspecified", OPStates.Unspecified)
}
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
m_OPStateList = New List(Of OPState) From {
New OPState("Start", OPStates.Start),
New OPState("Stop", OPStates.Stop),
New OPState("Reset", OPStates.End),
New OPState("Unspecified", OPStates.Unspecified)
m_OPStateList = New List(Of OPState) From {New OPState("Start", OPStates.Start),
New OPState("Stop", OPStates.Stop),
New OPState("Reset", OPStates.End),
New OPState("Unspecified", OPStates.Unspecified)
}
Case Else
m_OPStateList = New List(Of OPState) From {
New OPState("Unspecified", OPStates.Unspecified)
}
m_OPStateList = New List(Of OPState) From {New OPState("Unspecified", OPStates.Unspecified)}
End Select
' seleziono in partenza unspecified
Dim UnspecifiedState As OPState = m_OPStateList.FirstOrDefault(Function(x) x.Id = OPStates.Unspecified)
@@ -451,16 +446,13 @@ Public Class LeftPanelVM
' carico stati della macchina
Select Case NCType
Case NCTypes.TPA
m_OPModeList = New List(Of OPState) From {
New OPState("Manual", OPModes.Manual)
}
m_OPModeList = New List(Of OPState) From {New OPState("Manual", OPModes.Manual)}
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
m_OPModeList = New List(Of OPState) From {
New OPState("Auto", OPModes.Auto),
New OPState("Single", OPModes.Single),
New OPState("Mdi", OPModes.Mdi),
New OPState("Manual", OPModes.Manual),
New OPState("Home", OPModes.Home)
m_OPModeList = New List(Of OPState) From {New OPState("Auto", OPModes.Auto),
New OPState("Single", OPModes.Single),
New OPState("Mdi", OPModes.Mdi),
New OPState("Manual", OPModes.Manual),
New OPState("Home", OPModes.Home)
}
End Select
End Sub
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.Threading
Imports System.Threading
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core.ConstMachComm
Imports EgtBEAMWALL.Core
@@ -296,9 +295,9 @@ Public Class MachCommandMessagePanelVM
' creo thread gestione macchina
m_MachManagingThread = New Thread(Sub()
MachineCommThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
AddressOf UpdateCallbackDlg, AddressOf TPAAlarmCallbackDlg, AddressOf NUMAlarmCallbackDlg,
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
AddressOf OpModeCallbackDlg, AddressOf ChannelCallbackDlg, AddressOf ReadVarCallbackDlg)
AddressOf UpdateCallbackDlg, AddressOf TPAAlarmCallbackDlg, AddressOf NUMAlarmCallbackDlg,
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
AddressOf OpModeCallbackDlg, AddressOf ChannelCallbackDlg, AddressOf ReadVarCallbackDlg)
End Sub)
' avvio thread di gestione della macchina che avvia la connessione
m_MachManagingThread.Start()
@@ -767,9 +766,10 @@ Class Alarm
End Sub
Public Shared Function CreateAlarm(Code As String, Message As String) As Alarm
Dim NewAlarm As New Alarm
NewAlarm.m_sCode = Code
NewAlarm.m_sMessage = Message
Dim NewAlarm As New Alarm With {
.m_sCode = Code,
.m_sMessage = Message
}
Return NewAlarm
End Function
@@ -114,39 +114,45 @@ Public Class ThreadCommand
End Sub
Public Shared Function CreateCommand(CommandType As CommandTypes) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandType
Dim NewCommand As New ThreadCommand With {
.m_CommandType = CommandType
}
Return NewCommand
End Function
Public Shared Function CreateCommand(CommandType As CommandTypes, Variable As Integer) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandType
Dim NewCommand As ThreadCommand = New ThreadCommand With {
.m_CommandType = CommandType
}
NewCommand.m_nVariables(0) = Variable
Return NewCommand
End Function
Public Shared Function CreateCommand(CommandType As CommandTypes, Variable As Double) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandType
Dim NewCommand As New ThreadCommand With {
.m_CommandType = CommandType
}
NewCommand.m_dVariables(0) = Variable
Return NewCommand
End Function
Public Shared Function CreateCommand(CommandType As CommandTypes, Variable As String) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandType
Dim NewCommand As New ThreadCommand With {
.m_CommandType = CommandType
}
NewCommand.m_sVariables(0) = Variable
Return NewCommand
End Function
Public Shared Function CreateCommand(CommandType As CommandTypes, nVariables() As Integer, dVariables() As Double, sVariables() As String) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandType
NewCommand.m_nVariables = nVariables
NewCommand.m_dVariables = dVariables
NewCommand.m_sVariables = sVariables
Dim NewCommand As New ThreadCommand With {
.m_CommandType = CommandType,
.m_nVariables = nVariables,
.m_dVariables = dVariables,
.m_sVariables = sVariables
}
Return NewCommand
End Function
Public Shared Function CreateReadCommand(sVariable As String) As ThreadCommand
Dim NewCommand As ThreadCommand = New ThreadCommand
NewCommand.m_CommandType = CommandTypes.READ_TPA
Dim NewCommand As New ThreadCommand With {
.m_CommandType = CommandTypes.READ_TPA
}
NewCommand.m_sVariables(0) = sVariable
Return NewCommand
End Function
@@ -38,8 +38,9 @@ Public Class RWVariableManager
End Sub
Friend Shared Function CreateRWVariableManager(Tpa As TPAComm)
Dim NewRWVariableManager As New RWVariableManager
NewRWVariableManager.m_Tpa = Tpa
Dim NewRWVariableManager As New RWVariableManager With {
.m_Tpa = Tpa
}
AddHandler NewRWVariableManager.m_Tpa.eventProxy.VariableCommandExecuted, NewRWVariableManager.m_Proxy_VariableCommandExecutedEventHandler
Return NewRWVariableManager
End Function
@@ -333,9 +333,10 @@ Public Class MachinePanelVM
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName))
SetUpWindow.Height = 614
SetUpWindow.Width = 1024
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
SetUpWindow.ShowDialog()
End Sub
@@ -185,8 +185,9 @@ Public Class MainWindowVM
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub AboutBox(ByVal param As Object)
Dim AboutBoxWindow As New AboutBoxV
AboutBoxWindow.Owner = Application.Current.MainWindow
Dim AboutBoxWindow As New AboutBoxV With {
.Owner = Application.Current.MainWindow
}
AboutBoxWindow.ShowDialog()
End Sub
@@ -20,7 +20,7 @@
Public Shared Sub ViewerOptimizerCommThreadFunction()
' creo classe di comunicazione
Dim m_ViewerOptimizerComm As ViewerOptimizerComm = New ViewerOptimizerComm()
Dim m_ViewerOptimizerComm As New ViewerOptimizerComm()
While Not m_Stop
' eseguo ciclo principale che tiene vivo il thread
@@ -43,15 +43,7 @@ Module LabelPrinter
Try
' Connecting...
'Await Task.Delay(1500)
m_printerConnection.Open()
' Connected
'Await Task.Delay(1500)
'' Determining Printer Language...
'Await Task.Delay(1500)
'Dim printerLanguage As PrinterLanguage = ZebraPrinterFactory.GetInstance(m_printerConnection).PrinterControlLanguage
'' Printer Language
'Await Task.Delay(1500)
' Sending Data...
Dim LabelFile As String = File.ReadAllText("c:\Users\Dell\Downloads\Etichetta\Test2.prn")
For Each Variable In m_PrintVariables
@@ -76,7 +68,6 @@ Module LabelPrinter
m_printerConnection.Close()
End If
'Threading.Thread.Sleep(500)
' Not Connected
Catch __unusedConnectionException1__ As ConnectionException
End Try
@@ -181,7 +181,7 @@ Public Class RawPartManagerVM
Next
Return True
Else
ErrorMsg = String.Format("Impossible sending {0} to supervisor because not machinable!", MachGroup.Name)
ErrorMsg = String.Format(EgtMsg(62568), MachGroup.Name)
Return False
End If
End Function
Binary file not shown.
Binary file not shown.
Binary file not shown.