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


Golang PinInfo.SourceName方法代码示例

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


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

示例1: InitPins

func (m *ChannelEmulator) InitPins() {
	m.isInitialized = true
	totalpins := m.InPinCount() + m.OutPinCount()
	m.Pins = make(map[string]chipset.PinInfo, totalpins)
	m.PinNames = make(map[int]string, totalpins)
	// b := [...]string{"Penn", "Teller"}
	strlist := [4]string{"symbolIn", "symbolOut"}
	for i := 0; i < totalpins; i++ {
		m.PinNames[i] = strlist[i]
	}

	for i := 0; i < totalpins; i++ {
		var pinfo chipset.PinInfo
		// pinfo.CreateComplex128Channel()
		pinfo.Name = m.PinNames[i]
		if i < m.InPinCount() {
			pinfo.InputPin = true
		} else {
			pinfo.InputPin = false
		}
		m.Pins[m.PinNames[i]] = pinfo

	}

	testcch := gocomm.NewComplex128Channel()

	var dummypin chipset.PinInfo

	/// all Input Pins
	dummypin = m.Pins["symbolIn"]
	dummypin.Id = 0
	dummypin.DataType = reflect.TypeOf(testcch)
	m.Pins["symbolIn"] = dummypin

	/// All output pins
	dummypin = m.Pins["symbolOut"]
	dummypin.Id = 1
	dummypin.SourceName = "fadingchannel/awgn"
	dummypin.DataType = reflect.TypeOf(testcch)
	dummypin.CreateComplex128Channel()
	m.Pins["symbolOut"] = dummypin

}
开发者ID:postfix,项目名称:gocomm,代码行数:43,代码来源:awgn.go

示例2: InitPins

func (m *BitSource) InitPins() {
	m.isInitialized = true

	totalpins := m.InPinCount() + m.OutPinCount()
	m.Pins = make(map[string]chipset.PinInfo, totalpins)
	m.PinNames = make(map[int]string, totalpins)
	// b := [...]string{"Penn", "Teller"}
	strlist := [1]string{"bitOut"}
	for i := 0; i < totalpins; i++ {
		m.PinNames[i] = strlist[i]
	}

	for i := 0; i < totalpins; i++ {
		var pinfo chipset.PinInfo
		// pinfo.CreateComplex128Channel()
		pinfo.Name = m.PinNames[i]
		if i < m.InPinCount() {
			pinfo.InputPin = true
		} else {
			pinfo.InputPin = false
		}
		m.Pins[m.PinNames[i]] = pinfo

	}

	testch := gocomm.NewBitChannel()
	var dummypin chipset.PinInfo
	/// All output pins
	dummypin = m.Pins["bitOut"]
	dummypin.Id = 0
	dummypin.SourceName = "genbit"
	dummypin.Desc = "Output Pin where bits are written"
	dummypin.DataType = reflect.TypeOf(testch)
	dummypin.CreateBitChannel()
	m.Pins["bitOut"] = dummypin

}
开发者ID:postfix,项目名称:gocomm,代码行数:37,代码来源:bitsource.go

示例3: InitPins

func (m *Modem) InitPins() {
	m.isInitialized = true

	totalpins := m.InPinCount() + m.OutPinCount()
	m.Pins = make(map[string]chipset.PinInfo, totalpins)
	m.PinNames = make(map[int]string, totalpins)
	// b := [...]string{"Penn", "Teller"}
	strlist := [4]string{"bitIn", "symbolIn", "symbolOut", "bitOut"}
	for i := 0; i < totalpins; i++ {
		m.PinNames[i] = strlist[i]
	}

	for i := 0; i < totalpins; i++ {
		var pinfo chipset.PinInfo
		// pinfo.CreateComplex128Channel()
		pinfo.Name = m.PinNames[i]
		pinfo.Id = i
		if i < m.InPinCount() {
			pinfo.InputPin = true
		} else {
			pinfo.InputPin = false
		}
		m.Pins[m.PinNames[i]] = pinfo

	}

	// testcch := gocomm.NewComplex128Channel()
	// testch := gocomm.NewBitChannel()

	var dummypin chipset.PinInfo

	/// all Input Pins
	dummypin = m.Pins["symbolIn"]
	dummypin.Id = 1
	// dummypin.DataType = reflect.TypeOf(testcch)
	dummypin.DataType = reflect.TypeOf((*gocomm.Complex128Channel)(nil)).Elem()

	m.Pins["symbolIn"] = dummypin

	dummypin = m.Pins["bitIn"]
	dummypin.Id = 0
	// dummypin.DataType = reflect.TypeOf(testch)
	dummypin.DataType = reflect.TypeOf((*gocomm.BitChannel)(nil)).Elem()
	m.Pins["bitIn"] = dummypin

	///
	/// All output pins
	dummypin = m.Pins["symbolOut"]
	dummypin.Id = 2
	// dummypin.DataType = reflect.TypeOf(testcch)
	dummypin.DataType = reflect.TypeOf((*gocomm.Complex128Channel)(nil)).Elem()
	dummypin.CreateChannel()
	dummypin.SourceName = "modulate"
	m.Pins["symbolOut"] = dummypin

	// fmt.Printf("\n %v : PinO : %v , Channel : %v", m.modetype(), m.Pins["symbolOut"].Name, m.Pins["symbolOut"].Channel)
	dummypin = m.Pins["bitOut"]
	dummypin.Id = 3
	dummypin.SourceName = "demodulate"
	dummypin.DataType = reflect.TypeOf((*gocomm.Complex128Channel)(nil)).Elem()

	// dummypin.DataType = reflect.TypeOf(testcch)
	// dummypin.CreateComplex128Channel()
	dummypin.CreateChannel()

	m.Pins["bitOut"] = dummypin
	// fmt.Printf("\n %v : PinO : %v , Channel : %v", m.modetype(), m.Pins["bitOut"].Name, m.Pins["bitOut"].Channel)

}
开发者ID:postfix,项目名称:gocomm,代码行数:69,代码来源:modem.go


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