資源簡介
802.11n 基于gnuradio實現 開源軟件無線電(Gnuradio)或 開源軟件定義無線電,是一個對學習、構建和部署軟件定義無線電系統的免費軟件工具包。發起于2001年,Gnuradio 現在成為GNU 的正式項目之一。慈善家John Gilmore 發起并捐助$320,000.00 (US) 給Eric Blossom 用來構建代碼和維護。
代碼片段和文件信息
#!/usr/bin/env?python
__applicationName__?=?“doxypy“
__blurb__?=?“““
doxypy?is?an?input?filter?for?Doxygen.?It?preprocesses?python
files?so?that?docstrings?of?classes?and?functions?are?reformatted
into?Doxygen-conform?documentation?blocks.
“““
__doc__?=?__blurb__?+?\
“““
In?order?to?make?Doxygen?preprocess?files?through?doxypy?simply
add?the?following?lines?to?your?Doxyfile:
FILTER_SOURCE_FILES?=?YES
INPUT_FILTER?=?“python?/path/to/doxypy.py“
“““
__version__?=?“0.4.1“
__date__?=?“5th?December?2008“
__website__?=?“http://code.foosel.org/doxypy“
__author__?=?(
“Philippe?‘demod‘?Neumann?(doxypy?at?demod?dot?org)“
“Gina?‘foosel‘?Haeussge?(gina?at?foosel?dot?net)“?
)
__licenseName__?=?“GPL?v2“
__license__?=?“““This?program?is?free?software:?you?can?redistribute?it?and/or?modify
it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
the?Free?Software?Foundation?either?version?2?of?the?License?or
(at?your?option)?any?later?version.
This?program?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?General?Public?License?for?more?details.
You?should?have?received?a?copy?of?the?GNU?General?Public?License
along?with?this?program.??If?not?see? .
“““
import?sys
import?re
from?optparse?import?OptionParser?OptionGroup
class?FSM(object):
“““Implements?a?finite?state?machine.
Transitions?are?given?as?4-tuples?consisting?of?an?origin?state?a?target
state?a?condition?for?the?transition?(given?as?a?reference?to?a?function
which?gets?called?with?a?given?piece?of?input)?and?a?pointer?to?a?function
to?be?called?upon?the?execution?of?the?given?transition.?
“““
“““
@var?transitions?holds?the?transitions
@var?current_state?holds?the?current?state
@var?current_input?holds?the?current?input
@var?current_transition?hold?the?currently?active?transition
“““
def?__init__(self?start_state=None?transitions=[]):
self.transitions?=?transitions
self.current_state?=?start_state
self.current_input?=?None
self.current_transition?=?None
def?setStartState(self?state):
self.current_state?=?state
def?addTransition(self?from_state?to_state?condition?callback):
self.transitions.append([from_state?to_state?condition?callback])
def?makeTransition(self?input):
“““?Makes?a?transition?based?on?the?given?input.
@param input input?to?parse?by?the?FSM
“““
for?transition?in?self.transitions:
[from_state?to_state?condition?callback]?=?transition
if?from_state?==?self.current_state:
match?=?condition(input)
if?match:
self.current_state?=?to_state
self.current_input?=?input
self.current_transition?=?transition
if?options.debug:
print?>>sys.stderr?“#?FSM:?executing?(%s?->?%s)?for?line?‘%s‘“?%?(from_state?to_state?input)
callback(match)
return
class?Doxypy(object):
def?__init__(self):
string_prefi
評論
共有 條評論