# Coverage for grm\plugin\XMLMake.py : 0%

## 84 statements

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1# -*- coding: utf-8 -*-

2

3 import os

4 import sys

5

6 from ElementTree import Element, ElementTree, SubElement, dump, parse, tostring

7

8

9 class make(object):

10 def __init__(self):

11 self.ProjectFile = ""

12

13 # New Project 시에 GMP 파일 생성 하기

14 def Make_GMP_File(self, save_gmp_path):

15 GRMProject = Element("GRMProject")

16 GRMProject.set("xmlns", "http://tempuri.org/GRMProject.xsd")

17 ProjectSettings = SubElement(GRMProject, "ProjectSettings")

18 SubElement(ProjectSettings, "GRMSimulationType").text = "Normal"

19 SubElement(ProjectSettings, "DomainFile")

20 SubElement(ProjectSettings, "SlopeFile")

21 SubElement(ProjectSettings, "FlowDirectionFile")

22 SubElement(ProjectSettings, "FlowAccumFile")

23 SubElement(ProjectSettings, "StreamFile")

24 SubElement(ProjectSettings, "ChannelWidthFile")

25 SubElement(ProjectSettings, "InitialSoilSaturationRatioFile")

26 SubElement(ProjectSettings, "LandCoverDataType").text = "File"

27 SubElement(ProjectSettings, "LandCoverFile")

28 SubElement(ProjectSettings, "LandCoverVATFile")

29 SubElement(ProjectSettings, "ConstantRoughnessCoeff")

30 SubElement(ProjectSettings, "ConstantImperviousRatio")

31 SubElement(ProjectSettings, "SoilTextureDataType").text = "File"

32 SubElement(ProjectSettings, "SoilTextureFile")

33 SubElement(ProjectSettings, "SoilTextureVATFile")

34 SubElement(ProjectSettings, "ConstantSoilPorosity")

35 SubElement(ProjectSettings, "ConstantSoilEffPorosity")

36 SubElement(ProjectSettings, "ConstantSoilWettingFrontSuctionHead")

37 SubElement(ProjectSettings, "ConstantSoilHydraulicConductivity")

38 SubElement(ProjectSettings, "SoilDepthDataType").text = "File"

39 SubElement(ProjectSettings, "SoilDepthFile")

40 SubElement(ProjectSettings, "SoilDepthVATFile")

41 SubElement(ProjectSettings, "ConstantSoilDepth")

42 SubElement(ProjectSettings, "InitialChannelFlowFile")

43 SubElement(ProjectSettings, "FlowDirectionType").text = "StartsFromE_TauDEM"

44 SubElement(ProjectSettings, "GridCellSize")

45 # SubElement(ProjectSettings, 'IsParallel').text = 'true'

46 SubElement(ProjectSettings, "MaxDegreeOfParallelism").text = "-1"

47 SubElement(ProjectSettings, "SimulationStartingTime").text = "0"

48 SubElement(ProjectSettings, "ComputationalTimeStep_min")

49 SubElement(ProjectSettings, "IsFixedTimeStep").text = "false"

50 SubElement(ProjectSettings, "SimulationDuration_hr")

51 SubElement(ProjectSettings, "OutputTimeStep_min")

52 SubElement(ProjectSettings, "SimulateInfiltration").text = "true"

53 SubElement(ProjectSettings, "SimulateSubsurfaceFlow").text = "true"

54 SubElement(ProjectSettings, "SimulateBaseFlow").text = "true"

55 SubElement(ProjectSettings, "SimulateInterception").text = "true"

56 SubElement(ProjectSettings, "SimulateEvapotranspiration").text = "true"

57 SubElement(ProjectSettings, "SimulateSnowMelt").text = "true"

58 SubElement(ProjectSettings, "SimulateFlowControl").text = "true"

59 SubElement(ProjectSettings, "CrossSectionType").text = "CSSingle"

60 SubElement(ProjectSettings, "SingleCSChannelWidthType").text = "CWGeneration"

61 SubElement(ProjectSettings, "ChannelWidthEQc")

62 SubElement(ProjectSettings, "ChannelWidthEQd")

63 SubElement(ProjectSettings, "ChannelWidthEQe")

64 SubElement(ProjectSettings, "ChannelWidthMostDownStream")

65 SubElement(ProjectSettings, "LowerRegionHeight")

66 SubElement(ProjectSettings, "LowerRegionBaseWidth")

67 SubElement(ProjectSettings, "UpperRegionBaseWidth")

68 SubElement(ProjectSettings, "CompoundCSIniFlowDepth")

69 SubElement(ProjectSettings, "CompoundCSChannelWidthLimit")

70 SubElement(ProjectSettings, "BankSideSlopeRight").text = "1.5"

71 SubElement(ProjectSettings, "BankSideSlopeLeft").text = "1.5"

72 SubElement(ProjectSettings, "MakeIMGFile").text = "false"

73 SubElement(ProjectSettings, "MakeASCFile").text = "false"

74 SubElement(ProjectSettings, "MakeSoilSaturationDistFile").text = "true"

75 SubElement(ProjectSettings, "MakeRfDistFile").text = "true"

76 SubElement(ProjectSettings, "MakeRFaccDistFile").text = "true"

77 SubElement(ProjectSettings, "MakeFlowDistFile").text = "true"

78 SubElement(ProjectSettings, "PrintOption").text = "All"

79 SubElement(ProjectSettings, "PrintAveValue").text = "false"

80 SubElement(ProjectSettings, "AveValueTimeInterval_min")

81 SubElement(ProjectSettings, "WriteLog").text = "false"

82 SubElement(ProjectSettings, "AboutThisProject")

83 SubElement(ProjectSettings, "AboutWatershed")

84 SubElement(ProjectSettings, "AboutLandCoverMap")

85 SubElement(ProjectSettings, "AboutSoilMap")

86 SubElement(ProjectSettings, "AboutSoilDepthMap")

87 SubElement(ProjectSettings, "AboutRainfall")

88 SubElement(ProjectSettings, "ProjectSavedTime")

89 SubElement(ProjectSettings, "ComputerName")

90 SubElement(ProjectSettings, "ComputerUserName")

91 SubElement(ProjectSettings, "GRMVersion")

92 ElementTree(GRMProject).write(

93 save_gmp_path, encoding="utf-8", xml_declaration=True

94 )