def dispatchJobs(ch): fileTemplate = r".\\Template\T_Shader.gms" strDataPath = r"H:\SRTM\SRTM_GMG_ALL" strRenderName = r"GeoRender01" strOutputFilePath = MakeDir(r"H:\SRTM",strRenderName) strGMSPath = MakeDir(strOutputFilePath,"GMS") strLogPath = MakeDir(strOutputFilePath,"log") flist = SMUP_Image.scanPathAll(strDataPath) for f in flist: print "" print datetime.now(), "处理文件: ",f strFilePathName = f str_GMSPathFile = buildGMS(fileTemplate,strFilePathName, strGMSPath,strLogPath,strRenderName,strOutputFilePath) job = buildJob(str_GMSPathFile) SMB_Dispatch.send_job(job) print "已经提交: ",job
#生成任务参数 f_GMS= open(str_GMSPathFile,"w") f_GMS.write(strGMS) f_GMS.close() return str_GMSPathFile def runGMS(gmsPathFile): strGMPath = r"H:\GlobalMapper11\global_mapper11.exe" strGMSCMD = strGMPath + " " + gmsPathFile print "运行任务: ",strGMSCMD #os.system(strGMSCMD) subprocess.call(strGMSCMD) #=============================================================== if __name__ == '__main__': fileTemplate = r".\\Template\T_Render.gms" strGMSPath = r"H:\SRTM\GeoShader01\GMS" strLogPath = r"H:\SRTM\GeoShader01\log" strRenderName = r"GeoShader01" strOutputFilePath = r"H:\SRTM\GeoShader01" flist = SMUP_Image.scanPathAll(r"H:\SRTM\SRTM_GMG_ALL") for f in flist: print "" print datetime.now(), "处理文件: ",f strFilePathName = f str_GMSPathFile = buildGMS(fileTemplate,strFilePathName,strGMSPath,strLogPath, strRenderName,strOutputFilePath) runGMS(str_GMSPathFile)