-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparcelSizes.java
More file actions
97 lines (76 loc) · 3.22 KB
/
parcelSizes.java
File metadata and controls
97 lines (76 loc) · 3.22 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
package auto;
import java.awt.*;
import javax.swing.*;
import javax.swing.JOptionPane;
/**
*
* Description
*
* @version 1.0 from 7/30/2016
* @author Tim Gathercole
*/
// import dxf12objects;
public class parcelSizes {
// start attributes
public double odLength = 0;
public double odWidth = 0;
public double odDepth = 0;
public double d0421Area = (odDepth * 3 + odWidth * 2) * (odLength + odDepth * 2 + (45 * 2));
public double d02030701Area = (odWidth * 2 + odDepth + 28) * (odLength * 2 + odWidth * 2);
private double pctReduce = 0;
public String style = "d0421+";
// end attributes
// start methods
public void checkSizes() {
d0421Area = (odDepth * 3 + odWidth * 2) * (odLength + odDepth * 2 + (45 * 2));
d02030701Area = (odWidth * 2 + odDepth + 28) * (odLength * 2 + odWidth * 2);
pctReduce = ((d0421Area - d02030701Area) / d02030701Area) * 100;
String msg = "";
if (style == "d0421+" && d02030701Area < d0421Area) {
msg += "CONSIDER 0203+/0701 - BOARD EFFICIENCY\n\n";
}
if ((d02030701Area > d0421Area)) { // style == "Full Overlap/0701 Auto Full OL" &&
pctReduce = ((d0421Area - d02030701Area) / d02030701Area) * 100;
String tmp = String.format("%10.2f", pctReduce);
msg += "CONSIDER Mailbox 0421+ - BOARD EFFICIENCY " + tmp + "%\n\n";
}
// Parcel sizes
if (this.odLength > 240 || this.odWidth > 165 || this.odDepth > 5) {
msg += "***RM Letter up to 100g 240x165x5 - TOO BIG ***\n";
} else {
msg += "RM Letter up to 100g - OK\n";
}// end of if
if (this.odLength > 353 || this.odWidth > 250 || this.odDepth > 25) {
msg += "***RM Large Letter up to 750g 353x250x25 - TOO BIG ***\n";
} else {
msg += "RM Large Letter up to 750g - OK\n";
}// end of if
if (this.odLength > 415 || this.odWidth > 203 || this.odDepth > 25) {
msg += "***Min Letterbox (Lil Pkg Data) 415x203x25 - TOO BIG ***\n";
} else {
msg += "Min Letterbox (Lil Pkg Data) - OK\n";
}// end of if
if (this.odLength > 415 || this.odWidth > 254 || this.odDepth > 33) { // ** Lil Pkg data
msg += "***TYPICAL Letterbox (Lil Pkg Data) 415x254x33 - TOO BIG ***\n";
} else {
msg += "TYPICAL Letterbox (Lil Pkg Data) - OK\n";
}// end of if
if (this.odLength > 415 || this.odWidth > 305 || this.odDepth > 38) { // ** Lil Pkg data
msg += "***Largest Letterbox (Lil Pkg Data) 415x254x38 - TOO BIG ***\n";
} else {
msg += "Largest Letterbox (Lil Pkg Data) - OK\n";
}// end of if
if (this.odLength > 450 || this.odWidth > 350 || this.odDepth > 160) {
msg += "***RM Small Parcel up to 2kg 450x350x160 - TOO BIG ***\n";
} else {
msg += "RM Small Parcel up to 2kg - OK\n";
}// end of if
if (this.odLength > 610 || this.odWidth > 460 || this.odDepth > 460) {
msg += "***RM Medium Parcel up to 20kg 610x460x460 - TOO BIG ***\n";
} else {
msg += "RM Medium Parcel up to 20kg - OK\n";
}// end of if
JOptionPane.showMessageDialog(null, msg, "Info", JOptionPane.INFORMATION_MESSAGE);
}
// end methods
}