Class: Cosmos::PacketLogDialog

Inherits:
Qt::Dialog
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/cosmos/gui/dialogs/packet_log_dialog.rb

Overview

Creates a dialog to allow a user to browse for a COSMOS log and select the time period to process.

Instance Method Summary collapse

Constructor Details

#initialize(parent, title, log_directory, packet_log_reader, initial_filenames = [], initial_output_filename = nil, show_output_filename = false, show_time = true, show_log_reader = true, input_filename_filter = Cosmos::BIN_FILE_PATTERN, output_filename_filter = Cosmos::BIN_FILE_PATTERN, multiple_file_select = true) ⇒ PacketLogDialog



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/cosmos/gui/dialogs/packet_log_dialog.rb', line 38

def initialize(parent,
               title,
               log_directory,
               packet_log_reader,
               initial_filenames = [],
               initial_output_filename = nil,
               show_output_filename = false,
               show_time = true,
               show_log_reader = true,
               input_filename_filter = Cosmos::BIN_FILE_PATTERN,
               output_filename_filter = Cosmos::BIN_FILE_PATTERN,
               multiple_file_select = true)
  super(parent)
  setWindowTitle(title)

  @layout = Qt::VBoxLayout.new
  @packet_log_frame = PacketLogFrame.new(self,
                                         log_directory,
                                         packet_log_reader,
                                         initial_filenames,
                                         initial_output_filename,
                                         show_output_filename,
                                         show_time,
                                         show_log_reader,
                                         input_filename_filter,
                                         output_filename_filter,
                                         multiple_file_select)
  @packet_log_frame.change_callback = method(:change_callback)
  @layout.addWidget(@packet_log_frame)

  # Separator before buttons
  @sep1 = Qt::Frame.new(self)
  @sep1.setFrameStyle(Qt::Frame::HLine | Qt::Frame::Sunken)
  @layout.addWidget(@sep1)

  # Create OK and Cancel buttons
  @button_layout = Qt::HBoxLayout.new
  @ok_button = Qt::PushButton.new('OK')
  @ok_button.connect(SIGNAL('clicked()')) { System.telemetry.reset; self.accept }
  @ok_button.setEnabled(false) if initial_filenames.empty?
  @button_layout.addWidget(@ok_button)
  @cancel_button = Qt::PushButton.new('Cancel')
  @cancel_button.connect(SIGNAL('clicked()')) { self.reject }
  @button_layout.addWidget(@cancel_button)

  @layout.addLayout(@button_layout)
  setLayout(@layout)
end