프로젝트

일반

사용자정보

개정판 b2ff26e4

IDb2ff26e4cb4b40f55d4d9e5828f4d69059ce3708
상위 4564436a
하위 80a83629

송근호이(가) 2년 이상 전에 추가함

issue #000 Export TO PAP 코드 개선중

차이점 보기:

HYTOS/HYTOS/AppDocData.py
64 64
        return dics
65 65

  
66 66
class Inst_Attribute:
67
    def __init__(self, name, column, value):
68
        self.table = name
67
    def __init__(self, table, column, value):
68
        self.table = table
69 69
        self.column = column
70 70
        if value is None:
71 71
            value = ''
HYTOS/HYTOS/Export_To_PAP.py
437 437
                                        diffp = round(symbolItem.attribute['Diff.P'], 3)
438 438

  
439 439
                            if datacase_data == Valve_Datacase.Maximum_Flowrate_Case:
440
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueMaxIn", suctp))
441
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueMaxOut", discp))
442
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DifferentialPressMax", diffp))
440
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueMaxIn", value=suctp))
441
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueMaxOut", value=discp))
442
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="DifferentialPressMax", value=diffp))
443 443
                            elif datacase_data == Valve_Datacase.Normal_Flowrate_Case:
444
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueNorIn", suctp))
445
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueNorOut", discp))
446
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DifferentialPressNor", diffp))
444
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueNorIn", value=suctp))
445
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueNorOut", value=discp))
446
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="DifferentialPressNor", value=diffp))
447 447
                            elif datacase_data == Valve_Datacase.Minimum_Flowrate_Case:
448
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueMinIn", suctp))
449
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingPressrueMinOut", discp))
450
                                inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DifferentialPressMin", diffp))
448
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueMinIn", value=suctp))
449
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="OperatingPressrueMinOut", value=discp))
450
                                inst_Item.attributes.append(Inst_Attribute(table="Inst_CV", column="DifferentialPressMin", value=diffp))
451 451

  
452 452
                            if inlet_streamLine.data.phase_type.upper() != 'Mixed'.upper():
453 453
                                flowrate_mass = inlet_streamLine.data.flowrate_mass
......
459 459
                                compress_factor = inlet_streamLine.data.compress_factor
460 460

  
461 461
                                if datacase_data == Valve_Datacase.Maximum_Flowrate_Case:
462
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMax1", flowrate_mass))
463
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMax1", density))
464
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMax1", viscosity))
465
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingTemperatureMax", temperature))
466
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "MolecularWeightNor", molecular_weight))
467
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "SpecificHeatRatio", specific_heat_ratio))
468
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "Compressibility", compress_factor))
462
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateMax1", value = flowrate_mass))
463
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMax1", value = density))
464
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMax1", value = viscosity))
465
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "OperatingTemperatureMax", value = temperature))
466
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "MolecularWeightNor", value = molecular_weight))
467
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "SpecificHeatRatio", value = specific_heat_ratio))
468
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "Compressibility", value = compress_factor))
469 469
                                elif datacase_data == Valve_Datacase.Normal_Flowrate_Case:
470
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateNor1", flowrate_mass))
471
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityNor1", density))
472
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityNor1", viscosity))
473
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingTemperatureNor", temperature))
470
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="FlowrateNor1", value = flowrate_mass))
471
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="DensityNor1", value = density))
472
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="ViscosityNor1", value = viscosity))
473
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="OperatingTemperatureNor", value = temperature))
474 474
                                elif datacase_data == Valve_Datacase.Minimum_Flowrate_Case:
475
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMin1", flowrate_mass))
476
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMin1", density))
477
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMin1", viscosity))
478
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingTemperatureMin", temperature))
475
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="FlowrateMin1", value=flowrate_mass))
476
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="DensityMin1", value=density))
477
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="ViscosityMin1", value=viscosity))
478
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column="OperatingTemperatureMin", value=temperature))
479 479
                            else:
480 480
                                flowrate_volume = inlet_streamLine.data.flowrate_volume
481 481
                                density = inlet_streamLine.data.density
......
499 499
                                liquid_viscosity = inlet_streamLine.data.liquid_viscosity
500 500

  
501 501
                                if datacase_data == Valve_Datacase.Maximum_Flowrate_Case:
502
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMax1", vapor_flowrate_mass))
503
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMax1", vapor_density))
504
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMax1", vapor_viscosity))
505
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "OperatingTemperatureMax", vapor_temperature))
506
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "MolecularWeightNor", vapor_molecular_weight))
507
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "Compressibility", vapor_compress_factor))
508
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMax2", liquid_flowrate_mass))
509
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMax2", liquid_density))
510
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMax2", liquid_viscosity))
502
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateMax1", value=vapor_flowrate_mass))
503
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMax1", value=vapor_density))
504
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMax1", value=vapor_viscosity))
505
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "OperatingTemperatureMax", value=vapor_temperature))
506
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "MolecularWeightNor", value=vapor_molecular_weight))
507
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "Compressibility", value=vapor_compress_factor))
508
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateMax2", value=liquid_flowrate_mass))
509
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMax2", value=liquid_density))
510
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMax2", value=liquid_viscosity))
511 511
                                elif datacase_data == Valve_Datacase.Normal_Flowrate_Case:
512
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateNor1", vapor_flowrate_mass))
513
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityNor1", vapor_density))
514
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityNor1", vapor_viscosity))
515
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateNor2", liquid_flowrate_mass))
516
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityNor2", liquid_density))
517
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityNor2", liquid_viscosity))
512
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateNor1", value = vapor_flowrate_mass))
513
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityNor1", value = vapor_density))
514
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityNor1", value = vapor_viscosity))
515
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateNor2", value = liquid_flowrate_mass))
516
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityNor2", value = liquid_density))
517
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityNor2", value = liquid_viscosity))
518 518
                                elif datacase_data == Valve_Datacase.Minimum_Flowrate_Case:
519
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMin1", vapor_flowrate_mass))
520
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMin1", vapor_density))
521
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMin1", vapor_viscosity))
522
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "FlowrateMin2", liquid_flowrate_mass))
523
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "DensityMin2", liquid_density))
524
                                    inst_Item.attributes.append(Inst_Attribute("Inst_CV", "ViscosityMin2", liquid_viscosity))
519
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateMin1", value = vapor_flowrate_mass))
520
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMin1", value = vapor_density))
521
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMin1", value = vapor_viscosity))
522
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "FlowrateMin2", value = liquid_flowrate_mass))
523
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "DensityMin2", value = liquid_density))
524
                                    inst_Item.attributes.append(Inst_Attribute(table = "Inst_CV", column = "ViscosityMin2", value = liquid_viscosity))
525 525
                    elif symbolItem.type == "Compressor":
526 526
                        inletPressure = 0
527 527
                        dischargePress = 0
......
533 533
                                dischargePress = round(symbolItem.attribute['Disc.P'], 3)
534 534
                            if 'Diff.P' in symbolItem.attribute.keys():
535 535
                                diffPressure = round(symbolItem.attribute['Diff.P'], 3)
536
                        inst_Item.attributes.append(Inst_Attribute("eq_compressor", "InletPressure", inletPressure))
537
                        inst_Item.attributes.append(Inst_Attribute("eq_compressor", "DischargePress", dischargePress))
538
                        inst_Item.attributes.append(Inst_Attribute("eq_rotating", "DiffPressure", diffPressure))
536
                        inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletPressure", value = inletPressure))
537
                        inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "DischargePress", value = dischargePress))
538
                        inst_Item.attributes.append(Inst_Attribute(table = "eq_rotating", column = "DiffPressure", value = diffPressure))
539 539
                        if inlet_streamLine:
540 540
                            if inlet_streamLine.data:
541 541
                                flowrate_mass = inlet_streamLine.data.flowrate_mass
......
546 546
                                molecular_weight = inlet_streamLine.data.molecular_weight
547 547
                                specific_heat_ratio = inlet_streamLine.data.specific_heat_ratio
548 548
                                compress_factor = inlet_streamLine.data.compress_factor
549
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "WeightFlow", flowrate_mass))
550
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "InletCapacity", flowrate_volume))
551
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "Inlet_Density", density))
552
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "InletTemp", temperature))
553
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "MolecularWeight", molecular_weight))
554
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "InletCpCv", specific_heat_ratio))
555
                                inst_Item.attributes.append(Inst_Attribute("eq_compressor", "InletCompressibility", compress_factor))
556
                        inst_Item.attributes.append(Inst_Attribute("eq_compressor", "OperatingCase", datacase_data))
549
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "WeightFlow", value =  flowrate_mass))
550
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletCapacity", value =  flowrate_volume))
551
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "Inlet_Density", value =  density))
552
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletTemp", value =  temperature))
553
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "MolecularWeight", value =  molecular_weight))
554
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletCpCv", value =  specific_heat_ratio))
555
                                inst_Item.attributes.append(Inst_Attribute(table = "eq_compressor", column = "InletCompressibility", value =  compress_factor))
556
                        inst_Item.attributes.append(Inst_Attribute( table = "eq_compressor", column = "OperatingCase", value = datacase_data))
557 557
                    elif symbolItem.type == "Pump":
558 558
                        suctionPressRated = 0
559 559
                        dischargePressRated = 0
......
578 578
                            if 'HHP' in symbolItem.attribute.keys():
579 579
                                hydraulicPowerRated = symbolItem.attribute['HHP']
580 580
                        if datacase_data == Pump_Datacase.Rated_Flow_Case:
581
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "SuctionPressRated", suctionPressRated))
582
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DischargePressRated", dischargePressRated))
583
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DifferentialPressRated", differentialPressRated))
584
                            inst_Item.attributes.append(Inst_Attribute("eq_rotating", "RatedHead", differentialHeadRated))
585
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "NPSHaRated", nPSHaRated))
586
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "VaporPressRated", vaporPressRated))
587
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "HydraulicPowerRated", hydraulicPowerRated))
581
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "SuctionPressRated", value = suctionPressRated))
582
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "DischargePressRated", value = dischargePressRated))
583
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "DifferentialPressRated", value = differentialPressRated))
584
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_rotating", column = "RatedHead", value = differentialHeadRated))
585
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "NPSHaRated", value = nPSHaRated))
586
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "VaporPressRated", value = vaporPressRated))
587
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "HydraulicPowerRated", value = hydraulicPowerRated))
588 588
                        elif datacase_data == Pump_Datacase.Maximum_Flow_Case:
589
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "SuctionPressMax", suctionPressRated))
590
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DischargePressMax", dischargePressRated))
591
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DifferentialPressMax", differentialPressRated))
592
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DifferentialHeadMax", differentialHeadRated))
593
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "NPSHaMax", nPSHaRated))
594
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "VaporPressMax", vaporPressRated))
589
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "SuctionPressMax", value = suctionPressRated))
590
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "DischargePressMax", value = dischargePressRated))
591
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "DifferentialPressMax", value = differentialPressRated))
592
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "DifferentialHeadMax", value = differentialHeadRated))
593
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "NPSHaMax", value = nPSHaRated))
594
                            inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "VaporPressMax", value = vaporPressRated))
595 595

  
596 596
                        if inlet_streamLine:
597 597
                            if inlet_streamLine.data:
......
600 600
                                viscosity = inlet_streamLine.data.viscosity
601 601
                                temperature = inlet_streamLine.data.temperature
602 602
                                if datacase_data == Pump_Datacase.Rated_Flow_Case:
603
                                    inst_Item.attributes.append(Inst_Attribute("eq_rotating", "DesignCapacity", flowrate_volume))
604
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "RelativeDensityRated", density))
605
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "ViscosityRated", viscosity))
606
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "PumpingTempRated", temperature))
603
                                    inst_Item.attributes.append(Inst_Attribute(table= "eq_rotating", colum = "DesignCapacity", value = flowrate_volume))
604
                                    inst_Item.attributes.append(Inst_Attribute(table= "eq_pump", colum = "RelativeDensityRated", value = density))
605
                                    inst_Item.attributes.append(Inst_Attribute(table= "eq_pump", colum = "ViscosityRated", value = viscosity))
606
                                    inst_Item.attributes.append(Inst_Attribute(table= "eq_pump", colum = "PumpingTempRated", value = temperature))
607 607
                                elif datacase_data == Pump_Datacase.Maximum_Flow_Case:
608
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "FlowMax", flowrate_volume))
609
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "RelativeDensityMax", density))
610
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "ViscosityMax", viscosity))
611
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "PumpingTempMax", temperature))
608
                                    inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "FlowMax", value = flowrate_volume))
609
                                    inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "RelativeDensityMax", value = density))
610
                                    inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "ViscosityMax", value = viscosity))
611
                                    inst_Item.attributes.append(Inst_Attribute(table = "eq_pump", column = "PumpingTempMax", value = temperature))
612 612
                    inst_Item.printf()
613 613
                    inst_Items.append(inst_Item)
614 614

  

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)