Module: Origen::Generator::Compiler::DocHelpers::TestFlowHelpers

Included in:
Origen::Generator::Compiler::DocHelpers, OrigenDocHelpers::HtmlFlowFormatter
Defined in:
lib/origen_doc_helpers/helpers.rb

Overview

Helpers for the test flow documentation

Instance Method Summary collapse

Instance Method Details

#_bin_number(test) ⇒ Object



171
172
173
174
# File 'lib/origen_doc_helpers/helpers.rb', line 171

def _bin_number(test)
  flow = test[:flow]
  flow[:bin] || flow[:hard_bin] || flow[:hardbin] || flow[:soft_bin] || flow[:softbin]
end

#_sbin_number(test) ⇒ Object



176
177
178
179
# File 'lib/origen_doc_helpers/helpers.rb', line 176

def _sbin_number(test)
  flow = test[:flow]
  flow[:soft_bin] || flow[:softbin]
end

#_start_accordion(heading, options = {}) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/origen_doc_helpers/helpers.rb', line 181

def _start_accordion(heading, options = {})
  options = {
    panel: :default
  }.merge(options)
  @_accordion_index ||= 0
  @_accordion_index += 1
  <<-END


<div class="panel panel-#{options[:panel]}">
<a href="#_" class="expand-collapse-switch btn btn-xs pull-right btn-default" state="0"><i class='fa fa-plus'></i></a>
<div class="panel-heading clickable" data-toggle="collapse" data-parent="#blah2" href="#collapseAccordion#{@_accordion_index}">
#{heading}
</div>
<div id="collapseAccordion#{@_accordion_index}" class="panel-collapse collapse">
<div class="panel-body" markdown="1">


  END
end

#_start_test_flow_tableObject



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/origen_doc_helpers/helpers.rb', line 214

def _start_test_flow_table
  if @_test_flow_table_open
    ''
  else
    @_test_flow_table_open = true
    <<-END
<table class="table table-condensed table-bordered flow-table">

<thead>
<tr>
<th class="col1">Test</th>
<th class="col2">Number</th>
<th class="col3">HBin</th>
<th class="col3">SBin</th>
<th class="col5">Attributes</th>
<th class="col6">Description</th>
</tr>
</thead>

<tbody>
    END
  end
end

#_stop_accordionObject



202
203
204
205
206
207
208
209
210
211
212
# File 'lib/origen_doc_helpers/helpers.rb', line 202

def _stop_accordion
  <<-END


</div>
</div>
</div>


  END
end

#_stop_test_flow_tableObject



238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/origen_doc_helpers/helpers.rb', line 238

def _stop_test_flow_table
  if @_test_flow_table_open
    @_test_flow_table_open = false
    <<-END

</tbody>
</table>
    END
  else
    ''
  end
end

#_test_name(test) ⇒ Object



162
163
164
# File 'lib/origen_doc_helpers/helpers.rb', line 162

def _test_name(test)
  test[:flow][:name] || test[:instance].first[:name]
end

#_test_number(test) ⇒ Object



166
167
168
169
# File 'lib/origen_doc_helpers/helpers.rb', line 166

def _test_number(test)
  flow = test[:flow]
  flow[:number] || flow[:test_number] || flow[:tnum]
end


156
157
158
159
160
# File 'lib/origen_doc_helpers/helpers.rb', line 156

def _test_to_local_link(test)
  name = _test_name(test)
  number = _test_number(test)
  "<a href='##{name}_#{number}'>#{name}</a>"
end