/*
sopc2dts - Devicetree generation for Altera systems

Copyright (C) 2013 Walter Goossens <waltergoossens@home.nl>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
package sopc2dts.lib.components.altera;

import sopc2dts.lib.AvalonSystem;
import sopc2dts.lib.AvalonSystem.SystemDataType;
import sopc2dts.lib.Connection;
import sopc2dts.lib.components.BasicComponent;
import sopc2dts.lib.components.Interface;
import sopc2dts.lib.components.SopcComponentDescription;
public class VIPMixer extends BasicComponent {
	boolean connectedOthers = false;
	public VIPMixer(String cName, String iName, String ver, SopcComponentDescription scd) {
		super(cName, iName, ver, scd);
	}
	public boolean removeFromSystemIfPossible(AvalonSystem sys)
	{
		if(!connectedOthers) {
			connectedOthers=true;
			Interface ifMaster = getInterfaceByName("dout");
			for(Connection conn2NewSlave : ifMaster.getConnections()) {
				for(Interface ifSlave : getInterfaces(SystemDataType.STREAMING, false))
				{
					for(Connection conn2NewMaster : ifSlave.getConnections()) {
						new Connection(conn2NewMaster.getMasterInterface(), conn2NewSlave.getSlaveInterface(), SystemDataType.STREAMING, true);
					}
				}
			}
			return true;
		} else {
			return false;
		}
	}
}

@@ -892,16 +892,47 @@
 System;%0A
+import sopc2dts.lib.BoardInfo;%0A
 import s
@@ -972,16 +972,16 @@
 taType;%0A
-
 import s
@@ -1150,16 +1150,101 @@
 iption;%0A
+import sopc2dts.lib.devicetree.DTNode;%0Aimport sopc2dts.lib.devicetree.DTPropNumber;%0A%0A
 public c
@@ -1438,19 +1438,282 @@
 , scd);%0A
-
 %09%7D%0A
+%09%0A%09@Override%0A%09public DTNode toDTNode(BoardInfo bi, Connection conn)%0A%09%7B%0A%09%09DTNode node = super.toDTNode(bi, conn);%0A%09%09node.addProperty(new DTPropNumber(%22num-channels%22, new Long(getInterfaces(SystemDataType.STREAMING, false).size())));%0A%09%09return node;%0A%09%7D%0A%09%0A%09@Override%0A
 %09public 

Add property for nr of input channels