개정판 41e26743
dev issue #000 : fluid code의 fluid system 값 설정
Change-Id: If7119a15cc1822cecbf3d66dc70c57763a635d32
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
918 | 918 |
Entity objDb = (Entity)acTrans.GetObject(objectId, OpenMode.ForWrite); |
919 | 919 |
Entity startNodeEntityForPipe = Pipe.GetStartNodeEntityForPipe(objDb); |
920 | 920 |
|
921 |
ArrayList arrayList = new ArrayList(); |
|
922 |
ArrayList arrayList2 = new ArrayList(); |
|
923 |
PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2); |
|
924 |
PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2); |
|
925 |
NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject"); |
|
921 |
//ArrayList arrayList = new ArrayList(); |
|
922 |
//ArrayList arrayList2 = new ArrayList(); |
|
923 |
//PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2); |
|
924 |
//PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2); |
|
925 |
//NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject"); |
|
926 |
|
|
927 |
XData xData = XDataUtilities.GetXData<Entity>(objDb); |
|
928 |
XData xData2 = XDataUtilities.GetXData<Entity>(startNodeEntityForPipe); |
|
926 | 929 |
acTrans.Commit(); |
927 | 930 |
} |
928 | 931 |
|
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
2336 | 2336 |
ReModelingLine(groupLine, _lMConnector, _LMSymbolStart, _LMSymbolEnd, bRemodelingStart, bRemodelingEnd); |
2337 | 2337 |
|
2338 | 2338 |
FlowMarkModeling(groupLine); |
2339 |
LineNumberModelingOnlyOne(groupLine); |
|
2339 |
//LineNumberModelingOnlyOne(groupLine);
|
|
2340 | 2340 |
|
2341 | 2341 |
ReleaseCOMObjects(_lMConnector); |
2342 | 2342 |
|
... | ... | |
4487 | 4487 |
if (mapping != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None") |
4488 | 4488 |
{ |
4489 | 4489 |
LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME]; |
4490 |
if (_LMAAttribute != null) |
|
4490 |
if (mapping.SPPIDATTRIBUTENAME == "OperFluidCode" && !string.IsNullOrEmpty(attribute.VALUE)) |
|
4491 |
{ |
|
4492 |
LMAAttribute _FluidSystemAttribute = _LMModelItem.Attributes["FluidSystem"]; |
|
4493 |
if (_FluidSystemAttribute != null) |
|
4494 |
{ |
|
4495 |
DataTable dt = SPPID_DB.GetFluidSystemInfo(attribute.VALUE); |
|
4496 |
if (dt.Rows.Count == 1) |
|
4497 |
{ |
|
4498 |
string fluidSystem = dt.Rows[0]["CODELIST_TEXT"].ToString(); |
|
4499 |
if (DBNull.Value.Equals(_FluidSystemAttribute.get_Value())) |
|
4500 |
_FluidSystemAttribute.set_Value(fluidSystem); |
|
4501 |
else if (_FluidSystemAttribute.get_Value() != fluidSystem) |
|
4502 |
_FluidSystemAttribute.set_Value(fluidSystem); |
|
4503 |
|
|
4504 |
if (_LMAAttribute != null) |
|
4505 |
{ |
|
4506 |
if (DBNull.Value.Equals(_LMAAttribute.get_Value())) |
|
4507 |
_LMAAttribute.set_Value(attribute.VALUE); |
|
4508 |
else if (_LMAAttribute.get_Value() != attribute.VALUE) |
|
4509 |
_LMAAttribute.set_Value(attribute.VALUE); |
|
4510 |
} |
|
4511 |
} |
|
4512 |
if (dt != null) |
|
4513 |
dt.Dispose(); |
|
4514 |
} |
|
4515 |
} |
|
4516 |
else if (_LMAAttribute != null) |
|
4491 | 4517 |
{ |
4492 | 4518 |
if (DBNull.Value.Equals(_LMAAttribute.get_Value())) |
4493 | 4519 |
_LMAAttribute.set_Value(attribute.VALUE); |
4494 | 4520 |
else if (_LMAAttribute.get_Value() != attribute.VALUE) |
4495 | 4521 |
_LMAAttribute.set_Value(attribute.VALUE); |
4496 |
|
|
4497 | 4522 |
} |
4498 | 4523 |
} |
4499 | 4524 |
} |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
233 | 233 |
private void simpleButton1_Click(object sender, EventArgs e) |
234 | 234 |
{ |
235 | 235 |
Placement placement = new Placement(); |
236 |
LMADataSource dataSource = placement.PIDDataSource; |
|
237 |
LMModelItem modelitem = dataSource.GetModelItem("98F75D05005747969BECFC8E06340129"); |
|
238 |
foreach (LMAAttribute attri in modelitem.Attributes) |
|
239 |
{ |
|
240 |
string name = attri.Name; |
|
241 |
dynamic value = attri.get_Value(); |
|
242 |
} |
|
243 |
return; |
|
236 | 244 |
if (application.ActiveSelectSet.Count > 0) |
237 | 245 |
{ |
238 | 246 |
string modelItemId = null; |
... | ... | |
253 | 261 |
|
254 | 262 |
if (modelItemId!=null) |
255 | 263 |
{ |
256 |
LMADataSource dataSource = new LMADataSource(); |
|
264 |
//LMADataSource dataSource = new LMADataSource();
|
|
257 | 265 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemId); |
258 | 266 |
foreach (LMRepresentation item in modelItem.Representations) |
259 | 267 |
{ |
DTI_PID/SPPIDConverter/DB/SPPID_DB.cs | ||
---|---|---|
350 | 350 |
|
351 | 351 |
return dt; |
352 | 352 |
} |
353 |
|
|
354 |
public static DataTable GetFluidSystemInfo(string operFluidCode) |
|
355 |
{ |
|
356 |
List<string> attributes = new List<string>(); |
|
357 |
SPPID_DBInfo dbInfo = SPPID_DBInfo.GetInstance(); |
|
358 |
DataTable dt = null; |
|
359 |
try |
|
360 |
{ |
|
361 |
if (dbInfo.DBType == "ORACLE") |
|
362 |
{ |
|
363 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
364 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
365 |
|
|
366 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
367 |
{ |
|
368 |
conn.Open(); |
|
369 |
if (conn.State == System.Data.ConnectionState.Open) |
|
370 |
{ |
|
371 |
string sQuery = string.Format(CultureInfo.CurrentCulture, |
|
372 |
@"SELECT * FROM {0}.CODELISTS OUTATTR |
|
373 |
WHERE OUTATTR.codelist_index = |
|
374 |
(SELECT attr.codelist_constraint FROM {0}.CODELISTS ATTR WHERE ATTR.CODELIST_TEXT = '{1}' AND ATTR.CODELIST_NUMBER = 19) AND OUTATTR.CODELIST_NUMBER = 20", dbInfo.PlantPIDDic, operFluidCode); |
|
375 |
using (OracleCommand cmd = new OracleCommand(sQuery, conn)) |
|
376 |
using (OracleDataAdapter adapter = new OracleDataAdapter()) |
|
377 |
{ |
|
378 |
adapter.SelectCommand = cmd; |
|
379 |
dt = new DataTable(); |
|
380 |
adapter.Fill(dt); |
|
381 |
} |
|
382 |
} |
|
383 |
} |
|
384 |
} |
|
385 |
else |
|
386 |
{ |
|
387 |
|
|
388 |
} |
|
389 |
} |
|
390 |
catch (Exception ex) |
|
391 |
{ |
|
392 |
System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
393 |
} |
|
394 |
|
|
395 |
return dt; |
|
396 |
} |
|
353 | 397 |
} |
354 | 398 |
} |
내보내기 Unified diff