You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import os
import sys
import logging
from pydantic import BaseSettings
class AGVPLC :
'''
AGV配置PLC
'''
HOST = ' 192.168.193.202 '
PORT = 502
class Setting ( BaseSettings ) :
# 项目信息
PROJECT_NAME : str = ' agv '
VERSION : str = ' 1.0.0 '
DESCRIPTION : str = ' '
BASE_DIR = os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) )
# 查看models/module.py的BelongTo类
RUN_AT_OS : int = 0
# log
YANEI_LOG = BASE_DIR + os . sep + ' logs ' # drcc日志目录
YANEI_LOG_LEVEL = logging . INFO
LOG_MAX_SIZE = 200 * 1024 * 1024 # 文件最大值, 超过该size则切割(b-字节)
LOG_MAX_TIME = 30 * 24 * 3600 # 切割日志文件最大保留时间(s-秒)
LOG_PRE_FIX = ' yanei '
# 调试模式
DEBUG_MODE : bool = True
DEBUG_DEV_MODE : bool = True # 如是否自动热加载服务等
# SQL 调试
SQL_DEBUG_MODE : bool = False
# 服务端口号
PORT : int = 8003
# 数据库连接地址(必填)
DB_URL : str
REDIS_URL : str = ' redis://localhost '
# 终端ID(必填)
TERMINAL_ID : str
# 时区
TIMEZONE : str = ' Asia/Shanghai '
# Jwt
JWT_SECRET_KEY : str
JWT_ALGORITHM : str = ' HS256 '
YANEI_CORS_ORIGINS : list = [ ' * ' ] # 默认的跨域请求, 但是在很多情况下不能直接写成*
# 账号注册初始密码
REGISTER_INIT_PASSWORD : str = ' 000000 '
AGVID = " 001 "
# set AGV tray capacity
# 设置AGV小车托盘库存
AGVCAP = {
1 : 6 , #标准品A(1)
3 : 2 , #标准品B(3)
5 : 0 , #标准品C(5)
7 : 0 , #标准品D(7)
9 : 20 #非标准品E(9) 假定一个托盘之多装20个非标品, 需要根据实际情况确定! ! !
}
# 最大搜索距离
# MAXSEARCHDEPTH = 3000
MAXSEARCHDEPTH = 100000000000
class Config :
env_file = ' .env '
setting = Setting ( )