Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ezfit:clarujust:ezfit_optimizer_clarujust_api [2010/07/21 09:47]
smayr
ezfit:clarujust:ezfit_optimizer_clarujust_api [2010/10/12 11:25] (current)
smayr
Line 1: Line 1:
 == ezFIT Optimizer (for Clarujust) API == == ezFIT Optimizer (for Clarujust) API ==
 Following is the Application Programming Interface (API) for the ezFIT Optimizer application. Following is the Application Programming Interface (API) for the ezFIT Optimizer application.
-=== API 1.27 ===+=== API 1.28 ===
 This API is based on [[ezfit:clarujust:ezorange_api|ezOrange API 3.6]]: This API is based on [[ezfit:clarujust:ezorange_api|ezOrange API 3.6]]:
  
 <code delphi> <code delphi>
-IEzFITOptimizerClarujust = interface(IDispatch)+  IEzFITOptimizerClarujust = interface(IDispatch)
     ['{1ACEAB90-8E9A-43E7-B670-0DC23B3F4825}']     ['{1ACEAB90-8E9A-43E7-B670-0DC23B3F4825}']
     function SetEar(EarSideIdx: Integer): Integer; safecall;     function SetEar(EarSideIdx: Integer): Integer; safecall;
Line 72: Line 72:
     function GetOutputParams(BaselineIdx: Integer): PSafeArray; safecall;     function GetOutputParams(BaselineIdx: Integer): PSafeArray; safecall;
     function GetSessionRunTime: Integer; safecall;     function GetSessionRunTime: Integer; safecall;
-    function ApplyOptimizations: Integer; safecall;+    function ApplyOptimizations(WriteToCircuit: WordBool): Integer; safecall; 
 +    procedure GetProductCode(out AProductCode: PChar; EarSideIdx: Integer); safecall;
   end;   end;
 </code> </code>
Line 528: Line 529:
  
 Returns ''True'' if optimization was completed, ''False'' if not. Returns ''True'' if optimization was completed, ''False'' if not.
 +=== ApplyOptimizations(WriteToCircuit: WordBool): ErrorCode ===
  
 +Apply any independent optimizations to the circuit and selected memories. This lets the optimizer know that all the work is done, and it would be typically called just before disconnecting from the optimizer server.  The boolean parameter ''WriteToCircuit'' enables or disables the writing of parameters to the circuit.  
  
-=== ApplyOptimizations()integer === +Return ErrorCode0 if successfulnon-zero if not.
- +
-Apply any independent optimizations to the circuit and selected memories. This lets the optimizer know that all the work is doneand it would be typically called just before disconnecting from the optimizer server. +
  
  
Line 563: Line 563:
  
 Return: Output Parameters in a SafeArray format. Return: Output Parameters in a SafeArray format.
- 
 === GetSessionRunTime(): Integer  === === GetSessionRunTime(): Integer  ===
  
Line 569: Line 568:
  
 Return: TotalSeconds Return: TotalSeconds
 +=== GetProductCode(out AProductCode: PChar; EarSideIdx: Integer) ===
 +
 +Get the globally unique product code for the specified ear side. This product code is dependent on the read instrument.
  
 +See [[ezfit:clarujust:ezfit_optimizer_clarujust_api#product_codes|Product Codes]] and [[ezfit:clarujust:ezfit_optimizer_clarujust_api#ear_side|Ear Side]] data type.
  
 == Data Types & Ranges == == Data Types & Ranges ==
Line 579: Line 582:
 |  2   | MicroCard  | Microcard programmer interface. | |  2   | MicroCard  | Microcard programmer interface. |
 |  3   | Gennum DSP | Gennum DSP programmer interface. Not supported. | |  3   | Gennum DSP | Gennum DSP programmer interface. Not supported. |
-|  4   | NOAHlink   | NOAHlink programmer interface. Not supported. |+|  4   | NOAHlink   | NOAHlink programmer interface. Supported as of API 1.27 (20100816). |
 |  5   | CF2        | CF2 programmer interface. Not supported. | |  5   | CF2        | CF2 programmer interface. Not supported. |
 |  6   | EMiniTec   | EMiniTec programmer interface. | |  6   | EMiniTec   | EMiniTec programmer interface. |
Line 606: Line 609:
 | 2     | Closed-Simulated     | Closed simulated tubing. | | 2     | Closed-Simulated     | Closed simulated tubing. |
 | 3     | Closed-BTE-Ear-Hook  | Closed BTE Ear Hook.     | | 3     | Closed-BTE-Ear-Hook  | Closed BTE Ear Hook.     |
- 
 ==== Audiogram ==== ==== Audiogram ====
 Audiogram array to pass to Optimizer (''SetAudiogram()'' and ''GetAudiogram()''): Audiogram array to pass to Optimizer (''SetAudiogram()'' and ''GetAudiogram()''):
Line 620: Line 622:
 |  8    6000 |  |  8    6000 | 
 |  9    8000 |  |  9    8000 | 
 +==== Product Codes ====
 +
 +Return values for ''GetProductCode()'' routines:
 +
 +This value could be one of the following:
 +^ Product Code      ^ Product Name  ^ Description              ^
 +| prod_Flx          | Flx           | OTE.                     |
 +| prod_Intuition12  | Intuition 12  | Custom.                  |
 +| prod_Sparo12      | Sparo 12      | OTE.                     |
 +| prod_Loon         | Loon          | OTE. PHSI: LeFIT 201     |
 +| prod_Pluros       | Pluros        | OTE. PHSI: LeFIT 301     |
  
  
Line 898: Line 911:
 === Performing Independent Optimizations === === Performing Independent Optimizations ===
  
-After the optimizer client (such as Clarujust) connects to the optimizer server, it can perform whatever optimizations or adjustments it requires on the circuit.  After all the work is done, the optimizer client needs to call the ''ApplyOptimizations()'' routine to let the optimizer server know it is done with optimizations, and to store the values in the correct memories.+After the optimizer client (such as Clarujust) connects to the optimizer server, it can perform whatever optimizations or adjustments it requires on the circuit, without having to call the built-in optimizer routines.  After all the work is done, the optimizer client needs to call the ''ApplyOptimizations()'' routine to let the optimizer server know it is done with optimizations, and to store the values in the correct memories.  NOTE: The HiPro port is available to the optimizer client after connecting to the optimizer server, and it must be made available by the optimizer client before calling ''ApplyOptimizations()''.
  
-<code delphi>+<code csharp>
 ConnectToOptimizerSvr(); ConnectToOptimizerSvr();
  
-if Assigned(svr) then begin +if (svr != null
 +
 +  //------------------------------------------ 
 +  // Get Fitting Session Data 
 +  //------------------------------------------ 
 +  ... such as: 
 +  svr.GetEarCount(cnt); 
 +  ear = svr.GetEar(); 
 +  svr.GetInterface(idxIntf); 
 +  svr.GetTubingType(idxTubing, sideLeft); 
 +  svr.GetSerialNumber(SerialNumLeft,  sideLeft); 
 +  svr.GetSerialNumber(SerialNumRight, sideRight); 
 +  svr.GetDeviceID(DeviceIDLeft,  sideLeft); 
 +  svr.GetDeviceID(DeviceIDRight, sideRight); 
 +  svr.GetAudiogram(...);  
 +  ... 
 +  
   //--------------------------------------------------------------   //--------------------------------------------------------------
   // Do work: independent optimizations or circuit param changes   // Do work: independent optimizations or circuit param changes
Line 915: Line 943:
   svr.ApplyOptimizations();       // will change both hearing instruments   svr.ApplyOptimizations();       // will change both hearing instruments
      
-end;  +}
  
 DisconnectFromOptimizerSvr(); DisconnectFromOptimizerSvr();
Line 950: Line 978:
   // Get Fitting Session Data   // Get Fitting Session Data
   //------------------------------------------   //------------------------------------------
-  ... such as:+    ... such as:
   svr.GetEarCount(cnt);   svr.GetEarCount(cnt);
-  ear := svr.GetEar(); +  ear = svr.GetEar(); 
-  svr.GetInterface(idx); +  svr.GetInterface(idxIntf); 
-  svr.GetTubingType(idxgrpEarSide.ItemIndex);+  svr.GetTubingType(idxTubingsideLeft);
   svr.GetSerialNumber(SerialNumLeft,  sideLeft);   svr.GetSerialNumber(SerialNumLeft,  sideLeft);
   svr.GetSerialNumber(SerialNumRight, sideRight);   svr.GetSerialNumber(SerialNumRight, sideRight);
-  svr.GetDeviceID(SerialNumOptLeft,  sideLeft); +  svr.GetDeviceID(DeviceIDLeft,  sideLeft); 
-  svr.GetDeviceID(SerialNumOptRight, sideRight);+  svr.GetDeviceID(DeviceIDRight, sideRight);
   GetAudiogram(); // both sides   GetAudiogram(); // both sides
   svr.GetEthosArray(ParamsLeft,  sideLeft);   svr.GetEthosArray(ParamsLeft,  sideLeft);