icon and units

This commit is contained in:
Thaddeus Hughes
2025-09-18 07:26:18 -05:00
parent ec692756c5
commit 659c956c95
16 changed files with 5504 additions and 5500 deletions

View File

@@ -1,4 +1,4 @@
GROSS_WEIGHT,GROSS_TIME,TARE_WEIGHT,TARE_TIME,NET GROSS_WEIGHT,GROSS_UNITS,GROSS_TIME,TARE_WEIGHT,TARE_UNITS,TARE_TIME,NET,NET_UNITS
0,09/17/2025 06:12 PM,3780,09/17/2025 06:13 PM,-3780 0,lb,09/17/2025 06:12 PM,3780,lb,09/17/2025 06:13 PM,-3780,lb
3780,09/17/2025 10:18 PM,3640,09/17/2025 10:19 PM,140 3780,lb,09/17/2025 10:18 PM,3640,lb,09/17/2025 10:19 PM,140,lb
1640,09/17/2025 10:19 PM,0,09/17/2025 10:20 PM,1640 1640,lb,09/17/2025 10:19 PM,0,lb,09/17/2025 10:20 PM,1640,lb
1 GROSS_WEIGHT GROSS_UNITS GROSS_TIME TARE_WEIGHT TARE_UNITS TARE_TIME NET NET_UNITS
2 0 lb 09/17/2025 06:12 PM 3780 lb 09/17/2025 06:13 PM -3780 lb
3 3780 lb 09/17/2025 10:18 PM 3640 lb 09/17/2025 10:19 PM 140 lb
4 1640 lb 09/17/2025 10:19 PM 0 lb 09/17/2025 10:20 PM 1640 lb

View File

@@ -1,7 +1,7 @@
WEIGHT,TIMESTAMP WEIGHT,UNITS,TIMESTAMP
0,09/17/2025 06:12 PM 0,lb,09/17/2025 06:12 PM
3780,09/17/2025 06:13 PM 3780,lb,09/17/2025 06:13 PM
3780,09/17/2025 10:18 PM 3780,lb,09/17/2025 10:18 PM
3640,09/17/2025 10:19 PM 3640,lb,09/17/2025 10:19 PM
1640,09/17/2025 10:19 PM 1640,lb,09/17/2025 10:19 PM
0,09/17/2025 10:20 PM 0,lb,09/17/2025 10:20 PM
1 WEIGHT UNITS TIMESTAMP
2 0 lb 09/17/2025 06:12 PM
3 3780 lb 09/17/2025 06:13 PM
4 3780 lb 09/17/2025 10:18 PM
5 3640 lb 09/17/2025 10:19 PM
6 1640 lb 09/17/2025 10:19 PM
7 0 lb 09/17/2025 10:20 PM

View File

@@ -1 +1 @@
pyinstaller --noconsole --noconfirm main.py pyinstaller --noconsole --noconfirm -i icon.ico main.py

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
False, False,
False, False,
True, True,
'C:\\Users\\Thad\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-windowed.ico', ['C:\\data\\git\\rslogger-merger\\icon.ico'],
None, None,
False, False,
False, False,
@@ -62,7 +62,7 @@
[], [],
False, False,
False, False,
1758197208, 1758198359,
[('runw.exe', [('runw.exe',
'C:\\Users\\Thad\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\PyInstaller\\bootloader\\Windows-64bit-intel\\runw.exe', 'C:\\Users\\Thad\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\PyInstaller\\bootloader\\Windows-64bit-intel\\runw.exe',
'EXECUTABLE')], 'EXECUTABLE')],

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -18,8 +18,8 @@ missing module named grp - imported by shutil (delayed, optional), tarfile (opti
missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib._local (optional), subprocess (delayed, conditional, optional) missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib._local (optional), subprocess (delayed, conditional, optional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional) missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional) excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional)
missing module named 'collections.abc' - imported by traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level), tracemalloc (top-level) missing module named 'collections.abc' - imported by tracemalloc (top-level), traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level)
missing module named posix - imported by os (conditional, optional), posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional) missing module named posix - imported by posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional)
missing module named resource - imported by posix (top-level) missing module named resource - imported by posix (top-level)
missing module named _posixsubprocess - imported by subprocess (conditional) missing module named _posixsubprocess - imported by subprocess (conditional)
missing module named fcntl - imported by subprocess (optional) missing module named fcntl - imported by subprocess (optional)

Binary file not shown.

BIN
dist/main/main.exe vendored

Binary file not shown.

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

21
main.py
View File

@@ -18,9 +18,11 @@ def parse_logs(log_text):
i += 1 i += 1
continue continue
match = re.match(r'^GROSS\s+(\d+)\s*lb$', line) # Updated regex to capture any units (lb, kg, g, etc.)
match = re.match(r'^GROSS\s+(\d+)\s*([a-zA-Z]+)$', line)
if match: if match:
weight = int(match.group(1)) weight = int(match.group(1))
units = match.group(2)
i += 2 # Skip to timestamp line i += 2 # Skip to timestamp line
if i < len(lines): if i < len(lines):
ts_line = lines[i].strip() ts_line = lines[i].strip()
@@ -29,7 +31,7 @@ def parse_logs(log_text):
try: try:
dt = datetime.strptime(ts_line, '%I:%M %p %m/%d/%y') dt = datetime.strptime(ts_line, '%I:%M %p %m/%d/%y')
excel_ts = dt.strftime('%m/%d/%Y %I:%M %p') excel_ts = dt.strftime('%m/%d/%Y %I:%M %p')
pairs.append((weight, excel_ts)) pairs.append((weight, units, excel_ts))
except ValueError: except ValueError:
i += 1 i += 1
continue continue
@@ -44,20 +46,21 @@ def parse_logs(log_text):
def write_csv1(pairs, filename): def write_csv1(pairs, filename):
with open(filename, 'w', newline='') as f: with open(filename, 'w', newline='') as f:
writer = csv.writer(f) writer = csv.writer(f)
writer.writerow(['WEIGHT', 'TIMESTAMP']) writer.writerow(['WEIGHT', 'UNITS', 'TIMESTAMP'])
for weight, timestamp in pairs: for weight, units, timestamp in pairs:
writer.writerow([weight, timestamp]) writer.writerow([weight, units, timestamp])
def write_csv2(pairs, filename): def write_csv2(pairs, filename):
with open(filename, 'w', newline='') as f: with open(filename, 'w', newline='') as f:
writer = csv.writer(f) writer = csv.writer(f)
writer.writerow(['GROSS_WEIGHT', 'GROSS_TIME', 'TARE_WEIGHT', 'TARE_TIME', 'NET']) writer.writerow(['GROSS_WEIGHT', 'GROSS_UNITS', 'GROSS_TIME', 'TARE_WEIGHT', 'TARE_UNITS', 'TARE_TIME', 'NET', 'NET_UNITS'])
for j in range(0, len(pairs), 2): for j in range(0, len(pairs), 2):
if j + 1 < len(pairs): if j + 1 < len(pairs):
gross_weight, gross_time = pairs[j] gross_weight, gross_units, gross_time = pairs[j]
tare_weight, tare_time = pairs[j + 1] tare_weight, tare_units, tare_time = pairs[j + 1]
net = gross_weight - tare_weight net = gross_weight - tare_weight
writer.writerow([gross_weight, gross_time, tare_weight, tare_time, net]) # Use gross units for net (assuming consistent units within pairs)
writer.writerow([gross_weight, gross_units, gross_time, tare_weight, tare_units, tare_time, net, gross_units])
def select_input_file(): def select_input_file():
filename = filedialog.askopenfilename(filetypes=[("Text files", "*.txt"), ("All files", "*.*")]) filename = filedialog.askopenfilename(filetypes=[("Text files", "*.txt"), ("All files", "*.*")])

View File

@@ -32,6 +32,7 @@ exe = EXE(
target_arch=None, target_arch=None,
codesign_identity=None, codesign_identity=None,
entitlements_file=None, entitlements_file=None,
icon=['icon.ico'],
) )
coll = COLLECT( coll = COLLECT(
exe, exe,

BIN
truck.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB