public class PFFirmataConnector extends java.lang.Object implements PFComponent, PFDataUpdateEventSource, PFProcessTerminateEventSource, PFActionEventSource, PFXMLSerializable
このコンポーネントから発生するイベントは以下のとおり。
トリガ | 結果データ | イベント番号 |
---|---|---|
ポート切断時 | 切断したポート名 String |
0 |
ポート接続時 | 接続したポート名 String |
1 |
トリガ | 対象データ | 更新データ | イベント番号 |
---|---|---|---|
ポートのデータ受信 | ピン番号/td> | 更新後の値 | 0 |
コンストラクタと説明 |
---|
PFFirmataConnector()
コンストラクタ。
|
修飾子とタイプ | メソッドと説明 |
---|---|
boolean |
addDigitalInputConstantEventRule(int index,
int eventNo,
boolean high,
long msec)
デジタル入力の一定ルールを追加する。
|
boolean |
addDigitalInputTransitionEventRule(int index,
int eventNo,
boolean high)
デジタル入力の遷移ルールを追加する。
|
boolean |
addInputConstantEventRule(int index,
int eventNo,
int border,
boolean up,
long msec)
入力値の一定ルールを追加する。
|
boolean |
addInputRangeEventRule(int index,
int eventNo,
int lower,
int upper)
入力値範囲のルールを追加する。
|
boolean |
addInputRangeEventRule(int index,
int eventNo,
int lower,
int upper,
boolean diff)
入力値の範囲ルールを追加する。
|
boolean |
addInputTransitionEventRule(int index,
int eventNo,
int border,
boolean up)
入力値の遷移ルールを追加する。
|
boolean |
addInputTransitionEventRule(int index,
int eventNo,
int border,
boolean up,
boolean diff)
入力値の遷移ルールを追加する。
|
void |
addPFActionListener(PFActionListener lis)
引数で与えられたイベントリスナを登録し、
アクションイベント発生時に処理を行う対象とする。
|
void |
addPFDataUpdateListener(PFDataUpdateListener lis)
引数で与えられたイベントリスナを登録し、
データ更新イベント発生時に処理を行う対象とする。
|
void |
addPFProcessTerminateListener(PFProcessTerminateListener lis)
引数で与えられたイベントリスナを登録し、
処理完了イベント発生時に処理を行う対象とする。
|
void |
clearEventRules()
全ルールを削除する。
|
void |
evaluateInputRules()
ルール判定の実行。
|
protected void |
fireDataUpdated(PFDataUpdateEvent event)
データ更新イベントを発生させる。
|
protected void |
fireProcessTerminated(PFProcessTerminateEvent event)
処理完了イベントを発生させる。
|
int |
getAnalogInputIndexAt(int index)
アナログ入力のインデックスを位置指定で取得する。
|
PFObjectList |
getAnalogInputIndexList()
アナログ入力のインデックスリストを取得する。
|
int |
getAnalogInputSize()
アナログ入力の配列サイズを取得する。
|
long |
getAnalogInputValueAt(int index)
アナログ入力の値を位置指定で取得する。
|
PFObjectList |
getAnalogInputValueList()
アナログ入力の値リストを取得する。
|
int |
getComponentID()
コンポーネントIDを取得する。
|
java.lang.String |
getComponentKey()
コンポーネントキーを取得する。
|
PFMultiLocaleString |
getComponentKeys()
全ロケール分のコンポーネントキーを返す。
|
java.lang.String |
getComponentName()
コンポーネント名称を取得する。
|
java.lang.String |
getComponentPublicName()
コンポーネント公開名を取得する.
|
java.lang.String |
getComponentString()
コンポーネントの文字列表現を取得する。
|
float |
getCurrentSamplingRate()
現在の入力ピンのサンプリング回数を取得する。
|
long |
getCurrentSamplingTime()
現在の入力ピンのサンプリング間隔を取得する。
|
int |
getDigitalInputIndexAt(int index)
デジタル入力のインデックスを位置指定で取得する。
|
PFObjectList |
getDigitalInputIndexList()
デジタル入力のインデックスリストを取得する。
|
int |
getDigitalInputSize()
デジタル入力の配列サイズを取得する。
|
boolean |
getDigitalInputValueAt(int index)
デジタル入力の値を位置指定で取得する。
|
PFObjectList |
getDigitalInputValueListAsInteger()
デジタル入力の値リストを取得する。
|
java.util.Iterator |
getPFActionListenerList()
イベントリスナ配列を取得する。
|
java.util.Iterator |
getPFDataUpdateListenerList()
データ更新イベントリスナ配列を取得する。
|
java.util.Iterator |
getPFProcessTerminateListenerList()
処理完了イベントリスナ配列を取得する。
|
java.lang.String |
getPinModeAt(int index)
接続デバイスのピンモードを取得する。
|
PFObjectList |
getPinModeList()
接続デバイスのピンモードの一覧を取得する。
|
int |
getPinsCount()
接続デバイスのピン数を取得する。
|
PFObjectTable |
getPinTable()
現在のピンの状態をテーブルで取得する。
|
long |
getPinValueAt(int index)
接続デバイスのピンの値を取得する。
|
PFObjectList |
getPortList()
シリアルポートの一覧を取得する。
|
protected void |
init()
初期化する。
|
boolean |
isAllowPullTransfer()
他PFからのPull型コンポーネント転送要求に対する可否属性を取得する.
|
boolean |
isAllowPushTransfer()
他PFへのPush型コンポーネント転送要求に対する可否属性を取得する.
|
boolean |
isAllowRemoteInvocation()
他PFからのコンポーネント連携要求に対する可否属性を取得する.
|
boolean |
isNoUpdateEventMode()
データ更新イベント無モードを取得する。
|
boolean |
isRepeatMode()
連続データ更新モードを取得する。
|
boolean |
isStarted()
接続状態を返す。
|
void |
localeUpdated()
ロケール変更に対応する。
|
void |
readXML(PFXMLLoader in)
XMLを入力する.
|
void |
removePFActionListener(PFActionListener lis)
引数で与えられたイベントリスナを削除し、
アクションイベント発生時に処理を行う対象から外す。
|
void |
removePFDataUpdateListener(PFDataUpdateListener lis)
引数で与えられたイベントリスナを削除し、
データ更新イベント発生時に処理を行う対象から外す。
|
void |
removePFProcessTerminateListener(PFProcessTerminateListener lis)
引数で与えられたイベントリスナを削除し、
処理完了イベント発生時に処理を行う対象から外す。
|
void |
setAllowPullTransfer(boolean flag)
他PFからのPull型コンポーネント転送要求に対する可否属性を設定する.
|
void |
setAllowPushTransfer(boolean flag)
他PFへのPush型コンポーネント転送要求に対する可否属性を設定する.
|
void |
setAllowRemoteInvocation(boolean flag)
他PFからのコンポーネント連携要求に対する可否属性を設定する.
|
void |
setComponentID(int id)
コンポーネントIDを設定する。
|
void |
setComponentKey(java.lang.String key)
コンポーネントキーを設定する。
|
void |
setComponentKeys(PFMultiLocaleString keys)
全ロケール分のコンポーネントキーを設定する。
|
void |
setComponentPublicName(java.lang.String publicName)
コンポーネント公開名を設定する.
|
void |
setNoUpdateEventMode(boolean noupdate)
データ更新イベント無モードを設定する。
|
void |
setPinModeAt(int index,
java.lang.String modeName)
接続デバイスのピンモードを設定する。
|
void |
setPinValueAt(int index,
long value)
接続デバイスのピンの値を設定する。
|
void |
setRepeatMode(boolean repeat)
連続データ更新モードを設定する。
|
void |
start()
ポートを検索して接続を開始する。
|
boolean |
start(java.lang.String port)
ポート名指定で接続を開始する。
|
void |
stop()
接続を終了する。
|
void |
updateInputArray()
入力ピンの値の配列を更新する。
|
void |
writeXML(PFXMLGenerator out)
XMLを出力する.
|
public PFFirmataConnector() throws PFException
PFException
public java.lang.String getComponentName()
getComponentName
インタフェース内 PFComponent
public java.lang.String getComponentKey()
getComponentKey
インタフェース内 PFComponent
public void setComponentKey(java.lang.String key)
setComponentKey
インタフェース内 PFComponent
key
- コンポーネントキーpublic PFMultiLocaleString getComponentKeys()
public void setComponentKeys(PFMultiLocaleString keys)
keys
- 全ロケール分のコンポーネントキーpublic void setComponentID(int id)
PFComponentBus
から設定される。
各コンポーネント内では操作しないこと。setComponentID
インタフェース内 PFComponent
id
- 設定するコンポーネントIDpublic java.lang.String getComponentString()
getComponentString
インタフェース内 PFComponent
public int getComponentID()
getComponentID
インタフェース内 PFComponent
public java.lang.String getComponentPublicName()
getComponentPublicName
インタフェース内 PFComponent
public void setComponentPublicName(java.lang.String publicName) throws PFComponentException
setComponentPublicName
インタフェース内 PFComponent
publicName
- 設定するコンポーネント公開名PFComponentException
- 規約に反する名前が設定されようとした場合public boolean isAllowRemoteInvocation()
isAllowRemoteInvocation
インタフェース内 PFComponent
public void setAllowRemoteInvocation(boolean flag)
setAllowRemoteInvocation
インタフェース内 PFComponent
flag
- コンポーネント連携要求に対する可否public boolean isAllowPullTransfer()
isAllowPullTransfer
インタフェース内 PFComponent
public void setAllowPullTransfer(boolean flag)
setAllowPullTransfer
インタフェース内 PFComponent
flag
- Pull型コンポーネント転送要求に対する可否public boolean isAllowPushTransfer()
isAllowPushTransfer
インタフェース内 PFComponent
public void setAllowPushTransfer(boolean flag)
setAllowPushTransfer
インタフェース内 PFComponent
flag
- Push型コンポーネント転送要求に対する可否public java.util.Iterator getPFProcessTerminateListenerList()
getPFProcessTerminateListenerList
インタフェース内 PFProcessTerminateEventSource
public void addPFProcessTerminateListener(PFProcessTerminateListener lis)
addPFProcessTerminateListener
インタフェース内 PFProcessTerminateEventSource
lis
- 追加対象イベントリスナpublic void removePFProcessTerminateListener(PFProcessTerminateListener lis)
removePFProcessTerminateListener
インタフェース内 PFProcessTerminateEventSource
lis
- 削除対象イベントリスナprotected void fireProcessTerminated(PFProcessTerminateEvent event) throws PFMethodException, PFRuntimeException
event
- 処理完了イベントPFMethodException
- イベント伝播先のメソッド起動時のエラーPFRuntimeException
- 予期しない実行時エラーpublic java.util.Iterator getPFDataUpdateListenerList()
getPFDataUpdateListenerList
インタフェース内 PFDataUpdateEventSource
public void addPFDataUpdateListener(PFDataUpdateListener lis)
addPFDataUpdateListener
インタフェース内 PFDataUpdateEventSource
lis
- 追加対象イベントリスナpublic void removePFDataUpdateListener(PFDataUpdateListener lis)
removePFDataUpdateListener
インタフェース内 PFDataUpdateEventSource
lis
- 削除対象イベントリスナprotected void fireDataUpdated(PFDataUpdateEvent event) throws PFMethodException, PFRuntimeException
event
- データ更新イベントPFMethodException
- イベント伝播先のメソッド起動時のエラーPFRuntimeException
- 予期しない実行時エラーpublic java.util.Iterator getPFActionListenerList()
getPFActionListenerList
インタフェース内 PFActionEventSource
public void addPFActionListener(PFActionListener lis)
addPFActionListener
インタフェース内 PFActionEventSource
lis
- 追加対象イベントリスナpublic void removePFActionListener(PFActionListener lis)
removePFActionListener
インタフェース内 PFActionEventSource
lis
- 削除対象イベントリスナpublic void localeUpdated()
localeUpdated
インタフェース内 PFComponent
public void writeXML(PFXMLGenerator out) throws java.io.IOException
writeXML
インタフェース内 PFXMLSerializable
out
- XML出力ユーティリティjava.io.IOException
public void readXML(PFXMLLoader in)
readXML
インタフェース内 PFXMLSerializable
in
- XML入力ユーティリティpublic boolean start(java.lang.String port) throws PFException
port
- ポート名PFException
- 接続失敗またはイベント処理失敗public void start() throws PFException
PFException
- 接続失敗public boolean isStarted()
public void stop() throws PFException
PFException
- 接続終了失敗またはイベント処理失敗public PFObjectList getPortList()
public int getPinsCount()
public PFObjectList getPinModeList()
public java.lang.String getPinModeAt(int index)
index
- 位置public void setPinModeAt(int index, java.lang.String modeName) throws PFException
index
- 位置modeName
- モード名PFException
- モード設定失敗public long getPinValueAt(int index)
index
- 位置public void setPinValueAt(int index, long value) throws PFException
index
- 位置value
- 値PFException
- 値設定の失敗public void evaluateInputRules() throws PFException
PFException
- イベント処理失敗public PFObjectTable getPinTable()
public void updateInputArray()
public long getCurrentSamplingTime()
public float getCurrentSamplingRate()
public int getAnalogInputSize()
public long getAnalogInputValueAt(int index)
index
- 配列内の位置public int getAnalogInputIndexAt(int index)
index
- 配列内の位置public PFObjectList getAnalogInputValueList()
public PFObjectList getAnalogInputIndexList()
public int getDigitalInputSize()
public boolean getDigitalInputValueAt(int index)
index
- 位置public int getDigitalInputIndexAt(int index)
index
- 位置public PFObjectList getDigitalInputValueListAsInteger()
public PFObjectList getDigitalInputIndexList()
public boolean addInputRangeEventRule(int index, int eventNo, int lower, int upper)
index
- ピン位置eventNo
- イベント番号lower
- 下限値upper
- 上限値public boolean addInputRangeEventRule(int index, int eventNo, int lower, int upper, boolean diff)
index
- ピン位置eventNo
- イベント番号lower
- 下限値upper
- 上限値diff
- 差分かどうかpublic boolean addDigitalInputTransitionEventRule(int index, int eventNo, boolean high)
index
- ピン位置eventNo
- イベント番号high
- 対象値(HIGHがtrue)public boolean addInputTransitionEventRule(int index, int eventNo, int border, boolean up)
index
- ピン位置eventNo
- イベント番号border
- 基準値up
- 遷移方向(上がtrue)public boolean addInputTransitionEventRule(int index, int eventNo, int border, boolean up, boolean diff)
index
- ピン位置eventNo
- イベント番号border
- 基準値up
- 遷移方向(上がtrue)diff
- 差分かどうかpublic boolean addDigitalInputConstantEventRule(int index, int eventNo, boolean high, long msec)
index
- ピン位置eventNo
- イベント番号high
- 対象値(HIGHがtrue)msec
- 経過時間public boolean addInputConstantEventRule(int index, int eventNo, int border, boolean up, long msec)
index
- ピン位置eventNo
- イベント番号border
- 基準値up
- 遷移方向(上がtrue)msec
- 経過時間public void clearEventRules()
public void setRepeatMode(boolean repeat)
repeat
- 連続の場合truepublic boolean isRepeatMode()
public void setNoUpdateEventMode(boolean noupdate)
noupdate
- 無の場合truepublic boolean isNoUpdateEventMode()
protected void init()