ProjectController.py
changeset 1708 24416137cda7
parent 1685 578a46fb6b30
child 1722 89824afffef2
equal deleted inserted replaced
1707:92537edeb205 1708:24416137cda7
   390         return projectfiles_path
   390         return projectfiles_path
   391 
   391 
   392     def AddProjectDefaultConfiguration(self, config_name="config", res_name="resource1"):
   392     def AddProjectDefaultConfiguration(self, config_name="config", res_name="resource1"):
   393         self.ProjectAddConfiguration(config_name)
   393         self.ProjectAddConfiguration(config_name)
   394         self.ProjectAddConfigurationResource(config_name, res_name)
   394         self.ProjectAddConfigurationResource(config_name, res_name)
       
   395 
       
   396     def SetProjectDefaultConfiguration(self):
       
   397         # Sets default task and instance for new project
       
   398         config = self.Project.getconfiguration(self.GetProjectMainConfigurationName())
       
   399         resource = config.getresource()[0].getname()
       
   400         config = config.getname()
       
   401         resource_tagname = self.ComputeConfigurationResourceName(config, resource)
       
   402         def_task = [
       
   403             {'Priority': '0', 'Single': '', 'Interval': 'T#20ms', 'Name': 'task0', 'Triggering': 'Cyclic'}]
       
   404         def_instance = [
       
   405             {'Task': def_task[0].get('Name'), 'Type': self.GetProjectPouNames()[0], 'Name': 'instance0'}]
       
   406         self.SetEditedResourceInfos(resource_tagname, def_task, def_instance)
   395 
   407 
   396     def NewProject(self, ProjectPath, BuildPath=None):
   408     def NewProject(self, ProjectPath, BuildPath=None):
   397         """
   409         """
   398         Create a new project in an empty folder
   410         Create a new project in an empty folder
   399         @param ProjectPath: path of the folder where project have to be created
   411         @param ProjectPath: path of the folder where project have to be created