func CreateXmlIONodePosHint(n bh.NodeIf, path string) (xmln *backend.XmlNodePosHint) { if len(path) == 0 { xmln = backend.XmlNodePosHintNew(n.Name()) } else { xmln = backend.XmlNodePosHintNew(fmt.Sprintf("%s/%s", path, n.Name())) } empty := image.Point{} for _, p := range n.PathList() { for _, m := range gr.ValidModes { xmlp := string(gr.CreatePathMode(p, m)) pos := n.PathModePosition(p, m) if pos != empty { xmln.Entry = append(xmln.Entry, *backend.XmlModeHintEntryNew(xmlp, pos.X, pos.Y)) } } } for _, p := range n.InPorts() { xmlp := backend.XmlPortPosHintNew(p.Name()) xmlp.Entry = freesp.CreateXmlModePosition(p).Entry xmln.InPorts = append(xmln.InPorts, *xmlp) } for _, p := range n.OutPorts() { xmlp := backend.XmlPortPosHintNew(p.Name()) xmlp.Entry = freesp.CreateXmlModePosition(p).Entry xmln.OutPorts = append(xmln.OutPorts, *xmlp) } return }
func CreateXmlProcessHint(p pf.ProcessIf) (xmlp *backend.XmlProcessPosHint) { xmlp = backend.XmlProcessPosHintNew(p.Name()) xmlp.Entry = freesp.CreateXmlModePosition(p).Entry for _, c := range p.InChannels() { xmlp.InChannels = append(xmlp.InChannels, *CreateXmlChannelHint(c)) } for _, c := range p.OutChannels() { xmlp.OutChannels = append(xmlp.OutChannels, *CreateXmlChannelHint(c)) } return }
func CreateXmlArchHint(a pf.ArchIf) (xmla *backend.XmlArchPosHint) { xmla = backend.XmlArchPosHintNew(a.Name()) xmla.Entry = freesp.CreateXmlModePosition(a).Entry for _, p := range a.ArchPorts() { xmla.ArchPorts = append(xmla.ArchPorts, *CreateXmlArchPortHint(p)) } for _, p := range a.Processes() { xmla.Processes = append(xmla.Processes, *CreateXmlProcessHint(p)) } return }
func CreateXmlOutPort(p bh.PortIf) (xmlp *backend.XmlOutPort) { xmlp = backend.XmlOutPortNew(p.Name(), p.SignalType().TypeName()) xmlp.Entry = freesp.CreateXmlModePosition(p).Entry return }
func CreateXmlChannelHint(c pf.ChannelIf) (xmlc *backend.XmlChannelPosHint) { xmlc = backend.XmlChannelPosHintNew() xmlc.Entry = freesp.CreateXmlModePosition(c).Entry return }
func CreateXmlArchPortHint(p pf.ArchPortIf) (xmlp *backend.XmlArchPortPosHint) { xmlp = backend.XmlArchPortPosHintNew() xmlp.Entry = freesp.CreateXmlModePosition(p).Entry return }