plantUML的一個小例子

@startuml
start

if(eventCode != -1)then(yes)
	if(headCodeFound || index >= 9?)then(no)
		if(eventCode != 12 && index < 9?)then(yes)
			:按Index寫入Buffer
			Index++;
		elseif(eventCode = 12 && index < 9?)then(yes)
			:buffer內容整體後移
			計算buffer缺省長度
			頭部碼發現標誌位置1
			index置零;
		else(其他情況)
			:index = 0;
		endif
	else(yes)
		if(eventCode != 12 && index < 缺省長度?)then(yes)
			:按Index寫入Buffer
			Index++;
		elseif(eventCode = 12 && index < 缺省長度?)then(yes)
			end
		elseif(index >= 缺省長度)then(yes)
			:和校驗標誌位置1
			index = 0
			缺省長度 = 9;
		endif
		if(和校驗標誌位 == 1?)then(yes)
			:和校驗;
		else(no)
		endif
	endif
else(no)

endif

end
@enduml

運行效果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章