Index: TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb =================================================================== diff -u -r1599 -r1600 --- TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb (.../HoofdAansturingRework.vb) (revision 1599) +++ TAOR-rework-bugfixing/TAOR rework/Rework/HoofdAansturingRework.vb (.../HoofdAansturingRework.vb) (revision 1600) @@ -3,6 +3,110 @@ Private _productieData As ZijkamerFreesProductieData Private ReadOnly _productieDatas As New List(Of ZijkamerFreesProductieData) + 'TODO Code opkuisen voor rework trays (normale reworks) +#Region "Rework tray (normale reworks)" + + Public Sub VerwerkTray(tray As ReworkTray) + Try + For Each slot As Slot In tray.geefNietLegeSlots + If slot.zijkanten.Count > 0 Then + + OpslaanInAutomilling() + + For Each zijkant As Rework In slot.zijkanten + 'de opdracht resetten in de afkanter + ResetOpdrachtAfkanter(zijkant.barcode) + Next + + 'als het een paar is de andere van het paar verwijderen + slot.verwijderTweedeVanPaar() + + End If + Next + Catch ex As Exception + Throw ex + End Try + End Sub + + Private Sub OpslaanInAutomilling() + For Each data As ZijkamerFreesProductieData In _productieDatas + If data Is Nothing Then + _productieDatas.Clear() + Throw New Exception("Automilling data mag niet Nothing zijn om op te slaan") + End If + 'kijken of het wel moet worden opgeslagen + If Configs.geefVerwerkStatus Then + AutomillingMapper.opslaan(data) + End If + Next + _productieDatas.Clear() + End Sub + + Public Sub updateTray(tray As ReworkTray) + Try + For Each slot As Slot In tray.geefNietLegeSlots + If slot.zijkanten.Count > 0 Then + Dim linksOfRechts As String = slot.zijkanten(0).geefLinksOfRechts() + + 'In automilling (technologica) laten verwerken + If slot.zijkanten.Count >= 2 Then + MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst, slot.zijkanten(1).barcode, slot.zijkanten(1).geefLinksOfRechts()) + Else + MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst) + End If + + 'de naam van onderdeel naar "ONDERDEEL LR" zetten + 'als een van de twee niet in ardis wordt opgeslagen de andere automatisch ook niet! + slot.updateReworkOnderdeel() + + 'waarden in de rework invullen + slot.zijkanten(0).color = If(slot.type = SlotType.dubbel, _productieData.colorDubbel, _productieData.colorEnkel) + slot.zijkanten(0).length = _productieData.length + slot.zijkanten(0).height = _productieData.height + + 'In ARDIS per zijkant twee planken zagen (er moet maar 1 zijkant worden meegegeven, onderdeel is naar LR gezet) + HerzaagRework(slot.zijkanten(0), tray.nummer, slot.nummer) + End If + Next + Catch ex As Exception + Throw ex + End Try + End Sub + + Private Sub MaakFreesOpdrachtInReworkTray(ByVal barcodeID As String, ByVal linksOfRechts As String, ByVal nieuwTrayNummer As String, ByVal slotNr As String, ByVal voorVoorraad As Boolean, etiketTekst As String, Optional barcodeID2 As String = "", Optional andereZijkantLinksOfRechts As String = "") + Try + _productieData = AutomillingMapper.OphalenUitProductie(barcodeID) + If _productieData Is Nothing Then + _productieData = AutomillingMapper.OphalenUitHistoriek(barcodeID) + If _productieData Is Nothing Then + Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) + End If + End If + + 'als het een uit een paar is updaten met de informatie uit de andere van het paar + If barcodeID2.Equals("") Then + _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst) + Else + Dim productieDataAndere As ZijkamerFreesProductieData + productieDataAndere = AutomillingMapper.OphalenUitProductie(barcodeID2) + If productieDataAndere Is Nothing Then + productieDataAndere = AutomillingMapper.OphalenUitHistoriek(barcodeID2) + If productieDataAndere Is Nothing Then + Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) + End If + End If + _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst, productieDataAndere, andereZijkantLinksOfRechts) + End If + _productieDatas.Add(_productieData.ShallowCopy) + Catch ex As Exception + Throw ex + End Try + End Sub + +#End Region + +#Region "Special rework" + Public Sub VerwerkRug(rug As Rework) 'Naar Ardis sturen. HerzaagRework(rug) @@ -23,6 +127,8 @@ 'Productie tabel wordt nooit gewist op stemasC en insert moet dus niet worden uitgevoerd. End Sub +#End Region + ''' ''' Herzagen van het de rework. ''' @@ -49,6 +155,7 @@ HerzaagOnderdeelMetBarcode(rework.barcode) Else 'Voor zijkanten wordt gekeken of het links, rechts, beide of gewoon een zijkant is. + 'Waarde ziet er uit als 'ZIJKANT', 'ZIJKANT LI' of 'ZIJKANT LIS' Dim linksEnOfRechts As String = rework.onderdeel.ToUpper() 'Kijk of het een normale zijkant is. @@ -116,44 +223,6 @@ End Try End Sub -#Region "Tray" - Public Sub VerwerkTray(tray As ReworkTray) - Try - For Each slot As Slot In tray.geefNietLegeSlots - If slot.zijkanten.Count > 0 Then - - OpslaanInAutomilling() - - For Each zijkant As Rework In slot.zijkanten - 'de opdracht resetten in de afkanter - ResetOpdrachtAfkanter(zijkant.barcode) - Next - - 'als het een paar is de andere van het paar verwijderen - slot.verwijderTweedeVanPaar() - - End If - Next - Catch ex As Exception - Throw ex - End Try - End Sub - - Private Sub OpslaanInAutomilling() - For Each data As ZijkamerFreesProductieData In _productieDatas - If data Is Nothing Then - _productieDatas.Clear() - Throw New Exception("Automilling data mag niet Nothing zijn om op te slaan") - End If - 'kijken of het wel moet worden opgeslagen - If Configs.geefVerwerkStatus Then - AutomillingMapper.opslaan(data) - End If - Next - _productieDatas.Clear() - End Sub -#End Region - ''' ''' De opdracht resetten in de afkanter. ''' @@ -200,66 +269,5 @@ End Try End Sub - Public Sub updateTray(tray As ReworkTray) - Try - For Each slot As Slot In tray.geefNietLegeSlots - If slot.zijkanten.Count > 0 Then - Dim linksOfRechts As String = slot.zijkanten(0).geefLinksOfRechts() - - 'In automilling (technologica) laten verwerken - If slot.zijkanten.Count >= 2 Then - MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst, slot.zijkanten(1).barcode, slot.zijkanten(1).geefLinksOfRechts()) - Else - MaakFreesOpdrachtInReworkTray(slot.zijkanten(0).barcode, linksOfRechts, tray.nummer, slot.nummer, slot.zijkanten(0).voorVoorraad, slot.zijkanten(0).etiketTekst) - End If - - 'de naam van onderdeel naar "ONDERDEEL LR" zetten - 'als een van de twee niet in ardis wordt opgeslagen de andere automatisch ook niet! - slot.updateReworkOnderdeel() - - 'waarden in de rework invullen - slot.zijkanten(0).color = If(slot.type = SlotType.dubbel, _productieData.colorDubbel, _productieData.colorEnkel) - slot.zijkanten(0).length = _productieData.length - slot.zijkanten(0).height = _productieData.height - - 'In ARDIS per zijkant twee planken zagen (er moet maar 1 zijkant worden meegegeven, onderdeel is naar LR gezet) - HerzaagRework(slot.zijkanten(0), tray.nummer, slot.nummer) - End If - Next - Catch ex As Exception - Throw ex - End Try - End Sub - - Private Sub MaakFreesOpdrachtInReworkTray(ByVal barcodeID As String, ByVal linksOfRechts As String, ByVal nieuwTrayNummer As String, ByVal slotNr As String, ByVal voorVoorraad As Boolean, etiketTekst As String, Optional barcodeID2 As String = "", Optional andereZijkantLinksOfRechts As String = "") - Try - _productieData = AutomillingMapper.OphalenUitProductie(barcodeID) - If _productieData Is Nothing Then - _productieData = AutomillingMapper.OphalenUitHistoriek(barcodeID) - If _productieData Is Nothing Then - Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) - End If - End If - - 'als het een uit een paar is updaten met de informatie uit de andere van het paar - If barcodeID2.Equals("") Then - _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst) - Else - Dim productieDataAndere As ZijkamerFreesProductieData - productieDataAndere = AutomillingMapper.OphalenUitProductie(barcodeID2) - If productieDataAndere Is Nothing Then - productieDataAndere = AutomillingMapper.OphalenUitHistoriek(barcodeID2) - If productieDataAndere Is Nothing Then - Throw New Exception("De productieData kon niet worden opgehaald uit automiling met barcode: " & barcodeID) - End If - End If - _productieData.aanpassenData(linksOfRechts, nieuwTrayNummer, slotNr, voorVoorraad, etiketTekst, productieDataAndere, andereZijkantLinksOfRechts) - End If - _productieDatas.Add(_productieData.ShallowCopy) - Catch ex As Exception - Throw ex - End Try - End Sub - End Class End Namespace \ No newline at end of file