mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
Implement skip for rbank process
This commit is contained in:
parent
f085e226c6
commit
6ac551cf60
2 changed files with 135 additions and 89 deletions
|
@ -246,6 +246,7 @@ for igFile in igFilesAll:
|
||||||
# Write land IGs TXT
|
# Write land IGs TXT
|
||||||
printLog(log, ">>> Write land IGs TXT <<<")
|
printLog(log, ">>> Write land IGs TXT <<<")
|
||||||
igTxtFile = ExportBuildDirectory + "/" + IgLandBuildDirectory + "/" + LandscapeName + "_ig.txt"
|
igTxtFile = ExportBuildDirectory + "/" + IgLandBuildDirectory + "/" + LandscapeName + "_ig.txt"
|
||||||
|
if needUpdateDirNoSubdirFile(log, ExportBuildDirectory + "/" + IgLandBuildDirectory, igTxtFile):
|
||||||
printLog(log, "WRITE " + ExportBuildDirectory + "/" + IgLandBuildDirectory + "/" + LandscapeName + "_ig.txt")
|
printLog(log, "WRITE " + ExportBuildDirectory + "/" + IgLandBuildDirectory + "/" + LandscapeName + "_ig.txt")
|
||||||
if os.path.isfile(igTxtFile):
|
if os.path.isfile(igTxtFile):
|
||||||
os.remove(igTxtFile)
|
os.remove(igTxtFile)
|
||||||
|
@ -253,6 +254,8 @@ igTxt = open(igTxtFile, "w")
|
||||||
for igFile in igFilesAll:
|
for igFile in igFilesAll:
|
||||||
igTxt.write(igFile + "\n")
|
igTxt.write(igFile + "\n")
|
||||||
igTxt.close()
|
igTxt.close()
|
||||||
|
else:
|
||||||
|
printLog(log, "SKIP *")
|
||||||
|
|
||||||
# Merge other IGs
|
# Merge other IGs
|
||||||
printLog(log, ">>> Merge other IGs <<<") # (not true merge, since not necesserary)
|
printLog(log, ">>> Merge other IGs <<<") # (not true merge, since not necesserary)
|
||||||
|
|
|
@ -54,10 +54,23 @@ printLog(log, "")
|
||||||
|
|
||||||
# Build rbank bbox
|
# Build rbank bbox
|
||||||
printLog(log, ">>> Build rbank bbox <<<")
|
printLog(log, ">>> Build rbank bbox <<<")
|
||||||
|
tempBbox = ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox"
|
||||||
if BuildIgBoxes == "":
|
if BuildIgBoxes == "":
|
||||||
toolLogFail(log, BuildIgBoxesTool, ToolSuffix)
|
toolLogFail(log, BuildIgBoxesTool, ToolSuffix)
|
||||||
else:
|
else:
|
||||||
mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + RbankBboxBuildDirectory)
|
||||||
|
needUpdateIg = needUpdateMultiDirNoSubdirFile(log, ExportBuildDirectory, IgLookupDirectories, tempBbox)
|
||||||
|
if needUpdateIg:
|
||||||
|
printLog(log, "DETECT UPDATE IG->Bbox")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP IG->Bbox")
|
||||||
|
needUpdateShape = needUpdateMultiDirNoSubdirFile(log, ExportBuildDirectory, ShapeLookupDirectories, tempBbox)
|
||||||
|
if needUpdateShape:
|
||||||
|
printLog(log, "DETECT UPDATE Shape->Bbox")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Shape->Bbox")
|
||||||
|
if needUpdateIg or needUpdateShape:
|
||||||
|
printLog(log, "DETECT DECIDE UPDATE")
|
||||||
cf = open("build_ig_boxes.cfg", "w")
|
cf = open("build_ig_boxes.cfg", "w")
|
||||||
cf.write("\n")
|
cf.write("\n")
|
||||||
cf.write("Pathes = {\n")
|
cf.write("Pathes = {\n")
|
||||||
|
@ -76,11 +89,14 @@ else:
|
||||||
cf.write("\t\"" + os.path.basename(file)[0:-len(".ig")] + "\", \n")
|
cf.write("\t\"" + os.path.basename(file)[0:-len(".ig")] + "\", \n")
|
||||||
cf.write("};\n")
|
cf.write("};\n")
|
||||||
cf.write("\n")
|
cf.write("\n")
|
||||||
cf.write("Output = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n")
|
cf.write("Output = \"" + tempBbox + "\";\n")
|
||||||
cf.write("\n")
|
cf.write("\n")
|
||||||
cf.close()
|
cf.close()
|
||||||
subprocess.call([ BuildIgBoxes ])
|
subprocess.call([ BuildIgBoxes ])
|
||||||
os.remove("build_ig_boxes.cfg")
|
os.remove("build_ig_boxes.cfg")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT DECIDE SKIP")
|
||||||
|
printLog(log, "SKIP *")
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
printLog(log, ">>> Build rbank build config <<<")
|
printLog(log, ">>> Build rbank build config <<<")
|
||||||
|
@ -97,7 +113,7 @@ cf.write("BanksPath = \"" + ExportBuildDirectory + "/" + SmallbankExportDirector
|
||||||
cf.write("Bank = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank\";\n")
|
cf.write("Bank = \"" + ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank\";\n")
|
||||||
cf.write("ZoneExt = \".zonew\";\n")
|
cf.write("ZoneExt = \".zonew\";\n")
|
||||||
cf.write("ZoneNHExt = \".zonenhw\";\n")
|
cf.write("ZoneNHExt = \".zonenhw\";\n")
|
||||||
cf.write("IGBoxes = \"" + ExportBuildDirectory + "/" + RbankBboxBuildDirectory + "/temp.bbox\";\n")
|
cf.write("IGBoxes = \"" + tempBbox + "\";\n")
|
||||||
mkPath(log, LeveldesignWorldDirectory)
|
mkPath(log, LeveldesignWorldDirectory)
|
||||||
cf.write("LevelDesignWorldPath = \"" + LeveldesignWorldDirectory + "\";\n")
|
cf.write("LevelDesignWorldPath = \"" + LeveldesignWorldDirectory + "\";\n")
|
||||||
mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + IgLandBuildDirectory)
|
||||||
|
@ -207,7 +223,31 @@ else:
|
||||||
printLog(log, "SKIP " + lr1)
|
printLog(log, "SKIP " + lr1)
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
printLog(log, ">>> Build rbank process global <<<") # TODO: Check if the LR changed?
|
printLog(log, ">>> Detect modifications to rebuild lr <<<")
|
||||||
|
needUpdateCmbLr = needUpdateDirByTagLog(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory, ".cmb", ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory, ".lr")
|
||||||
|
if needUpdateCmbLr:
|
||||||
|
printLog(log, "DETECT UPDATE Cmb->Lr")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Cmb->Lr")
|
||||||
|
needUpdateCmbRbank = needUpdateDirNoSubdirFile(log, ExportBuildDirectory + "/" + RBankCmbExportDirectory, ExportBuildDirectory + "/" + RbankOutputBuildDirectory + "/" + RbankRbankName + ".rbank")
|
||||||
|
if needUpdateCmbRbank:
|
||||||
|
printLog(log, "DETECT UPDATE Cmb->Rbank")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Cmb->Rbank")
|
||||||
|
needUpdateLrRbank = needUpdateDirNoSubdirFile(log, ExportBuildDirectory + "/" + RbankSmoothBuildDirectory, ExportBuildDirectory + "/" + RbankOutputBuildDirectory + "/" + RbankRbankName + ".rbank")
|
||||||
|
if needUpdateLrRbank:
|
||||||
|
printLog(log, "DETECT UPDATE Lr->Rbank")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Lr->Rbank")
|
||||||
|
needUpdateBboxRbank = needUpdate(log, tempBbox, ExportBuildDirectory + "/" + RbankOutputBuildDirectory + "/" + RbankRbankName + ".rbank")
|
||||||
|
if needUpdateBboxRbank:
|
||||||
|
printLog(log, "DETECT UPDATE Lr->Rbank")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT SKIP Lr->Rbank")
|
||||||
|
|
||||||
|
if needUpdateCmbLr or needUpdateCmbRbank or needUpdateLrRbank or needUpdateBboxRbank:
|
||||||
|
printLog(log, "DETECT DECIDE UPDATE")
|
||||||
|
printLog(log, ">>> Build rbank process global <<<") # This generates temp lr files. TODO: Check if the LR changed?
|
||||||
if BuildRbank == "":
|
if BuildRbank == "":
|
||||||
toolLogFail(log, BuildRbankTool, ToolSuffix)
|
toolLogFail(log, BuildRbankTool, ToolSuffix)
|
||||||
elif ExecTimeout == "":
|
elif ExecTimeout == "":
|
||||||
|
@ -217,7 +257,7 @@ else:
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
os.remove("build_rbank.cfg")
|
os.remove("build_rbank.cfg")
|
||||||
|
|
||||||
printLog(log, ">>> Build rbank indoor <<<")
|
printLog(log, ">>> Build rbank indoor <<<") # This generates the retrievers for the ig that have the cmb export
|
||||||
if BuildIndoorRbank == "":
|
if BuildIndoorRbank == "":
|
||||||
toolLogFail(log, BuildIndoorRbankTool, ToolSuffix)
|
toolLogFail(log, BuildIndoorRbankTool, ToolSuffix)
|
||||||
elif ExecTimeout == "":
|
elif ExecTimeout == "":
|
||||||
|
@ -261,7 +301,7 @@ retrieversDir = ExportBuildDirectory + "/" + RbankRetrieversBuildDirectory
|
||||||
mkPath(log, retrieversDir)
|
mkPath(log, retrieversDir)
|
||||||
outputDir = ExportBuildDirectory + "/" + RbankOutputBuildDirectory
|
outputDir = ExportBuildDirectory + "/" + RbankOutputBuildDirectory
|
||||||
mkPath(log, outputDir)
|
mkPath(log, outputDir)
|
||||||
printLog(log, ">>> Move gr, rbank and lr <<<")
|
printLog(log, ">>> Move gr, rbank and lr <<<") # This simply renames everything
|
||||||
if needUpdateDirNoSubdir(log, retrieversDir, outputDir):
|
if needUpdateDirNoSubdir(log, retrieversDir, outputDir):
|
||||||
removeFilesRecursiveExt(log, outputDir, ".rbank")
|
removeFilesRecursiveExt(log, outputDir, ".rbank")
|
||||||
removeFilesRecursiveExt(log, outputDir, ".gr")
|
removeFilesRecursiveExt(log, outputDir, ".gr")
|
||||||
|
@ -271,6 +311,9 @@ if needUpdateDirNoSubdir(log, retrieversDir, outputDir):
|
||||||
copyFilesRenamePrefixExt(log, retrieversDir, outputDir, "tempMerged_", RbankRbankName + "_", ".lr")
|
copyFilesRenamePrefixExt(log, retrieversDir, outputDir, "tempMerged_", RbankRbankName + "_", ".lr")
|
||||||
else:
|
else:
|
||||||
printLog(log, "SKIP *")
|
printLog(log, "SKIP *")
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT DECIDE SKIP")
|
||||||
|
printLog(log, "SKIP *")
|
||||||
|
|
||||||
log.close()
|
log.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue