Ejemplo n.º 1
0
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
                
        iddfile = "../iddfiles/Energy+V6_0.idd"
        fname = args[0]
        newname = '%s_clean.idf' % (os.path.splitext(fname)[0])
        block,commlst,commdct=parse_idd.extractidddata(iddfile)
        theidd=eplusdata.idd(block,2)
        data, commdct = readidf.readdatacommdct(fname, iddfile=theidd,
                                    commdct=commdct)

        txt = `data`
        open(newname, 'w').write(txt)
Ejemplo n.º 2
0
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value
        print args
        fname, objkey, oldname, newname, newfname = args
        objkey = objkey.upper()
        iddfile = "../iddfiles/Energy+V6_0.idd"
        block,commlst,commdct=parse_idd.extractidddata(iddfile)
        theidd=eplusdata.idd(block,2)
        data, commdct = readidf.readdatacommdct(fname, iddfile=theidd,
                                    commdct=commdct)
        idd = eplus_functions.Idd(commdct, commlst, theidd, block)
        idfw = eplus_functions.IdfWrapper(data, idd)
        # ---
        eplus_functions.rename_name(idfw, key, oldname, newname)
        txt = `data`
        open(newfname, 'w').write(txt)
def main(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="])
        except getopt.error, msg:
            raise Usage(msg)
    
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-o", "--output"):
                output = value

        infile, zonename, aduname, uunitname, outfile = args
        iddfile = "../iddfiles/Energy+V6_0.idd"
        block,commlst,commdct=parse_idd.extractidddata(iddfile)
        theidd=eplusdata.idd(block,2)
        data, commdct = readidf.readdatacommdct(infile, iddfile=theidd,
                                    commdct=commdct)
        idd = eplus_functions.Idd(commdct, commlst, theidd, block)
        idfw = eplus_functions.IdfWrapper(data, idd)
        print "%s | %s | %s" % (zonename, aduname, uunitname)
        adu2unctr(idfw, zonename, aduname, uunitname)
        data = idfw.idf
        txt = `data`
        open(outfile, 'w').write(txt)
Ejemplo n.º 4
0
"""Remove air distribution unit and replace it with an uncontrolled unit"""
import sys
sys.path.append('../EPlusInputcode')
from EPlusCode.EPlusInterfaceFunctions import readidf

from EPlusCode.EPlusInterfaceFunctions import parse_idd
from EPlusCode.EPlusInterfaceFunctions import eplusdata
import loops
import eplus_functions

iddfile = "../iddfiles/Energy+V6_0.idd"
block,commlst,commdct=parse_idd.extractidddata(iddfile)
theidd=eplusdata.idd(block,2)


# #--------------------------
# fname = "../idffiles/doas2.idf"
# outname = "../idffiles/doas2_1.idf"
# aduname = "ZN_1_FLR_2_SEC_1 ATU"
# uunitname = "ZN_1_FLR_2_SEC_1 uncontrolled"
# zonename = "ZN_1_FLR_2_SEC_1"
# #--------------------------
#--------------------------
fname = "../idffiles/doas2_1.idf"
zonename = "ZN_1_FLR_2_SEC_2"
aduname = "ZN_1_FLR_2_SEC_2 ATU"
uunitname = "ZN_1_FLR_2_SEC_2 uncontrolled"
outname = "../idffiles/doas2_2.idf"
#--------------------------
data, commdct = readidf.readdatacommdct(fname, iddfile=theidd,
                            commdct=commdct)