Ejemplo n.º 1
0
 def enter_holes(self):
     MainCode.holes_entry(self.holeName_text.text(),
                          int(self.holeStart_text.text()),
                          int(self.holeSize_text.text()))
     self.holeName_text.clear()
     self.holeSize_text.clear()
     self.holeStart_text.clear()
Ejemplo n.º 2
0
 def check(self):
     global boxes
     segment_changed = []
     changed = []
     for i in range(len(boxes)):
         if boxes[i].checkState() == QtCore.Qt.Checked:
             name = boxes[i].text()
             #boxes[i].setText("Hole")
             boxes[i].setCheckState(QtCore.Qt.Unchecked)
             changed.append(i)
             print(name)
             if name[0:3] == "seg":
                 segment_changed.append(name[9:])
     if len(changed) != 0:
         MainCode.update_memory_after_check(changed, segment_changed)
Ejemplo n.º 3
0
 def bestFit_onclick(self):
     error = MainCode.best_fit()
     if error == 1:
         msg = QtWidgets.QMessageBox()
         msg.setIcon(QtWidgets.QMessageBox.Warning)
         msg.setText(
             "There is not enough Holes size for one of the Segments")
         msg.setWindowTitle("Error Message")
         msg.setStandardButtons(QtWidgets.QMessageBox.Close)
         msg.exec()
         print("error")
Ejemplo n.º 4
0
def Function():
    InitialAction = input("Пожалуйста, прочитайте инструкцию!\
Для этого напишите \'--help \' или напишите \'next \', чтобы продолжить. \
Для завершения работы программы напишите \'exit\'. Не забывайте писать расширения файлов! : "
                          )

    if InitialAction == "--help":
        os.system('cls')
        Functions.ProgramStatus()
        Functions.Info()
        MainCode.SuperMainCode()
    elif InitialAction == "next":
        MainCode.SuperMainCode()
    elif InitialAction == "exit":
        Functions.Exit()
    elif InitialAction == "cls":
        Functions.ClearConsole()
        Functions.ProgramStatus()
        Function()

    else:
        Function()
Ejemplo n.º 5
0
 def chosenProcess_click(self):
     MainCode.chosen_process(self.tableprocess_text.text())
     MainCode.segments_table()
     self.show_segmentTable()
     print("chosenProcess_click")
Ejemplo n.º 6
0
    def first_layout(self, Form):
        MainCode.memory_first_allocation()
        j = 0
        name = "memory_btn"
        fn_name = "on_click"
        global boxes
        global start_labels
        global end_labels
        if len(boxes) != 0:
            for i in range(len(boxes)):
                boxes[i].hide()
            for i in range(len(start_labels)):
                start_labels[i].hide()
            for i in range(len(end_labels)):
                end_labels[i].hide()
        boxes.clear()
        start_labels.clear()
        end_labels.clear()
        i = 0
        current = MainCode.Memory
        for item in current:
            i = i + 1
            name = name + str(i)
            fn_name = fn_name + str(i)
            self.name = QtWidgets.QCheckBox(Form)
            self.name.show()
            self.name.setGeometry(QtCore.QRect(680, 100 + j, 200, 90))
            self.name.setStyleSheet(" background-color: rgb(238, 238, 238);\n "
                                    "color:  dark blue;\n"
                                    "font-size: 18px;\n"
                                    "font-weight: Bold;")

            self.name.setText(item.pid)
            self.name.setCheckable(True)
            boxes.append(self.name)

            self.name.setCheckState(QtCore.Qt.Unchecked)
            self.start_label = QtWidgets.QLabel(Form)

            self.start_label.show()
            self.start_label.setGeometry(QtCore.QRect(685, 105 + j, 200, 90))
            font = QtGui.QFont()
            self.start_label.setFont(font)
            self.start_label.setStyleSheet(
                "background-color: rgb(238, 238, 238);\n"
                "color: dark blue;\n"
                "font-size: 18px;\n"
                "font-weight: Bold;"
                "")
            self.start_label.setObjectName("label")

            self.start_label.setText(str(item.start))
            start_labels.append(self.start_label)
            self.end_label = QtWidgets.QLabel(Form)
            self.end_label.setGeometry(QtCore.QRect(685, 165 + j, 100, 90))
            self.end_label.show()
            font = QtGui.QFont()
            self.end_label.setFont(font)
            self.end_label.setStyleSheet(
                "background-color: rgb(238, 238, 238);\n"
                "color: dark blue;\n"
                "font-size: 18px;\n"
                "font-weight: Bold;"
                "")
            self.end_label.setObjectName("label")
            self.end_label.setText(str(item.start + item.size))
            end_labels.append(self.end_label)
            self.layout.addWidget(self.start_label)
            self.layout.addWidget(self.name)
            self.layout.addWidget(self.end_label)
            j = j + 90
        print(boxes)

        self.startcheck = QtWidgets.QPushButton(Form)
        self.startcheck.show()
        self.startcheck.setGeometry(QtCore.QRect(400, 600, 200, 50))
        font = QtGui.QFont()
        self.startcheck.setFont(font)
        self.startcheck.setStyleSheet("background-color: rgb(238, 238, 238);\n"
                                      " border: 2px solid ;\n"
                                      " border-radius: 10px;\n"
                                      "border-color:#7e7ebd;\n"
                                      "color: #444466;\n  "
                                      "font-size: 18px;\n"
                                      "font-weight:Bold;")
        self.startcheck.setObjectName("startcheck")
        self.startcheck.setText("Start Check")
        self.startcheck.clicked.connect(self.check)
Ejemplo n.º 7
0
 def segment_create(self):
     print("Hi from segment")
     MainCode.segments_creation(self.SegName_text.text(),
                                int(self.SegSize_text.text()),
                                self.processName_text.text())
Ejemplo n.º 8
0
 def process_create(self):
     MainCode.process_creation(self.processName_text.text(),
                               int(self.SegNo_text.text()),
                               MainCode.process_segments)
Ejemplo n.º 9
0
 def NewAllocation_click(self):
     MainCode.new_allocation()
     self.memorySize_text.clear()
Ejemplo n.º 10
0
 def memorySize_click(self):
     MainCode.setMemorysize(int(self.memorySize_text.text()))
Ejemplo n.º 11
0
 def run(self):
     print("Thread 1 start")
     MC.initKinect()
     MC.disconnectStatus = 0
     MC.initialization = 0
     print("Thread 1 complete")
Ejemplo n.º 12
0
 def run(self):
     print("Thread 2 start")
     MC.processKinect()
     print("Thread 2 complete")
Ejemplo n.º 13
0
def Back():
    return MainCode.SuperMainCode()