Documentation
¶
Overview ¶
Package vtpro provides VTPro process management and interaction.
Index ¶
- Constants
- func GetVTProPath() string
- func ValidateVTProInstallation() error
- type Client
- func (c *Client) Cleanup(hwnd uintptr, pid uint32)
- func (c *Client) FindWindow(targetPid uint32, debug bool) (uintptr, string)
- func (c *Client) ForceCleanup(hwnd uintptr, knownPid uint32)
- func (c *Client) HandlePostLoadDialogs() error
- func (c *Client) StartMonitoring(pid uint32) func()
- func (c *Client) WaitForAppear(targetPid uint32, timeout time.Duration) (uintptr, bool)
- func (c *Client) WaitForFileLoaded(pid uint32, timeout time.Duration) bool
- func (c *Client) WaitForReady(hwnd uintptr, timeout time.Duration) bool
- type VTProProcessAPI
Constants ¶
const DefaultVTProPath = "C:\\Program Files (x86)\\Crestron\\VtPro-e\\vtpro.exe"
Variables ¶
This section is empty.
Functions ¶
func GetVTProPath ¶
func GetVTProPath() string
GetVTProPath returns the path to the VTPro executable. It checks the VTPRO_PATH environment variable first, falling back to the default installation path if not set.
func ValidateVTProInstallation ¶
func ValidateVTProInstallation() error
ValidateVTProInstallation checks if the VTPro executable exists. Returns an error with helpful guidance if the file is not found.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods for interacting with VTPro processes
func NewClient ¶
func NewClient(log logger.LoggerInterface) *Client
NewClient creates a new VTPro client
func (*Client) Cleanup ¶
Cleanup ensures VTPro is properly closed, with fallback to force termination
func (*Client) FindWindow ¶
FindWindow searches for the VTPro main window belonging to a specific process targetPid must be a valid process ID - passing 0 will return no results
func (*Client) ForceCleanup ¶
ForceCleanup attempts to forcefully close VTPro using the known PID. It tries two approaches in order: 1. Use hwnd if available (graceful close with PID for force termination) 2. Use known PID (forced termination)
func (*Client) HandlePostLoadDialogs ¶
HandlePostLoadDialogs checks for and dismisses warning dialogs that may appear after file load This includes the "VisionTools(R) Pro-e" warning dialog containing messages like path limitation warnings. This MUST be called BEFORE bringing the window to foreground to ensure dialogs don't interfere.
func (*Client) StartMonitoring ¶
StartMonitoring starts a background goroutine that monitors VTPro dialogs for a specific PID Returns a function to stop the monitoring
func (*Client) WaitForAppear ¶
WaitForAppear waits for the VTPro main window to appear for a specific process targetPid must be a valid process ID - passing 0 will immediately return failure
func (*Client) WaitForFileLoaded ¶
WaitForFileLoaded waits for VTPro to complete loading the file by monitoring the "VisionTools Pro-e" and "Progress [xx%]" dialogs that appear during file load. Returns true if file loading completed within timeout, false otherwise.
type VTProProcessAPI ¶
type VTProProcessAPI struct {
// contains filtered or unexported fields
}
VTProProcessAPI is a concrete implementation of the VTPro process management interface It wraps the Client for backward compatibility with the interface
func NewSimplProcessAPI ¶
func NewSimplProcessAPI(log logger.LoggerInterface) *VTProProcessAPI
func (VTProProcessAPI) FindWindow ¶
func (v VTProProcessAPI) FindWindow(targetPid uint32, debug bool) (uintptr, string)
func (VTProProcessAPI) WaitForReady ¶
func (v VTProProcessAPI) WaitForReady(hwnd uintptr, timeout time.Duration) bool