version_updater() is a wrapper of IDFVersionUpdater preprocessor distributed with EnergyPlus. It takes a path of IDF file or an Idf object, a target version to update to and a directory to save the new models.

version_updater(idf, ver, dir = NULL, keep_all = FALSE)

Arguments

idf

An Idf object or a path of IDF file.

ver

A valid EnergyPlus IDD version, e.g. "9", "8.8", or "8.8.0".

dir

The directory to save the new IDF files. If the directory does not exist, it will be created before save. If NULL, the directory of input Idf object or IDF file will be used. Default: NULL.

keep_all

If TRUE, a list will be return which contains all Idf objects of intermediate versions. The list will be named using first two number of that version, e.g. 8.1, 8.2. If FALSE, only the Idf object of the version specified by ver will be returned. Default: FALSE.

Value

An Idf object if keep_all is FALSE or a list of Idf objects if keep_all is TRUE. An attribute named errors is attached which contains all error messages from transition error (.VCpErr) files.

Details

An attribute named errors is attached which is a list of ErrFiles that contain all error messages from transition error (.VCpErr) files.

Author

Hongyuan Jia

Examples

if (FALSE) {
if (any(avail_eplus()) > "7.2") {
    # create an empty IDF
    idf <- empty_idf("7.2")
    idf$save(tempfile(fileext = ".idf"))

    # convert it from v7.2 to the latest EnergyPlus installed
    updated <- version_updater(idf, max(avail_eplus()))

    # convert it from v7.2 to the latest EnergyPlus installed and keep all
    # intermediate versions
    updated <- version_updater(idf, max(avail_eplus()), keep_all = TRUE)

    # see transition error messages
    attr(updated, "errors")
}
}