프로젝트

일반

사용자정보

개정판 a85b6513

IDa85b65136f0b8c9ed52dfdbaa4acdcb722e1c606
상위 1d28f9e1
하위 ba8e1fc3

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

issue #000 HYTOS 결과 저장 to PAP 수정.

차이점 보기:

HYTOS/HYTOS/Export_To_PAP.py
361 361
        projectNo = self.ui.comboBox_select_PAP_Project.currentText()
362 362
        try:
363 363
            self.data_load()
364
            asyncio.run(self.run_connection(projectNo))
364
            self.run_connection(projectNo)
365 365
        except Exception as ex:
366 366
            from App import App
367 367
            from AppDocData import MessageType
......
371 371
            App.mainWnd().addMessage.emit(MessageType.Error, message)
372 372
            self.ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
373 373

  
374
    async def run_connection(self, projectNo):
375
        task = asyncio.create_task(self.connection(projectNo))
376
        result = await task
374
    def run_connection(self, projectNo):
375
        loop = asyncio.get_event_loop()  # 이벤트 루프를 얻음
376
        result =loop.run_until_complete(self.connection(projectNo))  # main이 끝날 때까지 기다림
377 377
        self.ui.comboBox_select_PAP_Project.setEnabled(True)
378 378
        if strToBool(str(result)):
379 379
            QTimer.singleShot(500, self.done_animation)
......
385 385
    @asyncio.coroutine
386 386
    async def connection(self,projectNo):
387 387
        app_doc_data = AppDocData.instance()
388
        end_point = f"{app_doc_data.API_HOST}/api/Projects/Connection?ProjectName={projectNo}"
388
        url = f"{app_doc_data.API_HOST}/api/Projects/Connection?ProjectName={projectNo}"
389
        print('Starting {}'.format(url))
389 390
        async with aiohttp.ClientSession() as session:
390
            async with session.get(f'{end_point}') as resp:
391
            async with session.get(url) as resp:
391 392
                return await resp.json()
392 393

  
394

  
393 395
    def accept(self):
394 396
        inst_Items = []
395 397
        if self.ui.tableView_upload_item_list.model().rowCount() > 0:
......
559 561
                        differentialHeadRated = 0
560 562
                        nPSHaRated = 0
561 563
                        vaporPressRated = 0
564
                        hydraulicPowerRated = 0
562 565
                        if symbolItem.attribute:
563 566
                            if 'Suct.P' in symbolItem.attribute.keys():
564 567
                                suctionPressRated = round(symbolItem.attribute['Suct.P'], 3)
......
572 575
                                nPSHaRated = round(symbolItem.attribute['NPSHa'], 3)
573 576
                            if 'Vap. P' in symbolItem.attribute.keys():
574 577
                                vaporPressRated = symbolItem.attribute['Vap. P']
578
                            if 'HHP' in symbolItem.attribute.keys():
579
                                hydraulicPowerRated = symbolItem.attribute['HHP']
575 580
                        if datacase_data == Pump_Datacase.Rated_Flow_Case:
576 581
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "SuctionPressRated", suctionPressRated))
577 582
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DischargePressRated", dischargePressRated))
578 583
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DifferentialPressRated", differentialPressRated))
579
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DifferentialHeadRated", differentialHeadRated))
584
                            inst_Item.attributes.append(Inst_Attribute("eq_rotating", "DifferentialHeadRated", differentialHeadRated))
580 585
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "NPSHaRated", nPSHaRated))
581 586
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "VaporPressRated", vaporPressRated))
587
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "HydraulicPowerRated", hydraulicPowerRated))
582 588
                        elif datacase_data == Pump_Datacase.Maximum_Flow_Case:
583 589
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "SuctionPressMax", suctionPressRated))
584 590
                            inst_Item.attributes.append(Inst_Attribute("eq_pump", "DischargePressMax", dischargePressRated))
......
599 605
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "ViscosityRated", viscosity))
600 606
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "PumpingTempRated", temperature))
601 607
                                elif datacase_data == Pump_Datacase.Maximum_Flow_Case:
602
                                    inst_Item.attributes.append(Inst_Attribute("eq_rotating", "FlowMax", flowrate_volume))
608
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "FlowMax", flowrate_volume))
603 609
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "RelativeDensityMax", density))
604 610
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "ViscosityMax", viscosity))
605 611
                                    inst_Item.attributes.append(Inst_Attribute("eq_pump", "PumpingTempMax", temperature))

내보내기 Unified diff

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