-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculate_sheet_cost_CLI.HTML
More file actions
224 lines (186 loc) · 7.74 KB
/
calculate_sheet_cost_CLI.HTML
File metadata and controls
224 lines (186 loc) · 7.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sheet Cost Calculation CLI</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 0;
line-height: 1.6;
padding-bottom: 60px; /* Added space for footer */
}
header {
background-color: #2c3e50;
color: white;
text-align: center;
padding: 20px 0;
}
header h1 {
margin: 0;
font-size: 2.5em;
}
h2 {
color: #2c3e50;
border-bottom: 2px solid #3498db;
padding-bottom: 5px;
}
p, ul, ol {
font-size: 1.1em;
margin-bottom: 15px;
}
ul, ol {
margin-left: 20px;
}
pre {
background-color: #e0e0e0;
border: 1px solid #ccc;
padding: 15px;
font-size: 1.1em;
font-family: "Courier New", monospace;
white-space: pre-wrap;
word-wrap: break-word;
}
a {
color: #3498db;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
section {
padding: 20px;
margin: 20px auto;
background-color: white;
max-width: 900px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
section ul li {
margin-bottom: 10px;
}
footer {
background-color: #2c3e50;
color: white;
text-align: center;
padding: 10px 0;
position: relative; /* Changed from fixed to relative */
bottom: 0;
width: 100%;
}
strong {
font-weight: bold;
}
.how-to-use {
font-size: 1.1em;
line-height: 1.7;
}
.how-to-use li {
margin-bottom: 10px;
}
.how-to-use li span {
font-weight: bold;
}
.how-to-use ol {
list-style-type: decimal;
margin-left: 30px;
}
.how-to-use ul {
list-style-type: none;
margin-left: 40px;
}
</style>
</head>
<body>
<header>
<h1>Sheet Cost Calculation CLI</h1>
</header>
<section>
<p>This Python script calculates the mass and cost of metal sheets based on user input or generates simulated data for demonstration purposes. It allows the user to input sheet dimensions and select a material density to calculate the cost based on weight.</p>
<h2>Requirements</h2>
<ul>
<li>Python 3.7+ (You can download it from <a href="https://www.python.org/downloads/">here</a>)</li>
<li>The script uses the built-in <code>random</code> and <code>time</code> libraries.</li>
</ul>
<h2>How to Use</h2>
<div class="how-to-use">
<ol>
<li><span>Clone or download the <code>calculate_sheet_cost_CLI.py</code> script.</span></li>
<li><span>Open a terminal (or command prompt) and navigate to the directory where the script is located.</span></li>
<li><span>Run the script by typing the following command:</span>
<pre><code>python calculate_sheet_cost_CLI.py</code></pre>
</li>
<li><span>The program will prompt you for the following inputs:</span>
<ul>
<li><span><strong>Demo Mode:</strong> Choose whether to run in demo mode (simulating random data) or manual input mode.</span></li>
<li><span><strong>Number of Sheets:</strong> Enter the number of sheets you want to calculate.</span></li>
<li><span><strong>Material:</strong> Choose a material from the list by entering the corresponding number:
<ul>
<li><span>1: Steel</span></li>
<li><span>2: Stainless Steel</span></li>
<li><span>3: Aluminum</span></li>
<li><span>4: Custom (Enter your custom density in kg/dm³)</span></li>
</ul>
</span></li>
<li><span><strong>Sheet Dimensions:</strong> Enter the length, width, and thickness of the sheets (in millimeters).</span></li>
<li><span><strong>Density:</strong> For the selected material, the script will either use a predefined density or ask for a custom density input.</span></li>
</ul>
</li>
<li><span>For each sheet, the program will calculate and display the following information:</span>
<ul>
<li><span>Length, Width, Thickness</span></li>
<li><span>Material and Density used</span></li>
<li><span>Mass and Cost</span></li>
</ul>
</li>
<li><span>If you want to exit the program at any time, type <strong>e</strong>.</span></li>
</ol>
</div>
<h2>Demo Mode</h2>
<p>In demo mode, the script will automatically generate random values for sheet dimensions and density, allowing you to quickly see how the program works. You can specify the number of sheets and observe how the program simulates the process for each sheet.</p>
<h2>Exit the Program</h2>
<p>At any time, you can type 'exit' to quit the program. This will stop the script from asking further questions and exit gracefully.</p>
<h2>Example Usage</h2>
<pre>
Do you want to run the program in demo mode? (y/n, or 'e' to quit): y
Enter the number of sheets (or type 'exit' to quit): 3
Simulating input for sheet 1...
Length: 415 mm, Width: 500 mm, Thickness: 10 mm
Simulating input for sheet 2...
Length: 785 mm, Width: 208 mm, Thickness: 3 mm
Simulating input for sheet 3...
Length: 925 mm, Width: 550 mm, Thickness: 6 mm
Simulating density selection... Selected density: 7.85 kg/dm^3
Calculated Results:
Sheet 1:
Mass: 16.29 kg
Cost: 203.61 SEK
Sheet 2:
Mass: 3.85 kg
Cost: 48.07 SEK
Sheet 3:
Mass: 23.96 kg
Cost: 299.53 SEK
Do you want to calculate another sheet? (y/n, or 'e' to quit):
</pre>
<h2>Material Pricing</h2>
<p>The script currently supports the following materials with fixed prices per kilogram:</p>
<ul>
<li><strong>Steel</strong>: 12.5 SEK/kg</li>
<li><strong>Stainless Steel</strong>: 15.0 SEK/kg</li>
<li><strong>Aluminium</strong>: 10.0 SEK/kg</li>
</ul>
<h2>Technical Details</h2>
<p>The script uses basic mathematical calculations to determine the volume and mass of a sheet based on the input dimensions. The mass is then multiplied by the selected material density to calculate the final weight. The price is calculated based on the mass, with a fixed price per kilogram for each material.</p>
<h2>Contact</h2>
<p>If you have any questions or encounter issues, please reach out to the developer: <strong>Lucas Johansson</strong>.</p>
</section>
<footer>
<p>© 2024 Lucas Johansson. All rights reserved.</p>
</footer>
</body>
</html>