Excel 用の RTI DDS アドインを調べています。付属の Hello_simple HelloPublisher.java の例を書き直して、文字列を発行し、Excel に取得させようとしています。私がフィードした文字列の値を表示することを除いて、すべてが機能します。(メッセージが送信された時間を取得し、他のすべてのメタデータは問題ありません)
私のコードは次のようになります。
public class Publish {
public static void main(final String[] args){
// Create the DDS Domain participant on domain ID 123
final DomainParticipant participant = DomainParticipantFactory.get_instance().create_participant(
123, //Domain ID
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT,
null, // Listener
StatusKind.STATUS_MASK_NONE);
if (participant == null) {
System.err.println("Unable to create domain participant");
return;
}
// Create the topic "Message" for the String type
final Topic topic = participant.create_topic(
"Message",
StringTypeSupport.get_type_name(),
DomainParticipant.TOPIC_QOS_DEFAULT,
null, // listener
StatusKind.STATUS_MASK_NONE);
if (topic == null) {
System.err.println("Unable to create topic.");
return;
}
// Create the data writer using the default publisher
final StringDataWriter dataWriter =
(StringDataWriter) participant.create_datawriter(
topic,
Publisher.DATAWRITER_QOS_DEFAULT,
null, // listener
StatusKind.STATUS_MASK_NONE);
if (dataWriter == null) {
System.err.println("Unable to create data writer\n");
return;
}
System.out.println("Ready to write data.");
System.out.println("When the subscriber is ready, you can start writing.");
System.out.print("Press CTRL+C to terminate or enter an empty line to do a clean shutdown.\n\n");
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
while (true) {
System.out.print("Please type a message> ");
final String value = reader.readLine();
if (value == null) {break;}
dataWriter.write(value, InstanceHandle_t.HANDLE_NIL);
if (value.equals("")) { break; }
}
} catch (final IOException e) {e.printStackTrace();
} catch (final RETCODE_ERROR e) {e.printStackTrace();}
System.out.println("Exiting...");
participant.delete_contained_entities();
DomainParticipantFactory.get_instance().delete_participant(participant);
}
}
値を表示するためにExcelで行う呼び出しは
=RTD("dds2excel.connect",,"TYPE:DDS::String","TYPENAME:DDS::String","TOPIC:Message","FIELD:value")
(RTI アドインによって自動生成されます) 私はまだ RTI と DDS にあまり慣れていませんが、Excel がこのデータの実際の内容を取得したくないと感じています。それに?したがって、リッスンしているドメインのメタデータのみを認識するのはなぜですか。
任意のポインタをいただければ幸いです。