- migliorata gestione attivazione csv out
- gestita cartella ultimo csv aperto - messaggi in inglese - cambiato aggiornamento stato porta in simulazione - correzione in Restart nCircId invece di nId e condizioni di riordinamento su porte da sistemare - corretta gestione tempi di produzione su JsonLuaDoor
This commit is contained in:
@@ -23,8 +23,11 @@ Module ConstIni
|
||||
Public Const K_DDTDIR As String = "DDTDir"
|
||||
Public Const K_GENDDFDIR As String = "GenDDFDir"
|
||||
Public Const K_CSV As String = "CSV"
|
||||
Public Const K_CSVOUTPUT As String = "CSVOutput"
|
||||
Public Const K_ISCSVOUTPUTENABLED As String = "IsCSVOutputEnabled"
|
||||
Public Const K_CSVOUTPUTPATH As String = "CSVOutputPath"
|
||||
Public Const K_RESTART_WINPLACE As String = "RestartWinPlace"
|
||||
Public Const K_LASTPRODUCTIONDIR As String = "LastProductionDir"
|
||||
Public Const K_LASTCSVDIR As String = "LastCsvDir"
|
||||
|
||||
Public Const S_CSV As String = "CSV"
|
||||
Public Const K_DDFNAME As String = "DDFName"
|
||||
|
||||
@@ -134,17 +134,20 @@ Public Class DoorListPageVM
|
||||
AddHandler m_RefreshGraphicsTimer.Tick, AddressOf RefreshGraphicsTimer_Tick
|
||||
m_BackupTimer.Start()
|
||||
' verifico path salvataggio CSV
|
||||
Dim bStartWriteCSV As Boolean = True
|
||||
If GetPluginPrivateProfileString(S_GENERAL, K_CSVOUTPUT, "", m_sCSVOutDirPath) = 0 Then
|
||||
bStartWriteCSV = False
|
||||
MessageBox.Show("Path di salvataggio CSV non impostata! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
If bStartWriteCSV AndAlso Not Directory.Exists(m_sCSVOutDirPath) Then
|
||||
bStartWriteCSV = False
|
||||
MessageBox.Show("Path di salvataggio CSV impostata non esiste! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
If bStartWriteCSV Then
|
||||
m_WriteCSVTimer.Start()
|
||||
Dim bStartWriteCSV As Boolean = False
|
||||
If GetPluginPrivateProfileInt(S_GENERAL, K_ISCSVOUTPUTENABLED, 0) = 1 Then
|
||||
bStartWriteCSV = True
|
||||
If GetPluginPrivateProfileString(S_GENERAL, K_CSVOUTPUTPATH, "", m_sCSVOutDirPath) = 0 Then
|
||||
bStartWriteCSV = False
|
||||
MessageBox.Show("Path di salvataggio CSV non impostata! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
If bStartWriteCSV AndAlso Not Directory.Exists(m_sCSVOutDirPath) Then
|
||||
bStartWriteCSV = False
|
||||
MessageBox.Show("Path di salvataggio CSV impostata non esiste! Impossibile creare file CSV!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
If bStartWriteCSV Then
|
||||
m_WriteCSVTimer.Start()
|
||||
End If
|
||||
End If
|
||||
m_RefreshGraphicsTimer.Start()
|
||||
End Sub
|
||||
@@ -349,7 +352,7 @@ Public Class DoorListPageVM
|
||||
|
||||
Public Sub OpenCSV()
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_LASTCSVDIR, "", sDir)
|
||||
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".csv",
|
||||
.Filter = "CSV (*.csv)|*.csv",
|
||||
@@ -357,6 +360,7 @@ Public Class DoorListPageVM
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If OpenFileDialog.ShowDialog() Then
|
||||
WritePluginPrivateProfileString(S_GENERAL, K_LASTCSVDIR, Path.GetDirectoryName(OpenFileDialog.FileName))
|
||||
Dim sCSVPath As String = OpenFileDialog.FileName
|
||||
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(sCSVPath)
|
||||
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||
@@ -500,7 +504,7 @@ Public Class DoorListPageVM
|
||||
If sExtension.ToLower() = ".ddf" Then
|
||||
Dim sDDFFilePath As String = sDDFDirPath & "\" & sDDFName
|
||||
If Not File.Exists(sDDFFilePath) Then
|
||||
Dim sErr As String = "Il nome inserito (" & sDDFFilePath & ") non corrisponde a nessun file nella cartella dei Ddf (" & sDDFDirPath & ")"
|
||||
Dim sErr As String = "The inserted name (" & sDDFFilePath & ") do not correspond to any file in the Ddf folder (" & sDDFDirPath & ")"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
@@ -538,7 +542,7 @@ Public Class DoorListPageVM
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Dim sErr As String = "Estensione del file non riconosciuta!"
|
||||
Dim sErr As String = "File extension not recognized!"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Dim ErrDoor As Door = m_DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
@@ -995,10 +999,7 @@ Public Class DoorListPageVM
|
||||
End Sub
|
||||
|
||||
Public Sub ProduceDoor(DoorToProduce As Door, Optional bWriteBackup As Boolean = True)
|
||||
If IsNothing(DoorToProduce) OrElse DoorToProduce.nState = Door.DoorStates.SKIPPED OrElse
|
||||
DoorToProduce.nState = Door.DoorStates.NOTPRODUCE OrElse
|
||||
DoorToProduce.nState = Door.DoorStates.VERIFICATION_FAILED OrElse
|
||||
DoorToProduce.nState >= Door.DoorStates.READY_FOR_PRODUCTION Then Return
|
||||
If IsNothing(DoorToProduce) OrElse DoorToProduce.nState <> Door.DoorStates.VERIFIED Then Return
|
||||
' la sposto dopo l'ultima da produrre
|
||||
Dim nNewIndex As Integer = m_DoorList.IndexOf(m_DoorList.FirstOrDefault(Function(x) x.nState < Door.DoorStates.READY_FOR_PRODUCTION))
|
||||
Dim nOldIndex As Integer = m_DoorList.IndexOf(DoorToProduce)
|
||||
@@ -1135,7 +1136,7 @@ Public Class DoorListPageVM
|
||||
|
||||
Public Sub OpenProduction()
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_LASTPRODUCTIONDIR, "", sDir)
|
||||
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".csv",
|
||||
.Filter = "CSV (*.csv)|*.csv",
|
||||
@@ -1143,6 +1144,7 @@ Public Class DoorListPageVM
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If OpenFileDialog.ShowDialog() Then
|
||||
WritePluginPrivateProfileString(S_GENERAL, K_LASTPRODUCTIONDIR, Path.GetDirectoryName(OpenFileDialog.FileName))
|
||||
Dim sProductionCsvPath As String = OpenFileDialog.FileName
|
||||
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(sProductionCsvPath)
|
||||
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||
@@ -1197,9 +1199,10 @@ Public Class DoorListPageVM
|
||||
End While
|
||||
If Not String.IsNullOrWhiteSpace(sLineErrorList) Then
|
||||
MessageBox.Show("The following lines are not valid and have been skipped:" & sLineErrorList, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
MessageBox.Show("Single line csv writing successfully completed!", "Info", MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
End If
|
||||
End Using
|
||||
Verify()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1339,6 +1342,8 @@ Public Class Door
|
||||
NotifyPropertyChanged(NameOf(sDDFName))
|
||||
Return
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1394,6 +1399,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1442,6 +1449,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1490,6 +1499,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1544,6 +1555,8 @@ Public Class Door
|
||||
' Return
|
||||
'End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(nState))
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1800,37 +1813,49 @@ Public Class Door
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_GENDDFDIR, "", sGenDDFDirPath)
|
||||
Dim sDDTFilePath As String = sDDTDirPath & "\" & sDDFName
|
||||
If String.IsNullOrWhiteSpace(sDoorCreatorExePath) OrElse Not File.Exists(sDoorCreatorExePath) Then
|
||||
MessageBox.Show("Path del programma di calcolo del ddf mancante o errata!", "Errore!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
MessageBox.Show("Ddf file calculating software path not set or wrong!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return False
|
||||
ElseIf Not File.Exists(sDDTFilePath) Then
|
||||
Dim sErr As String = "File non trovato! Il nome inserito non corrisponde a nessun file nella cartella dei Ddt (" & sDDTDirPath & ")"
|
||||
Dim sErr As String = "File not found! Write name not correspond to any file in the Ddt folder (" & sDDTDirPath & ")"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Return False
|
||||
End If
|
||||
' creo il ddf
|
||||
Dim sGenDDFFilePath As String = sGenDDFDirPath & "\" & If(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(sDDFName)), Path.GetDirectoryName(sDDFName) & "_", "") & Path.GetFileNameWithoutExtension(sDDFName) & "_" & nId & ".ddf"
|
||||
Dim Proc As New Process()
|
||||
Proc.StartInfo.FileName = """" & sDoorCreatorExePath & """"
|
||||
Proc.StartInfo.RedirectStandardInput = False
|
||||
Proc.StartInfo.RedirectStandardOutput = False
|
||||
Proc.StartInfo.Arguments = """" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """"
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Dim ExecCounter = 0
|
||||
If Proc.Start Then
|
||||
While Not Proc.HasExited
|
||||
If ExecCounter >= 30 Then
|
||||
Proc.Kill()
|
||||
Exit While
|
||||
End If
|
||||
Threading.Thread.Sleep(100)
|
||||
ExecCounter += 1
|
||||
End While
|
||||
' elimino eventuale vecchio file
|
||||
If File.Exists(sGenDDFFilePath) Then
|
||||
File.Delete(sGenDDFFilePath)
|
||||
End If
|
||||
Try
|
||||
' creo il ddf
|
||||
Dim Proc As New Process()
|
||||
Proc.StartInfo.FileName = """" & sDoorCreatorExePath & """"
|
||||
Proc.StartInfo.RedirectStandardInput = False
|
||||
Proc.StartInfo.RedirectStandardOutput = False
|
||||
Map.refSupervisorFunction.PlgOutLog("""" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """")
|
||||
Proc.StartInfo.Arguments = """" & sDDTFilePath & ";" & DoubleToString(dWidth, 2) & ";" & DoubleToString(dHeight, 2) & ";" & DoubleToString(dThickness, 2) & ";" & sGenDDFFilePath & ";" & If(nSwing = SWINGTYPE.LEFT, "L", "R") & """"
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Dim ExecCounter = 0
|
||||
If Proc.Start Then
|
||||
|
||||
While Not Proc.HasExited
|
||||
If ExecCounter >= 100 Then
|
||||
Map.refSupervisorFunction.PlgOutLog("Process Kill!!")
|
||||
Proc.Kill()
|
||||
Exit While
|
||||
End If
|
||||
Threading.Thread.Sleep(100)
|
||||
ExecCounter += 1
|
||||
End While
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Map.refSupervisorFunction.PlgOutLog(ex.Message)
|
||||
End Try
|
||||
' se file generato
|
||||
If Not File.Exists(sGenDDFFilePath) Then
|
||||
Dim sErr As String = "Errore! Generazione file ddf fallita! (" & sDDTDirPath & ")"
|
||||
Dim sErr As String = "Error! Ddf file generation failed! (" & sDDTDirPath & ")"
|
||||
Map.refSupervisorFunction.PlgOutLog(sErr)
|
||||
sErrMessage &= "- " & sErr & Environment.NewLine
|
||||
Return False
|
||||
@@ -1880,7 +1905,7 @@ Public Class StateToSelColorConverter
|
||||
Return Dictionary.Effector_Green_SelStatus
|
||||
Case DoorStates.VERIFICATION_FAILED
|
||||
Return Dictionary.Effector_Red_SelStatus
|
||||
Case DoorStates.SKIPPED
|
||||
Case DoorStates.SKIPPED, DoorStates.NOTPRODUCE
|
||||
Return Dictionary.Effector_Yellow_SelStatus
|
||||
Case DoorStates.READY_FOR_PRODUCTION, DoorStates.ON_LOAD_STATION
|
||||
Return Dictionary.Effector_LightBlue_SelStatus
|
||||
|
||||
@@ -54,7 +54,6 @@ Public Class FiveLakesUIVM
|
||||
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione path Ini file
|
||||
PluginIniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
|
||||
Effector.Plugin.Lib.PluginIniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
|
||||
' Impostazione path resources dir
|
||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
End Sub
|
||||
|
||||
@@ -217,15 +217,15 @@ Public Class MachinePageVM
|
||||
' se in simulazione
|
||||
If Map.refSupervisorFunction.PlgGetPrivateProfileInt(S_NC, K_NC_SIMULATE, 0) > 0 Then
|
||||
' aggiorno stato porta in macchina da 1 a 2 se in stazione di lavorazione
|
||||
For nMachineIndex = 1 To 2
|
||||
Dim nMachineId As Integer = nMachineIndex
|
||||
Dim Machine1Var As Variable = m_VariableList.FirstOrDefault(Function(x) x.sName = "@WP_PR_02" AndAlso x.nMachine = nMachineId)
|
||||
If Not IsNothing(Machine1Var) AndAlso Machine1Var.dValue = 1 Then
|
||||
Dim nIndex As Integer = -1
|
||||
Integer.TryParse(Machine1Var.sIndex, nIndex)
|
||||
Map.refSupervisorFunction.ComWriteDoubleVar(nIndex, 2, Machine1Var.nMachine)
|
||||
End If
|
||||
Next
|
||||
'For nMachineIndex = 1 To 2
|
||||
' Dim nMachineId As Integer = nMachineIndex
|
||||
' Dim Machine1Var As Variable = m_VariableList.FirstOrDefault(Function(x) x.sName = "@WP_PR_02" AndAlso x.nMachine = nMachineId)
|
||||
' If Not IsNothing(Machine1Var) AndAlso Machine1Var.dValue = 1 Then
|
||||
' Dim nIndex As Integer = -1
|
||||
' Integer.TryParse(Machine1Var.sIndex, nIndex)
|
||||
' Map.refSupervisorFunction.ComWriteDoubleVar(nIndex, 2, Machine1Var.nMachine)
|
||||
' End If
|
||||
'Next
|
||||
' se presente un sent
|
||||
Dim Sent1Var As Variable = m_VariableList.FirstOrDefault(Function(x) x.sName = "@SENT_1" AndAlso x.nMachine = 2)
|
||||
Dim Sent2Var As Variable = m_VariableList.FirstOrDefault(Function(x) x.sName = "@SENT_2" AndAlso x.nMachine = 2)
|
||||
@@ -313,7 +313,7 @@ Public Class MachinePageVM
|
||||
Dim lUnloadTime As Long = 0
|
||||
LuaGetGlobVar("ListaCircPorte." & nDoorIndex & ".nUnloadTime", lUnloadTime)
|
||||
m_LuaDoorList.Add(New LuaDoor(nId, nCircIndex, nDoorState, nDoorPosition, sDoorCode, sDoorDescription, sDDFName, sCSVName, sM1CNPath, sM2CNPath, lLoadTime, lMachining1Start, lMachining1End, lMachining2Start, lMachining2End, lUnloadTime))
|
||||
If Not bM1Reset AndAlso Not bM2Reset AndAlso nId > 0 Then
|
||||
If nId > 0 AndAlso (Not bM1Reset AndAlso nDoorState >= 2 AndAlso nDoorState <= 4) OrElse (Not bM2Reset AndAlso nDoorState >= 5 AndAlso nDoorState <= 8) Then
|
||||
' aggiorno dati in lista porte
|
||||
Dim Door As Door = Map.refDoorListPageVM.DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(Door) AndAlso nDoorState <> Door.nProdState Then
|
||||
@@ -637,14 +637,15 @@ Public Class MachinePageVM
|
||||
Case 0
|
||||
Return
|
||||
Case 1
|
||||
If nStartStop = 1 AndAlso (StartDoorPresence.dValue = 1 OrElse EndDoorPresence.dValue = 2) AndAlso Sent1.nValue = 1 Then
|
||||
If nStartStop = 1 AndAlso (StartDoorPresence.dValue = 1 OrElse EndDoorPresence.dValue = 1) AndAlso Sent1.nValue = 1 Then
|
||||
nState = 2
|
||||
Map.refSupervisorFunction.ComWriteShortVar(Sent1.sIndex, 0, nMachineIndex)
|
||||
Else Return
|
||||
End If
|
||||
Case 2
|
||||
If nStartStop = 2 AndAlso EndDoorPresence.dValue = 2 Then
|
||||
If nStartStop = 2 AndAlso EndDoorPresence.dValue = 1 Then
|
||||
nState = 3
|
||||
Map.refSupervisorFunction.ComWriteDoubleVar(EndDoorPresence.sIndex, 2, nMachineIndex)
|
||||
Else Return
|
||||
End If
|
||||
Case 3
|
||||
@@ -654,8 +655,9 @@ Public Class MachinePageVM
|
||||
Else Return
|
||||
End If
|
||||
Case 4
|
||||
If nStartStop = 2 AndAlso EndDoorPresence.dValue = 2 Then
|
||||
If nStartStop = 2 AndAlso EndDoorPresence.dValue = 1 Then
|
||||
nState = 5
|
||||
Map.refSupervisorFunction.ComWriteDoubleVar(EndDoorPresence.sIndex, 2, nMachineIndex)
|
||||
Else Return
|
||||
End If
|
||||
Case 5
|
||||
|
||||
@@ -13,9 +13,9 @@ Imports System.Windows
|
||||
|
||||
<Assembly: AssemblyTitle("Effector.Plugin.FiveLakes")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Windows User")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("Effector.Plugin.FiveLakes")>
|
||||
<Assembly: AssemblyCopyright("Copyright @ Windows User 2024")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2025-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -42,7 +42,7 @@ Imports System.Windows
|
||||
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("b4747d9a-5420-4702-8e86-59fa0fb1ad51")>
|
||||
<Assembly: Guid("b4747d9a-5420-4702-8e86-59fa0fb1ad51")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyVersion("2.7.3.1")>
|
||||
<Assembly: AssemblyFileVersion("2.7.3.1")>
|
||||
|
||||
@@ -136,7 +136,7 @@ Public Class RestartWndVM
|
||||
Case 2 ' SENT_1
|
||||
Dim nCircIndex0 As Integer = 0
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S0", nCircIndex0)
|
||||
If nCircIndex0 <> LuaDoor.nId Then
|
||||
If nCircIndex0 <> LuaDoor.nCircIndex Then
|
||||
ResetLuaDoor(LuaDoorIndex, JsonLuaDoorList)
|
||||
End If
|
||||
Case 3 ' START_MACHINING_1
|
||||
@@ -146,7 +146,7 @@ Public Class RestartWndVM
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S1", nCircIndex1)
|
||||
Dim nCircIndex2 As Integer = 0
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S2", nCircIndex2)
|
||||
If nCircIndex0 <> LuaDoor.nId AndAlso nCircIndex1 <> LuaDoor.nId AndAlso nCircIndex2 <> LuaDoor.nId Then
|
||||
If nCircIndex0 <> LuaDoor.nCircIndex AndAlso nCircIndex1 <> LuaDoor.nCircIndex AndAlso nCircIndex2 <> LuaDoor.nCircIndex Then
|
||||
ResetLuaDoor(LuaDoorIndex, JsonLuaDoorList)
|
||||
End If
|
||||
Case 4 ' MACHINED_1
|
||||
@@ -156,7 +156,7 @@ Public Class RestartWndVM
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S3", nCircIndex3)
|
||||
Dim nCircIndex4 As Integer = 0
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S4", nCircIndex4)
|
||||
If nCircIndex2 <> LuaDoor.nId AndAlso nCircIndex3 <> LuaDoor.nId AndAlso nCircIndex4 <> LuaDoor.nId Then
|
||||
If nCircIndex2 <> LuaDoor.nCircIndex AndAlso nCircIndex3 <> LuaDoor.nCircIndex AndAlso nCircIndex4 <> LuaDoor.nCircIndex Then
|
||||
ResetLuaDoor(LuaDoorIndex, JsonLuaDoorList)
|
||||
End If
|
||||
End Select
|
||||
@@ -175,7 +175,7 @@ Public Class RestartWndVM
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S1", nCircIndex1)
|
||||
Dim nCircIndex2 As Integer = 0
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S2", nCircIndex2)
|
||||
If nCircIndex0 <> LuaDoor.nId AndAlso nCircIndex1 <> LuaDoor.nId AndAlso nCircIndex2 <> LuaDoor.nId Then
|
||||
If nCircIndex0 <> LuaDoor.nCircIndex AndAlso nCircIndex1 <> LuaDoor.nCircIndex AndAlso nCircIndex2 <> LuaDoor.nCircIndex Then
|
||||
ResetLuaDoor(LuaDoorIndex, JsonLuaDoorList)
|
||||
End If
|
||||
Case 7 ' MACHINED_2
|
||||
@@ -185,7 +185,7 @@ Public Class RestartWndVM
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S3", nCircIndex3)
|
||||
Dim nCircIndex4 As Integer = 0
|
||||
GetVariableValueFromName(nMachineIndex, "@DOORN_S4", nCircIndex4)
|
||||
If nCircIndex2 <> LuaDoor.nId AndAlso nCircIndex3 <> LuaDoor.nId AndAlso nCircIndex4 <> LuaDoor.nId Then
|
||||
If nCircIndex2 <> LuaDoor.nCircIndex AndAlso nCircIndex3 <> LuaDoor.nCircIndex AndAlso nCircIndex4 <> LuaDoor.nCircIndex Then
|
||||
ResetLuaDoor(LuaDoorIndex, JsonLuaDoorList)
|
||||
End If
|
||||
Case 8 ' UNLOADED
|
||||
@@ -213,12 +213,24 @@ Public Class RestartWndVM
|
||||
Select Case CurrDoor.nState
|
||||
Case Door.DoorStates.PRODUCED
|
||||
Continue For
|
||||
Case Door.DoorStates.MACHINE_2_END
|
||||
If nMachineIndex = 1 Then Continue For
|
||||
' cerco porta tra quelle in restart
|
||||
If Not IdIsInRestartList(CurrDoor.nId) Then
|
||||
m_DoorToBeFixedList.Add(New DoorToBeFixed(CurrDoor))
|
||||
End If
|
||||
Case Door.DoorStates.MACHINE_2_START
|
||||
If nMachineIndex = 1 Then Continue For
|
||||
' cerco porta tra quelle in restart
|
||||
If Not IdIsInRestartList(CurrDoor.nId) Then
|
||||
m_DoorToBeFixedList.Add(New DoorToBeFixed(CurrDoor))
|
||||
End If
|
||||
Case Door.DoorStates.MACHINE_1_END
|
||||
If nMachineIndex = 2 Then Continue For
|
||||
' cerco porta tra quelle in restart
|
||||
If Not IdIsInRestartList(CurrDoor.nId) Then
|
||||
m_DoorToBeFixedList.Add(New DoorToBeFixed(CurrDoor))
|
||||
End If
|
||||
Case Door.DoorStates.MACHINE_1_START
|
||||
If nMachineIndex = 2 Then Continue For
|
||||
' cerco porta tra quelle in restart
|
||||
@@ -334,7 +346,7 @@ Public Class RestartWndVM
|
||||
If ToBeFixedDoor.SelState = Door.DoorStates.NOTPRODUCE Then
|
||||
Dim DoorIndex As Integer = Map.refDoorListPageVM.DoorList.IndexOf(Door)
|
||||
For Index = 0 To Map.refDoorListPageVM.DoorList.Count - 1
|
||||
If Map.refDoorListPageVM.DoorList(Index).nState > Door.DoorStates.READY_FOR_PRODUCTION Then
|
||||
If Map.refDoorListPageVM.DoorList(Index).nState < Door.DoorStates.READY_FOR_PRODUCTION Then
|
||||
Map.refDoorListPageVM.DoorList.Move(DoorIndex, If(Index > 0, Index - 1, 0))
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -286,7 +286,6 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nLoadTime As Integer
|
||||
Public ReadOnly Property nLoadTime As Integer
|
||||
Get
|
||||
'Return m_nLoadTime
|
||||
@@ -307,10 +306,9 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nMachining1Start As Integer
|
||||
Public ReadOnly Property nMachining1Start As Integer
|
||||
Get
|
||||
Return m_nMachining1Start
|
||||
Return ConvertDateTimeToLuaInteger(m_dtMachining1Start)
|
||||
End Get
|
||||
End Property
|
||||
Private m_dtMachining1Start As DateTime
|
||||
@@ -327,10 +325,9 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nMachining1End As Integer
|
||||
Public ReadOnly Property nMachining1End As Integer
|
||||
Get
|
||||
Return m_nMachining1End
|
||||
Return ConvertDateTimeToLuaInteger(m_dtMachining1End)
|
||||
End Get
|
||||
End Property
|
||||
Private m_dtMachining1End As DateTime
|
||||
@@ -347,10 +344,9 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nMachining2Start As Integer
|
||||
Public ReadOnly Property nMachining2Start As Integer
|
||||
Get
|
||||
Return m_nMachining2Start
|
||||
Return ConvertDateTimeToLuaInteger(m_dtMachining2Start)
|
||||
End Get
|
||||
End Property
|
||||
Private m_dtMachining2Start As DateTime
|
||||
@@ -367,10 +363,9 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nMachining2End As Integer
|
||||
Public ReadOnly Property nMachining2End As Integer
|
||||
Get
|
||||
Return m_nMachining2End
|
||||
Return ConvertDateTimeToLuaInteger(m_dtMachining2End)
|
||||
End Get
|
||||
End Property
|
||||
Private m_dtMachining2End As DateTime
|
||||
@@ -387,10 +382,9 @@ Public Class JsonLuaDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nUnloadTime As Integer
|
||||
Public ReadOnly Property nUnloadTime As Integer
|
||||
Get
|
||||
Return m_nUnloadTime
|
||||
Return ConvertDateTimeToLuaInteger(m_dtUnloadTime)
|
||||
End Get
|
||||
End Property
|
||||
Private m_dtUnloadTime As DateTime
|
||||
|
||||
Reference in New Issue
Block a user