当前位置: 首页>>代码示例>>Golang>>正文


Golang ArchIf.Processes方法代码示例

本文整理汇总了Golang中github.com/axel-freesp/sge/interface/platform.ArchIf.Processes方法的典型用法代码示例。如果您正苦于以下问题:Golang ArchIf.Processes方法的具体用法?Golang ArchIf.Processes怎么用?Golang ArchIf.Processes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/axel-freesp/sge/interface/platform.ArchIf的用法示例。


在下文中一共展示了ArchIf.Processes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: CreateXmlArch

func CreateXmlArch(a pf.ArchIf) *backend.XmlArch {
	ret := backend.XmlArchNew(a.Name())
	for _, t := range a.IOTypes() {
		ret.IOType = append(ret.IOType, *CreateXmlIOType(t))
	}
	for _, p := range a.Processes() {
		ret.Processes = append(ret.Processes, *CreateXmlProcess(p))
	}
	//ret.Entry = freesp.CreateXmlModePosition(a).Entry
	return ret
}
开发者ID:axel-freesp,项目名称:sge,代码行数:11,代码来源:backendconversions.go

示例2: CreateXmlArchHint

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
}
开发者ID:axel-freesp,项目名称:sge,代码行数:11,代码来源:backendconversions.go

示例3: ArchMappingNew

func ArchMappingNew(userObj pf.ArchIf, nodes []NodeIf, mapping mp.MappingIf) *Arch {
	var processes []ProcessIf
	var Children []ContainerChild
	for _, up := range userObj.Processes() {
		var mappedNodes []NodeIf
		var mappedIds []bh.NodeIdIf
		for _, nId := range mapping.MappedIds() {
			m, ok := mapping.Mapped(nId.String())
			if ok && m == up {
				log.Printf("ArchMappingNew(p=%s): nId=%s", up.Name(), nId.String())
				n, ok := findNodeInTree(nodes, nId.String())
				if ok && !n.UserObj().Expanded() {
					mappedNodes = append(mappedNodes, n)
					mappedIds = append(mappedIds, nId)
				}
			}
		}
		p := ProcessMappingNew(mappedNodes, mappedIds, up)
		processes = append(processes, p)
		Children = append(Children, p)
	}
	config := DrawConfig{ColorInit(ColorOption(ArchNormal)),
		ColorInit(ColorOption(ArchHighlight)),
		ColorInit(ColorOption(ArchSelected)),
		ColorInit(ColorOption(BoxFrame)),
		ColorInit(ColorOption(Text)),
		image.Point{archPortOutBorder, archPortOutBorder}}
	cconfig := ContainerConfig{archPortWidth, archPortHeight, archMinWidth, archMinHeight}
	a := &Arch{ContainerInit(Children, config, userObj, cconfig), userObj,
		make(map[pf.ChannelIf]*ContainerPort), processes, gr.PositionModeMapping, mapping}
	a.init()
	/*
		for _, n := range nodes {
			melem, ok := mapping.MappedElement(n.UserObj())
			if !ok {
				log.Printf("ArchMappingNew warning: node %s not mapped.\n", n.Name())
				continue
			}
			n.SetPosition(melem.PathModePosition("", gr.PositionModeMapping))
		}
	*/
	a.initMappingPorts()
	return a
}
开发者ID:axel-freesp,项目名称:sge,代码行数:44,代码来源:arch.go

示例4: ArchNew

func ArchNew(userObj pf.ArchIf) *Arch {
	var processes []ProcessIf
	var Children []ContainerChild
	for _, up := range userObj.Processes() {
		p := ProcessNew(up.ModePosition(gr.PositionModeNormal), up)
		processes = append(processes, p)
		Children = append(Children, p)
	}
	config := DrawConfig{ColorInit(ColorOption(ArchNormal)),
		ColorInit(ColorOption(ArchHighlight)),
		ColorInit(ColorOption(ArchSelected)),
		ColorInit(ColorOption(BoxFrame)),
		ColorInit(ColorOption(Text)),
		image.Point{archPortOutBorder, archPortOutBorder}}
	cconfig := ContainerConfig{archPortWidth, archPortHeight, archMinWidth, archMinHeight}
	a := &Arch{ContainerInit(Children, config, userObj, cconfig), userObj,
		make(map[pf.ChannelIf]*ContainerPort), processes, gr.PositionModeNormal, nil}
	a.init()
	a.initPorts()
	return a
}
开发者ID:axel-freesp,项目名称:sge,代码行数:21,代码来源:arch.go


注:本文中的github.com/axel-freesp/sge/interface/platform.ArchIf.Processes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。