Example #1
0
    def saveTask(self, promptSaveLocation):
        printf("GUI| Saving project")

        # If there is no filename, ask for one
        if promptSaveLocation or self.fileName is None:
            Global.ensurePathExists(Paths.saves_dir)
            filename, _ = QtWidgets.QFileDialog.getSaveFileName(parent=self,
                                                                caption="Save Task",
                                                                filter="Task (*.task)",
                                                                directory=Paths.saves_dir)

            if filename == "": return False  #If user hit cancel
            self.fileName = filename
            self.env.updateSettings("lastOpenedFile", self.fileName)


        # Update the save file
        saveData = self.controlPanel.getSaveData()
        json.dump(saveData, open(self.fileName, 'w'), sort_keys=False, indent=3, separators=(',', ': '))

        self.loadData = deepcopy(saveData)  #Update what the latest saved changes are




        self.setWindowTitle(self.programTitle + '       ' + self.fileName)
        printf("GUI| Project Saved Successfully")
        return True
Example #2
0
    def saveTask(self, promptSaveLocation):
        printf("GUI| Saving project")

        # If there is no filename, ask for one
        if promptSaveLocation or self.fileName is None:
            Global.ensurePathExists(Paths.saves_dir)
            filename, _ = QtWidgets.QFileDialog.getSaveFileName(parent=self,
                                                                caption="Save Task",
                                                                filter="Task (*.task)",
                                                                directory=Paths.saves_dir)

            if filename == "": return False  #If user hit cancel
            self.fileName = filename
            self.env.updateSettings("lastOpenedFile", self.fileName)


        # Update the save file
        saveData = self.controlPanel.getSaveData()
        json.dump(saveData, open(self.fileName, 'w'), sort_keys=False, indent=3, separators=(',', ': '))

        self.loadData = deepcopy(saveData)  #Update what the latest saved changes are




        self.setWindowTitle(self.programTitle + '       ' + self.fileName)
        printf("GUI| Project Saved Successfully")
        return True
help_cam_overview = os.path.join(imageLoc, "help_cam_overview.png")
help_make_sticker = os.path.join(imageLoc, "help_make_sticker.png")
help_marker_on_head = os.path.join(imageLoc, "help_sticker_on_head.png")
help_star = os.path.join(imageLoc, "help_star.png")
help_drag_command = os.path.join(imageLoc, "help_drag_command.gif")
help_add_event = os.path.join(imageLoc, "help_add_event.gif")
help_connect_camera = os.path.join(imageLoc, "help_connect_camera.gif")
help_rob_connect = os.path.join(imageLoc, "help_rob_connect.gif")

################        USERS RESOUCES    ################
ucs_home_dir = os.path.join(expanduser("~"), "uArmCreatorStudio",
                            "")  # uArmCreatorStudio home dir
log_dir = os.path.join(ucs_home_dir, "log", "")
bugreport_dir = os.path.join(ucs_home_dir, "bugreport", "")

Global.ensurePathExists(ucs_home_dir)
Global.ensurePathExists(log_dir)
Global.ensurePathExists(bugreport_dir)

error_log = os.path.join(log_dir, "error.log")
ucs_log = os.path.join(log_dir, "ucs.log")
bugreport_zipfile = os.path.join(bugreport_dir, "log.zip")
user_manual = os.path.join(exeResourcesPath, "User_Manual.pdf")
survey_link = "https://goo.gl/forms/ZWN6xKvBssyRWqVI3"
bugreport_link = "https://form.jotform.me/63162320754450"

settings_txt = os.path.join(ucs_home_dir, "Settings.txt")
objects_dir = os.path.join(ucs_home_dir, "Objects", "")
saves_dir = os.path.join(ucs_home_dir, "Save Files", "")