Project

General

Profile

Actions

New Function #616

open

New Function #612: [ADMIN] 관리자 화면 개발 (Admin pages)

[ADMIN] SIMULATION > NEW

Added by Deca Park 4 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Start date:
10/07/2024
Due date:
% Done:

0%

Estimated time:

Description

1.Spec

2.As-Is

3.To-Be

  • page re-implementation
  • DB tables: EC_xxx
  • refer to current UI design style 

Files

DB_sensor_20241017.sql (7.01 KB) DB_sensor_20241017.sql Deca Park, 10/18/2024 04:43 PM
Simulation_logic_20241021.txt (3.57 KB) Simulation_logic_20241021.txt Deca Park, 10/21/2024 05:44 PM
eoco2_excel_down.png (19 KB) eoco2_excel_down.png Deca Park, 10/26/2024 02:51 PM
test_data.csv (1.02 KB) test_data.csv Toby Pham, 10/28/2024 02:32 PM
PredictMetModel_DeepL_2_json.json (198 KB) PredictMetModel_DeepL_2_json.json Toby Pham, 11/07/2024 05:47 PM
simul_1.png (75 KB) simul_1.png Deca Park, 11/13/2024 03:25 PM
simul_progress_bar.png (175 KB) simul_progress_bar.png Deca Park, 11/15/2024 12:34 PM
Actions #1

Updated by Deca Park 4 months ago

  • Description updated (diff)
Actions #2

Updated by Deca Park 4 months ago

  • Description updated (diff)
Actions #3

Updated by Deca Park 4 months ago

  • File DB_sensor.sql added
  • Description updated (diff)
Actions #4

Updated by Deca Park 4 months ago

  • File Simulation_logic_20241014.txt added
Actions #5

Updated by Deca Park 4 months ago

  • File deleted (Simulation_logic_20241014.txt)
Actions #6

Updated by Deca Park 4 months ago

  • File Simulation_logic_20241015.txt added
Actions #7

Updated by Deca Park 4 months ago

  • File deleted (DB_sensor.sql)
Actions #8

Updated by Deca Park 4 months ago

  • File deleted (Simulation_logic_20241015.txt)
Actions #9

Updated by Deca Park 4 months ago

  • File DB_sensor_20241016.sql added
  • File Simulation_logic_20241016.txt added
Actions #10

Updated by Deca Park 4 months ago

  • File deleted (DB_sensor_20241016.sql)
Actions #11

Updated by Deca Park 4 months ago

  • File DB_sensor_20241017.sql added
Actions #12

Updated by Deca Park 4 months ago

  • File deleted (DB_sensor_20241017.sql)
Actions #13

Updated by Deca Park 4 months ago

  • File DB_sensor_20241017.sql added
Actions #14

Updated by Deca Park 4 months ago

  • File deleted (DB_sensor_20241017.sql)
Actions #15

Updated by Deca Park 4 months ago

change history of [Simulation logic]

1.2024-10-18

  0-1)-b) : 1 record (current time) : manual input
  1-2)-*) : if run simulation MODEL with multiple input data, mutlple result of the simulation MODEL are returned
  2-5) M30 (DeepL1)
  2-6) M31 (DeepL2)

2.2024-10-21

  2.Simulation MODEL logic : Tier1 / Reg1 / Reg2 / Reg3 change

Actions #16

Updated by Deca Park 4 months ago

  • File deleted (Simulation_logic_20241016.txt)
Actions #17

Updated by Deca Park 4 months ago

  • Description updated (diff)
Actions #18

Updated by Deca Park 4 months ago

  • Status changed from New to In Progress
Actions #19

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.Common
  1) simulation name
    - 자동생성 checkbox: REMOVE
    - inputbox: editable (default)

2.시뮬레이션 유형 (simulation type)
  1) if 트윈형(T) and 탄소배출량 예측(TS02) is selected
    a) 적용 모델 (model)
      - selectbox options: show data with AI_MODEL_YN='Y' (DeepL-1/DeepL-2)
      - hide 추가(Add) button

3.데이터 입력 (input data)
  1) when previous selected simulation type is 트윈형(T)
    - clear 데이터 가져오기 / 데이터 미리보기 area
  2) 데이터 가져오기 > 데이터베이스 연결 (Database connect)
    a) Databse selectbox
      - apply disable style (gray color ?)
    b) when import DB data (if 가져오기(import) button clicks)
      - display only input data FACTOR into Grid (currently, all FACTOR is displayed)
      - Grid column name : apply with {FACTOR_COLUMN} (alias is applied with FACTOR_NAME on DB_sensor.sql)
    c) if 적용 모델(MODEL) is not selected
      - alert error msg.("적용 모델을 선택해주세요.")

  3) 데이터 가져오기 > 데이터 파일 불러오기 (import csv file)
    a) when import DB data
      - same issue with No 3-2)-b)
      - TIME column is shown on last wrong (test witha attach csv file)
        ("TIME" column should display with "create_dt")
      a-1) 데이터 전처리 (data preporcessing)
        - error happens: " [KeyError : 'create_dt']"

  4) 데이터 전처리 (data preprocessing) (Common)
      a) if API takes long time (when DB data import)
        - show progress bar
        - if it is done successfully, alert msg.("데이터 전처리가 정상적으로 수행되었습니다.")

4.시뮬레이션 실행 (RUN SIMULATION)
  1) if simulation type is 트윈형(T) and 데이터 가져오기 > 데이터베이스 연결 (Database connect)
    - currently, EC_SIMULATION_RESULT data is not created
  2) if 1) if simulation type is 트윈형(T) and 데이터 가져오기 > 데이터 파일 불러오기 (Import data file) (TEST: test_data.csv)
    a) EC_SIMULATION_RESULT data : 
      - RESULT_DT : set by INPUT data's datetime ([TEST RESULT] 1st row's datetime is set into all row)

Actions #20

Updated by Deca Park 4 months ago

  • File deleted (Simulation_logic_20241018.txt)
Actions #22

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.데이터 전처리 (data preprocess) button

  1) enable/disable
    - if 데이터 미리보기 (preview input data) is done, enable it (if not, disable)

  2) if clicks
    - call API : POST ​/model​/Preprocessing
    - apply API result(cleaned values) into 데이터 미리보기 (preview input data) Grid

2.시뮬레이션 실행 (RUN SIMULATION)

  1) if 데이터 미리보기 (preview input data) Grid's any column value has NULL(empty)
    - alert error msg.("값이 없는 입력 데이터 항목이 존재합니다.<br>데이터 전처리를 수행해주세요.")

Actions #23

Updated by Deca Park 4 months ago

[SIMULATION NEW]

1.if 시뮬레이션 유형(simulation type) is selected with

  1) 일반형(ST01)
    a) 적용 모델 (model)
      - don't show model with AI_MODEL_YN='Y' (DeepL-1/DeepL-2)

  2) 트윈형(ST02)
    a) 시뮬레이션 기간 (simulation period)
      a-1) period type (5분/시간/일) : Hide(all)
        - fixed with 5분(PT01)
      a-2) not set default period(today) (default: empty)
    b) 적용 모델 (model)
      b-1) if TWIN_SIMUL_TYPE is selected with 탄소배출량 예측(TS02)
               - can select only model with AI_MODEL_YN='Y' (DeepL-1/DeepL-2)
             else, display all MODEL (currently, AI_MODEL is not shown)

  3) if simulation type is selected again, clear previous fields
    - 분야 (ENERGY_CLS) is not cleared
    - add default option: '선택하세요' (select)

2.데이터 미리보기 (input data preview)

  1) if TWIN_SIMUL_TYPE is selected with 모델별 비교(TS01)
    a) 시뮬레이션 기간 > {PERIOD_TO}
      - can select until today on datepicker
      - but if 탄소배출량 예측(TS02), datepicker selection is no limit

    b) if AI_MODEL (DeepL-1/DeepL-2) is included in 적용 모델 (model)
         - get input data from {PERIOD_FR - 1day} ~ {PERIOD_TO}
           ex) if PERIOD_FR = '2024-10-24', get from '2024-10-23'  [Test] if  '2024-10-24' ~  '2024-10-24', get '2024-10-22' ~  '2024-10-24' (wrong) ->  TO_BE:  '2024-10-23' ~  '2024-10-24'
       else
         - get input data from {PERIOD_FR} ~ {PERIOD_TO}  [Test] if  '2024-10-24' ~  '2024-10-24', get '2024-10-23' ~  '2024-10-24' (wrong)) -> TO_BE:  '2024-10-24' ~  '2024-10-24'

    c) if MODEL is changed or added
      c-1) As-is: input data Grid is changed during some time
            To-be: just clear input data Grid

  2) if TWIN_SIMUL_TYPE is selected with 탄소배출량 예측(TS02)
    a) 시뮬레이션 기간 (simulation period)
      - get input data with {PERIOD_FR - 1day - interval} ~ {PERIOD_FR - 1day}
      - ex) if simulation period is 2024.08.01 ~ 2024.08.10 (interval: 10 days)
            get input data with 2024.07.22 ~ 2024.07.31

      [Test] if  '2024-10-24' ~  '2024-10-24', get '2024-10-22' ~  '2024-10-23' (wrong)) -> TO_BE: '2024-10-23' ~  '2024-10-23' : {PERIOD_FR - 1day - 0} ~ {PERIOD_FR - 1day}

  3) when import input data(가져오기), show progress bar

Actions #24

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.데이터 전처리 (data preprocessing)

2.RUN SIMULATION

  • alert error msg (p31 on #612 : 탄소배출 시뮬레이터_화면정의서_v1.91_en_20241024.pptx)

[Test]

2.RUN SIMULATION

  1) when  input data field with NULL is existed
    a) alert msg (change)

      as-is) "값이 없는 입력 데이터 항목이 존재합니다.<br>데이터 전처리를 수행해주세요."
      to-be) "시뮬레이션 실행중 오류가 발생되었습니다.<br>Null 값이 있을 경우 시뮬레이션이 동작하지 않을 수 있습니다.<br>데이터셋을 확인해 보시기 바랍니다." (No 2 on p31)

Actions #25

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.데이터 미리보기 > 파일 내려받기 (download excel)

  1) if clicks download excel, "data corrupted" msg is alerted (refer to attach image)

  2) excel column > TIME
    - set data with Grid column (ex: 2024-10-22 23:00:00)

Actions #26

Updated by Toby Pham 4 months ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #27

Updated by Deca Park 4 months ago

  • File test_data.csv added
Actions #28

Updated by Toby Pham 4 months ago

Actions #29

Updated by Deca Park 4 months ago

  • File deleted (test_data.csv)
Actions #30

Updated by Deca Park 4 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to Toby Pham

[SIMULATION result]

1.시뮬레이션 설정 정보
  1) 시뮬레이션 기간 
    - remove {PERIOD_TYPE} label (ex: 5분)
2.시뮬레이션 결과
  1) List 
    a) DATE
      - display with datetime
    b) add scroll bar into List area
      - display 10 rows by default

  2) graph
    - x-axis datetime is not same with List > Date

3.SIMULATION LIST
  1) simulation status icon
    - when run simulation, although simulation is done, progress icon is shown (if reload page, the icon is changed) - refer to attach image

Actions #31

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.시뮬레이션 실행 (RUN SIMULATION) > 데이터베이스 연결 (Database connect)

  1) 데이터 전처리 (date preprocessing) after import DB input data
    - import DB input data (simulation period: 2024-08-01 ~ 2024-08-02)
    - if run, no data is displayed (not work)
  2) 시뮬레이션 실행 (run simulation)
    - currently, input & result data is not created into DB

2.Run SIMULATION
  1) if MODEL is AI type (M30/M31)
    a) call API (http://218.232.78.85:9005/apidocs/)
      a-1) parameter change
        - start_date, end_date : set by selected simulation period
      a-2) response result
        - "date" : {RESULT_DT}
        - predicted_met" : {RESULT_VALUE}

[TEST]

SIMULATION TYPE: 모델별 비교(TS01), MODEL: DeepL-2, simulation period: 2024-08-02 ~ 2024-08-02, import DB data

1) RESULT DATA (check if it's right)
   - first RESULT_DT: 2024-08-01 00:00:00, last RESULT_DT: 2024-08-02 23:15:00

2) SIMULATION RESULT (/eoco2/simulation) page
  a) List/Chart
    - non-DB data (2024-07-31) is shown wrong

Actions #32

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.Run SIMULATION

  1) Test Case
    - simulation type: 모델별 비교(TS01)
    - applied MODEL: Reg-3, DeepL-2
    - simulation period: 2024-08-02 ~ 2024-08-02
    - input data: import DB data

 2) Input Data
    - get 2024-08-01 ~ 2024-08-02

 3) Simulation Result
   1) if MODEL is not AI model (Reg-3)
     - make Simulation Result of simulation period (2024-08-02 ~ 2024-08-02)

   2) if MODEL is AI model (DeepL-2)
     - make Simulation Result with API result

  3) when make Simulation Result (EC_SIMULATION_RESULT)
    a) if MODEL's RESULT_DT is same 
      - UPDATE EC_SIMULATION_RESULT
        + MODEL_CNT, MODEL_NO_n / RESULT_VALUE_n
   
b) else
        INSERT EC_SIMULATION_RESULT

[TEST Result]

1.EC_SIMULATION_RESULT
  - if RESULT_DT='2024-08-02', MODEL_CNT=1 (should be 2) - fix

2.SIMULATION RESULT (/eoco2/simulation) page
  a) List/Chart
    - Reg-3 MODEL result is not displayed
  b) 시뮬레이션 결과 데이터 > excel download
    - apply like List data

Actions #33

Updated by Toby Pham 4 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #35

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.데이터 입력 (input data)
  1) 데이터 가져오기 > 데이터베이스 연결 (Database connect)
    a) if selected MODEL is AI type(DeepL-1)
      a-1) FACTOR: BREEDING_NUMBER (F01)

        - get from {EC_FARM.LIVESTOCK_CNT} and set same value

Actions #36

Updated by Deca Park 4 months ago

[USER] SIMULATION NEW

1.Run SIMULATION

  1) if MODEL is AI MODEL (DeepL-1,Deep-2)
    a) "start_date/end_date" parameter when call API

      - currently, start_date is set with input data's create_dt because of API error
      - set by selected simulation period 

Actions #37

Updated by Deca Park 4 months ago

[USER] NEW SIMULATION

1.RUN SIMULATION
  1) DB: EC_SIMULATION_INPUT (if import DB input data)

    a)As-is
      - INSERT all input data

    b)To-be
      b-1) save into the file (file name: simulation/yyyymmdd/{SIMUL_SEQ}.json)
        - save json format data
          (currently, "create_dt":1722438000000 (wrong) - fix)

        - current DB INSERT logic is kept for future

      [TEST]
      if MODEL is AI MODEL (DeepL-1 / DeepL-2)
        - make json file with API json parameter (including start_date/end_date/records)

      b-2) INSERT EC_SIMULATION_INPUT (one row)
        - FILE_YN='Y'
        - INPUT_DT: current datetime
        - INPUT_FILE: created file name of b-1)

  2) 데이터 전처리(data preprocessing)

    - if it's done, the preprocessing result data should save into the file
    - when import data file(csv), the preprocessing result data should save into the csv file.

Actions #38

Updated by Deca Park 3 months ago

[ADMIN] NEW SIMULATION

1.데이터 가져오기 (Import input data) > DB 데이터 (DB data) / 데이터 파일 (data file)
  1) 가져오기 (import) button
    - if clicks, show progress bar until import input data is displayed into Grid list
    - currently, page is stopped until the data is loaded into Grid list

Actions #39

Updated by Deca Park 3 months ago

1.RUN SIMULATION

  1)As-is
    - if the simulation is not done, empty is displayed on simulation result page (so user can't know the simulation status)

  2)To-be
    a)display progress bar until the simulation run is done (refer to attach image)
      - msg: "시뮬레이션 진행중..."
      - if possibele (?), show percentage
    b) if the simulation run is done, change the simulation status icon(green style) on the left(simulation list)

[TEST]

1.when RUN SIMULATION

  • although progress bar is displayed, it's not disappeared with 0 percentage (refer to simul_progress_bar.png)
  • -> if simulation run is done, progress bar should disappear and reload simulation result page and the simulation icon on left area
Actions

Also available in: Atom PDF