Index: vhUnitTest/APPS/Verpakking/DoosService/Test.cls.xml =================================================================== diff -u -r68405 -r68407 --- vhUnitTest/APPS/Verpakking/DoosService/Test.cls.xml (.../Test.cls.xml) (revision 68405) +++ vhUnitTest/APPS/Verpakking/DoosService/Test.cls.xml (.../Test.cls.xml) (revision 68407) @@ -34,8 +34,8 @@ Do DoosFactoryMock.VerwachtMethodCall("MaakDoos", ProductGroep, ReceptNaam).DanReturn(DummyDoos).ExactAantalKeer(1) Do DoosAanvullerMock.VerwachtMethodCall("VulAanBasisInformatieDoos", DummyDoos, .Params, ProductGroep, Prioriteit, MachineTechnologie).DanDoeNiks().ExactAantalKeer(1) Do OptimizerMock.VerwachtMethodCall("Optimize", DummyDoos, ProductGroep).DanReturn(DummyDoos).ExactAantalKeer(1) - Do SnijRequestMakerMock.VerwachtMethodCall("MaakSnijRequest", DummyDoos, MachineTechnologie, MachineID, Prioriteit, Aantal).DanReturn(DummyRequest) - Do SnijDoosServiceMock.VerwachtMethodCall("SnijDoos", DummyRequest).DanDoeNiks() + Do SnijRequestMakerMock.VerwachtMethodCall("MaakSnijRequest", DummyDoos, MachineTechnologie, MachineID, Prioriteit, Aantal).DanReturn(DummyRequest).ExactAantalKeer(1) + Do SnijDoosServiceMock.VerwachtMethodCall("SnijDoos", DummyRequest).DanDoeNiks().ExactAantalKeer(1) Set DoosService = ##class(APPS.Verpakking.DoosService).%New(DoosFactoryMock, DoosAanvullerMock, OptimizerMock, SnijDoosServiceMock, SnijRequestMakerMock) Do DoosService.GeefDoos(ProductGroep, ReceptNaam, MachineID, Aantal, .Params, Prioriteit) Index: vhUnitTest/APPS/Verpakking/Optimizer/Test.cls.xml =================================================================== diff -u -r68405 -r68407 --- vhUnitTest/APPS/Verpakking/Optimizer/Test.cls.xml (.../Test.cls.xml) (revision 68405) +++ vhUnitTest/APPS/Verpakking/Optimizer/Test.cls.xml (.../Test.cls.xml) (revision 68407) @@ -73,221 +73,6 @@ Do $$$AssertEquals(Doos.Swap, VerwachteSwap) ]]> - - - BasisDoos.MinWidth) && (..InitieleBreedte > BasisDoos.MinDepth)) { - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } -} - -Method OptmizeV1LageRug(ByRef BasisDoos As APPS.Verpakking.V1LageRug) [ Private ] -{ - #dim BreedtePlanoVoorSwap As %Decimal = BasisDoos.Width + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K - #dim DieptePlaneVoorSwap As %Decimal = (2 * BasisDoos.Height) + BasisDoos.Depth + (2 * BasisDoos.Height) - - #dim BreedtePlanoNaSwap As %Decimal = BasisDoos.Depth + BasisDoos.Height + BasisDoos.Depth + BasisDoos.Height + BasisDoos.K - #dim DieptePlaneNaSwap As %Decimal = (2 * BasisDoos.Height) + BasisDoos.Width + (2 * BasisDoos.Height) - - #dim NodigeKartonBreedteVoorSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoVoorSwap) - #dim NodigeKartonBreedteNaSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoNaSwap) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap As %Decimal = DieptePlaneVoorSwap * NodigeKartonBreedteVoorSwap - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap As %Decimal = DieptePlaneNaSwap * NodigeKartonBreedteNaSwap - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap) && (..InitieleDiepte > BasisDoos.MinWidth) && (..InitieleBreedte > BasisDoos.MinDepth)) { - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } -} - -Method OptmizeV1LosseOnderdelen(ByRef BasisDoos As APPS.Verpakking.V1LosseOnderdelen) [ Private ] -{ - #dim BreedtePlanoVoorSwap As %Decimal = BasisDoos.K1 + BasisDoos.Depth + BasisDoos.Width + BasisDoos.Depth + BasisDoos.K1 - #dim DieptePlaneVoorSwap As %Decimal = BasisDoos.K2 + BasisDoos.Depth - BasisDoos.T + BasisDoos.Height + BasisDoos.T + (2 * BasisDoos.Height) + BasisDoos.Depth + BasisDoos.Height - - #dim BreedtePlanoNaSwap As %Decimal = BasisDoos.K1 + BasisDoos.Width + BasisDoos.Depth + BasisDoos.Width + BasisDoos.K1 - #dim DieptePlaneNaSwap As %Decimal = BasisDoos.K2 + BasisDoos.Width - BasisDoos.T + BasisDoos.Height + BasisDoos.T + (2 * BasisDoos.Height) + BasisDoos.Width + BasisDoos.Height - - #dim NodigeKartonBreedteVoorSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoVoorSwap) - #dim NodigeKartonBreedteNaSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoNaSwap) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap As %Decimal = DieptePlaneVoorSwap * NodigeKartonBreedteVoorSwap - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap As %Decimal = DieptePlaneNaSwap * NodigeKartonBreedteNaSwap - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap)) { - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } -} - -Method OptmizeComplexeScheiding(ByRef BasisDoos As APPS.Verpakking.ComplexeScheiding) [ Private ] -{ - //SWAP is 0 en er zijn geen altrecipes dus geen optimalisatie nodig -} - -Method OptmizeV1Flatpack(ByRef BasisDoos As APPS.Verpakking.V1Flatpack) [ Private ] -{ - //SWAP is 0 en er zijn geen altrecipes dus geen optimalisatie nodig -} - -Method OptmizeVouwErrondDoos(ByRef BasisDoos As APPS.Verpakking.VouwErrondDoos, ProductGroep As %String) [ Private ] -{ - If (ProductGroep = "KAD") { - If (BasisDoos.Width + ..#MachineKant > 2400) { //Breedte grootste karton - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } - - #dim BreedtePlanoRecept219 As %Decimal = BasisDoos.K1 + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K1 - #dim DieptePlaneRecept219 As %Decimal = BasisDoos.Depth + BasisDoos.Height +BasisDoos.Depth + BasisDoos.Height + BasisDoos.K2 - - #dim BreedtePlanoRecept209 As %Decimal = BasisDoos.Width + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K2 - #dim DieptePlaneRecept209 As %Decimal = BasisDoos.K1 + BasisDoos.Height +BasisDoos.Depth + BasisDoos.Height + BasisDoos.K1 - - #dim NodigeKartonBreedteRecept219 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoRecept219) - #dim NodigeKartonBreedteRecept209 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, DieptePlaneRecept219) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenRecept219 As %Decimal = DieptePlaneRecept219 * NodigeKartonBreedteRecept219 - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenRecept209 As %Decimal = DieptePlaneRecept209 * NodigeKartonBreedteRecept209 - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenRecept219)) { - Set BasisDoos.RecipeID = 209 - } - } Else { - #dim SwapRecept219IsBeter, SwapRecept209IsBeter As %Boolean = $$$False - - #dim BreedtePlanoVoorSwapRecept219 As %Decimal = BasisDoos.K1 + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K1 - #dim DieptePlaneVoorSwapRecept219 As %Decimal = BasisDoos.Depth + BasisDoos.Height +BasisDoos.Depth + BasisDoos.Height + BasisDoos.K2 - - #dim BreedtePlanoNaSwapRecept219 As %Decimal = BasisDoos.K1 + BasisDoos.Height + BasisDoos.Depth + BasisDoos.Height + BasisDoos.K1 - #dim DieptePlaneNaSwapRecept219 As %Decimal = BasisDoos.Width + BasisDoos.Height +BasisDoos.Width + BasisDoos.Height + BasisDoos.K2 - - #dim NodigeKartonBreedteVoorSwapRecept219 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoVoorSwapRecept219) - #dim NodigeKartonBreedteNaSwapRecept219 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoNaSwapRecept219) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept219 As %Decimal = DieptePlaneVoorSwapRecept219 * NodigeKartonBreedteVoorSwapRecept219 - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept219 As %Decimal = DieptePlaneNaSwapRecept219 * NodigeKartonBreedteNaSwapRecept219 - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept219 < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept219)) { - Set SwapRecept219IsBeter = $$$True - } - - #dim BreedtePlanoVoorSwapRecept209 As %Decimal = BasisDoos.Width + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K2 - #dim DieptePlaneVoorSwapRecept209 As %Decimal = BasisDoos.K1 + BasisDoos.Height +BasisDoos.Depth + BasisDoos.Height + BasisDoos.K1 - - #dim BreedtePlanoNaSwapRecept209 As %Decimal = BasisDoos.Width + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K2 - #dim DieptePlaneNaSwapRecept209 As %Decimal = BasisDoos.K1 + BasisDoos.Height +BasisDoos.Depth + BasisDoos.Height + BasisDoos.K1 - - #dim NodigeKartonBreedteVoorSwapRecept209 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoVoorSwapRecept209) - #dim NodigeKartonBreedteNaSwapRecept209 = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoNaSwapRecept209) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept209 As %Decimal = DieptePlaneVoorSwapRecept209 * NodigeKartonBreedteVoorSwapRecept209 - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept209 As %Decimal = DieptePlaneNaSwapRecept209 * NodigeKartonBreedteNaSwapRecept209 - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept209)) { - Set SwapRecept209IsBeter = $$$True - } - - If (SwapRecept219IsBeter && SwapRecept209IsBeter) { - If (OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept219) { - Set BasisDoos.RecipeID = 209 - } - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } ElseIf (SwapRecept219IsBeter && $$$Not(SwapRecept209IsBeter)) { - If (OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept219) { - Set BasisDoos.RecipeID = 209 - } Else { - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } - } ElseIf ($$$Not(SwapRecept219IsBeter) && SwapRecept209IsBeter) { - If (OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwapRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept219) { - Set BasisDoos.RecipeID = 209 - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } - } ElseIf ($$$Not(SwapRecept219IsBeter) && $$$Not(SwapRecept209IsBeter)) { - If (OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept209 < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwapRecept219) { - Set BasisDoos.RecipeID = 209 - } - } - } -} - -Method OptmizeV1DoosMetDeksel(ByRef BasisDoos As APPS.Verpakking.V1DoosMetDeksel) [ Private ] -{ - #dim BreedtePlanoVoorSwap As %Decimal = BasisDoos.Width + BasisDoos.Height + BasisDoos.Width + BasisDoos.Height + BasisDoos.K - #dim DieptePlaneVoorSwap As %Decimal = (2 * BasisDoos.Height) + BasisDoos.Depth + (2 * BasisDoos.Height) - - #dim BreedtePlanoNaSwap As %Decimal = BasisDoos.Depth + BasisDoos.Height + BasisDoos.Depth + BasisDoos.Height + BasisDoos.K - #dim DieptePlaneNaSwap As %Decimal = (2 * BasisDoos.Height) + BasisDoos.Width + (2 * BasisDoos.Height) - - #dim NodigeKartonBreedteVoorSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoVoorSwap) - #dim NodigeKartonBreedteNaSwap = ..GetCardboardProductBreedte(BasisDoos.Thickness, BasisDoos.LogoPrint, BreedtePlanoNaSwap) - - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap As %Decimal = DieptePlaneVoorSwap * NodigeKartonBreedteVoorSwap - #dim OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap As %Decimal = DieptePlaneNaSwap * NodigeKartonBreedteNaSwap - - If ((OppervlakteKartonOmVerpakkingUitTeSnijdenNaSwap < OppervlakteKartonOmVerpakkingUitTeSnijdenVoorSwap)) { - Set BasisDoos.Width = ..InitieleDiepte - Set BasisDoos.Depth = ..InitieleBreedte - } -} - -ClassMethod GetCardboardProductID(Dikte As %Decimal, LogoPrint As %String, PlanoBreedte As %Decimal) As %String [ Private ] -{ - Set Product="" - Set PlanoBreedte=PlanoBreedte+..#MachineKant - &sql(DECLARE GetProduct CURSOR FOR - Select Breedte, Product, CardBoardID - into :Breedte, :PRNr, :CardBoardID - from Prod.OptiBox_btCardboard - where Dikte=:Dikte and LogoPrint=:LogoPrint and Breedte>=:PlanoBreedte order by Breedte asc) - - &sql(OPEN GetProduct) - &sql(FETCH GetProduct) - &sql(CLOSE GetProduct) - - Quit CardBoardID -} - -ClassMethod GetCardboardProductBreedte(Dikte As %Decimal, LogoPrint As %String, PlanoBreedte As %Decimal) As %Decimal [ Private ] -{ - Set Product="" - Set PlanoBreedte=PlanoBreedte+..#MachineKant - &sql(DECLARE GetProductWidth CURSOR FOR - Select Breedte, Product, CardBoardID - into :Breedte, :PRNr, :CardBoardID - from Prod.OptiBox_btCardboard - where Dikte=:Dikte and LogoPrint=:LogoPrint and Breedte>=:PlanoBreedte order by Breedte asc) - - &sql(OPEN GetProductWidth) - &sql(FETCH GetProductWidth) - &sql(CLOSE GetProductWidth) - - Quit Breedte -} -*/ -]]> -