Repository Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 32: Line 32:
*[[Repository.AddURD|AddURD( cURD )]] {{APIComment|{{Template:Repository.AddURD.Cmt}}}}
*[[Repository.AddURD|AddURD( cURD )]] {{APIComment|{{Template:Repository.AddURD.Cmt}}}}
*[[Repository.UpdateURD|UpdateURD( cURD )]] {{APIComment|{{Template:Repository.UpdateURD.Cmt}}}}
*[[Repository.UpdateURD|UpdateURD( cURD )]] {{APIComment|{{Template:Repository.UpdateURD.Cmt}}}}
*[[Repository.GetURD|GetURD (cURD)]] {{APIComment|Returns the URD with the provided ID. Returns nothing if the URD does not exist.}} [[#Notes|*]]
*[[Repository.GetURD|GetURD (Integer)]] {{APIComment|Returns the URD with the provided ID. Returns nothing if the URD does not exist.}} [[#Notes|*]]


''' Variable '''  
''' Variable '''  
Line 38: Line 38:
*[[Repository.AddVariable|AddVariable( cVariable )]] {{APIComment|{{Template:Repository.AddVariable.Cmt}}}}
*[[Repository.AddVariable|AddVariable( cVariable )]] {{APIComment|{{Template:Repository.AddVariable.Cmt}}}}
*[[Repository.UpdateVariable|UpdateVariable( cVariable )]] {{APIComment|{{Template:Repository.UpdateVariable.Cmt}}}}
*[[Repository.UpdateVariable|UpdateVariable( cVariable )]] {{APIComment|{{Template:Repository.UpdateVariable.Cmt}}}}
*[[Repository.GetVariable|GetVariable( cVariable )]] {{APIComment|Returns variable with the provided ID. Returns nothing if the variable doesn't exist.}} [[#Notes|*]]
*[[Repository.GetVariable|GetVariable(Integer)]] {{APIComment|Returns variable with the provided ID. Returns nothing if the variable doesn't exist.}} [[#Notes|*]]


''' Task '''  
''' Task '''  
Line 44: Line 44:
*[[Repository.AddCorrectiveTask|AddCorrectiveTask( cCorrectiveTask )]] {{APIComment|{{Template:Repository.AddCorrectiveTask.Cmt}}}}
*[[Repository.AddCorrectiveTask|AddCorrectiveTask( cCorrectiveTask )]] {{APIComment|{{Template:Repository.AddCorrectiveTask.Cmt}}}}
*[[Repository.UpdateCorrectiveTask|UpdateCorrectiveTask( cCorrectiveTask )]] {{APIComment|{{Template:Repository.UpdateCorrectiveTask.Cmt}}}}
*[[Repository.UpdateCorrectiveTask|UpdateCorrectiveTask( cCorrectiveTask )]] {{APIComment|{{Template:Repository.UpdateCorrectiveTask.Cmt}}}}
*[[Repository.GetCorrectiveTask|GetCorrectiveTask]] {{APIComment|Returns corrective task with the provided ID. Returns nothing if the task doesn't exist.}} [[#Notes|*]]
*[[Repository.GetCorrectiveTask|GetCorrectiveTask(Integer)]] {{APIComment|Returns corrective task with the provided ID. Returns nothing if the task doesn't exist.}} [[#Notes|*]]
*[[Repository.GetAllScheduledTasks|GetAllScheduledTasks]] {{APIComment|{{Template:Repository.GetAllScheduledTasks.Cmt}}}}
*[[Repository.GetAllScheduledTasks|GetAllScheduledTasks]] {{APIComment|{{Template:Repository.GetAllScheduledTasks.Cmt}}}}
*[[Repository.AddScheduledTask|AddScheduledTask(cScheduledTask)]] {{APIComment|{{Template:Repository.AddScheduledTask.Cmt}}}}
*[[Repository.AddScheduledTask|AddScheduledTask(cScheduledTask)]] {{APIComment|{{Template:Repository.AddScheduledTask.Cmt}}}}
*[[Repository.UpdateCorrectiveTask|UpdateCorrectiveTask(cScheduledTask)]] {{APIComment|{{Template:Repository.UpdateScheduledTask.Cmt}}}}
*[[Repository.UpdateCorrectiveTask|UpdateCorrectiveTask(cScheduledTask)]] {{APIComment|{{Template:Repository.UpdateScheduledTask.Cmt}}}}
*[[Repository.GetScheduledTask|GetScheduledTask(cScheduledTask)]] {{APIComment|Returns scheduled task with the provided ID. Returns nothing if the task doesn't exist.}} [[#Notes|*]]
*[[Repository.GetScheduledTask|GetScheduledTask(Integer)]] {{APIComment|Returns scheduled task with the provided ID. Returns nothing if the task doesn't exist.}} [[#Notes|*]]
*[[Repository.GetAllTaskTypes|GetAllTaskTypes]] {{APIComment|{{Template:Repository.GetAllTaskTypes.Cmt}}}}
*[[Repository.GetAllTaskTypes|GetAllTaskTypes]] {{APIComment|{{Template:Repository.GetAllTaskTypes.Cmt}}}}


Line 55: Line 55:
*[[Repository.AddCrew|AddCrew(cCrew)]] {{APIComment|{{Template:Repository.AddCrew.Cmt}}}}
*[[Repository.AddCrew|AddCrew(cCrew)]] {{APIComment|{{Template:Repository.AddCrew.Cmt}}}}
*[[Repository.UpdateCrew|UpdateCrew( cCrew )]] {{APIComment|{{Template:Repository.UpdateCrew.Cmt}}}}
*[[Repository.UpdateCrew|UpdateCrew( cCrew )]] {{APIComment|{{Template:Repository.UpdateCrew.Cmt}}}}
*[[Repository.GetCrew|GetCrew(cCrew)]] {{APIComment|Returns crew with the provided ID. Returns nothing if the crew doesn't exist.}} [[#Notes|*]]
*[[Repository.GetCrew|GetCrew(Integer)]] {{APIComment|Returns crew with the provided ID. Returns nothing if the crew doesn't exist.}} [[#Notes|*]]


''' Pool '''  
''' Pool '''  
Line 67: Line 67:
*[[Repository.AddAction|AddAction(cAction)]] {{APIComment|{{Template:Repository.AddAction.Cmt}}}}
*[[Repository.AddAction|AddAction(cAction)]] {{APIComment|{{Template:Repository.AddAction.Cmt}}}}
*[[Repository.UpdateAction|UpdateAction(cAction)]] {{APIComment|{{Template:Repository.UpdateAction.Cmt}}}}
*[[Repository.UpdateAction|UpdateAction(cAction)]] {{APIComment|{{Template:Repository.UpdateAction.Cmt}}}}
*[[Repository.GetAction|GetAction(cAction)]] {{APIComment|Returns action with the provided ID. Returns nothing if the action doesn't exist.}} [[#Notes|*]]
*[[Repository.GetAction|GetAction(Integer)]] {{APIComment|Returns action with the provided ID. Returns nothing if the action doesn't exist.}} [[#Notes|*]]


''' BlockSim '''  
''' BlockSim '''  

Revision as of 23:00, 28 April 2015


This is a class that allows you to access a Synthesis repository. The class has following sections containing methods and properties that allow you to read, create and edit various objects in the repository. See Example at the bottom of this page.

Repository

Project

Unit

  • GetAllUnits Returns an array containing all units of measurement from the current repository.

Model

  • GetAllModelsInfo Returns an array containing all model names and their IDs from the current project.
  • GetAllModels Returns an array containing all models from the current project.
  • AddModel( cModel ) Saves a new model in the repository.
  • UpdateModel( cModel ) Updates the model in the repository.
  • GetModel( Integer ) Returns the model from the current project with the specified ID. Returns nothing if the model does not exist or is not in the current project. *
  • IsModelUsed(Integer) Checks if the model is currently in use by other items. *
  • DeleteModel(Integer) Checks if the model is not in use and deletes the model. Returns true if success, false otherwise. Throws an exception if the model is in use. *

URD

Variable

Task

Crew

Pool

  • GetAllPools Returns an array containing all spare parts pools from the current project.
  • AddPool(cPool) Saves the spare parts pool in the repository.
  • UpdatePool(cPool) Updates the spare parts pool in the repository.
  • GetPool (cPool) Returns pool with the provided ID. Returns nothing if the pool doesn't exist. *

Action

BlockSim

DataWarehouse

XFRACAS

Xfmea

Usage Example

In this usage example, the API is used to connect to a repository, retrieve one of the models in it and then calculate the reliability at a specified time, based on that model.

 'Declare a new repository connection object. 
 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()

Notes