As recommended I used Google's WindowBuilder to add a jformatedtextfield. This worked for 2.0beta3, 2.0 release and the current trunk. However on execution of the code I get some strange results including concatenated portnumbers (portnumber 49500 a becomes after a while 4950049500 !). So I was wondering if I implemented the repeated send command the wrong way (for-loop below)? Should I take some precautions before issuing serial send message commands?

Any hints appreciated.
Olaf

My code (adjustment to  Hl7V2MessageEditorPanel.java):

                mySendButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                                int repeatSend = 1;
                                      try {
repeatSend = ((Number)myformattedTextField_1.getValue()).intValue(); } catch (java.lang.NumberFormatException exp) {
                                                  repeatSend = 1;
} myOutboundInterfaceComboModel.getIndexOf(myOutboundInterfaceComboModel.getSelectedItem()); int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex(); OutboundConnection connection = myController.getOutboundConnectionList().getConnections().get(selectedIndex); activateSendingActivityTabForConnection(connection); List<AbstractMessage<?>> messages = myMessage.getMessages();
                                for (int i=0; i < repeatSend; i+=1) {
myController.sendMessages(connection, messages);

                                }
                        }
                });


On 07/11/2012 04:38 PM, James Agnew wrote:
Hi Olaf,

That sounds like a useful feature.

The "new" TestPanel is actually in a separate maven module altogether. The deprocation message you found is a bit unclear, I'd agree. If you have checked out the entire HAPI codebase, look for a maven module called "hapi-testpanel". This module contains the new TestPanel.

I haven't gotten around to writing documentation on working with the TestPanel codebase yet, but feel free to let me know if anything isn't clear. For what it's worth, I'd highly recommend importing the submodule as a top level project in Eclipse, and installing Google's eclipse plugin or the standalone "windowbuilder" plugin to edit the UI screens: http://www.eclipse.org/windowbuilder/

Cheers,
James


On Wed, Jul 11, 2012 at 9:00 AM, Olaf Zevenboom <[email protected] <mailto:[email protected]>> wrote:

    Dear List,

    I am new to HAPI. After downloading HAPI (2.0 beta1) and the
    TestPanel I noticed that the TestPanel was almost exactly what I
    needed. I did some tests and it worked ok. Only one feature seems
    to be missing so I decided to add some code to it myself. I want
    to have a JFormattedTextField so I can specify how often a
    testmessage must be send. Ideal for stress testing.
    My setup consists of Linux Debian stable ("squeeze") so the
    software is quite old. Eclipse 3.5.2 , Maven 2 and Sun JDK 6.
    Compiling seems to work fine. I installed the fat-jar extension to
    Eclipse. If I use that to export HAPI TestPanel + dependencies and
    specify a classpath ". ca.uhn.hl7v2.app.TestPanel" as suggested by
    http://hl7api.sourceforge.net/base/apidocs/ca/uhn/hl7v2/app/TestPanel.html
    and select as main class TestPanel it runs without error. Well....
    The problem is that I get the wrong screen. Might not be too
    surprising considering the documentation already states
    "depricated", but that is often the case in the documentation
    provided so it seems. Also I fail to see an alternative. It hints
    at "*Deprecated.* /use new TestPanel".
    /The screen I get consists of toolbar on top with "utf8 load clear
    Encode inbound Encode outbound use XML connect send disconnect"
    and the windowpane itself has as it's title "Message Tester".

    What am I doing wrong and how can I fix this please? What would be
    the correct non-deprecated classes to use?

    Thanks in advance,

    Olaf

-- This message has been scanned for viruses and
    dangerous content by *MailScanner* <http://www.mailscanner.info/>,
    and is
    believed to be clean.

    
------------------------------------------------------------------------------
    Live Security Virtual Conference
    Exclusive live event will cover all the ways today's security and
    threat landscape has changed and how IT managers can respond.
    Discussions
    will include endpoint security, mobile security and the latest in
    malware
    threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
    _______________________________________________
    Hl7api-devel mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/hl7api-devel



--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to