システムAPI
このドキュメントは、Altium Designer SDK の一部である Altium Designer の低レベル
本書には、Altium Designer におけるサーバー開発に使用できる低レベルのアプリケーション・プログラミング・インターフェース情報が含まれています。Altium Designer SDK は、必要に応じてサーバープロジェクト内の Source Units を
Altium Designer System API のオブジェクトインターフェース
|
IServerModule Interface IServerProcess Interface |
INotificationHandler Interface INavigationSystem Interface IExternalForm Interface |
IDynamicHelpManager Interface IOptionsManager Interface INavigationDocument Interface |
Altium Designer SDK
Plug-in SDK は、プラグインやアドオンの開発において Altium Designer API の全機能を活用できます。 スクリプトシステムは Altium Designer SDK のサブセットを実装しています。基本的に、スクリプトシステムで使用される Altium Designer のオブジェクトインターフェースは、プラグインプロジェクトでも利用できます。
システムレベル - Electronic Design Platform API
- Altium Designer スイート内の Electronic Design Platform のさまざまなオブジェクトを扱うクライアント/サーバーインターフェース。
- プラグインのプロセスを扱うルーチン
- Altium Designer プラットフォームの低レベル実装を扱うルーチン
- Embarcadergo Delphi のソースユニットから公開されるルーチンおよびオブジェクト。
他の API 用の個別リファレンス
- Schematic API(EDPXXX_SCH ファイル群)については Schematic API Reference
- を参照してください PCB API(EDPXXX_PCB ファイル群)については PCB API Reference
- を参照してください Integrated Library API(EDPXXX ファイル群)については Integrated Library API Reference
- を参照してください Workspace Manager および Integrated Library API(EDPXXX ファイル群)については Workspace Manager API Reference
- を参照してください Client Server API(EDPXXX ファイル群) 。
インターフェースとは何か?
インターフェース内の各メソッドは、対応するクラスで実装されます。インターフェースはクラスのように宣言されますが、直接インスタンス化することはできず、独自のメソッド定義も持ちません。クラスがサポートする各インターフェースは、実際にはメソッドへのポインタのリストです。したがって、インターフェースに対してメソッド呼び出しが行われるたびに、その呼び出しは実際にはインターフェースが保持するメソッドポインタの 1 つへ振り分けられ、本当にそれを実装しているオブジェクトが処理を行えるようになります。
クライアント/サーバーインターフェースは、関連するオブジェクトがメモリ上に存在する限り存在します。そのため、プラグインプロジェクトでコードを書く際には、問い合わせようとしているインターフェースが存在するかどうかを、そのメソッドを呼び出す前に確認する責任があります。
空のワークスペース、つまり Altium Designer のシェルは最上位のクライアントウィンドウです。クライアントモジュールは IClient インターフェースオブジェクトで表され、この IClient インターフェースを通じて、読み込まれたサーバーのデータ構造を参照できます。プラグインは IServerModule インターフェースとして表され、Altium Designer 内のプラグインモジュールとなります。
Client 関数を呼び出すことで IClient インターフェースオブジェクトを取得でき、その後、このオブジェクトから直接メソッドを実行できます。たとえばこの
Var ReportDocument : IServerDocument; Begin If Client = Nil Then Exit; // Opens and shows a text file in Altium Designer ReportDocument := Client.OpenDocument('Text',FileName); If ReportDocument <> Nil Then Client.ShowDocument(ReportDocument); End;
スクリプト例
\Client / Server スクリプトの例は \Examples\Scripts\DXP フォルダーにあります
Client / Server インターフェースの使用
Altium Designer のアーキテクチャの中心にあるのは、単一のクライアントモジュールがコントローラーとして機能し、ロードされたサーバーと連携するという概念です。各サーバーは自身のドキュメントを管理します。これが Altium Designer の全体像です。つまり、1 つの Client 実行ファイルと、下図に示すように動的リンクライブラリモジュールとしてロードされる複数のサーバーがあります。
オブジェクトインターフェース
IClient インターフェースは Altium Designer アプリケーションの Client サブシステムを表し、Client サブシステムは、ロードされたサーバーのコマンド(事前にパッケージ化されたプロセスランチャー)、プロセスの深さ、およびドキュメントを管理します。Altium Designer にロードされるすべてのサーバーモジュールは Altium Designer のクライアントサブシステムにリンクされているため、特定のロード済みドキュメントにアクセスできます。
クライアントモジュールはロード済みサーバーの一覧を保持しています。つまり、このモジュールは、開かれているサーバードキュメント、ロード済みサーバープロセス、ロード済みサーバーリソースの複数のリストを格納しています。
スクリプト内で Client 関数を呼び出すことで IClient インターフェースオブジェクトを取得し、この関数から直接メソッドを実行できます。たとえば Client.OpenDocument('Text',FileName); というメソッド呼び出しは有効です。
Client 関数は IClient インターフェースオブジェクトを返します。
Client のインターフェース
• ICommandLauncher(プロセスランチャーを扱う)
• IServerDocumentView(パネルまたはサーバードキュメントを扱う)
• IProcessControl(スタックされたプロセスのレベルを決定する)
• IGUIManager(ユーザーインターフェース、パネルの位置と状態を扱う)
• IServerModule(ロードされたサーバーを扱う)
• INotification(通知メッセージをサーバー群または指定したサーバーへブロードキャストまたはディスパッチする)
サーバーインターフェース
IServerModule インターフェースは、Altium Designer にロードされたサーバーを表します。サーバーモジュールを取得してそのメソッドを呼び出すには、ModuleName プロパティに対象サーバー名を渡して使用します。問題がなければ、そのサーバーのプロセスを起動できます。以下に例を示します。
If StringsEqual(ServerModule.ModuleName,'TextEdit') Then Begin ServerModule.CommandLauncher.LaunchCommand('TextEdit:MoveCursorToTopOfDocument', Nil,0,ServerDocument.View[0]); End;
サーバーとそのドキュメントの関係
IServerModule インターフェースには、次のインターフェースがあります。
• ICommandLauncher(サーバーのプロセステーブルを扱う)
• IServerDocument(Altium Designer にロードされた設計ドキュメントを表す)
• IServerView(システムのビューを持つことができるパネルを表す)
• IServerDocumentView(ドキュメントビュー、つまりドキュメントウィンドウまたはパネルウィンドウを扱う)
• IExternalForm(ドキュメントフォームまたはパネルフォームとして認識される、Altium Designer 対応の Delphi フォームを表す。これらのフォームは IServerDocumentView または IServerView インターフェースオブジェクトによってラップされます。この IExternalForm インターフェースオブジェクトには、フォームのサイズ変更や表示などの低レベルメソッドがあります)
• IProcessControl(フォーカスされているサーバードキュメントに対するスタック済みプロセスのレベルを表す)
• INotification は Client システムからのシステム通知を表し、すべてのサーバーモジュールがこれらの通知を受け取ります。通知を処理し、それに応じた動作を行うことができます。また、通知を使用してドキュメントと関連パネルを同期させることもできます)。
Altium Designer におけるサーバーのドキュメントおよびパネルのインターフェース
ドキュメントとパネルの概念は、Altium Designer でサーバーがどのように動作するかを理解するうえで中心的です。サーバーは自身のパネルとドキュメントを管理します。Altium Designer は現在アクティブなパネルとドキュメントにアクセスでき、それらのサイズと位置を管理します。基本的に、パネルには 2 種類あります。ドキュメントに関連付けられたパネルと、Messages パネルのようなスタンドアロンパネルです。
Altium Designer にロードされた各サーバーは、それぞれ独自のドキュメントを格納します(たとえば PCB ドキュメントや PCB ライブラリドキュメントなど、異なるドキュメント種別があります)。また、各ドキュメントには対応するパネルがあります。たとえば PCB パネルと PCB ドキュメントです。さらに、サーバーは同じドキュメント種別を格納する独自のドキュメントコンテナを持ちます。そのため、異なるドキュメント種別ごとにドキュメントコンテナが存在します。各ドキュメントコンテナには、ドキュメントのビューと関連パネル、さらに存在する場合はスタンドアロンパネルも格納されます。
下のスクリーンショットでは、Altium Designer で 2 つの PCB ドキュメントが開かれており、左側に

ここでは、上図に示されている Altium Designer 内のサーバー、ドキュメント、およびパネルを表す主なインターフェースについて見ていきます。
Altium Designer 内の Client システムは、アクティブなドキュメントおよびパネルビューに直接アクセスできます。そのため、パネルの境界や表示/非表示は、IClient およびその複合 IClientGUIManager インターフェースを通じてプログラムから設定できます。Client と Server モジュールはそれぞれ独自の Command Launcher 機能を持ち、これはサーバープロセスの実行に使用されます。これは ICommandLauncher インターフェースとしてカプセル化されています。
Altium Designer の Work-space manager サーバーには、複数の IServerView インターフェースがあります。たとえば
主なインターフェースは 3 つあり、IServerModule、IServerView、IServerDocumentView インターフェースについて、上図に関連付けて見ていきます。
IServerModule Interface
Altium Designer にロードされる各サーバーは IServerModule インターフェースによってカプセル化されます。したがって、上図では PCB エディターサーバー用の IServerModule インターフェース、Work-space Manager サーバー用のもの、Help Advisor サーバー用のもの、さらに PCB エディター用アドオンのインターフェースなどがあります。
IServerView Interface
IServerView インターフェースは、複数種類のドキュメントを扱えるグローバル(スタンドアロン)パネルを指します。たとえば
IServerDocumentView インターフェース
PCB ドキュメントには、エディター(ドキュメント)ビューと 3 つのパネルビュー(
クライアント/サーバー インターフェース
Altium Designer 内のクライアント/サーバー アーキテクチャで使用される主要なインターフェースは次のとおりです。
IClient シェルとそのインターフェース:
• ICommandLauncher(クライアントのプロセスランチャー テーブルを扱う)
• IProcessLauncher(クライアントからサーバープロセスを起動する処理を扱う)
• IServerDocumentView(パネルまたはサーバードキュメントを扱う)
• IProcessControl(スタックされたプロセスのレベルを判定する)
• IGUIManager(Altium Designer のユーザーインターフェース、パネルの位置および状態を扱う)
• IServerModule(Altium Designer にロードされたサーバーを扱う)
• INotification(クライアントはサーバー群または指定されたサーバーに通知メッセージをブロードキャストまたはディスパッチできる)
Altium Designer の構成インターフェース:
• IServerRecord(Altium Designer 起動時にサーバー情報を収集する - 未ロードのサーバー)
• IServerWindowKind(Altium Designer で開くドキュメント種別を決定する)
• IServerProcess(現在のサーバープロセスの情報を保持する)
IServerModule インターフェースは、Altium Designer にロードされたサーバーを表します
IServerModule インターフェースは、次のインターフェースを持ちます:
• ICommandLauncher インターフェース(サーバーのプロセス テーブルを扱う)
• IServerDocument インターフェース(Altium Designer にロードされた設計ドキュメントを表す)
• IServerView インターフェース(Altium Designer システムのビューを持てるパネルを表す)
• IServerDocumentView インターフェース(ドキュメントビュー(ドキュメント ウィンドウまたはパネル ウィンドウ)を扱う)
• IExternalForm インターフェース(ドキュメントフォームまたはパネルフォームとしての、Altium Designer 対応 Delphi フォームを表す。これらのフォームは IServerDocumentView または IServerView インターフェース オブジェクトによってラップされる。この IExternalForm インターフェース オブジェクトは、フォームのリサイズや表示などの低レベル メソッドを持つ)
• IProcessControl(このフォーカスされているサーバードキュメントに対するスタック済みプロセスのレベルを表す)
• INotification インターフェースは、クライアントシステムからのシステム通知を受信し、すべてのサーバーモジュールがこれらの通知を受け取ります。通知を処理し、そこから必要な動作を行うことができます。通知を使用して、ドキュメントと関連パネルを同期することもできます)。
IClient インターフェース
IClient インターフェース(RT_ClientServerInterface ユニット)は、Altium Designer アプリケーションの Client サブシステムを表し、Client はコマンド(あらかじめパッケージ化されたプロセスランチャー)、プロセス深度、およびドキュメントを管理します。Altium Designer にロードされたすべてのサーバーモジュールは、単一のクライアント実行可能サブシステムへのフックを持っているため、ロード済みサーバーの特定ドキュメントへアクセスしたり、サーバーコマンドを起動したりできます。
IClient シェルとそのインターフェース;
• ICommandLauncher(プロセスランチャーを扱う)
• IProcessLauncher(サーバープロセスの起動を扱う)
• IServerDocumentView(パネルまたはサーバードキュメントを扱う)
• IProcessControl(スタックされたプロセスのレベルを判定する)
• IGUIManager(ALtium Designer のユーザーインターフェース、パネルの位置および状態を扱う)
• IServerModule(ALtium Deisgner にロードされたサーバーを扱う)
• INotification(サーバー群または指定されたサーバーに通知メッセージをブロードキャストまたはディスパッチする)
スクリプト内で Client 関数を直接呼び出すことで、IClient インターフェース オブジェクトを取得できます。
|
|
IClient メソッド
AddServerView メソッド
(IClient インターフェース)
Procedure AddServerView (AView : IServerView);
このプロシージャは、カスタムパネルのようなドキュメントビューを Altium Designer 内の Client オブジェクトに追加します。サーバーコマンドを登録する TServerModule コンストラクターでは、ここでグローバル パネルビューを作成します。TServerModule.CreateServerViews メソッドでは、グローバルパネルフォームと、そのパネルフォームから作成されたビューを用意します。その後、そのビューはサーバーモジュール(TServerModule.AddView())とクライアントオブジェクト(Client.AddServerView)の両方に追加されます。
IServerView インターフェース
IClient インターフェース
TServerModule クラス用の RT_ServerImplementation。
ApplicationIdle メソッド
(IClient インターフェース)
Procedure ApplicationIdle;
ApplicationIdle メソッドが呼び出されると、このプロシージャは Altium Designer を、Window メッセージおよび Altium Designer 固有のメッセージを処理できるモードにします。
IClient インターフェース
BeginDisableInterface メソッド
(IClient インターフェース)
Procedure BeginDisableInterface;
これらの BeginDisableInterface および EndDisableInterface メソッドは、クライアントのユーザーインターフェースを無効にする必要がある場合に呼び出されます。たとえば、大規模な処理が進行中で、ユーザーによる介入を望まない場合です。
EndDisableInterface メソッド
IClient インターフェース
BeginDocumentLoad メソッド
(IClient インターフェース)
Procedure BeginDocumentLoad;
BeginDocumentLoad および EndDocumentLoad プロシージャは、Altium Designer で一連のドキュメントをロードするために使用されます。
Client.BeginDocumentLoad; ServerDocument1 := Client.OpenDocument('Text',FileName1); ServerDocument2 := Client.OpenDocument('Text',FileName2); ServerDocument3 := Client.OpenDocument('Text',FileName3); Client.EndDocumentLoad(True);
EndDocumentLoad メソッド
IClient インターフェース
BeginRecoverySave メソッド
(IClient インターフェース)
Procedure BeginRecoverySave;
BeginRecoverySave および EndRecoverySave プロパティは、Altium Designer で現在の設計ドキュメントのバックアップを行う際に、ドキュメント名変更に関するクライアント通知を抑制するために使用できます。リカバリー保存プロセスが進行中かどうかを確認するには、InRecoverySave メソッドを呼び出します。
EndRecoverySave メソッド
InRecoverySave メソッド
IClient インターフェース
BroadcastNotification メソッド
(IClient インターフェース)
Procedure BroadcastNotification (ANotification : INotification);
このプロシージャは Altium Designer 内で通知メッセージをブロードキャストし、アクティブなすべての設計ドキュメント/サーバーに応答の機会を与えます。BoardcastNotification は DispatchNotification (Nil, ANotification); です。Notification インターフェースには 5 つの種類があります。ISystemNotification、IDocumentNotification、IDocumentFormNotification、IViewNotification、および IModuleNotification です。
DispatchNotifiaction メソッド
INotification インターフェース
IClient インターフェース
Client_CanServerStarted メソッド
(IClient インターフェース)
Function CanServerStarted (AModuleName : PChar) : LongBool;
この関数は、サーバーモジュールを Altium Designer にロードできるかどうかを確認します。StartServer 関数を呼び出す前にこれを使用してください。
IClient インターフェース
StartServer メソッド
CloseDocument メソッド
(IClient インターフェース)
Procedure CloseDocument(ADocument : IServerDocument);
このプロシージャは IServerDocument パラメーターを受け取り、指定したドキュメントを閉じます(そのドキュメントがすでに Altium Designer にロードされ、開かれている場合)。なお、ドキュメントは Altium Designer から削除されるわけではありません。たとえば、そのドキュメントは依然として
OpenDocument メソッド
IClient インターフェース
Count プロパティ
(IClient インターフェース)
Property Count : Integer Read GetCount;
このプロパティは、Altium Designer の現在のセッションにおけるアクティブなサーバー数を返します。ServerModule プロパティと組み合わせて使用し、Server Module インターフェースを取得します。
GetCount メソッド
IServerModule インターフェース
IClient インターフェース
DispatchNotification メソッド
(IClient インターフェース)
Procedure DispatchNotification(IClient インターフェース)
Procedure EndDocumentLoad(AShow : LongBool);
BeginDocumentLoad および EndDocumentLoad プロシージャは、Altium Designer で一連のドキュメントを読み込むために使用されます。
Client.BeginDocumentLoad; ServerDocument1 := Client.OpenDocument('Text',FileName1); ServerDocument2 := Client.OpenDocument('Text',FileName2); ServerDocument3 := Client.OpenDocument('Text',FileName3); Client.EndDocumentLoad(True);
IClient インターフェース
BeginDocumentLoad メソッド
EndRecoverySave メソッド
(IClient インターフェース)
Procedure EndRecoverySave;
BeginRecoverySave および EndRecoverySave メソッドは、Altium Designer で現在の設計ドキュメントのバックアップを実行する際に、ドキュメント名の変更に関するクライアント通知を抑制するために使用できます。
リカバリ保存が進行中かどうかを確認するには、InRecoverySave メソッドを呼び出します。
BeginRecoverySave メソッド
InRecoverySave メソッド
IClient インターフェース
GetApplicationHandle メソッド
(IClient インターフェース)
Function GetApplicationHandle : Integer;
このアプリケーションハンドルは、サーバーからダイアログを動的に作成する必要がある場合にサーバーコード内で使用できます。これにより、Altium Designer 上に表示されるダイアログは Altium Designer のアイコンを継承し、タスクバー上で 1 つのアプリケーションとして表示されます。
この ApplicationHandle プロパティは、ダイアログの create コンストラクタのパラメータとして渡すことができます。GetMainWindowHandle 関数はこれに相当します。
GetMainWindowHandle メソッド
ApplicationHandle プロパティ
IClient インターフェース
GetCommandLauncher メソッド
(IClient インターフェース)
Function GetCommandLauncher : ICommandLauncher;
この関数は ICommandLauncher インターフェースを取得します。これは Client のプロセスランチャーを表し、サーバープロセスおよびそのパラメータの起動に使用できます。IProcessLauncher インターフェースも参照してください。
ICommandLauncher インターフェース
IProcessLauncher インターフェース
IClient インターフェース
GetCount メソッド
(IClient インターフェース)
Function GetCount : Integer;
このメソッドは、Altium Designer の現在のセッションにおけるアクティブ(ロード済み)サーバーの数を返します。ServerModule インターフェースを取得するには、このメソッド(または Count プロパティ)を ServerModule プロパティと組み合わせて使用します。
Count プロパティ
IClient インターフェース
GetCurrentView メソッド
(IClient インターフェース)
Function GetCurrentView : IServerDocumentView;
この関数は現在のビュー(つまり Altium Designer でフォーカスされている開いているドキュメント)を取得します。CurrentView プロパティおよび IServerDocumentView インターフェースを参照してください。
Procedure GrabACurrentDocumentView; Var ServerDocumentView : IServerDocumentView; CurrentDirectory : AnsiString; Begin ServerDocumentView := Client.GetCurrentView; CurrentDirectory := ExtractFileDir(ServerDocumentView.GetOwnerDocument.FileName); End;
CurrentView プロパティ
IClient インターフェース
GetDefaultExtensionForDocumentKind メソッド
(IClient インターフェース)
Function GetDefaultExtensionForDocumentKind(DocumentKind : PChar) : PChar;
この関数は、document kind パラメータに基づいて、指定されたドキュメント種別のデフォルト拡張子を返します。
IClient インターフェース
GetDocumentByPath メソッド
(IClient インターフェース)
Function GetDocumentByPath(Const AFilePath : WideString) : IServerDocument;
この関数は設計ドキュメントの完全なファイルパスを取得し、そのパスが有効であれば、設計ドキュメント全体およびそのパネルを表す IServerDocument オブジェクトインターフェースを返します。
IClient インターフェース
GetDocumentKindFromDocumentPath メソッド
(IClient インターフェース)
Function GetDocumentKindFromDocumentPath (Path : PChar) : PChar;
この関数は、有効な完全ドキュメントパスに基づいてドキュメント種別を返します。
IClient インターフェース
GetEncryptedTechnologySets メソッド
(IClient インターフェース)
Function GetEncryptedTechnologySets (Var ValidAtTimestamp : Cardinal) : WideString;
IClient インターフェース
GetGUIManager メソッド
(IClient インターフェース)
Function GetGUIManager : IGUIManager;
GUI Manager インターフェースを返します。代わりに GUIManager プロパティを使用してください。このインターフェースオブジェクトは、Altium Designer のステータスバーの制御や、Altium Designer 内のパネルの位置と状態の管理など、Altium Designer のユーザーインターフェースを扱います。
IGUIManager インターフェース
IClient インターフェース
GetLicenseManager 関数
(IClient インターフェース)
Function GetLicenseManager : ILicenseManager;
IClient インターフェース
ILicenseManager インターフェース
GetMainWindowHandle メソッド
(IClient インターフェース)
Function GetMainWindowHandle : Integer;
このアプリケーションハンドルは、サーバーからダイアログを動的に作成する必要がある場合にサーバーコード内で使用できます。これにより、Altium Designer 上に表示されるダイアログは Altium Designer のアイコンを継承し、タスクバー上で 1 つのアプリケーションとして表示されます。この ApplicationHandle プロパティもこれに相当します。
GetApplicationHandle メソッド
ApplicationHandle プロパティ
IClient インターフェース
GetNavigationSystem メソッド
(IClient インターフェース)
Function GetNavigationSystem : INavigationSystem;
この関数は Navigation system インターフェースを返します。
INavigationSystem インターフェース
IClient インターフェース
GetOptionsManager 関数
(IClient インターフェース)
Function GetOptionsManager : IOptionsManager;
このメソッドは IOptionsManager インターフェースを取得します。このインターフェースを使用すると、GetOptionsReader または GetOptionsWriter を呼び出して、対象サーバーのオプション(設定)を取得または書き込むことができます。各エディターサーバーには、そのサーバードキュメントを管理するオプションがあります。
Var Reader : IOptionsReader; Begin Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,''); If Reader = Nil Then Exit; AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue); End;
IClient インターフェース
IOptionsManager
GetOptionsSetByName メソッド
(IClient インターフェース)
Function GetOptionsSetByName (Const AName : Widestring) : IDocumentOptionsSet;
この関数は、有効な Name 文字列に基づいて IDocumentOptionsSet インターフェースを取得します。
GetOptionsSetCount メソッド
GetOptionsSet メソッド
IDocumentOptionsSet インターフェース
IClient インターフェース
GetOptionsSetCount メソッド
(IClient インターフェース)
Function GetOptionsSetCount : Integer;
この関数は Options Set の数を返します。
GetOptionsSet メソッド
GetOptionsSetByName メソッド
IClient インターフェース
GetOptionsSet メソッド
(IClient インターフェース)
Function GetOptionsSet (Index : Integer) : IDocumentOptionsSet;
この関数は、指定したインデックスの Options Set(IDocumentOptionsSet 型)を返します。
GetOptionsSetCount メソッド
GetOptionsSetByName メソッド
IClient インターフェース
GetPanelInfoByName メソッド
(IClient インターフェース)
Function GetPanelInfoByName (Const APanelName : Widestring)
: IServerPanelInfo;
この関数は、指定したパネルに対する IServerPanelInfo インターフェースを取得します。
IServerPanelInfo インターフェース
IClient インターフェース
GetProcessControl メソッド
(IClient インターフェース)
Function GetProcessControl : IProcessControl;
Process Control インターフェースを返します。この Process Control は、発生している「再入可能」プロセスの数、すなわち別のアクティブなクライアントプロセスの上に積み重なって発生している 1 つのクライアントプロセスの数を判定します。これがプロセス深度です。Process Control のプロセス深度が 0 の場合、Altium Designer では何も実行されていないことを示します。
IProcessControl インターフェース
IClient インターフェース
GetRealMainWindowHandle メソッド
(IClient インターフェース)
Function GetRealMainWindowHandle : THandle;
この関数は、Altium Designer のメインウィンドウのウィンドウハンドルを返します。
IClient インターフェース
GetServerNameByPLID メソッド
(IClient インターフェース)
Function GetServerNameByPLID(APLID : PChar) : PChar;
この関数は、PLID 識別子文字列(サーバーのリソースファイルから抽出された文字列)に基づいてサーバー名を返します。
IClient インターフェース
GetServerModule メソッド
(IClient インターフェース)
Function GetServerModule(Index : Integer) : IServerModule;
ServerModule プロパティは Count プロパティと組み合わせて、アクティブ(ロード済み)サーバーを取得するために使用します。ServerModule プロパティは、Altium Designer でロードされたサーバーモジュールに対する IServerModule インターフェースを返します。
なお、PCB サーバーおよび Schematic サーバーには、それぞれ独自の IPCB_ServerInterface インターフェースおよび ISch_ServerInterface インターフェースがあります。
この例では、Schematic の IServerModule インターフェースを取得し、Altium Designer で開いているドキュメントビューの数を返します
Var ServerModule : IServerModule; Begin If Client = Nil Then Exit; ServerModule := Client.ServerModuleByName('SCH'); ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount)); End;
Count プロパティ
IServerModule プロパティ
ServerModuleByName プロパティ
IClient インターフェース
GetServerModuleByName メソッド
(IClient インターフェース)
Function GetServerModuleByName (Const AModuleName : Widestring) : IServerModule;
この関数は、AModuleName パラメータの有効性に応じてサーバーモジュールインターフェースを返します。例としては 'PCB' や 'SCH' があります。インデックス指定のサーバーモジュールを返すには、代わりに ServerModuleByName プロパティを使用してください。
Var ServerModule : IServerModule; Begin If Client = Nil Then Exit; ServerModule := Client.ServerModuleByName('SCH'); ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount)); End;
GetServerModule メソッド
ServerModule プロパティ
IClient インターフェース
GetServerRecord メソッド
(IClient インターフェース)
Function GetServerRecord (Index : Integer) : IServerRecord;
GetServerRecord 関数は、Altium Designer のインストール先の System フォルダにあるインストール *.INS ファイルに基づいて、インストール済みサーバーの数を報告します)。この関数は GetServerRecordCount 関数と組み合わせて使用します。
IClient インターフェースには GetServerRecord メソッドと GetServerModule メソッドがあります。これら 2 つのメソッドの違いは、GetServerRecord 関数がインストール済みサーバーの数(Altium Designer のインストール先 \System\ フォルダ内の *.INS ファイル)を報告する点です。
GetServerModule は、Altium Designer 内でアクティブ(ロード済み)のサーバーを返すだけです。各アクティブサーバーを取得するには、GetCount 関数を呼び出し、そのカウントパラメータを GetServerModule 関数に渡す必要があります。
GetServerRecordCount メソッド
GetServerModule メソッド
IClient インターフェース
GetServerRecordCount メソッド
(IClient インターフェース)
Function GetServerRecordCount : Integer;
この関数は、Altium Designer ソフトウェアのインストール先 \System\ フォルダで見つかったサーバーインストールファイルを表すサーバーレコードの数を返します。GetServerRecord 関数と組み合わせて使用します。
IServerRecord インターフェース
IClient インターフェース
GetServerRecordByName メソッド
(IClient インターフェース)
Function GetServerRecordByName(AModuleName : WideString) : IServerRecord;
この関数は、AModuleName パラメータに基づいて IServerRecord インターフェースを返します。この IServerRecord インターフェースは、サーバーのインストールファイル(INS 拡張子付き)を表します。
Var ClientModule : IClient; ServerRecord : IServerRecord; Version : WideString; Begin ClientModule := Client; If ClientModule = Nil Then Exit; //The IServerRecord interface encapsulates the details // of a server's installation file //We are interested in the Altium Designer's Client Module // and fetch the product version. ServerRecord := ClientModule.GetServerRecordByName('CLIENT'); Version := ServerRecord.GetVersion; ShowMessage(Version); End;
IServerRecord インターフェース
IClient インターフェース
GetServerViewFromName メソッド
(IClient インターフェース)
Function GetServerViewFromName (Const ViewName : Widestring) : IServerView;
この関数は、サーバービューの名前に応じてサーバービューオブジェクトインターフェースを返します。IServerView インターフェースは、パネルビューを表すとともに、ドキュメントビューの祖先でもあります。
IExternalForm インターフェース
IServerView インターフェース
OpenDocument メソッド
ShowDocument メソッド
IServerDocument インターフェース
IClient インターフェース
OpenDocumentShowOrHide メソッド
(IClient インターフェース)
Function OpenDocumentShowOrHide (Const AKind, AFileName : WideString; AShowInTree : Boolean) : IServerDocument;
この関数は特定のドキュメントを開きますが、Altium Designer ワークスペース内での表示方法を制御できます。
IClient インターフェース
HandleException メソッド
(IClient インターフェース)
Procedure HandleException (Const AMessage : WideString);
IClient インターフェース
InRecoverySave メソッド
(IClient インターフェース)
Function InRecoverySave : LongBool
この関数は、BeginRecoverySave メソッドまたは EndRecoverySave メソッドを呼び出す前に、Altium Designer が Recovery Save モードの処理中かどうかを確認します。
BeginRecoverySave メソッド
EndRecoverySave メソッド
IClient インターフェース
IsDocumentOpen メソッド
(IClient インターフェース)
Function IsDocumentOpen (Const AFilePath : PChar) : LongBool;
ドキュメントが Altium Designer で開かれているかどうかを示すブール値を返します。この結果は、AFilePath パラメータが有効かどうかに依存します。
IClient インターフェース
IsQuitting メソッド
(IClient インターフェース)
Function IsQuitting : Boolean;
Altium Designer の状態を表すブール値を返します。Altium Designer が終了しようとしている、または終了処理中の場合は True、まだアクティブな場合は False です。
IClient インターフェース
LastActiveDocumentOfType メソッド
(IClient インターフェース)
Function LastActiveDocumentOfType (Const AType : Widestring) : IServerDocument;
この関数は、ドキュメント種別に基づいて、Altium Designer 内で最後にアクティブだった読み込み済みドキュメントを返します。種別には PCB、SCH、TEXT、WAVE、PCBLIB、SCHLIB があります。
IClient インターフェース
IsInitialized 関数
(IClient インターフェース)
Function IsInitialized : LongBool;
Client インターフェース
LicenseInfoStillValid メソッド
(IClient インターフェース)
Function LicenseInfoStillValid (Const RetrievedAt : Cardinal) : LongBool;
IClient インターフェース
MainWindowHandle プロパティ
(IClient インターフェース)
Property MainWindowHandle : Integer Read GetMainWindowHandle;
MainWindowHandle プロパティは、Altium Designer のメインウィンドウのハンドルを返します。これは、Altium Designer に関連付けられるアドオンダイアログで使用でき、たとえばタスクバー上では Altium Designer のアイコンが 1 つだけ表示されるようにできます。
GetMainWindowHandle メソッド
ApplicationHandle プロパティ
IClient インターフェース
OpenDocument メソッド
(IClient インターフェース)
Function OpenDocument (Const AKind, AFileName : PChar) : IServerDocument;
OpenDocument メソッドは、このドキュメントの DocumentKind および FileName の値が有効な場合に、IServerDocument インターフェースを返します。
Var ReportDocument : IServerDocument; Begin ReportDocument := Client.OpenDocument('Text',FileName); If ReportDocument <> Nil Then Client.ShowDocument(ReportDocument); End
ShowDocument メソッド
IClient インターフェース
OpenNewDocument メソッド
(IClient インターフェース)
Function OpenNewDocument (Const AKind, AFileName, ANewName : Widestring; ReuseExisting : Boolean) : IServerDocument;
IClient インターフェース
QuerySystemFont メソッド
(IClient インターフェース)
Procedure QuerySystemFont ( QueryMode : TFontQueryMode;
Var AUseSysFont : Boolean;
Var AFontName : WideString;
Var AFontSize : Integer;
Var AFontStyle : TFontStyles;
Var AFontColor : TColor;
Var AFontCharset : TFontCharset);
使用されているシステムフォントを取得します。
IClient インターフェース
RegisterNotificationHandler メソッド
(IClient インターフェース)
Procedure RegisterNotificationHandler(Const Handler : INotificationHandler);
RegisterNotificationHandler メソッドは、サーバーオブジェクトが作成されてコンピュータメモリに読み込まれた後、その通知ハンドラを Altium Designer の Client モジュール部分に登録します。Handler パラメータにはサーバーモジュールオブジェクトが含まれます。
INotificationHandler オブジェクトインターフェースは、Altium Designer で発生した通知を処理する役割を持ちます。
各サーバーオブジェクトには、システム全体の Preferences ダイアログでオプション値が調整されたときに通知を処理する HandleNotification プロシージャがあります。
たとえば、特定のサーバー通知コードが検出されるたびに、HandleNotification プロシージャではサーバーパネル上のサーバー設定値を更新する呼び出しを行います。
このメソッドは通常、スクリプトではなくサーバー開発で使用されます。
BroadcastNotification メソッド
DispatchNotification メソッド
UnRegisterNotificationHandler メソッド
INotificationHandler インターフェース
IClient インターフェース
RemoveServerView メソッド
(IClient インターフェース)
Procedure RemoveServerView (Const AView : IServerView);
このプロシージャは、サーバービュー(サーバードキュメントウィンドウを表す)を Altium Designer から削除します。
GetCurrentView メソッド
IClient インターフェース
ShowDocumentDontFocus メソッド
(IClient インターフェース)
Procedure ShowDocumentDontFocus(ADocument : IServerDocument);
このプロシージャは IServerDocument パラメータを取得し、その設計ドキュメントを表示しますが、以前にフォーカスされていたドキュメントのフォーカスは維持されます。まだ設計ドキュメントが何も開かれていない場合でも、この設計ドキュメントは表示されますが、フォーカスはされません。
OpenDocument メソッド
ShowDocument メソッド
IServerDocument インターフェース
IClient インターフェース
ShowDocument メソッド
(IClient インターフェース)
Procedure ShowDocument (ADocument : IServerDocument);
このプロシージャは、Altium Designer に読み込まれている Server Document を表す IServerDocument パラメータを取得し、その設計ドキュメントを Altium Designer に表示します。
この例では、client インターフェースを取得してからドキュメントを開いて表示します。
Procedure OpenAndShowADocument(Filename : TDynamicString); Var ReportDocument : IServerDocument; Begin If Client = Nil Then Exit; ReportDocument := Client.OpenDocument('Text',FileName); If ReportDocument <> Nil Then Client.ShowDocument(ReportDocument); End;
OpenDocument メソッド
IServerDocument インターフェース
IClient インターフェース
SetCurrentView メソッド
(IClient インターフェース)
Procedure SetCurrentView(Value : IServerDocumentView);
このプロシージャは IServerDocumentView パラメータを取得し、このドキュメントフォームを Altium Designer の現在のビューとして設定します。
GetCurrentView メソッド
CurrentView プロパティ
IClient インターフェース
StopServer メソッド
(IClient インターフェース)
Function StopServer (AModuleName : WideString) : Boolean;
StartServer プロパティおよび StopServer プロパティは、まだ読み込まれていないサーバーを Altium Designer に読み込んでからそのサーバーのプロセスを呼び出し、処理完了後にそのサーバーを停止するために使用できます。これによりコンピュータのメモリを節約できます。
StartServer 関数は通常、サーバーがまだ読み込まれていない状態で設計ドキュメントを読み込み、そのサーバーのプロセスや API 関数を実行する必要がある場合に使用されます。たとえば、PCB ドキュメントが 1 つも開かれていない Altium Designer の空のセッション中に、PCB ドキュメント上の内容を操作するために PCB API を使用する必要がある場合は、まず PCB サーバーを「開始」して PCB API を有効にする必要があります。
Client.StopServer('PCB');
StartServer メソッド
IClient インターフェース
StartServer メソッド
(IClient インターフェース)
Function StartServer (AModuleName : WideString) : Boolean;
StartServer プロパティおよび StopServer プロパティは、まだ読み込まれていないサーバーを Altium Designer に読み込んでからそのサーバーのプロセスを呼び出し、処理完了後にそのサーバーを停止するために使用できます。これによりコンピュータのメモリを節約できます。
StartServer 関数は通常、サーバーがまだ読み込まれていない状態で設計ドキュメントを読み込み、そのサーバーのプロセスや API 関数を実行する必要がある場合に使用されます。たとえば、PCB ドキュメントが 1 つも開かれていない Altium Designer の空のセッション中に、PCB ドキュメント上の内容を操作するために PCB API を使用する必要がある場合は、まず PCB サーバーを「開始」して PCB API を有効にする必要があります。
Client.StartServer('PCB');
StopServer メソッド
IClient インターフェース
UnregisterNotificationHandler メソッド
(IClient インターフェース)
Procedure UnregisterNotificationHandler(Const Handler : INotificationHandler);
UnregisterNotificationHandler メソッドは、サーバーオブジェクトがスコープ外になったとき(破棄されたとき)に、Client から通知ハンドラの登録を解除します。Handler パラメータにはサーバーモジュールオブジェクトが含まれます。
INotificationHandler オブジェクトインターフェースは、Altium Designer で発生した通知を処理する役割を持ちます。
各サーバーオブジェクトには、システム全体の Preferences ダイアログでオプション値が調整されたときに通知を処理する HandleNotification プロシージャがあります。
たとえば、特定のサーバー通知コードが検出されるたびに、HandleNotification プロシージャではサーバーパネル上のサーバー設定値を更新する呼び出しを行います。
このメソッドは通常、スクリプトではなくサーバー開発で使用されます。
BroadcastNotification
DispatchNotification
RegisterNotificationHandler メソッド
INotificationHandler インターフェース
IClient インターフェース
AddViewToFavorites メソッド
(IClient インターフェース)
Function AddViewToFavorites(Const AView : IServerDocumentView; AIsSnippet : Boolean) : Boolean;
IClient インターフェース
GetDynamicHelpManager メソッド
(IClient インターフェース)
Function GetDynamicHelpManager : IDynamicHelpManager;
このメソッドは Dynamic Help マネージャを返します。これは Altium Designer の Knowledge Center パネルを表します。
IClient インターフェース
IDynamicHelpManager インターフェース。
IClient プロパティ
ApplicationHandle プロパティ
(IClient インターフェース)
Property ApplicationHandle : Integer
ApplicationHandle プロパティは、サーバー内でアプリケーションハンドルを設定します。これは、サーバーからダイアログを動的に作成する必要がある場合に使用され、Altium Designer の前面に表示されるダイアログは毎回 Altium Designer のアイコンを継承し、タスクバー上では 1 つのアプリケーションとして表示されます。
たとえば、この ApplicationHandle プロパティは動的ダイアログの create コンストラクタへのパラメータとして渡すことができます。
通常、スクリプト作成者がこの applicationhandle プロパティを気にする必要はありません。このプロパティは、Altium Designer SDK の一部としてサーバー作成者が使用します。
サーバープロジェクトのメインユニット内
Function ServerFactory (AClient : IClient) : IServerModule; Safecall; Begin Result := TAddOn.Create(AClient, 'AddOn'); Application.Handle := Client.ApplicationHandle; End;
サーバープロジェクトのコマンドユニット内
Procedure DisplayResultsOnDialog(PadCount : TDynamicString); Var DisplayForm : TDialog; Begin DisplayForm := TDialog.Create(Application); DisplayForm.Label1.Caption := PadCount; DisplayForm.ShowModal; DisplayForm.Free; End;
IClient インターフェース
CommandLauncher プロパティ
(IClient インターフェース)
Property CommandLauncher : ICommandLauncher Read GetCommandLauncher;
CommandLauncher プロパティは Command Launcher インターフェースを返します。このインターフェースには、コマンドの起動に使用できる client のプロセスランチャーのテーブルが含まれています。
If StringsEqual(ServerModule.ModuleName,'TextEdit') Then Begin Client.CommandLauncher.LaunchCommand( 'TextEdit:MoveCursorToTopOfDocument', Nil,0,ServerDocument.View[0]); End;
ACommandLauncher := Client.GetCommandLauncher; If ACommandLauncher <> Nil Then Begin ACommandLauncher.GetCommandState(Command, Parameters, View, Enabled, Checked, Visible, Caption, Image); End;
GetCommandLauncher メソッド
IProcessLauncher インターフェース
ICommandLauncher インターフェース
IClient インターフェース
CurrentView プロパティ
(IClient インターフェース)
Property CurrentView : IServerDocumentView Read GetCurrentView Write SetCurrentView;
このプロパティは、Altium Designer における現在の設計ドキュメントビューを表す現在のドキュメントビューインターフェースを返します。
Client.SendMessage('PCB:Zoom', 'Action=Redraw' , 255, Client.CurrentView);
Procedure GrabACurrentDocumentView; Var ServerDocumentView : IServerDocumentView; FileName : WideString; Begin ServerDocumentView := Client.CurrentView; FileName := ServerDocumentView.GetOwnerDocument.FileName; End;
If StrPas(Client.CurrentView.ViewName) <> UpperCase('PCBLib') Then Exit;
このコードスニペットでは、現在のドキュメントの種類を確認するために
GetCurrentView メソッド
SetCurrentView メソッド
IServerDocumentView インターフェース
IClient インタ(IClient インターフェース)
Property GUIManager : IGUIManager Read GetGUIManager;
GUIManager プロパティは GUIManager インターフェースを返します。この Interface オブジェクトは、ステータスバーの制御、パネルの位置や状態など、Altium Designer のグラフィカルユーザーインターフェースを扱います。
IGUIManager インターフェース
IClient インターフェース
NavigationSystem プロパティ
(IClient インターフェース)
Property NavigationSystem : INavigationSystem Read GetNavigationSystem;
NavigationSystem プロパティは、Altium Designer のナビゲーションシステムを表します。ナビゲーションシステムは Navigation パネルの中核となる機能であり、設計プロジェクトのネット接続性の中心を担います。設計は、コンパイル済みシートのリスト、フラット化された階層、構造ツリーの 3 つの方法で構成できます。
IClient インターフェース
INavigationSystem インターフェース
ProcessControl プロパティ
(IClient インターフェース)
Property ProcessControl : IProcessControl Read GetProcessControl;
このプロパティは
ShowMessage('Current process depth ',IntToStr(Client.ProcessControl.ProcessDepth));
IClient インターフェース
IProcessControl インターフェース
ServerModule プロパティ
(IClient インターフェース)
Property ServerModule Integer : IServerModule Read GetServerModule;
ServerModule プロパティは Count プロパティと組み合わせて使用し、アクティブな(ロード済みの)サーバーを取得します。ServerModule プロパティは、Altium Designer にロードされているサーバーモジュールの IServerModule インターフェースを返します。
なお、PCB サーバーおよび Schematic サーバーには、それぞれ独自の IPCB_ServerInterface および ISch_ServerInterface インターフェースがあります。
この例では、Schematic の IServerModule インターフェースを取得し、Altium Designer で開いているドキュメントビューの数を返します
Var ServerModule : IServerModule; Begin If Client = Nil Then Exit; ServerModule := Client.ServerModuleByName('SCH'); ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount)); End;
IClient インターフェース
Count プロパティ
GetServerModule メソッド
IServerModule インターフェース
ServerModuleByName プロパティ
(IClient インターフェース)
Property ServerModuleByName Widestring : IServerModule Read GetServerModuleByName;
ServerModuleByName プロパティは、モジュール名が Client のアクティブサーバーテーブル内で見つかった場合に IServerModule インターフェースを返します。PCB エディターのモジュール名は PCB、Schematic Editor のモジュール名は SCH などです。
Var ServerModule : IServerModule; Begin If Client = Nil Then Exit; ServerModule := Client.ServerModuleByName('SCH'); ShowMessage('Doc Count = ' + IntToStr(ServerModule.DocumentCount)); End;
IClient インターフェース
IServerModule インターフェース
TimerManager プロパティ
(IClient インターフェース)
Property TimerManager : ITimerManager Read GetTimerManager;
このプロパティは、タイマーマネージャーオブジェクトのインターフェースを返します。
IClient インターフェース
ITimerManager インターフェース
OptionsManager プロパティ
(IClient インターフェース)
Property OptionsManager : IOptionsManager Read GetOptionsManager;
これは読み取り専用プロパティで、IOptionsManager インターフェースを返します。このインターフェースは、指定されたサーバーについて、Altium Designer のシステム全体の Preferences ダイアログへの値の管理(読み取りおよび書き込み)を担当します。
このインターフェースは、システム全体の Preferences ダイアログに独自のオプションページを追加し、それらのオプションページ上のコントロールを管理したいサーバー作成者にとって有用です。
Var Reader : IOptionsReader; Begin Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,''); If Reader = Nil Then Exit; AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue); End;
IClient インターフェース
IOptionsManager インターフェース
IServerModule インターフェース
サーバーは自身のサーバードキュメントを扱います。設計ドキュメントの種類は複数あり、たとえば Schematic Editor には Schematic と Schematic Library の 2 つのドキュメントタイプがあります。
各設計ドキュメントにはビューが格納され、ビューはドキュメントウィンドウまたはパネルウィンドウです。サーバーは、1 つのドキュメントビューに対して複数のパネルビューをホストすることができます。以下の図を参照してください。
またサーバーは、システム状態を表し、特定の設計ドキュメントに必ずしも結び付かない複数のグローバルパネルビューをホストすることもできます(たとえば Work-Space Manager サーバーには Message、Differences、Errors パネルがあります)。このドキュメントビュー / 複数パネルビュー構造は、Altium Designer のクライアント / サーバーアーキテクチャの基盤です。
これらの IServerModule インターフェース(RT_ClientServerInterface ユニット内)は、Altium Designer にロードされたサーバーを表します。このアプリケーションは、異なるサーバーモジュールの単一インスタンスを管理します。各サーバーは複数のサーバードキュメント種別を持つことができ、たとえば PCB サーバーは PCB および PCBLIB 設計ドキュメントの 2 つのサーバードキュメント種別をサポートしています。Altium Designer にロードされたサーバーは通常ドキュメントをホストし、各ドキュメントはさらにドキュメントビューとパネルビューをホストします。
以下の図は、サーバードキュメントを持つサーバーモジュールを表しています。各ドキュメントにはビュー、すなわちドキュメントビューと関連するパネルビューがあります。
IServerModule インターフェースには、次のインターフェースがあります。
• ICommandLauncher はサーバーのプロセステーブルを扱います
• IServerDocument は Altium Designer にロードされた設計ドキュメントを表します
• IServerView は Altium Designer システムのビューを持てるパネルを表します
• IServerDocumentView はドキュメントビュー(ドキュメントウィンドウまたはパネルウィンドウのいずれか)を扱います
• IExternalForm は、ドキュメントフォームまたはパネルフォームとして動作する、Altium Designer 対応の Delphi フォームを表します。これらのフォームは IServerDocumentView または IServerView インターフェースオブジェクトによってラップされます。この IExternalForm インターフェースオブジェクトには、フォームのサイズ変更や表示などの低レベルメソッドがあり、IServerDocumentView および IServerView インターフェースの祖先インターフェースです。
• IProcessControl は、このフォーカスされているサーバードキュメントに対する積み重なったプロセスのレベルを表します
• INotification は Client システムからのシステム通知を受け取り、すべてのサーバーモジュールがこれらの通知を受信します。通知を処理して、そこから対応を続けることができます。通知を利用して、ドキュメントと関連パネルを同期させることもできます。
PCB サーバーモジュールには、独自の IPCB_ServerInterface インターフェースもあります。
Schematic Server モジュールにも、独自の ISCH_ServerInterface インターフェースがあります。
ただし、両方のサーバーはこの IServerModule インターフェースも備えています。
|
|
IPCB_ServerInterface インターフェース
ISCH_ServerInterface インターフェース
IServerModule GetState および SetState メソッド
GetClient メソッド
(IServerModule インターフェース)
Function GetClient : IClient;
GetClient メソッドは、Altium Designer のクライアントサブシステムの IClient インターフェースを返します。この IClient インターフェースを使用して、そのメソッドを呼び出すことができます。
GetClient メソッドは Client プロパティで使用されます。
IServerModule インターフェース
GetCommandLauncher メソッド
(IServerModule インターフェース)
Function GetCommandLauncher : ICommandLauncher;
CommandLauncher 関数は ICommandLauncher インターフェースを返します。これは、サーバーモジュールからプロセスを起動するために使用されます。CommandLauncher オブジェクトにはコマンドテーブルが含まれており、実行時にプロセス名をそのプロセスを実装する実際の関数に関連付けます。
サーバー内でプロセスが呼び出されるたびに、このテーブルが参照され、実際の関数ポインターが検索されます。プロセス名がこのテーブル内に見つからない場合は、何も実行されません。
この CommandLauncher オブジェクトは、サーバープロジェクトの main.pas ユニットで初期化されます。詳細は ICommandLauncher インターフェースを参照してください。
このメソッドは CommandLauncher プロパティで使用されます。
IServerModule インターフェース
GetDocumentCount メソッド
(IServerModule インターフェース)
Function GetDocumentCount : Integer;
DocumentCount メソッドは、Document Kind の数を返します。重要な点として、View が実際の設計ドキュメントです。Document type は、特定の View を格納するコンテナです。
このメソッドは DocumentCount プロパティで使用されます。
IServerModule インターフェース
GetDocuments メソッド
(IServerModule インターフェース)
Function GetDocuments (Index : Integer) : IServerDocument;
エディタータイプのサーバーは、Schematic Editor や PCB Editor のように異なるドキュメントタイプを持つことができます。これらのエディターサーバーには、それぞれ 2 つのドキュメントタイプ、つまり SCH/SCHLIB および PCB/PCBLIB があります。
アドオンタイプのサーバーは通常ドキュメントコンテナを持ちません。これは、エディターサーバーに付随する形で動作し、エディターサーバーの API サービスを利用するためです。
このメソッドは、IServerDocument インターフェースで表される、インデックス指定されたドキュメントコンテナを返します。
このメソッドは Documents プロパティで使用されます。
IServerModule インターフェース
IServerDocument インターフェース
GetHandle メソッド
(IServerModule インターフェース)
Function GetHandle : THandle;
このメソッドはサーバーのハンドルを返します。
このメソッドは Handle プロパティで使用されます。
IServerModule インターフェース
GetModuleName メソッド
(IServerModule インターフェース)
Function GetModuleName : Widestring;
このメソッドは、このサーバーのモジュール名を返します。
たとえば、texteditor サーバーのモジュール名は TextEdit です。このサーバー名プロパティは、関連するサーバーインストールファイル(拡張子 INS のファイル)で定義されます。
このメソッドは ModuleName プロパティで使用されます。
IServerModule インターフェース
GetProcessControl メソッド
(IServerModule インターフェース)
Function GetProcessControl : IProcessControl;
このメソッドは IProcessControl インターフェースを返します。このインターフェースは、Altium Designer 内の各設計ドキュメントに対するプロセス深度を制御します。
ドキュメント上でプロセスが起動されるたびに、プロセス深度は 1 増加し、同じプロセスの実行が完了すると 1 減少します。プロセス深度がゼロの場合、現在の設計ドキュメント上では何も実行されていないことを示します。
この読み取り専用プロパティは、GetProcessControl メソッドによってサポートされます。
IServerModule インターフェース
GetViewCount メソッド
(IServerModule インターフェース)
Function GetViewCount : Integer;
ViewCount メソッドは、指定されたサーバーのビュー数を返します。
View オブジェクトは、通常その関連サーバーによってサポートされるグローバルパネルとして、Altium Designer 内のフォーム / ウィンドウオブジェクトをカプセル化します。
このメソッドは ViewCount プロパティで使用されます。
IServerModule インターフェース
GetViewsIServerModule のメソッド
AddServerView メソッド
(IServerModule インターフェース)
Procedure AddServerView (Const AView : IServerView);
このプロシージャは、Server Module にパネルを追加し、この新しいパネルをモジュールで使用できるようにします。
CreateServerView 関数で IServerView オブジェクトを作成した後にこの関数を呼び出すか、IServerView インターフェースのパラメーターを渡してください。
IServerModule インターフェース
IServerView インターフェース
ApplicationIdle メソッド
(IServerModule インターフェース)
Procedure ApplicationIdle;
ApplicationIdle プロシージャは、Altium Designer がアイドル状態のときに呼び出される内部プロシージャです。アクティブに動作しているすべてのサーバーの ApplicationIdle プロシージャが呼び出されます。Altium Designer によって送信されたメッセージは、追跡処理される機会を得ます。
IServerModule インターフェース
CreateDocument メソッド
(IServerModule インターフェース)
Function CreateDocument (Const AKind, AFileName : Widestring) : IServerDocument;
CreateDocument 関数は、AKind および AFileName パラメーターに基づいて、サーバーがサポートするドキュメントを作成します。
AKind パラメーターはサーバーがサポートするドキュメント種別を表し、AFileName パラメーターは新しいドキュメントに割り当てられます。
IServerModule インターフェース
CreateServerDocView メソッド
(IServerModule インターフェース)
Function CreateServerDocView (Const AName : Widestring; Const ADocument : IServerDocument): IServerDocumentView;
CreateServerDocView 関数は、ドキュメントビューの名前と IServerDocument コンテナーに基づいて、IServerDocumentView(ドキュメント本体、またはそれに関連付けられたパネルビュー)オブジェクトを作成します。
IServerModule インターフェース
CreateServerView メソッド
(IServerModule インターフェース)
Function CreateServerView (Const AName : Widestring) : IServerView;
CreateServerView 関数は、システムパネルを表す IServerView オブジェクトを作成します。このオブジェクトを Altium Designer 内に追加するには、AddServerView プロシージャを呼び出す必要があります。
IServerModule インターフェース
CreateOptionsView メソッド
(IServerModule インターフェース)
Function CreateOptionsView (Const AName : Widestring) : IDocumentOptionsView;
CreateOptionsView は、Altium Designer のシステム全体の Preferences ダイアログで使用する IDocumentOptions ビューを作成します。
IServerModule インターフェース
DestroyDocument メソッド
(IServerModule インターフェース)
Procedure DestroyDocument (Const ADocument : IServerDocument);
DestroyDocument プロシージャは、ADocument パラメーターで指定された設計ドキュメントを閉じて削除します。
IServerModule インターフェース
ReceiveNotification メソッド
(IServerModule インターフェース)
Procedure ReceiveNotification (Const ANotification : INotification);
サーバーモジュールの ReceiveNotification プロシージャは、Altium Designer によってブロードキャストされる通知をインターセプトします。
システムには BroadCastNotification または DispatchNotification 関数があり、Altium Designer 内で動作しているすべてのサーバーがそれを受信し、適宜処理できます。
このプロシージャはオーバーライドして実装する必要があります。
IServerModule インターフェース
RemoveServerView メソッド
(IServerModule インターフェース)
Procedure RemoveServerView (Const AView : IServerView);
RemoveServerView プロシージャは、システムパネルを表す Altium Designer 内の IServerView オブジェクトを削除します。
IServerModule インターフェース
CreateDocumentShowOrHide メソッド
(IServerModule インターフェース)
Function CreateDocumentShowOrHide(Const AKind, AFileName : Widestring;
AShowInTree : Boolean) : IServerDocument;
CreateDocumentShowOrHide 関数は、作成されたドキュメントが Altium Designer でどのように表示されるかを制御します。
IServerModule インターフェース
プロパティ
Client プロパティ
(IServerModule インターフェース)
Property Client : IClient Read GetClient;
Client プロパティは、Altium Designer のクライアントサブシステムの IClient インターフェースを返します。この IClient インターフェースを使用して、そのメソッドを呼び出せます。
この読み取り専用プロパティは GetClient メソッドでサポートされます。
IServerModule インターフェース
CommandLauncher プロパティ
(IServerModule インターフェース)
Property CommandLauncher : ICommandLauncher Read GetCommandLauncher;
CommandLauncher プロパティは、ICommandLauncher インターフェースへのポインターを返します。これは、サーバーモジュールからプロセスを起動するために使用されます。CommandLauncher オブジェクトにはコマンドテーブルが含まれており、プロセス名を、実行時にそのプロセスを実装する実際の関数に関連付けます。
サーバー内でプロセスが呼び出されるたびに、このテーブルが参照され、実際の関数ポインターが検索されます。プロセス名がこのテーブル内に見つからない場合は、何も実行されません。
この CommandLauncher オブジェクトは、サーバープロジェクトの main.pas ユニットで初期化されます。詳細は ICommandLauncher インターフェースを参照してください。
この読み取り専用プロパティは GetCommandLauncher メソッドでサポートされます。
IServerModule インターフェース
DocumentCount プロパティ
(IServerModule インターフェース)
Property DocumentCount : Integer Read GetDocumentCount;
DocumentCount プロパティは、Document Kind の数を返します。重要な点として、View は実際の設計ドキュメントです。Document タイプは、特定の View を格納するコンテナーです。
このプロパティは GetDocumentCount メソッドでサポートされます。
IServerModule インターフェース
Documents プロパティ
(IDocuments インターフェース)
Property Documents Integer : IServerDocument Read GetDocuments;
エディタータイプのサーバーは、Schematic Editor や PCB Editor など、異なるドキュメントタイプを持つことができます。これらのエディターサーバーには、それぞれ 2 つのドキュメントタイプ、すなわち SCH/SCHLIB および PCB/PCBLIB があります。
アドオンタイプのサーバーは通常、ドキュメントコンテナーを持ちません。これは、エディターサーバーに付随して動作し、そのエディターサーバーの API サービスを利用するためです。
このプロパティは、IServerDocument インターフェースで表されるインデックス付きドキュメントコンテナーを返します。
この読み取り専用プロパティは GetDocuments メソッドでサポートされます。
IClient インターフェース
IServerModule インターフェース
DocumentCount プロパティ
Handle プロパティ
(IServerModule インターフェース)
Property Handle : THandle Read GetHandle;
Handle プロパティはサーバーのハンドルを返します。この読み取り専用プロパティは GetHandle メソッドでサポートされます。
IServerModule インターフェース
ModuleName プロパティ
(IServerModule インターフェース)
Property ModuleName : Widestring Read GetModuleName;
ModuleName プロパティは、このサーバーのモジュール名を返します。
たとえば、Texteditor サーバーのモジュール名は TextEdit です。このサーバー名プロパティは、関連するサーバーインストールファイル(拡張子 INS のファイル)で定義されます。
この読み取り専用プロパティは GetModuleName メソッドでサポートされます。
If StringsEqual(ServerModule.ModuleName,'TextEdit') Then Begin ... End;
IServerModule インターフェース
ProcessControl プロパティ
(IServerModule インターフェース)
Property ProcessControl : IProcessControl Read GetProcessControl;
ProcessControl プロパティは、IProcessControl インターフェースへのポインターを返します。このインターフェースは、Altium Designer の各設計ドキュメントに対するプロセス深度を制御します。
ドキュメント上でプロセスが起動されるたびに、プロセス深度は 1 増加し、その同じプロセスの実行が終了すると 1 減少します。プロセス深度がゼロのとき、現在の設計ドキュメント上では何も行われていないことを示します。
この読み取り専用プロパティは GetProcessControl メソッドでサポートされます。
IServerModule インターフェース
ViewCount プロパティ
(IServerModule インターフェース)
Property ViewCount : Integer Read GetViewCount;
ViewCount プロパティは、指定されたサーバーのビュー数を返します。
View オブジェクトは、通常は関連サーバーがサポートするグローバルパネルとして、Altium Designer 内のフォーム/ウィンドウオブジェクトをカプセル化します。
この読み取り専用プロパティは GetViewCount メソッドでサポートされます。
IServerModule インターフェース
Views プロパティ
(IServerModule インターフェース)
Property Views Integer : IServerView Read GetViews;
Views プロパティは ViewCount プロパティと組み合わせることで、インデックス付き View オブジェクトを返します。View は、関連サーバーがサポートするフォームです。
この読み取り専用プロパティは GetViews メソッドでサポートされます。
IClient インターフェース
IServerModule インターフェース
ドキュメントおよびパネルビューのインターフェース
IExternalForm インターフェース
IExternalForm インターフェースは、Delphi フォームをドキュメントフォームまたはパネルフォームとして表します。この IExternalForm インターフェースオブジェクトには、フォームのサイズ変更や表示などの低レベルメソッドがあります。
Altium Designer プラットフォームは Borland(TM) のオブジェクトインターフェース技術に基づいています。そのため、TForm、TFrame、およびその他の VCL コントロールのオブジェクトインターフェースは、異なるプログラミングシステムでのサードパーティ開発向けに公開できるオブジェクトインターフェースには渡されません。たとえば、VCL 技術は MS C++ ツールキットと互換性がありません。
したがって、Altium Designer プラットフォームでウィンドウを扱うには、IExternalForm インターフェースを使用してウィンドウにアクセスし、それらを操作します。IExternalFormHolder インターフェースおよび TExternalFormComponent クラスは、Altium Designer プラットフォームにプラグインされたサーバー内の Delphi ウィンドウを扱い、さらにプラグインされた他のサーバーからアクセス可能にするために使用されます。
|
|
IServerView インターフェース
IServerDocumentView インターフェース
IExternalFormHolder インターフェース
ExternalForm ユニットの TExternalFormComponent クラス
ExternalForm ユニットの TServerExternalFormComponent クラス。
IExternalForm のメソッド
FocusFirstTabStop メソッド
(IExternalForm インターフェース)
Procedure FocusFirstTabStop;
IClient インターフェース
IExternalForm インターフェース
GetBounds メソッド
(IExternalForm インターフェース)
Procedure GetBounds (Var ALeft, ATop, AWidth, AHeight : Integer);
このプロシージャは、フォームの 4 つの境界値(left、top、width、height)を取得します。
IClient インターフェース
IExternalForm インターフェース
Hide メソッド
(IExternalForm インターフェース)
Procedure Hide;
この Hide メソッドは、Altium Designer の表示からフォームを隠します。
IClient インターフェース
IExternalForm インターフェース
ParentWindowCreated メソッド
(IExternalForm インターフェース)
Procedure ParentWindowCreated;
IClient インターフェース
IExternalForm インターフェース
ParentWindowDestroyed メソッド
(IExternalForm インターフェース)
Procedure ParentWindowDestroyed;
IClient インターフェース
IExternalForm インターフェース
SetBounds メソッド
(IExternalForm インターフェース)
Procedure SetBounds (ALeft(IExternalForm インターフェース)
Procedure Show;
このプロシージャは、非表示のフォームを表示します。
IClient インターフェース
IExternalForm インターフェース
IExternalForm のプロパティ
Caption プロパティ
(IExternalForm インターフェース)
Property Caption : Widestring
この読み取り専用プロパティは、このダイアログに関連付けられた外部フォームのキャプションを返します。
IClient インターフェース
IExternalForm インターフェース
Handle プロパティ
(IExternalForm インターフェース)
Property Handle : HWND
この読み取り専用プロパティは、Delphi ベースのフォームのハンドルを返します。
IClient インターフェース
IExternalForm インターフェース
IExternalFormHolder インターフェース
IExternalFormHolder インターフェースは TExternalFormComponent オブジェクトを表し、IExternalForm インターフェースを保持します。
DXP プラットフォームは Borland(TM) のオブジェクトインターフェース技術に基づいています。そのため、TForm、TFrame、およびその他の VCL コントロールのオブジェクトインターフェースは、異なるプログラミングシステムでのサードパーティ開発向けに公開できるオブジェクトインターフェースへは受け渡されません。たとえば、VCL 技術は MS C++ toolkit と互換性がありません。
したがって、Altium Designer プラットフォームでウィンドウを扱うには、IExternalForm インターフェースを使用してウィンドウへアクセスし、それらを操作します。IExternalFormHolder インターフェースと TExternalFormComponent クラスは、Altium Designer プラットフォームにプラグインされたサーバー内で Delphi ウィンドウを操作するために使用されます。
|
|
IExternalForm インターフェース
ExternalForm ユニット内の TExternalFormComponent クラス。
IExternalFormHolder のメソッド
GetParentWindow メソッド
(IExternalFormHolder インターフェース)
Function GetParentWindow : THandle;
この関数は、IExternalForm インターフェースで使用できる親ウィンドウの THandle を取得します。
IExternalFormHolder インターフェース
SetDialogHandle メソッド
(IExternalFormHolder インターフェース)
Procedure SetDialogHandle (AHandle : THandle);
このプロシージャは、この外部フォームのダイアログハンドルを設定します。
IExternalFormHolder インターフェース
IHTMLViewExternalForm インターフェース
The
|
|
ISceneView インターフェース
ISceneView インターフェースは特定のビューを表します。
|
|
INavigationDocument インターフェース
INavigationDocument インターフェースは特定のナビゲーションビューを表します。
|
|
IExternalForm インターフェース
IServerView インターフェース
IServerView インターフェースは、ドキュメントまたはパネルビューのオブジェクトインターフェースの祖先インターフェースです。
この IServerView インターフェースは、Altium Designer 内のグローバルパネルも表します。たとえば、Messages パネルや ToDo パネルなどです。
IServerView インターフェースの階層は次のとおりです。
IExternalForm
IServerView インターフェース
|
|
IExternalForm インターフェース
IServerDocumentView インターフェース
IServerDocument インターフェース
IServerView の GetState および SetState メソッド
GetIsPanel メソッド
(IServerView インターフェース)
Function GetIsPanel : LongBool;
IsPanel プロパティは、IServerDocumentView オブジェクトがパネルかどうかを判定します。IServerDocument コンテナは IServerDocumentView オブジェクトを格納し、それらはパネルビューまたはドキュメントビューのいずれかです。
このプロパティは GetIsPanel メソッドによってサポートされます。
Var
ServerDocumentView : IServerDocumentView;
Begin
ServerDocumentView := ServerDocument.View;
If Not(ServerDocumentView.IsPanel) Then
ShowMessage('Document Name ' + ServerDocument.FileName);
End;
IClient インターフェース
IExternalForm インターフェース
GetViewName メソッド
(IServerView インターフェース)
Function GetViewName : Widestring;
ViewName プロパティはビュー名を表し、ドキュメントのファイル名とは異なります。ビューは、Altium Designer 全体で表示されるグローバルパネル、ドキュメントビュー、またはパネルビューのいずれかです。
この読み取り専用プロパティは GetViewName メソッドによってサポートされます。
たとえば、Altium Designer で開いているライブラリドキュメントでは、次の情報が得られます。
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm
If StrPas(Client.CurrentView.GetViewName) <> UpperCase('PCBLib') Then Exit;
このコードスニペットは、Client.CurrentView.ViewName メソッドを使用して現在のドキュメントのタイプ名を調べます。
IClient インターフェース
IServerView インターフェース
IExternalForm インターフェース
IServerView のメソッド
GetViewState メソッド
(IServerView インターフェース)
Function GetViewState : Widestring;
IClient インターフェース
IServerView インターフェース
SetViewState メソッド
ReceiveNotification メソッド
(IServerView インターフェース)
Procedure ReceiveNotification (Const ANotification : INotification);
ReceiveNotification プロシージャは、Altium Designer によって生成された通知を取得します。グローバルパネル、ドキュメントビュー、またはパネルビューは、通知をインターセプトして、それに応じた処理を行うことができます。
IClient インターフェース
IServerView インターフェース
INotification インターフェース
SetViewState メソッド
(IServerView インターフェース)
Procedure SetViewState(Const Astate : Widestring);
IClient インターフェース
IExternalForm インターフェース
GetViewState メソッド
IServerView のプロパティ
IsPanel プロパティ
(IServerView インターフェース)
Property IsPanel : LongBool Read GetIsPanel;
IsPanel プロパティは、そのビューがパネルかドキュメントビューかを示すブール値を返します。
1 つのドキュメントは、1 つのドキュメントビューと少なくとも 1 つのパネルビューで構成されます。また、グローバルパネルビューである Message パネルのようなグローバルビューやシステムビューが存在する場合もあります。
この読み取り専用プロパティは GetIsPanel メソッドによってサポートされます。
Var ServerDocumentView : IServerDocumentView; Begin ServerDocumentView := ServerDocument.View[j]; If Not(ServerDocumentView.IsPanel) Then ShowMessage('Document Name ' + ServerDocument.FileName); End;
IServerView インターフェース
ViewName プロパティ
(IServerView インターフェース)
Property ViewName : Widestring Read GetViewName;
ViewName プロパティはビュー名を表し、ドキュメントのファイル名とは異なります。ビューは、Altium Designer 全体で表示されるグローバルパネル、ドキュメントビュー、またはパネルビューのいずれかです。
この読み取り専用プロパティは GetViewName メソッドによってサポートされます。
たとえば、Altium Designer で開いているライブラリドキュメントでは、次の情報が得られます。
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm
If StrPas(Client.CurrentView.ViewName) <> UpperCase('PCBLib') Then Exit;
このコードスニペットは、Client.CurrentView.ViewName メソッドを使用して現在のドキュメントの種類を調べます。
IClient インターフェース
IServerView インターフェース
IServerDocumentView インターフェース
IServerDocumentView は、Altium Designer におけるドキュメントビュー、または関連付けられたパネルビューのいずれかを表します。このインターフェースは IServerView インターフェースから継承されています。
IServerDocument インターフェースは IServerDocumentView インターフェースを含みます。つまり、Altium Designer で開いている設計ドキュメントには、ドキュメントビューと少なくとも 1 つのパネルビューへのリンクが含まれています。
階層は次のとおりです。
IExternalForm
IServerView インターフェース
IServerDocumentView インターフェース
|
|
|
|
|
|
IClient インターフェース
IServerModule インターフェース
IServerDocument インターフェース
IServerView インターフェース
IExternalForm インターフェース
IServerDocumentView の GetState および SetState メソッド
GetOwnerDocument メソッド
(IServerDocumentView インターフェース)
Function GetOwnerDocument : IServerDocument;
OwnerDocument プロパティは、この IServerDocumentView interface に関連付けられた IServerDocument インターフェースを返します。IServerDocument コンテナは、ドキュメントビューまたはパネルビューを表す IServerDocumentView インターフェースを格納します。
この読み取り専用プロパティは GetOwnerDocument メソッドによってサポートされます。
IClient インターフェース
IServerDocumentView インターフェース
IServerDocumentView のメソッド
PerformAutoZoom メソッド
(IServerDocumentView インターフェース)
Procedure PerformAutoZoom;
このプロシージャは、ドキュメントビュー / パネルビューの更新または再描画を強制します。
IClient インターフェース
IServerDocumentView インターフェース
UpdateStatusBar メソッド
(IServerDocumentView インターフェース)
Procedure UpdateStatusBar;
このプロシージャは、ステータスバーに文字列が送信されたときに、ステータスバーの更新を強制します。
IClient インターフェース
IServerDocumentView インターフェース
IServerDocumentView のプロパティ
OwnerDocument プロパティ
(IServerDocumentView インターフェース)
Property OwnerDocument : IServerDocument Read GetOwnerDocument;
このプロパティは、この IServerDocumentView インターフェースに関連付けられた IServerDocument インターフェースを返します。IServerDocument コンテナは、ドキュメントビューまたはパネルビューを表す IServerDocumentView インターフェースを格納します。
この読み取り専用プロパティは GetOwnerDocument メソッドによってサポートされます。
IClient インターフェース
IExternalForm インターフェース
IServerDocument インターフェース
IServerDocument インターフェースは、ドキュメントコンテナを表します。各 IServerDocument インターフェースは、同種のビューで構成
AddView
SetModified
SetIsShown
SetBeingClosed
Focus
DoFileLoad
DoFileSave
SupportsReload
GetCanClose
GetCount
GetFileName
SetFileName
GetKind
GetModified
GetIsShown
GetBeingClosed
GetFileModifiedDate
UpdateModifiedDate
GetServerModule
GetView
GetViewByName
NotifyViews
GetSupportsOwnSave
GetContextHelpTopicName
SetFileModifiedDate
WarnIfOwnedByOther
AcquireFileOwnership
ReleaseFileOwnership
ReleaseDataFileHandle
AcquireDataFileHandle
OwnsFile
DoSafeFileSave
DoSafeChangeFileNameAndSave
CreateSnippetFile
ZoomSnippetContents
GetSnippetView
PlaceSnippet
CanPlaceSnippet
CanCreateSnippet
CanClose
Count
FileName
Kind
Modified
IsShown
BeingClosed
ServerModule
View
SupportsOwnSave
Procedure OpenAndShowADocument(Filename : TDynamicString); Var ReportDocument : IServerDocument; Begin If Client = Nil Then Exit; ReportDocument := Client.OpenDocument('Text',FileName); If ReportDocument <> Nil Then Client.ShowDocument(ReportDocument); End;
IClient インターフェース
IServerDocumentView インターフェース
IServerView インターフェース
\Developer Kit\Examples\DXP\ClientServer Interfaces\ フォルダー内の CS サーバーのサンプル。
IServerDocument メソッド
AddView メソッド
(IServerDocument インターフェース)
Procedure AddView (Const AView : IServerDocumentView);
このプロシージャは、サーバードキュメント内に IServerDocumentView オブジェクトを追加します。IServerDocument オブジェクトは、ドキュメントビューおよびパネルビューのビューを含むコンテナーです。
IServerDocument インターフェース
IServerDocumentView インターフェース
DoFileLoad メソッド
(IServerDocument インターフェース)
Function DoFileLoad : LongBool;
この関数は、ドキュメントの再読み込みを可能にします。ドキュメントが変更されて保存された後、ドキュメントが最新の状態であることを保証するために再読み込みが必要な場合に有用です。
IServerDocument インターフェース
DoFileSave メソッド
(IServerDocument インターフェース)
Function DoFileSave (Const AKind : Widestring) : LongBool;
この関数は、特定のドキュメントエディターが既定形式以外の別形式での保存オプションを提供している場合に、ドキュメントを別の形式で保存するためのオプションを提供します。通常、これらのファイル形式は、サーバーのインストールファイル(拡張子 INS)内の EditorWindowKind セクションにある SaveFilters ブロックに保存されています。
たとえば、Altium Designer の PCB ドキュメントでは、PCB ASCII 形式、PCB Binary 3 形式などで保存できます。具体的には PCB Binary、PCB 3.0 Binary、PCB 4.0 Binary、PCB ASCII があり、既定では PCB Binary 5.0 です。
Schematic ドキュメントでは、Advanced Schematic binary、Advanced Schematic ascii、Schematic binary 4.0、Orcad SDT Schematic、Advanced Schematic template として保存できます。
エディターでサポートされるファイル形式は、サーバーのインストールファイル内の
Var Board : IPCB_Document; AView : IServerDocumentView; AServerDocument : IServerDocument; Begin // save the file in a different PCB format //check if current document is a PCB document otherwise exit! Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; If Client = Nil Then Exit; // Grab the current document view using the Client's Interface. AView := Client.GetCurrentView; AServerDocument := AView.OwnerDocument; AServerDocument.DoFileSave('PCB ASCII'); Close; End;
IServerDocument インターフェース
IServerDocument インターフェース
GetCanClose メソッド
GetModified メソッド
GetFileName メソッド
Focus メソッド
(IServerDocument インターフェース)
Procedure Focus;
このプロシージャは、ドキュメントを Altium Designer でフォーカスされたドキュメントに強制的に設定します。フォーカスされたドキュメントとは、Altium Designer のワークスペース内で最上位にあり、表示されていて、コマンドなどに応答するドキュメントです。
IServerDocument インターフェース
GetBeingClosed メソッド
(IServerDocument インターフェース)
Function GetBeingClosed : LongBool;
この関数は、サーバードキュメントが閉じられつつあるかどうかを判定します。ドキュメントを閉じられるかどうかの確認には GetCanClose 関数を使用してください。
IServerDocument インターフェース
GetCanClose メソッド
GetModified メソッド
GetFileName メソッド
DoFileSave メソッド
GetCanClose メソッド
(IServerDocument インターフェース)
Function GetCanClose : LongBool;
この関数は、ドキュメントを閉じられるかどうかを確認します。このメソッドは CanClose プロパティに使用されます。
IServerDocument インターフェース
GetModified メソッド
GetFileName メソッド
DoFileSave メソッド
GetContextHelpTopicName メソッド
(IServerDocument インターフェース)
Function GetContextHelpTopicName : Widestring;
GetContextHelpTopicName 関数は、ドキュメントのヘルプトピック名を取得します。通常、返される文字列は ServerModuleName.DocumentKind 形式で、たとえば 'SCH.SCH' のようになります。サーバーによっては、より詳細な情報を提供するものもあります。たとえば Schematic Editor サーバーは、回路図シート上でマウスが Port オブジェクトの上にある場合に Sch.Sheet.Port を返します。
サードパーティ開発者は、この関数を使用してコンテキスト依存ヘルプを提供できます。
サーバー用のヘルプを実装するには、Help フォルダー内に .HELPID ファイルを用意し、GetContextHelpTopicName が返す文字列と実際のヘルプドキュメントとの対応付けを定義する必要があります。
たとえば、CXTSystemDesignCapture.HelpID には Sch.Sheet.Port = CXTSystemDesignCapture.chm,Document_Objects\Port.htm が含まれます。これは、F1 キーが押されて Sch.Sheet.Port 文字列が返されたときに、CXTSystemDesignCapture.chm ファイル名が使用され、Document_Objects\Port.htm トピックが表示されることを意味します。
IServerDocument インターフェース
GetCount メソッド
(IServerDocument インターフェース)
Function GetCount : Integer;
Count プロパティは、IServerDocument コンテナー内のビュー(同じ型)の数を返します。View プロパティと組み合わせて使用してください。
このメソッドは Count プロパティに使用されます。
Var ServerModule : IServerModule; ServerDocument : IServerDocument; ServerDocumentView : IServerDocumentView; Begin ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; For I := 0 to ServerModule.DocumentCount - 1 Do Begin ServerDocument := ServerModule.Documents[I]; ShowMessage('Document View Count ' + IntToStr(ServerDocument.Count) + #13 + 'Kind ' + ServerDocument.Kind)); End; End;
IServerDocument インターフェース
GetFileModifiedDate メソッド
(IServerDocument インターフェース)
Function GetFileModifiedDate: TDateTime;
この関数は、変更されたファイルの日付と時刻を返します。
IServerDocument インターフェース
GetFileModifiedDate メソッド
SetFileModifiedDate メソッド
Borland Delphi Run Time Library の TDateTime 型。
GetFileName メソッド
(IServerDocument インターフェース)
Function GetFileName : Widestring;
この関数は、サーバードキュメントのファイル名を文字列として取得します。サーバードキュメントはドキュメントビューまたはパネルビューのいずれかであり、パネルビューである場合は GetFileName メソッドは無効である点に注意してください。
ServerDocumentView := ServerDocument.View[j]; If Not(ServerDocumentView.IsPanel) Then ShowMessage(' Document Name ' + ServerDocument.FileName);
IServerDocument インターフェース
GetIsShown メソッド
(IServerDocument インターフェース)
Function GetIsShown : LongBool;
IsShown プロパティは、このドキュメントが Altium Designer に表示されているかどうかを示します。このプロパティは GetIsShown および SetIsShown メソッドでサポートされます。
IServerDocument インターフェース
GetKind メソッド
(IServerDocument インターフェース)
Function GetKind : Widestring;
この関数は、このドキュメントの Kind 文字列を返し、Kind プロパティに使用されます。例としては 'PCB'、'PCBLIB'、'SCH'、'SCHLIB' などがあります。
ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; For I := 0 to ServerModule.DocumentCount - 1 Do Begin ServerDocument := ServerModule.Documents[I]; ShowMessage('Document View Count ' + IntToStr(ServerDocument.Count) + #13 + 'Kind ' + ServerDocument.GetKind)); End;
IServerDocument インターフェース
GetModified メソッド
(IServerDocument インターフェース)
Function GetModified : LongBool;
Modified プロパティは、このドキュメントが変更されているかどうかを示し、「dirty」フラグ、すなわちドキュメントが変更されて変更済みとしてマークされている状態と見なすことができます。
このプロパティは GetModified および SetModified メソッドでサポートされます。
Var AView : IServerDocumentView; AServerDocument : IServerDocument; Begin If Client = Nil Then Exit; // Grab the current document view using the Client's Interface. AView := Client.GetCurrentView; // Grab the server document which stores views by extracting the ownerdocument field. AServerDocument := AView.OwnerDocument; // Set the document dirty. AServerDocument.Modified := True; End;
IServerDocument インターフェース
GetServerModule メソッド
(IServerDocument インターフェース)
Function GetServerModule : IServerModule;
ServerModule は読み取り専用プロパティで、このドキュメントに関連付けられた IServerModule インターフェースを返します。サーバーモジュールは、Altium Designer にインストールされ実行されているサーバーオブジェクトを表します。
サーバーモジュールは、自身のドキュメントとパネルを管理します。このプロパティは GetServerModule メソッドでサポートされます。
//IServerModule interface ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; ShowMessage(IntToStr(ServerModule.DocumentCount)); For I := 0 to ServerModule.DocumentCount - 1 Do Begin //IServerDocument interface ServerDocument := ServerModule.Documents[I]; // do what you want with server documents End;
IServerDocument インターフェース
IServerModule インターフェース
GetSupportsOwnSave メソッド
(IServerDocument インターフェース)
Function GetSupportsOwnSave : LongBool;
SupportsOwnSave プロパティは、サーバーに関連付けられたこれらのドキュメントを保存するための保存ルーチンが提供されているかどうかを示すブール値を返します。これは読み取り専用プロパティであり、GetSupportsOwnSave メソッドでサポートされます。
IServerDocument インターフェース
GetView メソッド
(IServerDocument インターフェース)
Function GetView (Index : Integer) : IServerDocumentView;
View プロパティはインデックス付きプロパティで、ドキュメントビューまたはパネルビューを表します。IServerDocument.Count メソッドは、IServerDocument コンテナーの一部としてビュー(ドキュメントウィンドウまたはパネルウィンドウ)の一覧を返します。
このプロパティは GetView メソッドでサポートされます。
For J := 0 to ServerDocument.Count - 1 Do Begin ServerDocumentView := ServerDocument.View[j]; ShowMessage('View Name ' + ServerDocumentView.ViewName); If Not(ServerDocumentView.IsPanel) Then ShowMessage(' Document Name ' + ServerDocument.FileName); End;
IServerDocument インターフェース
GetViewByName メソッド
(IServerDocument インターフェース)
Function GetViewByName (Const ViewName : Widestring) : IServerDocumentView;
GetViewByName 関数は、ドキュメントビューまたはパネルビューを表す View オブジェクトを返します。
ServerDocumentView := ServerDocument.GetViewByName(PCBExpressionFilter); If ServerDocumentView.IsPanel Then ShowMessage('This Server Document View is a Panel');
IServerDocument インターフェース
IServerDocumentView インターフェース
SetBeingClosed メソッド
(IServerDocument インターフェース)
Procedure SetBeingClosed (Const Value : LongBool);
BeingClosed プロパティは、この設計ドキュメントが正常に破棄される前に閉じられつつあることを示します。このプロパティは読み取り専用プロパティです。ドキュメントが閉じられる前にドキュメントを変更または更新しようとする場合は、その前にドキュメントの状態を確認できます。
このプロパティは GetBeingClosed および SetBeingClosed メソッドでサポートされます。
IServerDocument インターフェース
SetFileModifiedDate メソッド
(IServerDocument インターフェース)
Procedure SetFileModifiedDate(Const AValue : TDateTime);
このプロシージャは、ドキュメントが外部要因によって変更された場合に、そのドキュメントの更新日時を設定します。
IServerDocument インターフェース
GetModified メソッド
SetModified メソッド
(IServerDocument インターフェース)
Function SetFileName (Const AFileName : Widestring): Widestring;
SetFileName 関数は、ドキュメントのファイル名を設定します。
IServerDocument インターフェース
SetIsShown メソッド
(IServerDocument インターフェース)
Procedure SetIsShown (Const Value : LongBool);
IsShown プロパティは、このドキュメントが Altium Designer に表示されているかどうかを示します。このプロパティは GetIsShown および SetIsShown メソッドでサポートされます(IServerDocument interface)
Procedure SetModified (Const Value : LongBool);
Modified プロパティは、このドキュメントが変更されているかどうかを示し、いわゆる "dirty" フラグとして扱えます。つまり、ドキュメントが変更され、dirty としてマークされていることを示します。
このプロパティは、GetModified メソッドおよび SetModified メソッドによってサポートされます。
Var AView : IServerDocumentView; AServerDocument : IServerDocument; Begin If Client = Nil Then Exit; // Grab the current document view using the Client's Interface. AView := Client.GetCurrentView; // Grab the server document which stores views by extracting the ownerdocument field. AServerDocument := AView.OwnerDocument; // Set the document dirty. AServerDocument.Modified := True; End;
IServerDocument interface
NotifyViews method
(IServerDocument interface)
Procedure NotifyViews (ANotification : INotification);
このプロシージャは、
IServerDocument interface
INotification interface
SupportsReload method
(IServerDocument interface)
Function SupportsReload : LongBool;
このメソッドは、Altium Designer 内のドキュメントを再読み込みできるかどうかを判定します(更新し、ドキュメントの状態が最新であることを確認するため)。
IServerDocument interface
DoFileLoad method
UpdateModifiedDate method
(IServerDocument interface)
Procedure UpdateModifiedDate;
このプロシージャは、このドキュメントが変更された後に、変更済みドキュメントの日付を更新します。
IServerDocument interface
GetModified method
SetModified method
ReleaseFileOwnership method
(IServerDocument interface)
Procedure ReleaseFileOwnership;
内部使用専用です。
IServerDocument interface
ReleaseDataFileHandle method
(IServerDocument interface)
Procedure ReleaseDataFileHandle;
内部使用専用です。
IServerDocument interface
OwnsFile method
(IServerDocument interface)
Function OwnsFile : Boolean;
OwnsFile 関数は、そのドキュメントが Altium Designer 製品によって所有されているかどうかを判定し、その結果としてこのドキュメントを保存できるかどうかを判断します。
IServerDocument interface
DoSafeFileSave method
(IServerDocument interface)
Function DoSafeFileSave (Const AKind : Widestring) : LongBool;
この関数は、指定されたドキュメントタイプのドキュメントを安全に保存できるかどうかを判定します。
IServerDocument interface
DoSafeChangeFileNameAndSave method
(IServerDocument interface)
Function DoSafeChangeFileNameAndSave(Const ANewFileName, AKind : Widestring) : LongBool;
この関数は、現在のドキュメントを新しいファイル名および新しいドキュメントタイプで保存できるかどうかを判定します。
IServerDocument interface
AcquireFileOwnership method
(IServerDocument interface)
Procedure AcquireFileOwnership;
内部使用専用です。
IServerDocument interface
AcquireDataFileHandle method
(IServerDocument interface)
Procedure AcquireDataFileHandle;
内部使用専用です。
IServerDocument interface
WarnIfOwnedByOther method
(IServerDocument interface)
Function WarnIfOwnedByOther(AWarningLevel : TFileOwnershipWarningLevel) : LongBool;
この関数は、そのドキュメントが他のユーザーによって所有されているかどうかを判定します。ドキュメントは他のユーザーと共有できますが、1 人のユーザーだけがそのドキュメントを単独所有している場合、他のユーザーはそのドキュメントを保存できません。
IServerDocument interface
IServerDocument Properties
BeingClosed property
(IServerDocument interface)
Property BeingClosed : LongBool Read GetBeingClosed Write SetBeingClosed;
BeingClosed プロパティは、この設計ドキュメントが正常に破棄される前に閉じられつつあることを示します。このプロパティは読み取り専用プロパティです。ドキュメントが閉じられる前に変更または更新を試みる前に、ドキュメントの状態を確認できます。
このプロパティは、GetBeingClosed メソッドおよび SetBeingClosed メソッドによってサポートされます。
IClient interface
IServerDocument interface
CanClose property
(IServerDocument interface)
Property CanClose : LongBool Read GetCanClose;
この CanClose プロパティは、ドキュメントを閉じることができるかどうかを判定します。
IClient interface
IServerDocument interface
Count property
(IServerDocument interface)
Property Count : Integer Read GetCount;
Count プロパティは、IServerDocument コンテナ内のビュー(同じタイプ)の数を返します。View プロパティと組み合わせて使用します。
このプロパティは GetCount メソッドによってサポートされます。
Var ServerModule : IServerModule; ServerDocument : IServerDocument; ServerDocumentView : IServerDocumentView; Begin ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; For I := 0 to ServerModule.DocumentCount - 1 Do Begin ServerDocument := ServerModule.Documents[I]; ShowMessage('Document View Count ' + IntToStr(ServerDocument.Count) + #13 + 'Kind ' + ServerDocument.Kind)); End; End;
IClient interface
IServerDocument interface
Filename property
(IServerDocument interface)
Property FileName : Widestring Read GetFileName;
FileName プロパティは、サーバードキュメントのファイル名を返します(対応するサーバーパネルではありません)。このプロパティは読み取り専用プロパティであり、GetFileName メソッドによってサポートされます。
サーバードキュメントはドキュメントビューまたはパネルビューである可能性がある点に注意してください。したがって、パネルビューである場合、FileName プロパティは無効です。
ServerDocumentView := ServerDocument.View[j]; If Not(ServerDocumentView.IsPanel) Then ShowMessage(' Document Name ' + ServerDocument.FileName);
IClient interface
IServerDocument interface
IsShown property
(IServerDocument interface)
Property IsShown : LongBool Read GetIsShown Write SetIsShown;
このプロパティは、このドキュメントが Altium Designer に表示されているかどうかを示します。このプロパティは、GetIsShown メソッドおよび SetIsShown メソッドによってサポートされます。
IClient interface
IServerDocument interface
Kind property
(IServerDocument interface)
Property Kind : Widestring Read GetKind;
Kind は、Altium Designer で開かれているドキュメントのタイプを示します。
例としては 'PCB'、'PCBLIB'、'SCH'、'SCHLIB' などがあります。このプロパティは読み取り専用プロパティです。このプロパティは GetKind メソッドによってサポートされます。
ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; For I := 0 to ServerModule.DocumentCount - 1 Do Begin ServerDocument := ServerModule.Documents[I]; ShowMessage('Document View Count ' + IntToStr(ServerDocument.Count) + #13 + 'Kind ' + ServerDocument.Kind)); End;
IClient interface
IServerDocument interface
Modified property
(IServerDocument interface)
Property Modified : LongBool Read GetModified Write SetModified;
Modified プロパティは、このドキュメントが変更されているかどうかを示し、いわゆる "dirty" フラグとして扱えます。つまり、ドキュメントが変更され、dirty としてマークされていることを示します。
このプロパティは、GetModified メソッドおよび SetModified メソッドによってサポートされます。
Var AView : IServerDocumentView; AServerDocument : IServerDocument; Begin If Client = Nil Then Exit; // Grab the current document view using the Client's Interface. AView := Client.GetCurrentView; // Grab the server document which stores views by extracting the ownerdocument field. AServerDocument := AView.OwnerDocument; // Set the document dirty. AServerDocument.Modified := True; End;
IClient interface
IServerDocument interface
ServerModule property
(IServerDocument interface)
Property ServerModule : IServerModule Read GetServerModule;
ServerModule は読み取り専用プロパティで、このドキュメントに関連付けられている IServerModule インターフェースを返します。サーバーモジュールは、Altium Designer にインストールされ実行中のサーバーオブジェクトを表します。
サーバーモジュールは自身のドキュメントおよびパネルを管理します。このプロパティは GetServerModule メソッドによってサポートされます。
//IServerModule interface ServerModule := Client.ServerModuleByName['PCB']; If ServerModule = Nil Then Exit; ShowMessage(IntToStr(ServerModule.DocumentCount)); For I := 0 to ServerModule.DocumentCount - 1 Do Begin //IServerDocument interface ServerDocument := ServerModule.Documents[I]; // do what you want with server documents End;
IClient interface
IServerDocument interface
IServerModule interface
SupportsOwnSave property
(IServerDocument interface)
Property SupportsOwnSave : LongBool Read GetSupportsOwnSave;
SupportsOwnSave プロパティは、サーバーに関連付けられたこれらのドキュメントを保存するための保存ルーチンが提供されているかどうかを示すブール値を返します。読み取り専用プロパティです。
IClient interface
IServerDocument interface
View property
(IServerDocument interface)
Property View Integer : IServerDocumentView Read GetView;
View プロパティはインデックス付きプロパティで、特定の IServerModule インターフェースに関連付けられた IDocument コンテナの一部であるドキュメントビューまたはパネルビューを表します。IServerDocument.Count メソッドは、IServerDocument コンテナの一部としてビュー(ドキュメントまたはパネルウィンドウの場合があります)の一覧を返します。
このプロパティは GetView メソッドによってサポートされます。
For J := 0 to ServerDocument.Count - 1 Do Begin ServerDocumentView := ServerDocument.View[j]; ShowMessage('View Name ' + ServerDocumentView.ViewName); If Not(ServerDocumentView.IsPanel) Then ShowMessage(' Document Name ' + ServerDocument.FileName); End;
IClient interface
IServerDocument interface
IHighlightedDocument Interface
この IHighlightedDocument インターフェースは、Altium Designer において、オブジェクトが選択または選択解除されるとき、またマスクされるとき/されないときに、設計ドキュメント(特に回路図および PCB ドキュメント)上のオブジェクトのハイライトを処理するメカニズムを表します。
このインターフェースとそのメソッドは内部使用向けです。
The
|
|
IServerDocument interface
IServerPanelInfo Interface
IServerPanelInfo インターフェースは、Altium Designer におけるパネルの詳細をカプセル化します。詳細には、名前、ビットマップ、パネルを水平方向または垂直方向にドッキングできるかどうか、などが含まれます。
このインターフェースは、IServerRecord インターフェースおよび IClient インターフェースによって使用されます。
IServerPanelInfo Methods and Properties Table
|
|
IServerRecord interface
IClient Interface
IServerPanelInfo Methods
GetBitmap method
(IServerPanelInfo interface)
Function GetBitmap : Widestring;
この関数はビットマップの名前を返します。
IServerPanelInfo interface
GetButtonVisible method
(IServerPanelInfo interface)
Function GetButtonVisible : Boolean;
この関数は、パネル上のボタンが表示されているかどうかを返します。
IServerPanelInfo interface
GetCanDockHorizontal method
(IServerPanelInfo interface)
Function GetCanDockHorizontal: Boolean;
この関数は、パネルを Altium Designer ユーザーインターフェースに水平方向でドッキングできるかどうかを判定します。
IServerPanelInfo interface
GetCanDockVertical method
(IServerPanelInfo interface)
Function GetCanDockVertical : Boolean;
この関数は、パネルを Altium Designer ユーザーインターフェースに垂直方向でドッキングできるかどうかを判定します。
IServerPanelInfo interface
GetCategory method
(IServerPanelInfo interface)
Function GetCategory : Widestring;
この関数は Category 文字列を返します。つまり、Altium Designer 内でどのモジュールの一部であるかを示します。たとえば、Favorites パネルは System の一部です。
IServerPanelInfo interface
GetCreationClassName method
Syntax
Function GetDocumentKindCount : Integer;
Description
この関数は、このパネルに関連付け可能なドキュメント種別の数を報告します。たとえば Simulation Breakpoints パネルは、VHDL および VHDTST ドキュメントに関連付けることができます。
この関数は GetDocumentKinds 関数と組み合わせて使用します。
Example
IServerPanelInfo インターフェース
GetDocumentKinds メソッド
(IServerPanelInfo インターフェース)
Function GetDocumentKinds(Index : Integer) : WideString;
この関数は、このパネルに関連付けられている、インデックス指定された Document Kind 文字列を返します。たとえば Simulation Breakpoints パネルは、VHDL および VHDTST ドキュメントに関連付けることができます。この関数は GetDocumentKindCount 関数と併用します。
IServerPanelInfo インターフェース
GetHotkey メソッド
(IServerPanelInfo インターフェース)
Function GetHotkey : Widestring;
この関数は、パネルの表示/非表示を切り替えるために使用される HotKey 文字列を返します。
IServerPanelInfo インターフェース
GetMultipleCreation メソッド
(IServerPanelInfo インターフェース)
Function GetMultipleCreation : Boolean;
内部使用。
IServerPanelInfo インターフェース
GetName メソッド
(IServerPanelInfo インターフェース)
Function GetName : Widestring;
この関数はパネル名を返します。たとえば PCB Library パネルの名前は PCBLibPanel です。
IServerPanelInfo インターフェース
GetProjectKindCount メソッド
(IServerPanelInfo インターフェース)
Function GetProjectKindCount : Integer;
内部使用。
IServerPanelInfo インターフェース
GetProjectKinds メソッド
(IServerPanelInfo インターフェース)
Function GetProjectKinds(Index : Integer) : WideString;
内部使用。
IServerPanelInfo インターフェース
SupportsDocumentKind メソッド
(IServerPanelInfo インターフェース)
Function SupportsDocumentKind(Const AKind : Widestring) : Boolean;
この関数は、そのドキュメント種別がこのパネルでサポートされているかどうかを判定します。
IServerPanelInfo インターフェース
SupportsProjectKind メソッド
(IServerPanelInfo インターフェース)
Function SupportsProjectKind (Const AKind : Widestring) : Boolean;
内部使用。
IServerPanelInfo インターフェース
IServerPanelInfo プロパティ
DocumentKindCount プロパティ
(IServerPanelInfo インターフェース)
Property DocumentKindCount : Integer read GetDocumentKindCount;
このプロパティは、このパネルに関連付け可能なドキュメント種別の数を報告します。たとえば Simulation Breakpoints パネルは、VHDL および VHDTST ドキュメントに関連付けることができます。
このプロパティは DocumentKinds プロパティと組み合わせて使用します。
IServerPanelInfo インターフェース
DocumentKinds プロパティ
(IServerPanelInfo インターフェース)
Property DocumentKinds Integer : WideString read GetDocumentKinds;
このプロパティは、このパネルに関連付けられている、インデックス指定された Document Kind 文字列を返します。たとえば Simulation Breakpoints パネルは、VHDL および VHDTST ドキュメントに関連付けることができます。このプロパティは GetDocumentKindCount 関数と併用します。
IServerPanelInfo インターフェース
ProjectKindCount プロパティ
(IServerPanelInfo インターフェース)
Property ProjectKindCount : Integer read GetProjectKindCount;
内部使用
IServerPanelInfo インターフェース
ProjectKinds プロパティ
(IServerPanelInfo インターフェース)
Property ProjectKinds Integer : WideString read GetProjectKinds;
内部使用
IServerPanelInfo インターフェース
ICommandLauncher インターフェース
ICommandLauncher インターフェースは、Altium Designer でコマンド(あらかじめパッケージ化されたプロセス)を起動する機能をカプセル化したものです。コマンドは、サーバー内のユーザーインターフェース項目(Text Editor、Schematic Editor など)に関連付けられており、たとえばホットキーボタン、メニュー項目、またはツールバーのビットマップなどがあります。要するに、サーバーはその一連のプロセスによって支えられており、それらのプロセスは Altium Designer とそのサーバーとの間のリンクとして機能します。
LaunchCommand メソッドは、この ICommandLauncher インターフェース関数に関連付けられたサーバーからプロセスを起動します。
GetCommandState メソッドは、指定されたコマンドの情報を取得します。
サーバーは一連のプロセスを持ち、それらのプロセス識別子はインストールファイル(拡張子は INS)に格納されます。また、特定のユーザーインターフェース要素(リソースとも呼ばれます)にリンクするプロセスランチャーと、ユーザーインターフェース要素のレイアウトはリソースファイル(拡張子は RCS)で定義されます。
|
|
プリミティブの配置、ズームレベルの変更など、サーバー内でユーザーが利用できるすべての機能は、あらかじめパッケージ化されたプロセスランチャーであるコマンドによって実行されます。これらの事前パッケージ済みプロセスランチャーには、コマンド選択時に実行されるプロセスに加えて、パラメータ、ビットマップ(アイコン)、キャプション(リソース上に表示される項目名)、説明、および関連するショートカットキーがまとめられています。
メニュー項目を選択したりツールバーボタンをクリックしたりすると、プロセスを起動していることになります。プロセスは、そのプロセス識別子を適切なサーバーに渡すことで起動され、サーバーがそのプロセスを実行します。プロセスはサーバーのソースコードプロジェクト内の Commands ユニットで定義・実装されます。プロセスはインストールファイル(拡張子 INS)で宣言されます。
各プロセスにはプロセス識別子があります。プロセス識別子はコロンで区切られた 2 つの部分で構成されます。最初の部分はそのプロセスを定義するサーバーを示し、2 番目の部分はプロセス名です。
たとえば、プロセス Sch:ZoomIn は Schematic サーバーによって提供されます。このプロセスが起動されると、メニュー項目の選択、ホットキーの押下、またはツールバーボタンの有効化(これらはいずれも Altium Designer ではプロセスランチャーとして定義されています)によって、現在アクティブな回路図シートを拡大表示する処理が実行されます。
サーバーが Altium Designer で初めて起動されると、そのサーバーモジュール内の CommandLauncher オブジェクトに登録されたプロセス手続きまたはコマンドが Altium Designer に読み込まれます。
IClient インターフェース
IServerModule インターフェース
ICommandLauncher メソッド
GetCommandState
(ICommandLauncher インターフェース)
Procedure GetCommandState( ACommandName,
AParameters : PChar;
Const AContext : IServerDocumentView;
Var Enabled,
Checked,
Visible : LongBool;
Caption,
ImageFile : PChar);
GetCommandState プロシージャは、サーバーコマンド(内部サーバープロセス)の現在のスナップショットを取得し、指定されたサーバーコマンド名に対するパラメータを返します。
ACommandLauncher := AServerModule.GetCommandLauncher; If ACommandLauncher <> Nil Then Begin ACommandLauncher.GetCommandState(Command, Parameters, View, Enabled, Checked, Visible, Caption, Image); // do what you want with the parameters // after you have supplied the Command parameter. End;
IServerModule インターフェース
LaunchCommand
(ICommandLauncher インターフェース)
Function LaunchCommand (Const ACommandName : PChar;
AParameters : PChar;
MaxParameterSize : Integer;
AContext : IServerDocumentView) : LongBool;
この関数は、サーバーモジュールまたは Client からコマンドを起動します。(Client も独自のプロセスを持つため、独自のコマンドランチャーテーブルを持ちます)。
AContext パラメータは、どの IServerDocumentView インターフェースに対してプロセスを起動するかを示します。コマンドを起動できる場合、この関数は true を返します。
If StringsEqual(ServerModule.ModuleName,'TextEdit') Then Begin ServerModule.CommandLauncher.LaunchCommand('TextEdit:MoveCursorToTopOfDocument', Nil,0,ServerDocument.View[0]); End;
IServerDocumentView インターフェース
IGUIManager インターフェース
IGUIManager インターフェースは、パネルのサイズ変更、特定のホットキーマップの確認、ステータスバーなど、Altium Designer アプリケーションのグラフィカルユーザーインターフェース部分を表します。
|
|
IGUIManager メソッド
AddKeyStrokeAndLaunch メソッド
(IGUIManager インターフェース)
Function AddKeyStrokeAndLaunch (AKey : Word) : LongBool;
IGUIManager インターフェース
AddKeyToBuffer メソッド
(IGUIManager インターフェース)
Function AddKeyToBuffer (KeyId : Integer;Alt, Shift, Ctrl : LongBool) : LongBool;
IGUIManager インターフェース
BeginDragDrop メソッド
(IGUIManager インターフェース)
Procedure BeginDragDrop (ADragDropInfo : IDragDropObject);
IGUIManager インターフェース
CanResizePanel メソッド
(IGUIManager インターフェース)
Function CanResizePanel (Const AViewName : Widestring) : LongBool;
この関数は、パネルのサイズ変更が可能かどうかを判定します。パネル名を指定する必要があります。
IGUIManager インターフェース
CurrentProcessLauncherAvailable メソッド
(IGUIManager インターフェース)
Function CurrentProcessLauncherAvailable : LongBool;
この関数は、現在のプロセスランチャーが使用可能かどうかを判定します。
IGUIManager インターフェース
DoneTransparentToolbars メソッド
(IGUIManager インターフェース)
Procedure DoneTransparentToolbars;
IGUIManager インターフェース
GetActivePLByCommand メソッド
(IGUIManager インターフェース)
Function GetActivePLByCommand (Const DocumentKind, ACommand, AParams : Widestring) : IProcessLauncherInfo;
IGUIManager インターフェース
GetFocusedPanelName メソッド
(IGUIManager インターフェース)
Function GetFocusedPanelName : Widestring;
IGUIManager インターフェース
GetPanelIsOpen メソッド
(IGUIManager インターフェース)
Function GetPanelIsOpen (Const AViewName : Widestring) : LongBool;
IGUIManager インターフェース
GetProcessLauncherInfoByID メソッド
(IGUIManager インターフェース)
Function GetProcessLauncherInfoByID (Const PLID : Widestring) : IProcessLauncherInfo;
IGUIManager インターフェース
InitTransparentToolbars メソッド
(IGUIManager インターフェース)
Procedure InitTransparentToolbars (Const ViewRect IGUIManager インターフェース
RegisterFloatingWindow メソッド
(IGUIManager インターフェース)
Procedure RegisterFloatingWindow (Const FloatingWindow : IFloatingWindow);
IGUIManager インターフェース
ResizePanel メソッド
(IGUIManager インターフェース)
Procedure ResizePanel (Const AViewName : Widestring; AWidth, AHeight : Integer);
IGUIManager インターフェース
SetFocusLock メソッド
(IGUIManager インターフェース)
Procedure SetFocusLock (Locked : LongBool);
IGUIManager インターフェース
SetPanelActiveInCurrentForm メソッド
(IGUIManager インターフェース)
Procedure SetPanelActiveInCurrentForm (Const AViewName : Widestring);
IGUIManager インターフェース
SetPanelVisibleInCurrentForm メソッド
(IGUIManager インターフェース)
Procedure SetPanelVisibleInCurrentForm (Const AViewName : Widestring; IsVisible : LongBool);
IGUIManager インターフェース
ShowCurrentProcessLauncherHelp メソッド
(IGUIManager インターフェース)
Function ShowCurrentProcessLauncherHelp : LongBool;
IGUIManager インターフェース
ShowTreeAsPopup メソッド
(IGUIManager インターフェース)
Procedure ShowTreeAsPopup (Const TreeID : Widestring);
IGUIManager インターフェース
StatusBar_GetState メソッド
(IGUIManager インターフェース)
Function StatusBar_GetState (Index : Integer) : Widestring;
IGUIManager インターフェース
StatusBar_SetState メソッド
(IGUIManager インターフェース)
Procedure StatusBar_SetState (Index : Integer; Const S : Widestring);
IGUIManager インターフェース
UnregisterFloatingWindow メソッド
(IGUIManager インターフェース)
Procedure UnregisterFloatingWindow (Const FloatingWindow : IFloatingWindow);
IGUIManager インターフェース
UpdateInterfaceState メソッド
(IGUIManager インターフェース)
Procedure UpdateInterfaceState;
IGUIManager インターフェース
UpdateTransparentToolbars メソッド
(IGUIManager インターフェース)
Procedure UpdateTransparentToolbars;
IGUIManager インターフェース
INavigationSystem インターフェース
ナビゲーションシステムは、設計プロジェクトのネット接続性の中心となる Navigation パネルの中核機能です。設計は、コンパイル済みシートのリスト、フラット化された階層構造、構造ツリーの3つの方法で配置できます。
|
|
IClient インターフェース
INavigationSystem メソッド
UnregisterNavigationProtocol メソッド
(INavigationSystem インターフェース)
Procedure UnregisterNavigationProtocol(Const Protocol : WideString; Handle : THandle);
INavigationSystem インターフェース
RegisterSpecialURLString メソッド
(INavigationSystem インターフェース)
Procedure RegisterSpecialURLString (Const SpecialString : WideString; SpecialStringFunc : TSpecialStringFunc);
INavigationSystem インターフェース
RegisterNavigationProvider メソッド
(INavigationSystem インターフェース)
Function RegisterNavigationProvider (Const ProtocolName : WideString; Const NavigationProvider : INavigationProvider) : THandle;
INavigationSystem インターフェース
ParseDestinationString メソッド
(INavigationSystem インターフェース)
Procedure ParseDestinationString(Const Destination : WideString; Var Protocol, Target, Parameters : WideString);
INavigationSystem インターフェース
NavigateTo メソッド
(INavigationSystem インターフェース)
Function NavigateTo (Const CurrentView : IExternalForm; Var Destination : WideString; Out TargetView : IExternalForm) : LongBool;
INavigationSystem インターフェース
ExpandTargets メソッド
(INavigationSystem インターフェース)
Procedure ExpandTargets (Var Target : WideString);
INavigationSystem インターフェース
ValidatedTarget メソッド
(INavigationSystem インターフェース)
Function ValidatedTarget ( Target : WideString) : WideString;
INavigationSystem インターフェース
UnregisterSpecialURLString メソッド
(INavigationSystem インターフェース)
Procedure UnregisterSpecialURLString (Const SpecialString : WideString; SpecialStringFunc : TSpecialStringFunc);
INavigationSystem インターフェース
INotification インターフェース
INotification インターフェースは、IClient、IServerView、IServerDocument、IServerModule、INotificationHandler の各インターフェースで使用されます。
通知には、ドキュメントの読み込み通知、ワークスペースの読み込み、オブジェクトへのナビゲーション、サーバーモジュールの読み込みなどがあります。
イベントメッセージとしての通知は Client システムによってブロードキャストでき、開いている任意のサーバードキュメントがそれを受信して、適切に処理できます。
Broadcast Notification はシステム全体の通知であり、Dispatch Notification はサーバー固有の通知です。
さまざまな種類の通知
1. DocumentNotification
2. ViewNotification
3. DocumentFormNotification
4. ModuleNotification
5. SystemNotification
6. MessagesNotification
7. DragDropNotification
8. FastCrossSelectNotification
サーバープロジェクトでの通知の設定
1. さまざまな通知を処理するために、TServerModule クラスの ReceiveNotifications メソッドをオーバーライドします。
2. 異なる通知ハンドラーを定義します。
3. 各通知の Code プロパティに基づいて各ハンドラーを処理します。
Procedure TNotificationModule.ReceiveNotification(Const ANotification: INotification); Var DocumentNotification : IDocumentNotification; ViewNotification : IViewNotification; FormNotification : IDocumentFormNotification; ModuleNotification : IModuleNotification; SystemNotification : ISystemNotification; Begin If Supports(ANotification, IDocumentNotification, DocumentNotification) Then HandleDocumentNotification(DocumentNotification); If Supports(ANotification, IViewNotification, ViewNotification) Then HandleViewNotification(ViewNotification); If Supports(ANotification, IDocumentFormNotification, FormNotification) Then HandleFormNotification(FormNotification); If Supports(ANotification, IModuleNotification, ModuleNotification) Then HandleModuleNotification(ModuleNotification); If Supports(ANotification, ISystemNotification, SystemNotification) Then HandleSystemNotification(SystemNotification); End;
INotification インターフェースの階層は次のとおりです。
INotification
IDocumentNotification
IViewNotification
IDocumentFormNotification
IModuleNotification
ISystemNotification
IMessageNotification
IDragDropNotification
IDocumentRequest
IFastCrossNotification
|
|
IClient インターフェース
IServerView インターフェース
IServerDocument インターフェース
IServerModule インターフェース
INotificationHandler インターフェース
IDocumentNotification インターフェース
IViewNotification インターフェース
IDocumentFormNotification インターフェース
IModuleNotification インターフェース
ISystemNotification インターフェース
IMessageNotification インターフェース
IDragDropNotification インターフェース
IDocumentRequest インターフェース
IFastCrossNotification インターフェース
IDocumentFormNotification インターフェース
(IDocumentFormNotification インターフェース)
IClient インターフェース
IExternalForm インターフェース
ISystemNotification インターフェース
(ISystemNotification インターフェース)
IClient インターフェース
IExternalForm インターフェース
IMessagesNotification インターフェース
IMessagesNotification インターフェース
|
|
IClient インターフェース
IExternalForm インターフェース
IModuleNotification インターフェース
IClient インターフェース
IExternalForm インターフェース
IViewNotification インターフェース
IClient インターフェース
IExternalForm インターフェース
IDragDropNotification インターフェース
INotification インターフェースから継承されています。
|
|
IDragDropObject インターフェース
IEventNavigated インターフェース
|
|
IDragDropObject インターフェース
INavigationProvider インターフェース
|
|
IDragDropObject インターフェース
INavigator インターフェース
|
|
IBackForwardNavigator インターフェース
|
|
INavigationSystem インターフェース
|
|
IDragDropObject インターフェース
INavigateAttributes インターフェース
|
|
IDynamicHelpManager インターフェース
このインターフェースは、Altium Designer の Knowledge Center パネルを表します。このインターフェースは IClient インターフェースの一部です。
|
IClient インターフェース
IFastCrossSelectNotification インターフェース
|
|
IClient インターフェース
IExternalForm インターフェース
IDocumentNotification インターフェース
IDocumentNotification インターフェースは、次を表します
|
|
IClient インターフェース
IExternalForm インターフェース
IDocumentRequest インターフェース
IClient インターフェース
INotification インターフェース
INotificationHandler インターフェース
INotificationHandler インターフェースは、Altium Designer システム内でブロードキャストされる通知を処理します。通知には、ドキュメントの読み込み通知、ワークスペースの読み込み、オブジェクトへのナビゲーション、サーバーモジュールの読み込みなどがあります。
イベントメッセージとしての通知は Client システムによってブロードキャストでき、開いている任意のサーバードキュメントがそれを受信して、適切に処理できます。Broadcast Notification はシステム全体の通知であり、Dispatch Notification はサーバー固有の通知です。
サーバープロジェクト内で Notification handler を登録するには(サーバーモジュールオブジェクト、パネルビューオブジェクト、またはドキュメントビューオブジェクトのいずれかで)
1. オブジェクトが作成されると、Client.RegisterNotificationHandler が呼び出されます。
2. オブジェクトが破棄されると、Client.UnregisterNotificationHandler が呼び出されます。
3. カスタム通知を処理するために、オブジェクトには HandlerNotification メソッドがあり、カスタム通知コードがインターセプトされたIProcessLauncherInfo インターフェース
IProcessLauncherInfo インターフェース階層は次のとおりです;
|
|
IProcessLauncherInfo のメソッド
GetCaption メソッド
(IProcessLauncherInfo インターフェース)
Function GetCaption : Widestring;
IProcessLauncherInfo インターフェース
GetDescription メソッド
(IProcessLauncherInfo インターフェース)
Function GetDescription : Widestring;
IProcessLauncherInfo インターフェース
GetImageFile メソッド
(IProcessLauncherInfo インターフェース)
Function GetImageFile : Widestring;
IProcessLauncherInfo インターフェース
GetKey メソッド
(IProcessLauncherInfo インターフェース)
Function GetKey : Integer;
IProcessLauncherInfo インターフェース
GetKey2 メソッド
(IProcessLauncherInfo インターフェース)
Function GetKey2 : Integer;
IProcessLauncherInfo インターフェース
GetParameters メソッド
(IProcessLauncherInfo インターフェース)
Function GetParameters : Widestring;
IProcessLauncherInfo インターフェース
GetServerCommand メソッド
(IProcessLauncherInfo インターフェース)
Function GetServerCommand : Widestring;
IProcessLauncherInfo インターフェース
GetShift メソッド
(IProcessLauncherInfo インターフェース)
Function GetShift : TShiftState;
IProcessLauncherInfo インターフェース
GetShift2 メソッド
(IProcessLauncherInfo インターフェース)
Function GetShift2 : TShiftState;
IProcessLauncherInfo インターフェース
GetShortcutText メソッド
(IProcessLauncherInfo インターフェース)
Function GetShortcutText : Widestring;
IProcessLauncherInfo インターフェース
IProcessLauncherInfo のプロパティ
Caption プロパティ
(IProcessLauncherInfo インターフェース)
Property Caption : Widestring Read GetCaption ;
IProcessLauncherInfo インターフェース
Description プロパティ
(IProcessLauncherInfo インターフェース)
Property Description : Widestring Read GetDescription ;
IProcessLauncherInfo インターフェース
ImageFile プロパティ
(IProcessLauncherInfo インターフェース)
Property ImageFile : Widestring Read GetImageFile ;
IProcessLauncherInfo インターフェース
Key プロパティ
(IProcessLauncherInfo インターフェース)
Property Key : Integer Read GetKey ;
IProcessLauncherInfo インターフェース
Key2 プロパティ
(IProcessLauncherInfo インターフェース)
Property Key2 : Integer Read GetKey2 ;
IProcessLauncherInfo インターフェース
Parameters プロパティ
(IProcessLauncherInfo インターフェース)
Property Parameters : Widestring Read GetParameters ;
IProcessLauncherInfo インターフェース
ServerCommand プロパティ
(IProcessLauncherInfo インターフェース)
Property ServerCommand : Widestring Read GetServerCommand;
IProcessLauncherInfo インターフェース
Shift プロパティ
(IProcessLauncherInfo インターフェース)
Property Shift : TShiftState Read GetShift ;
IProcessLauncherInfo インターフェース
Shift2 プロパティ
(IProcessLauncherInfo インターフェース)
Property Shift2 : TShiftState Read GetShift2 ;
IProcessLauncherInfo インターフェース
ShortcutText プロパティ
(IProcessLauncherInfo インターフェース)
Property ShortcutText : Widestring Read GetShortcutText ;
IProcessLauncherInfo インターフェース
IProcessControl インターフェース
IProcessControl インターフェースは、Altium Designer における各設計ドキュメントのプロセス深度を制御します。ドキュメント上でプロセスが起動されるたびに、プロセス深度は 1 ずつ増加し、その同じプロセスの実行が完了すると 1 ずつ減少します。プロセス深度が 0 の場合、現在の設計ドキュメント上では何も実行されていないことを示します。これは、特に Undo システムを含め、環境の同期を保つために必要です。
回路図および PCB ドキュメントのプロセス深度
Schematic API または PCB API を使用して、それぞれ回路図または PCB ドキュメント上のオブジェクトを変更または操作する場合、回路図または PCB ドキュメント上でオブジェクトを追加、削除、変更するときに環境が正しく更新されるよう、PreProcess メソッドと PostProcess メソッドを設定する必要があります。
|
|
PostProcess メソッドおよび PreProcess メソッド用の IPCB_ServerInterface
PostProcess メソッドおよび PreProcess メソッド用の ISch_ServerInterface
IProcessControl のメソッド
PostProcess メソッド
(IProcessControl インターフェース)
Procedure PostProcess (Const AContext : IInterface; AParameters : PChar);
このプロシージャはメインサーバー内で後処理を実行します。これには、Undo システムなどのサーバー環境の状態を最終確定する処理が含まれる場合があります。AContext パラメータは通常、Altium Designer でフォーカスされているドキュメントであり、たとえば ISch_Document や IPCB_Board インターフェースです。
// Initialize the robots in Schematic editor. SchServer.ProcessControl.PreProcess(Doc, ''); // Create a new port and place on current Schematic document. SchPort := SchServer.SchObjectFactory(ePort,eCreate_GlobalCopy); If SchPort = Nil Then Exit; SchPort.Location := Point(100,100); SchPort.Style := ePortRight; SchPort.IOType := ePortBidirectional; SchPort.Alignment := eHorizontalCentreAlign; SchPort.Width := 100; SchPort.AreaColor := 0; SchPort.TextColor := $FFFF00; SchPort.Name := 'New Port 1'; // Add a new port object in the existing Schematic document. Doc.RegisterSchObjectInContainer(SchPort); SchServer.RobotManager.SendMessage(Doc.I_ObjectAddress,c_BroadCast, SCHM_PrimitiveRegistration,SchPort.I_ObjectAddress); // Clean up the robots in Schematic editor SchServer.ProcessControl.PostProcess(Doc, '');
PreProcess メソッド
PreProcess メソッド
(IProcessControl インターフェース)
Procedure PreProcess (Const AContext : IInterface; AParameters : PChar);
メインサーバー内で前処理を実行します。これには、サーバー環境のリセットが含まれる場合があります。AContext パラメータは通常、Altium Designer でフォーカスされているドキュメントであり、たとえば ISch_Document や IPCB_Board インターフェースです
// Initialize the robots in Schematic editor. SchServer.ProcessControl.PreProcess(Doc, ''); // Create a new port and place on current Schematic document. SchPort := SchServer.SchObjectFactory(ePort,eCreate_GlobalCopy); If SchPort = Nil Then Exit; SchPort.Location := Point(100,100); SchPort.Style := ePortRight; SchPort.IOType := ePortBidirectional; SchPort.Alignment := eHorizontalCentreAlign; SchPort.Width := 100; SchPort.AreaColor := 0; SchPort.TextColor := $FFFF00; SchPort.Name := 'New Port 1'; // Add a new port object in the existing Schematic document. Doc.RegisterSchObjectInContainer(SchPort); SchServer.RobotManager.SendMessage(Doc.I_ObjectAddress,c_BroadCast, SCHM_PrimitiveRegistration,SchPort.I_ObjectAddress); // Clean up the robots in Schematic editor SchServer.ProcessControl.PostProcess(Doc, '');
PostProcess メソッド
IProcessControl のプロパティ
ProcessDepth プロパティ
(IProcessControl インターフェース)
Property ProcessDepth : Integer;
プロセス深度を設定または取得します。深度値は整数値です。0 = 非アクティブ、1 以上は積み重なったプロセス数を示します。
ShowMessage('Current process depth ',IntToStr(Client.ProcessControl.ProcessDepth));
ILicenseManager インターフェース
|
|
ILicenseManager のメソッド
UseLicense メソッド
(ILicenseManager インターフェース)
Procedure UseLicense (Const LicenseFileName : Widestring);
ILicenseManager インターフェース
ReleaseLicense メソッド
(ILicenseManager インターフェース)
Procedure ReleaseLicense (Const LicenseFileName : Widestring);
ILicenseManager インターフェース
GetLicenses メソッド
(ILicenseManager インターフェース)
Procedure GetLicenses (Licenses : TList);
ILicenseManager インターフェース
ChangeToStandalone メソッド
(ILicenseManager インターフェース)
Procedure ChangeToStandalone;
このプロシージャは、コンピューター上で実行中の Altium Designer のライセンスを、ネットワークライセンスからスタンドアロンライセンスへ変更します。スタンドアロン コンピューターとは、インターネットに接続されていないコンピューターのことです。
ILicenseManager インターフェース
ChangeToNetwork メソッド
(ILicenseManager インターフェース)
Procedure ChangeToNetwork (Const ServerName : Widestring);
このプロシージャは、コンピューター上で実行中の Altium Designer のライセンスを、スタンドアロンライセンスからネットワークライセンスへ変更します。サーバー名は文字列として指定する必要があります。
スタンドアロン コンピューターとは、インターネットに接続されていないコンピューターのことです。
ILicenseManager インターフェース
UseLicenseByName メソッド
(ILicenseManager インターフェース)
Procedure UseLicenseByName (Const LicenseName : Widestring);
ILicenseManager インターフェース
IOptionsManager インターフェース
IOptionsManager インターフェースは、システム全体の Preferences ダイアログ、またはプロジェクト中心の Project Options ダイアログのオプションを扱います。
サーバーは、Altium Designer の Client モジュール内に独自のオプションページを登録する必要があります。Altium Designer RTL 内の RT_ServerImplementation ユニットにある TServerModule クラスには、オーバーライド可能な RegisterOptionsPageClass プロシージャがあります。ここには、オプションページの名前と、TOptionsForm 型の Options Form を渡す必要があります。通常、このフォームは、その上にコントロールが配置されたサーバーパネルフォームと同じものです。
|
|
Procedure TGraphicPreferences.Save;
Var
Writer : IOptionsWriter;
Begin
Writer := Client.OptionsManager.GetOptionsWriter(CGraphicViewer);
If Writer = Nil Then Exit;
Writer.WriteBoolean(cGraphicPreferences, 'ScaleImage' , FScaleImage );
Writer.WriteBoolean(cGraphicPreferences, 'KeepAspectRatio', FKeepAspectRatio);
End;
IOptionsReader インターフェース
IOptionsWriter インターフェース
IOptionsPage インターフェース
\Developer Kit\Examples\Dxp\GraphicViewer フォルダー内の GraphicViewer サーバープロジェクト
IOptionsManager のメソッド
OptionsExist メソッド
(IOptionsManager インターフェース)
Function OptionsExist (Const ServerName, OldSettingsPath : WideString) : LongBool;
この関数は、指定されたサーバーのオプションがシステム全体の Preference ダイアログ内に存在するかどうかを確認します。
IOptionsManager インターフェース
GetOptionsWriter メソッド
(IOptionsManager インターフェース)
Function GetOptionsWriter (Const ServerName : WideString) : IOptionsWriter;
この関数は IOptionsWriter メソッドを取得します。これにより、指定されたサーバーの Options に対して設定値を書き込めます。
Var Writer : IOptionsWriter; Begin Writer := Client.OptionsManager.GetOptionsWriter(CGraphicViewer); If Writer = Nil Then Exit; Writer.WriteBoolean(PreferencesName, OptionName , OptionValue); End;
IOptionsManager インターフェース
IOptionsWriter インターフェース
IOptionsReader インターフェース
GetOptionsReader メソッド
(IOptionsManager インターフェース)
Function GetOptionsReader (Const ServerName, OldSettingsPath : WideString) : IOptionsReader;
この関数は IOptionsReader メソッドを取得します。これにより、指定されたサーバーの Options に対する設定値を読み取れます。
Var Reader : IOptionsReader; Begin Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,''); If Reader = Nil Then Exit; OptionValue := Reader.ReadBoolean(ServerPreferencesName,OptionName,DefaultValue); End;
IOptionsManager インターフェース
IOptionsWriter インターフェース
IOptionsReader インターフェース
IOptionsReader インターフェース
IOptionsReader インターフェースは、システム全体の Preferences ダイアログまたは Project Options ダイアログのページ上のオプション値を、レジストリ ストレージから読み取ります。
|
|
Var Reader : IOptionsReader; Begin Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,''); If Reader = Nil Then Exit; AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue); End;
IClient インターフェース
IOptionsManager インターフェース
IOptionsReader のメソッド
ValueExists メソッド
(IOptionsReader インターフェース)
Function ValueExists (Const SectionName, ValueName : WideString) : LongBool;
この関数は、このセクション名に対して値名が存在するかどうかを判定します。値をこの場所に書き込む前に、レジストリ ストレージ内にその値名が存在するかどうかを確認する必要がある場合に便利です。(IOptionsReader インターフェース)
Function ReadString (Const SectionName, ValueName, DefaultValue : WideString) : WideString;
ReadString 関数は、システム全体の Preferences ダイアログで表される、指定されたサーバーおよび設定名の文字列値を取得します。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsReader インターフェース
ReadSection メソッド
(IOptionsReader インターフェース)
Function ReadSection (Const SectionName : WideString) : WideString;
この関数は、システム全体の Preferences ダイアログ内の対象ページであるセクションのデータを取得します。
セクション名は、システム全体の Preferences ダイアログ内の対象ページであることに注意してください。
IOptionsReader インターフェース
ReadInteger メソッド
(IOptionsReader インターフェース)
Function ReadInteger (Const SectionName, ValueName : WideString; DefaultValue : Integer) : Integer;
ReadInteger 関数は、システム全体の Preferences ダイアログで表される、指定されたサーバーおよび設定名の整数値を取得します。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsReader インターフェース
ReadDouble メソッド
(IOptionsReader インターフェース)
Function ReadDouble (Const SectionName, ValueName : WideString; DefaultValue : Double) : Double;
ReadDouble 関数は、システム全体の Preferences ダイアログで表される、指定されたサーバーおよび設定名の double 値を取得します。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsReader インターフェース
ReadBoolean メソッド
(IOptionsReader インターフェース)
Function ReadBoolean (Const SectionName, ValueName : WideString; DefaultValue : LongBool) : LongBool;
ReadBoolean 関数は、システム全体の Preferences ダイアログで表される、指定されたサーバーおよび設定名のブール値を取得します。
ReadBoolean メソッドの DefaultValue パラメーターは、Preferences ダイアログ上の特定のコントロールが有効なブール値を返さない場合に、既定のブール値を返します。
セクション名は、システム全体の Preferences ダイアログ内の対象サーバーのページを表します。
Var Reader : IOptionsReader; Begin Reader := Client.OptionsManager.GetOptionsReader(NameOfServer,''); If Reader = Nil Then Exit; AValue := Reader.ReadBoolean(NameOfServerPreferences,SettingName,DefaultValue); End;
IOptionsReader インターフェース
IOptionsWriter インターフェース
IOptionsWriter インターフェースは、システム全体の Preferences または Project options ダイアログ内のページ上のオプション値をレジストリ ストレージに書き込みます。
|
|
Var Writer : IOptionsWriter; Begin Writer := Client.OptionsManager.GetOptionsWriter(CGraphicViewer); If Writer = Nil Then Exit; Writer.WriteBoolean(cGraphicPreferences, 'ScaleImage' , FScaleImage ); Writer.WriteBoolean(cGraphicPreferences, 'KeepAspectRatio', FKeepAspectRatio); End;
IClient インターフェース
IOptionsManager インターフェース
IOptionsWriter メソッド
EraseSection メソッド
(IOptionsWriter インターフェース)
Procedure EraseSection(Const SectionName : WideString);
このプロシージャは、そのセクション(システム全体の Preferences ダイアログ内の対象ページ)のすべてのオプション値を削除します。
IOptionsWriter インターフェース
WriteInteger メソッド
(IOptionsWriter インターフェース)
Procedure WriteInteger(Const SectionName, ValueName : WideString; Value : Integer);
WriteInteger プロシージャは、システム全体の Preferences ダイアログで表される指定サーバー(SectionName)が使用するオプション名に対して、整数値を書き込みます。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsWriter インターフェース
WriteDouble メソッド
(IOptionsWriter インターフェース)
Procedure WriteDouble (Const SectionName, ValueName : WideString; Value : Double);
WriteDouble プロシージャは、システム全体の Preferences ダイアログで表される指定サーバー(SectionName)が使用するオプション名に対して、double 値を書き込みます。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsWriter インターフェース
WriteBoolean メソッド
(IOptionsWriter インターフェース)
Procedure WriteBoolean(Const SectionName, ValueName : WideString; Value : LongBool);
WriteBoolean プロシージャは、システム全体の Preferences ダイアログで表される指定サーバー(SectionName)が使用するオプション名に対して、ブール型のオプション値を書き込みます。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
Var Writer : IOptionsWriter; Begin Writer := Client.OptionsManager.GetOptionsWriter(CGraphicViewer); If Writer = Nil Then Exit; Writer.WriteBoolean(cGraphicPreferences, 'ScaleImage' , FScaleImage ); Writer.WriteBoolean(cGraphicPreferences, 'KeepAspectRatio', FKeepAspectRatio); End;
IOptionsWriter インターフェース
WriteString メソッド
(IOptionsWriter インターフェース)
Procedure WriteString (Const SectionName, ValueName, Value : WideString);
WriteString プロシージャは、システム全体の Preferences ダイアログで表される指定サーバー(SectionName)が使用するオプション名に対して、文字列のオプション値を書き込みます。
セクション名は、システム全体の Preferences ダイアログ内の対象ページです。
IOptionsWriter インターフェース
IOptionsPage インターフェース
IOptionsPage インターフェースは、システム全体の Preferences ダイアログ内のコントロール ページを表します。たとえば Altium Designer では、この Preferences ダイアログ内のページ上のコントロールは、このサーバーのサーバー パネル上のコントロールからマップされます。ページ上のコントロールは、TOptionsForm オブジェクトとその IOptionsPage インターフェースによって表されます。
サーバー モジュール(TServerModule クラス)には RegisterOptionsPageClass メソッドがあり、これが TOptionsForm オブジェクトを受け取ります。IOptionsPage インターフェースは、この TOptionsForm オブジェクトを表します。
TOptionsForm クラスには、OptionsPage、OptionsManager、OptionsReader、および OptionsWriter インターフェースを実装するためにオーバーライドする必要のあるメソッドがあります。
ClearModified
GetModified
GetStateControls
GetNotificationCode
DoSetStateControls
SetDefaultState
|
|
TGraphicPrefsForm_General = Class(TOptionsForm) chxScale : TCheckBox; chxProportional : TCheckBox; Private FScaleStored : Boolean; FProportionalStored : Boolean; Protected Procedure ClearModified; Override; Function GetModified : Boolean; Override; Procedure GetStateControls; Override; Function GetNotificationCode : Integer; Override; Procedure DoSetStateControls; Override; Procedure SetDefaultState; Override; End; \{..........................................................................\} Function TGraphicPrefsForm_General.GetNotificationCode: Integer; Begin Result := cGraphicPreferencesChanged; End; Procedure TGraphicPrefsForm_General.GetStateControls; Begin gv_GraphicPreferences.ScaleImage := chxScale .Checked; gv_GraphicPreferences.KeepAspectRatio := chxProportional.Checked; End; Procedure TGraphicPrefsForm_General.DoSetStateControls; Begin chxScale .Checked := gv_GraphicPreferences.ScaleImage; chxProportional.Checked := gv_GraphicPreferences.KeepAspectRatio; End; Procedure TGraphicPrefsForm_General.SetDefaultState; Begin chxScale .Checked := False; chxProportional.Checked := False; Inherited; End; Procedure TGraphicPrefsForm_General.ClearModified; Begin FScaleStored := chxScale.Checked; FProportionalStored := chxProportional.Checked; End; Function TGraphicPrefsForm_General.GetModified : Boolean; Begin Result := (FScaleStored <> chxScale.Checked) Or (FProportionalStored <> chxProportional.Checked); End;
IOptionsManager インターフェース
IOptionsReader インターフェース
IOptionsWriter インターフェース
IOptionsPage の GetState および SetState メソッド
GetModified メソッド
(IOptionsPage インターフェース)
Function GetModified : Boolean;
IOptionsPage インターフェース
SetModified メソッド
(IOptionsPage インターフェース)
Procedure SetModified(Value : Boolean);
IOptionsPage インターフェース
IOptionsPage メソッド
SetStateControls メソッド
(IOptionsPage インターフェース)
Procedure SetStateControls;
このプロシージャは、サーバー モジュール内のデータ構造からフォーム上のコントロールを更新します。
IOptionsPage インターフェース
SetDefaultState メソッド
(IOptionsPage インターフェース)
Procedure SetDefaultState;
このプロシージャは、システム全体の Preferences ダイアログ内のページ上のコントロールを既定値に設定します。
SetDefaultState プロシージャは、サーバーの TOptionsForm オブジェクト内でオーバーライドされます。
IOptionsPage インターフェース
PostEditControls メソッド
(IOptionsPage インターフェース)
Procedure PostEditControls;
IOptionsPage インターフェース
GetStateControls メソッド
(IOptionsPage インターフェース)
Procedure GetStateControls;
このプロシージャ
IOptionsPage インターフェース
GetNotificationCode メソッド
(IOptionsPage インターフェース)
Function GetNotificationCode : Integer;
Altium Designer でサーバー パネルおよびシステム全体の Preferences ダイアログへの Option 通知を処理する各サーバーは、100 以上の値を取り得る独自の Notification code を持ちます。
サーバー モジュールには TOptionsForm オブジェクトが登録されており、このオブジェクトでは GetNotificationCode 関数がオーバーライドされます。このサーバー モジュールは独自の通知コード値を持ちます。これらの通知コードが一意であることを確認してください。
IOptionsPage インターフェース
IOptionsPage のプロパティ
Modified プロパティ
(IOptionsPage インターフェース)
Property Modified : Boolean Read GetModified Write SetModified;
IOptionsPage インターフェース
IServerProcess インターフェース
IServerProcess インターフェースは、サーバーのインストール ファイル内のコマンド(サーバー プロセス)に関する情報を返します。
- コマンド名(GetOriginalID メソッド)
- 詳細サマリー
- パラメーター数(存在する場合)
- パラメーター名(存在する場合)
IServerProcess インターフェースは、IServerRecord インターフェース内で使用される集約インターフェースです。
一般的なインストール ファイル構造は以下のとおりです
ClientInsFile 1.0
Server
EditorName = 'AddOn'
EditorExePath = 'AddOn.DLL'
EditorDescription = 'A demonstratory AddOn module'
Version = 'Version 8.1.4.2763'
Date = '24-Dec-2004'
HelpAboutInfo = 'This software is protected by copyright law and international treaties.'
Copyright = 'Copyright © Altium Limited 2004'
Updates = 'ADVPCB'
End
Command Name = 'CountPads' LongSummary = 'Find how many pads on a PCB document' End
Command Name = 'RunAPCBProcess' LongSummary = 'Invoke a PCB process' End
|
|
//ServerRecord is a IServerRecord interface CommandCount := ServerRecord.GetCommandCount; For J := 0 To CommandCount - 1 Do Begin //ServerProcess is a IServerProcess interface ServerProcess := ServerRecord.GetCommand(J); ReportFile.Add(' Process #' + IntToStr(J + 1) + ' Name = ' + ServerProcess.GetOriginalId + ' LongSummary = ' + ServerProcess.GetLongSummary); ParameterCount := ServerProcess.GetParameterCount; For K := 0 To ParameterCount - 1 Do S := S + ServerProcess.GetParameter(K) + ', '; ReportFile.Add(' Parameters = ' + S); End;
プリミティブの配置、ズーム レベルの変更など、ユーザーが利用できるサーバー内のすべての機能は、あらかじめパッケージ化されたプロセス ランチャーであるコマンドによって実行されます。これらの事前パッケージ化されたプロセス ランチャーには、コマンド選択時に実行されるプロセスに加え、必要に応じてパラメーター、ビットマップ(アイコン)、キャプション(リソース上に表示される項目名)、説明、および関連するショートカット キーがまとめられています。
メニュー項目を選択したりツールバー ボタンをクリックしたりすると、プロセスが起動されます。プロセスは、プロセス識別子を適切なサーバーに渡すことで起動され、サーバーがその後プロセスを実行します。プロセスは、サーバー ソース コード プロジェクトの Commands ユニットで定義および実装されます。これらのプロセスは、インストール ファイル(INS 拡張子)で宣言されます。
各プロセスにはプロセス識別子があります。プロセス識別子は、コロンで区切られた 2 つの部分から構成されます。最初の部分はそのプロセスを定義するサーバーを示し、2 番目の部分はプロセス名です。
たとえば、プロセス
サーバーが初めて起動されると、サーバー モジュール内の CommandLauncher オブジェクトにプロセス プロシージャまたはコマンドが登録されます。
IServerRecord インターフェース
\Examples\Scripts\DXP\ フォルダー内の ServerProcessReport スクリプト
IServerProcess メソッド
GetLongSummary メソッド
(IServerProcess インターフェース)
Function GetLongSummary : WideString;
GetLongSummary 関数は、Long Summary 識別子文字列を返します。
IServerProcess インターフェース
IServerRecord インターフェース
GetOriginalId メソッド
(IServerProcess インターフェース)
Function GetOriginalId : WideString;
GetOriginalID メソッドは、指定されたサーバー プロセスの Process Identifier 文字列を返します。
IClient インターフェース
IServerProcess インターフェース
GetParameter メソッド
(IServerProcess インターフェース)
Function GetParameter(Index : Integer) : WideString;
GetParameter 関数は、index パラメータに応じて指定されたインデックスのパラメータ文字列を返します。これは GetParameterCount メソッドと組み合わせて使用します。サーバープロセスはパラメトリックにすることができ、そのため複数のパラメータを持つ場合があります。
IClient インターフェース
IServerProcess インターフェース
GetParameterCount メソッド
GetParameterCount メソッド
(IServerProcess インターフェース)
Function GetParameterCount : Integer;
GetParameterCount 関数は、現在の Process Identifier (GetOriginalID) に対するパラメータ数を返します。
これは GetParameter メソッドと組み合わせて使用します。
IClient インターフェース
IServerProcess インターフェース
GetParameter メソッド
IServerRecord インターフェース
このインターフェースは、サーバーのインストールファイル一覧を持つ \System フォルダーから、サーバーのインストールファイル情報を取得します。つまり、各サーバーインストールファイル(INS 拡張子を持つ)は、それぞれ 1 つの IServerRecord インターフェースに対応します。
この IServerRecord インターフェースは Client オブジェクト内にあるため、Client.GetServerRecordCount を呼び出してサーバーインストールファイル数を取得し、その後 Client.GetServerRecord(RecordCount) を IServerRecord 変数に代入することで、インストールファイルに関連付けられたデータを取得できます。
Altium Designer にインストールされている各サーバーモジュールの詳細情報を確認するには、IClient.GetServerModule インターフェースを呼び出します。
|
|
PCB_SR := Client.GetServerRecordByName('PCB');
IClient インターフェース
IServerModule インターフェース
\Developer Kit\Examples\DXP\ClientServer Interfaces\ フォルダー内の CS サーバーの例。
IServerRecord のメソッド
GetCommand メソッド
(IServerRecord インターフェース)
Function GetCommand(Index : Integer) : IServerProcess;
このメソッドは IServerProcess インターフェースを返します。GetCommandCount 関数と組み合わせて使用します。
IServerRecord インターフェース
GetCommandCount メソッド
(IServerRecord インターフェース)
Function GetCommandCount : Integer;
このメソッドは、このサーバーがサポートするコマンド(Process launcher)の数を返します。
GetCommand 関数と組み合わせて使用します
IServerRecord インターフェース
GetCopyRight メソッド
(IServerRecord インターフェース)
Function GetCopyRight : PChar;
このメソッドは著作権文字列を返します。
IServerRecord インターフェース
GetDescription メソッド
(IServerRecord インターフェース)
Function GetDescription : PChar;
このメソッドは説明文字列を返します。
IServerRecord インターフェース
GetExePath メソッド
(IServerRecord インターフェース)
Function GetExePath : PChar;
このメソッドはサーバーファイルへのパスを返します。
IServerRecord インターフェース
GetDate メソッド
(IServerRecord インターフェース)
Function GetDate : PChar;
このメソッドは、サーバーインストールファイルに関連付けられた日付文字列を返します。
IServerRecord インターフェース
GetGeneralInfo メソッド
(IServerRecord インターフェース)
Function GetGeneralInfo : PChar;
このメソッドは、サーバーに関連付けられたサーバーレコードの一般情報文字列を返します。
IServerRecord インターフェース
GetInsPath メソッド
(IServerRecord インターフェース)
Function GetInsPath : PChar;
このメソッドはインストールファイルへのパスを返します。
IServerRecord インターフェース
GetName メソッド
(IServerRecord インターフェース)
Function GetName : PChar;
このメソッドはサーバー名を返します。
IServerRecord インターフェース
GetPanelInfo メソッド
(IServerRecord インターフェース)
Function GetPanelInfo (Index : Integer) : IServerPanelInfo;
このメソッドは、指定されたインデックスのパネル情報を返します。これは GetPanelInfoCount メソッドと組み合わせて使用します。
IServerRecord インターフェース
GetPanelInfoByName メソッド
(IServerRecord インターフェース)
Function GetPanelInfoByName (Const Name : Widestring) : IServerPanelInfo;
このメソッドは、パネル名によってパネル情報インターフェースを返します。
IServerRecord インターフェース
GetPanelInfoCount メソッド
(IServerRecord インターフェース)
Function GetPanelInfoCount : Integer;
このメソッドは、サーバーモジュールで使用されるパネルの数を返します。これは GetPanelInfo メソッドと組み合わせて使用します。
IServerRecord インターフェース
GetRCSFilePath メソッド
(IServerRecord インターフェース)
Function GetRCSFilePath : PChar;
このメソッドはリソースファイルへのパスを返します。
IServerRecord インターフェース
GetSystemExtension メソッド
(IServerRecord インターフェース)
Function GetSystemExtension : LongBool;
このメソッドはファイルシステム拡張子文字列を返します。
IServerRecord インターフェース
GetVersion メソッド
(IServerRecord インターフェース)
Function GetVersion : PChar;
このメソッドは、サーバーインストールファイルに関連付けられたバージョン文字列を返します。
RecordCount := Client.GetServerRecordCount; For I := 0 to RecordCount - 1 Do Begin // obtain details of the DXP.INS file ServerRecord := Client.GetServerRecord(I); If ServerRecord.GetName = 'Client' Then Begin Version := ServerRecord.GetVersion; Break; End; End;
IServerRecord インターフェース
GetServerFileExist メソッド
(IServerRecord インターフェース)
Function GetServerFileExist : LongBool;
このメソッドは、サーバーファイル(DLL を持つ)が存在するかどうかの Boolean 値を返します。
IServerRecord インターフェース
GetWindowKind メソッド
(IServerRecord インターフェース)
Function GetWindowKind (Index : Integer) : IServerWindowKind;
このメソッドは IServerWindowKind インターフェースを返します。GetWindowKindCount 関数と組み合わせて使用します。
IServerRecord インターフェース
GetWindowKindCount メソッド
(IServerRecord インターフェース)
Function GetWindowKindCount : Integer;
このメソッドは、このサーバーがサポートするドキュメント種別の数を返します。
IServerRecord インターフェース
GetWindowKindByName メソッド
(IServerRecord インターフェース)
Function GetWindowKindByName(Name : PChar ) : IServerWindowKind
このメソッドは、DocumentKind Name パラメータに応じて IServerWindowKind インターフェースを返します。
IServerRecord インターフェース
IServerWindowKind インターフェース
IServerWindowKind インターフェース
この IServerWindowKind インターフェースは、Altium Designer における設計ドキュメントのタイプを通知するもので、IServerRecord および IClient インターフェースオブジェクトで使用される複合オブジェクトです
|
|
IClient インターフェース
IServerRecord インターフェース
IServerWindowKind のメソッド
FileLoadDescriptionCount メソッド
(IServerWindowKind インターフェース)
Function FileLoadDescriptionCount : Integer;
このメソッドは、サーバーのドキュメントエディタータイプに対する File Load Description の数を返します。ドキュメントエディターは複数のドキュメントタイプをサポートできるため、複数のロード機能を提供できます。
IClient インターフェース
IServerWindowKind インターフェース
FileSaveDescriptionCount メソッド
(IServerWindowKind インターフェース)
Function FileSaveDescriptionCount : Integer;
このメソッドは、ドキュメントエディターサーバーの File Save Description の数を返します。ドキュメントエディターは複数のドキュメントタイプを持つことができるため、それに対応する複数のファイル保存機能を持つことができます。
IClient インターフェース
IServerWindowKind インターフェース
GetFileLoadDescription メソッド
(IServerWindowKind インターフェース)
Function GetFileLoadDescription(Index : Integer) : Widestring;
このメソッドは、指定されたインデックスのファイルロード説明を返します。FileLoadDescriptionCount 関数と組み合わせて使用します。
IClient インターフェース
IServerWindowKind インターフェース
GetFileSaveDescription メソッド
(IServerWindowKind インターフェース)
Function GetFileSaveDescription(Index : Integer) : Widestring;
このメソッドは、指定されたインデックスのファイル保存説明を返します。FileSaveDescriptionCount 関数と組み合わせて使用します。
IClient インターフェース
IServerWindowKind インターフェース
GetIconName メソッド
(IServerWindowKind インターフェース)
Function GetIconName : Widestring;
このメソッドは、DXP 内のドキュメントのサーバーウィンドウに関連付けられたアイコン名を返します。
IClient インターフェース
IServerWindowKind インターフェース
GetIsDocumentEditor メソッド
(IServerWindowKind インターフェース)
Function GetIsDocumentEditor : Boolean;
このメソッドは、このサーバーがドキュメントエディターかどうかの Boolean 値を返します。アドオンはドキュメントエディターではありません。ドキュメントエディターは独自のドキュメントをホストし、編集機能を提供するサーバーです。たとえば PCB Editor は Document Editor です。
IClient インターフェース
IServerWindowKind インターフェース
GetIsDomain
(IServerWindowKind インターフェース)
Function GetIsDomain : LongBool;
このメソッドは、この Domain に対する Boolean 値を返します。通常は false です。
IClient インターフェース
IServerWindowKind インターフェース
GetName メソッド
(IServerWindowKind インターフェース)
Function GetName : Widestring;
ウィンドウ種別の名前を返します。
IClient インターフェース
IServerWindowKind インターフェース
GetNewWindowCaption メソッド
(IServerWIndowKind インターフェース)
Function GetWindowKindDescription : Widestring;
このメソッドは、Altium Designer 内のウィンドウについて、そのウィンドウ種別の説明文字列を返します。
IClient インターフェース
IServerWindowKind インターフェース
(IServerWindowKind インターフェース)
Function IsOfWindowKindClass(Const AClass : Widestring) : Boolean;
このメソッドは、クラス文字列がウィンドウ種別クラスの一部であるかどうかを示すブール値を返します。
IClient インターフェース
IServerWindowKind インターフェース
IServerSecurity インターフェース
IServerSecurity インターフェース階層は次のとおりです。
|
|
IServerSecurity メソッド
IsTechnologySetSupported メソッド
(IServerSecurity インターフェース)
Function IsTechnologySetSupported (Const ATechnologySet : Widestring) : Boolean;
IServerSecurity インターフェース
ITimerManager インターフェース
ITimerManager インターフェースは、タイマーオブジェクトを登録し、必要時にそれらを呼び出すことで、Altium Designer のタイミング機構を効率的に管理します。通常、Timer オブジェクトは動作するためにウィンドウを必要とし、WM_Timer メッセージに応答します。これは内部使用向けです。
|
|
ITimerHandler インターフェース
ITimerManager メソッド
AddHandler メソッド
(ITimerManager インターフェース)
Function AddHandler(Const AHandler : ITimerHandler; AInterval : Cardinal; AEnabled : Boolean = True) : DWord;
内部使用専用
ITimerIManager インターフェース
GetHandlerEnabled メソッド
(ITimerManager インターフェース)
Function GetHandlerEnabled(ID : DWord) : Boolean;
内部使用専用
ITimerManager インターフェース
RemoveHandler メソッド
(ITimerManager インターフェース)
Procedure RemoveHandler (ID : DWord);
内部使用専用
ITimerManager インターフェース
SetGlobalEnabled メソッド
(ITimerManager インターフェース)
Procedure SetGlobalEnabled (AEnabled : Boolean);
内部使用専用
ITimerManager インターフェース
SetHandlerEnabled メソッド
(ITimerManager インターフェース)
Procedure SetHandlerEnabled(ID : DWord; AEnabled : Boolean);
内部使用専用
ITimerManager インターフェース
ITimerHandler インターフェース
各タイマーオブジェクトは ITimerHandler インターフェースで表され、すべてのタイマーオブジェクトは ITimerManager インターフェースによって管理されます。
これは内部使用向けです。
|
|
ITimerManger インターフェース
ITimerHandler メソッド
HandleTimerEvent メソッド
(ITimerHandler インターフェース)
Procedure HandleTimerEvent(ID : DWord);
ITimerHandler インターフェース
ITranslationManager インターフェース
ITranslationManager インターフェースは、Altium Designer にインストールされたロケール言語を扱います。インストール可能なロケール言語は、中国語(簡体字)、日本語、ドイツ語、フランス語です。デフォルトのロケールは標準英語です。
|
|
ITranslationManager メソッド
GetTranslatedProperty メソッド
(ITranslationManager インターフェース)
Function GetTranslatedProperty(Const ComponentName, PropName : WideString; Out OutValue : WideString) : LongBool;
SetComponentToTranslate メソッド
(ITranslationManager インターフェース)
Procedure SetComponentToTranslate(Const ComponentName : WideString);
HasTranslationData メソッド
(ITranslationManager インターフェース)
Function HasTranslationData : LongBool;
列挙型は、このセクションで扱う多くのクライアント/サーバーのインターフェースおよびメソッドで使用されます。
TCommandProc 手続き型
TCommandProc = Procedure(Const AContext : IServerDocumentView; AParameters : PChar);
TDocumentsBarGrouping 型
TDocumentsBarGrouping = (dbgNone, dbgByDocKind, dbgByProject);
TGetStateProc 手続き型
TGetStateProc = Procedure(Const AContext : IServerDocumentView; AParameters : PChar; Var Enabled, Checked, Visible : LongBool; Caption, ImageFile : PChar);
THighlightMethod 型
THighlightMethod = (eHighlight_Filter,eHighlight_Zoom,eHighlight_Select,eHighlight_Graph,eHighlight_Dim,eHighlight_Thicken, eHighlight_ZoomCursor);
THighlightMethodSet 型
THighlightMethodSet = Set Of THighlightMethod;
TSnippetCreationMode 型
TSnippetCreationMode = (eSnippetCreationBySelection, eSnippetCreationByUnionIndex);
TServerModuleFactory 関数型
TServerModuleFactory = Function (Const AClient : IClient) : IServerModule;
一般定数
cDXPHomePage = 'DXP://Home';
cDXPProcess = 'DXPProcess';
cDXPDocument = 'DXPDoc';
cViewNameParam = 'ViewName';
cContextHelpDelimiter = '.';
{$IFDEF ALTIUMINTERNAL}
cWebUpdate_DefaultURL = 'http://intranet.altium.com.au/rd/AltiumDesigner6/Updates/';
{$ELSE}
cWebUpdate_DefaultURL = 'https://www.altium.com/webupdate/';
{$ENDIF}
cWebUpdate_DefaultNetworkPath = '';
cWebUpdate_DefaultUseNetworkPath = False;
cWebUpdate_DefaultCheckFrequency = wucfEveryDay;
cWebUpdate_CheckFrequencyNames : Array[TWebUpdate_CheckFrequency] Of AnsiString =
(
'しない',
'Altium Designer の起動時',
'毎日',
'3 日ごと',
'毎週',
'2 週間ごと',
'毎月');
DocumentNotification コード
cDocumentLoading = 0;
cDocumentOpening = 1;
cDocumentClosing = 2;
cDocumentActivating = 3;
cDocumentNameChanging = 4;
cDocumentCompiled = 6;
cDocumentCompiling = 7;
cDocumentBeforeClose = 8;
cDocumentProjectChanged = 9;
cDocumentSaved = 10;
cDocumentModifiedChanged = 11;
cDocumentHidden = 12;
cDocumentProjectActivating = 15;
cDocumentScrapCompiling = 16;
cDocumentScrapCompiled = 17;
cProjectClosing = 18;
cDocumentWorkspaceLoad_Begin = 101;
cDocumentWorkspaceLoad_End = 102;
cDocumentWorkspaceSave_Begin = 103;
cDocumentWorkspaceSave_End = 104;
cDocumentRouterStarted = 200;
cDocumentRouterStopped = 201;
cDocumentOwnershipChanged = 300;
View Notification コード
cDocumentDataInserted = 0;
cDocumentDataDeleted = 1;
cDocumentDataModified = 2;
cDocumentDataRefresh = 3;
cApplicationStartupComplete = 6;
cApplicationShutdownStarted = 7;
cLicenseDetailsChanged = 8;
cObjectNavigated = 150;
cGroupNavigated = 155;
cNavigationHistory = 160;
cRefreshNavigationPanels = 170;
cObjectCrossprobed = 180;
cGroupCrossprobed = 185;
cBeginRefreshNavigationPanels = 190;
Module Notification コード
cModuleLoaded = 0;
System Notification コード
cLibrariesUpdated = 0;
cSystemPreferencesChanged = 1;
cTextEditPreferencesChanged = 2;
cPCBPreferencesChanged = 3;
cSchPreferencesChanged = 4;
cSchPreferencesChangedWithUpdate = 5;
cCamtasticPreferencesChanged = 6;
cPCB3DPreferencesChanged = 7;
cVersionControlPreferencesChanged= 8;
cSchPreferencesChanged_UpdateStringsFont = 10;
cCustomDynamicHelpUpdated = 11;
Message notification コード
cMessagesAdd = 0;
cMessagesReplaceLast = 1;
cMessagesFullUpdate = 2;
cMessagesClearAll = 3;
Client 関数
Function Client : IClient;
Function Server : IServerModule;
Procedure SetClient (Const AClient : IClient);
Procedure SetServer (Const AServer : IServerModule);
Function CreateNewDocumentFromDocumentKind (Const DocumentKind : AnsiString) : IServerDocument;
Function CreateNewFreeDocumentFromDocumentKind(Const DocumentKind : AnsiString) : IServerDocument;
Function GetSceneManager : ISceneManager;
このセクションには、Altium Designer RTL の ClientAPIReg、RT_Util、RT_Param ユニットから得られたランタイムライブラリ情報が含まれており、スクリプトおよびサーバー開発に使用できます。
スケール係数表
T 10 12
G 10 9
M, Meg = 10 6
K 10 3
U 10 -6
N 10 -9
P 10 -12
F 10 -15
定数
cMeasureUnitSuffixes : Array[TMeasureUnit] Of TDynamicString = ('mil', 'mm', 'in', 'cm', 'dxp', 'm');
cMeasureUnitConvert : ArrayTMeasureUnit, TMeasureUnit Of Double =
(// mil mm in cm dxp m への変換
(1 , 2.54/100 , 1/1000 , 2.54/1000 , 1/10 , 2.54/100000), // mil から
(100/2.54 , 1 , 1/25.4 , 1/10 , 10/2.54 , 1/1000 ), // mm から
(1000 , 25.4 , 1 , 2.54 , 100 , 0.0254 ), // in から
(1000/2.54 , 10 , 1/2.54 , 1 , 100/2.54 , 1/100 ), // cm から
(10 , 2.54/10 , 1/100 , 2.54/100 , 1 , 2.54/10000 ), // dxp から
(100000/2.54, 1000 , 100/2.54, 100 , 10000/2.54, 1 ) // m から
);
cPaintColorModes : Array[TPaintColorMode] Of TDynamicString = ('FullColor', 'GrayScale', 'Monochrome');
CaseSensitive = True;
CaseInSensitive = False;
OrdNumOfZero = 48;
cDefThumbnailSizeX = 96;
cDefThumbnailSizeY = 72;
Delimiter : Set of char = 0,#39,',',' ',#10,#13,#9,'(',')';
StringDelimiter = #39;
cm_Share_Compat = $0;
cm_Share_DenyRW = $10;
cm_Share_DenyW = $20;
cm_Share_DenyR = $30;
cm_Share_DenyN = $40;
cm_Access_ReadOnly = $0;
cm_Access_WriteOnly = $1;
cm_Access_ReadWrite = $2;
cm_NoInheritance = $80; {子プロセスはファイルハンドルおよびモードを継承しない}
fe_NoAccessError = $0;
fe_FunctionInvalid = $1;
fe_FileNotFound = $2;
fe_PathNotFoundOrFileDoesntExist = $3;
fe_NoHandleIsAvalible = $4;
fe_AccessIsDenied = $5;
fe_FileAccessCodeInvalid = $C;
FileExtension_Temp = '$$$';
cPathSeparator = '\';
cBooleanStrings : Array[False..True] Of TString = ('False','True');
変換ルーチン
Function GetPrevSettings_Count : Integer;
Function GetPrevSettings_Name (AIndex : Integer) : TDynamicString;
Function GetPrevSettings_SpecialKey_SoftwareAltiumApp (AIndex : Integer) : TDynamicString;
Function GetPrevSettings_SpecialKey_SoftwareAltiumAppDXP (AIndex : Integer) : TDynamicString;
Function GetPrevSettings_SpecialFolder_AltiumApplicationData (AIndex : Integer) : TDynamicString;
Function ConvertMeasureUnits(Const AValue : Double; FromUnit, ToUnit : TMeasureUnit) : Double;
Function StripMeasureUnits(Var S : TDynamicString; Var Value : Double; Var UsedUnits : TMeasureUnit) : Boolean;
列挙型
TAltShiftCtrlCombination
TAltShiftCtrlCombination = TShiftState;
TBoolean
TBoolean = Boolean;
TBusKind
TBusKind = (eBusKindUndefined,eBusKindLowValueFirst,eBusKindHighValueFirst,eBusKindGeneric);
TByte
TByte = Byte;
TChar
TChar = Array[0..256] of Char;
Char 型は AnsiChar と等価です。Char の実装は変更される可能性があるため、異なるサイズの文字を扱う必要があるプログラムを作成する際には、固定値の定数ではなく標準関数 SizeOf を使用することを推奨します。TChar 型は PChar の代わりに使用できます。
Var
P : TChar;
Begin
lResult := GetModuleFileName(HInstance,P,255)
....
End;
TDate
TDate = Record
Year : Word;
Month : Word;
Day : Word;
End;
TDouble
TDouble = Double;
TDynamicString
TDynamicString = AnsiString;
TExtended
TExtended = Extended;
TFileFunction
(Altium Designer RTL の RT_FileUtil)
TFileFunction = Function(Path : TDynamicString) : Boolean Of Object;
THugeInt
THugeInt = Comp;
TMatchFileNameKind
TMatchFileNameKind = (eMatchByPath,eMatchByFileName);
TPaintColorMode
TPaintColorMode = (ePaintColorMode_FullColor, ePaintColorMode_GrayScale, ePaintColorMode_Monochrome);
TMeasureUnit
TMeasureUnit = (cUnitMil, cUnitMM, cUnitIN, cUnitCM, cUnitAltium Designer, cUnitM);
TPaintScaleMode
TPaintScaleMode = (psmScreen, psmDefault, psmPrint);
TReal
TReal = Single;
TString
TString = ShortString;
TTime
TTime = Record
Hours : Word;
Minutes : Word;
Seconds : Word;
MilliSeconds : Word;
End;
TNonRefCountedInterfaceObject
TNonRefCountedInterfacedObject = Class(TObject, IInterface)
Protected
FRefCount : Integer;
Function QueryInterface(Const IID: TGUID; Out Obj): HResult; StdCall;
Function _AddRef: Integer; StdCall;
Function _Release: Integer; StdCall;
End;
ダイアログ
ConfirmOkCancel
(RT_Util ユニット)
Function ConfirmOKCancel (S : TDynamicString) : Boolean;
ConfirmOkCancel 関数は、ダイアログのメッセージ本文としてパラメータ S を表示するダイアログを表示します。この関数は Boolean 値を返します。ボタンは「OK」と「Cancel」のため、OK ボタンを押した場合は true を返し、それ以外の場合は false を返します。
ConfirmNoYes、ShowError、ShowInfo、ShowWarning プロシージャ。
ConfirmOkCancelWithCaption
(RT_Util ユニット)
Function ConfirmOKCancelWithCaption (Caption, S : TDynamicString) : Boolean;
ConfirmOkCancelWithCaption 関数は、ダイアログのタイトルバーに Caption パラメータ、メッセージ本文に S パラメータを使用するダイアログを表示します。この関数は Boolean 値を返します。ボタンは「OK」と「Cancel」のため、OK ボタンを押した場合は true を返し、それ以外の場合は false を返します。
ConfirmNoYes、ShowError、ShowInfo、ShowWarning プロシージャ。
ConfirmNoYes
(ClientAPIReg ユニット)
Function ConfirmNoYes(Const S: String) : Boolean
このプロシージャは、YES ボタンと NO ボタンを持つメッセージダイアログを表示します。メッセージボックスのタイトルは "Confirm" です。Value パラメータは、Yes ボタンで True、No ボタンで False を返します。
ダイアログ
ConfirmNoYesCancel
(ClientAPIReg)
Function ConfirmNoYesCancel(Const S: String) : Integer
このプロシージャは、YES ボタン、NO ボタン、および Cancel ボタンを持つメッセージダイアログを表示します。メッセージボックスのタイトルは "Confirm" です。
Value パラメータは、どのボタンが押されたかを表す TModalResult 型(Borland Delphi で定義)の次のいずれかの値を返します。
ConfirmNoYes、ShowError、ShowInfo、ShowWarning プロシージャ。
ConfirmNoYesCancelWithCaption
Function ConfirmNoYesCancelWithCaption(Const Caption, S : TDynamicString) : Integer;
ConfirmNoYesCancelWithCaption 関数は、ダイアログのタイトルバーに Caption パラメータ、メッセージ本文に S パラメータを使用し、「Yes」「No」「Cancel」ボタンを持つダイアログを表示します。
この関数はモーダル値を返します。つまり、ユーザーが Cancel ボタンを選択した場合は IDCancel (2)、No ボタンを選択した場合は IDNo (7)、Yes ボタンを選択した場合は IDYES (6) が返されます。
ConfirmNoYes、ShowError、ShowInfo、ShowWarning プロシージャ。
ConfirmNoYesWithCaption
Function ConfirmNoYesWithCaption (Caption : TDynamicString; S : TDynamicString) : TBoolean;
ConfirmNoYesWithCaption 関数は、ダイアログのタイトルバーに Caption パラメータ、メッセージ本文に S パラメータを使用し、「Yes」と「No」ボタンを持つダイアログを表示します。
この関数はモーダル値を返します。つまり、ユーザーが No ボタンを選択した場合は False、Yes ボタンを選択した場合は True が返されます。
ConfirmNoYes、ShowError、ShowInfo、ShowWarning プロシージャ。
SortedListBoxCompare
(Altium Designer RTL の IRT_Util ユニット)
Function SortedListBoxCompare(Const S1, S2 : AnsiString) : Integer;
この関数には、リストを英数字順に並べ替える内部ソートルーチンがあります。Delphi のソートでは、数値順またはアルファベット順の並べ替えしかできません。TStringList または Delphi の同等の文字列リストに対して CustomSort ルーチンを呼び出し、この関数をその CustomSort ルーチンに渡す必要があります。
DisplayNotImplementedMessage
(Altium Designer RTL の RT_Util ユニット)
Procedure DisplayNotImplementedMessage(ProcessId,ProcessDescription : TDynamicString);
このプロシージャは、サーバープロジェクト向けに、サーバープロセスが実装されていないことを示すメッセージダイアログを表示します。これはサーバープロジェクトの commands ユニットで使用されます。
ShowInfo および ShowWarning プロシージャ。
RunNetworkConnectionDialog
(Altium Designer RTL の Rt_Util)
Procedure RunNetWorkPrintersDialog(HWindow : Hwnd);
このプロシージャは、Altium Designer 内の現在のダイアログまたはウィンドウのハンドルを使用して、Network Printers ダイアログを呼び出します。
RunNetworkPrintersDialog
(Altium Designer RTL の Rt_Util)
Procedure RunNetWorkConnectionDialog(HWindow : Hwnd);
このプロシージャは、ALTIUM DESIGNER 内の現在のダイアログまたはウィンドウのハンドルを使用して、Network Connection ダイアログを呼び出します。
RunOpenDocumentDialog
(Altium Designer RTL の RT_Util)
Function RunOpenDocumentDialog (Caption : TDynamicString; MultiSelect : Boolean; Var Path, SelectedType, Editor : TDynamicString; Const FileTypes, Files : TStrings) : Boolean;
この関数は、クライアントの RunCommonDialog プロセスに基づいています。Caption パラメータはダイアログのタイトルに使用されます。MultiSelect パラメータが True の場合、ダイアログから複数のファイルを選択できます。1 つのファイルのみを選択したい場合は False を使用します。Path、SelectedType、Editor パラメータは、ダイアログが閉じた後に返されます。FileTypes と Files パラメータは、Common Dialog で開くことができるファイルタイプとファイルを決定します。
ShowError
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure ShowError(Const S: String);
このプロシージャは、OK ボタンと警告アイコンを含むエラーダイアログを表示します。
ShowInfo および ShowWarning プロシージャ。
ShowError_SystemModal
(Altium Designer RTL の RT_Util ユニット)
Procedure ShowError_SystemModal(Const S : TDynamicString);
ShowError_SystemModal プロシージャは、エラー記号とテキスト S を表示する独立したダイアログを表示します。このダイアログは Altium Designer のウィンドウハンドルを持たないため、Windows デスクトップのタスクバーに表示されます。
ShowInfo
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure ShowInfo(Const S: String);
このプロシージャは、OK ボタンと情報アイコンを含む情報ダイアログを表示します。
ShowError および ShowWarning プロシージャ。
ShowInfoWithCaption
Procedure ShowInfoWithCaption (Caption,S : TDynamicString);
情報アイコンを表示し、ダイアログのタイトルバーに Caption パラメータ、メッセージ本文に S パラメータを使用するダイアログを表示します。
ShowError および ShowWarning プロシージャ。
ShowWarning
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure ShowWarning(Const S: String);
このプロシージャは、OK ボタンと警告アイコンを含む警告ダイアログを表示します。
ShowError および ShowInfo プロシージャ。
ファイル入出力
AddBackSlashToFrontAndBack
(RT_Util ユニット)
Function AddBackSlashToFrontAndBack(S: TDynamicString) : TDynamicString;
AddBackSlashToFrontAndBack 関数は、文字列の先頭と末尾にパス区切り文字を追加します。たとえば S 文字列が空の場合、追加されるバックスラッシュは 1 つだけです。それ以外の場合は、S 文字列の先頭と末尾にバックスラッシュが追加されます。
CheckAgainstWildCard_CaseSensitive
(RT_Util ユニット)
Function CheckAgainstWildCard_CaseSensitive(WildCard,Name : TDynamicString)
CheckAgainstWildCard_CaseSensitive 関数では、ワイルドカードを含む Wildcard 文字列と Name 文字列を比較できます。大文字と小文字を含めることができる Wildcard 文字列を使用して、Name 文字列が Wildcard 文字列で記述された形式に一致するかどうかを判定します。ワイルドカード文字列には、任意の文字に一致するワイルドカードや、Name 文字列に含まれる 1 文字に一致する集合を含めることができます。
CheckAgainstWildCard
(RT_Util unit)
Function CheckAgainstWildCard (WildCard,Name : TDynamicString)
CheckAgainstWildCard 関数は、ワイルドカードを含む Wildcard 文字列と Name 文字列を比較できます。Wildcard 文字列を使用して、Name 文字列が Wildcard 文字列で記述された形式に一致するかどうかを判定します。ワイルドカード文字列には、任意の文字に一致するワイルドカードや、Name 文字列に含まれる単一文字に一致する文字集合を含めることができます。この関数は大文字と小文字を区別しません。
ComputerName
(RT_Util unit)
Function ComputerName : ShortString
ComputerName 関数は、現在のシステムのコンピューター名を取得します。この名前はシステム起動時にレジストリから初期化され、設定されます。
ConvertDiskSizeToString
(RT_Util unit)
Function ConvertDiskSizeToString (Size : Integer) : TDynamicString;
ConvertDiskSizeToString 関数は、数値をストレージ容量を表す文字列に変換します。たとえば、Size = 345 の場合、この関数は '345 Bytes' という文字列を返します。
ConvertFIleNameToExeSystemFileName
(RT_FileUtil in Altium Designer RTL)
Function ConvertFileNameToExeSystemFileName(S : TString) : TString;
ConvertFileNameToExeSystemFileName ルーチンは、ファイル名を更新し、filename パラメーターとともに Altium\System フォルダーへのフルパスを含めます。例: 'C:\Program Files\Altium\System\ServerA.exe'
ConvertPartialPathToExeFileName
(RT_FileUnit from Altium Designer RTL)
Function ConvertPartialPathToExeFileName(S : TString) : TString;
ConvertPartialPathToExeFileName ルーチンは、ファイル名を更新し、filename パラメーターとともに Altium\System フォルダーへのフルパスを含めます。例: 'C:\Program Files\Altium\System\ServerA.exe'
CurrentModuleName
(RT_FileUtil)
Function CurrentModuleName : TString;
CurrentModuleName 関数は、指定したモジュールを含む実行ファイルまたは動的ライブラリのリンクファイルについて、フルパスとファイル名を取得します。
DocumentIsReadOnly
(RT_Util unit)
Function DocumentIsReadOnly (FullPath : TDynamicString) : Boolean;
DocumentIsReadOnly 関数は、設計ドキュメントファイルの読み取り専用属性が true に設定されている場合に True を返します。
If DocumentIsReadOnly(Document.FileName) Then
Begin
ShowError(ExtractFileName(Document.FileName)
+ ' is read-only.');
Exit;
End;
ExtractFilename 関数
ExistAnyWhere
(RT_FileUtil)
Function ExistAnyWhere(Var S : TDynamicString) : TBoolean; Overload;
Function ExistAnyWhere(Var S : TString ) : TBoolean; Overload;
ExistAnyWhere 関数は、ファイルが存在するかどうかを示す TBoolean 値を返します。S パラメーターは TDynamicString 型であることに注意してください。
// Remove the .SchLib file because it is no longer needed SchLibFileName := GetProjectLibraryPath; If ExistAnyWhere(SchLibFileName) Then Begin Project.DM_RemoveSourceDocument(SchLibFileName); Document := Client.GetDocumentByPath(SchLibFileName); If Document <> Nil Then Document.ReleaseFileOwnership; DeleteFile(SchLibFileName); End;
ExistAnyWhereAsTemplate 関数
ExistAnyWhereAsTemplate
(RT_FileUtil in Altium Designer RTL)
Function ExistAnyWhereAsTemplate(Var S : TDynamicString) : TBoolean;
ファイル名を含む S パラメーターが、次のフォルダー内に存在するかどうかを確認します。
SpecialFolder_DesignTemplates,
SpecialFolder_AltiumSystemTemplates,
SpecialFolder_TemplatesForAllUsers, または
SpecialFolder_CommonDocumentTemplates。
If Not ExistAnywhere(MacroFileName) then Exit;
ExistAnyWhere 関数。
ExpandFile
(RT_Util unit)
Function ExpandFile (S : TDynamicString) : TDynamicString;
ExpandFile 関数は、現在のドライブおよびディレクトリを補完して、相対ファイル名を完全修飾パス名に変換します。完全修飾パス名には、ドライブ文字、任意のディレクトリおよびサブディレクトリに加えて、ファイル名と拡張子が含まれます。
ExpandFileName 関数は、変換結果の完全修飾パス名が実在するファイルを参照しているか、あるいはそのパス自体が存在するかを検証しません。
ShowMessage(ExpandFileName('autoexec.bat'));
ExtractFilename 関数
FileExists 関数
FindFileAnyWhere
(RT_FileUtil)
Function FindFileAnyWhere(Var Path : TDynamicString) : TBoolean; Overload;
この FindFileAnywhere は、ファイルがそのパスまたは他の場所に存在するかどうかを確認します。ファイルが見つかった場合は 'True' を返し、見つからない場合は 'False' を返します。
FileExists
(RT_Util unit)
Function FileExists(const FileName: string): Boolean;
FileExists 関数は、FileName で指定されたファイルが存在する場合に True を返します。ファイルが存在しない場合、FileExists は False を返します。
Function OpenProject(ProjectName : String) : Boolean; Begin Result := True; If Not FileExists(ProjectName) Then Result := False; ResetParameters; AddStringParameter('ObjectKind','Project'); AddStringParameter('FileName', ProjectName); RunProcess('WorkspaceManager:OpenObject'); End;
GetFreeDiskSpaceString
(RT_Util unit)
Function GetFreeDiskSpaceString(DiskNumber : Integer) : TDynamicString;
GetFreeDiskSpaceString 関数は、指定されたドライブ番号上の空きバイト数を表す TDynamicString 値を返します。
GetDiskSizeString
(RT_Util)
Function GetDiskSizeString (DiskNumber : Integer) : TDynamicString;
GetDiskSizeString 関数は、指定されたドライブのサイズをバイト単位で表す TDynamicString 値を返します。
GetDiskFree
(RT_Util)
Function GetDiskFree(Drive: Byte): Double;
GetDiskFree 関数は、ディスク上の空き容量を示す double 値を返します。Drive 値(Byte 値)はドライブ文字を表します。A ドライブ = 0、B ドライブ = 1 などです。
GetMacroDescription
(RT_FileUtil)
Function GetMacroDescription(MacroFileName : TString) : TString;
GetMacroDescription は、マクロスクリプト内で '$SUMMARY' または '$Description' 識別子を見つけた場合に文字列を返します。
HasExtension
(RT_Util)
Function HasExtension(Const Name : TDynamicString; Var DotPos : Integer) : TBoolean;
この関数は、ドット文字を検索して Name パラメーターに拡張子があるかどうかを確認します。ドット文字が見つかった場合、変数パラメーター DotPos のインデックスが返されます。無効な文字は '\' と ':' であり、これらが Name パラメーター内に存在する場合、この関数は false を返すことに注意してください。
IsFullPathToExistingFile
(RT_Util)
Function IsFullPathToExistingFile(FullPath : TDynamicString) : Boolean;
この関数は、既存ファイルへのファイル名を含むパスが存在する場合に True を返します。ファイル名のみを含むパスと区別するために使用します。
IsFullPathToExistingStructuredStorage 関数
IsFullPathToExistingStructuredStorage function
(RT_Util)
Function IsFullPathToExistingStructuredStorage(Const FullPath : TDynamicString) : Boolean;
この関数は、特定のディスクファイルにストレージオブジェクトが含まれているかどうかを示します。既存の structured storage へのファイル名を含むパスが存在する場合、この関数は True を返します。
If IsFullPathToExistingStructuredStorage(GetFileName) Then Result := fmShareDenyNone Else Result := Inherited GetFileShareMode;
IsFullPathToExistingFile 関数
IsPathRelative
(RT_FileUtil)
Function IsPathRelative(Path : TString) : Boolean;
IsPathRelative 関数は、その文字列が完全な絶対パスではなく相対パスを含んでいるかどうかを確認します。
If IsPathRelative(FileName) Then Begin If Not DirectoryExists(FRootPath) Then Exit; S := GetCurrentDir; If Not SetCurrentDir(FRootPath) Then Exit; Try AbsolutePath := ExpandFileName(FileName); Finally SetCurrentDir(S); End; End Else AbsolutePath := FileName;
ExpandFilename 関数
LowLevelRunTextEditorWithFile
(RT_Util unit)
Procedure LowLevelRunTextEditorWithFile (S : TDynamicString);
この関数は Microsoft Windows の NotePad アプリケーションを起動し、S パラメーターで指定されたファイルを開こうとします。
RunCommand procedure。
ProcessAllFilesOnPath
(Rt_FileUtil)
Procedure ProcessAllFilesOnPath(Filter : TDynamicString;
FileFunction : TFileFunction;
AbsolutePath : TDynamicString;
IncludeSubFolders : Boolean = True);
この関数は、指定された AbsolutePath および Filter パラメーターに一致するすべてのファイルを返します。通常、Absolute path 上のすべてのファイルを取得するには、この '
ProcessAllFilesOnPath('*',ArchiveItems_CreateAnyDirectoryFile,AFullPath,True);
TFileFunction 型
ValidDosFileName
(RT_FileUtil)
Function ValidDosFileName(FileName : TSTring) : TBoolean;
ValidDosFileName は、ファイル名文字列が有効な DOS ファイル名かどうかを示す TBoolean 値を返します。有効な DOS ファイル名には、次の文字を含めてはなりません ('*','?',' ','"','/',';' ,'|',',', '=')。また、ファイル名文字列全体で '.' ピリオド文字は 1 つだけでなければなりません。
Filename := ForceFileNameExtension(Board.FileName, ReportFileExtension); If GetState_ParameterUpperCaseString(Parameters, 'Filename', S) Then If (ValidDosFileName(S)) then Filename := S;
ForceFileNameExtension 関数
Number Manipulation Routines
GetBinaryStringFromInteger
Function GetBinaryStringFromInteger(L : Integer ) : TDynamicString;
GetBinaryStringFromInteger 関数は、整数を 2 進文字列(最大 32 文字)に変換します。整数は 4 バイト = 32 ビットです。
ExtendedToEng
(RT_Util unit)
Function ExtendedToEng (Const ExtVal : Extended) : String;
ExtendedToEng 関数は、Value で与えられた浮動小数点値をその文字列表現に変換します。
ShowInfo(ExtendedToEng(4.32e18)); //4.320e18
数値操作ルーチン
EngToExtended
(RT_Util unit)
Function EngToExtended (Const EngString : String) : Extended;
EngToExtended 関数は、EngString で与えられた文字列値を extended 表現に変換します。この関数は文字列の最後の文字を調べ、それに応じて変換を行います。詳細は以下のスケール係数表を参照してください。たとえば '3Meg' は 3M として変換されます。
数値操作ルーチン
GetHexStringFromInteger
(RT_Util unit)
Function GetHexStringFromInteger (L : Integer) : TDynamicString;
GetHexStringFromInteger は、word を 16 進文字列(最大 8 文字)に変換します。16 進数は 16 個の数字を使用する基数 16 の体系です。1 バイトは 2 桁の 16 進数字に相当します。これは各 16 進数字が 4 桁の 2 進数字に対応するためで、したがって 4 バイトは 8 桁の 16 進数字に相当します。
数値操作ルーチン
HexToInteger
(RT_Util unit)
Function HexToInteger(Const S : TDynamicString) : Integer;
16 進数の値(文字列値)を Integer 値に変換します。
数値操作ルーチン
(RT_Util unit)
Function IntegerToHex(L : Integer) : TDynamicString;
整数値を 16 進数値に変換します。
数値操作ルーチン
IntMax
(RT_Util unit)
Function IntMax(x,y : Integer) : Integer;
IntMax 関数は、X と Y の integer 型のうち大きい値を返します。
数値操作ルーチン
IntMin
(RT_Util unit)
Function IntMin(x,y : Integer) : Integer;
IntMin 関数は、X と Y の integer 型のうち小さい値を返します。
数値操作ルーチン
IntSwap
(RT_Util unit)
Procedure IntSwap(Var a,b : Integer);
IntSwap プロシージャは、A と B の値を入れ替えます。たとえば A = 2、B = 5 の場合、これらの値を IntSwap プロシージャに渡した後、新しい値は a = 5、b = 2 になります。
数値操作ルーチン
Other Routines
AltKeyDown
(ClientAPIReg unit)
Function AltKeyDown: Integer;
この関数は ALT キーの状態を示す値を返します。つまり、ALT キーが押されている場合は 1、そうでない場合は 0 を返します。
その他のルーチン
BeginHourGlass
(ClientAPIReg unit)
Procedure BeginHourGlass(ACursor : TCursor = crHourGlass);
BeginHourGlass プロシージャは、システムがビジー状態であることを示すために、カーソルを Hour Glass に変更します。
EndHourGlass procedure
SetCursorBusy procedure
その他のルーチン
CheckActiveServer
(ClientAPIReg unit in Altium Designer RTL)
Function CheckActiveServer(Const AServerName, AServerCaption: String; AWithDialog: Boolean): Boolean;
この関数は、指定されたドキュメントのサーバーがアクティブかどうかを確認します。
その他のルーチン
ControlKeyDown
(ClientAPIReg unit)
Function ControlKeyDown: Integer;
ControlKeyDown 関数は CONTROL キーの状態を示す値を返します。つまり、CONTROL キーが押されている場合は 1、そうでない場合は 0 を返します。
AltKeyDown および ShiftKeyDown 関数。
その他のルーチン
BeginHourGlass
(ClientAPIReg unit)
Procedure BeginHourGlass(ACursor : TCursor = crHourGlass);
EndHourGlass プロシージャは、カーソルを Hour Glass カーソルからデフォルトのポインティングカーソルに戻します。
BeginHourGlass procedure
SetCursorBusy procedure
その他のルーチン
EscKeyDown
(ClientAPIReg unit)
Function EscKeyDown: Integer;
EscKeyDown 関数は ESCAPE キーの状態を示す値を返します。つまり、ESCAPE キーが押されている場合は 1、そうでない場合は 0 を返します。
AltKeyDown および ShiftKeyDown 関数。
その他のルーチン
GetActiveServerName function
(ClientAPIReg unit)
Function GetActiveServerName:String;
GetActiveServerName 関数は、現在 Altium Designer でアクティブなサーバーモジュールの名前を返します。
その他のルーチン
GetCurrentWindowHandle
(ClientAPIReg unit)
Procedure GetCurrentWindowHandle(Var Value: HWND);
このプロシージャは、現在 Altium Designer でアクティブなウィンドウのウィンドウハンドルを表す HWND 値を返します。
その他のルーチン
GetCurrentDocumentFileName
(ClientAPIReg unit)
Function GetCurrentDocumentFileName : String;
GetCurrentDocumentFileName は、DXP で現在フォーカスされているドキュメントのファイル名を取得します。
SaveCurrentDocument function.
その他のルーチン
GetErrorMessage
(ClientAPIReg unit)
Function GetErrorMessage(Const ErrorNumber : Integer) : String;
GetErrorMessage 関数は、指定されたオペレーティングシステムのエラーコードに対応するエラーメッセージ文字列を返します。
その他のルーチン
RunApplication
(ClientAPIReg unit)
Function RunApplication(Const CommandLine : String) : Integer;
RunApplication 関数は、Altium Designer 環境の外部でアプリケーションプログラムを実行します。実行したいアプリケーションについて、ファイル名を含むフルパスを指定する必要があります。
CommandLine := 'notepad.exe' + NameOfTextFile;
ErrorCode := RunApplication(CommandLine);
If ErrorCode <> 0 Then
ShowError('System cannot start : ' + CommandLine + #13#10 + GetErrorMessage(ErrorCode));
その他のルーチン
ResetCursor
(ClientAPIReg unit in Altium Designer RTL)
Procedure ResetCursor;
ResetCursor は、カーソルをデフォルトの矢印カーソルに戻します。
SetCursorBusy
その他のルーチン
RunCommand
(RT_API unit and RT_Util)
Procedure RunCommand (Const IdString : TDynamicString; Const SpecialParameter : TDynamicString);
このプロシージャは、パラメーター付きでサーバープロセスを実行します。IdString パラメーターは servername:serverprocessname を示します。SpecialParameter パラメーターは、| パイプ記号で区切られた parametername=parametervalue ブロックを示します。
この RunCommand 関数は、Altium Designer のスクリプトシステムでは適切にサポートされていません。
RunCommand('Client:SetupPreferences', 'Server=PCB\|PageName=Models'); RunCommand('WorkspaceManager:Configure','ObjectKind=MessageView\|Action=ClearAll'); RunCommand('PCB:BoardInformation',''); RunCommand('PCB:Zoom','Action=Redraw');
RunSystemCommand
RunSystemCommand
(RT_Util unit)
Function RunSystemCommand(Const S : TDynamicString) : TBoolean;
RunSystemCommand 関数は、パラメーター文字列 S で指定されたアプリケーションを実行します。
RunSystemCommand('NotePad.Exe ' + S);
RunCommand procedure.
RunSystemCommandInSystemDirectory
(RT_Util unit)
Function RunSystemCommandInSystemDirectory(Const S : TDynamicString) : TBoolean;
RunSystemCommandInSystemDirectory 関数は、Windows ディレクトリ内で指定されたアプリケーションを実行します。アプリケーションのファイル名は文字列 S で指定されます。
RunSystemCommandInSystemDirectory('Notepad.Exe');
RunCommand procedure
RunSystemCommand procedure
SaveCurrentDocument
(ClientAPIReg unit)
Function SaveCurrentDocument : Boolean;
SaveCurrentDocument 関数は、現在のドキュメントを保存できるかどうかを判定します。
その他のルーチン
SetCursorBusy
(ClientAPIReg unit)
Procedure SetCursorBusy;
SetCursorBusy は、システムがビジー状態であることを示すために、カーソルをデフォルトのビジーカーソルに更新します。このプロシージャは、スクリプト内の時間のかかるループの前に設定できます。
ResetCursor
その他のルーチン
ShiftKeyDown
(ClientAPIReg unit)
Function ShiftKeyDown: Integer;
ShiftKeyDown 関数は SHIFT キーの状態を示す値を返します。つまり、SHIFT キーが押されている場合は 1、そうでない場合は 0 を返します。
AltKeyDown および ControlKeyDown 関数。
その他のルーチン
Special Folder Path Strings
Special Folder Paths セクションは、Altium Designer RTL の RT_Util unit で定義されています。
ClientAPI_SpecialFolder_AltiumAllUserApplicationData
(ClientProcs unit)
Function ClientAPI_SpecialFolder_AltiumAllUserApplicationData : WideString;
この関数は、特別フォルダーへのフルパスを返します。
{color:#800000}ShowMessage( {color:#800000}ClientAPI_SpecialFolder_AltiumAllUserApplicationData); //C:\Documents and Settings\All Users\Application Data\AltiumDesigner
Special Folder Paths
ClientAPI_SpecialFolder_AltiumApplicationData
(ClientProcs unit)
Function ClientAPI_SpecialFolder_AltiumApplicationData : WideString;
この関数は、特別フォルダーへのフルパスを返します。
{color:#800000}ShowMessage( {color:#800000}Clien {color:#800000}tAPI_SpecialFolder_Altium {color:#800000}ApplicationData); //C:\Documents and Settings\*UserName*\Application Data\AltiumDesigner
Special Folder Paths
ClientAPI_SpecialFolder_AltiumLocalApplicationData
(ClientProcs unit in Altium Designer RTL)
Function ClientAPI_SpecialFolder_AltiumLocalApplicationData : WideString;
この関数は、特別フォルダーへのフルパスを返します。
{color:#800000}ShowMessage( {color:#800000}ClientAPI_SpecialFolder_AltiumLocalApplicationData); //C:\Documents and Settings\*UserName*\Local settings\Application Data\AltiumDesigner
Special Folder Paths
SpecialFolder_AdminTools
(RT_Util unit)
Function SpecialFolder_AdminTools : TDynamicString;
この関数は、All User Application Data フォルダーへのパスを返します。
Special Folder Paths
SpecialFolder_AllUserAdminTools
(RT_Util unit)
Function SpecialFolder_AllUserAdminTools : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools フォルダーへのパスを返します。
Special Folder Paths
SpecialFolder_AllUserDesktop
(RT_Util unit)
Function SpecialFolder_AllUserDesktop : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Desktop フォルダーへのパスを返します。
Special Folder Paths
SpecialFolder_AllUserDocuments
(RT_Util unit)
Function SpecialFolder_AllUserDocuments : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Desktop フォルダーへのパスを返します。
Special Folder Paths
SpecialFolder_AltiumLibraryIntegrated
(RT_Util unit)
Function SpecialFolder_AltiumLibraryIntegrated : TDynamicString;
この関数は、Altium Integrated Library フォルダーへのパスを返します。例: C:\Program Files\Altium\Library\
Special Folder Paths
SpecialFolder_AltiumLibraryPld
(RT_Util unit)
Function SpecialFolder_AltiumLibraryPld : TDynamicString;
この関数は、Altium PLD Library フォルダーへのパスを返します。例: C:\Program Files\Altium\Library\Pld\
Special Folder Paths
SpecialFolder_AltiumLibrary
(RT_Util unit)
Function SpecialFolder_AltiumLibrary : TDynamicString;
この関数は、Altium Library フォルダーへのパスを返します。例: C:\Program Files\Altium Designer\Library\
Special Folder Paths
SpecialFolder_AltiumApplicationData
(RT_Util unit)
Function SpecialFolder_AltiumApplicationData : TDynamicString;
この関数は、Altium User Application Data フォルダーへのパスを返します。例: C:\Documents and Settings\UserName\Application Data\Altium
Special Folder Paths
SpecialFolder_AltiumAllUserApplicationData
(RT_Util unit)
Function SpecialFolder_AltiumAllUserApplicationData : TDynamicString;
この関数は、Altium All User Application Data フォルダーへのパスを返します。例: C:\Documents and Settings\All Users\Application Data\Altium
Special Folder Paths
SpecialFolder_AltiumDesignExplorer
(RT_Util unit)
Function SpecialFolder_AltiumDesignExplorer : TDynamicString;
この関数は、Altium フォルダーへのパスを返します。例: C:\Program Files\Altium\
Special Folder Paths
SpecialFolder_AltiumLocalApplicationData
(RT_Util unit)
Function SpecialFolder_AltiumLocalApplicationData : TDynamicString;
この関数は、Altium Local Application Data フォルダーへのパスを返します。例: C:\Documents and Settings\UserName\My Documents\My Designs
Special Folder Paths
SpecialFolder_AltiumSystem
(RT_Util unit)
Function SpecialFolder_AltiumSystem : TDynamicString;
この関数は、Altium の system フォルダーへのパスを返します。例: C:\Program Files\Altium\System\
Special Folder Paths
SpecialFolder_AltiumSystemTasksPages
(RT_Util unit)
Function SpecialFolder_AltiumSystemTasksPages : TDynamicString;
この関数は、Altium の system tasks pages フォルダーへのパスを返します。例: C:\Program Files\Altium\System\
Special Folder Paths
SpecialFolder_AltiumSystemTemplates
(RT_Util unit)
Function SpecialFolder_AltiumSystemTemplates : TDynamicString;
この関数は、Altium の System Templates フォルダーへのパスを返します。例: C:\Program Files\Altium\System\Templates\
Special Folder Paths
SpecialFolder_AllApplicationData
(RT_Util unit)
Function SpecialFolder_AllUserApplicationData : TDynamicString;
この関数は、C:\Documents and settings\All Users\Application Data フォルダーへのパスを返します。
Special Folder Paths
SpecialFolder_AltiumTaskingApplicationData
(RT_Util unit)
Function SpecialFolder_AltiumTaskingApplicationData : TDynamicString;
この関数は、Altium Tasking application data フォルダーへのパスを返します。例: C:\Documents and Settings\UserName\Application Data\Altium Designer\Tasking.
Special Folder Paths
SpecialFolder_AltiumSecurityAllUserApplicationData
(RT_Util unit)
Function SpecialFolder_AltiumSecurityAllUserApplicationData : TDynamicString;
この関数は、Altium Security All User Application Data フォルダーへのパスを返します。例: C:\Documents and Settings\UserName\Application Data\AltiumDesignerSecurity\.
Special Folder Paths
SpecialFolder_AltiumSystemResources
(RT_Util unit)
Function SpecialFolder_AltiumSystemResources : TDynamicString;
この関数は、Altium System Resources フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\Resources です。
特殊フォルダーパス
SpecialFolder_AltiumSystemDesktopLayouts
(RT_Util unit)
Function SpecialFolder_AltiumSystemDesktopsLayouts : TDynamicString;
この関数は、Altium Device Images フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_AltiumHelp
(RT_Util unit)
Function SpecialFolder_AltiumHelp : TDynamicString;
この関数は、Altium Help フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\Help\ です。
特殊フォルダーパス
SpecialFolder_AltiumLocalResources
(RT_Util unit)
Function SpecialFolder_AltiumLocalResources : TDynamicString;
この関数は、Altium Local resources フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer \System\. です。
特殊フォルダーパス
SpecialFolder_AltiumLocalHelp
(RT_Util unit)
Function SpecialFolder_AltiumLocalHelp : TDynamicString;
この関数は、Altium Local help フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\Help\. です。
特殊フォルダーパス
SpecialFolder_AltiumScripts
(RT_Util unit)
Function SpecialFolder_AltiumScripts : TDynamicString;
この関数は、Altium Scripts フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\Scripts\. です。
特殊フォルダーパス
SpecialFolder_AltiumSystemButtons
(RT_Util unit)
Function SpecialFolder_AltiumSystemButtons : TDynamicString;
この関数は、Altium System Buttons フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\Buttons\. です。
特殊フォルダーパス
SpecialFolder_AltiumSystemDocumentImages
(RT_Util unit)
Function SpecialFolder_AltiumSystemDocumentImages : TDynamicString;
この関数は、Altium System Document Images フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\DocumentImages\. です。
特殊フォルダーパス
SpecialFolder_AltiumSystemNavImages
(RT_Util unit)
Function SpecialFolder_AltiumSystemNavImages : TDynamicString;
この関数は、Altium System Nav Images フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\NavImages\. です。
特殊フォルダーパス
SpecialFolder_AltiumSystemNavPages
(RT_Util unit)
Function SpecialFolder_AltiumSystemNavPages : TDynamicString;
この関数は、Altium System Nav Pages フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\System\NavPages. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVHDL87
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVHDL87 : TDynamicString;
この関数は、Altium Library VHDL 87 フォルダーのパスを返します。たとえば C:\Program Files\Altium Designer\Library\VHDL\IEEE87\. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVHDL93
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVHDL93 : TDynamicString;
この関数は、Altium Library VHDL93 フォルダーのパスを返します。たとえば C:\program files\Altium Designer\library\VHDL\IEEE93\. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVerificVHDL87
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVerificVHDL87 : TDynamicString;
この関数は、Altium Library Verific VHDL87 フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\VHDL\VHDL87\. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVerificVHDL93
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVerificVHDL93 : TDynamicString;
この関数は、Altium Library Verific VHDL93 フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\VHDL\VHDL93\. です。
特殊フォルダーパス
SpecialFolder_AltiumSynthesis
(RT_Util unit)
Function SpecialFolder_AltiumSynthesis : TDynamicString;
この関数は、Altium Synthesis フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\VHDL_LIB\ です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryEDIF
(RT_Util unit)
Function SpecialFolder_AltiumLibraryEDIF : TDynamicString;
この関数は、Altium Library EDIF フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\EDIF\. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVHDL
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVHDL : TDynamicString;
この関数は、Altium Library VHDL フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\VHDL\. です。
特殊フォルダーパス
SpecialFolder_AltiumLibraryVHDLModels
(RT_Util unit)
Function SpecialFolder_AltiumLibraryVHDLModels : TDynamicString;
この関数は、Altium Library VHDL Models フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\VHDL\Models\. です。
特殊フォルダーパス
AltiumLibraryLMF
(RT_Util unit)
Function SpecialFolder_AltiumLibraryLMF : TDynamicString;
この関数は、Altium Library LMF フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\EDIF\. です。
特殊フォルダーパス
SpecialFolder_AltiumConstraintFiles
(RT_Util unit)
Function SpecialFolder_AltiumConstraintFiles : TDynamicString;
この関数は、Altium Constraint Files フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\FPGA\. です。
特殊フォルダーパス
SpecialFolder_AltiumDeviceConstraintFiles
(RT_Util unit)
Function SpecialFolder_AltiumDeviceConstraintFiles : TDynamicString;
この関数は、FPGA Device Constraint Files フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\FPGA\DeviceConstraintFiles. です。
特殊フォルダーパス
SpecialFolder_AltiumDeviceImages
(RT_Util unit)
Function SpecialFolder_AltiumDeviceImages : TDynamicString;
この関数は、Altium Device Images フォルダーのパスを返します。たとえば c:\program files\Altium Designer\library\deviceimages\. です。
特殊フォルダーパス
SpecialFolder_ApplicationData
(RT_Util unit)
Function SpecialFolder_ApplicationData : TDynamicString;
この関数は、C:\Documents and settings\UserName\Application Data フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_CommonAllUserApplicationData
(RT_Util unit)
Function SpecialFolder_CommonAllUserApplicationData : TDynamicString;
この関数は、Common All User Application Data フォルダーのパスを返します。たとえば C:\Documents and Settings\All Users\Application Data\Altium Designer\. です。
特殊フォルダーパス
SpecialFolder_CommonApplicationData
(RT_Util unit)
Function SpecialFolder_CommonApplicationData : TDynamicString;
この関数は、Common Application data フォルダーのパスを返します。たとえば C:\Documents and Settings\User Name\Application Data\Altium Designer\. です。
特殊フォルダーパス
SpecialFolder_CommonDocumnetTemplates
(RT_Util unit)
Function SpecialFolder_CommonDocumnetTemplates : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Templates フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_CommonLocalApplicationData
(RT_Util unit)
Function SpecialFolder_CommonLocalApplicationData : TDynamicString;
この関数は、Common Local Application data フォルダーのパスを返します。たとえば C:\Documents and Settings\User Name\Application Data\Altium Designer\. です。
特殊フォルダーパス
SpecialFolder_CommonProgramFiles
(RT_Util unit)
Function SpecialFolder_CommonProgramFiles : TDynamicString;
この関数は、C:\Program Files\Common Files フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_CommonStartup
(RT_Util unit)
Function SpecialFolder_CommonStartup : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Start Menu フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_CommonStartupPrograms
(RT_Util unit)
Function SpecialFolder_CommonStartupPrograms : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Start Menu\Programs フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_CommonFavorites
(RT_Util unit)
Function SpecialFolder_CommonFavorites : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Favorites フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_ControlPanel
(RT_Util unit)
Function SpecialFolder_ControlPanel : TDynamicString;
この関数は、Control Panel フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_DesignExamples
(RT_Util unit)
Function SpecialFolder_DesignExamples : TDynamicString;
この関数は、Design Examples フォルダーのパスを返します。例: C:\Program Files\Altium\Examples\
特殊フォルダーパス
SpecialFolder_DesignTemplates
(RT_Util unit)
Function SpecialFolder_DesignTemplates : TDynamicString;
この関数は、DesignTemplates フォルダーのパスを返します。例: C:\Program Files\Altium\Templates\
特殊フォルダーパス
SpecialFolder_Desktop
(RT_Util unit)
Function SpecialFolder_Desktop : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Desktop フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_DesktopLocation
(RT_Util unit)
Function SpecialFolder_DesktopLocation : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Desktop フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_Favorites
(RT_Util unit)
Function SpecialFolder_Favorites : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Cookies フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_Fonts
(RT_Util unit)
Function SpecialFolder_Fonts : TDynamicString;
この関数は、フォントが保存されているフォルダーのパスを返します。たとえば C:\WinNT\Fonts です。
特殊フォルダーパス
SpecialFolder_InstalledPrinters
(RT_Util unit)
Function SpecialFolder_InstalledPrinters : TDynamicString;
この関数は、C:\Documents and Settings\UserName\PrintHood フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_Internet
(RT_Util unit)
Function SpecialFolder_Internet : TDynamicString;
この関数は、インターネットブラウザーソフトウェアが配置されているフォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_InternetCookies
(RT_Util unit)
Function SpecialFolder_InternetCookies : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Cookies フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_InternetHistory
(RT_Util unit)
Function SpecialFolder_InternetHistory : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Local Settings\History フォルダーのパスを返します。
特殊フォルダーパス
SpecialFolder_InternetTemporaryFiles
(RT_Util unit)
Function SpecialFolder_InternetTemporaryFiles : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Local Settings\Temporary Internet Files フォルダーのパスを返します。
特殊フォルダのパス
SpecialFolder_LocalApplicationdata
(RT_Util ユニット)
Function SpecialFolder_LocalApplicationData : TDynamicString;
この関数は、C:\Documents and settings\UserName\Local Settings\Application Data フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_MyComputer
(RT_Util ユニット)
Function SpecialFolder_MyComputer : TDynamicString;
この関数は、MyComputer フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_MyDesigns
(RT_Util ユニット)
Function SpecialFolder_MyDesigns : TDynamicString;
この関数は、MyDesigns フォルダのパスを返します。例: C:\Documents and Settings\UserName\My Documents\My Designs
特殊フォルダのパス
SpecialFolder_MyDocuments
(RT_Util ユニット)
Function SpecialFolder_MyDocuments : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Local Settings\My Documents フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_MyMusic
(RT_Util ユニット)
Function SpecialFolder_MyMusic : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Local Settings\My Music フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_MyNetworkPlaces
(RT_Util ユニット)
Function SpecialFolder_MyNetworkPlaces : TDynamicString;
この関数は、C:\Documents and Settings\UserName\NetHood フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_MyPictures
(RT_Util ユニット)
Function SpecialFolder_MyPictures : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Local Settings\My Pictures フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_NetWorkRoot
(RT_Util ユニット)
Function SpecialFolder_NetworkRoot : TDynamicString;
この関数は、Network Root ディレクトリのパスを返します。
特殊フォルダのパス
SpecialFolder_NonlocalizedStartupPrograms
(RT_Util ユニット)
Function SpecialFolder_NonLocalizedStartupPrograms : TDynamicString;
この関数は、Non Localized Startup Programs フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_Printers
(RT_Util ユニット)
Function SpecialFolder_Printers : TDynamicString;
この関数は、Printers フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_Profile
(RT_Util ユニット)
Function SpecialFolder_Profile : TDynamicString;
この関数は、C:\Program Files\UserName のパスを返します。
特殊フォルダのパス
SpecialFolder_Programs
(RT_Util ユニット)
Function SpecialFolder_Programs : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Start Menu\Programs フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_ProgramFiles
(RT_Util ユニット)
Function SpecialFolder_ProgramFiles : TDynamicString;
この関数は、C:\Program Files フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_Recent
(RT_Util ユニット)
Function SpecialFolder_Recent : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Recent フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_Recovery
(RT_Util ユニット)
Function SpecialFolder_Recovery : TDynamicString;
この関数は、Altium Recover フォルダのパスを返します。例: C:\Documents and Settings\UserName\Application Data\Recovery\
特殊フォルダのパス
SpecialFolder_RecycleBin
(RT_Util ユニット)
Function SpecialFolder_RecycleBin : TDynamicString;
この関数は、ごみ箱のパスを返します。
特殊フォルダのパス
SpecialFolder_SendTo
(RT_Util ユニット)
Function SpecialFolder_SendTo : TDynamicString;
この関数は、C:\Documents and Settings\UserName\SendTo フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_StartMenuItems
(RT_Util ユニット)
Function SpecialFolder_StartMenuItems : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Recent フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_SystemFolder
(RT_Util ユニット)
Function SpecialFolder_SystemFolder : TDynamicString;
この関数は、C:\WINNT\System32 フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_TemplatesForAllUsers
(RT_Util ユニット)
Function SpecialFolder_TemplatesForAllUsers : TDynamicString;
この関数は、C:\Documents and Settings\All Users\Templates フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_Temporary
(RT_Util ユニット)
Function SpecialFolder_Temporary : TDynamicString;
この関数は、C:\DOCUME~1\UserName\LOCALS~1\Temp\ フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_TemporarySlash
(RT_Util ユニット)
Function SpecialFolder_TemporarySlash : TDynamicString;
この関数は、C:\Documents and settings\UserName\Local Settings\Temp\ フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_UserStartMenuItems
(RT_Util ユニット)
Function SpecialFolder_UserStartMenuItems : TDynamicString;
この関数は、C:\Documents and Settings\UserName\Recent フォルダのパスを返します。
特殊フォルダのパス
SpecialFolder_WindowsFolder
(RT_Util ユニット)
Function SpecialFolder_WindowsFolder : TDynamicString;
この関数は、C:\WINNT フォルダのパスを返します。
特殊フォルダのパス
文字列ルーチン
Center
(RT_Util ユニット)
Function Center(Const S : TDynamicString; Width : Integer) : TDynamicString;
指定した幅の空白文字列の中央に配置された文字列を返します。
文字列操作ルーチン
CenterCH
Function CenterCh (Const S : TDynamicString; Ch : Char; Width : Integer) : TDynamicString;
指定した幅の、文字 Ch で構成された文字列の中央に配置された文字列を返します。
文字列操作ルーチン
CharStr
Function CharStr (Ch : Char; Len : Integer) : TDynamicString;
文字 Ch で埋められた、長さ len の文字列を返します。
文字列操作ルーチン
CropStringToLength
Function CropStringToLength (Const StringToCrop : TDynamicString; Const MaximumLength : Integer) : TDynamicString;
CropStringToLength 関数は、指定された文字列 StringToCrop の先頭および末尾にある空白と制御文字を削除します。MaximumLength パラメータは、関数が返す文字列の範囲をインデックス 0 から MaximumLength までとして指定します。残りの部分の文字列は切り捨てられます。
文字列操作ルーチン
GeneralStringInc
Procedure GeneralStringInc (Var S : TString; Const IncValue : TDynamicString);
GeneralStringInc プロシージャは、パラメータ S を解析して、数値が埋め込まれているかどうかを判定します。文字列内に数値がある場合は、既存の数値を 1 増やします。
S := 'Part1';
GeneralStringInc(S,'4');
//Part5
文字列操作ルーチン
GetStringFromBoolean
Function GetStringFromBoolean (B : Boolean ) : TDynamicString;
GetStringFromBoolean 関数は、パラメータ B が true の場合は 'True' を返し、それ以外の場合は 'False' を返します。
文字列操作ルーチン
GetStringFromInteger
Function GetStringFromInteger (N : Integer) : TDynamicString;
GetStringFromInteger 関数は、任意の整数型を文字列に変換します。
文字列操作ルーチン
IndentString
Function IndentString(Indent : Integer) : TDynamicString;
この関数は、文字列内に空白文字 (#32) として指定されたインデント量を表す文字列を返します。たとえば、インデント値 4 の場合は、4 つの空白文字からなる文字列が生成されます。
文字列操作ルーチン
LeftJust
Function LeftJust(Const S : TDynamicString; Width : Integer) : TDynamicString;
LeftJust 関数は、文字列の右側に (Width - 文字列長) 分の空白を追加して、文字列を左揃えにします。
S := LeftJust('smith',9) + '.';
//s := 'smith .' ('smith' とピリオド '.' の間に 4 つの空白)
文字列ルーチン
PadLeft
Function PadLeft(S : TDynamicString; Len : Integer) : TDynamicString;
左側を空白で埋めて、長さ len にした文字列を返します。
文字列操作ルーチン
PadLeftCh
Function PadLeftCh (S : TDynamicString; Ch : Char; Len : Integer) : TDynamicString;
左側を指定した文字 Ch で埋めて、長さ len にした文字列を返します。
文字列操作ルーチン
PadRight
Function PadRight(S : TDynamicString; Len : Integer) : TDynamicString;
右側を空白で埋めて、長さ len にした文字列を返します。
文字列操作ルーチン
PadRightCh
Function PadRightCh(S : TDynamicString; Ch : Char; Len : Integer) : TDynamicString;
len パラメータで指定した長さになるよう、右側を文字 Ch で埋めた文字列を返します。
文字列操作ルーチン
SameString
Function SameString (Const S1,S2 : TDynamicString; CaseSensitive : Boolean) : Boolean;
SameString 関数は 2 つの文字列を比較し、CaseSensitive パラメータに応じて真偽値を返します。CaseSensitive が false に設定されている場合、'aaa' と 'AaA' は同じ文字列と見なされます。
文字列操作ルーチン
StringsEqual
Function StringsEqual(S1,S2 : TDynamicString) :Boolean;
この SameString 関数は 2 つの文字列を比較し、文字列 S1 と S2 の長さが等しく、内容も同一であるかどうかを確認します。
文字列操作ルーチン
StringReplace
(SysUtils ユニット)
Function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;
基本的にこの関数は、ある部分文字列の出現箇所を別の部分文字列に置き換えた文字列を返します。StringReplace は、OldPattern で指定された部分文字列の出現箇所を、NewPattern で指定された部分文字列に置き換えます。
S は、部分文字列が変更される元の文字列です。
OldPattern は、検索して NewPattern に置き換える部分文字列です。
NewPattern は、OldPattern の出現箇所に代入される部分文字列です。
Flags は、StringReplace が OldPattern の出現箇所をどのように検索し置換するかを制御するフラグのセットです。Flags に rfReplaceAll が含まれていない場合、StringReplace は S 内の OldPattern の最初の出現箇所だけを置き換えます。それ以外の場合、StringReplace は OldPattern のすべての出現箇所を NewPattern に置き換えます。Flags パラメータに rfIgnoreCase が含まれている場合、比較操作では大文字と小文字を区別しません。
Type
TReplaceFlags = set of (rfReplaceAll, rfIgnoreCase);
Result := StringReplace(AKeys, ADelimiter, cDatabase_KeyFieldDelimiter, [rfReplaceAll]);
文字列操作ルーチン
StrToInt
Function StrToInt(const S: string): Integer;
StrToInt 関数は、10進数または16進数表記の整数値を表す文字列 S を数値に変換します。
文字列操作ルーチン
TrimLead
Function TrimLead (Const S : TDynamicString) : TDynamicString;
先頭の空白文字を削除した文字列を返します。
文字列操作ルーチン
TrimTrail
Function TrimTrail (Const S : TDynamicString) : TDynamicString;
末尾の空白文字を削除した文字列を返します。
文字列操作ルーチン
時刻および日付ルーチン
DateString
(RT_Util unit)
Function DateString (Const DateRecord : TDate) : TDynamicString;
DateString 関数は、'12-Jan-1985' 形式の日付を表す TString を返します。
時刻および日付ルーチン
GetCurrentDate
(RT_Util unit)
Procedure GetCurrentDate (Var DateRecord : TDate);
GetCurrentDate プロシージャは、Date パラメータとして指定された値を年、月、日に分解する Windows API の DecodeDate プロシージャに基づいています。指定された TDateTime 値が 0 以下の場合、戻り値の年、月、日の各パラメータはすべて 0 に設定されます。
時刻および日付ルーチン
GetCurrentDateString
(RT_Util unit)
Function GetCurrentDateString : TDynamicString;
GetCurrentDateString 関数は、'12-Jan-1985' 形式の日付を表す TString を返します。
時刻および日付ルーチン
GetCurrentTimeString
(RT_Util unit)
Function GetCurrentTimeString : TDynamicString;
GetCurrentTimeString 関数は、HH:MM:SS 形式の時刻を表す TString を返します。
時刻および日付ルーチン
GetCurrentTimeRec
(RT_Util unit)
Procedure GetCurrentTimeRec (Var TimeRecord : TTime);
GetCurrentTimeRec プロシージャは、TDateTime レコードを時、分、秒、ミリ秒に分解する WinAPI の DecodeTime 関数に基づいています。
時刻および日付ルーチン
GetDateAndTimeStamp
(RT_Util unit)
Function GetDateAndTimeStamp : TDynamicString;
この関数は、現在の日付と時刻を含む文字列を返します。
時刻および日付ルーチン
GetElapsedTime
(RT_Util unit)
Procedure GetElapsedTime (Const Start : TTime; Const Stop : TTime;Var Elapsed : TTime);
GetElapsedTime プロシージャは、Start と Stop の時間間隔の差を秒単位で Elapsed に返します。
時刻および日付ルーチン
GetElapsedTimeDate
(RT_Util unit)
Procedure GetElapsedTimeDate (Const Start : TTime;
Const Stop : TTime;
Var Elapsed : TTime;
Const StartDate : TDate;
Const StopDate : TDate);
GetElapsedTimeDate プロシージャは、StartDate、StopDate の日付と Start、Stop の時刻から算出した Elapsed 値を返します。結果は TimeString_Elapsed 関数によって文字列として取得できます。
時刻および日付ルーチン
GetFileDateString
Function GetFileDateString(Const AFileName : TDynamicString) : TDynamicString;
GetCurrentDateString 関数は、たとえば '12-Jan-1985' 形式の日付を表す String を返します。
時刻および日付ルーチン
GetMilliSecondTime
(RT_Util unit)
Function GetMilliSecondTime : Integer;
GetMilliSecondTime 関数は、Windows の起動以降に経過したミリ秒数を取得します。
時刻および日付ルーチン
MakeDateAndTimeStampedFileName
(RT_Util unit)
Function MakeDateAndTimeStampedFileName(BaseName : TDynamicString) : TDynamicString;
この関数は、ベースとなるファイル名文字列に日付と時刻を挿入した文字列を返します。
時刻および日付ルーチン
SecondsToTimeRecord
(RT_Util unit)
Procedure SecondsToTimeRecord(Var TimeRecord : TTime; Const Seconds : Integer);
このプロシージャは TimeRecordToSeconds プロシージャの逆の処理を行います。秒の情報を TTime 構造体型に変換します。
時刻および日付ルーチン
TimeString_elapsed
(RT_Util unit)
Function TimeString_Elapsed (Const TimeRecord : TTime) : TDynamicString;
この関数は、経過した時間情報を含む文字列を返します。時間情報を取得するには、GetElapsedTimeDate または GetElapsedTime 関数を呼び出します。
Var
ElapsedTime : TTime;
Begin
GetCurrentTimeRec (EndTime);
GetCurrentDate (EndDate);
GetElapsedTimeDate (StartTime, EndTime, ElapsedTime, StartDate, EndDate);
ShowInfo('Time Elapsed : ' + TimeString_Elapsed(ElapsedTime));
End;
時刻および日付ルーチン
TimeString
(RT_Util unit)
Function TimeString (Const TimeRecord : TTime) : TDynamicString;
TimeString 関数は、HH:MM:SS 形式の時刻を表す TString を返します。
時刻および日付ルーチン
TimeRecordToSeconds
(RT_Util unit)
Procedure TimeRecordToSeconds(Const TimeRecord : TTime; Var Seconds : Integer);
このプロシージャは、TTime 型の構造体を秒数に変換します。このプロシージャは GetElapsedTime および GetElapsedTimeDate プロシージャで使用されます。
時刻および日付ルーチン
WaitMilliSecondDelay
(RT_Util unit)
Procedure WaitMilliSecondDelay(N : Integer);
WaitMilliSecondDelay 関数は、整数値 N で指定されたミリ秒数だけコードの実行を遅延させます。これは、ソフトウェア内の関数が別の処理を行う前に少し待機する必要がある場合に有用で、ソフトウェアが処理を追いつくための時間を与えます。この関数は GetMilliSecondTime 関数を使用します。
WaitMilliSecondDelay(1000); // 1 秒待機します。1000 ミリ秒 = 1 秒。
時刻および日付ルーチン
Function ClientAPI_GetPrefAnimatedPanels : Boolean;
Function ClientAPI_GetPrefSaveToolsLayout : Boolean;
Function ClientAPI_GetPrefAutoTransparency : Boolean;
Function ClientAPI_GetPrefDynamicAutoTransparency : Boolean;
Function ClientAPI_GetPrefSuppressStartupScreen : Boolean;
Function ClientAPI_GetPrefTransparencyHighest : Integer;
Function ClientAPI_GetPrefTransparencyLowest : Integer;
Function ClientAPI_GetPrefTransparencyForce : Integer;
Function ClientAPI_GetPrefPopupPanelDelay : Integer;
Function ClientAPI_GetPrefHidePanelDelay : Integer;
Function ClientAPI_GetPrefAnimatedPanelSpeed : Integer;
Function ClientAPI_GetPrefPathInTitleBar : Boolean;
Function ClientAPI_GetPrefUseShadow : Boolean;
Function ClientAPI_GetPrefUseLuna : Boolean;
Function ClientAPI_GetPrefHideFloatingPanels : Boolean;
Function ClientAPI_GetPrefRestoreOpenDocuments : Boolean;
Function ClientAPI_GetPrefOpenTasksIfNothingOpen : Boolean;
Function ClientAPI_GetPrefHideBinderViewTabs : Boolean;
Function ClientAPI_GetPrefNoRestoreKindCount : Integer;
Procedure ClientAPI_GetPrefNoRestoreKind (Index : Integer; Buffer : PChar);
Procedure ClientAPI_SetPrefAnimatedPanels (Value : Boolean);
Procedure ClientAPI_SetPrefSaveToolsLayout (Value : Boolean);
Procedure ClientAPI_SetPrefAutoTransparency (Value : Boolean);
Procedure ClientAPI_SetPrefDynamicAutoTransparency (Value : Boolean);
Procedure ClientAPI_SetPrefSuppressStartupScreen (Value : Boolean);
Procedure ClientAPI_SetPrefTransparencyHighest (Value : Integer);
Procedure ClientAPI_SetPrefTransparencyLowest (Value : Integer);
Procedure ClientAPI_SetPrefTransparencyForce (Value : Integer);
Procedure ClientAPI_SetPrefPopupPanelDelay (Value : Integer);
Procedure ClientAPI_SetPrefHidePanelDelay (Value : Integer);
Procedure ClientAPI_SetPrefAnimatedPanelSpeed (Value : Integer);
Procedure ClientAPI_SetPrefPathInTitleBar (Value : Boolean);
Procedure ClientAPI_SetPrefUseShadow (Value : Boolean);
Procedure ClientAPI_SetPrefUseLuna (Value : Boolean);
Procedure ClientAPI_SetPrefHideFloatingPanels (Value : Boolean);
Procedure ClientAPI_SetPrefRestoreOpenDocuments (Value : Boolean);
Procedure ClientAPI_SetPrefOpenTasksIfNothingOpen (Value : Boolean);
Procedure ClientAPI_SetPrefHideBinderViewTabs (Value : Boolean);
Procedure ClientAPI_SetPrefNoRestoreKindClear;
Procedure ClientAPI_SetPrefNoRestoreKindAdd (Value : PChar);
Function ClientAPI_GetPrefRememberFormForDocKind : Boolean;
Procedure ClientAPI_SetPrefRememberFormForDocKind (Value : Boolean);
Procedure ClientAPI_SetAutoShowComponentSymbols (Value : Boolean);
Function ClientAPI_GetAutoShowComponentSymbols : Boolean;
Procedure ClientAPI_ShowProductStartup (Bitmap : TDynamicString);
Procedure ClientAPI_HideProductStartup;
Procedure ClientAPI_AddStartupMessage (S : TDynamicString);
Procedure ClientAPI_AddShutdownMessage (S : TDynamicString);
Procedure ClientAPI_Synchronize (Const ASync : IThreadSynchronize);
Procedure ClientAPI_CheckSynchronize;
Function ClientAPI_GetCurrentOutputGenerator : IUnknown;
Procedure ClientAPI_SetCurrentOutputGenerator(Const Generator : IUnknown);
Function ClientAPI_GetBuiltInNavigationBar : Boolean;
Procedure ClientAPI_SetBuiltInNavigationBar (Value : Boolean);
Function ClientAPI_GetAlwaysShowNavBarInTasks : Boolean;
Procedure ClientAPI_SetAlwaysShowNavBarInTasks(Value : Boolean);
{............................................................................................}
{............................................................................................}
Function ClientAPI_GetFavoritesThumbnailSize : TSize;
Procedure ClientAPI_SetFavoritesThumbnailSize(Value : TSize);
{............................................................................................}
{............................................................................................}
Function ClientAPI_GetGroupingInDocumentsBar : TDocumentsBarGrouping;
Procedure ClientAPI_SetGroupingInDocumentsBar (Value : TDocumentsBarGrouping);
Function ClientAPI_GetEqualButtonsInDocumentsBar : Boolean;
Procedure ClientAPI_SetEqualButtonsInDocumentsBar(Value : Boolean);
Function ClientAPI_GetAutoHideDocumentsBar : Boolean;
Procedure ClientAPI_SetAutoHideDocumentsBar (Value : Boolean);
Function ClientAPI_GetMultilineDocumentsBar : Boolean;
Procedure ClientAPI_SetMultilineDocumentsBar (Value : Boolean);
Function ClientAPI_GetMiddleClickClosesDocumentTab : Boolean;
Procedure ClientAPI_SetMiddleClickClosesDocumentTab(Value : Boolean);
Function ClientAPI_GetIntegratedHelpSystem : Boolean;
Procedure ClientAPI_SetIntegratedHelpSystem (Value : Boolean);
Function ClientAPI_GetUseSystemLocaleLanguage : Boolean;
Procedure ClientAPI_SetUseSystemLocaleLanguage (Value : Boolean);
Function ClientAPI_GetUseLocalizedDialogs : Boolean;
Procedure ClientAPI_SetUseLocalizedDialogs (Value : Boolean);
Function ClientAPI_GetUseLocalizedResources : Boolean;
Procedure ClientAPI_SetUseLocalizedResources (Value : Boolean);
Function ClientAPI_GetVSStyleCtrlTab : Boolean;
Procedure ClientAPI_SetVSStyleCtrlTab (Value : Boolean);
Function ClientAPI_GetActivateLastActiveOnClose : Boolean;
Procedure ClientAPI_SetActivateLastActiveOnClose (Value : Boolean);
{............................................................................................}
Function ClientAPI_GetHelpFileAndTopic(Const AHelpTopicID : WideString; Out HelpFileName, HelpTopicName : WideString) : Boolean;
Function ClientAPI_UpdateFont(Var Font : TLogFont) : LongBool;
Procedure ClientAPI_SetErrorInfo(Const ErrorMsg, ErrorReport : WideString; ErrorAddr : Pointer);
Procedure ClientAPI_ClearErrorInfo;
Procedure ClientAPI_HandleException(Const Message : WideString);
Procedure ClientAPI_QueryUpdatesInfo (Var UpdatesURL, UpdatesNetworkPath : WideString; Var UpdatesUseNetworkPath : LongBool; Var UpdatesPathToDownloadUpdates : WideString;
Var CheckFrequency : TWebUpdate_CheckFrequency); Stdcall;
Procedure ClientAPI_SetUpdatesInfo (Const UpdatesURL, UpdatesNetworkPath : WideString; UpdatesUseNetworkPath : LongBool; Const UpdatesPathToDownloadUpdates : WideString;
CheckFrequency : TWebUpdate_CheckFrequency); Stdcall;
サーバープロセス ルーチン
Servers
サーバーは、Altium Designer 環境内でそのサービスを提供します。Altium Designer 内の Client モジュールは、タスクをサーバープロ たとえば、ユーザーがワイヤを配置するために Schematic メニューをクリックすると、Client モジュールはこの操作を 'PlaceWire' プロセスとして解釈し、そのプロセスを Schematic Editor サーバーに委譲します。Schematic サーバーはこの要求に応答して、プロセスを実行します。Altium Designer にインストールされているサーバーの機能は、そのサーバーのプロセスおよび公開されている関数を通じて提供されます。
一般に、プロセスは Altium Designer でコマンドを選択することで実行されます。このコマンドは、プロセス起動用にパッケージ化されたランチャーです(たとえば、ツールバーボタンのクリック、ホットキーの押下、またはメニュー項目の選択など)。同じプロセスを起動するために、最大 3 種類の異なるプロセスランチャーを使用できます。
System メニュー内の Run Process メニュー項目から、手動でプロセスを実行できます。
サーバープロセス
各サーバープロセスにはプロセス識別子があります。プロセス識別子は、コロンで区切られた 2 つの部分で構成されます。最初の部分はそのプロセスを定義するサーバーを示し、2 番目の部分はプロセス名です。
たとえば、プロセス
プロセスは
パラメトリックプロセス
パラメトリックサーバープロセスでは、プロセスが必要とする情報を、プロセス呼び出し時に渡すことができます。このようにプロセスパラメータを渡せることで、プロセスの動作を直接制御できます。パラメトリックプロセスでは、各パラメータに値が割り当てられ、このパラメータ / 値ブロックは Parameter = Name として表されます。
たとえば、FileName = C:\Program Files\TestFile.Txt です。
複数のパラメータを 1 つの文字列として連結するには、各パラメータ / 値ブロックをパイプ | 記号で区切ります。
たとえば、Parameter1 = Name1 | Parameter2 = Name 2 などです。
サーバープロセス関数と、Altium Designer RTL の RT_Param ユニットに含まれる TParameterList クラスを使用すると、プロセス文字列の操作をはるかに簡単に行えます。
TParameterList クラス
(RT_Param ユニット)
TParameterList クラスは、Pipe 記号で区切られた parameter name = value ブロックを、単一の null 終端文字列として簡単に保存できます。たとえば、Orientation=1|Location.X=10000000|Location.Y=20000000 は典型的なパラメータ文字列です。
TParameterList オブジェクトにパラメータを追加するには、以下の SetState_AddParameterX メソッドのいずれかを使用します。通常、この場合は SetState_AddParameterAsString メソッドを使用します。
TParameterList オブジェクトから特別な形式の null 終端文字列を取得するには、GetState_ParameterX メソッドのいずれかを呼び出します。この場合は GetState_ToString または GetState_ParameterAsPChar メソッドを使用します。
TParameterList クラスのインスタンスを作成し、ClearAllParameters メソッドを呼び出してリセットします。
TParameterList メソッド
コンストラクタ Create;
デストラクタ Destroy; Override;
SetState_FromString および GetState_ToString メソッド
Procedure SetState_FromString (Const S : TDynamicString);
Function GetState_ToString : TDynamicString;
SetState_AddParameterX メソッド
Procedure SetState_AddParameter (Const AName, AValue : TDynamicString);
Procedure SetState_AddParameterAsString (Const AName : TDynamicString; Const Value : TDynamicString);
Procedure SetState_AddParameterAsBoolean (Const AName : TDynamicString; Value : Boolean);
Procedure SetState_AddParameterAsInteger (Const AName : TDynamicString; Value : Integer);
Procedure SetState_AddParameterAsInt64 (Const AName : TDynamicString; Value : Int64);
Procedure SetState_AddParameterAsDouble (Const AName : TDynamicString; Const Value : Double);
GetState_AddParameterX メソッド
Function GetState_ParameterAsString (Const Name : TDynamicString; Var Value : TDynamicString ) : Boolean; Overload;
Function GetState_ParameterAsString (Const Name : TDynamicString; Var Value : TString ) : Boolean; Overload;
Function GetState_ParameterAsPChar (Const Name : TDynamicString; Var Value : PChar ) : Boolean;
Function GetState_ParameterAsLongInt (Const Name : TDynamicString; Var Value : LongInt) : Boolean;
Function GetState_ParameterAsInteger (Const Name : TDynamicString; Var Value : Integer) : Boolean;
Function GetState_ParameterAsInt64 (Const Name : TDynamicString; Var Value : Int64 ) : Boolean;
Function GetState_ParameterAsSmallInt (Const Name : TDynamicString; Var Value : SmallInt) : Boolean;
Function GetState_ParameterAsWord (Const Name : TDynamicString; Var Value : Word ) : Boolean;
Function GetState_ParameterAsBoolean (Const Name : TDynamicString; Var Value : Boolean) : Boolean;
Function GetState_ParameterAsWordBool (Const Name : TDynamicString; Var Value : WordBool) : Boolean;
Function GetState_ParameterAsReal (Const Name : TDynamicString; Var Value : Single ) : Boolean;
Function GetState_ParameterAsDouble (Const Name : TDynamicString; Var Value : Double) : Boolean;
その他のメソッド
Function GetState_ParameterByName (Const AName : TDynamicString) : TParameter;
Function SetState_RemoveByName (Const AName : TDynamicString) : Boolean;
Procedure ClearAllParameters;
Procedure SetState(P : PChar);
Procedure GetState(P : PChar);
スクリプトでは、文字列を処理するために使用できるのは SetState_FromString (Const S : TDynamicString); および GetState_ToString の各メソッドのみです。SetState メソッドと GetState メソッドは、スクリプトエンジンで問題を引き起こします。
//Parameters = Orientation=1|Location.X=10000000|Location.Y=20000000';
P := TParameterList.Create; // P は TParameterList 型です。
P.ClearAllParameters;
P.SetState_FromString(Parameters);
P.SetState_AddParameterAsString ('Orientation','1');
P.SetState_AddParameterAsString ('Location.X' ,'10000000');
P.SetState_AddParameterAsString ('Location.Y' ,'20000000');
P.SetState_AddParameterAsString ('Designator' ,'dB1');
P.SetState_AddParameterAsString ('Comment' ,'50pF');
Parameters := P.GetState_ToString;
IntegratedLibraryManager.PlaceLibraryComponent(SchLibRef,SchLibpath,Parameters);
P.Free;
プロセスパラメータ関数
Function GetState_Parameter (P : PChar; Const Name : TString; Var Value : TString) : Boolean; Overload;
Function GetState_Parameter (P : PChar; Const Name : TDynamicString; Var Value : TDynamicString) : Boolean; Overload;
Procedure SetState_RemoveParameter(P : PChar; Const Name : TDynamicString); Overload;
Function GetState_ParameterPChar (P : PChar; Const Name : TDynamicString; Value : PChar) : Boolean;
Procedure SetState_ParameterPChar (P : PChar; Const Name : TDynamicString; Value : PChar);
Procedure SetState_Parameter (P : PChar; Const Name : TDynamicString; Const Value : TDynamicString); Overload;
Function GetState_Parameter (Const S : TDynamicString; Const Name : TDynamicString; Var Value : TDynamicString) : Boolean; Overload;
Procedure SetState_Parameter (Var S : TDynamicString; Const Name : TDynamicString; Const Value : TDynamicString); Overload;
Procedure SetState_RemoveParameter(Var S : TDynamicString; Const Name : TDynamicString); Overload;
サーバープロセスルーチンは、Altium Designer RTL の一部である ClientApiReg ユニットで定義されています。
スクリプトでサーバープロセスを実行するには、
ResetParameters; AddStringParameter('OpenMode','NewFromTemplate'); AddStringParameter('ObjectKind,'Project'); RunProcess('WorkSpaceManager:OpenObject);
Client.SendMessage('WorkspaceManager:OpenObject','OpenMode=NewFromTemplate \| ObjectKind=Project',1024,Nil);
プロセスパラメータリファレンスのオンラインヘルプ
\Examples\Scripts\Delphiscript Scripts\Processes\ フォルダ内のプロセス例。
AddWordParameter
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure AddWordParameter(Const Name: String; Value: Word);
Begin ResetParameters; AddWordParameter('WordValue',5); // code here End;
サーバープロセスルーチン
AddColorParameter
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure AddColorParameter(Const Name: String; Red: Integer; Green: Integer; Blue: Integer);
このプロシージャは、Altium Designer のパラメータバッファに色値パラメータを追加します。このプロシージャは、色パラメータを必要とするプロセスで使用する色を定義するために使われます。
Color は value = RedVal + 256*(GreenVal + 256*BlueVal) で表される値であり、Name はこの色値を表す名前です。
サーバープロセスルーチン
AddIntegerParameter
(Altium Designer RTL の ClientAPIReg ユニット)
Procedure AddIntegerParameter(Const Name: String; Value: Integer);
AddIntegerParameter プロシージャは、サーバープロセスで使用するために、Integer データ型のパラメータをパラメータバッファに定義します。
Begin ResetParameters; AddStringParameter('ObjectKind','Netlist'); AddIntegerParameter('Index',5); AddStringParameter('ReturnGeneratedDocuments', 'True'); RunProcess('WorkspaceManager:GenerateReport'); End;
サーバープロセスルーチン
AddLongIntParameter
(ClientAPIReg ユニット)
Procedure AddLongIntParameter(Const Name: String; Value: LongInt);
AddLongIntParameter プロシージャは、サーバープロセスで使用するために、longint データ型のパラメータをパラメータバッファに定義します。
Begin ResetParameters; AddLongIntParameter('LongIntValue',5); // code here End;
サーバープロセスルーチン
AddSingleParameter
(ClientAPIReg ユニット)
Procedure AddSingleParameter(Const Name: String; Value: Single);
AddLongIntParameter プロシージャは、サーバープロセスで使用するために、single データ型のパラメータをパラメータバッファに定義します。
Begin ResetParameters; AddSingleParameter('SingleValue',5); // code here End;
サーバープロセスルーチン
AddStringParameter
(ClientAPIReg ユニット)
Procedure AddStringParameter(Const Name, Value: String);
このプロシージャは、文字列値を持つパラメータをパラメータバッファに追加します。Name パラメータはプロセスパラメータの名前を表し、Value パラメータはプロセスパラメータの値を表します。
ResetParameters Call AddStringParameter("Object","JumpToLocation10") Call RunProcess("PCB:Jump") ResetParameters Call AddStringParameter("ZoomLevel","2.0") Call RunProcess("PCB:Zoom")
サーバープロセスルーチン
GetColorParameter
(ClientAPIReg ユニット)
Procedure GetColorParameter(Const Name: String; Var Red: Integer; Var Green: Integer; Var Blue: Integer);
GetColorParameter プロシージャは、色値を返すプロセスの実行後に、パラメータバッファから色パラメータの値を RGB 値として取得します。
サーバープロセスルーチン
GetIntegerParameter
(ClientAPIReg unit)
Procedure GetIntegerParameter(Const Name: String; Var Value: Integer);
GetIntegerParameter プロシージャは、パラメータバッファから integer 型パラメータの値を取得します。このプロシージャは、プロセス実行後に結果の word 値を返すこともできます。
Var ErrorCode : Integer; CommandLine : String; Result : Integer; NetlistName : String Begin ResetParameters; AddStringParameter('ObjectKind','Netlist'); AddIntegerParameter('Index',5); AddStringParameter('ReturnGeneratedDocuments', 'True'); RunProcess('WorkspaceManager:GenerateReport'); GetIntegerParameter('Result', Result); If Result = 0 Then Exit; NetListName := GetStringParameter('File1', Result); End;
サーバープロセスルーチン
GetLongIntParameter
(ClientAPIReg unit)
Procedure GetLongIntParameter(Const Name: String; Var Value: LongInt);
GetLongIntParameter プロシージャは、パラメータバッファから long int 型パラメータの値を取得します。このプロシージャは、プロセス実行後に結果の long int 型の値を返すこともできます。
サーバープロセスルーチン
GetSingleParameter
(ClientAPIReg unit)
Procedure GetSingleParameter(Const Name: String; Var Value: Single);
GetSingleParameter プロシージャは、パラメータバッファから single 型パラメータの値を取得します。このプロシージャは、プロセス実行後に結果の single 型の値を返すこともできます。
サーバープロセスルーチン
GetStringParameter
(ClientAPIReg unit)
Procedure GetStringParameter(Const Name: String; Var Value: String);
GetSingleParameter プロシージャは、パラメータバッファから string 型パラメータの値を取得します。このプロシージャは、プロセス実行後に結果の string 型の値を返すこともできます。
Var ErrorCode : Integer; CommandLine : String; Result : Integer; NetlistName : String Begin ResetParameters; AddStringParameter('ObjectKind','Netlist'); AddIntegerParameter('Index',5); AddStringParameter('ReturnGeneratedDocuments', 'True'); RunProcess('WorkspaceManager:GenerateReport'); GetIntegerParameter('Result', Result); If Result = 0 Then Exit; NetListName := GetStringParameter('File1', Result); End;
サーバープロセスルーチン
GetWordParameter
(ClientAPIReg unit)
Procedure GetWordParameter(Const Name: String; Var Value: Word);
GetWordParameter プロシージャは、パラメータバッファから word 型パラメータの値を取得します。このプロシージャは、プロセス実行後に結果の integer 値を返すこともできます。
サーバープロセスルーチン
ResetParameters
(ClientAPIReg unit)
Procedure ResetParameters;
The
Add...Parameter プロシージャのいずれかを使用すると、宣言したパラメータはパラメータバッファに追加されます。プロセスを実行すると、プロセスに渡す必要があるパラメータはすべてパラメータバッファから読み取られます。
ただし、プロセスを実行してもパラメータバッファはクリアされません。したがって、新しい一連のパラメータをバッファに格納する前に、
Var ErrorCode : Integer; CommandLine : String; Result : Integer; NetlistName : String Begin ResetParameters; AddStringParameter('ObjectKind','Netlist'); AddIntegerParameter('Index',5); AddStringParameter('ReturnGeneratedDocuments', 'True'); RunProcess('WorkspaceManager:GenerateReport'); GetIntegerParameter('Result', Result); If Result = 0 Then Exit; NetListName := GetStringParameter('File1', Result); End;
サーバープロセスルーチン
RunProcess
(ClientAPIReg unit in Altium Designer RTL)
Procedure RunProcess(Const Command: String);
The
プロセスが値を返す場合、それらはリターンバッファに格納され、GetXXXParameter 関数を使って読み取ることができます。
Command 文字列は次の形式を取ります: Server: Process
ここで、Server はそのプロセスを提供するサーバー名、Process はそのプロセスのコマンド名です。例として PCB:Zoom があります。
// available parameters for Dialog: Color or FileOpenSave Names ResetParameters; AddStringParameter('Dialog','Color'); // color dialog AddStringParameter('Color', '0'); // black color RunProcess('Client:RunCommonDialog'); //Result value obtained from the RunCommonDialog's Ok or Cancel buttons. GetStringParameter('Result',S); If (S = 'True') Then Begin GetStringParameter('Color',S); ShowInfo('New color is ' + S); End;
// Refresh PCB workspace. ResetParameters; AddStringParameter('Action', 'Redraw'); RunProcess('PCB:Zoom');
// Refresh Schematic workspace ResetParameters; AddStringParameter('Action', 'All'); RunProcess('Sch:Zoom');
Var ErrorCode : Integer; CommandLine : String; Result : Integer; NetlistName : String Begin ResetParameters; AddStringParameter('ObjectKind','Netlist'); AddIntegerParameter('Index',5); AddStringParameter('ReturnGeneratedDocuments', 'True'); RunProcess('WorkspaceManager:GenerateReport'); End;
サーバープロセスルーチン
スクリプティングシステム用のヘルパー関数およびオブジェクト
スクリプティングシステムには、特に文字列やオブジェクトのリストの作成および管理を簡素化するためのヘルパーオブジェクトがいくつか用意されています。
- CopyFile
- TStringList
- TList
- TIniFile
Borland Delphi のランタイムライブラリのルーチンやオブジェクトの多くは、スクリプティングシステムでは使用できません。これは、スクリプティングシステムが Int64 型パラメータをサポートしていないためです。
たとえば、TStream およびその派生クラスは、多くのメソッドが Int64 パラメータ型を使用するため、スクリプティングシステムでは使用できません。さらに、スクリプティングシステムは型を持たないため、クラスやレコードを定義することもできません。
CopyFile 関数
CopyFile 関数は、元のファイル名で指定されたファイルを、新しいファイル名で新しいファイルへコピーします。CopyFile 関数が成功した場合は true を返し、そうでない場合は false を返します。
FailIfExists パラメータは、CopyFile 関数が既存のターゲットファイルを新しいソースファイルで上書きできるかどうかを制御します。
- このパラメータが TRUE で、新しいファイルがすでに存在する場合、関数は失敗します。
- このパラメータが FALSE で、新しいファイルがすでに存在する場合、関数は既存ファイルを上書きして成功します。
Function CopyFile(SourceFileName, TargetFilename : PChar; FailIfExists : Boolean) : Boolean;
Procedure CopyFromTo; Var Project : String; PathSource : String; PathTarget : String; Begin PathSource := 'C:\3M Footprints.PcbLib'; PathTarget := 'C:\Temp\3M Footprints.PcbLib'; CopyFile(PathSource, PathTarget, False); End;
ヘルパークラスおよび関数
TIniFile オブジェクト
TIniFile オブジェクト(Borland Delphi の TIniFile クラスから派生)は、INI 拡張子を持つテキストファイルにアプリケーション固有の情報や設定を保存および取得します。TIniFile オブジェクトをインスタンス化する際には、TIniFile のコンストラクタのパラメータとして INI ファイル名を渡します。ファイルが存在しない場合、ini ファイルは自動的に作成されます。
その後、ReadString、ReadInteger、ReadBool メソッドを使用して値を読み取ることができます。あるいは、INI ファイルのセクション全体を読み取りたい場合は、ReadSection メソッドを使用できます。また、WriteBool、WriteInteger、WriteString メソッドを使用して値を書き込むこともできます。
各 Read ルーチンは 3 つのパラメータを取ります。最初のパラメータは INI ファイルのセクションを識別し、2 番目のパラメータは読み取りたい値を識別し、3 番目はそのセクションまたは値が INI ファイル内に存在しない場合のデフォルト値です。同様に、Write ルーチンはセクションや値が存在しない場合、それらを作成します。
このページの最後に、INI ファイルを作成するサンプルコードがあります。
DeleteKey(const Section, Ident: String);
EraseSection(const Section: String);
ReadSection (const Section: String; Strings: TStrings);
ReadSections(Strings: TStrings);
ReadSectionValues(const Section: String; Strings: TStrings);
ReadString(const Section, Ident, Default: String): String;
WriteString(const Section, Ident, Value: String);
UpdateFile;
Create(const FileName: String);
ReadBinaryStream(const Section, Name: string; Value: TStream): Integer;
ReadBool (const Section, Ident: String; Default: Boolean): Boolean ;
ReadDate (const Section, Ident: String; Default: TDateTime): TDateTime;
ReadDateTime (const Section, Ident: String; Default: TDateTime): TDateTime;
ReadFloat (const Section, Ident: String; Default: Double): Double;
ReadInteger(const Section, Ident: String; Default: Longint): Longint;
ReadTime (const Section, Ident: String; Default: TDateTime): TDateTime;
SectionExists (const Section: String): Boolean;
WriteBinaryStream(const Section, Name: string; Value: TStream);
WriteBool(const Section, Ident: String; Value: Boolean);
WriteDate(const Section, Ident: String; Value: TDateTime);
WriteDateTime(const Section, Ident: String; Value: TDateTime);
procedure WriteFloat(const Section, Ident: String; Value: Double);
WriteInteger(const Section, Ident: String; Value: Longint);
WriteTime(const Section, Ident: String; Value: TDateTime);
ValueExists (const Section, Ident: String): Boolean;
AfterConstruction
BeforeDestruction
ClassInfo
ClassName
ClassNameIs
ClassParent
ClassType
CleanupInstance
DefaultHandler
Destroy
Dispatch
FieldAddress
Free
FreeInstance
GetInterface
GetInterfaceEntry
GetInterfaceTable
InheritsFrom
InitInstance
InstanceSize
MethodAddress
MethodName
NewInstance
SafeCallException
Procedure WriteToIniFile(AFileName : String); Var IniFile : TIniFile; I,J : Integer; Begin IniFile := TIniFile.Create(AFileName); For I := 1 to 2 Do For J := 1 to 2 Do IniFile.WriteString('Section'+IntToStr(I), 'Key' + IntToStr(I) + '_' + IntToStr(J), 'Value' + IntToStr(I)); IniFile.Free; (* The INIFILE object generates a text file of the following format; [Section1] Key1_1=Value1 Key1_2=Value1 [Section2] Key2_1=Value2 Key2_2=Value2 *) End;
ヘルパークラスおよび関数
\Examples\Scripts\General\ フォルダ内の IniFileEg スクリプト例を参照してください。
TList オブジェクト
TList クラスは、オブジェクトへのポインタ配列を格納します。たとえば Altium Designer のスクリプト内で、TList オブジェクトのインスタンスを作成し、この TList オブジェクトに個々のオブジェクトを追加、ソート、削除できます。
Capacity
Count
Items
List
Add(Item: Pointer): Integer;
Assign(ListA: TList; AOperator: TListAssignOp = laCopy; ListB: TList = nil);
Clear
Delete(Index: Integer);
Destroy
Exchange(Index1, Index2: Integer);
Expand: TList;
Extract(Item: Pointer): Pointer;
First: Pointer;
IndexOf
IndexOf(Item: Pointer): Integer;
function Last: Pointer;
Move(CurIndex, NewIndex: Integer);
Pack
Remove(Item: Pointer): Integer;
Sort
メソッド
AfterConstruction
BeforeDestruction
ClassInfo
ClassName
ClassNameIs
ClassParent
ClassType
CleanupInstance
Create
DefaultHandler
Dispatch
FieldAddress
Free
FreeInstance
GetInterface
GetInterfaceEntry
GetInterfaceTable
InheritsFrom
InitInstance
InstanceSize
MethodAddress
MethodName
NewInstance
SafeCallException
//The following code adds an object to TheList container if the object is not in the list. Begin If TheList.IndexOf(AnObject)=-1 Then TheList.Add(AnObject); // do something TheList.Remove(AnObject); End;
ヘルパークラスおよび関数
TStringList オブジェクト
TStringList オブジェクトは、文字列のリストを保持します。スクリプト内で TStringList オブジェクトのインスタンスを作成し、このオブジェクトに個々の文字列を追加、ソート、削除できます。
TStringList コンテナに対してカスタマイズしたソートを行う必要がある場合は、独自のソートルーチンを作成する必要があります。以下の例を参照してください。
Capacity: Integer;
CaseSensitive: Boolean;
Count: Integer;
Duplicates: TDuplicates;
Objects Integer: TObject;
Sorted: Boolean;
Strings Integer: string;
CommaText: string;
DelimitedText: string;
Delimiter: Char;
Names Integer: string;
QuoteChar: Char;
StringsAdapter: IStringsAdapter;
Text: string;
Values string: string;
Add(const S: string): Integer;
AddObject(const S: string; AObject: TObject: Integer);
Clear
Delete(Index: Integer);
Destroy
Exchange(Index1, Index2: Integer);
Find(const S: string; var Index: Integer): Boolean;
IndexOf(const S: string): Integer;
Insert(Index: Integer; const S: string);
InsertObject(Index: Integer; const S: string; AObject: TObject);
Sort
メソッド
AddStrings(Strings: TStrings);
Append(const S: string);
Assign(Source: TPersistent);
BeginUpdate
EndUpdate
Equals(Strings: TStrings): Boolean;
GetText: PChar;
IndexOfName(const Name: string): Integer;
IndexOfObject(AObject: TObject): Integer;
LoadFromFile(const FileName: string);
LoadFromStream(Stream: TStream);
Move(CurIndex, NewIndex: Integer);
SaveToFile(const FileName: string);
SaveToStream(Stream: TStream);
SetText(Text: PChar);
メソッド
GetNamePath
メソッド
AfterConstruction
BeforeDestruction
ClassInfo
ClassName
ClassNameIs
ClassParent
ClassType
CleanupInstance
Create
DefaultHandler
Dispatch
FieldAddress
Free
FreeInstance
GetInterface
GetInterfaceEntry
GetInterfaceTable
InheritsFrom
InitInstance
InstanceSize
MethodAddress
MethodName
NewInstance
SafeCallException
Procedure TDialogForm.FormCreate(Sender: TObject); Var StringsList : TStringList; Index : Integer; Begin StringsList := TStringList.Create; Try StringsList.Add('Capacitors'); StringsList.Add('Resistors'); StringsList.Add('Antennas'); StringsList.Sort; // The Find method will only work on sorted lists. If StringsList.Find('Resistor', Index) then Begin ListBox.Items.AddStrings(StringsList); Label.Caption := 'Antennas has an index value of ' + IntToStr(Index); End; Finally StringsList.Free; End; End; End;
カスタマイズされたソートルーチンの例
Altium Designer のインストール先にある \Examples\Scripts\WSM\ フォルダー内の Netlister スクリプト例を参照してください。
ヘルパークラスと関数