void InitConstruct() { RUNSPEC runspec = new RUNSPEC("RUNSPEC"); this.Key.Add(runspec); GRID grid = new GRID("GRID"); this.Key.Add(grid); EDIT edit = new EDIT("EDIT"); this.Key.Add(edit); PROPS props = new PROPS("PROPS"); this.Key.Add(props); REGIONS regions = new REGIONS("REGIONS"); this.Key.Add(regions); SOLUTION solution = new SOLUTION("SOLUTION"); this.Key.Add(solution); SUMMARY summary = new SUMMARY("SUMMARY"); this.Key.Add(summary); SCHEDULE schedule = new SCHEDULE("SCHEDULE"); this.Key.Add(schedule); }
static public void Add(string symbols, PROPS props) { for (int symbol = 0; symbol < symbols.Length; ++symbol) { m_props[symbols[symbol]] |= props; } }
public PROPS CopyProps(PROPS props) { return(new PROPS() { minimizeModifier = props.minimizeModifier, minimizeKey = props.minimizeKey, switchModifier = props.switchModifier, switchKey = props.switchKey }); }
public void SaveProps(PROPS props) { string propsString = ""; propsString += props.minimizeModifier + ","; propsString += (int)props.minimizeKey + ","; propsString += props.switchModifier + ","; propsString += (int)props.switchKey; File.WriteAllText(propsFile, propsString); }
/** * Author | Arcelia Aguirre * Description | Cargar gird de Estudiante * Date | 12-03-2018 * Parameters | DataSet ds, DataGridView dtgd_student */ public void load_dtgdStudent(DataSet ds, DataGridView dtgd_student) { ds = (DataSet)this.consult(PROPS.CERO, PROPS.EMPTY, PROPS.EMPTY, PROPS.CONSULT_L1); if (ds == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_LOAD_CONSOLE); return; } dtgd_student.DataSource = ds.Tables[PROPS.TABLE_STUDENT]; }
/** * Author | Arcelia Aguirre * Description | Cargar el grid de licenciatura * Date | 22-02-2018 * Parameters | DataSet ds, DataGridView dtgd_student, ComboBox cmbbx_typeRegister */ public void load_dtgdStudent(DataSet ds, DataGridView dtgd_student, ComboBox cmbbx_typeRegister) { ds = (DataSet)this.consult(PROPS.CERO, PROPS.EMPTY, PROPS.EMPTY, cmbbx_typeRegister.SelectedValue, PROPS.CONSULT_L3); if (ds == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_LOAD_CONSOLE); return; } dtgd_student.DataSource = ds.Tables[PROPS.TABLE_NOT_STUDENT]; }
/** * Author | Arcelia Aguirre * Description | Cargar el grid de tipos de usuarios * Date | 22-02-2018 * Parameters | DataSet ds, DataGridView dtgd_typeUser */ public void load_dtgdTypeUser(DataSet ds, DataGridView dtgd_typeUser) { ds = (DataSet)this.consult(PROPS.CERO, PROPS.EMPTY, PROPS.CONSULT_L1); if (ds == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_LOAD_CONSOLE); return; } dtgd_typeUser.DataSource = ds.Tables[PROPS.TABLE_TYPE_USER]; }
/** * Author | Arcelia Aguirre * Description | Agregar un tipo de no estudiante * Date | 19-02-2018 * Parameters | string typeNotStudentName */ public void save(string typeNotStudentName) { string command = "type_not_student_new @description = @typeNotStudentName"; paramName[0] = "@typeNotStudentName"; param[0] = typeNotStudentName; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
/** * Author | Arcelia Aguirre * Description | Eliminar un No Estudiante * Date | 12-03-2018 * Parameters | int id */ public void delete(int id) { string command = "student_delete @id = @id"; paramName[0] = "@id"; param[0] = id; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_DELETE); } }
/** * Author | Arcelia Aguirre * Description | Agregar un Tipo de Usuario * Date | 19-02-2018 * Parameters | string description */ public void save(string description) { string command = "type_user_new @description = @description"; paramName[0] = "@description"; param[0] = description; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
/** * Author | Arcelia Aguirre * Description | Agregar una carrera * Date | 19-02-2018 * Parameters | string carrerName, string carrerKey */ public void save(string carrerName, string carrerKey) { string command = "career_new @career_name = @career_name, @career_key = @careerKey "; paramName[0] = "@career_name"; paramName[1] = "@careerKey"; param[0] = carrerName; param[1] = carrerKey; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
/** * Author | Arcelia Aguirre * Description | Modificar un tipo de no estudiante * Date | 28-02-2018 * Parameters | int id, string description */ public void update(int id, string description) { string command = "type_not_student_update @id = @id , @description = @description"; paramName[0] = "@id"; paramName[1] = "@description"; param[0] = id; param[1] = description; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_UPDATE); } }
/** * Author | Arcelia Aguirre * Description | Modificar una carrera * Date | 27-02-2018 * Parameters | int id, string carrerName, string carrerKey */ public void update(int id, string carrerName, string carrerKey) { string command = "career_update @id = @id, @career_name = @career_name, @career_key = @careerKey"; paramName[0] = "@id"; paramName[1] = "@career_name"; paramName[2] = "@careerKey"; param[0] = id; param[1] = carrerName; param[2] = carrerKey; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_UPDATE); } }
/** * Author | Arcelia Aguirre * Description | Agregar un acceso * Date | 21-03-2018 * Parameters | string student_number, string not_student_number */ public DataTable save(string student_number, string not_student_number) { DataTable dataTable; string command = "access_new @student_number = @student_number, @not_student_number = @not_student_number"; paramName[0] = "@student_number"; paramName[1] = "@not_student_number"; param[0] = student_number; param[1] = not_student_number; dataTable = con.loadData(command, paramName, param); if (dataTable == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); return(null); } return(dataTable); }
/** * Author | Arcelia Aguirre * Description | Agregar un No Estudiante * Date | 12-03-2018 * Parameters | string number, string name, string father_last_name, string mother_last_name, int id_type_not_student */ public void save(string number, string name, string father_last_name, string mother_last_name, int id_type_not_student) { string command = "not_student_new @number = @number, @name = @name, @father_last_name = @father_last_name, @mother_last_name = @mother_last_name, @id_type_not_student = @id_type_not_student"; paramName[0] = "@number"; paramName[1] = "@name"; paramName[2] = "@father_last_name"; paramName[3] = "@mother_last_name"; paramName[4] = "@id_type_not_student"; param[0] = number; param[1] = name; param[2] = father_last_name; param[3] = mother_last_name; param[4] = id_type_not_student; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
/** * Author | Arcelia Aguirre * Description | Agregar un usuario * Date | 19-02-2018 * Parameters | string nameUser, string passwordUser, string fatherLastnameUser, string motherLastnameUser, int typeUser */ public void save(string nameUser, string passwordUser, string fatherLastnameUser, string motherLastnameUser, int typeUser) { string command = "user_CICE_new @user_name = @nameUser, @user_password = @passwordUser, @father_last_name = @fatherLastnameUser, @mother_last_name = @motherLastnameUser, @id_type_user = @typeUser "; paramName[0] = "@nameUser"; paramName[1] = "@passwordUser"; paramName[2] = "@fatherLastnameUser"; paramName[3] = "@motherLastnameUser"; paramName[4] = "@typeUser"; param[0] = nameUser; param[1] = passwordUser; param[2] = fatherLastnameUser; param[3] = motherLastnameUser; param[4] = typeUser; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
/** * Author | Arcelia Aguirre * Description | Consultar usuario * Date | 28-02-2018 * Parameters | int id, string user_name, string type_consult */ public object consult(int id, string user_name, string type_consult) { DataSet dataSet; string command = "user_CICE_consult @id = @id, @user_name = @user_name, @type_consult = @type_consult"; paramName[0] = "@id"; paramName[1] = "@user_name"; paramName[2] = "@type_consult"; param[0] = id; param[1] = user_name; param[2] = type_consult; dataSet = con.loadData(command, PROPS.TABLE_USER_CICE, paramName, param); if (dataSet == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_LOAD_CONSOLE); return(null); } return(dataSet); }
/** * Author | Arcelia Aguirre * Description | Consultar un Estudiante * Date | 12-03-2018 * Parameters | int id, string number, string student_name, string type_consult * Retrun | DataSet resutlado de la consulta */ public DataSet consult(int id, string number, string student_name, string type_consult) { DataSet dataSet; string command = "student_consult @id = @id, @number = @number, @student_name = @student_name, @type_consult = @type_consult"; paramName[0] = "@id"; paramName[1] = "@number"; paramName[2] = "@student_name"; paramName[3] = "@type_consult"; param[0] = id; param[1] = number; param[2] = student_name; param[3] = type_consult; dataSet = con.loadData(command, PROPS.TABLE_STUDENT, paramName, param); if (dataSet == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_LOAD_CONSOLE); return(null); } return(dataSet); }
/** * Author | Arcelia Aguirre * Description | Agregar un Estudiante * Date | 01-03-2018 * Parameters | int number, string student_name, * | string student_father_last_name, * | string student_mother_last_name, * | string semester, string id_carrer */ public void save(string number, string student_name, string student_father_last_name, string student_mother_last_name, string semester, int id_carrer) { string command = "student_new @number = @number, @student_name = @student_name, @student_father_last_name = @student_father_last_name, "+ "@student_mother_last_name = @student_mother_last_name, @semester = @semester, @id_career = @id_career"; paramName[0] = "@number"; paramName[1] = "@student_name"; paramName[2] = "@student_father_last_name"; paramName[3] = "@student_mother_last_name"; paramName[4] = "@semester"; paramName[5] = "@id_career"; param[0] = number; param[1] = student_name; param[2] = student_father_last_name; param[3] = student_mother_last_name; param[4] = semester; param[5] = id_carrer; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_SAVE); } }
public PROPS ReadProps() { PROPS props = new PROPS(); if (!File.Exists(propsFile)) { props.minimizeModifier = 5; props.minimizeKey = Keys.X; props.switchModifier = 5; props.switchKey = Keys.S; } else { string[] propsArray = File.ReadAllText(propsFile).Split(','); props.minimizeModifier = Convert.ToInt16(propsArray[0]); props.minimizeKey = (Keys)Convert.ToInt16(propsArray[1]); props.switchModifier = Convert.ToInt16(propsArray[2]); props.switchKey = (Keys)Convert.ToInt16(propsArray[3]); } return(props); }
/** * Author | Arcelia Aguirre * Description | Modificar usuario * Date | 28-02-2018 * Parameters | int id,string user_name,string user_password,string user_password_old, * string father_last_name, string mother_last_name, int id_type_user */ public void update(int id, string user_name, string user_password, string user_password_old, string father_last_name, string mother_last_name, int id_type_user) { string command = "user_CICE_update @id = @id, @user_name = @user_name, @user_password = @user_password, @user_password_old = @user_password_old, @father_last_name = @father_last_name, @mother_last_name = @mother_last_name, @id_type_user = @id_type_user"; paramName[0] = "@id"; paramName[1] = "@user_name"; paramName[2] = "@user_password"; paramName[3] = "@user_password_old"; paramName[4] = "@father_last_name"; paramName[5] = "@mother_last_name"; paramName[6] = "@id_type_user"; param[0] = id; param[1] = user_name; param[2] = user_password; param[3] = user_password_old; param[4] = father_last_name; param[5] = mother_last_name; param[6] = id_type_user; if (con.loadData(command, paramName, param) == null) { PROPS.messageError((int)PROPS.MESSAGE_ERROR.NOT_UPDATE); } }
/// <summary> 清理父节点 </summary> public void InitParentKey(bool isCoal = false) { this.Key.Clear(); this.Key.CreateSingle <SIMSET>("SIMSET"); GRID grid = this.Key.CreateSingle <GRID>("GRID"); if (grid != null) { // 增加屏显 ECHO_OFF echo_off = new ECHO_OFF("ECHO_OFF"); grid.Add(echo_off); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_REG.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GPRO.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GGO.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GOTH.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); // 关闭屏显 ECHO_ON echo_on = new ECHO_ON("ECHO_ON"); grid.Add(echo_on); } this.Key.CreateSingle <MODIFY>("MODIFY"); WELL well = this.Key.CreateSingle <WELL>("WELL"); USE_TF use_tf = new USE_TF("USE_TF"); if (well != null) { well.Add(use_tf); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_WELL.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; well.Add(include); } PROPS props = this.Key.CreateSingle <PROPS>("PROPS"); if (props != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_SAT.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_PVT.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); } if (isCoal) { ADSORB adsorb = this.Key.CreateSingle <ADSORB>("ADSORB"); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_ADS.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; adsorb.Add(include); } SOLUTION solution = this.Key.CreateSingle <SOLUTION>("SOLUTION"); if (solution != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_INI.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_AQU.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); } TUNESET tuneset = this.Key.CreateSingle <TUNESET>("TUNESET"); SOLVECTRL solvectrl = new SOLVECTRL("SOLVECTRL"); tuneset.Add(solvectrl); //if (solvectrl != null) //{ // INCLUDE include = new INCLUDE("INCLUDE"); // include.FileName = this.FileName.GetFileNameWithoutExtension() + "_TUN.DAT"; // include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; // solvectrl.Add(include); //} //SUMMARY summary = this.Key.CreateSingle<SUMMARY>("SUMMARY"); //if (summary != null) //{ // INCLUDE include = new INCLUDE("INCLUDE"); // include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sum.inc"; // include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; // summary.Add(include); // //if (include.Keys.Count == 0) // //{ // // ALL all = new ALL("ALL"); // // include.Add(all); // //} //} SCHEDULE schedule = this.Key.CreateSingle <SCHEDULE>("SCHEDULE"); if (schedule != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_SCH.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; schedule.Add(include); } //END end = this.Key.CreateSingle<END>("END"); // 输出关键字 OUTSCHED rptsched = new OUTSCHED("RPTSCHED"); this.Key.Add(rptsched); }
/// <summary> 将Eclipse数模文件转换成SimON数模文件 </summary> public SimONData ConvertToSimON(EclipseData ecl) { // Todo :Eclipse里面的修改参数没有解析成SimON中修改参数 ecl.RunModify(); RUNSPEC runspec = ecl.Key.Find <RUNSPEC>(); GRID grid = ecl.Key.Find <GRID>(); SOLUTION solution = ecl.Key.Find <SOLUTION>(); SUMMARY summary = ecl.Key.Find <SUMMARY>(); SCHEDULE schedule = ecl.Key.Find <SCHEDULE>(); REGIONS regions = ecl.Key.Find <REGIONS>(); PROPS props = ecl.Key.Find <PROPS>(); SimONData simon = new SimONData(); simon.FileName = ecl.FileName; simon.FilePath = ecl.FilePath; simon.MmfDirPath = ecl.MmfDirPath; simon.InitConstruct(); simon.X = ecl.X; simon.Y = ecl.Y; simon.Z = ecl.Z; // 模型定义 #region - 起始时间 - SOLVECTRL tuning = new SOLVECTRL("TUNING"); tuning.Date = ecl.Key.Find <START>().StartTime; simon.Key.Add(tuning); #endregion #region - 维数定义 - RSVSIZE rsvsize = new RSVSIZE("RSVSIZE"); DIMENS dimens = ecl.Key.Find <DIMENS>(); rsvsize.X = dimens.X; rsvsize.Y = dimens.Y; rsvsize.Z = dimens.Z; simon.Key.Add(rsvsize); #endregion #region - 单位类型 - UnitType unitType = UnitType.METRIC; // 读到METRIC公制单位 METRIC metric = ecl.Key.Find <METRIC>(); if (metric != null) { simon.Key.Add(metric); unitType = UnitType.METRIC; } // 单位类型 FIELD field = ecl.Key.Find <FIELD>(); if (field != null) { simon.Key.Add(field); unitType = UnitType.FIELD; } #endregion #region - 流体类型 - MODELTYPE modeltype = new MODELTYPE("MODELTYPE"); // 流体类型 OIL oil = runspec.Find <OIL>(); WATER water = runspec.Find <WATER>(); GAS gas = runspec.Find <GAS>(); DISGAS disgas = runspec.Find <DISGAS>(); VAPOIL vapoil = runspec.Find <VAPOIL>(); // 黑油 if (oil != null && water != null && gas != null && disgas != null && vapoil == null) { modeltype.MetricType = MetricType.BLACKOIL; } // 油水 else if (oil != null && water != null && gas == null && disgas == null && vapoil == null) { modeltype.MetricType = MetricType.OILWATER; } // 气水 else if (oil == null && water != null && gas != null && disgas == null && vapoil == null) { modeltype.MetricType = MetricType.GASWATER; } // 挥发油 else if (oil != null && water != null && gas != null && disgas != null && vapoil != null) { modeltype.MetricType = MetricType.HFOIL; } else { modeltype.MetricType = MetricType.BLACKOIL; } simon.Key.Add(modeltype); #endregion #region - 分区维数 - EQUILREG equilreg = new EQUILREG("EQUILREG"); FIPREG fipreg = new FIPREG("FIPREG"); ROCKREG rockreg = new ROCKREG("ROCKREG"); SATREG satreg = new SATREG("SATREG"); PVTREG pvtreg = new PVTREG("PVTREG"); simon.Key.Add(equilreg); simon.Key.Add(fipreg); simon.Key.Add(rockreg); simon.Key.Add(satreg); simon.Key.Add(pvtreg); TABDIMS tabdims = runspec.Find <TABDIMS>(); if (tabdims != null) { fipreg.X = tabdims.Fipfqzds4.ToString(); rockreg.X = tabdims.Yslxgs12.ToString(); satreg.X = tabdims.Bhdbs0.ToString(); pvtreg.X = tabdims.Pvtbs1.ToString(); //fipreg.X = "1"; //rockreg.X = "1"; //satreg.X = "1"; //pvtreg.X = "1"; } EQLDIMS eqldims = runspec.Find <EQLDIMS>(); if (eqldims != null) { //equilreg.X = "1"; equilreg.X = eqldims.Phfqs0.ToString(); } OVERBURD overburd = props.Find <OVERBURD>(); if (overburd != null) { //rockreg.X = overburd.Regions.Count.ToString(); } EQUILMAP equilmap = new EQUILMAP("EQUILMAP"); FIPMAP fipmap = new FIPMAP("FIPMAP"); ROCKMAP rockmap = new ROCKMAP("ROCKMAP"); SATMAP satmap = new SATMAP("SATMAP"); PVTMAP pvtmap = new PVTMAP("PVTMAP"); if (regions != null) { EQLNUM eqlnum = regions.Find <EQLNUM>(); if (eqlnum != null) { equilmap = eqlnum.ToTableKey <EQUILMAP>(); solution.Add(equilmap); eqlnum.Delete(); eqlnum.Dispose(); } // Todo :非平衡初始化压力需要转换 var pressure = solution.Find <PRESSURE>(); if (pressure != null) { POIL poil = pressure.ToTableKey <POIL>(); solution.Add(poil); pressure.Delete(); pressure.Dispose(); } if (regions != null) { FIPNUM fipnum = regions.Find <FIPNUM>(); if (fipnum != null) { fipmap = fipnum.ToTableKey <FIPMAP>(); grid.Add(fipmap); fipnum.Delete(); fipnum.Dispose(); } ROCKNUM rocknum = regions.Find <ROCKNUM>(); if (rocknum != null) { rockmap = rocknum.TransToTableKeyByName("ROCKMAP", true) as ROCKMAP; grid.Add(rockmap); rocknum.Delete(); rocknum.Dispose(); } SATNUM satnum = regions.Find <SATNUM>(); if (satnum != null) { satmap = satnum.ToTableKey <SATMAP>(); grid.Add(satmap); satnum.Delete(); satnum.Dispose(); } PVTNUM pvtnum = regions.Find <PVTNUM>(); if (pvtnum != null) { pvtmap = pvtnum.ToTableKey <PVTMAP>(); grid.Add(pvtmap); pvtnum.Delete(); pvtnum.Dispose(); } } } #endregion #region - 地质模型 - simon.Key.Add(grid); #endregion #region - 断层 - //var eclFaults = grid.FindAll<OPT.Product.SimalorManager.RegisterKeys.Eclipse.FAULTS>(); //foreach (var v in eclFaults) //{ //grid.AddRange(this.ConvertToSimON(v)); //v.Delete(); //} #endregion #region - 水体 - //AQUFETP AQUFETP= // Todo :Fetkovich水体数据转换 var ct = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUCT>(); if (ct != null) { var newFetp = this.ConvertToSimON(ct); solution.Add(newFetp); ct.Delete(); } // Todo :Fetkovich水体数据转换 var fetp = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUFETP>(); if (fetp != null) { var newFetp = this.ConvertToSimON(fetp); solution.Add(newFetp); fetp.Delete(); } // Todo :水体连接数据转换 var aquancon = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUANCON>(); if (aquancon != null) { var newFetp = this.ConvertToSimON(aquancon); solution.Add(newFetp); aquancon.Delete(); } #endregion #region - 流体模型 岩石模型- GRAVITY gravity = ecl.Key.Find <GRAVITY>(); if (gravity != null) { // Todo :SimON只解析绝对密度 DENSITY density = this.ConvertTo(gravity, unitType); gravity.ParentKey.Add(density); gravity.Delete(); } List <IRegionInterface> regSoltionKeys = solution.FindAll <IRegionInterface>(); regSoltionKeys.ForEach(l => l.TransToSimONRegion()); simon.Key.Add(solution); // List <IRegionInterface> regPropsKeys = props.FindAll <IRegionInterface>(); regPropsKeys.ForEach(l => l.TransToSimONRegion()); //// Todo :SGWFN 需要特殊转换为 SWGF //SGWFN sgwfn = props.Find<SGWFN>(); //if (sgwfn != null) //{ // //props.AddRange(sgwfn.ConvertTo()); // simon.Key.AddRange<SWGF>(sgwfn.ConvertTo()); //} simon.Key.Add(props); #endregion #region - 初始化模型 - List <EQUIL> equil = solution.FindAll <EQUIL>(); foreach (var item in equil) { EQUILPAR equilpar = new EQUILPAR("EQUILPAR"); EQUIL.Item it = item.GetSingleRegion().GetSingleItem(); equilpar.Szstzdhs0 = it.cksd0; equilpar.Szstljs1 = it.ckyl1; equilpar.Ctstyxhs2 = it.ysjmsd2; equilpar.Ctstyxzdhs3 = it.ysjmcmgyl3.ToDefalt("0"); //equilpar.Jxstzds4 = it.yqjmsd4; equilpar.E100wgzds5 = it.yqjmsd4; equilpar.E300jxstzds6 = it.yqjmcmgyl5; item.ParentKey.Add(equilpar); item.Delete(); } #endregion #region - 生产模型 - WELL well = new WELL("WELL"); // Todo :添加完井数据 (注意要放到生产模型前面) simon.Key.Add(well); // 生产模型 simon.Key.Add(this.ConvertToSimON(schedule, well, ecl.Key.Find <START>().StartTime, simon.HistoryData)); #endregion // Todo :转换修正关键字 List <ModifyKey> modifys = ecl.Key.FindAll <ModifyKey>(); grid.AddRange(modifys); return(simon); }
static public bool HasProps(char chr, PROPS props) { return((chr < 256) ? (m_props[chr] & props) != 0 : false); }
/// <summary> 清理父节点 </summary> public void InitParentKey() { RUNSPEC runspec = this.Key.CreateSingle <RUNSPEC>("RUNSPEC"); GRID grid = this.Key.CreateSingle <GRID>("GRID"); if (grid != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_grid.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); INCLUDE include1 = new INCLUDE("INCLUDE"); include1.FileName = this.FileName.GetFileNameWithoutExtension() + "_faults.inc"; include1.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName; grid.Add(include1); INCLUDE include2 = new INCLUDE("INCLUDE"); include2.FileName = this.FileName.GetFileNameWithoutExtension() + "_aquifer.inc"; include2.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName; grid.Add(include2); } EDIT edit = this.Key.Find <EDIT>(); if (edit != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_edit.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; edit.Add(include); } PROPS props = this.Key.CreateSingle <PROPS>("PROPS"); if (props != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_pvt.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_rp.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); } SOLUTION solution = this.Key.CreateSingle <SOLUTION>("SOLUTION"); if (solution != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_init.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); } REGIONS region = this.Key.CreateSingle <REGIONS>("REGIONS"); if (region != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_regs.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; region.Add(include); } SUMMARY summary = this.Key.CreateSingle <SUMMARY>("SUMMARY"); if (summary != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sum.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; summary.Add(include); //if (include.Keys.Count == 0) //{ // ALL all = new ALL("ALL"); // include.Add(all); //} } SCHEDULE schedule = this.Key.CreateSingle <SCHEDULE>("SCHEDULE"); if (schedule != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sch.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; schedule.Add(include); } END end = this.Key.CreateSingle <END>("END"); }