#!/usr/bin/env python
# -*- coding: utf-8 -*-
# time: 2023/3/2 10:35
# file: main.py
# author: David
# company: shenyang JY
import datetime
import time
from config import myargparse
from logs import Log
from data_process import DataProcess
from data_features import DataFeatures
from validate import Validation
from request import requestHandler
from cache.nn_bp import FMI
from error import dqFix

def start_up(graph, sess):
    # 实例化日志类
    log = Log().logger
    log.info("日志类初始化")
    # 实例化配置类
    args = myargparse(discription="场站端配置", add_help=False)
    log.info("配置类初始化")
    # 实例化验证类
    va = Validation(log=log, args=args)
    log.info("验证类初始化")
    # 实例化请求类
    req = requestHandler(log, args)
    log.info("请求类初始化")
    # 实例化数据处理类
    process = DataProcess(log, args)
    log.info("数据预处理类初始化")
    # 实例化特征类
    features = DataFeatures(log, args)
    log.info("特征类初始化")
    # 模型类初始化
    fmi = FMI(log=log, args=args, graph=graph, sess=sess)
    log.info("模型类初始化")
    # 实例化误差修正类
    fix = dqFix(log=log, args=args)
    log.info("误差修正类初始化")
    return log, va, args, req, process, features, fmi, fix



if __name__ == '__main__':
    start_up()