-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcntPosition.vb
More file actions
3146 lines (2575 loc) · 128 KB
/
Copy pathcntPosition.vb
File metadata and controls
3146 lines (2575 loc) · 128 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'Copyright 2009 Paxton Technologies Inc.
Imports System.Data.SqlClient
Imports System.Web.Security
Imports System.Web.Mail
Imports System.Net
Imports System.Text
Imports System.IO
Imports System.Reflection
Imports TrailerLoading
Imports System
Imports System.Collections
Imports System.Data
Imports system.web
Namespace TrailerLoading
Public Class cntPosition
Inherits System.Web.UI.Page
Public Shared noOfAxles
Public Shared axleSpacing
Public Shared MovieName As String
Public Shared drawMCTop
Public Shared drawMCSide
Public Shared drawMCEnd
Public Shared FAlpha = 100
Public Shared ColorName = "green"
Public Shared c = 0
Public Shared nextCntBurstWgt = 10000
Public Shared posW As Decimal = 0
Public Shared posWE As Decimal = 0
Public Shared posL As Decimal = 0
Public Shared posH As Decimal = 0
Public Shared trailerRow = 1
Public Shared cntBurstWeight = 10000
Public Shared prevCntArea = 61056
Public Shared cntArea = 0
Public Shared cntRemainArea = 10000
Public Shared contactArea '= 0
Public Shared contactAreaBurstPsiGood = True
Public Shared noCntLoaded = 0
Public Shared noCntOnTruck = 0
Public Shared noSurfLoaded = 0
Public Shared noSurfRemoved = 0
Public Shared noSurfChecked = 0
Public Shared nextCntWidth As Decimal = 0
Public Shared nextCntLength As Decimal = 0
Public Shared nextCntHeight As Decimal = 0
Public Shared nextCntID
Public Shared cntLoading = 0
Public Shared prevCntID = 0
Public Shared widthRemain As Decimal = 0
Public Shared nextCntBurstWeight = 0
Public Shared nextCntWgt = 0
Public Shared loadedTrailerWgt = 0
Public Shared maxTrailerW = 97 'pull from web later
Public Shared maxTrailerL = 636 'pull from web later
Public Shared maxTrailerH = 109 'pull from web later
Public Shared truckNetWeight = 15000
Public Shared trailerNetWeight = 13000
Public Shared driveAxleNetLoad = (truckNetWeight / 2) + (trailerNetWeight / 2)
Public Shared rearAxleNetLoad = trailerNetWeight / 2
Public Shared maxTrailerWgt = 54000 'pull from web later
Public Shared singleDriveAxle As Boolean = False
Public Shared tandemDriveAxle As Boolean = False
Public Shared singleRearAxle As Boolean = False
Public Shared tandemRearAxle As Boolean = False
Public Shared minTrailerLength As Decimal = 0
Public Shared minTrailerLengthFeet = 0
Public Shared minTrailerlengthInches = 0
Public Shared totalNoOfCnts = 16 'pull from web later
Public Shared hitFlagTop = False
Public Shared hitFlagSide = False
Public Shared hitFlagEnd = False
Public Shared hitFlagTrailer = False
Public Shared hitFlagCnt = False
Public Shared p2HitFlag As Boolean = False
Public Shared p1HitFlag As Boolean = False
Public Shared heightPln = 0
Public Shared topOffsetX = 40
Public Shared topOffsetY = 80
Public Shared sideOffsetX = 40
Public Shared sideOffsetY = 351 + 109
Public Shared endOffsetX = 867
Public Shared endOffsetY = 460
Public Shared cntSeqNoInHeightPln = 0
Public Shared p8x As Decimal
Public Shared p8y As Decimal
Public Shared p8z As Decimal
Public Shared p2x As Decimal
Public Shared p2y As Decimal
Public Shared p2z As Decimal
Public Shared p3x As Decimal
Public Shared p3y As Decimal
Public Shared p3z As Decimal
Public Shared p4x As Decimal
Public Shared p4y As Decimal
Public Shared p4z As Decimal
Public Shared p5x As Decimal
Public Shared p5y As Decimal
Public Shared p5z As Decimal
Public Shared p6x As Decimal
Public Shared p6y As Decimal
Public Shared p6z As Decimal
Public Shared p7x As Decimal
Public Shared p7y As Decimal
Public Shared p7z As Decimal
Public Shared p1xHit = False
Public Shared p1yHit = False
Public Shared p1zHit = False
Public Shared p2xHit = False
Public Shared p2yHit = False
Public Shared p2zHit = False
Public Shared p3xHit = False
Public Shared p3yHit = False
Public Shared p3zHit = False
Public Shared p4xHit = False
Public Shared p4yHit = False
Public Shared p4zHit = False
Public Shared p5xHit = False
Public Shared p5yHit = False
Public Shared p5zHit = False
Public Shared p6xHit = False
Public Shared p6yHit = False
Public Shared p6zHit = False
Public Shared p7xHit = False
Public Shared p7yHit = False
Public Shared p7zHit = False
Public Shared p8xHit = False
Public Shared p8yHit = False
Public Shared p8zHit = False
Public Shared tmpp1xHit = False
Public Shared tmpp1yHit = False
Public Shared tmpp1zHit = False
Public Shared tmpp2xHit = False
Public Shared tmpp2yHit = False
Public Shared tmpp2zHit = False
Public Shared tmpp3xHit = False
Public Shared tmpp3yHit = False
Public Shared tmpp3zHit = False
Public Shared tmpp4xHit = False
Public Shared tmpp4yHit = False
Public Shared tmpp4zHit = False
Public Shared tmpp5xHit = False
Public Shared tmpp5yHit = False
Public Shared tmpp5zHit = False
Public Shared tmpp6xHit = False
Public Shared tmpp6yHit = False
Public Shared tmpp6zHit = False
Public Shared tmpp7xHit = False
Public Shared tmpp7yHit = False
Public Shared tmpp7zHit = False
Public Shared tmpp8xHit = False
Public Shared tmpp8yHit = False
Public Shared tmpp8zHit = False
Public Shared tmpP8x As Decimal
Public Shared topFrontCheck = False
Public Shared contactAreaSizeOk = False
Public Shared checkTopNextCounter = 0
Public Shared minBurstStrength = 0
Public Shared tmpMinBurstStrength = 0
Public Shared tmpP8xVal As Decimal = 0
Public Shared kingPinOverHang = 60
Public Shared driveAxleWgt = driveAxleNetLoad
Public Shared rearAxleWgt = rearAxleNetLoad
Public Shared txtInit = 0
Public Shared startTime
Public Shared endTime
Public Shared nowTime
Public Shared lX = 0
Public Const gridSizeS = 34
Public Const ArrayNumberS = 1000
Public Const gridSizeC = 13
Public Const ArrayNumberC = 1000
Public Shared loadArrC(ArrayNumberC, gridSizeC) As String
Public Shared surfaceArr(ArrayNumberS, gridSizeS) As String
Public Shared p2HitFlagArr(100, 3) As String
Public Shared p1HitFlagArr(100, 3) As String
Public Shared surfFound As Boolean = False
Public Shared verticalContact As Boolean = False
Public Shared verticalContactRight As Boolean = False
Public Shared surfaceContact As Boolean = False
Public Shared foundMatch As Boolean = False
Public Shared burstStrength = 0
Public Shared p2HitFlagCounter As Integer = 0
Public Shared p1HitFlagCounter As Integer = 0
Public Shared driveAxleNoTxt As String
Public Shared rearAxleNoTxt As String
Public Shared Function InitVars()
driveAxleNoTxt = ""
rearAxleNoTxt = ""
FAlpha = 100
ColorName = "green"
c = 0
nextCntBurstWgt = 10000
posW = 0
posWE = 0
posL = 0
posH = 0
trailerRow = 1
cntBurstWeight = 10000
prevCntArea = 61056
cntArea = 0
cntRemainArea = 10000
contactAreaBurstPsiGood = True
noCntLoaded = 0
noCntOnTruck = 0
noSurfLoaded = 0
noSurfChecked = 0
nextCntWidth = 0
nextCntLength = 0
nextCntHeight = 0
cntLoading = 0
prevCntID = 0
widthRemain = 0
nextCntBurstWeight = 0
nextCntWgt = 0
loadedTrailerWgt = 0
maxTrailerW = 97 'pull from web later
maxTrailerL = 636 'pull from web later
maxTrailerH = 109 'pull from web later
truckNetWeight = 15000
trailerNetWeight = 13000
driveAxleNetLoad = (truckNetWeight / 2) + (trailerNetWeight / 2)
rearAxleNetLoad = trailerNetWeight / 2
maxTrailerWgt = 54000 'pull from web later
singleDriveAxle = False
tandemDriveAxle = False
singleRearAxle = False
tandemRearAxle = False
driveAxleWgt = driveAxleNetLoad
rearAxleWgt = rearAxleNetLoad
minTrailerLength = 0
minTrailerLengthFeet = 0
minTrailerlengthInches = 0
totalNoOfCnts = 16 'pull from web later
hitFlagTop = False
hitFlagSide = False
hitFlagEnd = False
hitFlagTrailer = False
hitFlagCnt = False
p2HitFlag = False
p1HitFlag = False
heightPln = 0
topOffsetX = 40
topOffsetY = 80
sideOffsetX = 40
sideOffsetY = 351 + 109
endOffsetX = 867
endOffsetY = 460
cntSeqNoInHeightPln = 0
p8x = 0
p8y = 0
p8z = 0
p2x = 0
p2y = 0
p2z = 0
p3x = 0
p3y = 0
p3z = 0
p4x = 0
p4y = 0
p4z = 0
p5x = 0
p5y = 0
p5z = 0
p6x = 0
p6y = 0
p6z = 0
p7x = 0
p7y = 0
p7z = 0
p1xHit = False
p1yHit = False
p1zHit = False
p2xHit = False
p2yHit = False
p2zHit = False
p3xHit = False
p3yHit = False
p3zHit = False
p4xHit = False
p4yHit = False
p4zHit = False
p5xHit = False
p5yHit = False
p5zHit = False
p6xHit = False
p6yHit = False
p6zHit = False
p7xHit = False
p7yHit = False
p7zHit = False
p8xHit = False
p8yHit = False
p8zHit = False
tmpP8x = 0
topFrontCheck = False
contactAreaSizeOk = False
checkTopNextCounter = 0
minBurstStrength = 0
tmpMinBurstStrength = 0
p1HitFlag = False
tmpP8xVal = 0
kingPinOverHang = 60
txtInit = 0
lX = 0
surfFound = False
verticalContact = False
surfaceContact = False
foundMatch = False
burstStrength = 0
noSurfRemoved = 0
End Function
Public Shared Function updateLoadData(ByVal sessionID As String, ByVal varShipmentID As String)
Dim connection As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("connectionstring"))
Dim command As New SqlCommand("updateLoadData", connection)
command.CommandType = CommandType.StoredProcedure
Dim x As Integer
For x = 0 To noCntLoaded - 1
Dim varCntID = surfaceArr(x, 4)
Dim varCSessionID = sessionID
Dim varCPosL = surfaceArr(x, 2)
Dim varCPosW = surfaceArr(x, 1)
Dim varCPosH = surfaceArr(x, 3)
Dim varCPalletWidth = surfaceArr(x, 6)
Dim varCPalletLength = surfaceArr(x, 5)
Dim ifUsed = surfaceArr(x, 12)
If ifUsed = "used" Then
command.Parameters.Clear()
command.Parameters.Add("@shipmentID", varShipmentID)
command.Parameters.Add("@cntID", varCntID)
command.Parameters.Add("@cSessionID", varCSessionID)
command.Parameters.Add("@cPosL", varCPosL)
command.Parameters.Add("@cPosW", varCPosW)
command.Parameters.Add("@cPosH", varCPosH)
command.Parameters.Add("@cPalletWidth", varCPalletWidth)
command.Parameters.Add("@cPalletLength", varCPalletLength)
Try
connection.Open()
command.ExecuteNonQuery()
connection.Close()
Catch
End Try
End If
Next x
End Function
Public Shared Function showData(ByVal shipmentID As String, ByVal cSessionID As String)
initvars()
Dim connection As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("connectionstring"))
Dim command As SqlCommand = New SqlCommand("getLoadData", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@shipmentID", shipmentID)
command.Parameters.Add("@cSessionID", cSessionID)
connection.Open()
Dim cntReader As SqlDataReader = command.ExecuteReader
Dim x As Integer = 0
While cntReader.Read
loadArrC(x, 0) = trailerRow
loadArrC(x, 1) = posW
loadArrC(x, 2) = posL
loadArrC(x, 3) = posH
loadArrC(x, 10) = heightPln
loadArrC(x, 12) = posWE
Dim nextCntShipmentID = cntReader("shipmentID")
Dim nextCntShipmentStopNumber = cntReader("shipmentStopNumber")
Dim varPalletLength As Decimal = CDec(cntReader("palletLength"))
Dim varPalletWidth As Decimal = CDec(cntReader("palletWidth"))
If varPalletLength > varPalletWidth Then
nextCntLength = CDec(cntReader("palletWidth"))
nextCntWidth = CDec(cntReader("palletLength"))
loadArrC(x, 5) = CStr(nextCntLength)
loadArrC(x, 6) = CStr(nextCntWidth)
Else
nextCntLength = CDec(cntReader("palletLength"))
nextCntWidth = CDec(cntReader("palletWidth"))
loadArrC(x, 6) = CStr(nextCntWidth)
loadArrC(x, 5) = CStr(nextCntLength)
End If
Dim varLoadArrc6 As Decimal = CDec(loadArrC(x, 6))
Dim varLoadArrc5 As Decimal = CDec(loadArrC(x, 5))
If nextCntLength = 78 Then
Dim debugStop As String = "stop"
End If
nextCntHeight = cntReader("palletHeight")
loadArrC(x, 7) = nextCntHeight
Dim varLoadArr7 As Decimal = CDec(loadArrC(x, 7))
nextCntWgt = cntReader("palletWeight")
loadArrC(x, 8) = nextCntWgt
loadedTrailerWgt = loadedTrailerWgt + nextCntWgt
If loadedTrailerWgt > maxTrailerWgt Then
Exit Function
End If
Dim nextTypeOfContainer = cntReader("typeOfContainer")
nextCntBurstWgt = cntReader("burstWeight")
loadArrC(x, 9) = nextCntBurstWgt
Dim nextSessionID = cntReader("sessionid")
nextCntID = cntReader("containerID")
loadArrC(x, 4) = nextCntID
loadArrC(x, 11) = nextCntWidth * nextCntLength
cntArea = nextCntWidth * nextCntLength
noCntLoaded = noCntLoaded + 1
loadSurface()
x = x + 1
End While
connection.Close()
End Function
Public Shared Sub NumberCntLoaded()
End Sub
Public Shared Function mainMovie(ByVal varSessionID As String, ByVal varShipmentID As String)
noSurfLoaded = 0
Dim x As Integer
For x = 0 To noCntLoaded - 1
nextCntWidth = CDec(loadArrC(x, 6))
nextCntLength = CDec(loadArrC(x, 5))
If nextCntLength > nextCntWidth Then
Dim debugStop As String = "stop"
End If
nextCntID = loadArrC(x, 4)
cntLoading = nextCntID
If cntLoading = "832" Then
Dim stopHere As String
stopHere = "now"
End If
nextCntHeight = CDec(loadArrC(x, 7))
cntArea = CDec(loadArrC(x, 11))
nextCntWgt = CDec(loadArrC(x, 8))
'*************************************************************************************************************************
If noSurfLoaded = 0 Then
setContainerPosVal()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
calcAxleWeight()
noSurfLoaded = noSurfLoaded + 1
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
GoTo endofloop
End If
'**********************************************************************************************************************************************
resetHitFlags()
'**********************************************************************************************************************************************
Dim xT As Integer = 0
xT = xT + noSurfRemoved
xT = xT
surfFound = False
While xT < noSurfLoaded And surfFound = False
setNextTestPos(xT)
Dim xTsub As Integer = 0
xTsub = xTsub + noSurfRemoved
xTsub = xTsub
While xTsub < noSurfLoaded
setNextTestPosShiftDown(xTsub)
checkContainerInt()
checkTrailerInt()
checkLoadPath()
checkSurfaceContact()
If hitFlagCnt = False And hitFlagTrailer = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
surfFound = True
checkVerticalContact()
If verticalContact = False And posL > 0 Then
findVertSurf()
checkContainerInt()
checkLoadPath()
surfaceContact = False
checkSurfaceContact()
If hitFlagCnt = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
Else
If hitFlagCnt = False Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
End If
End If
resetHitFlags()
resetSurfFlags()
xTsub = xTsub + 1
End While
xT = xT + 1
If xT <> noSurfLoaded And surfFound = True And hitFlagCnt = False And surfaceContact = True Then
GoTo EndOfLoop
End If
End While
'**************************************************************************************************************************************************
If surfFound = True And hitFlagCnt = False And surfaceContact = True Then
surfFound = False
GoTo endofloop
End If
rotateCnt()
resetHitFlags()
'**************************************************************************************************************************************************
xT = 0
surfFound = False
xT = xT + noSurfRemoved
While xT < noSurfLoaded And surfFound = False
setNextTestPos(xT)
Dim xTsub = 0
xTsub = xTsub + noSurfRemoved
While xTsub < noSurfLoaded
setNextTestPosShiftDown(xTsub)
checkContainerInt()
checkTrailerInt()
checkLoadPath()
checkSurfaceContact()
If hitFlagCnt = False And hitFlagTrailer = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
surfFound = True
checkVerticalContact()
If verticalContact = False And posL > 0 Then
findVertSurf()
checkContainerInt()
checkLoadPath()
surfaceContact = False
checkSurfaceContact()
If hitFlagCnt = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
Else
If hitFlagCnt = False Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
End If
End If
resetHitFlags()
resetSurfFlags()
xTsub = xTsub + 1
End While
xT = xT + 1
If xT <> noSurfLoaded And surfFound = True And hitFlagCnt = False And surfaceContact = True Then
GoTo EndOfLoop
End If
End While
'**************************************************************************************************************************************************
If surfFound = True And hitFlagCnt = False And surfaceContact = True Then
surfFound = False
GoTo endofloop
End If
rotateCnt()
resetHitFlags()
'**************************************************************************************************************************************************
xT = 0
xT = xT + noSurfRemoved
While xT < noSurfLoaded
setNextTestPos(xT)
checkContainerInt()
checkTrailerInt()
checkLoadPath()
checkSurfaceContact()
If hitFlagCnt = False And hitFlagTrailer = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
checkVerticalContact()
If verticalContact = False And posL > 0 Then
findVertSurf()
checkContainerInt()
checkLoadPath()
surfaceContact = False
checkSurfaceContact()
If hitFlagCnt = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
Else
If hitFlagCnt = False Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
End If
End If
resetHitFlags()
resetSurfFlags()
xT = xT + 1
End While
If xT <> noSurfLoaded And hitFlagCnt = False Then
GoTo EndOfLoop
End If
'**************************************************************************************************************************************************
rotateCnt()
resetHitFlags()
'**************************************************************************************************************************************************
xT = 0
xT = xT + noSurfRemoved
While xT < noSurfLoaded
setNextTestPos(xT)
checkContainerInt()
checkTrailerInt()
checkLoadPath()
checkSurfaceContact()
If hitFlagCnt = False And hitFlagTrailer = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
checkVerticalContact()
If verticalContact = False And posL > 0 Then
findVertSurf()
checkContainerInt()
checkLoadPath()
surfaceContact = False
checkSurfaceContact()
If hitFlagCnt = False And surfaceContact = True And contactAreaBurstPsiGood = True And contactAreaSizeOk = True Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
Else
If hitFlagCnt = False Then
If posH = 0 Then
moveToTrailerWall()
If hitFlagCnt = False Then
findVertSurf()
End If
End If
If posW > 0 And posH = 0 Then
checkVerticalContactRight()
If verticalContactRight = False Then
findVertSurfRight()
End If
checkVerticalContact()
If verticalContact = False Then
findVertSurf()
End If
End If
resetHitFlags()
setContainerPosVal()
checkTrailerInt()
checkLoadPath()
checkContainerInt()
If hitFlagTrailer = False And hitFlagCnt = False Then
calcAxleWeight()
nextCntID = cntLoading
addSurfaceData(varSessionID, varShipmentID)
prevCntID = nextCntID
removeSurface(nextCntID, varSessionID, varShipmentID)
noSurfLoaded = noSurfLoaded + 1
GoTo endofloop
End If
End If
End If
End If
resetHitFlags()
resetSurfFlags()
xT = xT + 1
End While
If xT <> noSurfLoaded And hitFlagCnt = False Then
GoTo EndOfLoop
End If
'**************************************************************************************************************************************************
rotateCnt()
resetHitFlags()
'**************************************************************************************************************************************************
xT = 0
p2HitFlag = False
p1HitFlag = False
tmpP8xVal = 0
xT = xT + noSurfRemoved
While xT < noSurfLoaded
SetNextTestPosTop(xT)
p2HitFlag = False
p1HitFlag = False
checkContainerInt()
checkLoadPath()
If p2HitFlag = True And posH > 0 And posL > 0 Then
Dim p2HitFlagChecker As Integer = 0
For p2HitFlagChecker = 0 To p2HitFlagCounter
If p2HitFlagArr(p2HitFlagChecker, 0) >= minTrailerLength - 96 Then
p2HitFlag = False
posL = CDec(p2HitFlagArr(p2HitFlagChecker, 0))
p2x = CDec(p2HitFlagArr(p2HitFlagChecker, 0))
p5x = CDec(p2HitFlagArr(p2HitFlagChecker, 0))
p6x = CDec(p2HitFlagArr(p2HitFlagChecker, 0))
posW = CDec(p2HitFlagArr(p2HitFlagChecker, 1))
posH = CDec(p2HitFlagArr(p2HitFlagChecker, 2))
resetHitFlags()
checkContainerInt()
checkLoadPath()
If hitFlagCnt = False Then
Exit For
End If
End If
Next p2HitFlagChecker
End If
If p1HitFlag = True And posH > 0 And posL > 0 Then
Dim p1HitFlagChecker As Integer = 0
For p1HitFlagChecker = 0 To p1HitFlagCounter
If p2HitFlagArr(p1HitFlagChecker, 0) >= minTrailerLength - 96 Then
p1HitFlag = False
posL = CDec(p1HitFlagArr(p1HitFlagChecker, 0))
p2x = CDec(p1HitFlagArr(p1HitFlagChecker, 0))
p5x = CDec(p1HitFlagArr(p1HitFlagChecker, 0))
p6x = CDec(p1HitFlagArr(p1HitFlagChecker, 0))