tory',Str);
         MovedGroup = [];   % release persistent objects
         
         % Trigger global update
         LoopData.dataevent('all')
      end
      
end

%----------------- Local functions -----------------

%%%%%%%%%%%%%%%%%%%%%
% LocalGetSelection %
%%%%%%%%%%%%%%%%%%%%%
function [MovedGroup,PZID,G0] = LocalGetSelection(CurrentObj)
% Identifies selected PZGROUP object (pole/zero group)

% Moved PZVIEW object
MovedPZVIEW = getappdata(CurrentObj,'PZVIEW');
if any(MovedPZVIEW.Zero==CurrentObj)
   PZID = 'Zero';
else
   PZID = 'Pole';
end

% Moved PZGROUP
MovedGroup = MovedPZVIEW.GroupData;
%G0 = get(MovedGroup);   % initial pole/zero values
G0 = getTypeZeroPole(MovedGroup);  % initial pole/zero values (fixed)

%%%%%%%%%%%%%%%%%%%
% LocalCancelRoot %
%%%%%%%%%%%%%%%%%%%
function Y = LocalCancelRoot(MagPhase,Freqs,Y,PZGroup,PZID,Ts,Format)
%  Remove contribution of selected root or groups of roots from magnitude or phase data

%  RE: Convert DT roots to continuous time (matched pole/zero conversion).
%      This is warranted by tractability for complex roots and the fact
%      that distortions will be corrected by REFRESHPZ
s = 1i*Freqs;

% Get zero and pole values (in CT domain)
rz = dom2ct(PZGroup.Zero,Ts);  % zeros
rp = dom2ct(PZGroup.Pole,Ts);  % poles

% Evaluate root contribution  
resp = 1;
switch lower(Format(1))
case 'z'   % zero/pole/gain
   for ct=1:length(rz)
      resp = resp .* (s - rz(ct));
   end
   for ct=1:length(rp)
      resp = resp ./ (s - rp(ct));
   end
case 't'   % time constant
   for ct=1:length(rz)
      resp = resp .* (1 - s/rz(ct));
   end
   for ct=1:length(rp)
      resp = resp ./ (1 - s/rp(ct));
   end
end

% Remove contribution of moved root(s) from Y data
switch MagPhase
case 1  % mag
   Y = Y ./ abs(resp);
case 2  % phase
   Y = Y - atan2(imag(resp),real(resp));
end


%%%%%%%%%%%%%%%%%%%%
% LocalTrackStatus %
%%%%%%%%%%%%%%%%%%%%
function Status = LocalTrackStatus(Group,PZID,Ts,FreqUnits)
% Display info about moved pole/zero

% Defs
Spacing = blanks(5);

switch Group.Type
case 'Notch'
   % Custom display for notch filters
   Text = getString(message('Control:compDesignTask:msgShapeNotch2'));
   [Wn,Zeta] = damp([Group.Zero(1);Group.Pole(1)],Ts);
   Wn = Wn*funitconv('rad/s',FreqUnits);
   Status = ...
      sprintf('%s\n%s%s%s%s%s',...
      Text, ...
      getString(message('Control:compDesignTask:lblNaturalFrequency',sprintf('%0.3g',Wn(1)), FreqUnits)), ...
      Spacing, ...
      getString(message('Control:compDesignTask:lblZeroDamping',sprintf('%0.3g',Zeta(1)))),

/* this ALWAYS GENERATED file contains the definitions for the interfaces */


 /* File created by MIDL compiler version 8.01.0618 */
/* @@MIDL_FILE_HEADING(  ) */



/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif

/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */

#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/

#ifndef __extensionvalidation_h__
#define __extensionvalidation_h__

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* Forward Declarations */ 

#ifndef __IExtensionValidation_FWD_DEFINED__
#define __IExtensionValidation_FWD_DEFINED__
typedef interface IExtensionValidation IExtensionValidation;

#endif 	/* __IExtensionValidation_FWD_DEFINED__ */


/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "Mshtml.h"

#ifdef __cplusplus
extern "C"{
#endif 


/* interface __MIDL_itf_extensionvalidation_0000_0000 */
/* [local] */ 

/*******************************************************
 *                                                     *
 *     Copyright (C) Microsoft. All rights reserved.   *
 *                                                     *
 *******************************************************/
#ifdef _MSC_VER
#pragma once
#endif

#pragma comment(lib,"uuid.lib")

#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
typedef 
enum ExtensionValidationContexts
    {
        ExtensionValidationContextNone	= 0,
        ExtensionValidationContextDynamic	= 0x1,
        ExtensionValidationContextParsed	= 0x2
    } 	ExtensionValidationContexts;

typedef 
enum ExtensionValidationResults
    {
        ExtensionValidationResultNone	= 0,
        ExtensionValidationResultDoNotInstantiate	= 0x1,
        ExtensionValidationResultArrestPageLoad	= 0x2
    } 	ExtensionValidationResults;



extern RPC_IF_HANDLE __MIDL_itf_extensionvalidation_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_extensionvalidation_0000_0000_v0_0_s_ifspec;

#ifndef __IExtensionValidation_INTERFACE_DEFINED__
#define __IExtensionValidation_INTERFACE_DEFINED__

/* interface IExtensionValidation */
/* [uuid][unique][object][local] */ 


EXTERN_C const IID IID_IExtensionValidation;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("7d33f73d-8525-4e0f-87db-830288baff44")
    IExtensionValidation : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE Validate( 
            /* [in] */ REFGUID extensionGuid,
            /* [string][in] */ LPWSTR extensionModulePath,
            /* [in] */ DWORD extensionFileVersionMS,
            /* [in] */ DWORD extensionFileVersionLS,
            /* [in] */ IHTMLDocument2 *htmlDocumentTop,
            /* [in] */ IHTMLDocument2 *htmlDocumentSubframe,
            /* [in] */ IHTMLElement *htmlElement,
            /* [in] */ ExtensionValidationContexts contexts,
            /* [out] */ ExtensionValidationResults *results) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE DisplayName( 
            /* [string][out] */ LPWSTR *displayName) = 0;
        
    };
    
    
#else 	/* C style interface */

    typedef struct IExtensionValidationVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            IExtensionValidation * This,
            /* [in] */ REFIID riid,
            /* [annotation][iid_is][out] */ 
            _COM_Outptr_  void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            IExtensionValidation * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            IExtensionValidation * This);
        
        HRESULT ( STDMETHODCALLTYPE *Validate )( 
            IExtensionValidation * This,
            /* [in] */ REFGUID extensionGuid,
            /* [string][in] */ LPWSTR extensionModulePath,
            /* [in] */ DWORD extensionFileVersionMS,
            /* [in] */ DWORD extensionFileVersionLS,
            /* [in] */ IHTMLDocument2 *htmlDocumentTop,
            /* [in] */ IHTMLDocument2 *htmlDocumentSubframe,
            /* [in] */ IHTMLElement *htmlElement,
            /* [in] */ ExtensionValidationContexts contexts,
            /* [out] */ ExtensionValidationResults *results);
        
        HRESULT ( STDMETHODCALLTYPE *DisplayName )( 
            IExtensionValidation * This,
            /* [string][out] */ LPWSTR *displayName);
        
        END_INTERFACE
    } IExtensionValidationVtbl;

    interface IExtensionValidation
    {
        CONST_VTBL struct IExtensionValidationVtbl *lpVtbl;
    };

    

#ifdef COBJMACROS


#define IExtensionValidation_QueryInterface(This,riid,ppvObject)	\
    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

#define IExtensionValidation_AddRef(This)	\
    ( (This)->lpVtbl -> AddRef(This) ) 

#define IExtensionValidation_Release(This)	\
    ( (This)->lpVtbl -> Release(This) ) 


#define IExtensionValidation_Validate(This,extensionGuid,extensionModulePath,extensionFileVersionMS,extensionFileVersionLS,htmlDocumentTop,htmlDocumentSubframe,htmlElement,contexts,results)	\
    ( (This)->lpVtbl -> Validate(This,extensionGuid,extensionModulePath,extensionFileVersionMS,extensionFileVersionLS,htmlDocumentTop,htmlDocumentSubframe,htmlElement,contexts,results) ) 

#define IExtensionValidation_DisplayName(This,displayName)	\
    ( (This)->lpVtbl -> DisplayName(This,displayName) ) 

#endif /* COBJMACROS */


#endif 	/* C style interface */




#endif 	/* __IExtensionValidation_INTERFACE_DEFINED__ */


/* interface __MIDL_itf_extensionvalidation_0000_0001 */
/* [local] */ 

EXTERN_C GUID CATID_ExtensionValidation;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion


extern RPC_IF_HANDLE __MIDL_itf_extensionvalidation_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_extensionvalidation_0000_0001_v0_0_s_ifspec;

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif


