Agilent Technologies 86038B User Manual page 190

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

190
with the event. When a class implements a delegate, Microsoft
recommends appending Handler to the name. Some people find
this confusing, since in the past what we have called here the
event function (the function you write that gets called when the
event occurs) has also been called the event handler.
Now consider the specific example of a new status message. The
pdlaClient has an event called NewStatus. The PDLA promises
to fire it when a new status message appears. To take advantage
of this, l write a routine called NewStatusEvent
Studio, and select View, Other Windows, Object Browser. Select
the Find Symbol tool on the object browser (look for the
binoculars.) Type in NewStatus and click Find. You get the
result below:
The first hit (with the lightning bolt) represents the event itself.
The second hit is the function prototype. NewStatus is expecting
a function that accepts a string and an eEventLogType. Note
that the fully qualified eEventLogType is
Agilent.LWD.Ag86038x.InstrumentObjects.ODACommon.eEvent
LogType. To see the values defined in the enumeration, find the
InstrumentObjects object in the left hand pane of the object
browser. Expand that entry, and find
Agilent.LWD.Ag86038x.InstrumentObjects, and expand that.
Scan down the resultant list to find
ODACommon.eEventLogType, and click on that. It shows the
five different possible values. It turns out the FailureAudit and
SuccessAudit are unused default log values. The only values we
will ever see are EventError (something bad happened and
PDLA could not do what you asked), Information (simple status
update, like Sweep Started) or Warning (PDLA was still able to
make a measurement, but wasn't able to do precisely as asked.)
The first pass parameter is the text of the message displayed to
the user on the PDLA front panel. So, to be informed of a new
status message, implement a function like this:
private void NewStatusEvent( string msg, ODACommon.eEventLogType
e )
{
// Let the user know something happened
lblStatus.Text=msg;
}
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
Go into Visual
.

Advertisement

Table of Contents
loading

Table of Contents