Interface IRunningStation
- Namespace
- Acuit.Pinpoint.Workstation
- Assembly
- Acuit.Pinpoint.Workstation.Abstractions.dll
Represents a running station.
public interface IRunningStation : INotifyPropertyChanged
- Inherited Members
- Extension Methods
Remarks
This is not thread-safe. All access should occur from the main application thread.
Properties
IsStopped
Gets whether this IRunningStation instance has been stopped. When the station be restarted, a new instance will be created and should be obtained via RunningStation.
bool IsStopped { get; }
Property Value
LineName
Gets the line name.
string LineName { get; }
Property Value
ProductionCounts
Gets the latest production count information for the line, or null if the production counts are not available.
ProductionCounts? ProductionCounts { get; }
Property Value
StationName
Gets the station name.
string StationName { get; }
Property Value
StationSettings
Gets the station settings.
StationSettings StationSettings { get; }
Property Value
StationTypeName
Gets the station type name.
string StationTypeName { get; }
Property Value
WorkerAtStation
Gets the IWorkerAtStation representing the worker logged on at the station (including for stations with an automatic worker logon configured), or null if no worker is logged on at the station.
IWorkerAtStation? WorkerAtStation { get; }
Property Value
WorkstationState
Gets the associated workstation state.
IWorkstationState WorkstationState { get; }
Property Value
Methods
AuthenticateWorker(string?, string?)
Authenticates a worker.
AuthenticateWorkerStatus AuthenticateWorker(string? badgeNumber, string? password)
Parameters
badgeNumberstringThe worker's badge number, or null to validate using
passwordonly.passwordstringThe worker's password, or null to validate using
badgeNumberonly.
Returns
- AuthenticateWorkerStatus
An AuthenticateWorkerStatus object representing the status.
Remarks
Either badgeNumber or password can be null or empty to only
validate using the other parameter, but both cannot be null or empty.
Exceptions
- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See AuthenticateWorker2(string, string?, string?) for the specific errors that can occur.
AuthenticateWorkerAsync(string?, string?)
Authenticates a worker.
Task<AuthenticateWorkerStatus> AuthenticateWorkerAsync(string? badgeNumber, string? password)
Parameters
badgeNumberstringThe worker's badge number, or null to validate using
passwordonly.passwordstringThe worker's password, or null to validate using
badgeNumberonly.
Returns
- Task<AuthenticateWorkerStatus>
The task object representing the asynchronous operation.
Remarks
Once the operation completes, the Result property on the returned task object contains an AuthenticateWorkerStatus object representing the status.
Either badgeNumber or password can be null or empty to only
validate using the other parameter, but both cannot be null or empty.
Exceptions
- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See AuthenticateWorker2(string, string?, string?) for the specific errors that can occur.
GetComponentScanSettings(string)
Gets the item scan settings for a component type, as configured for this station type.
ItemScanSettings GetComponentScanSettings(string componentTypeName)
Parameters
componentTypeNamestringThe component type name.
Returns
- ItemScanSettings
A new ItemScanSettings with the item scan settings.
Remarks
These settings can be used with StartScanningItem(ItemScanSettings).
Exceptions
- ArgumentNullException
componentTypeNameis null.- ArgumentException
The
componentTypeNamecomponent type is not configured to be scanned at this station.
GetUnitScanSettings()
Gets the item scan settings for units, as configured for this station type.
ItemScanSettings GetUnitScanSettings()
Returns
- ItemScanSettings
A new ItemScanSettings with the item scan settings.
Remarks
These settings can be used with StartScanningItem(ItemScanSettings).
ShowAlert(Alert)
Shows an alert at the station.
void ShowAlert(Alert alert)
Parameters
alertAlertThe alert.
Remarks
If the station is automated, the message is shown as an alarm. Otherwise, the message is shown via a warning message box.
Exceptions
- ArgumentNullException
alertis null.- InvalidOperationException
This station is no longer running.
ShowAuthenticateWorkerDialog(string?, string?)
Prompts for worker credentials via a dialog box.
Worker? ShowAuthenticateWorkerDialog(string? title = null, string? message = null)
Parameters
titlestringThe title to use for the dialog box title, or null to use the default "Not Authorized".
messagestringThe message to use in the dialog box title, or null to use the default "You are not authorization to perform this action. Please enter alternate credentials with sufficient authorization."
Returns
- Worker
A Worker for the authenticated worker, or null if the worker authentication prompt was canceled by the user. When connecting to Acuit Pinpoint versions older than 6.200, Groups will not be populated.
Exceptions
- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See AuthenticateWorker2(string, string?, string?) for the specific errors that can occur.
TryAuthorizeAcknowledgeAlert(int, out AuthorizedWorker?)
Tries to get authorization to acknowledge an alert, prompting for alternate credentials if necessary.
bool TryAuthorizeAcknowledgeAlert(int alertId, out AuthorizedWorker? authorizedWorker)
Parameters
alertIdintThe alert id.
authorizedWorkerAuthorizedWorkerOn return, will contain information about the authorized worker if successful, or null if not.
Returns
- bool
true if the worker (or another via alternate credentials) is authorized for the station permission, or false if the user canceled or an error occurred.
Remarks
If there is a worker logged onto the station, this will first attempt to authorize that worker. If that authorization fails, then a prompt for alternate worker credentials will appear.
A "please wait" window with a cancel button will be shown while the authorization check is being performed. If a communication error occurs when checking authorization, an error message box will be displayed and the method will return false.
Exceptions
- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See IsAuthorizedForStation(string, string, int, string) for the specific errors that can occur.
TryAuthorizeComponentTypePermission(string, string, out AuthorizedWorker?)
Tries to get authorization for a component type permission, prompting for alternate credentials if necessary.
bool TryAuthorizeComponentTypePermission(string componentTypeName, string permission, out AuthorizedWorker? authorizedWorker)
Parameters
componentTypeNamestringThe component type name.
permissionstringThe permission to check.
authorizedWorkerAuthorizedWorkerOn return, will contain information about the authorized worker if successful, or null if not.
Returns
- bool
true if the worker (or another via alternate credentials) is authorized for the station permission, or false if the user canceled or an error occurred.
Remarks
If there is a worker logged onto the station, this will first attempt to authorize that worker. If that authorization fails, then a prompt for alternate worker credentials will appear.
A "please wait" window with a cancel button will be shown while the authorization check is being performed. If a communication error occurs when checking authorization, an error message box will be displayed and the method will return false.
Exceptions
- ArgumentNullException
componentTypeNameis null.- ArgumentNullException
permissionis null.- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See IsAuthorizedForStation(string, string, int, string) for the specific errors that can occur.
TryAuthorizeOverrideTest(int, out AuthorizedWorker?)
Tries to get authorization to override a failed test result, prompting for alternate credentials if necessary.
bool TryAuthorizeOverrideTest(int unitTestId, out AuthorizedWorker? authorizedWorker)
Parameters
unitTestIdintThe id of the test to override.
authorizedWorkerAuthorizedWorkerOn return, will contain information about the authorized worker if successful, or null if not.
Returns
- bool
true if the worker (or another via alternate credentials) is authorized for the station permission, or false if the user canceled or an error occurred.
Remarks
If there is a worker logged onto the station, this will first attempt to authorize that worker. If that authorization fails, then a prompt for alternate worker credentials will appear.
A "please wait" window with a cancel button will be shown while the authorization check is being performed. If a communication error occurs when checking authorization, an error message box will be displayed and the method will return false.
Exceptions
- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See IsAuthorizedForStation(string, string, int, string) for the specific errors that can occur.
TryAuthorizeStationPermission(string, out AuthorizedWorker?)
Tries to get authorization for a station permission, prompting for alternate credentials if necessary.
bool TryAuthorizeStationPermission(string permission, out AuthorizedWorker? authorizedWorker)
Parameters
permissionstringThe station permission to check.
authorizedWorkerAuthorizedWorkerOn return, will contain information about the authorized worker if successful, or null if not.
Returns
- bool
true if the worker (or another via alternate credentials) is authorized for the station permission, or false if the user canceled or an error occurred.
Remarks
If there is a worker logged onto the station, this will first attempt to authorize that worker. If that authorization fails, then a prompt for alternate worker credentials will appear.
A "please wait" window with a cancel button will be shown while the authorization check is being performed. If a communication error occurs when checking authorization, an error message box will be displayed and the method will return false.
Exceptions
- ArgumentNullException
permissionis null.- InvalidOperationException
This station is no longer running.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See IsAuthorizedForStation(string, string, int, string) for the specific errors that can occur.
TryLogOnWorkerAsync(string?, string?, CancellationToken)
Tries to log a worker on to the station.
Task<bool> TryLogOnWorkerAsync(string? badgeNumber, string? password, CancellationToken cancellationToken = default)
Parameters
badgeNumberstringThe worker's badge number, or null to validate using
passwordonly or when the station is configured for automatic worker logon.passwordstringThe worker's password, or null to validate using
badgeNumberonly or when the station is configured for automatic worker logon.cancellationTokenCancellationTokenA token that can request cancellation.
Returns
Remarks
Once the operation completes, the Result property on the returned task object contains true if the worker
was authenticated and logged on to the station, or false if the worker was not authenticated or the log on was canceled (e.g., by a
plug-in requesting cancellation of the logon process; not due to cancellationToken being signaled, which would result in this
asynchronous task completing as canceled).
Exceptions
- ArgumentException
badgeNumberwas provided, but the station is configured for automatic worker logon.- ArgumentException
passwordwas provided, but the station is configured for automatic worker logon.- InvalidOperationException
This station is no longer running.
- InvalidOperationException
A worker is already logged on to the station.
- Exception
Acuit Pinpoint responded with an error, or an error occurred while attempting to communicate with Acuit Pinpoint. See AuthenticateWorker2Async(string, string?, string?) or WorkerLogOn2(string, string, string, int) for the specific errors that can occur.
TryStopStationAsync(CancellationToken)
Tries to stop the station.
Task<bool> TryStopStationAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token that can request cancellation.
Returns
Remarks
Once the operation completes, the Result property on the returned task object contains true if the station was successfully stopped; otherwise, false (e.g., a plug-in canceled a unit release that would occur as part of the station stop process).
Exceptions
- InvalidOperationException
This station is no longer running.