aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-07 13:08:53 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-07 13:08:53 +0200
commit942a428f90587a9ffdafaa593b780fb6ad06aabc (patch)
tree4dd27cc98c494a57b8366b7beb9d9b4477b41409 /Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
parentccacf23ab2f33f830a830dd2c938f1863335f01d (diff)
downloadTango-942a428f90587a9ffdafaa593b780fb6ad06aabc.tar.gz
Tango-942a428f90587a9ffdafaa593b780fb6ad06aabc.zip
Refactored dispensing formula naming.
Added code comments for integration & Dispensing namespaces.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs61
1 files changed, 43 insertions, 18 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
index 1ae4c078a..cc42b64ed 100644
--- a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs
@@ -18,18 +18,29 @@ using Tango.Integration.Printing;
namespace Tango.Integration.Operators
{
+ /// <summary>
+ /// Represents the Tango machine operator default implementation.
+ /// </summary>
+ /// <seealso cref="Tango.Transport.Transporters.BasicTransporter" />
+ /// <seealso cref="Tango.Integration.Operators.IMachineOperator" />
public class MachineOperator : BasicTransporter, IMachineOperator
{
+ #region Events
+
/// <summary>
/// Occurs when there is new diagnostics data available.
/// </summary>
public event EventHandler<PushDiagnosticsResponse> DiagnosticsDataAvailable;
+ #endregion
+
+ #region Properties
+
private bool _enableDiagnostics;
/// <summary>
- /// Gets or sets a value indicating whether to enable diagnostics messages by requesting diagnostics messages.
+ /// Gets or sets a value indicating whether direct the embedded device to send diagnostics messages.
/// </summary>
- public bool EnableSensorsUpdate
+ public bool EnableDiagnostics
{
get { return _enableDiagnostics; }
set
@@ -38,16 +49,20 @@ namespace Tango.Integration.Operators
{
_enableDiagnostics = value;
RaisePropertyChangedAuto();
- OnEnableSensorsUpdateChanged(value);
+ OnEnableDiagnosticsChanged(value);
}
}
}
+ #endregion
+
+ #region Virtual Methods
+
/// <summary>
/// Called when the enable sensors update property has been changed
/// </summary>
/// <param name="value">if set to <c>true</c> [value].</param>
- protected virtual void OnEnableSensorsUpdateChanged(bool value)
+ protected virtual void OnEnableDiagnosticsChanged(bool value)
{
if (value && State == TransportComponentState.Connected)
{
@@ -81,6 +96,10 @@ namespace Tango.Integration.Operators
DiagnosticsDataAvailable?.Invoke(this, data);
}
+ #endregion
+
+ #region Protected Methods
+
/// <summary>
/// Called when the component state has changed.
/// </summary>
@@ -89,11 +108,15 @@ namespace Tango.Integration.Operators
{
base.OnStateChanged(state);
- OnEnableSensorsUpdateChanged(EnableSensorsUpdate);
+ OnEnableDiagnosticsChanged(EnableDiagnostics);
}
+ #endregion
+
+ #region Public Methods
+
/// <summary>
- /// Prints the specified job.
+ /// Prints the specified job using the specified job parameters.
/// </summary>
/// <param name="job">The job.</param>
/// <param name="processParameters">Process parameters table</param>
@@ -131,7 +154,7 @@ namespace Tango.Integration.Operators
JobHandler handler = null;
- handler = new JobHandler(async () =>
+ handler = new JobHandler(async () =>
{
try
{
@@ -144,21 +167,23 @@ namespace Tango.Integration.Operators
}
});
- SendContinuousRequest<JobRequest, JobResponse>(request).Subscribe((response) =>
+ SendContinuousRequest<JobRequest, JobResponse>(request).Subscribe((response) =>
{
handler.RaiseStatusReceived(response.Message.Status);
- },(ex) =>
- {
- if (!handler.IsCanceled)
- {
- handler.RaiseFailed(ex);
- }
- },() =>
- {
- handler.RaiseCompleted();
- });
+ }, (ex) =>
+ {
+ if (!handler.IsCanceled)
+ {
+ handler.RaiseFailed(ex);
+ }
+ }, () =>
+ {
+ handler.RaiseCompleted();
+ });
return handler;
}
+
+ #endregion
}
}