Repository Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 76: Line 76:


''' BlockSim '''  
''' BlockSim '''  
*[[Repository.ImportBlockSimXMLFile|ImportBlockSimXMLFile( String )]] {{APIComment|{{Template:Repository.ImportBlockSimXMLFile.Cmt}}}}
*[[Repository.ImportBlockSimXMLFile|ImportBlockSimXMLFile(String)]] {{APIComment|{{Template:Repository.ImportBlockSimXMLFile.Cmt}}}}
*[[Repository.ExportBlockSimXMLFile|ExportBlockSimXMLFile( String )]] {{APIComment|{{Template:Repository.ExportBlockSimXMLFile.Cmt}}}}
*[[Repository.ExportBlockSimXMLFile|ExportBlockSimXMLFile(String)]] {{APIComment|{{Template:Repository.ExportBlockSimXMLFile.Cmt}}}}


'''Reliability Data Warehouse (RDW)'''
'''Reliability Data Warehouse (RDW)'''
Line 91: Line 91:
*[[Repository.WriteToDiagnosticsLog(string, XFRACASDiagnosticEntryType)|WriteToDiagnosticsLog(string, XFRACASDiagnosticEntryType)]] {{APIComment|{{Template:Repository.WriteToDiagnosticsLog (string,XFRACASDiagnosticEntryType).Cmt}}}}
*[[Repository.WriteToDiagnosticsLog(string, XFRACASDiagnosticEntryType)|WriteToDiagnosticsLog(string, XFRACASDiagnosticEntryType)]] {{APIComment|{{Template:Repository.WriteToDiagnosticsLog (string,XFRACASDiagnosticEntryType).Cmt}}}}
*[[Repository.WriteToDiagnosticsLog(System.Exception, XFRACASDiagnosticEntryType, String)|WriteToDiagnosticsLog(System.Exception, XFRACASDiagnosticEntryType, String)]] {{APIComment|{{Template:Repository.WriteToDiagnosticsLog (System.Exception,mXFRACASDiagnosticEntryType, String).Cmt}}}}
*[[Repository.WriteToDiagnosticsLog(System.Exception, XFRACASDiagnosticEntryType, String)|WriteToDiagnosticsLog(System.Exception, XFRACASDiagnosticEntryType, String)]] {{APIComment|{{Template:Repository.WriteToDiagnosticsLog (System.Exception,mXFRACASDiagnosticEntryType, String).Cmt}}}}
*[[Repository.XFRACASCommandTimeout(Integer)|XFRACASCommandTimeout(Integer)]] {{APIComment|{{Template:Repository.XFRACASCommandTimeout(Integer).Cmt}}}}


== Properties ==
== Properties ==

Revision as of 22:37, 20 April 2015


Template:Repository Class.Cmt

Constructors

  • Repository Creates a new Repository object for connecting to Synthesis repositories.

Methods

Connect to / Disconnect from Repository

Project

Units of Measurement

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

Models

  • GetAllModelsInfo Returns an array containing all model names and their IDs from the current project.
  • 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.
  • 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.
  • 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.
  • IsModelUsed(Integer) Version 10 Only- Checks if the model is currently in use by other items.

URDs

  • GetAllURDs Returns an array containing all URDs from the current project.
  • GetURD (cURD) Version 10 Only- Returns URD(s) with the provided ID. Returns nothing if the URD(s) does/do not exist.
  • AddURD( cURD ) Saves a new URD in the repository.
  • UpdateURD( cURD ) Updates the URD in the repository.

Variables

Corrective Tasks

Scheduled Tasks

Task Types

  • GetAllTaskTypes Retuns an array containing all task types in the repository.

Crews

  • GetAllCrews Returns an array containing all crews from the current project.
  • AddCrew(cCrew) Saves the crew in the repository.
  • UpdateCrew( cCrew ) Updates the crew in the repository.
  • GetCrew(cCrew) Version 10 Only - Returns crew with the provided ID. Returns nothing if the crew doesn't exist.

Pools

  • 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) Version 10 Only - Returns pool with the provided ID. Returns nothing if the pool doesn't exist.

Action

BlockSim

Reliability Data Warehouse (RDW)

XFRACAS

Properties

Synthesis Setup Option

  • EnforceRENOCompliance (as boolean) Disallows spaces and special characters in names of models and analysis workbooks. This will ensure that all models and analysis workbooks can be used in RENO equations.

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()