Last active
December 26, 2015 05:59
-
-
Save carbonrobot/7104243 to your computer and use it in GitHub Desktop.
Async options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SpeedData MeasureSpeed(Dryer dryer) | |
{ | |
lock (thisLock) | |
{ | |
if (this.State == DAQState.Ready) | |
{ | |
this.State = DAQState.Acquiring; | |
try | |
{ | |
var configuration = new TriggeredScanConfiguration(2000.0, 2, 0.5, 2.0); | |
var task = new MeasureSpeedTask(deviceName, dryer, configuration); | |
var data = task.Measure(); | |
return data; | |
} | |
catch (Exception ex) | |
{ | |
this.Log().Error(() => "DAQController:MeasureSpeed Error"); | |
this.Log().Error(() => ex.ToString()); | |
} | |
finally | |
{ | |
this.State = DAQState.Ready; | |
} | |
} | |
throw new InvalidOperationException(Messages.DAQControllerNotReady_0.FormatWith(this.State)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment