Template:Repository.Ex: Difference between revisions
Jump to navigation
Jump to search
Chris Kahn (talk | contribs) No edit summary |
Alex Ulanov (talk | contribs) No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
{{APIComment|'Connect to a Synthesis repository.}} | {{APIComment|'Connect to a Synthesis repository.}} | ||
Dim Success As Boolean = False | Dim Success As Boolean = False | ||
Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository. | Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr10") | ||
{{APIComment|'Get a list of the names/IDs of projects in the connected repository.}} | {{APIComment|'Get a list of the names/IDs of projects in the connected repository.}} | ||
Dim ListOfProjects() As NameIdPair | Dim ListOfProjects() As NameIdPair | ||
ListOfProjects = MyRepository.GetAllProjects() | ListOfProjects = MyRepository.Project.GetAllProjects() | ||
{{APIComment|'Open the first project in the list.}} | {{APIComment|'Open the first project in the list.}} | ||
MyRepository.SetCurrentProject(ListOfProjects(0).ID) | MyRepository.Project.SetCurrentProject(ListOfProjects(0).ID) | ||
{{APIComment|'Get a list of the names/IDs of models in the current project.}} | {{APIComment|'Get a list of the names/IDs of models in the current project.}} | ||
Dim ListOfModels() As NameIdPair | Dim ListOfModels() As NameIdPair | ||
ListOfModels = MyRepository.GetAllModelsInfo() | ListOfModels = MyRepository.Model.GetAllModelsInfo() | ||
{{APIComment|'Retrieve the first model in the list.}} | {{APIComment|'Retrieve the first model in the list.}} | ||
Dim AModel | Dim AModel As cModel | ||
AModel = MyRepository.GetModel(ListOfModels(0).ID) | AModel = MyRepository.Model.GetModel(ListOfModels(0).ID) | ||
{{APIComment|'Calculate the reliability at time = 50 and save the result. See [[CModel.Reliability|Reliability]].}} | {{APIComment|'Calculate the reliability at time = 50 and save the result. See [[CModel.Reliability|Reliability]].}} | ||
Dim Rel | Dim Rel As Double | ||
Rel = AModel.Reliability(50) | Rel = AModel.Reliability(50) | ||
{{APIComment|'Disconnect from the repository.}} | {{APIComment|'Disconnect from the repository.}} | ||
MyRepository.DisconnectFromRepository() | MyRepository.DisconnectFromRepository() |
Latest revision as of 23:25, 28 April 2015
Dim MyRepository As New Repository 'Connect to a Synthesis repository. Dim Success As Boolean = False Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr10") 'Get a list of the names/IDs of projects in the connected repository. Dim ListOfProjects() As NameIdPair ListOfProjects = MyRepository.Project.GetAllProjects() 'Open the first project in the list. MyRepository.Project.SetCurrentProject(ListOfProjects(0).ID) 'Get a list of the names/IDs of models in the current project. Dim ListOfModels() As NameIdPair ListOfModels = MyRepository.Model.GetAllModelsInfo() 'Retrieve the first model in the list. Dim AModel As cModel AModel = MyRepository.Model.GetModel(ListOfModels(0).ID) 'Calculate the reliability at time = 50 and save the result. See Reliability. Dim Rel As Double Rel = AModel.Reliability(50) 'Disconnect from the repository. MyRepository.DisconnectFromRepository()