Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Nov 30, 2016
2 parents ea721cf + a47e3ff commit d1d8a93
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions lib/cosmos/gui/utilities/screenshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ class Screenshot

# Take a screenshot of the given window
def self.screenshot_window (window, filename)
if !Kernel.is_windows?()
# Delay for one second to allow any dialogs to fully clear first
start_time = Time.now
while ((Time.now - start_time) < 1.0)
Qt::CoreApplication.processEvents(Qt::EventLoop::AllEvents, 1000)
end
end

# Create a Pixmap to save the screenshot into
pixmap = Qt::Pixmap::grabWindow(window.winId())
pixmap.save(filename)
Expand Down
4 changes: 2 additions & 2 deletions lib/cosmos/tools/table_manager/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def initialize(name, description, type, endianness, table_id, filename)

# Calls define_item in Packet but also incrememts @num_columns
# if this table is a REPEATING table.
def create_param(name, bit_offset, bit_size, type, description, range, default, display_type, editable)
def create_param(name, bit_offset, bit_size, type, description, range, default, display_type, editable, endianness)
@num_columns += 1 if @type == :TWO_DIMENSIONAL
item = define_item(name, bit_offset, bit_size, type)
item = define_item(name, bit_offset, bit_size, type, nil, endianness)
item.description = description
item.range = range
item.default = default
Expand Down
14 changes: 10 additions & 4 deletions lib/cosmos/tools/table_manager/table_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def process(filename)
end

when 'PARAMETER'
usage = "PARAMETER <Parameter Name> <Parameter Description> <Data Type> <Bit Size> <Display Type> <Minimum Value> <Maximum Value> <Default Value - Only in ONE_DIMENTIONAL>"
parser.verify_num_parameters(6, 8, usage)
usage = "PARAMETER <Parameter Name> <Parameter Description> <Data Type> <Bit Size> <Display Type> <Minimum Value> <Maximum Value> <Default Value (Only in ONE_DIMENTIONAL)> <ENDIANNESS (Optional)>"
parser.verify_num_parameters(6, 9, usage)
finish_parameter()
if @current_table
@current_table.num_rows += 1
Expand Down Expand Up @@ -149,8 +149,14 @@ def process(filename)
default = 0
end

@current_parameter = @current_table.create_param(name, @cur_bit_offset,
bit_size, type, description, range, default, display_type, editable)
endianness = parameters[-1].to_s.upcase.intern
if endianness != :BIG_ENDIAN && endianness != :LITTLE_ENDIAN
endianness = @current_table.default_endianness
end

@current_parameter = @current_table.create_param(
name, @cur_bit_offset, bit_size, type, description,
range, default, display_type, editable, endianness)
@cur_bit_offset += parameters[3].to_i
rescue ArgumentError => err
raise parser.error("#{err.message} with #{keyword}.\nUSAGE: #{usage}")
Expand Down

0 comments on commit d1d8a93

Please sign in to comment.