def set_logo_and_title(self):
        """
        Add various widget titles and Polarcus logo to the application

        :return: none
        """
        plcs_logo = QtGui.QLabel()
        myPixmap = QtGui.QPixmap(
            os.path.join(os.getcwd(), media_path, 'polarcus.png'))
        pixmap_resized = myPixmap.scaled(100, 50, QtCore.Qt.KeepAspectRatio)
        plcs_logo.setPixmap(pixmap_resized)
        plcs_logo.setFixedSize(100, 50)
        self.layout.addWidget(plcs_logo, 0, 0)
        #Addition of window title
        ca_title = create_central_labels('Deliverables QC Application')
        ca_title.setStyleSheet(
            'background-color: rgb(140,198,63);color: black')
        ca_title.setFont(QtGui.QFont('SansSerif', 20))
        self.layout.addWidget(ca_title, 0, 1)
        ############ ading label for status info
        sts_title = create_central_labels('Configuration')
        sts_title.setStyleSheet('background-color: rgb(65,65,65);color: white')
        sts_title.setFont(QtGui.QFont('SansSerif', 15))
        self.layout.addWidget(sts_title, 0, 2)
        # addind title for message board
        # runlog_title = create_central_labels('Run time Log')
        # runlog_title.setStyleSheet('background-color: rgb(65,65,65);color: white')
        # runlog_title.setFont(QtGui.QFont('SansSerif', 15))
        # self.layout.addWidget(runlog_title, 0, 3)
        # add thread dock
        thread_dock_title = create_central_labels('Thread status')
        thread_dock_title.setStyleSheet(
            'background-color: rgb(65,65,65);color: white')
        thread_dock_title.setFont(QtGui.QFont('SansSerif', 15))
        self.layout.addWidget(thread_dock_title, 0, 3)
 def add_labels(self):
     label_seq = ['Seq #', 'Line name', 'SEGY on disk QC']
     set_wise_label = ['Write status', 'QC status']
     set_label_start_column = 3
     for i in range(0, len(label_seq)):
         self.grid.addWidget(create_central_labels(label_seq[i]), 1, i)
     for i in range(0, self.deliverable.copies):
         set_label = str('Set no: ' + str(i + 1))
         set_label_start = i * 2 + set_label_start_column
         self.grid.addWidget(create_central_labels(set_label), 0,
                             set_label_start, 1, 2)
         for j in range(0, len(set_wise_label)):
             self.grid.addWidget(create_central_labels(set_wise_label[j]),
                                 1, set_label_start + j)
    def __init__(self, parent):
        super(deliverable_info_widget, self).__init__()
        self.parent = parent

        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        self.deliverable_id = self.parent.deliverable_id

        grid = QtGui.QGridLayout()

        #go get the deliverable_object_from the database
        self.deliverable_obj = get_deliverable_object(self.db_connection_obj,
                                                      self.deliverable_id)

        label_deliverable_name = create_central_labels(
            str(
                str(self.deliverable_obj.id) + " : " +
                self.deliverable_obj.name))
        label_deliverable_media = create_central_labels(
            str("Media: " + self.deliverable_obj.media))

        pb_sgyt = QtGui.QPushButton('SGYT_EBCDIC')
        pb_bin_def = QtGui.QPushButton('Bin.def')
        pb_trc_def = QtGui.QPushButton('Trc.def')

        grid.addWidget(label_deliverable_name, 0, 0, 1, 2)
        grid.addWidget(label_deliverable_media, 0, 2, 1, 2)
        grid.addWidget(pb_sgyt, 0, 4)
        grid.addWidget(pb_bin_def, 0, 5)
        grid.addWidget(pb_trc_def, 0, 6)

        if self.deliverable_obj.sgyt_master_status:
            pb_sgyt.clicked.connect(self.show_EBCDIC)
        else:
            pb_sgyt.clicked.connect(self.show_warning_message)

        if self.deliverable_obj.bin_def_status:
            pb_bin_def.clicked.connect(self.show_bin_def)
        else:
            pb_bin_def.clicked.connect(self.show_warning_message)

        if self.deliverable_obj.trc_def_status:
            pb_trc_def.clicked.connect(self.show_trc_def)
        else:
            pb_trc_def.clicked.connect(self.show_warning_message)

        self.setLayout(grid)
 def add_config_message(self):
     #Configuration message
     config_message_label = create_central_labels('Config Message:::')
     config_message_label.setMaximumHeight(30)
     #self.layout.addWidget(config_message_label,2,0,1,1)
     self.config_message = QtGui.QLineEdit()
     self.config_message.setMinimumWidth(600)
Ejemplo n.º 5
0
    def __init__(self, message):
        # define the top window

        super(pop_up_approval_box_segy_write, self).__init__()

        grid = QtGui.QGridLayout()

        self.setWindowTitle('SEGY Write log')

        pb_approve = QtGui.QPushButton("Approve")
        pb_approve.setObjectName("Approve")
        pb_approve.clicked.connect(self.ok_exit)

        pb_approve_all = QtGui.QPushButton("Approve all on Tape")
        pb_approve_all.setObjectName("Approve_all")
        pb_approve_all.clicked.connect(self.ok_exit)

        pb_reject = QtGui.QPushButton("Reject")
        pb_reject.setObjectName("Reject")
        pb_reject.clicked.connect(self.ok_exit)

        message_label = QtGui.QTextEdit()
        message_label.setText(message)
        grid.addWidget(message_label, 0, 0, 1, 3)

        grid.addWidget(create_central_labels("User Name"), 1, 0)
        self.username = QtGui.QLineEdit()
        grid.addWidget(self.username, 1, 1, 1, 2)
        grid.addWidget(pb_approve, 2, 1)
        grid.addWidget(pb_approve_all, 2, 2)
        grid.addWidget(pb_reject, 2, 0)
        self.setLayout(grid)
    def home_screen(self):
        self.grid.addWidget(create_central_labels(str(self.tape_service.use_location)), 0, 1, 1,
                            len(self.tape_service.available_dst))

        self.pb_refresh = QtGui.QPushButton("Refresh all")
        self.pb_refresh.setToolTip(self.tool_tip_dict['refresh'])
        self.pb_refresh.clicked.connect(self.refresh_all)

        self.pb_rewind = QtGui.QPushButton("Rewind")
        self.pb_rewind.setToolTip(self.tool_tip_dict['rewind'])
        self.pb_rewind.clicked.connect(lambda: self.choose_tape_drive('rewind'))


        self.pb_eject = QtGui.QPushButton("Eject")
        self.pb_eject.setToolTip(self.tool_tip_dict['eject'])
        self.pb_eject.clicked.connect(lambda : self.choose_tape_drive('eject'))

        self.pb_segd_qc = QtGui.QPushButton("SEGD QC")
        self.pb_segd_qc.setToolTip(self.tool_tip_dict['segd_qc'])
        self.pb_segd_qc.clicked.connect(self.segd_qc)

        self.pb_segy = QtGui.QPushButton("SEGY write")
        self.pb_segy.setToolTip(self.tool_tip_dict['segy_write'])
        self.pb_segy.clicked.connect(self.segy_write)

        self.pb_quit = QtGui.QPushButton("Exit")
        self.pb_quit.setToolTip(self.tool_tip_dict['exit'])
        self.pb_quit.clicked.connect(self.closeEvent)

        self.grid.addWidget(self.pb_refresh, 2, 0)
        self.grid.addWidget(self.pb_rewind, 3, 0)
        self.grid.addWidget(self.pb_eject, 4, 0)
        self.grid.addWidget(self.pb_segd_qc, 5, 0)
        self.grid.addWidget(self.pb_segy, 6, 0)
        self.grid.addWidget(self.pb_quit, 7, 0)
 def __init__(self, parent):
     super(SEGY_all_summary, self).__init__()
     self.grid = QtGui.QGridLayout()
     self.title = create_central_labels("SEGY production and QC summary")
     self.title.setFixedHeight(20)
     self.grid.addWidget(self.title, 0, 0)
     self.setLayout(self.grid)
Ejemplo n.º 8
0
    def __init__(self,parent):# type will decide which headers are relevant to be extracted
        super (SEGY_qc_log_extractor,self).__init__()
        self.parent = parent

        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        self.log_path = self.parent.log_path
        self.log_data = self.parent.log_data
        self.type = self.parent.type

        self.grid = QtGui.QGridLayout()

        self.grid.addWidget(create_central_labels(str('Automatic header extraction: ' + type_name_dict[self.type])), 0, 0, 1,3)  # label from type name dict

        self.scroll_area = QtGui.QScrollArea()
        self.grid.addWidget(self.scroll_area,1,0,25,3)

        self.widget = SEGY_header_extraction(self)
        self.scroll_area.setWidget(self.widget)


        pb_ok = QtGui.QPushButton('Save automatic')
        pb_ok.clicked.connect(self.widget.save_auto)
        self.grid.addWidget(pb_ok,26,0,1,1)

        # pb_manual = QtGui.QPushButton('Save Manual')
        # pb_manual.clicked.connect(self.widget.save_manual)
        # self.grid.addWidget(pb_manual,26,2,1,1,)

        self.setLayout(self.grid)
Ejemplo n.º 9
0
    def __init__(self, parent):

        super(project_info, self).__init__(parent=parent)
        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj  # use this line to pass the connection object between the parent and the child
        self.project_info = fetch_project_info(self.db_connection_obj)
        grid = QtGui.QGridLayout()
        grid.addWidget(create_central_labels('General Project information'), 0,
                       0, 1, 2)
        if self.project_info == None or len(self.project_info) == 0:
            grid.addWidget(
                create_center_data(
                    "Project information from ORCA is not available !!!"), 1,
                0, 1, 2)
        else:
            info_dict = self.project_info[0].__dict__
            j = 0

            for key in info_dict:
                if key != '_sa_instance_state':
                    j = j + 1
                    #print key , info_dict[key]
                    grid.addWidget(create_center_data(key), j, 0)
                    grid.addWidget(
                        create_left_blank(str(info_dict[key]), 'blue'), j, 1)

        self.setLayout(grid)
 def add_labels(self):
     labels_list = [
         'Seq_no', 'Line name', 'SGYT export', 'SGYT reel_no',
         'Exported by', 'Date', 'QC run status', 'Approve',
         'Approval status', 'Approved by', 'Approval timestamp'
     ]
     for i in range(0, len(labels_list)):
         self.grid.addWidget(create_central_labels(labels_list[i]), 0, i)
 def add_labels(self):
     label_list = [
         'Tape #', 'Seq #', 'Line name', 'SEGY on disk QC',
         'Tape write status', 'Tape written by', 'Tape written on',
         'View and QC log', 'Tape QC status', 'Tape checked by',
         'Tape checked on'
     ]
     for i in range(0, len(label_list)):
         self.grid.addWidget(create_central_labels(label_list[i]), 0, i)
 def add_labels(self):
     labels_list = [
         'Seq #', 'Line name', 'SEGYT QC', 'Export', 'Export status',
         'Exported by', 'Time stamp', 'QC run status', 'Link',
         'Header Extraction', 'Approve', 'Approval status', 'Approved by',
         'Approval timestamp', 'Line name', 'Seq #'
     ]
     for i in range(0, len(labels_list)):
         self.grid.addWidget(create_central_labels(labels_list[i]), 0, i)
Ejemplo n.º 13
0
 def add_general_labels_and_widgets(self):
     #SEGY file_name
     self.grid.addWidget(create_central_labels('SEGY file name'), 0, 0)
     self.segy_name = QtGui.QLabel()
     self.grid.addWidget(self.segy_name, 0, 1)
     # Add general information labels like SGYT name
     self.grid.addWidget(create_central_labels('SGYT name'),1,0)
     self.sgyt_name = QtGui.QLabel()
     self.grid.addWidget(self.sgyt_name,1,1)
     # Number of traces in SEGY file
     self.grid.addWidget(create_central_labels('# Traces'),2,0)
     self.no_traces = QtGui.QLabel()
     self.grid.addWidget(self.no_traces,2,1)
     # File size
     self.grid.addWidget(create_central_labels('File size in Mib'), 3, 0)
     self.file_size = QtGui.QLabel()
     self.grid.addWidget(self.file_size, 3, 1)
     # Mismatch flag
     self.grid.addWidget(create_central_labels('SGYT match flag'),4,0)
Ejemplo n.º 14
0
 def add_type_specific_gui_obj(self):
     label_list = self.def_dict['ordered_key_list']
     #Now resolve stat values for varous labels
     label_position_dict = self.def_dict['label_start_dict']
     for i in range(0,len(label_list)):
         self.grid.addWidget(create_central_labels(label_list[i]),label_position_dict[label_list[i]],0,1,2)
     # Now add label_list_wise_object
     self.line_edit_dict = {}
     for i in range(0,len(label_list)):
         key = label_list[i]
         row_no = label_position_dict[key]
         dict_to_use = self.def_dict[key]
         for a_key in dict_to_use.keys():
             offset = dict_to_use[a_key][1]
             self.grid.addWidget(create_central_labels(a_key),row_no+offset,0)
             self.line_edit_dict[dict_to_use[a_key][0]] = QtGui.QLabel()
             self.grid.addWidget(self.line_edit_dict[dict_to_use[a_key][0]], row_no + offset, 1)
             #This part only adds the text for binary and trace headers
             if dict_to_use[a_key][0] in self.extracted_headers_dict.keys():
                 self.line_edit_dict[dict_to_use[a_key][0]].setText(str(self.extracted_headers_dict[dict_to_use[a_key][0]]))
    def __init__(self, parent):
        super(SEGY_QC_Form, self).__init__()
        #parent
        self.parent = parent

        #grid
        self.grid = QtGui.QGridLayout()
        self.setWindowTitle("SEGY QC Input form")

        # labels

        self.grid.addWidget(create_central_labels('SEGY QC Input'), 0, 0, 1, 3)
        self.grid.addWidget(create_central_labels('Select Deliverable'), 1, 0)
        self.grid.addWidget(create_central_labels('Select line'), 2, 0)

        # pushbuttons

        self.pb_execute = QtGui.QPushButton('Run')
        self.grid.addWidget(self.pb_execute, 3, 2)
        self.pb_execute.clicked.connect(self.execute)

        # combo boxes

        self.combo_deliverable = QtGui.QComboBox()
        self.combo_deliverable.setObjectName("Deliverable")
        self.grid.addWidget(self.combo_deliverable, 1, 1)
        self.combo_deliverable.addItems(
            self.parent.form_definition_for_SEGY_QC())
        self.combo_deliverable.setCurrentIndex(-1)
        self.combo_deliverable.blockSignals(False)
        self.combo_deliverable.currentIndexChanged.connect(
            self.deliverable_selected)

        self.combo_line = QtGui.QComboBox()
        self.combo_line.setObjectName("File name")
        self.grid.addWidget(self.combo_line, 2, 1)
        self.combo_line.blockSignals(False)
        self.combo_line.currentIndexChanged.connect(self.line_selected)

        self.setLayout(self.grid)
Ejemplo n.º 16
0
    def __init__(self,parent,type):
        super(approve_form_SEGY_on_disk_qc,self).__init__()
        self.parent = parent
        db_obj_dict = self.parent.db_obj_update.__dict__

        self.def_dict = type_dict[type]

        self.grid = QtGui.QGridLayout()
        #Add label
        label_text = str('Approval form : ' + type_name_dict[type])
        self.grid.addWidget(create_central_labels(label_text),0,0,1,2)
        flag_list_to_use = self.def_dict['flag_list']

        for i in range(0,len(flag_list_to_use)):
            self.grid.addWidget(create_central_labels(flag_name_dict[flag_list_to_use[i]]),i+1,0)
            self.grid.addWidget(decide_and_create_label(db_obj_dict[flag_list_to_use[i]]),i+1,1)
        message = 'Approve or reject: ' + db_obj_dict['segy_on_disk_file_path']

        self.approve_box = pop_up_approval_box(message = message)
        self.approve_box.closed.connect(self.parent.approve_qc_log)

        self.grid.addWidget(self.approve_box,len(flag_list_to_use)+2,0,1,2)

        self.setLayout(self.grid)
    def __init__(self, parent):
        # define the top window

        super(add_new_shipment, self).__init__(parent=parent)

        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        grid = QtGui.QGridLayout()

        grid.addWidget(create_central_labels("Create New shipment"), 0, 0, 1,
                       3)

        keys_list = [
            'Id', 'Shipment Number', 'Air way bill number', "Number of boxes"
        ]

        keys_dict = {}
        keys_dict['Id'] = create_center_data('Automatic')
        keys_dict['Shipment Number'] = QtGui.QLineEdit()
        keys_dict['Air way bill number'] = QtGui.QLineEdit()
        keys_dict["Number of boxes"] = QtGui.QLineEdit()

        self.shipment_def = keys_dict

        for i in range(0, len(keys_list)):
            grid.addWidget(create_center_data(keys_list[i]), i + 1, 0)
            grid.addWidget(keys_dict[keys_list[i]], i + 1, 1, 1, 2)

        for i in range(len(keys_list), 15):
            grid.addWidget(create_center_blank(""), i + 1, 1)

        self.pb_save = QtGui.QPushButton()
        self.pb_save.setText('Save')
        self.pb_save.setStatusTip('Save Shipment to the database')
        self.pb_save.clicked.connect(self.save_shipment)

        grid.addWidget(self.pb_save, 17, 0)

        self.pb_exit = QtGui.QPushButton()
        self.pb_exit.setText('Back')
        self.pb_exit.setStatusTip('Back to main Shipment Menu')
        self.pb_exit.clicked.connect(self.parent.set_shipment_tools)

        grid.addWidget(self.pb_exit, 17, 1)

        self.setLayout(grid)
Ejemplo n.º 18
0
    def __init__(self, parent):
        # define the top window

        super(add_usb_label, self).__init__()

        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        grid = QtGui.QGridLayout()

        grid.addWidget(create_central_labels("Create New USB label"), 0, 0, 1,
                       3)

        keys_list = ['Id', 'Label', 'Capacity in TB', "Serial no"]

        keys_dict = {}
        keys_dict['Id'] = create_center_data('Automatic')
        keys_dict['Label'] = QtGui.QLineEdit()
        keys_dict['Capacity in TB'] = QtGui.QLineEdit()
        keys_dict['Serial no'] = QtGui.QLineEdit()

        self.usb_def = keys_dict

        for i in range(0, len(keys_list)):
            grid.addWidget(create_center_data(keys_list[i]), i + 1, 0)
            grid.addWidget(keys_dict[keys_list[i]], i + 1, 1, 1, 2)

        for i in range(len(keys_list), 15):
            grid.addWidget(create_center_blank(""), i + 1, 1)

        self.pb_save = QtGui.QPushButton()
        self.pb_save.setText('Save')
        self.pb_save.setStatusTip('Save USB label to database')
        self.pb_save.clicked.connect(self.save_usb_label)

        grid.addWidget(self.pb_save, 17, 0)

        self.pb_exit = QtGui.QPushButton()
        self.pb_exit.setText('Back')
        self.pb_exit.setStatusTip('Back to main Shipment Menu')
        self.pb_exit.clicked.connect(self.parent.set_usb_functions)

        grid.addWidget(self.pb_exit, 17, 1)

        self.setLayout(grid)
    def __init__(self, parent):
        # define the top window

        super(shipment_tools, self).__init__()
        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        grid = QtGui.QGridLayout()

        grid.addWidget(create_central_labels("Shipments Tools"), 0, 0)

        self.pb_add_shipment = QtGui.QPushButton('Add a new shipment')
        self.pb_add_shipment.setStatusTip('Add a new shipment')
        self.pb_add_shipment.clicked.connect(self.parent.set_add_shipment)
        self.pb_add_shipment.resize(self.pb_add_shipment.minimumSizeHint())


        self.pb_shipment_summary = QtGui.QPushButton("Shipment summary")
        self.pb_shipment_summary.setStatusTip('Shipments summary')
        self.pb_shipment_summary.clicked.connect(
            self.parent.set_shipments_summary)
        self.pb_shipment_summary.resize(self.pb_shipment_summary.minimumSizeHint())


        self.pb_add_media_to_shipment = QtGui.QPushButton("Associate Media with existing shipments")
        self.pb_add_media_to_shipment.setStatusTip('Shipments summary')
        self.pb_add_media_to_shipment.clicked.connect(
            self.associate_media_with_shipment)
        self.pb_add_media_to_shipment.resize(self.pb_add_media_to_shipment.minimumSizeHint())


        grid.addWidget(self.pb_add_shipment,1,0)
        grid.addWidget(self.pb_shipment_summary,2,0)
        grid.addWidget(self.pb_add_media_to_shipment,3,0)

        for i in range(4,16):
            grid.addWidget(QtGui.QLabel(""),i,0)


        self.setLayout(grid)

        self.show()
Ejemplo n.º 20
0
    def __init__(self, parent):
        super(file_selection, self).__init__()
        self.parent = parent

        self.grid = QtGui.QGridLayout()

        self.parent.file_selected = False

        self.pb_ok = QtGui.QPushButton('Confirm selection')
        self.pb_ok.clicked.connect(self.ok_exit)
        self.grid.addWidget(self.pb_ok, 0, 0)

        self.ck_box_remove = QtGui.QCheckBox('Remove files already written')
        self.grid.addWidget(self.ck_box_remove, 1, 0)
        self.ck_box_remove.stateChanged.connect(self.toggle_file_selection)

        self.grid.addWidget(create_central_labels("Files"), 2, 0)

        self.setLayout(self.grid)
        self.show()
    def __init__(self, parent, title, list, caller, fn):
        super(file_selection, self).__init__()
        self.parent = parent
        self.file_list = list
        self.grid = QtGui.QGridLayout()
        self.caller = caller
        self.fn = fn
        self.parent.file_selected = False

        self.pb_ok = QtGui.QPushButton('Confirm selection')
        self.pb_ok.clicked.connect(self.ok_exit)
        self.grid.addWidget(self.pb_ok, 0, 0)

        self.grid.addWidget(create_central_labels("Files"), 1, 0)

        self.setLayout(self.grid)

        self.working_widget = all_files_widget(self)
        self.grid.addWidget(self.working_widget, 2, 0)

        self.show()
Ejemplo n.º 22
0
    def __init__(self, parent):
        # define the top window

        super(usb_tools_window, self).__init__()

        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        grid = QtGui.QGridLayout()

        self.pb_add_usb_label = QtGui.QPushButton("Create new USB label")
        self.pb_add_usb_label.clicked.connect(self.parent.set_add_usb_label)

        self.pb_add_media_to_usb_tape = QtGui.QPushButton("Associate files with USB (on Tape as well)")
        self.pb_add_usb_label.clicked.connect(self.associate_files_with_usb_on_tape)

        self.pb_add_media_to_usb_no_tape = QtGui.QPushButton("Associate files with USB (No tape)")
        self.pb_add_usb_label.clicked.connect(self.tool_welcome)


        self.pb_show_usb_summary = QtGui.QPushButton("Show USB summary")
        self.pb_show_usb_summary.clicked.connect(self.parent.set_usb_summary)


        grid.addWidget(create_central_labels("USB tools"),0,0)
        grid.addWidget(self.pb_add_usb_label,1,0)
        grid.addWidget(self.pb_add_media_to_usb_tape,2,0)
        grid.addWidget(self.pb_add_media_to_usb_no_tape, 3, 0)
        grid.addWidget(self.pb_show_usb_summary,4,0)

        for i in range(5,16):
            grid.addWidget(QtGui.QLabel(""),i,0)


        self.setLayout(grid)
        self.show()
    def __init__(self, parent, deliverable):

        super(SEGY_qc_status, self).__init__()
        ts = time.time()
        self.tool_tip_dict = tool_tips_mapper_dict['segy_status']
        self.setToolTip(self.tool_tip_dict['general'])

        self.parent = parent
        self.minimum_width = 800
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        self.deliverable = deliverable
        self.deliverable_id = self.deliverable.id

        self.grid = QtGui.QGridLayout()
        self.grid.addWidget(create_central_labels("Deliverable details"), 0, 0,
                            1, 4)

        self.pb_refresh = QtGui.QPushButton("Refresh")
        self.pb_refresh.clicked.connect(self.refresh)
        self.pb_refresh.setStyleSheet('background-color: yellow')
        self.grid.addWidget(self.pb_refresh, 0, 4)

        self.deliverable_info_widget = deliverable_info_widget(self)
        self.deliverable_info_widget.setFixedHeight(50)
        self.deliverable_info_widget.setMinimumWidth(self.minimum_width)

        self.grid.addWidget(self.deliverable_info_widget, 1, 0, 1, 5)

        self.decide_and_use_type_tabs()

        self.setLayout(self.grid)

        te = time.time()
        time_string = "{:8.5f} sec".format(te - ts)
        logger.info("Finished Creating SEGY Summary widget in: " + time_string)
    def __init__(self, parent, title, list, caller, fn):
        # define the top window

        super(pop_up_combo_box, self).__init__()

        self.parent = parent
        self.caller = caller
        self.fn = fn

        self.grid = QtGui.QGridLayout()
        self.setWindowTitle(title)
        self.combo = QtGui.QComboBox()
        self.combo.addItems(list)

        self.grid.addWidget(create_central_labels(title), 0, 0)
        self.grid.addWidget(self.combo, 0, 1)

        self.pb_ok = QtGui.QPushButton('ok')
        self.pb_ok.clicked.connect(self.ok_exit)

        self.grid.addWidget(self.pb_ok, 1, 0)

        self.setLayout(self.grid)
        self.show()
Ejemplo n.º 25
0
    def __init__(self,parent):
        super(labels_widget_SEGD_QC_summary,self).__init__()

        self.grid = QtGui.QGridLayout()
        self.parent = parent

        qc_labels_list = ['Prod', 'Run', 'QC']
        self.grid.addWidget(create_central_labels("SEGD QC summary"), 0, 0, 1, self.parent.total_widget_width)
        self.grid.addWidget(create_central_labels("Line name"), 3, 0, 1, 1)
        self.grid.addWidget(create_central_labels("Tape no"), 3, 1, 1, 1)

        start_value_for_deliverable = 2

        cv_dict = {}  # column values for SEGD QC entries

        # structure = {deliverable_id:{set_no:{prod:xx,run:xx,qc:xx}}}

        for deliverable in self.parent.deliverables_list:
            label_text = str(str(deliverable.id) + " " + deliverable.name)
            width = int(deliverable.copies) * 3
            self.grid.addWidget(create_central_labels(label_text), 1, start_value_for_deliverable, 1, width)

            set_start_value = start_value_for_deliverable
            set_dict = {}
            for set in range(1, int(deliverable.copies) + 1):
                label_text = str("Set : " + str(set))
                self.grid.addWidget(create_central_labels(label_text), 2, set_start_value, 1, 3)
                status_dict = {}
                for i in range(0, len(qc_labels_list)):
                    status_dict.update({qc_labels_list[i]: set_start_value + i})
                    self.grid.addWidget(create_central_labels(qc_labels_list[i]), 3, set_start_value + i, 1, 1)

                set_dict.update({set: status_dict})
                set_start_value = set_start_value + 3
            cv_dict.update({deliverable.id: set_dict})
            start_value_for_deliverable = start_value_for_deliverable + width + 1
        self.parent.summary.cv_dict = cv_dict

        self.setLayout(self.grid)
Ejemplo n.º 26
0
    def __init__(self, parent):
        # define the top window

        super(Deliverables_summary_window, self).__init__(parent=parent)
        self.parent = parent
        self.tool_tip_dict = tool_tips_mapper_dict['deliverables']
        self.setToolTip(self.tool_tip_dict['general'])
        self.db_connection_obj = self.parent.db_connection_obj  # use this line to pass the connection object between the parent and the child
        grid = QtGui.QGridLayout()
        #header
        title = create_central_labels('Deliverables sumary')
        title.setMaximumHeight(50)
        grid.addWidget(title, 0, 0, 1, 6)

        #---------------------------------------------
        #  **creating the label for the widget table
        #---------------------------------------------
        labels_text = ["Id", "Name", "Class", "Type", "Media", "Copies"]
        labels_list = []
        for label in labels_text:
            labels_list.append(create_central_labels(label))
        for i in range(0, len(labels_list)):
            grid.addWidget(labels_list[i], 1, i)
        #----------------------------------------------------------------------------------
        #  **** Now searcing for existing deliverables in the database and displaying them
        #----------------------------------------------------------------------------------
        self.existing_deliverables_list_dict = fetch_deliverables_list(
            self.db_connection_obj)
        sobj = self.existing_deliverables_list_dict
        for j in range(0, len(sobj)):
            grid.addWidget(create_center_data(str(sobj[j]['id'])), j + 2, 0)
            grid.addWidget(create_center_data(str(sobj[j]['name'])), j + 2, 1)
            grid.addWidget(create_center_data(str(sobj[j]['class_d'])), j + 2,
                           2)
            grid.addWidget(create_center_data(str(sobj[j]['type'])), j + 2, 3)
            grid.addWidget(create_center_data(str(sobj[j]['media'])), j + 2, 4)
            grid.addWidget(create_center_data(str(sobj[j]['copies'])), j + 2,
                           5)

        #Make it look organized------------------------------------------------
        for j in range(len(sobj), 22):
            for i in range(0, 6):
                grid.addWidget(create_center_blank(""), j + 1, i)
        #----------------------------------------------------------
        # Adding the button to add deliverable, edit existing one or delete
        #----------------------------------------------------------
        j = 22
        self.pb_add = QtGui.QPushButton()
        self.pb_add.setText("+")
        self.pb_add.clicked.connect(self.parent.set_new_deliverable)
        grid.addWidget(self.pb_add, j, 0)
        self.pb_add.setToolTip(self.tool_tip_dict['add'])

        self.pb_edit = QtGui.QPushButton()
        self.pb_edit.setText('Edit')
        self.pb_edit.clicked.connect(self.edit_single_deliverable)
        grid.addWidget(self.pb_edit, j, 2)
        self.pb_edit.setToolTip(self.tool_tip_dict['edit'])

        self.pb_view = QtGui.QPushButton()
        self.pb_view.setText('View')
        self.pb_view.clicked.connect(self.view_single_deliverable_detail)
        grid.addWidget(self.pb_view, j, 1)
        self.pb_view.setToolTip(self.tool_tip_dict['view'])

        self.pb_delete = QtGui.QPushButton()
        self.pb_delete.setText('Delete')
        self.pb_delete.clicked.connect(self.delete_deliverable)
        grid.addWidget(self.pb_delete, j, 3)
        self.pb_delete.setToolTip(self.tool_tip_dict['delete'])

        self.pb_home = QtGui.QPushButton()
        self.pb_home.setText('Exit')
        self.pb_home.clicked.connect(self.parent.show_project_info)
        grid.addWidget(self.pb_home, j, 5)
        self.pb_home.setToolTip(self.tool_tip_dict['exit'])

        self.setLayout(grid)
    def __init__(self, parent):
        # define the top window

        super(SEGY_Tool_Window, self).__init__()
        self.parent = parent
        self.tool_tip_dict = tool_tips_mapper_dict['segy_tools']
        self.setToolTip(self.tool_tip_dict['general'])
        self.DUG_connection_obj = self.parent.DUG_connection_obj
        self.db_connection_obj = self.parent.db_connection_obj
        self.SEGY_service = SEGY_service(self)

        grid = QtGui.QGridLayout()

        labels_widget = QtGui.QLabel('SEGY Tools')  #position  = 0
        labels_widget.setAlignment(QtCore.Qt.AlignCenter)
        labels_widget.setStyleSheet('background-color: black; color: white')
        grid.addWidget(labels_widget, 0, 0)

        btn0 = QtGui.QPushButton(
            "SEGY QC and production Status")  #position = 1
        btn0.setToolTip(self.tool_tip_dict['status'])
        btn0.clicked.connect(self.segy_production_qc_status)
        btn0.resize(btn0.minimumSizeHint())
        grid.addWidget(btn0, 1, 0)

        lbl1 = create_central_labels('Report functions')  #position = 2
        lbl1.resize(lbl1.minimumSizeHint())
        grid.addWidget(lbl1, 2, 0)

        btn1 = QtGui.QPushButton("Survey wide SEGY QC report")  # position = 3
        btn1.setToolTip(self.tool_tip_dict['survey_wide_qc'])
        btn1.clicked.connect(
            self.tool_welcome
        )  ################## need to define proper funciton for this
        btn1.resize(btn1.minimumSizeHint())
        grid.addWidget(btn1, 3, 0)

        btn2 = QtGui.QPushButton("Shipment wise SEGY QC report")  #position = 4
        btn2.setToolTip(self.tool_tip_dict['shipment_wise_qc'])
        btn2.clicked.connect(
            self.tool_welcome
        )  ################## need to define proper funciton for this
        btn2.resize(btn2.minimumSizeHint())
        grid.addWidget(btn2, 4, 0)

        lbl2 = create_central_labels('DUG SEGY Templates')  #position = 5
        lbl2.resize(lbl2.minimumSizeHint())
        grid.addWidget(lbl2, 5, 0)

        btn3 = QtGui.QPushButton("Create sequencewise DUGSGYT")  #position = 6
        btn3.setToolTip(self.tool_tip_dict['2d_sgyt'])
        btn3.clicked.connect(self.DUG_SGYT)
        btn3.resize(btn3.minimumSizeHint())
        grid.addWidget(btn3, 6, 0)

        btn31 = QtGui.QPushButton("Create 3D DUGSGYT")  # position = 7
        btn31.setToolTip(self.tool_tip_dict['3d_sgyt'])
        btn31.clicked.connect(self.DUG_SGYT)
        btn31.resize(btn31.minimumSizeHint())
        grid.addWidget(btn31, 7, 0)

        lbl3 = create_central_labels('SEGY on disk QC')  #postion = 8
        lbl3.resize(lbl3.minimumSizeHint())
        grid.addWidget(lbl3, 8, 0)

        btn4 = QtGui.QPushButton("Perform SEGY QC")  #position = 9
        btn4.setToolTip(self.tool_tip_dict['segy_qc'])
        btn4.clicked.connect(
            self.single_SEGY_QC_perform
        )  ################## need to define proper funciton for this
        btn4.resize(btn4.minimumSizeHint())
        grid.addWidget(btn4, 9, 0)

        lbl4 = create_central_labels('Tape logs')  #position = 10
        lbl4.resize(lbl4.minimumSizeHint())
        grid.addWidget(lbl4, 10, 0)

        btn6 = QtGui.QPushButton("Survey wide SEGY Tape Logs")  #postion = 11
        btn6.setToolTip(self.tool_tip_dict['survey_wide_tape'])
        btn6.clicked.connect(
            self.survey_wide_tape_log
        )  ################## need to define proper funciton for this
        btn6.resize(btn6.minimumSizeHint())
        grid.addWidget(btn6, 11, 0)

        btn99 = QtGui.QPushButton(
            "Shipment wise SEGY Tape Logs")  # postion = 11
        btn99.setToolTip(self.tool_tip_dict['shipment_tape'])
        btn99.clicked.connect(
            self.tool_welcome
        )  ################## need to define proper funciton for this
        btn99.resize(btn99.minimumSizeHint())
        grid.addWidget(btn99, 12, 0)

        for i in range(13, 16):
            grid.addWidget(QtGui.QLabel(""), i, 0)

        grid.setSpacing(10)
        self.setLayout(grid)
        self.resize(self.sizeHint())
class pop_up_check_combo_box_media_association(QtGui.QWidget):
    closed = QtCore.pyqtSignal()

    def __init__(self, parent, title, combo_list, (a, b), (c, d)):
        super(pop_up_check_combo_box_media_association, self).__init__()

        self.deliverable = c
        self.set_no = d
        self.shipment_no = a
        self.box_no = b
        self.media_list = combo_list

        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.setWindowTitle(title)

        self.widget = QtGui.QWidget()
        grid = QtGui.QGridLayout()

        self.media_dict = {}

        i = 0

        for media in combo_list:
            key = str(media.media_label + " : " + media.reel_no)
            btn = QtGui.QCheckBox(
                str(media.media_label + " : " + media.reel_no))
            btn.setObjectName(str(media.media_label + " : " + media.reel_no))
            if media.shipment_no == a and media.box_no == b:
                btn.setChecked(True)
                data = True
            else:
                btn.setChecked(False)
                data = False
            self.media_dict.update({key: data})
            btn.stateChanged.connect(self.btnstate)

            grid.addWidget(btn, i, 0)

            i = i + 1

        pb_ok = QtGui.QPushButton("OK")
        pb_ok.clicked.connect(self.ok_return)

        self.setMinimumWidth(300)
        self.widget.setLayout(grid)
        scroll = QtGui.QScrollArea()
        scroll.setWidget(self.widget)
        scroll.setWidgetResizable(True)
        scroll.setFixedHeight(600)

        layout = QtGui.QVBoxLayout(self)
        layout.addWidget(create_central_labels(a), 0)
        layout.addWidget(create_central_labels(str("Box no : " + str(d))), 1)
        layout.addWidget(create_central_labels(str(c.id) + "_" + c.name), 2)
        layout.addWidget(create_central_labels(str("Set no: " + str(d))), 3)
        layout.addWidget(
            create_center_blank(
                " Available Media list (Media Label : Reel_no) "), 4)
        layout.addWidget(scroll, 5)
        layout.addWidget(pb_ok, 6)

        self.show()
    def __init__(self, parent):
        # define the top window

        super(usb_summary_window, self).__init__()
        self.parent = parent
        self.db_connection_obj = self.parent.db_connection_obj
        self.DUG_connection_obj = self.parent.DUG_connection_obj

        grid =  QtGui.QGridLayout()

        grid.addWidget(create_central_labels("USB Summary"),0,0,1,4)

        labels_text = ["Id", "USB # ",  "Capacity" , "Serial #"]
        labels_list = []
        for label in labels_text:
            labels_list.append(create_central_labels(label))
        for i in range(0, len(labels_list)):
            grid.addWidget(labels_list[i], 1, i)

        # ----------------------------------------------------------------------------------
        #  **** Now searcing for existing shipments in the database and displaying them
        # ----------------------------------------------------------------------------------
        self.existing_usb_list_dict = fetch_usb_list_dict(self.db_connection_obj)

        sobj = self.existing_usb_list_dict

        for j in range(0, len(sobj)):
            grid.addWidget(create_center_data(str(sobj[j]['usb_id'])), j + 2, 0)
            grid.addWidget(create_center_data(str(sobj[j]['label'])), j + 2, 1)
            grid.addWidget(create_center_data(str(sobj[j]['capacity_tb'])), j + 2, 2)
            grid.addWidget(create_center_data(str(sobj[j]['serial_no'])), j + 2, 3)


        # Make it look organized------------------------------------------------
        for j in range(len(sobj), 22):
            for i in range(0, 4):
                grid.addWidget(create_center_blank(""), j + 1, i)
        # ----------------------------------------------------------
        # Adding the button to add deliverable, edit existing one or delete
        # ----------------------------------------------------------
        j = 22

        self.pb_add = QtGui.QPushButton()
        self.pb_add.setText("+")
        self.pb_add.setStatusTip('Add more USB')
        self.pb_add.clicked.connect(self.parent.set_add_usb_label)
        grid.addWidget(self.pb_add, j, 0)

        self.pb_edit = QtGui.QPushButton()
        self.pb_edit.setText('Edit')
        self.pb_edit.setStatusTip('Edit and existing USB')
        self.pb_edit.clicked.connect(self.edit_single_usb)
        grid.addWidget(self.pb_edit, j, 1)

        self.pb_delete = QtGui.QPushButton()
        self.pb_delete.setText('Delete')
        self.pb_delete.setStatusTip('Delete an existing USB')
        self.pb_delete.clicked.connect(self.delete_usb)
        grid.addWidget(self.pb_delete, j, 2)

        self.pb_home = QtGui.QPushButton()
        self.pb_home.setText('Exit')
        self.pb_home.setStatusTip('Exit and return to Home screen ')
        self.pb_home.clicked.connect(self.parent.show_project_info)
        grid.addWidget(self.pb_home, j, 3)

        self.setLayout(grid)
 def add_none(self):
     message = "No active tasks"
     self.grid.addWidget(create_central_labels(message), 0, 0)