Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Adding value-add server

On 28.06.2013 20:40, Stieber, Uwe wrote:
Hi,

Making the value-add known to the Target Explorer is done via a very small contribution. The class to implement looks like

public class ValueAdd extends AbstractExternalValueAdd {

	@Override
	protected IPath getLocation() {
		Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
		return <path to the value add executable>;
	}
}

The Value Add is registerd via plugin.xml:

    <extension point="org.eclipse.tcf.te.tcf.core.valueadds">
       <valueadd
             class="<package>.ValueAdd"
             id="MyValueAddID"
             label="Value Add"
             optional="true">
       </valueadd>
    </extension>

And

    <extension point="org.eclipse.tcf.te.tcf.core.valueaddBindings">
       <binding
             id="MyValueAddBinding"
             valueAddId=" MyValueAddID ">
             <enablement>
                <with variable="peer">
                   <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
                   <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
                      <test property="org.eclipse.tcf.te.tcf.locator.isValueAdd" value="false"/>
                   </adapt>
                </with>
             </enablement>
       </binding>
    </extension>

You can extend the enablement to make the value-add to be used only for particular peers or use this standard (minimum) enablement.

That's all you need. The value-add launch and shutdown and the setup of the redirection chain is handled by the Target Explorer.

Uwe,

thanks for response. I have several further questions:

- Why is this setup must be done in IDE? It would seem more modular if a value add-on can both automatically connect to some
  specific agent, and then IDE would notice that connection and hide, or deemphasize the underlying agent? In fact, why can't
  two value-add servers and the backend agent sort communication between themselves and then be presented in IDE as unified
  whole, by default?

- You say I can make a value-add be used only for particular peers? How do I do that in user interface? I don't think it's
  good idea to specify specific address in plugin.xml, rather, I would want to right click on the target and say
  'enable OS awareness for my fancy RTOS', instead.

- Can I define a value-add entirely in IDE? It seems like AbstractValueAdd might be useful, but it does not have any subclasses
  except for AbstractExternalValueAdd.

- Suppose I want an IDE-side value-add for serial connections, so that the user can pick a target, say
  "This has serial connection", configure details for serial connection and then, so that I can right click on a target
  and open terminal (using real serial). What support TCF has for this? How can custom UI be integrated with the
  "System Management" view, and to target properties editor? I see that a target properties dialog has an area for
   custom properties, but that's not quite perfect UI.

- In fact, I am not sure it's good idea to merge general services framework with TCF protocol. Support I want to
  represent a target that does not have Ethernet, and can only be debugged over JTAG (and so can never ever run
  TCF agent). How would I do that?

Thanks,

--
Vladimir Prus
CodeSourcery / Mentor Graphics
http://www.mentor.com/embedded-software/


Back to the top