Package modbuspal.binding

Examples of modbuspal.binding.Binding


        Node parentRegister = XMLTools.findParent(node,"register");
        String parentAddress = XMLTools.getAttribute(ModbusPalXML.XML_ADDRESS_ATTRIBUTE, parentRegister);
        int registerAddress = Integer.parseInt( parentAddress );

        // Instanciate the binding:
        Binding binding = bindingFactory.newInstance(className);
        binding.setup(automation, wordOrder);


        if( slave==null)
        {
            // retrieve the slave that is the parent of this register
View Full Code Here


     * @return value of the register. If the register doesn't exist, returns 0
     * by default.
     */
    public int getValue(int index)
    {
        Binding binding = bindings.get(index);
        if( binding != null )
        {
            return getValue(binding);
        }
        else
View Full Code Here

        }

        // set the binding of the register
        if( binding != null )
        {
            Binding old = bindings.get(index);
            if( old!=null )
            {
                old.detach();
            }
            binding.attach(this,index);
            bindings.put(index, binding );
        }
View Full Code Here

     * @param index index of the value to remove
     */
    public void remove(int index)
    {
        // check if a binding exists
        Binding binding = bindings.get( index );
        if( binding != null )
        {
            binding.detach();
            bindings.remove(index);
        }

        // delete register
        values.delete( index );
View Full Code Here

    void replace(ModbusRegisters source, int srcIndex, int dstIndex)
    {
        Integer value = source.values.getByIndex(srcIndex);
        String name = source.names.get(srcIndex);
        Binding binding = source.bindings.get(srcIndex);
        set(dstIndex, value, name, binding);
    }
View Full Code Here

    void paste(int destIndex, RegisterCopy src)
    {
        try
        {
            Binding b = null;
            if( src.registerBinding!=null )
            {
                b = (Binding) src.registerBinding.clone();
            }
            set( destIndex, src.registerValue, src.registerName, b);
View Full Code Here

            return null;
        }

        Integer value = source.values.getByIndex(sourceIndex);
        String name = source.names.get(sourceIndex);
        Binding binding = source.bindings.get(sourceIndex);
        return new RegisterCopy( sourceIndex, value, name, binding );
    }
View Full Code Here

     * automation it is linked to.
     * @param index index of the value from which the binding must be removed.
     */
    public void unbind(int index)
    {
        Binding removed = bindings.remove(index);
        if( removed!=null )
        {
            removed.detach();
            notifyTableChanged( values.getOrderOf(index) );
        }
    }
View Full Code Here

     * @param index index of the register to check
     * @return true if the register is bound to an automation.
     */
    public boolean isBound(int index)
    {
        Binding binding = bindings.get(index);
        return (binding!=null);
    }
View Full Code Here

        Integer addressesArray[] = new Integer[0];
        addressesArray = addressesSet.toArray(addressesArray);
        for(int i=0; i<addressesArray.length; i++)
        {
            Integer address = addressesArray[i];
            Binding b = bindings.get(address);
            if( b.getClassName().compareTo(classname)==0 )
            {
                bindings.remove(address);
            }
        }
        notifyTableChanged();
View Full Code Here

TOP

Related Classes of modbuspal.binding.Binding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.