|
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
import logging
|
|
|
|
|
from pydantic import BaseSettings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AGVPLC:
|
|
|
|
|
'''
|
|
|
|
|
AGV配置PLC
|
|
|
|
|
'''
|
|
|
|
|
HOST = '192.168.192.203'
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
#PLC命令执行超时
|
|
|
|
|
PLCTIMEOUT = 1000000
|
|
|
|
|
|
|
|
|
|
AGVID = "001"
|
|
|
|
|
|
|
|
|
|
#物料框编号偏差
|
|
|
|
|
#Big Disk
|
|
|
|
|
BIGDISKDIFF = 100
|
|
|
|
|
#Little Disk
|
|
|
|
|
LITDISKDIFF = 200
|
|
|
|
|
|
|
|
|
|
#LITTLE BOX
|
|
|
|
|
LITBOXDIFF = 300
|
|
|
|
|
#BIG BOX
|
|
|
|
|
BIGBOXDIFF = 400
|
|
|
|
|
|
|
|
|
|
#相机像素与真实世界的比率
|
|
|
|
|
# 54mm / 400 pixes
|
|
|
|
|
# CAMREALRATIO = 54.0 / 400.0 = 0.135
|
|
|
|
|
# CAMREALRATIO = CAMREALRATIO * 3 / 4
|
|
|
|
|
|
|
|
|
|
# # 60mm / 500 pixes
|
|
|
|
|
# CAMREALRATIO = 60.0 / 500.0 = 0.12
|
|
|
|
|
|
|
|
|
|
# 74mm / 512 pixes
|
|
|
|
|
DYCAMREALRATIO = 74 / 512.0
|
|
|
|
|
DXCAMREALRATIO = 88.0 / 612.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# set AGV tray capacity
|
|
|
|
|
# 设置AGV小车托盘库存
|
|
|
|
|
AGVCAP = {
|
|
|
|
|
1: 6, #标准品A(1) -> right
|
|
|
|
|
3: 2, #标准品B(3) -> left
|
|
|
|
|
5: 0, #标准品C(5)
|
|
|
|
|
7: 0, #标准品D(7)
|
|
|
|
|
9: 20 #非标准品E(9) 假定一个托盘之多装20个非标品,需要根据实际情况确定!!!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 最大搜索距离
|
|
|
|
|
# MAXSEARCHDEPTH = 3000
|
|
|
|
|
MAXSEARCHDEPTH = 100000000000
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
env_file = '.env'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setting = Setting()
|