Files
udc-parser/parser/config.py
cproudlock 5c707c3cd4 Initial commit: UDC/CLM parser for ShopDB
Python parsers for Universal Data Collector (UDC) and Control Loop
Monitor (CLM) data from CNC machines.

- clmparser.py: Main parser for CLM JSON data files
  - Incremental imports using file hashes
  - Extracts parts, measurements, tool data, violations
  - Calculates cycle times and changeovers

- udcparser.py: Parser for raw UDC log files
  - Application events, errors, connections

- config.py: Database configuration (dev/prod)
- backfill_changeover.py: One-time migration utility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-16 07:54:54 -05:00

37 lines
1004 B
Python

"""
UDC Parser Configuration
"""
import platform
# Detect OS
IS_WINDOWS = platform.system() == 'Windows'
# CLM Data paths
CLM_DATA_PATH_WINDOWS = r'S:\SPC\UDC\CLM_Data'
CLM_DATA_PATH_LINUX = '/home/camp/projects/UDC/CLM_Data'
CLM_DATA_PATH = CLM_DATA_PATH_WINDOWS if IS_WINDOWS else CLM_DATA_PATH_LINUX
# Database - Development (Docker on Linux)
DB_CONFIG_DEV = {
'host': '127.0.0.1',
'port': 3306,
'user': 'root',
'password': 'rootpassword',
'database': 'shopdb'
}
# Database - Production (update these values)
DB_CONFIG_PROD = {
'host': 'PROD_MYSQL_HOST', # TODO: Update with production host
'port': 3306,
'user': 'PROD_USER', # TODO: Update with production user
'password': 'PROD_PASSWORD', # TODO: Update with production password
'database': 'shopdb'
}
# Default config based on OS (Windows = prod, Linux = dev)
DB_CONFIG = DB_CONFIG_PROD if IS_WINDOWS else DB_CONFIG_DEV
# Batch insert size
BATCH_SIZE = 1000