3.6 KiB
3.6 KiB
CMNDPROC.BAS Documentation
Overview
CMNDPROC.BAS is a Visual Basic module that handles command processing for a CAD/drawing file management system. It manages file operations, printing, and communication between different parts of the system.
Global Variables
File Location Variables
Place$
,Lpt$
,PrinterGroup$
,Tray$
,Limits$
- Arrays storing printer and location infoNetWPath$
- Network path for shared filesEngrDrive$
- Engineering drawings drive pathIEDrive$
- Industrial Engineering drive pathtemppath$
- Temporary file path
Message/Queue Files
COMPLETE$
- Complete queue fileINCOME$
- Incoming queue fileReply$
- Reply queue fileMessageFileName$
- Message file nameMessageLogName$
- Log file name
Key Subroutines
StartSystem()
Main processing loop that:
- Monitors incoming command queue
- Processes commands
- Generates replies
- Handles file operations
AddHeaders()
Adds print headers to PostScript files including:
- Job information
- Page setup
- User details
PrintPSFile()
Handles printing PostScript files:
- Adds headers
- Sends to printer queue
- Monitors print completion
File Operations
MoveIN()
- Moves files into systemMoveOUT()
- Moves files out to usersCopyIt()
- Copies drawing filesDeleteIt()
- Deletes filesSaveRev()
- Saves drawing revisions
Support Functions
LoadPrinters()
- Loads printer configurationsLoadPlot()
- Loads plotter settingsLoadSubDirs()
- Loads subdirectory mappingsMessages()
- Logs messagesPrintLog()
- Prints to log file
Command Types
- P - Print drawing
- R - Reference drawing
- O - Check out drawing
- I - Check in drawing
- B - Move back drawing
- Y - Copy drawing
- E - Move to IE
- W - Print wiring diagram
- T - Print text file
File Types Handled
- AutoCAD (.DWG)
- Pro/E (.PLT, .DRW, etc)
- PDF files
- PostScript files
- Text/INI files
- Altium files
- SolidWorks files
- Menu folders
Error Handling
- Error codes returned in replies
- Logging of errors
- Retry mechanisms for file operations
- File locking detection
Configuration Files
- PRINTER.CFG - Printer definitions
- PLOT.CFG - Plotter settings
- SUBS.CFG - Subdirectory mappings
- ExternalUsers.txt - External user mappings
Communication
- Uses file-based queues for commands
- Reply messages for status
- Watchdog timer monitoring
- Process synchronization
CMNDPROC.BAS is the main module that contains the core business logic and processing functionality, while Cmdproc-1.frm through Cmdproc-6.frm are the form modules that provide the user interface components:
- CMNDPROC.BAS:
- Contains all the core functions for file operations, command processing, and system management
- Handles the actual processing of commands and file operations
- Manages communication between components
- Contains global variables and configuration settings
- Form Relationships:
- Cmdproc-1.frm: Main interface form that displays status, logs, and controls
- Cmdproc-2.frm: Handles printer and plotter configuration interface
- Cmdproc-3.frm: Manages file viewing and selection interface
- Cmdproc-4.frm: Provides command entry and monitoring interface
- Cmdproc-5.frm: Shows system status and diagnostic information
- Cmdproc-6.frm: Contains settings and configuration interface
The forms access the functions and variables in CMNDPROC.BAS to:
- Display status information
- Trigger command processing
- Show operation results
- Configure system settings
- Monitor system state
CMNDPROC.BAS acts as the central processing module while the forms provide the UI layer for user interaction with the system.