Browse Source

为空判断

rambo 8 months ago
parent
commit
75d104ed12
1 changed files with 16 additions and 4 deletions
  1. 16 4
      python/settings.py

+ 16 - 4
python/settings.py

@@ -50,12 +50,18 @@ def get_dict_value(_dict, key, default=None):
     else:
         return default
 
-MACHINE_LEVEL = getSysConfigs("other_configs", "device_speed", "二档")
+MACHINE_LEVEL = (
+    "二档"
+    if getSysConfigs("other_configs", "device_speed", "二档") == ""
+    else getSysConfigs("other_configs", "device_speed", "二档")
+)
 IS_TEST = False
 IS_MCU = True
 IS_LIN_SHI_TEST = False
 PhotographSeconds = float(
-    getSysConfigs("take_photo_configs", "camera_delay", "0.5")
+    0.5
+    if getSysConfigs("take_photo_configs", "camera_delay", "0.5") == ""
+    else getSysConfigs("take_photo_configs", "camera_delay", "0.5")
 )  # 拍照停留时间
 
 
@@ -173,12 +179,18 @@ is_test_plugins = true_divide
 
 OUT_PIC_MODE = "."+getSysConfigs("basic_configs", "image_out_format", "png")  # ".png"
 
-OUT_PIC_SIZE = int(getSysConfigs("basic_configs", "main_image_size", "800"))  # 主图大小
+OUT_PIC_SIZE = int(
+    800
+    if getSysConfigs("basic_configs", "main_image_size", "800") == ""
+    else getSysConfigs("basic_configs", "main_image_size", "800")
+)  # 主图大小
 
 
 Mode = getSysConfigs("other_configs", "product_type", "鞋类")  # 程序执行类
 OUT_PIC_FACTOR = float(
-    getSysConfigs("basic_configs", "image_sharpening", "1")
+    1
+    if getSysConfigs("basic_configs", "image_sharpening", "1") == ""
+    else getSysConfigs("basic_configs", "image_sharpening", "1")
 )  # 图片锐化