From 1250257d4a98b1e54db24631d5fe4fa8f1bb3a75 Mon Sep 17 00:00:00 2001 From: kaizhi-singtown Date: Sun, 8 Mar 2026 10:04:13 +0800 Subject: [PATCH] docs: Add Chinese doc translation. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: kaizhi-singtown --- .gitignore | 3 + docs/conf.py | 168 +- .../LC_MESSAGES/differences/python_310.po | 581 ++ .../LC_MESSAGES/differences/python_35.po | 506 ++ .../LC_MESSAGES/differences/python_36.po | 523 ++ .../LC_MESSAGES/differences/python_37.po | 295 + .../LC_MESSAGES/differences/python_38.po | 327 ++ .../LC_MESSAGES/differences/python_39.po | 353 ++ .../zh_CN/LC_MESSAGES/genrst/builtin_types.po | 460 ++ .../zh_CN/LC_MESSAGES/genrst/core_language.po | 316 + docs/locale/zh_CN/LC_MESSAGES/genrst/index.po | 45 + .../zh_CN/LC_MESSAGES/genrst/modules.po | 263 + .../locale/zh_CN/LC_MESSAGES/genrst/syntax.po | 160 + docs/locale/zh_CN/LC_MESSAGES/index.po | 27 + .../zh_CN/LC_MESSAGES/library/_thread.po | 41 + .../locale/zh_CN/LC_MESSAGES/library/array.po | 183 + .../zh_CN/LC_MESSAGES/library/asyncio.po | 449 ++ .../zh_CN/LC_MESSAGES/library/binascii.po | 88 + .../zh_CN/LC_MESSAGES/library/bluetooth.po | 1075 ++++ .../zh_CN/LC_MESSAGES/library/builtins.po | 107 + .../locale/zh_CN/LC_MESSAGES/library/cmath.po | 93 + .../zh_CN/LC_MESSAGES/library/collections.po | 134 + .../zh_CN/LC_MESSAGES/library/cryptolib.po | 94 + .../zh_CN/LC_MESSAGES/library/deflate.po | 281 + .../locale/zh_CN/LC_MESSAGES/library/errno.po | 61 + docs/locale/zh_CN/LC_MESSAGES/library/gc.po | 105 + docs/locale/zh_CN/LC_MESSAGES/library/gzip.po | 164 + .../zh_CN/LC_MESSAGES/library/hashlib.po | 104 + .../locale/zh_CN/LC_MESSAGES/library/heapq.po | 70 + .../locale/zh_CN/LC_MESSAGES/library/index.po | 323 + docs/locale/zh_CN/LC_MESSAGES/library/io.po | 213 + docs/locale/zh_CN/LC_MESSAGES/library/json.po | 86 + .../zh_CN/LC_MESSAGES/library/machine.ADC.po | 117 + .../LC_MESSAGES/library/machine.ADCBlock.po | 113 + .../zh_CN/LC_MESSAGES/library/machine.CAN.po | 491 ++ .../zh_CN/LC_MESSAGES/library/machine.I2C.po | 323 + .../LC_MESSAGES/library/machine.I2CTarget.po | 241 + .../zh_CN/LC_MESSAGES/library/machine.I2S.po | 226 + .../zh_CN/LC_MESSAGES/library/machine.LED.po | 74 + .../zh_CN/LC_MESSAGES/library/machine.PWM.po | 209 + .../zh_CN/LC_MESSAGES/library/machine.Pin.po | 449 ++ .../zh_CN/LC_MESSAGES/library/machine.RTC.po | 181 + .../zh_CN/LC_MESSAGES/library/machine.SPI.po | 206 + .../LC_MESSAGES/library/machine.Signal.po | 196 + .../LC_MESSAGES/library/machine.Timer.po | 146 + .../zh_CN/LC_MESSAGES/library/machine.UART.po | 486 ++ .../zh_CN/LC_MESSAGES/library/machine.WDT.po | 74 + .../zh_CN/LC_MESSAGES/library/machine.po | 340 ++ .../zh_CN/LC_MESSAGES/library/marshal.po | 65 + docs/locale/zh_CN/LC_MESSAGES/library/math.po | 221 + .../zh_CN/LC_MESSAGES/library/micropython.po | 382 ++ .../locale/zh_CN/LC_MESSAGES/library/mutex.po | 137 + .../zh_CN/LC_MESSAGES/library/network.LAN.po | 161 + .../zh_CN/LC_MESSAGES/library/network.PPP.po | 149 + .../zh_CN/LC_MESSAGES/library/network.WINC.po | 362 ++ .../zh_CN/LC_MESSAGES/library/network.WLAN.po | 360 ++ .../zh_CN/LC_MESSAGES/library/network.po | 395 ++ .../zh_CN/LC_MESSAGES/library/omv.audio.po | 116 + .../zh_CN/LC_MESSAGES/library/omv.cpufreq.po | 63 + .../zh_CN/LC_MESSAGES/library/omv.csi.po | 1701 ++++++ .../library/omv.display.DACBacklight.po | 73 + .../library/omv.display.PWMBacklight.po | 77 + .../library/omv.display.SSD1351.po | 67 + .../LC_MESSAGES/library/omv.display.ST7701.po | 62 + .../library/omv.display.displaydata.po | 111 + .../library/omv.display.dsidisplay.po | 298 + .../zh_CN/LC_MESSAGES/library/omv.display.po | 120 + .../library/omv.display.rgbdisplay.po | 293 + .../library/omv.display.spidisplay.po | 340 ++ .../zh_CN/LC_MESSAGES/library/omv.fir.po | 596 ++ .../zh_CN/LC_MESSAGES/library/omv.ft5x06.po | 164 + .../zh_CN/LC_MESSAGES/library/omv.gif.po | 135 + .../zh_CN/LC_MESSAGES/library/omv.gt911.po | 72 + .../zh_CN/LC_MESSAGES/library/omv.image.po | 5201 +++++++++++++++++ .../zh_CN/LC_MESSAGES/library/omv.imu.po | 112 + .../zh_CN/LC_MESSAGES/library/omv.mjpeg.po | 277 + .../zh_CN/LC_MESSAGES/library/omv.ml.apps.po | 116 + .../zh_CN/LC_MESSAGES/library/omv.ml.po | 313 + .../library/omv.ml.postprocessing.darknet.po | 91 + .../omv.ml.postprocessing.edgeimpulse.po | 73 + .../omv.ml.postprocessing.mediapipe.po | 139 + .../library/omv.ml.postprocessing.po | 32 + .../omv.ml.postprocessing.ultralytics.po | 79 + .../library/omv.ml.preprocessing.po | 109 + .../zh_CN/LC_MESSAGES/library/omv.ml.utils.po | 202 + .../zh_CN/LC_MESSAGES/library/omv.omv.po | 69 + .../zh_CN/LC_MESSAGES/library/omv.pca9674a.po | 67 + .../zh_CN/LC_MESSAGES/library/omv.rpc.po | 617 ++ .../zh_CN/LC_MESSAGES/library/omv.rtsp.po | 188 + .../zh_CN/LC_MESSAGES/library/omv.sensor.po | 1919 ++++++ .../zh_CN/LC_MESSAGES/library/omv.tfp410.po | 72 + .../zh_CN/LC_MESSAGES/library/omv.tof.po | 371 ++ .../zh_CN/LC_MESSAGES/library/omv.tv.po | 266 + .../zh_CN/LC_MESSAGES/library/openamp.po | 197 + docs/locale/zh_CN/LC_MESSAGES/library/os.po | 294 + .../zh_CN/LC_MESSAGES/library/platform.po | 90 + .../zh_CN/LC_MESSAGES/library/pyb.ADC.po | 198 + .../zh_CN/LC_MESSAGES/library/pyb.CAN.po | 728 +++ .../zh_CN/LC_MESSAGES/library/pyb.DAC.po | 181 + .../zh_CN/LC_MESSAGES/library/pyb.ExtInt.po | 193 + .../zh_CN/LC_MESSAGES/library/pyb.Flash.po | 105 + .../zh_CN/LC_MESSAGES/library/pyb.I2C.po | 260 + .../zh_CN/LC_MESSAGES/library/pyb.LED.po | 85 + .../zh_CN/LC_MESSAGES/library/pyb.Pin.po | 411 ++ .../zh_CN/LC_MESSAGES/library/pyb.RTC.po | 141 + .../zh_CN/LC_MESSAGES/library/pyb.SPI.po | 232 + .../zh_CN/LC_MESSAGES/library/pyb.Servo.po | 139 + .../zh_CN/LC_MESSAGES/library/pyb.Timer.po | 503 ++ .../zh_CN/LC_MESSAGES/library/pyb.UART.po | 377 ++ .../zh_CN/LC_MESSAGES/library/pyb.USB_HID.po | 83 + .../zh_CN/LC_MESSAGES/library/pyb.USB_VCP.po | 227 + docs/locale/zh_CN/LC_MESSAGES/library/pyb.po | 436 ++ .../zh_CN/LC_MESSAGES/library/random.po | 135 + docs/locale/zh_CN/LC_MESSAGES/library/re.po | 396 ++ .../zh_CN/LC_MESSAGES/library/requests.po | 145 + .../zh_CN/LC_MESSAGES/library/select.po | 182 + .../zh_CN/LC_MESSAGES/library/socket.po | 498 ++ docs/locale/zh_CN/LC_MESSAGES/library/ssl.po | 334 ++ docs/locale/zh_CN/LC_MESSAGES/library/stm.po | 222 + .../zh_CN/LC_MESSAGES/library/struct.po | 328 ++ docs/locale/zh_CN/LC_MESSAGES/library/sys.po | 312 + docs/locale/zh_CN/LC_MESSAGES/library/time.po | 441 ++ .../zh_CN/LC_MESSAGES/library/uctypes.po | 439 ++ .../locale/zh_CN/LC_MESSAGES/library/uping.po | 43 + docs/locale/zh_CN/LC_MESSAGES/library/vfs.po | 367 ++ docs/locale/zh_CN/LC_MESSAGES/library/zlib.po | 188 + docs/locale/zh_CN/LC_MESSAGES/license.po | 65 + .../zh_CN/LC_MESSAGES/openmvcam/general.po | 149 + .../zh_CN/LC_MESSAGES/openmvcam/quickref.po | 591 ++ .../openmvcam/tutorial/analog_io.po | 59 + .../openmvcam/tutorial/gpio_control.po | 103 + .../openmvcam/tutorial/hardware_setup.po | 415 ++ .../LC_MESSAGES/openmvcam/tutorial/index.po | 33 + .../openmvcam/tutorial/io_tutorial.po | 123 + .../openmvcam/tutorial/led_control.po | 92 + .../openmvcam/tutorial/more_information.po | 49 + .../openmvcam/tutorial/openmvide_overview.po | 740 +++ .../openmvcam/tutorial/overview.po | 115 + .../openmvcam/tutorial/production.po | 194 + .../openmvcam/tutorial/script_structure.po | 80 + .../openmvcam/tutorial/software_setup.po | 170 + .../openmvcam/tutorial/system_architecture.po | 176 + .../openmvcam/tutorial/uart_control.po | 95 + .../LC_MESSAGES/reference/asm_thumb2_arith.po | 132 + .../reference/asm_thumb2_compare.po | 181 + .../reference/asm_thumb2_directives.po | 91 + .../LC_MESSAGES/reference/asm_thumb2_float.po | 193 + .../reference/asm_thumb2_hints_tips.po | 254 + .../LC_MESSAGES/reference/asm_thumb2_index.po | 152 + .../reference/asm_thumb2_label_branch.po | 250 + .../LC_MESSAGES/reference/asm_thumb2_ldr.po | 77 + .../reference/asm_thumb2_logical_bit.po | 149 + .../LC_MESSAGES/reference/asm_thumb2_misc.po | 63 + .../LC_MESSAGES/reference/asm_thumb2_mov.po | 82 + .../LC_MESSAGES/reference/asm_thumb2_stack.po | 64 + .../LC_MESSAGES/reference/asm_thumb2_str.po | 75 + .../LC_MESSAGES/reference/constrained.po | 763 +++ .../zh_CN/LC_MESSAGES/reference/filesystem.po | 389 ++ .../zh_CN/LC_MESSAGES/reference/glossary.po | 498 ++ .../zh_CN/LC_MESSAGES/reference/index.po | 56 + .../zh_CN/LC_MESSAGES/reference/isr_rules.po | 675 +++ .../zh_CN/LC_MESSAGES/reference/manifest.po | 423 ++ .../reference/micropython2_migration.po | 142 + .../zh_CN/LC_MESSAGES/reference/mpremote.po | 1059 ++++ .../zh_CN/LC_MESSAGES/reference/mpyfiles.po | 515 ++ .../zh_CN/LC_MESSAGES/reference/packages.po | 267 + .../zh_CN/LC_MESSAGES/reference/pyboard.py.po | 197 + .../zh_CN/LC_MESSAGES/reference/repl.po | 371 ++ .../zh_CN/LC_MESSAGES/reference/reset_boot.po | 402 ++ .../LC_MESSAGES/reference/speed_python.po | 653 +++ docs/locale/zh_CN/LC_MESSAGES/sphinx.po | 35 + 171 files changed, 48691 insertions(+), 79 deletions(-) create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_310.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_35.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_36.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_37.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_38.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/differences/python_39.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/genrst/builtin_types.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/genrst/core_language.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/genrst/index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/genrst/modules.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/genrst/syntax.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/_thread.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/array.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/asyncio.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/binascii.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/bluetooth.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/builtins.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/cmath.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/collections.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/cryptolib.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/deflate.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/errno.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/gc.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/gzip.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/hashlib.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/heapq.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/io.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/json.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.ADC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.ADCBlock.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.CAN.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.I2C.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.I2CTarget.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.I2S.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.LED.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.PWM.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.Pin.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.RTC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.SPI.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.Signal.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.Timer.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.UART.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.WDT.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/machine.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/marshal.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/math.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/micropython.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/mutex.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/network.LAN.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/network.PPP.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/network.WINC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/network.WLAN.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/network.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.audio.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.cpufreq.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.csi.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.DACBacklight.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.PWMBacklight.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.SSD1351.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.ST7701.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.displaydata.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.dsidisplay.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.rgbdisplay.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.display.spidisplay.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.fir.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ft5x06.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.gif.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.gt911.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.image.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.imu.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.mjpeg.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.apps.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.darknet.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.edgeimpulse.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.mediapipe.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.ultralytics.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.preprocessing.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.utils.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.omv.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.pca9674a.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.rpc.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.rtsp.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.sensor.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.tfp410.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.tof.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/omv.tv.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/openamp.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/os.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/platform.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.ADC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.CAN.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.DAC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.ExtInt.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.Flash.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.I2C.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.LED.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.Pin.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.RTC.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.SPI.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.Servo.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.Timer.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.UART.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_HID.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_VCP.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/pyb.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/random.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/re.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/requests.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/select.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/socket.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/ssl.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/stm.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/struct.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/sys.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/time.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/uctypes.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/uping.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/vfs.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/library/zlib.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/license.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/general.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/quickref.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/analog_io.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/gpio_control.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/hardware_setup.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/io_tutorial.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/led_control.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/more_information.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/openmvide_overview.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/overview.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/production.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/script_structure.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/software_setup.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/system_architecture.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/openmvcam/tutorial/uart_control.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_arith.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_compare.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_directives.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_float.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_hints_tips.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_label_branch.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_ldr.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_logical_bit.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_misc.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_mov.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_stack.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/asm_thumb2_str.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/constrained.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/filesystem.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/glossary.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/index.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/isr_rules.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/manifest.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/micropython2_migration.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/mpremote.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/mpyfiles.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/packages.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/pyboard.py.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/repl.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/reset_boot.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/reference/speed_python.po create mode 100644 docs/locale/zh_CN/LC_MESSAGES/sphinx.po diff --git a/.gitignore b/.gitignore index 224cdb47f33f4..f5426d07fcbf1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ tests/ports/unix/ffi_lib.so # Python cache files __pycache__/ +# Compiled translation files +docs/**/*.mo + # Customized Makefile/project overrides GNUmakefile user.props diff --git a/docs/conf.py b/docs/conf.py index f7ac06d3fd04e..282f121a555aa 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -79,12 +79,16 @@ # # We don't follow "The short X.Y version" vs "The full version, including alpha/beta/rc tags" # breakdown, so use the same version identifier for both to avoid confusion. -version = release = '1.26' +version = release = "1.26" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None +# -- Options for i18n output ---------------------------------------------- +locale_dirs = ["locale"] +gettext_compact = False + # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' @@ -93,81 +97,88 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['build', '.venv', "esp32", "esp8266", "pyboard", "wipy", - "develop/cmodules.rst", - "develop/compiler.rst", - "develop/extendingmicropython.rst", - "develop/gettingstarted.rst", - "develop/index.rst", - "develop/library.rst", - "develop/maps.rst", - "develop/memorymgt.rst", - "develop/natmod.rst", - "develop/optimizations.rst", - "develop/porting.rst", - "develop/publiccapi.rst", - "develop/qstr.rst", - "develop/writingtests.rst", - "library/btree.rst", - "library/esp.rst", - "library/espnow.rst", - "library/esp32.rst", - "library/framebuf.rst", - "library/rp2.rst", - "library/rp2.DMA.rst", - "library/rp2.Flash.rst", - "library/rp2.PIO.rst", - "library/rp2.StateMachine.rst", - "library/wm8960.rst", - "library/zephyr.rst", - "library/zephyr.DiskAccess.rst", - "library/zephyr.FlashArea.rst", - "library/zephyr.zsensor.rst", - "library/lcd160cr.rst", - "library/machine.ADCWiPy.rst", - "library/machine.Counter.rst", - "library/machine.Encoder.rst", - "library/machine.SD.rst", - "library/machine.SDCard.rst", - "library/machine.TimerWiPy.rst", - "library/machine.USBDevice.rst", - "library/network.CC3K.rst", - "library/network.WIZNET5K.rst", - "library/network.WLANWiPy.rst", - "library/neopixel.rst", - "library/pyb.Accel.rst", - "library/pyb.LCD.rst", - "library/pyb.Switch.rst", - "library/wipy.rst", - "mimxrt/general.rst", - "mimxrt/pinout.rst", - "mimxrt/tutorial/intro.rst", - "mimxrt/quickref.rst", - "renesas-ra/general.rst", - "renesas-ra/quickref.rst", - "renesas-ra/tutorial/index.rst", - "renesas-ra/tutorial/intro.rst", - "renesas-ra/tutorial/program_in_flash.rst", - "renesas-ra/tutorial/reset.rst", - "renesas-ra/tutorial/troubleshooting.rst", - "renesas-ra/tutorial/using_peripheral.rst", - "rp2/general.rst", - "rp2/quickref.rst", - "rp2/tutorial/intro.rst", - "rp2/tutorial/pio.rst", - "rp2/tutorial/reset.rst", - "samd/general.rst", - "samd/quickref.rst", - "samd/pinout.rst", - "samd/tutorial/intro.rst", - "unix/quickref.rst", - "zephyr/general.rst", - "zephyr/quickref.rst", - "zephyr/tutorial/index.rst", - "zephyr/tutorial/intro.rst", - "zephyr/tutorial/pins.rst", - "zephyr/tutorial/repl.rst", - "zephyr/tutorial/storage.rst"] +exclude_patterns = [ + "build", + ".venv", + "esp32", + "esp8266", + "pyboard", + "wipy", + "develop/cmodules.rst", + "develop/compiler.rst", + "develop/extendingmicropython.rst", + "develop/gettingstarted.rst", + "develop/index.rst", + "develop/library.rst", + "develop/maps.rst", + "develop/memorymgt.rst", + "develop/natmod.rst", + "develop/optimizations.rst", + "develop/porting.rst", + "develop/publiccapi.rst", + "develop/qstr.rst", + "develop/writingtests.rst", + "library/btree.rst", + "library/esp.rst", + "library/espnow.rst", + "library/esp32.rst", + "library/framebuf.rst", + "library/rp2.rst", + "library/rp2.DMA.rst", + "library/rp2.Flash.rst", + "library/rp2.PIO.rst", + "library/rp2.StateMachine.rst", + "library/wm8960.rst", + "library/zephyr.rst", + "library/zephyr.DiskAccess.rst", + "library/zephyr.FlashArea.rst", + "library/zephyr.zsensor.rst", + "library/lcd160cr.rst", + "library/machine.ADCWiPy.rst", + "library/machine.Counter.rst", + "library/machine.Encoder.rst", + "library/machine.SD.rst", + "library/machine.SDCard.rst", + "library/machine.TimerWiPy.rst", + "library/machine.USBDevice.rst", + "library/network.CC3K.rst", + "library/network.WIZNET5K.rst", + "library/network.WLANWiPy.rst", + "library/neopixel.rst", + "library/pyb.Accel.rst", + "library/pyb.LCD.rst", + "library/pyb.Switch.rst", + "library/wipy.rst", + "mimxrt/general.rst", + "mimxrt/pinout.rst", + "mimxrt/tutorial/intro.rst", + "mimxrt/quickref.rst", + "renesas-ra/general.rst", + "renesas-ra/quickref.rst", + "renesas-ra/tutorial/index.rst", + "renesas-ra/tutorial/intro.rst", + "renesas-ra/tutorial/program_in_flash.rst", + "renesas-ra/tutorial/reset.rst", + "renesas-ra/tutorial/troubleshooting.rst", + "renesas-ra/tutorial/using_peripheral.rst", + "rp2/general.rst", + "rp2/quickref.rst", + "rp2/tutorial/intro.rst", + "rp2/tutorial/pio.rst", + "rp2/tutorial/reset.rst", + "samd/general.rst", + "samd/quickref.rst", + "samd/pinout.rst", + "samd/tutorial/intro.rst", + "unix/quickref.rst", + "zephyr/general.rst", + "zephyr/quickref.rst", + "zephyr/tutorial/index.rst", + "zephyr/tutorial/intro.rst", + "zephyr/tutorial/pins.rst", + "zephyr/tutorial/repl.rst", + "zephyr/tutorial/storage.rst", +] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -210,7 +221,6 @@ import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] except: html_theme = "default" html_theme_path = ["."] @@ -234,12 +244,12 @@ # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = '../../openmv-media/logos/openmv-logo-white/web-logo-sticky.png' +html_logo = "../../openmv-media/logos/openmv-logo-white/web-logo-sticky.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -html_favicon = '../../openmv-media/icons/openmv-icon/openmv.ico' +html_favicon = "../../openmv-media/icons/openmv-icon/openmv.ico" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_310.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_310.po new file mode 100644 index 0000000000000..090329764aecd --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_310.po @@ -0,0 +1,581 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-06 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../differences/python_310.rst:4 +msgid "Python 3.10" +msgstr "Python 3.10" + +#: ../../differences/python_310.rst:6 +msgid "" +"Python 3.10.0 (final) was released on the 4 October 2021. The Features " +"for 3.10 are defined in `PEP 619 " +"`_ and a " +"detailed description of the changes can be found in `What's New in Python" +" 3.10 `_." +msgstr "" +"Python 3.10.0(最终版本)于2021年10月4日发布。3.10的特性在 `PEP 619 " +"`_ 中定义," +"有关更改的详细描述可以在 `What's New in Python 3.10 `_ 中找到。" + +#: ../../differences/python_310.rst:15 +msgid "**New syntax features**" +msgstr "**新的语法特性**" + +#: ../../differences/python_310.rst:15 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_310.rst:17 +msgid "`PEP 634 `_" +msgstr "`PEP 634 `_" + +#: ../../differences/python_310.rst:17 +msgid "Structural Pattern Matching: Specification" +msgstr "结构模式匹配:规范" + +#: ../../differences/python_310.rst:17 ../../differences/python_310.rst:19 +#: ../../differences/python_310.rst:22 +msgid "[#spm]_" +msgstr "[#spm]_" + +#: ../../differences/python_310.rst:19 +msgid "`PEP 635 `_" +msgstr "`PEP 635 `_" + +#: ../../differences/python_310.rst:19 +msgid "Structural Pattern Matching: Motivation and Rationale" +msgstr "结构模式匹配:动机和基本原理" + +#: ../../differences/python_310.rst:22 +msgid "`PEP 636 `_" +msgstr "`PEP 636 `_" + +#: ../../differences/python_310.rst:22 +msgid "Structural Pattern Matching: Tutorial" +msgstr "结构模式匹配:教程" + +#: ../../differences/python_310.rst:24 +msgid "`bpo-12782 `_" +msgstr "`bpo-12782 `_" + +#: ../../differences/python_310.rst:24 +msgid "Parenthesized context managers are now officially allowed" +msgstr "现在正式允许使用括号括起来的上下文管理器" + +#: ../../differences/python_310.rst:27 +msgid "**New features in the standard library**" +msgstr "**标准库中的新功能**" + +#: ../../differences/python_310.rst:29 +msgid "`PEP 618 `_" +msgstr "`PEP 618 `_" + +#: ../../differences/python_310.rst:29 +msgid "Add Optional Length-Checking To zip" +msgstr "添加可选的长度检查到zip" + +#: ../../differences/python_310.rst:31 +msgid "**Interpreter improvements**" +msgstr "**解释器改进**" + +#: ../../differences/python_310.rst:33 +msgid "`PEP 626 `_" +msgstr "`PEP 626 `_" + +#: ../../differences/python_310.rst:33 +msgid "Precise line numbers for debugging and other tools" +msgstr "用于调试和其他工具的精确行号" + +#: ../../differences/python_310.rst:35 +msgid "**New typing features**" +msgstr "**新的打字功能**" + +#: ../../differences/python_310.rst:37 +msgid "`PEP 604 `_" +msgstr "`PEP 604 `_" + +#: ../../differences/python_310.rst:37 +msgid "Allow writing union types as X | Y" +msgstr "允许写联合类型为X | Y" + +#: ../../differences/python_310.rst:39 +msgid "`PEP 613 `_" +msgstr "`PEP 613 `_" + +#: ../../differences/python_310.rst:39 +msgid "Explicit Type Aliases" +msgstr "显式类型别名" + +#: ../../differences/python_310.rst:41 +msgid "`PEP 612 `_" +msgstr "`PEP 612 `_" + +#: ../../differences/python_310.rst:41 +msgid "Parameter Specification Variables" +msgstr "参数规格变量" + +#: ../../differences/python_310.rst:43 +msgid "**Important deprecations, removals or restrictions**" +msgstr "**重要的弃用、删除或限制**" + +#: ../../differences/python_310.rst:45 +msgid "`PEP 644 `_" +msgstr "`PEP 644 `_" + +#: ../../differences/python_310.rst:45 +msgid "Require OpenSSL 1.1.1 or newer" +msgstr "需要OpenSSL 1.1.1或更新版本" + +#: ../../differences/python_310.rst:47 +msgid "`PEP 632 `_" +msgstr "`PEP 632 `_" + +#: ../../differences/python_310.rst:47 +msgid "Deprecate distutils module." +msgstr "弃用distutils模块。" + +#: ../../differences/python_310.rst:47 ../../differences/python_310.rst:49 +#: ../../differences/python_310.rst:52 +msgid "Not relevant" +msgstr "不相关的" + +#: ../../differences/python_310.rst:49 +msgid "`PEP 623 `_" +msgstr "`PEP 623 `_" + +#: ../../differences/python_310.rst:49 +msgid "" +"Deprecate and prepare for the removal of the wstr member in " +"PyUnicodeObject." +msgstr "弃用并准备删除PyUnicodeObject中的wstr成员。" + +#: ../../differences/python_310.rst:52 +msgid "`PEP 624 `_" +msgstr "`PEP 624 `_" + +#: ../../differences/python_310.rst:52 +msgid "Remove Py_UNICODE encoder APIs" +msgstr "移除Py_UNICODE编码器API" + +#: ../../differences/python_310.rst:54 +msgid "`PEP 597 `_" +msgstr "`PEP 597 `_" + +#: ../../differences/python_310.rst:54 +msgid "Add optional EncodingWarning" +msgstr "添加可选的编码警告" + +#: ../../differences/python_310.rst:58 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_310.rst:64 +msgid "" +"The :class:`int` type has a new method :meth:`int.bit_count`, returning " +"the number of ones in the binary expansion of a given integer, also known" +" as the population count." +msgstr ":class:`int` 类型有一个新方法 :meth:`int." +"bit_count` ,返回给定整数的二进制展开形式中的1个数,也称为总体计数。" + +#: ../../differences/python_310.rst:68 +msgid "" +"The views returned by :meth:`dict.keys`, :meth:`dict.values` and " +":meth:`dict.items` now all have a ``mapping`` attribute that gives a " +":class:`types.MappingProxyType` object wrapping the original dictionary." +msgstr "" +"由 :meth:`dict.keys` 、 :meth:`dict.values` 和 :meth:`dict.items` " +"返回的视图现在都有一个 ``mapping`` " +"属性,该属性提供一个包装原始字典的 :class:`types.MappingProxyType` 对象。" + +#: ../../differences/python_310.rst:73 +msgid "" +":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag," +" used to require that all the iterables have an equal length." +msgstr ":pep:`618`: 现在, :func:`zip` 函数具有一个可选的 ``strict`` " +"标志,用于要求所有可迭代对象具有相等的长度。" + +#: ../../differences/python_310.rst:76 +msgid "" +"Builtin and extension functions that take integer arguments no longer " +"accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s " +"and other objects that can be converted to integers only with a loss " +"(e.g. that have the :meth:`~object.__int__` method but do not have the " +":meth:`~object.__index__` method)." +msgstr "" +"采用整数参数的内置函数和扩展函数不再接受 :class:`~decimal.Decimal`\\ " +"s、 :class:`~fractions.Fraction`\\ s " +"以及其他只能带有损失地转换为整数的对象(例如,具有 :meth:`~object.__int__` " +"方法但没有 :meth:`~object.__index__` 方法的对象)。" + +#: ../../differences/python_310.rst:82 +msgid "" +"If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " +"will correctly fall back to :func:`object.__pow__` and " +":func:`object.__rpow__` as expected." +msgstr "" +"如果 :func:`object.__ipow__` 返回 :const:`NotImplemented` ,操作符将正确回退到 " +":func:`object.__pow__` 和 :func:`object.__rpow__` 如预期的那样。" + +#: ../../differences/python_310.rst:85 +msgid "" +"Assignment expressions can now be used unparenthesized within set " +"literals and set comprehensions, as well as in sequence indexes (but not " +"slices)." +msgstr "赋值表达式现在可以在集合字面量和集合推导式中,以及在序列索引(但不是切片)中" +"无括号使用。" + +#: ../../differences/python_310.rst:88 +msgid "" +"Functions have a new ``__builtins__`` attribute which is used to look for" +" builtin symbols when a function is executed, instead of looking into " +"``__globals__['__builtins__']``. The attribute is initialized from " +"``__globals__[\"__builtins__\"]`` if it exists, else from the current " +"builtins." +msgstr "" +"函数有一个新的 ``__builtins__`` 属性,用于在函数执行时查找内置符号," +"而不是查找 ``__globals__['__builtins__']``。该属性从 ``__globals__[" +"\"__builtins__\"]`` 初始化,如果存在,否则从当前的builtins初始化。" + +#: ../../differences/python_310.rst:93 +msgid "" +"Two new builtin functions -- :func:`aiter` and :func:`anext` have been " +"added to provide asynchronous counterparts to :func:`iter` and " +":func:`next`, respectively." +msgstr "" +"增加了两个新的内置函数 -- :func:`aiter` 和 :func:`anext` ,分别为 :func:`iter` " +"和 :func:`next` 提供异步对应。" + +#: ../../differences/python_310.rst:97 +msgid "" +"Static methods (:func:`@staticmethod `) and class methods " +"(:func:`@classmethod `) now inherit the method attributes " +"(``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, " +"``__annotations__``) and have a new ``__wrapped__`` attribute. Moreover, " +"static methods are now callable as regular functions." +msgstr "" +"静态方法(:func:`@staticmethod `)和类方法(:func:`@classmethod " +"`)现在继承方法属性(``__module__``、``__name__``、 " +"``__qualname__``、``__doc__``、``__annotations__``),并有一个新的 " +"``__wrapped__`` 属性。此外,静态方法现在可以像普通函数一样调用。" + +#: ../../differences/python_310.rst:103 +msgid "" +"Annotations for complex targets (everything beside ``simple name`` " +"targets defined by :pep:`526`) no longer cause any runtime effects with " +"``from __future__ import annotations``." +msgstr "" +"复杂目标的注释(除了由 :pep:`526` 定义的 ``simple name`` 目标之外的所有内容)" +"不再导致 ``from __future__ import annotations`` 的运行时影响。" + +#: ../../differences/python_310.rst:106 +msgid "" +"Class and module objects now lazy-create empty annotations dicts on " +"demand. The annotations dicts are stored in the object’s ``__dict__`` for" +" backwards compatibility. This improves the best practices for working " +"with ``__annotations__``." +msgstr "" +"类和模块对象现在可以根据需要惰性创建空注释字典。为了向后兼容," +"注释字典存储在对象的 ``__dict__`` 中。这改进了使用 ``__annotations__`` " +"的最佳实践。" + +#: ../../differences/python_310.rst:111 +msgid "" +"Annotations consist of ``yield``, ``yield from``, ``await`` or named " +"expressions are now forbidden under ``from __future__ import " +"annotations`` due to their side effects." +msgstr "" +"由 ``yield``、 ``yield from``、 ``await`` 或命名表达式组成的注释现在被禁止在 " +"``from __future__ import annotations`` 下,因为它们的副作用。" + +#: ../../differences/python_310.rst:115 +msgid "" +"Usage of unbound variables, ``super()`` and other expressions that might " +"alter the processing of symbol table as annotations are now rendered " +"effectless under ``from __future__ import annotations``." +msgstr "" +"未绑定变量、``super()`` 和其他表达式的使用可能会改变符号表的处理," +"因为注释现在在 ``from __future__ import annotations`` 下变为无效。" + +#: ../../differences/python_310.rst:119 +msgid "" +"Hashes of NaN values of both :class:`float` type and " +":class:`decimal.Decimal` type now depend on object identity. Formerly, " +"they always hashed to ``0`` even though NaN values are not equal to one " +"another. This caused potentially quadratic runtime behavior due to " +"excessive hash collisions when creating dictionaries and sets containing " +"multiple NaNs." +msgstr "" +":class:`float` 类型和 :class:`decimal.Decimal` " +"类型的NaN值的哈希值现在取决于对象标识。以前,它们总是散列到 ``0`` ,即使NaN值" +"彼此不相等。这导致在创建包含多个nan的字典和集合时,由于哈希冲突过多,这可能导" +"致二次运行时行为。" + +#: ../../differences/python_310.rst:125 +msgid "" +"A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " +"deleting the :const:`__debug__` constant." +msgstr "" +"删除 :const:`__debug__` 常量时,将引发一个 :exc:`SyntaxError` (而不是 " +":exc:`NameError`)。" + +#: ../../differences/python_310.rst:128 +msgid "" +":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " +"attributes. They will be ``None`` if not determined." +msgstr "" +":exc:`SyntaxError` 异常现在具有 ``end_lineno`` 和 ``end_offset`` " +"属性。如果不确定,它们将是 ``None`` 。" + +#: ../../differences/python_310.rst:132 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_310.rst:138 +msgid "`asyncio `_" +msgstr "`asyncio `_" + +#: ../../differences/python_310.rst:140 +msgid "" +"Add missing " +":meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket` method." +msgstr "" +"添加了缺失的 :meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket`" +" 方法。" + +#: ../../differences/python_310.rst:143 +msgid "`array `_" +msgstr "`array `_" + +#: ../../differences/python_310.rst:145 +msgid "" +"The :meth:`~array.array.index` method of :class:`array.array` now has " +"optional *start* and *stop* parameters." +msgstr "" +":class:`array.array` 的 :meth:`~array.array.index` 方法现在具有可选的 *start* 和 " +"*stop* 参数。" + +#: ../../differences/python_310.rst:148 +msgid "`gc `_" +msgstr "`gc `_" + +#: ../../differences/python_310.rst:150 +msgid "" +"Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and " +":func:`gc.get_referents`." +msgstr "" +"为以下项添加审核挂钩 :func:`gc.get_objects`、 :func:`gc.get_referrers` " +"和 :func:`gc.get_referents`。" + +#: ../../differences/python_310.rst:153 +msgid "`hashlib `_" +msgstr "`hashlib `_" + +#: ../../differences/python_310.rst:155 +msgid "The hashlib module requires OpenSSL 1.1.1 or newer." +msgstr "hashlib模块需要OpenSSL 1.1.1或更新版本。" + +#: ../../differences/python_310.rst:157 +msgid "The hashlib module has preliminary support for OpenSSL 3.0.0." +msgstr "hashlib模块对OpenSSL 3.0.0有初步支持。" + +#: ../../differences/python_310.rst:159 +msgid "" +"The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. " +"In the future PBKDF2-HMAC will only be available when Python has been " +"built with OpenSSL support." +msgstr "" +"不赞成使用纯Python回退 :func:`~hashlib.pbkdf2_hmac` " +"。在未来,PBKDF2-HMAC将仅在Python已构建并支持OpenSSL时可用。" + +#: ../../differences/python_310.rst:163 +msgid "`os `_" +msgstr "`os `_" + +#: ../../differences/python_310.rst:165 +msgid "Add :func:`os.cpu_count()` support for VxWorks RTOS." +msgstr "添加 :func:`os.cpu_count()` 对 VxWorks RTOS的支持。" + +#: ../../differences/python_310.rst:167 +msgid "" +"Add a new function :func:`os.eventfd` and related helpers to wrap the " +"``eventfd2`` syscall on Linux." +msgstr "添加一个新函数 :func:`os.eventfd` 和相关的助手来包装Linux上的 ``eventfd2`` " +"系统调用。" + +#: ../../differences/python_310.rst:170 +msgid "" +"Add :func:`os.splice()` that allows to move data between two file " +"descriptors without copying between kernel address space and user address" +" space, where one of the file descriptors must refer to a pipe." +msgstr "" +"添加 :func:`os.splice()` ,它允许在两个文件描述符之间移动数据,而无需在内核地" +"址空间和用户地址空间之间复制,其中一个文件描述符必须引用管道。" + +#: ../../differences/python_310.rst:175 +msgid "" +"Add :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`, :data:`~os.O_SYMLINK` and" +" :data:`~os.O_NOFOLLOW_ANY` for macOS." +msgstr "" +"为 macOS 添加了 :data:`~os.O_EVTONLY`、 :data:`~os.O_FSYNC`、 :data:`~os." +"O_SYMLINK` 和 :data:`~os.O_NOFOLLOW_ANY` 。" + +#: ../../differences/python_310.rst:178 +msgid "`platform `_" +msgstr "`platform `_" + +#: ../../differences/python_310.rst:180 +msgid "" +"Add :func:`platform.freedesktop_os_release()` to retrieve operation " +"system identification from `freedesktop.org os-release " +"`_ " +"standard file." +msgstr "" +"增加 :func:`platform.freedesktop_os_release()` 从 `freedesktop.org os-" +"release `_ " +"标准文件中检索操作系统标识。" + +#: ../../differences/python_310.rst:184 +msgid "`socket `_" +msgstr "`socket `_" + +#: ../../differences/python_310.rst:186 +msgid "" +"The exception :exc:`socket.timeout` is now an alias of " +":exc:`TimeoutError`." +msgstr "异常 :exc:`socket.timeout` 现在是 :exc:`TimeoutError` 的别名。" + +#: ../../differences/python_310.rst:188 +msgid "Add option to create MPTCP sockets with ``IPPROTO_MPTCP``." +msgstr "添加选项以使用 ``IPPROTO_MPTCP`` 创建MPTCP套接字。" + +#: ../../differences/python_310.rst:190 +msgid "" +"Add ``IP_RECVTOS`` option to receive the type of service (ToS) or " +"DSCP/ECN fields." +msgstr "添加 ``IP_RECVTOS`` 选项来接收服务类型(ToS)或DSCP/ECN字段。" + +#: ../../differences/python_310.rst:192 +msgid "`ssl `_" +msgstr "`ssl `_" + +#: ../../differences/python_310.rst:194 +msgid "The ssl module requires OpenSSL 1.1.1 or newer." +msgstr "ssl模块需要OpenSSL 1.1.1或更新版本。" + +#: ../../differences/python_310.rst:196 +msgid "" +"The ssl module has preliminary support for OpenSSL 3.0.0 and new option " +":data:`~ssl.OP_IGNORE_UNEXPECTED_EOF`." +msgstr "ssl模块已初步支持 OpenSSL 3.0.0 和新选项 :data:`~ssl." +"OP_IGNORE_UNEXPECTED_EOF`。" + +#: ../../differences/python_310.rst:199 +msgid "" +"Deprecated function and use of deprecated constants now result in a " +":exc:`DeprecationWarning`. :attr:`ssl.SSLContext.options` has " +":data:`~ssl.OP_NO_SSLv2` and :data:`~ssl.OP_NO_SSLv3` set by default and " +"therefore cannot warn about setting the flag again." +msgstr "" +"弃用的函数和使用弃用的常量现在会导致 :exc:`DeprecationWarning`。 :attr:`ssl." +"SSLContext.options` 默认设置了 :data:`~ssl.OP_NO_SSLv2` 和 :data:`~ssl." +"OP_NO_SSLv3`,因此无法再对重复设置这些标志发出警告 。" + +#: ../../differences/python_310.rst:204 +msgid "" +"The ssl module now has more secure default settings. Ciphers without " +"forward secrecy or SHA-1 MAC are disabled by default. Security level 2 " +"prohibits weak RSA, DH, and ECC keys with less than 112 bits of security." +" :class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2. " +"Settings are based on Hynek Schlawack's research." +msgstr "" +"ssl 模块现在具有更安全的默认设置。默认情况下禁用了不具备前向保密性或使用 SHA-" +"1 MAC 的密码套件。安全级别 2 禁止使用安全性低于 112 位的弱 RSA、DH 和 ECC " +"密钥。:class:`~ssl.SSLContext` 默认使用 TLS 1.2 作为最低协议版本。" +"这些设置基于 Hynek Schlawack 的研究。" + +#: ../../differences/python_310.rst:210 +msgid "" +"The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer " +"officially supported. Python does not block them actively. However " +"OpenSSL build options, distro configurations, vendor patches, and cipher " +"suites may prevent a successful handshake." +msgstr "" +"不再正式支持已弃用的协议SSL 3.0、TLS 1.0和TLS 1.1。Python不会主动阻止它们。然" +"而,OpenSSL构建选项、发行版配置、供应商补丁和密码套件可能会阻止成功的握手。" + +#: ../../differences/python_310.rst:215 +msgid "" +"Add a *timeout* parameter to the :func:`ssl.get_server_certificate` " +"function." +msgstr "在 :func:`ssl.get_server_certificate` 中添加一个 *timeout* 参数。" + +#: ../../differences/python_310.rst:217 +msgid "The ssl module uses heap-types and multi-phase initialization." +msgstr "ssl模块使用堆类型和多阶段初始化。" + +#: ../../differences/python_310.rst:219 +msgid "A new verify flag :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added." +msgstr "新增了一个新的验证标志 :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` 。" + +#: ../../differences/python_310.rst:221 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_310.rst:223 +msgid "" +"Add :data:`sys.orig_argv` attribute: the list of the original command " +"line arguments passed to the Python executable." +msgstr "添加 :data:`sys.orig_argv` " +"属性:传递给Python可执行文件的原始命令行参数的列表。" + +#: ../../differences/python_310.rst:226 +msgid "" +"Add :data:`sys.stdlib_module_names`, containing the list of the standard " +"library module names." +msgstr "添加 :data:`sys.stdlib_module_names`,其中包含标准库模块名称的列表。" + +#: ../../differences/python_310.rst:229 +msgid "`_thread `_" +msgstr "`_thread `_" + +#: ../../differences/python_310.rst:231 +msgid "" +":func:`_thread.interrupt_main` now takes an optional signal number to " +"simulate (the default is still :data:`signal.SIGINT`)." +msgstr "" +":func:`_thread.interrupt_main` 现在接受一个可选的信号号来模拟(默认值仍然是 " +":data:`signal.SIGINT`)。" + +#: ../../differences/python_310.rst:236 +msgid "Notes" +msgstr "笔记" + +#: ../../differences/python_310.rst:237 +msgid "" +"The structural pattern matching feature is discussed in `issue #7847 " +"`_." +msgstr "" +"结构模式匹配特征在 `issue #7847 `_ 中进行了讨论." diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_35.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_35.po new file mode 100644 index 0000000000000..68a98ba0b674c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_35.po @@ -0,0 +1,506 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-04 04:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../differences/python_35.rst:4 +msgid "Python 3.5" +msgstr "Python 3.5" + +#: ../../differences/python_35.rst:6 +msgid "" +"Below is a list of finalised/accepted PEPs for Python 3.5 grouped into " +"their impact to MicroPython." +msgstr "以下是Python 3.5的最终/接受的PEP列表,根据它们对MicroPython的影响进行分组。" + +#: ../../differences/python_35.rst:12 +msgid "**Extensions to the syntax**" +msgstr "**语法的扩展**" + +#: ../../differences/python_35.rst:12 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_35.rst:14 +msgid "`PEP 448 `_" +msgstr "`PEP 448 `_" + +#: ../../differences/python_35.rst:14 +msgid "Additional unpacking generalizations" +msgstr "额外的解包概括" + +#: ../../differences/python_35.rst:14 +msgid "Partial" +msgstr "部分" + +#: ../../differences/python_35.rst:16 +msgid "`PEP 465 `_" +msgstr "`PEP 465 `_" + +#: ../../differences/python_35.rst:16 +msgid "A new matrix multiplication operator" +msgstr "一种新的矩阵乘法算子" + +#: ../../differences/python_35.rst:16 ../../differences/python_35.rst:18 +#: ../../differences/python_35.rst:22 ../../differences/python_35.rst:24 +#: ../../differences/python_35.rst:26 ../../differences/python_35.rst:32 +#: ../../differences/python_35.rst:108 ../../differences/python_35.rst:151 +msgid "Complete" +msgstr "完成" + +#: ../../differences/python_35.rst:18 +msgid "`PEP 492 `_" +msgstr "`PEP 492 `_" + +#: ../../differences/python_35.rst:18 +msgid "Coroutines with ``async`` and ``await`` syntax" +msgstr "带有 ``async`` 和 ``await`` 语法的子程序" + +#: ../../differences/python_35.rst:20 +msgid "**Extensions and changes to runtime**" +msgstr "**运行时的扩展和更改**" + +#: ../../differences/python_35.rst:22 +msgid "`PEP 461 `_" +msgstr "`PEP 461 `_" + +#: ../../differences/python_35.rst:22 +#, python-format +msgid "% formatting for binary strings" +msgstr "%格式化二进制字符串" + +#: ../../differences/python_35.rst:24 +msgid "`PEP 475 `_" +msgstr "`PEP 475 `_" + +#: ../../differences/python_35.rst:24 +msgid "Retrying system calls that fail with ``EINTR``" +msgstr "重试因 ``EINTR`` 失败的系统调用" + +#: ../../differences/python_35.rst:26 +msgid "`PEP 479 `_" +msgstr "`PEP 479 `_" + +#: ../../differences/python_35.rst:26 +msgid "Change ``StopIteration`` handling inside generators" +msgstr "更改生成器内部的 ``StopIteration`` 处理" + +#: ../../differences/python_35.rst:28 +msgid "**Standard library changes**" +msgstr "**标准库更改**" + +#: ../../differences/python_35.rst:30 +msgid "`PEP 471 `_" +msgstr "`PEP 471 `_" + +#: ../../differences/python_35.rst:30 +msgid "``os.scandir()``" +msgstr "``os.scandir()``" + +#: ../../differences/python_35.rst:32 +msgid "`PEP 485 `_" +msgstr "`PEP 485 `_" + +#: ../../differences/python_35.rst:32 +msgid "``math.isclose()``, a function for testing approximate equality" +msgstr "``math.isclose()``,一个用于测试近似相等的函数" + +#: ../../differences/python_35.rst:35 +msgid "**Miscellaneous changes**" +msgstr "**其他变更**" + +#: ../../differences/python_35.rst:37 +msgid "`PEP 441 `_" +msgstr "`PEP 441 `_" + +#: ../../differences/python_35.rst:37 +msgid "Improved Python zip application support" +msgstr "改进的Python zip应用程序支持" + +#: ../../differences/python_35.rst:39 +msgid "`PEP 486 `_" +msgstr "`PEP 486 `_" + +#: ../../differences/python_35.rst:39 +msgid "Make the Python Launcher aware of virtual environments" +msgstr "使Python启动器了解虚拟环境" + +#: ../../differences/python_35.rst:39 ../../differences/python_35.rst:44 +msgid "Not relevant" +msgstr "不相关的" + +#: ../../differences/python_35.rst:42 +msgid "`PEP 484 `_" +msgstr "`PEP 484 `_" + +#: ../../differences/python_35.rst:42 +msgid "Type hints (advisory only)" +msgstr "类型提示(仅供参考)" + +#: ../../differences/python_35.rst:42 +msgid "Complete [#fth]_" +msgstr "完成 [#fth]_" + +#: ../../differences/python_35.rst:44 +msgid "`PEP 488 `_" +msgstr "`PEP 488 `_" + +#: ../../differences/python_35.rst:44 +msgid "Elimination of PYO files" +msgstr "消除PYO文件" + +#: ../../differences/python_35.rst:46 +msgid "`PEP 489 `_" +msgstr "`PEP 489 `_" + +#: ../../differences/python_35.rst:46 +msgid "Redesigning extension module loading" +msgstr "重新设计扩展模块加载" + +#: ../../differences/python_35.rst:49 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_35.rst:55 +msgid "" +"Added the *namereplace* error handlers. The *backslashreplace* error " +"handlers now work with decoding and translating." +msgstr "" +"增加了*nameeplace *错误处理程序。*backslashreplace* 错误处理程序现在可以解码和翻译。" + +#: ../../differences/python_35.rst:58 +msgid "" +"Property docstrings are now writable. This is especially useful for " +"collections.namedtuple() docstrings" +msgstr "属性文档字符串现在是可写的。这对于collections.namedtuple()文档字符串特别有用" + +#: ../../differences/python_35.rst:60 +msgid "Circular imports involving relative imports are now supported." +msgstr "现在支持涉及相对导入的循环导入。" + +#: ../../differences/python_35.rst:64 +msgid "New Modules:" +msgstr "新模块:" + +#: ../../differences/python_35.rst:66 +msgid "`typing `_" +msgstr "`typing `_" + +#: ../../differences/python_35.rst:68 +msgid "`zipzap `_" +msgstr "`zipzap `_" + +#: ../../differences/python_35.rst:71 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_35.rst:77 +msgid "`collections `_" +msgstr "" +"`collections `_" + +#: ../../differences/python_35.rst:79 +msgid "" +"The *OrderedDict* class is now implemented in C, which makes it 4 to 100 " +"times faster." +msgstr "*OrderedDict* 类现在是用C实现的,这使得它的速度提高了4到100倍。" + +#: ../../differences/python_35.rst:81 +msgid "" +"*OrderedDict.items()* , *OrderedDict.keys()* , *OrderedDict.values()* " +"views now support reversed() iteration." +msgstr "" +"*OrderedDict.items()*、*OrderedDict.keys()*、 *OrderedDict.values()* " +"视图现在支持reversed() 迭代。" + +#: ../../differences/python_35.rst:84 +msgid "" +"The deque class now defines *index()*, *insert()*, and *copy()*, and " +"supports the + and * operators." +msgstr "deque类现在定义了 *index()*、*insert()* 和 *copy()*,并支持+和* 操作符。" + +#: ../../differences/python_35.rst:86 +msgid "Docstrings produced by namedtuple() can now be updated." +msgstr "namedtuple()生成的文档字符串现在可以更新了。" + +#: ../../differences/python_35.rst:88 +msgid "" +"The UserString class now implements the *__getnewargs__()*, *__rmod__()*," +" *casefold()*, *format_map()*, *isprintable()*, and *maketrans()* methods" +" to match the corresponding methods of str." +msgstr "" +"UserString 类现在实现了 *__getnewargs__()*、*__rmod__()*、*casefold()*、*format_map(" +")*、*isprintable()* 、*maketrans()* 方法来匹配 str 的相应方法。" + +#: ../../differences/python_35.rst:91 +msgid "`heapq `_" +msgstr "`heapq `_" + +#: ../../differences/python_35.rst:93 +msgid "" +"Element comparison in *merge()* can now be customized by passing a key " +"function in a new optional key keyword argument, and a new optional " +"*reverse* keyword argument can be used to reverse element comparison" +msgstr "" +"*merge()* 中的元素比较现在可以通过在一个新的可选key关键字参数中传递一个key函数来定制,并且一个新的可选 *reverse* " +"关键字参数可以用来反转元素比较" + +#: ../../differences/python_35.rst:96 +msgid "`io `_" +msgstr "`io `_" + +#: ../../differences/python_35.rst:98 +msgid "" +"A new *BufferedIOBase.readinto1()* method, that uses at most one call to " +"the underlying raw stream's *RawIOBase.read()* or *RawIOBase.readinto()* " +"methods" +msgstr "" +"一个新的 *BufferedIOBase.readinto1()* 方法,该方法最多使用一次调用底层原始流的 *RawIOBase.read()* " +"或 *RawIOBase.readinto()* 方法" + +#: ../../differences/python_35.rst:101 +msgid "`json `_" +msgstr "`json `_" + +#: ../../differences/python_35.rst:103 +msgid "" +"JSON decoder now raises JSONDecodeError instead of ValueError to provide " +"better context information about the error." +msgstr "JSON解码器现在引发JSONDecodeError而不是ValueError,以提供有关错误的更好的上下" +"文信息。" + +#: ../../differences/python_35.rst:106 +msgid "`math `_" +msgstr "`math `_" + +#: ../../differences/python_35.rst:108 +msgid "Two new constants have been added to the math module: *inf* and *nan*." +msgstr "数学模块中增加了两个新的常量:*inf* 和 *nan*。" + +#: ../../differences/python_35.rst:110 +msgid "" +"A new function *isclose()* provides a way to test for approximate " +"equality." +msgstr "一个新的函数 *isclose()* 提供了一种测试近似相等的方法。" + +#: ../../differences/python_35.rst:112 +msgid "" +"A new *gcd()* function has been added. The *fractions.gcd()* function is " +"now deprecated." +msgstr "增加了一个新的 *gcd()* 函数。*fractions.gcd()* 函数现已弃用。" + +#: ../../differences/python_35.rst:114 +msgid "`os `_" +msgstr "`os `_" + +#: ../../differences/python_35.rst:116 +msgid "" +"The new *scandir()* function returning an iterator of DirEntry objects " +"has been added." +msgstr "添加了新的 *scandir()* 函数,返回DirEntry对象的迭代器。" + +#: ../../differences/python_35.rst:118 +msgid "" +"The *urandom()* function now uses the *getrandom()* syscall on Linux 3.17" +" or newer, and *getentropy()* on OpenBSD 5.6 and newer, removing the need" +" to use /dev/urandom and avoiding failures due to potential file " +"descriptor exhaustion." +msgstr "" +"*urandom()* 函数现在在Linux 3.17或更新版本上使用 *getrandom()* 系统调用,在OpenBSD " +"5.6及更新版本上使用 *getentropy()* ,从而消除了使用/dev/urandom的需要,并避免了由于潜在的文件描述符耗尽而导致的失败。" + +#: ../../differences/python_35.rst:122 +msgid "" +"New *get_blocking()* and *set_blocking()* functions allow getting and " +"setting a file descriptor's blocking mode (O_NONBLOCK.)" +msgstr "" +"新的 *get_blocking()* 和 *set_blocking()* 函数允许获取和设置文件描述符的阻塞模式(O_NONBLOCK。)" + +#: ../../differences/python_35.rst:125 +msgid "" +"There is a new *os.path.commonpath()* function returning the longest " +"common sub-path of each passed pathname" +msgstr "有一个新的 *os.path.commonpath()* 函数返回每个传递的pathname的最长公共子路径" + +#: ../../differences/python_35.rst:128 +msgid "`re `_" +msgstr "`re `_" + +#: ../../differences/python_35.rst:130 +msgid "" +"References and conditional references to groups with fixed length are now" +" allowed in lookbehind assertions" +msgstr "在向后看断言中,现在允许对固定长度的组的引用和条件引用" + +#: ../../differences/python_35.rst:132 +msgid "" +"The number of capturing groups in regular expressions is no longer " +"limited to 100." +msgstr "正则表达式中捕获组的数量不再局限于100个。" + +#: ../../differences/python_35.rst:134 +msgid "" +"The *sub()* and *subn()* functions now replace unmatched groups with " +"empty strings instead of raising an exception." +msgstr "*sub()* 和 *subn()* 函数现在用空字符串替换不匹配的组,而不是引发异常。" + +#: ../../differences/python_35.rst:137 +msgid "" +"The *re.error* exceptions have new attributes, msg, pattern, pos, lineno," +" and colno, that provide better context information about the error" +msgstr "*re.error* 异常有新的属性msg、pattern、pos、lineno和colno,它们提供了关于错误" +"的更好的上下文信息" + +#: ../../differences/python_35.rst:140 +msgid "`socket `_" +msgstr "`socket `_" + +#: ../../differences/python_35.rst:142 +msgid "" +"Functions with timeouts now use a monotonic clock, instead of a system " +"clock." +msgstr "带有超时的函数现在使用单调时钟,而不是系统时钟。" + +#: ../../differences/python_35.rst:144 +msgid "" +"A new *socket.sendfile()* method allows sending a file over a socket by " +"using the high-performance *os.sendfile()* function on UNIX, resulting in" +" uploads being from 2 to 3 times faster than when using plain " +"*socket.send()*" +msgstr "" +"新的 *socket.sendfile()* 方法允许在UNIX上使用高性能的 *os.sendfile()* " +"函数通过套接字发送文件,导致上传速度比使用普通的 *socket.send()* 快2到3倍" + +#: ../../differences/python_35.rst:148 +msgid "" +"The *socket.sendall()* method no longer resets the socket timeout every " +"time bytes are received or sent. The socket timeout is now the maximum " +"total duration to send all data." +msgstr "" +"*socket.sendall()* 方法不再在每次接收或发送字节时重置套接字超时。套接字超时现在是发送所有数据的最大总持续时间。" + +#: ../../differences/python_35.rst:151 +msgid "" +"The backlog argument of the *socket.listen()* method is now optional. By " +"default it is set to SOMAXCONN or to 128, whichever is less." +msgstr "" +"*socket.listen()* 方法的backlog参数现在是可选的。默认情况下,它被设置为SOMAXCONN或128,以较小者为准。" + +#: ../../differences/python_35.rst:154 +msgid "`ssl `_" +msgstr "`ssl `_" + +#: ../../differences/python_35.rst:156 +msgid "Memory BIO Support" +msgstr "内存BIO支持" + +#: ../../differences/python_35.rst:158 +msgid "Application-Layer Protocol Negotiation Support" +msgstr "支持应用层协议协商" + +#: ../../differences/python_35.rst:160 +msgid "" +"There is a new *SSLSocket.version()* method to query the actual protocol " +"version in use." +msgstr "有一个新的 *SSLSocket.version()* 方法来查询正在使用的实际协议版本。" + +#: ../../differences/python_35.rst:162 +msgid "The SSLSocket class now implements a *SSLSocket.sendfile()* method." +msgstr "SSLSocket类现在实现了一个 *SSLSocket.sendfile()* 方法。" + +#: ../../differences/python_35.rst:164 +msgid "" +"The *SSLSocket.send()* method now raises either the " +"*ssl.SSLWantReadError* or *ssl.SSLWantWriteError* exception on a non-" +"blocking socket if the operation would block. Previously, it would return" +" 0." +msgstr "" +"在非阻塞套接字上,如果操作会阻塞,*SSLSocket.send()* 方法现在会引发 *ssl." +"SSLWantReadError* 或 *ssl.SSLWantWriteError* 异常。此前,它会返回 0。" + +#: ../../differences/python_35.rst:167 +msgid "" +"The *cert_time_to_seconds()* function now interprets the input time as " +"UTC and not as local time, per RFC 5280. Additionally, the return value " +"is always an int." +msgstr "" +"根据RFC 5280, *cert_time_to_seconds()* 函数现在将输入时间解释为UTC而不是本地时间。另外,返回值总是int型的。" + +#: ../../differences/python_35.rst:170 +msgid "" +"New *SSLObject.shared_ciphers()* and *SSLSocket.shared_ciphers()* methods" +" return the list of ciphers sent by the client during the handshake." +msgstr "" +"新的 *SSLObject.shared_ciphers()* 和 *SSLSocket.shared_ciphers()* " +"方法返回握手期间客户端发送的密码列表。" + +#: ../../differences/python_35.rst:173 +msgid "" +"The *SSLSocket.do_handshake()*, *SSLSocket.read()*, " +"*SSLSocket.shutdown()*, and *SSLSocket.write()* methods of the SSLSocket " +"class no longer reset the socket timeout every time bytes are received or" +" sent." +msgstr "" +"SSLSocket类的 *SSLSocket.do_handshake()*、*SSLSocket.read()*、*SSLSocket.shutd" +"own()* 和 *SSLSocket.write()* 方法不再在每次接收或发送字节时重置套接字超时。" + +#: ../../differences/python_35.rst:176 +msgid "The *match_hostname()* function now supports matching of IP addresses." +msgstr "*match_hostname()* 函数现在支持IP地址匹配。" + +#: ../../differences/python_35.rst:178 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_35.rst:180 +msgid "" +"A new *set_coroutine_wrapper()* function allows setting a global hook " +"that will be called whenever a coroutine object is created by an async " +"def function. A corresponding *get_coroutine_wrapper()* can be used to " +"obtain a currently set wrapper." +msgstr "" +"新的 *set_coroutine_wrapper()* 函数允许设置一个全局钩子,该钩子将在async def函数创建协程对象时被调用。对应的 " +"*get_coroutine_wrapper()* 可用于获取当前设置的包装器。" + +#: ../../differences/python_35.rst:184 +msgid "" +"A new *is_finalizing()* function can be used to check if the Python " +"interpreter is shutting down." +msgstr "一个新的 *is_finalizing()* 函数可以用来检查Python解释器是否正在关闭。" + +#: ../../differences/python_35.rst:186 +msgid "`time `_" +msgstr "`time `_" + +#: ../../differences/python_35.rst:188 +msgid "The *monotonic()* function is now always available" +msgstr "*monotonic()* 函数现在总是可用的" + +#: ../../differences/python_35.rst:192 +msgid "Notes" +msgstr "笔记" + +#: ../../differences/python_35.rst:193 +msgid "" +"The MicroPython parser correct ignores all type hints. However, the " +"``typing`` module is not built-in." +msgstr "MicroPython解析器会忽略所有类型提示。然而,``typing`` 模块不是内置的。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_36.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_36.po new file mode 100644 index 0000000000000..344cb7999dd5e --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_36.po @@ -0,0 +1,523 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-07-06 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../differences/python_36.rst:4 +msgid "Python 3.6" +msgstr "Python 3.6" + +#: ../../differences/python_36.rst:6 +msgid "" +"Python 3.6 beta 1 was released on 12 Sep 2016, and a summary of the new " +"features can be found here:" +msgstr "Python 3.6 beta 1于2016年9月12日发布,新特性的摘要可以在这里找到:" + +#: ../../differences/python_36.rst:12 +msgid "**New Syntax Features**" +msgstr "**新的语法特性**" + +#: ../../differences/python_36.rst:12 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_36.rst:14 +msgid "`PEP 498 `_" +msgstr "`PEP 498 `_" + +#: ../../differences/python_36.rst:14 +msgid "Literal String Formatting" +msgstr "字面值字符串格式" + +#: ../../differences/python_36.rst:14 ../../differences/python_36.rst:16 +#: ../../differences/python_36.rst:20 ../../differences/python_36.rst:91 +#: ../../differences/python_36.rst:134 +msgid "Complete" +msgstr "完成" + +#: ../../differences/python_36.rst:16 +msgid "`PEP 515 `_" +msgstr "`PEP 515 `_" + +#: ../../differences/python_36.rst:16 +msgid "Underscores in Numeric Literals" +msgstr "数字字面值中的下划线" + +#: ../../differences/python_36.rst:18 +msgid "`PEP 525 `_" +msgstr "`PEP 525 `_" + +#: ../../differences/python_36.rst:18 +msgid "Asynchronous Generators" +msgstr "异步生成器" + +#: ../../differences/python_36.rst:20 +msgid "`PEP 526 `_" +msgstr "`PEP 526 `_" + +#: ../../differences/python_36.rst:20 +msgid "Syntax for Variable Annotations (provisional)" +msgstr "变量注释的语法(暂定)" + +#: ../../differences/python_36.rst:22 +msgid "`PEP 530 `_" +msgstr "`PEP 530 `_" + +#: ../../differences/python_36.rst:22 +msgid "Asynchronous Comprehensions" +msgstr "异步的理解" + +#: ../../differences/python_36.rst:24 +msgid "**New Built-in Features**" +msgstr "**新的内置功能**" + +#: ../../differences/python_36.rst:26 +msgid "`PEP 468 `_" +msgstr "`PEP 468 `_" + +#: ../../differences/python_36.rst:26 +msgid "Preserving the order of *kwargs* in a function" +msgstr "保持函数中 *kwargs* 的顺序" + +#: ../../differences/python_36.rst:28 +msgid "`PEP 487 `_" +msgstr "`PEP 487 `_" + +#: ../../differences/python_36.rst:28 +msgid "Simpler customization of class creation" +msgstr "更简单的自定义类创建" + +#: ../../differences/python_36.rst:28 +msgid "Partial [#setname]_" +msgstr "部分 [#setname]_" + +#: ../../differences/python_36.rst:31 +msgid "`PEP 520 `_" +msgstr "`PEP 520 `_" + +#: ../../differences/python_36.rst:31 +msgid "Preserving Class Attribute Definition Order" +msgstr "保留类属性定义顺序" + +#: ../../differences/python_36.rst:33 +msgid "**Standard Library Changes**" +msgstr "**标准库更改**" + +#: ../../differences/python_36.rst:35 +msgid "`PEP 495 `_" +msgstr "`PEP 495 `_" + +#: ../../differences/python_36.rst:35 +msgid "Local Time Disambiguation" +msgstr "本地时间消除歧义" + +#: ../../differences/python_36.rst:37 +msgid "`PEP 506 `_" +msgstr "`PEP 506 `_" + +#: ../../differences/python_36.rst:37 +msgid "Adding A Secrets Module To The Standard Library" +msgstr "向标准库中添加Secrets模块" + +#: ../../differences/python_36.rst:39 +msgid "`PEP 519 `_" +msgstr "`PEP 519 `_" + +#: ../../differences/python_36.rst:39 +msgid "Adding a file system path protocol" +msgstr "添加文件系统路径协议" + +#: ../../differences/python_36.rst:41 +msgid "**CPython Internals**" +msgstr "**CPython 内部机制**" + +#: ../../differences/python_36.rst:43 +msgid "`PEP 509 `_" +msgstr "`PEP 509 `_" + +#: ../../differences/python_36.rst:43 +msgid "Add a private version to dict" +msgstr "向dict添加私有版本" + +#: ../../differences/python_36.rst:43 +msgid "Won't do" +msgstr "不会做" + +#: ../../differences/python_36.rst:45 +msgid "`PEP 523 `_" +msgstr "`PEP 523 `_" + +#: ../../differences/python_36.rst:45 +msgid "Adding a frame evaluation API to CPython" +msgstr "向CPython添加框架评估API" + +#: ../../differences/python_36.rst:47 +msgid "**Linux/Window Changes**" +msgstr "**Linux/Windows更改**" + +#: ../../differences/python_36.rst:49 +msgid "`PEP 524 `_" +msgstr "`PEP 524 `_" + +#: ../../differences/python_36.rst:49 +msgid "Make ``os.urandom()`` blocking on Linux (during system startup)" +msgstr "使 ``os.urandom()`` 在Linux上阻塞(在系统启动期间)" + +#: ../../differences/python_36.rst:52 +msgid "`PEP 528 `_" +msgstr "`PEP 528 `_" + +#: ../../differences/python_36.rst:52 +msgid "Change Windows console encoding to UTF-8" +msgstr "将Windows控制台编码更改为UTF-8" + +#: ../../differences/python_36.rst:54 +msgid "`PEP 529 `_" +msgstr "`PEP 529 `_" + +#: ../../differences/python_36.rst:54 +msgid "Change Windows filesystem encoding to UTF-8" +msgstr "将Windows文件系统编码更改为UTF-8" + +#: ../../differences/python_36.rst:57 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_36.rst:63 +msgid "" +"A *global* or *nonlocal* statement must now textually appear before the " +"first use of the affected name in the same scope. Previously this was a " +"SyntaxWarning." +msgstr "*全局* 或 *非局部* 语句现在必须在文本上出现在同一作用域中受影响的名称的第一次使用之前。以前这是一个SyntaxWarning。" + +#: ../../differences/python_36.rst:66 +msgid "" +"It is now possible to set a special method to None to indicate that the " +"corresponding operation is not available. For example, if a class sets " +"*__iter__()* to *None* , the class is not iterable." +msgstr "" +"现在可以将一个特殊的方法设置为None,以表示相应的操作不可用。例如,如果一个类将 *__iter__()* 设置为 *None* " +",则该类不可迭代。" + +#: ../../differences/python_36.rst:69 +#, python-brace-format +msgid "" +"Long sequences of repeated traceback lines are now abbreviated as " +"*[Previous line repeated {count} more times]*" +msgstr "长序列的重复回溯行现在缩写为 *[前一行重复{count}多次]*" + +#: ../../differences/python_36.rst:72 +msgid "" +"Import now raises the new exception *ModuleNotFoundError* when it cannot " +"find a module. Code that currently checks for ImportError (in try-except)" +" will still work." +msgstr "" +"Import现在在找不到模块时引发新的异常 *ModuleNotFoundError*。当前检查 ImportError " +"(在try-except中)的代码仍然可以工作。" + +#: ../../differences/python_36.rst:75 +msgid "" +"Class methods relying on zero-argument *super()* will now work correctly " +"when called from metaclass methods during class creation." +msgstr "依赖于零参数的类方法 *super()* 将在创建类期间从元类方法调用时正确工作。" + +#: ../../differences/python_36.rst:79 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_36.rst:85 +msgid "`array `_" +msgstr "`array `_" + +#: ../../differences/python_36.rst:87 +msgid "" +"Exhausted iterators of *array.array* will now stay exhausted even if the " +"iterated array is extended." +msgstr "已耗尽的 *array.array* 现在将保持耗尽状态,即使迭代数组被扩展。" + +#: ../../differences/python_36.rst:89 +msgid "`binascii `_" +msgstr "`binascii `_" + +#: ../../differences/python_36.rst:91 +msgid "" +"The b2a_base64() function now accepts an optional newline keyword " +"argument to control whether the newline character is appended to the " +"return value" +msgstr "b2a_base64()函数现在接受一个可选的换行关键字参数来控制是否将换行字符附加到返回值" + +#: ../../differences/python_36.rst:94 +msgid "`cmath `_" +msgstr "`cmath `_" + +#: ../../differences/python_36.rst:96 +msgid "The new cmath.tau (τ) constant has been added" +msgstr "添加了新的cmath.tau (τ) 常数" + +#: ../../differences/python_36.rst:98 +msgid "" +"New constants: *cmath.inf* and *cmath.nan* to match *math.inf* and " +"*math.nan* , and also *cmath.infj* and *cmath.nanj* to match the format " +"used by complex repr" +msgstr "新常量:*cmath.inf* 和 *cmath.nan* 用于匹配 *math.inf* 和 *math.nan*,还有 *cmath.infj* 和 *cmath.nanj* 用于匹配复数repr使用的格式" + +#: ../../differences/python_36.rst:101 +msgid "`collections `_" +msgstr "`collections `_" + +#: ../../differences/python_36.rst:103 +msgid "" +"The new Collection abstract base class has been added to represent sized " +"iterable container classes" +msgstr "添加了新的Collection抽象基类来表示大小可迭代的容器类" + +#: ../../differences/python_36.rst:105 +msgid "" +"The new *Reversible* abstract base class represents iterable classes that" +" also provide the *__reversed__()* method." +msgstr "新的 *Reversible* 抽象基类代表了可迭代的类,这些类也提供了 *__reversed__()* 方法。" + +#: ../../differences/python_36.rst:108 +msgid "" +"The new *AsyncGenerator* abstract base class represents asynchronous " +"generators." +msgstr "新的 *AsyncGenerator* 抽象基类表示异步生成器。" + +#: ../../differences/python_36.rst:110 +msgid "" +"The *namedtuple()* function now accepts an optional keyword argument " +"module, which, when specified, is used for the *__module__* attribute of " +"the returned named tuple class." +msgstr "*namedtuple()* 函数现在接受一个可选的关键字参数module,该参数在指定时用于返回的命名元组类的 *__module__* 属性。" + +#: ../../differences/python_36.rst:113 +msgid "The verbose and rename arguments for *namedtuple()* are now keyword-only." +msgstr "*namedtuple()* 的verbose和rename参数现在仅限关键字。" + +#: ../../differences/python_36.rst:115 +msgid "Recursive *collections.deque* instances can now be pickled." +msgstr "递归的 *collections.deque* 实例现在可以被pickle。" + +#: ../../differences/python_36.rst:117 +msgid "`hashlib `_" +msgstr "`hashlib `_" + +#: ../../differences/python_36.rst:119 +msgid "" +"BLAKE2 hash functions were added to the module. *blake2b()* and " +"*blake2s()* are always available and support the full feature set of " +"BLAKE2." +msgstr "模块中增加BLAKE2哈希函数。*blake2b()* 和 *blake2s()* 始终可用,并支持BLAKE2的完整功能集。" + +#: ../../differences/python_36.rst:122 +msgid "" +"The SHA-3 hash functions *sha3_224()*, *sha3_256()*, *sha3_384()*, " +"*sha3_512()*, and *SHAKE* hash functions *shake_128()* and *shake_256()* " +"were added." +msgstr "新增SHA-3哈希函数 *sha3_224()*、*sha3_256()*、*sha3_384()*、*sha3_512()*,以及 *SHAKE* 哈希函数 *shake_128()*、*shake_256()*。" + +#: ../../differences/python_36.rst:125 +msgid "" +"The password-based key derivation function *scrypt()* is now available " +"with OpenSSL 1.1.0 and newer." +msgstr "基于密码的密钥派生函数 *scrypt()* 现在可以在OpenSSL 1.1.0及更新版本中使用。" + +#: ../../differences/python_36.rst:127 +msgid "`json `_" +msgstr "`json `_" + +#: ../../differences/python_36.rst:129 +msgid "" +"*json.load()* and *json.loads()* now support binary input. Encoded JSON " +"should be represented using either UTF-8, UTF-16, or UTF-32." +msgstr "*json.load()* 和 *json.loads()* 现在支持二进制输入。编码后的JSON应该使用UTF-8、UTF-16或UTF-32来表示。" + +#: ../../differences/python_36.rst:132 +msgid "`math `_" +msgstr "`math `_" + +#: ../../differences/python_36.rst:134 +msgid "The new math.tau (τ) constant has been added" +msgstr "添加了新的math.tau (τ)常数" + +#: ../../differences/python_36.rst:136 +msgid "`os `_" +msgstr "`os `_" + +#: ../../differences/python_36.rst:138 +msgid "" +"A new *close()* method allows explicitly closing a *scandir()* iterator. " +"The *scandir()* iterator now supports the context manager protocol." +msgstr "一个新的 *close()* 方法允许显式关闭 *scandir()* 迭代器。*scandir()* 迭代器现在支持上下文管理器协议。" + +#: ../../differences/python_36.rst:141 +msgid "" +"On Linux, *os.urandom()* now blocks until the system urandom entropy pool" +" is initialized to increase the security." +msgstr "在Linux上,*os.urandom()* 现在阻塞,直到系统随机熵池初始化以增加安全性。" + +#: ../../differences/python_36.rst:144 +msgid "" +"The Linux *getrandom()* syscall (get random bytes) is now exposed as the " +"new *os.getrandom()* function." +msgstr "Linux *getrandom()* sycall(获取随机字节)现在公开为新的 *os.getrandom()* 函数。" + +#: ../../differences/python_36.rst:146 +msgid "`re `_" +msgstr "`re `_" + +#: ../../differences/python_36.rst:148 +msgid "" +"Added support of modifier spans in regular expressions. Examples: " +"*'(?i:p)ython'* matches 'python' and 'Python', but not 'PYTHON'; " +"*'(?i)g(?-i:v)r'* matches *'GvR'* and *'gvr'*, but not *'GVR'*." +msgstr "" +"添加了对正则表达式中修饰符跨度的支持。例如:*'(?i:p)ython'* 匹配'python'和 " +"'Python',但不匹配'PYTHON';*'(?i)g(?-i:v)r'* 匹配 *'GvR'* 和 *'gvr'*,但不匹配 " +"*'GVR'*。" + +#: ../../differences/python_36.rst:151 +msgid "" +"Match object groups can be accessed by *__getitem__*, which is equivalent" +" to *group()*. So *mo['name']* is now equivalent to *mo.group('name')*." +msgstr "" +"匹配对象组可以由 *__getitem__* 访问,相当于 *group()*。所以 *mo['name']* 现在等价于 " +"*mo.group('name')*。" + +#: ../../differences/python_36.rst:154 +msgid "Match objects now support index-like objects as group indices." +msgstr "Match对象现在支持将类似索引的对象作为组索引。" + +#: ../../differences/python_36.rst:156 +msgid "`socket `_" +msgstr "`socket `_" + +#: ../../differences/python_36.rst:158 +msgid "" +"The *ioctl()* function now supports the *SIO_LOOPBACK_FAST_PATH* control " +"code." +msgstr "*ioctl()* 函数现在支持 *SIO_LOOPBACK_FAST_PATH* 控制代码。" + +#: ../../differences/python_36.rst:160 +msgid "" +"The *getsockopt()* constants *SO_DOMAIN* , *SO_PROTOCOL*, *SO_PEERSEC* , " +"and *SO_PASSSEC* are now supported." +msgstr "现在支持 *getsockopt()* 常量 *SO_DOMAIN* ,*SO_PROTOCOL*, *SO_PEERSEC* 和 *SO_PASSSEC*。" + +#: ../../differences/python_36.rst:162 +msgid "" +"The *setsockopt()* now supports the *setsockopt(level, optname, None, " +"optlen: int)* form." +msgstr "*setsockopt()* 现在支持 *setsockopt(level, optname, None, optlen: int)* 形式。" + +#: ../../differences/python_36.rst:164 +msgid "" +"The socket module now supports the address family *AF_ALG* to interface " +"with Linux Kernel crypto API. *ALG_*, *SOL_ALG* and *sendmsg_afalg()* " +"were added." +msgstr "套接字模块现在支持地址系列 *AF_ALG* 与Linux内核加密API接口。添加了 *ALG_*、*SOL_ALG* 和 *sendmsg_afalg()*。" + +#: ../../differences/python_36.rst:167 +msgid "New Linux constants *TCP_USER_TIMEOUT* and *TCP_CONGESTION* were added." +msgstr "新增Linux常量 *TCP_USER_TIMEOUT* 和 *TCP_CONGESTION*。" + +#: ../../differences/python_36.rst:169 +msgid "`ssl `_" +msgstr "`ssl `_" + +#: ../../differences/python_36.rst:171 +msgid "ssl supports OpenSSL 1.1.0. The minimum recommend version is 1.0.2." +msgstr "ssl支持OpenSSL 1.1.0。最低推荐版本为1.0.2。" + +#: ../../differences/python_36.rst:173 +msgid "" +"3DES has been removed from the default cipher suites and ChaCha20 " +"Poly1305 cipher suites have been added." +msgstr "3DES已从默认密码套件中删除,并添加了ChaCha20 Poly1305密码套件。" + +#: ../../differences/python_36.rst:175 +msgid "*SSLContext* has better default configuration for options and ciphers." +msgstr "*SSLContext* 对选项和密码有更好的默认配置。" + +#: ../../differences/python_36.rst:177 +msgid "" +"SSL session can be copied from one client-side connection to another with" +" the new *SSLSession* class. TLS session resumption can speed up the " +"initial handshake, reduce latency and improve performance." +msgstr "使用新的 *SSLSession* 类可以将SSL会话从一个客户端连接复制到另一个客户端连接。TLS会话恢复可以加快初始握手速度,减少延迟,提高性能。" + +#: ../../differences/python_36.rst:180 +msgid "" +"The new *get_ciphers()* method can be used to get a list of enabled " +"ciphers in order of cipher priority." +msgstr "新的 *get_ciphers()* 方法可用于按密码优先级顺序获取已启用密码的列表。" + +#: ../../differences/python_36.rst:182 +msgid "All constants and flags have been converted to *IntEnum* and *IntFlags*." +msgstr "所有常量和标志已转换为 *IntEnum* 和 *IntFlags*。" + +#: ../../differences/python_36.rst:184 +msgid "Server and client-side specific TLS protocols for *SSLContext* were added." +msgstr "为 *SSLContext* 添加了服务器端和客户端特定的TLS协议。" + +#: ../../differences/python_36.rst:186 +msgid "" +"Added *SSLContext.post_handshake_auth* to enable and " +"*ssl.SSLSocket.verify_client_post_handshake()* to initiate TLS 1.3 post-" +"handshake authentication." +msgstr "" +"添加 *SSLContext.post_handshake_auth* 以启用和 " +"*ssl.SSLSocket.verify_client_post_handshake()* 以启动TLS 1.3握手后认证。" + +#: ../../differences/python_36.rst:189 +msgid "`struct `_" +msgstr "`struct `_" + +#: ../../differences/python_36.rst:191 +msgid "now supports IEEE 754 half-precision floats via the 'e' format specifier." +msgstr "现在通过 'e'格式说明符支持IEEE 754半精度浮点数。" + +#: ../../differences/python_36.rst:193 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_36.rst:195 +msgid "" +"The new *getfilesystemencodeerrors()* function returns the name of the " +"error mode used to convert between Unicode filenames and bytes filenames." +msgstr "新的 *getfilesystemencodeerrors()* 函数返回用于在Unicode文件名和字节文件名之间进行转换的错误模式的名称。" + +#: ../../differences/python_36.rst:198 +msgid "`zlib `_" +msgstr "`zlib `_" + +#: ../../differences/python_36.rst:200 +msgid "The *compress()* and *decompress()* functions now accept keyword arguments" +msgstr "*compress()* 和 *decompress()* 函数现在接受关键字参数" + +#: ../../differences/python_36.rst:204 +msgid "Notes" +msgstr "注意" + +#: ../../differences/python_36.rst:205 +msgid "Currently, only :func:`__set_name__` is implemented." +msgstr "目前,仅实现了 :func:`__set_name__`。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_37.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_37.po new file mode 100644 index 0000000000000..7f05da11356f5 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_37.po @@ -0,0 +1,295 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-06 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../differences/python_37.rst:4 +msgid "Python 3.7" +msgstr "Python 3.7" + +#: ../../differences/python_37.rst:6 +msgid "New Features:" +msgstr "新特征:" + +#: ../../differences/python_37.rst:12 +msgid "**Feature**" +msgstr "**特征**" + +#: ../../differences/python_37.rst:12 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_37.rst:14 +msgid "`PEP 538 `_" +msgstr "`PEP 538 `_" + +#: ../../differences/python_37.rst:14 +msgid "Coercing the legacy C locale to a UTF-8 based locale" +msgstr "将传统的C语言环境强制转换为基于UTF-8的语言环境" + +#: ../../differences/python_37.rst:17 +msgid "`PEP 539 `_" +msgstr "`PEP 539 `_" + +#: ../../differences/python_37.rst:17 +msgid "A New C-API for Thread-Local Storage in CPython" +msgstr "在CPython中为线程本地存储提供了一个新的C-API" + +#: ../../differences/python_37.rst:19 +msgid "`PEP 540 `_" +msgstr "`PEP 540 `_" + +#: ../../differences/python_37.rst:19 +msgid "UTF-8 mode" +msgstr "UTF-8 模式" + +#: ../../differences/python_37.rst:21 +msgid "`PEP 552 `_" +msgstr "`PEP 552 `_" + +#: ../../differences/python_37.rst:21 +msgid "Deterministic pyc" +msgstr "确定性pyc" + +#: ../../differences/python_37.rst:23 +msgid "`PEP 553 `_" +msgstr "`PEP 553 `_" + +#: ../../differences/python_37.rst:23 +msgid "Built-in ``breakpoint()``" +msgstr "内置 ``breakpoint()``" + +#: ../../differences/python_37.rst:25 +msgid "`PEP 557 `_" +msgstr "`PEP 557 `_" + +#: ../../differences/python_37.rst:25 +msgid "Data Classes" +msgstr "数据类" + +#: ../../differences/python_37.rst:27 +msgid "`PEP 560 `_" +msgstr "`PEP 560 `_" + +#: ../../differences/python_37.rst:27 +msgid "Core support for typing module and generic types" +msgstr "对类型模块和泛型类型的核心支持" + +#: ../../differences/python_37.rst:29 +msgid "`PEP 562 `_" +msgstr "`PEP 562 `_" + +#: ../../differences/python_37.rst:29 +msgid "Module ``__getattr__`` and ``__dir__``" +msgstr "模型 ``__getattr__`` 和 ``__dir__``" + +#: ../../differences/python_37.rst:29 +msgid "Partial" +msgstr "部分" + +#: ../../differences/python_37.rst:31 +msgid "`PEP 563 `_" +msgstr "`PEP 563 `_" + +#: ../../differences/python_37.rst:31 +msgid "Postponed Evaluation of Annotations" +msgstr "延迟评估注解" + +#: ../../differences/python_37.rst:33 +msgid "`PEP 564 `_" +msgstr "`PEP 564 `_" + +#: ../../differences/python_37.rst:33 +msgid "Time functions with nanosecond resolution" +msgstr "纳秒分辨率的时间函数" + +#: ../../differences/python_37.rst:33 +msgid "Partial [#ftimenanosec]_" +msgstr "部分 [#ftimenanosec]_" + +#: ../../differences/python_37.rst:35 +msgid "`PEP 565 `_" +msgstr "`PEP 565 `_" + +#: ../../differences/python_37.rst:35 +msgid "Show DeprecationWarning in ``__main__``" +msgstr "在 ``__main__`` 中显示DeprecationWarning" + +#: ../../differences/python_37.rst:37 +msgid "`PEP 567 `_" +msgstr "`PEP 567 `_" + +#: ../../differences/python_37.rst:37 +msgid "Context Variables" +msgstr "上下文变量" + +#: ../../differences/python_37.rst:40 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_37.rst:46 +msgid "``async`` and ``await`` are now reserved keywords" +msgstr "``async`` 和 ``await`` 现在是保留关键字" + +#: ../../differences/python_37.rst:46 +msgid "Complete" +msgstr "完成" + +#: ../../differences/python_37.rst:48 +msgid "``dict`` objects must preserve insertion-order" +msgstr "``dict`` 对象必须保持插入顺序" + +#: ../../differences/python_37.rst:50 +msgid "" +"More than 255 arguments can now be passed to a function; a function can " +"now have more than 255 parameters" +msgstr "一个函数现在可以传递超过255个参数;一个函数现在可以有255个以上的参数" + +#: ../../differences/python_37.rst:52 +msgid "" +"``bytes.fromhex()`` and ``bytearray.fromhex()`` now ignore all ASCII " +"whitespace, not only spaces" +msgstr "``bytes.fromhex()`` 和 ``bytearray.fromhex()`` " +"现在忽略所有ASCII空格,而不仅仅是空格" + +#: ../../differences/python_37.rst:54 +msgid "" +"``str``, ``bytes``, and ``bytearray`` gained support for the new " +"``isascii()`` method, which can be used to test if a string or bytes " +"contain only the ASCII characters" +msgstr "" +"``str``、 ``bytes`` 和 ``bytearray`` 获得了新的 ``isascii()`` " +"方法的支持,该方法可用于测试字符串或字节是否仅包含ASCII字符" + +#: ../../differences/python_37.rst:57 +msgid "" +"``ImportError`` now displays module name and module ``__file__`` path " +"when ``from ... import ...`` fails" +msgstr "``ImportError`` 现在显示模块名和模块 ``__file__`` 路径,当 ``from ... import " +"...`` 失败" + +#: ../../differences/python_37.rst:59 +msgid "" +"Circular imports involving absolute imports with binding a submodule to a" +" name are now supported" +msgstr "现在支持循环导入,包括将子模块绑定到名称的绝对导入" + +#: ../../differences/python_37.rst:61 +msgid "" +"``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " +"``format(str(self), '')``" +msgstr "" +"``object.__format__(x, '')`` 现在相当于 ``str(x)`` 而不是 ``format(str(self)" +", '')``" + +#: ../../differences/python_37.rst:63 +msgid "" +"In order to better support dynamic creation of stack traces, " +"``types.TracebackType`` can now be instantiated from Python code, and the" +" ``tb_next`` attribute on tracebacks is now writable" +msgstr "" +"为了更好地支持动态创建堆栈跟踪,``types.TracebackType`` " +"现在可以从Python代码中实例化,并且tracebacks上的 ``tb_next`` 属性现在是可写的" + +#: ../../differences/python_37.rst:66 +msgid "" +"When using the ``-m`` switch, ``sys.path[0]`` is now eagerly expanded to " +"the full starting directory path, rather than being left as the empty " +"directory (which allows imports from the current working directory at the" +" time when an import occurs)" +msgstr "" +"当使用 ``-m`` 开关时, ``sys.path[0]`` 现在被急切地扩展为完整的起始目录路径," +"而不是作为空目录(允许在导入发生时从当前工作目录导入)" + +#: ../../differences/python_37.rst:70 +msgid "" +"The new ``-X importtime`` option or the ``PYTHONPROFILEIMPORTTIME`` " +"environment variable can be used to show the timing of each module import" +msgstr "新的 ``-X importtime`` 选项或 ``PYTHONPROFILEIMPORTTIME`` " +"环境变量可用于显示每个模块导入的时间" + +#: ../../differences/python_37.rst:74 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_37.rst:80 +msgid "`asyncio `_" +msgstr "`asyncio `_" + +#: ../../differences/python_37.rst:82 +msgid "Too many to list" +msgstr "不胜枚举" + +#: ../../differences/python_37.rst:84 +msgid "`gc `_" +msgstr "`gc `_" + +#: ../../differences/python_37.rst:86 +msgid "New features include *gc.freeze()*, *gc.unfreeze()*, *gc-get_freeze_count*" +msgstr "新增功能包括 *gc.freeze()*、*gc.unfreeze()*、 *gc-get_freeze_count*" + +#: ../../differences/python_37.rst:88 +msgid "`math `_" +msgstr "`math `_" + +#: ../../differences/python_37.rst:90 +msgid "math.remainder() added to implement IEEE 754-style remainder" +msgstr "添加math.remainder()以实现IEEE 754风格的余数" + +#: ../../differences/python_37.rst:92 +msgid "`re `_" +msgstr "`re `_" + +#: ../../differences/python_37.rst:94 +msgid "" +"A number of tidy up features including better support for splitting on " +"empty strings and copy support for compiled expressions and match objects" +msgstr "许多整理功能,包括更好地支持对空字符串的分割,以及对编译表达式和匹配对象的复" +"制支持" + +#: ../../differences/python_37.rst:97 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_37.rst:99 +msgid "" +"sys.breakpointhook() added. " +"sys.get(/set)_coroutine_origin_tracking_depth() added" +msgstr "" +"添加sys.breakpointhook() 。添加 sys." +"get(/set)_coroutine_origin_tracking_depth()" + +#: ../../differences/python_37.rst:101 +msgid "`time `_" +msgstr "`time `_" + +#: ../../differences/python_37.rst:103 +msgid "Mostly updates to support nanosecond resolution in PEP564, see above" +msgstr "大多数更新是为了支持PEP564的纳秒分辨率,见上文" + +#: ../../differences/python_37.rst:107 +msgid "Notes" +msgstr "笔记" + +#: ../../differences/python_37.rst:108 +msgid "Only :func:`time.time_ns` is implemented." +msgstr "仅实现 :func:`time.time_ns`。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_38.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_38.po new file mode 100644 index 0000000000000..95d081f821355 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_38.po @@ -0,0 +1,327 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-03 03:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../differences/python_38.rst:4 +msgid "Python 3.8" +msgstr "Python 3.8" + +#: ../../differences/python_38.rst:6 +msgid "" +"Python 3.8.0 (final) was released on the 14 October 2019. The Features " +"for 3.8 are defined in `PEP 569 " +"`_ and a detailed " +"description of the changes can be found in `What's New in Python 3.8. " +"`_" +msgstr "" +"Python 3.8.0(最终版本)于2019年10月14日发布。3.8的特性在 `PEP 569 `_ 中定义,有关更改的详细描述可以在 `" +"What's New in Python 3.8. `_ 中找到" + +#: ../../differences/python_38.rst:15 +msgid "**Features**" +msgstr "**特性**" + +#: ../../differences/python_38.rst:15 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_38.rst:17 +msgid "`PEP 570 `_" +msgstr "`PEP 570 `_" + +#: ../../differences/python_38.rst:17 +msgid "Positional-only arguments" +msgstr "Positional-only 参数" + +#: ../../differences/python_38.rst:19 +msgid "`PEP 572 `_" +msgstr "`PEP 572 `_" + +#: ../../differences/python_38.rst:19 +msgid "Assignment Expressions" +msgstr "赋值表达式" + +#: ../../differences/python_38.rst:19 ../../differences/python_38.rst:31 +#: ../../differences/python_38.rst:40 ../../differences/python_38.rst:87 +#: ../../differences/python_38.rst:91 ../../differences/python_38.rst:121 +msgid "Complete" +msgstr "完成" + +#: ../../differences/python_38.rst:21 +msgid "`PEP 574 `_" +msgstr "`PEP 574 `_" + +#: ../../differences/python_38.rst:21 +msgid "Pickle protocol 5 with out-of-band data" +msgstr "带外数据的Pickle协议5" + +#: ../../differences/python_38.rst:23 +msgid "`PEP 578 `_" +msgstr "`PEP 578 `_" + +#: ../../differences/python_38.rst:23 +msgid "Runtime audit hooks" +msgstr "运行时审计挂钩" + +#: ../../differences/python_38.rst:25 +msgid "`PEP 587 `_" +msgstr "`PEP 587 `_" + +#: ../../differences/python_38.rst:25 +msgid "Python Initialization Configuration" +msgstr "Python初始化配置" + +#: ../../differences/python_38.rst:27 +msgid "`PEP 590 `_" +msgstr "`PEP 590 `_" + +#: ../../differences/python_38.rst:27 +msgid "Vectorcall: a fast calling protocol for CPython" +msgstr "Vectorcall: CPython的快速调用协议" + +#: ../../differences/python_38.rst:29 +msgid "**Miscellaneous**" +msgstr "**混杂的**" + +#: ../../differences/python_38.rst:31 +msgid "f-strings support = for self-documenting expressions and debugging" +msgstr "f字符串支持=用于自文档化表达式和调试" + +#: ../../differences/python_38.rst:34 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_38.rst:40 +msgid "" +"A *continue* statement was illegal in the *finally* clause due to a " +"problem with the implementation. In Python 3.8 this restriction was " +"lifted" +msgstr "一条 *continue* 语句在 *finally* 子句中是非法的,因为实现上存在问题。在 " +"Python 3.8 中,这一限制被取消了" + +#: ../../differences/python_38.rst:43 +msgid "" +"The *bool*, *int* , and *fractions.Fraction* types now have an " +"*as_integer_ratio()* method like that found in *float* and " +"*decimal.Decimal*" +msgstr "" +"*bool*、*int* 和 *fractions.Fraction* 类型现在有一个 *as_integer_ratio()* " +"方法,就像* float* 和 *decimal.Decimal* 中的那个方法一样" + +#: ../../differences/python_38.rst:46 +msgid "" +"Constructors of *int*, *float* and *complex* will now use the " +"*__index__()* special method, if available and the corresponding method " +"*__int__()*, *__float__()* or *__complex__()* is not available" +msgstr "" +"*int*、*float* 和* complex* 的构造函数现在会使用 *__index__()* 特殊方法,如果该方法可用且对应的 " +"*__index__()* 、*__float__()* 或 *__complex__()* 方法不可用" + +#: ../../differences/python_38.rst:49 +msgid "Added support of *\\N{name}* escapes in regular expressions" +msgstr "在正则表达式中添加了对 *\\N{name}* 转义序列的支持" + +#: ../../differences/python_38.rst:51 +msgid "" +"Dict and dictviews are now iterable in reversed insertion order using " +"*reversed()*" +msgstr "字典和字典视图现在可以使用 *reversed()* 按插入顺序的反向顺序进行迭代" + +#: ../../differences/python_38.rst:53 +msgid "" +"The syntax allowed for keyword names in function calls was further " +"restricted. In particular, f((keyword)=arg) is no longer allowed" +msgstr "函数调用中允许的关键字名称的语法进一步被限制。特别是,f((keyword)=arg) " +"这种写法不再被允许" + +#: ../../differences/python_38.rst:56 +msgid "" +"Generalized iterable unpacking in yield and return statements no longer " +"requires enclosing parentheses" +msgstr "在 yield 和 return 语句中,通用的可迭代 unpacking 不再需要括号" + +#: ../../differences/python_38.rst:58 +msgid "" +"When a comma is missed in code such as [(10, 20) (30, 40)], the compiler " +"displays a SyntaxWarning with a helpful suggestion" +msgstr "当代码中遗漏逗号,如 [(10, 20) (30, 40)] 时,编译器会显示一个 " +"SyntaxWarning,并提供有用的建议" + +#: ../../differences/python_38.rst:61 +msgid "" +"Arithmetic operations between subclasses of *datetime.date* or " +"*datetime.datetime* and *datetime.timedelta* objects now return an " +"instance of the subclass, rather than the base class" +msgstr "" +"*datetime.date* 或 *datetime.datetime* 的子类与 *datetime.timedelta* " +"对象之间的算术运算现在会返回子类的实例,而不是基类的实例" + +#: ../../differences/python_38.rst:64 +msgid "" +"When the Python interpreter is interrupted by *Ctrl-C (SIGINT)* and the " +"resulting *KeyboardInterrupt* exception is not caught, the Python process" +" now exits via a SIGINT signal or with the correct exit code such that " +"the calling process can detect that it died due to a *Ctrl-C*" +msgstr "" +"当 Python 解释器被 *Ctrl-C (SIGINT) *中断,并且生成的 *KeyboardInterrupt* " +"异常没有被捕获时,Python 进程现在会通过 SIGINT 信号退出或使用正确的退出代码," +"以便调用进程可以检测到它因 *Ctrl-C* 而终止" + +#: ../../differences/python_38.rst:68 +msgid "" +"Some advanced styles of programming require updating the *types.CodeType*" +" object for an existing function" +msgstr "一些高级编程风格需要更新现有函数的 *types.CodeType* 对象" + +#: ../../differences/python_38.rst:70 +msgid "" +"For integers, the three-argument form of the pow() function now permits " +"the exponent to be negative in the case where the base is relatively " +"prime to the modulus" +msgstr "对于整数,pow() 函数的三参数形式现在允许在基数与模数互质的情况下,指数为负数" + +#: ../../differences/python_38.rst:73 +msgid "" +"Dict comprehensions have been synced-up with dict literals so that the " +"key is computed first and the value second" +msgstr "字典推导式现在与字典字面量同步,使得键首先被计算,然后是值" + +#: ../../differences/python_38.rst:76 +msgid "" +"The *object.__reduce__()* method can now return a tuple from two to six " +"elements long" +msgstr "*object.__reduce__()* 方法现在可以返回两个到六个元素长的元组" + +#: ../../differences/python_38.rst:79 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_38.rst:85 +msgid "`asyncio `_" +msgstr "`asyncio `_" + +#: ../../differences/python_38.rst:87 +msgid "*asyncio.run()* has graduated from the provisional to stable API" +msgstr "*asyncio.run()* 已从临时API升级为稳定API" + +#: ../../differences/python_38.rst:89 +msgid "Running *python -m asyncio* launches a natively async REPL" +msgstr "运行 *python -m asyncio* 会启动一个本地异步REPL" + +#: ../../differences/python_38.rst:91 +msgid "" +"The exception *asyncio.CancelledError* now inherits from *BaseException* " +"rather than *Exception* and no longer inherits from " +"*concurrent.futures.CancelledError*" +msgstr "" +"异常 *asyncio.CancelledError* 现在继承自 *BaseException* 而不是 *Exception*,并且不再继承自 " +"*concurrent.futures.CancelledError*" + +#: ../../differences/python_38.rst:94 +msgid "" +"Added *asyncio.Task.get_coro()* for getting the wrapped coroutine within " +"an *asyncio.Task*" +msgstr "增加了 *asyncio.Task.get_coro()* 方法,用于获取 *asyncio.Task* 内部封装的协程" + +#: ../../differences/python_38.rst:96 +msgid "" +"Asyncio tasks can now be named, either by passing the name keyword " +"argument to *asyncio.create_task()* or the *create_task()* event loop " +"method, or by calling the *set_name()* method on the task object" +msgstr "" +"现在可以通过将name关键字参数传递给 *asyncio.create_task()* 或 *create_task()* " +"事件循环方法,或通过调用任务对象上的 *set_name()* 方法来命名Asyncio任务" + +#: ../../differences/python_38.rst:99 +msgid "" +"Added support for Happy Eyeballs to *asyncio.loop.create_connection()*. " +"To specify the behavior, two new parameters have been added: " +"*happy_eyeballs_delay* and interleave." +msgstr "" +"为 *asyncio.loop.create_connection()* 增加了对Happy " +"Eyeballs的支持。为了指定行为,添加了两个新参数: *happy_eyeballs_delay* 和interleave。" + +#: ../../differences/python_38.rst:102 +msgid "`gc `_" +msgstr "`gc `_" + +#: ../../differences/python_38.rst:104 +msgid "" +"*get_objects()* can now receive an optional generation parameter " +"indicating a generation to get objects from. (Note, though, that while " +"*gc* is a built-in, *get_objects()* is not implemented for MicroPython)" +msgstr "" +"*get_objects()* 现在可以接收一个可选的 generation 参数,该参数指示从哪一代获取对象。(请注意,虽然 *gc* " +"是内置的,但 *get_objects()* 并没有为MicroPython实现)" + +#: ../../differences/python_38.rst:107 +msgid "`math `_" +msgstr "`math `_" + +#: ../../differences/python_38.rst:109 +msgid "" +"Added new function *math.dist()* for computing Euclidean distance between" +" two points" +msgstr "添加了新的函数 *math.dist()* 用于计算两点之间的欧几里德距离" + +#: ../../differences/python_38.rst:111 +msgid "Expanded the *math.hypot()* function to handle multiple dimensions" +msgstr "扩展了 *math.hypot()* 函数以处理多个维度" + +#: ../../differences/python_38.rst:113 +msgid "" +"Added new function, *math.prod()*, as analogous function to *sum()* that " +"returns the product of a \"start\" value (default: 1) times an iterable " +"of numbers" +msgstr "" +"添加了新函数,*math.prod()*,作为类似于 *sum()* 的函数,返回 \"start\" " +"值(默认值:1)乘以数字可迭代对象的乘积" + +#: ../../differences/python_38.rst:116 +msgid "Added two new combinatoric functions *math.perm()* and *math.comb()*" +msgstr "添加了两个新的组合函数 *math.perm()* 和 *math.comb()*" + +#: ../../differences/python_38.rst:118 +msgid "" +"Added a new function *math.isqrt()* for computing accurate integer square" +" roots without conversion to floating point" +msgstr "增加了一个新的函数 *math.isqrt()* ,用于计算精确的整数平方根而不转换为浮点数" + +#: ../../differences/python_38.rst:121 +msgid "" +"The function *math.factorial()* no longer accepts arguments that are not " +"int-like" +msgstr "函数 *math.factorial()* 不再接受非int型的参数" + +#: ../../differences/python_38.rst:123 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_38.rst:125 +msgid "" +"Add new *sys.unraisablehook()* function which can be overridden to " +"control how \"unraisable exceptions\" are handled" +msgstr "" +"添加新的 *sys.unraisablehook()* 函数,该函数可以被重写以控制如何处理\"不可引发的异常\"" diff --git a/docs/locale/zh_CN/LC_MESSAGES/differences/python_39.po b/docs/locale/zh_CN/LC_MESSAGES/differences/python_39.po new file mode 100644 index 0000000000000..2d0e382137076 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/differences/python_39.po @@ -0,0 +1,353 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-03 03:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../differences/python_39.rst:4 +msgid "Python 3.9" +msgstr "Python 3.9" + +#: ../../differences/python_39.rst:6 +msgid "" +"Python 3.9.0 (final) was released on the 5th October 2020. The Features " +"for 3.9 are defined in `PEP 596 `_ and a detailed description of the changes can be " +"found in `What's New in Python 3.9 " +"`_" +msgstr "" +"Python 3.9.0(最终版本)于2020年10月5日发布。3.9的特性在 `PEP 596 `_ 中定义," +"有关更改的详细描述可以在 `What's New in Python 3.9 `_ 中找到" + +#: ../../differences/python_39.rst:15 +msgid "**Features**" +msgstr "**特性**" + +#: ../../differences/python_39.rst:15 +msgid "**Status**" +msgstr "**状态**" + +#: ../../differences/python_39.rst:17 +msgid "`PEP 573 `_" +msgstr "`PEP 573 `_" + +#: ../../differences/python_39.rst:17 +msgid "Fast access to module state from methods of C extension types" +msgstr "从C扩展类型的方法快速访问模块状态" + +#: ../../differences/python_39.rst:17 ../../differences/python_39.rst:26 +#: ../../differences/python_39.rst:36 +msgid "Not relevant" +msgstr "不相关的" + +#: ../../differences/python_39.rst:20 +msgid "`PEP 584 `_" +msgstr "`PEP 584 `_" + +#: ../../differences/python_39.rst:20 +msgid "Union operators added to dict" +msgstr "字典中增加了联合操作符" + +#: ../../differences/python_39.rst:20 +msgid "Complete [#pep584]_" +msgstr "完成 [#pep584]_" + +#: ../../differences/python_39.rst:22 +msgid "`PEP 585 `_" +msgstr "`PEP 585 `_" + +#: ../../differences/python_39.rst:22 +msgid "Type hinting generics in standard collections" +msgstr "在标准集合中键入提示泛型" + +#: ../../differences/python_39.rst:24 +msgid "`PEP 593 `_" +msgstr "`PEP 593 `_" + +#: ../../differences/python_39.rst:24 +msgid "Flexible function and variable annotations" +msgstr "灵活的函数和变量注释" + +#: ../../differences/python_39.rst:26 +msgid "`PEP 602 `_" +msgstr "`PEP 602 `_" + +#: ../../differences/python_39.rst:26 +msgid "" +"CPython adopts an annual release cycle. Instead of annual, aiming for two" +" month release cycle" +msgstr "CPython采用年度发布周期。目标是两个月的发布周期而不是每年" + +#: ../../differences/python_39.rst:29 +msgid "`PEP 614 `_" +msgstr "`PEP 614 `_" + +#: ../../differences/python_39.rst:29 +msgid "Relaxed grammar restrictions on decorators" +msgstr "放宽对修饰符的语法限制" + +#: ../../differences/python_39.rst:31 +msgid "`PEP 615 `_" +msgstr "`PEP 615 `_" + +#: ../../differences/python_39.rst:31 +msgid "" +"The IANA Time Zone Database is now present in the standard library in the" +" zoneinfo module" +msgstr "IANA时区数据库现在存在于zoneinfo模块的标准库中" + +#: ../../differences/python_39.rst:34 +msgid "`PEP 616 `_" +msgstr "`PEP 616 `_" + +#: ../../differences/python_39.rst:34 +msgid "String methods to remove prefixes and suffixes" +msgstr "字符串方法来删除前缀和后缀" + +#: ../../differences/python_39.rst:36 +msgid "`PEP 617 `_" +msgstr "`PEP 617 `_" + +#: ../../differences/python_39.rst:36 +msgid "CPython now uses a new parser based on PEG" +msgstr "CPython现在使用基于PEG的新解析器" + +#: ../../differences/python_39.rst:39 +msgid "Other Language Changes:" +msgstr "其他语言变化:" + +#: ../../differences/python_39.rst:45 +msgid "*__import__()* now raises *ImportError* instead of *ValueError*" +msgstr "*__import__()* 现在引发 *ImportError* 而不是 *ValueError*" + +#: ../../differences/python_39.rst:45 ../../differences/python_39.rst:114 +#: ../../differences/python_39.rst:116 +msgid "Complete" +msgstr "完成" + +#: ../../differences/python_39.rst:47 +msgid "" +"Python now gets the absolute path of the script filename specified on the" +" command line (ex: *python3* *script.py*): the *__file__* attribute of " +"the *__main__* module became an absolute path, rather than a relative " +"path" +msgstr "" +"Python现在获取命令行上指定的脚本文件名的绝对路径(例如:*python3* *script.py*): *__main__* 模块的 " +"*__file__* 属性成为绝对路径,而不是相对路径" + +#: ../../differences/python_39.rst:51 +msgid "" +"By default, for best performance, the errors argument is only checked at " +"the first encoding/decoding error and the encoding argument is sometimes " +"ignored for empty strings" +msgstr "默认情况下,为了获得最佳性能,只在出现第一个编码/解码错误时检查errors参数,对" +"于空字符串,有时会忽略encoding参数" + +#: ../../differences/python_39.rst:54 +msgid "" +"*\"\".replace(\"\", s, n)* now returns *s* instead of an empty string for" +" all non-zero n. It is now consistent with *\"\".replace(\"\", s)*" +msgstr "" +"*\"\".replace(\"\", s, n)* 现在对所有非零n返回 *s*,而不是空字符串。它现在与 " +"*\"\".replace(\"\", s)* 一致" + +#: ../../differences/python_39.rst:57 +msgid "" +"Any valid expression can now be used as a decorator. Previously, the " +"grammar was much more restrictive" +msgstr "现在,任何有效的表达式都可以用作装饰器。以前,语法的限制要严格得多" + +#: ../../differences/python_39.rst:59 +msgid "" +"Parallel running of *aclose()* / *asend()* / *athrow()* is now " +"prohibited, and *ag_running* now reflects the actual running status of " +"the async generator" +msgstr "" +"*aclose ()*/* asend()*/* athrow()*的并行运行现在是禁止的,* " +"ag_running*现在反映了异步生成器的实际运行状态" + +#: ../../differences/python_39.rst:62 +msgid "" +"Unexpected errors in calling the *__iter__* method are no longer masked " +"by TypeError in the in operator and functions contains(), indexOf() and " +"countOf() of the operator module" +msgstr "" +"调用 *__iter__* 方法时的意外错误在 in 运算符和 operator 模块中的 contains()、indexOf() 和 " +"countOf() 函数中不再被 TypeError 掩盖" + +#: ../../differences/python_39.rst:65 +msgid "" +"Unparenthesized lambda expressions can no longer be the expression part " +"in an if clause in comprehensions and generator expressions" +msgstr "未加括号的 lambda 表达式不能再作为推导式和生成器表达式中的 if " +"子句的表达式部分" + +#: ../../differences/python_39.rst:69 +msgid "Changes to built-in modules:" +msgstr "对内置模块的更改:" + +#: ../../differences/python_39.rst:75 +msgid "`asyncio `_" +msgstr "`asyncio `_" + +#: ../../differences/python_39.rst:77 +msgid "" +"Due to significant security concerns, the reuse_address parameter of " +"*asyncio.loop.create_datagram_endpoint()* is no longer supported" +msgstr "" +"由于严重的安全问题,不再支持 *asyncio.loop.create_datagram_endpoint()* 的reuse_address参数" + +#: ../../differences/python_39.rst:80 +msgid "" +"Added a new coroutine *shutdown_default_executor()* that schedules a " +"shutdown for the default executor that waits on the *ThreadPoolExecutor* " +"to finish closing. Also, *asyncio.run()* has been updated to use the new " +"coroutine." +msgstr "" +"增加了一个新的协程 *shutdown_default_executor()*,它为等待 *ThreadPoolExecutor* " +"完成关闭的默认执行程序调度关闭。此外,*asyncio.run()* 已更新为使用新的协程。" + +#: ../../differences/python_39.rst:84 +msgid "" +"Added *asyncio.PidfdChildWatcher*, a Linux-specific child watcher " +"implementation that polls process file descriptors" +msgstr "" +"添加了 *asyncio.PidfdChildWatcher*,一个特定于linux的子监视器实现,轮询处理文件描述符" + +#: ../../differences/python_39.rst:87 +msgid "added a new *coroutine asyncio.to_thread()*" +msgstr "添加一个新的 *coroutine asyncio.to_thread()*" + +#: ../../differences/python_39.rst:89 +msgid "" +"When cancelling the task due to a timeout, *asyncio.wait_for()* will now " +"wait until the cancellation is complete also in the case when timeout is " +"<= 0, like it does with positive timeouts" +msgstr "" +"当由于超时而取消任务时,*asyncio.wait_for()* 现在将等待直到取消完成,同样在timeout <= 0的情况下,就像正超时一样" + +#: ../../differences/python_39.rst:92 +msgid "" +"*asyncio* now raises *TyperError* when calling incompatible methods with " +"an *ssl.SSLSocket* socket" +msgstr "*asyncio* 现在在使用 *ssl.SSLSocket* 套接字调用不兼容方法时会引发 *TyperError*" + +#: ../../differences/python_39.rst:94 +msgid "`gc `_" +msgstr "`gc `_" + +#: ../../differences/python_39.rst:96 +msgid "Garbage collection does not block on resurrected objects" +msgstr "垃圾收集不会阻塞复活的对象" + +#: ../../differences/python_39.rst:98 +msgid "" +"Added a new function *gc.is_finalized()* to check if an object has been " +"finalized by the garbage collector" +msgstr "增加了一个新的函数 *gc.is_finalized()* 来检查一个对象是否已经被垃圾回收器完成" + +#: ../../differences/python_39.rst:100 +msgid "`math `_" +msgstr "`math `_" + +#: ../../differences/python_39.rst:102 +msgid "" +"Expanded the *math.gcd()* function to handle multiple arguments. " +"Formerly, it only supported two arguments" +msgstr "扩展了 *math.gcd()* 函数以处理多个参数。以前,它只支持两个论点" + +#: ../../differences/python_39.rst:104 +msgid "" +"Added *math.lcm()*: return the least common multiple of specified " +"arguments" +msgstr "增加了 *math.lcm()*: 返回指定参数的最小公倍数" + +#: ../../differences/python_39.rst:106 +msgid "" +"Added *math.nextafter()*: return the next floating-point value after x " +"towards y" +msgstr "增加了 *math.nextafter()*: 返回x之后朝向y的下一个浮点值" + +#: ../../differences/python_39.rst:108 +msgid "" +"Added *math.ulp()*: return the value of the least significant bit of a " +"float" +msgstr "增加了 *math.ulp()*: 返回浮点数的最低有效位的值" + +#: ../../differences/python_39.rst:110 +msgid "`os `_" +msgstr "`os `_" + +#: ../../differences/python_39.rst:112 +msgid "Exposed the Linux-specific *os.pidfd_open()* and *os.P_PIDFD*" +msgstr "暴露了特定于linux的 *os.pidfd_open()* 和 *os.P_PIDFD*" + +#: ../../differences/python_39.rst:114 +msgid "The *os.unsetenv()* function is now also available on Windows" +msgstr "*os.unsetenv()* 函数现在在Windows上也可用" + +#: ../../differences/python_39.rst:116 +msgid "The *os.putenv()* and *os.unsetenv()* functions are now always available" +msgstr "*os.putenv()* 和 *os.unsetenv()* 函数现在总是可用的" + +#: ../../differences/python_39.rst:118 +msgid "" +"Added *os.waitstatus_to_exitcode()* function: convert a wait status to an" +" exit code" +msgstr "增加了 *os.waitstatus_to_exitcode()* 函数:将等待状态转换为退出代码" + +#: ../../differences/python_39.rst:120 +msgid "`random `_" +msgstr "`random `_" + +#: ../../differences/python_39.rst:122 +msgid "Added a new *random.Random.randbytes* method: generate random bytes" +msgstr "增加了一个新的 *random.Random.randbytes* 方法:生成随机字节" + +#: ../../differences/python_39.rst:124 +msgid "`sys `_" +msgstr "`sys `_" + +#: ../../differences/python_39.rst:126 +msgid "" +"Added a new *sys.platlibdir* attribute: name of the platform-specific " +"library directory" +msgstr "增加了一个新的 *sys.platlibdir* 属性:特定于平台的库目录名" + +#: ../../differences/python_39.rst:128 +msgid "" +"Previously, *sys.stderr* was block-buffered when non-interactive. Now " +"stderr defaults to always being line-buffered" +msgstr "以前,*sys.stderr* 在非交互式时被块缓冲。现在stderr默认为始终行缓冲" + +#: ../../differences/python_39.rst:133 +msgid "Notes" +msgstr "笔记" + +#: ../../differences/python_39.rst:134 +msgid "" +"PEP 584 ``dict`` union operator is only available on MicroPython builds " +"with ``MICROPY_CPYTHON_COMPAT`` enabled." +msgstr "" +"PEP 584 ``dict`` 联合运算符仅在启用了 ``MICROPY_CPYTHON_COMPAT`` " +"的MicroPython构建上可用。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/genrst/builtin_types.po b/docs/locale/zh_CN/LC_MESSAGES/genrst/builtin_types.po new file mode 100644 index 0000000000000..bfb64cfc9d56f --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/genrst/builtin_types.po @@ -0,0 +1,460 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-08 00:15+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../genrst/builtin_types.rst:4 +msgid "Builtin types" +msgstr "内置类型" + +#: ../../genrst/builtin_types.rst:7 +#, fuzzy +msgid "Generated Sat 07 Mar 2026 16:15:41 UTC" +msgstr "生成于 2026 年 3 月 7 日星期六 04:35:17 UTC" + +#: ../../genrst/builtin_types.rst:10 +msgid "Exception" +msgstr "异常" + +#: ../../genrst/builtin_types.rst:15 +msgid "" +"All exceptions have readable ``value`` and ``errno`` attributes, not just" +" ``StopIteration`` and ``OSError``." +msgstr "所有异常都具有可读的 ``value`` 和 ``errno`` 属性,不仅限于 ``StopIteration`` 和 ``OSError``。" + +#: ../../genrst/builtin_types.rst:17 +msgid "**Cause:** MicroPython is optimised to reduce code size." +msgstr "**原因:** MicroPython 优化了代码大小。" + +#: ../../genrst/builtin_types.rst:19 +msgid "" +"**Workaround:** Only use ``value`` on ``StopIteration`` exceptions, and " +"``errno`` on ``OSError`` exceptions. Do not use or rely on these " +"attributes on other exceptions." +msgstr "" +"**解决方法:** 仅在 ``StopIteration`` 异常上使用 ``value``,在 ``OSError`` 异常上使用 " +"``errno`` 。不要在其他异常上使用或依赖这些属性。" + +#: ../../genrst/builtin_types.rst:21 ../../genrst/builtin_types.rst:43 +#: ../../genrst/builtin_types.rst:76 ../../genrst/builtin_types.rst:98 +#: ../../genrst/builtin_types.rst:133 ../../genrst/builtin_types.rst:160 +#: ../../genrst/builtin_types.rst:187 ../../genrst/builtin_types.rst:209 +#: ../../genrst/builtin_types.rst:231 ../../genrst/builtin_types.rst:259 +#: ../../genrst/builtin_types.rst:287 ../../genrst/builtin_types.rst:310 +#: ../../genrst/builtin_types.rst:343 ../../genrst/builtin_types.rst:364 +#: ../../genrst/builtin_types.rst:398 ../../genrst/builtin_types.rst:424 +#: ../../genrst/builtin_types.rst:448 ../../genrst/builtin_types.rst:470 +#: ../../genrst/builtin_types.rst:499 ../../genrst/builtin_types.rst:529 +#: ../../genrst/builtin_types.rst:560 ../../genrst/builtin_types.rst:580 +#: ../../genrst/builtin_types.rst:602 ../../genrst/builtin_types.rst:620 +#: ../../genrst/builtin_types.rst:638 ../../genrst/builtin_types.rst:659 +msgid "Sample code::" +msgstr "示例代码::" + +#: ../../genrst/builtin_types.rst:29 ../../genrst/builtin_types.rst:52 +#: ../../genrst/builtin_types.rst:84 ../../genrst/builtin_types.rst:109 +#: ../../genrst/builtin_types.rst:145 ../../genrst/builtin_types.rst:168 +#: ../../genrst/builtin_types.rst:193 ../../genrst/builtin_types.rst:215 +#: ../../genrst/builtin_types.rst:237 ../../genrst/builtin_types.rst:268 +#: ../../genrst/builtin_types.rst:293 ../../genrst/builtin_types.rst:322 +#: ../../genrst/builtin_types.rst:350 ../../genrst/builtin_types.rst:376 +#: ../../genrst/builtin_types.rst:405 ../../genrst/builtin_types.rst:432 +#: ../../genrst/builtin_types.rst:456 ../../genrst/builtin_types.rst:478 +#: ../../genrst/builtin_types.rst:508 ../../genrst/builtin_types.rst:546 +#: ../../genrst/builtin_types.rst:566 ../../genrst/builtin_types.rst:586 +#: ../../genrst/builtin_types.rst:608 ../../genrst/builtin_types.rst:626 +#: ../../genrst/builtin_types.rst:644 ../../genrst/builtin_types.rst:665 +msgid "CPy output:" +msgstr "CPy输出:" + +#: ../../genrst/builtin_types.rst:29 ../../genrst/builtin_types.rst:52 +#: ../../genrst/builtin_types.rst:84 ../../genrst/builtin_types.rst:109 +#: ../../genrst/builtin_types.rst:145 ../../genrst/builtin_types.rst:168 +#: ../../genrst/builtin_types.rst:193 ../../genrst/builtin_types.rst:215 +#: ../../genrst/builtin_types.rst:237 ../../genrst/builtin_types.rst:268 +#: ../../genrst/builtin_types.rst:293 ../../genrst/builtin_types.rst:322 +#: ../../genrst/builtin_types.rst:350 ../../genrst/builtin_types.rst:376 +#: ../../genrst/builtin_types.rst:405 ../../genrst/builtin_types.rst:432 +#: ../../genrst/builtin_types.rst:456 ../../genrst/builtin_types.rst:478 +#: ../../genrst/builtin_types.rst:508 ../../genrst/builtin_types.rst:546 +#: ../../genrst/builtin_types.rst:566 ../../genrst/builtin_types.rst:586 +#: ../../genrst/builtin_types.rst:608 ../../genrst/builtin_types.rst:626 +#: ../../genrst/builtin_types.rst:644 ../../genrst/builtin_types.rst:665 +msgid "uPy output:" +msgstr "uPy输出:" + +#: ../../genrst/builtin_types.rst:41 +msgid "Exception chaining not implemented" +msgstr "未实现异常链接" + +#: ../../genrst/builtin_types.rst:70 +msgid "User-defined attributes for builtin exceptions are not supported" +msgstr "不支持内置异常的用户定义属性" + +#: ../../genrst/builtin_types.rst:72 ../../genrst/builtin_types.rst:227 +#: ../../genrst/builtin_types.rst:252 +msgid "**Cause:** MicroPython is highly optimized for memory usage." +msgstr "**原因:** MicroPython 对内存使用进行了高度优化。" + +#: ../../genrst/builtin_types.rst:74 +msgid "**Workaround:** Use user-defined exception subclasses." +msgstr "**解决方法:** 使用用户定义的异常子类。" + +#: ../../genrst/builtin_types.rst:94 +msgid "Exception in while loop condition may have unexpected line number" +msgstr "在 while 循环条件中的异常可能具有意外的行号" + +#: ../../genrst/builtin_types.rst:96 +msgid "" +"**Cause:** Condition checks are optimized to happen at the end of loop " +"body, and that line number is reported." +msgstr "**原因:** 条件检查被优化为在循环体结束时进行,而报告的是该行号。" + +#: ../../genrst/builtin_types.rst:123 +msgid "Exception.__init__ method does not exist." +msgstr "Exception.__init__ 方法不存在。" + +#: ../../genrst/builtin_types.rst:125 +msgid "" +"**Cause:** Subclassing native classes is not fully supported in " +"MicroPython." +msgstr "**原因:** 在 MicroPython 中并不完全支持对原生类进行子类化。" + +#: ../../genrst/builtin_types.rst:127 +msgid "**Workaround:** Call using ``super()`` instead::" +msgstr "**解决方法:** 使用 ``super()`` 调用::" + +#: ../../genrst/builtin_types.rst:153 +msgid "bytearray" +msgstr "字节数组" + +#: ../../genrst/builtin_types.rst:158 +msgid "Array slice assignment with unsupported RHS" +msgstr "使用不受支持的 RHS 进行数组切片赋值" + +#: ../../genrst/builtin_types.rst:176 +msgid "bytes" +msgstr "bytes" + +#: ../../genrst/builtin_types.rst:181 +msgid "bytes objects support .format() method" +msgstr "bytes 对象支持 .format() 方法" + +#: ../../genrst/builtin_types.rst:183 +#, python-format +msgid "" +"**Cause:** MicroPython strives to be a more regular implementation, so if" +" both `str` and `bytes` support ``__mod__()`` (the % operator), it makes " +"sense to support ``format()`` for both too. Support for ``__mod__`` can " +"also be compiled out, which leaves only ``format()`` for bytes " +"formatting." +msgstr "" +"**原因:** MicroPython 力求实现更规范的实现,因此如果 `str` 和 `bytes` 都支持 ``__mod__()`` (% " +"运算符),那么支持 ``format()`` 对于两者都是有意义的。对于 ``__mod__`` 的支持也可以编译出来,这样就只剩下了字节格式化的" +" ``format()``。" + +#: ../../genrst/builtin_types.rst:185 +msgid "" +"**Workaround:** If you are interested in CPython compatibility, don't use" +" ``.format()`` on bytes objects." +msgstr "**解决方法:** 如果你关心与 CPython 的兼容性,请不要在 bytes 对象上使用 ``.format()``。" + +#: ../../genrst/builtin_types.rst:205 +msgid "bytes() with keywords not implemented" +msgstr "未实现带有关键字的 bytes() 方法" + +#: ../../genrst/builtin_types.rst:207 +msgid "" +"**Workaround:** Pass the encoding as a positional parameter, e.g. " +"``print(bytes('abc', 'utf-8'))``" +msgstr "**解决方法:** 将编码作为位置参数传递,例如 ``print(bytes('abc', 'utf-8'))``" + +#: ../../genrst/builtin_types.rst:225 +msgid "Bytes subscription with step != 1 not implemented" +msgstr "未实现step != 1的字节订阅" + +#: ../../genrst/builtin_types.rst:229 +msgid "**Workaround:** Use explicit loop for this very rare operation." +msgstr "**解决方法:** 对于这种非常罕见的操作,请使用显式循环。" + +#: ../../genrst/builtin_types.rst:245 +msgid "complex" +msgstr "complex" + +#: ../../genrst/builtin_types.rst:250 +msgid "" +"MicroPython's complex() accepts certain incorrect values that CPython " +"rejects" +msgstr "MicroPython 的 complex() 接受 CPython 拒绝的某些不正确的值" + +#: ../../genrst/builtin_types.rst:254 +msgid "" +"**Workaround:** Do not use non-standard complex literals as argument to " +"complex()" +msgstr "**解决方法:** 不要使用非标准的复数字面量作为 complex() 的参数" + +#: ../../genrst/builtin_types.rst:256 +msgid "" +"MicroPython's ``complex()`` function accepts literals that contain a " +"space and no sign between the real and imaginary parts, and interprets it" +" as a plus." +msgstr "MicroPython 的 ``complex()`` 函数接受实部和虚部之间包含空格且没有符号的字面量,并将其解释为加号。" + +#: ../../genrst/builtin_types.rst:276 +msgid "dict" +msgstr "字典" + +#: ../../genrst/builtin_types.rst:281 +msgid "Dictionary keys view does not behave as a set." +msgstr "字典键视图的行为不像集合。" + +#: ../../genrst/builtin_types.rst:283 +msgid "**Cause:** Not implemented." +msgstr "**原因:** 未实现。" + +#: ../../genrst/builtin_types.rst:285 +msgid "" +"**Workaround:** Explicitly convert keys to a set before using set " +"operations." +msgstr "**解决方法:** 在使用集合操作之前,将键明确转换为集合。" + +#: ../../genrst/builtin_types.rst:301 +msgid "float" +msgstr "float" + +#: ../../genrst/builtin_types.rst:306 +msgid "" +"uPy allows implicit conversion of objects in maths operations while " +"CPython does not." +msgstr "uPy 允许在数学运算中对对象进行隐式转换,而 CPython 不允许。" + +#: ../../genrst/builtin_types.rst:308 +msgid "" +"**Workaround:** Objects should be wrapped in ``float(obj)`` for " +"compatibility with CPython." +msgstr "**解决方法:** 为了与 CPython 兼容,应将对象包装在 ``float(obj)`` 中。" + +#: ../../genrst/builtin_types.rst:332 +msgid "int" +msgstr "int" + +#: ../../genrst/builtin_types.rst:337 +msgid "``bit_length`` method doesn't exist." +msgstr "``bit_length`` 方法不存在。" + +#: ../../genrst/builtin_types.rst:339 +msgid "**Cause:** bit_length method is not implemented." +msgstr "**原因:** 未实现 bit_length 方法。" + +#: ../../genrst/builtin_types.rst:341 +msgid "**Workaround:** Avoid using this method on MicroPython." +msgstr "**解决方法:** 在 MicroPython 上避免使用此方法。" + +#: ../../genrst/builtin_types.rst:360 +msgid "No int conversion for int-derived types available" +msgstr "int 派生类型的 int 转换不可用" + +#: ../../genrst/builtin_types.rst:362 +msgid "" +"**Workaround:** Avoid subclassing builtin types unless really needed. " +"Prefer https://en.wikipedia.org/wiki/Composition_over_inheritance ." +msgstr "" +"**解决方法:** 除非真正需要,避免对内置类型进行子类化。更倾向于使用 " +"https://en.wikipedia.org/wiki/Composition_over_inheritance 。" + +#: ../../genrst/builtin_types.rst:386 +msgid "``to_bytes`` method doesn't implement signed parameter." +msgstr "``to_bytes`` 方法未实现 signed 参数。" + +#: ../../genrst/builtin_types.rst:388 +msgid "" +"**Cause:** The ``signed`` keyword-only parameter is not implemented for " +"``int.to_bytes()``." +msgstr "**原因:** ``int.to_bytes()`` 未实现 ``signed`` 仅关键字参数。" + +#: ../../genrst/builtin_types.rst:390 +msgid "" +"When the integer is negative, MicroPython behaves the same as CPython " +"``int.to_bytes(..., signed=True)``" +msgstr "当整数为负数时,MicroPython 的行为与 CPython 的 ``int.to_bytes(..., signed=True)`` 相同" + +#: ../../genrst/builtin_types.rst:392 +msgid "" +"When the integer is non-negative, MicroPython behaves the same as CPython" +" ``int.to_bytes(..., signed=False)``." +msgstr "" +"当整数为非负数时,MicroPython 的行为与 CPython 的 ``int.to_bytes(..., signed=False)`` " +"相同。" + +#: ../../genrst/builtin_types.rst:394 +msgid "" +"(The difference is subtle, but in CPython a positive integer converted " +"with ``signed=True`` may require one byte more in the output length, in " +"order to fit the 0 sign bit.)" +msgstr "(差异很细微,但在 CPython 中,使用 ``signed=True`` 转换正整数可能需要在输出长度中多一个字节,以容纳 0 符号位。)" + +#: ../../genrst/builtin_types.rst:396 +msgid "" +"**Workaround:** Take care when calling ``to_bytes()`` on an integer value" +" which may be negative." +msgstr "**解决方法:** 在可能为负数的整数值上调用 ``to_bytes()`` 时要注意。" + +#: ../../genrst/builtin_types.rst:415 +msgid "list" +msgstr "list" + +#: ../../genrst/builtin_types.rst:420 +msgid "List delete with step != 1 not implemented" +msgstr "未实现step != 1 的列表删除" + +#: ../../genrst/builtin_types.rst:422 ../../genrst/builtin_types.rst:468 +msgid "**Workaround:** Use explicit loop for this rare operation." +msgstr "**解决方法:** 对于此罕见操作,请使用显式循环。" + +#: ../../genrst/builtin_types.rst:442 +msgid "List slice-store with non-iterable on RHS is not implemented" +msgstr "未实现 RHS 上不可迭代的列表切片存储" + +#: ../../genrst/builtin_types.rst:444 +msgid "**Cause:** RHS is restricted to be a tuple or list" +msgstr "**原因:** RHS 受限于为元组或列表" + +#: ../../genrst/builtin_types.rst:446 +msgid "" +"**Workaround:** Use ``list()`` on RHS to convert the iterable to a " +"list" +msgstr "**解决方法:** 在 RHS 上使用 ``list()`` 将可迭代对象转换为列表" + +#: ../../genrst/builtin_types.rst:466 +msgid "List store with step != 1 not implemented" +msgstr "未实现step != 1 的列表存储" + +#: ../../genrst/builtin_types.rst:486 +msgid "memoryview" +msgstr "memoryview" + +#: ../../genrst/builtin_types.rst:491 +msgid "memoryview can become invalid if its target is resized" +msgstr "如果目标被调整大小,memoryview 可能会变为无效" + +#: ../../genrst/builtin_types.rst:493 +msgid "" +"**Cause:** CPython prevents a ``bytearray`` or ``io.bytesIO`` object from" +" changing size while there is a ``memoryview`` object that references it." +" MicroPython requires the programmer to manually ensure that an object is" +" not resized while any ``memoryview`` references it." +msgstr "" +"**原因:** CPython 会阻止 ``bytearray`` 或 ``io.bytesIO`` 对象在有 ``memoryview`` " +"对象引用它时改变大小。MicroPython 要求程序员手动确保在任何 ``memoryview`` 引用对象时不调整其大小。" + +#: ../../genrst/builtin_types.rst:495 +msgid "" +"In the worst case scenario, resizing an object which is the target of a " +"memoryview can cause the memoryview(s) to reference invalid freed memory " +"(a use-after-free bug) and corrupt the MicroPython runtime." +msgstr "" +"在最坏的情况下,调整作为 memoryview 目标的对象的大小可能导致 memoryview 引用无效的已释放内存(释放后使用漏洞),并破坏 " +"MicroPython 运行时。" + +#: ../../genrst/builtin_types.rst:497 +msgid "" +"**Workaround:** Do not change the size of any ``bytearray`` or " +"``io.bytesIO`` object that has a ``memoryview`` assigned to it." +msgstr "" +"**解决方法:** 不要更改任何已分配了 ``memoryview`` 的 ``bytearray`` 或 ``io.bytesIO`` " +"对象的大小。" + +#: ../../genrst/builtin_types.rst:518 +msgid "str" +msgstr "str" + +#: ../../genrst/builtin_types.rst:523 +msgid "" +"MicroPython accepts the \",\" grouping option with any radix, unlike " +"CPython" +msgstr "与 CPython 不同,MicroPython 接受 \",\" 分组选项与任何基数的组合" + +#: ../../genrst/builtin_types.rst:525 +msgid "" +"**Cause:** To reduce code size, MicroPython does not issue an error for " +"this combination" +msgstr "**原因:** 为了减少代码大小,MicroPython 不会对此组合发出错误" + +#: ../../genrst/builtin_types.rst:527 +#, python-brace-format +msgid "" +"**Workaround:** Do not use a format string like ``{:,b}`` if CPython " +"compatibility is required." +msgstr "**解决方法:** 如果需要 CPython 兼容性,请不要使用类似 ``{:,b}`` 的格式字符串。" + +#: ../../genrst/builtin_types.rst:558 +msgid "Attributes/subscr not implemented" +msgstr "未实现属性/订阅" + +#: ../../genrst/builtin_types.rst:576 +msgid "str(...) with keywords not implemented" +msgstr "未实现带关键字的 str(...) 方法" + +#: ../../genrst/builtin_types.rst:578 +msgid "" +"**Workaround:** Input the encoding format directly. eg " +"``print(bytes('abc', 'utf-8'))``" +msgstr "**解决方法:** 直接输入编码格式。例如 ``print(bytes('abc', 'utf-8'))``" + +#: ../../genrst/builtin_types.rst:596 +msgid "str.ljust() and str.rjust() not implemented" +msgstr "未实现str.ljust() 和 str.rjust()" + +#: ../../genrst/builtin_types.rst:598 +msgid "" +"**Cause:** MicroPython is highly optimized for memory usage. Easy " +"workarounds available." +msgstr "**原因:** MicroPython 高度优化了内存使用。提供了简单的解决方法。" + +#: ../../genrst/builtin_types.rst:600 +#, python-brace-format, python-format +msgid "" +"**Workaround:** Instead of ``s.ljust(10)`` use ``\"%-10s\" % s``, instead" +" of ``s.rjust(10)`` use ``\"% 10s\" % s``. Alternatively, " +"``\"{:<10}\".format(s)`` or ``\"{:>10}\".format(s)``." +msgstr "" +"**解决方法:** 使用 ``\"%-10s\" % s`` 代替 ``s.ljust(10)``,使用 ``\"% 10s\" % s`` 代替" +" ``s.rjust(10)``。或者,使用 ``\"{:<10}\".format(s)`` 或 " +"``\"{:>10}\".format(s)``。" + +#: ../../genrst/builtin_types.rst:618 +msgid "" +"None as first argument for rsplit such as str.rsplit(None, n) not " +"implemented" +msgstr "将 None 作为 rsplit 的第一个参数(例如 str.rsplit(None, n))未实现" + +#: ../../genrst/builtin_types.rst:636 +msgid "Subscript with step != 1 is not yet implemented" +msgstr "带步长的下标!=1尚未实现" + +#: ../../genrst/builtin_types.rst:652 +msgid "tuple" +msgstr "元组" + +#: ../../genrst/builtin_types.rst:657 +msgid "Tuple load with step != 1 not implemented" +msgstr "尚未实现步长不等于 1 的元组加载" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/genrst/core_language.po b/docs/locale/zh_CN/LC_MESSAGES/genrst/core_language.po new file mode 100644 index 0000000000000..9870070ca5af2 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/genrst/core_language.po @@ -0,0 +1,316 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-08 00:15+0800\n" +"PO-Revision-Date: 2024-07-06 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../genrst/core_language.rst:4 +msgid "Core language" +msgstr "核心语言" + +#: ../../genrst/core_language.rst:7 +#, fuzzy +msgid "Generated Sat 07 Mar 2026 16:15:41 UTC" +msgstr "生成于2026年3月7日星期六 04:35:17 UTC" + +#: ../../genrst/core_language.rst:10 +msgid "Classes" +msgstr "类" + +#: ../../genrst/core_language.rst:15 +msgid "Special method __del__ not implemented for user-defined classes" +msgstr "用户定义类的特殊方法 __del__ 未实现" + +#: ../../genrst/core_language.rst:17 ../../genrst/core_language.rst:50 +#: ../../genrst/core_language.rst:83 ../../genrst/core_language.rst:127 +#: ../../genrst/core_language.rst:173 ../../genrst/core_language.rst:218 +#: ../../genrst/core_language.rst:257 ../../genrst/core_language.rst:282 +#: ../../genrst/core_language.rst:309 ../../genrst/core_language.rst:336 +#: ../../genrst/core_language.rst:385 ../../genrst/core_language.rst:411 +#: ../../genrst/core_language.rst:446 ../../genrst/core_language.rst:476 +#: ../../genrst/core_language.rst:500 ../../genrst/core_language.rst:525 +#: ../../genrst/core_language.rst:549 +msgid "Sample code::" +msgstr "示例代码::" + +#: ../../genrst/core_language.rst:34 ../../genrst/core_language.rst:67 +#: ../../genrst/core_language.rst:107 ../../genrst/core_language.rst:156 +#: ../../genrst/core_language.rst:203 ../../genrst/core_language.rst:238 +#: ../../genrst/core_language.rst:266 ../../genrst/core_language.rst:293 +#: ../../genrst/core_language.rst:321 ../../genrst/core_language.rst:364 +#: ../../genrst/core_language.rst:397 ../../genrst/core_language.rst:426 +#: ../../genrst/core_language.rst:457 ../../genrst/core_language.rst:483 +#: ../../genrst/core_language.rst:506 ../../genrst/core_language.rst:533 +#: ../../genrst/core_language.rst:563 +msgid "CPy output:" +msgstr "CPy输出:" + +#: ../../genrst/core_language.rst:34 ../../genrst/core_language.rst:67 +#: ../../genrst/core_language.rst:107 ../../genrst/core_language.rst:156 +#: ../../genrst/core_language.rst:203 ../../genrst/core_language.rst:238 +#: ../../genrst/core_language.rst:266 ../../genrst/core_language.rst:293 +#: ../../genrst/core_language.rst:321 ../../genrst/core_language.rst:364 +#: ../../genrst/core_language.rst:397 ../../genrst/core_language.rst:426 +#: ../../genrst/core_language.rst:457 ../../genrst/core_language.rst:483 +#: ../../genrst/core_language.rst:506 ../../genrst/core_language.rst:533 +#: ../../genrst/core_language.rst:563 +msgid "uPy output:" +msgstr "uPy输出:" + +#: ../../genrst/core_language.rst:44 +msgid "Method Resolution Order (MRO) is not compliant with CPython" +msgstr "方法解析顺序(MRO)不符合 CPython" + +#: ../../genrst/core_language.rst:46 +msgid "**Cause:** Depth first non-exhaustive method resolution order" +msgstr "**原因:** 深度优先非穷尽方法解析顺序" + +#: ../../genrst/core_language.rst:48 +msgid "" +"**Workaround:** Avoid complex class hierarchies with multiple inheritance" +" and complex method overrides. Keep in mind that many languages don't " +"support multiple inheritance at all." +msgstr "**解决方法:** 避免具有多重继承和复杂方法重写的复杂类层次结构。请记住,许多语言根本不支持多重继承。" + +#: ../../genrst/core_language.rst:77 +msgid "Private Class Members name mangling is not implemented" +msgstr "私有类成员的名称修饰未实现" + +#: ../../genrst/core_language.rst:79 +msgid "" +"**Cause:** The MicroPython compiler does not implement name mangling for " +"private class members." +msgstr "**原因:** MicroPython 编译器未实现私有类成员的名称修饰。" + +#: ../../genrst/core_language.rst:81 +msgid "" +"**Workaround:** Avoid using or having a collision with global names, by " +"adding a unique prefix to the private class member name manually." +msgstr "**解决方法:** 通过手动为私有类成员名称添加唯一前缀,避免与全局名称发生冲突。" + +#: ../../genrst/core_language.rst:121 +msgid "" +"When inheriting native types, calling a method in ``__init__(self, ...)``" +" before ``super().__init__()`` raises an ``AttributeError`` (or segfaults" +" if ``MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG`` is not enabled)." +msgstr "" +"继承原生类型时,在 ``super().__init__()`` 之前在 ``__init__(self, ...)`` 中调用方法会引发 " +"``AttributeError``(如果未启用 ``MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG`` " +"则会导致段错误)。" + +#: ../../genrst/core_language.rst:123 +msgid "" +"**Cause:** MicroPython does not have separate ``__new__`` and " +"``__init__`` methods in native types." +msgstr "**原因:** MicroPython 在原生类型中没有单独的 ``__new__`` 和 ``__init__`` 方法。" + +#: ../../genrst/core_language.rst:125 +msgid "**Workaround:** Call ``super().__init__()`` first." +msgstr "**解决方法:** 先调用 ``super().__init__()``。" + +#: ../../genrst/core_language.rst:167 +msgid "When inheriting from multiple classes super() only calls one class" +msgstr "从多个类继承时,super() 只调用一个类" + +#: ../../genrst/core_language.rst:169 +msgid "**Cause:** See :ref:`cpydiff_core_class_mro`" +msgstr "**原因:** 见 :ref:`cpydiff_core_class_mro`" + +#: ../../genrst/core_language.rst:171 +msgid "**Workaround:** See :ref:`cpydiff_core_class_mro`" +msgstr "**解决方法:** 见 :ref:`cpydiff_core_class_mro`" + +#: ../../genrst/core_language.rst:216 +msgid "" +"Calling super() getter property in subclass will return a property " +"object, not the value" +msgstr "在子类中调用 super() getter 属性将返回一个属性对象,而不是值" + +#: ../../genrst/core_language.rst:246 +msgid "Functions" +msgstr "函数" + +#: ../../genrst/core_language.rst:251 +msgid "Error messages for methods may display unexpected argument counts" +msgstr "方法的错误消息可能显示意外的参数计数" + +#: ../../genrst/core_language.rst:253 +msgid "**Cause:** MicroPython counts \"self\" as an argument." +msgstr "**原因:** MicroPython 将 \"self\" 作为参数计算。" + +#: ../../genrst/core_language.rst:255 +msgid "" +"**Workaround:** Interpret error messages with the information above in " +"mind." +msgstr "**解决方法:** 根据以上信息解释错误消息。" + +#: ../../genrst/core_language.rst:276 +msgid "Function objects do not have the ``__module__`` attribute" +msgstr "函数对象没有 ``__module__`` 属性" + +#: ../../genrst/core_language.rst:278 +msgid "**Cause:** MicroPython is optimized for reduced code size and RAM usage." +msgstr "**原因:** MicroPython 为了减少代码大小和 RAM 使用量进行了优化。" + +#: ../../genrst/core_language.rst:280 +msgid "" +"**Workaround:** Use ``sys.modules[function.__globals__['__name__']]`` for" +" non-builtin modules." +msgstr "**解决方法:** 对于非内置模块,使用 ``sys.modules[function.__globals__['__name__']]``。" + +#: ../../genrst/core_language.rst:303 +msgid "User-defined attributes for functions are not supported" +msgstr "不支持函数的用户定义属性" + +#: ../../genrst/core_language.rst:305 +msgid "**Cause:** MicroPython is highly optimized for memory usage." +msgstr "**原因:** MicroPython 对内存使用进行了高度优化。" + +#: ../../genrst/core_language.rst:307 +msgid "**Workaround:** Use external dictionary, e.g. ``FUNC_X[f] = 0``." +msgstr "**解决方法:** 使用外部字典,例如 ``FUNC_X[f] = 0``。" + +#: ../../genrst/core_language.rst:329 +msgid "Generator" +msgstr "生成器" + +#: ../../genrst/core_language.rst:334 +msgid "" +"Context manager __exit__() not called in a generator which does not run " +"to completion" +msgstr "在不完全运行的生成器中,上下文管理器 __exit__() 不会被调用" + +#: ../../genrst/core_language.rst:376 +msgid "Runtime" +msgstr "运行时" + +#: ../../genrst/core_language.rst:381 +msgid "Local variables aren't included in locals() result" +msgstr "局部变量不包括在 locals() 结果中" + +#: ../../genrst/core_language.rst:383 +msgid "" +"**Cause:** MicroPython doesn't maintain symbolic local environment, it is" +" optimized to an array of slots. Thus, local variables can't be accessed " +"by a name." +msgstr "**原因:** MicroPython 不维护符号局部环境,它被优化为一个插槽数组。因此,局部变量不能通过名称访问。" + +#: ../../genrst/core_language.rst:407 +msgid "Code running in eval() function doesn't have access to local variables" +msgstr "在 eval() 函数中运行的代码无法访问局部变量" + +#: ../../genrst/core_language.rst:409 +msgid "" +"**Cause:** MicroPython doesn't maintain symbolic local environment, it is" +" optimized to an array of slots. Thus, local variables can't be accessed " +"by a name. Effectively, ``eval(expr)`` in MicroPython is equivalent to " +"``eval(expr, globals(), globals())``." +msgstr "" +"**原因:** MicroPython " +"不维护符号局部环境,它被优化为一个插槽数组。因此,局部变量不能通过名称访问。从效果上讲,MicroPython 中的 ``eval(expr)``" +" 相当于 ``eval(expr, globals(), globals())``。" + +#: ../../genrst/core_language.rst:435 +msgid "f-strings" +msgstr "f-strings" + +#: ../../genrst/core_language.rst:440 +msgid "" +"f-strings don't support concatenation with adjacent literals if the " +"adjacent literals contain braces" +msgstr "f-strings 不支持与相邻字面量的拼接,如果相邻字面量包含大括号" + +#: ../../genrst/core_language.rst:442 ../../genrst/core_language.rst:472 +msgid "**Cause:** MicroPython is optimised for code space." +msgstr "**原因:** MicroPython 优化了代码空间。" + +#: ../../genrst/core_language.rst:444 +msgid "" +"**Workaround:** Use the + operator between literal strings when they are " +"not both f-strings" +msgstr "**解决方法:** 当字面量字符串不都是 f-strings 时,使用 + 操作符连接它们" + +#: ../../genrst/core_language.rst:470 +msgid "" +"f-strings cannot support expressions that require parsing to resolve " +"unbalanced nested braces and brackets" +msgstr "f-strings 无法支持需要解析来解决不平衡嵌套大括号和方括号的表达式" + +#: ../../genrst/core_language.rst:474 +msgid "" +"**Workaround:** Always use balanced braces and brackets in expressions " +"inside f-strings" +msgstr "**解决方法:** 在 f-strings 内的表达式中始终使用平衡的大括号和方括号" + +#: ../../genrst/core_language.rst:494 +msgid "f-strings don't support !a conversions" +msgstr "f-strings 不支持 !a 转换" + +#: ../../genrst/core_language.rst:496 +msgid "**Cause:** MicropPython does not implement ascii()" +msgstr "**原因:** MicroPython 未实现 ascii()" + +#: ../../genrst/core_language.rst:498 +msgid "**Workaround:** None" +msgstr "**解决方法:** 无" + +#: ../../genrst/core_language.rst:514 +msgid "import" +msgstr "导入" + +#: ../../genrst/core_language.rst:519 +msgid "" +"__path__ attribute of a package has a different type (single string " +"instead of list of strings) in MicroPython" +msgstr "在 MicroPython 中,包的 __path__ 属性具有不同的类型(单个字符串而不是字符串列表)" + +#: ../../genrst/core_language.rst:521 +msgid "" +"**Cause:** MicroPython doesn't support namespace packages split across " +"filesystem. Beyond that, MicroPython's import system is highly optimized " +"for minimal memory usage." +msgstr "**原因:** MicroPython 不支持跨文件系统拆分的命名空间包。此外,MicroPython 的导入系统针对最小内存使用量进行了高度优化。" + +#: ../../genrst/core_language.rst:523 +msgid "" +"**Workaround:** Details of import handling is inherently implementation " +"dependent. Don't rely on such details in portable applications." +msgstr "**解决方法:** 导入处理的详细信息在本质上是与实现相关的。在可移植应用程序中不要依赖此类详细信息。" + +#: ../../genrst/core_language.rst:543 +msgid "MicroPython doesn't support namespace packages split across filesystem." +msgstr "MicroPython 不支持跨文件系统拆分命名空间包。" + +#: ../../genrst/core_language.rst:545 +msgid "" +"**Cause:** MicroPython's import system is highly optimized for " +"simplicity, minimal memory usage, and minimal filesystem search overhead." +msgstr "**原因:** MicroPython 的导入系统针对简单性、最小内存使用量和最小文件系统搜索开销进行了高度优化。" + +#: ../../genrst/core_language.rst:547 +msgid "" +"**Workaround:** Don't install modules belonging to the same namespace " +"package in different directories. For MicroPython, it's recommended to " +"have at most 3-component module search paths: for your current " +"application, per-user (writable), system-wide (non-writable)." +msgstr "" +"**解决方法:** 不要在不同目录中安装属于同一命名空间包的模块。对于 MicroPython,建议最多具有 3 " +"个组件的模块搜索路径:对于当前应用程序、每个用户(可写)和系统范围(非可写)。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/genrst/index.po b/docs/locale/zh_CN/LC_MESSAGES/genrst/index.po new file mode 100644 index 0000000000000..1ffa774d1ee6b --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/genrst/index.po @@ -0,0 +1,45 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-25 01:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../genrst/index.rst:6 +msgid "MicroPython differences from CPython" +msgstr "MicroPython与CPython的区别" + +#: ../../genrst/index.rst:8 +msgid "" +"MicroPython implements Python 3.4 and some select features of Python 3.5 " +"and above. The sections below describe the current status of these " +"features." +msgstr "MicroPython实现了Python 3.4以及Python 3." +"5及以上版本的部分特性。以下各节描述了这些特性的当前状态。" + +#: ../../genrst/index.rst:20 +msgid "" +"For the features of Python that are implemented by MicroPython, there are" +" sometimes differences in their behaviour compared to standard Python. " +"The operations listed in the sections below produce conflicting results " +"in MicroPython when compared to standard Python." +msgstr "" +"对于MicroPython实现的Python特性,其行为有时与标准Python存在差异。以下各节列出" +"的操作在与标准Python比较时在MicroPython中产生冲突的结果。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/genrst/modules.po b/docs/locale/zh_CN/LC_MESSAGES/genrst/modules.po new file mode 100644 index 0000000000000..eb4f1368cd51e --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/genrst/modules.po @@ -0,0 +1,263 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-08 00:15+0800\n" +"PO-Revision-Date: 2024-06-25 01:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../genrst/modules.rst:4 +msgid "Modules" +msgstr "模块" + +#: ../../genrst/modules.rst:7 +#, fuzzy +msgid "Generated Sat 07 Mar 2026 16:15:41 UTC" +msgstr "生成于 2026 年 3 月 7 日星期六 04:35:17 UTC" + +#: ../../genrst/modules.rst:12 +msgid "Positional-only Parameters" +msgstr "仅位置参数" + +#: ../../genrst/modules.rst:14 +msgid "" +"To save code size, many functions that accept keyword arguments in " +"CPython only accept positional arguments in MicroPython." +msgstr "为了节省代码大小,许多在 CPython 中接受关键字参数的函数在 MicroPython 中仅接受位置参数。" + +#: ../../genrst/modules.rst:16 +msgid "" +"MicroPython marks positional-only parameters in the same way as CPython, " +"by inserting a ``/`` to mark the end of the positional parameters. Any " +"function whose signature ends in ``/`` takes *only* positional arguments." +" For more details, see `PEP 570 `_." +msgstr "" +"MicroPython 与 CPython 以相同的方式标记仅位置参数,通过插入 ``/`` 来标记位置参数的结束。任何签名以 ``/`` " +"结尾的函数 *仅* 接受位置参数。更多详情,请参见 `PEP 570 `_。" + +#: ../../genrst/modules.rst:19 +msgid "Example" +msgstr "示例" + +#: ../../genrst/modules.rst:21 +msgid "" +"For example, in CPython 3.4 this is the signature of the constructor " +"``socket.socket``::" +msgstr "例如,在 CPython 3.4 中,构造函数 ``socket.socket`` 的签名如下::" + +#: ../../genrst/modules.rst:25 +msgid "" +"However, the signature documented in :func:`MicroPython` " +"is::" +msgstr "然而,:func:`MicroPython` 中记录的签名为::" + +#: ../../genrst/modules.rst:29 +msgid "" +"The ``/`` at the end of the parameters indicates that they are all " +"positional-only in MicroPython. The following code works in CPython but " +"not in most MicroPython ports::" +msgstr "" +"参数末尾的 ``/`` 表示它们在 MicroPython 中都是仅位置参数。以下代码在 CPython 中可以运行,但在大多数 " +"MicroPython 端口中不行::" + +#: ../../genrst/modules.rst:34 +msgid "MicroPython will raise an exception::" +msgstr "MicroPython 将引发异常::" + +#: ../../genrst/modules.rst:38 +msgid "The following code will work in both CPython and MicroPython::" +msgstr "以下代码在 CPython 和 MicroPython 中都可以运行::" + +#: ../../genrst/modules.rst:44 +msgid "array" +msgstr "array" + +#: ../../genrst/modules.rst:49 +msgid "Comparison between different typecodes not supported" +msgstr "不支持不同类型代码的比较" + +#: ../../genrst/modules.rst:51 +msgid "**Cause:** Code size" +msgstr "**原因:** 代码大小" + +#: ../../genrst/modules.rst:53 +msgid "**Workaround:** Compare individual elements" +msgstr "**解决方法:** 逐个比较元素" + +#: ../../genrst/modules.rst:55 ../../genrst/modules.rst:79 +#: ../../genrst/modules.rst:102 ../../genrst/modules.rst:122 +#: ../../genrst/modules.rst:144 ../../genrst/modules.rst:168 +#: ../../genrst/modules.rst:196 ../../genrst/modules.rst:227 +#: ../../genrst/modules.rst:257 ../../genrst/modules.rst:283 +#: ../../genrst/modules.rst:308 ../../genrst/modules.rst:332 +#: ../../genrst/modules.rst:360 ../../genrst/modules.rst:390 +msgid "Sample code::" +msgstr "示例代码::" + +#: ../../genrst/modules.rst:63 ../../genrst/modules.rst:88 +#: ../../genrst/modules.rst:110 ../../genrst/modules.rst:132 +#: ../../genrst/modules.rst:153 ../../genrst/modules.rst:179 +#: ../../genrst/modules.rst:212 ../../genrst/modules.rst:237 +#: ../../genrst/modules.rst:267 ../../genrst/modules.rst:293 +#: ../../genrst/modules.rst:320 ../../genrst/modules.rst:344 +#: ../../genrst/modules.rst:372 ../../genrst/modules.rst:399 +msgid "CPy output:" +msgstr "CPy输出:" + +#: ../../genrst/modules.rst:63 ../../genrst/modules.rst:88 +#: ../../genrst/modules.rst:110 ../../genrst/modules.rst:132 +#: ../../genrst/modules.rst:153 ../../genrst/modules.rst:179 +#: ../../genrst/modules.rst:212 ../../genrst/modules.rst:237 +#: ../../genrst/modules.rst:267 ../../genrst/modules.rst:293 +#: ../../genrst/modules.rst:320 ../../genrst/modules.rst:344 +#: ../../genrst/modules.rst:372 ../../genrst/modules.rst:399 +msgid "uPy output:" +msgstr "uPy输出:" + +#: ../../genrst/modules.rst:73 +msgid "Overflow checking is not implemented" +msgstr "溢出检查未实现" + +#: ../../genrst/modules.rst:75 +msgid "" +"**Cause:** MicroPython implements implicit truncation in order to reduce " +"code size and execution time" +msgstr "**原因:** MicroPython 实现了隐式截断以减小代码大小和执行时间" + +#: ../../genrst/modules.rst:77 +msgid "" +"**Workaround:** If CPython compatibility is needed then mask the value " +"explicitly" +msgstr "**解决方法:** 如果需要兼容 CPython,则显式地对值进行掩码处理" + +#: ../../genrst/modules.rst:100 +msgid "Looking for integer not implemented" +msgstr "查找整数未实现" + +#: ../../genrst/modules.rst:120 +msgid "Array deletion not implemented" +msgstr "未实现数组删除" + +#: ../../genrst/modules.rst:142 +msgid "Subscript with step != 1 is not yet implemented" +msgstr "带步长的下标!=1尚未实现" + +#: ../../genrst/modules.rst:161 +msgid "json" +msgstr "json" + +#: ../../genrst/modules.rst:166 +msgid "JSON module does not throw exception when object is not serialisable" +msgstr "当对象不可序列化时,JSON 模块不会抛出异常" + +#: ../../genrst/modules.rst:187 +msgid "os" +msgstr "os" + +#: ../../genrst/modules.rst:192 +msgid "``environ`` attribute is not implemented" +msgstr "未实现 ``environ`` 属性" + +#: ../../genrst/modules.rst:194 +msgid "**Workaround:** Use ``getenv``, ``putenv`` and ``unsetenv``" +msgstr "**解决方法:** 使用 ``getenv``、``putenv`` 和 ``unsetenv``" + +#: ../../genrst/modules.rst:223 +msgid "``getenv`` returns actual value instead of cached value" +msgstr "``getenv`` 返回实际值而不是缓存值" + +#: ../../genrst/modules.rst:225 +msgid "**Cause:** The ``environ`` attribute is not implemented" +msgstr "**原因:** ``environ`` 属性未实现" + +#: ../../genrst/modules.rst:246 +msgid "random" +msgstr "random" + +#: ../../genrst/modules.rst:251 +msgid "``getrandbits`` method can only return a maximum of 32 bits at a time." +msgstr "``getrandbits`` 方法一次只能返回最多 32 位。" + +#: ../../genrst/modules.rst:253 +msgid "" +"**Cause:** PRNG's internal state is only 32bits so it can only return a " +"maximum of 32 bits of data at a time." +msgstr "**原因:** PRNG 的内部状态只有 32 位,因此一次只能返回最多 32 位的数据。" + +#: ../../genrst/modules.rst:255 +msgid "" +"**Workaround:** If you need a number that has more than 32 bits then " +"utilize the random module from micropython-lib." +msgstr "**解决方法:** 如果需要超过 32 位的数字,则使用 micropython-lib 中的 random 模块。" + +#: ../../genrst/modules.rst:277 +msgid "" +"``randint`` method can only return an integer that is at most the native " +"word size." +msgstr "``randint`` 方法只能返回一个最多为本地字大小的整数。" + +#: ../../genrst/modules.rst:279 +msgid "" +"**Cause:** PRNG is only able to generate 32 bits of state at a time. The " +"result is then cast into a native sized int instead of a full int object." +msgstr "**原因:** PRNG 一次只能生成 32 位的状态。然后将结果转换为本地大小的 int,而不是完整的 int 对象。" + +#: ../../genrst/modules.rst:281 +msgid "" +"**Workaround:** If you need integers larger than native wordsize use the " +"random module from micropython-lib." +msgstr "**解决方法:** 如果需要大于本地字大小的整数,请使用 micropython-lib 中的 random 模块。" + +#: ../../genrst/modules.rst:301 +msgid "struct" +msgstr "struct" + +#: ../../genrst/modules.rst:306 +msgid "Struct pack with too few args, not checked by uPy" +msgstr "结构化打包参数过少,uPy 不会检查" + +#: ../../genrst/modules.rst:330 +msgid "Struct pack with too many args, not checked by uPy" +msgstr "结构化打包参数过多,uPy 不会检查" + +#: ../../genrst/modules.rst:354 +msgid "" +"Struct pack with whitespace in format, whitespace ignored by CPython, " +"error on uPy" +msgstr "结构化打包格式中包含空格,CPython 忽略空格,uPy 报错" + +#: ../../genrst/modules.rst:356 +msgid "**Cause:** MicroPython is optimised for code size." +msgstr "**原因:** MicroPython 优化了代码空间。" + +#: ../../genrst/modules.rst:358 +msgid "**Workaround:** Don't use spaces in format strings." +msgstr "**解决方法:** 不要在格式字符串中使用空格。" + +#: ../../genrst/modules.rst:381 +msgid "sys" +msgstr "sys" + +#: ../../genrst/modules.rst:386 +msgid "Overriding sys.stdin, sys.stdout and sys.stderr not possible" +msgstr "无法覆盖 sys.stdin、sys.stdout 和 sys.stderr" + +#: ../../genrst/modules.rst:388 +msgid "**Cause:** They are stored in read-only memory." +msgstr "**原因:** 它们存储在只读内存中。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/genrst/syntax.po b/docs/locale/zh_CN/LC_MESSAGES/genrst/syntax.po new file mode 100644 index 0000000000000..0563db8032850 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/genrst/syntax.po @@ -0,0 +1,160 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-08 00:15+0800\n" +"PO-Revision-Date: 2024-06-25 01:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../genrst/syntax.rst:4 +msgid "Syntax" +msgstr "语法" + +#: ../../genrst/syntax.rst:7 +#, fuzzy +msgid "Generated Sat 07 Mar 2026 16:15:41 UTC" +msgstr "生成于 2026 年 3 月 7 日星期六 04:35:17 UTC" + +#: ../../genrst/syntax.rst:10 +msgid "Literals" +msgstr "字面量" + +#: ../../genrst/syntax.rst:15 +msgid "MicroPython accepts underscores in numeric literals where CPython doesn't" +msgstr "MicroPython 接受数字字面量中的下划线,而 CPython 不接受" + +#: ../../genrst/syntax.rst:17 ../../genrst/syntax.rst:50 +msgid "**Cause:** Different parser implementation" +msgstr "**原因:** 不同的解析器实现" + +#: ../../genrst/syntax.rst:19 +msgid "" +"MicroPython's tokenizer ignores underscores in numeric literals, while " +"CPython rejects multiple consecutive underscores and underscores after " +"the last digit." +msgstr "MicroPython 的分词器忽略数字字面量中的下划线,而 CPython 拒绝多个连续下划线和最后一位数字后的下划线。" + +#: ../../genrst/syntax.rst:22 +msgid "**Workaround:** Remove the underscores not accepted by CPython." +msgstr "**解决方法:** 移除 CPython 不接受的下划线。" + +#: ../../genrst/syntax.rst:24 ../../genrst/syntax.rst:60 +#: ../../genrst/syntax.rst:107 ../../genrst/syntax.rst:129 +#: ../../genrst/syntax.rst:154 +msgid "Sample code::" +msgstr "示例代码::" + +#: ../../genrst/syntax.rst:37 ../../genrst/syntax.rst:81 +#: ../../genrst/syntax.rst:113 ../../genrst/syntax.rst:135 +#: ../../genrst/syntax.rst:174 +msgid "CPy output:" +msgstr "CPy输出:" + +#: ../../genrst/syntax.rst:37 ../../genrst/syntax.rst:81 +#: ../../genrst/syntax.rst:113 ../../genrst/syntax.rst:135 +#: ../../genrst/syntax.rst:174 +msgid "uPy output:" +msgstr "uPy输出:" + +#: ../../genrst/syntax.rst:48 +msgid "" +"MicroPython requires spaces between literal numbers and keywords or " +"\".\", CPython doesn't" +msgstr "MicroPython 要求在字面数字和关键字或 \".\" 之间加入空格,CPython 不需要" + +#: ../../genrst/syntax.rst:52 +msgid "" +"MicroPython's tokenizer treats a sequence like ``1and`` as a single " +"token, while CPython treats it as two tokens." +msgstr "MicroPython 的分词器将 ``1and`` 这样的序列视为单个标记,而 CPython 将其视为两个标记。" + +#: ../../genrst/syntax.rst:54 +msgid "" +"Since CPython 3.11, when the literal number is followed by a token, this " +"syntax causes a ``SyntaxWarning`` for an \"invalid literal\". When a " +"literal number is followed by a \".\" denoting attribute access, CPython " +"does not warn." +msgstr "" +"从 CPython 3.11 开始,当字面数字后跟标记时,此语法会因“无效字面量”而产生 " +"``SyntaxWarning``。当字面数字后跟表示属性访问的 \".\" 时,CPython 不会发出警告。" + +#: ../../genrst/syntax.rst:56 +msgid "" +"**Workaround:** Add a space between the integer literal and the intended " +"next token." +msgstr "**解决方法:** 在整数字面量和预期的下一个标记之间添加空格。" + +#: ../../genrst/syntax.rst:58 +msgid "This also fixes the ``SyntaxWarning`` in CPython." +msgstr "这同样可以修复 CPython 中的 ``SyntaxWarning``。" + +#: ../../genrst/syntax.rst:96 +msgid "Operators" +msgstr "运算符" + +#: ../../genrst/syntax.rst:101 +msgid "" +"MicroPython allows := to assign to the iteration variable in nested " +"comprehensions, CPython does not." +msgstr "MicroPython 允许使用 := 对嵌套推导式中的迭代变量进行赋值,CPython 不允许。" + +#: ../../genrst/syntax.rst:103 +msgid "" +"**Cause:** MicroPython is optimised for code size. Although it is a " +"syntax error to assign to the iteration variable in a standard " +"comprehension (same as CPython), it doesn't check if an inner nested " +"comprehension assigns to the iteration variable of the outer " +"comprehension." +msgstr "" +"**原因:** MicroPython 针对代码大小进行了优化。虽然在标准推导式中对迭代变量赋值是语法错误(与 CPython " +"相同),但它不会检查内部嵌套推导式是否对外部推导式的迭代变量赋值。" + +#: ../../genrst/syntax.rst:105 +msgid "" +"**Workaround:** Do not use := to assign to the iteration variable of a " +"comprehension." +msgstr "**解决方法:** 不要使用 := 对推导式的迭代变量进行赋值。" + +#: ../../genrst/syntax.rst:122 +msgid "Unicode" +msgstr "Unicode" + +#: ../../genrst/syntax.rst:127 +msgid "Unicode name escapes are not implemented" +msgstr "未实现Unicode名称转义" + +#: ../../genrst/syntax.rst:143 +msgid "Unpacking" +msgstr "解包" + +#: ../../genrst/syntax.rst:148 +msgid "" +"Argument unpacking does not work if the argument being unpacked is the " +"nth or greater argument where n is the number of bits in an MP_SMALL_INT." +msgstr "参数解包在参数被解包的位置是第n个或更大的参数时(其中n是MP_SMALL_INT中的位数),将不起作用。" + +#: ../../genrst/syntax.rst:150 +msgid "" +"**Cause:** The implementation uses an MP_SMALL_INT to flag args that need" +" to be unpacked." +msgstr "**原因:** 实现中使用了 MP_SMALL_INT 来标记需要解包的参数。" + +#: ../../genrst/syntax.rst:152 +msgid "**Workaround:** Use fewer arguments." +msgstr "**解决方法:** 使用更少的参数。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/index.po b/docs/locale/zh_CN/LC_MESSAGES/index.po new file mode 100644 index 0000000000000..551ebf13aee22 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/index.po @@ -0,0 +1,27 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-21 05:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../index.rst:2 +msgid "MicroPython documentation and references" +msgstr "MicroPython文档和参考" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/_thread.po b/docs/locale/zh_CN/LC_MESSAGES/library/_thread.po new file mode 100644 index 0000000000000..ef7e46e295f46 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/_thread.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/_thread.rst:2 +msgid ":mod:`_thread` -- multithreading support" +msgstr ":mod:`_thread` -- 多线程支持" + +#: ../../library/_thread.rst:7 +msgid "|see_cpython_module| :mod:`python:_thread`." +msgstr "|see_cpython_module| :mod:`python:_thread`." + +#: ../../library/_thread.rst:9 +msgid "This module implements multithreading support." +msgstr "这个模块实现了多线程支持。" + +#: ../../library/_thread.rst:11 +msgid "" +"This module is highly experimental and its API is not yet fully settled " +"and not yet described in this documentation." +msgstr "" +"这个模块是高度实验性的,它的API还没有完全确定" +"在本文档中还没有描述。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/array.po b/docs/locale/zh_CN/LC_MESSAGES/library/array.po new file mode 100644 index 0000000000000..44ea49944e1da --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/array.po @@ -0,0 +1,183 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/array.rst:2 +msgid ":mod:`array` -- arrays of numeric data" +msgstr ":mod:`array` -- 数组" + +#: ../../library/array.rst:7 +msgid "|see_cpython_module| :mod:`python:array`." +msgstr "|see_cpython_module| :mod:`python:array`。" + +#: ../../library/array.rst:9 +msgid "" +"Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``, " +"``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the " +"floating-point support)." +msgstr "" +"支持格式编码: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``, ``L``, ``q``, " +"``Q``, ``f``, ``d`` (后两种依赖于浮点支持)。" + +#: ../../library/array.rst:14 +msgid "Classes" +msgstr "类" + +#: ../../library/array.rst:18 +msgid "" +"Create array with elements of given type. Initial contents of the array " +"are given by *iterable*. If it is not provided, an empty array is " +"created." +msgstr "使用给定类型的元素创建数组。数组的初始内容由 *iterable* 给定。若未给定内容,则创建一个空数组。" + +#: ../../library/array.rst:22 +msgid "" +"In addition to the methods below, array objects also implement the buffer" +" protocol. This means the contents of the entire array can be accessed as" +" raw bytes via a `memoryview` or other interfaces which use this " +"protocol." +msgstr "" +"除了以下方法外,数组对象还实现了缓冲区协议。这意味着可以通过 `memoryview` " +"或其他使用此协议的接口以原始字节形式访问整个数组的内容。" + +#: ../../library/array.rst:28 +msgid "Append new element *val* to the end of array, growing it." +msgstr "将 *val* 添加到数组末尾,并扩展数组。" + +#: ../../library/array.rst:32 +msgid "" +"Append new elements as contained in *iterable* to the end of array, " +"growing it." +msgstr "将包含在 *iterable* 中的新元素添加到数组末尾,并扩展数组。" + +#: ../../library/array.rst:37 +msgid "" +"Indexed read of the array, called as ``a[index]`` (where ``a`` is an " +"``array``). Returns a value if *index* is an ``int`` and an ``array`` if " +"*index* is a slice. Negative indices count from the end and " +"``IndexError`` is thrown if the index is out of range." +msgstr "" +"通过索引读取数组,使用 ``a[index]`` 的形式调用(其中 ``a`` 是一个 ``array``)。如果 *index* 是一个 " +"``int``,则返回一个值;如果 *index* 是一个切片,则返回一个 " +"``array``。如果索引为负数,则从末尾计数,如果索引超出范围,则引发 ``IndexError``。" + +#: ../../library/array.rst:42 +msgid "" +"**Note:** ``__getitem__`` cannot be called directly " +"(``a.__getitem__(index)`` fails) and is not present in ``__dict__``, " +"however ``a[index]`` does work." +msgstr "" +"**注意:** 不能直接调用 ``__getitem__`` (``a.__getitem__(index)`` 会失败),也不在 " +"``__dict__`` 中,但是 ``a[index]`` 可以正常工作。" + +#: ../../library/array.rst:47 +msgid "" +"Indexed write into the array, called as ``a[index] = value`` (where ``a``" +" is an ``array``). ``value`` is a single value if *index* is an ``int`` " +"and an ``array`` if *index* is a slice. Negative indices count from the " +"end and ``IndexError`` is thrown if the index is out of range." +msgstr "" +"通过索引写入数组,使用 ``a[index] = value`` 的形式调用(其中 ``a`` 是一个 ``array``)。如果 *index*" +" 是一个 ``int``,则 *value* 是一个值;如果 *index* 是一个切片,则 *value* 是一个 " +"``array``。如果索引为负数,则从末尾计数,如果索引超出范围,则引发 ``IndexError``。" + +#: ../../library/array.rst:51 +msgid "" +"**Note:** ``__setitem__`` cannot be called directly " +"(``a.__setitem__(index, value)`` fails) and is not present in " +"``__dict__``, however ``a[index] = value`` does work." +msgstr "" +"**注意:** 不能直接调用 ``__setitem__`` (``a.__setitem__(index, value)`` 会失败),也不在 " +"``__dict__`` 中,但是 ``a[index] = value`` 可以正常工作。" + +#: ../../library/array.rst:56 +msgid "" +"Returns the number of items in the array, called as ``len(a)`` (where " +"``a`` is an ``array``)." +msgstr "返回数组中的项数,使用 ``len(a)`` 的形式调用(其中 ``a`` 是一个 ``array``)。" + +#: ../../library/array.rst:58 +msgid "" +"**Note:** ``__len__`` cannot be called directly (``a.__len__()`` fails) " +"and the method is not present in ``__dict__``, however ``len(a)`` does " +"work." +msgstr "" +"**注意:** 不能直接调用 ``__len__`` (``a.__len__()`` 会失败),方法也不在 ``__dict__`` 中,但是 " +"``len(a)`` 可以正常工作。" + +#: ../../library/array.rst:63 +msgid "" +"Return a new ``array`` that is the concatenation of the array with " +"*other*, called as ``a + other`` (where ``a`` and *other* are both " +"``arrays``)." +msgstr "" +"返回一个新的 ``array``,它是数组与 *other* 的连接,使用 ``a + other`` 的形式调用(其中 ``a`` 和 " +"*other* 都是 ``arrays``)。" + +#: ../../library/array.rst:66 +msgid "" +"**Note:** ``__add__`` cannot be called directly (``a.__add__(other)`` " +"fails) and is not present in ``__dict__``, however ``a + other`` does " +"work." +msgstr "" +"**注意:** 不能直接调用 ``__add__`` ( ``a.__add__(other)`` 会失败),方法也不在 ``__dict__``" +" 中,但是 ``a + other`` 可以正常工作。" + +#: ../../library/array.rst:71 +msgid "" +"Concatenates the array with *other* in-place, called as ``a += other`` " +"(where ``a`` and *other* are both ``arrays``). Equivalent to " +"``extend(other)``." +msgstr "" +"在原地将数组与 *other* 连接,使用 ``a += other`` 的形式调用(其中 ``a`` 和 *other* 都是 " +"``arrays``)。等效于 ``extend(other)``。" + +#: ../../library/array.rst:74 +msgid "" +"**Note:** ``__iadd__`` cannot be called directly (``a.__iadd__(other)`` " +"fails) and is not present in ``__dict__``, however ``a += other`` does " +"work." +msgstr "" +"**注意:** 不能直接调用 ``__iadd__`` ( ``a.__iadd__(other)`` 会失败),方法也不在 " +"``__dict__`` 中,但是 ``a += other`` 可以正常工作。" + +#: ../../library/array.rst:79 +msgid "" +"Returns the string representation of the array, called as ``str(a)`` or " +"``repr(a)``` (where ``a`` is an ``array``). Returns the string " +"``\"array(, [])\"``, where ```` is the type code " +"letter for the array and ```` is a comma separated list of the " +"elements of the array." +msgstr "" +"返回数组的字符串表示形式,使用 ``str(a)`` 或 ``repr(a)`` 的形式调用(其中 ``a`` 是一个 ``array`` " +")。返回字符串 ``\"array(, [])\"``,其中 ```` " +"是数组的类型代码字母,```` 是数组的元素的逗号分隔列表。" + +#: ../../library/array.rst:84 +msgid "" +"**Note:** ``__repr__`` cannot be called directly (``a.__repr__()`` fails)" +" and is not present in ``__dict__``, however ``str(a)`` and ``repr(a)`` " +"both work." +msgstr "" +"**注意:** 不能直接调用 ``__repr__`` ( ``a.__repr__()`` 会失败),也不在 ``__dict__`` 中,但是" +" ``str(a)`` 和 ``repr(a)`` 都可以正常工作。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/asyncio.po b/docs/locale/zh_CN/LC_MESSAGES/library/asyncio.po new file mode 100644 index 0000000000000..6bad8fbad03f2 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/asyncio.po @@ -0,0 +1,449 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/asyncio.rst:2 +msgid ":mod:`asyncio` --- asynchronous I/O scheduler" +msgstr ":mod:`asyncio` --- 异步 I/O 调度器" + +#: ../../library/asyncio.rst:7 +msgid "" +"|see_cpython_module| `asyncio " +"`_" +msgstr "" +"|see_cpython_module| `asyncio " +"`_" + +#: ../../library/asyncio.rst:10 +msgid "Example::" +msgstr "例子::" + +#: ../../library/asyncio.rst:35 +msgid "Core functions" +msgstr "核心函数" + +#: ../../library/asyncio.rst:39 +msgid "Create a new task from the given coroutine and schedule it to run." +msgstr "从给定的协程创建一个新任务并安排其运行。" + +#: ../../library/asyncio.rst:41 +msgid "Returns the corresponding `Task` object." +msgstr "返回相应的 `Task` 对象。" + +#: ../../library/asyncio.rst:45 +msgid "Return the `Task` object associated with the currently running task." +msgstr "返回当前正在运行的任务关联的 `Task` 对象。" + +#: ../../library/asyncio.rst:49 +msgid "Create a new task from the given coroutine and run it until it completes." +msgstr "从给定的协程创建一个新任务并运行它,直到完成。" + +#: ../../library/asyncio.rst:51 +msgid "Returns the value returned by *coro*." +msgstr "返回 *coro* 返回的值。" + +#: ../../library/asyncio.rst:55 +msgid "Sleep for *t* seconds (can be a float)." +msgstr "休眠 *t* 秒(可以是浮点数)。" + +#: ../../library/asyncio.rst:57 ../../library/asyncio.rst:81 +#: ../../library/asyncio.rst:96 ../../library/asyncio.rst:143 +#: ../../library/asyncio.rst:171 ../../library/asyncio.rst:192 +#: ../../library/asyncio.rst:214 ../../library/asyncio.rst:226 +#: ../../library/asyncio.rst:247 ../../library/asyncio.rst:255 +#: ../../library/asyncio.rst:271 ../../library/asyncio.rst:277 +#: ../../library/asyncio.rst:289 ../../library/asyncio.rst:304 +msgid "This is a coroutine." +msgstr "这是一个协程。" + +#: ../../library/asyncio.rst:61 +msgid "Sleep for *t* milliseconds." +msgstr "休眠 *t* 毫秒。" + +#: ../../library/asyncio.rst:63 ../../library/asyncio.rst:87 +#: ../../library/asyncio.rst:263 +msgid "This is a coroutine, and a MicroPython extension." +msgstr "这是一个协程,并且是 MicroPython 的扩展。" + +#: ../../library/asyncio.rst:66 +msgid "Additional functions" +msgstr "其他函数" + +#: ../../library/asyncio.rst:70 +msgid "" +"Wait for the *awaitable* to complete, but cancel it if it takes longer " +"than *timeout* seconds. If *awaitable* is not a task then a task will be" +" created from it." +msgstr "等待 *awaitable* 完成,但如果超过 *timeout* 秒,则取消它。如果 *awaitable* 不是一个任务,则将从中创建一个任务。" + +#: ../../library/asyncio.rst:74 +msgid "" +"If a timeout occurs, it cancels the task and raises " +"``asyncio.TimeoutError``: this should be trapped by the caller. The task" +" receives ``asyncio.CancelledError`` which may be ignored or trapped " +"using ``try...except`` or ``try...finally`` to run cleanup code." +msgstr "" +"如果超时发生,它会取消任务并引发 ``asyncio.TimeoutError``:这应该由调用者捕获。任务接收 " +"``asyncio.CancelledError``,可以忽略或使用 ``try...except`` 或 ``try...finally`` " +"捕获以运行清理代码。" + +#: ../../library/asyncio.rst:79 +msgid "Returns the return value of *awaitable*." +msgstr "返回 *awaitable* 的返回值。" + +#: ../../library/asyncio.rst:85 +msgid "Similar to `wait_for` but *timeout* is an integer in milliseconds." +msgstr "类似于 `wait_for`,但 *timeout* 是以毫秒为单位的整数。" + +#: ../../library/asyncio.rst:91 +msgid "" +"Run all *awaitables* concurrently. Any *awaitables* that are not tasks " +"are promoted to tasks." +msgstr "同时运行所有 *awaitables*。任何不是任务的 *awaitables* 都会提升为任务。" + +#: ../../library/asyncio.rst:94 +msgid "Returns a list of return values of all *awaitables*." +msgstr "返回所有 *awaitables* 的返回值列表。" + +#: ../../library/asyncio.rst:99 +msgid "class Task" +msgstr "Task 类" + +#: ../../library/asyncio.rst:103 +msgid "" +"This object wraps a coroutine into a running task. Tasks can be waited " +"on using ``await task``, which will wait for the task to complete and " +"return the return value of the task." +msgstr "此对象将协程封装到运行中的任务中。任务可以使用 ``await task`` 等待,等待任务完成并返回任务的返回值。" + +#: ../../library/asyncio.rst:107 +msgid "" +"Tasks should not be created directly, rather use `create_task` to create " +"them." +msgstr "任务不应直接创建,而应使用 `create_task` 创建它们。" + +#: ../../library/asyncio.rst:111 +msgid "" +"Cancel the task by injecting ``asyncio.CancelledError`` into it. The " +"task may ignore this exception. Cleanup code may be run by trapping it, " +"or via ``try ... finally``." +msgstr "" +"通过注入 ``asyncio.CancelledError`` 来取消任务。任务可以忽略此异常。可以通过捕获它或通过 ``try ... " +"finally`` 运行清理代码。" + +#: ../../library/asyncio.rst:116 +msgid "class Event" +msgstr "Event 类" + +#: ../../library/asyncio.rst:120 +msgid "" +"Create a new event which can be used to synchronise tasks. Events start " +"in the cleared state." +msgstr "创建一个新的事件,可用于同步任务。事件从清除状态开始。" + +#: ../../library/asyncio.rst:125 +msgid "Returns ``True`` if the event is set, ``False`` otherwise." +msgstr "如果事件已设置,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/asyncio.rst:129 +msgid "Set the event. Any tasks waiting on the event will be scheduled to run." +msgstr "设置事件。任何等待事件的任务都将被安排运行。" + +#: ../../library/asyncio.rst:131 +msgid "" +"Note: This must be called from within a task. It is not safe to call this" +" from an IRQ, scheduler callback, or other thread. See `ThreadSafeFlag`." +msgstr "注意:这必须在任务内部调用。从 IRQ、调度程序回调或其他线程调用此函数是不安全的。参见 `ThreadSafeFlag`。" + +#: ../../library/asyncio.rst:136 +msgid "Clear the event." +msgstr "清除事件。" + +#: ../../library/asyncio.rst:140 +msgid "" +"Wait for the event to be set. If the event is already set then it " +"returns immediately." +msgstr "等待事件设置。如果事件已设置,则立即返回。" + +#: ../../library/asyncio.rst:146 +msgid "class ThreadSafeFlag" +msgstr "ThreadSafeFlag 类" + +#: ../../library/asyncio.rst:150 +msgid "" +"Create a new flag which can be used to synchronise a task with code " +"running outside the asyncio loop, such as other threads, IRQs, or " +"scheduler callbacks. Flags start in the cleared state." +msgstr "" +"创建一个新的标志,可以用来将任务与在 asyncio 循环外运行的代码同步,例如其他线" +"程、中断请求(IRQs)或调度器回调。标志默认处于清除状态。" + +#: ../../library/asyncio.rst:156 +msgid "" +"Set the flag. If there is a task waiting on the flag, it will be " +"scheduled to run." +msgstr "设置标志。如果有等待标志的任务,则将其安排运行。" + +#: ../../library/asyncio.rst:161 +msgid "" +"Clear the flag. This may be used to ensure that a possibly previously-set" +" flag is clear before waiting for it." +msgstr "清除标志。这可用于确保在等待标志之前清除可能先前设置的标志。" + +#: ../../library/asyncio.rst:166 +msgid "" +"Wait for the flag to be set. If the flag is already set then it returns " +"immediately. The flag is automatically reset upon return from ``wait``." +msgstr "等待标志设置。如果标志已设置,则立即返回。标志在从 ``wait`` 返回时会自动重置。" + +#: ../../library/asyncio.rst:169 +msgid "A flag may only be waited on by a single task at a time." +msgstr "一次只能由一个任务等待标志。" + +#: ../../library/asyncio.rst:174 +msgid "class Lock" +msgstr "Lock 类" + +#: ../../library/asyncio.rst:178 +msgid "" +"Create a new lock which can be used to coordinate tasks. Locks start in " +"the unlocked state." +msgstr "创建一个新的锁,可用于协调任务。锁从未锁定状态开始。" + +#: ../../library/asyncio.rst:181 +msgid "" +"In addition to the methods below, locks can be used in an ``async with`` " +"statement." +msgstr "除了下面列出的方法之外,还可以在 ``async with`` 语句中使用锁。" + +#: ../../library/asyncio.rst:185 +msgid "Returns ``True`` if the lock is locked, otherwise ``False``." +msgstr "如果锁已锁定,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/asyncio.rst:189 +msgid "" +"Wait for the lock to be in the unlocked state and then lock it in an " +"atomic way. Only one task can acquire the lock at any one time." +msgstr "等待锁处于未锁定状态,然后以原子方式锁定它。一次只能有一个任务获取锁。" + +#: ../../library/asyncio.rst:196 +msgid "" +"Release the lock. If any tasks are waiting on the lock then the next one" +" in the queue is scheduled to run and the lock remains locked. " +"Otherwise, no tasks are waiting an the lock becomes unlocked." +msgstr "释放锁。如果有任务在等待锁,则排队中的下一个任务将被安排运行,并且锁仍然保持锁定状态。否则,没有任务等待锁,锁变为未锁定状态。" + +#: ../../library/asyncio.rst:201 +msgid "TCP stream connections" +msgstr "TCP 流连接" + +#: ../../library/asyncio.rst:205 +msgid "" +"Open a TCP connection to the given *host* and *port*. The *host* address" +" will be resolved using `socket.getaddrinfo`, which is currently a " +"blocking call. If *ssl* is a `ssl.SSLContext` object, this context is " +"used to create the transport; if *ssl* is ``True``, a default context is " +"used." +msgstr "" +"打开到给定 *host* 和 *port* 的 TCP 连接。将使用 `socket.getaddrinfo` 解析 *host* " +"地址,这是一个当前阻塞的调用。如果 *ssl* 是一个 `ssl.SSLContext` 对象,则使用此上下文创建传输;如果 *ssl* 是 " +"``True``,则使用默认上下文。" + +#: ../../library/asyncio.rst:210 +msgid "" +"Returns a pair of streams: a reader and a writer stream. Will raise a " +"socket-specific ``OSError`` if the host could not be resolved or if the " +"connection could not be made." +msgstr "返回一对流:读取器流和写入器流。如果无法解析主机或无法建立连接,则会引发特定于套接字的 ``OSError``。" + +#: ../../library/asyncio.rst:218 +msgid "" +"Start a TCP server on the given *host* and *port*. The *callback* will " +"be called with incoming, accepted connections, and be passed 2 arguments:" +" reader and writer streams for the connection." +msgstr "" +"在给定的 *host* 和 *port* 上启动 TCP 服务器。将使用 *callback* " +"处理传入的、已接受的连接,并传递两个参数:连接的读取器和写入器流。" + +#: ../../library/asyncio.rst:222 +msgid "" +"If *ssl* is a `ssl.SSLContext` object, this context is used to create the" +" transport." +msgstr "如果 *ssl* 是一个 `ssl.SSLContext` 对象,则使用此上下文创建传输。" + +#: ../../library/asyncio.rst:224 +msgid "Returns a `Server` object." +msgstr "返回一个 `Server` 对象。" + +#: ../../library/asyncio.rst:230 +msgid "" +"This represents a TCP stream connection. To minimise code this class " +"implements both a reader and a writer, and both ``StreamReader`` and " +"``StreamWriter`` alias to this class." +msgstr "" +"这表示 TCP 流连接。为了尽量减少代码,此类实现了读取器和写入器,而 ``StreamReader`` 和 ``StreamWriter`` " +"别名为此类。" + +#: ../../library/asyncio.rst:236 +msgid "" +"Get extra information about the stream, given by *v*. The valid values " +"for *v* are: ``peername``." +msgstr "获取有关流的额外信息,由 *v* 给出。*v* 的有效值为:``peername``。" + +#: ../../library/asyncio.rst:241 +msgid "Close the stream." +msgstr "关闭流。" + +#: ../../library/asyncio.rst:245 +msgid "Wait for the stream to close." +msgstr "等待流关闭。" + +#: ../../library/asyncio.rst:251 +msgid "" +"Read up to *n* bytes and return them. If *n* is not provided or -1 then " +"read all bytes until EOF. The returned value will be an empty bytes " +"object if EOF is encountered before any bytes are read." +msgstr "" +"读取最多 *n* 字节并返回它们。如果未提供 *n* 或为 -1,则读取直到 EOF 的所有字节。如果在读取任何字节之前遇到 " +"EOF,则返回一个空字节对象。" + +#: ../../library/asyncio.rst:259 +msgid "Read up to n bytes into *buf* with n being equal to the length of *buf*." +msgstr "将最多 n 字节读入到 *buf* 中,其中 n 等于 *buf* 的长度。" + +#: ../../library/asyncio.rst:261 +msgid "Return the number of bytes read into *buf*." +msgstr "返回读入 *buf* 的字节数。" + +#: ../../library/asyncio.rst:267 +msgid "Read exactly *n* bytes and return them as a bytes object." +msgstr "读取确切的 *n* 字节并返回它们作为字节对象。" + +#: ../../library/asyncio.rst:269 +msgid "" +"Raises an ``EOFError`` exception if the stream ends before reading *n* " +"bytes." +msgstr "如果在读取 *n* 字节之前流结束,则引发 ``EOFError`` 异常。" + +#: ../../library/asyncio.rst:275 +msgid "Read a line and return it." +msgstr "读取一行并返回它。" + +#: ../../library/asyncio.rst:281 +msgid "" +"Accumulated *buf* to the output buffer. The data is only flushed when " +"`Stream.drain` is called. It is recommended to call `Stream.drain` " +"immediately after calling this function." +msgstr "" +"将 *buf* 累积到输出缓冲区中。只有在调用 `Stream.drain` 后才会刷新数据。建议在调用此函数后立即调用 " +"`Stream.drain`。" + +#: ../../library/asyncio.rst:287 +msgid "Drain (write) all buffered output data out to the stream." +msgstr "将所有缓冲的输出数据刷新到流中。" + +#: ../../library/asyncio.rst:293 +msgid "" +"This represents the server class returned from `start_server`. It can be" +" used in an ``async with`` statement to close the server upon exit." +msgstr "这表示从 `start_server` 返回的服务器类。可以在 ``async with`` 语句中使用它以在退出时关闭服务器。" + +#: ../../library/asyncio.rst:298 +msgid "Close the server." +msgstr "关闭服务器。" + +#: ../../library/asyncio.rst:302 +msgid "Wait for the server to close." +msgstr "等待服务器关闭。" + +#: ../../library/asyncio.rst:307 +msgid "Event Loop" +msgstr "事件循环" + +#: ../../library/asyncio.rst:311 +msgid "Return the event loop used to schedule and run tasks. See `Loop`." +msgstr "返回用于调度和运行任务的事件循环。参见 `Loop`。" + +#: ../../library/asyncio.rst:315 +msgid "Reset the event loop and return it." +msgstr "重置事件循环并返回它。" + +#: ../../library/asyncio.rst:317 +msgid "" +"Note: since MicroPython only has a single event loop this function just " +"resets the loop's state, it does not create a new one." +msgstr "注意:由于 MicroPython 只有一个事件循环,此函数只是重置循环的状态,而不会创建新的循环。" + +#: ../../library/asyncio.rst:322 +msgid "" +"This represents the object which schedules and runs tasks. It cannot be " +"created, use `get_event_loop` instead." +msgstr "这表示调度和运行任务的对象。不能创建它,请改用 `get_event_loop`。" + +#: ../../library/asyncio.rst:327 +msgid "Create a task from the given *coro* and return the new `Task` object." +msgstr "从给定的 *coro* 创建一个任务,并返回新的 `Task` 对象。" + +#: ../../library/asyncio.rst:331 +msgid "Run the event loop until `stop()` is called." +msgstr "运行时间循环直到 `stop()` 被调用。" + +#: ../../library/asyncio.rst:335 +msgid "" +"Run the given *awaitable* until it completes. If *awaitable* is not a " +"task then it will be promoted to one." +msgstr "运行给定的 *awaitable* 直到完成。如果 *awaitable* 不是任务,则将其升级为任务。" + +#: ../../library/asyncio.rst:340 +msgid "Stop the event loop." +msgstr "停止事件循环。" + +#: ../../library/asyncio.rst:344 +msgid "Close the event loop." +msgstr "关闭事件循环。" + +#: ../../library/asyncio.rst:348 +msgid "" +"Set the exception handler to call when a Task raises an exception that is" +" not caught. The *handler* should accept two arguments: ``(loop, " +"context)``." +msgstr "设置当任务引发未捕获的异常时调用的异常处理程序。*handler* 应接受两个参数: ``(loop, context)``。" + +#: ../../library/asyncio.rst:353 +msgid "" +"Get the current exception handler. Returns the handler, or ``None`` if " +"no custom handler is set." +msgstr "获取当前的异常处理程序。如果未设置自定义处理程序,则返回处理程序,否则返回 ``None``。" + +#: ../../library/asyncio.rst:358 +msgid "The default exception handler that is called." +msgstr "调用默认的异常处理程序。" + +#: ../../library/asyncio.rst:362 +msgid "" +"Call the current exception handler. The argument *context* is passed " +"through and is a dictionary containing keys: ``'message'``, " +"``'exception'``, ``'future'``." +msgstr "" +"调用当前的异常处理程序。参数 *context* " +"通过,是一个包含键的字典:``'message'``、``'exception'``、``'future'``。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/binascii.po b/docs/locale/zh_CN/LC_MESSAGES/library/binascii.po new file mode 100644 index 0000000000000..89e2a88d6d7f9 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/binascii.po @@ -0,0 +1,88 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-07-09 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/binascii.rst:2 +msgid ":mod:`binascii` -- binary/ASCII conversions" +msgstr ":mod:`binascii` -- 二进制/ASCII 转换" + +#: ../../library/binascii.rst:7 +msgid "|see_cpython_module| :mod:`python:binascii`." +msgstr "|see_cpython_module| :mod:`python:binascii`。" + +#: ../../library/binascii.rst:9 +msgid "" +"This module implements conversions between binary data and various " +"encodings of it in ASCII form (in both directions)." +msgstr "该模块实现了二进制数据与其各种 ASCII 表示形式之间的转换(双向)。" + +#: ../../library/binascii.rst:13 +msgid "Functions" +msgstr "函数" + +#: ../../library/binascii.rst:17 +msgid "" +"Convert the bytes in the *data* object to a hexadecimal representation. " +"Returns a bytes object." +msgstr "将 *data* 对象中的字节转换为十六进制表示形式。返回一个字节对象。" + +#: ../../library/binascii.rst:20 +msgid "" +"If the additional argument *sep* is supplied it is used as a separator " +"between hexadecimal values." +msgstr "如果提供了额外参数 *sep*,则用作十六进制值之间的分隔符。" + +#: ../../library/binascii.rst:25 +msgid "" +"Convert hexadecimal data to binary representation. Returns bytes string. " +"(i.e. inverse of hexlify)" +msgstr "将十六进制数据转换为二进制表示形式。返回字节字符串。(即 hexlify 的反向)" + +#: ../../library/binascii.rst:30 +msgid "" +"Decode base64-encoded data, ignoring invalid characters in the input. " +"Conforms to `RFC 2045 s.6.8 " +"`_. Returns a bytes " +"object." +msgstr "" +"解码 base64 编码的数据,忽略输入中的无效字符。符合 `RFC 2045 s.6.8 " +"`_。返回一个字节对象。" + +#: ../../library/binascii.rst:36 +msgid "" +"Encode binary data in base64 format, as in `RFC 3548 " +"`_. Returns the encoded data " +"followed by a newline character if newline is true, as a bytes object." +msgstr "" +"将二进制数据编码为 base64 格式,如 `RFC 3548 " +"`_ 中所述。返回编码后的数据,如果 newline 为 " +"true,则跟随一个换行符,作为一个字节对象。" + +#: ../../library/binascii.rst:42 +msgid "" +"Compute CRC-32, the 32-bit checksum of *data*, starting with an initial " +"CRC of *value*. The default initial CRC is zero. The algorithm is " +"consistent with the ZIP file checksum." +msgstr "" +"计算 CRC-32,即 *data* 的 32 位校验和,以 *value* 作为初始 CRC 值。" +"默认初始 CRC 为零。该算法与 ZIP 文件校验和一致。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/bluetooth.po b/docs/locale/zh_CN/LC_MESSAGES/library/bluetooth.po new file mode 100644 index 0000000000000..9f6fd204f56de --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/bluetooth.po @@ -0,0 +1,1075 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/bluetooth.rst:2 +msgid ":mod:`bluetooth` --- low-level Bluetooth" +msgstr ":mod:`bluetooth` --- 低功耗蓝牙" + +#: ../../library/bluetooth.rst:7 +msgid "" +"This module provides an interface to a Bluetooth controller on a board. " +"Currently this supports Bluetooth Low Energy (BLE) in Central, " +"Peripheral, Broadcaster, and Observer roles, as well as GATT Server and " +"Client and L2CAP connection-oriented-channels. A device may operate in " +"multiple roles concurrently. Pairing (and bonding) is supported on some " +"ports." +msgstr "该模块提供了与板载蓝牙控制器的接口。目前,此模块支持蓝牙低功耗(BLE)中的中央、外围、广播器和观察者角色,以及GATT服务器和客户端以及L2CAP连接定向通道。一个设备可以同时处于多种角色。在某些移植版本上支持配对(和绑定)。" + +#: ../../library/bluetooth.rst:13 +msgid "" +"This API is intended to match the low-level Bluetooth protocol and " +"provide building-blocks for higher-level abstractions such as specific " +"device types." +msgstr "此 API 旨在匹配底层蓝牙协议,并提供构建高级抽象的构建模块,例如特定设备类型。" + +#: ../../library/bluetooth.rst:16 +msgid "" +"For most applications, we recommend using the higher-level `aioble " +"library `_." +msgstr "" +"对于大多数应用程序,我们建议使用更高级别的 `aioble library `_。" + +#: ../../library/bluetooth.rst:19 +msgid "" +"This module is still under development and its classes, functions, " +"methods and constants are subject to change." +msgstr "此模块仍在开发中,其类、函数、方法和常量可能会发生变化。" + +#: ../../library/bluetooth.rst:23 +msgid "class BLE" +msgstr "BLE 类" + +#: ../../library/bluetooth.rst:26 ../../library/bluetooth.rst:758 +msgid "Constructor" +msgstr "构造函数" + +#: ../../library/bluetooth.rst:30 +msgid "Returns the singleton BLE object." +msgstr "返回 BLE 单例对象。" + +#: ../../library/bluetooth.rst:33 +msgid "Configuration" +msgstr "配置器" + +#: ../../library/bluetooth.rst:37 +msgid "" +"Optionally changes the active state of the BLE radio, and returns the " +"current state." +msgstr "可选地更改 BLE 无线电的活动状态,并返回当前状态。" + +#: ../../library/bluetooth.rst:40 +msgid "" +"The radio must be made active before using any other methods on this " +"class." +msgstr "在使用此类的其他方法之前,无线电必须处于活动状态。" + +#: ../../library/bluetooth.rst:45 +msgid "" +"Get or set configuration values of the BLE interface. To get a value the" +" parameter name should be quoted as a string, and just one parameter is " +"queried at a time. To set values use the keyword syntax, and one or more" +" parameter can be set at a time." +msgstr "" +"获取或设置 BLE " +"接口的配置值。要获取值,参数名称应作为字符串引用,一次仅查询一个参数。要设置值,请使用关键字语法,并且可以一次设置一个或多个参数。" + +#: ../../library/bluetooth.rst:50 +msgid "Currently supported values are:" +msgstr "目前支持的值有:" + +#: ../../library/bluetooth.rst:52 +msgid "" +"``'mac'``: The current address in use, depending on the current address " +"mode. This returns a tuple of ``(addr_type, addr)``." +msgstr "``'mac'``:使用中的当前地址,取决于当前地址模式。这返回一个 ``(addr_type, addr)`` 元组。" + +#: ../../library/bluetooth.rst:55 +msgid "See :meth:`gatts_write ` for details about address type." +msgstr "有关地址类型的详细信息,请参阅 :meth:`gatts_write `。" + +#: ../../library/bluetooth.rst:57 +msgid "This may only be queried while the interface is currently active." +msgstr "只有在接口当前处于活动状态时才能查询此项。" + +#: ../../library/bluetooth.rst:59 +msgid "``'addr_mode'``: Sets the address mode. Values can be:" +msgstr "``'addr_mode'``:设置地址模式。值可以是:" + +#: ../../library/bluetooth.rst:61 +msgid "0x00 - PUBLIC - Use the controller's public address." +msgstr "0x00 - PUBLIC - 使用控制器的公共地址。" + +#: ../../library/bluetooth.rst:62 +msgid "0x01 - RANDOM - Use a generated static address." +msgstr "0x01 - RANDOM - 使用生成的静态地址。" + +#: ../../library/bluetooth.rst:63 +msgid "0x02 - RPA - Use resolvable private addresses." +msgstr "0x02 - RPA - 使用可解析的私有地址。" + +#: ../../library/bluetooth.rst:64 +msgid "0x03 - NRPA - Use non-resolvable private addresses." +msgstr "0x03 - NRPA - 使用不可解析的私有地址。" + +#: ../../library/bluetooth.rst:66 +msgid "" +"By default the interface mode will use a PUBLIC address if available, " +"otherwise it will use a RANDOM address." +msgstr "默认情况下,如果可用,接口模式将使用 PUBLIC 地址,否则将使用 RANDOM 地址。" + +#: ../../library/bluetooth.rst:69 +msgid "" +"``'gap_name'``: Get/set the GAP device name used by service 0x1800, " +"characteristic 0x2a00. This can be set at any time and changed multiple " +"times." +msgstr "``'gap_name'``:获取/设置由服务 0x1800 使用的 GAP 设备名称,特性 0x2a00。可以随时设置并多次更改。" + +#: ../../library/bluetooth.rst:73 +msgid "" +"``'rxbuf'``: Get/set the size in bytes of the internal buffer used to " +"store incoming events. This buffer is global to the entire BLE driver " +"and so handles incoming data for all events, including all " +"characteristics. Increasing this allows better handling of bursty " +"incoming data (for example scan results) and the ability to receive " +"larger characteristic values." +msgstr "" +"``'rxbuf'``:获取/设置用于存储传入事件的内部缓冲区的大小(以字节为单位)。此缓冲区对整个 BLE " +"驱动程序全局可见,因此处理所有事件的传入数据,包括所有特性。增加此值可以更好地处理突发传入数据(例如扫描结果)并能够接收更大的特性值。" + +#: ../../library/bluetooth.rst:79 +msgid "" +"``'mtu'``: Get/set the MTU that will be used during a ATT MTU exchange. " +"The resulting MTU will be the minimum of this and the remote device's " +"MTU. ATT MTU exchange will not happen automatically (unless the remote " +"device initiates it), and must be manually initiated with " +":meth:`gattc_exchange_mtu`. Use the " +"``_IRQ_MTU_EXCHANGED`` event to discover the MTU for a given connection." +msgstr "" +"``'mtu'``:获取/设置在 ATT MTU 交换期间将使用的 MTU。结果 MTU 将是此值与远程设备的MTU 的最小值。ATT MTU " +"交换不会自动发生(除非远程设备启动它),必须使用:meth:`gattc_exchange_mtu`" +" 手动启动。使用 ``_IRQ_MTU_EXCHANGED`` 事件发现给定连接的 MTU。" + +#: ../../library/bluetooth.rst:86 +msgid "" +"``'bond'``: Sets whether bonding will be enabled during pairing. When " +"enabled, pairing requests will set the \"bond\" flag and the keys will be" +" stored by both devices." +msgstr "``'bond'``:设置在配对过程中是否启用绑定。启用时,配对请求将设置“bond”标志,并且密钥将由两个设备存储。" + +#: ../../library/bluetooth.rst:90 +msgid "``'mitm'``: Sets whether MITM-protection is required for pairing." +msgstr "``'mitm'``:设置配对是否需要 MITM 保护。" + +#: ../../library/bluetooth.rst:92 +msgid "``'io'``: Sets the I/O capabilities of this device." +msgstr "``'io'``:设置此设备的 I/O 能力。" + +#: ../../library/bluetooth.rst:94 +msgid "Available options are::" +msgstr "可用选项有::" + +#: ../../library/bluetooth.rst:102 +msgid "" +"``'le_secure'``: Sets whether \"LE Secure\" pairing is required. Default " +"is false (i.e. allow \"Legacy Pairing\")." +msgstr "``'le_secure'``:设置是否需要“LE Secure”配对。默认值为 false(即允许“Legacy Pairing”)。" + +#: ../../library/bluetooth.rst:106 +msgid "Event Handling" +msgstr "事件处理" + +#: ../../library/bluetooth.rst:110 +msgid "" +"Registers a callback for events from the BLE stack. The *handler* takes " +"two arguments, ``event`` (which will be one of the codes below) and " +"``data`` (which is an event-specific tuple of values)." +msgstr "" +"为 BLE 栈的事件注册回调。*handler* 接受两个参数, ``event`` (将是下面代码之一)和 ``data`` " +"(它是特定于事件的值元组)。" + +#: ../../library/bluetooth.rst:114 +msgid "" +"**Note:** As an optimisation to prevent unnecessary allocations, the " +"``addr``, ``adv_data``, ``char_data``, ``notify_data``, and ``uuid`` " +"entries in the tuples are read-only memoryview instances pointing to " +":mod:`bluetooth`'s internal ringbuffer, and are only valid during the " +"invocation of the IRQ handler function. If your program needs to save " +"one of these values to access after the IRQ handler has returned (e.g. by" +" saving it in a class instance or global variable), then it needs to take" +" a copy of the data, either by using ``bytes()`` or ``bluetooth.UUID()``," +" like this::" +msgstr "" +"**注意:** 为了防止不必要的分配以优化性能,元组中的 " +"``addr``、``adv_data``、``char_data``、``notify_data`` 和 ``uuid`` 条目是指向 " +":mod:`bluetooth` 内部环形缓冲区的只读内存视图实例,并且仅在 IRQ " +"处理程序函数的调用期间有效。如果您的程序需要保存其中一个值以在 IRQ " +"处理程序返回后访问(例如,通过将其保存在类实例或全局变量中),则需要复制数据,方法是使用 ``bytes()`` 或 " +"``bluetooth.UUID()``,就像这样::" + +#: ../../library/bluetooth.rst:126 +msgid "" +"For example, the IRQ handler for a scan result might inspect the " +"``adv_data`` to decide if it's the correct device, and only then copy the" +" address data to be used elsewhere in the program. And to print data " +"from within the IRQ handler, ``print(bytes(addr))`` will be needed." +msgstr "" +"例如,对于扫描结果的 IRQ 处理程序可能会检查 ``adv_data`` " +"以确定是否为正确的设备,然后仅在此后复制地址数据以在程序的其他地方使用。要在 IRQ 处理程序内打印数据,将需要 " +"``print(bytes(addr))``。" + +#: ../../library/bluetooth.rst:131 +msgid "An event handler showing all possible events::" +msgstr "显示所有可能事件的事件处理程序::" + +#: ../../library/bluetooth.rst:246 +msgid "The event codes are::" +msgstr "事件代码为::" + +#: ../../library/bluetooth.rst:280 +msgid "" +"For the ``_IRQ_GATTS_READ_REQUEST`` event, the available return codes " +"are::" +msgstr "``_IRQ_GATTS_READ_REQUEST`` 事件的可用返回代码如下::" + +#: ../../library/bluetooth.rst:289 +msgid "For the ``_IRQ_PASSKEY_ACTION`` event, the available actions are::" +msgstr "``_IRQ_PASSKEY_ACTION`` 事件的可用的操作如下::" + +#: ../../library/bluetooth.rst:296 +msgid "" +"In order to save space in the firmware, these constants are not included " +"on the :mod:`bluetooth` module. Add the ones that you need from the list " +"above to your program." +msgstr "为了在固件中节省空间,这些常量未包含在 :mod:`bluetooth` 模块中。从上述列表中添加您需要的常量到您的程序中。" + +#: ../../library/bluetooth.rst:302 +msgid "Broadcaster Role (Advertiser)" +msgstr "广播角色(Advertiser)" + +#: ../../library/bluetooth.rst:306 +msgid "" +"Starts advertising at the specified interval (in **micro**\\ seconds). " +"This interval will be rounded down to the nearest 625us. To stop " +"advertising, set *interval_us* to ``None``." +msgstr "" +"在指定的间隔(以 **micro**\\ 为单位)开始广播。此间隔将四舍五入到最接近的 625 微秒。要停止广播,请将 *interval_us*" +" 设置为 ``None``。" + +#: ../../library/bluetooth.rst:310 +msgid "" +"*adv_data* and *resp_data* can be any type that implements the buffer " +"protocol (e.g. ``bytes``, ``bytearray``, ``str``). *adv_data* is included" +" in all broadcasts, and *resp_data* is send in reply to an active scan." +msgstr "" +"*adv_data* 和 *resp_data* 可以是实现缓冲区协议的任何类型(例如 " +"``bytes``、``bytearray``、``str``)。*adv_data* 包含在所有广播中,*resp_data* " +"在对主动扫描的回复中发送。" + +#: ../../library/bluetooth.rst:314 +msgid "" +"**Note:** if *adv_data* (or *resp_data*) is ``None``, then the data " +"passed to the previous call to ``gap_advertise`` will be reused. This " +"allows a broadcaster to resume advertising with just " +"``gap_advertise(interval_us)``. To clear the advertising payload pass an " +"empty ``bytes``, i.e. ``b''``." +msgstr "" +"**注意:** 如果 *adv_data*(或 *resp_data*)为 ``None``,则将重用上一次调用 " +"``gap_advertise`` 时传递的数据。这允许广播者仅通过 ``gap_advertise(interval_us)`` " +"恢复广告。如果要清除广告有效载荷,请传递一个空的 ``bytes``,即 ``b''``。" + +#: ../../library/bluetooth.rst:321 +msgid "Observer Role (Scanner)" +msgstr "观察者角色 (Scanner)" + +#: ../../library/bluetooth.rst:325 +msgid "" +"Run a scan operation lasting for the specified duration (in **milli**\\ " +"seconds)." +msgstr "运行持续指定时间的扫描操作(以毫秒为单位)。" + +#: ../../library/bluetooth.rst:327 +msgid "To scan indefinitely, set *duration_ms* to ``0``." +msgstr "若要无限期扫描,请将 *duration_ms* 设置为 ``0``。" + +#: ../../library/bluetooth.rst:329 +msgid "To stop scanning, set *duration_ms* to ``None``." +msgstr "要停止扫描,请将 *duration_ms* 设置为 ``None``。" + +#: ../../library/bluetooth.rst:331 +msgid "" +"Use *interval_us* and *window_us* to optionally configure the duty cycle." +" The scanner will run for *window_us* **micro**\\ seconds every " +"*interval_us* **micro**\\ seconds for a total of *duration_ms* " +"**milli**\\ seconds. The default interval and window are 1.28 seconds and" +" 11.25 milliseconds respectively (background scanning)." +msgstr "" +"使用 *interval_us* 和 *window_us* 可以选择配置工作循环。扫描器将每隔 *interval_us***micro**\\" +" 秒运行 *window_us* **micro**\\ 秒,总共 *duration_ms* **milli**\\ " +"秒。默认的间隔和窗口分别为1.28 秒和 11.25 毫秒(后台扫描)。" + +#: ../../library/bluetooth.rst:337 +msgid "" +"For each scan result the ``_IRQ_SCAN_RESULT`` event will be raised, with " +"event data ``(addr_type, addr, adv_type, rssi, adv_data)``." +msgstr "" +"对于每个扫描结果,将触发 ``_IRQ_SCAN_RESULT`` 事件,其事件数据为 ``(addr_type, addr, adv_type," +" rssi, adv_data)``。" + +#: ../../library/bluetooth.rst:340 +msgid "``addr_type`` values indicate public or random addresses:" +msgstr "``addr_type`` 值表示公共地址或随机地址:" + +#: ../../library/bluetooth.rst:341 +msgid "0x00 - PUBLIC" +msgstr "0x00 - 公共" + +#: ../../library/bluetooth.rst:342 +msgid "" +"0x01 - RANDOM (either static, RPA, or NRPA, the type is encoded in the " +"address itself)" +msgstr "0x01 - RANDOM(静态、RPA 或 NRPA 中的任意一种,类型已编码在地址本身中)" + +#: ../../library/bluetooth.rst:344 +msgid "``adv_type`` values correspond to the Bluetooth Specification:" +msgstr "``adv_type`` 值对应于蓝牙规范:" + +#: ../../library/bluetooth.rst:346 +msgid "0x00 - ADV_IND - connectable and scannable undirected advertising" +msgstr "0x00 - ADV_IND - 可连接和可扫描的非定向广播" + +#: ../../library/bluetooth.rst:347 +msgid "0x01 - ADV_DIRECT_IND - connectable directed advertising" +msgstr "0x01 - ADV_DIRECT_IND - 可连接定向广播" + +#: ../../library/bluetooth.rst:348 +msgid "0x02 - ADV_SCAN_IND - scannable undirected advertising" +msgstr "0x02 - ADV_SCAN_IND - 可扫描非定向广播" + +#: ../../library/bluetooth.rst:349 +msgid "0x03 - ADV_NONCONN_IND - non-connectable undirected advertising" +msgstr "0x03 - ADV_NONCONN_IND - 不可连接的非定向广播" + +#: ../../library/bluetooth.rst:350 +msgid "0x04 - SCAN_RSP - scan response" +msgstr "0x04 - SCAN_RSP - 扫描响应" + +#: ../../library/bluetooth.rst:352 +msgid "" +"``active`` can be set ``True`` if you want to receive scan responses in " +"the results." +msgstr "如果希望在结果中接收扫描响应,则可以将 ``active`` 设置为 ``True``。" + +#: ../../library/bluetooth.rst:354 +msgid "" +"When scanning is stopped (either due to the duration finishing or when " +"explicitly stopped), the ``_IRQ_SCAN_DONE`` event will be raised." +msgstr "当扫描停止(无论是由于持续时间结束还是显式停止时),将触发 ``_IRQ_SCAN_DONE`` 事件。" + +#: ../../library/bluetooth.rst:359 +msgid "Central Role" +msgstr "中心角色" + +#: ../../library/bluetooth.rst:361 +msgid "" +"A central device can connect to peripherals that it has discovered using " +"the observer role (see :meth:`gap_scan`) or with a known " +"address." +msgstr "中心设备可以使用观察者角色(参见 :meth:`gap_scan`)或已知地址连接到已发现的外围设备。" + +#: ../../library/bluetooth.rst:365 +msgid "Connect to a peripheral." +msgstr "连接到外围设备。" + +#: ../../library/bluetooth.rst:367 +msgid "See :meth:`gap_scan ` for details about address types." +msgstr "有关地址类型的详细信息,请参阅 :meth:`gap_scan `。" + +#: ../../library/bluetooth.rst:369 +msgid "" +"To cancel an outstanding connection attempt early, call " +"``gap_connect(None)``." +msgstr "要取消未完成的连接尝试,请调用 ``gap_connect(None)``。" + +#: ../../library/bluetooth.rst:372 +msgid "" +"On success, the ``_IRQ_PERIPHERAL_CONNECT`` event will be raised. If " +"cancelling a connection attempt, the ``_IRQ_PERIPHERAL_DISCONNECT`` event" +" will be raised." +msgstr "" +"成功时,将触发 ``_IRQ_PERIPHERAL_CONNECT`` 事件。如果取消连接尝试,则将触发 " +"``_IRQ_PERIPHERAL_DISCONNECT`` 事件。" + +#: ../../library/bluetooth.rst:376 +msgid "" +"The device will wait up to *scan_duration_ms* to receive an advertising " +"payload from the device." +msgstr "设备将等待最多 *scan_duration_ms* 从设备接收广播有效载荷。" + +#: ../../library/bluetooth.rst:379 +msgid "" +"The connection interval can be configured in **micro**\\ seconds using " +"either or both of *min_conn_interval_us* and *max_conn_interval_us*. " +"Otherwise a default interval will be chosen, typically between 30000 and " +"50000 microseconds. A shorter interval will increase throughput, at the " +"expense of power usage." +msgstr "" +"连接间隔可以使用 **micro**\\ 秒进行配置,使用 *min_conn_interval_us* 和 " +"*max_conn_interval_us* 中的一个或两个。否则,将选择默认间隔,通常在 30000 到 " +"50000微秒之间。较短的间隔将增加吞吐量,但会增加功耗。" + +#: ../../library/bluetooth.rst:387 +msgid "Peripheral Role" +msgstr "外围角色" + +#: ../../library/bluetooth.rst:389 +msgid "" +"A peripheral device is expected to send connectable advertisements (see " +":meth:`gap_advertise`). It will usually be acting as a" +" GATT server, having first registered services and characteristics using " +":meth:`gatts_register_services`." +msgstr "" +"外围设备应发送可连接广播(请参阅 :meth:`gap_advertise`)。通常,它将充当 GATT " +"服务器,首先使用 :meth:`gatts_register_services` " +"注册服务和特征。" + +#: ../../library/bluetooth.rst:394 +msgid "" +"When a central connects, the ``_IRQ_CENTRAL_CONNECT`` event will be " +"raised." +msgstr "当中心连接时,将触发 ``_IRQ_CENTRAL_CONNECT`` 事件。" + +#: ../../library/bluetooth.rst:398 +msgid "Central & Peripheral Roles" +msgstr "中心 & 外围角色" + +#: ../../library/bluetooth.rst:402 +msgid "" +"Disconnect the specified connection handle. This can either be a central " +"that has connected to this device (if acting as a peripheral) or a " +"peripheral that was previously connected to by this device (if acting as " +"a central)." +msgstr "断开指定的连接句柄。这可以是已连接到该设备的中心(如果充当外围设备),也可以是此设备先前连接到的外围设备(如果充当中心)。" + +#: ../../library/bluetooth.rst:407 +msgid "" +"On success, the ``_IRQ_PERIPHERAL_DISCONNECT`` or " +"``_IRQ_CENTRAL_DISCONNECT`` event will be raised." +msgstr "成功时,将触发 ``_IRQ_PERIPHERAL_DISCONNECT`` 或 ``_IRQ_CENTRAL_DISCONNECT`` 事件。" + +#: ../../library/bluetooth.rst:410 +msgid "" +"Returns ``False`` if the connection handle wasn't connected, and ``True``" +" otherwise." +msgstr "如果连接句柄未连接,则返回 ``False``,否则返回 ``True``。" + +#: ../../library/bluetooth.rst:415 +msgid "GATT Server" +msgstr "GATT 服务器" + +#: ../../library/bluetooth.rst:417 +msgid "" +"A GATT server has a set of registered services. Each service may contain " +"characteristics, which each have a value. Characteristics can also " +"contain descriptors, which themselves have values." +msgstr "GATT 服务器具有一组已注册的服务。每个服务可能包含特征,每个特征都有一个值。特征还可以包含描述符,描述符本身也具有值。" + +#: ../../library/bluetooth.rst:421 +msgid "" +"These values are stored locally, and are accessed by their \"value " +"handle\" which is generated during service registration. They can also be" +" read from or written to by a remote client device. Additionally, a " +"server can \"notify\" a characteristic to a connected client via a " +"connection handle." +msgstr "这些值存储在本地,并通过它们的“值句柄”访问,该句柄在服务注册期间生成。它们也可以被远程客户端设备读取或写入。此外,服务器可以通过连接句柄将特征“通知”给已连接的客户端。" + +#: ../../library/bluetooth.rst:426 +msgid "" +"A device in either central or peripheral roles may function as a GATT " +"server, however in most cases it will be more common for a peripheral " +"device to act as the server." +msgstr "中心或外围设备都可以充当 GATT 服务器,但在大多数情况下,外围设备更常见。" + +#: ../../library/bluetooth.rst:430 +msgid "" +"Characteristics and descriptors have a default maximum size of 20 bytes. " +"Anything written to them by a client will be truncated to this length. " +"However, any local write will increase the maximum size, so if you want " +"to allow larger writes from a client to a given characteristic, use " +":meth:`gatts_write` after registration. e.g. " +"``gatts_write(char_handle, bytes(100))``." +msgstr "" +"特征和描述符的默认最大大小为 20 " +"字节。客户端写入的任何内容都将被截断为此长度。但是,任何本地写入都将增加最大大小,因此,如果要允许客户端对给定特征进行更大的写入,请在注册后使用 " +":meth:`gatts_write`。例如 ``gatts_write(char_handle, " +"bytes(100))``。" + +#: ../../library/bluetooth.rst:439 +msgid "" +"Configures the server with the specified services, replacing any existing" +" services." +msgstr "使用指定的服务配置服务器,替换任何现有服务。" + +#: ../../library/bluetooth.rst:442 +msgid "" +"*services_definition* is a list of **services**, where each **service** " +"is a two-element tuple containing a UUID and a list of " +"**characteristics**." +msgstr "" +"*services_definition* 是一个 **service** 列表,其中每个 **service** 是一个包含 UUID 和 " +"**characteristic** 列表的两个元素元组。" + +#: ../../library/bluetooth.rst:445 +msgid "" +"Each **characteristic** is a two-or-three-element tuple containing a " +"UUID, a **flags** value, and optionally a list of *descriptors*." +msgstr "" +"每个 **characteristic** 是一个包含 UUID、**flags** 值和可选的 *descriptors* " +"列表的两个或三个元素元组。" + +#: ../../library/bluetooth.rst:448 +msgid "" +"Each **descriptor** is a two-element tuple containing a UUID and a " +"**flags** value." +msgstr "每个 **descriptor** 是一个包含 UUID 和 **flags** 值的两个元素元组。" + +#: ../../library/bluetooth.rst:451 +msgid "" +"The **flags** are a bitwise-OR combination of the flags defined below. " +"These set both the behaviour of the characteristic (or descriptor) as " +"well as the security and privacy requirements." +msgstr "**flags** 是以下标志的按位或组合。这些设置特征(或描述符)的行为以及安全性和隐私要求。" + +#: ../../library/bluetooth.rst:455 +msgid "" +"The return value is a list (one element per service) of tuples (each " +"element is a value handle). Characteristics and descriptor handles are " +"flattened into the same tuple, in the order that they are defined." +msgstr "返回值是一个元组列表(每个服务一个元素),其中每个元组(每个特征和描述符句柄都平铺在其中)以定义的顺序排列。" + +#: ../../library/bluetooth.rst:459 +msgid "" +"The following example registers two services (Heart Rate, and Nordic " +"UART)::" +msgstr "以下是注册两个服务(心率和 Nordic UART)的示例:" + +#: ../../library/bluetooth.rst:471 +msgid "" +"The three value handles (``hr``, ``tx``, ``rx``) can be used with " +":meth:`gatts_read `, :meth:`gatts_write " +"`, :meth:`gatts_notify `, and " +":meth:`gatts_indicate `." +msgstr "" +"三个值句柄( ``hr`` 、 ``tx`` 、 ``rx`` )可用于 :meth:`gatts_read `," +" :meth:`gatts_write `, :meth:`gatts_notify " +"`, 和 :meth:`gatts_indicate `。" + +#: ../../library/bluetooth.rst:475 +msgid "**Note:** Advertising must be stopped before registering services." +msgstr "**注意:** 在注册服务之前必须停止广播。" + +#: ../../library/bluetooth.rst:477 +msgid "Available flags for characteristics and descriptors are::" +msgstr "特征和描述符的可用标志为:" + +#: ../../library/bluetooth.rst:496 +msgid "" +"As for the IRQs above, any required constants should be added to your " +"Python code." +msgstr "与上述 IRQ 一样,任何所需的常量都应添加到您的 Python 代码中。" + +#: ../../library/bluetooth.rst:500 +msgid "" +"Reads the local value for this handle (which has either been written by " +":meth:`gatts_write ` or by a remote client)." +msgstr "读取此句柄的本地值(由 :meth:`gatts_write ` 或远程客户端写入)。" + +#: ../../library/bluetooth.rst:505 +msgid "Writes the local value for this handle, which can be read by a client." +msgstr "写入此句柄的本地值,客户端可以读取。" + +#: ../../library/bluetooth.rst:507 +msgid "" +"If *send_update* is ``True``, then any subscribed clients will be " +"notified (or indicated, depending on what they're subscribed to and which" +" operations the characteristic supports) about this write." +msgstr "如果 *send_update* 设置为 ``True``,则任何已订阅的客户端将收到通知(或指示,取决于客户端订阅的内容和特征支持的操作)。" + +#: ../../library/bluetooth.rst:513 +msgid "Sends a notification request to a connected client." +msgstr "向已连接的客户端发送通知请求。" + +#: ../../library/bluetooth.rst:515 ../../library/bluetooth.rst:528 +msgid "" +"If *data* is ``None`` (the default), then the current local value (as set" +" with :meth:`gatts_write `) will be sent." +msgstr "" +"如果 *data* 为 ``None`` (默认值),则将发送当前本地值(由 :meth:`gatts_write " +"` 设置)。" + +#: ../../library/bluetooth.rst:518 +msgid "" +"Otherwise, if *data* is not ``None``, then that value is sent to the " +"client as part of the notification. The local value will not be modified." +msgstr "否则,如果 *data* 不为 ``None``,则该值将作为通知的一部分发送给客户端。本地值不会被修改。" + +#: ../../library/bluetooth.rst:521 +msgid "" +"**Note:** The notification will be sent regardless of the subscription " +"status of the client to this characteristic." +msgstr "**注意:** 不管客户端对该特征的订阅状态如何,通知都将被发送。" + +#: ../../library/bluetooth.rst:526 +msgid "Sends a indication request to a connected client." +msgstr "向已连接的客户端发送指示请求。" + +#: ../../library/bluetooth.rst:531 +msgid "" +"Otherwise, if *data* is not ``None``, then that value is sent to the " +"client as part of the indication. The local value will not be modified." +msgstr "否则,如果 *data* 不为 ``None``,则该值将作为指示的一部分发送给客户端。本地值不会被修改。" + +#: ../../library/bluetooth.rst:534 +msgid "" +"On acknowledgment (or failure, e.g. timeout), the " +"``_IRQ_GATTS_INDICATE_DONE`` event will be raised." +msgstr "在确认(或失败,例如超时)时,将触发 ``_IRQ_GATTS_INDICATE_DONE`` 事件。" + +#: ../../library/bluetooth.rst:537 +msgid "" +"**Note:** The indication will be sent regardless of the subscription " +"status of the client to this characteristic." +msgstr "**注意:** 不管客户端对该特征的订阅状态如何,指示都将被发送。" + +#: ../../library/bluetooth.rst:542 +msgid "" +"Sets the internal buffer size for a value in bytes. This will limit the " +"largest possible write that can be received. The default is 20." +msgstr "设置字节中值的内部缓冲区大小。这将限制可能接收的最大写入量。默认值为 20。" + +#: ../../library/bluetooth.rst:545 +msgid "" +"Setting *append* to ``True`` will make all remote writes append to, " +"rather than replace, the current value. At most *len* bytes can be " +"buffered in this way. When you use :meth:`gatts_read `, " +"the value will be cleared after reading. This feature is useful when " +"implementing something like the Nordic UART Service." +msgstr "" +"将 *append* 设置为 ``True`` 将使所有远程写入附加到当前值,而不是替换当前值。以这种方式最多可以缓冲 *len* 字节。当您使用" +" :meth:`gatts_read ` 时,值将在读取后清除。当实现类似 Nordic UART " +"服务的功能时,此功能很有用。" + +#: ../../library/bluetooth.rst:552 +msgid "GATT Client" +msgstr "GATT 客户端" + +#: ../../library/bluetooth.rst:554 +msgid "" +"A GATT client can discover and read/write characteristics on a remote " +"GATT server." +msgstr "GATT 客户端可以发现和读取/写入远程 GATT 服务器上的特征。" + +#: ../../library/bluetooth.rst:556 +msgid "" +"It is more common for a central role device to act as the GATT client, " +"however it's also possible for a peripheral to act as a client in order " +"to discover information about the central that has connected to it (e.g. " +"to read the device name from the device information service)." +msgstr "通常,中心角色设备充当 GATT 客户端,但外围设备也可以充当客户端,以便了解连接到它的中心的信息(例如从设备信息服务中读取设备名称)。" + +#: ../../library/bluetooth.rst:563 +msgid "Query a connected server for its services." +msgstr "查询已连接服务器的服务。" + +#: ../../library/bluetooth.rst:565 +msgid "Optionally specify a service *uuid* to query for that service only." +msgstr "可选择指定要仅查询该服务的服务 *uuid*。" + +#: ../../library/bluetooth.rst:567 +msgid "" +"For each service discovered, the ``_IRQ_GATTC_SERVICE_RESULT`` event will" +" be raised, followed by ``_IRQ_GATTC_SERVICE_DONE`` on completion." +msgstr "" +"对于每个发现的服务,将触发 ``_IRQ_GATTC_SERVICE_RESULT`` 事件,随后将触发 " +"``_IRQ_GATTC_SERVICE_DONE`` 事件。" + +#: ../../library/bluetooth.rst:572 +msgid "Query a connected server for characteristics in the specified range." +msgstr "查询指定范围内的已连接服务器的特征。" + +#: ../../library/bluetooth.rst:574 +msgid "" +"Optionally specify a characteristic *uuid* to query for that " +"characteristic only." +msgstr "可选择指定要仅查询该特征的特征 *uuid*。" + +#: ../../library/bluetooth.rst:577 +msgid "" +"You can use ``start_handle=1``, ``end_handle=0xffff`` to search for a " +"characteristic in any service." +msgstr "您可以使用 ``start_handle=1``、``end_handle=0xffff`` 来搜索任何服务中的特征。" + +#: ../../library/bluetooth.rst:580 +msgid "" +"For each characteristic discovered, the " +"``_IRQ_GATTC_CHARACTERISTIC_RESULT`` event will be raised, followed by " +"``_IRQ_GATTC_CHARACTERISTIC_DONE`` on completion." +msgstr "" +"对于每个发现的特征,将触发 ``_IRQ_GATTC_CHARACTERISTIC_RESULT`` 事件,随后将触发 " +"``_IRQ_GATTC_CHARACTERISTIC_DONE`` 事件。" + +#: ../../library/bluetooth.rst:585 +msgid "Query a connected server for descriptors in the specified range." +msgstr "查询指定范围内已连接服务器的描述符。" + +#: ../../library/bluetooth.rst:587 +msgid "" +"For each descriptor discovered, the ``_IRQ_GATTC_DESCRIPTOR_RESULT`` " +"event will be raised, followed by ``_IRQ_GATTC_DESCRIPTOR_DONE`` on " +"completion." +msgstr "" +"对于每个发现的描述符,将触发 ``_IRQ_GATTC_DESCRIPTOR_RESULT`` 事件,随后将触发 " +"``_IRQ_GATTC_DESCRIPTOR_DONE`` 事件。" + +#: ../../library/bluetooth.rst:592 +msgid "" +"Issue a remote read to a connected server for the specified " +"characteristic or descriptor handle." +msgstr "为指定的特征或描述符句柄向已连接的服务器发出远程读取请求。" + +#: ../../library/bluetooth.rst:595 +msgid "" +"When a value is available, the ``_IRQ_GATTC_READ_RESULT`` event will be " +"raised. Additionally, the ``_IRQ_GATTC_READ_DONE`` will be raised." +msgstr "" +"当有值可用时,将触发 ``_IRQ_GATTC_READ_RESULT`` 事件。此外,将触发 ``_IRQ_GATTC_READ_DONE`` " +"事件。" + +#: ../../library/bluetooth.rst:600 +msgid "" +"Issue a remote write to a connected server for the specified " +"characteristic or descriptor handle." +msgstr "为指定的特征或描述符句柄向已连接的服务器发出远程写入请求。" + +#: ../../library/bluetooth.rst:603 +msgid "" +"The argument *mode* specifies the write behaviour, with the currently " +"supported values being:" +msgstr "参数 *mode* 指定写入行为,当前支持的值为:" + +#: ../../library/bluetooth.rst:606 +msgid "" +"``mode=0`` (default) is a write-without-response: the write will be sent " +"to the remote server but no confirmation will be returned, and no event " +"will be raised." +msgstr "``mode=0`` (默认)是写入但不回复:写入将发送到远程服务器,但不会返回确认,并且不会触发任何事件。" + +#: ../../library/bluetooth.rst:609 +msgid "" +"``mode=1`` is a write-with-response: the remote server is requested to " +"send a response/acknowledgement that it received the data." +msgstr "``mode=1`` 是带回复的写入:请求远程服务器发送响应/确认,表示它已接收数据。" + +#: ../../library/bluetooth.rst:613 +msgid "" +"If a response is received from the remote server the " +"``_IRQ_GATTC_WRITE_DONE`` event will be raised." +msgstr "如果从远程服务器接收到响应,则将触发 ``_IRQ_GATTC_WRITE_DONE`` 事件。" + +#: ../../library/bluetooth.rst:618 +msgid "" +"Initiate MTU exchange with a connected server, using the preferred MTU " +"set using ``BLE.config(mtu=value)``." +msgstr "使用首选 MTU 进行与已连接服务器的 MTU 交换,设置为 ``BLE.config(mtu=value)``。" + +#: ../../library/bluetooth.rst:621 +msgid "" +"The ``_IRQ_MTU_EXCHANGED`` event will be raised when MTU exchange " +"completes." +msgstr "完成 MTU 交换时,将触发 ``_IRQ_MTU_EXCHANGED`` 事件。" + +#: ../../library/bluetooth.rst:624 +msgid "" +"**Note:** MTU exchange is typically initiated by the central. When using " +"the BlueKitchen stack in the central role, it does not support a remote " +"peripheral initiating the MTU exchange. NimBLE works for both roles." +msgstr "" +"**注意:** MTU 交换通常由中心发起。使用 BlueKitchen 堆栈处于中心角色时,它不支持远程外围设备发起 MTU 交换。NimBLE" +" 对两种角色都起作用。" + +#: ../../library/bluetooth.rst:630 +msgid "L2CAP connection-oriented-channels" +msgstr "L2CAP 连接定向通道" + +#: ../../library/bluetooth.rst:632 +msgid "" +"This feature allows for socket-like data exchange between two BLE " +"devices. Once the devices are connected via GAP, either device can listen" +" for the other to connect on a numeric PSM (Protocol/Service " +"Multiplexer)." +msgstr "" +"此功能允许两个 BLE 设备之间进行类似套接字的数据交换。一旦设备通过 GAP 连接,任何一个设备都可以侦听另一个设备在数字 " +"PSM(协议/服务复用器)上的连接。" + +#: ../../library/bluetooth.rst:636 +msgid "" +"**Note:** This is currently only supported when using the NimBLE stack on" +" STM32 and Unix (not ESP32). Only one L2CAP channel may be active at a " +"given time (i.e. you cannot connect while listening)." +msgstr "" +"**注意:** 目前在 EPS32, STM32 和 Unix 上使用 NimBLE 堆栈支持此功能。在任何给定时间只能有一个 L2CAP " +"通道处于活动状态(即您不能在侦听时连接)。" + +#: ../../library/bluetooth.rst:640 +msgid "" +"Active L2CAP channels are identified by the connection handle that they " +"were established on and a CID (channel ID)." +msgstr "活动的 L2CAP 通道由建立它们的连接句柄和 CID(通道 ID)标识。" + +#: ../../library/bluetooth.rst:643 +msgid "" +"Connection-oriented channels have built-in credit-based flow control. " +"Unlike ATT, where devices negotiate a shared MTU, both the listening and " +"connecting devices each set an independent MTU which limits the maximum " +"amount of outstanding data that the remote device can send before it is " +"fully consumed in :meth:`l2cap_recvinto `." +msgstr "" +"连接定向通道具有内置的基于信用的流控制。与 ATT 不同,在 ATT 中,设备会协商共享的MTU,依赖于 " +":meth:`l2cap_recvinto ` 中的缓冲区的最大值。" + +#: ../../library/bluetooth.rst:651 +msgid "" +"Start listening for incoming L2CAP channel requests on the specified " +"*psm* with the local MTU set to *mtu*." +msgstr "以本地 MTU 设置为 *mtu*,开始侦听指定 *psm* 上的传入 L2CAP 通道请求。" + +#: ../../library/bluetooth.rst:654 +msgid "" +"When a remote device initiates a connection, the ``_IRQ_L2CAP_ACCEPT`` " +"event will be raised, which gives the listening server a chance to reject" +" the incoming connection (by returning a non-zero integer)." +msgstr "当远程设备启动连接时,将触发 ``_IRQ_L2CAP_ACCEPT`` 事件,这使得侦听服务器有机会拒绝传入的连接(通过返回非零整数)。" + +#: ../../library/bluetooth.rst:658 +msgid "" +"Once the connection is accepted, the ``_IRQ_L2CAP_CONNECT`` event will be" +" raised, allowing the server to obtain the channel id (CID) and the local" +" and remote MTU." +msgstr "一旦接受连接,将触发 ``_IRQ_L2CAP_CONNECT`` 事件,允许服务器获取通道 ID(CID)和本地和远程 MTU。" + +#: ../../library/bluetooth.rst:662 +msgid "**Note:** It is not currently possible to stop listening." +msgstr "**注意:** 目前无法停止侦听。" + +#: ../../library/bluetooth.rst:666 +msgid "" +"Connect to a listening peer on the specified *psm* with local MTU set to " +"*mtu*." +msgstr "使用本地 MTU 设置为 *mtu*,连接到指定 *psm* 上的侦听对等端。" + +#: ../../library/bluetooth.rst:668 +msgid "" +"On successful connection, the ``_IRQ_L2CAP_CONNECT`` event will be " +"raised, allowing the client to obtain the CID and the local and remote " +"(peer) MTU." +msgstr "成功连接时,将触发 ``_IRQ_L2CAP_CONNECT`` 事件,允许客户端获取 CID 以及本地和远程(对等)MTU。" + +#: ../../library/bluetooth.rst:671 +msgid "" +"An unsuccessful connection will raise the ``_IRQ_L2CAP_DISCONNECT`` event" +" with a non-zero status." +msgstr "连接失败将触发带有非零状态的 ``_IRQ_L2CAP_DISCONNECT`` 事件。" + +#: ../../library/bluetooth.rst:676 +msgid "" +"Disconnect an active L2CAP channel with the specified *conn_handle* and " +"*cid*." +msgstr "断开指定 *conn_handle* 和 *cid* 的活动 L2CAP 通道。" + +#: ../../library/bluetooth.rst:681 +msgid "" +"Send the specified *buf* (which must support the buffer protocol) on the " +"L2CAP channel identified by *conn_handle* and *cid*." +msgstr "在由 *conn_handle* 和 *cid* 标识的 L2CAP 通道上发送指定的 *buf* (必须支持缓冲区协议)。" + +#: ../../library/bluetooth.rst:684 +msgid "" +"The specified buffer cannot be larger than the remote (peer) MTU, and no " +"more than twice the size of the local MTU." +msgstr "指定的缓冲区大小不能大于远程(对等) MTU,并且不能超过本地 MTU 的两倍。" + +#: ../../library/bluetooth.rst:687 +msgid "" +"This will return ``False`` if the channel is now \"stalled\", which means" +" that :meth:`l2cap_send ` must not be called again until " +"the ``_IRQ_L2CAP_SEND_READY`` event is received (which will happen when " +"the remote device grants more credits, typically after it has received " +"and processed the data)." +msgstr "" +"如果通道现在处于“停滞”状态,则将返回 ``False`` ,这意味着在接收到 ``_IRQ_L2CAP_SEND_READY`` " +"事件之前不能再次调用 :meth:`l2cap_send ` (这将在远程设备授予更多信用后发生, " +"通常在它接收并处理数据之后)。" + +#: ../../library/bluetooth.rst:695 +msgid "" +"Receive data from the specified *conn_handle* and *cid* into the provided" +" *buf* (which must support the buffer protocol, e.g. bytearray or " +"memoryview)." +msgstr "" +"从指定的 *conn_handle* 和 *cid* 处接收数据到提供的 *buf* 中(必须支持缓冲区协议,例如 bytearray 或 " +"memoryview)。" + +#: ../../library/bluetooth.rst:699 +msgid "Returns the number of bytes read from the channel." +msgstr "返回从通道中读取的字节数。" + +#: ../../library/bluetooth.rst:701 +msgid "If *buf* is None, then returns the number of bytes available." +msgstr "如果 *buf* 为 None,则返回可用的字节数。" + +#: ../../library/bluetooth.rst:703 +msgid "" +"**Note:** After receiving the ``_IRQ_L2CAP_RECV`` event, the application " +"should continue calling :meth:`l2cap_recvinto ` until" +" no more bytes are available in the receive buffer (typically up to the " +"size of the remote (peer) MTU)." +msgstr "" +"**注意:** 在接收到 ``_IRQ_L2CAP_RECV`` 事件之后,应用程序应继续调用 :meth:`l2cap_recvinto " +"`,直到接收缓冲区中没有更多的字节可用 (通常最多等于远程(对等) MTU 的大小)。" + +#: ../../library/bluetooth.rst:708 +msgid "" +"Until the receive buffer is empty, the remote device will not be granted " +"more channel credits and will be unable to send any more data." +msgstr "在接收缓冲区为空之前,远程设备将不会被授予更多的通道信用,也不会发送更多数据。" + +#: ../../library/bluetooth.rst:713 +msgid "Pairing and bonding" +msgstr "配对和绑定" + +#: ../../library/bluetooth.rst:715 +msgid "" +"Pairing allows a connection to be encrypted and authenticated via " +"exchange of secrets (with optional MITM protection via passkey " +"authentication)." +msgstr "配对允许通过交换密钥(通过可选的 MITM 保护通过密钥认证)对连接进行加密和认证。" + +#: ../../library/bluetooth.rst:718 +msgid "" +"Bonding is the process of storing those secrets into non-volatile " +"storage. When bonded, a device is able to resolve a resolvable private " +"address (RPA) from another device based on the stored identity resolving " +"key (IRK). To support bonding, an application must implement the " +"``_IRQ_GET_SECRET`` and ``_IRQ_SET_SECRET`` events." +msgstr "" +"绑定是将这些密钥存储到非易失性存储器中的过程。当绑定时,设备能够基于存储的身份解析密钥(IRK)从另一个设备解析可解析的私有地址(RPA)。要支持绑定,应用程序必须实现" +" ``_IRQ_GET_SECRET`` 和 ``_IRQ_SET_SECRET`` 事件。" + +#: ../../library/bluetooth.rst:724 +msgid "" +"**Note:** This is currently only supported when using the NimBLE stack on" +" ESP32, STM32 and Unix." +msgstr "**注意:** 目前仅在使用 NimBLE 栈的 ESP32、STM32 和 Unix 系统上支持此功能。" + +#: ../../library/bluetooth.rst:729 +msgid "Initiate pairing with the remote device." +msgstr "启动与远程设备的配对。" + +#: ../../library/bluetooth.rst:731 +msgid "" +"Before calling this, ensure that the ``io``, ``mitm``, ``le_secure``, and" +" ``bond`` configuration options are set (via :meth:`config`)." +msgstr "" +"在调用此方法之前,请确保通过 :meth:`config` 设置了 ``io``、, ``mitm`` 、 " +"``le_secure`` 和 ``bond`` 配置选项。" + +#: ../../library/bluetooth.rst:734 +msgid "" +"On successful pairing, the ``_IRQ_ENCRYPTION_UPDATE`` event will be " +"raised." +msgstr "配对成功后,将触发 ``_IRQ_ENCRYPTION_UPDATE`` 事件。" + +#: ../../library/bluetooth.rst:738 +msgid "" +"Respond to a ``_IRQ_PASSKEY_ACTION`` event for the specified " +"*conn_handle* and *action*." +msgstr "响应指定 *conn_handle* 和 *action* 的 ``_IRQ_PASSKEY_ACTION`` 事件。" + +#: ../../library/bluetooth.rst:741 +msgid "" +"The *passkey* is a numeric value and will depend on on the *action* " +"(which will depend on what I/O capability has been set):" +msgstr "" +"*passkey* 是一个数字值,将取决于 *action* (这取决于已设置的 I/O 能力):" + +#: ../../library/bluetooth.rst:744 +msgid "" +"When the *action* is ``_PASSKEY_ACTION_INPUT``, then the application " +"should prompt the user to enter the passkey that is shown on the remote " +"device." +msgstr "当 *action* 为 ``_PASSKEY_ACTION_INPUT`` 时,应用程序应提示用户输入在远程设备上显示的密码。" + +#: ../../library/bluetooth.rst:746 +msgid "" +"When the *action* is ``_PASSKEY_ACTION_DISPLAY``, then the application " +"should generate a random 6-digit passkey and show it to the user." +msgstr "当 *action* 为 ``_PASSKEY_ACTION_DISPLAY`` 时,应用程序应生成一个随机的 6 位数密码并显示给用户。" + +#: ../../library/bluetooth.rst:748 +msgid "" +"When the *action* is ``_PASSKEY_ACTION_NUMERIC_COMPARISON``, then the " +"application should show the passkey that was provided in the " +"``_IRQ_PASSKEY_ACTION`` event and then respond with either ``0`` (cancel " +"pairing), or ``1`` (accept pairing)." +msgstr "" +"当 *action* 为 ``_PASSKEY_ACTION_NUMERIC_COMPARISON`` 时,应用程序应显示在 " +"``_IRQ_PASSKEY_ACTION`` 事件中提供的密码,然后响应为 ``0`` (取消配对)或 ``1`` (接受配对)。" + +#: ../../library/bluetooth.rst:754 +msgid "class UUID" +msgstr "UUID 类" + +#: ../../library/bluetooth.rst:762 +msgid "Creates a UUID instance with the specified **value**." +msgstr "使用指定的 **value** 创建 UUID 实例。" + +#: ../../library/bluetooth.rst:764 +msgid "The **value** can be either:" +msgstr "**value** 可以是:" + +#: ../../library/bluetooth.rst:766 +msgid "A 16-bit integer. e.g. ``0x2908``." +msgstr "16 位整数。例如,``0x2908``。" + +#: ../../library/bluetooth.rst:767 +msgid "" +"An object with the buffer protocol and that is 2, 4 or 16 bytes long, " +"e.g. ``b'\\x08\\x29'``." +msgstr "" +"一个实现了缓冲区协议且长度为 2、4 或 16 字节的对象,例如 ``b'\\x08\\x29'``。" + +#: ../../library/bluetooth.rst:768 +msgid "A 128-bit UUID string. e.g. ``'6E400001-B5A3-F393-E0A9-E50E24DCCA9E'``." +msgstr "128 位 UUID 字符串。例如, ``'6E400001-B5A3-F393-E0A9-E50E24DCCA9E'``。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/builtins.po b/docs/locale/zh_CN/LC_MESSAGES/library/builtins.po new file mode 100644 index 0000000000000..c9ec7f9b2fe24 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/builtins.po @@ -0,0 +1,107 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/builtins.rst:2 +msgid ":mod:`builtins` -- builtin functions and exceptions" +msgstr ":mod:`builtins` -- 内置模块和异常" + +#: ../../library/builtins.rst:4 +msgid "" +"All builtin functions and exceptions are described here. They are also " +"available via ``builtins`` module." +msgstr "此处描述了所有内置函数和异常,这些函数和异常也可通过 ``builtins`` 模块获得。" + +#: ../../library/builtins.rst:8 +msgid "Functions and types" +msgstr "函数和类型" + +#: ../../library/builtins.rst:22 +msgid "|see_cpython| `python:bytearray`." +msgstr "|see_cpython| `python:bytearray`。" + +#: ../../library/builtins.rst:26 +msgid "|see_cpython| `python:bytes`." +msgstr "|see_cpython| `python:bytes`。" + +#: ../../library/builtins.rst:40 +msgid "" +"The argument *name* should be a string, and this function deletes the " +"named attribute from the object given by *obj*." +msgstr "参数名称应为一个字符串,且此函数从 *obj* 给出的对象中删除指定的属性。" + +#: ../../library/builtins.rst:79 ../../library/builtins.rst:84 +msgid "" +"In MicroPython, `byteorder` parameter must be positional (this is " +"compatible with CPython)." +msgstr "在MicroPython中, `byteorder` 参数须为位置参数(与CPython兼容)。" + +#: ../../library/builtins.rst:87 +msgid "" +"The optional ``signed`` kwarg from CPython is not supported. MicroPython " +"currently converts negative integers as signed, and positive as unsigned." +" (:ref:`Details `.)" +msgstr "" +"不支持 CPython 中的可选 ``signed`` 关键字参数。MicroPython " +"目前将负整数作为有符号数转换,正整数作为无符号数转换。(:ref:`Details `。)" + +#: ../../library/builtins.rst:109 +msgid "|see_cpython| `python:memoryview`." +msgstr "|see_cpython| `python:memoryview`。" + +#: ../../library/builtins.rst:143 +msgid "The *slice* builtin is the type that slice objects have." +msgstr "内置 *slice* 为切片对象所具有的类型。" + +#: ../../library/builtins.rst:163 +msgid "Exceptions" +msgstr "异常" + +#: ../../library/builtins.rst:177 +msgid "|see_cpython| `python:KeyboardInterrupt`." +msgstr "|see_cpython| `python:KeyboardInterrupt`。" + +#: ../../library/builtins.rst:179 +msgid "See also in the context of :ref:`soft_bricking`." +msgstr "另请参阅 :ref:`soft_bricking` 的相关内容。" + +#: ../../library/builtins.rst:199 +msgid "|see_cpython| `python:SystemExit`." +msgstr "|see_cpython| `python:SystemExit`。" + +#: ../../library/builtins.rst:201 +msgid "" +"On non-embedded ports (i.e. Windows and Unix), an unhandled " +"``SystemExit`` exits the MicroPython process in a similar way to CPython." +msgstr "" +"在非嵌入式端口(即 Windows 和 Unix)上,未处理的 " +"``SystemExit`` 会以类似于 CPython 的方式退出 MicroPython 进程。" + +#: ../../library/builtins.rst:204 +msgid "" +"On embedded ports, an unhandled ``SystemExit`` currently causes a " +":ref:`soft_reset` of MicroPython." +msgstr "在嵌入式端口上,未处理的 ``SystemExit`` 目前会导致 MicroPython 的 :ref:`soft_reset`。" + +#: ../../library/builtins.rst:209 +msgid "|see_cpython| `python:TypeError`." +msgstr "|see_cpython| `python:TypeError`。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/cmath.po b/docs/locale/zh_CN/LC_MESSAGES/library/cmath.po new file mode 100644 index 0000000000000..9ffbf36f97075 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/cmath.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-25 01:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/cmath.rst:2 +msgid ":mod:`cmath` -- mathematical functions for complex numbers" +msgstr ":mod:`cmath` -- 复数的数学函数" + +#: ../../library/cmath.rst:7 +msgid "|see_cpython_module| :mod:`python:cmath`." +msgstr "|see_cpython_module| :mod:`python:cmath`。" + +#: ../../library/cmath.rst:9 +msgid "" +"The ``cmath`` module provides some basic mathematical functions for " +"working with complex numbers." +msgstr "``cmath`` 模块提供一些对复数有效的基本数学函数。" + +#: ../../library/cmath.rst:13 +msgid "Functions" +msgstr "函数" + +#: ../../library/cmath.rst:17 +msgid "Return the cosine of ``z``." +msgstr "返回 ``z`` 的余弦。" + +#: ../../library/cmath.rst:21 +msgid "Return the exponential of ``z``." +msgstr "返回 ``z`` 的指数。" + +#: ../../library/cmath.rst:25 +msgid "" +"Return the natural logarithm of ``z``. The branch cut is along the " +"negative real axis." +msgstr "返回 ``z`` 的自然对数。分支切割线沿着负实轴。" + +#: ../../library/cmath.rst:29 +msgid "" +"Return the base-10 logarithm of ``z``. The branch cut is along the " +"negative real axis." +msgstr "返回以 ``z`` 以10为底的对数。分支切割线沿着负实轴。" + +#: ../../library/cmath.rst:33 +msgid "Returns the phase of the number ``z``, in the range (-pi, +pi]." +msgstr "返回数字 ``z`` 的相位,范围为(-pi, +pi]。" + +#: ../../library/cmath.rst:37 +msgid "Returns, as a tuple, the polar form of ``z``." +msgstr "以元组返回 ``z`` 的极坐标形式。" + +#: ../../library/cmath.rst:41 +msgid "Returns the complex number with modulus ``r`` and phase ``phi``." +msgstr "使用模块 ``r`` 和相位 ``phi`` 来返回复数。" + +#: ../../library/cmath.rst:45 +msgid "Return the sine of ``z``." +msgstr "返回 ``z`` 的正弦。" + +#: ../../library/cmath.rst:49 +msgid "Return the square-root of ``z``." +msgstr "返回 ``z`` 的平方根。" + +#: ../../library/cmath.rst:52 +msgid "Constants" +msgstr "常量" + +#: ../../library/cmath.rst:56 +msgid "base of the natural logarithm" +msgstr "自然对数的底数" + +#: ../../library/cmath.rst:60 +msgid "the ratio of a circle's circumference to its diameter" +msgstr "圆周长与直径之比" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/collections.po b/docs/locale/zh_CN/LC_MESSAGES/library/collections.po new file mode 100644 index 0000000000000..2499f5d3530d0 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/collections.po @@ -0,0 +1,134 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/collections.rst:2 +msgid ":mod:`collections` -- collection and container types" +msgstr ":mod:`collections` -- 集合和容器类型" + +#: ../../library/collections.rst:7 +msgid "|see_cpython_module| :mod:`python:collections`." +msgstr "|see_cpython_module| :mod:`python:collections`。" + +#: ../../library/collections.rst:9 +msgid "" +"This module implements advanced collection and container types to " +"hold/accumulate various objects." +msgstr "该模块实现了高级的集合和容器类型,用于保存/累积各种对象。" + +#: ../../library/collections.rst:13 +msgid "Classes" +msgstr "类" + +#: ../../library/collections.rst:17 +msgid "" +"Deques (double-ended queues) are a list-like container that support O(1) " +"appends and pops from either side of the deque. New deques are created " +"using the following arguments:" +msgstr "Deques(双端队列)是一种类似于列表的容器,支持从deque的任一端进行 O(1)的附加和弹出操作。可以使用以下参数创建新的deque:" + +#: ../../library/collections.rst:21 +msgid "" +"*iterable* is an iterable used to populate the deque when it is created." +" It can be an empty tuple or list to create a deque that is initially " +"empty." +msgstr "*iterable* 是在创建时用于填充 deque 的可迭代对象。它可以是一个空元组或列表," +"用于创建一个初始为空的 deque。" + +#: ../../library/collections.rst:25 +msgid "" +"*maxlen* must be specified and the deque will be bounded to this maximum " +"length. Once the deque is full, any new items added will discard items " +"from the opposite end." +msgstr "必须指定 *maxlen*,deque将被限制为最大长度。一旦deque已满,添加的任何新项都将从另一端丢弃项。" + +#: ../../library/collections.rst:29 +msgid "The optional *flags* can be 1 to check for overflow when adding items." +msgstr "可选的 *flags* 可以为 1,以检查添加项时是否溢出。" + +#: ../../library/collections.rst:31 +msgid "" +"Deque objects support `bool`, `len`, iteration and subscript load and " +"store. They also have the following methods:" +msgstr "Deque 对象支持 `bool`、`len`、迭代以及下标加载和存储。它们还具有以下方法:" + +#: ../../library/collections.rst:36 +msgid "" +"Add *x* to the right side of the deque. Raises ``IndexError`` if overflow" +" checking is enabled and there is no more room in the queue." +msgstr "将 *x* 添加到 deque 的右侧。如果启用了溢出检查且队列没有更多空间,将引发 " +"``IndexError``。" + +#: ../../library/collections.rst:42 +msgid "" +"Add *x* to the left side of the deque. Raises ``IndexError`` if overflow " +"checking is enabled and there is no more room in the queue." +msgstr "将 *x* 添加到 deque 的左侧。如果启用了溢出检查且队列没有更多空间,将引发 " +"``IndexError``。" + +#: ../../library/collections.rst:48 +msgid "" +"Remove and return an item from the right side of the deque. Raises " +"``IndexError`` if no items are present." +msgstr "从 deque 的右侧移除并返回一个项。如果队列为空,将引发 ``IndexError``。" + +#: ../../library/collections.rst:53 +msgid "" +"Remove and return an item from the left side of the deque. Raises " +"``IndexError`` if no items are present." +msgstr "从 deque 的左侧移除并返回一个项。如果队列为空,将引发 ``IndexError``。" + +#: ../../library/collections.rst:58 +msgid "" +"Extend the deque by appending all the items from *iterable* to the right " +"of the deque. Raises ``IndexError`` if overflow checking is enabled and " +"there is no more room in the deque." +msgstr "" +"通过将 *iterable* 中的所有项追加到 deque 的右侧来扩展 deque。" +"如果启用了溢出检查且 deque 没有更多空间,将引发 ``IndexError``。" + +#: ../../library/collections.rst:65 +msgid "" +"This is factory function to create a new namedtuple type with a specific " +"name and set of fields. A namedtuple is a subclass of tuple which allows " +"to access its fields not just by numeric index, but also with an " +"attribute access syntax using symbolic field names. Fields is a sequence " +"of strings specifying field names. For compatibility with CPython it can " +"also be a a string with space-separated field named (but this is less " +"efficient). Example of use::" +msgstr "" +"这是一个工厂函数,用于创建具有特定名称和字段集的新命名元组类型。命名元组是tuple " +"的子类,它允许不仅通过数字索引,而且还可以使用带有符号字段名称的属性访问语法来访问其字段。字段是指定字段名称的字符串序列。为了与 CPython " +"兼容,它也可以是一个带有空格分隔的字段名称的字符串(但这样效率较低)。使用示例::" + +#: ../../library/collections.rst:83 +msgid "" +"``dict`` type subclass which remembers and preserves the order of keys " +"added. When ordered dict is iterated over, keys/items are returned in the" +" order they were added::" +msgstr "``dict`` 类型的子类,它记住并保留添加的键的顺序。当有序字典进行迭代时,键/项将以它们添加的顺序返回::" + +#: ../../library/collections.rst:98 +msgid "Output::" +msgstr "输出::" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/cryptolib.po b/docs/locale/zh_CN/LC_MESSAGES/library/cryptolib.po new file mode 100644 index 0000000000000..5ef42e745e66c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/cryptolib.po @@ -0,0 +1,94 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/cryptolib.rst:2 +msgid ":mod:`cryptolib` -- cryptographic ciphers" +msgstr ":mod:`cryptolib` -- 加密密码学算法" + +#: ../../library/cryptolib.rst:8 +msgid "Classes" +msgstr "类" + +#: ../../library/cryptolib.rst:14 +msgid "" +"Initialize cipher object, suitable for encryption/decryption. Note: after" +" initialization, cipher object can be use only either for encryption or " +"decryption. Running decrypt() operation after encrypt() or vice versa is " +"not supported." +msgstr "" +"初始化密码对象,适用于加密/解密。注意:初始化后,密码对象只能用于加密或" +"解密之一。在执行 encrypt() 操作后再执行 decrypt(),或者反之,是不支持的。" + +#: ../../library/cryptolib.rst:19 +msgid "Parameters are:" +msgstr "参数为:" + +#: ../../library/cryptolib.rst:21 +msgid "*key* is an encryption/decryption key (bytes-like)." +msgstr "*key* 是加密/解密密钥(类似于字节)。" + +#: ../../library/cryptolib.rst:22 +msgid "*mode* is:" +msgstr "*mode* 为:" + +#: ../../library/cryptolib.rst:24 +msgid "" +"``1`` (or ``cryptolib.MODE_ECB`` if it exists) for Electronic Code Book " +"(ECB)." +msgstr "``1`` (或者 ``cryptolib.MODE_ECB`` ,如果存在)表示Electronic Code " +"Book(ECB)模式。" + +#: ../../library/cryptolib.rst:25 +msgid "" +"``2`` (or ``cryptolib.MODE_CBC`` if it exists) for Cipher Block Chaining " +"(CBC)." +msgstr "``2`` (或者 ``cryptolib.MODE_CBC`` ,如果存在)表示Cipher Block " +"Chaining(CBC)模式。" + +#: ../../library/cryptolib.rst:26 +msgid "``6`` (or ``cryptolib.MODE_CTR`` if it exists) for Counter mode (CTR)." +msgstr "``6`` (或者 ``cryptolib.MODE_CTR`` ,如果存在)表示Counter mode(CTR)模式。" + +#: ../../library/cryptolib.rst:28 +msgid "*IV* is an initialization vector for CBC mode." +msgstr "*IV* 是 CBC 模式的初始化向量。" + +#: ../../library/cryptolib.rst:29 +msgid "For Counter mode, *IV* is the initial value for the counter." +msgstr "对于计数器模式,*IV* 是计数器的初始值。" + +#: ../../library/cryptolib.rst:33 +msgid "" +"Encrypt *in_buf*. If no *out_buf* is given result is returned as a newly " +"allocated `bytes` object. Otherwise, result is written into mutable " +"buffer *out_buf*. *in_buf* and *out_buf* can also refer to the same " +"mutable buffer, in which case data is encrypted in-place." +msgstr "" +"加密 *in_buf*。如果没有给出 *out_buf*,则结果将作为新分配的 `bytes` " +"对象返回。否则,结果将写入可变缓冲区 *out_buf*。*in_buf* 和 *out_buf* " +"也可以引用同一个可变缓冲区,在这种情况下,数据将被原地加密。" + +#: ../../library/cryptolib.rst:40 +msgid "Like `encrypt()`, but for decryption." +msgstr "类似于 `encrypt()`,但用于解密。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/deflate.po b/docs/locale/zh_CN/LC_MESSAGES/library/deflate.po new file mode 100644 index 0000000000000..e120067a7ebaa --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/deflate.po @@ -0,0 +1,281 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/deflate.rst:2 +msgid ":mod:`deflate` -- deflate compression & decompression" +msgstr ":mod:`deflate` -- DEFLATE 压缩 & 解压" + +#: ../../library/deflate.rst:7 +msgid "" +"This module allows compression and decompression of binary data with the " +"`DEFLATE algorithm `_ (commonly " +"used in the zlib library and gzip archiver)." +msgstr "" +"该模块允许使用 `DEFLATE algorithm `_ " +"(通常用于 zlib 库和 gzip 压缩器)对二进制数据进行压缩和解压缩。" + +#: ../../library/deflate.rst:11 +msgid "**Availability:**" +msgstr "**可用性:**" + +#: ../../library/deflate.rst:13 +msgid "Added in MicroPython v1.21." +msgstr "在 MicroPython v1.21 中添加。" + +#: ../../library/deflate.rst:15 +msgid "" +"Decompression: Enabled via the ``MICROPY_PY_DEFLATE`` build option, on by" +" default on ports with the \"extra features\" level or higher (which is " +"most boards)." +msgstr "" +"解压缩: 通过 ``MICROPY_PY_DEFLATE`` 构建选项启用,默认情况下在具有 \"extra " +"features \" 级别或更高级别的移植版本上启用(大多数开发板)。" + +#: ../../library/deflate.rst:18 +msgid "" +"Compression: Enabled via the ``MICROPY_PY_DEFLATE_COMPRESS`` build " +"option, on by default on ports with the \"full features\" level or higher" +" (generally this means you need to build your own firmware to enable " +"this)." +msgstr "" +"压缩: 通过 ``MICROPY_PY_DEFLATE_COMPRESS`` 构建选项启用,默认情况下在具有 " +"\"full features\" 级别或更高级别的移植版本上启用(通常这意味着您需要构建自己" +"的固件以启用此功能)。" + +#: ../../library/deflate.rst:23 +msgid "Classes" +msgstr "类" + +#: ../../library/deflate.rst:27 +msgid "" +"This class can be used to wrap a *stream* which is any :term:`stream-like" +" ` object such as a file, socket, or stream (including " +":class:`io.BytesIO`). It is itself a stream and implements the standard " +"read/readinto/write/close methods." +msgstr "" +"这个类可以用来包装一个 *stream*,它是任何 :term:`stream-like ` 对象," +"比如文件、套接字或流(包括 :class:`io.BytesIO`)。它本身是一个流,并实现了标准的" +"read/readinto/write/close 方法。" + +#: ../../library/deflate.rst:32 +msgid "" +"The *stream* must be a blocking stream. Non-blocking streams are " +"currently not supported." +msgstr "*stream* 必须是一个阻塞流。非阻塞流目前不受支持。" + +#: ../../library/deflate.rst:35 +msgid "" +"The *format* can be set to any of the constants defined below, and " +"defaults to ``AUTO`` which for decompressing will auto-detect gzip or " +"zlib streams, and for compressing it will generate a raw stream." +msgstr "" +"*format* 可以设置为下面定义的任何常量,默认为 ``AUTO``,对于解压缩,它将自动检" +"测 gzip 或 zlib 流,对于压缩,它将生成一个原始流。" + +#: ../../library/deflate.rst:39 +msgid "" +"The *wbits* parameter sets the base-2 logarithm of the DEFLATE dictionary" +" window size. So for example, setting *wbits* to ``10`` sets the window " +"size to 1024 bytes. Valid values are ``5`` to ``15`` inclusive " +"(corresponding to window sizes of 32 to 32k bytes)." +msgstr "" +"*wbits* 参数设置了 DEFLATE 字典窗口大小的以 2 为底的对数。例如,将 *wbits* 设置为 ``10`` ,将窗口大小设置为 " +"1024 字节。有效值为 ``5`` 到 ``15`` (包括)(对应窗口大小为 32 到 32k 字节)。" + +#: ../../library/deflate.rst:44 +msgid "" +"If *wbits* is set to ``0`` (the default), then for compression a window " +"size of 256 bytes will be used (as if *wbits* was set to 8). For " +"decompression, it depends on the format:" +msgstr "" +"如果 *wbits* 设置为 ``0`` (默认值),则对于压缩,将使用 256 字节的窗口大小" +"(就好像 *wbits* 设置为 8)。对于解压缩,它取决于格式:" + +#: ../../library/deflate.rst:48 +msgid "``RAW`` will use 256 bytes (corresponding to *wbits* set to 8)." +msgstr "``RAW`` 将使用 256 字节(对应 *wbits* 设置为 8)。" + +#: ../../library/deflate.rst:49 +msgid "" +"``ZLIB`` (or ``AUTO`` with zlib detected) will use the value from the " +"zlib header." +msgstr "``ZLIB`` (或检测到 zlib 的 ``AUTO``)将使用 zlib 标头中的值。" + +#: ../../library/deflate.rst:51 +msgid "" +"``GZIP`` (or ``AUTO`` with gzip detected) will use 32 kilobytes " +"(corresponding to *wbits* set to 15)." +msgstr "``GZIP`` (或检测到 gzip 的 ``AUTO``)将使用 32 千字节(对应 *wbits* 设置为 15)。" + +#: ../../library/deflate.rst:54 +msgid "" +"See the :ref:`window size ` notes below for more " +"information about the window size, zlib, and gzip streams." +msgstr "" +"查看下面关于窗口大小、zlib 和 gzip 流的 :ref:`window size ` 注意事项," +"获取更多信息。" + +#: ../../library/deflate.rst:57 +msgid "" +"If *close* is set to ``True`` then the underlying stream will be closed " +"automatically when the :class:`deflate.DeflateIO` stream is closed. This " +"is useful if you want to return a :class:`deflate.DeflateIO` stream that " +"wraps another stream and not have the caller need to know about managing " +"the underlying stream." +msgstr "" +"如果 *close* 设置为 ``True``,那么在关闭 :class:`deflate.DeflateIO` 流时将" +"自动关闭底层流。如果您希望返回一个包装另一个流的 :class:`deflate.DeflateIO` 流," +"并且不希望调用者知道如何管理底层流,这是有用的。" + +#: ../../library/deflate.rst:63 +msgid "" +"If compression is enabled, a given :class:`deflate.DeflateIO` instance " +"supports both reading and writing. For example, a bidirectional stream " +"like a socket can be wrapped, which allows for compression/decompression " +"in both directions." +msgstr "" +"如果启用了压缩,给定的 :class:`deflate.DeflateIO` 实例支持读和写。例如,可以" +"包装一个双向流(如套接字),这样就可以在两个方向上进行压缩/解压缩。" + +#: ../../library/deflate.rst:69 +msgid "Constants" +msgstr "常量" + +#: ../../library/deflate.rst:76 +msgid "Supported values for the *format* parameter." +msgstr "*format* 参数支持的值。" + +#: ../../library/deflate.rst:79 +msgid "Examples" +msgstr "示例" + +#: ../../library/deflate.rst:81 +msgid "" +"A typical use case for :class:`deflate.DeflateIO` is to read or write a " +"compressed file from storage:" +msgstr ":class:`deflate.DeflateIO` 的典型用例是从存储中读取或写入压缩文件:" + +#: ../../library/deflate.rst:98 +msgid "" +"Because :class:`deflate.DeflateIO` is a stream, it can be used for " +"example with :meth:`json.dump` and :meth:`json.load` (and any other " +"places streams can be used):" +msgstr "" +"因为 :class:`deflate.DeflateIO` 是一个流,所以它可以与 :meth:`json.dump` 和 :meth:`json.load` (" +"以及任何其他可以使用流的地方)一起使用:" + +#: ../../library/deflate.rst:118 +msgid "" +"If your source data is not in a stream format, you can use " +":class:`io.BytesIO` to turn it into a stream suitable for use with " +":class:`deflate.DeflateIO`:" +msgstr "" +"如果您的源数据不是流格式,可以使用 :class:`io.BytesIO` 将其转换为适合与 " +":class:`deflate.DeflateIO`: 一起使用的流:" + +#: ../../library/deflate.rst:140 +msgid "Deflate window size" +msgstr "DEFLATE 窗口大小" + +#: ../../library/deflate.rst:142 +msgid "" +"The window size limits how far back in the stream the (de)compressor can " +"reference. Increasing the window size will improve compression, but will " +"require more memory and make the compressor slower." +msgstr "" +"窗口大小限制了(解)压缩器在流中可以引用的距离。增加窗口大小将提高压缩率," +"但会需要更多内存,并使压缩器变慢。" + +#: ../../library/deflate.rst:146 +msgid "" +"If an input stream was compressed a given window size, then `DeflateIO` " +"using a smaller window size will fail mid-way during decompression with " +":exc:`OSError`, but only if a back-reference actually refers back further" +" than the decompressor's window size. This means it may be possible to " +"decompress with a smaller window size. For example, this would trivially " +"be the case if the original uncompressed data is shorter than the window " +"size." +msgstr "" +"如果输入流被压缩到了给定的窗口大小,那么使用较小窗口大小的 `DeflateIO` 在解压缩过程中" +"会在中途失败,抛出 :exc:`OSError`,但仅当后向引用实际上超出了解压缩器的窗口大小时。" +"这意味着可能可以使用较小的窗口大小解压缩。例如,如果原始未压缩数据比窗口大小短,则这" +"显然是可能的。" + +#: ../../library/deflate.rst:154 +msgid "Decompression" +msgstr "解压缩" + +#: ../../library/deflate.rst:156 +msgid "" +"The zlib format includes a header which specifies the window size that " +"was used to compress the data. This indicates the maximum window size " +"required to decompress this stream. If this header value is less than the" +" specified *wbits* value (or if *wbits* is unset), then the header value " +"will be used." +msgstr "" +"zlib 格式包括一个头,指定了用于压缩数据的窗口大小。这表示解压缩此流所需的最大窗口大小。" +"如果此头值小于指定的 *wbits* 值(或 *wbits* 未设置),则将使用头值。" + +#: ../../library/deflate.rst:161 +msgid "" +"The gzip format does not include the window size in the header, and " +"assumes that all gzip compressors (e.g. the ``gzip`` utility, or " +"CPython's implementation of :class:`gzip.GzipFile`) use the maximum " +"window size of 32kiB. For this reason, if the *wbits* parameter is not " +"set, the decompressor will use a 32 kiB window size (corresponding to " +"*wbits* set to 15). This means that to be able to decompress an arbitrary" +" gzip stream, you must have at least this much RAM available. If you " +"control the source data, consider instead using the zlib format with a " +"smaller window size." +msgstr "" +"gzip 格式不在头中包括窗口大小,并假定所有 gzip 压缩器(例如 ``gzip`` 实用程序或 CPython " +"的 :class:`gzip.GzipFile` 实现)使用 32kiB 的最大窗口大小。因此,如果 *wbits* 参数未设置," +"则解压缩器将使用 32 kiB 的窗口大小(对应 *wbits* 设置为 15)。这意味着为了能够解压缩任意 " +"gzip 流,您必须至少有这么多 RAM 可用。如果您控制源数据,考虑使用 zlib 格式并使用较小的窗口大小。" + +#: ../../library/deflate.rst:170 +msgid "" +"The raw format has no header and therefore does not include any " +"information about the window size. If *wbits* is not set, then it will " +"default to a window size of 256 bytes, which may not be large enough for " +"a given stream. Therefore it is recommended that you should always " +"explicitly set *wbits* if using the raw format." +msgstr "" +"原始格式没有头,因此不包括有关窗口大小的任何信息。如果未设置 *wbits*,则默认使用" +"256 字节的窗口大小,这可能对于给定的流来说不够大。因此,建议如果使用原始格式," +"应始终明确设置 *wbits*。" + +#: ../../library/deflate.rst:177 +msgid "Compression" +msgstr "压缩" + +#: ../../library/deflate.rst:179 +msgid "" +"For compression, MicroPython will default to a window size of 256 bytes " +"for all formats. This provides a reasonable amount of compression with " +"minimal memory usage and fast compression time, and will generate output " +"that will work with any decompressor." +msgstr "" +"对于压缩,MicroPython 将默认为所有格式使用 256 字节的窗口大小。这提供了合理的压缩量," +"内存使用量小,压缩时间快,并且生成的输出可以与任何解压缩器一起使用。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/errno.po b/docs/locale/zh_CN/LC_MESSAGES/library/errno.po new file mode 100644 index 0000000000000..fe3bdefa89759 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/errno.po @@ -0,0 +1,61 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/errno.rst:2 +msgid ":mod:`errno` -- system error codes" +msgstr ":mod:`errno` -- 系统错误代码" + +#: ../../library/errno.rst:7 +msgid "|see_cpython_module| :mod:`python:errno`." +msgstr "|see_cpython_module| :mod:`python:errno`。" + +#: ../../library/errno.rst:9 +msgid "" +"This module provides access to symbolic error codes for `OSError` " +"exception. A particular inventory of codes depends on :term:`MicroPython " +"port`." +msgstr "该模块提供了对 `OSError` 异常的符号化错误代码的访问。" +"特定错误代码的清单取决于 :term:`MicroPython port` 。" + +#: ../../library/errno.rst:13 +msgid "Constants" +msgstr "常量" + +#: ../../library/errno.rst:17 +msgid "" +"Error codes, based on ANSI C/POSIX standard. All error codes start with " +"\"E\". As mentioned above, inventory of the codes depends on " +":term:`MicroPython port`. Errors are usually accessible as ``exc.errno`` " +"where ``exc`` is an instance of `OSError`. Usage example::" +msgstr "" +"错误代码,基于 ANSI C/POSIX 标准。所有错误代码以 \"E\" 开头。" +"如上所述,错误代码的清单取决于 :term:`MicroPython port`。" +"错误通常可以通过 ``exc.errno`` 访问,其中 ``exc`` 是 `OSError` " +"的一个实例。使用示例::" + +#: ../../library/errno.rst:30 +msgid "" +"Dictionary mapping numeric error codes to strings with symbolic error " +"code (see above)::" +msgstr "将数值错误代码映射到带有符号错误代码的字符串的字典(参见上文)::" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/gc.po b/docs/locale/zh_CN/LC_MESSAGES/library/gc.po new file mode 100644 index 0000000000000..48b5f8e541a48 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/gc.po @@ -0,0 +1,105 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-21 05:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/gc.rst:2 +msgid ":mod:`gc` -- control the garbage collector" +msgstr ":mod:`gc` -- 控制垃圾收集器" + +#: ../../library/gc.rst:7 +msgid "|see_cpython_module| :mod:`python:gc`." +msgstr "|see_cpython_module| :mod:`python:gc`。" + +#: ../../library/gc.rst:10 +msgid "Functions" +msgstr "函数" + +#: ../../library/gc.rst:14 +msgid "Enable automatic garbage collection." +msgstr "启用自动垃圾收集。" + +#: ../../library/gc.rst:18 +msgid "" +"Disable automatic garbage collection. Heap memory can still be " +"allocated, and garbage collection can still be initiated manually using " +":meth:`gc.collect`." +msgstr "禁用自动垃圾收集。堆内存仍然可以被分配,垃圾收集仍然可以通过使用 :meth:`gc." +"collect` 手动启动。" + +#: ../../library/gc.rst:23 +msgid "Run a garbage collection." +msgstr "运行一次垃圾收集。" + +#: ../../library/gc.rst:27 +msgid "Return the number of bytes of heap RAM that are allocated by Python code." +msgstr "返回由Python代码分配的堆RAM的字节数。" + +#: ../../library/gc.rst:29 ../../library/gc.rst:39 ../../library/gc.rst:61 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/gc.rst:32 ../../library/gc.rst:42 +msgid "This function is MicroPython extension." +msgstr "此函数是MicroPython扩展。" + +#: ../../library/gc.rst:36 +msgid "" +"Return the number of bytes of heap RAM that is available for Python code " +"to allocate, or -1 if this amount is not known." +msgstr "返回可供Python代码分配的堆RAM的字节数,如果此数量未知,则返回-1。" + +#: ../../library/gc.rst:46 +msgid "" +"Set or query the additional GC allocation threshold. Normally, a " +"collection is triggered only when a new allocation cannot be satisfied, " +"i.e. on an out-of-memory (OOM) condition. If this function is called, in " +"addition to OOM, a collection will be triggered each time after *amount* " +"bytes have been allocated (in total, since the previous time such an " +"amount of bytes have been allocated). *amount* is usually specified as " +"less than the full heap size, with the intention to trigger a collection " +"earlier than when the heap becomes exhausted, and in the hope that an " +"early collection will prevent excessive memory fragmentation. This is a " +"heuristic measure, the effect of which will vary from application to " +"application, as well as the optimal value of the *amount* parameter." +msgstr "" +"设置或查询额外的GC分配阈值。通常情况下,只有在新的分配无法满足时才会触发收集" +",即在内存不足(OOM)条件下。如果调用此函数,除了OOM条件外,每次分配 *amount*" +" 字节(总的来说,因为上次已经分配了这么多字节)后都会触发一次收集。*amount* " +"通常指定为小于整个堆大小,意图是在堆耗尽之前触发收集,并希望提前收集将防止过" +"度的内存碎片化。这是一种启发式措施,其效果将因应用程序而异,以及 *amount* " +"参数的最佳值也会有所不同。" + +#: ../../library/gc.rst:58 +msgid "" +"Calling the function without argument will return the current value of " +"the threshold. A value of -1 means a disabled allocation threshold." +msgstr "不带参数调用此函数将返回阈值的当前值。-1的值意味着禁用了分配阈值。" + +#: ../../library/gc.rst:64 +msgid "" +"This function is a MicroPython extension. CPython has a similar function " +"- ``set_threshold()``, but due to different GC implementations, its " +"signature and semantics are different." +msgstr "" +"此函数是MicroPython扩展。CPython有一个类似的函数 - " +"``set_threshold()``,但由于GC实现不同,其签名和语义有所不同。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/gzip.po b/docs/locale/zh_CN/LC_MESSAGES/library/gzip.po new file mode 100644 index 0000000000000..886ceff984626 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/gzip.po @@ -0,0 +1,164 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-21 05:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/gzip.rst:2 +msgid ":mod:`gzip` -- gzip compression & decompression" +msgstr ":mod:`gzip` -- gzip 压缩与解压缩" + +#: ../../library/gzip.rst:7 +msgid "|see_cpython_module| :mod:`python:gzip`." +msgstr "|see_cpython_module| :mod:`python:gzip`。" + +#: ../../library/gzip.rst:9 +msgid "" +"This module allows compression and decompression of binary data with the " +"`DEFLATE algorithm `_ used by the " +"gzip file format." +msgstr "" +"此模块允许使用 gzip 文件格式采用的 `DEFLATE algorithm " +"`_ 对二进制数据进行压缩和解压缩。" + +#: ../../library/gzip.rst:13 +msgid "" +"Prefer to use :class:`deflate.DeflateIO` instead of the functions in this " +"module as it provides a streaming interface to compression and decompression " +"which is convenient and more memory efficient when working with reading or " +"writing compressed data to a file, socket, or stream." +msgstr "" +"优先使用 :class:`deflate.DeflateIO`,而不是本模块中的函数,因为它提供了对压缩" +"和解压缩的流接口,当处理读取或写入压缩数据到文件、套接字或流时更方便且更节省" +"内存。" + +#: ../../library/gzip.rst:18 +msgid "**Availability:**" +msgstr "**可用性:**" + +#: ../../library/gzip.rst:20 +msgid "" +"This module is **not present by default** in official MicroPython firmware " +"releases as it duplicates functionality available in the :mod:`deflate " +"` module." +msgstr "" +"此模块 **默认不包含** 在官方 MicroPython 固件发布中,因为它复制了 :mod:`" +"deflate ` 模块中可用的功能。" + +#: ../../library/gzip.rst:24 +msgid "" +"A copy of this module can be installed (or frozen) from :term:`micropython-" +"lib` (`source `_). See :ref:`packages` for more information. " +"This documentation describes that module." +msgstr "" +"此模块的副本可以从 :term:`micropython-lib` ( `source `_ )安装(或冻结)。有关更多信息,请参阅 " +":ref:`packages`。本文档描述了该模块。" + +#: ../../library/gzip.rst:28 +msgid "" +"Compression support will only be available if compression support is enabled " +"in the built-in :mod:`deflate ` module." +msgstr "只有在内置的 :mod:`deflate ` " +"模块中启用了压缩支持时,才能使用压缩支持。" + +#: ../../library/gzip.rst:32 +msgid "Functions" +msgstr "函数" + +#: ../../library/gzip.rst:36 +msgid "Wrapper around built-in :func:`open` returning a GzipFile instance." +msgstr "对内置 :func:`open` 函数的封装,返回一个 GzipFile 实例。" + +#: ../../library/gzip.rst:40 +msgid "Decompresses *data* into a bytes object." +msgstr "将 *data* 解压缩为一个字节对象。" + +#: ../../library/gzip.rst:44 +msgid "Compresses *data* into a bytes object." +msgstr "将 *data* 压缩为一个字节对象。" + +#: ../../library/gzip.rst:47 +msgid "Classes" +msgstr "类" + +#: ../../library/gzip.rst:51 +msgid "" +"This class can be used to wrap a *fileobj* which is any :term:`stream-like " +"` object such as a file, socket, or stream (including :class:`io." +"BytesIO`). It is itself a stream and implements the standard read/readinto/" +"write/close methods." +msgstr "" +"此类可用于包装一个 *fileobj* ,它是任何 :term:`stream-like ` " +"对象,例如文件、套接字或流(包括 :class:`io.BytesIO`)。它本身就是一个流," +"并实现了标准的 read/readinto/write/close 方法。" + +#: ../../library/gzip.rst:56 +msgid "" +"When the *mode* argument is ``\"rb\"``, reads from the GzipFile instance " +"will decompress the data in the underlying stream and return decompressed " +"data." +msgstr "当 *mode* 参数为 ``\"rb\"`` 时,从 GzipFile " +"实例读取将会解压缩底层流中的数据并返回解压缩后的数据。" + +#: ../../library/gzip.rst:59 +msgid "" +"If compression support is enabled then the *mode* argument can be set to " +"``\"wb\"``, and writes to the GzipFile instance will be compressed and " +"written to the underlying stream." +msgstr "如果启用了压缩支持,则 *mode* 参数可以设置为 ``\"wb\"``,并且对 GzipFile " +"实例的写入将被压缩并写入底层流。" + +#: ../../library/gzip.rst:63 +msgid "" +"By default the GzipFile class will read and write data using the gzip file " +"format, including a header and footer with checksum and a window size of 512 " +"bytes." +msgstr "默认情况下,GzipFile 类将使用 gzip 文件格式读取和写入数据," +"包括带有校验和的页眉和页脚以及 512 字节的窗口大小。" + +#: ../../library/gzip.rst:67 +msgid "" +"The **file**, **compresslevel**, and **mtime** arguments are not supported. " +"**fileobj** and **mode** must always be specified as keyword arguments." +msgstr "" +"**file**、**compresslevel** 和 **mtime** 参数不受支持。必须始终指定 " +"**fileobj** 和 **mode** 作为关键字参数。" + +#: ../../library/gzip.rst:72 +msgid "Examples" +msgstr "示例" + +#: ../../library/gzip.rst:74 +msgid "" +"A typical use case for :class:`gzip.GzipFile` is to read or write a " +"compressed file from storage:" +msgstr ":class:`gzip.GzipFile` 的典型用例是从存储中读取或写入一个压缩文件:" + +#: ../../library/gzip.rst:105 +msgid "" +"For guidance on working with gzip sources and choosing the window size see " +"the note at the :ref:`end of the deflate documentation `." +msgstr "" +"有关使用 gzip 源和选择窗口大小的指导,请参阅 :ref:`end of the deflate documentation " +"`。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/hashlib.po b/docs/locale/zh_CN/LC_MESSAGES/library/hashlib.po new file mode 100644 index 0000000000000..113137155d780 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/hashlib.po @@ -0,0 +1,104 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/hashlib.rst:2 +msgid ":mod:`hashlib` -- hashing algorithms" +msgstr ":mod:`hashlib` -- 散列算法" + +#: ../../library/hashlib.rst:7 +msgid "|see_cpython_module| :mod:`python:hashlib`." +msgstr "|see_cpython_module| :mod:`python:hashlib`。" + +#: ../../library/hashlib.rst:9 +msgid "" +"This module implements binary data hashing algorithms. The exact " +"inventory of available algorithms depends on a board. Among the " +"algorithms which may be implemented:" +msgstr "此模块实现了二进制数据的散列算法。可用算法的确切清单取决于开发板。可能实现的" +"算法包括:" + +#: ../../library/hashlib.rst:13 +msgid "" +"SHA256 - The current generation, modern hashing algorithm (of SHA2 " +"series). It is suitable for cryptographically-secure purposes. Included " +"in the MicroPython core and any board is recommended to provide this, " +"unless it has particular code size constraints." +msgstr "" +"SHA256 - 当前代的现代散列算法(SHA2系列之一)。适用于加密安全目的。包含在Micr" +"oPython核心中,任何开发板都建议提供此算法,除非它有特定的代码大小限制。" + +#: ../../library/hashlib.rst:18 +msgid "" +"SHA1 - A previous generation algorithm. Not recommended for new usages, " +"but SHA1 is a part of number of Internet standards and existing " +"applications, so boards targeting network connectivity and " +"interoperability will try to provide this." +msgstr "" +"SHA1 - 上一代算法。不推荐用于新的用途,但SHA1是许多互联网标准和现有应用程序的" +"一部分,因此,针对网络连接和互操作性的开发板将尝试提供此算法。" + +#: ../../library/hashlib.rst:23 +msgid "" +"MD5 - A legacy algorithm, not considered cryptographically secure. Only " +"selected boards, targeting interoperability with legacy applications, " +"will offer this." +msgstr "MD5 - 一个遗留算法,不被认为是加密安全的。只有选定的开发板,针对与遗留应用程" +"序的互操作性,将提供此算法。" + +#: ../../library/hashlib.rst:28 +msgid "Constructors" +msgstr "构造" + +#: ../../library/hashlib.rst:32 +msgid "Create an SHA256 hasher object and optionally feed ``data`` into it." +msgstr "创建一个SHA256哈希器对象,并可选地向其输入 ``data``。" + +#: ../../library/hashlib.rst:36 +msgid "Create an SHA1 hasher object and optionally feed ``data`` into it." +msgstr "创建一个SHA1哈希器对象,并可选地向其输入 ``data``。" + +#: ../../library/hashlib.rst:40 +msgid "Create an MD5 hasher object and optionally feed ``data`` into it." +msgstr "创建一个MD5哈希器对象,并可选地向其输入 ``data``。" + +#: ../../library/hashlib.rst:43 +msgid "Methods" +msgstr "方法" + +#: ../../library/hashlib.rst:47 +msgid "Feed more binary data into hash." +msgstr "向哈希中输入更多的二进制数据。" + +#: ../../library/hashlib.rst:51 +msgid "" +"Return hash for all data passed through hash, as a bytes object. After " +"this method is called, more data cannot be fed into the hash any longer." +msgstr "返回通过哈希传递的所有数据的哈希值,作为一个字节对象。在调用此方法后,不能再" +"向哈希中输入更多数据。" + +#: ../../library/hashlib.rst:56 +msgid "" +"This method is NOT implemented. Use ``binascii.hexlify(hash.digest())`` " +"to achieve a similar effect." +msgstr "此方法未实现。使用 ``binascii.hexlify(hash.digest())`` 可以达到类似的效果。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/heapq.po b/docs/locale/zh_CN/LC_MESSAGES/library/heapq.po new file mode 100644 index 0000000000000..74fa200676137 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/heapq.po @@ -0,0 +1,70 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-21 05:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/heapq.rst:2 +msgid ":mod:`heapq` -- heap queue algorithm" +msgstr ":mod:`heapq` -- 堆队列算法" + +#: ../../library/heapq.rst:7 +msgid "|see_cpython_module| :mod:`python:heapq`." +msgstr "|see_cpython_module| :mod:`python:heapq`。" + +#: ../../library/heapq.rst:9 +#, python-format +msgid "" +"This module implements the `min heap queue algorithm " +"`_." +msgstr "" +"此模块实现了 `min heap queue algorithm " +"`_。" + +#: ../../library/heapq.rst:12 +msgid "" +"A heap queue is essentially a list that has its elements stored in such a" +" way that the first item of the list is always the smallest." +msgstr "堆队列本质上是一个列表,其元素以这样的方式存储:列表的第一个项目始终是最小的" +"。" + +#: ../../library/heapq.rst:16 +msgid "Functions" +msgstr "函数" + +#: ../../library/heapq.rst:20 +msgid "Push the ``item`` onto the ``heap``." +msgstr "将 ``item`` 推入 ``heap`` 中。" + +#: ../../library/heapq.rst:24 +msgid "" +"Pop the first item from the ``heap``, and return it. Raise " +"``IndexError`` if ``heap`` is empty." +msgstr "从 ``heap`` 中弹出第一个项目,并返回它。如果 ``heap`` 为空,则引发 " +"``IndexError`` 。" + +#: ../../library/heapq.rst:27 +msgid "The returned item will be the smallest item in the ``heap``." +msgstr "返回的项目将是 ``heap`` 中最小的项目。" + +#: ../../library/heapq.rst:31 +msgid "Convert the list ``x`` into a heap. This is an in-place operation." +msgstr "将列表 ``x`` 转换为堆。这是一个就地操作。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/index.po b/docs/locale/zh_CN/LC_MESSAGES/library/index.po new file mode 100644 index 0000000000000..f26fffce412d6 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/index.po @@ -0,0 +1,323 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-08-13 10:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/index.rst:4 +msgid "MicroPython libraries" +msgstr "MicroPython库" + +#: ../../library/index.rst:8 +msgid "Important summary of this section" +msgstr "本节的重要概要" + +#: ../../library/index.rst:10 +msgid "" +"MicroPython provides built-in modules that mirror the functionality of " +"the :ref:`Python standard library ` (e.g. " +":mod:`os`, :mod:`time`), as well as :ref:`MicroPython-specific modules " +"` (e.g. :mod:`bluetooth`, :mod:`machine`)." +msgstr "" +"MicroPython 提供了内置模块,这些模块反映了 :ref:`Python standard library " +"` (例如 :mod:`os` 、 :mod:`time` )的功能,以及 " +":ref:`MicroPython-specific modules ` (例如 " +":mod:`bluetooth` 、 :mod:`machine` )。" + +#: ../../library/index.rst:14 +msgid "" +"Most Python standard library modules implement a subset of the " +"functionality of the equivalent Python module, and in a few cases provide" +" some MicroPython-specific extensions (e.g. :mod:`array`, :mod:`os`)" +msgstr "" +"大多数 Python 标准库模块实现了相应 Python 模块功能的一个子集,并在少数情况下提供了一些 MicroPython 特定的扩展(例如 " +":mod:`array`、:mod:`os`)" + +#: ../../library/index.rst:17 +msgid "" +"Due to resource constraints or other limitations, some ports or firmware " +"versions may not include all the functionality documented here." +msgstr "由于资源限制或其他限制,某些移植版本或固件版本可能不包括此处记录的所有功能。" + +#: ../../library/index.rst:19 +msgid "" +"To allow for extensibility, some built-in modules can be :ref:`extended " +"from Python code ` loaded onto the device " +"filesystem." +msgstr "为了允许扩展性,一些内置模块可以 :ref:`extended from Python code ` 扩展到设备文件系统。" + +#: ../../library/index.rst:23 +msgid "" +"This chapter describes modules (function and class libraries) which are " +"built into MicroPython. This documentation in general aspires to describe" +" all modules and functions/classes which are implemented in the " +"MicroPython project. However, MicroPython is highly configurable, and " +"each port to a particular board/embedded system may include only a subset" +" of the available MicroPython libraries." +msgstr "" +"本章描述了内置于 MicroPython 中的模块(函数和类库)。这份文档通常旨在描述 MicroPython " +"项目中实现的所有模块和函数/类。然而,MicroPython 是高度可配置的,每个移植到特定板/嵌入式系统的版本可能只包含可用 " +"MicroPython 库的一个子集。" + +#: ../../library/index.rst:30 +msgid "" +"With that in mind, please be warned that some functions/classes in a " +"module (or even the entire module) described in this documentation **may " +"be unavailable** in a particular build of MicroPython on a particular " +"system. The best place to find general information of the availability" +"/non-availability of a particular feature is the \"General Information\" " +"section which contains information pertaining to a specific " +":term:`MicroPython port`." +msgstr "" +"考虑到这一点,请注意,本文档中描述的模块中的一些函数/类(甚至整个模块)在特定系统上的 MicroPython 的特定构建中 **可能不可用** " +"。查找特定功能的可用性/不可用性的基本信息的最佳地方是包含特定 :term:`MicroPython port` 相关信息的“基本信息”部分。" + +#: ../../library/index.rst:37 +msgid "" +"On some ports you are able to discover the available, built-in libraries " +"that can be imported by entering the following at the :term:`REPL`::" +msgstr "在一些移植版本上,您可以通过在 :term:`REPL` 中输入以下内容来发现可以导入的可用内置库::" + +#: ../../library/index.rst:42 +msgid "" +"Beyond the built-in libraries described in this documentation, many more " +"modules from the Python standard library, as well as further MicroPython " +"extensions to it, can be found in :term:`micropython-lib`." +msgstr "" +"除了本文档中描述的内置库之外,还可以在 :term:`micropython-lib` 中找到更多来自 Python " +"标准库的模块,以及对其的进一步 MicroPython 扩展。" + +#: ../../library/index.rst:49 +msgid "Python standard libraries and micro-libraries" +msgstr "Python标准库和微型库" + +#: ../../library/index.rst:51 +msgid "" +"The following standard Python libraries have been \"micro-ified\" to fit " +"in with the philosophy of MicroPython. They provide the core " +"functionality of that module and are intended to be a drop-in replacement" +" for the standard Python library." +msgstr "" +"以下标准 Python 库已被“微型化”,以符合 MicroPython 的理念。它们提供了该模块的核心功能,并旨在成为标准 Python " +"库的即插即用替代品。" + +#: ../../library/index.rst:89 +msgid "MicroPython-specific libraries" +msgstr "MicroPython-特定库" + +#: ../../library/index.rst:91 +msgid "" +"Functionality specific to the MicroPython implementation is available in " +"the following libraries." +msgstr "以下库中的功能是 MicroPython 实现特有的。" + +#: ../../library/index.rst:112 +msgid "Libraries specific to the OpenMV Cam" +msgstr "特定于OpenMV Cam的库" + +#: ../../library/index.rst:114 +msgid "The following libraries are specific to the OpenMV Cam." +msgstr "以下库专门用于OpenMV Cam。" + +#: ../../library/index.rst:141 +msgid "Third-party libraries on the OpenMV Cam" +msgstr "OpenMV Cam上的第三方库" + +#: ../../library/index.rst:143 +msgid "" +"The following third-party libraries are built-in to your OpenMV Cam's " +"firmware:" +msgstr "以下第三方库内置到您的OpenMV Cam固件中:" + +#: ../../library/index.rst:146 +msgid "" +":mod:`ulab` --- `numpy-like array manipulation library `_" +msgstr "" +":mod:`ulab` --- `numpy-like array manipulation library " +"`_" + +#: ../../library/index.rst:152 +msgid "" +":mod:`pid` --- `Proportional/Integral/Derivative Control " +"`_" +msgstr "" +":mod:`pid` --- `Proportional/Integral/Derivative Control " +"`_" + +#: ../../library/index.rst:158 +msgid "" +":mod:`bno055` --- `IMU Driver " +"`_" +msgstr "" +":mod:`bno055` --- `IMU Driver " +"" +"`_" + +#: ../../library/index.rst:163 +msgid "" +"Examples scripts are located in OpenMV IDE under the ``IMU Shield`` " +"examples folder." +msgstr "示例脚本位于OpenMV IDE的 ``IMU Shield`` 示例文件夹中。" + +#: ../../library/index.rst:166 +msgid "" +":mod:`ssd1306` --- `OLED Driver " +"`_" +msgstr "" +":mod:`ssd1306` --- `OLED Driver " +"`_" + +#: ../../library/index.rst:172 +msgid "" +":mod:`tb6612` --- `Stepper Motor Driver " +"`_" +msgstr "" +":mod:`tb6612` --- `Stepper Motor Driver " +"" +"`_" + +#: ../../library/index.rst:177 +msgid "" +"Examples scripts are located in OpenMV IDE under the ``Motor Shield`` " +"examples folder." +msgstr "示例脚本位于OpenMV IDE的 ``Motor Shield`` 示例文件夹中。" + +#: ../../library/index.rst:180 +msgid "" +":mod:`modbus` --- `modbus protocol library " +"`_" +msgstr "" +":mod:`modbus` --- `modbus protocol library " +"" +"`_" + +#: ../../library/index.rst:185 +msgid "" +"Examples scripts are located in OpenMV IDE under the ``Modbus`` examples " +"folder." +msgstr "示例脚本位于OpenMV IDE的 ``Modbus`` 示例文件夹中。" + +#: ../../library/index.rst:188 +msgid "" +":mod:`mqtt` --- `mqtt protocol library " +"`_" +msgstr "" +":mod:`mqtt` --- `mqtt protocol library " +"`_" + +#: ../../library/index.rst:193 +msgid "" +"Examples scripts are located in OpenMV IDE under the ``WiFi Shield`` " +"examples folder." +msgstr "示例脚本位于OpenMV IDE的 ``WiFi Shield`` 示例文件夹中。" + +#: ../../library/index.rst:196 +msgid "" +":mod:`vl53l1x` --- `ToF Distance Sensor Driver " +"`_" +msgstr "" +":mod:`vl53l1x` --- `ToF Distance Sensor Driver " +"`_" + +#: ../../library/index.rst:201 +msgid "" +"Examples scripts are located in OpenMV IDE under the ``Distance Shield`` " +"examples folder." +msgstr "示例脚本位于OpenMV IDE的 ``Distance Shield`` 示例文件夹中。" + +#: ../../library/index.rst:206 +msgid "Extending built-in libraries from Python" +msgstr "从 Python 扩展内置库" + +#: ../../library/index.rst:208 +msgid "" +"A subset of the built-in modules are able to be extended by Python code " +"by providing a module of the same name in the filesystem. This " +"extensibility applies to the following Python standard library modules " +"which are built-in to the firmware: ``array``, ``binascii``, " +"``collections``, ``errno``, ``gzip``, ``hashlib``, ``heapq``, ``io``, " +"``json``, ``os``, ``platform``, ``random``, ``re``, ``select``, " +"``socket``, ``ssl``, ``struct``, ``time`` ``zlib``, as well as the " +"MicroPython-specific ``machine`` module. All other built-in modules " +"cannot be extended from the filesystem." +msgstr "" +"Python代码可以通过在文件系统中提供同名模块来扩展内置模块的子集。这种扩展性适用于以下内置到固件中的 Python " +"标准库模块:``array``、``binascii``、``collections``、``errno``、``gzip``、``hashlib``、``heapq``、``io``、``json``、``os``、``platform``、``random``、``re``、``select``、``socket``、``ssl``、``struct``、``time``" +" ``zlib``,以及 MicroPython 特定的 ``machine`` 模块。所有其他内置模块不能从文件系统扩展。" + +#: ../../library/index.rst:217 +msgid "" +"This allows the user to provide an extended implementation of a built-in " +"library (perhaps to provide additional CPython compatibility or missing " +"functionality). This is used extensively in :term:`micropython-lib`, see " +":ref:`packages` for more information. The filesystem module will " +"typically do a wildcard import of the built-in module in order to inherit" +" all the globals (classes, functions and variables) from the built-in." +msgstr "" +"这允许用户提供内置库的扩展实现(也许是为了提供额外的 CPython 兼容性或缺失的功能)。这在 :term:`micropython-lib` " +"中被广泛使用,有关更多信息,请参见 " +":ref:`packages`。文件系统模块通常会对内置模块进行通配符导入,以继承内置模块的所有全局变量(类、函数和变量)。" + +#: ../../library/index.rst:224 +msgid "" +"In MicroPython v1.21.0 and higher, to prevent the filesystem module from " +"importing itself, it can force an import of the built-in module it by " +"temporarily clearing ``sys.path`` during the import. For example, to " +"extend the ``time`` module from Python, a file named ``time.py`` on the " +"filesystem would do the following::" +msgstr "" +"在 MicroPython v1.21.0 及更高版本中,为了防止文件系统模块导入自身,它可以通过在导入期间临时清除 ``sys.path`` " +"来强制导入内置模块。例如,要从 Python 扩展 ``time`` 模块,文件系统上名为 ``time.py`` 的文件将执行以下操作::" + +#: ../../library/index.rst:241 +msgid "" +"The result is that ``time.py`` contains all the globals of the built-in " +"``time`` module, but adds ``extra_method``." +msgstr "结果是 ``time.py`` 包含了内置 ``time`` 模块的所有全局变量,但添加了 ``extra_method``。" + +#: ../../library/index.rst:244 +msgid "" +"In earlier versions of MicroPython, you can force an import of a built-in" +" module by appending a ``u`` to the start of its name. For example, " +"``import utime`` instead of ``import time``. For example, ``time.py`` on " +"the filesystem could look like::" +msgstr "" +"在 MicroPython 的早期版本中,您可以通过在其名称前添加 ``u`` 来强制导入内置模块。例如,使用 ``import utime`` " +"而不是 ``import time``。例如,文件系统上的 ``time.py`` 可能看起来像这样::" + +#: ../../library/index.rst:254 +msgid "" +"This way is still supported, but the ``sys.path`` method described above " +"is now preferred as the ``u``-prefix will be removed from the names of " +"built-in modules in a future version of MicroPython." +msgstr "" +"这种方式仍然受到支持,但现在更倾向于使用上述的 ``sys.path`` 方法,因为在 MicroPython " +"的未来版本中将从内置模块的名称中移除 ``u`` 前缀。" + +#: ../../library/index.rst:258 +msgid "" +"*Other than when it specifically needs to force the use of the built-in " +"module, code should always use* ``import module`` *rather than* ``import " +"umodule``." +msgstr "*除了在特定需要强制使用内置模块的情况外,代码应该始终使用* ``import module`` *而不是* ``import umodule``。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/io.po b/docs/locale/zh_CN/LC_MESSAGES/library/io.po new file mode 100644 index 0000000000000..7bd551f0f1cce --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/io.po @@ -0,0 +1,213 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/io.rst:2 +msgid ":mod:`io` -- input/output streams" +msgstr ":mod:`io` -- 输入/输出流" + +#: ../../library/io.rst:7 +msgid "|see_cpython_module| :mod:`python:io`." +msgstr "|see_cpython_module| :mod:`python:io`。" + +#: ../../library/io.rst:9 +msgid "" +"This module contains additional types of :std:term:`stream` (file-like) " +"objects and helper functions." +msgstr "此模块包含额外类型的 :std:term:`stream` (类似文件)对象和辅助函数。" + +#: ../../library/io.rst:13 +msgid "Conceptual hierarchy" +msgstr "概念层次结构" + +#: ../../library/io.rst:15 ../../library/io.rst:118 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/io.rst:18 +msgid "" +"Conceptual hierarchy of stream base classes is simplified in MicroPython, as " +"described in this section." +msgstr "MicroPython 中流基类的概念层次结构已简化,如本节所述。" + +#: ../../library/io.rst:21 +msgid "" +"(Abstract) base stream classes, which serve as a foundation for behaviour of " +"all the concrete classes, adhere to few dichotomies (pair-wise " +"classifications) in CPython. In MicroPython, they are somewhat simplified " +"and made implicit to achieve higher efficiencies and save resources." +msgstr "" +"(抽象)基础流类作为所有具体类行为的基础,在 CPython " +"中遵循一些二分法(成对分类)。在 MicroPython " +"中,这些类被简化并隐式化,以提高效率并节省资源。" + +#: ../../library/io.rst:26 +msgid "" +"An important dichotomy in CPython is unbuffered vs buffered streams. In " +"MicroPython, all streams are currently unbuffered. This is because all " +"modern OSes, and even many RTOSes and filesystem drivers already perform " +"buffering on their side. Adding another layer of buffering is counter- " +"productive (an issue known as \"bufferbloat\") and takes precious memory. " +"Note that there still cases where buffering may be useful, so we may " +"introduce optional buffering support at a later time." +msgstr "" +"在 CPython 中的一个重要二分法是非缓冲流与缓冲流。在 MicroPython 中,所有流当" +"前都是非缓冲的。这是因为所有现代操作系统,甚至许多实时操作系统和文件系统驱动" +"程序已经在它们一侧进行了缓冲。添加另一层缓冲是适得其反的(一个称为“缓冲膨胀”" +"的问题)并且占用宝贵的内存。注意,仍然有一些情况下缓冲可能是有用的,所以我们" +"可能会在以后引入可选的缓冲支持。" + +#: ../../library/io.rst:34 +msgid "" +"But in CPython, another important dichotomy is tied with \"bufferedness\" - " +"it's whether a stream may incur short read/writes or not. A short read is " +"when a user asks e.g. 10 bytes from a stream, but gets less, similarly for " +"writes. In CPython, unbuffered streams are automatically short operation " +"susceptible, while buffered are guarantee against them. The no short read/" +"writes is an important trait, as it allows to develop more concise and " +"efficient programs - something which is highly desirable for MicroPython. " +"So, while MicroPython doesn't support buffered streams, it still provides " +"for no-short-operations streams. Whether there will be short operations or " +"not depends on each particular class' needs, but developers are strongly " +"advised to favour no-short-operations behaviour for the reasons stated " +"above. For example, MicroPython sockets are guaranteed to avoid short read/" +"writes. Actually, at this time, there is no example of a short-operations " +"stream class in the core, and one would be a port-specific class, where such " +"a need is governed by hardware peculiarities." +msgstr "" +"但在 CPython 中,另一个重要的二分法与“缓冲性”相关 - " +"它是关于流是否可能发生短读/写的。短读是指用户从流中请求例如 10 " +"个字节,但得到的少于此数量,对于写入也是类似的。在 CPython 中,非缓冲流自动容" +"易受到短操作的影响,而缓冲流则保证免受它们的影响。无短读/写是一个重要的特性," +"因为它允许开发更简洁高效的程序 - 这对于 MicroPython 来说是非常可取的。因此," +"虽然 MicroPython 不支持缓冲流,但它仍然提供了无短操作流。是否会有短操作取决于" +"每个特定类的需求,但出于上述原因,强烈建议开发者倾向于无短操作行为。例如," +"MicroPython 套接字保证避免短读/写。实际上,目前在核心中没有短操作流类的例子," +"一个会是特定移植版本的类,其中这种需求由硬件特性决定。" + +#: ../../library/io.rst:51 +msgid "" +"The no-short-operations behaviour gets tricky in case of non-blocking " +"streams, blocking vs non-blocking behaviour being another CPython dichotomy, " +"fully supported by MicroPython. Non-blocking streams never wait for data " +"either to arrive or be written - they read/write whatever possible, or " +"signal lack of data (or ability to write data). Clearly, this conflicts with " +"\"no-short-operations\" policy, and indeed, a case of non-blocking buffered " +"(and this no-short-ops) streams is convoluted in CPython - in some places, " +"such combination is prohibited, in some it's undefined or just not " +"documented, in some cases it raises verbose exceptions. The matter is much " +"simpler in MicroPython: non-blocking stream are important for efficient " +"asynchronous operations, so this property prevails on the \"no-short-ops\" " +"one. So, while blocking streams will avoid short reads/writes whenever " +"possible (the only case to get a short read is if end of file is reached, or " +"in case of error (but errors don't return short data, but raise " +"exceptions)), non-blocking streams may produce short data to avoid blocking " +"the operation." +msgstr "" +"在非阻塞流的情况下,无短操作行为变得棘手,阻塞与非阻塞行为是 CPython " +"的另一个二分法,MicroPython 完全支持。非阻塞流永远不会等待数据到达或被写入 - " +"它们读/写任何可能的数据,或信号数据缺失(或无法写入数据的能力)。显然,这与“" +"无短操作”政策相冲突,确实,非阻塞缓冲(以及这种无短操作)流在 CPython " +"中的情况是复杂的 - 在某些地方,这种组合是禁止的,在某些地方它是未定义的或只是" +"没有文档,在某些情况下它会引发详细的异常。在 MicroPython 中,情况要简单得多:" +"非阻塞流对于高效的异步操作很重要,所以这个属性优先于“无短操作”属性。因此,虽" +"然阻塞流会尽可能避免短读/写(唯一得到短读的情况是如果到达文件末尾,或在错误情" +"况下(但错误不返回短数据,而是引发异常)),非阻塞流可能产生短数据以避免阻塞" +"操作。" + +#: ../../library/io.rst:68 +msgid "" +"The final dichotomy is binary vs text streams. MicroPython of course " +"supports these, but while in CPython text streams are inherently buffered, " +"they aren't in MicroPython. (Indeed, that's one of the cases for which we " +"may introduce buffering support.)" +msgstr "" +"最后的二分法是二进制流与文本流。MicroPython 当然支持这些,但虽然在 CPython " +"中文本流本质上是缓冲的,它们在 MicroPython " +"中则不是。(实际上,这是我们可能引入缓冲支持的情况之一。)" + +#: ../../library/io.rst:73 +msgid "" +"Note that for efficiency, MicroPython doesn't provide abstract base classes " +"corresponding to the hierarchy above, and it's not possible to implement, or " +"subclass, a stream class in pure Python." +msgstr "注意,为了效率,MicroPython 不提供对应于上述层次结构的抽象基类," +"而且不可能在纯 Python 中实现或子类化流类。" + +#: ../../library/io.rst:78 +msgid "Functions" +msgstr "函数" + +#: ../../library/io.rst:82 +msgid "" +"Open a file. Builtin ``open()`` function is aliased to this function. All " +"ports (which provide access to file system) are required to support *mode* " +"parameter, but support for other arguments vary by port." +msgstr "" +"打开一个文件。内置的 ``open()`` " +"函数被别名为此函数。所有的移植版本(提供对文件系统的访问)都需要支持 *mode* " +"参数,但对其他参数的支持因移植版本而异。" + +#: ../../library/io.rst:87 +msgid "Classes" +msgstr "类" + +#: ../../library/io.rst:92 +msgid "" +"In-memory file-like objects for input/output. `StringIO` is used for text-" +"mode I/O (similar to a normal file opened with \"t\" modifier). `BytesIO` is " +"used for binary-mode I/O (similar to a normal file opened with \"b\" " +"modifier). Initial contents of file-like objects can be specified with " +"*string* parameter (should be normal string for `StringIO` or bytes object " +"for `BytesIO`). All the usual file methods like ``read()``, ``write()``, " +"``seek()``, ``flush()``, ``close()`` are available on these objects, and " +"additionally, a following method:" +msgstr "" +"内存中的类文件对象,用于输入/输出。`StringIO` 用于文本模式 I/O(类似于以 \"t" +"\" 修饰符打开的普通文件)。`BytesIO` 用于二进制模式 I/O(类似于以 \"b\" " +"修饰符打开的普通文件)。类文件对象的初始内容可以用 *string* 参数指定(对于 " +"`StringIO` 应该是普通字符串,对于 `BytesIO` " +"应该是字节对象)。所有常见的文件方法,如 ``read()``, ``write()``, ``seek()``" +", ``flush()``, ``close()`` 在这些对象上都可用,并且还有以下方法:" + +#: ../../library/io.rst:104 +msgid "Get the current contents of the underlying buffer which holds data." +msgstr "获取保存数据的底层缓冲区的当前内容。" + +#: ../../library/io.rst:111 +msgid "" +"Create an empty `StringIO`/`BytesIO` object, preallocated to hold up to " +"*alloc_size* number of bytes. That means that writing that amount of bytes " +"won't lead to reallocation of the buffer, and thus won't hit out-of-memory " +"situation or lead to memory fragmentation. These constructors are a " +"MicroPython extension and are recommended for usage only in special cases " +"and in system-level libraries, not for end-user applications." +msgstr "" +"创建一个空的 `StringIO`/`BytesIO` 对象,预分配以容纳最多 *alloc_size* 字节数" +"。这意味着写入该数量的字节不会导致缓冲区重新分配,因此不会遇到内存不足的情况" +"或导致内存碎片化。这些构造函数是 MicroPython " +"的扩展,仅推荐在特殊情况和系统级库中使用,而不是终端用户应用程序。" + +#: ../../library/io.rst:121 +msgid "These constructors are a MicroPython extension." +msgstr "这些构造函数是 MicroPython 的扩展。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/json.po b/docs/locale/zh_CN/LC_MESSAGES/library/json.po new file mode 100644 index 0000000000000..12839426e0c1c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/json.po @@ -0,0 +1,86 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-21 05:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/json.rst:2 +msgid ":mod:`json` -- JSON encoding and decoding" +msgstr ":mod:`json` -- JSON 编码与解码" + +#: ../../library/json.rst:7 +msgid "|see_cpython_module| :mod:`python:json`." +msgstr "|see_cpython_module| :mod:`python:json`。" + +#: ../../library/json.rst:9 +msgid "" +"This modules allows to convert between Python objects and the JSON data " +"format." +msgstr "此模块允许在 Python 对象和 JSON 数据格式之间转换。" + +#: ../../library/json.rst:13 +msgid "Functions" +msgstr "函数" + +#: ../../library/json.rst:17 +msgid "Serialise *obj* to a JSON string, writing it to the given *stream*." +msgstr "将 *obj* 序列化为 JSON 字符串,将其写入给定的 *stream*。" + +#: ../../library/json.rst:19 +msgid "" +"If specified, separators should be an ``(item_separator, key_separator)``" +" tuple. The default is ``(', ', ': ')``. To get the most compact JSON " +"representation, you should specify ``(',', ':')`` to eliminate " +"whitespace." +msgstr "" +"如果指定,separators 应该是一个 ``(item_separator, key_separator)`` 元组。" +"默认值是 ``(', ', ': ')``。为了获得最紧凑的 JSON 表示,你应该指定 ``(',', " +"':')`` 来消除空白。" + +#: ../../library/json.rst:25 +msgid "Return *obj* represented as a JSON string." +msgstr "返回表示为 JSON 字符串的 *obj*。" + +#: ../../library/json.rst:27 +msgid "The arguments have the same meaning as in `dump`." +msgstr "参数的含义与 `dump` 中相同。" + +#: ../../library/json.rst:31 +msgid "" +"Parse the given *stream*, interpreting it as a JSON string and " +"deserialising the data to a Python object. The resulting object is " +"returned." +msgstr "解析给定的 *stream*,将其解释为 JSON 字符串,并将数据反序列化为 Python " +"对象。返回结果对象。" + +#: ../../library/json.rst:35 +msgid "" +"Parsing continues until end-of-file is encountered. A :exc:`ValueError` " +"is raised if the data in *stream* is not correctly formed." +msgstr "解析持续到遇到文件结尾。如果 *stream* " +"中的数据格式不正确,将引发:exc:`ValueError` 异常。" + +#: ../../library/json.rst:40 +msgid "" +"Parse the JSON *str* and return an object. Raises :exc:`ValueError` if " +"the string is not correctly formed." +msgstr "解析 JSON *str* 并返回一个对象。如果字符串格式不正确,将引发 " +":exc:`ValueError` 异常。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADC.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADC.po new file mode 100644 index 0000000000000..319f067becf2f --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADC.po @@ -0,0 +1,117 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.ADC.rst:5 +msgid "class ADC -- analog to digital conversion" +msgstr "class ADC -- 模拟到数字转换" + +#: ../../library/machine.ADC.rst:7 +msgid "" +"The ADC class provides an interface to analog-to-digital converters, and " +"represents a single endpoint that can sample a continuous voltage and " +"convert it to a discretised value." +msgstr "ADC 类提供了对模拟到数字转换器的接口,并代表一个可以对连续电压进行采样并将其" +"转换为离散值的单个点。" + +#: ../../library/machine.ADC.rst:11 +msgid "" +"For extra control over ADC sampling see :ref:`machine.ADCBlock " +"`." +msgstr "要对 ADC 采样进行更多控制,请参阅 :ref:`machine.ADCBlock `。" + +#: ../../library/machine.ADC.rst:13 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.ADC.rst:22 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.ADC.rst:26 +msgid "" +"Access the ADC associated with a source identified by *id*. This *id* " +"may be an integer (usually specifying a channel number), a :ref:`Pin " +"` object, or other value supported by the underlying " +"machine." +msgstr "" +"通过 *id* 访问与某个源关联的 ADC。这个 *id* " +"可能是一个整数(通常指定一个通道号)、一个 :ref:`Pin ` " +"对象,或者底层机器支持的其他值。" + +#: ../../library/machine.ADC.rst:31 +msgid "" +"If additional keyword-arguments are given then they will configure " +"various aspects of the ADC. If not given, these settings will take " +"previous or default values. The settings are:" +msgstr "如果给出了额外的关键字参数,它们将配置 ADC " +"的各种方面。如果没有给出,这些设置将采用之前的或默认值。设置项包括:" + +#: ../../library/machine.ADC.rst:35 +msgid "*sample_ns* is the sampling time in nanoseconds." +msgstr "*sample_ns* 是采样时间,单位为纳秒。" + +#: ../../library/machine.ADC.rst:37 +msgid "*atten* specifies the input attenuation." +msgstr "*atten* 指定输入衰减。" + +#: ../../library/machine.ADC.rst:40 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.ADC.rst:44 +msgid "" +"Apply the given settings to the ADC. Only those arguments that are " +"specified will be changed. See the ADC constructor above for what the " +"arguments are." +msgstr "将给定的设置应用于ADC。只有指定的参数会被更改。有关参数的信息,请参阅上面的AD" +"C构造函数。" + +#: ../../library/machine.ADC.rst:50 +msgid "" +"Return the :ref:`ADCBlock ` instance associated with " +"this ADC object." +msgstr "返回与此 ADC 对象关联的 :ref:`ADCBlock ` 实例。" + +#: ../../library/machine.ADC.rst:53 +msgid "" +"This method only exists if the port supports the :ref:`ADCBlock " +"` class." +msgstr "仅当移植版本支持 :ref:`ADCBlock ` 类时,此方法才存在。" + +#: ../../library/machine.ADC.rst:58 +msgid "" +"Take an analog reading and return an integer in the range 0-65535. The " +"return value represents the raw reading taken by the ADC, scaled such " +"that the minimum value is 0 and the maximum value is 65535." +msgstr "进行一次模拟读取并返回一个范围在 0-65535 之间的整数。返回值代表 ADC " +"采取的原始读数,缩放后的最小值为 0,最大值为 65535。" + +#: ../../library/machine.ADC.rst:64 +msgid "" +"Take an analog reading and return an integer value with units of " +"microvolts. It is up to the particular port whether or not this value is" +" calibrated, and how calibration is done." +msgstr "进行一次模拟读取并以微伏为单位返回一个整数值。是否校准该值以及如何进行校准取" +"决于特定移植版本。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADCBlock.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADCBlock.po new file mode 100644 index 0000000000000..4b85811807a91 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.ADCBlock.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.ADCBlock.rst:5 +msgid "class ADCBlock -- control ADC peripherals" +msgstr "class ADCBlock -- 控制ADC外设" + +#: ../../library/machine.ADCBlock.rst:7 +msgid "" +"The ADCBlock class provides access to an ADC peripheral which has a " +"number of channels that can be used to sample analog values. It allows " +"finer control over configuration of :ref:`machine.ADC ` " +"objects, which do the actual sampling." +msgstr "" +"ADCBlock类提供了对具有多个通道的ADC外设的访问,这些通道可用于采样模拟值。它允" +"许对 :ref:`machine.ADC ` " +"对象的配置进行更精细的控制,这些对象执行实际的采样。" + +#: ../../library/machine.ADCBlock.rst:12 +msgid "This class is not always available." +msgstr "该类并不总是可用的。" + +#: ../../library/machine.ADCBlock.rst:14 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.ADCBlock.rst:23 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.ADCBlock.rst:27 +msgid "" +"Access the ADC peripheral identified by *id*, which may be an integer or " +"string." +msgstr "访问由 *id* 标识的ADC外设,*id* 可以是整数或字符串。" + +#: ../../library/machine.ADCBlock.rst:30 +msgid "" +"The *bits* argument, if given, sets the resolution in bits of the " +"conversion process. If not specified then the previous or default " +"resolution is used." +msgstr "" +"如果给出 *bits* 参数,则设置转换过程的分辨率(以位为单位)。如果未指定,则使用之前的或默认的分辨率。" + +#: ../../library/machine.ADCBlock.rst:35 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.ADCBlock.rst:39 +msgid "" +"Configure the ADC peripheral. *bits* will set the resolution of the " +"conversion process." +msgstr "配置ADC外设。*bits* 将设置转换过程的分辨率。" + +#: ../../library/machine.ADCBlock.rst:46 +msgid "" +"Connect up a channel on the ADC peripheral so it is ready for sampling, " +"and return an :ref:`ADC ` object that represents that " +"connection." +msgstr "连接ADC外设上的一个通道,使其准备好进行采样,并返回一个代表该连接的 :ref:`ADC " +"` 对象。" + +#: ../../library/machine.ADCBlock.rst:49 +msgid "" +"The *channel* argument must be an integer, and *source* must be an object" +" (for example a :ref:`Pin `) which can be connected up for " +"sampling." +msgstr "" +"*channel* 参数必须是一个整数,*source* 必须是一个对象(例如 :ref:`Pin ` ),可以连接用于采样。" + +#: ../../library/machine.ADCBlock.rst:52 +msgid "If only *channel* is given then it is configured for sampling." +msgstr "如果只给出 *channel*,则它被配置为采样。" + +#: ../../library/machine.ADCBlock.rst:54 +msgid "" +"If only *source* is given then that object is connected to a default " +"channel ready for sampling." +msgstr "如果只给出 *source*,则该对象连接到一个默认通道,准备采样。" + +#: ../../library/machine.ADCBlock.rst:57 +msgid "" +"If both *channel* and *source* are given then they are connected together" +" and made ready for sampling." +msgstr "如果同时给出 *channel* 和 *source*,则它们被连接在一起,准备采样。" + +#: ../../library/machine.ADCBlock.rst:60 +msgid "" +"Any additional keyword arguments are used to configure the returned ADC " +"object, via its :meth:`init ` method." +msgstr "任何额外的关键字参数用于通过其 :meth:`init ` 方法配置返回的ADC对象。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.CAN.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.CAN.po new file mode 100644 index 0000000000000..7f39ccdd790d3 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.CAN.po @@ -0,0 +1,491 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.CAN.rst:5 +msgid "class CAN -- controller area network communication bus" +msgstr "class CAN -- 控制器局域网通信总线" + +#: ../../library/machine.CAN.rst:7 +msgid "" +"**THIS MODULE EXISTS TO PROVIDE CAN SUPPORT FOR THE OPENMV CAM RT1062 AND" +" WILL BE REMOVED ONCE MICROPYTHON PROVIDES A STANDARD MACHINE CAN MODULE." +" THIS MODULE IS A COPY OF THE PYB.CAN MODULE FOR THE STM32.**" +msgstr "" +"**此模块旨在为OpenMV CAM RT1062提供CAN支持,并将在MicroPython提供标准机器CAN" +"模块后删除。此模块是STM32的PYB.CAN模块的副本。**" + +#: ../../library/machine.CAN.rst:11 +msgid "" +"CAN implements support for classic CAN controllers. At the physical level" +" CAN bus consists of 2 lines: RX and TX. Note that to connect the board " +"to a CAN bus you must use a CAN transceiver to convert the CAN logic " +"signals from the board to the correct voltage levels on the bus." +msgstr "" +"CAN实现了对经典CAN控制器的支持。在物理层面上,CAN总线由2根线组成:RX和TX。请" +"注意,要将板连接到CAN总线,必须使用CAN变换器将板上的CAN逻辑信号转换为总线上的" +"正确电压水平。" + +#: ../../library/machine.CAN.rst:16 +msgid "" +"Example usage for classic CAN controller in Loopback (transceiver-less) " +"mode::" +msgstr "经典 CAN 控制器在回环(无需收发器)模式下的示例用法:" + +#: ../../library/machine.CAN.rst:24 +msgid "" +"The following CAN module functions and their arguments are available for " +"classic CAN controllers, unless otherwise stated." +msgstr "以下CAN模块函数及其参数可用于经典CAN控制器,除非另有说明。" + +#: ../../library/machine.CAN.rst:28 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.CAN.rst:32 +msgid "" +"Construct a CAN object on the given bus. *bus* can be 0. With no " +"additional parameters, the CAN object is created but not initialised (it " +"has the settings from the last initialisation of the bus, if any). If " +"extra arguments are given, the bus is initialised. See :meth:`CAN.init` " +"for parameters of initialisation." +msgstr "" +"在给定的总线上构造一个CAN对象。*bus* " +"可以是0。如果没有额外的参数,则创建CAN对象但不进行初始化(如果有的话,它具有总线上次初始化的设置)。如果给出额外的参数,则初始化总线。有关初始化" +"的参数,请参阅 :meth:`CAN.init`。" + +#: ../../library/machine.CAN.rst:38 +msgid "The physical pins of the CAN buses are:" +msgstr "CAN总线的物理引脚如下:" + +#: ../../library/machine.CAN.rst:40 +msgid "``CAN(0)``: ``(RX, TX) = (P3, P1)``" +msgstr "``CAN(0)``: ``(RX, TX) = (P3, P1)``" + +#: ../../library/machine.CAN.rst:43 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.CAN.rst:47 +msgid "Initialise the CAN bus with the given parameters:" +msgstr "使用给定参数初始化CAN总线:" + +#: ../../library/machine.CAN.rst:49 +msgid "*mode* is one of: NORMAL, LOOPBACK, SILENT, SILENT_LOOPBACK" +msgstr "*mode* 可以是以下之一:NORMAL、LOOPBACK、SILENT、SILENT_LOOPBACK" + +#: ../../library/machine.CAN.rst:50 +msgid "" +"*auto_restart* sets whether the controller will automatically try and " +"restart communications after entering the bus-off state; if this is " +"disabled then :meth:`~CAN.restart()` can be used to leave the bus-off " +"state" +msgstr "" +"*auto_restart* " +"设置控制器是否会在进入总线关闭状态后自动尝试重新启动通信;如果禁用了此功能," +"则可以使用 :meth:`~CAN.restart()` 来离开总线关闭状态" + +#: ../../library/machine.CAN.rst:53 +msgid "*baudrate* sets the baudrate used to connect to the CAN bus" +msgstr "*baudrate* 设置连接到CAN总线的波特率" + +#: ../../library/machine.CAN.rst:57 +msgid "Turn off the CAN bus." +msgstr "关闭CAN总线。" + +#: ../../library/machine.CAN.rst:61 +msgid "" +"Force a software restart of the CAN controller without resetting its " +"configuration." +msgstr "强制软件重新启动CAN控制器,而不是重置其配置。" + +#: ../../library/machine.CAN.rst:64 +msgid "" +"If the controller enters the bus-off state then it will no longer " +"participate in bus activity. If the controller is not configured to " +"automatically restart (see :meth:`~CAN.init()`) then this method can be " +"used to trigger a restart, and the controller will follow the CAN " +"protocol to leave the bus-off state and go into the error active state." +msgstr "" +"如果控制器进入总线关闭状态,则它将不再参与总线活动。如果控制器未配置为自动重" +"新启动(请参阅 :meth:`~CAN.init()`),则可以使用此方法触发重新启动," +"并且控制器将遵循 CAN 协议以离开总线关闭状态并进入错误激活状态。" + +#: ../../library/machine.CAN.rst:72 +msgid "Return the state of the controller. The return value can be one of:" +msgstr "返回控制器的状态。返回值可以是以下之一:" + +#: ../../library/machine.CAN.rst:74 +msgid "``CAN.STOPPED`` -- the controller is completely off and reset;" +msgstr "``CAN.STOPPED`` -- 控制器完全关闭并重置;" + +#: ../../library/machine.CAN.rst:75 +msgid "" +"``CAN.ERROR_ACTIVE`` -- the controller is on and in the Error Active " +"state (both TEC and REC are less than 96);" +msgstr "``CAN.ERROR_ACTIVE`` -- 控制器开启且处于错误激活状态(TEC和REC都小于96);" + +#: ../../library/machine.CAN.rst:77 +msgid "" +"``CAN.ERROR_WARNING`` -- the controller is on and in the Error Warning " +"state (at least one of TEC or REC is 96 or greater);" +msgstr "``CAN.ERROR_WARNING`` -- 控制器开启且处于错误警告状态(TEC或REC至少为96);" + +#: ../../library/machine.CAN.rst:79 +msgid "" +"``CAN.ERROR_PASSIVE`` -- the controller is on and in the Error Passive " +"state (at least one of TEC or REC is 128 or greater);" +msgstr "``CAN.ERROR_PASSIVE`` -- 控制器开启且处于错误被动状态(TEC或REC至少为128);" + +#: ../../library/machine.CAN.rst:81 +msgid "" +"``CAN.BUS_OFF`` -- the controller is on but not participating in bus " +"activity (TEC overflowed beyond 255)." +msgstr "``CAN.BUS_OFF`` -- 控制器开启但不参与总线活动(TEC溢出超过255)。" + +#: ../../library/machine.CAN.rst:86 +msgid "" +"Get information about the controller's error states and TX and RX " +"buffers. If *list* is provided then it should be a list object with at " +"least 8 entries, which will be filled in with the information. Otherwise" +" a new list will be created and filled in. In both cases the return " +"value of the method is the populated list." +msgstr "" +"获取有关控制器的错误状态以及 TX 和 RX 缓冲区的信息。如果提供了 *list*," +"则应该是一个至少有 8 个条目的列表对象,将用信息填充其中。否则将创建一个新列表" +"并填充其中。在两种情况下,方法的返回值是填充的列表。" + +#: ../../library/machine.CAN.rst:92 +msgid "The values in the list are:" +msgstr "列表中的值为:" + +#: ../../library/machine.CAN.rst:94 +msgid "TEC value" +msgstr "TEC值" + +#: ../../library/machine.CAN.rst:95 +msgid "REC value" +msgstr "REC值" + +#: ../../library/machine.CAN.rst:96 +msgid "" +"number of times the controller enterted the Error Warning state (wrapped " +"around to 0 after 65535)" +msgstr "控制器进入错误警告状态的次数(在达到65535后环绕为0)" + +#: ../../library/machine.CAN.rst:98 +msgid "" +"number of times the controller enterted the Error Passive state (wrapped " +"around to 0 after 65535)" +msgstr "控制器进入错误被动状态的次数(在达到65535后环绕为0)" + +#: ../../library/machine.CAN.rst:100 +msgid "" +"number of times the controller enterted the Bus Off state (wrapped around" +" to 0 after 65535)" +msgstr "控制器进入总线关闭状态的次数(在达到65535后环绕为0)" + +#: ../../library/machine.CAN.rst:102 +msgid "number of pending TX messages" +msgstr "待处理的TX消息数" + +#: ../../library/machine.CAN.rst:103 +msgid "number of pending RX messages on fifo 0" +msgstr "FIFO 0 上待处理的 RX 消息数" + +#: ../../library/machine.CAN.rst:104 +msgid "always 0" +msgstr "总是0" + +#: ../../library/machine.CAN.rst:108 +msgid "Configure a filter bank:" +msgstr "配置一个过滤器组:" + +#: ../../library/machine.CAN.rst:110 +msgid "*bank* is the classic CAN controller filter bank to configure." +msgstr "*bank* 是经典的CAN控制器滤波器组配置。" + +#: ../../library/machine.CAN.rst:111 +msgid "*mode* is the mode the filter should operate in, see the tables below." +msgstr "*mode* 是过滤器应该操作的模式,请参阅下表。" + +#: ../../library/machine.CAN.rst:112 +msgid "" +"*fifo* is which fifo (0) a message should be stored in, if it is accepted" +" by this filter." +msgstr "*fifo* 表示如果消息被此过滤器接受,该消息应该存储在哪个fifo(0)中。" + +#: ../../library/machine.CAN.rst:113 +msgid "" +"*params* is an array of values the defines the filter. The contents of " +"the array depends on the *mode* argument." +msgstr "*params* 是定义过滤器的值数组。数组的内容取决于 *mode* 参数。" + +#: ../../library/machine.CAN.rst:116 ../../library/machine.CAN.rst:129 +msgid "*mode*" +msgstr "*mode*" + +#: ../../library/machine.CAN.rst:116 +msgid "Contents of *params* array for classic CAN controller" +msgstr "经典 CAN 控制器所使用的 *params* 数组内容" + +#: ../../library/machine.CAN.rst:118 ../../library/machine.CAN.rst:131 +msgid "CAN.LIST32" +msgstr "CAN.LIST32" + +#: ../../library/machine.CAN.rst:118 +msgid "Two 32 bit ids that will be accepted" +msgstr "将被接受的两个32位ID" + +#: ../../library/machine.CAN.rst:120 ../../library/machine.CAN.rst:133 +msgid "CAN.DUAL" +msgstr "CAN.DUAL" + +#: ../../library/machine.CAN.rst:120 +msgid "Two ids that will be accepted. For example (1, 2)" +msgstr "将被接受的两个 ID。例如 (1, 2)" + +#: ../../library/machine.CAN.rst:123 +msgid "" +"*rtr* For classic CAN controllers, this is an array of booleans that " +"states if a filter should accept a remote transmission request message. " +"If this argument is not given then it defaults to ``False`` for all " +"entries. The length of the array depends on the *mode* argument." +msgstr "" +"*rtr* 对于经典CAN控制器,这是一个布尔值数组,指定过滤器是否应接受远程传输请求消息。如果未给出此参数,则对于所有条目,默认为 " +"``False``。数组的长度取决于 *mode* 参数。" + +#: ../../library/machine.CAN.rst:129 +msgid "length of *rtr* array" +msgstr "*rtr* 数组的长度" + +#: ../../library/machine.CAN.rst:131 ../../library/machine.CAN.rst:133 +#: ../../library/machine.CAN.rst:223 +msgid "2" +msgstr "2" + +#: ../../library/machine.CAN.rst:136 +msgid "" +"*extframe* If True the frame will have an extended identifier (29 bits), " +"otherwise a standard identifier (11 bits) is used." +msgstr "*extframe* 如果为 True,则帧将具有扩展标识符(29 位),否则将使用标准标识符(" +"11 位)。" + +#: ../../library/machine.CAN.rst:142 +msgid "Clear and disables a filter bank:" +msgstr "清除并禁用一个过滤器组:" + +#: ../../library/machine.CAN.rst:144 +msgid "*bank* is the classic CAN controller filter bank to clear." +msgstr "*bank* 是要清除的经典CAN控制器过滤器组。" + +#: ../../library/machine.CAN.rst:145 +msgid "*extframe* ignored" +msgstr "*extframe* 被忽略" + +#: ../../library/machine.CAN.rst:149 +msgid "Return ``True`` if any message waiting on the FIFO, else ``False``." +msgstr "如果 FIFO 上有任何消息等待,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/machine.CAN.rst:153 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/machine.CAN.rst:155 +msgid "*fifo* is an integer, which is the FIFO to receive on - always 0" +msgstr "*fifo* 是一个整数,表示要接收的FIFO - 总是0" + +#: ../../library/machine.CAN.rst:156 +msgid "*list* is an optional list object to be used as the return value" +msgstr "*list* 是一个可选的列表对象,用作返回值" + +#: ../../library/machine.CAN.rst:157 +msgid "*timeout* is the timeout in milliseconds to wait for the receive." +msgstr "*timeout* 是等待接收的超时时间(以毫秒为单位)。" + +#: ../../library/machine.CAN.rst:159 +msgid "Return value: A tuple containing five values." +msgstr "返回值:包含五个值的元组。" + +#: ../../library/machine.CAN.rst:161 +msgid "The id of the message." +msgstr "消息的 ID。" + +#: ../../library/machine.CAN.rst:162 +msgid "A boolean that indicates if the message ID is standard or extended." +msgstr "一个布尔值,指示消息 ID 是否为标准或扩展。" + +#: ../../library/machine.CAN.rst:163 +msgid "A boolean that indicates if the message is an RTR message." +msgstr "一个布尔值,指示消息是否为 RTR 消息。" + +#: ../../library/machine.CAN.rst:164 +msgid "The FMI (Filter Match Index) value." +msgstr "FMI(过滤器匹配索引)值。" + +#: ../../library/machine.CAN.rst:165 +msgid "An array containing the data." +msgstr "包含数据的数组。" + +#: ../../library/machine.CAN.rst:167 +msgid "" +"If *list* is ``None`` then a new tuple will be allocated, as well as a " +"new bytes object to contain the data (as the fifth element in the tuple)." +msgstr "如果 *list* 是 ``None``,则将分配一个新的元组,以及一个新的字节对象来包含数据" +"(作为元组的第五个元素)。" + +#: ../../library/machine.CAN.rst:170 +msgid "" +"If *list* is not ``None`` then it should be a list object with a least " +"five elements. The fifth element should be a memoryview object which is " +"created from either a bytearray or an array of type 'B' or 'b', and this " +"array must have enough room for at least 8 bytes. The list object will " +"then be populated with the first four return values above, and the " +"memoryview object will be resized inplace to the size of the data and " +"filled in with that data. The same list and memoryview objects can be " +"reused in subsequent calls to this method, providing a way of receiving " +"data without using the heap. For example::" +msgstr "" +"如果 *list* 不是 ``None``,则它应该是一个列表对象,至少有五个元素。" +"第五个元素应该是从 bytearray 或类型为 'B' 或 'b' 的数组创建的 memoryview " +"对象,此数组必须至少有 8 个字节的空间。然后列表对象将用上述前四个返回值填充," +"并且 memoryview 对象将被就地调整为数据的大小,并用该数据填充。" +"可以在后续调用此方法时重用相同的列表和 memoryview " +"对象,从而提供了一种在不使用堆内存的情况下接收数据的方式。例如::" + +#: ../../library/machine.CAN.rst:187 +msgid "Send a message on the bus:" +msgstr "在总线上发送消息:" + +#: ../../library/machine.CAN.rst:189 +msgid "*data* is the data to send (an integer to send, or a buffer object)." +msgstr "*data* 是要发送的数据(要发送的整数或缓冲区对象)。" + +#: ../../library/machine.CAN.rst:190 +msgid "*id* is the id of the message to be sent." +msgstr "*id* 是要发送的消息的 ID。" + +#: ../../library/machine.CAN.rst:191 +msgid "*timeout* is the timeout in milliseconds to wait for the send." +msgstr "*timeout* 是等待发送的超时时间(以毫秒为单位)。" + +#: ../../library/machine.CAN.rst:192 +msgid "" +"*rtr* is a boolean that specifies if the message shall be sent as a " +"remote transmission request. If *rtr* is True then only the length of " +"*data* is used to fill in the DLC slot of the frame; the actual bytes in " +"*data* are unused." +msgstr "" +"*rtr* 是一个布尔值,指定消息是否应作为远程传输请求发送。如果 *rtr* 为 True," +"则只使用 *data* 的长度填充帧的 DLC 槽;*data* 中的实际字节不使用。" + +#: ../../library/machine.CAN.rst:196 +msgid "" +"*extframe* if True the frame will have an extended identifier (29 bits), " +"otherwise a standard identifier (11 bits) is used." +msgstr "*extframe* 如果为 True,则帧将具有扩展标识符(29 位),否则将使用标准标识符(" +"11 位)。" + +#: ../../library/machine.CAN.rst:202 +msgid "" +"If timeout is 0 the message is placed in a buffer and the method returns " +"immediately." +msgstr "如果超时为0,则消息将放入缓冲区,并立即返回方法。" + +#: ../../library/machine.CAN.rst:200 +msgid "" +"If all three buffers are in use an exception is thrown. If timeout is not" +" 0, the method waits until the message is transmitted. If the message " +"can't be transmitted within the specified time an exception is thrown." +msgstr "如果三个缓冲区都在使用中,则会抛出异常。如果超时不为0,该方法将等待消息发送。" +"如果消息无法在指定时间内发送,则会抛出异常。" + +#: ../../library/machine.CAN.rst:204 +msgid "Return value: ``None``." +msgstr "返回值:``None``。" + +#: ../../library/machine.CAN.rst:208 +msgid "" +"Register a function to be called when a message is accepted into a empty " +"fifo:" +msgstr "注册一个函数,在将消息接受到空的 fifo 时调用:" + +#: ../../library/machine.CAN.rst:210 +msgid "*fifo* is the receiving fifo - always 0." +msgstr "*fifo* 是接收fifo - 总是0。" + +#: ../../library/machine.CAN.rst:211 +msgid "*fun* is the function to be called when the fifo becomes non empty." +msgstr "*fun* 是 fifo 变为非空时要调用的函数。" + +#: ../../library/machine.CAN.rst:213 +msgid "" +"The callback function takes two arguments the first is the can object it " +"self the second is a integer that indicates the reason for the callback." +msgstr "回调函数接受两个参数,第一个是 CAN 对象本身,第二个是表示回调原因的整数。" + +#: ../../library/machine.CAN.rst:217 +msgid "Reason" +msgstr "原因" + +#: ../../library/machine.CAN.rst:219 +msgid "0" +msgstr "0" + +#: ../../library/machine.CAN.rst:219 +msgid "A message has been accepted into a empty FIFO." +msgstr "消息已被接受到空的FIFO中。" + +#: ../../library/machine.CAN.rst:221 +msgid "1" +msgstr "1" + +#: ../../library/machine.CAN.rst:221 +msgid "The FIFO is full" +msgstr "FIFO已满" + +#: ../../library/machine.CAN.rst:223 +msgid "A message has been lost due to a full FIFO" +msgstr "由于FIFO已满,消息已丢失" + +#: ../../library/machine.CAN.rst:226 +msgid "Example use of rxcallback::" +msgstr "rxcallback的示例用法::" + +#: ../../library/machine.CAN.rst:241 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.CAN.rst:248 +msgid "The mode of the CAN bus used in :meth:`~CAN.init()`." +msgstr "在 :meth:`~CAN.init()` 中使用的 CAN 总线模式。" + +#: ../../library/machine.CAN.rst:256 +msgid "Possible states of the CAN controller returned from :meth:`~CAN.state()`." +msgstr "从 :meth:`~CAN.state()` 返回CAN控制器的可能状态。" + +#: ../../library/machine.CAN.rst:261 +msgid "" +"The operation mode of a filter used in :meth:`~CAN.setfilter()` for " +"classic CAN." +msgstr "在 :meth:`~CAN.setfilter()` 中用于经典 CAN的过滤器的操作模式。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2C.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2C.po new file mode 100644 index 0000000000000..12b12392031d6 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2C.po @@ -0,0 +1,323 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.I2C.rst:5 +msgid "class I2C -- a two-wire serial protocol" +msgstr "class I2C -- 一种两线串行协议" + +#: ../../library/machine.I2C.rst:7 +msgid "" +"I2C is a two-wire protocol for communicating between devices. At the " +"physical level it consists of 2 wires: SCL and SDA, the clock and data " +"lines respectively." +msgstr "I2C是一种用于设备间通信的两线协议。在物理层面上,它由两根线组成:SCL和SDA,分别为时钟线和数据线。" + +#: ../../library/machine.I2C.rst:10 +msgid "" +"I2C objects are created attached to a specific bus. They can be " +"initialised when created, or initialised later on." +msgstr "I2C 对象被创建并连接到特定的总线上。它们可以在创建时初始化,也可以稍后初始化。" + +#: ../../library/machine.I2C.rst:13 +msgid "Printing the I2C object gives you information about its configuration." +msgstr "打印I2C对象会给你显示其他配置信息。" + +#: ../../library/machine.I2C.rst:15 +msgid "" +"Both hardware and software I2C implementations exist via the " +":ref:`machine.I2C ` and `machine.SoftI2C` classes. Hardware" +" I2C uses underlying hardware support of the system to perform the " +"reads/writes and is usually efficient and fast but may have restrictions " +"on which pins can be used. Software I2C is implemented by bit-banging and" +" can be used on any pin but is not as efficient. These classes have the " +"same methods available and differ primarily in the way they are " +"constructed." +msgstr "" +"硬件和软件I2C的实现都通过 :ref:`machine.I2C ` 和 `machine.SoftI2C` " +"类。硬件I2C使用系统的底层硬件支持来执行读/写操作,通常效率高且快速,但可能对可用的引脚有限制。软件I2C通过bit-" +"banging实现,可以在任何引脚上使用,但效率不如硬件I2C。这些类有相同的方法可用,主要区别在于它们的构造方式。" + +#: ../../library/machine.I2C.rst:25 +msgid "" +"The I2C bus requires pull-up circuitry on both SDA and SCL for it's " +"operation. Usually these are resistors in the range of 1 - 10 kOhm, " +"connected from each SDA/SCL to Vcc. Without these, the behaviour is " +"undefined and may range from blocking, unexpected watchdog reset to just " +"wrong values. Often, this pull-up circuitry is built-in already to the " +"MCU board or sensor breakout boards, but there is no rule for that. So " +"please check in case of trouble. See also this excellent `learning guide " +"`_" +" by Adafruit about I2C wiring." +msgstr "" +"I2C总线需要在SDA和SCL上有上拉电路才能操作。通常这些是1 - 10 " +"kOhm范围内的电阻,从每个SDA/SCL连接到Vcc。没有这些,行为是未定义的,可能从阻塞、意外的看门狗复位到错误的值都有。通常,这种上拉电路已经" +"内置在MCU板或传感器断路板上,但这并非硬性规定。所以如果遇到问题,请检查。也可以参考Adafruit关于I2C接线的这篇优秀的 " +"`learning guide `_。" + +#: ../../library/machine.I2C.rst:34 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.I2C.rst:53 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.I2C.rst:57 +msgid "Construct and return a new I2C object using the following parameters:" +msgstr "使用以下参数构造并返回一个新的I2C对象:" + +#: ../../library/machine.I2C.rst:59 +msgid "" +"*id* identifies a particular I2C peripheral. Allowed values for depend " +"on the particular port/board" +msgstr "*id* 标识特定的I2C外设。允许的值取决于特定的移植版本/板" + +#: ../../library/machine.I2C.rst:61 ../../library/machine.I2C.rst:77 +msgid "*scl* should be a pin object specifying the pin to use for SCL." +msgstr "*scl* 应该是一个引脚对象,指定用于SCL的引脚。" + +#: ../../library/machine.I2C.rst:62 ../../library/machine.I2C.rst:78 +msgid "*sda* should be a pin object specifying the pin to use for SDA." +msgstr "*sda* 应该是一个引脚对象,指定用于SDA的引脚。" + +#: ../../library/machine.I2C.rst:63 ../../library/machine.I2C.rst:79 +msgid "*freq* should be an integer which sets the maximum frequency for SCL." +msgstr "*freq* 应该是一个整数,设置SCL的最大频率。" + +#: ../../library/machine.I2C.rst:65 +msgid "" +"*timeout* is the maximum time in microseconds to allow for I2C " +"transactions. This parameter is not allowed on some ports." +msgstr "*timeout* 是允许I2C事务的最大时间(微秒)。某些移植版本上不允许此参数。" + +#: ../../library/machine.I2C.rst:68 +msgid "" +"Note that some ports/boards will have default values of *scl* and *sda* " +"that can be changed in this constructor. Others will have fixed values " +"of *scl* and *sda* that cannot be changed." +msgstr "请注意,某些移植版本/板可能有 *scl* 和 *sda* 的默认值,可以在此构造函数中更改。其他的可能有固定的 *scl* 和 *sda* 值,无法更改。" + +#: ../../library/machine.I2C.rst:75 +msgid "Construct a new software I2C object. The parameters are:" +msgstr "构造一个新的软件I2C对象。参数为:" + +#: ../../library/machine.I2C.rst:81 +msgid "" +"*timeout* is the maximum time in microseconds to wait for clock " +"stretching (SCL held low by another device on the bus), after which an " +"``OSError(ETIMEDOUT)`` exception is raised." +msgstr "" +"*timeout* 是等待时钟拉伸的最大时间(微秒)(SCL由总线上的另一个设备保持低电平),之后会抛出 " +"``OSError(ETIMEDOUT)`` 异常。" + +#: ../../library/machine.I2C.rst:86 +msgid "General Methods" +msgstr "通用方法" + +#: ../../library/machine.I2C.rst:90 +msgid "Initialise the I2C bus with the given arguments:" +msgstr "使用给定的参数初始化I2C总线:" + +#: ../../library/machine.I2C.rst:92 +msgid "*scl* is a pin object for the SCL line" +msgstr "*scl* 是SCL线的引脚对象" + +#: ../../library/machine.I2C.rst:93 +msgid "*sda* is a pin object for the SDA line" +msgstr "*sda* 是SDA线的引脚对象" + +#: ../../library/machine.I2C.rst:94 +msgid "*freq* is the SCL clock rate" +msgstr "*freq* 是SCL时钟频率" + +#: ../../library/machine.I2C.rst:96 +msgid "" +"In the case of hardware I2C the actual clock frequency may be lower than " +"the requested frequency. This is dependent on the platform hardware. The " +"actual rate may be determined by printing the I2C object." +msgstr "在硬件I2C的情况下,实际的时钟频率可能低于请求的频率。这取决于平台硬件。实际频率可以通过打印I2C对象来确定。" + +#: ../../library/machine.I2C.rst:102 +msgid "" +"Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list " +"of those that respond. A device responds if it pulls the SDA line low " +"after its address (including a write bit) is sent on the bus." +msgstr "扫描0x08到0x77之间的所有I2C地址,并返回响应的列表。如果设备在其地址(包括写入位)发送到总线后,将SDA线拉低,则认为该设备响应。" + +#: ../../library/machine.I2C.rst:107 +msgid "Primitive I2C operations" +msgstr "原始I2C操作" + +#: ../../library/machine.I2C.rst:109 +msgid "" +"The following methods implement the primitive I2C controller bus " +"operations and can be combined to make any I2C transaction. They are " +"provided if you need more control over the bus, otherwise the standard " +"methods (see below) can be used." +msgstr "以下方法实现了原始I2C控制器总线操作,可以组合使用以进行任何I2C事务。如果你需要对总线有更多控制,可以提供这些方法,否则可以使用标准方法(见下文)。" + +#: ../../library/machine.I2C.rst:113 +msgid "These methods are only available on the `machine.SoftI2C` class." +msgstr "这些方法仅在 `machine.SoftI2C` 类上可用。" + +#: ../../library/machine.I2C.rst:117 +msgid "" +"Generate a START condition on the bus (SDA transitions to low while SCL " +"is high)." +msgstr "在总线上生成一个START条件(SDA在SCL为高时过渡到低电平)。" + +#: ../../library/machine.I2C.rst:121 +msgid "" +"Generate a STOP condition on the bus (SDA transitions to high while SCL " +"is high)." +msgstr "在总线上生成一个STOP条件(SDA在SCL为高时过渡到高电平)。" + +#: ../../library/machine.I2C.rst:125 +msgid "" +"Reads bytes from the bus and stores them into *buf*. The number of bytes" +" read is the length of *buf*. An ACK will be sent on the bus after " +"receiving all but the last byte. After the last byte is received, if " +"*nack* is true then a NACK will be sent, otherwise an ACK will be sent " +"(and in this case the peripheral assumes more bytes are going to be read " +"in a later call)." +msgstr "" +"从总线读取字节并存储到 *buf* 中。读取的字节数是 *buf* " +"的长度。在接收最后一个字节之前的所有字节后,将在总线上发送一个ACK。在接收到最后一个字节后,如果 *nack* " +"为真,则发送一个NACK,否则发送一个ACK(在这种情况下,外设假设稍后会读取更多字节)。" + +#: ../../library/machine.I2C.rst:133 +msgid "" +"Write the bytes from *buf* to the bus. Checks that an ACK is received " +"after each byte and stops transmitting the remaining bytes if a NACK is " +"received. The function returns the number of ACKs that were received." +msgstr "" +"将 *buf* 中的字节写入总线。检查在 *buf* " +"的每个字节写入后是否收到ACK,并在收到NACK时停止传输剩余的字节。函数返回收到的ACK数量。" + +#: ../../library/machine.I2C.rst:138 +msgid "Standard bus operations" +msgstr "标准总线操作" + +#: ../../library/machine.I2C.rst:140 +msgid "" +"The following methods implement the standard I2C controller read and " +"write operations that target a given peripheral device." +msgstr "以下方法实现了针对给定外设设备的标准I2C控制器读写操作。" + +#: ../../library/machine.I2C.rst:145 +msgid "" +"Read *nbytes* from the peripheral specified by *addr*. If *stop* is true " +"then a STOP condition is generated at the end of the transfer. Returns a " +"`bytes` object with the data read." +msgstr "" +"从由 *addr* 指定的外设读取 *nbytes* 字节。如果 *stop* 为真,则在传输结束时生成一个STOP条件。返回一个包含读取数据的 " +"`bytes` 对象。" + +#: ../../library/machine.I2C.rst:151 +msgid "" +"Read into *buf* from the peripheral specified by *addr*. The number of " +"bytes read will be the length of *buf*. If *stop* is true then a STOP " +"condition is generated at the end of the transfer." +msgstr "" +"从由 *addr* 指定的外设读取到 *buf* 中。读取的字节数将是 *buf* 的长度。如果 *stop* " +"为真,则在传输结束时生成一个STOP条件。" + +#: ../../library/machine.I2C.rst:155 ../../library/machine.I2C.rst:201 +#: ../../library/machine.I2C.rst:209 +msgid "The method returns ``None``." +msgstr "方法返回 ``None``。" + +#: ../../library/machine.I2C.rst:159 +msgid "" +"Write the bytes from *buf* to the peripheral specified by *addr*. If a " +"NACK is received following the write of a byte from *buf* then the " +"remaining bytes are not sent. If *stop* is true then a STOP condition is" +" generated at the end of the transfer, even if a NACK is received. The " +"function returns the number of ACKs that were received." +msgstr "" +"将 *buf* 中的字节写入由 *addr* 指定的外设。如果在从 *buf* 写入一个字节后收到一个NACK,则不会发送剩余的字节。如果 " +"*stop* 为真,则即使收到NACK,也会在传输结束时生成一个STOP条件。函数返回收到的ACK数量。" + +#: ../../library/machine.I2C.rst:167 +msgid "" +"Write the bytes contained in *vector* to the peripheral specified by " +"*addr*. *vector* should be a tuple or list of objects with the buffer " +"protocol. The *addr* is sent once and then the bytes from each object in " +"*vector* are written out sequentially. The objects in *vector* may be " +"zero bytes in length in which case they don't contribute to the output." +msgstr "" +"将 *vector* 中包含的字节写入由 *addr* 指定的外设。*vector* 应该是包含具有缓冲协议的对象的元组或列表。*addr* " +"发送一次,然后 *vector* 中每个对象的字节依次写出。*vector* 中的对象可以是长度为零的,在这种情况下它们不会对输出有贡献。" + +#: ../../library/machine.I2C.rst:173 +msgid "" +"If a NACK is received following the write of a byte from one of the " +"objects in *vector* then the remaining bytes, and any remaining objects, " +"are not sent. If *stop* is true then a STOP condition is generated at " +"the end of the transfer, even if a NACK is received. The function " +"returns the number of ACKs that were received." +msgstr "" +"如果在从 *vector* 中的一个对象写入一个字节后收到一个NACK,则不会发送剩余的字节和任何剩余的对象。如果 *stop* " +"为真,则即使收到NACK,也会在传输结束时生成一个STOP条件。函数返回收到的ACK数量。" + +#: ../../library/machine.I2C.rst:180 +msgid "Memory operations" +msgstr "内存操作" + +#: ../../library/machine.I2C.rst:182 +msgid "" +"Some I2C devices act as a memory device (or set of registers) that can be" +" read from and written to. In this case there are two addresses " +"associated with an I2C transaction: the peripheral address and the memory" +" address. The following methods are convenience functions to communicate" +" with such devices." +msgstr "某些I2C设备充当内存设备(或一组寄存器),可以从中读取和写入。在这种情况下,I2C事务有两个相关的地址:外设地址和内存地址。以下方法是与此类设备通信的便利函数。" + +#: ../../library/machine.I2C.rst:189 +msgid "" +"Read *nbytes* from the peripheral specified by *addr* starting from the " +"memory address specified by *memaddr*. The argument *addrsize* specifies " +"the address size in bits. Returns a `bytes` object with the data read." +msgstr "" +"从由 *addr* 指定的外设的 *memaddr* 指定的内存地址开始读取 *nbytes* 字节。*addrsize* " +"参数指定地址大小(位)。返回一个包含读取数据的 `bytes` 对象。" + +#: ../../library/machine.I2C.rst:196 +msgid "" +"Read into *buf* from the peripheral specified by *addr* starting from the" +" memory address specified by *memaddr*. The number of bytes read is the " +"length of *buf*. The argument *addrsize* specifies the address size in " +"bits." +msgstr "" +"从 *addr* 指定的外设从 *memaddr* 指定的内存地址开始读入 *buf* 。读取的字节数是 *buf* 的长度。参数 " +"*addrsize* 指定地址大小(以位为单位)。" + +#: ../../library/machine.I2C.rst:205 +msgid "" +"Write *buf* to the peripheral specified by *addr* starting from the " +"memory address specified by *memaddr*. The argument *addrsize* specifies " +"the address size in bits." +msgstr "从 *memaddr* 指定的内存地址开始,将 *buf* 写入 *addr* 指定的外设。参数 *addrsize* 指定地址大小(以位为单位)。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2CTarget.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2CTarget.po new file mode 100644 index 0000000000000..1cf9d3120a186 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2CTarget.po @@ -0,0 +1,241 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.I2CTarget.rst:5 +msgid "class I2CTarget -- an I2C target device" +msgstr "class I2CTarget -- I2C 目标设备" + +#: ../../library/machine.I2CTarget.rst:7 +msgid "" +"An I2C target is a device which connects to an I2C bus and is controlled " +"by an I2C controller. I2C targets can take many forms. The " +":class:`machine.I2CTarget` class implements an I2C target that can be " +"configured as a memory/register device, or as an arbitrary I2C device by " +"using callbacks (if supported by the port)." +msgstr "" +"I2C 目标是连接到 I2C 总线并由 I2C 控制器控制的设备。I2C 目标可以有多种形式。" +":class:`machine.I2CTarget` 类实现了一个 I2C 目标,可以配置为内存/寄存器设备," +"或者通过使用回调函数配置为任意 I2C 设备(如果移植版本支持)。" + +#: ../../library/machine.I2CTarget.rst:12 +msgid "Example usage for the case of a memory device::" +msgstr "内存设备的使用示例::" + +#: ../../library/machine.I2CTarget.rst:29 +msgid "" +"Note that some ports require an ``id``, and maybe ``scl`` and ``sda`` " +"pins, to be passed to the `I2CTarget` constructor, to select the hardware" +" I2C instance and pins that it connects to." +msgstr "请注意,某些移植版本需要将 ``id`` 以及可能的 ``scl`` 和 ``sda`` 引脚传递给 `I2CTarget` 构造函数,以选择硬件 I2C 实例及其连接的引脚。" + +#: ../../library/machine.I2CTarget.rst:33 +msgid "" +"When configured as a memory device, it's also possible to register to " +"receive events. For example to be notified when the memory is " +"read/written::" +msgstr "配置为内存设备时,还可以注册接收事件。例如,在内存被读取/写入时收到通知::" + +#: ../../library/machine.I2CTarget.rst:51 +msgid "" +"More complicated I2C devices can be implemented using the full set of " +"events. For example, to see the raw events as they are triggered::" +msgstr "可以使用完整的事件集来实现更复杂的 I2C 设备。例如,查看原始事件触发情况::" + +#: ../../library/machine.I2CTarget.rst:78 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/machine.I2CTarget.rst:82 +msgid "" +"Construct and return a new I2CTarget object using the following " +"parameters:" +msgstr "使用以下参数构造并返回一个新的 I2CTarget 对象:" + +#: ../../library/machine.I2CTarget.rst:84 +msgid "" +"*id* identifies a particular I2C peripheral. Allowed values depend on " +"the particular port/board. Some ports have a default in which case this " +"parameter can be omitted." +msgstr "*id* 标识特定的 I2C 外设。允许的值取决于特定的移植版本/板。某些移植版本有默认值,在这种情况下可以省略此参数。" + +#: ../../library/machine.I2CTarget.rst:87 +msgid "*addr* is the I2C address of the target." +msgstr "*addr* 是目标的 I2C 地址。" + +#: ../../library/machine.I2CTarget.rst:88 +msgid "" +"*addrsize* is the number of bits in the I2C target address. Valid values" +" are 7 and 10." +msgstr "*addrsize* 是 I2C 目标地址的位数。有效值为 7 和 10。" + +#: ../../library/machine.I2CTarget.rst:90 +msgid "" +"*mem* is an object with the buffer protocol that is writable. If not " +"specified then there is no backing memory and data must be read/written " +"using the :meth:`I2CTarget.readinto` and :meth:`I2CTarget.write` methods." +msgstr "*mem* 是一个支持缓冲区协议的可写对象。如果未指定,则没有后备内存,数据必须使用 :meth:`I2CTarget.readinto` 和 :meth:`I2CTarget.write` 方法进行读写。" + +#: ../../library/machine.I2CTarget.rst:93 +msgid "" +"*mem_addrsize* is the number of bits in the memory address. Valid values" +" are 0, 8, 16, 24 and 32." +msgstr "*mem_addrsize* 是内存地址的位数。有效值为 0、8、16、24 和 32。" + +#: ../../library/machine.I2CTarget.rst:95 +msgid "*scl* is a pin object specifying the pin to use for SCL." +msgstr "*scl* 是指定用于 SCL 的引脚对象。" + +#: ../../library/machine.I2CTarget.rst:96 +msgid "*sda* is a pin object specifying the pin to use for SDA." +msgstr "*sda* 是指定用于 SDA 的引脚对象。" + +#: ../../library/machine.I2CTarget.rst:98 +msgid "" +"Note that some ports/boards will have default values of *scl* and *sda* " +"that can be changed in this constructor. Others will have fixed values " +"of *scl* and *sda* that cannot be changed." +msgstr "请注意,某些移植版本/板具有 *scl* 和 *sda* 的默认值,可以在此构造函数中更改。其他移植版本具有固定的 *scl* 和 *sda* 值,不能更改。" + +#: ../../library/machine.I2CTarget.rst:103 +msgid "General Methods" +msgstr "通用方法" + +#: ../../library/machine.I2CTarget.rst:107 +msgid "" +"Deinitialise the I2C target. After this method is called the hardware " +"will no longer respond to requests on the I2C bus, and no other methods " +"can be called." +msgstr "反初始化 I2C 目标。调用此方法后,硬件将不再响应 I2C 总线上的请求,也不能调用其他方法。" + +#: ../../library/machine.I2CTarget.rst:112 +msgid "" +"Read into the given buffer any pending bytes written by the I2C " +"controller. Returns the number of bytes read." +msgstr "将 I2C 控制器写入的任何待处理字节读入给定的缓冲区。返回读取的字节数。" + +#: ../../library/machine.I2CTarget.rst:117 +msgid "" +"Write out the bytes from the given buffer, to be passed to the I2C " +"controller after it sends a read request. Returns the number of bytes " +"written. Most ports only accept one byte at a time to this method." +msgstr "将给定缓冲区中的字节写出,在 I2C 控制器发送读取请求后传递给它。返回写入的字节数。大多数移植版本此方法一次只接受一个字节。" + +#: ../../library/machine.I2CTarget.rst:123 +msgid "" +"Configure an IRQ *handler* to be called when an event occurs. The " +"possible events are given by the following constants, which can be or'd " +"together and passed to the *trigger* argument:" +msgstr "配置事件发生时调用的 IRQ *handler*。可能的事件由以下常量给出,可以进行或运算组合后传递给 *trigger* 参数:" + +#: ../../library/machine.I2CTarget.rst:127 +msgid "" +"``IRQ_ADDR_MATCH_READ`` indicates that the target was addressed by a " +"controller for a read transaction." +msgstr "``IRQ_ADDR_MATCH_READ`` 表示目标被控制器寻址以进行读取事务。" + +#: ../../library/machine.I2CTarget.rst:129 +msgid "" +"``IRQ_ADDR_MATCH_READ`` indicates that the target was addressed by a " +"controller for a write transaction." +msgstr "``IRQ_ADDR_MATCH_WRITE`` 表示目标被控制器寻址以进行写入事务。" + +#: ../../library/machine.I2CTarget.rst:131 +msgid "" +"``IRQ_READ_REQ`` indicates that the controller is requesting data, and " +"this request must be satisfied by calling `I2CTarget.write` with the data" +" to be passed back to the controller." +msgstr "``IRQ_READ_REQ`` 表示控制器正在请求数据,必须通过调用 `I2CTarget.write` 将数据传回控制器来满足此请求。" + +#: ../../library/machine.I2CTarget.rst:134 +msgid "" +"``IRQ_WRITE_REQ`` indicates that the controller has written data, and the" +" data must be read by calling `I2CTarget.readinto`." +msgstr "``IRQ_WRITE_REQ`` 表示控制器已写入数据,必须通过调用 `I2CTarget.readinto` 读取数据。" + +#: ../../library/machine.I2CTarget.rst:136 +msgid "" +"``IRQ_END_READ`` indicates that the controller has finished a read " +"transaction." +msgstr "``IRQ_END_READ`` 表示控制器已完成读取事务。" + +#: ../../library/machine.I2CTarget.rst:137 +msgid "" +"``IRQ_END_WRITE`` indicates that the controller has finished a write " +"transaction." +msgstr "``IRQ_END_WRITE`` 表示控制器已完成写入事务。" + +#: ../../library/machine.I2CTarget.rst:139 +msgid "" +"Not all triggers are available on all ports. If a port has the constant " +"then that event is available." +msgstr "并非所有触发器在所有移植版本上都可用。如果移植版本具有该常量,则该事件可用。" + +#: ../../library/machine.I2CTarget.rst:142 +msgid "Note the following restrictions:" +msgstr "请注意以下限制:" + +#: ../../library/machine.I2CTarget.rst:144 +msgid "" +"``IRQ_ADDR_MATCH_READ``, ``IRQ_ADDR_MATCH_READ``, ``IRQ_READ_REQ`` and " +"``IRQ_WRITE_REQ`` must be handled by a hard IRQ callback (with the *hard*" +" argument set to ``True``). This is because these events have very " +"strict timing requirements and must usually be satisfied synchronously " +"with the hardware event." +msgstr "" +"``IRQ_ADDR_MATCH_READ``、``IRQ_ADDR_MATCH_WRITE``、``IRQ_READ_REQ`` 和 ``IRQ_WRITE_REQ`` " +"必须由硬 IRQ 回调处理(将 *hard* 参数设置为 ``True``)。这是因为这些事件具有非常严格的时序要求,通常必须与硬件事件同步满足。" + +#: ../../library/machine.I2CTarget.rst:149 +msgid "" +"``IRQ_END_READ`` and ``IRQ_END_WRITE`` may be handled by either a soft or" +" hard IRQ callback (although note that all events must be registered with" +" the same handler, so if any events need a hard callback then all events " +"must be hard)." +msgstr "``IRQ_END_READ`` 和 ``IRQ_END_WRITE`` 可以由软 IRQ 或硬 IRQ 回调处理(但请注意,所有事件必须使用同一个处理程序注册,因此如果任何事件需要硬回调,则所有事件都必须是硬回调)。" + +#: ../../library/machine.I2CTarget.rst:153 +msgid "" +"If a memory buffer has been supplied in the constructor then " +"``IRQ_END_WRITE`` is not emitted for the transaction that writes the " +"memory address. This is to allow ``IRQ_END_READ`` and ``IRQ_END_WRITE`` " +"to function correctly as soft IRQ callbacks, where the IRQ handler may be" +" called quite some time after the actual hardware event." +msgstr "" +"如果在构造函数中提供了内存缓冲区,则写入内存地址的事务不会发出 ``IRQ_END_WRITE``。" +"这是为了允许 ``IRQ_END_READ`` 和 ``IRQ_END_WRITE`` 作为软 IRQ 回调正确工作," +"因为 IRQ 处理程序可能在实际硬件事件发生后较长时间才被调用。" + +#: ../../library/machine.I2CTarget.rst:161 +msgid "" +"The integer value of the most recent memory address that was selected by " +"the I2C controller (only valid if ``mem`` was specified in the " +"constructor)." +msgstr "I2C 控制器最近选择的内存地址的整数值(仅在构造函数中指定了 ``mem`` 时有效)。" + +#: ../../library/machine.I2CTarget.rst:165 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.I2CTarget.rst:174 +msgid "IRQ trigger sources." +msgstr "IRQ 触发源。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2S.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2S.po new file mode 100644 index 0000000000000..d736f7ae067c9 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.I2S.po @@ -0,0 +1,226 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.I2S.rst:5 +msgid "class I2S -- Inter-IC Sound bus protocol" +msgstr "class I2S -- Inter-IC Sound 总线协议" + +#: ../../library/machine.I2S.rst:7 +msgid "" +"I2S is a synchronous serial protocol used to connect digital audio " +"devices. At the physical level, a bus consists of 3 lines: SCK, WS, SD. " +"The I2S class supports controller operation. Peripheral operation is not" +" supported." +msgstr "" +"I2S 是一种同步串行协议,用于连接数字音频设备。在物理层面,总线由 3 " +"条线组成:SCK、WS、SD。I2S 类支持控制器操作。不支持外设操作。" + +#: ../../library/machine.I2S.rst:11 +msgid "" +"The I2S class is currently available as a Technical Preview. During the " +"preview period, feedback from users is encouraged. Based on this " +"feedback, the I2S class API and implementation may be changed." +msgstr "I2S 类目前作为技术预览版提供。在预览期间,鼓励用户提供反馈。基于这些反馈," +"I2S 类的 API 和实现可能会有所变化。" + +#: ../../library/machine.I2S.rst:14 +msgid "I2S objects can be created and initialized using::" +msgstr "可以使用以下方式创建和初始化 I2S 对象:" + +#: ../../library/machine.I2S.rst:50 +msgid "3 modes of operation are supported:" +msgstr "支持 3 种操作模式:" + +#: ../../library/machine.I2S.rst:48 +msgid "blocking" +msgstr "阻塞" + +#: ../../library/machine.I2S.rst:49 +msgid "non-blocking" +msgstr "非阻塞" + +#: ../../library/machine.I2S.rst:50 +msgid "asyncio" +msgstr "异步" + +#: ../../library/machine.I2S.rst:52 +msgid "blocking::" +msgstr "阻塞::" + +#: ../../library/machine.I2S.rst:58 +msgid "non-blocking::" +msgstr "非阻塞::" + +#: ../../library/machine.I2S.rst:66 +msgid "asyncio::" +msgstr "异步::" + +#: ../../library/machine.I2S.rst:76 +msgid "Constructor" +msgstr "构造函数" + +#: ../../library/machine.I2S.rst:80 +msgid "Construct an I2S object of the given id:" +msgstr "构造一个给定 id 的 I2S 对象:" + +#: ../../library/machine.I2S.rst:82 +msgid "``id`` identifies a particular I2S bus; it is board and port specific" +msgstr "``id`` 标识特定的 I2S 总线;它是特定于板和移植版本的" + +#: ../../library/machine.I2S.rst:84 +msgid "Keyword-only parameters that are supported on all ports:" +msgstr "仅限关键字参数,这些参数在所有移植版本上都支持:" + +#: ../../library/machine.I2S.rst:86 +msgid "``sck`` is a pin object for the serial clock line" +msgstr "``sck`` 是串行时钟线的引脚对象" + +#: ../../library/machine.I2S.rst:87 +msgid "``ws`` is a pin object for the word select line" +msgstr "``ws`` 是字选择线的引脚对象" + +#: ../../library/machine.I2S.rst:88 +msgid "``sd`` is a pin object for the serial data line" +msgstr "``sd`` 是串行数据线的引脚对象" + +#: ../../library/machine.I2S.rst:89 +msgid "" +"``mck`` is a pin object for the master clock line; master clock frequency" +" is sampling rate * 256" +msgstr "``mck`` 是主时钟线的引脚对象;主时钟频率是采样率 * 256" + +#: ../../library/machine.I2S.rst:91 +msgid "``mode`` specifies receive or transmit" +msgstr "``mode`` 指定接收或传输" + +#: ../../library/machine.I2S.rst:92 +msgid "``bits`` specifies sample size (bits), 16 or 32" +msgstr "``bits`` 指定样本大小(位),16 或 32" + +#: ../../library/machine.I2S.rst:93 +msgid "``format`` specifies channel format, STEREO or MONO" +msgstr "``format`` 指定通道格式,STEREO 或 MONO" + +#: ../../library/machine.I2S.rst:94 +msgid "" +"``rate`` specifies audio sampling rate (Hz); this is the frequency of the" +" ``ws`` signal" +msgstr "``rate`` 指定音频采样率(Hz);这是 ``ws`` 信号的频率" + +#: ../../library/machine.I2S.rst:96 +msgid "``ibuf`` specifies internal buffer length (bytes)" +msgstr "``ibuf`` 指定内部缓冲区长度(字节)" + +#: ../../library/machine.I2S.rst:98 +msgid "" +"For all ports, DMA runs continuously in the background and allows user " +"applications to perform other operations while sample data is transferred" +" between the internal buffer and the I2S peripheral unit. Increasing the " +"size of the internal buffer has the potential to increase the time that " +"user applications can perform non-I2S operations before underflow (e.g. " +"``write`` method) or overflow (e.g. ``readinto`` method)." +msgstr "" +"对于所有移植版本,DMA 在后台连续运行," +"允许用户应用程序在样本数据在内部缓冲区和 I2S 外设单元之间传输时执行其他操作。" +"增加内部缓冲区的大小有可能增加用户应用程序在下溢(例如 ``write`` " +"方法)或上溢(例如 ``readinto`` 方法)之前执行非 I2S 操作的时间。" + +#: ../../library/machine.I2S.rst:104 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.I2S.rst:108 +msgid "see Constructor for argument descriptions" +msgstr "有关参数描述,请参阅构造函数" + +#: ../../library/machine.I2S.rst:112 +msgid "Deinitialize the I2S bus" +msgstr "反初始化I2S总线" + +#: ../../library/machine.I2S.rst:116 +msgid "" +"Read audio samples into the buffer specified by ``buf``. ``buf`` must " +"support the buffer protocol, such as bytearray or array. \"buf\" byte " +"ordering is little-endian. For Stereo format, left channel sample " +"precedes right channel sample. For Mono format, the left channel sample " +"data is used. Returns number of bytes read" +msgstr "" +"将音频样本读入由 ``buf`` 指定的缓冲区。``buf`` 必须支持缓冲协议,如 " +"bytearray 或 array。“buf”字节顺序为小端。对于 Stereo " +"格式,左声道样本在右声道样本之前。对于 Mono " +"格式,使用左声道样本数据。返回读取的字节数" + +#: ../../library/machine.I2S.rst:123 +msgid "" +"Write audio samples contained in ``buf``. ``buf`` must support the buffer" +" protocol, such as bytearray or array. \"buf\" byte ordering is little-" +"endian. For Stereo format, left channel sample precedes right channel " +"sample. For Mono format, the sample data is written to both the right and" +" left channels. Returns number of bytes written" +msgstr "" +"写入 ``buf`` 中包含的音频样本。``buf`` 必须支持缓冲协议,如 bytearray 或 " +"array。“buf”字节顺序为小端。对于 Stereo 格式,左声道样本在右声道样本之前。" +"对于 Mono 格式,样本数据写入右声道和左声道。返回写入的字节数" + +#: ../../library/machine.I2S.rst:130 +msgid "" +"Set a callback. ``handler`` is called when ``buf`` is emptied (``write`` " +"method) or becomes full (``readinto`` method). Setting a callback changes" +" the ``write`` and ``readinto`` methods to non-blocking operation. " +"``handler`` is called in the context of the MicroPython scheduler." +msgstr "" +"设置回调。当 ``buf`` 清空(``write`` 方法)或变满(``readinto`` 方法)时," +"调用 ``handler``。设置回调将 ``write`` 和 ``readinto`` " +"方法改为非阻塞操作。``handler`` 在 MicroPython 调度器的上下文中被调用。" + +#: ../../library/machine.I2S.rst:136 +msgid "" +"bitwise shift of all samples contained in ``buf``. ``bits`` specifies " +"sample size in bits. ``shift`` specifies the number of bits to shift each" +" sample. Positive for left shift, negative for right shift. Typically " +"used for volume control. Each bit shift changes sample volume by 6dB." +msgstr "" +"对 ``buf`` 中包含的所有样本进行位移。``bits`` 指定样本大小(位)。``shift`` " +"指定每个样本要移位的位数。正数表示左移,负数表示右移。通常用于音量控制。" +"每位移动改变样本音量 6dB。" + +#: ../../library/machine.I2S.rst:141 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.I2S.rst:145 +msgid "for initialising the I2S bus ``mode`` to receive" +msgstr "初始化I2S总线 ``mode`` 为接收" + +#: ../../library/machine.I2S.rst:149 +msgid "for initialising the I2S bus ``mode`` to transmit" +msgstr "初始化 I2S 总线 ``mode`` 为传输" + +#: ../../library/machine.I2S.rst:153 +msgid "for initialising the I2S bus ``format`` to stereo" +msgstr "初始化 I2S 总线 ``format`` 为立体声" + +#: ../../library/machine.I2S.rst:157 +msgid "for initialising the I2S bus ``format`` to mono" +msgstr "初始化 I2S 总线 ``format`` 为单声道" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.LED.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.LED.po new file mode 100644 index 0000000000000..5ebf070252f5d --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.LED.po @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.LED.rst:5 +msgid "class LED -- LED Control" +msgstr "类 LED -- LED 控制" + +#: ../../library/machine.LED.rst:7 +msgid "The LED class provides an interface to control the on-board LED." +msgstr "LED 类提供了控制板载 LED 的接口。" + +#: ../../library/machine.LED.rst:9 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.LED.rst:22 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/machine.LED.rst:26 +msgid "" +"Access the LED associated with a source identified by *pin_name*. This " +"``pin_name`` may be a string (usually specifying a color), a :ref:`Pin " +"` object, or other value supported by the underlying " +"machine." +msgstr "" +"访问由 *pin_name* 标识的源关联的 LED。此 ``pin_name`` 可以是一个字符串" +"(通常指定颜色)、一个 :ref:`Pin ` 对象,或底层硬件支持的其他值。" + +#: ../../library/machine.LED.rst:32 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.LED.rst:36 +msgid "Returns the name of the board." +msgstr "返回板的名称。" + +#: ../../library/machine.LED.rst:40 +msgid "Turns the LED on." +msgstr "打开 LED。" + +#: ../../library/machine.LED.rst:44 +msgid "Turns the LED off." +msgstr "关闭 LED。" + +#: ../../library/machine.LED.rst:48 +msgid "Toggles the LED state." +msgstr "切换 LED 状态。" + +#: ../../library/machine.LED.rst:52 +msgid "" +"If ``v`` is given, sets the LED to the given value. If ``v`` is not " +"given, returns the current LED value." +msgstr "如果给定了 ``v``,则将 LED 设置为给定的值。如果未给定 ``v``,则返回当前 LED 值。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.PWM.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.PWM.po new file mode 100644 index 0000000000000..4a5ba07493e6f --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.PWM.po @@ -0,0 +1,209 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.PWM.rst:5 +msgid "class PWM -- pulse width modulation" +msgstr "class PWM -- 脉冲宽度调制" + +#: ../../library/machine.PWM.rst:7 +msgid "This class provides pulse width modulation output." +msgstr "这个类提供了脉冲宽度调制输出的功能。" + +#: ../../library/machine.PWM.rst:9 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.PWM.rst:25 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.PWM.rst:29 +msgid "Construct and return a new PWM object using the following parameters:" +msgstr "使用以下参数构造并返回一个新的PWM对象:" + +#: ../../library/machine.PWM.rst:31 +msgid "" +"*dest* is the entity on which the PWM is output, which is usually a " +":ref:`machine.Pin ` object, but a port may allow other " +"values, like integers." +msgstr "" +"*dest* 是PWM输出的实体,通常是一个 :ref:`machine.Pin ` " +"对象,但是某些移植版本可能允许其他值,比如整数。" + +#: ../../library/machine.PWM.rst:34 +msgid "" +"*freq* should be an integer which sets the frequency in Hz for the PWM " +"cycle." +msgstr "*freq* 应该是一个整数,用于设置PWM周期的频率(单位为Hz)。" + +#: ../../library/machine.PWM.rst:36 +msgid "*duty_u16* sets the duty cycle as a ratio ``duty_u16 / 65535``." +msgstr "*duty_u16* 以 ``duty_u16 / 65535`` 的比例设置占空比。" + +#: ../../library/machine.PWM.rst:37 +msgid "*duty_ns* sets the pulse width in nanoseconds." +msgstr "*duty_ns* 以纳秒为单位设置脉冲宽度。" + +#: ../../library/machine.PWM.rst:38 +msgid "*invert* inverts the respective output if the value is True" +msgstr "*invert* 如果值为True,则反转相应的输出" + +#: ../../library/machine.PWM.rst:40 +msgid "" +"Setting *freq* may affect other PWM objects if the objects share the same" +" underlying PWM generator (this is hardware specific). Only one of " +"*duty_u16* and *duty_ns* should be specified at a time. *invert* is " +"available only on the esp32, mimxrt, nrf, rp2, samd and zephyr ports." +msgstr "" +"设置 *freq* 可能会影响其他 PWM 对象,如果这些对象共享相同的底层 PWM 生成器(这是硬件特定的)。*duty_u16* 和 " +"*duty_ns* 应该一次只指定一个。*invert* 仅在 esp32、mimxrt、nrf、rp2、samd 和 zephyr 移植版本上可用。" + +#: ../../library/machine.PWM.rst:46 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.PWM.rst:50 +msgid "" +"Modify settings for the PWM object. See the above constructor for " +"details about the parameters." +msgstr "修改PWM对象的设置。关于参数的详细信息,请参见上面的构造函数文档。" + +#: ../../library/machine.PWM.rst:55 +msgid "Disable the PWM output." +msgstr "禁用PWM输出。" + +#: ../../library/machine.PWM.rst:59 +msgid "Get or set the current frequency of the PWM output." +msgstr "获取或设置PWM输出的当前频率。" + +#: ../../library/machine.PWM.rst:61 +msgid "With no arguments the frequency in Hz is returned." +msgstr "如果没有参数,则返回以Hz为单位的频率。" + +#: ../../library/machine.PWM.rst:63 +msgid "" +"With a single *value* argument the frequency is set to that value in Hz." +" The method may raise a ``ValueError`` if the frequency is outside the " +"valid range." +msgstr "使用单个 *value* 参数时,将频率设置为该值(单位为Hz)。如果频率超出有效范围,方法可能会引发 ``ValueError``。" + +#: ../../library/machine.PWM.rst:68 +msgid "" +"Get or set the current duty cycle of the PWM output, as an unsigned " +"16-bit value in the range 0 to 65535 inclusive." +msgstr "获取或设置PWM输出的当前占空比,作为一个范围在0到65535(含)之间的无符号16位值。" + +#: ../../library/machine.PWM.rst:71 +msgid "With no arguments the duty cycle is returned." +msgstr "没有参数时,返回占空比。" + +#: ../../library/machine.PWM.rst:73 +msgid "" +"With a single *value* argument the duty cycle is set to that value, " +"measured as the ratio ``value / 65535``." +msgstr "使用单个 *value* 参数时,将占空比设置为该值,以 ``value / 65535`` 的比率测量。" + +#: ../../library/machine.PWM.rst:78 +msgid "" +"Get or set the current pulse width of the PWM output, as a value in " +"nanoseconds." +msgstr "获取或设置PWM输出的当前脉冲宽度,作为纳秒值。" + +#: ../../library/machine.PWM.rst:80 +msgid "With no arguments the pulse width in nanoseconds is returned." +msgstr "没有参数时返回脉冲宽度(单位为纳秒)。" + +#: ../../library/machine.PWM.rst:82 +msgid "With a single *value* argument the pulse width is set to that value." +msgstr "使用单个 *value* 参数时,将脉冲宽度设置为该值。" + +#: ../../library/machine.PWM.rst:85 +msgid "Specific PWM class implementations" +msgstr "特定PWM类实现" + +#: ../../library/machine.PWM.rst:87 +msgid "The following concrete class(es) implement enhancements to the PWM class." +msgstr "以下具体类实现了对PWM类的增强。" + +#: ../../library/machine.PWM.rst:89 +msgid ":ref:`pyb.Timer for PyBoard `" +msgstr ":ref:`pyb.Timer for PyBoard `" + +#: ../../library/machine.PWM.rst:92 +msgid "Limitations of PWM" +msgstr "PWM的限制" + +#: ../../library/machine.PWM.rst:94 +msgid "" +"Not all frequencies can be generated with absolute accuracy due to the " +"discrete nature of the computing hardware. Typically the PWM frequency " +"is obtained by dividing some integer base frequency by an integer " +"divider. For example, if the base frequency is 80MHz and the required PWM" +" frequency is 300kHz the divider must be a non-integer number 80000000 / " +"300000 = 266.67. After rounding the divider is set to 267 and the PWM " +"frequency will be 80000000 / 267 = 299625.5 Hz, not 300kHz. If the " +"divider is set to 266 then the PWM frequency will be 80000000 / 266 = " +"300751.9 Hz, but again not 300kHz." +msgstr "" +"由于计算硬件的离散性质,并非所有频率都能以绝对精确度生成。通常,PWM频率是通过将某个整数基频除以一个整数分频器获得的。例如,如果基频是80MHz,而所需的PWM频率是300kHz,则分频器必须是一个非整数数值80000000" +" / 300000 = 266.67。四舍五入后,分频器被设置为267,PWM频率将是80000000 / 267 = 299625.5 " +"Hz,而不是300kHz。如果分频器设置为266,则PWM频率将是80000000 / 266 = 300751.9 " +"Hz,但同样不是300kHz。" + +#: ../../library/machine.PWM.rst:103 +msgid "" +"Some ports like the RP2040 one use a fractional divider, which allow a " +"finer granularity of the frequency at higher frequencies by switching the" +" PWM pulse duration between two adjacent values, such that the resulting " +"average frequency is more close to the intended one, at the cost of " +"spectral purity." +msgstr "一些移植版本如RP2040使用分数分频器,这允许在较高频率下通过在两个相邻值之间切换PWM脉冲持续时间来实现更细的频率粒度,使得结果平均频率更接近预期值,但以频谱纯度为代价。" + +#: ../../library/machine.PWM.rst:108 +msgid "" +"The duty cycle has the same discrete nature and its absolute accuracy is " +"not achievable. On most hardware platforms the duty will be applied at " +"the next frequency period. Therefore, you should wait more than " +"\"1/frequency\" before measuring the duty." +msgstr "占空比也具有相同的离散性质,其绝对精度是无法实现的。在大多数硬件平台上,占空比将在下一个频率周期应用。因此,在测量占空比之前,你应该等待超过“1/频率”的时间。" + +#: ../../library/machine.PWM.rst:113 +msgid "" +"The frequency and the duty cycle resolution are usually interdependent. " +"The higher the PWM frequency the lower the duty resolution which is " +"available, and vice versa. For example, a 300kHz PWM frequency can have a" +" duty cycle resolution of 8 bit, not 16-bit as may be expected. In this " +"case, the lowest 8 bits of *duty_u16* are insignificant. So::" +msgstr "" +"频率和占空比分辨率通常是相互依赖的。PWM频率越高,可用的占空比分辨率就越低,反之亦然。例如,300kHz的PWM频率可以有8位的占空比分辨率,而不是预期的16位。在这种情况下,*duty_u16*" +" 的最低8位是无意义的。所以::" + +#: ../../library/machine.PWM.rst:121 +msgid "and::" +msgstr "和::" + +#: ../../library/machine.PWM.rst:125 +#, python-format +msgid "will generate PWM with the same 50% duty cycle." +msgstr "将生成具有相同50%占空比的PWM。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.Pin.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Pin.po new file mode 100644 index 0000000000000..7f4c92b19a040 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Pin.po @@ -0,0 +1,449 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.Pin.rst:5 +msgid "class Pin -- control I/O pins" +msgstr "class Pin -- 控制I/O引脚" + +#: ../../library/machine.Pin.rst:7 +msgid "" +"A pin object is used to control I/O pins (also known as GPIO - general-" +"purpose input/output). Pin objects are commonly associated with a " +"physical pin that can drive an output voltage and read input voltages. " +"The pin class has methods to set the mode of the pin (IN, OUT, etc) and " +"methods to get and set the digital logic level. For analog control of a " +"pin, see the :class:`ADC` class." +msgstr "" +"Pin 对象用于控制 I/O 引脚(也称为 GPIO - 通用输入/输出)。Pin " +"对象通常与可以驱动输出电压和读取输入电压的物理引脚相关联。Pin " +"类有方法设置引脚的模式(输入、输出等)以及获取和设置数字逻辑电平的方法。对于引脚的模拟控制,请参见 :class:`ADC` 类。" + +#: ../../library/machine.Pin.rst:13 +msgid "" +"A pin object is constructed by using an identifier which unambiguously " +"specifies a certain I/O pin. The allowed forms of the identifier and the" +" physical pin that the identifier maps to are port-specific. " +"Possibilities for the identifier are an integer, a string or a tuple with" +" port and pin number." +msgstr "" +"通过使用明确指定某个 I/O 引脚的标识符来构造 Pin " +"对象。标识符的允许形式和标识符映射到的物理引脚是特定于移植版本的。标识符的可能形式包括整数、字符串或带有移植版本和引脚号的元组。" + +#: ../../library/machine.Pin.rst:19 +msgid "Usage Model::" +msgstr "使用模型::" + +#: ../../library/machine.Pin.rst:43 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.Pin.rst:47 +msgid "" +"Access the pin peripheral (GPIO pin) associated with the given ``id``. " +"If additional arguments are given in the constructor then they are used " +"to initialise the pin. Any settings that are not specified will remain " +"in their previous state." +msgstr "" +"使用给定的 ``id`` 访问与之关联的引脚外设(GPIO " +"引脚)。如果在构造函数中给出了其他参数,则使用它们来初始化引脚。任何未指定的设置将保持其之前的状态。" + +#: ../../library/machine.Pin.rst:51 ../../library/machine.Pin.rst:174 +msgid "The arguments are:" +msgstr "参数包括:" + +#: ../../library/machine.Pin.rst:53 +msgid "" +"``id`` is mandatory and can be an arbitrary object. Among possible value" +" types are: int (an internal Pin identifier), str (a Pin name), and tuple" +" (pair of [port, pin])." +msgstr "" +"``id`` 是必须的,可以是任意对象。可能的值类型包括:int(内部 Pin 标识符)、str(Pin 名称)和 tuple([port, " +"pin]对)。" + +#: ../../library/machine.Pin.rst:57 +msgid "``mode`` specifies the pin mode, which can be one of:" +msgstr "``mode`` 指定引脚模式,可以是以下之一:" + +#: ../../library/machine.Pin.rst:59 +msgid "" +"``Pin.IN`` - Pin is configured for input. If viewed as an output the pin" +" is in high-impedance state." +msgstr "``Pin.IN`` - 引脚配置为输入。如果视为输出,则引脚处于高阻抗状态。" + +#: ../../library/machine.Pin.rst:62 +msgid "``Pin.OUT`` - Pin is configured for (normal) output." +msgstr "``Pin.OUT`` - 引脚配置为(普通)输出。" + +#: ../../library/machine.Pin.rst:64 +msgid "" +"``Pin.OPEN_DRAIN`` - Pin is configured for open-drain output. Open-drain " +"output works in the following way: if the output value is set to 0 the " +"pin is active at a low level; if the output value is 1 the pin is in a " +"high-impedance state. Not all ports implement this mode, or some might " +"only on certain pins." +msgstr "" +"``Pin.OPEN_DRAIN`` - " +"引脚配置为开漏输出。开漏输出的工作方式如下:如果输出值设置为0,则引脚处于低电平活动状态;如果输出值为1,则引脚处于高阻抗状态。并非所有移植版本都实现了这种模式,或者某些移植版本可能只在某些引脚上实现。" + +#: ../../library/machine.Pin.rst:69 +msgid "" +"``Pin.ALT`` - Pin is configured to perform an alternative function, which" +" is port specific. For a pin configured in such a way any other Pin " +"methods (except :meth:`Pin.init`) are not applicable (calling them will " +"lead to undefined, or a hardware-specific, result). Not all ports " +"implement this mode." +msgstr "" +"``Pin.ALT`` - 引脚配置为执行特定于移植版本的替代功能。以这种方式配置的引脚,任何其他 Pin 方法(除了 " +":meth:`Pin.init`)都不适用(调用它们将导致未定义的或硬件特定的结果)。并非所有移植版本都实现了这种模式。" + +#: ../../library/machine.Pin.rst:74 +msgid "" +"``Pin.ALT_OPEN_DRAIN`` - The Same as ``Pin.ALT``, but the pin is " +"configured as open-drain. Not all ports implement this mode." +msgstr "``Pin.ALT_OPEN_DRAIN`` - 与 ``Pin.ALT`` 相同,但引脚配置为开漏。并非所有移植版本都实现了这种模式。" + +#: ../../library/machine.Pin.rst:77 +msgid "" +"``Pin.ANALOG`` - Pin is configured for analog input, see the :class:`ADC`" +" class." +msgstr "``Pin.ANALOG`` - 引脚配置为模拟输入,请参见 :class:`ADC` 类。" + +#: ../../library/machine.Pin.rst:79 +msgid "" +"``pull`` specifies if the pin has a (weak) pull resistor attached, and " +"can be one of:" +msgstr "``pull`` 指定引脚是否连接了(弱)上拉或下拉电阻,可以是:" + +#: ../../library/machine.Pin.rst:82 +msgid "``None`` - No pull up or down resistor." +msgstr "``None`` - 无上拉或下拉电阻。" + +#: ../../library/machine.Pin.rst:83 +msgid "``Pin.PULL_UP`` - Pull up resistor enabled." +msgstr "``Pin.PULL_UP`` - 启用上拉电阻。" + +#: ../../library/machine.Pin.rst:84 +msgid "``Pin.PULL_DOWN`` - Pull down resistor enabled." +msgstr "``Pin.PULL_UP`` - 启用下拉电阻。" + +#: ../../library/machine.Pin.rst:86 +msgid "" +"``value`` is valid only for Pin.OUT and Pin.OPEN_DRAIN modes and " +"specifies initial output pin value if given, otherwise the state of the " +"pin peripheral remains unchanged." +msgstr "``value`` 仅对 Pin.OUT 和 Pin.OPEN_DRAIN 模式有效,如果给出,则指定初始输出引脚值,否则引脚外设的状态保持不变。" + +#: ../../library/machine.Pin.rst:90 +msgid "" +"``drive`` specifies the output power of the pin and can be one of: " +"``Pin.DRIVE_0``, ``Pin.DRIVE_1``, etc., increasing in drive strength. " +"The actual current driving capabilities are port dependent. Not all " +"ports implement this argument." +msgstr "" +"``drive`` 指定引脚的输出功率,可以是:``Pin.DRIVE_0``、``Pin.DRIVE_1`` " +"等,驱动强度递增。实际的电流驱动能力取决于移植版本。并非所有移植版本都实现了这个参数。" + +#: ../../library/machine.Pin.rst:94 +msgid "" +"``alt`` specifies an alternate function for the pin and the values it can" +" take are port dependent. This argument is valid only for ``Pin.ALT`` " +"and ``Pin.ALT_OPEN_DRAIN`` modes. It may be used when a pin supports " +"more than one alternate function. If only one pin alternate function is " +"supported the this argument is not required. Not all ports implement " +"this argument." +msgstr "" +"``alt`` 为引脚指定一个替代功能,其可取的值取决于移植版本。此参数仅对 ``Pin.ALT`` 和 " +"``Pin.ALT_OPEN_DRAIN`` " +"模式有效。当一个引脚支持多于一个的替代功能时,可以使用它。如果只支持一个引脚替代功能,则不需要此参数。并非所有移植版本都实现了这个参数。" + +#: ../../library/machine.Pin.rst:100 +msgid "" +"As specified above, the Pin class allows to set an alternate function for" +" a particular pin, but it does not specify any further operations on such" +" a pin. Pins configured in alternate-function mode are usually not used " +"as GPIO but are instead driven by other hardware peripherals. The only " +"operation supported on such a pin is re-initialising, by calling the " +"constructor or :meth:`Pin.init` method. If a pin that is configured in " +"alternate-function mode is re-initialised with ``Pin.IN``, ``Pin.OUT``, " +"or ``Pin.OPEN_DRAIN``, the alternate function will be removed from the " +"pin." +msgstr "" +"如上所述,Pin 类允许为特定引脚设置替代功能,但它不指定对这样的引脚的任何进一步操作。配置为替代功能模式的引脚通常不用作 " +"GPIO,而是由其他硬件外设驱动。对这样的引脚唯一支持的操作是通过调用构造函数或 :meth:`Pin.init` " +"方法重新初始化。如果配置为替代功能模式的引脚重新初始化为 ``Pin.IN``、``Pin.OUT`` 或 " +"``Pin.OPEN_DRAIN``,则该引脚将移除替代功能。" + +#: ../../library/machine.Pin.rst:109 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.Pin.rst:113 +msgid "" +"Re-initialise the pin using the given parameters. Only those arguments " +"that are specified will be set. The rest of the pin peripheral state " +"will remain unchanged. See the constructor documentation for details of " +"the arguments." +msgstr "使用给定的参数重新初始化引脚。只有指定的参数将被设置。引脚外设的其余状态将保持不变。有关参数的详细信息,请参见构造函数文档。" + +#: ../../library/machine.Pin.rst:117 +msgid "Returns ``None``." +msgstr "返回 ``None``。" + +#: ../../library/machine.Pin.rst:121 +msgid "" +"This method allows to set and get the value of the pin, depending on " +"whether the argument ``x`` is supplied or not." +msgstr "此方法允许设置和获取引脚的值,这取决于是否提供了参数 ``x``。" + +#: ../../library/machine.Pin.rst:124 +msgid "" +"If the argument is omitted then this method gets the digital logic level " +"of the pin, returning 0 or 1 corresponding to low and high voltage " +"signals respectively. The behaviour of this method depends on the mode " +"of the pin:" +msgstr "如果省略了参数,则此方法获取引脚的数字逻辑电平,返回 0 或 1,分别对应于低和高电压信号。此方法的行为取决于引脚的模式:" + +#: ../../library/machine.Pin.rst:128 +msgid "" +"``Pin.IN`` - The method returns the actual input value currently present " +"on the pin." +msgstr "``Pin.IN`` - 该方法返回当前在引脚上存在的实际输入值。" + +#: ../../library/machine.Pin.rst:130 +msgid "``Pin.OUT`` - The behaviour and return value of the method is undefined." +msgstr "``Pin.OUT`` - 该方法的行为和返回值未定义。" + +#: ../../library/machine.Pin.rst:131 +msgid "" +"``Pin.OPEN_DRAIN`` - If the pin is in state '0' then the behaviour and " +"return value of the method is undefined. Otherwise, if the pin is in " +"state '1', the method returns the actual input value currently present on" +" the pin." +msgstr "" +"``Pin.OPEN_DRAIN`` - " +"如果引脚处于状态'0',则该方法的行为和返回值未定义。否则,如果引脚处于状态'1',该方法返回当前在引脚上存在的实际输入值。" + +#: ../../library/machine.Pin.rst:136 +msgid "" +"If the argument is supplied then this method sets the digital logic level" +" of the pin. The argument ``x`` can be anything that converts to a " +"boolean. If it converts to ``True``, the pin is set to state '1', " +"otherwise it is set to state '0'. The behaviour of this method depends " +"on the mode of the pin:" +msgstr "" +"如果提供了参数,则此方法设置引脚的数字逻辑电平。参数 ``x`` 可以是任何转换为布尔值的东西。如果它转换为 " +"``True``,则引脚设置为状态'1',否则设置为状态'0'。此方法的行为取决于引脚的模式:" + +#: ../../library/machine.Pin.rst:141 +msgid "" +"``Pin.IN`` - The value is stored in the output buffer for the pin. The " +"pin state does not change, it remains in the high-impedance state. The " +"stored value will become active on the pin as soon as it is changed to " +"``Pin.OUT`` or ``Pin.OPEN_DRAIN`` mode." +msgstr "" +"``Pin.IN`` - 值存储在引脚的输出缓冲区中。引脚状态不变,仍处于高阻抗状态。一旦将其更改为 ``Pin.OUT`` 或 " +"``Pin.OPEN_DRAIN`` 模式,存储的值将在引脚上变为活动状态。" + +#: ../../library/machine.Pin.rst:145 +msgid "``Pin.OUT`` - The output buffer is set to the given value immediately." +msgstr "``Pin.OUT`` - 输出缓冲区立即设置为给定值。" + +#: ../../library/machine.Pin.rst:146 +msgid "" +"``Pin.OPEN_DRAIN`` - If the value is '0' the pin is set to a low voltage " +"state. Otherwise the pin is set to high-impedance state." +msgstr "``Pin.OPEN_DRAIN`` - 如果值为'0',则引脚设置为低电压状态。否则,引脚设置为高阻抗状态。" + +#: ../../library/machine.Pin.rst:149 +msgid "When setting the value this method returns ``None``." +msgstr "设置值时,此方法返回 ``None``。" + +#: ../../library/machine.Pin.rst:153 +msgid "" +"Pin objects are callable. The call method provides a (fast) shortcut to " +"set and get the value of the pin. It is equivalent to Pin.value([x]). " +"See :meth:`Pin.value` for more details." +msgstr "" +"Pin 对象是可调用的。调用方法提供了设置和获取引脚值的(快速)快捷方式。它等同于 Pin.value([x])。有关更多详细信息,请参见 " +":meth:`Pin.value`。" + +#: ../../library/machine.Pin.rst:159 ../../library/machine.Pin.rst:216 +msgid "Set pin to \"1\" output level." +msgstr "将引脚设置为“1”输出电平。" + +#: ../../library/machine.Pin.rst:163 ../../library/machine.Pin.rst:210 +msgid "Set pin to \"0\" output level." +msgstr "将引脚设置为“0”输出电平。" + +#: ../../library/machine.Pin.rst:167 +msgid "" +"Configure an interrupt handler to be called when the trigger source of " +"the pin is active. If the pin mode is ``Pin.IN`` then the trigger source" +" is the external value on the pin. If the pin mode is ``Pin.OUT`` then " +"the trigger source is the output buffer of the pin. Otherwise, if the " +"pin mode is ``Pin.OPEN_DRAIN`` then the trigger source is the output " +"buffer for state '0' and the external pin value for state '1'." +msgstr "" +"配置中断处理程序,当引脚的触发源激活时调用。如果引脚模式为 ``Pin.IN``,则触发源为引脚上的外部值。如果引脚模式为 " +"``Pin.OUT``,则触发源就是引脚的输出缓冲区。否则,如果引脚模式为 " +"``Pin.OPEN_DRAIN``,则触发源是状态'0'的输出缓冲区和状态'1'的外部引脚值。" + +#: ../../library/machine.Pin.rst:176 +msgid "" +"``handler`` is an optional function to be called when the interrupt " +"triggers. The handler must take exactly one argument which is the ``Pin``" +" instance." +msgstr "``handler`` 是一个可选的函数,当中断触发时调用。处理程序必须准确地接受一个参数,即 ``Pin`` 实例。" + +#: ../../library/machine.Pin.rst:180 +msgid "" +"``trigger`` configures the event which can generate an interrupt. " +"Possible values are:" +msgstr "``trigger`` 配置可以生成中断的事件。可能的值包括:" + +#: ../../library/machine.Pin.rst:183 +msgid "``Pin.IRQ_FALLING`` interrupt on falling edge." +msgstr "``Pin.IRQ_FALLING`` 下降沿中断。" + +#: ../../library/machine.Pin.rst:184 +msgid "``Pin.IRQ_RISING`` interrupt on rising edge." +msgstr "``Pin.IRQ_RISING`` 上升沿中断。" + +#: ../../library/machine.Pin.rst:185 +msgid "``Pin.IRQ_LOW_LEVEL`` interrupt on low level." +msgstr "``Pin.IRQ_LOW_LEVEL`` 低电平中断。" + +#: ../../library/machine.Pin.rst:186 +msgid "``Pin.IRQ_HIGH_LEVEL`` interrupt on high level." +msgstr "``Pin.IRQ_HIGH_LEVEL`` 高电平中断。" + +#: ../../library/machine.Pin.rst:188 +msgid "These values can be OR'ed together to trigger on multiple events." +msgstr "这些值可以通过 OR 运算组合在一起以触发多个事件。" + +#: ../../library/machine.Pin.rst:190 +msgid "" +"``priority`` sets the priority level of the interrupt. The values it can" +" take are port-specific, but higher values always represent higher " +"priorities." +msgstr "``priority`` 设置中断的优先级。它可以取的值是特定于移植版本的,但更高的值总是代表更高的优先级。" + +#: ../../library/machine.Pin.rst:194 +msgid "" +"``wake`` selects the power mode in which this interrupt can wake up the " +"system. It can be ``machine.IDLE``, ``machine.SLEEP`` or " +"``machine.DEEPSLEEP``. These values can also be OR'ed together to make a " +"pin generate interrupts in more than one power mode." +msgstr "" +"``wake`` 选择此中断可以唤醒系统的电源模式。它可以是 ``machine.IDLE``、``machine.SLEEP`` 或 " +"``machine.DEEPSLEEP``。这些值也可以通过 OR 运算组合在一起,使一个引脚在多个电源模式中生成中断。" + +#: ../../library/machine.Pin.rst:199 +msgid "" +"``hard`` if true a hardware interrupt is used. This reduces the delay " +"between the pin change and the handler being called. Hard interrupt " +"handlers may not allocate memory; see :ref:`isr_rules`. Not all ports " +"support this argument." +msgstr "" +"``hard`` 如果为真,则使用硬件中断。这减少了引脚变化和调用处理程序之间的延迟。硬中断处理程序不得分配内存;参见 " +":ref:`isr_rules`。并非所有移植版本都支持此参数。" + +#: ../../library/machine.Pin.rst:204 +msgid "This method returns a callback object." +msgstr "此方法返回一个回调对象。" + +#: ../../library/machine.Pin.rst:206 +msgid "" +"The following methods are not part of the core Pin API and only " +"implemented on certain ports." +msgstr "以下方法不是核心 Pin API 的一部分,只在某些移植版本上实现。" + +#: ../../library/machine.Pin.rst:212 ../../library/machine.Pin.rst:218 +msgid "Availability: mimxrt, nrf, renesas-ra, rp2, samd, stm32, alif ports." +msgstr "可用性:mimxrt、nrf、renesas-ra、rp2、samd、stm32、alif 移植版本。" + +#: ../../library/machine.Pin.rst:222 +msgid "" +"Get or set the pin mode. See the constructor documentation for details of" +" the ``mode`` argument." +msgstr "获取或设置引脚模式。有关 ``mode`` 参数的详细信息,请参见构造函数文档。" + +#: ../../library/machine.Pin.rst:225 ../../library/machine.Pin.rst:232 +msgid "Availability: cc3200, stm32 ports." +msgstr "可用性:cc3200, stm32 移植版本。" + +#: ../../library/machine.Pin.rst:229 +msgid "" +"Get or set the pin pull state. See the constructor documentation for " +"details of the ``pull`` argument." +msgstr "获取或设置引脚的上拉状态。有关 ``pull`` 参数的详细信息,请参见构造函数文档。" + +#: ../../library/machine.Pin.rst:236 +msgid "" +"Get or set the pin drive strength. See the constructor documentation for " +"details of the ``drive`` argument." +msgstr "获取或设置引脚的驱动强度。有关 ``drive`` 参数的详细信息,请参见构造函数文档。" + +#: ../../library/machine.Pin.rst:239 +msgid "Availability: cc3200 port." +msgstr "可用性:cc3200移植版本。" + +#: ../../library/machine.Pin.rst:243 +msgid "Toggle output pin from \"0\" to \"1\" or vice-versa." +msgstr "将输出引脚从 \"0\" 切换为 \"1\",或反之。" + +#: ../../library/machine.Pin.rst:245 +msgid "Availability: cc3200, esp32, esp8266, mimxrt, rp2, samd, alif ports." +msgstr "可用性:cc3200、esp32、esp8266、mimxrt、rp2、samd、alif 移植版本。" + +#: ../../library/machine.Pin.rst:248 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.Pin.rst:250 +msgid "" +"The following constants are used to configure the pin objects. Note that" +" not all constants are available on all ports." +msgstr "以下常量用于配置Pin对象。请注意,并非所有常量在所有移植版本上都可用。" + +#: ../../library/machine.Pin.rst:260 +msgid "Selects the pin mode." +msgstr "选择引脚模式。" + +#: ../../library/machine.Pin.rst:266 +msgid "" +"Selects whether there is a pull up/down resistor. Use the value ``None``" +" for no pull." +msgstr "选择是否有上拉/下拉电阻。使用值 ``None`` 表示无上拉。" + +#: ../../library/machine.Pin.rst:273 +msgid "" +"Selects the pin drive strength. A port may define additional drive " +"constants with increasing number corresponding to increasing drive " +"strength." +msgstr "选择引脚的驱动强度。一个移植版本可以定义额外的驱动常量,其编号随驱动强度的增加而增加。" + +#: ../../library/machine.Pin.rst:282 +msgid "Selects the IRQ trigger type." +msgstr "选择 IRQ 触发类型。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.RTC.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.RTC.po new file mode 100644 index 0000000000000..46bc0b3db20f0 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.RTC.po @@ -0,0 +1,181 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.RTC.rst:5 +msgid "class RTC -- real time clock" +msgstr "class RTC -- 实时时钟" + +#: ../../library/machine.RTC.rst:7 +msgid "The RTC is an independent clock that keeps track of the date and time." +msgstr "RTC 是一个独立的时钟,用于跟踪日期和时间。" + +#: ../../library/machine.RTC.rst:10 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.RTC.rst:18 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.RTC.rst:22 +msgid "Create an RTC object. See init for parameters of initialization." +msgstr "创建一个 RTC 对象。有关初始化的参数,请参见 init 方法。" + +#: ../../library/machine.RTC.rst:25 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.RTC.rst:29 +msgid "Get or set the date and time of the RTC." +msgstr "获取或设置 RTC 的日期和时间。" + +#: ../../library/machine.RTC.rst:31 +msgid "" +"With no arguments, this method returns an 8-tuple with the current date " +"and time. With 1 argument (being an 8-tuple) it sets the date and time." +msgstr "没有参数时,此方法返回一个包含当前日期和时间的8元组。带有1个参数(是一个8元组)时,它设置日期和时间。" + +#: ../../library/machine.RTC.rst:35 +msgid "The 8-tuple has the following format:" +msgstr "8 元组具有以下格式:" + +#: ../../library/machine.RTC.rst:37 +msgid "(year, month, day, weekday, hours, minutes, seconds, subseconds)" +msgstr "(年, 月, 日, 星期, 小时, 分钟, 秒, 子秒)" + +#: ../../library/machine.RTC.rst:39 +msgid "The meaning of the ``subseconds`` field is hardware dependent." +msgstr "``subseconds`` 字段的含义依赖于硬件。" + +#: ../../library/machine.RTC.rst:43 +msgid "Initialise the RTC. Datetime is a tuple of the form:" +msgstr "初始化RTC。Datatime是以下形式的元组:" + +#: ../../library/machine.RTC.rst:45 +msgid "``(year, month, day, hour, minute, second, microsecond, tzinfo)``" +msgstr "``(年, 月, 日, 小时, 分钟, 秒, 微秒, 时区信息)``" + +#: ../../library/machine.RTC.rst:47 +msgid "" +"All eight arguments must be present. The ``microsecond`` and ``tzinfo`` " +"values are currently ignored but might be used in the future." +msgstr "必须提供全部八个参数。``microsecond`` 和 ``tzinfo`` 值目前被忽略,但将来可能会使用。" + +#: ../../library/machine.RTC.rst:50 +msgid "" +"Availability: CC3200, ESP32, MIMXRT, SAMD. The rtc.init() method on the " +"stm32 and renesas-ra ports just (re-)starts the RTC and does not accept " +"arguments." +msgstr "" +"可用性:CC3200、ESP32、MIMXRT、SAMD。在 stm32 和 renesas-ra 端口上," +"rtc.init() 方法仅(重新)启动 RTC,不接受参数。" + +#: ../../library/machine.RTC.rst:56 +msgid "Get get the current datetime tuple." +msgstr "获取当前的日期时间元组。" + +#: ../../library/machine.RTC.rst:58 +msgid "Availability: WiPy." +msgstr "可用性:WiPy。" + +#: ../../library/machine.RTC.rst:62 +msgid "Resets the RTC to the time of January 1, 2015 and starts running it again." +msgstr "将 RTC 重置为 2015 年 1 月 1 日的时间,并重新开始运行。" + +#: ../../library/machine.RTC.rst:66 +msgid "" +"Set the RTC alarm. Time might be either a millisecond value to program " +"the alarm to current time + time_in_ms in the future, or a datetimetuple." +" If the time passed is in milliseconds, repeat can be set to ``True`` to " +"make the alarm periodic." +msgstr "" +"设置 RTC 警报。时间可以是毫秒值,以便将警报编程为当前时间 + 未来的 time_in_ms,或者是一个 " +"datetimetuple。如果传递的时间是以毫秒为单位的,可以将 repeat 设置为 ``True`` 以使警报周期性地响起。" + +#: ../../library/machine.RTC.rst:72 +msgid "Get the number of milliseconds left before the alarm expires." +msgstr "获取警报过期前剩余的毫秒数。" + +#: ../../library/machine.RTC.rst:76 +msgid "Cancel a running alarm." +msgstr "取消正在运行的警报。" + +#: ../../library/machine.RTC.rst:78 +msgid "" +"The mimxrt port also exposes this function as ``RTC.cancel(alarm_id=0)``," +" but this is scheduled to be removed in MicroPython 2.0." +msgstr "mimxrt 端口也将此函数公开为 ``RTC.cancel(alarm_id=0)``,但计划在 MicroPython 2.0 中移除。" + +#: ../../library/machine.RTC.rst:83 +msgid "Create an irq object triggered by a real time clock alarm." +msgstr "创建由实时时钟警报触发的irq对象。" + +#: ../../library/machine.RTC.rst:85 +msgid "``trigger`` must be ``RTC.ALARM0``" +msgstr "``trigger`` 必须是 ``RTC.ALARM0``" + +#: ../../library/machine.RTC.rst:86 +msgid "``handler`` is the function to be called when the callback is triggered." +msgstr "``handler`` 是触发回调时要调用的函数。" + +#: ../../library/machine.RTC.rst:87 +msgid "" +"``wake`` specifies the sleep mode from where this interrupt can wake up " +"the system." +msgstr "``wake`` 指定此中断可以唤醒系统的睡眠模式。" + +#: ../../library/machine.RTC.rst:92 +msgid "" +"``RTC.memory(data)`` will write *data* to the RTC memory, where *data* is" +" any object which supports the buffer protocol (including `bytes`, " +"`bytearray`, `memoryview` and `array.array`). ``RTC.memory()`` reads RTC " +"memory and returns a `bytes` object." +msgstr "" +"``RTC.memory(data)`` 将 *data* 写入 RTC 内存,其中 *data* 是支持缓冲区协议的任何对象(包括 " +"`bytes`、`bytearray`、`memoryview` 和 `array.array`)。``RTC.memory()`` 读取 RTC" +" 内存并返回一个 `bytes` 对象。" + +#: ../../library/machine.RTC.rst:97 +msgid "" +"Data written to RTC user memory is persistent across restarts, including " +":ref:`soft_reset` and `machine.deepsleep()`." +msgstr "写入 RTC 用户内存的数据在重启后保持持久,包括 :ref:`soft_reset` 和 `machine.deepsleep()`。" + +#: ../../library/machine.RTC.rst:100 +msgid "" +"The maximum length of RTC user memory is 2048 bytes by default on esp32, " +"and 492 bytes on esp8266." +msgstr "默认情况下,ESP32 上的 RTC 用户内存最大长度为 2048 字节,ESP8266 上为 492 字节。" + +#: ../../library/machine.RTC.rst:103 +msgid "Availability: esp32, esp8266 ports." +msgstr "可用性:ESP32、ESP8266 端口。" + +#: ../../library/machine.RTC.rst:106 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.RTC.rst:110 +msgid "irq trigger source" +msgstr "irq触发源" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.SPI.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.SPI.po new file mode 100644 index 0000000000000..232fb72c098e5 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.SPI.po @@ -0,0 +1,206 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.SPI.rst:5 +msgid "class SPI -- a Serial Peripheral Interface bus protocol (controller side)" +msgstr "class SPI -- 串行外设接口总线协议(控制器端)" + +#: ../../library/machine.SPI.rst:7 +msgid "" +"SPI is a synchronous serial protocol that is driven by a controller. At " +"the physical level, a bus consists of 3 lines: SCK, MOSI, MISO. Multiple " +"devices can share the same bus. Each device should have a separate, 4th " +"signal, CS (Chip Select), to select a particular device on a bus with " +"which communication takes place. Management of a CS signal should happen " +"in user code (via machine.Pin class)." +msgstr "" +"SPI是一种由控制器驱动的同步串行协议。在物理层面上,总线由3条线组成:SCK、MOSI" +"、MISO。多个设备可以共享同一总线。每个设备应该有一个单独的第4个信号,CS(片选" +"信号),用来选择与之通信的总线上的特定设备。CS信号的管理应该在用户代码中进行" +"(通过machine.Pin类)。" + +#: ../../library/machine.SPI.rst:14 +msgid "" +"Both hardware and software SPI implementations exist via the " +":ref:`machine.SPI ` and `machine.SoftSPI` classes. Hardware" +" SPI uses underlying hardware support of the system to perform the " +"reads/writes and is usually efficient and fast but may have restrictions " +"on which pins can be used. Software SPI is implemented by bit-banging and" +" can be used on any pin but is not as efficient. These classes have the " +"same methods available and differ primarily in the way they are " +"constructed." +msgstr "" +"硬件和软件SPI实现均可通过 :ref:`machine.SPI ` 和 `machine." +"SoftSPI` 类。硬件SPI使用系统的底层硬件支持来执行读写操作,通常效率高且速度快" +",但可能对可用的引脚有限制。软件SPI通过位摆动实现,可以在任何引脚上使用,但效" +"率不高。这些类有相同的方法可用,并且主要在构造方式上有所不同。" + +#: ../../library/machine.SPI.rst:22 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.SPI.rst:59 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.SPI.rst:63 +msgid "" +"Construct an SPI object on the given bus, *id*. Values of *id* depend on " +"a particular port and its hardware. Values 0, 1, etc. are commonly used " +"to select hardware SPI block #0, #1, etc." +msgstr "" +"在给定的总线 *id* 上构造一个SPI对象。*id* 的值取决于特定的移植版本和其硬件。" +"常用的值为0、1等,用来选择硬件SPI块#0、#1等。" + +#: ../../library/machine.SPI.rst:67 +msgid "" +"With no additional parameters, the SPI object is created but not " +"initialised (it has the settings from the last initialisation of the bus," +" if any). If extra arguments are given, the bus is initialised. See " +"``init`` for parameters of initialisation." +msgstr "" +"如果没有额外的参数,SPI对象被创建但未初始化(它保留了总线的最后一次初始化设置" +",如果有的话)。如果给出了额外的参数,则初始化总线。查看 ``init`` " +"了解初始化的参数。" + +#: ../../library/machine.SPI.rst:75 +msgid "" +"Construct a new software SPI object. Additional parameters must be " +"given, usually at least *sck*, *mosi* and *miso*, and these are used to " +"initialise the bus. See `SPI.init` for a description of the parameters." +msgstr "" +"构造一个新的软件SPI对象。必须给出额外的参数,通常至少包括 *sck*、*mosi* 和 " +"*miso*,这些用于初始化总线。查看 `SPI.init` 了解参数的描述。" + +#: ../../library/machine.SPI.rst:80 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.SPI.rst:84 +msgid "Initialise the SPI bus with the given parameters:" +msgstr "使用给定的参数初始化 SPI 总线:" + +#: ../../library/machine.SPI.rst:86 +msgid "``baudrate`` is the SCK clock rate." +msgstr "``baudrate`` 是SCK时钟速率。" + +#: ../../library/machine.SPI.rst:87 +msgid "``polarity`` can be 0 or 1, and is the level the idle clock line sits at." +msgstr "``polarity`` 可以是 0 或 1,表示空闲时钟线的电平。" + +#: ../../library/machine.SPI.rst:88 +msgid "" +"``phase`` can be 0 or 1 to sample data on the first or second clock edge " +"respectively." +msgstr "``phase`` 可以是 0 或 1,在第一个或第二个时钟边沿上采样数据。" + +#: ../../library/machine.SPI.rst:90 +msgid "" +"``bits`` is the width in bits of each transfer. Only 8 is guaranteed to " +"be supported by all hardware." +msgstr "``bits`` 是每次传输的位宽。所有硬件都保证支持8位。" + +#: ../../library/machine.SPI.rst:91 +msgid "``firstbit`` can be ``SPI.MSB`` or ``SPI.LSB``." +msgstr "``firstbit`` 可以是 ``SPI.MSB`` 或 ``SPI.LSB``。" + +#: ../../library/machine.SPI.rst:92 +msgid "" +"``sck``, ``mosi``, ``miso`` are pins (machine.Pin) objects to use for bus" +" signals. For most hardware SPI blocks (as selected by ``id`` parameter " +"to the constructor), pins are fixed and cannot be changed. In some cases," +" hardware blocks allow 2-3 alternative pin sets for a hardware SPI block." +" Arbitrary pin assignments are possible only for a bitbanging SPI driver " +"(``id`` = -1)." +msgstr "" +"``sck``、``mosi``、``miso`` 是用于总线信号的引脚(machine." +"Pin)对象。对于大多数硬件SPI块(由构造函数的 ``id`` 参数选择),引脚是固定的" +",不能更改。在某些情况下,硬件块允许为硬件SPI块选择2-3种备选引脚集。任意引脚" +"分配仅对位摆动SPI驱动程序(``id`` = -1)可能。" + +#: ../../library/machine.SPI.rst:97 +msgid "" +"``pins`` - WiPy port doesn't ``sck``, ``mosi``, ``miso`` arguments, and " +"instead allows to specify them as a tuple of ``pins`` parameter." +msgstr "" +"``pins`` - WiPy移植版本不使用 ``sck``、``mosi``、``miso`` 参数," +"而是允许将它们作为 ``pins`` 参数的元组指定。" + +#: ../../library/machine.SPI.rst:100 +msgid "" +"In the case of hardware SPI the actual clock frequency may be lower than " +"the requested baudrate. This is dependent on the platform hardware. The " +"actual rate may be determined by printing the SPI object." +msgstr "在硬件SPI的情况下,实际的时钟频率可能低于请求的波特率。这取决于平台硬件。实际" +"速率可以通过打印SPI对象来确定。" + +#: ../../library/machine.SPI.rst:106 +msgid "Turn off the SPI bus." +msgstr "关闭SPI总线。" + +#: ../../library/machine.SPI.rst:110 +msgid "" +"Read a number of bytes specified by ``nbytes`` while continuously writing" +" the single byte given by ``write``. Returns a ``bytes`` object with the " +"data that was read." +msgstr "" +"读取由 ``nbytes`` 指定的字节数,同时连续写入由 ``write`` 给出的单个字节。" +"返回一个包含读取数据的 ``bytes`` 对象。" + +#: ../../library/machine.SPI.rst:116 +msgid "" +"Read into the buffer specified by ``buf`` while continuously writing the " +"single byte given by ``write``. Returns ``None``." +msgstr "读取到由 ``buf`` 指定的缓冲区,同时连续写入由 ``write`` 给出的单个字节。返回 " +"``None``。" + +#: ../../library/machine.SPI.rst:122 +msgid "Write the bytes contained in ``buf``. Returns ``None``." +msgstr "写入 ``buf`` 中包含的字节。返回 ``None``。" + +#: ../../library/machine.SPI.rst:127 +msgid "" +"Write the bytes from ``write_buf`` while reading into ``read_buf``. The " +"buffers can be the same or different, but both buffers must have the same" +" length. Returns ``None``." +msgstr "" +"从 ``write_buf`` 写入字节,同时读取到 " +"``read_buf``。缓冲区可以相同或不同,但两个缓冲区必须具有相同的长度。返回 " +"``None``。" + +#: ../../library/machine.SPI.rst:133 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.SPI.rst:137 +msgid "for initialising the SPI bus to controller; this is only used for the WiPy" +msgstr "用于初始化到控制器的SPI总线;这仅用于WiPy" + +#: ../../library/machine.SPI.rst:142 +msgid "set the first bit to be the most significant bit" +msgstr "将第一个比特设置为最高有效位" + +#: ../../library/machine.SPI.rst:147 +msgid "set the first bit to be the least significant bit" +msgstr "将第一个比特设置为最低有效位" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.Signal.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Signal.po new file mode 100644 index 0000000000000..869223634d152 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Signal.po @@ -0,0 +1,196 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.Signal.rst:5 +msgid "class Signal -- control and sense external I/O devices" +msgstr "class Signal -- 控制和感知外部I/O设备" + +#: ../../library/machine.Signal.rst:7 +msgid "" +"The Signal class is a simple extension of the `Pin` class. Unlike Pin, " +"which can be only in \"absolute\" 0 and 1 states, a Signal can be in " +"\"asserted\" (on) or \"deasserted\" (off) states, while being inverted " +"(active-low) or not. In other words, it adds logical inversion support to" +" Pin functionality. While this may seem a simple addition, it is exactly " +"what is needed to support wide array of simple digital devices in a way " +"portable across different boards, which is one of the major MicroPython " +"goals. Regardless of whether different users have an active-high or " +"active-low LED, a normally open or normally closed relay - you can " +"develop a single, nicely looking application which works with each of " +"them, and capture hardware configuration differences in few lines in the " +"config file of your app." +msgstr "" +"Signal类是 `Pin` 类的一个简单扩展。与Pin只能处于“绝对”的0和1状态不同,Signal" +"可以处于“有效”(开)或“无效”(关)状态,同时可以是反向(低电平有效)或非反向" +"的。换句话说,它为Pin功能增加了逻辑反转支持。虽然这看起来是一个简单的添加,但" +"它正是支持各种简单数字设备以跨不同板卡可移植的方式所需的,这是MicroPython的主" +"要目标之一。无论不同的用户拥有高电平有效的LED还是低电平有效的LED," +"常开或常闭的继电器 - 你都可以开发一个单一的、外观良好的应用程序,它可以与它们" +"中的每一个一起工作,并且可以在应用程序的配置文件中用几行代码捕获硬件配置差异" +"。" + +#: ../../library/machine.Signal.rst:19 +msgid "Example::" +msgstr "例子::" + +#: ../../library/machine.Signal.rst:46 +msgid "Following is the guide when Signal vs Pin should be used:" +msgstr "以下是应该使用Singal还是Pin的指导:" + +#: ../../library/machine.Signal.rst:48 +msgid "" +"Use Signal: If you want to control a simple on/off (including software " +"PWM!) devices like LEDs, multi-segment indicators, relays, buzzers, or " +"read simple binary sensors, like normally open or normally closed " +"buttons, pulled high or low, Reed switches, moisture/flame detectors, " +"etc. etc. Summing up, if you have a real physical device/sensor requiring" +" GPIO access, you likely should use a Signal." +msgstr "" +"使用Signal:如果你想控制简单的开/关(包括软件PWM!)设备,如LEDs、多段显示器" +"、继电器、蜂鸣器,或读取简单的二进制传感器,如常开或常闭按钮、高电平或低电平" +"拉高、簧片开关、湿度/火焰探测器等等。总之,如果你有一个需要GPIO访问的真实物理" +"设备/传感器,你很可能应该使用Signal。" + +#: ../../library/machine.Signal.rst:55 +msgid "" +"Use Pin: If you implement a higher-level protocol or bus to communicate " +"with more complex devices." +msgstr "使用Pin:如果你实现了一个高级协议或总线来与更复杂的设备通信。" + +#: ../../library/machine.Signal.rst:58 +msgid "" +"The split between Pin and Signal come from the use cases above and the " +"architecture of MicroPython: Pin offers the lowest overhead, which may be" +" important when bit-banging protocols. But Signal adds additional " +"flexibility on top of Pin, at the cost of minor overhead (much smaller " +"than if you implemented active-high vs active-low device differences in " +"Python manually!). Also, Pin is a low-level object which needs to be " +"implemented for each support board, while Signal is a high-level object " +"which comes for free once Pin is implemented." +msgstr "" +"Pin和Signal之间的分裂来自于上述用例和MicroPython的架构:Pin提供了最低的开销," +"这在位摆动协议时可能很重要。但Signal在Pin的基础上增加了额外的灵活性,代价是微" +"小的开销(比如果你手动用Python实现高电平有效与低电平有效设备差异要小得多!)" +"。此外,Pin是一个低级对象,需要为每个支持的板卡实现,而Signal是一个高级对象," +"一旦Pin实现了,就免费获得。" + +#: ../../library/machine.Signal.rst:67 +msgid "" +"If in doubt, give the Signal a try! Once again, it is offered to save " +"developers from the need to handle unexciting differences like active-low" +" vs active-high signals, and allow other users to share and enjoy your " +"application, instead of being frustrated by the fact that it doesn't work" +" for them simply because their LEDs or relays are wired in a slightly " +"different way." +msgstr "" +"如果有疑问,试试Signal吧!再次强调,它是为了节省开发者处理如高电平有效与低电" +"平有效信号等不令人兴奋的差异的需要,并允许其他用户分享和享受你的应用程序,而" +"不是因为它们的LED或继电器的接线方式略有不同而感到沮丧。" + +#: ../../library/machine.Signal.rst:75 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.Signal.rst:80 +msgid "Create a Signal object. There're two ways to create it:" +msgstr "创建一个Singal对象。有两种创建方式:" + +#: ../../library/machine.Signal.rst:82 +msgid "" +"By wrapping existing Pin object - universal method which works for any " +"board." +msgstr "通过包装现有的Pin对象 - 适用于任何卡板的通用方法。" + +#: ../../library/machine.Signal.rst:84 +msgid "" +"By passing required Pin parameters directly to Signal constructor, " +"skipping the need to create intermediate Pin object. Available on many, " +"but not all boards." +msgstr "直接将所需的Pin参数传递给Signal构造器,跳过创建中间Pin对象的需要。在许多但不" +"是所有的板卡上可用。" + +#: ../../library/machine.Signal.rst:88 +msgid "The arguments are:" +msgstr "参数包括:" + +#: ../../library/machine.Signal.rst:90 +msgid "``pin_obj`` is existing Pin object." +msgstr "``pin_obj`` 是现有的Pin对象。" + +#: ../../library/machine.Signal.rst:92 +msgid "" +"``pin_arguments`` are the same arguments as can be passed to Pin " +"constructor." +msgstr "``pin_arguments`` 是可以传递给Pin构造函数的相同参数。" + +#: ../../library/machine.Signal.rst:94 +msgid "``invert`` - if True, the signal will be inverted (active low)." +msgstr "``invert`` - 如果为True,信号将被反转(低电平有效)。" + +#: ../../library/machine.Signal.rst:97 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.Signal.rst:101 +msgid "" +"This method allows to set and get the value of the signal, depending on " +"whether the argument ``x`` is supplied or not." +msgstr "此方法允许根据是否提供参数 ``x`` 来设置和获取信号的值。" + +#: ../../library/machine.Signal.rst:104 +msgid "" +"If the argument is omitted then this method gets the signal level, 1 " +"meaning signal is asserted (active) and 0 - signal inactive." +msgstr "如果省略参数,则此方法获取信号电平,1表示信号断言(活动)且0 - 信号非活动。" + +#: ../../library/machine.Signal.rst:107 +msgid "" +"If the argument is supplied then this method sets the signal level. The " +"argument ``x`` can be anything that converts to a boolean. If it converts" +" to ``True``, the signal is active, otherwise it is inactive." +msgstr "" +"如果提供了参数,则此方法设置信号电平。参数 ``x`` " +"可以是任何可以转换为布尔值的东西。如果它转换为 " +"``True``,则信号活动,否则它是非活动的。" + +#: ../../library/machine.Signal.rst:111 +msgid "" +"Correspondence between signal being active and actual logic level on the " +"underlying pin depends on whether signal is inverted (active-low) or not." +" For non-inverted signal, active status corresponds to logical 1, " +"inactive - to logical 0. For inverted/active-low signal, active status " +"corresponds to logical 0, while inactive - to logical 1." +msgstr "" +"信号活动与底层引脚上的实际逻辑电平之间的对应关系取决于信号是否被反转(低电平" +"有效)或不反转。对于非反转信号,活动状态对应于逻辑1,非活动状态 - " +"对应于逻辑0。对于反转/低电平有效信号,活动状态对应于逻辑0,而非活动状态 - " +"对应于逻辑1。" + +#: ../../library/machine.Signal.rst:119 +msgid "Activate signal." +msgstr "激活信号。" + +#: ../../library/machine.Signal.rst:123 +msgid "Deactivate signal." +msgstr "关闭信号。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.Timer.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Timer.po new file mode 100644 index 0000000000000..5b2b324f50bdf --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.Timer.po @@ -0,0 +1,146 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.Timer.rst:5 +msgid "class Timer -- control hardware timers" +msgstr "class Timer -- 控制硬件定时器" + +#: ../../library/machine.Timer.rst:7 +msgid "" +"Hardware timers deal with timing of periods and events. Timers are " +"perhaps the most flexible and heterogeneous kind of hardware in MCUs and " +"SoCs, differently greatly from a model to a model. MicroPython's Timer " +"class defines a baseline operation of executing a callback with a given " +"period (or once after some delay), and allow specific boards to define " +"more non-standard behaviour (which thus won't be portable to other " +"boards)." +msgstr "" +"硬件定时器处理周期和事件的计时。定时器或许是MCU和SoC中最灵活和最不同的硬件类" +"型,从一个型号到另一个型号差异很大。MicroPython的Timer类定义了一个基线操作," +"即以给定周期执行回调(或在某个延迟后执行一次),并允许特定板卡定义更多非标准" +"行为(因此这些行为不会在其他板卡上可移植)。" + +#: ../../library/machine.Timer.rst:14 +msgid "" +"See discussion of :ref:`important constraints ` on " +"Timer callbacks." +msgstr "关于Timer回调的讨论,请参见 :ref:`important constraints `。" + +#: ../../library/machine.Timer.rst:19 +msgid "" +"Memory can't be allocated inside irq handlers (an interrupt) and so " +"exceptions raised within a handler don't give much information. See " +":func:`micropython.alloc_emergency_exception_buf` for how to get around " +"this limitation." +msgstr "" +"内存不能在irq处理程序(中断)中分配,因此在处理程序内部引发的异常不会提供太多信" +"息。请参见 :func:`micropython.alloc_emergency_exception_buf` " +"了解如何克服这个限制。" + +#: ../../library/machine.Timer.rst:25 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.Timer.rst:29 +msgid "" +"Construct a new timer object of the given ``id``. ``id`` of -1 constructs" +" a virtual timer (if supported by a board). ``id`` shall not be passed as" +" a keyword argument." +msgstr "" +"根据给定的 ``id`` 构造一个新的定时器对象。``id`` " +"为-1构造一个虚拟定时器(如果板卡支持的话)。``id`` 不应作为关键字参数传递。" + +#: ../../library/machine.Timer.rst:33 +msgid "See ``init`` for parameters of initialisation." +msgstr "查看 ``init`` 了解初始化的参数。" + +#: ../../library/machine.Timer.rst:36 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.Timer.rst:40 +msgid "Initialise the timer. Example::" +msgstr "初始化定时器。示例::" + +#: ../../library/machine.Timer.rst:54 +msgid "Keyword arguments:" +msgstr "关键字参数:" + +#: ../../library/machine.Timer.rst:56 +msgid "``mode`` can be one of:" +msgstr "``mode`` 可以是以下之一:" + +#: ../../library/machine.Timer.rst:58 +msgid "" +"``Timer.ONE_SHOT`` - The timer runs once until the configured period of " +"the channel expires." +msgstr "``Timer.ONE_SHOT`` - 定时器运行一次,直到配置的通道周期到期。" + +#: ../../library/machine.Timer.rst:60 +msgid "" +"``Timer.PERIODIC`` - The timer runs periodically at the configured " +"frequency of the channel." +msgstr "``Timer.PERIODIC`` - 定时器周期性地以通道配置的频率运行。" + +#: ../../library/machine.Timer.rst:63 +msgid "" +"``freq`` - The timer frequency, in units of Hz. The upper bound of the " +"frequency is dependent on the port. When both the ``freq`` and " +"``period`` arguments are given, ``freq`` has a higher priority and " +"``period`` is ignored." +msgstr "" +"``freq`` - 定时器频率,单位为Hz。频率的上限取决于移植版本。当同时给出 " +"``freq`` 和 ``period`` 参数时,``freq`` 具有更高的优先级,``period`` " +"将被忽略。" + +#: ../../library/machine.Timer.rst:68 +msgid "``period`` - The timer period, in milliseconds." +msgstr "``period`` - 定时器周期,以毫秒为单位。" + +#: ../../library/machine.Timer.rst:70 +msgid "" +"``callback`` - The callable to call upon expiration of the timer period. " +"The callback must take one argument, which is passed the Timer object. " +"The ``callback`` argument shall be specified. Otherwise an exception will" +" occur upon timer expiration: ``TypeError: 'NoneType' object isn't " +"callable``" +msgstr "" +"``callback`` - " +"定时器周期到期时调用的可调用对象。回调必须接受一个参数,该参数传递Timer对象。" +"必须指定 ``callback`` 参数。否则,定时器到期时将发生异常:``TypeError: " +"'NoneType' object isn't callable``" + +#: ../../library/machine.Timer.rst:78 +msgid "" +"Deinitialises the timer. Stops the timer, and disables the timer " +"peripheral." +msgstr "取消初始化定时器。停止定时器,并禁用定时器外设。" + +#: ../../library/machine.Timer.rst:81 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.Timer.rst:86 +msgid "Timer operating mode." +msgstr "定时器操作模式。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.UART.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.UART.po new file mode 100644 index 0000000000000..bc5a44d961bfa --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.UART.po @@ -0,0 +1,486 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.UART.rst:5 +msgid "class UART -- duplex serial communication bus" +msgstr "class UART -- 双工串行通信总线" + +#: ../../library/machine.UART.rst:7 +msgid "" +"UART implements the standard UART/USART duplex serial communications " +"protocol. At the physical level it consists of 2 lines: RX and TX. The " +"unit of communication is a character (not to be confused with a string " +"character) which can be 8 or 9 bits wide." +msgstr "" +"UART 实现了标准的 UART/USART 双工串行通信协议。在物理层面上,它由 2 条线组成:RX 和 " +"TX。通信的单位是一个字符(不要与字符串字符混淆),可以是 8 位或 9 位宽。" + +#: ../../library/machine.UART.rst:12 +msgid "UART objects can be created and initialised using::" +msgstr "可以使用以下方式创建和初始化 UART 对象::" + +#: ../../library/machine.UART.rst:19 +msgid "" +"Bits can be 7, 8 or 9. Stop can be 1 or 2. With *parity=None*, only 8 and" +" 9 bits are supported. With parity enabled, only 7 and 8 bits are " +"supported." +msgstr "" +"Bits 可以是 7、8 或 9。Stop 可以是 1 或 2。当 *parity=None* 时,只支持 8 和 9 位。启用奇偶校验时,只支持" +" 7 和 8 位。" + +#: ../../library/machine.UART.rst:23 +msgid "" +"A UART object acts like a :std:term:`stream` object and reading and " +"writing is done using the standard stream methods::" +msgstr "UART 对象的行为类似于 :std:term:`stream` 对象,使用标准的流方法进行读写::" + +#: ../../library/machine.UART.rst:33 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.UART.rst:37 +msgid "Construct a UART object of the given id." +msgstr "构造给定 id 的 UART 对象。" + +#: ../../library/machine.UART.rst:40 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.UART.rst:44 +msgid "Initialise the UART bus with the given parameters:" +msgstr "使用给定的参数初始化 UART 总线:" + +#: ../../library/machine.UART.rst:46 +msgid "*baudrate* is the clock rate." +msgstr "*baudrate* 是时钟频率。" + +#: ../../library/machine.UART.rst:47 +msgid "*bits* is the number of bits per character, 7, 8 or 9." +msgstr "*bits* 是每个字符的位数,7、8 或 9。" + +#: ../../library/machine.UART.rst:48 +msgid "*parity* is the parity, ``None``, 0 (even) or 1 (odd)." +msgstr "*parity* 是奇偶校验,``None``、0(偶数)或 1(奇数)。" + +#: ../../library/machine.UART.rst:49 +msgid "*stop* is the number of stop bits, 1 or 2." +msgstr "*stop* 是停止位的数量,1 或 2。" + +#: ../../library/machine.UART.rst:51 +msgid "Additional keyword-only parameters that may be supported by a port are:" +msgstr "可能由移植版本支持的额外关键字参数有:" + +#: ../../library/machine.UART.rst:53 +msgid "*tx* specifies the TX pin to use." +msgstr "*tx* 指定要使用的 TX 引脚。" + +#: ../../library/machine.UART.rst:54 +msgid "*rx* specifies the RX pin to use." +msgstr "*rx* 指定要使用的 RX 引脚。" + +#: ../../library/machine.UART.rst:55 +msgid "" +"*rts* specifies the RTS (output) pin to use for hardware receive flow " +"control." +msgstr "*rts* 指定用于硬件接收流控制的 RTS(输出)引脚。" + +#: ../../library/machine.UART.rst:56 +msgid "" +"*cts* specifies the CTS (input) pin to use for hardware transmit flow " +"control." +msgstr "*cts* 指定用于硬件发送流控制的 CTS(输入)引脚。" + +#: ../../library/machine.UART.rst:57 +msgid "*txbuf* specifies the length in characters of the TX buffer." +msgstr "*txbuf* 指定 TX 缓冲区的字符长度。" + +#: ../../library/machine.UART.rst:58 +msgid "*rxbuf* specifies the length in characters of the RX buffer." +msgstr "*rxbuf* 指定 RX 缓冲区的字符长度。" + +#: ../../library/machine.UART.rst:59 +msgid "*timeout* specifies the time to wait for the first character (in ms)." +msgstr "*timeout* 指定等待第一个字符的时间(毫秒)。" + +#: ../../library/machine.UART.rst:60 +msgid "*timeout_char* specifies the time to wait between characters (in ms)." +msgstr "*timeout_char* 指定字符之间等待的时间(毫秒)。" + +#: ../../library/machine.UART.rst:61 +msgid "*invert* specifies which lines to invert." +msgstr "*invert* 指定要反转的线路。" + +#: ../../library/machine.UART.rst:63 +msgid "``0`` will not invert lines (idle state of both lines is logic high)." +msgstr "``0`` 不反转线路(两条线的空闲状态为逻辑高)。" + +#: ../../library/machine.UART.rst:64 +msgid "``UART.INV_TX`` will invert TX line (idle state of TX line now logic low)." +msgstr "``UART.INV_TX`` 将反转 TX 线(TX 线的空闲状态现在为逻辑低)。" + +#: ../../library/machine.UART.rst:65 +msgid "``UART.INV_RX`` will invert RX line (idle state of RX line now logic low)." +msgstr "``UART.INV_RX`` 将反转 RX 线(RX 线的空闲状态现在为逻辑低)。" + +#: ../../library/machine.UART.rst:66 +msgid "" +"``UART.INV_TX | UART.INV_RX`` will invert both lines (idle state at logic" +" low)." +msgstr "``UART.INV_TX | UART.INV_RX`` 将反转两条线(空闲状态为逻辑低)。" + +#: ../../library/machine.UART.rst:68 +msgid "" +"*flow* specifies which hardware flow control signals to use. The value is" +" a bitmask." +msgstr "*flow* 指定要使用哪些硬件流控制信号。该值是一个位掩码。" + +#: ../../library/machine.UART.rst:71 +msgid "``0`` will ignore hardware flow control signals." +msgstr "``0`` 将忽略硬件流控制信号。" + +#: ../../library/machine.UART.rst:72 +msgid "" +"``UART.RTS`` will enable receive flow control by using the RTS output pin" +" to signal if the receive FIFO has sufficient space to accept more data." +msgstr "``UART.RTS`` 将通过使用 RTS 输出引脚来启用接收流控制,以信号接收 FIFO 是否有足够的空间接受更多数据。" + +#: ../../library/machine.UART.rst:74 +msgid "" +"``UART.CTS`` will enable transmit flow control by pausing transmission " +"when the CTS input pin signals that the receiver is running low on buffer" +" space." +msgstr "``UART.CTS`` 将通过在 CTS 输入引脚信号接收器缓冲区空间不足时暂停传输来启用发送流控制。" + +#: ../../library/machine.UART.rst:76 +msgid "``UART.RTS | UART.CTS`` will enable both, for full hardware flow control." +msgstr "``UART.RTS | UART.CTS`` 将启用两者,实现全硬件流控制。" + +#: ../../library/machine.UART.rst:79 +msgid "" +"It is possible to call ``init()`` multiple times on the same object in " +"order to reconfigure UART on the fly. That allows using single UART " +"peripheral to serve different devices attached to different GPIO pins. " +"Only one device can be served at a time in that case. Also do not call " +"``deinit()`` as it will prevent calling ``init()`` again." +msgstr "" +"可以在同一个对象上多次调用 ``init()`` 以实现在运行时重新配置 UART。这允许使用单个 UART 外设为连接到不同 GPIO " +"引脚的不同设备提供服务。在这种情况下一次只能服务一个设备。也不要调用 ``deinit()``,因为这将阻止再次调用 ``init()``。" + +#: ../../library/machine.UART.rst:88 +msgid "Turn off the UART bus." +msgstr "关闭 UART 总线。" + +#: ../../library/machine.UART.rst:91 +msgid "" +"You will not be able to call ``init()`` on the object after ``deinit()``." +" A new instance needs to be created in that case." +msgstr "在 ``deinit()`` 之后,你将无法在该对象上调用 ``init()``。在这种情况下,需要创建一个新实例。" + +#: ../../library/machine.UART.rst:96 +msgid "" +"Returns an integer counting the number of characters that can be read " +"without blocking. It will return 0 if there are no characters available " +"and a positive number if there are characters. The method may return 1 " +"even if there is more than one character available for reading." +msgstr "" +"返回一个整数,计算可以在不阻塞的情况下读取的字符数。如果没有可用的字符,它将返回 " +"0;如果有字符,将返回一个正数。即使有多个字符可供阅读,该方法也可能返回 1。" + +#: ../../library/machine.UART.rst:101 +msgid "For more sophisticated querying of available characters use select.poll::" +msgstr "对于更复杂的可用字符查询,请使用 select.poll:" + +#: ../../library/machine.UART.rst:109 +msgid "" +"Read characters. If ``nbytes`` is specified then read at most that many " +"bytes, otherwise read as much data as possible." +msgstr "读取字符。如果指定了 ``nbytes``,则最多读取那么多字节,否则尽可能多地读取数据。" + +#: ../../library/machine.UART.rst:112 +msgid "" +"Return value: a bytes object containing the bytes read in. Returns " +"``None`` on timeout." +msgstr "返回值:包含读取的字节的 bytes 对象。超时时返回 ``None``。" + +#: ../../library/machine.UART.rst:117 +msgid "" +"Read bytes into the ``buf``. If ``nbytes`` is specified then read at " +"most that many bytes. Otherwise, read at most ``len(buf)`` bytes." +msgstr "将字节读入 ``buf``。如果指定了 ``nbytes``,则最多读取该数量的字节。否则,最多读取 ``len(buf)`` 字节。" + +#: ../../library/machine.UART.rst:120 +msgid "" +"Return value: number of bytes read and stored into ``buf`` or ``None`` on" +" timeout." +msgstr "返回值:读取并存储到 ``buf`` 中的字节数,或超时时返回 ``None``。" + +#: ../../library/machine.UART.rst:125 +msgid "Read a line, ending in a newline character." +msgstr "读取一行,以换行字符结束。" + +#: ../../library/machine.UART.rst:127 +msgid "Return value: the line read or ``None`` on timeout." +msgstr "返回值:读取的行,或在超时时为 ``None``。" + +#: ../../library/machine.UART.rst:131 +msgid "Write the buffer of bytes to the bus." +msgstr "将字节缓冲区写入总线。" + +#: ../../library/machine.UART.rst:133 +msgid "Return value: number of bytes written or ``None`` on timeout." +msgstr "返回值:写入的字节数,或在超时时为 ``None``。" + +#: ../../library/machine.UART.rst:137 +msgid "" +"Send a break condition on the bus. This drives the bus low for a duration" +" longer than required for a normal transmission of a character." +msgstr "在总线上发送一个中断条件。这使得总线低电平的持续时间比字符的正常传输所需的时间长。" + +#: ../../library/machine.UART.rst:142 +msgid "" +"Waits until all data has been sent. In case of a timeout, an exception is" +" raised. The timeout duration depends on the tx buffer size and the baud " +"rate. Unless flow control is enabled, a timeout should not occur." +msgstr "等待直到所有数据都已发送。如果发生超时,将引发异常。超时持续时间取决于 tx 缓冲区大小和波特率。除非启用了流控制,否则不应发生超时。" + +#: ../../library/machine.UART.rst:148 +msgid "" +"For the esp8266 and nrf ports the call returns while the last byte is " +"sent. If required, a one character wait time has to be added in the " +"calling script." +msgstr "对于 esp8266 和 nrf 移植版本,调用在最后一个字节发送时返回。如果需要,在调用脚本中必须添加一个字符的等待时间。" + +#: ../../library/machine.UART.rst:151 +msgid "" +"Availability: rp2, esp32, esp8266, mimxrt, cc3200, stm32, nrf ports, " +"renesas-ra" +msgstr "可用性:rp2、esp32、esp8266、mimxrt、cc3200、stm32、nrf 移植版本、renesas-ra" + +#: ../../library/machine.UART.rst:155 +msgid "" +"Tells whether all data has been sent or no data transfer is happening. In" +" this case, it returns ``True``. If a data transmission is ongoing it " +"returns ``False``." +msgstr "告诉是否所有数据已发送或没有数据传输正在进行。在这种情况下,它返回 ``True``。如果数据传输正在进行中,它返回 ``False``。" + +#: ../../library/machine.UART.rst:160 +msgid "" +"For the esp8266 and nrf ports the call may return ``True`` even if the " +"last byte of a transfer is still being sent. If required, a one character" +" wait time has to be added in the calling script." +msgstr "" +"对于 esp8266 和 nrf 移植版本,即使传输的最后一个字节仍在发送,调用也可能返回 " +"``True``。如果需要,在调用脚本中必须添加一个字符的等待时间。" + +#: ../../library/machine.UART.rst:164 +msgid "" +"Availability: rp2, esp32, esp8266, mimxrt, cc3200, stm32, nrf ports, " +"renesas-ra, alif" +msgstr "可用性:rp2、esp32、esp8266、mimxrt、cc3200、stm32、nrf 移植版本、renesas-ra、alif" + +#: ../../library/machine.UART.rst:168 +msgid "Configure an interrupt handler to be called when a UART event occurs." +msgstr "配置 UART 事件发生时调用的中断处理程序。" + +#: ../../library/machine.UART.rst:170 +msgid "The arguments are:" +msgstr "参数如下:" + +#: ../../library/machine.UART.rst:172 +msgid "" +"*handler* is an optional function to be called when the interrupt event " +"triggers. The handler must take exactly one argument which is the " +"``UART`` instance." +msgstr "*handler* 是中断事件触发时调用的可选函数。处理程序必须接受恰好一个参数,即 ``UART`` 实例。" + +#: ../../library/machine.UART.rst:176 +msgid "" +"*trigger* configures the event(s) which can generate an interrupt. " +"Possible values are a mask of one or more of the following:" +msgstr "*trigger* 配置可以生成中断的事件。可能的值是以下一个或多个值的掩码:" + +#: ../../library/machine.UART.rst:179 +msgid "" +"``UART.IRQ_RXIDLE`` interrupt after receiving at least one character and " +"then the RX line goes idle." +msgstr "``UART.IRQ_RXIDLE`` 在接收到至少一个字符且 RX 线进入空闲状态后触发中断。" + +#: ../../library/machine.UART.rst:181 +msgid "``UART.IRQ_RX`` interrupt after each received character." +msgstr "``UART.IRQ_RX`` 每接收到一个字符后触发中断。" + +#: ../../library/machine.UART.rst:182 +msgid "" +"``UART.IRQ_TXIDLE`` interrupt after or while the last character(s) of a " +"message are or have been sent." +msgstr "``UART.IRQ_TXIDLE`` 在消息的最后一个(或多个)字符正在发送或已发送后触发中断。" + +#: ../../library/machine.UART.rst:184 +msgid "``UART.IRQ_BREAK`` interrupt when a break state is detected at RX" +msgstr "``UART.IRQ_BREAK`` 在 RX 检测到中断状态时触发中断" + +#: ../../library/machine.UART.rst:186 +msgid "" +"*hard* if true a hardware interrupt is used. This reduces the delay " +"between the pin change and the handler being called. Hard interrupt " +"handlers may not allocate memory; see :ref:`isr_rules`." +msgstr "*hard* 如果为 true,则使用硬件中断。这减少了引脚变化与处理程序被调用之间的延迟。硬中断处理程序不能分配内存;参见 :ref:`isr_rules`。" + +#: ../../library/machine.UART.rst:190 +msgid "Returns an irq object." +msgstr "返回一个 irq 对象。" + +#: ../../library/machine.UART.rst:192 +msgid "" +"Due to limitations of the hardware not all trigger events are available " +"on all ports." +msgstr "由于硬件的限制,并非所有触发事件在所有移植版本上都可用。" + +#: ../../library/machine.UART.rst:194 +msgid "Availability of triggers" +msgstr "触发器可用性" + +#: ../../library/machine.UART.rst:198 +msgid "Port / Trigger" +msgstr "移植版本 / 触发器" + +#: ../../library/machine.UART.rst:198 +msgid "IRQ_RXIDLE" +msgstr "IRQ_RXIDLE" + +#: ../../library/machine.UART.rst:198 +msgid "IRQ_RX" +msgstr "IRQ_RX" + +#: ../../library/machine.UART.rst:198 +msgid "IRQ_TXIDLE" +msgstr "IRQ_TXIDLE" + +#: ../../library/machine.UART.rst:198 +msgid "IRQ_BREAK" +msgstr "IRQ_BREAK" + +#: ../../library/machine.UART.rst:200 +msgid "CC3200" +msgstr "CC3200" + +#: ../../library/machine.UART.rst:200 ../../library/machine.UART.rst:201 +#: ../../library/machine.UART.rst:202 ../../library/machine.UART.rst:203 +#: ../../library/machine.UART.rst:204 ../../library/machine.UART.rst:205 +#: ../../library/machine.UART.rst:206 ../../library/machine.UART.rst:207 +#: ../../library/machine.UART.rst:208 +msgid "yes" +msgstr "yes" + +#: ../../library/machine.UART.rst:201 +msgid "ESP32" +msgstr "ESP32" + +#: ../../library/machine.UART.rst:202 +msgid "MIMXRT" +msgstr "MIMXRT" + +#: ../../library/machine.UART.rst:203 +msgid "NRF" +msgstr "NRF" + +#: ../../library/machine.UART.rst:204 +msgid "RENESAS-RA" +msgstr "RENESAS-RA" + +#: ../../library/machine.UART.rst:205 +msgid "RP2" +msgstr "RP2" + +#: ../../library/machine.UART.rst:206 +msgid "SAMD" +msgstr "SAMD" + +#: ../../library/machine.UART.rst:207 +msgid "STM32" +msgstr "STM32" + +#: ../../library/machine.UART.rst:208 +msgid "alif" +msgstr "alif" + +#: ../../library/machine.UART.rst:213 +msgid "" +"The ESP32 port does not support the option hard=True. It uses Timer(0) " +"for UART.IRQ_RXIDLE, so this timer cannot be used for other means." +msgstr "ESP32 移植版本不支持 hard=True 选项。它使用 Timer(0) 来实现 UART.IRQ_RXIDLE,因此该定时器不能用于其他用途。" + +#: ../../library/machine.UART.rst:216 +msgid "" +"The rp2 port's UART.IRQ_TXIDLE is only triggered when the message is " +"longer than 5 characters and the trigger happens when still 5 characters " +"are to be sent." +msgstr "rp2 移植版本的 UART.IRQ_TXIDLE 仅在消息长度超过 5 个字符时触发,且触发时仍有 5 个字符待发送。" + +#: ../../library/machine.UART.rst:220 +msgid "" +"The rp2 port's UART.IRQ_BREAK needs receiving valid characters for " +"triggering again." +msgstr "rp2 移植版本的 UART.IRQ_BREAK 需要接收有效字符才能再次触发。" + +#: ../../library/machine.UART.rst:223 +msgid "" +"The SAMD port's UART.IRQ_TXIDLE is triggered while the last character is " +"sent." +msgstr "SAMD 移植版本的 UART.IRQ_TXIDLE 在最后一个字符发送时触发。" + +#: ../../library/machine.UART.rst:225 +msgid "" +"On STM32F4xx MCU's, using the trigger UART.IRQ_RXIDLE the handler will be" +" called once after the first character and then after the end of the " +"message, when the line is idle." +msgstr "在 STM32F4xx MCU 上,使用 UART.IRQ_RXIDLE 触发器时,处理程序将在第一个字符之后调用一次,然后在消息结束、线路空闲时再次调用。" + +#: ../../library/machine.UART.rst:230 +msgid "" +"Availability: cc3200, esp32, mimxrt, nrf, renesas-ra, rp2, samd, stm32, " +"alif." +msgstr "可用性:cc3200、esp32、mimxrt、nrf、renesas-ra、rp2、samd、stm32、alif。" + +#: ../../library/machine.UART.rst:233 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.UART.rst:238 +msgid "Flow control options." +msgstr "流控制选项。" + +#: ../../library/machine.UART.rst:240 +msgid "Availability: esp32, mimxrt, renesas-ra, rp2, stm32, alif." +msgstr "可用性:esp32、mimxrt、renesas-ra、rp2、stm32、alif。" + +#: ../../library/machine.UART.rst:247 +msgid "IRQ trigger sources." +msgstr "IRQ 触发源。" + +#: ../../library/machine.UART.rst:249 +msgid "" +"Availability: renesas-ra, stm32, esp32, rp2040, mimxrt, samd, cc3200, " +"alif." +msgstr "可用性:renesas-ra、stm32、esp32、rp2040、mimxrt、samd、cc3200、alif。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.WDT.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.WDT.po new file mode 100644 index 0000000000000..e987b34e52d6c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.WDT.po @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/machine.WDT.rst:5 +msgid "class WDT -- watchdog timer" +msgstr "class WDT -- 看门狗定时器" + +#: ../../library/machine.WDT.rst:7 +msgid "" +"The WDT is used to restart the system when the application crashes and " +"ends up into a non recoverable state. Once started it cannot be stopped " +"or reconfigured in any way. After enabling, the application must \"feed\"" +" the watchdog periodically to prevent it from expiring and resetting the " +"system." +msgstr "" +"WDT 用于在应用程序崩溃并进入无法恢复的状态时重启系统。一旦启动,它就不能被停" +"止或以任何方式重新配置。启用后,应用程序必须定期“喂养”看门狗,以防止它到期并" +"重置系统。" + +#: ../../library/machine.WDT.rst:12 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/machine.WDT.rst:19 +msgid "Constructors" +msgstr "构造" + +#: ../../library/machine.WDT.rst:23 +msgid "" +"Create a WDT object and start it. The timeout must be given in " +"milliseconds. Once it is running the timeout cannot be changed and the " +"WDT cannot be stopped either." +msgstr "创建一个WDT对象并启动它。超时必须以毫秒为单位给出。一旦它运行,超时就不能更改" +",WDT也不能停止。" + +#: ../../library/machine.WDT.rst:26 +msgid "" +"Notes: On the esp8266 a timeout cannot be specified, it is determined by " +"the underlying system. On rp2040 devices, the maximum timeout is 8388 ms." +msgstr "注意:在 esp8266 上不能指定超时,它由底层系统决定。在 rp2040 设备上," +"最大超时为 8388 毫秒。" + +#: ../../library/machine.WDT.rst:30 +msgid "Methods" +msgstr "方法" + +#: ../../library/machine.WDT.rst:34 +msgid "" +"Feed the WDT to prevent it from resetting the system. The application " +"should place this call in a sensible place ensuring that the WDT is only " +"fed after verifying that everything is functioning correctly." +msgstr "喂养WDT以防止它重置系统。应用程序应该将此调用放在一个合理的位置,确保只有在验" +"证一切正常运行后才喂养WDT。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/machine.po b/docs/locale/zh_CN/LC_MESSAGES/library/machine.po new file mode 100644 index 0000000000000..af38915ddd149 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/machine.po @@ -0,0 +1,340 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/machine.rst:2 +msgid ":mod:`machine` --- functions related to the hardware" +msgstr ":mod:`machine` --- 与硬件相关的函数" + +#: ../../library/machine.rst:7 +msgid "" +"The ``machine`` module contains specific functions related to the " +"hardware on a particular board. Most functions in this module allow to " +"achieve direct and unrestricted access to and control of hardware blocks " +"on a system (like CPU, timers, buses, etc.). Used incorrectly, this can " +"lead to malfunction, lockups, crashes of your board, and in extreme " +"cases, hardware damage." +msgstr "" +"``machine`` 模块包含特定于某个板上的与硬件相关的特定函数。该模块中的大多数函数允许直接和无限制地访问和控制系统上的硬件模块(如 " +"CPU、定时器、总线等)。如果使用不当,这可能导致板的故障、死机、崩溃,甚至在极端情况下可能造成硬件损坏。" + +#: ../../library/machine.rst:16 +msgid "" +"A note of callbacks used by functions and class methods of :mod:`machine`" +" module: all these callbacks should be considered as executing in an " +"interrupt context. This is true for both physical devices with IDs >= 0 " +"and \"virtual\" devices with negative IDs like -1 (these \"virtual\" " +"devices are still thin shims on top of real hardware and real hardware " +"interrupts). See :ref:`isr_rules`." +msgstr "" +":mod:`machine` 模块的函数和类方法使用的回调注意事项:所有这些回调应被视为在中断上下文中执行。这对于具有 ID >= 0 " +"的物理设备和具有负 ID(如 -1)的“虚拟”设备都是正确的(这些“虚拟”设备仍然是真实硬件和真实硬件中断之上的薄垫片)。参见 " +":ref:`isr_rules`。" + +#: ../../library/machine.rst:23 +msgid "Memory access" +msgstr "内存访问" + +#: ../../library/machine.rst:25 +msgid "The module exposes three objects used for raw memory access." +msgstr "此模块公开了三个用于原始内存访问的对象。" + +#: ../../library/machine.rst:29 +msgid "Read/write 8 bits of memory." +msgstr "读/写内存的8位。" + +#: ../../library/machine.rst:33 +msgid "Read/write 16 bits of memory." +msgstr "读/写内存的16位。" + +#: ../../library/machine.rst:37 +msgid "Read/write 32 bits of memory." +msgstr "读/写内存的32位。" + +#: ../../library/machine.rst:39 +msgid "" +"Use subscript notation ``[...]`` to index these objects with the address " +"of interest. Note that the address is the byte address, regardless of the" +" size of memory being accessed." +msgstr "使用下标符号 ``[...]`` 来使用感兴趣的地址索引这些对象。请注意,无论所访问的内存大小如何,地址都是字节地址。" + +#: ../../library/machine.rst:43 +msgid "Example use (registers are specific to an stm32 microcontroller):" +msgstr "使用示例(寄存器特定于stm32微控制器):" + +#: ../../library/machine.rst:61 +msgid "Reset related functions" +msgstr "与重置相关的函数" + +#: ../../library/machine.rst:65 +msgid "" +":ref:`Hard resets ` the device in a manner similar to pushing" +" the external RESET button." +msgstr "以类似于按外部RESET按钮的方式 :ref:`Hard resets ` 设备。" + +#: ../../library/machine.rst:70 +msgid "" +"Performs a :ref:`soft reset ` of the interpreter, deleting " +"all Python objects and resetting the Python heap." +msgstr "" +"执行解释器的 :ref:`soft reset ` ,删除所有 Python 对象并重置 Python 堆。" + +#: ../../library/machine.rst:75 +msgid "" +"Get the reset cause. See :ref:`constants ` for the " +"possible return values." +msgstr "获取重置原因。参见 :ref:`constants ` 以获取可能的返回值。" + +#: ../../library/machine.rst:79 +msgid "" +"Reset the device and enter its bootloader. This is typically used to put" +" the device into a state where it can be programmed with new firmware." +msgstr "重置设备并进入其引导加载程序。通常用于将设备置于可编程新固件状态。" + +#: ../../library/machine.rst:82 +msgid "" +"Some ports support passing in an optional *value* argument which can " +"control which bootloader to enter, what to pass to it, or other things." +msgstr "一些移植版本支持传入一个可选的 *value* 参数,该参数可以控制要进入的引导加载程序、要传递给它的内容或其他事项。" + +#: ../../library/machine.rst:86 +msgid "Interrupt related functions" +msgstr "与中断相关的函数" + +#: ../../library/machine.rst:88 +msgid "" +"The following functions allow control over interrupts. Some systems " +"require interrupts to operate correctly so disabling them for long " +"periods may compromise core functionality, for example watchdog timers " +"may trigger unexpectedly. Interrupts should only be disabled for a " +"minimum amount of time and then re-enabled to their previous state. For " +"example::" +msgstr "以下函数允许对中断进行控制。一些系统要求中断正常运行,因此长时间禁用它们可能会损害核心功能,例如看门狗定时器可能会意外触发。中断应该仅在最短时间内被禁用,然后重新启用到它们之前的状态。例如::" + +#: ../../library/machine.rst:106 +msgid "" +"Disable interrupt requests. Returns the previous IRQ state which should " +"be considered an opaque value. This return value should be passed to the " +"`enable_irq()` function to restore interrupts to their original state, " +"before `disable_irq()` was called." +msgstr "" +"禁用中断请求。返回先前的 IRQ 状态,应将此返回值视为不透明值。此返回值应传递给 `enable_irq()` 函数以将中断恢复到调用 " +"`disable_irq()` 之前的原始状态。" + +#: ../../library/machine.rst:113 +msgid "" +"Re-enable interrupt requests. The *state* parameter should be the value " +"that was returned from the most recent call to the `disable_irq()` " +"function." +msgstr "重新启用中断请求。*state* 参数应是从最近调用 `disable_irq()` 函数返回的值。" + +#: ../../library/machine.rst:118 +msgid "Power related functions" +msgstr "与电源相关的函数" + +#: ../../library/machine.rst:122 +msgid "Returns the CPU frequency in hertz." +msgstr "返回以赫兹为单位的CPU频率。" + +#: ../../library/machine.rst:124 +msgid "" +"On some ports this can also be used to set the CPU frequency by passing " +"in *hz*." +msgstr "在某些移植版本上,这也可以用于通过传入 *hz* 来设置 CPU 的频率。" + +#: ../../library/machine.rst:128 +msgid "" +"Gates the clock to the CPU, useful to reduce power consumption at any " +"time during short or long periods. Peripherals continue working and " +"execution resumes as soon as any interrupt is triggered, or at most one " +"millisecond after the CPU was paused." +msgstr "" +"门控 CPU " +"的时钟,可在短时间或长时间内降低功耗。外围设备继续工作,并在触发任何中断时或在 CPU 暂停后最多一毫秒内恢复执行。" + +#: ../../library/machine.rst:133 +msgid "" +"It is recommended to call this function inside any tight loop that is " +"continuously checking for an external change (i.e. polling). This will " +"reduce power consumption without significantly impacting performance. To " +"reduce power consumption further then see the :func:`lightsleep`, " +":func:`time.sleep()` and :func:`time.sleep_ms()` functions." +msgstr "" +"建议在任何持续检查外部变化(即轮询)的紧密循环中调用此函数。这将在不显著影响性能的情况下降低功耗。" +"要进一步降低功耗,请参阅 :func:`lightsleep`、:func:`time.sleep()` 和 " +":func:`time.sleep_ms()` 函数。" + +#: ../../library/machine.rst:141 +msgid "" +"This function is deprecated, use :func:`lightsleep()` instead with no " +"arguments." +msgstr "此函数已弃用,请改用无参数的 :func:`lightsleep()` 。" + +#: ../../library/machine.rst:146 +msgid "Stops execution in an attempt to enter a low power state." +msgstr "停止执行以尝试进入低功耗状态。" + +#: ../../library/machine.rst:148 +msgid "" +"If *time_ms* is specified then this will be the maximum time in " +"milliseconds that the sleep will last for. Otherwise the sleep can last " +"indefinitely." +msgstr "如果指定了 *time_ms*,则此值将是睡眠的最长时间(以毫秒为单位)。否则,睡眠可能持续无限期。" + +#: ../../library/machine.rst:151 +msgid "" +"With or without a timeout, execution may resume at any time if there are " +"events that require processing. Such events, or wake sources, should be " +"configured before sleeping, like `Pin` change or `RTC` timeout." +msgstr "无论是否设置了超时,如果有需要处理的事件,执行都可能随时恢复。这些事件或唤醒源应在睡眠前配置,如 `Pin` 变化或 `RTC` 超时。" + +#: ../../library/machine.rst:155 +msgid "" +"The precise behaviour and power-saving capabilities of lightsleep and " +"deepsleep is highly dependent on the underlying hardware, but the general" +" properties are:" +msgstr "lightsleep 和 deepsleep 的精确行为和节能能力高度依赖于底层硬件,但一般属性包括:" + +#: ../../library/machine.rst:158 +msgid "" +"A lightsleep has full RAM and state retention. Upon wake execution is " +"resumed from the point where the sleep was requested, with all subsystems" +" operational." +msgstr "lightsleep 具有完整的 RAM 和状态保留。唤醒时,从请求睡眠的点继续执行,所有子系统都正常工作。" + +#: ../../library/machine.rst:161 +msgid "" +"A deepsleep may not retain RAM or any other state of the system (for " +"example peripherals or network interfaces). Upon wake execution is " +"resumed from the main script, similar to a hard or power-on reset. The " +"`reset_cause()` function will return `machine.DEEPSLEEP` and this can be " +"used to distinguish a deepsleep wake from other resets." +msgstr "" +"deepsleep 可能不保留系统的 RAM " +"或任何其他状态(例如外围设备或网络接口)。唤醒时,从主脚本继续执行,类似于硬重置或上电重置。`reset_cause()` 函数将返回 " +"`machine.DEEPSLEEP`,这可以用于区分深睡唤醒和其他重置。" + +#: ../../library/machine.rst:168 +msgid "Miscellaneous functions" +msgstr "杂项函数" + +#: ../../library/machine.rst:172 +msgid "" +"Returns a byte string with a unique identifier of a board/SoC. It will " +"vary from a board/SoC instance to another, if underlying hardware allows." +" Length varies by hardware (so use substring of a full value if you " +"expect a short ID). In some MicroPython ports, ID corresponds to the " +"network MAC address." +msgstr "" +"返回一个板/SoC 的唯一标识符的字节串。如果底层硬件允许,它将从一个板/SoC " +"实例变化到另一个实例。硬件的长度可能会有所不同(因此如果您期望一个短 ID,使用完整值的子串)。在某些 MicroPython 移植版本中,ID " +"对应于网络 MAC 地址。" + +#: ../../library/machine.rst:179 +msgid "" +"Time a pulse on the given *pin*, and return the duration of the pulse in " +"microseconds. The *pulse_level* argument should be 0 to time a low pulse" +" or 1 to time a high pulse." +msgstr "计时给定 *pin* 上的脉冲,并以微秒为单位返回脉冲持续时间。*pulse_level* 参数应为 0 以计时低脉冲,或为 1 以计时高脉冲。" + +#: ../../library/machine.rst:183 +msgid "" +"If the current input value of the pin is different to *pulse_level*, the " +"function first (*) waits until the pin input becomes equal to " +"*pulse_level*, then (**) times the duration that the pin is equal to " +"*pulse_level*. If the pin is already equal to *pulse_level* then timing " +"starts straight away." +msgstr "" +"如果引脚的当前输入值与 *pulse_level* 不同,函数首先(*)等待引脚输入变为等于 *pulse_level*,然后(**)计时引脚等于" +" *pulse_level* 的持续时间。如果引脚已经等于 *pulse_level*,则计时立即开始。" + +#: ../../library/machine.rst:188 +msgid "" +"The function will return -2 if there was timeout waiting for condition " +"marked (*) above, and -1 if there was timeout during the main " +"measurement, marked (**) above. The timeout is the same for both cases " +"and given by *timeout_us* (which is in microseconds)." +msgstr "" +"如果在等待上述条件(*)时超时,函数将返回 -2;如果在主要测量(**)期间超时,函数将返回 -1。超时对于两种情况是相同的,由 " +"*timeout_us* 给出(以微秒为单位)。" + +#: ../../library/machine.rst:195 +msgid "" +"Transmits *data* by bit-banging the specified *pin*. The *encoding* " +"argument specifies how the bits are encoded, and *timing* is an encoding-" +"specific timing specification." +msgstr "" +"通过对指定的 *pin* 进行比特振荡来传输 *data*。*encoding* 参数指定了位的编码方式,*timing* " +"是一个特定于编码的时间规范。" + +#: ../../library/machine.rst:199 +msgid "The supported encodings are:" +msgstr "支持的编码有:" + +#: ../../library/machine.rst:201 +msgid "" +"``0`` for \"high low\" pulse duration modulation. This will transmit 0 " +"and 1 bits as timed pulses, starting with the most significant bit. The " +"*timing* must be a four-tuple of nanoseconds in the format " +"``(high_time_0, low_time_0, high_time_1, low_time_1)``. For example, " +"``(400, 850, 800, 450)`` is the timing specification for WS2812 RGB LEDs " +"at 800kHz." +msgstr "" +"``0`` 用于 \"高低\" 脉冲持续时间调制。这将以定时脉冲的方式传输 0 和 1 位,从最高有效位开始。*timing* " +"必须是一个四元组,以纳秒格式表示 ``(高时间_0, 低时间_0, 高时间_1, 低时间_1)``。例如,``(400, 850, 800, " +"450)`` 是用于 WS2812 RGB LED 的 800kHz 的时序规范。" + +#: ../../library/machine.rst:208 +msgid "" +"The accuracy of the timing varies between ports. On Cortex M0 at 48MHz, " +"it is at best +/- 120ns, however on faster MCUs (ESP8266, ESP32, STM32, " +"Pyboard), it will be closer to +/-30ns." +msgstr "" +"时间的准确性因移植版本而异。在 Cortex M0 上,时钟为 48MHz,最好的情况下为 +/- 120ns;然而,在更快的 " +"MCU(ESP8266、ESP32、STM32、Pyboard)上,它将更接近于 +/-30ns。" + +#: ../../library/machine.rst:212 +msgid "" +"For controlling WS2812 / NeoPixel strips, see the :mod:`neopixel` module " +"for a higher-level API." +msgstr "用于控制 WS2812 / NeoPixel 条,请参阅 :mod:`neopixel` 模块以获得更高级的 API。" + +#: ../../library/machine.rst:218 +msgid "Constants" +msgstr "常量" + +#: ../../library/machine.rst:224 +msgid "IRQ wake values." +msgstr "IRQ唤醒值。" + +#: ../../library/machine.rst:232 +msgid "Reset causes." +msgstr "重置原因。" + +#: ../../library/machine.rst:238 +msgid "Wake-up reasons." +msgstr "唤醒原因。" + +#: ../../library/machine.rst:241 +msgid "Classes" +msgstr "类" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/marshal.po b/docs/locale/zh_CN/LC_MESSAGES/library/marshal.po new file mode 100644 index 0000000000000..4c78ce9d1bf53 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/marshal.po @@ -0,0 +1,65 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/marshal.rst:2 +msgid ":mod:`marshal` -- Python object serialization" +msgstr ":mod:`marshal` -- Python 对象序列化" + +#: ../../library/marshal.rst:7 +msgid "|see_cpython_module| :mod:`python:marshal`." +msgstr "|see_cpython_module| :mod:`python:marshal`。" + +#: ../../library/marshal.rst:9 +msgid "" +"This module implements conversion between Python objects and a binary " +"format. The format is specific to MicroPython but does not depend on the " +"machine architecture, so the data can be transferred and used on a " +"different MicroPython instance, as long as the version of the binary data" +" matches (it's currently versioned as the mpy file version, see " +":ref:`mpy_files`)." +msgstr "" +"此模块实现 Python 对象与二进制格式之间的转换。该格式特定于 MicroPython," +"但不依赖于机器架构,因此数据可以在不同的 MicroPython 实例之间传输和使用," +"只要二进制数据的版本匹配即可(目前版本与 mpy 文件版本一致,参见 :ref:`mpy_files`)。" + +#: ../../library/marshal.rst:16 +msgid "Functions" +msgstr "函数" + +#: ../../library/marshal.rst:20 +msgid "" +"Convert the given *value* to binary format and return a corresponding " +"``bytes`` object." +msgstr "将给定的 *value* 转换为二进制格式并返回相应的 ``bytes`` 对象。" + +#: ../../library/marshal.rst:23 +msgid "" +"Currently, code objects are the only supported values that can be " +"converted." +msgstr "目前,代码对象是唯一支持转换的值类型。" + +#: ../../library/marshal.rst:27 +msgid "" +"Convert the given bytes-like *data* to its corresponding Python object, " +"and return it." +msgstr "将给定的类字节 *data* 转换为对应的 Python 对象并返回。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/math.po b/docs/locale/zh_CN/LC_MESSAGES/library/math.po new file mode 100644 index 0000000000000..fd25a853c9363 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/math.po @@ -0,0 +1,221 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-06-25 01:11+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/math.rst:2 +msgid ":mod:`math` -- mathematical functions" +msgstr ":mod:`math` -- 数学函数" + +#: ../../library/math.rst:7 +msgid "|see_cpython_module| :mod:`python:math`." +msgstr "|see_cpython_module| :mod:`python:math`。" + +#: ../../library/math.rst:9 +msgid "" +"The ``math`` module provides some basic mathematical functions for " +"working with floating-point numbers." +msgstr "``math`` 模块提供了一些基本的数学函数,用于处理浮点数。" + +#: ../../library/math.rst:12 +msgid "*Note:* On the pyboard, floating-point numbers have 32-bit precision." +msgstr "*注意:* 在 pyboard 上,浮点数精度为 32 位。" + +#: ../../library/math.rst:15 +msgid "Functions" +msgstr "函数" + +#: ../../library/math.rst:19 +msgid "Return the inverse cosine of ``x``." +msgstr "返回 ``x`` 的反余弦值。" + +#: ../../library/math.rst:23 +msgid "Return the inverse hyperbolic cosine of ``x``." +msgstr "返回 ``x`` 的反双曲余弦值。" + +#: ../../library/math.rst:27 +msgid "Return the inverse sine of ``x``." +msgstr "返回 ``x`` 的反正弦值。" + +#: ../../library/math.rst:31 +msgid "Return the inverse hyperbolic sine of ``x``." +msgstr "返回 ``x`` 的反双曲正弦值。" + +#: ../../library/math.rst:35 +msgid "Return the inverse tangent of ``x``." +msgstr "返回 ``x`` 的反正切值。" + +#: ../../library/math.rst:39 +msgid "Return the principal value of the inverse tangent of ``y/x``." +msgstr "返回 ``y/x`` 的反正切主值。" + +#: ../../library/math.rst:43 +msgid "Return the inverse hyperbolic tangent of ``x``." +msgstr "返回 ``x`` 的反双曲正切值。" + +#: ../../library/math.rst:47 +msgid "Return an integer, being ``x`` rounded towards positive infinity." +msgstr "返回一个整数,将 ``x`` 四舍五入到正无穷大。" + +#: ../../library/math.rst:51 +msgid "Return ``x`` with the sign of ``y``." +msgstr "返回带有 ``y`` 符号的 ``x``。" + +#: ../../library/math.rst:55 +msgid "Return the cosine of ``x``." +msgstr "返回 ``x`` 的余弦值。" + +#: ../../library/math.rst:59 +msgid "Return the hyperbolic cosine of ``x``." +msgstr "返回 ``x`` 的双曲余弦值。" + +#: ../../library/math.rst:63 +msgid "Return radians ``x`` converted to degrees." +msgstr "返回弧度 ``x`` 转换为度数。" + +#: ../../library/math.rst:67 +msgid "Return the error function of ``x``." +msgstr "返回 ``x`` 的误差函数。" + +#: ../../library/math.rst:71 +msgid "Return the complementary error function of ``x``." +msgstr "返回 ``x`` 的互补误差函数。" + +#: ../../library/math.rst:75 +msgid "Return the exponential of ``x``." +msgstr "返回 ``x`` 的指数函数。" + +#: ../../library/math.rst:79 +msgid "Return ``exp(x) - 1``." +msgstr "返回 ``exp(x) - 1``。" + +#: ../../library/math.rst:83 +msgid "Return the absolute value of ``x``." +msgstr "返回 ``x`` 的绝对值。" + +#: ../../library/math.rst:87 +msgid "Return an integer, being ``x`` rounded towards negative infinity." +msgstr "返回一个整数,将 ``x`` 四舍五入到负无穷大。" + +#: ../../library/math.rst:91 +msgid "Return the remainder of ``x/y``." +msgstr "返回 ``x/y`` 的余数。" + +#: ../../library/math.rst:95 +msgid "" +"Decomposes a floating-point number into its mantissa and exponent. The " +"returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` " +"exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise" +" the relation ``0.5 <= abs(m) < 1`` holds." +msgstr "" +"将浮点数分解为尾数和指数。返回值是元组 ``(m, e)``,使得 ``x == m * 2**e``。如果 ``x == 0``,则函数返回 " +"``(0.0, 0)``,否则满足关系式 ``0.5 <= abs(m) < 1``。" + +#: ../../library/math.rst:102 +msgid "Return the gamma function of ``x``." +msgstr "返回 ``x`` 的伽玛函数。" + +#: ../../library/math.rst:106 +msgid "Return ``True`` if ``x`` is finite." +msgstr "如果 ``x`` 是有限数,则返回 ``True``。" + +#: ../../library/math.rst:110 +msgid "Return ``True`` if ``x`` is infinite." +msgstr "如果 ``x`` 是无穷大数,则返回 ``True``。" + +#: ../../library/math.rst:114 +msgid "Return ``True`` if ``x`` is not-a-number" +msgstr "如果 ``x`` 是非数字,则返回 ``True``" + +#: ../../library/math.rst:118 +msgid "Return ``x * (2**exp)``." +msgstr "返回 ``x * (2**exp)``。" + +#: ../../library/math.rst:122 +msgid "Return the natural logarithm of the gamma function of ``x``." +msgstr "返回 ``x`` 的伽玛函数的自然对数。" + +#: ../../library/math.rst:127 +msgid "With one argument, return the natural logarithm of *x*." +msgstr "使用一个参数时,返回 *x* 的自然对数。" + +#: ../../library/math.rst:129 +msgid "With two arguments, return the logarithm of *x* to the given *base*." +msgstr "使用两个参数时,返回以给定 *base* 为底的 *x* 的对数。" + +#: ../../library/math.rst:133 +msgid "Return the base-10 logarithm of ``x``." +msgstr "返回 ``x`` 的以 10 为底的对数。" + +#: ../../library/math.rst:137 +msgid "Return the base-2 logarithm of ``x``." +msgstr "返回 ``x`` 的以 2 为底的对数。" + +#: ../../library/math.rst:141 +msgid "" +"Return a tuple of two floats, being the fractional and integral parts of " +"``x``. Both return values have the same sign as ``x``." +msgstr "返回一个包含两个浮点数的元组,分别是 ``x`` 的小数部分和整数部分。两个返回值的符号与 ``x`` 相同。" + +#: ../../library/math.rst:146 +msgid "Returns ``x`` to the power of ``y``." +msgstr "返回 ``x`` 的 ``y`` 次幂。" + +#: ../../library/math.rst:150 +msgid "Return degrees ``x`` converted to radians." +msgstr "返回度数 ``x`` 转换为弧度。" + +#: ../../library/math.rst:154 +msgid "Return the sine of ``x``." +msgstr "返回 ``x`` 的正弦值。" + +#: ../../library/math.rst:158 +msgid "Return the hyperbolic sine of ``x``." +msgstr "返回 ``x`` 的双曲正弦值。" + +#: ../../library/math.rst:162 +msgid "Return the square root of ``x``." +msgstr "返回 ``x`` 的平方根。" + +#: ../../library/math.rst:166 +msgid "Return the tangent of ``x``." +msgstr "返回 ``x`` 的正切值。" + +#: ../../library/math.rst:170 +msgid "Return the hyperbolic tangent of ``x``." +msgstr "返回 ``x`` 的双曲正切值。" + +#: ../../library/math.rst:174 +msgid "Return an integer, being ``x`` rounded towards 0." +msgstr "返回一个整数,将 ``x`` 四舍五入到 0。" + +#: ../../library/math.rst:177 +msgid "Constants" +msgstr "常量" + +#: ../../library/math.rst:181 +msgid "base of the natural logarithm" +msgstr "自然对数的底数" + +#: ../../library/math.rst:185 +msgid "the ratio of a circle's circumference to its diameter" +msgstr "圆周长与直径之比" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/micropython.po b/docs/locale/zh_CN/LC_MESSAGES/library/micropython.po new file mode 100644 index 0000000000000..9e940772c089e --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/micropython.po @@ -0,0 +1,382 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/micropython.rst:2 +msgid ":mod:`micropython` -- access and control MicroPython internals" +msgstr ":mod:`micropython` -- 访问和控制 MicroPython 内部" + +#: ../../library/micropython.rst:8 +msgid "Functions" +msgstr "函数" + +#: ../../library/micropython.rst:12 +msgid "" +"Used to declare that the expression is a constant so that the compiler " +"can optimise it. The use of this function should be as follows::" +msgstr "用于声明表达式是一个常量,以便编译器可以优化它。应使用此函数如下::" + +#: ../../library/micropython.rst:20 +msgid "" +"Constants declared this way are still accessible as global variables from" +" outside the module they are declared in. On the other hand, if a " +"constant begins with an underscore then it is hidden, it is not available" +" as a global variable, and does not take up any memory during execution." +msgstr "以这种方式声明的常量仍然可以从它们声明所在的模块外部作为全局变量访问。另一方面,如果常量以下划线开头,则它是隐藏的,它不作为全局变量可用,并且在执行期间不占用任何内存。" + +#: ../../library/micropython.rst:25 +msgid "" +"This `const` function is recognised directly by the MicroPython parser " +"and is provided as part of the :mod:`micropython` module mainly so that " +"scripts can be written which run under both CPython and MicroPython, by " +"following the above pattern." +msgstr "" +"此 `const` 函数被 MicroPython 解析器直接识别,并作为 :mod:`micropython` " +"模块的一部分提供,主要是为了可以编写同时在 CPython 和 MicroPython 下运行的脚本,遵循上述模式。" + +#: ../../library/micropython.rst:32 +msgid "" +"If *level* is given then this function sets the optimisation level for " +"subsequent compilation of scripts, and returns ``None``. Otherwise it " +"returns the current optimisation level." +msgstr "如果给出了 *level*,则此函数设置后续脚本编译的优化级别,并返回 ``None``。否则,它返回当前的优化级别。" + +#: ../../library/micropython.rst:36 +msgid "The optimisation level controls the following compilation features:" +msgstr "优化级别控制以下编译特性:" + +#: ../../library/micropython.rst:38 +msgid "" +"Assertions: at level 0 assertion statements are enabled and compiled into" +" the bytecode; at levels 1 and higher assertions are not compiled." +msgstr "断言:在级别 0,断言语句被启用并编译到字节码中;在级别 1 及更高级别,断言不会被编译。" + +#: ../../library/micropython.rst:40 +msgid "" +"Built-in ``__debug__`` variable: at level 0 this variable expands to " +"``True``; at levels 1 and higher it expands to ``False``." +msgstr "内置的 ``__debug__`` 变量:在级别 0,此变量扩展为 ``True``;在级别 1 及更高级别,它扩展为 ``False``。" + +#: ../../library/micropython.rst:42 +msgid "" +"Source-code line numbers: at levels 0, 1 and 2 source-code line number " +"are stored along with the bytecode so that exceptions can report the line" +" number they occurred at; at levels 3 and higher line numbers are not " +"stored." +msgstr "源代码行号:在级别 0、1 和 2,源代码行号将与字节码一起存储,以便异常可以报告它们发生的行号;在级别 3 及更高级别,不会存储行号。" + +#: ../../library/micropython.rst:46 +msgid "The default optimisation level is usually level 0." +msgstr "默认优化级别通常是级别 0。" + +#: ../../library/micropython.rst:50 +msgid "" +"Allocate *size* bytes of RAM for the emergency exception buffer (a good " +"size is around 100 bytes). The buffer is used to create exceptions in " +"cases when normal RAM allocation would fail (eg within an interrupt " +"handler) and therefore give useful traceback information in these " +"situations." +msgstr "" +"为紧急情况异常缓冲区分配 *size* 字节的 RAM(一个很好的大小大约是 100 字节)。该缓冲区用于在正常 RAM " +"分配失败时创建异常(例如在中断处理程序中),因此在这些情况下给出有用的回溯信息。" + +#: ../../library/micropython.rst:55 +msgid "" +"A good way to use this function is to put it at the start of your main " +"script (eg ``boot.py`` or ``main.py``) and then the emergency exception " +"buffer will be active for all the code following it." +msgstr "使用此函数的好方法是将它放在主脚本的开头(例如 ``boot.py`` 或 ``main.py``),然后紧急异常缓冲区将为其后的所有代码激活。" + +#: ../../library/micropython.rst:61 +msgid "" +"Print information about currently used memory. If the *verbose* argument" +" is given then extra information is printed." +msgstr "打印有关当前使用的内存的信息。如果给出了 *verbose* 参数,则会打印额外的信息。" + +#: ../../library/micropython.rst:64 +msgid "" +"The information that is printed is implementation dependent, but " +"currently includes the amount of stack and heap used. In verbose mode it" +" prints out the entire heap indicating which blocks are used and which " +"are free." +msgstr "打印的信息是实现相关的,但目前包括使用的堆栈和堆的数量。在详细模式下,它会打印出整个堆,指示哪些块正在使用,哪些是空闲的。" + +#: ../../library/micropython.rst:70 +msgid "" +"Print information about currently interned strings. If the *verbose* " +"argument is given then extra information is printed." +msgstr "打印当前内存化字符串的信息。如果提供了 *verbose* 参数,则会打印额外的信息。" + +#: ../../library/micropython.rst:73 +msgid "" +"The information that is printed is implementation dependent, but " +"currently includes the number of interned strings and the amount of RAM " +"they use. In verbose mode it prints out the names of all RAM-interned " +"strings." +msgstr "打印的信息依赖于具体实现,但目前包括内存化字符串的数量及其占用的 RAM 大小。在详细模式下,它还会打印出所有 RAM 内存化字符串的名称。" + +#: ../../library/micropython.rst:79 +msgid "" +"Return an integer representing the current amount of stack that is being " +"used. The absolute value of this is not particularly useful, rather it " +"should be used to compute differences in stack usage at different points." +msgstr "返回一个整数,表示当前正在使用的堆栈量。此绝对值并不特别有用,而是应该用于计算不同点的堆栈使用量之间的差异。" + +#: ../../library/micropython.rst:87 +msgid "" +"Lock or unlock the heap. When locked no memory allocation can occur and " +"a `MemoryError` will be raised if any heap allocation is attempted. " +"`heap_locked()` returns a true value if the heap is currently locked." +msgstr "" +"锁定或解锁堆。当锁定时,无法进行内存分配,如果尝试进行任何堆分配,则会引发 `MemoryError`。如果堆被锁定,则 " +"`heap_locked()` 返回一个真值。" + +#: ../../library/micropython.rst:91 +msgid "" +"These functions can be nested, ie `heap_lock()` can be called multiple " +"times in a row and the lock-depth will increase, and then `heap_unlock()`" +" must be called the same number of times to make the heap available " +"again." +msgstr "" +"这些函数可以嵌套,即可以连续多次调用 `heap_lock()`,锁深度将增加,然后必须调用相同数量的 `heap_unlock()` " +"来重新使堆可用。" + +#: ../../library/micropython.rst:95 +msgid "" +"Both `heap_unlock()` and `heap_locked()` return the current lock depth " +"(after unlocking for the former) as a non-negative integer, with 0 " +"meaning the heap is not locked." +msgstr "`heap_unlock()` 和 `heap_locked()` 都以非负整数返回当前锁定深度(前者解锁后),0 表示堆未锁定。" + +#: ../../library/micropython.rst:99 +msgid "" +"If the REPL becomes active with the heap locked then it will be " +"forcefully unlocked." +msgstr "如果 REPL 在堆被锁定的情况下变为活动状态,则它将被强制解锁。" + +#: ../../library/micropython.rst:102 +msgid "" +"Note: `heap_locked()` is not enabled on most ports by default, requires " +"``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``." +msgstr "" +"注意:`heap_locked()` 在大多数移植版本上默认未启用,需要 " +"``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``。" + +#: ../../library/micropython.rst:107 +msgid "" +"Set the character that will raise a `KeyboardInterrupt` exception. By " +"default this is set to 3 during script execution, corresponding to " +"Ctrl-C. Passing -1 to this function will disable capture of Ctrl-C, and " +"passing 3 will restore it." +msgstr "" +"设置将引发 `KeyboardInterrupt` 异常的字符。在脚本执行期间,默认情况下将此设置为 3,对应于 Ctrl-C。将 -1 " +"传递给此函数将禁用捕获 Ctrl-C,将 3 传递给此函数将恢复它。" + +#: ../../library/micropython.rst:112 +msgid "" +"This function can be used to prevent the capturing of Ctrl-C on the " +"incoming stream of characters that is usually used for the REPL, in case " +"that stream is used for other purposes." +msgstr "此函数可用于防止捕获通常用于 REPL 的字符流上的 Ctrl-C,以防该流用于其他目的。" + +#: ../../library/micropython.rst:118 +msgid "" +"Schedule the function *func* to be executed \"very soon\". The function " +"is passed the value *arg* as its single argument. \"Very soon\" means " +"that the MicroPython runtime will do its best to execute the function at " +"the earliest possible time, given that it is also trying to be efficient," +" and that the following conditions hold:" +msgstr "" +"调度函数 *func* \"立即\" 执行。该函数将值 *arg* 作为其单个参数。 \"立即\" 的意思是 MicroPython " +"运行时将尽其所能在最早可能的时间执行该函数,前提是它还试图高效地执行,并且以下条件成立:" + +#: ../../library/micropython.rst:124 +msgid "A scheduled function will never preempt another scheduled function." +msgstr "已调度的函数永远不会抢占另一个已调度的函数。" + +#: ../../library/micropython.rst:125 +msgid "" +"Scheduled functions are always executed \"between opcodes\" which means " +"that all fundamental Python operations (such as appending to a list) are " +"guaranteed to be atomic." +msgstr "调度的函数始终在 \"操作码之间\" 执行,这意味着所有基本的 Python 操作(例如向列表附加)都是原子的。" + +#: ../../library/micropython.rst:128 +msgid "" +"A given port may define \"critical regions\" within which scheduled " +"functions will never be executed. Functions may be scheduled within a " +"critical region but they will not be executed until that region is " +"exited. An example of a critical region is a preempting interrupt " +"handler (an IRQ)." +msgstr "" +"给定移植版本可能在其中定义 " +"\"关键区域\",在其中调度的函数将永远不会执行。函数可以在关键区域内调度,但直到退出该区域才会执行。关键区域的示例是抢占中断处理程序(IRQ)。" + +#: ../../library/micropython.rst:134 +msgid "" +"A use for this function is to schedule a callback from a preempting IRQ. " +"Such an IRQ puts restrictions on the code that runs in the IRQ (for " +"example the heap may be locked) and scheduling a function to call later " +"will lift those restrictions." +msgstr "" +"此函数的一个用途是从抢占 IRQ 调度回调。这种 IRQ 对 IRQ " +"中运行的代码施加了限制(例如,堆可能被锁定),而调度一个稍后调用的函数将解除这些限制。" + +#: ../../library/micropython.rst:139 +msgid "" +"On multi-threaded ports, the scheduled function's behaviour depends on " +"whether the Global Interpreter Lock (GIL) is enabled for the specific " +"port:" +msgstr "在多线程移植版本上,调度函数的行为取决于该移植版本是否启用了全局解释器锁(GIL):" + +#: ../../library/micropython.rst:142 +msgid "" +"If GIL is enabled, the function can preempt any thread and run in its " +"context." +msgstr "如果启用了 GIL,该函数可以抢占任何线程并在其上下文中运行。" + +#: ../../library/micropython.rst:144 +msgid "" +"If GIL is disabled, the function will only preempt the main thread and " +"run in its context." +msgstr "如果未启用 GIL,该函数将仅抢占主线程并在其上下文中运行。" + +#: ../../library/micropython.rst:147 +msgid "" +"Note: If `schedule()` is called from a preempting IRQ, when memory " +"allocation is not allowed and the callback to be passed to `schedule()` " +"is a bound method, passing this directly will fail. This is because " +"creating a reference to a bound method causes memory allocation. A " +"solution is to create a reference to the method in the class constructor " +"and to pass that reference to `schedule()`. This is discussed in detail " +"here :ref:`reference documentation ` under \"Creation of " +"Python objects\"." +msgstr "" +"注意:如果从抢占 IRQ 中调用 `schedule()`,则不允许内存分配,并且要传递给 `schedule()` " +"的回调是绑定方法,则直接传递这个会失败。这是因为创建对绑定方法的引用会导致内存分配。解决方案是在类构造函数中创建对该方法的引用,并将该引用传递给 " +"`schedule()`。这在此处详细讨论 :ref:`reference documentation ` 中的 \"创建 " +"Python 对象\" 下。" + +#: ../../library/micropython.rst:156 +msgid "" +"There is a finite queue to hold the scheduled functions and `schedule()` " +"will raise a `RuntimeError` if the queue is full." +msgstr "有限队列用于保存调度的函数,如果队列已满,则 `schedule()` 将引发 `RuntimeError`。" + +#: ../../library/micropython.rst:160 +msgid "Classes" +msgstr "类" + +#: ../../library/micropython.rst:166 +msgid "" +"Provides a fixed-size ringbuffer for bytes with a stream interface. Can " +"be considered like a fifo queue variant of `io.BytesIO`." +msgstr "提供一个具有流接口的固定大小字节环形缓冲区。可以看作是 `io.BytesIO` 的先进先出队列变体。" + +#: ../../library/micropython.rst:169 +msgid "" +"When created with integer size a suitable buffer will be allocated. " +"Alternatively a `bytearray` or similar buffer protocol object can be " +"provided to the constructor for in-place use." +msgstr "使用整数大小创建时将分配合适的缓冲区。也可以将 `bytearray` 或类似的缓冲区协议对象提供给构造函数以供就地使用。" + +#: ../../library/micropython.rst:173 +msgid "" +"The classic ringbuffer algorithm is used which allows for any size buffer" +" to be used however one byte will be consumed for tracking. If " +"initialised with an integer size this will be accounted for, for example " +"``RingIO(16)`` will allocate a 17 byte buffer internally so it can hold " +"16 bytes of data. When passing in a pre-allocated buffer however one byte" +" less than its original length will be available for storage, eg. " +"``RingIO(bytearray(16))`` will only hold 15 bytes of data." +msgstr "" +"使用经典的环形缓冲区算法,允许使用任意大小的缓冲区,但会消耗一个字节用于跟踪。" +"如果使用整数大小初始化,这将被考虑在内,例如 ``RingIO(16)`` 将在内部分配 17 字节的缓冲区," +"以便可以容纳 16 字节的数据。然而,当传入预分配的缓冲区时,可用于存储的空间将比其原始长度少一个字节," +"例如 ``RingIO(bytearray(16))`` 只能容纳 15 字节的数据。" + +#: ../../library/micropython.rst:181 +msgid "" +"A RingIO instance can be IRQ / thread safe when used to pass data in a " +"single direction eg. when written to in an IRQ and read from in a non-IRQ" +" function (or vice versa). This does not hold if you try to eg. write to " +"a single instance from both IRQ and non-IRQ code, this would often cause " +"data corruption." +msgstr "" +"RingIO 实例在单方向传递数据时可以是 IRQ/线程安全的,例如在 IRQ 中写入并在非 IRQ " +"函数中读取(或反之亦然)。如果尝试从 IRQ 和非 IRQ 代码同时写入同一个实例,则不适用,这通常会导致数据损坏。" + +#: ../../library/micropython.rst:188 +msgid "Returns an integer counting the number of characters that can be read." +msgstr "返回一个整数,表示可读取的字符数。" + +#: ../../library/micropython.rst:192 +msgid "" +"Read available characters. This is a non-blocking function. If ``nbytes``" +" is specified then read at most that many bytes, otherwise read as much " +"data as possible." +msgstr "读取可用字符。这是一个非阻塞函数。如果指定了 ``nbytes``,则最多读取该数量的字节,否则尽可能多地读取数据。" + +#: ../../library/micropython.rst:196 +msgid "" +"Return value: a bytes object containing the bytes read. Will be zero-" +"length bytes object if no data is available." +msgstr "返回值:包含已读取字节的 bytes 对象。如果没有可用数据,则为零长度的 bytes 对象。" + +#: ../../library/micropython.rst:201 +msgid "" +"Read a line, ending in a newline character or return if one exists in the" +" buffer, else return available bytes in buffer. If ``nbytes`` is " +"specified then read at most that many bytes." +msgstr "读取一行,以换行符或回车符结束(如果缓冲区中存在),否则返回缓冲区中可用的字节。如果指定了 ``nbytes``,则最多读取该数量的字节。" + +#: ../../library/micropython.rst:205 +msgid "Return value: a bytes object containing the line read." +msgstr "返回值:包含已读取行的 bytes 对象。" + +#: ../../library/micropython.rst:209 +msgid "" +"Read available bytes into the provided ``buf``. If ``nbytes`` is " +"specified then read at most that many bytes. Otherwise, read at most " +"``len(buf)`` bytes." +msgstr "将可用字节读取到提供的 ``buf`` 中。如果指定了 ``nbytes``,则最多读取该数量的字节。否则,最多读取 ``len(buf)`` 个字节。" + +#: ../../library/micropython.rst:213 +msgid "Return value: Integer count of the number of bytes read into ``buf``." +msgstr "返回值:读入 ``buf`` 的字节数(整数)。" + +#: ../../library/micropython.rst:217 +msgid "" +"Non-blocking write of bytes from ``buf`` into the ringbuffer, limited by " +"the available space in the ringbuffer." +msgstr "将 ``buf`` 中的字节非阻塞地写入环形缓冲区,受限于环形缓冲区的可用空间。" + +#: ../../library/micropython.rst:220 +msgid "Return value: Integer count of bytes written." +msgstr "返回值:已写入的字节数(整数)。" + +#: ../../library/micropython.rst:224 +msgid "" +"No-op provided as part of standard :std:term:`stream` interface. Has no " +"effect on data in the ringbuffer." +msgstr "作为标准 :std:term:`stream` 接口的一部分提供的空操作。对环形缓冲区中的数据无影响。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/mutex.po b/docs/locale/zh_CN/LC_MESSAGES/library/mutex.po new file mode 100644 index 0000000000000..c92cc60c59dc3 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/mutex.po @@ -0,0 +1,137 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/mutex.rst:2 +msgid ":mod:`mutex` --- mutex module" +msgstr ":mod:`mutex` --- 互斥锁模块" + +#: ../../library/mutex.rst:7 +msgid "The ``mutex`` module is used for creating mutexes." +msgstr "``mutex`` 模块用于创建互斥锁。" + +#: ../../library/mutex.rst:10 +msgid "class Mutex -- mutex object" +msgstr "class Mutex -- 互斥锁对象" + +#: ../../library/mutex.rst:12 +msgid "" +"A mutex is an object enabling threads of execution to protect critical " +"sections of code from reentrancy or to temporarily protect critical data " +"sets from being updated by other threads. The term \"mutex\" derives from" +" the notion of mutual exclusion. A mutex usually provides three methods:" +msgstr "" +"互斥锁是一种对象,使执行线程能够保护代码的关键部分免受重入,或者暂时保护关键" +"数据集不被其他线程更新。术语“mutex”源于互斥排他的概念。互斥锁通常提供三种方法" +":" + +#: ../../library/mutex.rst:16 +msgid "" +"lock() (POSIX pthread_mutex_lock): wait until the mutex is free, then " +"lock it" +msgstr "lock() (POSIX pthread_mutex_lock): 等待互斥锁空闲,然后锁定它" + +#: ../../library/mutex.rst:17 +msgid "unlock() (POSIX pthread_mutex_unlock): Immediate return. unlock the mutex." +msgstr "unlock() (POSIX pthread_mutex_unlock): 立即返回。解锁互斥锁。" + +#: ../../library/mutex.rst:18 +msgid "" +"test() (POSIX pthread_mutex_trylock): Immediate return. test if it is " +"locked." +msgstr "test() (POSIX pthread_mutex_trylock): 立即返回。测试它是否被锁定。" + +#: ../../library/mutex.rst:20 +msgid "In this implementation lock and unlock is controlled by a context manager." +msgstr "在这个实现中,通过上下文管理器来控制锁定和解锁。" + +#: ../../library/mutex.rst:22 +msgid "" +"In the context of MicroPython a mutex provides a mechanism where an " +"interrupt service routine (ISR) can test whether the main loop was using " +"critical variables at the time the interrupt occurred, and if so avoid " +"modifying those variables. Typical usage::" +msgstr "" +"在MicroPython环境中,互斥锁提供了一种机制,其中中断服务例程(ISR)可以测试主" +"循环在中断发生时是否使用了关键变量,如果是,则避免修改这些变量。典型用法::" + +#: ../../library/mutex.rst:48 +msgid "" +"Note that the with statement will execute immediately because no other " +"process runs a with block on the same mutex instance." +msgstr "注意,由于没有其他进程在相同的互斥锁实例上运行一个 with 块,因此 with " +"语句将立即执行。" + +#: ../../library/mutex.rst:51 +msgid "`Linux man page `_" +msgstr "`Linux man page `_" + +#: ../../library/mutex.rst:53 +msgid "References describing mutex and semaphore objects" +msgstr "描述互斥锁和信号量对象的参考文献" + +#: ../../library/mutex.rst:55 +msgid "`geeksforgeeks `_" +msgstr "`geeksforgeeks `_" + +#: ../../library/mutex.rst:56 +msgid "" +"`stackoverflow `_" +msgstr "" +"`stackoverflow `_" + +#: ../../library/mutex.rst:57 +msgid "" +"`differencebetween `_" +msgstr "" +"`differencebetween `_" + +#: ../../library/mutex.rst:60 +msgid "Constructors" +msgstr "构造" + +#: ../../library/mutex.rst:64 +msgid "Creates an unlocked mutex object." +msgstr "创建一个未锁定的互斥锁对象。" + +#: ../../library/mutex.rst:67 +msgid "Methods" +msgstr "方法" + +#: ../../library/mutex.rst:71 +msgid "Unlock the mutex." +msgstr "解锁互斥锁。" + +#: ../../library/mutex.rst:75 +msgid "" +"Try to acquire the mutex in a non-blocking way. Return ``True`` on " +"success and ``False`` on failure." +msgstr "尝试以非阻塞方式获取互斥锁。成功返回 ``True``,失败返回 ``False``。" + +#: ../../library/mutex.rst:77 +msgid "You may also acquire the mutex in a blocking way by using ``with``." +msgstr "您也可以使用 ``with`` 以阻塞方式获取互斥锁。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/network.LAN.po b/docs/locale/zh_CN/LC_MESSAGES/library/network.LAN.po new file mode 100644 index 0000000000000..8f6ef018fded8 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/network.LAN.po @@ -0,0 +1,161 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/network.LAN.rst:5 +msgid "class LAN -- control an Ethernet module" +msgstr "class LAN -- 控制以太网模块" + +#: ../../library/network.LAN.rst:7 +msgid "" +"This class allows you to control the Ethernet interface. The PHY hardware" +" type is board-specific." +msgstr "此类允许您控制以太网接口。PHY 硬件类型是特定于板子的。" + +#: ../../library/network.LAN.rst:9 +msgid "Example usage, for a board with built-in LAN support::" +msgstr "示例用法,适用于内置 LAN 支持的板::" + +#: ../../library/network.LAN.rst:20 +msgid "Constructors" +msgstr "构造" + +#: ../../library/network.LAN.rst:24 +msgid "" +"Create a LAN driver object, initialise the LAN module using the given PHY" +" driver name, and return the LAN object." +msgstr "创建一个 LAN 驱动程序对象,使用给定的 PHY 驱动程序名称初始化 LAN 模块,并返回 LAN 对象。" + +#: ../../library/network.LAN.rst:27 +msgid "Arguments are:" +msgstr "参数是:" + +#: ../../library/network.LAN.rst:29 +msgid "*id* is the number of the Ethernet port, either 0 or 1." +msgstr "*id* 是以太网端口的编号,为 0 或 1。" + +#: ../../library/network.LAN.rst:30 +msgid "" +"*phy_type* is the name of the PHY driver. For most board the on-board PHY" +" has to be used and is the default. Suitable values are port specific." +msgstr "*phy_type* 是 PHY 驱动程序的名称。对于大多数板子,必须使用板载 PHY,并且是默认值。适当的值是特定于移植版本的。" + +#: ../../library/network.LAN.rst:32 +msgid "" +"*phy_addr* specifies the address of the PHY interface. As with " +"*phy_type*, the hardwired value has to be used for most boards and that " +"value is the default." +msgstr "*phy_addr* 指定 PHY 接口的地址。与 *phy_type* 一样,大多数板子需要使用预设的硬编码数值,该值是默认值。" + +#: ../../library/network.LAN.rst:34 +msgid "" +"*ref_clk_mode* specifies, whether the data clock is provided by the " +"Ethernet controller or the PHY interface. The default value is the one " +"that matches the board. If set to ``LAN.OUT`` or ``Pin.OUT`` or ``True``," +" the clock is driven by the Ethernet controller, if set to ``LAN.IN`` or " +"``Pin.IN`` or ``False``, the clock is driven by the PHY interface." +msgstr "" +"*ref_clk_mode* 指定数据时钟是由以太网控制器提供还是由 PHY 接口提供。默认值是与板子匹配的值。如果设置为 ``LAN.OUT``" +" 或 ``Pin.OUT`` 或 ``True``,则时钟由以太网控制器驱动;如果设置为 ``LAN.IN`` 或 ``Pin.IN`` 或 " +"``False``,则时钟由 PHY 接口驱动。" + +#: ../../library/network.LAN.rst:41 +msgid "Methods" +msgstr "方法" + +#: ../../library/network.LAN.rst:45 +msgid "" +"With a parameter, it sets the interface active if *state* is true, " +"otherwise it sets it inactive. Without a parameter, it returns the state." +msgstr "带有参数时,如果 *state* 为真,则将接口设置为活动状态,否则设置为非活动状态。没有参数时,返回状态。" + +#: ../../library/network.LAN.rst:51 +msgid "" +"Returns ``True`` if the physical Ethernet link is connected and up. " +"Returns ``False`` otherwise." +msgstr "如果物理以太网链接已连接并且正常工作,则返回 ``True``。否则返回 ``False``。" + +#: ../../library/network.LAN.rst:56 +msgid "Returns the LAN status." +msgstr "返回LAN状态。" + +#: ../../library/network.LAN.rst:60 +msgid "Get/set IP address, subnet mask, gateway and DNS." +msgstr "获取/设置IP地址、子网掩码、网关和DNS。" + +#: ../../library/network.LAN.rst:62 +msgid "" +"When called with no arguments, this method returns a 4-tuple with the " +"above information." +msgstr "当不带参数调用时,此方法返回包含上述信息的 4 元组。" + +#: ../../library/network.LAN.rst:64 +msgid "" +"To set the above values, pass a 4-tuple with the required information. " +"For example::" +msgstr "要设置上述值,请传递包含所需信息的 4 元组。例如::" + +#: ../../library/network.LAN.rst:70 +msgid "" +"Sets or gets parameters of the LAN interface. The only parameter that can" +" be retrieved is the MAC address, using::" +msgstr "设置或获取 LAN 接口的参数。唯一可检索的参数是 MAC 地址,使用以下方法::" + +#: ../../library/network.LAN.rst:75 +msgid "The parameters that can be set are:" +msgstr "可以设置的参数是:" + +#: ../../library/network.LAN.rst:77 +msgid "``trace=n`` sets trace levels; suitable values are:" +msgstr "``trace=n`` 设置跟踪级别;适当的值为:" + +#: ../../library/network.LAN.rst:79 +msgid "2: trace TX" +msgstr "2: 跟踪 TX" + +#: ../../library/network.LAN.rst:80 +msgid "4: trace RX" +msgstr "4: 跟踪 RX" + +#: ../../library/network.LAN.rst:81 +msgid "8: full trace" +msgstr "8: 完整跟踪" + +#: ../../library/network.LAN.rst:83 +msgid "" +"``low_power=bool`` sets or clears low power mode, valid values being " +"``False`` or ``True``." +msgstr "``low_power=bool`` 设置或清除低功耗模式,有效值为 ``False`` 或 ``True``。" + +#: ../../library/network.LAN.rst:88 +msgid "Specific LAN class implementations" +msgstr "特定的 LAN 类实现" + +#: ../../library/network.LAN.rst:90 +msgid "" +"On the mimxrt port, suitable values for the *phy_type* constructor " +"argument are: ``PHY_KSZ8081``, ``PHY_DP83825``, ``PHY_DP83848``, " +"``PHY_LAN8720``, ``PHY_RTL8211F``." +msgstr "" +"在 mimxrt 移植版本上, *phy_type* 构造函数参数的适当值为:``PHY_KSZ8081``, ``PHY_DP83825``, " +"``PHY_DP83848``, ``PHY_LAN8720``, ``PHY_RTL8211F``。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/network.PPP.po b/docs/locale/zh_CN/LC_MESSAGES/library/network.PPP.po new file mode 100644 index 0000000000000..d4482c1332c52 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/network.PPP.po @@ -0,0 +1,149 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/network.PPP.rst:5 +msgid "class PPP -- create network connections over serial PPP" +msgstr "class PPP -- 通过串口 PPP 创建网络连接" + +#: ../../library/network.PPP.rst:7 +msgid "" +"This class allows you to create a network connection over a serial port " +"using the PPP protocol." +msgstr "此类允许您通过串口使用 PPP 协议创建网络连接。" + +#: ../../library/network.PPP.rst:10 +msgid "" +"Currently only the esp32 port has PPP support enabled in the default " +"firmware build. PPP support can be enabled in custom builds of the stm32 " +"and rp2 ports by enabling networking support and setting " +"``MICROPY_PY_NETWORK_PPP_LWIP`` to 1." +msgstr "" +"目前只有 esp32 移植版本在默认固件构建中启用了 PPP 支持。可以在 stm32 和 rp2 移植版本的自定义构建中" +"通过启用网络支持并将 ``MICROPY_PY_NETWORK_PPP_LWIP`` 设置为 1 来启用 PPP 支持。" + +#: ../../library/network.PPP.rst:15 +msgid "Example usage::" +msgstr "用法示例::" + +#: ../../library/network.PPP.rst:32 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/network.PPP.rst:36 +msgid "Create a PPP driver object." +msgstr "创建 PPP 驱动对象。" + +#: ../../library/network.PPP.rst:38 +msgid "Arguments are:" +msgstr "参数如下:" + +#: ../../library/network.PPP.rst:40 +msgid "" +"*stream* is any object that supports the stream protocol, but is most " +"commonly a :class:`machine.UART` instance. This stream object must have " +"an ``irq()`` method and an ``IRQ_RXIDLE`` constant, for use by " +"`PPP.connect`." +msgstr "" +"*stream* 是任何支持流协议的对象,但最常见的是 :class:`machine.UART` 实例。" +"此流对象必须具有 ``irq()`` 方法和 ``IRQ_RXIDLE`` 常量,供 `PPP.connect` 使用。" + +#: ../../library/network.PPP.rst:45 +msgid "Methods" +msgstr "方法" + +#: ../../library/network.PPP.rst:49 +msgid "Initiate a PPP connection with the given parameters:" +msgstr "使用给定参数发起 PPP 连接:" + +#: ../../library/network.PPP.rst:51 +msgid "" +"*security* is the type of security, either ``PPP.SEC_NONE``, " +"``PPP.SEC_PAP``, or ``PPP.SEC_CHAP``." +msgstr "*security* 是安全类型,可以是 ``PPP.SEC_NONE``、``PPP.SEC_PAP`` 或 ``PPP.SEC_CHAP``。" + +#: ../../library/network.PPP.rst:53 +msgid "*user* is an optional user name to use with the security mode." +msgstr "*user* 是与安全模式一起使用的可选用户名。" + +#: ../../library/network.PPP.rst:54 +msgid "*key* is an optional password to use with the security mode." +msgstr "*key* 是与安全模式一起使用的可选密码。" + +#: ../../library/network.PPP.rst:56 +msgid "" +"When this method is called the underlying stream has its interrupt " +"configured to call `PPP.poll` via ``stream.irq(ppp.poll, " +"stream.IRQ_RXIDLE)``. This makes sure the stream is polled, and data " +"passed up the PPP stack, wheverver data becomes available on the stream." +msgstr "" +"调用此方法时,底层流的中断被配置为通过 ``stream.irq(ppp.poll, stream.IRQ_RXIDLE)`` 调用 `PPP.poll`。" +"这确保在流上有数据可用时对其进行轮询,并将数据传递到 PPP 协议栈。" + +#: ../../library/network.PPP.rst:61 +msgid "The connection proceeds asynchronously, in the background." +msgstr "连接在后台异步进行。" + +#: ../../library/network.PPP.rst:65 +msgid "" +"Terminate the connection. This must be called to cleanly close the PPP " +"connection." +msgstr "终止连接。必须调用此方法才能干净地关闭 PPP 连接。" + +#: ../../library/network.PPP.rst:69 +msgid "" +"Returns ``True`` if the PPP link is connected and up. Returns ``False`` " +"otherwise." +msgstr "如果 PPP 链接已连接并运行,则返回 ``True``。否则返回 ``False``。" + +#: ../../library/network.PPP.rst:74 +msgid "Returns the PPP status." +msgstr "返回 PPP 状态。" + +#: ../../library/network.PPP.rst:78 +msgid "" +"Sets or gets parameters of the PPP interface. The only parameter that can" +" be retrieved and set is the underlying stream, using::" +msgstr "设置或获取 PPP 接口的参数。唯一可以获取和设置的参数是底层流,使用方式如下::" + +#: ../../library/network.PPP.rst:87 +msgid "See `AbstractNIC.ipconfig`." +msgstr "参见 `AbstractNIC.ipconfig`。" + +#: ../../library/network.PPP.rst:91 +msgid "See `AbstractNIC.ifconfig`." +msgstr "参见 `AbstractNIC.ifconfig`。" + +#: ../../library/network.PPP.rst:95 +msgid "" +"Poll the underlying stream for data, and pass it up the PPP stack. This " +"is called automatically if the stream is a UART with a RXIDLE interrupt, " +"so it's not usually necessary to call it manually." +msgstr "轮询底层流以获取数据,并将其传递到 PPP 协议栈。如果流是具有 RXIDLE 中断的 UART,则会自动调用此方法,因此通常不需要手动调用。" + +#: ../../library/network.PPP.rst:100 +msgid "Constants" +msgstr "常量" + +#: ../../library/network.PPP.rst:106 +msgid "The type of connection security." +msgstr "连接安全类型。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/network.WINC.po b/docs/locale/zh_CN/LC_MESSAGES/library/network.WINC.po new file mode 100644 index 0000000000000..f89e65f5d3f40 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/network.WINC.po @@ -0,0 +1,362 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/network.WINC.rst:5 +msgid "class WINC -- wifi shield driver" +msgstr "class WINC -- wifi shield 驱动器" + +#: ../../library/network.WINC.rst:7 +msgid "The ``WINC`` class is used for controlling the wifi shield." +msgstr "``WINC`` 类用于控制 wifi shield。" + +#: ../../library/network.WINC.rst:9 ../../library/network.WINC.rst:122 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/network.WINC.rst:19 +msgid "Constructors" +msgstr "构造" + +#: ../../library/network.WINC.rst:23 +msgid "" +"Creates a winc driver object and connects to the wifi shield which uses " +"I/O pins P0, P1, P2, P3, P6, P7, and P8." +msgstr "创建一个 WINC 驱动器对象并连接到使用 I/O pins P0, P1, P2, P3, P6, P7 和 P8 的 wifi shield。" + +#: ../../library/network.WINC.rst:26 +msgid "``mode`` controls the mode the WINC module works in:" +msgstr "``mode`` 控制 WINC 模块的工作模式:" + +#: ../../library/network.WINC.rst:28 +msgid "network.WINC.MODE_STATION" +msgstr "network.WINC.MODE_STATION" + +#: ../../library/network.WINC.rst:30 +msgid "" +"The module connects to an access point as a client. This is the default " +"mode." +msgstr "该模块以客户端的方式连接到接入点。这是默认模式。" + +#: ../../library/network.WINC.rst:32 +msgid "network.WINC.MODE_AP" +msgstr "network.WINC.MODE_AP" + +#: ../../library/network.WINC.rst:34 +msgid "" +"The module will create an AP (Access Point) and accept connections from a" +" client." +msgstr "该模块将创建一个 AP (接入点) 并接受来自客户端的连接。" + +#: ../../library/network.WINC.rst:38 +msgid "" +"The start_ap() method must be called after setting AP mode to configure " +"the AP." +msgstr "在设置 AP 模式后,必须调用 start_ap() 方法来配置 AP。" + +#: ../../library/network.WINC.rst:40 +msgid "Also, the WINC1500 has some limitations in its AP implementation:" +msgstr "此外,WINC1500 在其 AP 实现中存在一些限制:" + +#: ../../library/network.WINC.rst:42 +msgid "Only one client can connect at a time." +msgstr "一次只能连接一个客户端。" + +#: ../../library/network.WINC.rst:43 +msgid "Only OPEN or WEP security are supported." +msgstr "仅支持 OPEN 或 WEP 安全性。" + +#: ../../library/network.WINC.rst:44 +msgid "" +"There's a bug in the WiFi Module FW, when the client disconnects any " +"bound sockets are lost (they just stop working). As a workaround, set a " +"timeout for the server socket to force it to raise an exception and then " +"reopen it (See the example script)." +msgstr "" +"在 WiFi 模块 FW 中存在一个 " +"bug,当客户端断开连接时,任何已绑定的套接字都会丢失(它们停止工作)。作为解决方法,为服务器套接字设置超时以强制其引发异常,然后重新打开它(参见示例脚本)。" + +#: ../../library/network.WINC.rst:46 +msgid "network.WINC.MODE_FIRMWARE:" +msgstr "network.WINC.MODE_FIRMWARE:" + +#: ../../library/network.WINC.rst:48 +msgid "This mode enables WiFi module firmware update." +msgstr "此模式启用 WiFi 模块固件更新。" + +#: ../../library/network.WINC.rst:52 +msgid "" +"``mode`` can also be ``network.STA_IF`` (station aka client, connects to " +"upstream WiFi access points) and and ``network.AP_IF`` (access point, " +"allows other WiFi clients to connect). Availability of the methods below " +"depends on interface type. For example, only STA interface may " +"`WLAN.connect()` to an access point." +msgstr "" +"``mode`` 也可以是 ``network.STA_IF`` (即站点或客户端,连接到上游 WiFi 接入点)和 " +"``network.AP_IF`` (接入点,允许其他 WiFi 客户端连接)。下面的方法的可用性取决于接口类型。例如,只有 STA 接口可以 " +"`WLAN.connect()` 到一个接入点。" + +#: ../../library/network.WINC.rst:58 +msgid "Methods" +msgstr "方法" + +#: ../../library/network.WINC.rst:62 +msgid "" +"Activate (\"up\") or deactivate (\"down\") network interface, if boolean " +"argument is passed. Otherwise, query current state if no argument is " +"provided. Most other methods require active interface." +msgstr "如果传递布尔参数,则激活(“up”)或停用(“down”)网络接口。否则,在未提供参数的情况下查询当前状态。大多数其他方法都需要激活接口。" + +#: ../../library/network.WINC.rst:68 +msgid "" +"Connect to a wifi network with ssid ``ssid`` using key ``key`` with " +"security ``security`` and channel ``channel``." +msgstr "使用 ssid ``ssid``,密钥 ``key``,安全性 ``security`` 和信道 ``channel`` 连接到 wifi 网络。" + +#: ../../library/network.WINC.rst:71 +msgid "" +"After connecting to the network use the :mod:`usocket` module to open " +"TCP/UDP ports to send and receive data." +msgstr "连接到网络后,使用 :mod:`usocket` 模块打开 TCP/UDP 端口以发送和接收数据。" + +#: ../../library/network.WINC.rst:76 +msgid "This method takes a little while to return." +msgstr "此方法需要一点时间才能返回。" + +#: ../../library/network.WINC.rst:80 +msgid "" +"When running in AP mode this method must be called after creating a WINC " +"object to configure and start the AP ." +msgstr "在 AP 模式下运行时,必须在创建 WINC 对象后调用此方法来配置和启动 AP。" + +#: ../../library/network.WINC.rst:83 +msgid "ssid: The AP SSID (must be set)." +msgstr "ssid: AP 的 SSID(必须设置)。" + +#: ../../library/network.WINC.rst:84 +msgid "key: The AP encryption key. A Key is required only if security is WEP." +msgstr "key: AP 加密密钥。仅当安全性为 WEP 时需要密钥。" + +#: ../../library/network.WINC.rst:85 +msgid "security: AP security mode (only OPEN or WEP are supported)." +msgstr "security: AP 安全模式(仅支持 OPEN 或 WEP)。" + +#: ../../library/network.WINC.rst:86 +msgid "" +"channel: WiFi channel, change this if you have another AP running at the " +"same channel." +msgstr "channel: WiFi 信道,如果同一信道上有另一个 AP 运行,则更改此信道。" + +#: ../../library/network.WINC.rst:90 +msgid "Disconnect from the wifi network." +msgstr "从 wifi 网络断开连接。" + +#: ../../library/network.WINC.rst:94 +msgid "" +"Returns True if connected to an access point and an IP address has been " +"obtained." +msgstr "如果连接到接入点并获得了 IP 地址,则返回 True。" + +#: ../../library/network.WINC.rst:99 +msgid "This method returns a list containing the connected client's IP adress." +msgstr "此方法返回一个包含连接客户端 IP 地址的列表。" + +#: ../../library/network.WINC.rst:103 +msgid "" +"This method blocks and waits for a client to connect. If timeout is 0 " +"this will block forever. This method returns a list containing the " +"connected client's IP adress." +msgstr "此方法会阻塞并等待客户端连接。如果超时值为 0,则会一直阻塞。此方法返回一个包含连接客户端 IP 地址的列表。" + +#: ../../library/network.WINC.rst:109 ../../library/network.WINC.rst:130 +msgid "Returns a tuple containing:" +msgstr "返回一个元组,其中包含:" + +#: ../../library/network.WINC.rst:111 +msgid "[0]: IP Address String (XXX.XXX.XXX.XXX)" +msgstr "[0]: IP 地址字符串(XXX.XXX.XXX.XXX)" + +#: ../../library/network.WINC.rst:112 +msgid "[1]: Subnet Address String (XXX.XXX.XXX.XXX)" +msgstr "[1]: 子网地址字符串(XXX.XXX.XXX.XXX)" + +#: ../../library/network.WINC.rst:113 +msgid "[2]: Gateway String (XXX.XXX.XXX.XXX)" +msgstr "[2]: 网关字符串(XXX.XXX.XXX.XXX)" + +#: ../../library/network.WINC.rst:114 +msgid "[3]: DNS Address String (XXX.XXX.XXX.XXX)" +msgstr "[3]: DNS 地址字符串(XXX.XXX.XXX.XXX)" + +#: ../../library/network.WINC.rst:116 ../../library/network.WINC.rst:138 +msgid "While connected to the network." +msgstr "在连接到网络时。" + +#: ../../library/network.WINC.rst:118 +msgid "" +"You may optionally pass a tuple/list of the ip_addr, subnet_addr, " +"gateway_addr, and dns_addr strings in ipv4 (XXX.XXX.XXX.XXX) format to " +"set a static IP address versus an address obtained through DHCP (which " +"happens by default)." +msgstr "" +"您可以选择传递一个元组/列表,其中包含以 IPv4 格式(XXX.XXX.XXX.XXX)的 " +"ip_addr、subnet_addr、gateway_addr 和 dns_addr 字符串,以设置静态 IP 地址,而不是通过 DHCP " +"获取地址(默认情况下发生)。" + +#: ../../library/network.WINC.rst:132 +msgid "[0]: RSSI - received signal strength indicator (int)" +msgstr "[0]: RSSI - 接收信号强度指示器(int)" + +#: ../../library/network.WINC.rst:133 +msgid "[1]: Authorization Type (see constants)" +msgstr "[1]: 授权类型(见常量)" + +#: ../../library/network.WINC.rst:134 +msgid "[2]: Set Service Identifier String (SSID)" +msgstr "[2]: 设置服务标识符字符串(SSID)" + +#: ../../library/network.WINC.rst:135 +msgid "[3]: MAC Address String (XX:XX:XX:XX:XX:XX) (BSSID)" +msgstr "[3]: MAC 地址字符串(XX:XX:XX:XX:XX:XX)(BSSID)" + +#: ../../library/network.WINC.rst:136 +msgid "[4]: IP Address String (XXX.XXX.XXX.XXX)" +msgstr "[4]: IP 地址字符串(XXX.XXX.XXX.XXX)" + +#: ../../library/network.WINC.rst:142 +msgid "Returns a list containing:" +msgstr "返回一个列表,其中包含:" + +#: ../../library/network.WINC.rst:144 +msgid "[0]: Set Service Identifier String (SSID)" +msgstr "[0]: 设置服务标识符字符串(SSID)" + +#: ../../library/network.WINC.rst:145 +msgid "[1]: MAC Address String (XX:XX:XX:XX:XX:XX) (BSSID)" +msgstr "[1]: MAC 地址字符串(XX:XX:XX:XX:XX:XX)(BSSID)" + +#: ../../library/network.WINC.rst:146 +msgid "[2]: Channel Number (int)" +msgstr "[2]: 信道号(int)" + +#: ../../library/network.WINC.rst:147 +msgid "[3]: RSSI - received signal strength indicator (int)" +msgstr "[3]: RSSI - 接收信号强度指示器(int)" + +#: ../../library/network.WINC.rst:148 +msgid "[4]: Authorization Type (see constants)" +msgstr "[4]: 授权类型(见常量)" + +#: ../../library/network.WINC.rst:149 +msgid "[5]: 1 (int)" +msgstr "[5]: 1(int)" + +#: ../../library/network.WINC.rst:151 +msgid "You don't need to be connected to call this." +msgstr "您无需连接即可调用此方法。" + +#: ../../library/network.WINC.rst:155 +msgid "" +"Returns the received signal strength indicator (int) of the currently " +"connected network." +msgstr "返回当前连接网络的接收信号强度指示器(int)。" + +#: ../../library/network.WINC.rst:160 +msgid "Returns a tuple containing the wifi shield firmware version number." +msgstr "返回一个元组,其中包含 wifi shield 固件版本号。" + +#: ../../library/network.WINC.rst:162 +msgid "[0]: Firmware Major Version Number (int)" +msgstr "[0]: 固件主要版本号(int)" + +#: ../../library/network.WINC.rst:163 +msgid "[1]: Firmware Minor Version Number (int)" +msgstr "[1]: 固件次要版本号(int)" + +#: ../../library/network.WINC.rst:164 +msgid "[2]: Firmware Patch Version Number (int)" +msgstr "[2]: 固件补丁版本号(int)" + +#: ../../library/network.WINC.rst:165 +msgid "[3]: Driver Major Version Number (int)" +msgstr "[3]: 驱动程序主要版本号(int)" + +#: ../../library/network.WINC.rst:166 +msgid "[4]: Driver Minor Version Number (int)" +msgstr "[4]: 驱动程序次要版本号(int)" + +#: ../../library/network.WINC.rst:167 +msgid "[5]: Driver Patch Version Number (int)" +msgstr "[5]: 驱动程序补丁版本号(int)" + +#: ../../library/network.WINC.rst:168 +msgid "[6]: Hardware Revision Number - Chip ID (int)" +msgstr "[6]: 硬件修订号 - 芯片 ID(int)" + +#: ../../library/network.WINC.rst:172 +msgid "" +"Dumps the wifi shield firmware to a binary file at ``path``. You must " +"have put the module into firmware mode to use this." +msgstr "将 wifi shield 固件转储到位于 ``path`` 处的二进制文件。您必须将模块放入固件模式才能使用此功能。" + +#: ../../library/network.WINC.rst:177 +msgid "" +"Programs the wifi shield with binary image found at ``path``. You must " +"have put the module into firmware mode to use this." +msgstr "使用在 ``path`` 处找到的二进制图像对 wifi shield 进行编程。您必须将模块放入固件模式才能使用此功能。" + +#: ../../library/network.WINC.rst:181 +msgid "Constants" +msgstr "常量" + +#: ../../library/network.WINC.rst:185 +msgid "For connecting to an open wifi network." +msgstr "用于连接到开放的 wifi 网络。" + +#: ../../library/network.WINC.rst:189 +msgid "For connecting to a WPA/PSK based password protected network." +msgstr "用于连接到基于 WPA/PSK 的密码保护网络。" + +#: ../../library/network.WINC.rst:193 +msgid "Network is secured with WPA/WPA2 Enterprise." +msgstr "网络受到 WPA/WPA2 企业级保护。" + +#: ../../library/network.WINC.rst:197 +msgid "Start in station mode (i.e. connect to a network)." +msgstr "以站点模式启动(即连接到网络)。" + +#: ../../library/network.WINC.rst:201 +msgid "Start in access point mode (i.e. become the network)." +msgstr "以接入点模式启动(即成为网络)。" + +#: ../../library/network.WINC.rst:205 +msgid "Start in wifi-direct mode." +msgstr "以 wifi-direct 模式启动。" + +#: ../../library/network.WINC.rst:209 +msgid "Init BSP." +msgstr "初始化 BSP。" + +#: ../../library/network.WINC.rst:213 +msgid "Setup in firmware update mode." +msgstr "设置固件更新模式。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/network.WLAN.po b/docs/locale/zh_CN/LC_MESSAGES/library/network.WLAN.po new file mode 100644 index 0000000000000..3a939d8315a86 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/network.WLAN.po @@ -0,0 +1,360 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/network.WLAN.rst:5 +msgid "class WLAN -- control built-in WiFi interfaces" +msgstr "class WLAN -- 控制内置 WiFi 接口" + +#: ../../library/network.WLAN.rst:7 +msgid "This class provides a driver for WiFi network processors. Example usage::" +msgstr "此类提供了 WiFi 网络处理器的驱动程序。示例用法::" + +#: ../../library/network.WLAN.rst:17 +msgid "Constructors" +msgstr "构造" + +#: ../../library/network.WLAN.rst:20 +msgid "" +"Create a WLAN network interface object. Supported interfaces are " +"``network.WLAN.IF_STA`` (station aka client, connects to upstream WiFi " +"access points) and ``network.WLAN.IF_AP`` (access point, allows other " +"WiFi clients to connect). Availability of the methods below depends on " +"interface type. For example, only STA interface may `WLAN.connect()` to " +"an access point." +msgstr "" +"创建 WLAN 网络接口对象。支持的接口有 ``network.WLAN.IF_STA`` (站点,即客户端,连接到上游 WiFi 接入点)和 " +"``network.WLAN.IF_AP`` (访问点,允许其他 WiFi 客户端连接)。下面的方法的可用性取决于接口类型。例如,只有 STA 接口可以 " +"`WLAN.connect()` 到一个接入点。" + +#: ../../library/network.WLAN.rst:27 +msgid "Methods" +msgstr "方法" + +#: ../../library/network.WLAN.rst:31 +msgid "" +"Activate (\"up\") or deactivate (\"down\") network interface, if boolean " +"argument is passed. Otherwise, query current state if no argument is " +"provided. Most other methods require active interface." +msgstr "如果传递布尔参数,则激活(“up”)或停用(“down”)网络接口。否则,在未提供参数的情况下查询当前状态。大多数其他方法都需要激活接口。" + +#: ../../library/network.WLAN.rst:37 +msgid "" +"Connect to the specified wireless network, using the specified key. If " +"*bssid* is given then the connection will be restricted to the access-" +"point with that MAC address (the *ssid* must also be specified in this " +"case)." +msgstr "" +"使用指定的密钥连接到指定的无线网络。如果提供了 *bssid* ,则连接将限制在具有该 MAC 地址的接入点(在这种情况下 *ssid* " +"也必须被指定)。" + +#: ../../library/network.WLAN.rst:44 +msgid "Disconnect from the currently connected wireless network." +msgstr "断开当前连接的无线网络。" + +#: ../../library/network.WLAN.rst:48 +msgid "" +"Scan for the available wireless networks. Hidden networks -- where the " +"SSID is not broadcast -- will also be scanned if the WLAN interface " +"allows it." +msgstr "扫描可用的无线网络。如果 WLAN 接口允许,还将扫描隐藏网络(SSID 不广播)。" + +#: ../../library/network.WLAN.rst:52 +msgid "" +"Scanning is only possible on STA interface. Returns list of tuples with " +"the information about WiFi access points:" +msgstr "只有在 STA 接口上扫描是可能的。返回一个包含 WiFi 接入点信息的元组列表:" + +#: ../../library/network.WLAN.rst:55 +msgid "(ssid, bssid, channel, RSSI, security, hidden)" +msgstr "(ssid、bssid、通道、RSSI、安全性、隐藏)" + +#: ../../library/network.WLAN.rst:57 +msgid "" +"*bssid* is hardware address of an access point, in binary form, returned " +"as bytes object. You can use `binascii.hexlify()` to convert it to ASCII " +"form." +msgstr "" +"*bssid* 是一个接入点的硬件地址,以二进制形式返回,作为字节对象。您可以使用 `binascii.hexlify()` 将其转换为 " +"ASCII 形式。" + +#: ../../library/network.WLAN.rst:60 +msgid "There are five values for security:" +msgstr "安全性有五个值:" + +#: ../../library/network.WLAN.rst:62 +msgid "0 -- open" +msgstr "0 -- open" + +#: ../../library/network.WLAN.rst:63 +msgid "1 -- WEP" +msgstr "1 -- WEP" + +#: ../../library/network.WLAN.rst:64 +msgid "2 -- WPA-PSK" +msgstr "2 -- WPA-PSK" + +#: ../../library/network.WLAN.rst:65 +msgid "3 -- WPA2-PSK" +msgstr "3 -- WPA2-PSK" + +#: ../../library/network.WLAN.rst:66 +msgid "4 -- WPA/WPA2-PSK" +msgstr "4 -- WPA/WPA2-PSK" + +#: ../../library/network.WLAN.rst:68 +msgid "and two for hidden:" +msgstr "两个值用于隐藏:" + +#: ../../library/network.WLAN.rst:70 +msgid "0 -- visible" +msgstr "0 -- visible" + +#: ../../library/network.WLAN.rst:71 +msgid "1 -- hidden" +msgstr "1 -- hidden" + +#: ../../library/network.WLAN.rst:75 +msgid "Return the current status of the wireless connection." +msgstr "返回无线连接的当前状态。" + +#: ../../library/network.WLAN.rst:77 +msgid "" +"When called with no argument the return value describes the network link " +"status. The possible statuses are defined as constants in the " +":mod:`network` module:" +msgstr "不带参数调用时,返回值描述了网络链接状态。可能的状态定义为 :mod:`network` 模块中的常量:" + +#: ../../library/network.WLAN.rst:80 +msgid "``STAT_IDLE`` -- no connection and no activity," +msgstr "``STAT_IDLE`` -- 无连接和无活动," + +#: ../../library/network.WLAN.rst:81 +msgid "``STAT_CONNECTING`` -- connecting in progress," +msgstr "``STAT_CONNECTING`` -- 连接中," + +#: ../../library/network.WLAN.rst:82 +msgid "``STAT_WRONG_PASSWORD`` -- failed due to incorrect password," +msgstr "``STAT_WRONG_PASSWORD`` -- 因密码错误而失败," + +#: ../../library/network.WLAN.rst:83 +msgid "``STAT_NO_AP_FOUND`` -- failed because no access point replied," +msgstr "``STAT_NO_AP_FOUND`` -- 由于没有接入点回复而失败," + +#: ../../library/network.WLAN.rst:84 +msgid "``STAT_CONNECT_FAIL`` -- failed due to other problems," +msgstr "``STAT_CONNECT_FAIL`` -- 由于其他问题而失败," + +#: ../../library/network.WLAN.rst:85 +msgid "``STAT_GOT_IP`` -- connection successful." +msgstr "``STAT_GOT_IP`` -- 连接成功。" + +#: ../../library/network.WLAN.rst:87 +msgid "" +"When called with one argument *param* should be a string naming the " +"status parameter to retrieve, and different parameters are supported " +"depending on the mode the WiFi is in." +msgstr "" +"带有一个参数 *param* 调用时,*param* 应为一个字符串,命名为要检索的状态参数。根据 WiFi " +"所处的模式不同,支持不同的参数。" + +#: ../../library/network.WLAN.rst:91 +msgid "" +"In STA mode, passing ``'rssi'`` returns a signal strength indicator " +"value, whose format varies depending on the port (this is available on " +"all ports that support WiFi network interfaces, except for CC3200)." +msgstr "" +"在 STA 模式下,传入 ``'rssi'`` 返回信号强度指示值," +"其格式因端口而异(除 CC3200 外,所有支持 WiFi 网络接口的端口均可用)。" + +#: ../../library/network.WLAN.rst:95 +msgid "" +"In AP mode, passing ``'stations'`` returns a list of connected WiFi " +"stations (this is available on all ports that support WiFi network " +"interfaces, except for CC3200). The format of the station information " +"entries varies across ports, providing either the raw BSSID of the " +"connected station, the IP address of the connected station, or both." +msgstr "" +"在 AP 模式下,传入 ``'stations'`` 返回已连接的 WiFi " +"站点列表(除 CC3200 外,所有支持 WiFi 网络接口的端口均可用)。" +"站点信息条目的格式因端口而异,提供已连接站点的原始 BSSID、IP 地址或两者。" + +#: ../../library/network.WLAN.rst:103 +msgid "" +"In case of STA mode, returns ``True`` if connected to a WiFi access point" +" and has a valid IP address. In AP mode returns ``True`` when a station " +"is connected. Returns ``False`` otherwise." +msgstr "" +"在 STA 模式下,如果连接到 WiFi 接入点并且具有有效的 IP 地址,则返回 ``True``。在 AP 模式下,当有台设备连接时返回 " +"``True``。否则返回 ``False``。" + +#: ../../library/network.WLAN.rst:109 +msgid "" +"Get/set IP-level network interface parameters: IP address, subnet mask, " +"gateway and DNS server. When called with no arguments, this method " +"returns a 4-tuple with the above information. To set the above values, " +"pass a 4-tuple with the required information. For example::" +msgstr "" +"获取/设置 IP 级网络接口参数:IP 地址、子网掩码、网关和 DNS 服务器。当不带参数调用时,此方法返回包含上述信息的 4 " +"元组。要设置上述值,请传递包含所需信息的 4 元组。例如::" + +#: ../../library/network.WLAN.rst:119 +msgid "" +"Get or set general network interface parameters. These methods allow to " +"work with additional parameters beyond standard IP configuration (as " +"dealt with by `AbstractNIC.ipconfig()`). These include network-specific " +"and hardware-specific parameters. For setting parameters, keyword " +"argument syntax should be used, multiple parameters can be set at once. " +"For querying, parameters name should be quoted as a string, and only one " +"parameter can be queries at time::" +msgstr "" +"获取或设置通用网络接口参数。这些方法允许处理标准 IP 配置之外的附加参数(由 `AbstractNIC.ipconfig()` " +"处理)。这些参数包括网络特定和硬件特定参数。对于设置参数,应使用关键字参数语法,可以一次设置多个参数。对于查询,参数名应作为字符串引用,并且一次只能查询一个参数::" + +#: ../../library/network.WLAN.rst:132 +msgid "" +"Following are commonly supported parameters (availability of a specific " +"parameter depends on network technology type, driver, and " +":term:`MicroPython port`)." +msgstr "以下是常见支持的参数(特定参数的可用性取决于网络技术类型、驱动程序和 :term:`MicroPython port`)。" + +#: ../../library/network.WLAN.rst:136 +msgid "Parameter" +msgstr "参数" + +#: ../../library/network.WLAN.rst:136 +msgid "Description" +msgstr "描述" + +#: ../../library/network.WLAN.rst:138 +msgid "mac" +msgstr "mac" + +#: ../../library/network.WLAN.rst:138 +msgid "MAC address (bytes)" +msgstr "MAC地址(字节)" + +#: ../../library/network.WLAN.rst:139 +msgid "ssid" +msgstr "ssid" + +#: ../../library/network.WLAN.rst:139 +msgid "WiFi access point name (string)" +msgstr "WiFi接入点名称(字符串)" + +#: ../../library/network.WLAN.rst:140 +msgid "channel" +msgstr "通道" + +#: ../../library/network.WLAN.rst:140 +msgid "" +"WiFi channel (integer). Depending on the port this may only be supported " +"on the AP interface." +msgstr "WiFi 信道(整数)。根据端口不同,此参数可能仅在 AP 接口上受支持。" + +#: ../../library/network.WLAN.rst:141 +msgid "hidden" +msgstr "隐藏" + +#: ../../library/network.WLAN.rst:141 +msgid "Whether SSID is hidden (boolean)" +msgstr "SSID 是否隐藏(布尔值)" + +#: ../../library/network.WLAN.rst:142 +msgid "security" +msgstr "安全" + +#: ../../library/network.WLAN.rst:142 +msgid "Security protocol supported (enumeration, see module constants)" +msgstr "支持的安全协议(枚举,见模块常量)" + +#: ../../library/network.WLAN.rst:143 +msgid "key" +msgstr "键" + +#: ../../library/network.WLAN.rst:143 +msgid "Access key (string)" +msgstr "访问密钥(字符串)" + +#: ../../library/network.WLAN.rst:144 +msgid "hostname" +msgstr "hostname" + +#: ../../library/network.WLAN.rst:144 +msgid "" +"The hostname that will be sent to DHCP (STA interfaces) and mDNS (if " +"supported, both STA and AP). (Deprecated, use :func:`network.hostname` " +"instead)" +msgstr "" +"将发送到 DHCP(STA 接口)和 mDNS(如果支持,STA 和 AP)的主机名。(已弃用,改用 " +":func:`network.hostname`)" + +#: ../../library/network.WLAN.rst:145 +msgid "reconnects" +msgstr "重新连接" + +#: ../../library/network.WLAN.rst:145 +msgid "Number of reconnect attempts to make (integer, 0=none, -1=unlimited)" +msgstr "尝试重新连接的次数(整数,0=无,-1=无限)" + +#: ../../library/network.WLAN.rst:146 +msgid "txpower" +msgstr "发射功率" + +#: ../../library/network.WLAN.rst:146 +msgid "Maximum transmit power in dBm (integer or float)" +msgstr "最大发射功率 dBm(整数或浮点数)" + +#: ../../library/network.WLAN.rst:147 +msgid "pm" +msgstr "pm" + +#: ../../library/network.WLAN.rst:147 +msgid "WiFi Power Management setting (see below for allowed values)" +msgstr "WiFi 电源管理设置(允许的值见下文)" + +#: ../../library/network.WLAN.rst:151 +msgid "Constants" +msgstr "常量" + +#: ../../library/network.WLAN.rst:157 +msgid "" +"Allowed values for the ``WLAN.config(pm=...)`` network interface " +"parameter:" +msgstr "``WLAN.config(pm=...)`` 网络接口参数的允许值:" + +#: ../../library/network.WLAN.rst:159 +msgid "" +"``PM_PERFORMANCE``: enable WiFi power management to balance power savings" +" and WiFi performance" +msgstr "``PM_PERFORMANCE``: 启用 WiFi 电源管理以平衡功耗节约和 WiFi 性能" + +#: ../../library/network.WLAN.rst:161 +msgid "" +"``PM_POWERSAVE``: enable WiFi power management with additional power " +"savings and reduced WiFi performance" +msgstr "``PM_POWERSAVE``: 启用 WiFi 电源管理,额外节约电量并降低 WiFi 性能" + +#: ../../library/network.WLAN.rst:163 +msgid "``PM_NONE``: disable wifi power management" +msgstr "``PM_NONE``: 禁用 WiFi 电源管理" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/network.po b/docs/locale/zh_CN/LC_MESSAGES/library/network.po new file mode 100644 index 0000000000000..3986ed8273916 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/network.po @@ -0,0 +1,395 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/network.rst:3 +msgid ":mod:`network` --- network configuration" +msgstr ":mod:`network` --- 网络配置" + +#: ../../library/network.rst:8 +msgid "" +"This module provides network drivers and routing configuration. To use " +"this module, a MicroPython variant/build with network capabilities must " +"be installed. Network drivers for specific hardware are available within " +"this module and are used to configure hardware network interface(s). " +"Network services provided by configured interfaces are then available for" +" use via the :mod:`socket` module." +msgstr "" +"本模块提供了网络驱动程序和路由配置。要使用此模块,必须安装带有网络功能的 MicroPython " +"变体/构建。特定硬件的网络驱动程序位于此模块中,并用于配置硬件网络接口。通过配置的接口提供的网络服务可以通过 :mod:`socket` " +"模块进行使用。" + +#: ../../library/network.rst:15 +msgid "For example::" +msgstr "举例::" + +#: ../../library/network.rst:39 +msgid "Common network adapter interface" +msgstr "常见网络适配器接口" + +#: ../../library/network.rst:41 +msgid "" +"This section describes an (implied) abstract base class for all network " +"interface classes implemented by :term:`MicroPython ports ` for different hardware. This means that MicroPython does not " +"actually provide ``AbstractNIC`` class, but any actual NIC class, as " +"described in the following sections, implements methods as described " +"here." +msgstr "" +"本节描述了由 :term:`MicroPython ports ` " +"实现的所有网络接口类的(隐式)抽象基类。这意味着 MicroPython实际上并不提供 ``AbstractNIC`` 类,而是任何实际的 NIC " +"类,如以下各节中所述,都会实现此处描述的方法。" + +#: ../../library/network.rst:49 +msgid "" +"Instantiate a network interface object. Parameters are network interface " +"dependent. If there are more than one interface of the same type, the " +"first parameter should be `id`." +msgstr "实例化网络接口对象。参数取决于网络接口。如果有多个相同类型的接口,则第一个参数应为 `id`。" + +#: ../../library/network.rst:55 +msgid "" +"Activate (\"up\") or deactivate (\"down\") the network interface, if a " +"boolean argument is passed. Otherwise, query current state if no argument" +" is provided. Most other methods require an active interface (behaviour " +"of calling them on inactive interface is undefined)." +msgstr "" +"激活 (\"up\") 或停用 (\"down\") " +"网络接口,如果传递了布尔参数。否则,如果未提供参数,则查询当前状态。大多数其他方法都需要活动接口(在非活动接口上调用它们的行为是未定义的)。" + +#: ../../library/network.rst:63 +msgid "" +"Connect the interface to a network. This method is optional, and " +"available only for interfaces which are not \"always connected\". If no " +"parameters are given, connect to the default (or the only) service. If a " +"single parameter is given, it is the primary identifier of a service to " +"connect to. It may be accompanied by a key (password) required to access " +"said service. There can be further arbitrary keyword-only parameters, " +"depending on the networking medium type and/or particular device. " +"Parameters can be used to: a) specify alternative service identifier " +"types; b) provide additional connection parameters. For various medium " +"types, there are different sets of predefined/recommended parameters, " +"among them:" +msgstr "" +"将接口连接到网络。此方法是可选的,仅适用于不是 \"始终连接\" " +"的接口。如果没有给出参数,则连接到默认(或唯一)服务。如果给定单个参数,则它是要连接的服务的主要标识符。它可能需要与访问所述服务所需的密码。还可以有进一步的任意关键字参数,这取决于网络介质类型和/或特定设备。参数可用于:a)指定替代服务标识符类型;b)提供附加的连接参数。对于各种介质类型,有不同的预定义/推荐参数集,其中包括:" + +#: ../../library/network.rst:75 +msgid "WiFi: *bssid* keyword to connect to a specific BSSID (MAC address)" +msgstr "* WiFi: *bssid* 关键字以连接到特定的 BSSID(MAC 地址)" + +#: ../../library/network.rst:79 +msgid "Disconnect from network." +msgstr "断开网络连接。" + +#: ../../library/network.rst:83 +msgid "Returns ``True`` if connected to network, otherwise returns ``False``." +msgstr "如果连接到网络,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/network.rst:87 +msgid "" +"Scan for the available network services/connections. Returns a list of " +"tuples with discovered service parameters. For various network media, " +"there are different variants of predefined/ recommended tuple formats, " +"among them:" +msgstr "扫描可用的网络服务/连接。返回发现的服务参数的元组列表。对于各种网络媒体,有不同的预定义/推荐元组格式变体,其中包括:" + +#: ../../library/network.rst:92 +msgid "" +"WiFi: (ssid, bssid, channel, RSSI, security, hidden). There may be " +"further fields, specific to a particular device." +msgstr "WiFi: (ssid, bssid, channel, RSSI, security, hidden)。还可能有其他字段,特定于特定设备。" + +#: ../../library/network.rst:95 +msgid "" +"The function may accept additional keyword arguments to filter scan " +"results (e.g. scan for a particular service, on a particular channel, for" +" services of a particular set, etc.), and to affect scan duration and " +"other parameters. Where possible, parameter names should match those in " +"connect()." +msgstr "" +"该函数可能接受其他关键字参数以过滤扫描结果(例如,扫描特定服务、特定信道上的服务、特定集合的服务等),并影响扫描持续时间和其他参数。在可能的情况下,参数名称应与" +" connect() 中的参数名称匹配。" + +#: ../../library/network.rst:103 +msgid "" +"Query dynamic status information of the interface. When called with no " +"argument the return value describes the network link status. Otherwise " +"*param* should be a string naming the particular status parameter to " +"retrieve." +msgstr "查询接口的动态状态信息。当不带参数调用时,返回值描述网络链接状态。否则,*param* 应该是命名要检索的特定状态参数的字符串。" + +#: ../../library/network.rst:108 +msgid "" +"The return types and values are dependent on the network " +"medium/technology. Some of the parameters that may be supported are:" +msgstr "返回类型和值取决于网络媒体/技术。可能支持的一些参数包括:" + +#: ../../library/network.rst:111 +msgid "WiFi STA: use ``'rssi'`` to retrieve the RSSI of the AP signal" +msgstr "WiFi STA: 使用 ``'rssi'`` 检索 AP 信号的 RSSI" + +#: ../../library/network.rst:112 +msgid "" +"WiFi AP: use ``'stations'`` to retrieve a list of all the STAs connected " +"to the AP. The list contains tuples of the form (MAC, RSSI)." +msgstr "WiFi AP: 使用 ``'stations'`` 检索连接到 AP 的所有 STA 的列表。该列表包含形式为 (MAC、RSSI) 的元组。" + +#: ../../library/network.rst:119 +msgid "" +"Get or set interface-specific IP-configuration interface parameters. " +"Supported parameters are the following (availability of a particular " +"parameter depends on the port and the specific network interface):" +msgstr "获取或设置特定于接口的 IP 配置接口参数。支持的参数如下(特定参数的可用性取决于移植版本和具体的网络接口):" + +#: ../../library/network.rst:123 +msgid "" +"``dhcp4`` (``True/False``) obtain an IPv4 address, gateway and dns server" +" via DHCP. This method does not block and wait for an address to be " +"obtained. To check if an address was obtained, use the read-only property" +" ``has_dhcp4``." +msgstr "``dhcp4`` (``True/False``) 通过 DHCP 获取 IPv4 地址、网关和 DNS 服务器。此方法不会阻塞等待地址获取。要检查是否已获取地址,请使用只读属性 ``has_dhcp4``。" + +#: ../../library/network.rst:127 +msgid "``gw4`` Get/set the IPv4 default-gateway." +msgstr "``gw4`` 获取/设置 IPv4 默认网关。" + +#: ../../library/network.rst:128 +msgid "" +"``dhcp6`` (``True/False``) obtain a DNS server via stateless DHCPv6. " +"Obtaining IP Addresses via DHCPv6 is currently not implemented." +msgstr "``dhcp6`` (``True/False``) 通过无状态 DHCPv6 获取 DNS 服务器。目前尚未实现通过 DHCPv6 获取 IP 地址。" + +#: ../../library/network.rst:130 +msgid "" +"``autoconf6`` (``True/False``) obtain a stateless IPv6 address via the " +"network prefix shared in router advertisements. To check if a stateless " +"address was obtained, use the read-only property ``has_autoconf6``." +msgstr "``autoconf6`` (``True/False``) 通过路由器通告中共享的网络前缀获取无状态 IPv6 地址。要检查是否已获取无状态地址,请使用只读属性 ``has_autoconf6``。" + +#: ../../library/network.rst:134 +msgid "" +"``addr4`` (e.g. ``192.168.0.4/24``) obtain the current IPv4 address and " +"network mask as ``(ip, subnet)``-tuple, regardless of how this address " +"was obtained. This method can be used to set a static IPv4 address either" +" as ``(ip, subnet)``-tuple or in CIDR-notation." +msgstr "``addr4`` (例如 ``192.168.0.4/24``)获取当前 IPv4 地址和网络掩码,以 ``(ip, subnet)`` 元组形式返回,无论该地址是如何获取的。此方法也可用于设置静态 IPv4 地址,可以使用 ``(ip, subnet)`` 元组或 CIDR 表示法。" + +#: ../../library/network.rst:138 +msgid "" +"``addr6`` (e.g. ``fe80::1234:5678``) obtain a list of current IPv6 " +"addresses as ``(ip, state, preferred_lifetime, valid_lifetime)``-tuple. " +"This include link-local, slaac and static addresses. " +"``preferred_lifetime`` and ``valid_lifetime`` represent the remaining " +"valid and preferred lifetime of each IPv6 address, in seconds. ``state`` " +"indicates the current state of the address:" +msgstr "" +"``addr6`` (例如 ``fe80::1234:5678``)获取当前 IPv6 地址列表,以 ``(ip, state, preferred_lifetime, valid_lifetime)`` 元组形式返回。" +"这包括链路本地地址、SLAAC 地址和静态地址。``preferred_lifetime`` 和 ``valid_lifetime`` 表示每个 IPv6 地址剩余的有效和首选生存期(以秒为单位)。" +"``state`` 指示地址的当前状态:" + +#: ../../library/network.rst:145 +msgid "" +"``0x08`` - ``0x0f`` indicates the address is tentative, counting the " +"number of probes sent." +msgstr "``0x08`` - ``0x0f`` 表示地址是暂定的,记录已发送的探测次数。" + +#: ../../library/network.rst:147 +msgid "``0x10`` The address is deprecated (but still valid)" +msgstr "``0x10`` 地址已弃用(但仍然有效)" + +#: ../../library/network.rst:148 +msgid "``0x30`` The address is preferred (and valid)" +msgstr "``0x30`` 地址是首选的(且有效)" + +#: ../../library/network.rst:149 +msgid "``0x40`` The address is duplicated and can not be used." +msgstr "``0x40`` 地址重复,不能使用。" + +#: ../../library/network.rst:151 +msgid "" +"This method can be used to set a static IPv6 address, by setting this " +"parameter to the address, like ``fe80::1234:5678``." +msgstr "此方法可用于设置静态 IPv6 地址,将此参数设置为地址即可,例如 ``fe80::1234:5678``。" + +#: ../../library/network.rst:156 +msgid "This function is deprecated, use `ipconfig()` instead." +msgstr "此函数已弃用,请改用 `ipconfig()`。" + +#: ../../library/network.rst:158 +msgid "" +"Get/set IP-level network interface parameters: IP address, subnet mask, " +"gateway and DNS server. When called with no arguments, this method " +"returns a 4-tuple with the above information. To set the above values, " +"pass a 4-tuple with the required information. For example::" +msgstr "" +"获取/设置 IP 级网络接口参数:IP 地址、子网掩码、网关和 DNS 服务器。当不带参数调用时,此方法返回包含上述信息的 4 " +"元组。要设置上述值,请传递包含所需信息的 4 元组。例如::" + +#: ../../library/network.rst:168 +msgid "" +"Get or set general network interface parameters. These methods allow to " +"work with additional parameters beyond standard IP configuration (as " +"dealt with by `ipconfig()`). These include network-specific and hardware-" +"specific parameters. For setting parameters, the keyword argument syntax " +"should be used, and multiple parameters can be set at once. For querying," +" a parameter name should be quoted as a string, and only one parameter " +"can be queried at a time::" +msgstr "" +"获取或设置一般的网络接口参数。这些方法允许处理标准 IP 配置(由 " +"`ipconfig()` 处理)之外的附加参数。这些包括网络特定和硬件特定的参数。对于设置参数,应使用关键字参数语法,并且可以一次设置多个参数。对于查询,应将参数名称作为字符串引用,并且一次只能查询一个参数::" + +#: ../../library/network.rst:183 +msgid "Specific network class implementations" +msgstr "特定网络类实现" + +#: ../../library/network.rst:185 +msgid "" +"The following concrete classes implement the AbstractNIC interface and " +"provide a way to control networking interfaces of various kinds." +msgstr "以下具体类实现了 AbstractNIC 接口,并提供了一种控制各种类型网络接口的方法。" + +#: ../../library/network.rst:197 +msgid "Network functions" +msgstr "网络函数" + +#: ../../library/network.rst:199 +msgid "The following are functions available in the network module." +msgstr "以下是网络模块中可用的函数。" + +#: ../../library/network.rst:203 +msgid "" +"Get or set the two-letter ISO 3166-1 Alpha-2 country code to be used for " +"radio compliance." +msgstr "获取或设置用于无线电遵从的两个字母 ISO 3166-1 Alpha-2 国家代码。" + +#: ../../library/network.rst:206 +msgid "" +"If the *code* parameter is provided, the country will be set to this " +"value. If the function is called without parameters, it returns the " +"current country." +msgstr "如果提供了 *code* 参数,则国家将设置为此值。如果不带参数调用该函数,则返回当前国家。" + +#: ../../library/network.rst:210 +msgid "The default code ``\"XX\"`` represents the \"worldwide\" region." +msgstr "默认代码 ``\"XX\"`` 代表 \"全球\" 区域。" + +#: ../../library/network.rst:214 +msgid "" +"Get or set the hostname that will identify this device on the network. It" +" will be used by all interfaces." +msgstr "获取或设置在网络上标识此设备的主机名。它将由所有接口使用。" + +#: ../../library/network.rst:217 +msgid "This hostname is used for:" +msgstr "此主机名用于:" + +#: ../../library/network.rst:218 +msgid "Sending to the DHCP server in the client request. (If using DHCP)" +msgstr "在客户端请求中发送到DHCP服务器。(如果使用DHCP)" + +#: ../../library/network.rst:219 +msgid "Broadcasting via mDNS. (If enabled)" +msgstr "通过 mDNS 广播。(如果启用)" + +#: ../../library/network.rst:221 +msgid "" +"If the *name* parameter is provided, the hostname will be set to this " +"value. If the function is called without parameters, it returns the " +"current hostname." +msgstr "如果提供了 *name* 参数,则主机名将设置为此值。如果不带参数调用该函数,则返回当前主机名。" + +#: ../../library/network.rst:225 +msgid "" +"A change in hostname is typically only applied during connection. For " +"DHCP this is because the hostname is part of the DHCP client request, and" +" the implementation of mDNS in most ports only initialises the hostname " +"once during connection. For this reason, you must set the hostname before" +" activating/connecting your network interfaces." +msgstr "更改主机名通常仅在连接时应用。对于DHCP来说,这是因为主机名是DHCP客户端请求的一部分,并且大多数移植版本中mDNS的实现仅在连接期间初始化主机名一次。因此,您必须在激活/连接网络接口之前设置主机名。" + +#: ../../library/network.rst:231 +msgid "" +"The length of the hostname is limited to 32 characters. " +":term:`MicroPython ports ` may choose to set a lower " +"limit for memory reasons. If the given name does not fit, a `ValueError` " +"is raised." +msgstr "" +"主机名的长度限制为 32 个字符。:term:`MicroPython ports ` " +"可能选择出于内存原因设置较低的限制。如果给定的名称不合适,则会引发 `ValueError`。" + +#: ../../library/network.rst:236 +msgid "The default hostname is typically the name of the board." +msgstr "默认主机名通常是板子的名称。" + +#: ../../library/network.rst:241 +msgid "" +"Get or set global IP-configuration parameters. Supported parameters are " +"the following (availability of a particular parameter depends on the port" +" and the specific network interface):" +msgstr "获取或设置全局 IP 配置参数。支持的参数如下(特定参数的可用性取决于移植版本和具体的网络接口):" + +#: ../../library/network.rst:245 +msgid "" +"``dns`` Get/set DNS server. This method can support both, IPv4 and IPv6 " +"addresses." +msgstr "``dns`` 获取/设置 DNS 服务器。此方法可以同时支持 IPv4 和 IPv6 地址。" + +#: ../../library/network.rst:247 +msgid "" +"``prefer`` (``4/6``) Specify which address type to return, if a domain " +"name has both A and AAAA records. Note, that this does not clear the " +"local DNS cache, so that any previously obtained addresses might not " +"change." +msgstr "``prefer`` (``4/6``) 指定当域名同时具有 A 和 AAAA 记录时返回哪种地址类型。请注意,这不会清除本地 DNS 缓存,因此之前获取的地址可能不会更改。" + +#: ../../library/network.rst:254 +msgid "Get or set the PHY mode." +msgstr "获取或设置 PHY 模式。" + +#: ../../library/network.rst:256 +msgid "" +"If the *mode* parameter is provided, the PHY mode will be set to this " +"value. If the function is called without parameters, it returns the " +"current PHY mode." +msgstr "如果提供了 *mode* 参数,则 PHY 模式将设置为此值。如果不带参数调用该函数,则返回当前 PHY 模式。" + +#: ../../library/network.rst:260 +msgid "The possible modes are defined as constants:" +msgstr "可能的模式定义为常量:" + +#: ../../library/network.rst:261 +msgid "``MODE_11B`` -- IEEE 802.11b," +msgstr "``MODE_11B`` -- IEEE 802.11b," + +#: ../../library/network.rst:262 +msgid "``MODE_11G`` -- IEEE 802.11g," +msgstr "``MODE_11G`` -- IEEE 802.11g," + +#: ../../library/network.rst:263 +msgid "``MODE_11N`` -- IEEE 802.11n." +msgstr "``MODE_11N`` -- IEEE 802.11n。" + +#: ../../library/network.rst:265 +msgid "Availability: ESP8266." +msgstr "可用性:ESP8266。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.audio.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.audio.po new file mode 100644 index 0000000000000..2dec94596bb71 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.audio.po @@ -0,0 +1,116 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.audio.rst:2 +msgid ":mod:`audio` --- Audio Module" +msgstr ":mod:`audio` --- Audio 模块" + +#: ../../library/omv.audio.rst:7 +msgid "" +"The ``audio`` module is used to record audio samples from a microphone on" +" the Arduino Portenta or the Arduino Nicla." +msgstr "``audio`` 模块用于从 Arduino Portenta 或 Arduino Nicla 上的麦克风录制音频样本。" + +#: ../../library/omv.audio.rst:10 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.audio.rst:14 +msgid "" +"Initializes the audio module. Must be called first before using the audio" +" module." +msgstr "初始化音频模块。必须在使用音频模块前先调用。" + +#: ../../library/omv.audio.rst:16 +msgid "" +"``channels`` specifies the number of audio channels. May be 1 or 2. Audio" +" samples are interleaved for two audio channels. Using more than one " +"channel is only possible on boards with more than one mic." +msgstr "" +"``channels`` 指定音频通道的数量。可以是 1 或 " +"2。当使用两个音频通道时,音频样本会交错排列。使用多个通道仅在具有多个麦克风的板上才可实现。" + +#: ../../library/omv.audio.rst:20 +msgid "" +"``frequency`` is the sample frequency to run at. Running at a higher " +"sample frequency results in a higher noise floor which means less " +"effective bits per sample." +msgstr "``frequency`` 是运行的采样频率。以更高的采样频率运行会导致更高的噪声底噪,这意味着每个样本的有效位数会减少。" + +#: ../../library/omv.audio.rst:23 +msgid "``gain_db`` is the microphone gain to apply." +msgstr "``gain_db`` 是要应用的麦克风增益。" + +#: ../../library/omv.audio.rst:25 +msgid "" +"``highpass`` is the high pass filter cut-off given the target sample " +"frequency. This parameter is applicable for the Arduino Portenta H7 only." +msgstr "``highpass`` 是根据目标采样频率设置的高通滤波器截止频率。此参数仅适用于 Arduino Portenta H7。" + +#: ../../library/omv.audio.rst:28 +msgid "" +"``samples`` is the number of samples to accumulate per callback. This is " +"typically caluclated based on the decimation factor and number of " +"channels. If set to -1, the number of samples will be calculated " +"automatically based on the decimation factor and number of channels." +msgstr "" +"``samples`` 是每次回调时要积累的样本数。通常根据抽取因子(decimation factor)和通道数量计算。如果设置为 " +"-1,样本数将根据抽取因子和通道数量自动计算。" + +#: ../../library/omv.audio.rst:34 +msgid "" +"Calls the ``callback`` that takes one argument ``pcmbuf`` automatically " +"forever when enough PCM samples have accumulated based on the `audio` " +"module settings. You can cast the ``pcmbuf`` into an ``ndarray`` for " +"processing the audio samples in numpy and then pass the ``ndarray`` to a " +"`ml.Model` object for inference." +msgstr "" +"当根据 `audio` 模块的设置累积足够的 PCM 样本时,自动永远调用带有一个参数 ``pcmbuf`` 的 " +"``callback``。您可以将 ``pcmbuf`` 转换为 ``ndarray`` 以使用 numpy 处理音频样本,然后将该 " +"``ndarray`` 传递给 `ml.Model` 对象进行推理。" + +#: ../../library/omv.audio.rst:39 +msgid "" +"``pcmbuf`` is a signed 16-bit array of audio samples who's sized based on" +" the decimation factor and number of channels, or the number of samples " +"specified in the `audio.init()` function." +msgstr "" +"``pcmbuf`` 是一个有符号 16 位音频样本数组,其大小基于抽取因子(decimation factor)和通道数量,或者是 " +"`audio.init()` 函数中指定的样本数。" + +#: ../../library/omv.audio.rst:42 +msgid "" +"In single channel mode audio samples will be 16-bits each filling up the " +"16-bit array." +msgstr "在单通道模式下,音频样本将是 16 位,每个样本填充 16 位数组。" + +#: ../../library/omv.audio.rst:44 +msgid "" +"In dual channel mode audio samples will be 16-bits each in pairs filling " +"up the 16-bit array." +msgstr "在双通道模式下,音频样本将是 16 位的每对样本,成对填充 16 位数组。" + +#: ../../library/omv.audio.rst:48 +msgid "Stops audio streaming and the callback from being called." +msgstr "停止音频流和回调被调用。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.cpufreq.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.cpufreq.po new file mode 100644 index 0000000000000..4ba16f902a592 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.cpufreq.po @@ -0,0 +1,63 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.cpufreq.rst:2 +msgid ":mod:`cpufreq` --- CPU Frequency Control" +msgstr ":mod:`cpufreq` --- CPU频率控制" + +#: ../../library/omv.cpufreq.rst:7 +msgid "The ``cpufreq`` module is used to get/set the CPU frequency to save power." +msgstr "``cpufreq`` 模块用于获取/设置 CPU 频率以节省电力。" + +#: ../../library/omv.cpufreq.rst:11 +msgid "" +"This module is not supported on the OpenMV Cam M4 because the CPU " +"frequency, for various reasons, cannot be set independently of " +"peripherals." +msgstr "由于各种原因,此模块不支持 OpenMV Cam M4,因为 CPU " +"频率不能独立于外围设备进行设置。" + +#: ../../library/omv.cpufreq.rst:15 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.cpufreq.rst:19 +msgid "" +"Sets the CPU frequency to a supported frequency in MHz. Peripherals " +"frequencies are not changed. Only the CPU performance." +msgstr "将 CPU 频率设置为支持的频率(以 MHz 为单位)。不会更改外围设备频率,只影响 " +"CPU 性能。" + +#: ../../library/omv.cpufreq.rst:24 +msgid "Returns (cpu_clk_in_mhz, hclk_in_mhz, pclk1_in_mhz, pclk2_in_mhz)." +msgstr "返回当前的频率 (cpu_clk_in_mhz, hclk_in_mhz, pclk1_in_mhz, pclk2_in_mhz)。" + +#: ../../library/omv.cpufreq.rst:28 +msgid "" +"Returns the supported CPU frequencies [120, 144, 168, 192, 216] on the " +"OpenMV Cam M7 and [60/50, 120/100, 240/200, 480/400] on the OpenMV Cam H7" +" Rev V/XY silicon in MHz." +msgstr "" +"返回支持的 CPU 频率列表,在 OpenMV Cam M7 上为 [120, 144, 168, 192, 216] " +"MHz,在 OpenMV Cam H7 Rev V/XY 上为 [60/50, 120/100, 240/200, 480/400] MHz。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.csi.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.csi.po new file mode 100644 index 0000000000000..281a1a907bd24 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.csi.po @@ -0,0 +1,1701 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.csi.rst:2 +msgid ":mod:`csi` --- camera sensors" +msgstr ":mod:`csi` --- 摄像头传感器" + +#: ../../library/omv.csi.rst:7 +msgid "The ``csi`` module is used for controlling camera sensors." +msgstr "``csi`` 模块用于控制摄像头传感器。" + +#: ../../library/omv.csi.rst:9 +msgid "Example usage::" +msgstr "使用示例::" + +#: ../../library/omv.csi.rst:25 +msgid "class CSI -- Camera Sensor Interface" +msgstr "class CSI -- 摄像头传感器接口" + +#: ../../library/omv.csi.rst:27 +msgid "The `CSI` class is used to control a camera sensor." +msgstr "`CSI` 类用于控制摄像头传感器。" + +#: ../../library/omv.csi.rst:30 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.csi.rst:34 +msgid "" +"Create an object to talk with a camera sensor. On camera sensor modules " +"with multiple sensors, the particular CSI object may be selected by " +"passing a ``cid`` like `csi.LEPTON` to select a FLIR Lepton sensor " +"module. If ``cid`` is -1 then the primary sensor is selected (typically a" +" color camera module on multi-sensor boards)." +msgstr "创建一个与摄像头传感器通信的对象。在具有多个传感器的摄像头传感器模块上,可以通过传递 ``cid`` (如 `csi.LEPTON` )来选择特定的 CSI 对象以选择 FLIR Lepton 传感器模块。如果 ``cid`` 为 -1,则选择主传感器(在多传感器板上通常是彩色摄像头模块)。" + +#: ../../library/omv.csi.rst:39 +msgid "" +"If ``delays`` is ``False`` then disable all settling time delays in the " +"csi driver. Whenever you reset the camera module, change modes, etc. the " +"sensor driver delays to prevent you can from calling `CSI.snapshot` to " +"quickly afterwards and receiving corrupt frames from the camera module. " +"By disabling delays you can quickly update the camera module settings in " +"bulk via multiple method calls before delaying at the end and calling " +"`CSI.snapshot`." +msgstr "如果 ``delays`` 为 ``False``,则禁用 csi 驱动程序中的所有稳定时间延迟。每当您重置摄像头模块、更改模式等时,传感器驱动程序会延迟以防止您过快地调用 `CSI.snapshot` 而从摄像头模块接收到损坏的帧。通过禁用延迟,您可以在最后延迟并调用 `CSI.snapshot` 之前,通过多个方法调用批量快速更新摄像头模块设置。" + +#: ../../library/omv.csi.rst:45 +msgid "" +"If ``fflush`` is ``False`` then automatic framebuffer flushing mentioned " +"in `CSI.framebuffers` is disabled. This removes any time limit on frames " +"in the frame buffer fifo. For example, if you set the number of frame " +"buffers to 30 and set the frame rate to 30 you can now precisely record 1" +" second of video from the camera without risk of frame loss." +msgstr "如果 ``fflush`` 为 ``False``,则禁用 `CSI.framebuffers` 中提到的自动帧缓冲区刷新。这将移除帧缓冲区 FIFO 中帧的任何时间限制。例如,如果您将帧缓冲区数量设置为 30 并将帧率设置为 30,您现在可以精确录制 1 秒的摄像头视频而不会有丢帧风险。" + +#: ../../library/omv.csi.rst:52 +msgid "" +"`CSI.snapshot` starts the frame capture process which will continue to " +"capture frames until there is no space to hold a frame at which point the" +" frame capture process stops. The process always stops when there is no " +"space to hold the next frame." +msgstr "`CSI.snapshot` 启动帧捕获过程,该过程将持续捕获帧,直到没有空间容纳帧时帧捕获过程停止。当没有空间容纳下一帧时,过程总是会停止。" + +#: ../../library/omv.csi.rst:57 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.csi.rst:61 +msgid "" +"Initializes the camera sensor. Performs a hardware reset by toggling the " +"RESET signal GPIO to the camera module if ``hard`` is ``True``. ``hard`` " +"should be set to false when resetting auxiliary camera sensors that share" +" the same RESET signal GPIO as the primary module." +msgstr "初始化摄像头传感器。如果 ``hard`` 为 ``True``,则通过切换摄像头模块的 RESET 信号 GPIO 执行硬件复位。当复位与主模块共享相同 RESET 信号 GPIO 的辅助摄像头传感器时,``hard`` 应设置为 false。" + +#: ../../library/omv.csi.rst:67 +msgid "" +"Puts the camera into a lower power mode than sleep (but the camera must " +"be reset on being woken up)." +msgstr "将摄像头置于比睡眠更低的功耗模式(但唤醒时必须重置摄像头)。" + +#: ../../library/omv.csi.rst:71 +msgid "Puts the camera to sleep if enable is True. Otherwise, wakes it back up." +msgstr "如果 enable 为 True,则使摄像头进入睡眠模式。否则,将其唤醒。" + +#: ../../library/omv.csi.rst:75 +msgid "" +"Copies whatever was in the frame buffer to the IDE. You should call this " +"method to display the last image your OpenMV Cam takes if it's not " +"running a script with an infinite loop. Note that you'll need to add a " +"delay time of about a second after your script finishes for the IDE to " +"grab the image from your camera. Otherwise, this method will have no " +"effect." +msgstr "将帧缓冲区中的内容复制到 IDE。如果您的 OpenMV Cam 没有运行带有无限循环的脚本,您应该调用此方法来显示最后拍摄的图像。请注意,您需要在脚本结束后添加大约一秒的延迟时间,以便 IDE 从摄像头获取图像。否则,此方法将无效。" + +#: ../../library/omv.csi.rst:83 +msgid "Takes a picture using the camera and returns an `Image` object." +msgstr "使用摄像头拍摄一张图片并返回一个 `Image` 对象。" + +#: ../../library/omv.csi.rst:85 +msgid "" +"If ``time`` and/or ``frames`` is passed snapshot will block for that many" +" ``time`` milliseconds and/or ``frames`` captured from the camera. Both " +"arguments may be used at the same time. After ``time`` and/or ``frames`` " +"has passed ``CSI.snapshot`` will return ``None``." +msgstr "如果传递了 ``time`` 和/或 ``frames``,snapshot 将阻塞指定的 ``time`` 毫秒和/或从摄像头捕获的 ``frames`` 帧数。两个参数可以同时使用。在 ``time`` 和/或 ``frames`` 结束后,``CSI.snapshot`` 将返回 ``None``。" + +#: ../../library/omv.csi.rst:89 +msgid "" +"``update`` controls if `CSI.flush` is called internally before capturing " +"the next snapshot so that the previous frame buffer is sent to the IDE." +msgstr "``update`` 控制在捕获下一个快照之前是否在内部调用 `CSI.flush`,以便将前一个帧缓冲区发送到 IDE。" + +#: ../../library/omv.csi.rst:92 +msgid "" +"``blocking`` may be ``False`` to enable non-blocking behavior which will " +"cause snapshot to return ``None`` when the next image from the camera is " +"not ready versus waiting." +msgstr "``blocking`` 可以设置为 ``False`` 以启用非阻塞行为,当摄像头的下一帧图像尚未就绪时,snapshot 将返回 ``None`` 而不是等待。" + +#: ../../library/omv.csi.rst:95 +msgid "" +"``image`` may be another `Image` object to update with the new image " +"captured from the camera instead of returning an `Image` object. Note " +"that this does a deep copy update of the provided image." +msgstr "``image`` 可以是另一个 `Image` 对象,用从摄像头捕获的新图像更新它,而不是返回一个新的 `Image` 对象。请注意,这会对提供的图像进行深拷贝更新。" + +#: ../../library/omv.csi.rst:99 +msgid "" +"If `CSI.auto_rotation()` is enabled this method will return a new already" +" rotated `Image` object." +msgstr "如果启用了 `CSI.auto_rotation()`,此方法将返回一个已经旋转过的新 `Image` 对象。" + +#: ../../library/omv.csi.rst:104 +msgid "Returns the sensor resolution width." +msgstr "返回传感器分辨率宽度。" + +#: ../../library/omv.csi.rst:108 +msgid "Returns the sensor resolution height." +msgstr "返回传感器分辨率高度。" + +#: ../../library/omv.csi.rst:112 +msgid "Returns the camera module ID." +msgstr "返回摄像头模块 ID。" + +#: ../../library/omv.csi.rst:114 +msgid "`csi.OV2640`: Second gen OpenMV Cam sensor - never released." +msgstr "`csi.OV2640`:第二代 OpenMV Cam 传感器 - 从未发布。" + +#: ../../library/omv.csi.rst:115 +msgid "`csi.OV5640`: High-res OpenMV Cam H7 Plus sensor." +msgstr "`csi.OV5640`:高分辨率 OpenMV Cam H7 Plus 传感器。" + +#: ../../library/omv.csi.rst:116 +msgid "`csi.OV7670`: Arduino Giga Sensor Module." +msgstr "`csi.OV7670`:Arduino Giga 传感器模块。" + +#: ../../library/omv.csi.rst:117 +msgid "`csi.OV7690`: OpenMV Cam Micro sensor module." +msgstr "`csi.OV7690`:OpenMV Cam Micro 传感器模块。" + +#: ../../library/omv.csi.rst:118 +msgid "`csi.OV7725`: Rolling shutter sensor module." +msgstr "`csi.OV7725`:卷帘快门传感器模块。" + +#: ../../library/omv.csi.rst:119 +msgid "`csi.OV9650`: First gen OpenMV Cam sensor - never released." +msgstr "`csi.OV9650`:第一代 OpenMV Cam 传感器 - 从未发布。" + +#: ../../library/omv.csi.rst:120 +msgid "`csi.MT9V022`: Global shutter sensor module." +msgstr "`csi.MT9V022`:全局快门传感器模块。" + +#: ../../library/omv.csi.rst:121 +msgid "`csi.MT9V024`: Global shutter sensor module." +msgstr "`csi.MT9V024`:全局快门传感器模块。" + +#: ../../library/omv.csi.rst:122 +msgid "`csi.MT9V032`: Global shutter sensor module." +msgstr "`csi.MT9V032`:全局快门传感器模块。" + +#: ../../library/omv.csi.rst:123 +msgid "`csi.MT9V034`: Global shutter sensor module." +msgstr "`csi.MT9V034`:全局快门传感器模块。" + +#: ../../library/omv.csi.rst:124 +msgid "`csi.MT9M114`: OV7725 replacement rolling shutter sensor module." +msgstr "`csi.MT9M114`:OV7725 替代卷帘快门传感器模块。" + +#: ../../library/omv.csi.rst:125 +msgid "`csi.BOSON320`: Boson 320x256 thermal sensor module." +msgstr "`csi.BOSON320`:Boson 320x256 热成像传感器模块。" + +#: ../../library/omv.csi.rst:126 +msgid "`csi.BOSON640`: Boson 640x512 thermal sensor module." +msgstr "`csi.BOSON640`:Boson 640x512 热成像传感器模块。" + +#: ../../library/omv.csi.rst:127 +msgid "`csi.LEPTON`: Lepton1/2/3 sensor module." +msgstr "`csi.LEPTON`:Lepton1/2/3 传感器模块。" + +#: ../../library/omv.csi.rst:128 +msgid "`csi.HM01B0`: Arduino Portenta H7 sensor module." +msgstr "`csi.HM01B0`:Arduino Portenta H7 传感器模块。" + +#: ../../library/omv.csi.rst:129 +msgid "`csi.HM0360`: Arduino Portenta H7 sensor module." +msgstr "`csi.HM0360`:Arduino Portenta H7 传感器模块。" + +#: ../../library/omv.csi.rst:130 +msgid "`csi.GC2145`: Arduino Nicla Vision H7 sensor module." +msgstr "`csi.GC2145`:Arduino Nicla Vision H7 传感器模块。" + +#: ../../library/omv.csi.rst:131 +msgid "" +"`csi.GENX320ES`: Prophesee Event Camera sensor module (engineering " +"sample)." +msgstr "`csi.GENX320ES`:Prophesee 事件相机传感器模块(工程样品)。" + +#: ../../library/omv.csi.rst:132 +msgid "`csi.GENX320`: Prophesee Event Camera sensor module." +msgstr "`csi.GENX320`:Prophesee 事件相机传感器模块。" + +#: ../../library/omv.csi.rst:133 +msgid "`csi.PAG7920`: PixArt Imaging sensor Module." +msgstr "`csi.PAG7920`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.csi.rst:134 +msgid "`csi.PAG7936`: PixArt Imaging sensor Module." +msgstr "`csi.PAG7936`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.csi.rst:135 +msgid "`csi.PAJ6100`: PixArt Imaging sensor Module." +msgstr "`csi.PAJ6100`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.csi.rst:136 +msgid "`csi.PSS5520`: PixArt Imaging sensor Module." +msgstr "`csi.PSS5520`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.csi.rst:137 +msgid "" +"`csi.FROGEYE2020` : FrogEye2020 event camera sensor module - never " +"released." +msgstr "`csi.FROGEYE2020`:FrogEye2020 事件相机传感器模块 - 从未发布。" + +#: ../../library/omv.csi.rst:141 +msgid "" +"Returns if there's an image ready to be returned by `CSI.snapshot` so " +"that any call to snapshot will not block." +msgstr "返回是否有图像准备好由 `CSI.snapshot` 返回,以便任何对 snapshot 的调用都不会阻塞。" + +#: ../../library/omv.csi.rst:146 +msgid "Sets the pixel format for the camera module." +msgstr "设置摄像头模块的像素格式。" + +#: ../../library/omv.csi.rst:148 +msgid "`csi.GRAYSCALE`: 8-bits per pixel." +msgstr "`csi.GRAYSCALE`:每像素 8 位。" + +#: ../../library/omv.csi.rst:149 +msgid "`csi.RGB565`: 16-bits per pixel." +msgstr "`csi.RGB565`:每像素 16 位。" + +#: ../../library/omv.csi.rst:150 +msgid "`csi.BAYER`: 8-bits per pixel bayer pattern." +msgstr "`csi.BAYER`:每像素 8 位 Bayer 模式。" + +#: ../../library/omv.csi.rst:151 +msgid "" +"`csi.YUV422`: 16-bits per pixel (8-bits Y1, 8-bits U, 8-bits Y2, 8-bits " +"V, etc.)" +msgstr "`csi.YUV422`:每像素 16 位(8 位 Y1、8 位 U、8 位 Y2、8 位 V,等等)" + +#: ../../library/omv.csi.rst:152 +msgid "`csi.JPEG`: Compressed JPEG data. Only for the OV2640/OV5640." +msgstr "`csi.JPEG`:压缩的 JPEG 数据。仅适用于 OV2640/OV5640。" + +#: ../../library/omv.csi.rst:154 +msgid "" +"If you are trying to take JPEG images with the OV2640 or OV5640 camera " +"modules at high resolutions you should set the pixformat to `csi.JPEG`. " +"You can control the image quality then with `CSI.quality()`." +msgstr "如果您尝试使用 OV2640 或 OV5640 摄像头模块以高分辨率拍摄 JPEG 图像,应将像素格式设置为 `csi.JPEG`。然后您可以使用 `CSI.quality()` 控制图像质量。" + +#: ../../library/omv.csi.rst:158 +msgid "Returns the current pixformat if called with no arguments." +msgstr "如果不带参数调用则返回当前像素格式。" + +#: ../../library/omv.csi.rst:162 +msgid "Sets the frame size for the camera module." +msgstr "设置摄像头模块的帧大小。" + +#: ../../library/omv.csi.rst:164 +msgid "`csi.QCIF`: 176x144" +msgstr "`csi.QCIF`:176x144" + +#: ../../library/omv.csi.rst:165 +msgid "`csi.CIF`: 352x288" +msgstr "`csi.CIF`:352x288" + +#: ../../library/omv.csi.rst:166 +msgid "`csi.QSIF`: 176x120" +msgstr "`csi.QSIF`:176x120" + +#: ../../library/omv.csi.rst:167 +msgid "`csi.SIF`: 352x240" +msgstr "`csi.SIF`:352x240" + +#: ../../library/omv.csi.rst:168 +msgid "`csi.QQQVGA`: 80x60" +msgstr "`csi.QQQVGA`:80x60" + +#: ../../library/omv.csi.rst:169 +msgid "`csi.QQVGA`: 160x120" +msgstr "`csi.QQVGA`:160x120" + +#: ../../library/omv.csi.rst:170 +msgid "`csi.QVGA`: 320x240" +msgstr "`csi.QVGA`:320x240" + +#: ../../library/omv.csi.rst:171 +msgid "`csi.VGA`: 640x480" +msgstr "`csi.VGA`:640x480" + +#: ../../library/omv.csi.rst:172 +msgid "`csi.HQVGA`: 240x160" +msgstr "`csi.HQVGA`:240x160" + +#: ../../library/omv.csi.rst:173 +msgid "`csi.HVGA`: 480x320" +msgstr "`csi.HVGA`:480x320" + +#: ../../library/omv.csi.rst:174 +msgid "`csi.WVGA`: 720x480 (for the MT9V034)" +msgstr "`csi.WVGA`:720x480(适用于 MT9V034)" + +#: ../../library/omv.csi.rst:175 +msgid "`csi.WVGA2`:752x480 (for the MT9V034)" +msgstr "`csi.WVGA2`:752x480(适用于 MT9V034)" + +#: ../../library/omv.csi.rst:176 +msgid "`csi.SVGA`: 800x600 (only for the OV2640/OV5640 sensor)" +msgstr "`csi.SVGA`:800x600(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.csi.rst:177 +msgid "`csi.XGA`: 1024x768 (only for the OV2640/OV5640 sensor)" +msgstr "`csi.XGA`:1024x768(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.csi.rst:178 +msgid "`csi.WXGA`: 1280x768 (for the MT9M114)" +msgstr "`csi.WXGA`:1280x768(适用于 MT9M114)" + +#: ../../library/omv.csi.rst:179 +msgid "`csi.SXGA`: 1280x1024 (only for the OV2640/OV5640 sensor)" +msgstr "`csi.SXGA`:1280x1024(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.csi.rst:180 +msgid "`csi.SXGAM`: 1280x960 (for the MT9M114)" +msgstr "`csi.SXGAM`:1280x960(适用于 MT9M114)" + +#: ../../library/omv.csi.rst:181 +msgid "`csi.UXGA`: 1600x1200 (only for the OV2640/OV5640 sensor)" +msgstr "`csi.UXGA`:1600x1200(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.csi.rst:182 +msgid "`csi.HD`: 1280x720 (only for the OV2640/OV5640 sensor)" +msgstr "`csi.HD`:1280x720(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.csi.rst:183 +msgid "`csi.FHD`: 1920x1080 (only for the OV5640/PSS520 sensor)" +msgstr "`csi.FHD`:1920x1080(仅适用于 OV5640/PSS520 传感器)" + +#: ../../library/omv.csi.rst:184 +msgid "`csi.QHD`: 2560x1440 (only for the OV5640 sensor)" +msgstr "`csi.QHD`:2560x1440(仅适用于 OV5640 传感器)" + +#: ../../library/omv.csi.rst:185 +msgid "`csi.QXGA`: 2048x1536 (only for the OV5640 sensor)" +msgstr "`csi.QXGA`:2048x1536(仅适用于 OV5640 传感器)" + +#: ../../library/omv.csi.rst:186 +msgid "`csi.WQXGA`: 2560x1600 (only for the OV5640 sensor)" +msgstr "`csi.WQXGA`:2560x1600(仅适用于 OV5640 传感器)" + +#: ../../library/omv.csi.rst:187 +msgid "`csi.WQXGA2`: 2592x1944 (only for the OV5640 sensor)" +msgstr "`csi.WQXGA2`:2592x1944(仅适用于 OV5640 传感器)" + +#: ../../library/omv.csi.rst:189 +msgid "" +"Alternatively, you may pass a custom framesize like ``framesize((320, " +"320))``. Note that when `CSI.snapshot` is called the custom framesize " +"will be evaluated against DMA rules if it's valid. Generally, framesizes " +"need to be a multiple of 8 pixels and or 16 bytes." +msgstr "或者,您可以传递自定义帧大小,如 ``framesize((320, 320))``。请注意,当调用 `CSI.snapshot` 时,自定义帧大小将根据 DMA 规则进行验证。通常,帧大小需要是 8 像素和/或 16 字节的倍数。" + +#: ../../library/omv.csi.rst:193 +msgid "Returns the current framesize if called with no arguments." +msgstr "如果不带参数调用则返回当前帧大小。" + +#: ../../library/omv.csi.rst:197 +msgid "Sets the frame rate in hz for the camera module." +msgstr "设置摄像头模块的帧率(Hz)。" + +#: ../../library/omv.csi.rst:199 +msgid "Returns the current framerate if called with no arguments." +msgstr "如果不带参数调用则返回当前帧率。" + +#: ../../library/omv.csi.rst:203 +msgid "" +"`CSI.framerate` works by dropping frames received by the camera module to" +" keep the frame rate equal to (or below) the rate you specify. By default" +" the camera will run at the maximum frame rate. If implemented for the " +"particular camera sensor then `CSI.framerate` will also reduce the camera" +" sensor frame rate internally to save power and improve image quality by " +"increasing the sensor exposure. `CSI.framerate` may conflict with " +"`CSI.auto_exposure` on some cameras." +msgstr "`CSI.framerate` 通过丢弃摄像头模块接收的帧来保持帧率等于(或低于)您指定的速率。默认情况下,摄像头将以最大帧率运行。如果特定摄像头传感器支持,`CSI.framerate` 还会在内部降低摄像头传感器帧率以节省功耗并通过增加传感器曝光时间来提高图像质量。`CSI.framerate` 可能与某些摄像头上的 `CSI.auto_exposure` 冲突。" + +#: ../../library/omv.csi.rst:211 +msgid "" +"Sets the resolution of the camera to a sub resolution inside of the " +"current resolution. For example, setting the resolution to `csi.VGA` and " +"then the windowing to (120, 140, 200, 200) sets `CSI.snapshot()` to " +"capture the 200x200 center pixels of the VGA resolution outputted by the " +"camera sensor. You can use windowing to get custom resolutions. Also, " +"when using windowing on a larger resolution you effectively are digital " +"zooming." +msgstr "将摄像头的分辨率设置为当前分辨率内的子分辨率。例如,将分辨率设置为 `csi.VGA`,然后将窗口设置为 (120, 140, 200, 200),则 `CSI.snapshot()` 将捕获摄像头传感器输出的 VGA 分辨率中心 200x200 像素。您可以使用窗口功能获取自定义分辨率。此外,在较大分辨率上使用窗口功能实际上就是数字变焦。" + +#: ../../library/omv.csi.rst:218 +msgid "" +"``roi`` is a rect tuple (x, y, w, h). However, you may just pass (w, h) " +"and the ``roi`` will be centered on the frame. You may also pass roi not " +"in parens." +msgstr "``roi`` 是一个矩形元组 (x, y, w, h)。但是,您也可以只传递 (w, h),``roi`` 将在帧上居中。您也可以不使用括号传递 roi。" + +#: ../../library/omv.csi.rst:221 +msgid "" +"Returns the current ``roi`` rect tuple (x, y, w, h) if called with no " +"arguments." +msgstr "如果不带参数调用则返回当前 ``roi`` 矩形元组 (x, y, w, h)。" + +#: ../../library/omv.csi.rst:225 +msgid "Set the camera image gainceiling. 2, 4, 8, 16, 32, 64, or 128." +msgstr "设置摄像头图像增益上限。可选值为 2、4、8、16、32、64 或 128。" + +#: ../../library/omv.csi.rst:227 +msgid "Returns the current gainceiling if called with no arguments." +msgstr "如果不带参数调用则返回当前增益上限。" + +#: ../../library/omv.csi.rst:231 +msgid "Set the camera image brightness." +msgstr "设置摄像头图像亮度。" + +#: ../../library/omv.csi.rst:233 +msgid "Returns the current brightness if called with no arguments." +msgstr "如果不带参数调用则返回当前亮度。" + +#: ../../library/omv.csi.rst:237 +msgid "Set the camera image contrast." +msgstr "设置摄像头图像对比度。" + +#: ../../library/omv.csi.rst:239 +msgid "Returns the current contrast if called with no arguments." +msgstr "如果不带参数调用则返回当前对比度。" + +#: ../../library/omv.csi.rst:243 +msgid "Set the camera image saturation." +msgstr "设置摄像头图像饱和度。" + +#: ../../library/omv.csi.rst:245 +msgid "Returns the current saturation if called with no arguments." +msgstr "如果不带参数调用则返回当前饱和度。" + +#: ../../library/omv.csi.rst:249 +msgid "Set the camera image JPEG compression quality. 0 - 100." +msgstr "设置摄像头图像 JPEG 压缩质量。范围 0 - 100。" + +#: ../../library/omv.csi.rst:251 +msgid "Returns the current quality if called with no arguments." +msgstr "如果不带参数调用则返回当前质量。" + +#: ../../library/omv.csi.rst:255 +msgid "Only for the OV2640/OV5640 cameras." +msgstr "仅适用于 OV2640/OV5640 摄像头。" + +#: ../../library/omv.csi.rst:259 +msgid "Turns color bar mode on (True) or off (False). Defaults to off." +msgstr "开启(True)或关闭(False)色条模式。默认关闭。" + +#: ../../library/omv.csi.rst:261 ../../library/omv.csi.rst:334 +#: ../../library/omv.csi.rst:340 ../../library/omv.csi.rst:351 +#: ../../library/omv.csi.rst:357 ../../library/omv.csi.rst:424 +#: ../../library/omv.csi.rst:526 +msgid "Returns the current setting if called with no arguments." +msgstr "如果不带参数调用则返回当前设置。" + +#: ../../library/omv.csi.rst:265 +msgid "" +"``enable`` turns auto gain control on (True) or off (False). The camera " +"will startup with auto gain control on." +msgstr "``enable`` 开启(True)或关闭(False)自动增益控制。摄像头启动时自动增益控制默认开启。" + +#: ../../library/omv.csi.rst:268 +msgid "" +"If ``enable`` is False you may set a fixed gain in decibels with " +"``gain_db``." +msgstr "如果 ``enable`` 为 False,您可以使用 ``gain_db`` 设置固定增益(分贝)。" + +#: ../../library/omv.csi.rst:270 +msgid "" +"If ``enable`` is True you may set the maximum gain ceiling in decibels " +"with ``gain_db_ceiling`` for the automatic gain control algorithm." +msgstr "如果 ``enable`` 为 True,您可以使用 ``gain_db_ceiling`` 为自动增益控制算法设置最大增益上限(分贝)。" + +#: ../../library/omv.csi.rst:275 +msgid "You need to turn off white balance too if you want to track colors." +msgstr "如果您想跟踪颜色,还需要关闭白平衡。" + +#: ../../library/omv.csi.rst:279 +msgid "Returns the current camera gain value in decibels (float)." +msgstr "返回当前摄像头增益值(分贝,浮点数)。" + +#: ../../library/omv.csi.rst:283 +msgid "" +"``enable`` turns auto exposure control on (True) or off (False). The " +"camera will startup with auto exposure control on." +msgstr "``enable`` 开启(True)或关闭(False)自动曝光控制。摄像头启动时自动曝光控制默认开启。" + +#: ../../library/omv.csi.rst:286 +msgid "" +"If ``enable`` is False you may set a fixed exposure time in microseconds " +"with ``exposure_us``." +msgstr "如果 ``enable`` 为 False,您可以使用 ``exposure_us`` 设置固定曝光时间(微秒)。" + +#: ../../library/omv.csi.rst:291 +msgid "" +"Camera auto exposure algorithms are pretty conservative about how much " +"they adjust the exposure value by and will generally avoid changing the " +"exposure value by much. Instead, they change the gain value a lot to deal" +" with changing lighting." +msgstr "摄像头自动曝光算法在调整曝光值方面相当保守,通常会避免大幅改变曝光值。相反,它们会大幅改变增益值来应对光照变化。" + +#: ../../library/omv.csi.rst:298 +msgid "Returns the current camera exposure value in microseconds (int)." +msgstr "返回当前摄像头曝光值(微秒,整数)。" + +#: ../../library/omv.csi.rst:302 +msgid "" +"``enable`` turns auto white balance on (True) or off (False). The camera " +"will startup with auto white balance on." +msgstr "``enable`` 开启(True)或关闭(False)自动白平衡。摄像头启动时自动白平衡默认开启。" + +#: ../../library/omv.csi.rst:305 +msgid "" +"If ``enable`` is False you may set a fixed gain in decibels for the red, " +"green, and blue channels respectively with ``rgb_gain_db``." +msgstr "如果 ``enable`` 为 False,您可以使用 ``rgb_gain_db`` 分别为红色、绿色和蓝色通道设置固定增益(分贝)。" + +#: ../../library/omv.csi.rst:310 +msgid "You need to turn off gain control too if you want to track colors." +msgstr "如果您想跟踪颜色,还需要关闭增益控制。" + +#: ../../library/omv.csi.rst:314 +msgid "" +"Returns a tuple with the current camera red, green, and blue gain values " +"in decibels ((float, float, float))." +msgstr "返回一个包含当前摄像头红色、绿色和蓝色增益值(分贝)的元组 ((float, float, float))。" + +#: ../../library/omv.csi.rst:319 +msgid "Sets the auto black line calibration (blc) control on the camera." +msgstr "设置摄像头的自动黑电平校准 (blc) 控制。" + +#: ../../library/omv.csi.rst:321 +msgid "" +"``enable`` pass `True` or `False` to turn BLC on or off. You typically " +"always want this on." +msgstr "``enable`` 传递 `True` 或 `False` 来开启或关闭 BLC。通常您应该始终保持开启。" + +#: ../../library/omv.csi.rst:323 +msgid "" +"``regs`` if disabled then you can manually set the blc register values " +"via the values you got previously from `CSI.blc_regs()`." +msgstr "``regs`` 如果禁用了 BLC,您可以通过之前从 `CSI.blc_regs()` 获取的值手动设置 blc 寄存器值。" + +#: ../../library/omv.csi.rst:328 +msgid "" +"Returns the sensor blc registers as an opaque tuple of integers. For use " +"with `CSI.auto_blc`." +msgstr "以不透明的整数元组形式返回传感器 blc 寄存器。用于 `CSI.auto_blc`。" + +#: ../../library/omv.csi.rst:332 +msgid "Turns horizontal mirror mode on (True) or off (False). Defaults to off." +msgstr "开启(True)或关闭(False)水平镜像模式。默认关闭。" + +#: ../../library/omv.csi.rst:338 +msgid "Turns vertical flip mode on (True) or off (False). Defaults to off." +msgstr "开启(True)或关闭(False)垂直翻转模式。默认关闭。" + +#: ../../library/omv.csi.rst:344 +msgid "Turns transpose mode on (True) or off (False). Defaults to off." +msgstr "开启(True)或关闭(False)转置模式。默认关闭。" + +#: ../../library/omv.csi.rst:346 +msgid "vflip=False, hmirror=False, transpose=False -> 0 degree rotation" +msgstr "vflip=False, hmirror=False, transpose=False -> 旋转 0 度" + +#: ../../library/omv.csi.rst:347 +msgid "vflip=True, hmirror=False, transpose=True -> 90 degree rotation" +msgstr "vflip=True, hmirror=False, transpose=True -> 旋转 90 度" + +#: ../../library/omv.csi.rst:348 +msgid "vflip=True, hmirror=True, transpose=False -> 180 degree rotation" +msgstr "vflip=True, hmirror=True, transpose=False -> 旋转 180 度" + +#: ../../library/omv.csi.rst:349 +msgid "vflip=False, hmirror=True, transpose=True -> 270 degree rotation" +msgstr "vflip=False, hmirror=True, transpose=True -> 旋转 270 度" + +#: ../../library/omv.csi.rst:355 +msgid "Turns auto rotation mode on (True) or off (False). Defaults to off." +msgstr "开启(True)或关闭(False)自动旋转模式。默认关闭。" + +#: ../../library/omv.csi.rst:361 +msgid "" +"This method only works when the OpenMV Cam has an `imu` installed and is " +"enabled automatically." +msgstr "此方法仅在 OpenMV Cam 安装了 `imu` 时有效,并会自动启用。" + +#: ../../library/omv.csi.rst:365 +msgid "" +"Sets the number of frame buffers used to receive image data. By default " +"your OpenMV Cam will automatically try to allocate the maximum number of " +"frame buffers it can possibly allocate to ensure the best performance. " +"Automatic reallocation of frame buffers occurs whenever you call " +"`CSI.pixformat()`, `CSI.framesize()`, and `CSI.window()`." +msgstr "设置用于接收图像数据的帧缓冲区数量。默认情况下,您的 OpenMV Cam 会自动尝试分配尽可能多的帧缓冲区以确保最佳性能。每当您调用 `CSI.pixformat()`、`CSI.framesize()` 和 `CSI.window()` 时,帧缓冲区会自动重新分配。" + +#: ../../library/omv.csi.rst:370 +msgid "" +"`CSI.snapshot()` will automatically handle switching active frame buffers" +" in the background. From your code's perspective there is only ever 1 " +"active frame buffer even though there might be more than 1 frame buffer " +"on the system and another frame buffer receiving data in the background." +msgstr "`CSI.snapshot()` 会在后台自动处理活动帧缓冲区的切换。从您的代码角度来看,始终只有 1 个活动帧缓冲区,即使系统上可能有多个帧缓冲区并且另一个帧缓冲区正在后台接收数据。" + +#: ../../library/omv.csi.rst:374 +msgid "If count is:" +msgstr "如果 count 为:" + +#: ../../library/omv.csi.rst:376 +msgid "1 - Single Buffer Mode" +msgstr "1 - 单缓冲模式" + +#: ../../library/omv.csi.rst:377 +msgid "" +"In single buffer mode your OpenMV Cam will allocate one frame buffer for " +"receiving images. When you call `CSI.snapshot()` that framebuffer will be" +" used to receive the image and the camera driver will continue to run. In" +" the advent you call `CSI.snapshot()` again before the first line of the " +"next frame is received your code will execute at the frame rate of the " +"camera. Otherwise, the image will be dropped." +msgstr "在单缓冲模式下,您的 OpenMV Cam 将分配一个帧缓冲区用于接收图像。当您调用 `CSI.snapshot()` 时,该帧缓冲区将用于接收图像,摄像头驱动程序将继续运行。如果您在下一帧的第一行接收之前再次调用 `CSI.snapshot()`,您的代码将以摄像头的帧率执行。否则,图像将被丢弃。" + +#: ../../library/omv.csi.rst:383 +msgid "2 - Double Buffer Mode" +msgstr "2 - 双缓冲模式" + +#: ../../library/omv.csi.rst:384 +msgid "" +"In double buffer mode your OpenMV Cam will allocate two frame buffers for" +" receiving images. When you call `CSI.snapshot()` one framebuffer will be" +" used to receive the image and the camera driver will continue to run. " +"When the next frame is received it will be stored in the other frame " +"buffer. In the advent you call `CSI.snapshot()` again before the first " +"line of the next frame after is received your code will execute at the " +"frame rate of the camera. Otherwise, the image will be dropped." +msgstr "在双缓冲模式下,您的 OpenMV Cam 将分配两个帧缓冲区用于接收图像。当您调用 `CSI.snapshot()` 时,一个帧缓冲区将用于接收图像,摄像头驱动程序将继续运行。当接收到下一帧时,它将存储在另一个帧缓冲区中。如果您在下一帧之后的第一行接收之前再次调用 `CSI.snapshot()`,您的代码将以摄像头的帧率执行。否则,图像将被丢弃。" + +#: ../../library/omv.csi.rst:391 +msgid "3 - Triple Buffer Mode" +msgstr "3 - 三缓冲模式" + +#: ../../library/omv.csi.rst:392 +msgid "" +"In triple buffer mode your OpenMV Cam will allocate three buffers for " +"receiving images. In this mode there is always a frame buffer to store " +"the received image to in the background resulting in the highest " +"performance and lowest latency for reading the latest received frame. No " +"frames are ever dropped in this mode. The next frame read by " +"`CSI.snapshot()` is the last captured frame by the sensor driver (e.g. if" +" you are reading slower than the camera frame rate then the older frame " +"in the possible frames available is skipped)." +msgstr "在三缓冲模式下,您的 OpenMV Cam 将分配三个缓冲区用于接收图像。在此模式下,后台始终有一个帧缓冲区可用于存储接收到的图像,从而实现最高性能和最低延迟来读取最新接收的帧。在此模式下不会丢弃任何帧。`CSI.snapshot()` 读取的下一帧是传感器驱动程序最后捕获的帧(例如,如果您的读取速度低于摄像头帧率,则可用帧中较旧的帧将被跳过)。" + +#: ../../library/omv.csi.rst:399 +msgid "" +"Regarding the reallocation above, triple buffering is tried first, then " +"double buffering, and then single buffering." +msgstr "关于上述重新分配,首先尝试三缓冲,然后是双缓冲,最后是单缓冲。" + +#: ../../library/omv.csi.rst:402 +msgid "" +"You may pass a value of 4 or greater to put the sensor driver into video " +"FIFO mode where received images are stored in a frame buffer FIFO with " +"``count`` buffers. This is useful for video recording to an SD card which" +" may randomly block your code from writing data when the SD card is " +"performing house-keeping tasks like pre-erasing blocks to write data to." +msgstr "您可以传递 4 或更大的值以将传感器驱动程序置于视频 FIFO 模式,接收到的图像将存储在具有 ``count`` 个缓冲区的帧缓冲区 FIFO 中。这对于录制视频到 SD 卡很有用,因为 SD 卡在执行预擦除块等维护任务时可能会随机阻塞您的代码写入数据。" + +#: ../../library/omv.csi.rst:407 +msgid "" +"``expand`` allows for allocating more memory in each frame buffer than " +"required for the framebuffer framesize and pixformat when set to " +"``True``. This is useful to allow for modifications of the `Image` in the" +" framebuffer in-place versus things like `Image.scale()` requiring a new " +"allocation." +msgstr "``expand`` 设置为 ``True`` 时,允许在每个帧缓冲区中分配比帧缓冲区帧大小和像素格式所需更多的内存。这对于允许在帧缓冲区中就地修改 `Image` 很有用,而不是像 `Image.scale()` 那样需要新的内存分配。" + +#: ../../library/omv.csi.rst:413 +msgid "" +"On frame drop (no buffers available to receive the next frame) all frame " +"buffers are automatically cleared except the active frame buffer. This is" +" done to ensure `CSI.snapshot()` returns current frames and not frames " +"from long ago." +msgstr "当帧丢弃时(没有可用缓冲区接收下一帧),除活动帧缓冲区外的所有帧缓冲区都会自动清除。这样做是为了确保 `CSI.snapshot()` 返回当前帧而不是很久以前的帧。" + +#: ../../library/omv.csi.rst:417 +msgid "" +"Fun fact, you can pass a value of 100 or so on OpenMV Cam's with SDRAM " +"for a huge video fifo. If you then call snapshot slower than the camera " +"frame rate (by adding `machine.sleep()`) you'll get slow-mo effects in " +"OpenMV IDE. However, you will also see the above policy effect of " +"resetting the frame buffer on a frame drop to ensure that frames do not " +"get too old. If you want to record slow-mo video just record video " +"normally to the SD card and then play the video back on a desktop machine" +" slower than it was recorded." +msgstr "有趣的是,您可以在带有 SDRAM 的 OpenMV Cam 上传递 100 左右的值来获得巨大的视频 FIFO。如果您以低于摄像头帧率的速度调用 snapshot(通过添加 `machine.sleep()`),您将在 OpenMV IDE 中获得慢动作效果。但是,您也会看到上述帧丢弃时重置帧缓冲区的策略效果,以确保帧不会过于陈旧。如果您想录制慢动作视频,只需正常录制视频到 SD 卡,然后在桌面计算机上以低于录制速度播放即可。" + +#: ../../library/omv.csi.rst:428 +msgid "``effect`` Special digital effect value." +msgstr "``effect`` 特殊数字效果值。" + +#: ../../library/omv.csi.rst:430 ../../library/omv.csi.rst:438 +msgid "Returns ``True`` on success and ``False`` on failure." +msgstr "成功返回 ``True``,失败返回 ``False``。" + +#: ../../library/omv.csi.rst:434 +msgid "" +"``enable`` True to enable and False to disable (bool). ``radi`` integer " +"radius of pixels to correct (int). ``coef`` power of correction (int)." +msgstr "``enable`` True 启用,False 禁用(布尔值)。``radi`` 要校正的像素半径整数值(int)。``coef`` 校正强度(int)。" + +#: ../../library/omv.csi.rst:442 +msgid "" +"Registers callback ``cb`` to be executed (in interrupt context) whenever " +"the camera module generates a new frame (but, before the frame is " +"received)." +msgstr "注册回调函数 ``cb``,在摄像头模块生成新帧时(但在帧被接收之前)在中断上下文中执行。" + +#: ../../library/omv.csi.rst:445 +msgid "" +"``cb`` takes one argument and is passed the current state of the vsync " +"pin after changing." +msgstr "``cb`` 接受一个参数,传入 vsync 引脚变化后的当前状态。" + +#: ../../library/omv.csi.rst:447 ../../library/omv.csi.rst:458 +msgid "Returns the callback if passed no arguments." +msgstr "如果不传参数则返回回调函数。" + +#: ../../library/omv.csi.rst:451 +msgid "" +"Registers callback ``cb`` to be executed (in interrupt context) whenever " +"the camera module generates a new frame and the frame is ready to be read" +" via `CSI.snapshot()`." +msgstr "注册回调函数 ``cb``,在摄像头模块生成新帧且帧已准备好通过 `CSI.snapshot()` 读取时在中断上下文中执行。" + +#: ../../library/omv.csi.rst:454 +msgid "``cb`` takes no arguments." +msgstr "``cb`` 不接受参数。" + +#: ../../library/omv.csi.rst:456 +msgid "" +"Use this to get an interrupt to schedule reading a frame later with " +"`micropython.schedule()`." +msgstr "使用此方法获取中断,以便稍后通过 `micropython.schedule()` 调度帧读取。" + +#: ../../library/omv.csi.rst:462 +msgid "Executes a sensor specific method:" +msgstr "执行传感器特定方法:" + +#: ../../library/omv.csi.rst:464 +msgid "" +"`csi.IOCTL_SET_READOUT_WINDOW` - Pass this enum followed by a rect tuple " +"(x, y, w, h) or a size tuple (w, h)." +msgstr "`csi.IOCTL_SET_READOUT_WINDOW` - 传递此枚举值,后跟矩形元组 (x, y, w, h) 或大小元组 (w, h)。" + +#: ../../library/omv.csi.rst:465 +msgid "" +"This IOCTL allows you to control the readout window of the camera sensor " +"which dramatically improves the frame rate at the cost of field-of-view." +msgstr "此 IOCTL 允许您控制摄像头传感器的读出窗口,以牺牲视野为代价显著提高帧率。" + +#: ../../library/omv.csi.rst:466 +msgid "" +"If you pass a rect tuple (x, y, w, h) the readout window will be " +"positoned on that rect tuple. The rect tuple's x/y position will be " +"adjusted so the size w/h fits. Additionally, the size w/h will be " +"adjusted to not be smaller than the ``framesize``." +msgstr "如果传递矩形元组 (x, y, w, h),读出窗口将定位在该矩形元组上。矩形元组的 x/y 位置将被调整以适应 w/h 大小。此外,w/h 大小将被调整为不小于 ``framesize``。" + +#: ../../library/omv.csi.rst:467 +msgid "" +"If you pass a size tuple (w, h) the readout window will be centered given" +" the w/h. Additionally, the size w/h will be adjusted to not be smaller " +"than the ``framesize``." +msgstr "如果传递大小元组 (w, h),读出窗口将根据 w/h 居中。此外,w/h 大小将被调整为不小于 ``framesize``。" + +#: ../../library/omv.csi.rst:468 +msgid "" +"This IOCTL is extremely helpful for increasing the frame rate on higher " +"resolution cameras like the OV2640/OV5640." +msgstr "此 IOCTL 对于提高 OV2640/OV5640 等高分辨率摄像头的帧率非常有帮助。" + +#: ../../library/omv.csi.rst:469 +msgid "" +"`csi.IOCTL_GET_READOUT_WINDOW` - Pass this enum for `CSI.ioctl` to return" +" the current readout window rect tuple (x, y, w, h). By default this is " +"(0, 0, maximum_camera_sensor_pixel_width, " +"maximum_camera_sensor_pixel_height)." +msgstr "`csi.IOCTL_GET_READOUT_WINDOW` - 传递此枚举值让 `CSI.ioctl` 返回当前读出窗口矩形元组 (x, y, w, h)。默认值为 (0, 0, 最大摄像头传感器像素宽度, 最大摄像头传感器像素高度)。" + +#: ../../library/omv.csi.rst:470 +msgid "" +"`csi.IOCTL_SET_TRIGGERED_MODE` - Pass this enum followed by True or False" +" set triggered mode for the MT9V034 sensor." +msgstr "`csi.IOCTL_SET_TRIGGERED_MODE` - 传递此枚举值后跟 True 或 False 来设置 MT9V034 传感器的触发模式。" + +#: ../../library/omv.csi.rst:471 +msgid "" +"`csi.IOCTL_GET_TRIGGERED_MODE` - Pass this enum for `CSI.ioctl` to return" +" the current triggered mode state." +msgstr "`csi.IOCTL_GET_TRIGGERED_MODE` - 传递此枚举值让 `CSI.ioctl` 返回当前触发模式状态。" + +#: ../../library/omv.csi.rst:472 +msgid "" +"`csi.IOCTL_SET_FOV_WIDE` - Pass this enum followed by True or False " +"enable `CSI.framesize()` to optimize for the field-of-view over FPS." +msgstr "`csi.IOCTL_SET_FOV_WIDE` - 传递此枚举值后跟 True 或 False 来启用 `CSI.framesize()` 优先优化视野而非帧率。" + +#: ../../library/omv.csi.rst:473 +msgid "" +"`csi.IOCTL_GET_FOV_WIDE` - Pass this enum for `CSI.ioctl` to return the " +"current field-of-view over fps optimization state." +msgstr "`csi.IOCTL_GET_FOV_WIDE` - 传递此枚举值让 `CSI.ioctl` 返回当前视野优先于帧率的优化状态。" + +#: ../../library/omv.csi.rst:474 +msgid "" +"`csi.IOCTL_TRIGGER_AUTO_FOCUS` - Pass this enum for `CSI.ioctl` to " +"trigger auto focus on the OV5640 FPC camera module." +msgstr "`csi.IOCTL_TRIGGER_AUTO_FOCUS` - 传递此枚举值让 `CSI.ioctl` 在 OV5640 FPC 摄像头模块上触发自动对焦。" + +#: ../../library/omv.csi.rst:475 +msgid "" +"`csi.IOCTL_PAUSE_AUTO_FOCUS` - Pass this enum for `CSI.ioctl` to pause " +"auto focus (after triggering) on the OV5640 FPC camera module." +msgstr "`csi.IOCTL_PAUSE_AUTO_FOCUS` - 传递此枚举值让 `CSI.ioctl` 在 OV5640 FPC 摄像头模块上暂停自动对焦(触发后)。" + +#: ../../library/omv.csi.rst:476 +msgid "" +"`csi.IOCTL_RESET_AUTO_FOCUS` - Pass this enum for `CSI.ioctl` to reset " +"auto focus (after triggering) on the OV5640 FPC camera module." +msgstr "`csi.IOCTL_RESET_AUTO_FOCUS` - 传递此枚举值让 `CSI.ioctl` 在 OV5640 FPC 摄像头模块上重置自动对焦(触发后)。" + +#: ../../library/omv.csi.rst:477 +msgid "" +"`csi.IOCTL_WAIT_ON_AUTO_FOCUS` - Pass this enum for `CSI.ioctl` to wait " +"for auto focus (after triggering) to finish on the OV5640 FPC camera " +"module. You may pass a second argument of the timeout in milliseconds. " +"The default is 5000 ms." +msgstr "`csi.IOCTL_WAIT_ON_AUTO_FOCUS` - 传递此枚举值让 `CSI.ioctl` 等待 OV5640 FPC 摄像头模块上的自动对焦(触发后)完成。您可以传递第二个参数作为超时时间(毫秒)。默认为 5000 毫秒。" + +#: ../../library/omv.csi.rst:478 +msgid "" +"`csi.IOCTL_SET_NIGHT_MODE` - Pass this enum followed by True or False set" +" nightmode the OV7725 and OV5640 sensors." +msgstr "`csi.IOCTL_SET_NIGHT_MODE` - 传递此枚举值后跟 True 或 False 来设置 OV7725 和 OV5640 传感器的夜间模式。" + +#: ../../library/omv.csi.rst:479 +msgid "" +"`csi.IOCTL_GET_NIGHT_MODE` - Pass this enum for `CSI.ioctl` to return the" +" current night mode state." +msgstr "`csi.IOCTL_GET_NIGHT_MODE` - 传递此枚举值让 `CSI.ioctl` 返回当前夜间模式状态。" + +#: ../../library/omv.csi.rst:480 +msgid "" +"`csi.IOCTL_LEPTON_GET_WIDTH` - Pass this enum to get the FLIR Lepton " +"image width in pixels." +msgstr "`csi.IOCTL_LEPTON_GET_WIDTH` - 传递此枚举值以获取 FLIR Lepton 图像宽度(像素)。" + +#: ../../library/omv.csi.rst:481 +msgid "" +"`csi.IOCTL_LEPTON_GET_HEIGHT` - Pass this enum to get the FLIR Lepton " +"image height in pixels." +msgstr "`csi.IOCTL_LEPTON_GET_HEIGHT` - 传递此枚举值以获取 FLIR Lepton 图像高度(像素)。" + +#: ../../library/omv.csi.rst:482 +msgid "" +"`csi.IOCTL_LEPTON_GET_RADIOMETRY` - Pass this enum to get the FLIR Lepton" +" type (radiometric or not)." +msgstr "`csi.IOCTL_LEPTON_GET_RADIOMETRY` - 传递此枚举值以获取 FLIR Lepton 类型(是否为辐射测量型)。" + +#: ../../library/omv.csi.rst:483 +msgid "" +"`csi.IOCTL_LEPTON_GET_REFRESH` - Pass this enum to get the FLIR Lepton " +"refresh rate in hertz." +msgstr "`csi.IOCTL_LEPTON_GET_REFRESH` - 传递此枚举值以获取 FLIR Lepton 刷新率(赫兹)。" + +#: ../../library/omv.csi.rst:484 +msgid "" +"`csi.IOCTL_LEPTON_GET_RESOLUTION` - Pass this enum to get the FLIR Lepton" +" ADC resolution in bits." +msgstr "`csi.IOCTL_LEPTON_GET_RESOLUTION` - 传递此枚举值以获取 FLIR Lepton ADC 分辨率(位)。" + +#: ../../library/omv.csi.rst:485 +msgid "" +"`csi.IOCTL_LEPTON_RUN_COMMAND` - Pass this enum to execute a FLIR Lepton " +"SDK command. You need to pass an additional 16-bit value after the enum " +"as the command to execute." +msgstr "`csi.IOCTL_LEPTON_RUN_COMMAND` - 传递此枚举值以执行 FLIR Lepton SDK 命令。您需要在枚举值之后传递一个额外的 16 位值作为要执行的命令。" + +#: ../../library/omv.csi.rst:486 +msgid "" +"`csi.IOCTL_LEPTON_SET_ATTRIBUTE` - Pass this enum to set a FLIR Lepton " +"SDK attribute." +msgstr "`csi.IOCTL_LEPTON_SET_ATTRIBUTE` - 传递此枚举值以设置 FLIR Lepton SDK 属性。" + +#: ../../library/omv.csi.rst:487 ../../library/omv.csi.rst:490 +msgid "" +"The first argument is the 16-bit attribute ID to set (set the FLIR Lepton" +" SDK)." +msgstr "第一个参数是要设置的 16 位属性 ID(参见 FLIR Lepton SDK)。" + +#: ../../library/omv.csi.rst:488 +msgid "" +"The second argument is a MicroPython byte array of bytes to write (should" +" be a multiple of 16-bits). Create the byte array using ``struct`` " +"following the FLIR Lepton SDK." +msgstr "第二个参数是要写入的 MicroPython 字节数组(应为 16 位的倍数)。按照 FLIR Lepton SDK 使用 ``struct`` 创建字节数组。" + +#: ../../library/omv.csi.rst:489 +msgid "" +"`csi.IOCTL_LEPTON_GET_ATTRIBUTE` - Pass this enum to get a FLIR Lepton " +"SDK attribute." +msgstr "`csi.IOCTL_LEPTON_GET_ATTRIBUTE` - 传递此枚举值以获取 FLIR Lepton SDK 属性。" + +#: ../../library/omv.csi.rst:491 +msgid "" +"Returns a MicroPython byte array of the attribute. Use ``struct`` to " +"deserialize the byte array following the FLIR Lepton SDK." +msgstr "返回属性的 MicroPython 字节数组。按照 FLIR Lepton SDK 使用 ``struct`` 反序列化字节数组。" + +#: ../../library/omv.csi.rst:492 +msgid "" +"`csi.IOCTL_LEPTON_GET_FPA_TEMP` - Pass this enum to get the FLIR Lepton " +"FPA Temp in celsius." +msgstr "`csi.IOCTL_LEPTON_GET_FPA_TEMP` - 传递此枚举值以获取 FLIR Lepton FPA 温度(摄氏度)。" + +#: ../../library/omv.csi.rst:493 +msgid "" +"`csi.IOCTL_LEPTON_GET_AUX_TEMP` - Pass this enum to get the FLIR Lepton " +"AUX Temp in celsius." +msgstr "`csi.IOCTL_LEPTON_GET_AUX_TEMP` - 传递此枚举值以获取 FLIR Lepton AUX 温度(摄氏度)。" + +#: ../../library/omv.csi.rst:494 +msgid "" +"`csi.IOCTL_LEPTON_SET_MODE` - Pass this followed by True or False to turn" +" off automatic gain control on the FLIR Lepton and force it to output an " +"image where each pixel value represents an exact temperature value in " +"celsius. A second True enables high temperature mode enabling " +"measurements up to 500C on the Lepton 3.5, False is the default low " +"temperature mode." +msgstr "`csi.IOCTL_LEPTON_SET_MODE` - 传递此值后跟 True 或 False 来关闭 FLIR Lepton 的自动增益控制,并强制其输出每个像素值代表精确摄氏温度值的图像。第二个 True 启用高温模式,在 Lepton 3.5 上可测量高达 500°C,False 为默认低温模式。" + +#: ../../library/omv.csi.rst:495 +msgid "" +"`csi.IOCTL_LEPTON_GET_MODE` - Pass this to get a tuple for (measurement-" +"mode-enabled, high-temp-enabled)." +msgstr "`csi.IOCTL_LEPTON_GET_MODE` - 传递此值以获取 (测量模式是否启用, 高温模式是否启用) 元组。" + +#: ../../library/omv.csi.rst:496 +msgid "" +"`csi.IOCTL_LEPTON_SET_RANGE` - Pass this when measurement mode is enabled" +" to set the temperature range in celsius for the mapping operation. The " +"temperature image returned by the FLIR Lepton will then be clamped " +"between these min and max values and then scaled to values between 0 to " +"255. To map a pixel value back to a temperature (on a grayscale image) " +"do: ((pixel * (max_temp_in_celsius - min_temp_in_celsius)) / 255.0) + " +"min_temp_in_celsius." +msgstr "`csi.IOCTL_LEPTON_SET_RANGE` - 在测量模式启用时传递此值以设置映射操作的温度范围(摄氏度)。FLIR Lepton 返回的温度图像将被限制在这些最小值和最大值之间,然后缩放到 0 到 255 之间的值。要将像素值映射回温度(在灰度图像上),请执行:((pixel * (max_temp_in_celsius - min_temp_in_celsius)) / 255.0) + min_temp_in_celsius。" + +#: ../../library/omv.csi.rst:497 +msgid "The first arugment should be the min temperature in celsius." +msgstr "第一个参数应为最低温度(摄氏度)。" + +#: ../../library/omv.csi.rst:498 +msgid "" +"The second argument should be the max temperature in celsius. If the " +"arguments are reversed the library will automatically swap them for you." +msgstr "第二个参数应为最高温度(摄氏度)。如果参数顺序颠倒,库会自动为您交换。" + +#: ../../library/omv.csi.rst:499 +msgid "" +"`csi.IOCTL_LEPTON_GET_RANGE` - Pass this to return the sorted (min, max) " +"2 value temperature range tuple. The default is -10C to 40C if not set " +"yet." +msgstr "`csi.IOCTL_LEPTON_GET_RANGE` - 传递此值以返回排序后的 (最小值, 最大值) 双值温度范围元组。如果尚未设置,默认为 -10°C 到 40°C。" + +#: ../../library/omv.csi.rst:500 +msgid "" +"`csi.IOCTL_HIMAX_MD_ENABLE` - Pass this enum followed by " +"``True``/``False`` to enable/disable motion detection on the HM01B0. You " +"should also enable the I/O pin (PC15 on the Arduino Portenta) attached " +"the HM01B0 motion detection line to receive an interrupt." +msgstr "`csi.IOCTL_HIMAX_MD_ENABLE` - 传递此枚举值后跟 ``True``/``False`` 来启用/禁用 HM01B0 上的运动检测。您还应启用连接到 HM01B0 运动检测线的 I/O 引脚(Arduino Portenta 上的 PC15)以接收中断。" + +#: ../../library/omv.csi.rst:501 +msgid "" +"`csi.IOCTL_HIMAX_MD_CLEAR` - Pass this enum to clear the motion detection" +" interrupt on the HM01B0." +msgstr "`csi.IOCTL_HIMAX_MD_CLEAR` - 传递此枚举值以清除 HM01B0 上的运动检测中断。" + +#: ../../library/omv.csi.rst:502 +msgid "" +"`csi.IOCTL_HIMAX_MD_WINDOW` - Pass this enum followed by (x1, y1, x2, y2)" +" to set the motion detection window on the HM01B0." +msgstr "`csi.IOCTL_HIMAX_MD_WINDOW` - 传递此枚举值后跟 (x1, y1, x2, y2) 来设置 HM01B0 上的运动检测窗口。" + +#: ../../library/omv.csi.rst:503 +msgid "" +"`csi.IOCTL_HIMAX_MD_THRESHOLD` - Pass this enum followed by a threshold " +"value (0-255) to set the motion detection threshold on the HM01B0." +msgstr "`csi.IOCTL_HIMAX_MD_THRESHOLD` - 传递此枚举值后跟阈值(0-255)来设置 HM01B0 上的运动检测阈值。" + +#: ../../library/omv.csi.rst:504 +msgid "" +"`csi.IOCTL_HIMAX_OSC_ENABLE` - Pass this enum followed by " +"``True``/``False`` to enable/disable the oscillator HM01B0 to save power." +msgstr "`csi.IOCTL_HIMAX_OSC_ENABLE` - 传递此枚举值后跟 ``True``/``False`` 来启用/禁用 HM01B0 振荡器以节省功耗。" + +#: ../../library/omv.csi.rst:505 +msgid "" +"`csi.IOCTL_RGB_STATS` - Pass this enum to get the RGB statistics from the" +" camera sensor. Returns a tuple of (r, gb, gr, b) values." +msgstr "`csi.IOCTL_RGB_STATS` - 传递此枚举值以从摄像头传感器获取 RGB 统计数据。返回 (r, gb, gr, b) 值的元组。" + +#: ../../library/omv.csi.rst:506 +msgid "" +"`csi.IOCTL_GENX320_SET_BIASES` - Pass this enum followed by a bias enum " +"to set the GENX320 sensor biases." +msgstr "`csi.IOCTL_GENX320_SET_BIASES` - 传递此枚举值后跟偏置枚举来设置 GENX320 传感器偏置。" + +#: ../../library/omv.csi.rst:507 +msgid "" +"`csi.IOCTL_GENX320_SET_BIAS` - Pass this enum followed by a bias enum and" +" a bias value to set the GENX320 sensor bias." +msgstr "`csi.IOCTL_GENX320_SET_BIAS` - 传递此枚举值后跟偏置枚举和偏置值来设置 GENX320 传感器偏置。" + +#: ../../library/omv.csi.rst:508 +msgid "" +"`csi.IOCTL_GENX320_SET_AFK` - Pass this enum followed by ``enable``, " +"``freq_low_in_hz``, ``freq_high_in_hz`` to change the GENX320 anti-" +"flickering-filter settings." +msgstr "`csi.IOCTL_GENX320_SET_AFK` - 传递此枚举值后跟 ``enable``、``freq_low_in_hz``、``freq_high_in_hz`` 来更改 GENX320 抗闪烁滤波器设置。" + +#: ../../library/omv.csi.rst:509 +msgid "" +"`csi.IOCTL_GENX320_SET_MODE` - Pass this enum followed by a " +"``GENX320_MODE`` to change the camera operating mode. For event mode, you" +" must additionally pass the length of the row axis of the event " +"``ndarray``." +msgstr "`csi.IOCTL_GENX320_SET_MODE` - 传递此枚举值后跟 ``GENX320_MODE`` 来更改摄像头工作模式。对于事件模式,您还必须传递事件 ``ndarray`` 行轴的长度。" + +#: ../../library/omv.csi.rst:510 +msgid "" +"`csi.IOCTL_GENX320_READ_EVENTS` - Populates a passed uint16 ``ndarray`` " +"with post-processed events from the camera." +msgstr "`csi.IOCTL_GENX320_READ_EVENTS` - 用摄像头的后处理事件填充传入的 uint16 ``ndarray``。" + +#: ../../library/omv.csi.rst:511 +msgid "Shape: (EVT_res, 6) where EVT_res is the event resolution" +msgstr "形状:(EVT_res, 6),其中 EVT_res 为事件分辨率" + +#: ../../library/omv.csi.rst:512 +msgid "EVT_res: must be a power of two between 1024 and 65536." +msgstr "EVT_res:必须是 1024 到 65536 之间的 2 的幂。" + +#: ../../library/omv.csi.rst:513 +msgid "Columns:" +msgstr "列:" + +#: ../../library/omv.csi.rst:514 +msgid "[0] Event type (PIX_ON/OFF, TRIGGER, etc.)" +msgstr "[0] 事件类型(PIX_ON/OFF、TRIGGER 等)" + +#: ../../library/omv.csi.rst:515 +msgid "[1] Seconds timestamp" +msgstr "[1] 秒时间戳" + +#: ../../library/omv.csi.rst:516 +msgid "[2] Milliseconds timestamp" +msgstr "[2] 毫秒时间戳" + +#: ../../library/omv.csi.rst:517 +msgid "[3] Microseconds timestamp" +msgstr "[3] 微秒时间戳" + +#: ../../library/omv.csi.rst:518 +msgid "[4] X coordinate 0 to 319 for GENX320" +msgstr "[4] X 坐标 0 到 319(适用于 GENX320)" + +#: ../../library/omv.csi.rst:519 +msgid "[5] Y coordinate 0 to 319 for GENX320" +msgstr "[5] Y 坐标 0 到 319(适用于 GENX320)" + +#: ../../library/omv.csi.rst:520 +msgid "" +"`csi.IOCTL_GENX320_CALIBRATE` - Pass this enum followed by a sigma " +"floating point value to turn off pixel values out of sigma standard " +"deviation from the normal distribution on the GENX320 camera module." +msgstr "`csi.IOCTL_GENX320_CALIBRATE` - 传递此枚举值后跟 sigma 浮点值,以关闭 GENX320 摄像头模块上超出正态分布 sigma 标准差的像素值。" + +#: ../../library/omv.csi.rst:524 +msgid "" +"Sets the color palette to use for things like FLIR Lepton grayscale to " +"RGB565 conversion." +msgstr "设置用于 FLIR Lepton 灰度到 RGB565 转换等操作的调色板。" + +#: ../../library/omv.csi.rst:530 +msgid "Write ``value`` (int) to camera register at ``address`` (int)." +msgstr "将 ``value`` (int)写入 ``address`` (int)处的摄像头寄存器。" + +#: ../../library/omv.csi.rst:532 ../../library/omv.csi.rst:538 +msgid "See the camera data sheet for register info." +msgstr "有关寄存器信息,请参阅摄像头数据手册。" + +#: ../../library/omv.csi.rst:536 +msgid "Read camera register at ``address`` (int)." +msgstr "读取 ``address`` (int)处的摄像头寄存器。" + +#: ../../library/omv.csi.rst:541 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.csi.rst:545 +msgid "Returns of list of the detected sensor chip IDs." +msgstr "返回检测到的传感器芯片 ID 列表。" + +#: ../../library/omv.csi.rst:548 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.csi.rst:553 +msgid "BINARY (bitmap) pixel format. Each pixel is 1-bit." +msgstr "BINARY(位图)像素格式。每像素 1 位。" + +#: ../../library/omv.csi.rst:555 +msgid "This format is usful for mask storage. Can be used with `Image()`." +msgstr "此格式适用于掩码存储。可与 `Image()` 一起使用。" + +#: ../../library/omv.csi.rst:560 +msgid "GRAYSCALE pixel format (Y from YUV422). Each pixel is 8-bits, 1-byte." +msgstr "GRAYSCALE 像素格式(来自 YUV422 的 Y 分量)。每像素 8 位,1 字节。" + +#: ../../library/omv.csi.rst:562 +msgid "" +"All of our computer vision algorithms run faster on grayscale images than" +" RGB565 images." +msgstr "我们所有的计算机视觉算法在灰度图像上的运行速度都比 RGB565 图像快。" + +#: ../../library/omv.csi.rst:568 +msgid "" +"RGB565 pixel format. Each pixel is 16-bits, 2-bytes. 5-bits are used for " +"red, 6-bits are used for green, and 5-bits are used for blue." +msgstr "RGB565 像素格式。每像素 16 位,2 字节。红色使用 5 位,绿色使用 6 位,蓝色使用 5 位。" + +#: ../../library/omv.csi.rst:571 +msgid "" +"All of our computer vision algorithms run slower on RGB565 images than " +"grayscale images." +msgstr "我们所有的计算机视觉算法在 RGB565 图像上的运行速度都比灰度图像慢。" + +#: ../../library/omv.csi.rst:577 +msgid "" +"RAW BAYER image pixel format. If you try to make the frame size too big " +"to fit in the frame buffer your OpenMV Cam will set the pixel format to " +"BAYER so that you can capture images but only some image processing " +"methods will be operational." +msgstr "RAW BAYER 图像像素格式。如果您尝试使帧大小太大而无法放入帧缓冲区,您的 OpenMV Cam 将把像素格式设置为 BAYER,这样您可以捕获图像,但只有部分图像处理方法可以使用。" + +#: ../../library/omv.csi.rst:585 +msgid "" +"A pixel format that is very easy to jpeg compress. Each pixel is stored " +"as a grayscale 8-bit Y value followed by alternating 8-bit U/V color " +"values that are shared between two Y values (8-bits Y1, 8-bits U, 8-bits " +"Y2, 8-bits V, etc.). Only some image processing methods work with YUV422." +msgstr "一种非常容易进行 JPEG 压缩的像素格式。每个像素存储为灰度 8 位 Y 值,后跟在两个 Y 值之间共享的交替 8 位 U/V 颜色值(8 位 Y1、8 位 U、8 位 Y2、8 位 V,等等)。只有部分图像处理方法支持 YUV422。" + +#: ../../library/omv.csi.rst:593 +msgid "" +"JPEG mode. The camera module outputs compressed jpeg images. Use " +"`CSI.quality()` to control the jpeg quality. Only works for the " +"OV2640/OV5640 cameras." +msgstr "JPEG 模式。摄像头模块输出压缩的 JPEG 图像。使用 `CSI.quality()` 控制 JPEG 质量。仅适用于 OV2640/OV5640 摄像头。" + +#: ../../library/omv.csi.rst:600 +msgid "`CSI.cid()` returns this for the OV2640 camera." +msgstr "`CSI.cid()` 对 OV2640 摄像头返回此值。" + +#: ../../library/omv.csi.rst:605 +msgid "`CSI.cid()` returns this for the OV5640 camera." +msgstr "`CSI.cid()` 对 OV5640 摄像头返回此值。" + +#: ../../library/omv.csi.rst:610 +msgid "`CSI.cid()` returns this for the OV7670 camera." +msgstr "`CSI.cid()` 对 OV7670 摄像头返回此值。" + +#: ../../library/omv.csi.rst:615 +msgid "`CSI.cid()` returns this for the OV7690 camera." +msgstr "`CSI.cid()` 对 OV7690 摄像头返回此值。" + +#: ../../library/omv.csi.rst:620 +msgid "`CSI.cid()` returns this for the OV7725 camera." +msgstr "`CSI.cid()` 对 OV7725 摄像头返回此值。" + +#: ../../library/omv.csi.rst:625 +msgid "`CSI.cid()` returns this for the OV9650 camera." +msgstr "`CSI.cid()` 对 OV9650 摄像头返回此值。" + +#: ../../library/omv.csi.rst:630 +msgid "`CSI.cid()` returns this for the MT9V022 camera." +msgstr "`CSI.cid()` 对 MT9V022 摄像头返回此值。" + +#: ../../library/omv.csi.rst:635 +msgid "`CSI.cid()` returns this for the MT9V024 camera." +msgstr "`CSI.cid()` 对 MT9V024 摄像头返回此值。" + +#: ../../library/omv.csi.rst:640 +msgid "`CSI.cid()` returns this for the MT9V032 camera." +msgstr "`CSI.cid()` 对 MT9V032 摄像头返回此值。" + +#: ../../library/omv.csi.rst:645 +msgid "`CSI.cid()` returns this for the MT9V034 camera." +msgstr "`CSI.cid()` 对 MT9V034 摄像头返回此值。" + +#: ../../library/omv.csi.rst:650 +msgid "`CSI.cid()` returns this for the MT9M114 camera." +msgstr "`CSI.cid()` 对 MT9M114 摄像头返回此值。" + +#: ../../library/omv.csi.rst:655 +msgid "`CSI.cid()` returns this for the BOSON 320x256 camera." +msgstr "`CSI.cid()` 对 BOSON 320x256 摄像头返回此值。" + +#: ../../library/omv.csi.rst:660 +msgid "`CSI.cid()` returns this for the BOSON 640x512 camera." +msgstr "`CSI.cid()` 对 BOSON 640x512 摄像头返回此值。" + +#: ../../library/omv.csi.rst:665 +msgid "`CSI.cid()` returns this for the LEPTON1/2/3 cameras." +msgstr "`CSI.cid()` 对 LEPTON1/2/3 摄像头返回此值。" + +#: ../../library/omv.csi.rst:670 +msgid "`CSI.cid()` returns this for the HM01B0 camera." +msgstr "`CSI.cid()` 对 HM01B0 摄像头返回此值。" + +#: ../../library/omv.csi.rst:675 +msgid "`CSI.cid()` returns this for the HM0360 camera." +msgstr "`CSI.cid()` 对 HM0360 摄像头返回此值。" + +#: ../../library/omv.csi.rst:680 +msgid "`CSI.cid()` returns this for the GC2145 camera." +msgstr "`CSI.cid()` 对 GC2145 摄像头返回此值。" + +#: ../../library/omv.csi.rst:685 +msgid "`CSI.cid()` returns this for the GENX320 (Engineering Samples) camera." +msgstr "`CSI.cid()` 对 GENX320(工程样品)摄像头返回此值。" + +#: ../../library/omv.csi.rst:690 +msgid "`CSI.cid()` returns this for the GENX320 camera." +msgstr "`CSI.cid()` 对 GENX320 摄像头返回此值。" + +#: ../../library/omv.csi.rst:695 +msgid "`CSI.cid()` returns this for the PAG7920 camera." +msgstr "`CSI.cid()` 对 PAG7920 摄像头返回此值。" + +#: ../../library/omv.csi.rst:700 +msgid "`CSI.cid()` returns this for the PAG7936 camera." +msgstr "`CSI.cid()` 对 PAG7936 摄像头返回此值。" + +#: ../../library/omv.csi.rst:705 +msgid "`CSI.cid()` returns this for the PS5520 camera." +msgstr "`CSI.cid()` 对 PS5520 摄像头返回此值。" + +#: ../../library/omv.csi.rst:710 +msgid "`CSI.cid()` returns this for the PAJ6100 camera." +msgstr "`CSI.cid()` 对 PAJ6100 摄像头返回此值。" + +#: ../../library/omv.csi.rst:715 +msgid "`CSI.cid()` returns this for the FROGEYE2020 camera." +msgstr "`CSI.cid()` 对 FROGEYE2020 摄像头返回此值。" + +#: ../../library/omv.csi.rst:720 +msgid "`CSI.cid()` returns this for the software CSI camera." +msgstr "`CSI.cid()` 对软件 CSI 摄像头返回此值。" + +#: ../../library/omv.csi.rst:725 +msgid "Set normal mode for `CSI.special_effect`." +msgstr "为 `CSI.special_effect` 设置正常模式。" + +#: ../../library/omv.csi.rst:730 +msgid "Set negative mode for `CSI.special_effect`." +msgstr "为 `CSI.special_effect` 设置负片模式。" + +#: ../../library/omv.csi.rst:735 +msgid "176x144 resolution for the camera sensor." +msgstr "摄像头传感器的 176x144 分辨率。" + +#: ../../library/omv.csi.rst:740 +msgid "352x288 resolution for the camera sensor." +msgstr "摄像头传感器的 352x288 分辨率。" + +#: ../../library/omv.csi.rst:745 +msgid "176x120 resolution for the camera sensor." +msgstr "摄像头传感器的 176x120 分辨率。" + +#: ../../library/omv.csi.rst:750 +msgid "352x240 resolution for the camera sensor." +msgstr "摄像头传感器的 352x240 分辨率。" + +#: ../../library/omv.csi.rst:755 +msgid "80x60 resolution for the camera sensor." +msgstr "摄像头传感器的 80x60 分辨率。" + +#: ../../library/omv.csi.rst:760 +msgid "160x120 resolution for the camera sensor." +msgstr "摄像头传感器的 160x120 分辨率。" + +#: ../../library/omv.csi.rst:765 +msgid "320x240 resolution for the camera sensor." +msgstr "摄像头传感器的 320x240 分辨率。" + +#: ../../library/omv.csi.rst:770 +msgid "640x480 resolution for the camera sensor." +msgstr "摄像头传感器的 640x480 分辨率。" + +#: ../../library/omv.csi.rst:775 +msgid "240x160 resolution for the camera sensor." +msgstr "摄像头传感器的 240x160 分辨率。" + +#: ../../library/omv.csi.rst:780 +msgid "480x320 resolution for the camera sensor." +msgstr "摄像头传感器的 480x320 分辨率。" + +#: ../../library/omv.csi.rst:785 +msgid "720x480 resolution for the MT9V034 camera sensor." +msgstr "MT9V034 摄像头传感器的 720x480 分辨率。" + +#: ../../library/omv.csi.rst:790 +msgid "752x480 resolution for the MT9V034 camera sensor." +msgstr "MT9V034 摄像头传感器的 752x480 分辨率。" + +#: ../../library/omv.csi.rst:795 +msgid "800x600 resolution for the camera sensor." +msgstr "摄像头传感器的 800x600 分辨率。" + +#: ../../library/omv.csi.rst:800 +msgid "1024x768 resolution for the camera sensor." +msgstr "摄像头传感器的 1024x768 分辨率。" + +#: ../../library/omv.csi.rst:805 +msgid "1280x768 resolution for the MT9M114 camera sensor." +msgstr "MT9M114 摄像头传感器的 1280x768 分辨率。" + +#: ../../library/omv.csi.rst:810 +msgid "" +"1280x1024 resolution for the camera sensor. Only works for the " +"OV2640/OV5640 cameras." +msgstr "摄像头传感器的 1280x1024 分辨率。仅适用于 OV2640/OV5640 摄像头。" + +#: ../../library/omv.csi.rst:815 +msgid "1280x960 resolution for the MT9M114 camera sensor." +msgstr "MT9M114 摄像头传感器的 1280x960 分辨率。" + +#: ../../library/omv.csi.rst:820 +msgid "" +"1600x1200 resolution for the camera sensor. Only works for the " +"OV2640/OV5640 cameras." +msgstr "摄像头传感器的 1600x1200 分辨率。仅适用于 OV2640/OV5640 摄像头。" + +#: ../../library/omv.csi.rst:825 +msgid "1280x720 resolution for the camera sensor." +msgstr "摄像头传感器的 1280x720 分辨率。" + +#: ../../library/omv.csi.rst:830 +msgid "" +"1920x1080 resolution for the camera sensor. Only works for the OV5640 and" +" PS5520 camera." +msgstr "摄像头传感器的 1920x1080 分辨率。仅适用于 OV5640 和 PS5520 摄像头。" + +#: ../../library/omv.csi.rst:835 +msgid "" +"2560x1440 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "摄像头传感器的 2560x1440 分辨率。仅适用于 OV5640 摄像头。" + +#: ../../library/omv.csi.rst:840 +msgid "" +"2048x1536 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "摄像头传感器的 2048x1536 分辨率。仅适用于 OV5640 摄像头。" + +#: ../../library/omv.csi.rst:845 +msgid "" +"2560x1600 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "摄像头传感器的 2560x1600 分辨率。仅适用于 OV5640 摄像头。" + +#: ../../library/omv.csi.rst:850 +msgid "" +"2592x1944 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "摄像头传感器的 2592x1944 分辨率。仅适用于 OV5640 摄像头。" + +#: ../../library/omv.csi.rst:855 +msgid "Lets you set the readout window for the OV5640." +msgstr "允许您设置 OV5640 的读出窗口。" + +#: ../../library/omv.csi.rst:860 +msgid "Lets you get the readout window for the OV5640." +msgstr "允许您获取 OV5640 的读出窗口。" + +#: ../../library/omv.csi.rst:865 +msgid "Lets you set the triggered mode for the MT9V034." +msgstr "允许您设置 MT9V034 的触发模式。" + +#: ../../library/omv.csi.rst:870 +msgid "Lets you get the triggered mode for the MT9V034." +msgstr "允许您获取 MT9V034 的触发模式。" + +#: ../../library/omv.csi.rst:875 +msgid "Enable `CSI.framesize()` to optimize for the field-of-view over FPS." +msgstr "启用 `CSI.framesize()` 优先优化视野而非帧率。" + +#: ../../library/omv.csi.rst:880 +msgid "Return if `CSI.framesize()` is optimizing for field-of-view over FPS." +msgstr "返回 `CSI.framesize()` 是否正在优先优化视野而非帧率。" + +#: ../../library/omv.csi.rst:885 +msgid "Used to trigger auto focus for the OV5640 FPC camera module." +msgstr "用于触发 OV5640 FPC 摄像头模块的自动对焦。" + +#: ../../library/omv.csi.rst:890 +msgid "Used to pause auto focus (while running) for the OV5640 FPC camera module." +msgstr "用于暂停 OV5640 FPC 摄像头模块的自动对焦(运行中)。" + +#: ../../library/omv.csi.rst:895 +msgid "" +"Used to reset auto focus back to the default for the OV5640 FPC camera " +"module." +msgstr "用于将 OV5640 FPC 摄像头模块的自动对焦重置为默认值。" + +#: ../../library/omv.csi.rst:900 +msgid "" +"Used to wait on auto focus to finish after being triggered for the OV5640" +" FPC camera module." +msgstr "用于等待 OV5640 FPC 摄像头模块触发后的自动对焦完成。" + +#: ../../library/omv.csi.rst:905 +msgid "" +"Used to turn night mode on or off on a sensor. Nightmode reduces the " +"frame rate to increase exposure dynamically." +msgstr "用于开启或关闭传感器的夜间模式。夜间模式通过降低帧率来动态增加曝光。" + +#: ../../library/omv.csi.rst:910 +msgid "" +"Gets the current value of if night mode is enabled or disabled for your " +"sensor." +msgstr "获取传感器当前夜间模式是否启用或禁用。" + +#: ../../library/omv.csi.rst:915 +msgid "Lets you get the FLIR Lepton image resolution width in pixels." +msgstr "允许您获取 FLIR Lepton 图像分辨率宽度(像素)。" + +#: ../../library/omv.csi.rst:920 +msgid "Lets you get the FLIR Lepton image resolution height in pixels." +msgstr "允许您获取 FLIR Lepton 图像分辨率高度(像素)。" + +#: ../../library/omv.csi.rst:925 +msgid "Lets you get the FLIR Lepton type (radiometric or not)." +msgstr "允许您获取 FLIR Lepton 类型(是否为辐射测量型)。" + +#: ../../library/omv.csi.rst:930 +msgid "Lets you get the FLIR Lepton refresh rate in hertz." +msgstr "允许您获取 FLIR Lepton 刷新率(赫兹)。" + +#: ../../library/omv.csi.rst:935 +msgid "Lets you get the FLIR Lepton ADC resolution in bits." +msgstr "允许您获取 FLIR Lepton ADC 分辨率(位)。" + +#: ../../library/omv.csi.rst:940 +msgid "Executes a 16-bit command given the FLIR Lepton SDK." +msgstr "根据 FLIR Lepton SDK 执行 16 位命令。" + +#: ../../library/omv.csi.rst:945 +msgid "Sets a FLIR Lepton Attribute given the FLIR Lepton SDK." +msgstr "根据 FLIR Lepton SDK 设置 FLIR Lepton 属性。" + +#: ../../library/omv.csi.rst:950 +msgid "Gets a FLIR Lepton Attribute given the FLIR Lepton SDK." +msgstr "根据 FLIR Lepton SDK 获取 FLIR Lepton 属性。" + +#: ../../library/omv.csi.rst:955 +msgid "Gets the FLIR Lepton FPA temp in celsius." +msgstr "获取 FLIR Lepton FPA 温度(摄氏度)。" + +#: ../../library/omv.csi.rst:960 +msgid "Gets the FLIR Lepton AUX temp in celsius." +msgstr "获取 FLIR Lepton AUX 温度(摄氏度)。" + +#: ../../library/omv.csi.rst:965 +msgid "" +"Lets you set the FLIR Lepton driver into a mode where you can get a valid" +" temperature value per pixel. See `CSI.ioctl()` for more information." +msgstr "允许您将 FLIR Lepton 驱动程序设置为可以获取每个像素有效温度值的模式。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:970 +msgid "" +"Lets you get if measurement mode is enabled or not for the FLIR Lepton " +"sensor. See `CSI.ioctl()` for more information." +msgstr "允许您获取 FLIR Lepton 传感器的测量模式是否启用。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:975 +msgid "" +"Lets you set the temperature range you want to map pixels in the image to" +" when in measurement mode. See `CSI.ioctl()` for more information." +msgstr "允许您在测量模式下设置要将图像中像素映射到的温度范围。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:980 +msgid "" +"Lets you get the temperature range used for measurement mode. See " +"`CSI.ioctl()` for more information." +msgstr "允许您获取测量模式使用的温度范围。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:985 ../../library/omv.csi.rst:990 +#: ../../library/omv.csi.rst:995 ../../library/omv.csi.rst:1000 +msgid "" +"Lets you control the motion detection interrupt on the HM01B0. See " +"`CSI.ioctl()` for more information." +msgstr "允许您控制 HM01B0 上的运动检测中断。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1005 +msgid "" +"Lets you control the internal oscillator on the HM01B0. See `CSI.ioctl()`" +" for more information." +msgstr "允许您控制 HM01B0 上的内部振荡器。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1010 +msgid "" +"Lets you get the RGB statistics from the camera sensor. See `CSI.ioctl()`" +" for more information." +msgstr "允许您从摄像头传感器获取 RGB 统计数据。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1015 +msgid "" +"Lets you set the GENX320 camera sensor biases. See `CSI.ioctl()` for more" +" information." +msgstr "允许您设置 GENX320 摄像头传感器偏置。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1020 +msgid "Default biases for the GENX320 camera sensor." +msgstr "GENX320 摄像头传感器的默认偏置。" + +#: ../../library/omv.csi.rst:1025 +msgid "Low light biases for the GENX320 camera sensor." +msgstr "GENX320 摄像头传感器的低光照偏置。" + +#: ../../library/omv.csi.rst:1030 +msgid "Active marker biases for the GENX320 camera sensor." +msgstr "GENX320 摄像头传感器的主动标记偏置。" + +#: ../../library/omv.csi.rst:1035 +msgid "Low noise biases for the GENX320 camera sensor." +msgstr "GENX320 摄像头传感器的低噪声偏置。" + +#: ../../library/omv.csi.rst:1040 +msgid "High speed biases for the GENX320 camera sensor." +msgstr "GENX320 摄像头传感器的高速偏置。" + +#: ../../library/omv.csi.rst:1045 +msgid "" +"Lets you set a single GENX320 camera sensor bias. See `CSI.ioctl()` for " +"more information." +msgstr "允许您设置单个 GENX320 摄像头传感器偏置。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1050 +msgid "Set the GENX320 DIFF OFF bias." +msgstr "设置 GENX320 DIFF OFF 偏置。" + +#: ../../library/omv.csi.rst:1055 +msgid "Set the GENX320 DIFF ON bias." +msgstr "设置 GENX320 DIFF ON 偏置。" + +#: ../../library/omv.csi.rst:1060 +msgid "Set the GENX320 FO bias." +msgstr "设置 GENX320 FO 偏置。" + +#: ../../library/omv.csi.rst:1065 +msgid "Set the GENX320 HPF bias." +msgstr "设置 GENX320 HPF 偏置。" + +#: ../../library/omv.csi.rst:1070 +msgid "Set the GENX320 REFR bias." +msgstr "设置 GENX320 REFR 偏置。" + +#: ../../library/omv.csi.rst:1075 +msgid "" +"Lets you set the GENX320 camera sensor anti-flickering-filter. See " +"`CSI.ioctl()` for more information." +msgstr "允许您设置 GENX320 摄像头传感器的抗闪烁滤波器。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1080 +msgid "" +"Lets you set the GENX320 camera sensor into event mode. See `CSI.ioctl()`" +" for more information." +msgstr "允许您将 GENX320 摄像头传感器设置为事件模式。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1085 +msgid "Sets the GENX320 to histogram mode." +msgstr "将 GENX320 设置为直方图模式。" + +#: ../../library/omv.csi.rst:1090 +msgid "Sets the GENX320 to event mode." +msgstr "将 GENX320 设置为事件模式。" + +#: ../../library/omv.csi.rst:1095 +msgid "" +"Populates an ndarray with event information. See `CSI.ioctl()` for more " +"information." +msgstr "用事件信息填充 ndarray。有关更多信息,请参阅 `CSI.ioctl()`。" + +#: ../../library/omv.csi.rst:1100 +msgid "Pixel off event." +msgstr "像素关闭事件。" + +#: ../../library/omv.csi.rst:1105 +msgid "Pixel on event." +msgstr "像素开启事件。" + +#: ../../library/omv.csi.rst:1110 +msgid "Pixel reset rising event." +msgstr "像素复位上升事件。" + +#: ../../library/omv.csi.rst:1115 +msgid "Pixel reset failing event." +msgstr "像素复位下降事件。" + +#: ../../library/omv.csi.rst:1120 +msgid "External trigger rising event." +msgstr "外部触发上升事件。" + +#: ../../library/omv.csi.rst:1125 +msgid "External trigger failing event." +msgstr "外部触发下降事件。" + +#: ../../library/omv.csi.rst:1129 +msgid "" +"Automatically turns off hot-pixels on the GENX320. See `CSI.ioctl()` for " +"more information." +msgstr "自动关闭 GENX320 上的热像素。有关更多信息,请参阅 `CSI.ioctl()`。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.DACBacklight.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.DACBacklight.po new file mode 100644 index 0000000000000..2be48e4d6b108 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.DACBacklight.po @@ -0,0 +1,73 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.display.DACBacklight.rst:5 +msgid "class DACBacklight -- DAC Backlight" +msgstr "class DACBacklight -- DAC 背光" + +#: ../../library/omv.display.DACBacklight.rst:7 +msgid "The `DACBacklight` class is used to control a screen backlight." +msgstr "`DACBacklight` 类用于控制屏幕背光。" + +#: ../../library/omv.display.DACBacklight.rst:10 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.DACBacklight.rst:14 +msgid "" +"Creates a backlight object to initialize the display backlight. This " +"class should be passed as the ``backlight`` argument to any display " +"object constructor which can use a backlight controller." +msgstr "创建一个背光对象来初始化显示屏背光。应将此类作为 ``backlight`` " +"参数传递给任何可以使用背光控制器的显示对象构造函数。" + +#: ../../library/omv.display.DACBacklight.rst:17 +msgid "" +"``channel`` specifies the DAC channel to use. This can be the GPIO pin " +"also. For STM32 based OpenMV Cams this is ``P5``." +msgstr "``channel`` 指定要使用的DAC通道。这也可以是GPIO引脚。对于基于STM32的OpenMV " +"Cams,这是 ``P5``。" + +#: ../../library/omv.display.DACBacklight.rst:20 +msgid "" +"``bits`` specifies the resolution of the DAC. The default value of 8-bits" +" should be good enough." +msgstr "``bits`` 指定DAC的分辨率。默认值为8位应该足够好。" + +#: ../../library/omv.display.DACBacklight.rst:23 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.DACBacklight.rst:27 +msgid "Deinitializes the backlight controller." +msgstr "反初始化背光控制器。" + +#: ../../library/omv.display.DACBacklight.rst:31 +msgid "" +"Sets the backlight strength from 0-100. Note that a linear voltage on the" +" backlight output will not necessary result in a linear brightness change" +" on the screen. Typically there's a small region where the screen " +"brightness will change drastically." +msgstr "将背光强度设置为 0-100。请注意,背光输出上的线性电压不一定会导致屏幕亮度的线" +"性变化。通常存在一个小区域,屏幕亮度将会发生显著变化。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.PWMBacklight.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.PWMBacklight.po new file mode 100644 index 0000000000000..816b1e076e084 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.PWMBacklight.po @@ -0,0 +1,77 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.display.PWMBacklight.rst:5 +msgid "class PWMBacklight -- PWM Backlight" +msgstr "class PWMBacklight -- PWM 背光" + +#: ../../library/omv.display.PWMBacklight.rst:7 +msgid "The `PWMBacklight` class is used to control a screen backlight." +msgstr "`PWMBacklight` 类用于控制屏幕背光。" + +#: ../../library/omv.display.PWMBacklight.rst:10 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.PWMBacklight.rst:14 +msgid "" +"Creates a backlight object to initialize the display backlight. This " +"class should be passed as the ``backlight`` argument to any display " +"object constructor which can use a backlight controller." +msgstr "创建一个背光对象来初始化显示屏背光。应将此类作为 ``backlight`` " +"参数传递给任何可以使用背光控制器的显示对象构造函数。" + +#: ../../library/omv.display.PWMBacklight.rst:17 +msgid "``pin`` specifies the Pin to use." +msgstr "``pin`` 指定要使用的引脚。" + +#: ../../library/omv.display.PWMBacklight.rst:19 +msgid "``timer`` specifies the Timer number to use." +msgstr "``timer`` 指定要使用的定时器编号。" + +#: ../../library/omv.display.PWMBacklight.rst:21 +msgid "``channel`` specifies the Timer channel to use." +msgstr "``channel`` 指定要使用的定时器通道。" + +#: ../../library/omv.display.PWMBacklight.rst:23 +msgid "``frequency`` specifies the PWM frequency." +msgstr "``frequency`` 指定PWM频率。" + +#: ../../library/omv.display.PWMBacklight.rst:26 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.PWMBacklight.rst:30 +msgid "Deinitializes the backlight controller." +msgstr "反初始化背光控制器。" + +#: ../../library/omv.display.PWMBacklight.rst:34 +msgid "" +"Sets the backlight strength from 0-100. Note that a linear pwm duty cycle" +" on the backlight output will not necessary result in a linear brightness" +" change on the screen. Typically there's a small region where the screen " +"brightness will change drastically." +msgstr "" +"将背光强度设置为 0-100。请注意,在背光输出的线性pwm占空比并不一定会导致屏幕亮" +"度的线性变化。通常存在一个小区域,屏幕亮度将会发生显著变化。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.SSD1351.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.SSD1351.po new file mode 100644 index 0000000000000..e38d0881acb37 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.SSD1351.po @@ -0,0 +1,67 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.display.SSD1351.rst:5 +msgid "class SSD1351 -- Display Controller" +msgstr "类 SSD1351 -- 显示控制器" + +#: ../../library/omv.display.SSD1351.rst:7 +msgid "The `SSD1351` class is used to initialize the LCD screen controller." +msgstr "`SSD1351` 类用于初始化 LCD 屏幕控制器。" + +#: ../../library/omv.display.SSD1351.rst:10 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.display.SSD1351.rst:14 +msgid "" +"Creates a controller object to initialize the SSD1351 display controller " +"which typically powers SPI displays. This class should be passed as the " +"``controller`` argument to the `SPIDisplay()` class constructor which " +"will take care of calling the `SSD1351.init()` method for you." +msgstr "" +"创建一个控制器对象来初始化 SSD1351 显示控制器,该控制器通常驱动 SPI 显示屏。" +"此类应作为 ``controller`` 参数传递给 `SPIDisplay()` 类构造函数," +"该构造函数将自动调用 `SSD1351.init()` 方法。" + +#: ../../library/omv.display.SSD1351.rst:19 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.SSD1351.rst:23 +msgid "" +"Initializes the display using the display controller which must provide " +"`display.SPIDisplay.bus_write()` method." +msgstr "使用显示控制器初始化显示屏,该控制器必须提供 `display.SPIDisplay.bus_write()` 方法。" + +#: ../../library/omv.display.SSD1351.rst:27 +msgid "Returns the command to write to display ram. Called by display controller." +msgstr "返回写入显示 RAM 的命令。由显示控制器调用。" + +#: ../../library/omv.display.SSD1351.rst:31 +msgid "Returns the command to turn the display on. Called by display controller." +msgstr "返回打开显示屏的命令。由显示控制器调用。" + +#: ../../library/omv.display.SSD1351.rst:35 +msgid "Returns the command to turn the display off. Called by display controller." +msgstr "返回关闭显示屏的命令。由显示控制器调用。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.ST7701.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.ST7701.po new file mode 100644 index 0000000000000..4055e7b24076d --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.ST7701.po @@ -0,0 +1,62 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.display.ST7701.rst:5 +msgid "class ST7701 -- Display Controller" +msgstr "class ST7701 -- 显示控制器" + +#: ../../library/omv.display.ST7701.rst:7 +msgid "The `ST7701` class is used to initialize the LCD screen controller." +msgstr "`ST7701` 类用以初始化LCD屏幕控制器。" + +#: ../../library/omv.display.ST7701.rst:10 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.ST7701.rst:14 +msgid "" +"Creates a controller object to initialize the ST7701 display controller " +"which typically powers MIPI DSI displays. This class should be passed as " +"the ``controller`` argument to the `DSIDisplay()` class constructor which" +" will take care of calling the `ST7701.init()` method for you." +msgstr "" +"创建一个控制器对象,用于初始化 ST7701 显示控制器,通常用于驱动 MIPI DSI 显示器。应将此类作为 `DSIDisplay()` " +"类构造函数的 ``controller`` 参数传递,该构造函数会负责调用 `ST7701.init()` 方法。" + +#: ../../library/omv.display.ST7701.rst:19 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.ST7701.rst:23 +msgid "" +"Initializes the display using the display controller which must provide " +"`display.DSIDisplay.bus_write()` and `display.DSIDisplay.bus_read()` " +"methods." +msgstr "" +"使用显示控制器初始化显示器,该控制器必须提供 `display.DSIDisplay.bus_write()` 和 " +"`display.DSIDisplay.bus_read()` 方法。" + +#: ../../library/omv.display.ST7701.rst:28 +msgid "Returns the display id." +msgstr "返回显示器ID。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.displaydata.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.displaydata.po new file mode 100644 index 0000000000000..42f8ccc49d52e --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.displaydata.po @@ -0,0 +1,111 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.display.displaydata.rst:5 +msgid "class DisplayData -- Display Data" +msgstr "class DisplayData -- 显示数据" + +#: ../../library/omv.display.displaydata.rst:7 +msgid "" +"The `DisplayData` class is used for getting information about the " +"attached DisplayPort/HDMI Display." +msgstr "`DisplayData` 类用于获取关于连接的 DisplayPort/HDMI 显示器的信息。" + +#: ../../library/omv.display.displaydata.rst:10 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.displaydata.rst:14 +msgid "" +"``cec`` Pass `True` to enable CEC communication to an external display " +"(if possible)." +msgstr "``cec`` 传递 `True` 以启用与外部显示器的 CEC 通信(如果可能)。" + +#: ../../library/omv.display.displaydata.rst:16 +msgid "" +"``ddc`` Pass `True` to enable DDC communication to an external display " +"(if possible)." +msgstr "``ddc`` 传递 `True` 以启用与外部显示器的 DDC 通信(如果可能)。" + +#: ../../library/omv.display.displaydata.rst:18 +msgid "" +"``ddc_addr`` The I2C address to use to talk to the external display " +"EEPROM." +msgstr "``ddc_addr`` 用于与外部显示器 EEPROM 进行通信的 I2C 地址。" + +#: ../../library/omv.display.displaydata.rst:21 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.displaydata.rst:25 +msgid "" +"Returns the external display EDID data as a bytes() object. Verifying the" +" EDID headers, checksums, and concatenating all sections into one bytes()" +" object is done for you. You may then parse this information by " +"`following this guide " +"`__." +msgstr "" +"返回外部显示器的 EDID 数据作为 bytes()对象。已为您验证了 EDID 标头、校验和将所有部分连接成一个 " +"bytes()对象。然后,您可以通过 `following this guide " +"`__ " +"进行解析。" + +#: ../../library/omv.display.displaydata.rst:31 +msgid "" +"Sends a packet on the HDMI-CEC bus to ``dst_addr`` with source " +"``src_addr`` and data ``bytes``." +msgstr "在 HDMI-CEC 总线上向 ``dst_addr`` 发送一个帧,源地址为 ``src_addr``,数据为 " +"``bytes``。" + +#: ../../library/omv.display.displaydata.rst:35 +msgid "" +"Waits ``timeout`` milliseconds to receive an HDMI-CEC frame for address " +"``dst_addr``. Returns True if the received frame was for ``dst_addr`` and" +" False if not. On timeout throws an `OSError` Exception." +msgstr "" +"等待 ``timeout`` 毫秒以接收地址为 ``dst_addr`` 的 HDMI-CEC帧。" +"如果接收到的帧是为 ``dst_addr`` 的,则返回 True,否则返回 False。" +"在超时时抛出 `OSError` 异常。" + +#: ../../library/omv.display.displaydata.rst:41 +msgid "" +"Registers a ``callback`` which will be called on reception of an HDMI-CEC" +" frame. The callback will receive two arguments of the frame src_addr as " +"an int and payload as a `bytes()` object." +msgstr "" +"注册一个 ``callback``,在接收到 HDMI-CEC 帧时将调用它。回调将接收两个参数," +"帧的 src_addr(int 类型)和 payload(`bytes()` 对象)。" + +#: ../../library/omv.display.displaydata.rst:45 +msgid "``dst_addr`` sets the filter address to listen to on the CEC bus." +msgstr "``dst_addr`` 设置要在 CEC 总线上侦听的过滤地址。" + +#: ../../library/omv.display.displaydata.rst:47 +msgid "" +"If you use this method do not call `DisplayData.receive_frame()` anymore " +"until the callback is disabled by passing ``None`` as the callback for " +"this method." +msgstr "" +"如果使用此方法,请不要调用 `DisplayData.receive_frame()` ," +"直到通过此方法的回调禁用了 ``None`` 作为回调。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.dsidisplay.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.dsidisplay.po new file mode 100644 index 0000000000000..7fd3de60037b3 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.dsidisplay.po @@ -0,0 +1,298 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.display.dsidisplay.rst:5 +msgid "class DSIDisplay -- DSI Display Driver" +msgstr "class DSIDisplay -- DSI 显示驱动程序" + +#: ../../library/omv.display.dsidisplay.rst:7 +msgid "The `DSIDisplay` class is used for driving MIPI LCDs." +msgstr "`DSIDisplay` 类用于驱动MIPI LCD。" + +#: ../../library/omv.display.dsidisplay.rst:9 +msgid "Example usage for driving the 800x480 MIPI LCD::" +msgstr "使用示例驱动 800x480 MIPI LCD::" + +#: ../../library/omv.display.dsidisplay.rst:25 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.dsidisplay.rst:29 +msgid "``framesize`` One of the standard supported resolutions." +msgstr "``framesize`` 支持的标准分辨率之一。" + +#: ../../library/omv.display.dsidisplay.rst:31 +msgid "" +"``refresh`` Sets the screen refresh rate in hertz. This controls the DSI " +"LCD clock." +msgstr "``refresh`` 设置屏幕刷新率(赫兹)。这控制了DSI LCD 时钟。" + +#: ../../library/omv.display.dsidisplay.rst:33 +msgid "``portrait`` Swap the framesize width and height." +msgstr "``portrait`` 交换帧大小的宽度和高度。" + +#: ../../library/omv.display.dsidisplay.rst:35 +msgid "``channel`` The virtual MIPI DSI channel to use to talk to the display." +msgstr "``channel`` 用于与显示屏通信的虚拟 MIPI DSI 通道。" + +#: ../../library/omv.display.dsidisplay.rst:37 +msgid "" +"``controller`` Pass the controller chip class here to initialize it along" +" with the display. E.g. `display.ST7701()` which is a standard display " +"controller for MIPI DSI displays." +msgstr "" +"``controller`` 在此处传递控制器芯片类以初始化它以及显示屏。例如,`display.ST7701()` 是 MIPI DSI " +"显示器的标准显示控制器。" + +#: ../../library/omv.display.dsidisplay.rst:40 +msgid "" +"``backlight`` specify a backlight controller module to use. By default " +"the backlight will be controlled via a GPIO pin." +msgstr "``backlight`` 指定要使用的背光控制器模块。默认情况下,背光将通过 GPIO 引脚控制。" + +#: ../../library/omv.display.dsidisplay.rst:44 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.dsidisplay.rst:48 +msgid "" +"Releases the I/O pins and RAM used by the class. This is called " +"automatically on destruction." +msgstr "释放类使用的 I/O 引脚和 RAM。在销毁时自动调用此方法。" + +#: ../../library/omv.display.dsidisplay.rst:52 +msgid "Returns the width of the screen." +msgstr "返回屏幕的宽度。" + +#: ../../library/omv.display.dsidisplay.rst:56 +msgid "Returns the height of the screen." +msgstr "返回屏幕的高度。" + +#: ../../library/omv.display.dsidisplay.rst:60 +msgid "Returns the refresh rate." +msgstr "返回刷新率。" + +#: ../../library/omv.display.dsidisplay.rst:64 +msgid "Displays an ``image`` whose top-left corner starts at location x, y." +msgstr "显示一个左上角从位置x,y开始的 ``image``。" + +#: ../../library/omv.display.dsidisplay.rst:66 +msgid "" +"You may also pass a path instead of an image object for this method to " +"automatically load the image from disk and draw it in one step. E.g. " +"``write(\"test.jpg\")``." +msgstr "您也可以传递路径而不是图像对象给此方法,一边从磁盘加载图像并在一步中绘制它。例如 ``write(\"test.jpg\")``。" + +#: ../../library/omv.display.dsidisplay.rst:69 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向的显示比例(float)。如果此值为负,则图像将水平翻转。注意,如果未指定 " +"``y_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.dsidisplay.rst:73 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向的显示比例(float)。如果此值为负,则图像将垂直翻转。注意,如果未指定 " +"``x_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.dsidisplay.rst:77 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"image to display. This allows you to extract just the pixels in the ROI " +"to scale." +msgstr "``roi`` 是要显示的图像的感兴趣区域矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域的像素以进行缩放。" + +#: ../../library/omv.display.dsidisplay.rst:80 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render on the display. For example, if " +"you pass ``rgb_channel=1`` this will extract the green channel of the " +"RGB565 image and display that in grayscale." +msgstr "" +"``rgb_channel`` 是从RGB565图像(如果传递)中提取和在显示屏上渲染的RGB通道(0=R, G=1, B=2)。例如,如果传递 " +"``rgb_channel=1`` ,则会提取RGB565图像的绿色通道并以灰度显示。" + +#: ../../library/omv.display.dsidisplay.rst:84 +msgid "" +"``alpha`` controls how opaque the image is. A value of 256 displays an " +"opaque image while a value lower than 256 produces a black transparent " +"image. 0 results in a perfectly black image." +msgstr "``alpha`` 控制图像的不透明度。职位256显示不透明图像,而低于256的值会产生黑色透明图像。0会产生完全黑色图像。" + +#: ../../library/omv.display.dsidisplay.rst:87 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the input image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1``,可以是调色板枚举值" +"或总共 256 像素的 RGB565 图像,用作输入图像灰度值的颜色查找表。如果使用了 ``rgb_channel``,则会在提取之后应用此选项。" + +#: ../../library/omv.display.dsidisplay.rst:91 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the input image being displayed at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总共 256 像素的 GRAYSCALE 图像,用作 alpha " +"调色板,以像素级别调制正在显示的输入图像的 ``alpha`` 值,从而精确控制根据其灰度值的像素的 alpha 值。 alpha 查找表中值为 " +"255 的像素是不透明的,小于 255 的值会更加透明直到 0。如果使用了 ``rgb_channel``,则会在缩放之后应用此选项。" + +#: ../../library/omv.display.dsidisplay.rst:97 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.display.dsidisplay.rst:99 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.dsidisplay.rst:100 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.dsidisplay.rst:101 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.dsidisplay.rst:102 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.display.dsidisplay.rst:103 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.display.dsidisplay.rst:104 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.display.dsidisplay.rst:105 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.display.dsidisplay.rst:106 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.display.dsidisplay.rst:107 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.display.dsidisplay.rst:108 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.display.dsidisplay.rst:109 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.display.dsidisplay.rst:110 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.display.dsidisplay.rst:111 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.display.dsidisplay.rst:112 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.display.dsidisplay.rst:113 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.display.dsidisplay.rst:117 +msgid "Clears the lcd screen to black." +msgstr "将LCD屏幕清除为黑色。" + +#: ../../library/omv.display.dsidisplay.rst:119 +msgid "" +"``display_off`` if True instead turns off the display logic versus " +"clearing the frame LCD frame buffer to black. You should also turn off " +"the backlight too after this to ensure the screen goes to black as many " +"displays are white when only the backlight is on." +msgstr "" +"``display_off`` 如果为 True则关闭显示逻辑,而不是将 LCD " +"帧缓冲区清除为黑色。之后,还应关闭背光,以确保屏幕变为黑色,因为许多显示器仅在打开背光时为白色。" + +#: ../../library/omv.display.dsidisplay.rst:125 +msgid "Sets the lcd backlight dimming value. 0 (off) to 100 (on)." +msgstr "设置LCD背光调光值。0(关闭)至100(开启)。" + +#: ../../library/omv.display.dsidisplay.rst:127 +msgid "" +"Note that unless you pass `DACBacklight` or `PWMBacklight` the backlight " +"will be controlled as a GPIO pin and will only go from 0 (off) to !0 " +"(on)." +msgstr "" +"请注意,除非传递 `DACBacklight` 或 `PWMBacklight` " +",否则背光将作为GPIO引脚进行控制,并且只能从0(关闭)到非0(开启)。" + +#: ../../library/omv.display.dsidisplay.rst:130 +msgid "Pass no arguments to get the state of the backlight value." +msgstr "不传递参数以获取背光值的状态。" + +#: ../../library/omv.display.dsidisplay.rst:134 +msgid "Send the DSI Display ``cmd`` with ``args``." +msgstr "发送带有 ``args`` 的 DSI 显示器 ``cmd``。" + +#: ../../library/omv.display.dsidisplay.rst:138 +msgid "Read ``len`` using ``cmd`` with ``args`` from the DSI Display." +msgstr "使用 ``args`` 和 ``cmd`` 从 DSI 显示器读取 ``len``。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.po new file mode 100644 index 0000000000000..ce9f641484c56 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.po @@ -0,0 +1,120 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-06 08:36+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.display.rst:2 +msgid ":mod:`display` --- display driver" +msgstr ":mod:`display` --- 显示驱动" + +#: ../../library/omv.display.rst:7 +msgid "" +"The ``display`` module is used for driving SPI LCDs, 24-bit parallel LCDs, " +"MIPI DSI LCDs, HDMI output, and Display Port output." +msgstr "``display`` 模块用于驱动SPI LCD、24位并行LCD、MIPI DSI " +"LCD、HDIM输出和显示端口输出。" + +#: ../../library/omv.display.rst:10 +msgid "Classes" +msgstr "类" + +#: ../../library/omv.display.rst:24 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.display.rst:28 +msgid "320x240 resolution for framesize." +msgstr "帧大小为320×240分辨率。" + +#: ../../library/omv.display.rst:32 +msgid "240x320 resolution for framesize." +msgstr "帧大小为240×320分辨率。" + +#: ../../library/omv.display.rst:36 +msgid "480x272 resolution for framesize." +msgstr "帧大小为480×272分辨率。" + +#: ../../library/omv.display.rst:40 +msgid "480x128 resolution for framesize." +msgstr "帧大小为480×128分辨率。" + +#: ../../library/omv.display.rst:44 +msgid "640x480 resolution for framesize." +msgstr "帧大小为640×480分辨率。" + +#: ../../library/omv.display.rst:48 +msgid "320x480 resolution for framesize." +msgstr "帧大小为320×480分辨率。" + +#: ../../library/omv.display.rst:52 +msgid "800x480 resolution for framesize." +msgstr "帧大小为800×480分辨率。" + +#: ../../library/omv.display.rst:56 +msgid "800x320 resolution for framesize." +msgstr "帧大小为800×320分辨率。" + +#: ../../library/omv.display.rst:60 +msgid "480x800 resolution for framesize." +msgstr "帧大小为480×800分辨率。" + +#: ../../library/omv.display.rst:64 +msgid "480x480 resolution for framesize." +msgstr "帧大小为480×480分辨率。" + +#: ../../library/omv.display.rst:68 +msgid "800x600 resolution for framesize." +msgstr "帧大小为800×600分辨率。" + +#: ../../library/omv.display.rst:72 +msgid "1024x600 resolution for framesize." +msgstr "帧大小为1024×600分辨率。" + +#: ../../library/omv.display.rst:76 +msgid "1024x768 resolution for framesize." +msgstr "帧大小为1024×768分辨率。" + +#: ../../library/omv.display.rst:80 +msgid "1280x1024 resolution for framesize." +msgstr "帧大小为1280×1024分辨率。" + +#: ../../library/omv.display.rst:84 +msgid "1280x400 resolution for framesize." +msgstr "帧大小为1280×400分辨率。" + +#: ../../library/omv.display.rst:88 +msgid "1600x1200 resolution for framesize." +msgstr "帧大小为1600×1200分辨率。" + +#: ../../library/omv.display.rst:92 +msgid "1280x720 resolution for framesize." +msgstr "帧大小为1280×720分辨率。" + +#: ../../library/omv.display.rst:96 +msgid "1920x1080 resolution for framesize." +msgstr "帧大小为1920×1080分辨率。" + +#: ../../library/omv.display.rst:100 +msgid "" +"Use a ``refresh`` of 30 Hz with this setting. The STM32H7 is not capable of " +"driving 1080p at 60 Hz." +msgstr "使用 ``refresh`` 设置时刷新率为30HZ。STM32H7 无法以 60 Hz 驱动 1080p。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.rgbdisplay.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.rgbdisplay.po new file mode 100644 index 0000000000000..3a16e0fdc7575 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.rgbdisplay.po @@ -0,0 +1,293 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.display.rgbdisplay.rst:5 +msgid "class RGBDisplay -- RGB Display Driver" +msgstr "class RGBDisplay -- RGB 显示驱动程序" + +#: ../../library/omv.display.rgbdisplay.rst:7 +msgid "The `RGBDisplay` class is used for driving 24-bit parallel LCDs." +msgstr "`RGBDisplay` 类用于驱动24位并行lcd。" + +#: ../../library/omv.display.rgbdisplay.rst:9 +msgid "Example usage for driving the 800x480 24-bit Parallel LCD::" +msgstr "驱动800×480 24位并行LCD的示例用法::" + +#: ../../library/omv.display.rgbdisplay.rst:25 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.rgbdisplay.rst:29 +msgid "``framesize`` One of the standard supported resolutions." +msgstr "``framesize`` 支持的标准分辨率之一。" + +#: ../../library/omv.display.rgbdisplay.rst:31 +msgid "" +"``refresh`` Sets the screen refresh rate in hertz. This controls the RGB " +"LCD clock." +msgstr "``refresh`` 以赫兹为单位设置屏幕刷新率。这控制 RGB LCD 时钟。" + +#: ../../library/omv.display.rgbdisplay.rst:33 +msgid "" +"``display_on`` Enables the display. Pass `False` here when the 24-bit " +"parallel LCD output is shared by multiple devices like the TFP410 chip " +"for driving HDMI displays to keep the display off while driving the " +"databus still." +msgstr "" +"``display_on`` 启用显示器。当24位并行LCD输出由多个设备(如驱动HDMI显示器的TFP410芯片)共享时,此处传递 " +"`False` 以在驱动数据总线静止时保持显示关闭。" + +#: ../../library/omv.display.rgbdisplay.rst:37 +msgid "``portrait`` Swap the framesize width and height." +msgstr "``portrait`` 交换帧大小的宽度和高度。" + +#: ../../library/omv.display.rgbdisplay.rst:39 +msgid "" +"``controller`` Pass the controller chip class here to initialize it along" +" with the display." +msgstr "``controller`` 在此处传递控制器芯片类以与显示器一起初始化。" + +#: ../../library/omv.display.rgbdisplay.rst:41 +msgid "" +"``backlight`` specify a backlight controller module to use. By default " +"the backlight will be controlled via a GPIO pin." +msgstr "``backlight`` 指定要使用的背光控制器模块。默认情况下,背光将通过 GPIO 引脚控制。" + +#: ../../library/omv.display.rgbdisplay.rst:45 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.rgbdisplay.rst:49 +msgid "" +"Releases the I/O pins and RAM used by the class. This is called " +"automatically on destruction." +msgstr "释放类使用的 I/O 引脚和 RAM。在销毁时自动调用此方法。" + +#: ../../library/omv.display.rgbdisplay.rst:53 +msgid "Returns the width of the screen." +msgstr "返回屏幕的宽度。" + +#: ../../library/omv.display.rgbdisplay.rst:57 +msgid "Returns the height of the screen." +msgstr "返回屏幕的高度。" + +#: ../../library/omv.display.rgbdisplay.rst:61 +msgid "Returns the refresh rate." +msgstr "返回刷新率。" + +#: ../../library/omv.display.rgbdisplay.rst:65 +msgid "Displays an ``image`` whose top-left corner starts at location x, y." +msgstr "显示一个左上角从位置x,y开始的 ``image``。" + +#: ../../library/omv.display.rgbdisplay.rst:67 +msgid "" +"You may also pass a path instead of an image object for this method to " +"automatically load the image from disk and draw it in one step. E.g. " +"``write(\"test.jpg\")``." +msgstr "您也可以传递路径而不是图像对象给此方法,一边从磁盘加载图像并在一步中绘制它。例如 ``write(\"test.jpg\")``。" + +#: ../../library/omv.display.rgbdisplay.rst:70 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向的显示比例(float)。如果此值为负,则图像将水平翻转。注意,如果未指定 " +"``y_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.rgbdisplay.rst:74 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向的显示比例(float)。如果此值为负,则图像将垂直翻转。注意,如果未指定 " +"``x_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.rgbdisplay.rst:78 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"image to display. This allows you to extract just the pixels in the ROI " +"to scale." +msgstr "``roi`` 是要显示的图像的感兴趣区域矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域的像素以进行缩放。" + +#: ../../library/omv.display.rgbdisplay.rst:81 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render on the display. For example, if " +"you pass ``rgb_channel=1`` this will extract the green channel of the " +"RGB565 image and display that in grayscale." +msgstr "" +"``rgb_channel`` 是从RGB565图像(如果传递)中提取和在显示屏上渲染的RGB通道(0=R, G=1, B=2)。例如,如果传递 " +"``rgb_channel=1`` ,则会提取RGB565图像的绿色通道并以灰度显示。" + +#: ../../library/omv.display.rgbdisplay.rst:85 +msgid "" +"``alpha`` controls how opaque the image is. A value of 256 displays an " +"opaque image while a value lower than 256 produces a black transparent " +"image. 0 results in a perfectly black image." +msgstr "``alpha`` 控制图像的不透明度。职位256显示不透明图像,而低于256的值会产生黑色透明图像。0会产生完全黑色图像。" + +#: ../../library/omv.display.rgbdisplay.rst:88 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the input image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1``,可以是调色板枚举值" +"或总共 256 像素的 RGB565 图像,用作输入图像灰度值的颜色查找表。如果使用了 ``rgb_channel``,则会在提取之后应用此选项。" + +#: ../../library/omv.display.rgbdisplay.rst:92 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the input image being displayed at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总共 256 像素的 GRAYSCALE 图像,用作 alpha " +"调色板,以像素级别调制正在显示的输入图像的 ``alpha`` 值,从而精确控制根据其灰度值的像素的 alpha 值。 alpha 查找表中值为 " +"255 的像素是不透明的,小于 255 的值会更加透明直到 0。如果使用了 ``rgb_channel``,则会在缩放之后应用此选项。" + +#: ../../library/omv.display.rgbdisplay.rst:98 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.display.rgbdisplay.rst:100 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.rgbdisplay.rst:101 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.rgbdisplay.rst:102 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.rgbdisplay.rst:103 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.display.rgbdisplay.rst:104 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.display.rgbdisplay.rst:105 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.display.rgbdisplay.rst:106 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.display.rgbdisplay.rst:107 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.display.rgbdisplay.rst:108 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.display.rgbdisplay.rst:109 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.display.rgbdisplay.rst:110 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.display.rgbdisplay.rst:111 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.display.rgbdisplay.rst:112 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.display.rgbdisplay.rst:113 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.display.rgbdisplay.rst:114 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.display.rgbdisplay.rst:118 +msgid "Clears the lcd screen to black." +msgstr "将LCD屏幕清除为黑色。" + +#: ../../library/omv.display.rgbdisplay.rst:120 +msgid "" +"``display_off`` if True instead turns off the display logic versus " +"clearing the frame LCD frame buffer to black. You should also turn off " +"the backlight too after this to ensure the screen goes to black as many " +"displays are white when only the backlight is on." +msgstr "" +"``display_off`` 如果为 True则关闭显示逻辑,而不是将 LCD " +"帧缓冲区清除为黑色。之后,还应关闭背光,以确保屏幕变为黑色,因为许多显示器仅在打开背光时为白色。" + +#: ../../library/omv.display.rgbdisplay.rst:126 +msgid "Sets the lcd backlight dimming value. 0 (off) to 100 (on)." +msgstr "设置LCD背光调光值。0(关闭)至100(开启)。" + +#: ../../library/omv.display.rgbdisplay.rst:128 +msgid "" +"Note that unless you pass `DACBacklight` or `PWMBacklight` the backlight " +"will be controlled as a GPIO pin and will only go from 0 (off) to !0 " +"(on)." +msgstr "" +"请注意,除非传递 `DACBacklight` 或 `PWMBacklight` " +",否则背光将作为GPIO引脚进行控制,并且只能从0(关闭)到非0(开启)。" + +#: ../../library/omv.display.rgbdisplay.rst:131 +msgid "Pass no arguments to get the state of the backlight value." +msgstr "不传递参数以获取背光值的状态。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.spidisplay.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.spidisplay.po new file mode 100644 index 0000000000000..35b754f34f5b5 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.display.spidisplay.po @@ -0,0 +1,340 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.display.spidisplay.rst:5 +msgid "class SPIDisplay -- SPI Display Driver" +msgstr "class SPIDisplay -- SPI 显示器驱动" + +#: ../../library/omv.display.spidisplay.rst:7 +msgid "The `SPIDisplay` class is used for driving SPI LCDs." +msgstr "`SPIDisplay` 类用于驱动 SPI LCD。" + +#: ../../library/omv.display.spidisplay.rst:9 +msgid "Example usage for driving the 128x160 LCD shield::" +msgstr "驱动128×160 LCD扩展板板的使用示例::" + +#: ../../library/omv.display.spidisplay.rst:25 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.display.spidisplay.rst:29 +msgid "" +"``width`` SPI LCD width. By default this is 128 to match the OpenMV " +"128x160 LCD shield." +msgstr "``width`` SPI LCD 的宽度。默认情况下,这是 128,以匹配 OpenMV 128x160 LCD 扩展板。" + +#: ../../library/omv.display.spidisplay.rst:31 +msgid "" +"``height`` SPI LCD height. By default this is 160 to match the OpenMV " +"128x160 LCD shield." +msgstr "``height`` SPI LCD 的高度。默认情况下,这是 160,以匹配 OpenMV 128x160 LCD 扩展板。" + +#: ../../library/omv.display.spidisplay.rst:33 +msgid "" +"``refresh`` Sets the LCD refresh rate in hertz. This controls the SPI LCD" +" shield clock." +msgstr "``refresh`` 以赫兹为单位设置 LCD 的刷新率。这控制 SPI LCD 扩展板的时钟。" + +#: ../../library/omv.display.spidisplay.rst:35 +msgid "" +"``bgr`` set to True to swap the red and blue channels. This argument " +"allows you to use our driver with more types of displays." +msgstr "``bgr`` 设置为True以交换红色和蓝色通道。此参数允许您与更多类型的显示器一起使用我们的驱动程序。" + +#: ../../library/omv.display.spidisplay.rst:38 +msgid "" +"``byte_swap`` set to True to swap RGB565 pixel bytes sent to the LCD. " +"This argument allows you to use our driver with more types of displays." +msgstr "``byte_swap`` 设置为True以交换发送到 LCD 的 RGB565 像素字节。此参数允许您与更多类型的显示器一起使用我们的驱动程序。" + +#: ../../library/omv.display.spidisplay.rst:41 +msgid "" +"``hmirror`` set to True to horizontally mirror the display output. This " +"argument allows you to use our driver with more types of displays." +msgstr "``hmirror`` 设置为 True 以水平镜像显示输出。此参数允许您与更多类型的显示器一起使用我们的驱动程序。" + +#: ../../library/omv.display.spidisplay.rst:44 +msgid "" +"``vflip`` set to True to vertically flip the display output. This " +"argument allows you to use our driver with more types of displays." +msgstr "``vflip`` 设置为 True 以垂直翻转显示输出。此参数允许您与更多类型的显示器一起使用我们的驱动程序。" + +#: ../../library/omv.display.spidisplay.rst:47 +msgid "" +"``triple_buffer`` If True then makes updates to the screen non-blocking " +"at the cost of 3X the display size in RAM. This is on by default for " +"OpenMV Cam boards with SDRAM." +msgstr "" +"``triple_buffer`` 如果为True,则以RAM中显示大小的3倍为代价对屏幕进行无阻塞更新。对于带有SDRAM的OpenMV " +"Cam板,默认情况下会启用此选项。" + +#: ../../library/omv.display.spidisplay.rst:50 +msgid "" +"``controller`` Pass the controller chip class here to initialize it along" +" with the display." +msgstr "``controller`` 在此处传递控制器芯片类以与显示器一起初始化。" + +#: ../../library/omv.display.spidisplay.rst:52 +msgid "" +"``backlight`` specify a backlight controller module to use. By default " +"the backlight will be controlled via a GPIO pin." +msgstr "``backlight`` 指定要使用的背光控制器模块。默认情况下,背光将通过 GPIO 引脚控制。" + +#: ../../library/omv.display.spidisplay.rst:57 +msgid "Uses pins P0, P2, P3, P6, P7, and P8." +msgstr "使用引脚 P0、P2、P3、P6、P7 和 P8。" + +#: ../../library/omv.display.spidisplay.rst:60 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.display.spidisplay.rst:64 +msgid "" +"Releases the I/O pins and RAM used by the class. This is called " +"automatically on destruction." +msgstr "释放类使用的 I/O 引脚和 RAM。在销毁时自动调用此方法。" + +#: ../../library/omv.display.spidisplay.rst:68 +msgid "Returns the width of the screen." +msgstr "返回屏幕的宽度。" + +#: ../../library/omv.display.spidisplay.rst:72 +msgid "Returns the height of the screen." +msgstr "返回屏幕的高度。" + +#: ../../library/omv.display.spidisplay.rst:76 +msgid "Returns the refresh rate." +msgstr "返回刷新率。" + +#: ../../library/omv.display.spidisplay.rst:80 +msgid "Returns if the red and blue channels are swapped." +msgstr "如果红色和蓝色通道交换则返回。" + +#: ../../library/omv.display.spidisplay.rst:84 +msgid "Returns if the RGB565 pixels are displayed byte reversed." +msgstr "返回 RGB565 像素是否以字节反转显示。" + +#: ../../library/omv.display.spidisplay.rst:88 +msgid "Returns if triple buffering is enabled." +msgstr "如果启用了三重缓冲则返回。" + +#: ../../library/omv.display.spidisplay.rst:92 +msgid "Displays an ``image`` whose top-left corner starts at location x, y." +msgstr "显示一个左上角从位置x,y开始的 ``image``。" + +#: ../../library/omv.display.spidisplay.rst:94 +msgid "" +"You may also pass a path instead of an image object for this method to " +"automatically load the image from disk and draw it in one step. E.g. " +"``write(\"test.jpg\")``." +msgstr "您也可以传递路径而不是图像对象给此方法,一边从磁盘加载图像并在一步中绘制它。例如 ``write(\"test.jpg\")``。" + +#: ../../library/omv.display.spidisplay.rst:97 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向的显示比例(float)。如果此值为负,则图像将水平翻转。注意,如果未指定 " +"``y_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.spidisplay.rst:101 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向的显示比例(float)。如果此值为负,则图像将垂直翻转。注意,如果未指定 " +"``x_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.display.spidisplay.rst:105 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"image to display. This allows you to extract just the pixels in the ROI " +"to scale." +msgstr "``roi`` 是要显示的图像的感兴趣区域矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域的像素以进行缩放。" + +#: ../../library/omv.display.spidisplay.rst:108 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render on the display. For example, if " +"you pass ``rgb_channel=1`` this will extract the green channel of the " +"RGB565 image and display that in grayscale." +msgstr "" +"``rgb_channel`` 是从RGB565图像(如果传递)中提取和在显示屏上渲染的RGB通道(0=R, G=1, B=2)。例如,如果传递 " +"``rgb_channel=1`` ,则会提取RGB565图像的绿色通道并以灰度显示。" + +#: ../../library/omv.display.spidisplay.rst:112 +msgid "" +"``alpha`` controls how opaque the image is. A value of 256 displays an " +"opaque image while a value lower than 256 produces a black transparent " +"image. 0 results in a perfectly black image." +msgstr "``alpha`` 控制图像的不透明度。职位256显示不透明图像,而低于256的值会产生黑色透明图像。0会产生完全黑色图像。" + +#: ../../library/omv.display.spidisplay.rst:115 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the input image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1``,可以是调色板枚举值" +"或总共 256 像素的 RGB565 图像,用作输入图像的灰度值的颜色查找表。如果使用了 ``rgb_channel``,则会在提取之后应用此选项。" + +#: ../../library/omv.display.spidisplay.rst:119 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the input image being displayed at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总共 256 像素的 GRAYSCALE 图像,用作 alpha " +"调色板,以像素级别调制正在显示的输入图像的 ``alpha`` 值,从而精确控制根据其灰度值的像素的 alpha 值。 alpha 查找表中值为 " +"255 的像素是不透明的,小于 255 的值会更加透明直到 0。如果使用了 ``rgb_channel``,则会在缩放之后应用此选项。" + +#: ../../library/omv.display.spidisplay.rst:125 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.display.spidisplay.rst:127 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.spidisplay.rst:128 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.spidisplay.rst:129 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.display.spidisplay.rst:130 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.display.spidisplay.rst:131 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.display.spidisplay.rst:132 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.display.spidisplay.rst:133 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.display.spidisplay.rst:134 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.display.spidisplay.rst:135 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.display.spidisplay.rst:136 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.display.spidisplay.rst:137 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.display.spidisplay.rst:138 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.display.spidisplay.rst:139 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.display.spidisplay.rst:140 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.display.spidisplay.rst:141 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.display.spidisplay.rst:145 +msgid "Clears the lcd screen to black." +msgstr "将LCD屏幕清除为黑色。" + +#: ../../library/omv.display.spidisplay.rst:147 +msgid "" +"``display_off`` if True instead turns off the display logic versus " +"clearing the frame LCD frame buffer to black. You should also turn off " +"the backlight too after this to ensure the screen goes to black as many " +"displays are white when only the backlight is on." +msgstr "" +"``display_off`` 如果为 True则关闭显示逻辑,而不是将 LCD " +"帧缓冲区清除为黑色。之后,还应关闭背光,以确保屏幕变为黑色,因为许多显示器仅在打开背光时为白色。" + +#: ../../library/omv.display.spidisplay.rst:153 +msgid "Sets the lcd backlight dimming value. 0 (off) to 100 (on)." +msgstr "设置LCD背光调光值。0(关闭)至100(开启)。" + +#: ../../library/omv.display.spidisplay.rst:155 +msgid "" +"Note that unless you pass `DACBacklight` or `PWMBacklight` the backlight " +"will be controlled as a GPIO pin and will only go from 0 (off) to !0 " +"(on)." +msgstr "" +"请注意,除非传递 `DACBacklight` 或 `PWMBacklight` " +",否则背光将作为GPIO引脚进行控制,并且只能从0(关闭)到非0(开启)。" + +#: ../../library/omv.display.spidisplay.rst:158 +msgid "Pass no arguments to get the state of the backlight value." +msgstr "不传递参数以获取背光值的状态。" + +#: ../../library/omv.display.spidisplay.rst:162 +msgid "Send the SPI Display ``cmd`` with ``args``." +msgstr "向 SPI 显示屏发送 ``cmd`` 和 ``args``。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.fir.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.fir.po new file mode 100644 index 0000000000000..8d0eb0a9797c0 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.fir.po @@ -0,0 +1,596 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 07:53+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.fir.rst:2 +msgid ":mod:`fir` --- thermal sensor driver (fir == far infrared)" +msgstr ":mod:`fir` --- 热传感器驱动程序(fir == 远红外)" + +#: ../../library/omv.fir.rst:7 +msgid "The ``fir`` module is used for controlling the thermal sensors." +msgstr "``fir`` 模块用于控制热传感器。" + +#: ../../library/omv.fir.rst:9 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/omv.fir.rst:31 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.fir.rst:35 +msgid "Initializes an attached thermopile shield using I/O pins P4 and P5." +msgstr "使用I/O引脚P4和P5初始化已连接的热电堆扩展板。" + +#: ../../library/omv.fir.rst:37 +msgid "``type`` indicates the type of thermopile shield:" +msgstr "``type`` 表示热电堆扩展板的类型:" + +#: ../../library/omv.fir.rst:39 ../../library/omv.fir.rst:95 +#: ../../library/omv.fir.rst:106 +msgid "`fir.FIR_NONE`: 0 pixels." +msgstr "`fir.FIR_NONE`: 0像素。" + +#: ../../library/omv.fir.rst:40 +msgid "`fir.FIR_SHIELD`: 16x4 pixels." +msgstr "`fir.FIR_SHIELD`: 16x4 像素。" + +#: ../../library/omv.fir.rst:41 +msgid "`fir.FIR_MLX90621`: 16x4 pixels." +msgstr "`fir.FIR_MLX90621`: 16x4 像素。" + +#: ../../library/omv.fir.rst:42 +msgid "`fir.FIR_MLX90640`: 32x24 pixels." +msgstr "`fir.FIR_MLX90640`: 32x24 像素。" + +#: ../../library/omv.fir.rst:43 +msgid "`fir.FIR_MLX90641`: 16x12 pixels." +msgstr "`fir.FIR_MLX90641`: 16x12 像素。" + +#: ../../library/omv.fir.rst:44 +msgid "`fir.FIR_AMG8833`: 8x8 pixels." +msgstr "`fir.FIR_AMG8833`: 8x8 像素。" + +#: ../../library/omv.fir.rst:46 +msgid "" +"By default type is ``-1`` which will cause `fir.init()` to automatically " +"scan and initialize an attached thermal sensor based on the I2C address. " +"Note that `fir.FIR_MLX90640` and `fir.FIR_MLX90641` have the same I2C " +"address so you must pass `fir.FIR_MLX90641` to type to initialize it " +"specifically." +msgstr "" +"默认情况下,type 为 ``-1``,这将导致 `fir.init()` 根据 I2C " +"地址自动扫描并初始化连接的热传感器。请注意,`fir.FIR_MLX90640` 和 `fir.FIR_MLX90641` 具有相同的 I2C " +"地址,因此您必须将 `fir.FIR_MLX90641` 传递给 type 来具体初始化它。" + +#: ../../library/omv.fir.rst:51 +msgid "``refresh`` is the thermopile sensor power-of-2 refresh rate in Hz:" +msgstr "``refresh`` 是热电堆传感器的2的幂刷新率(单位:Hz):" + +#: ../../library/omv.fir.rst:53 ../../library/omv.fir.rst:62 +msgid "`fir.FIR_NONE`: N/A" +msgstr "`fir.FIR_NONE`: N/A" + +#: ../../library/omv.fir.rst:54 +msgid "" +"`fir.FIR_SHIELD`: Defaults to 64 Hz. Can be 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 " +"Hz, 32 Hz, 64 Hz, 128 Hz, 256 Hz, or 512 Hz. Note that a higher refresh " +"rate lowers the accuracy and vice-versa." +msgstr "" +"`fir.FIR_SHIELD`: 默认为 64 Hz。可以是 1 Hz、2 Hz、4 Hz、8 Hz、16 Hz、32 Hz、64 Hz、128" +" Hz、256 Hz 或 512 Hz。请注意,刷新率越高,精度越低,反之亦然。" + +#: ../../library/omv.fir.rst:55 +msgid "" +"`fir.FIR_MLX90621`: Defaults to 64 Hz. Can be 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 " +"Hz, 32 Hz, 64 Hz, 128 Hz, 256 Hz, or 512 Hz. Note that a higher refresh " +"rate lowers the accuracy and vice-versa." +msgstr "" +"`fir.FIR_MLX90621`: 默认为 64 Hz。可以是 1 Hz、2 Hz、4 Hz、8 Hz、16 Hz、32 Hz、64 " +"Hz、128 Hz、256 Hz 或 512 Hz。请注意,刷新率越高,精度越低,反之亦然。" + +#: ../../library/omv.fir.rst:56 +msgid "" +"`fir.FIR_MLX90640`: Defaults to 32 Hz. Can be 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 " +"Hz, 32 Hz, or 64 Hz. Note that a higher refresh rate lowers the accuracy " +"and vice-versa." +msgstr "" +"`fir.FIR_MLX90640`: 默认为 32 Hz。可以是 1 Hz、2 Hz、4 Hz、8 Hz、16 Hz、32 Hz 或 64 " +"Hz。请注意,刷新率越高,精度越低,反之亦然。" + +#: ../../library/omv.fir.rst:57 +msgid "" +"`fir.FIR_MLX90641`: Defaults to 32 Hz. Can be 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 " +"Hz, 32 Hz, or 64 Hz. Note that a higher refresh rate lowers the accuracy " +"and vice-versa." +msgstr "" +"`fir.FIR_MLX90641`: 默认为 32 Hz。可以是 1 Hz、2 Hz、4 Hz、8 Hz、16 Hz、32 Hz 或 64 " +"Hz。请注意,刷新率越高,精度越低,反之亦然。" + +#: ../../library/omv.fir.rst:58 +msgid "`fir.FIR_AMG8833`: 10 Hz" +msgstr "`fir.FIR_AMG8833`: 10 Hz" + +#: ../../library/omv.fir.rst:60 +msgid "``resolution`` is the thermopile sensor measurement resolution:" +msgstr "``resolution`` 是热电堆传感器的测量分辨率:" + +#: ../../library/omv.fir.rst:63 +msgid "" +"`fir.FIR_SHIELD`: Defaults to 18-bits. Can be 15-bits, 16-bits, 17-bits, " +"or 18-bits. Note that a higher resolution lowers the maximum temperature " +"range and vice-versa." +msgstr "`fir.FIR_SHIELD`: 默认为18位。可以是15位、16位、17位或18位。请注意,分辨率越高,最大温度范围越小,反之亦然。" + +#: ../../library/omv.fir.rst:64 +msgid "" +"`fir.FIR_MLX90621`: Defaults to 18-bits. Can be 15-bits, 16-bits, " +"17-bits, or 18-bits. Note that a higher resolution lowers the maximum " +"temperature range and vice-versa." +msgstr "`fir.FIR_MLX90621`: 默认为18位。可以是15位、16位、17位或18位。请注意,分辨率越高,最大温度范围越小,反之亦然。" + +#: ../../library/omv.fir.rst:65 +msgid "" +"`fir.FIR_MLX90640`: Defaults to 19-bits. Can be 16-bits, 17-bits, " +"18-bits, or 19-bits. Note that a higher resolution lowers the maximum " +"temperature range and vice-versa." +msgstr "`fir.FIR_MLX90640`: 默认为19位。可以是16位、17位、18位或19位。请注意,分辨率越高,最大温度范围越小,反之亦然。" + +#: ../../library/omv.fir.rst:66 +msgid "" +"`fir.FIR_MLX90641`: Defaults to 19-bits. Can be 16-bits, 17-bits, " +"18-bits, or 19-bits. Note that a higher resolution lowers the maximum " +"temperature range and vice-versa." +msgstr "" +"`fir.FIR_MLX90641`: 默认为 19 位。可以是 16 位、17 位、18 位 或 19 " +"位。请注意,分辨率越高,最大温度范围越小,反之亦然。" + +#: ../../library/omv.fir.rst:67 +msgid "`fir.FIR_AMG8833`: 12-bits." +msgstr "`fir.FIR_AMG8833`: 12 位。" + +#: ../../library/omv.fir.rst:69 +msgid "For the `fir.FIR_SHIELD` and `fir.FIR_MLX90621`:" +msgstr "对于 `fir.FIR_SHIELD` 和 `fir.FIR_MLX90621`:" + +#: ../../library/omv.fir.rst:71 +msgid "15-bits -> Max of ~950C." +msgstr "15 位 -> 最大约 950 摄氏度。" + +#: ../../library/omv.fir.rst:72 ../../library/omv.fir.rst:78 +msgid "16-bits -> Max of ~750C." +msgstr "16 位 -> 最大约 750 摄氏度。" + +#: ../../library/omv.fir.rst:73 ../../library/omv.fir.rst:79 +msgid "17-bits -> Max of ~600C." +msgstr "17 位 -> 最大约 600 摄氏度。" + +#: ../../library/omv.fir.rst:74 ../../library/omv.fir.rst:80 +msgid "18-bits -> Max of ~450C." +msgstr "18 位 -> 最大约 450 摄氏度。" + +#: ../../library/omv.fir.rst:76 +msgid "For the `fir.FIR_MLX90640` and `fir.FIR_MLX90641`:" +msgstr "对于 `fir.FIR_MLX90640` 和 `fir.FIR_MLX90641`:" + +#: ../../library/omv.fir.rst:81 +msgid "19-bits -> Max of ~300C." +msgstr "19 位 -> 最大约 300 摄氏度。" + +#: ../../library/omv.fir.rst:83 +msgid "For the `fir.FIR_AMG8833`:" +msgstr "对于 `fir.FIR_AMG8833`:" + +#: ../../library/omv.fir.rst:85 +msgid "Max of ~80C." +msgstr "最大约 80 摄氏度。" + +#: ../../library/omv.fir.rst:89 +msgid "Deinitializes the thermal sensor freeing up resources." +msgstr "反初始化热传感器,释放资源。" + +#: ../../library/omv.fir.rst:93 +msgid "Returns the width (horizontal resolution) of the thermal sensor in-use:" +msgstr "返回正在使用的热传感器的宽度(水平分辨率):" + +#: ../../library/omv.fir.rst:96 +msgid "`fir.FIR_SHIELD`: 16 pixels." +msgstr "`fir.FIR_SHIELD`: 16 像素。" + +#: ../../library/omv.fir.rst:97 +msgid "`fir.FIR_MLX90621`: 16 pixels." +msgstr "`fir.FIR_MLX90621`: 16 像素。" + +#: ../../library/omv.fir.rst:98 +msgid "`fir.FIR_MLX90640`: 32 pixels." +msgstr "`fir.FIR_MLX90640`: 32像素。" + +#: ../../library/omv.fir.rst:99 +msgid "`fir.FIR_MLX90641`: 16 pixels." +msgstr "`fir.FIR_MLX90641`: 16 像素。" + +#: ../../library/omv.fir.rst:100 ../../library/omv.fir.rst:111 +msgid "`fir.FIR_AMG8833`: 8 pixels." +msgstr "`fir.FIR_AMG8833`: 8 像素。" + +#: ../../library/omv.fir.rst:104 +msgid "Returns the height (vertical resolution) of the thermal sensor in-use:" +msgstr "返回正在使用的热传感器的高度(垂直分辨率):" + +#: ../../library/omv.fir.rst:107 +msgid "`fir.FIR_SHIELD`: 4 pixels." +msgstr "`fir.FIR_SHIELD`: 4 像素。" + +#: ../../library/omv.fir.rst:108 +msgid "`fir.FIR_MLX90621`: 4 pixels." +msgstr "`fir.FIR_MLX90621`: 4 像素。" + +#: ../../library/omv.fir.rst:109 +msgid "`fir.FIR_MLX90640`: 24 pixels." +msgstr "`fir.FIR_MLX90640`: 24 像素。" + +#: ../../library/omv.fir.rst:110 +msgid "`fir.FIR_MLX90641`: 12 pixels." +msgstr "`fir.FIR_MLX90641`: 12像素。" + +#: ../../library/omv.fir.rst:115 +msgid "Returns the type of the thermal sensor in-use:" +msgstr "返回正在使用的热传感器的类型:" + +#: ../../library/omv.fir.rst:117 +msgid "`fir.FIR_NONE`" +msgstr "`fir.FIR_NONE`" + +#: ../../library/omv.fir.rst:118 +msgid "`fir.FIR_SHIELD`" +msgstr "`fir.FIR_SHIELD`" + +#: ../../library/omv.fir.rst:119 +msgid "`fir.FIR_MLX90621`" +msgstr "`fir.FIR_MLX90621`" + +#: ../../library/omv.fir.rst:120 +msgid "`fir.FIR_MLX90640`" +msgstr "`fir.FIR_MLX90640`" + +#: ../../library/omv.fir.rst:121 +msgid "`fir.FIR_MLX90641`" +msgstr "`fir.FIR_MLX90641`" + +#: ../../library/omv.fir.rst:122 +msgid "`fir.FIR_AMG8833`" +msgstr "`fir.FIR_AMG8833`" + +#: ../../library/omv.fir.rst:126 +msgid "Returns the current refresh rate set during `fir.init()` call." +msgstr "返回在 `fir.init()` 调用期间设置的当前刷新率。" + +#: ../../library/omv.fir.rst:130 +msgid "Returns the current resolution set during the `fir.init()` call." +msgstr "返回在 `fir.init()` 调用期间设置的当前分辨率。" + +#: ../../library/omv.fir.rst:134 +msgid "Returns the ambient temperature (i.e. sensor temperature)." +msgstr "返回环境温度(即传感器温度)。" + +#: ../../library/omv.fir.rst:136 ../../library/omv.fir.rst:163 +msgid "Example::" +msgstr "例子::" + +#: ../../library/omv.fir.rst:140 +msgid "The value returned is a float that represents the temperature in celsius." +msgstr "返回的值是表示摄氏度的浮点数。" + +#: ../../library/omv.fir.rst:144 +msgid "" +"Returns a tuple containing the ambient temperature (i.e. sensor " +"temperature), the temperature list (width * height), the minimum " +"temperature seen, and the maximum temperature seen." +msgstr "返回一个元组,其中包含环境温度(即传感器温度)、温度列表(宽度*高度)、观察到的最低温度和观察到的最高温度。" + +#: ../../library/omv.fir.rst:148 +msgid "``hmirror`` if set to True horizontally mirrors the ``ir`` array." +msgstr "``hmirror`` 如果设置为True,则水平镜像 ``ir`` 数组。" + +#: ../../library/omv.fir.rst:150 +msgid "``vflip`` if set to True vertically flips the ``ir`` array." +msgstr "``vflip`` 如果设置为True,则垂直翻转 ``ir`` 数组。" + +#: ../../library/omv.fir.rst:152 +msgid "``transpose`` if set to True transposes the ``ir`` array." +msgstr "``transpose`` 如果设置为True,则转置 ``ir`` 数组。" + +#: ../../library/omv.fir.rst:154 ../../library/omv.fir.rst:312 +msgid "" +"``timeout`` if not -1 then how many milliseconds to wait for the new " +"frame." +msgstr "``timeout`` 如果不是-1,则等待新帧的毫秒数。" + +#: ../../library/omv.fir.rst:156 ../../library/omv.fir.rst:252 +msgid "" +"If you want to rotate an image by multiples of 90 degrees pass the " +"following::" +msgstr "如果要旋转图像的角度为90的倍数,则传递以下内容::" + +#: ../../library/omv.fir.rst:167 +msgid "The values returned are floats that represent the temperature in celsius." +msgstr "返回的值时表示摄氏度的浮点数。" + +#: ../../library/omv.fir.rst:171 +msgid "``ir`` is a (width * height) list of floats (4-bytes each)." +msgstr "``ir`` 是浮点数(每个4字节)的(宽度*高度)列表。" + +#: ../../library/omv.fir.rst:175 +msgid "" +"Draws an ``ir`` array on ``image`` whose top-left corner starts at " +"location x, y. This method automatically handles rendering the image " +"passed into the correct pixel format for the destination image while also" +" handling clipping seamlessly." +msgstr "" +"在 ``image`` 上绘制一个 ``ir`` " +"数组,其左上角从位置x、y开始。此方法会自动将传入的图像呈现为图像的正确像素格式,同时无缝处理裁剪。" + +#: ../../library/omv.fir.rst:179 ../../library/omv.fir.rst:259 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向的显示比例(float)。如果此值为负,则图像将水平翻转。注意,如果未指定 " +"``y_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.fir.rst:183 ../../library/omv.fir.rst:263 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向的显示比例(float)。如果此值为负,则图像将垂直翻转。注意,如果未指定 " +"``x_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.fir.rst:187 ../../library/omv.fir.rst:267 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"source image to draw. This allows you to extract just the pixels in the " +"ROI to scale and draw on the destination image." +msgstr "``roi`` 是源图像要绘制的感兴趣区域的矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域中的像素以在目标图像上进行缩放和绘制。" + +#: ../../library/omv.fir.rst:190 ../../library/omv.fir.rst:270 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render onto the destination image. For " +"example, if you pass ``rgb_channel=1`` this will extract the green " +"channel of the source RGB565 image and draw that in grayscale on the " +"destination image." +msgstr "" +"``rgb_channel`` 是要从 RGB565 图像中提取(如果传递)并渲染到目标图像上的 RGB " +"通道(0=R,G=1,B=2)。例如,如果传递 ``rgb_channel=1``,则会提取源 RGB565 " +"图像的绿色通道,并将其以灰度形式绘制到目标图像上。" + +#: ../../library/omv.fir.rst:195 ../../library/omv.fir.rst:275 +msgid "" +"``alpha`` controls how much of the source image to blend into the " +"destination image. A value of 255 draws an opaque source image while a " +"value lower than 255 produces a blend between the source and destination " +"image. 0 results in no modification to the destination image." +msgstr "" +"``alpha`` 控制要混合到目标图像中的源图像的程度。255 的值绘制不透明的源图像,而低于 255 的值会在源图像和目标图像之间产生混合。0" +" 表示不对目标图像进行修改。" + +#: ../../library/omv.fir.rst:199 ../../library/omv.fir.rst:279 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the source image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1`` ,可以是调色板枚举值,或者总像素 256 的 RGB565 " +"图像,用作对源图像的灰度值进行颜色查找表。如果使用,此操作将在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.fir.rst:203 ../../library/omv.fir.rst:283 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the source image being drawn at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总像素256 的 GRAYSCALE 图像,用作调制被绘制到像素级别的源图像的 " +"``alpha`` 值的 alpha 调色板,从而允许您根据它们的灰度值精确控制像素的 alpha 值。在 alpha 查找表中的像素值为 255" +" 时是不透明的,小于 255 的任何值都会变得更透明,直到 0。如果使用,此操作将在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.fir.rst:209 ../../library/omv.fir.rst:289 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.fir.rst:211 ../../library/omv.fir.rst:291 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.fir.rst:212 ../../library/omv.fir.rst:292 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.fir.rst:213 ../../library/omv.fir.rst:293 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.fir.rst:214 ../../library/omv.fir.rst:294 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.fir.rst:215 ../../library/omv.fir.rst:295 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.fir.rst:216 ../../library/omv.fir.rst:296 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.fir.rst:217 ../../library/omv.fir.rst:297 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.fir.rst:218 ../../library/omv.fir.rst:298 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.fir.rst:219 ../../library/omv.fir.rst:299 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.fir.rst:220 ../../library/omv.fir.rst:300 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.fir.rst:221 ../../library/omv.fir.rst:301 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.fir.rst:222 ../../library/omv.fir.rst:302 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.fir.rst:223 ../../library/omv.fir.rst:303 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.fir.rst:224 ../../library/omv.fir.rst:304 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.fir.rst:225 ../../library/omv.fir.rst:305 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.fir.rst:227 ../../library/omv.fir.rst:307 +msgid "" +"``scale`` is a two value tuple which controls the min and max temperature" +" (in celsius) to scale the ``ir`` image. By default it's equal to the " +"image ``ir`` min and ``ir`` max." +msgstr "" +"``scale`` 是一个两个值的元组,它控制最小和最大温度(一摄氏度为单位)以缩放 ``ir`` 图像。默认情况下,它等于图像 ``ir`` " +"的最小值和 ``ir`` 的最大值。" + +#: ../../library/omv.fir.rst:230 +msgid "" +"If x/y are not specified the image will be centered in the field of view." +" If x_scale/y_scale or x_size/y_size are not specified the ``ir`` array " +"will be scaled to fit on the ``image``." +msgstr "" +"如果未指定x/y,则图像将居中显示在视野中。如果未指定x_scale/y_scale或x_size/y_size,则 ``ir`` " +"数组将被缩放以适应 ``image`` 上。" + +#: ../../library/omv.fir.rst:235 +msgid "" +"To handle a transposed ``ir`` array `read_ir` remembers if it was called " +"with ``transposed`` ``True``. This is then passed to ``draw_ir`` " +"internally." +msgstr "" +"要处理转置的 ``ir`` 数组,`read_ir` 将记住是否使用 ``transposed`` ``True`` " +"调用了它。然后在内部将其传递给 ``draw_ir``。" + +#: ../../library/omv.fir.rst:240 +msgid "" +"Works like `sensor.snapshot()` and returns an `image` object that is " +"either `image.GRAYSCALE` (grayscale) or `image.RGB565` (color). If " +"``copy_to_fb`` is False then the new image is allocated on the " +"MicroPython heap. However, the MicroPython heap is limited and may not " +"have space to store the new image if exhausted. Instead, set " +"``copy_to_fb`` to True to set the frame buffer to the new image making " +"this function work just like `sensor.snapshot()`." +msgstr "" +"类似于 `sensor.snapshot()`,返回一个 `image` 对象,其类型为 `image.GRAYSCALE` (灰度)或 " +"`image.RGB565` (彩色)。如果 ``copy_to_fb`` 为 False,则在 MicroPython " +"堆上分配新图像。但是,MicroPython 堆有限,如果耗尽空间,则可能无法存储新图像。相反,将 ``copy_to_fb`` 设置为 " +"True,将帧缓冲区设置为新图像,使此函数的工作方式与 `sensor.snapshot()` 相同。" + +#: ../../library/omv.fir.rst:246 +msgid "``hmirror`` if set to True horizontally mirrors the new image." +msgstr "``hmirror`` 如果设置为True,则水平镜像新图像。" + +#: ../../library/omv.fir.rst:248 +msgid "``vflip`` if set to True vertically flips the new image." +msgstr "``vflip`` 如果设置为True,则垂直翻转新图像。" + +#: ../../library/omv.fir.rst:250 +msgid "``transpose`` if set to True transposes the new image." +msgstr "``transpose`` 如果设置为True,则转置新图像。" + +#: ../../library/omv.fir.rst:310 +msgid "``pixformat`` if specified controls the final image pixel format." +msgstr "如果指定了 ``pixformat``,则控制最终图像的像素格式。" + +#: ../../library/omv.fir.rst:314 +msgid "Returns an image object." +msgstr "返回一个图像对象。" + +#: ../../library/omv.fir.rst:317 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.fir.rst:322 +msgid "No FIR sensor type." +msgstr "无FIR传感器类型。" + +#: ../../library/omv.fir.rst:327 +msgid "The OpenMV Cam Thermopile Shield Type (MLX90621)." +msgstr "OpenMV Cam 热电堆扩展板板类型(MLX90621)。" + +#: ../../library/omv.fir.rst:332 +msgid "FIR_MLX90621 FIR sensor." +msgstr "FIR_MLX90621 FIR 传感器。" + +#: ../../library/omv.fir.rst:337 ../../library/omv.fir.rst:342 +msgid "FIR_MLX90640 FIR sensor." +msgstr "FIR_MLX90640 FIR 传感器。" + +#: ../../library/omv.fir.rst:347 +msgid "FIR_AMG8833 FIR sensor." +msgstr "FIR_AMG8833 FIR 传感器。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ft5x06.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ft5x06.po new file mode 100644 index 0000000000000..1e01174df68c6 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ft5x06.po @@ -0,0 +1,164 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.ft5x06.rst:2 +msgid ":mod:`ft5x06` --- Touch Screen Driver" +msgstr ":mod:`ft5x06` --- 触摸屏驱动" + +#: ../../library/omv.ft5x06.rst:7 +msgid "Touch Screen Driver for the OpenMV Pure Thermal." +msgstr "OpenMV Pure Thermal 的触摸屏驱动。" + +#: ../../library/omv.ft5x06.rst:11 +msgid "This will be refactored to be under the display module soon." +msgstr "这将很快被重构到显示模块下。" + +#: ../../library/omv.ft5x06.rst:14 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.ft5x06.rst:18 +msgid "Creates a touch screen controller object" +msgstr "创建一个触摸屏控制器对象" + +#: ../../library/omv.ft5x06.rst:21 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.ft5x06.rst:25 +msgid "This is one of LCD_GESTURE_*." +msgstr "状态为 LCD_GESTURE_* 之一。" + +#: ../../library/omv.ft5x06.rst:27 ../../library/omv.ft5x06.rst:34 +#: ../../library/omv.ft5x06.rst:43 ../../library/omv.ft5x06.rst:53 +#: ../../library/omv.ft5x06.rst:62 ../../library/omv.ft5x06.rst:71 +msgid "" +"When a callback is enabled for the touch screen this method should not be" +" called anymore except inside of the callback." +msgstr "当触摸屏调用回调时,除了在回调内部,不应再调用此方法。" + +#: ../../library/omv.ft5x06.rst:32 +msgid "This returns the current number of touch points (0-5)." +msgstr "返回当前触摸点数(0-5)。" + +#: ../../library/omv.ft5x06.rst:39 +msgid "This returns the current touch point state of the point at ``index``." +msgstr "返回索引为 ``index`` 的触摸点当前状态。" + +#: ../../library/omv.ft5x06.rst:41 +msgid "This is one of LCD_FLAG_*." +msgstr "状态为 LCD_FLAG_* 之一。" + +#: ../../library/omv.ft5x06.rst:48 +msgid "This returns the current touch point ``id`` of the point at ``index``." +msgstr "返回索引为 ``index`` 的触摸点当前 ``id``。" + +#: ../../library/omv.ft5x06.rst:50 +msgid "" +"The touch point ``id`` is a numeric value that allows you to track a " +"touch point as it may move around in list of touch points returned as " +"points are added and removed." +msgstr "触摸点 ``id`` 是一个数值,允许您跟踪触摸点,因为它可能在添加和删除点时返回的" +"触摸点列表中移动。" + +#: ../../library/omv.ft5x06.rst:58 +msgid "This returns the current touch point x position of the point at ``index``." +msgstr "返回索引为 ``index`` 的触摸点当前X位置。" + +#: ../../library/omv.ft5x06.rst:60 +msgid "This is the x pixel position of the touch point on the screen." +msgstr "这是触摸点在屏幕上的x像素位置。" + +#: ../../library/omv.ft5x06.rst:67 +msgid "This returns the current touch point y position of the point at ``index``." +msgstr "返回索引为 ``index`` 的触摸点当前y位置。" + +#: ../../library/omv.ft5x06.rst:69 +msgid "This is the y pixel position of the touch point on the screen." +msgstr "这是触摸点在屏幕上的y像素位置。" + +#: ../../library/omv.ft5x06.rst:76 +msgid "" +"This method registers a callback which will receive the number of touch " +"points (0-5) when a touch event happens." +msgstr "注册一个回调,当触摸事件发生时将接收触摸点数(0-5)。" + +#: ../../library/omv.ft5x06.rst:79 +msgid "" +"If you use this method do not call `FT5X06.update_points()` anymore until" +" the callback is disabled by pass ``None`` as the callback for this " +"method." +msgstr "" +"如果使用此方法,请不要再调用 `FT5X06.update_points()` " +",直到通过此方法将回调禁用为止,即将 ``None`` 作为此方法的回调参数。" + +#: ../../library/omv.ft5x06.rst:84 +msgid "" +"This function reads the touch screen state and returns the number of " +"touch points (0-5)." +msgstr "读取触摸屏状态并返回触摸点数(0-5)。" + +#: ../../library/omv.ft5x06.rst:87 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.ft5x06.rst:91 +msgid "Touch screen move up gesture." +msgstr "触摸屏上滑手势。" + +#: ../../library/omv.ft5x06.rst:95 +msgid "Touch screen move left gesture." +msgstr "触摸屏左滑手势。" + +#: ../../library/omv.ft5x06.rst:99 +msgid "Touch screen move down gesture." +msgstr "触摸屏下滑手势。" + +#: ../../library/omv.ft5x06.rst:103 +msgid "Touch screen move right gesture." +msgstr "触摸屏右滑手势。" + +#: ../../library/omv.ft5x06.rst:107 +msgid "Touch screen zoom in gesture." +msgstr "触摸屏放大手势。" + +#: ../../library/omv.ft5x06.rst:111 +msgid "Touch screen zoom out gesture." +msgstr "触摸屏缩小手势。" + +#: ../../library/omv.ft5x06.rst:115 +msgid "Touch screen no gesture." +msgstr "触摸屏无手势。" + +#: ../../library/omv.ft5x06.rst:119 +msgid "Touch point is pressed." +msgstr "触摸点被按下。" + +#: ../../library/omv.ft5x06.rst:123 +msgid "Touch point is released." +msgstr "触摸点被释放。" + +#: ../../library/omv.ft5x06.rst:127 +msgid "Touch point is moved." +msgstr "触摸点被移动。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.gif.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.gif.po new file mode 100644 index 0000000000000..f639c0e5fffb8 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.gif.po @@ -0,0 +1,135 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.gif.rst:2 +msgid ":mod:`gif` --- gif recording" +msgstr ":mod:`gif` --- GIF 录制" + +#: ../../library/omv.gif.rst:7 +msgid "The ``gif`` module is used for gif recording." +msgstr "``gif`` 模块用于GIF录制。" + +#: ../../library/omv.gif.rst:10 +msgid "class Gif -- Gif recorder" +msgstr "class Gif -- GIF 录制器" + +#: ../../library/omv.gif.rst:12 +msgid "" +"You can use the gif module to record small video clips. Note that gif " +"files save uncompressed image data. So, they are best for recording short" +" video clips that you want to share. Use `mjpeg` for long clips." +msgstr "" +"您可以使用gif模块记录小视频片段。请注意,gif文件保存未压缩的图像数据。因此," +"它们最适合记录想要分享的短视频片段。对于长视频片段,请使用 `mjpeg` 。" + +#: ../../library/omv.gif.rst:16 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/omv.gif.rst:37 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.gif.rst:41 +msgid "" +"Create a Gif object which you can add frames to. ``filename`` is the path" +" to save the gif recording to." +msgstr "创建一个可以向其中添加帧的 Gif 对象。``filename`` 是保存 gif 录制的路径。" + +#: ../../library/omv.gif.rst:44 +msgid "" +"``width`` is automatically set equal to the image sensor horizontal " +"resolution unless explicitly overridden." +msgstr "``width`` 被自动设置为图像传感器的水平分辨率,除非明确覆盖。" + +#: ../../library/omv.gif.rst:47 +msgid "" +"``height`` is automatically set equal to the image sensor vertical " +"resolution unless explicitly overridden." +msgstr "``height`` 被自动设置为图像传感器的垂直分辨率,除非明确覆盖。" + +#: ../../library/omv.gif.rst:50 +msgid "" +"``color`` is automatically set equal to the image sensor color mode " +"unless explicitly overridden:" +msgstr "``color`` 被自动设置为图像传感器的颜色模式,除非明确覆盖:" + +#: ../../library/omv.gif.rst:53 +msgid "False for color results in a `sensor.GRAYSCALE` 7-bit per pixel gif." +msgstr "False 表示颜色为灰度,产生每像素 7 位的 `sensor.GRAYSCALE` gif。" + +#: ../../library/omv.gif.rst:54 +msgid "True for color results in a `sensor.RGB565` 7-bit per pixel gif." +msgstr "True 表示颜色为彩色,产生每像素7位的 `sensor.RGB565` gif。" + +#: ../../library/omv.gif.rst:56 +msgid "``loop`` when True results in the gif automatically looping on playback." +msgstr "``loop`` 为 True 时,导致 gif 在播放时自动循环。" + +#: ../../library/omv.gif.rst:59 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.gif.rst:63 +msgid "Returns the width (horizontal resolution) for the gif object." +msgstr "返回 gif 对象的宽度(水平分辨率)。" + +#: ../../library/omv.gif.rst:67 +msgid "Returns the height (vertical resolution) for the gif object." +msgstr "返回 gif 对象的高度(垂直分辨率)。" + +#: ../../library/omv.gif.rst:71 +msgid "Returns `sensor.RGB565` if color is True or `sensor.GRAYSCALE` if not." +msgstr "如果颜色为 True,则返回 `sensor.RGB565`,否则返回 `sensor.GRAYSCALE`。" + +#: ../../library/omv.gif.rst:75 +msgid "" +"Returns the file size of the gif so far. This value is updated after " +"adding frames." +msgstr "返回到目前为止gif的文件大小。此值在添加帧后更新。" + +#: ../../library/omv.gif.rst:79 +msgid "Returns if the gif object had loop set in its constructor." +msgstr "如果gif对象在其构造函数中设置了循环则返回。" + +#: ../../library/omv.gif.rst:83 +msgid "" +"Add an image to the gif recording. The image width, height, and color " +"mode, must be equal to the same width, height, and color modes used in " +"the constructor for the gif." +msgstr "将图像添加到gif录制中。图像的宽度、高度和颜色模式必须与构造gif时使用的宽度、" +"高度和颜色模式相同。" + +#: ../../library/omv.gif.rst:87 +msgid "" +"``delay`` is the number of centi-seconds to wait before displaying this " +"frame after the previous frame (if not the first frame)." +msgstr "``delay`` " +"是在上一帧(如果不是第一帧)后显示此帧之前等待的以厘秒为单位的时间。" + +#: ../../library/omv.gif.rst:92 +msgid "" +"Finalizes the gif recording. This method must be called once the " +"recording is complete to make the file viewable." +msgstr "完成gif录制。完成录制后必须调用此方法才能查看文件。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.gt911.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.gt911.po new file mode 100644 index 0000000000000..167de67ce3922 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.gt911.po @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.gt911.rst:2 +msgid ":mod:`gt911` --- Touch Screen Driver" +msgstr ":mod:`gt911` --- 触摸屏驱动" + +#: ../../library/omv.gt911.rst:7 +msgid "Basic polling mode example usage::" +msgstr "基本轮询模式示例用法::" + +#: ../../library/omv.gt911.rst:22 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.gt911.rst:26 +msgid "" +"Creates a touch screen controller object. You should initialize it " +"according to the example above." +msgstr "创建一个触摸屏控制器对象。您应该根据上面的示例进行初始化。" + +#: ../../library/omv.gt911.rst:29 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.gt911.rst:33 +msgid "Reads a register value." +msgstr "读取寄存器值。" + +#: ../../library/omv.gt911.rst:37 +msgid "Writes a register value." +msgstr "写入寄存器值。" + +#: ../../library/omv.gt911.rst:41 +msgid "Returns the ID of the gt911 chip." +msgstr "返回gt911芯片的ID。" + +#: ../../library/omv.gt911.rst:45 +msgid "" +"Returns a tuple containing the count of points an array of point tuples. " +"Each point tuple has an x[0], y[1], size[2], and id[3]. x/y are the " +"position on screen. Size is the amount of pressure applied. And id is a " +"unique id per point which should correlate to the same point over reads." +msgstr "" +"返回一个包含点数计数和点元组数组的元组。每个点元组具有 x[0]、y[1]、size[2] " +"和 id[3]。x/y 是屏幕上的位置。Size 是施加的压力量。Id 是每个点的唯一 " +"ID,应与读取的相同点相关联。" + +#: ../../library/omv.gt911.rst:51 +msgid "Resets the gt911 chip." +msgstr "复位gt911芯片。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.image.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.image.po new file mode 100644 index 0000000000000..d1a2cf193fc3d --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.image.po @@ -0,0 +1,5201 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:30+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.image.rst:2 +msgid ":mod:`image` --- machine vision" +msgstr ":mod:`image` --- 机器视觉" + +#: ../../library/omv.image.rst:7 +msgid "The ``image`` module is used for machine vision." +msgstr "``image`` 模块用于机器视觉。" + +#: ../../library/omv.image.rst:10 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.image.rst:14 +msgid "Returns a converted binary value (0-1) to a grayscale value (0-255)." +msgstr "返回二进制值(0-1)对应的灰度值(0-255)。" + +#: ../../library/omv.image.rst:18 +msgid "Returns a converted binary value (0-1) to a 3 value RGB888 tuple." +msgstr "返回二进制值(0-1)对应的RGB888格式的元组(r, g, b)。" + +#: ../../library/omv.image.rst:22 +msgid "Returns a converted binary value (0-1) to a 3 value LAB tuple." +msgstr "返回二进制值(0-1)对应的LAB格式的元组(l, a, b)。" + +#: ../../library/omv.image.rst:24 ../../library/omv.image.rst:50 +#: ../../library/omv.image.rst:94 ../../library/omv.image.rst:190 +msgid "L goes between 0 and 100 and A/B go from -128 to 128." +msgstr "L的范围为0到100, A和B的范围为-128到128。" + +#: ../../library/omv.image.rst:28 +msgid "Returns a converted binary value (0-1) to a 3 value YUV tuple." +msgstr "返回二进制值(0-1)对应的YUV格式的元组(y, u, v)。" + +#: ../../library/omv.image.rst:30 ../../library/omv.image.rst:62 +#: ../../library/omv.image.rst:106 ../../library/omv.image.rst:148 +msgid "Y goes between 0 and 255 and U/V go from -128 to 128." +msgstr "Y的范围为0到255, U和V范围为-128到128。" + +#: ../../library/omv.image.rst:34 +msgid "Returns a converted grayscale value (0-255) to a binary value (0-1)." +msgstr "返回灰度值(0-255)对应的二进制值(0-1)。" + +#: ../../library/omv.image.rst:38 +msgid "Returns a converted grayscale value to a 3 value RGB888 tuple." +msgstr "返回灰度值(0-255)对应的RGB888格式的元组(r, g, b)。" + +#: ../../library/omv.image.rst:42 +msgid "" +"The OpenMV Cam firmware does the conversion using a RGB565->RGB888 " +"process so this method won't return the exact values as a pure RGB888 " +"system would. However, it's true to how the image lib works internally." +msgstr "" +"OpenMV " +"Cam固件使用RGB565->RGB888处理转换,因此此方法不会像纯RGB888系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:48 +msgid "Returns a converted grayscale value to a 3 value LAB tuple." +msgstr "返回灰度值(0-255)对应的LAB格式的元组(l, a, b)。" + +#: ../../library/omv.image.rst:54 +msgid "" +"The OpenMV Cam firmware does the conversion using a RGB565->LAB process " +"so this method won't return the exact values as a pure LAB system would. " +"However, it's true to how the image lib works internally." +msgstr "" +"OpenMV Cam固件使用RGB565-> " +"LAB处理转换,因此此方法不会像纯RGB888系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:60 +msgid "Returns a converted grayscale value to a 3 value YUV tuple." +msgstr "返回灰度值(0-255)对应的YUV格式的元组(y, u, v)。" + +#: ../../library/omv.image.rst:66 +msgid "" +"The OpenMV Cam firmware does the conversion using a RGB565->YUV process " +"so this method won't return the exact values as a pure YUV system would. " +"However, it's true to how the image lib works internally." +msgstr "OpenMV Cam固件使用RGB565->YUV处理转换,因此此方法不会像纯RGB888系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:72 +msgid "" +"Returns a converted 3 value RGB888 tuple to a center range thresholded " +"binary value (0-1)." +msgstr "返回RGB888格式的元组(r, g, b)对应的中心范围阈值二进制值(0-1)。" + +#: ../../library/omv.image.rst:76 ../../library/omv.image.rst:86 +#: ../../library/omv.image.rst:98 ../../library/omv.image.rst:110 +msgid "" +"The OpenMV Cam firmware does the conversion using a RGB888->RGB565 " +"process so this method won't return the exact values as a pure RGB888 " +"system would. However, it's true to how the image lib works internally." +msgstr "" +"OpenMV " +"Cam固件使用RGB888->RGB565处理转换,因此此方法不会像纯RGB888系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:82 +msgid "Returns a converted 3 value RGB888 tuple to a grayscale value (0-255)." +msgstr "返回RGB888格式的元组(r, g, b)对应的灰度值(0-255)。" + +#: ../../library/omv.image.rst:92 +msgid "Returns a converted 3 value RGB888 tuple to a 3 value LAB tuple." +msgstr "返回RGB888格式的元组(r, g, b)对应的LAB格式的元组(l, a, b)。" + +#: ../../library/omv.image.rst:104 +msgid "Returns a converted 3 value RGB888 tuple to a 3 value YUV tuple." +msgstr "返回RGB888格式的元组(r, g, b)对应的YUV格式的元组(y, u, v)。" + +#: ../../library/omv.image.rst:116 +msgid "" +"Returns a converted 3 value LAB tuple to a center range thresholded " +"binary value (0-1)." +msgstr "返回LAB格式的元组(l, a, b)对应的中心范围阈值二进制值(0-1)。" + +#: ../../library/omv.image.rst:120 ../../library/omv.image.rst:130 +#: ../../library/omv.image.rst:140 ../../library/omv.image.rst:152 +msgid "" +"The OpenMV Cam firmware does the conversion using a LAB->RGB565 process " +"so this method won't return the exact values as a pure LAB system would. " +"However, it's true to how the image lib works internally." +msgstr "OpenMV Cam固件使用LAB->RGB565处理转换,因此此方法不会像纯LAB系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:126 +msgid "Returns a converted 3 value LAB tuple to a grayscale value (0-255)." +msgstr "返回LAB格式的元组(l, a, b)对应的灰度值(0-255)。" + +#: ../../library/omv.image.rst:136 +msgid "Returns a converted 3 value LAB tuple to a 3 value RGB888 tuple." +msgstr "返回LAB格式的元组(l, a, b)对应的RGB888格式的元组(r, g, b)。" + +#: ../../library/omv.image.rst:146 +msgid "Returns a converted 3 value LAB tuple to a 3 value YUV tuple." +msgstr "返回LAB格式的元组(l, a, b)对应的YUV格式的元组(y, u, v)。" + +#: ../../library/omv.image.rst:158 +msgid "" +"Returns a converted 3 value YUV tuple to a center range thresholded " +"binary value (0-1)." +msgstr "返回YUV格式的元组(y, u, v)对应的中心范围阈值二进制值(0-1)。" + +#: ../../library/omv.image.rst:162 ../../library/omv.image.rst:172 +#: ../../library/omv.image.rst:182 ../../library/omv.image.rst:194 +msgid "" +"The OpenMV Cam firmware does the conversion using a YUV->RGB565 process " +"so this method won't return the exact values as a pure YUV system would. " +"However, it's true to how the image lib works internally." +msgstr "OpenMV Cam固件使用YUV->RGB565处理转换,因此此方法不会像纯YUV系统那样返回准确的值。但是,图像库在内部确实是这样工作的。" + +#: ../../library/omv.image.rst:168 +msgid "Returns a converted 3 value YUV tuple to a grayscale value (0-255)." +msgstr "返回YUV格式的元组(y, u, v)对应的灰度值(0-255)。" + +#: ../../library/omv.image.rst:178 +msgid "Returns a converted 3 value YUV tuple to a 3 value RGB888 tuple." +msgstr "返回YUV格式的元组(y, u, v)对应的RGB888格式的元组(r, g, b)。" + +#: ../../library/omv.image.rst:188 +msgid "Returns a converted 3 value YUV tuple to a 3 value LAB tuple." +msgstr "返回YUV格式的元组(y, u, v)对应的LAB格式的元组(l, a, b)。" + +#: ../../library/omv.image.rst:200 +msgid "Loads a descriptor object from disk." +msgstr "从磁盘上加载一个descriptor对象。" + +#: ../../library/omv.image.rst:202 +msgid "``path`` is the path to the descriptor file to load." +msgstr "``path`` 是加载的descriptor的文件路径。" + +#: ../../library/omv.image.rst:206 +msgid "Saves the descriptor object ``descriptor`` to disk." +msgstr "保存描述符对象 ``descriptor`` 到磁盘。" + +#: ../../library/omv.image.rst:208 +msgid "``path`` is the path to the descriptor file to save." +msgstr "``path`` 是descriptor文件保存的路径。" + +#: ../../library/omv.image.rst:212 +msgid "" +"For LBP descriptors this function returns an integer representing the " +"difference between the two descriptors. You may then threshold/compare " +"this distance metric as necessary. The distance is a measure of " +"similarity. The closer it is to zero the better the LBP keypoint match." +msgstr "对于LBP描述符来说,这个函数返回的是一个体现两个描述符之间区别的整数。你可以接下来计算阈值或者比较这个距离。这个距离是对相似度的一个度量。这个测度值越接近0,LBPF特征点就越匹配。" + +#: ../../library/omv.image.rst:217 +msgid "" +"For ORB descriptors this function returns the ``kptmatch`` object. See " +"above." +msgstr "对于ORB描述符来说,这个函数返回的是 ``kptmatch`` 对象。以下。" + +#: ../../library/omv.image.rst:219 +msgid "" +"``threshold`` is used for ORB keypoints to filter ambiguous matches. A " +"lower ``threshold`` value tightens the keypoint matching algorithm. " +"``threshold`` may be between 0-100 (int). Defaults to 70." +msgstr "" +"``threshold`` 是用来为ORB键点过滤不准确的匹配。一个较低的 ``threshold`` " +"值将减少关键点匹配的结果。``threshold`` 值可以为0-100 (int)。默认值为70。" + +#: ../../library/omv.image.rst:223 +msgid "" +"``filter_outliers`` is used for ORB keypoints to filter out outlier " +"keypoints allow you to raise the ``threshold``. Defaults to False." +msgstr "``filter_outliers`` 用于 ORB 关键点,以过滤异常点关键点,允许您提高 ``threshold``。默认为 False。" + +#: ../../library/omv.image.rst:227 +msgid "class HaarCascade -- Feature Descriptor" +msgstr "HaarCascade类 -- 特征描述符" + +#: ../../library/omv.image.rst:229 +msgid "" +"The Haar Cascade feature descriptor is used for the " +"`Image.find_features()` method. It doesn't have any methods itself for " +"you to call." +msgstr "Haar Cascade特征描述符用于 `Image.find_features()` 方法。它没有供用户调用的方法。" + +#: ../../library/omv.image.rst:234 +msgid "" +"Loads a Haar Cascade into memory from a Haar Cascade binary file " +"formatted for your OpenMV Cam. If you pass \"frontalface\" instead of a " +"path then this constructor will load the built-in frontal face Haar " +"Cascade into memory. Additionally, you can also pass \"eye\" to load a " +"Haar Cascade for eyes into memory. Finally, this method returns the " +"loaded Haar Cascade object for use with `Image.find_features()`." +msgstr "" +"从一个Haar " +"Cascade二进制文件导入到OpenMV的内存中。如果您传递“frontalface”字符串而不是路径,这个构造函数将会把一个内置的正脸的Haar" +" Cascade载入内存。此外,您也可以通过“eye”来把Haar Cascade导入内存。最后,这个方法会返回载入的Haar " +"Cascade对象,用来使用 `Image.find_features()` 。" + +#: ../../library/omv.image.rst:241 +msgid "" +"``stages`` defaults to the number of stages in the Haar Cascade. However," +" you can specify a lower number of stages to speed up processing the " +"feature detector at the cost of a higher rate of false positives." +msgstr "``stages`` 默认值为Haar Cascade中的阶段数。然而,您可以指定一个较低的数值来加速运行特征检测器,当然这会带来较高的误报率。" + +#: ../../library/omv.image.rst:246 +msgid "" +"You can make your own Haar Cascades to use with your OpenMV Cam. First, " +"Google for \" Haar Cascade\" to see if someone already made an " +"OpenCV Haar Cascade for an object you want to detect. If not... then " +"you'll have to generate your own (which is a lot of work). See `here " +"`_ for how to make your own Haar Cascade. Then see this " +"`script `_ for converting OpenCV Haar Cascades into a format your " +"OpenMV Cam can read." +msgstr "" +"您可以制作自己的Haar Cascades 来配合您的OpenMV Cam 使用。首先,使用谷歌搜索“ Haar " +"Cascade”,看看是否有人已经为您想要检测的对象制作了OpenCV Haar Cascade。如果没有... " +"那您需要自己动手制作(工作量巨大)。关于如何制作自己的Haar Cascade,`here " +"`_。关于如何把OpenCV Haar Cascades转化成您的OpenMV Cam可以读取的模式,`script " +"`_。" + +#: ../../library/omv.image.rst:255 +msgid "Q: What is a Haar Cascade?" +msgstr "问:Haar Cascade 是什么?" + +#: ../../library/omv.image.rst:257 +msgid "" +"A: A Haar Cascade is a series of contrast checks that are used to " +"determine if an object is present in the image. The contrast checks are " +"split of into stages where a stage is only run if previous stages have " +"already passed. The contrast checks are simple things like checking if " +"the center vertical of the image is lighter than the edges. Large area " +"checks are performed first in the earlier stages followed by more " +"numerous and smaller area checks in later stages." +msgstr "" +"A: Haar Cascade " +"是一系列用于确定图像中是否存在对象的对比检查。对比检查分为几个阶段,其中一个阶段只在前面的阶段已经通过的情况下运行。对比检查是一些简单的东西,比如检查图像的中垂直中心是否比边缘亮。在较早的阶段首先执行大面积检查,然后在后续阶段执行更多的和更小的面积检查。" + +#: ../../library/omv.image.rst:265 +msgid "Q: How are Haar Cascades made?" +msgstr "Q: 如何制作 Haar Cascade?" + +#: ../../library/omv.image.rst:267 +msgid "" +"A: Haar Cascades are made by training the generator algorithm against " +"positive and negative labeled images. For example, you'd train the " +"generator algorithm against hundreds of pictures with cats in them that " +"have been labeled as images with cats and against hundreds of images with" +" not cat like things labeled differently. The generator algorithm will " +"then produce a Haar Cascade that detects cats." +msgstr "" +"A: 通过针对正负标记图像训练生成器算法来制作 Haar " +"Cascade。例如,您可以针对数百张带有猫的图片进行训练,这些图片被标记为带有猫的图片,并且针对数百张带有不像猫的东西的图片进行标记。然后,生成器算法将生成一个可以检测猫的" +" Haar Cascade。" + +#: ../../library/omv.image.rst:275 +msgid "class Similarity -- Similarity Object" +msgstr "类 Similarity -- Similarity 对象" + +#: ../../library/omv.image.rst:277 +msgid "The similarity object is returned by `Image.get_similarity()`." +msgstr "similarity对象是由 `Image.get_similarity()` 方法返回的。" + +#: ../../library/omv.image.rst:281 +msgid "Please call `Image.get_similarity()` to create this object." +msgstr "请调用 `Image.get_similarity()` 来创建此对象。" + +#: ../../library/omv.image.rst:285 +msgid "" +"Returns the mean of the similarity values computed across the image " +"(float)." +msgstr "返回在整个图像上计算得出的相似度值的平均值(float)。" + +#: ../../library/omv.image.rst:287 ../../library/omv.image.rst:332 +#: ../../library/omv.image.rst:338 ../../library/omv.image.rst:397 +#: ../../library/omv.image.rst:403 ../../library/omv.image.rst:436 +#: ../../library/omv.image.rst:442 ../../library/omv.image.rst:476 +#: ../../library/omv.image.rst:524 ../../library/omv.image.rst:693 +#: ../../library/omv.image.rst:863 ../../library/omv.image.rst:920 +#: ../../library/omv.image.rst:963 ../../library/omv.image.rst:1012 +#: ../../library/omv.image.rst:1115 ../../library/omv.image.rst:1306 +#: ../../library/omv.image.rst:1385 ../../library/omv.image.rst:1463 +#: ../../library/omv.image.rst:1509 +msgid "You may also get this value doing ``[0]`` on the object." +msgstr "您也可以对该对象执行 ``[0]`` 来获取此值。" + +#: ../../library/omv.image.rst:291 +msgid "" +"Returns the standard deviation of the similarity values computed across " +"the image ( (float)." +msgstr "返回在整个图像上计算得出的相似度值的标准差(float)。" + +#: ../../library/omv.image.rst:293 ../../library/omv.image.rst:344 +#: ../../library/omv.image.rst:409 ../../library/omv.image.rst:448 +#: ../../library/omv.image.rst:482 ../../library/omv.image.rst:530 +#: ../../library/omv.image.rst:699 ../../library/omv.image.rst:869 +#: ../../library/omv.image.rst:926 ../../library/omv.image.rst:969 +#: ../../library/omv.image.rst:1018 ../../library/omv.image.rst:1121 +#: ../../library/omv.image.rst:1312 ../../library/omv.image.rst:1391 +#: ../../library/omv.image.rst:1470 ../../library/omv.image.rst:1515 +msgid "You may also get this value doing ``[1]`` on the object." +msgstr "您也可以对该对象执行 ``[1]`` 来获取此值。" + +#: ../../library/omv.image.rst:297 +msgid "" +"Returns the min of the similarity values computed across the image ( " +"(float)." +msgstr "返回在整个图像上计算得出的相似度值的最小值(float)。" + +#: ../../library/omv.image.rst:299 +msgid "" +"Generally, for the SSIM you want to threshold the min value to determine " +"if two images are different." +msgstr "通常,对于结构相似性指数(SSIM),你需要对最小值进行阈值处理,以确定两幅图像是否不同。" + +#: ../../library/omv.image.rst:302 ../../library/omv.image.rst:350 +#: ../../library/omv.image.rst:415 ../../library/omv.image.rst:454 +#: ../../library/omv.image.rst:488 ../../library/omv.image.rst:536 +#: ../../library/omv.image.rst:705 ../../library/omv.image.rst:875 +#: ../../library/omv.image.rst:932 ../../library/omv.image.rst:975 +#: ../../library/omv.image.rst:1024 ../../library/omv.image.rst:1127 +#: ../../library/omv.image.rst:1318 ../../library/omv.image.rst:1397 +#: ../../library/omv.image.rst:1476 ../../library/omv.image.rst:1521 +msgid "You may also get this value doing ``[2]`` on the object." +msgstr "您也可以对该对象执行 ``[2]`` 来获取此值。" + +#: ../../library/omv.image.rst:306 +msgid "" +"Returns the max of the similarity values computed across the image ( " +"(float)." +msgstr "返回在整个图像上计算得出的相似度值的最大值(float)。" + +#: ../../library/omv.image.rst:308 +msgid "" +"Generally, for the DSIM you want to threshold the max value to determine " +"if two images are different." +msgstr "通常,对于结构差异性指数(DSIM),你需要对最大值进行阈值处理,以确定两幅图像是否不同。" + +#: ../../library/omv.image.rst:311 ../../library/omv.image.rst:494 +#: ../../library/omv.image.rst:542 ../../library/omv.image.rst:711 +#: ../../library/omv.image.rst:881 ../../library/omv.image.rst:938 +#: ../../library/omv.image.rst:981 ../../library/omv.image.rst:1030 +#: ../../library/omv.image.rst:1133 ../../library/omv.image.rst:1324 +#: ../../library/omv.image.rst:1403 ../../library/omv.image.rst:1482 +#: ../../library/omv.image.rst:1527 +msgid "You may also get this value doing ``[3]`` on the object." +msgstr "您也可以对该对象执行 ``[3]`` 来获取此值。" + +#: ../../library/omv.image.rst:314 +msgid "class Histogram -- Histogram Object" +msgstr "类 Histogram -- 直方图对象" + +#: ../../library/omv.image.rst:316 +msgid "The histogram object is returned by `Image.get_histogram()`." +msgstr "直方图对象由 `Image.get_histogram()` 返回。" + +#: ../../library/omv.image.rst:318 +msgid "" +"Grayscale histograms have one channel with some number of bins. All bins " +"are normalized so that all bins sum to 1." +msgstr "灰度直方图有一个通道,一些数目的柱。所有柱都被归一化,以便所有柱的和等于 1。" + +#: ../../library/omv.image.rst:321 +msgid "" +"RGB565 histograms have three channels with some number of bins each. All " +"bins are normalized so that all bins in a channel sum to 1." +msgstr "RGB565 直方图有三个通道,每个通道有一些柱。所有柱都被归一化,以便每个通道中的所有柱的和等于 1。" + +#: ../../library/omv.image.rst:326 +msgid "Please call `Image.get_histogram()` to create this object." +msgstr "请调用 `Image.get_histogram()` 来创建此对象。" + +#: ../../library/omv.image.rst:330 +msgid "Returns a list of floats for the grayscale histogram." +msgstr "返回灰度直方图的浮点数列表。" + +#: ../../library/omv.image.rst:336 +msgid "Returns a list of floats for the RGB565 histogram LAB L channel." +msgstr "返回 RGB565 直方图的浮点数列表 LAB L 通道。" + +#: ../../library/omv.image.rst:342 +msgid "Returns a list of floats for the RGB565 histogram LAB A channel." +msgstr "返回 RGB565 直方图的浮点数列表 LAB A 通道。" + +#: ../../library/omv.image.rst:348 +msgid "Returns a list of floats for the RGB565 histogram LAB B channel." +msgstr "返回 RGB565 直方图的浮点数列表 LAB B 通道。" + +#: ../../library/omv.image.rst:354 +msgid "" +"Computes the CDF of the histogram channels and returns a " +"`image.percentile` object with the values of the histogram at the passed " +"in ``percentile`` (0.0 - 1.0) (float). So, if you pass in 0.1 this method" +" will tell you (going from left-to-right in the histogram) what bin when " +"summed into an accumulator caused the accumulator to cross 0.1. This is " +"useful to determine min (with 0.1) and max (with 0.9) of a color " +"distribution without outlier effects ruining your results for adaptive " +"color tracking." +msgstr "" +"计算直方图通道的累积分布函数(CDF),并返回一个带有直方图在传入的 ``percentile`` (0.0-1.0)(float)处值的 " +"`image.percentile` 对象。因此,如果您传入 0.1,该方法将告诉您(从直方图的左到右)哪个柱子在加到累加器中时使累加器越过 " +"0.1。这对于确定颜色分布的最小值(使用 0.1)和最大值(使用 0.9)而不会因异常值效果而破坏自适应颜色跟踪结果非常有用。" + +#: ../../library/omv.image.rst:364 +msgid "" +"Uses Otsu's Method to compute the optimal threshold values that split the" +" histogram into two halves for each channel of the histogram. This method" +" returns a `image.threshold` object. This method is particularly useful " +"for determining optimal `Image.binary()` thresholds." +msgstr "" +"使用 Otsu 方法计算将直方图分成两半的每个通道的最佳阈值值。此方法返回一个 `image.threshold` " +"对象。此方法特别适用于确定最佳的 `Image.binary()` 阈值。" + +#: ../../library/omv.image.rst:371 +msgid "" +"Computes the mean, median, mode, standard deviation, min, max, lower " +"quartile, and upper quartile of each color channel in the histogram and " +"returns a `statistics` object." +msgstr "计算直方图中每个颜色通道的均值、中位数、模式、标准差、最小值、最大值、下四分位数和上四分位数,并返回一个 `statistics` 对象。" + +#: ../../library/omv.image.rst:375 +msgid "" +"You may also use ``histogram.statistics()`` and ``histogram.get_stats()``" +" as aliases for this method." +msgstr "您也可以将 ``histogram.statistics()`` 和 ``histogram.get_stats()`` 用作此方法的别名。" + +#: ../../library/omv.image.rst:379 +msgid "class Percentile -- Percentile Object" +msgstr "类 Percentile -- 百分位数对象" + +#: ../../library/omv.image.rst:381 +msgid "The percentile object is returned by `histogram.get_percentile()`." +msgstr "百分位数对象由 `histogram.get_percentile()` 返回。" + +#: ../../library/omv.image.rst:383 +msgid "" +"Grayscale percentiles have one channel. Use the non ``l_*``, ``a_*``, and" +" ``b_*`` method." +msgstr "灰度百分位数有一个通道。使用非 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:386 +msgid "" +"RGB565 percentiles have three channels. Use the ``l_*``, ``a_*``, and " +"``b_*`` methods." +msgstr "RGB565 百分位数有三个通道。使用 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:391 +msgid "Please call `histogram.get_percentile()` to create this object." +msgstr "请调用 `histogram.get_percentile()` 来创建此对象。" + +#: ../../library/omv.image.rst:395 +msgid "Return the grayscale percentile value (between 0 and 255)." +msgstr "返回灰度百分位数值(介于 0 到 255 之间)。" + +#: ../../library/omv.image.rst:401 +msgid "Return the RGB565 LAB L channel percentile value (between 0 and 100)." +msgstr "返回 RGB565 LAB L 通道百分位数值(介于 0 到 100 之间)。" + +#: ../../library/omv.image.rst:407 +msgid "Return the RGB565 LAB A channel percentile value (between -128 and 127)." +msgstr "返回 RGB565 LAB A 通道百分位数值(介于 -128 到 127 之间)。" + +#: ../../library/omv.image.rst:413 +msgid "Return the RGB565 LAB B channel percentile value (between -128 and 127)." +msgstr "返回 RGB565 LAB B 通道百分位数值(介于 -128 到 127 之间)。" + +#: ../../library/omv.image.rst:418 +msgid "class Threshold -- Threshold Object" +msgstr "类 Threshold -- 阈值对象" + +#: ../../library/omv.image.rst:420 +msgid "The threshold object is returned by `histogram.get_threshold()`." +msgstr "阈值对象由 `histogram.get_threshold()` 返回。" + +#: ../../library/omv.image.rst:422 +msgid "" +"Grayscale thresholds have one channel. Use the non ``l_*``, ``a_*``, and " +"``b_*`` method." +msgstr "灰度阈值有一个通道。使用非 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:425 +msgid "" +"RGB565 thresholds have three channels. Use the ``l_*``, ``a_*``, and " +"``b_*`` methods." +msgstr "RGB565 阈值有三个通道。使用 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:430 +msgid "Please call `histogram.get_threshold()` to create this object." +msgstr "请调用 `histogram.get_threshold()` 来创建此对象。" + +#: ../../library/omv.image.rst:434 +msgid "Return the grayscale threshold value (between 0 and 255)." +msgstr "返回灰度阈值值(介于 0 到 255 之间)。" + +#: ../../library/omv.image.rst:440 +msgid "Return the RGB565 LAB L channel threshold value (between 0 and 100)." +msgstr "返回 RGB565 LAB L 通道阈值值(介于 0 到 100 之间)。" + +#: ../../library/omv.image.rst:446 +msgid "Return the RGB565 LAB A channel threshold value (between -128 and 127)." +msgstr "返回 RGB565 LAB A 通道阈值值(介于 -128 到 127 之间)。" + +#: ../../library/omv.image.rst:452 +msgid "Return the RGB565 LAB B channel threshold value (between -128 and 127)." +msgstr "返回 RGB565 LAB B 通道阈值值(介于 -128 到 127 之间)。" + +#: ../../library/omv.image.rst:457 +msgid "class Statistics -- Statistics Object" +msgstr "类 Statistics -- 统计对象" + +#: ../../library/omv.image.rst:459 +msgid "" +"The percentile object is returned by `histogram.get_statistics()` or " +"`Image.get_statistics()`." +msgstr "百分位对象由 `histogram.get_statistics()` 或 `Image.get_statistics()` 返回。" + +#: ../../library/omv.image.rst:462 +msgid "" +"Grayscale statistics have one channel. Use the non ``l_*``, ``a_*``, and " +"``b_*`` method." +msgstr "灰度统计有一个通道。使用非 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:465 +msgid "" +"RGB565 statistics have three channels. Use the ``l_*``, ``a_*``, and " +"``b_*`` methods." +msgstr "RGB565 统计有三个通道。使用 ``l_*``、``a_*`` 和 ``b_*`` 方法。" + +#: ../../library/omv.image.rst:470 +msgid "" +"Please call `histogram.get_statistics()` or `Image.get_statistics()` to " +"create this object." +msgstr "请调用 `histogram.get_statistics()` 或 `Image.get_statistics()` 来创建此对象。" + +#: ../../library/omv.image.rst:474 +msgid "Returns the grayscale mean (0-255) (int)." +msgstr "返回灰度均值(0-255) (int)。" + +#: ../../library/omv.image.rst:480 +msgid "Returns the grayscale median (0-255) (int)." +msgstr "返回灰度中位数(0-255) (int)。" + +#: ../../library/omv.image.rst:486 +msgid "Returns the grayscale mode (0-255) (int)." +msgstr "返回灰度模式(0-255) (int)。" + +#: ../../library/omv.image.rst:492 +msgid "Returns the grayscale standard deviation (0-255) (int)." +msgstr "返回灰度标准差(0-255) (int)。" + +#: ../../library/omv.image.rst:498 +msgid "Returns the grayscale min (0-255) (int)." +msgstr "返回灰度最小值(0-255) (int)。" + +#: ../../library/omv.image.rst:500 ../../library/omv.image.rst:548 +#: ../../library/omv.image.rst:717 ../../library/omv.image.rst:887 +#: ../../library/omv.image.rst:987 ../../library/omv.image.rst:1036 +#: ../../library/omv.image.rst:1146 ../../library/omv.image.rst:1330 +#: ../../library/omv.image.rst:1409 ../../library/omv.image.rst:1489 +#: ../../library/omv.image.rst:1533 +msgid "You may also get this value doing ``[4]`` on the object." +msgstr "您也可以对该对象执行 ``[4]`` 来获取此值。" + +#: ../../library/omv.image.rst:504 +msgid "Returns the grayscale max (0-255) (int)." +msgstr "返回灰度最大值(0-255) (int)。" + +#: ../../library/omv.image.rst:506 ../../library/omv.image.rst:554 +#: ../../library/omv.image.rst:723 ../../library/omv.image.rst:893 +#: ../../library/omv.image.rst:1042 ../../library/omv.image.rst:1159 +#: ../../library/omv.image.rst:1336 ../../library/omv.image.rst:1415 +#: ../../library/omv.image.rst:1539 +msgid "You may also get this value doing ``[5]`` on the object." +msgstr "您也可以对该对象执行 ``[5]`` 来获取此值。" + +#: ../../library/omv.image.rst:510 +msgid "Returns the grayscale lower quartile (0-255) (int)." +msgstr "返回灰度下四分位数(0-255) (int)。" + +#: ../../library/omv.image.rst:512 ../../library/omv.image.rst:560 +#: ../../library/omv.image.rst:733 ../../library/omv.image.rst:1048 +#: ../../library/omv.image.rst:1169 ../../library/omv.image.rst:1342 +#: ../../library/omv.image.rst:1438 ../../library/omv.image.rst:1545 +msgid "You may also get this value doing ``[6]`` on the object." +msgstr "您也可以对该对象执行 ``[6]`` 来获取此值。" + +#: ../../library/omv.image.rst:516 +msgid "Returns the grayscale upper quartile (0-255) (int)." +msgstr "返回灰度上四分位数(0-255) (int)。" + +#: ../../library/omv.image.rst:518 ../../library/omv.image.rst:566 +#: ../../library/omv.image.rst:745 ../../library/omv.image.rst:899 +#: ../../library/omv.image.rst:1054 ../../library/omv.image.rst:1179 +#: ../../library/omv.image.rst:1348 ../../library/omv.image.rst:1447 +#: ../../library/omv.image.rst:1551 +msgid "You may also get this value doing ``[7]`` on the object." +msgstr "您也可以对该对象执行 ``[7]`` 来获取此值。" + +#: ../../library/omv.image.rst:522 +msgid "Returns the RGB565 LAB L mean (0-255) (int)." +msgstr "返回 RGB565 LAB L 均值(0-255)(int)。" + +#: ../../library/omv.image.rst:528 +msgid "Returns the RGB565 LAB L median (0-255) (int)." +msgstr "返回 RGB565 LAB L 中位数(0-255)(int)。" + +#: ../../library/omv.image.rst:534 +msgid "Returns the RGB565 LAB L mode (0-255) (int)." +msgstr "返回 RGB565 LAB L 模式(0-255)(int)。" + +#: ../../library/omv.image.rst:540 +msgid "Returns the RGB565 LAB L standard deviation (0-255) (int)." +msgstr "返回 RGB565 LAB L 标准差(0-255)(int)。" + +#: ../../library/omv.image.rst:546 +msgid "Returns the RGB565 LAB L min (0-255) (int)." +msgstr "返回 RGB565 LAB L 最小值(0-255)(int)。" + +#: ../../library/omv.image.rst:552 +msgid "Returns the RGB565 LAB L max (0-255) (int)." +msgstr "返回 RGB565 LAB L 最大值(0-255)(int)。" + +#: ../../library/omv.image.rst:558 +msgid "Returns the RGB565 LAB L lower quartile (0-255) (int)." +msgstr "返回 RGB565 LAB L 下四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:564 +msgid "Returns the RGB565 LAB L upper quartile (0-255) (int)." +msgstr "返回 RGB565 LAB L 上四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:570 +msgid "Returns the RGB565 LAB A mean (0-255) (int)." +msgstr "返回 RGB565 LAB A 均值(0-255)(int)。" + +#: ../../library/omv.image.rst:572 ../../library/omv.image.rst:766 +#: ../../library/omv.image.rst:905 ../../library/omv.image.rst:1060 +#: ../../library/omv.image.rst:1185 ../../library/omv.image.rst:1354 +#: ../../library/omv.image.rst:1557 +msgid "You may also get this value doing ``[8]`` on the object." +msgstr "您也可以对该对象执行 ``[8]`` 来获取此值。" + +#: ../../library/omv.image.rst:576 +msgid "Returns the RGB565 LAB A median (0-255) (int)." +msgstr "返回 RGB565 LAB A 中位数(0-255)(int)。" + +#: ../../library/omv.image.rst:578 ../../library/omv.image.rst:773 +#: ../../library/omv.image.rst:1068 ../../library/omv.image.rst:1191 +#: ../../library/omv.image.rst:1360 +msgid "You may also get this value doing ``[9]`` on the object." +msgstr "您也可以对该对象执行 ``[9]`` 来获取此值。" + +#: ../../library/omv.image.rst:582 +msgid "Returns the RGB565 LAB A mode (0-255) (int)." +msgstr "返回 RGB565 LAB A 模式(0-255)(int)。" + +#: ../../library/omv.image.rst:584 ../../library/omv.image.rst:1204 +msgid "You may also get this value doing ``[10]`` on the object." +msgstr "您也可以对该对象执行 ``[10]`` 来获取此值。" + +#: ../../library/omv.image.rst:588 +msgid "Returns the RGB565 LAB A standard deviation (0-255) (int)." +msgstr "返回 RGB565 LAB A 标准差(0-255)(int)。" + +#: ../../library/omv.image.rst:590 ../../library/omv.image.rst:1216 +msgid "You may also get this value doing ``[11]`` on the object." +msgstr "您也可以对该对象执行 ``[11]`` 来获取此值。" + +#: ../../library/omv.image.rst:594 +msgid "Returns the RGB565 LAB A min (0-255) (int)." +msgstr "返回 RGB565 LAB A 最小值(0-255)(int)。" + +#: ../../library/omv.image.rst:596 ../../library/omv.image.rst:1230 +msgid "You may also get this value doing ``[12]`` on the object." +msgstr "您也可以对该对象执行 ``[12]`` 来获取此值。" + +#: ../../library/omv.image.rst:600 +msgid "Returns the RGB565 LAB A max (0-255) (int)." +msgstr "返回 RGB565 LAB A 最大值(0-255)(int)。" + +#: ../../library/omv.image.rst:602 ../../library/omv.image.rst:1244 +msgid "You may also get this value doing ``[13]`` on the object." +msgstr "您也可以对该对象执行 ``[13]`` 来获取此值。" + +#: ../../library/omv.image.rst:606 +msgid "Returns the RGB565 LAB A lower quartile (0-255) (int)." +msgstr "返回 RGB565 LAB A 下四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:608 ../../library/omv.image.rst:1258 +msgid "You may also get this value doing ``[14]`` on the object." +msgstr "您也可以对该对象执行 ``[14]`` 来获取此值。" + +#: ../../library/omv.image.rst:612 +msgid "Returns the RGB565 LAB A upper quartile (0-255) (int)." +msgstr "返回 RGB565 LAB A 上四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:614 ../../library/omv.image.rst:1265 +msgid "You may also get this value doing ``[15]`` on the object." +msgstr "您也可以对该对象执行 ``[15]`` 来获取此值。" + +#: ../../library/omv.image.rst:618 +msgid "Returns the RGB565 LAB B mean (0-255) (int)." +msgstr "返回 RGB565 LAB B 均值(0-255)(int)。" + +#: ../../library/omv.image.rst:620 ../../library/omv.image.rst:1272 +msgid "You may also get this value doing ``[16]`` on the object." +msgstr "您也可以对该对象执行 ``[16]`` 来获取此值。" + +#: ../../library/omv.image.rst:624 +msgid "Returns the RGB565 LAB B median (0-255) (int)." +msgstr "返回 RGB565 LAB B 中位数(0-255)(int)。" + +#: ../../library/omv.image.rst:626 ../../library/omv.image.rst:1281 +msgid "You may also get this value doing ``[17]`` on the object." +msgstr "您也可以对该对象执行 ``[17]`` 来获取此值。" + +#: ../../library/omv.image.rst:630 +msgid "Returns the RGB565 LAB B mode (0-255) (int)." +msgstr "返回 RGB565 LAB B 模式(0-255)(int)。" + +#: ../../library/omv.image.rst:632 +msgid "You may also get this value doing ``[18]`` on the object." +msgstr "您也可以对该对象执行 ``[18]`` 来获取此值。" + +#: ../../library/omv.image.rst:636 +msgid "Returns the RGB565 LAB B standard deviation (0-255) (int)." +msgstr "返回 RGB565 LAB B 标准差(0-255)(int)。" + +#: ../../library/omv.image.rst:638 +msgid "You may also get this value doing ``[19]`` on the object." +msgstr "您也可以对该对象执行 ``[19]`` 来获取此值。" + +#: ../../library/omv.image.rst:642 +msgid "Returns the RGB565 LAB B min (0-255) (int)." +msgstr "返回 RGB565 LAB B 最小值(0-255)(int)。" + +#: ../../library/omv.image.rst:644 +msgid "You may also get this value doing ``[20]`` on the object." +msgstr "您也可以对该对象执行 ``[20]`` 来获取此值。" + +#: ../../library/omv.image.rst:648 +msgid "Returns the RGB565 LAB B max (0-255) (int)." +msgstr "返回 RGB565 LAB B 最大值(0-255)(int)。" + +#: ../../library/omv.image.rst:650 +msgid "You may also get this value doing ``[21]`` on the object." +msgstr "您也可以对该对象执行 ``[21]`` 来获取此值。" + +#: ../../library/omv.image.rst:654 +msgid "Returns the RGB565 LAB B lower quartile (0-255) (int)." +msgstr "返回 RGB565 LAB B 下四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:656 +msgid "You may also get this value doing ``[22]`` on the object." +msgstr "您也可以对该对象执行 ``[22]`` 来获取此值。" + +#: ../../library/omv.image.rst:660 +msgid "Returns the RGB565 LAB B upper quartile (0-255) (int)." +msgstr "返回 RGB565 LAB B 上四分位数(0-255)(int)。" + +#: ../../library/omv.image.rst:662 +msgid "You may also get this value doing ``[23]`` on the object." +msgstr "您也可以对该对象执行 ``[23]`` 来获取此值。" + +#: ../../library/omv.image.rst:665 +msgid "class Blob -- Blob object" +msgstr "类 Blob -- Blob 对象" + +#: ../../library/omv.image.rst:667 +msgid "The blob object is returned by `Image.find_blobs()`." +msgstr "Blob 对象由 `Image.find_blobs()` 返回。" + +#: ../../library/omv.image.rst:671 +msgid "Please call `Image.find_blobs()` to create this object." +msgstr "请调用 `Image.find_blobs()` 来创建此对象。" + +#: ../../library/omv.image.rst:675 ../../library/omv.image.rst:951 +#: ../../library/omv.image.rst:1000 ../../library/omv.image.rst:1103 +#: ../../library/omv.image.rst:1294 ../../library/omv.image.rst:1373 +msgid "" +"Returns a list of 4 (x,y) tuples of the 4 corners of the object. Corners " +"are always returned in sorted clock-wise order starting from the top " +"left." +msgstr "返回对象的 4 个角的 4 个 (x,y) 元组的列表。角始终按顺时针顺序返回,从左上角开始。" + +#: ../../library/omv.image.rst:680 +msgid "" +"Returns a list of 4 (x,y) tuples of the 4 corners than bound the min area" +" rectangle of the blob. Unlike `blob.corners()` the min area rectangle " +"corners do not necessarily lie on the blob." +msgstr "" +"返回对象的最小区域矩形的 4 个角的 4 个 (x,y) 元组的列表。与 `blob.corners()` 不同,最小区域矩形的角不一定在 " +"blob 上。" + +#: ../../library/omv.image.rst:686 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the blob's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 blob" +" 的边界框。" + +#: ../../library/omv.image.rst:691 +msgid "Returns the blob's bounding box x coordinate (int)." +msgstr "返回 blob 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:697 +msgid "Returns the blob's bounding box y coordinate (int)." +msgstr "返回 blob 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:703 +msgid "Returns the blob's bounding box w coordinate (int)." +msgstr "返回 blob 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:709 +msgid "Returns the blob's bounding box h coordinate (int)." +msgstr "返回 blob 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:715 +msgid "Returns the number of pixels that are part of this blob (int)." +msgstr "返回属于此 blob 的像素数(int)。" + +#: ../../library/omv.image.rst:721 +msgid "Returns the centroid x position of the blob (int)." +msgstr "返回 blob 的质心 x 位置(int)。" + +#: ../../library/omv.image.rst:727 +msgid "Returns the centroid x position of the blob (float)." +msgstr "返回 blob 的质心 x 位置(float)。" + +#: ../../library/omv.image.rst:731 +msgid "Returns the centroid y position of the blob (int)." +msgstr "返回 blob 的质心 y 位置(int)。" + +#: ../../library/omv.image.rst:737 +msgid "Returns the centroid y position of the blob (float)." +msgstr "返回 blob 的质心 y 位置(float)。" + +#: ../../library/omv.image.rst:741 +msgid "" +"Returns the rotation of the blob in radians (float). If the blob is like " +"a pencil or pen this value will be unique for 0-180 degrees. If the blob " +"is round this value is not useful." +msgstr "" +"返回 blob 的旋转弧度(float)。如果 blob 像铅笔或笔,这个值将在 0-180 度之间独一无二。如果 blob " +"是圆形,这个值是没有用的。" + +#: ../../library/omv.image.rst:749 +msgid "Returns the rotation of the blob in degrees." +msgstr "返回 blob 的旋转角度(度)。" + +#: ../../library/omv.image.rst:753 +msgid "" +"Returns the rotation of the blob in radians. This method is more " +"descriptive than just `blob.rotation()`." +msgstr "返回 blob 的旋转角度(弧度)。此方法比 `blob.rotation()` 更具描述性。" + +#: ../../library/omv.image.rst:758 +msgid "" +"Returns a 32-bit binary number with a bit set in it for each color " +"threshold that's part of this blob. For example, if you passed " +"`Image.find_blobs()` three color thresholds to look for then bits 0/1/2 " +"may be set for this blob. Note that only one bit will be set for each " +"blob unless `Image.find_blobs()` was called with ``merge=True``. Then its" +" possible for multiple blobs with different color thresholds to be merged" +" together. You can use this method along with multiple thresholds to " +"implement color code tracking." +msgstr "" +"返回一个具有每个颜色阈值的位设置的 32 位二进制数字,该颜色阈值是此 blob 的一部分。例如,如果您传递了 " +"`Image.find_blobs()` 来查找三个颜色阈值,那么可能会为该 blob 设置位 0/1/2。请注意,除非 " +"`Image.find_blobs()` 以 ``merge=True`` 调用,否则每个 blob " +"只会设置一个位。然后,可能会将具有不同颜色阈值的多个 blob 合并在一起。您可以将此方法与多个阈值一起使用,以实现颜色编码跟踪。" + +#: ../../library/omv.image.rst:770 +msgid "" +"Returns the number of blobs merged into this blob. This is 1 unless you " +"called `Image.find_blobs()` with ``merge=True``." +msgstr "返回合并到此 blob 中的 blob 数量。除非您以 ``merge=True`` 调用了 `Image.find_blobs()`,否则为 1。" + +#: ../../library/omv.image.rst:777 +msgid "Returns the number of pixels on this blob's perimeter." +msgstr "返回此 blob 周长上的像素数。" + +#: ../../library/omv.image.rst:781 +msgid "" +"Returns a value between 0 and 1 representing how round the object is. A " +"circle would be a 1." +msgstr "返回介于 0 和 1 之间的值,表示对象的圆度。圆将是 1。" + +#: ../../library/omv.image.rst:785 +msgid "" +"Returns a value between 0 and 1 representing how long (not round) the " +"object is. A line would be a 1." +msgstr "返回介于 0 和 1 之间的值,表示对象的长度(非圆)。线将是 1。" + +#: ../../library/omv.image.rst:789 +msgid "Returns the area of the bounding box around the blob. (w * h)." +msgstr "返回 blob 周围边界框的面积(w * h)。" + +#: ../../library/omv.image.rst:793 +msgid "" +"Returns the density ratio of the blob. This is the number of pixels in " +"the blob over its bounding box area. A low density ratio means in general" +" that the lock on the object isn't very good. The result is between 0 and" +" 1." +msgstr "返回 blob 的密度比率。这是 blob 中的像素数除以其边界框区域。低密度比率通常意味着对象的锁定不太好。结果在 0 到 1 之间。" + +#: ../../library/omv.image.rst:799 +msgid "Alias for `blob.density()`." +msgstr "`blob.density()` 的别名。" + +#: ../../library/omv.image.rst:803 +msgid "" +"Like `blob.density()`, but, uses the perimeter of the blob instead to " +"measure the objects density and is thus more accurate. The result is " +"between 0 and 1." +msgstr "类似于 `blob.density()`,但是使用 blob 的周长来测量对象的密度,因此更准确。结果在 0 到 1 之间。" + +#: ../../library/omv.image.rst:808 +msgid "" +"Like `blob.density()` but, uses the minimum area rotated rectangle versus" +" the bounding rectangle to measure density. The result is between 0 and " +"1." +msgstr "类似于 `blob.density()`,但是使用最小区域旋转矩形与边界矩形来测量密度。结果在 0 到 1 之间。" + +#: ../../library/omv.image.rst:813 +msgid "" +"Returns a value between 0 and 1 representing how convex the object is. A " +"square would be 1." +msgstr "返回介于 0 和 1 之间的值,表示对象的凸度。正方形将是 1。" + +#: ../../library/omv.image.rst:817 +msgid "" +"Returns a histogram of the x axis of all columns in a blob. Bin values " +"are scaled between 0 and 1." +msgstr "返回 blob 所有列的 x 轴直方图。bin 值在 0 到 1 之间缩放。" + +#: ../../library/omv.image.rst:822 +msgid "" +"Returns a histogram of the y axis of all the rows in a blob. Bin values " +"are scaled between 0 and 1." +msgstr "返回 blob 所有行的 y 轴直方图。bin 值在 0 到 1 之间缩放。" + +#: ../../library/omv.image.rst:827 +msgid "" +"Returns a line tuple (x1, y1, x2, y2) that can be drawn with " +"`Image.draw_line()` of the major axis of the blob (the line going through" +" the longest side of the min area rectangle)." +msgstr "返回可以用 `Image.draw_line()` 绘制的主轴线元组 (x1, y1, x2, y2)(通过最小区域矩形的最长边)。" + +#: ../../library/omv.image.rst:832 +msgid "" +"Returns a line tuple (x1, y1, x2, y2) that can be drawn with " +"`Image.draw_line()` of the minor axis of the blob (the line going through" +" the shortest side of the min area rectangle)." +msgstr "返回可以用 `Image.draw_line()` 绘制的次轴线元组 (x1, y1, x2, y2)(通过最小区域矩形的最短边)。" + +#: ../../library/omv.image.rst:837 +msgid "" +"Returns a circle tuple (x, y, r) that can be drawn with " +"`Image.draw_circle()` of the circle that encloses the min area rectangle " +"of a blob." +msgstr "返回可以用 `Image.draw_circle()` 绘制的圆元组 (x, y, r)(包围 blob 的最小区域矩形的圆)。" + +#: ../../library/omv.image.rst:842 +msgid "" +"Returns an ellipse tuple (x, y, rx, ry, rotation) that can be drawn with " +"`Image.draw_ellipse()` of the ellipse that fits inside of the min area " +"rectangle of a blob." +msgstr "" +"返回可以用 `Image.draw_ellipse()` 绘制的椭圆元组 (x, y, rx, ry, rotation)(适合于 blob " +"的最小区域矩形内部的椭圆)。" + +#: ../../library/omv.image.rst:846 +msgid "class Line -- Line object" +msgstr "类 Line -- Line 对象" + +#: ../../library/omv.image.rst:848 +msgid "" +"The line object is returned by `Image.find_lines()`, " +"`Image.find_line_segments()`, or `Image.get_regression()`." +msgstr "" +"Line 对象由 `Image.find_lines()`、`Image.find_line_segments()` 或 " +"`Image.get_regression()` 返回。" + +#: ../../library/omv.image.rst:852 +msgid "" +"Please call `Image.find_lines()`, `Image.find_line_segments()`, or " +"`Image.get_regression()` to create this object." +msgstr "" +"请调用 `Image.find_lines()`、`Image.find_line_segments()` 或 " +"`Image.get_regression()` 来创建此对象。" + +#: ../../library/omv.image.rst:856 +msgid "" +"Returns a line tuple (x1, y1, x2, y2) for use with other `image` methods " +"like `Image.draw_line()`." +msgstr "返回一个线元组 (x1, y1, x2, y2),可用于其他 `image` 方法,如 `Image.draw_line()`。" + +#: ../../library/omv.image.rst:861 +msgid "Returns the line's p1 x component." +msgstr "返回线的 p1 x 分量。" + +#: ../../library/omv.image.rst:867 +msgid "Returns the line's p1 y component." +msgstr "返回线的 p1 y 分量。" + +#: ../../library/omv.image.rst:873 +msgid "Returns the line's p2 x component." +msgstr "返回线的 p2 x 分量。" + +#: ../../library/omv.image.rst:879 +msgid "Returns the line's p2 y component." +msgstr "返回线的 p2 y 分量。" + +#: ../../library/omv.image.rst:885 +msgid "Returns the line's length: sqrt(((x2-x1)^2) + ((y2-y1)^2)." +msgstr "返回线的长度:sqrt(((x2-x1)^2) + ((y2-y1)^2)。" + +#: ../../library/omv.image.rst:891 +msgid "Returns the magnitude of the line from the hough transform." +msgstr "通过霍夫变换返回直线的幅度。" + +#: ../../library/omv.image.rst:897 +msgid "" +"Returns the angle of the line from the hough transform - (0 - 179) " +"degrees." +msgstr "通过霍夫变换返回线的角度 - (0 - 179) 度。" + +#: ../../library/omv.image.rst:903 +msgid "Returns the the rho value for the line from the hough transform." +msgstr "返回线的霍夫变换中的 rho 值。" + +#: ../../library/omv.image.rst:908 +msgid "class Circle -- Circle object" +msgstr "class Circle -- Circle 对象" + +#: ../../library/omv.image.rst:910 +msgid "The circle object is returned by `Image.find_circles()`." +msgstr "Circle 对象由 `Image.find_circles()` 返回。" + +#: ../../library/omv.image.rst:914 +msgid "Please call `Image.find_circles()` to create this object." +msgstr "请调用 `Image.find_circles()` 来创建此对象。" + +#: ../../library/omv.image.rst:918 +msgid "Returns the circle's x position." +msgstr "返回圆的 x 位置。" + +#: ../../library/omv.image.rst:924 +msgid "Returns the circle's y position." +msgstr "返回圆的 y 位置。" + +#: ../../library/omv.image.rst:930 +msgid "Returns the circle's radius." +msgstr "返回圆的半径。" + +#: ../../library/omv.image.rst:936 +msgid "Returns the circle's magnitude." +msgstr "返回圆的幅度。" + +#: ../../library/omv.image.rst:941 +msgid "class Rect -- Rectangle Object" +msgstr "类 Rect -- 矩形对象" + +#: ../../library/omv.image.rst:943 +msgid "The rect object is returned by `Image.find_rects()`." +msgstr "Rect 对象由 `Image.find_rects()` 返回。" + +#: ../../library/omv.image.rst:947 +msgid "Please call `Image.find_rects()` to create this object." +msgstr "请调用 `Image.find_rects()` 来创建此对象。" + +#: ../../library/omv.image.rst:956 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the rect's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 rect" +" 的边界框。" + +#: ../../library/omv.image.rst:961 +msgid "Returns the rectangle's top left corner's x position." +msgstr "返回矩形的左上角的 x 位置。" + +#: ../../library/omv.image.rst:967 +msgid "Returns the rectangle's top left corner's y position." +msgstr "返回矩形的左上角的 y 位置。" + +#: ../../library/omv.image.rst:973 +msgid "Returns the rectangle's width." +msgstr "返回矩形的宽度。" + +#: ../../library/omv.image.rst:979 +msgid "Returns the rectangle's height." +msgstr "返回矩形的高度。" + +#: ../../library/omv.image.rst:985 +msgid "Returns the rectangle's magnitude." +msgstr "返回矩形的幅度。" + +#: ../../library/omv.image.rst:990 +msgid "class QRCode -- QRCode object" +msgstr "类 QRCode -- QRCode 对象" + +#: ../../library/omv.image.rst:992 +msgid "The qrcode object is returned by `Image.find_qrcodes()`." +msgstr "QRCode 对象由 `Image.find_qrcodes()` 返回。" + +#: ../../library/omv.image.rst:996 +msgid "Please call `Image.find_qrcodes()` to create this object." +msgstr "请调用 `Image.find_qrcodes()` 来创建此对象。" + +#: ../../library/omv.image.rst:1005 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the qrcode's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 " +"qrcode 的边界框。" + +#: ../../library/omv.image.rst:1010 +msgid "Returns the qrcode's bounding box x coordinate (int)." +msgstr "返回 qrcode 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:1016 +msgid "Returns the qrcode's bounding box y coordinate (int)." +msgstr "返回 qrcode 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:1022 +msgid "Returns the qrcode's bounding box w coordinate (int)." +msgstr "返回 qrcode 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:1028 +msgid "Returns the qrcode's bounding box h coordinate (int)." +msgstr "返回 qrcode 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:1034 +msgid "Returns the payload string of the qrcode. E.g. the URL." +msgstr "返回 qrcode 的有效载荷字符串。例如,URL。" + +#: ../../library/omv.image.rst:1040 +msgid "Returns the version number of the qrcode (int)." +msgstr "返回 qrcode 的版本(int)。" + +#: ../../library/omv.image.rst:1046 +msgid "Returns the ecc_level of the qrcode (int)." +msgstr "返回 qrcode 的错误级别( int)。" + +#: ../../library/omv.image.rst:1052 +msgid "Returns the mask of the qrcode (int)." +msgstr "返回到此 qrcode 的掩码(int)。" + +#: ../../library/omv.image.rst:1058 +msgid "Returns the data type of the qrcode (int)." +msgstr "返回到此 qrcode 的 数据类型(int)。" + +#: ../../library/omv.image.rst:1064 +msgid "" +"Returns the eci of the qrcode (int). The eci stores the encoding of data " +"bytes in the QR Code. If you plan to handling QR Codes that contain more " +"than just standard ASCII text you will need to look at this value." +msgstr "" +"返回 QR 码的 eci(int)。eci 存储了 QR 码中数据字节的编码方式。如果您计划处理包含非标准 ASCII 文本的 QR " +"码,您需要查看此值。" + +#: ../../library/omv.image.rst:1072 +msgid "Returns True if the data_type of the qrcode is numeric." +msgstr "如果 QR 码的数据类型为数字,则返回 True。" + +#: ../../library/omv.image.rst:1076 +msgid "Returns True if the data_type of the qrcode is alpha numeric." +msgstr "如果 QR 码的数据类型为字母数字,则返回 True。" + +#: ../../library/omv.image.rst:1080 +msgid "" +"Returns True if the data_type of the qrcode is binary. If you are serious" +" about handling all types of text you need to check the eci if this is " +"True to determine the text encoding of the data. Usually, it's just " +"standard ASCII, but, it could be UTF8 that has some 2-byte characters in " +"it." +msgstr "" +"如果 QR 码的数据类型为二进制,则返回 True。如果您严肃对待处理所有类型的文本,需要检查 eci 是否为 " +"True,以确定数据的文本编码。通常情况下,它只是标准的 ASCII,但它也可能是 UTF8,其中包含一些 2 字节的字符。" + +#: ../../library/omv.image.rst:1087 +msgid "" +"Returns True if the data_type of the qrcode is alpha Kanji. If this is " +"True then you'll need to decode the string yourself as Kanji symbols are " +"10-bits per character and MicroPython has no support to parse this kind " +"of text. The payload in this case must be treated as just a large byte " +"array." +msgstr "" +"如果 QR 码的数据类型为日文(Kanji),则返回 True。如果是 True,则您需要自行解码字符串,因为日文符号每个字符有 10 位,而 " +"MicroPython 没有支持解析这种类型文本的功能。在这种情况下,负载必须被视为一个大字节数组。" + +#: ../../library/omv.image.rst:1093 +msgid "class AprilTag -- AprilTag object" +msgstr "类 AprilTag -- AprilTag 对象" + +#: ../../library/omv.image.rst:1095 +msgid "The apriltag object is returned by `Image.find_apriltags()`." +msgstr "AprilTag 对象是由 `Image.find_apriltags()` 返回的。" + +#: ../../library/omv.image.rst:1099 +msgid "Please call `Image.find_apriltags()` to create this object." +msgstr "请调用 `Image.find_apriltags()` 来创建此对象。" + +#: ../../library/omv.image.rst:1108 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the apriltag's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 " +"apriltag 的边界框。" + +#: ../../library/omv.image.rst:1113 +msgid "Returns the apriltag's bounding box x coordinate (int)." +msgstr "返回 apriltag 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:1119 +msgid "Returns the apriltag's bounding box y coordinate (int)." +msgstr "返回 apriltag 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:1125 +msgid "Returns the apriltag's bounding box w coordinate (int)." +msgstr "返回 apriltag 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:1131 +msgid "Returns the apriltag's bounding box h coordinate (int)." +msgstr "返回 apriltag 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:1137 +msgid "Returns the numeric id of the apriltag." +msgstr "返回 apriltag 的数字 id。" + +#: ../../library/omv.image.rst:1139 +msgid "TAG16H5 -> 0 to 29" +msgstr "TAG16H5 -> 0 到 29" + +#: ../../library/omv.image.rst:1140 +msgid "TAG25H7 -> 0 to 241" +msgstr "TAG25H7 -> 0 到 241" + +#: ../../library/omv.image.rst:1141 +msgid "TAG25H9 -> 0 to 34" +msgstr "TAG25H9 -> 0 到 34" + +#: ../../library/omv.image.rst:1142 +msgid "TAG36H10 -> 0 to 2319" +msgstr "TAG36H10 -> 0 到 2319" + +#: ../../library/omv.image.rst:1143 +msgid "TAG36H11 -> 0 to 586" +msgstr "TAG36H11 -> 0 到 586" + +#: ../../library/omv.image.rst:1144 +msgid "ARTOOLKIT -> 0 to 511" +msgstr "ARTOOLKIT -> 0 到 511" + +#: ../../library/omv.image.rst:1150 +msgid "Returns the numeric family of the apriltag." +msgstr "返回 apriltag 的数字家族。" + +#: ../../library/omv.image.rst:1152 +msgid "image.TAG16H5" +msgstr "image.TAG16H5" + +#: ../../library/omv.image.rst:1153 +msgid "image.TAG25H7" +msgstr "image.TAG25H7" + +#: ../../library/omv.image.rst:1154 +msgid "image.TAG25H9" +msgstr "image.TAG25H9" + +#: ../../library/omv.image.rst:1155 +msgid "image.TAG36H10" +msgstr "image.TAG36H10" + +#: ../../library/omv.image.rst:1156 +msgid "image.TAG36H11" +msgstr "image.TAG36H11" + +#: ../../library/omv.image.rst:1157 +msgid "image.ARTOOLKIT" +msgstr "image.ARTOOLKIT" + +#: ../../library/omv.image.rst:1163 +msgid "Returns the centroid x position of the apriltag (int)." +msgstr "返回 apriltag 的质心 x 位置(int)。" + +#: ../../library/omv.image.rst:1167 +msgid "Returns the centroid x position of the apriltag (float)." +msgstr "返回 apriltag 的质心 x 位置(float)。" + +#: ../../library/omv.image.rst:1173 +msgid "Returns the centroid y position of the apriltag (int)." +msgstr "返回 apriltag 的质心 y 位置(int)。" + +#: ../../library/omv.image.rst:1177 +msgid "Returns the centroid y position of the apriltag (float)." +msgstr "返回 apriltag 的质心 y 位置(float)。" + +#: ../../library/omv.image.rst:1183 +msgid "Returns the rotation of the apriltag in radians (float)." +msgstr "以弧度为单位返回 apriltag 的旋转角度(float)。" + +#: ../../library/omv.image.rst:1189 +msgid "" +"Returns the quality of the apriltag match (0.0 - 1.0) where 1.0 is the " +"best." +msgstr "返回 apriltag 匹配的质量(0.0 - 1.0),其中 1.0 是最佳的。" + +#: ../../library/omv.image.rst:1195 +msgid "Returns the number of accepted bit errors for this tag." +msgstr "返回此标签可接受的位错误数。" + +#: ../../library/omv.image.rst:1197 +msgid "TAG16H5 -> 0 bit errors will be accepted" +msgstr "TAG16H5 -> 0 位错误将被接受" + +#: ../../library/omv.image.rst:1198 +msgid "TAG25H7 -> up to 1 bit error may be accepted" +msgstr "TAG25H7 -> 最多可接受 1 位错误" + +#: ../../library/omv.image.rst:1199 +msgid "TAG25H9 -> up to 3 bit errors may be accepted" +msgstr "TAG25H9 -> 最多可接受 3 位错误" + +#: ../../library/omv.image.rst:1200 +msgid "TAG36H10 -> up to 3 bit errors may be accepted" +msgstr "TAG36H10 -> 最多可接受 3 位错误" + +#: ../../library/omv.image.rst:1201 +msgid "TAG36H11 -> up to 4 bit errors may be accepted" +msgstr "TAG36H11 -> 最多可接受 4 位错误" + +#: ../../library/omv.image.rst:1202 +msgid "ARTOOLKIT -> 0 bit errors will be accepted" +msgstr "ARTOOLKIT -> 0 位错误将被接受" + +#: ../../library/omv.image.rst:1208 +msgid "" +"Returns the quality of the apriltag image (0.0 - 1.0) where 1.0 is the " +"best." +msgstr "返回 apriltag 图像的质量(0.0 - 1.0),其中 1.0 是最佳的。" + +#: ../../library/omv.image.rst:1212 +msgid "" +"This value is always 0.0 for now. We may enable a feature called \"tag " +"refinement\" in the future which will allow detection of small apriltags." +" However, this feature currently drops the frame rate to less than 1 FPS." +msgstr "" +"目前此值始终为 0.0。我们可能会在未来启用称为 \"标签细化\" 的功能,以便检测小型 apriltags。但是,该功能目前会将帧速率降至低于 " +"1 FPS。" + +#: ../../library/omv.image.rst:1220 +msgid "" +"Returns the translation in unknown units from the camera in the X " +"direction." +msgstr "返回从相机到 apriltag 的 X 方向的未知单位的平移。" + +#: ../../library/omv.image.rst:1222 +msgid "" +"This method is useful for determining the apriltag's location away from " +"the camera. However, the size of the apriltag, the lens you are using, " +"etc. all come into play as to actually determining what the X units are " +"in. For ease of use we recommend you use a lookup table to convert the " +"output of this method to something useful for your application." +msgstr "" +"此方法对于确定 apriltag 相对于相机的位置很有用。但是,apriltag 的大小、所使用的镜头等等都会影响实际确定 X " +"单位是什么。为了方便起见,我们建议您使用查找表将此方法的输出转换为对您的应用程序有用的内容。" + +#: ../../library/omv.image.rst:1228 +msgid "Note that this is the left-to-right direction." +msgstr "请注意,这是从左到右的方向。" + +#: ../../library/omv.image.rst:1234 +msgid "" +"Returns the translation in unknown units from the camera in the Y " +"direction." +msgstr "返回从相机到 apriltag 的 Y 方向的未知单位的平移。" + +#: ../../library/omv.image.rst:1236 +msgid "" +"This method is useful for determining the apriltag's location away from " +"the camera. However, the size of the apriltag, the lens you are using, " +"etc. all come into play as to actually determining what the Y units are " +"in. For ease of use we recommend you use a lookup table to convert the " +"output of this method to something useful for your application." +msgstr "" +"此方法对于确定 apriltag 相对于相机的位置很有用。但是,apriltag 的大小、所使用的镜头等等都会影响实际确定 Y " +"单位是什么。为了方便起见,我们建议您使用查找表将此方法的输出转换为对您的应用程序有用的内容。" + +#: ../../library/omv.image.rst:1242 +msgid "Note that this is the up-to-down direction." +msgstr "请注意,这是从上到下的方向。" + +#: ../../library/omv.image.rst:1248 +msgid "" +"Returns the translation in unknown units from the camera in the Z " +"direction." +msgstr "以未知单位返回摄像机在 Z 方向的平移量。" + +#: ../../library/omv.image.rst:1250 +msgid "" +"This method is useful for determining the apriltag's location away from " +"the camera. However, the size of the apriltag, the lens you are using, " +"etc. all come into play as to actually determining what the Z units are " +"in. For ease of use we recommend you use a lookup table to convert the " +"output of this method to something useful for your application." +msgstr "" +"此方法对于确定 apriltag 相对于相机的位置很有用。但是,apriltag 的大小、所使用的镜头等等都会影响实际确定 Z " +"单位是什么。为了方便起见,我们建议您使用查找表将此方法的输出转换为对您的应用程序有用的内容。" + +#: ../../library/omv.image.rst:1256 +msgid "Note that this is the front-to-back direction." +msgstr "请注意,这是从前到后的方向。" + +#: ../../library/omv.image.rst:1262 +msgid "" +"Returns the rotation in radians of the apriltag in the X plane. E.g. " +"moving the camera left-to-right while looking at the tag." +msgstr "返回 apriltag 在 X 平面上以弧度为单位的旋转角度。例如,在查看标签时将相机从左向右移动。" + +#: ../../library/omv.image.rst:1269 +msgid "" +"Returns the rotation in radians of the apriltag in the Y plane. E.g. " +"moving the camera up-to-down while looking at the tag." +msgstr "返回 apriltag 在 Y 平面上以弧度为单位的旋转角度。例如,在查看标签时将相机从上向下移动。" + +#: ../../library/omv.image.rst:1276 +msgid "" +"Returns the rotation in radians of the apriltag in the Z plane. E.g. " +"rotating the camera while looking directly at the tag." +msgstr "返回 apriltag 在 Z 平面上以弧度为单位的旋转角度。例如,直接旋转相机并直视标签。" + +#: ../../library/omv.image.rst:1279 +msgid "Note that this is just a renamed version of `apriltag.rotation()`." +msgstr "请注意,这只是 `apriltag.rotation()` 的重命名版本。" + +#: ../../library/omv.image.rst:1284 +msgid "class DataMatrix -- DataMatrix object" +msgstr "类 DataMatrix -- DataMatrix 对象" + +#: ../../library/omv.image.rst:1286 +msgid "The datamatrix object is returned by `Image.find_datamatrices()`." +msgstr "DataMatrix 对象是由 `Image.find_datamatrices()` 返回的。" + +#: ../../library/omv.image.rst:1290 +msgid "Please call `Image.find_datamatrices()` to create this object." +msgstr "请调用 `Image.find_datamatrices()` 来创建此对象。" + +#: ../../library/omv.image.rst:1299 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the datamatrix's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 " +"datamatrix 的边界框。" + +#: ../../library/omv.image.rst:1304 +msgid "Returns the datamatrix's bounding box x coordinate (int)." +msgstr "返回 datamatrix 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:1310 +msgid "Returns the datamatrix's bounding box y coordinate (int)." +msgstr "返回 datamatrix 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:1316 +msgid "Returns the datamatrix's bounding box w coordinate (int)." +msgstr "返回 datamatrix 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:1322 +msgid "Returns the datamatrix's bounding box h coordinate (int)." +msgstr "返回 datamatrix 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:1328 +msgid "Returns the payload string of the datamatrix. E.g. The string." +msgstr "返回 datamatrix 的有效负载字符串。例如,字符串。" + +#: ../../library/omv.image.rst:1334 +msgid "Returns the rotation of the datamatrix in radians (float)." +msgstr "返回 datamatrix 的弧度旋转角度(float)。" + +#: ../../library/omv.image.rst:1340 +msgid "Returns the number of rows in the data matrix (int)." +msgstr "返回数据矩阵中的行数(int)。" + +#: ../../library/omv.image.rst:1346 +msgid "Returns the number of columns in the data matrix (int)." +msgstr "返回数据矩阵中的列数(int)。" + +#: ../../library/omv.image.rst:1352 +msgid "Returns how many characters could fit in this data matrix." +msgstr "返回此数据矩阵中可容纳的字符数。" + +#: ../../library/omv.image.rst:1358 +msgid "Returns how many unused characters are in this data matrix." +msgstr "返回此数据矩阵中未使用的字符数。" + +#: ../../library/omv.image.rst:1363 +msgid "class BarCode -- BarCode object" +msgstr "类 BarCode -- BarCode 对象" + +#: ../../library/omv.image.rst:1365 +msgid "The barcode object is returned by `Image.find_barcodes()`." +msgstr "BarCode 对象是由 `Image.find_barcodes()` 返回的。" + +#: ../../library/omv.image.rst:1369 +msgid "Please call `Image.find_barcodes()` to create this object." +msgstr "请调用 `Image.find_barcodes()` 来创建此对象。" + +#: ../../library/omv.image.rst:1378 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the barcode's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 " +"barcode 的边界框。" + +#: ../../library/omv.image.rst:1383 +msgid "Returns the barcode's bounding box x coordinate (int)." +msgstr "返回 barcode 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:1389 +msgid "Returns the barcode's bounding box y coordinate (int)." +msgstr "返回 barcode 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:1395 +msgid "Returns the barcode's bounding box w coordinate (int)." +msgstr "返回 barcode 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:1401 +msgid "Returns the barcode's bounding box h coordinate (int)." +msgstr "返回 barcode 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:1407 +msgid "Returns the payload string of the barcode. E.g. The number." +msgstr "返回 barcode 的有效负载字符串。例如,数字。" + +#: ../../library/omv.image.rst:1413 +msgid "Returns the type enumeration of the barcode (int)." +msgstr "返回 barcode 的类型枚举(int)。" + +#: ../../library/omv.image.rst:1417 +msgid "image.EAN2" +msgstr "image.EAN2" + +#: ../../library/omv.image.rst:1418 +msgid "image.EAN5" +msgstr "image.EAN5" + +#: ../../library/omv.image.rst:1419 +msgid "image.EAN8" +msgstr "image.EAN8" + +#: ../../library/omv.image.rst:1420 +msgid "image.UPCE" +msgstr "image.UPCE" + +#: ../../library/omv.image.rst:1421 +msgid "image.ISBN10" +msgstr "image.ISBN10" + +#: ../../library/omv.image.rst:1422 +msgid "image.UPCA" +msgstr "image.UPCA" + +#: ../../library/omv.image.rst:1423 +msgid "image.EAN13" +msgstr "image.EAN13" + +#: ../../library/omv.image.rst:1424 +msgid "image.ISBN13" +msgstr "image.ISBN13" + +#: ../../library/omv.image.rst:1425 +msgid "image.I25" +msgstr "image.I25" + +#: ../../library/omv.image.rst:1426 +msgid "image.DATABAR" +msgstr "image.DATABAR" + +#: ../../library/omv.image.rst:1427 +msgid "image.DATABAR_EXP" +msgstr "image.DATABAR_EXP" + +#: ../../library/omv.image.rst:1428 +msgid "image.CODABAR" +msgstr "image.CODABAR" + +#: ../../library/omv.image.rst:1429 +msgid "image.CODE39" +msgstr "image.CODE39" + +#: ../../library/omv.image.rst:1430 +msgid "image.PDF417 - Future (e.g. doesn't work right now)." +msgstr "image.PDF417 - 未来(例如,当前不起作用)。" + +#: ../../library/omv.image.rst:1431 +msgid "image.CODE93" +msgstr "image.CODE93" + +#: ../../library/omv.image.rst:1432 +msgid "image.CODE128" +msgstr "image.CODE128" + +#: ../../library/omv.image.rst:1436 +msgid "Returns the rotation of the barcode in radians (float)." +msgstr "返回 barcode 的弧度旋转角度(float)。" + +#: ../../library/omv.image.rst:1442 +msgid "Returns the number of times this barcode was detected in the image (int)." +msgstr "返回此 barcode 在图像中被检测到的次数(int)。" + +#: ../../library/omv.image.rst:1444 +msgid "" +"When scanning a barcode each new scanline can decode the same barcode. " +"This value increments for a barcode each time that happens..." +msgstr "扫描条形码时,每次新的扫描线都可以解码相同的条形码。对于一个条形码来说,每次这样的情况发生,此值都会递增..." + +#: ../../library/omv.image.rst:1450 +msgid "class Displacement -- Displacement object" +msgstr "类 Displacement -- Displacement 对象" + +#: ../../library/omv.image.rst:1452 +msgid "The displacement object is returned by `Image.find_displacement()`." +msgstr "Displacement 对象是由 `Image.find_displacement()` 返回的。" + +#: ../../library/omv.image.rst:1456 +msgid "Please call `Image.find_displacement()` to create this object." +msgstr "请调用 `Image.find_displacement()` 来创建此对象。" + +#: ../../library/omv.image.rst:1460 +msgid "" +"Returns the x translation in pixels between two images. This is sub pixel" +" accurate so it's a float." +msgstr "返回两个图像之间的 x 轴方向的像素平移。这是次像素精度的,因此它是一个浮点数。" + +#: ../../library/omv.image.rst:1467 +msgid "" +"Returns the y translation in pixels between two images. This is sub pixel" +" accurate so it's a float." +msgstr "返回两个图像之间的 y 轴方向的像素平移。这是次像素精度的,因此它是一个浮点数。" + +#: ../../library/omv.image.rst:1474 +msgid "Returns the rotation in radians between two images." +msgstr "返回两个图像之间的弧度旋转角度。" + +#: ../../library/omv.image.rst:1480 +msgid "Returns the scale change between two images." +msgstr "返回两个图像之间的缩放变化。" + +#: ../../library/omv.image.rst:1486 +msgid "" +"Returns the quality of the results of displacement matching between two " +"images. Between 0-1. A ``displacement`` object with a response less than " +"0.1 is likely noise." +msgstr "返回两个图像之间的位移匹配结果的质量。在 0-1 之间。响应值小于 0.1 的 ``displacement`` 对象可能是噪声。" + +#: ../../library/omv.image.rst:1492 +msgid "class kptmatch -- Keypoint Object" +msgstr "类 kptmatch -- 关键点对象" + +#: ../../library/omv.image.rst:1494 +msgid "" +"The kptmatch object is returned by `image.match_descriptor()` for " +"keypoint matches." +msgstr "关键点对象是由 `image.match_descriptor()` 返回的用于关键点匹配的对象。" + +#: ../../library/omv.image.rst:1498 +msgid "Please call `image.match_descriptor()` to create this object." +msgstr "请调用 `image.match_descriptor()` 来创建此对象。" + +#: ../../library/omv.image.rst:1502 +msgid "" +"Returns a rectangle tuple (x, y, w, h) for use with other `image` methods" +" like `Image.draw_rectangle()` of the kptmatch's bounding box." +msgstr "" +"返回一个矩形元组 (x, y, w, h),可用于其他 `image` 方法,如 `Image.draw_rectangle()`,表示 " +"kptmatch 的边界框。" + +#: ../../library/omv.image.rst:1507 +msgid "Returns the centroid x position of the kptmatch (int)." +msgstr "返回 kptmatch 的质心 x 位置(int)。" + +#: ../../library/omv.image.rst:1513 +msgid "Returns the centroid y position of the kptmatch (int)." +msgstr "返回 kptmatch 的质心 y 位置(int)。" + +#: ../../library/omv.image.rst:1519 +msgid "Returns the kptmatch's bounding box x coordinate (int)." +msgstr "返回 kptmatch 的边界框 x 坐标(int)。" + +#: ../../library/omv.image.rst:1525 +msgid "Returns the kptmatch's bounding box y coordinate (int)." +msgstr "返回 kptmatch 的边界框 y 坐标(int)。" + +#: ../../library/omv.image.rst:1531 +msgid "Returns the kptmatch's bounding box w coordinate (int)." +msgstr "返回 kptmatch 的边界框 w 坐标(int)。" + +#: ../../library/omv.image.rst:1537 +msgid "Returns the kptmatch's bounding box h coordinate (int)." +msgstr "返回 kptmatch 的边界框 h 坐标(int)。" + +#: ../../library/omv.image.rst:1543 +msgid "Returns the number of keypoints matched (int)." +msgstr "返回匹配的关键点数(int)。" + +#: ../../library/omv.image.rst:1549 +msgid "Returns the estimated angle of rotation for the keypoint (int)." +msgstr "返回关键点的估计旋转角度(int)。" + +#: ../../library/omv.image.rst:1555 +msgid "Returns the list of (x,y) tuples of matching keypoints." +msgstr "返回匹配关键点的 (x,y) 元组列表。" + +#: ../../library/omv.image.rst:1560 +msgid "class ImageIO -- ImageIO Object" +msgstr "类 ImageIO -- ImageIO 对象" + +#: ../../library/omv.image.rst:1562 +msgid "" +"The ImageIO object allows you to read/write OpenMV Image objects in their" +" native form to disk or to memory. This class provides fast read/write " +"random access for loading/storing images." +msgstr "ImageIO 对象允许您以原生形式读取/写入 OpenMV Image 对象到磁盘或内存中。此类提供了加载/存储图像的快速读/写随机访问。" + +#: ../../library/omv.image.rst:1567 +msgid "Creates an ImageIO object." +msgstr "创建一个 ImageIO 对象。" + +#: ../../library/omv.image.rst:1569 +msgid "" +"If ``path`` is a file name on disk then that file will be opened for " +"reading if ``mode`` is ``'r'`` or writing if ``mode`` is ``'w'``." +msgstr "" +"如果 ``path`` 是磁盘上的文件名,则该文件将在 ``mode`` 为 ``'r'`` 时打开以进行读取,如果 ``mode`` 为 " +"``'w'`` 时打开以进行写入。" + +#: ../../library/omv.image.rst:1572 +msgid "" +"``path`` may also be a 3-value tuple (w, h, bpp) for in-memory storage of" +" images. ``mode`` in this case is then the number of image buffers to " +"store in memory. Note that the in-memory storage buffer is not allowed to" +" grow in size after being allocated. Use a ``bpp`` value of 0 for binary " +"images, 1 for grayscale images, and 2 for rgb565 images." +msgstr "" +"``path`` 也可以是一个 3 值元组 (w, h, bpp) 用于图像的内存存储。在这种情况下,``mode`` " +"是内存中存储图像的数量。请注意,在分配了内存后,不允许内存存储缓冲区增长。对于二进制图像,使用 0 作为 ``bpp`` 值,对于灰度图像使用 " +"1,对于 rgb565 图像使用 2。" + +#: ../../library/omv.image.rst:1579 +msgid "Returns if the `ImageIO` object is a `FILE_STREAM` or `MEMORY_STREAM`." +msgstr "如果 `ImageIO` 对象是 `FILE_STREAM` 或 `MEMORY_STREAM` 则返回。" + +#: ../../library/omv.image.rst:1583 +msgid "Returns if the `ImageIO` object is closed and can no longer be used." +msgstr "如果 `ImageIO` 对象已关闭且不再可用则返回。" + +#: ../../library/omv.image.rst:1587 +msgid "Returns the number of frames stored." +msgstr "返回存储的帧数。" + +#: ../../library/omv.image.rst:1591 +msgid "Returns the image index offset." +msgstr "返回图像索引偏移量。" + +#: ../../library/omv.image.rst:1595 +msgid "" +"Returns the version of the object if it's `FILE_STREAM`. `MEMORY_STREAM` " +"versions are ``none``." +msgstr "返回对象的版本,如果是 `FILE_STREAM`。`MEMORY_STREAM` 版本是 ``none``。" + +#: ../../library/omv.image.rst:1600 +msgid "Returns the size allocated by the object for a frame in a single buffer." +msgstr "返回单个缓冲区中帧所分配的对象的大小。" + +#: ../../library/omv.image.rst:1602 +msgid "``buffer_size() * count() == size()``" +msgstr "``buffer_size() * count() == size()``" + +#: ../../library/omv.image.rst:1606 +msgid "Returns the number of bytes on disk or memory used by the ImageIO object." +msgstr "返回 ImageIO 对象使用的磁盘或内存中的字节数。" + +#: ../../library/omv.image.rst:1610 +msgid "" +"Writes a new image ``img`` to the ImageIO object. For on disk ImageIO " +"objects the file will grow as new images are added. For in-memory ImageIO" +" objects this just writes an image to the current pre-allocated slot " +"before advancing to the next slot." +msgstr "" +"将新图像 ``img`` 写入 ImageIO 对象。对于磁盘上的 ImageIO 对象,随着添加新图像,文件将增长。对于内存中的 ImageIO" +" 对象,这只是将图像写入当前预分配的插槽,然后转到下一个插槽。" + +#: ../../library/omv.image.rst:1614 +msgid "Returns the ImageIO object." +msgstr "返回 ImageIO 对象。" + +#: ../../library/omv.image.rst:1618 +msgid "" +"Returns an image object from the ImageIO object. If ``copy_to_fb`` is " +"False then the new image is allocated on the MicroPython heap. However, " +"the MicroPython heap is limited and may not have space to store the new " +"image if exhausted. Instead, set ``copy_to_fb`` to True to set the frame " +"buffer to the new image making this function work just like " +"`sensor.snapshot()`." +msgstr "" +"从 ImageIO 对象返回图像对象。如果 ``copy_to_fb`` 为 False,则新图像将分配在MicroPython " +"堆上。但是,MicroPython 堆有限,如果耗尽,可能没有空间来存储新图像。相反,将 ``copy_to_fb`` 设置为 True " +"可将帧缓冲区设置为新图像,使该函数的工作方式与 `sensor.snapshot()` 类似。" + +#: ../../library/omv.image.rst:1623 +msgid "" +"``loop`` if True automatically causes the ImageIO object to seek to the " +"beginning at the end of the stream of images." +msgstr "如果 ``loop`` 为 True,则会自动导致ImageIO 对象从图像流的末尾查找开头。" + +#: ../../library/omv.image.rst:1626 +msgid "" +"``pause`` if True causes this method to pause for a previously recorded " +"number of milliseconds by write in-order to match the original frame rate" +" that captured the image data." +msgstr "如果 ``pause`` 为True,则该方法在写入时暂停先前记录的毫秒数,以匹配捕获图像数据的原始帧速率。" + +#: ../../library/omv.image.rst:1631 +msgid "Seeks to the image slot number ``offset`` in the ImageIO object." +msgstr "查找ImageIO对象中的图像槽编号为 ``offset`` 的位置。" + +#: ../../library/omv.image.rst:1633 +msgid "Works for on disk or in-memory objects." +msgstr "对于磁盘上或内存中的对象都适用。" + +#: ../../library/omv.image.rst:1637 +msgid "Writes out all data pending for on-disk ImageIO objects." +msgstr "将所有待写入磁盘的ImageIO对象数据写出。" + +#: ../../library/omv.image.rst:1641 +msgid "" +"Closes the ImageIO object. For in-memory objects this free's the " +"allocated space and for on-disk files this closes the file and writes out" +" all meta-data." +msgstr "关闭ImageIO对象。对于内存中的对象,这将释放分配的空间;对于磁盘文件,这将关闭文件并写出所有元数据。" + +#: ../../library/omv.image.rst:1647 +msgid "ImageIO object was opened on a file." +msgstr "ImageIO对象是在文件上打开的。" + +#: ../../library/omv.image.rst:1652 +msgid "ImageIO object was opened in memory." +msgstr "ImageIO 对象已在内存中打开。" + +#: ../../library/omv.image.rst:1655 +msgid "class Image -- Image object" +msgstr "类 Image -- Image 对象" + +#: ../../library/omv.image.rst:1657 +msgid "The image object is the basic object for machine vision operations." +msgstr "图像对象是机器视觉操作的基本对象。" + +#: ../../library/omv.image.rst:1661 +msgid "" +"If ``arg`` is a string then this creates a new image object from a file " +"at ``arg`` path. Supports loading bmp/pgm/ppm/jpg/jpeg/png image files " +"from disk. If ``copy_to_fb`` is true the image is copied to the frame " +"buffer verus being allocated on the heap." +msgstr "" +"如果 ``arg`` 是一个字符串,则会从 ``arg`` " +"路径的文件创建一个新的图像对象。支持从磁盘加载bmp/pgm/ppm/jpg/jpeg/png格式的图像文件。如果 ``copy_to_fb`` " +"为真,则图像将被复制到帧缓冲区,而不是在堆上分配。" + +#: ../../library/omv.image.rst:1665 +msgid "" +"If ``arg`` is an ``ndarray`` then this creates a new image object from " +"the ``ndarray``. ``ndarray`` objects with a shape of ``(w, h)`` are " +"treated as grayscale images, ``(w, h, 3)`` are treated as RGB565 images. " +"Only float32 point ``ndarrays`` are supported at this time. When creating" +" an image this way if you pass a ``buffer`` argument it will be used to " +"store the image data versus allocating space on the heap. If " +"``copy_to_fb`` is true the image is copied to the frame buffer verus " +"being allocated on the heap or using the ``buffer``." +msgstr "" +"如果 ``arg`` 是一个 ``ndarray`` ,则会从该 ``ndarray`` 创建一个新的图像对象。形状为 ``(w, h)`` 的 " +"``ndarray`` 被视为灰度图像,形状为 ``(w, h, 3)`` 的 ``ndarray`` 被视为RGB565图像。目前仅支持 " +"``float32`` 类型的 ``ndarray`` 。以这种方式创建图像时,如果传递了 ``buffer`` " +"参数,则图像数据将存储在该缓冲区中,而不是分配到堆上。如果 ``copy_to_fb`` 为真,则图像将被复制到帧缓冲区,而不是分配到堆上或使用 " +"``buffer`` 。" + +#: ../../library/omv.image.rst:1672 +msgid "" +"If ``arg`` is an ``int`` it is then considered the width of a new image " +"and a ``height`` value and a ``format`` value must follow to create a new" +" blank image object. ``format`` can be be any image pixformat value like " +"`image.GRAYSCALE`. The image will be initialized to all zeros. Note that " +"a ``buffer`` value is expected for compressed image formats. ``buffer`` " +"is considered as the source of image data for creating images this way. " +"If used with ``copy_to_fb`` the data from ``buffer`` is copied to the " +"frame buffer. If you'd like to create a JPEG image from a JPEG `bytes()` " +"or `bytearray()` object you can pass the ``width``, ``height``, " +"``image.JPEG`` for the JPEG along with setting ``buffer`` to the JPEG " +"byte stream to create a JPEG image." +msgstr "" +"如果 ``arg`` 是一个 ``int`` ,则该值被视为新图像的宽度,接下来必须提供 ``height`` 和 ``format`` " +"值,以创建一个新的空白图像对象。 ``format`` 可以是任何图像像素格式值,例如 `image.GRAYSCALE` " +"。图像将初始化为全零。请注意,对于压缩图像格式,需要提供 ``buffer`` 值。 ``buffer`` " +"将作为图像数据的来源,用于以这种方式创建图像。如果与 ``copy_to_fb`` 一起使用, ``buffer`` " +"中的数据将被复制到帧缓冲区。如果你想从JPEG的 `bytes()` 或 `bytearray()` 对象创建JPEG图像,你可以传递 " +"``width`` 、 ``height`` 和 ``image.JPEG`` 作为JPEG格式,并将 ``buffer`` " +"设置为JPEG字节流,从而创建JPEG图像。" + +#: ../../library/omv.image.rst:1682 +msgid "" +"Images support \"[]\" notation. Do ``image[index] = 8/16-bit value`` to " +"assign an image pixel or ``image[index]`` to get an image pixel which " +"will be either an 8-bit value for grayscale/bayer images of a 16-bit " +"value for RGB565/YUV images. Binary images return a 1-bit value." +msgstr "" +"图像支持\"[]\" 表示法。执行 ``image[index] = 8/16位值 `` 以分配图像像素,或执行 ``image[index]`` " +"以获取图像像素,该像素将是灰度/贝叶斯图像的8位值或RGB565/YUV图像的16位值。二进制图像返回1位值。" + +#: ../../library/omv.image.rst:1687 +msgid "" +"For JPEG images the \"[]\" allows you to access the compressed JPEG image" +" blob as a byte-array. Reading and writing to the data array is opaque " +"however as JPEG images are compressed byte streams." +msgstr "" +"对于JPEG图像,\"[]\" " +"允许您以字节数组的形式访问压缩的JPEG图像blob。但是,由于JPEG图像是压缩的字节流,因此对数据数组的读写是不透明的。" + +#: ../../library/omv.image.rst:1691 +msgid "" +"Images also support read buffer operations. You can pass images to all " +"sorts of MicroPython functions like as if the image were a byte-array " +"object. In particular, if you'd like to transmit an image you can just " +"pass it to the UART/SPI/I2C write functions to be transmitted " +"automatically." +msgstr "图像还支持读缓冲区操作。您可以将图像传递给各种MicroPython函数,就好像图像是字节数组对象一样。特别是,如果您想要传输图像,您可以只将其传递给UART/SPI/I2C写函数,以便自动传输。" + +#: ../../library/omv.image.rst:1697 +msgid "Basic Methods" +msgstr "基本方法" + +#: ../../library/omv.image.rst:1701 +msgid "Returns the image width in pixels." +msgstr "返回图像的宽度(以像素为单位)。" + +#: ../../library/omv.image.rst:1705 +msgid "Returns the image height in pixels." +msgstr "返回图像的高度(以像素为单位)。" + +#: ../../library/omv.image.rst:1709 +msgid "" +"Returns `image.GRAYSCALE` for grayscale images, `image.RGB565` for RGB565" +" images, `image.BAYER` for bayer pattern images, and `image.JPEG` for " +"JPEG images." +msgstr "" +"对于灰度图像,返回 `image.GRAYSCALE` ;对于RGB565图像,返回 `image.RGB565` ;对于贝叶斯模式图像,返回 " +"`image.BAYER` ;对于JPEG图像,返回 `image.JPEG` 。" + +#: ../../library/omv.image.rst:1715 +msgid "Returns the image size in bytes." +msgstr "返回图像的大小(以字节为单位)。" + +#: ../../library/omv.image.rst:1719 +msgid "" +"Returns a `bytearray` object that points to the image data for byte-level" +" read/write access." +msgstr "返回一个指向图像数据的 `bytearray` 对象,用于字节级读/写访问。" + +#: ../../library/omv.image.rst:1723 +msgid "" +"Image objects are automatically cast as `bytes` objects when passed to " +"MicroPython driver that requires a `bytes` like object. This is read-only" +" access. Call `bytearray()` to get read/write access." +msgstr "" +"当传递给需要 `bytes` 类似对象的MicroPython驱动程序时,图像对象会自动转换为 `bytes` 对象。这是只读访问。调用 " +"`bytearray()` 以获取读/写访问权限。" + +#: ../../library/omv.image.rst:1729 +msgid "" +"For grayscale images: Returns the grayscale pixel value at location (x, " +"y). For RGB565 images: Returns the RGB888 pixel tuple (r, g, b) at " +"location (x, y). For bayer pattern images: Returns the the pixel value at" +" the location (x, y)." +msgstr "对于灰度图像:返回位置(x,y)处的灰度像素值。对于RGB565图像:返回位置(x,y)处的RGB888像素元组(r,g,b)。对于贝叶斯模式图像:返回位置(x,y)处的像素值。" + +#: ../../library/omv.image.rst:1733 +msgid "Returns None if ``x`` or ``y`` is outside of the image." +msgstr "如果 ``x`` 或 ``y`` 在图像外部,则返回None。" + +#: ../../library/omv.image.rst:1735 ../../library/omv.image.rst:1760 +msgid "``x`` and ``y`` may either be passed independently or as a tuple." +msgstr "``x`` 和 ``y`` 可以单独传递,也可以作为元组传递(例如, ``(x,y)`` )。" + +#: ../../library/omv.image.rst:1737 +msgid "" +"``rgbtuple`` if True causes this method to return an RGB888 tuple. " +"Otherwise, this method returns the integer value of the underlying pixel." +" I.e. for RGB565 images this method returns a RGB565 value. Defaults to " +"True for RGB565 images and False otherwise." +msgstr "" +"``rgbtuple`` " +"若为True,则此方法返回RGB888元组。否则,此方法返回底层像素的整数值。例如,对于RGB565图像,此方法返回RGB565值。对于RGB565图像,默认为True,否则为False。" + +#: ../../library/omv.image.rst:1742 ../../library/omv.image.rst:1766 +#: ../../library/omv.image.rst:2764 ../../library/omv.image.rst:4549 +msgid "Not supported on compressed images." +msgstr "不支持压缩图像。" + +#: ../../library/omv.image.rst:1746 +msgid "" +"`Image.get_pixel()` and `Image.set_pixel()` are the only methods that " +"allow you to manipulate bayer pattern images. Bayer pattern images are " +"literal images where pixels in the image are R/G/R/G/etc. for even rows " +"and G/B/G/B/etc. for odd rows. Each pixel is 8-bits. If you call this " +"method with ``rgbtuple`` set then `Image.get_pixel()` will debayer the " +"source image at that pixel location and return a valid RGB888 tuple for " +"the pixel location." +msgstr "" +"`Image.get_pixel()` 和 `Image.set_pixel()` 是唯一允许您操作 Bayer 模式图像的方法。Bayer " +"模式图像是字面意义上的图像,其中图像中偶数行的像素为 R/G/R/G 等,奇数行的像素为 G/B/G/B 等。每个像素为 8 " +"位。如果调用此方法时设置了 ``rgbtuple`` ,则 `Image.get_pixel()` 将在该像素位置对源图像进行 Bayer " +"解码,并返回该像素位置的有效 RGB888 元组。" + +#: ../../library/omv.image.rst:1754 +msgid "" +"For grayscale images: Sets the pixel at location (x, y) to the grayscale " +"value ``pixel``. For RGB565 images: Sets the pixel at location (x, y) to " +"the RGB888 tuple (r, g, b) ``pixel``. For bayer pattern images: Sets the " +"pixel value at the location (x, y) to the value ``pixel``." +msgstr "" +"对于灰度图像:将位置 (x, y) 处的像素设置为灰度值 ``pixel`` 。对于RGB565图像:将位置 (x, y) 处的像素设置为 " +"RGB888 元组 (r, g, b) ``pixel`` 。对于 Bayer 模式图像:将位置 (x, y) 处的像素值设置为值 " +"``pixel`` 。" + +#: ../../library/omv.image.rst:1758 ../../library/omv.image.rst:1874 +#: ../../library/omv.image.rst:1938 ../../library/omv.image.rst:2002 +#: ../../library/omv.image.rst:2066 ../../library/omv.image.rst:2130 +#: ../../library/omv.image.rst:2194 ../../library/omv.image.rst:2258 +#: ../../library/omv.image.rst:2322 ../../library/omv.image.rst:2395 +#: ../../library/omv.image.rst:2459 ../../library/omv.image.rst:2532 +#: ../../library/omv.image.rst:2596 ../../library/omv.image.rst:2660 +#: ../../library/omv.image.rst:2724 ../../library/omv.image.rst:2744 +#: ../../library/omv.image.rst:2762 ../../library/omv.image.rst:2777 +#: ../../library/omv.image.rst:2794 ../../library/omv.image.rst:2811 +#: ../../library/omv.image.rst:2828 ../../library/omv.image.rst:2871 +#: ../../library/omv.image.rst:2888 ../../library/omv.image.rst:2903 +#: ../../library/omv.image.rst:2922 ../../library/omv.image.rst:2987 +#: ../../library/omv.image.rst:3006 ../../library/omv.image.rst:3036 +#: ../../library/omv.image.rst:3062 ../../library/omv.image.rst:3071 +#: ../../library/omv.image.rst:3080 ../../library/omv.image.rst:3150 +#: ../../library/omv.image.rst:3162 ../../library/omv.image.rst:3180 +#: ../../library/omv.image.rst:3198 ../../library/omv.image.rst:3216 +#: ../../library/omv.image.rst:3234 ../../library/omv.image.rst:3252 +#: ../../library/omv.image.rst:3270 ../../library/omv.image.rst:3286 +#: ../../library/omv.image.rst:3315 ../../library/omv.image.rst:3338 +#: ../../library/omv.image.rst:3361 ../../library/omv.image.rst:3380 +#: ../../library/omv.image.rst:3424 ../../library/omv.image.rst:3450 +#: ../../library/omv.image.rst:3471 ../../library/omv.image.rst:3489 +#: ../../library/omv.image.rst:3507 ../../library/omv.image.rst:3525 +#: ../../library/omv.image.rst:3548 ../../library/omv.image.rst:3570 +#: ../../library/omv.image.rst:3595 ../../library/omv.image.rst:3617 +#: ../../library/omv.image.rst:3631 ../../library/omv.image.rst:3645 +#: ../../library/omv.image.rst:3690 ../../library/omv.image.rst:3719 +#: ../../library/omv.image.rst:3745 ../../library/omv.image.rst:3772 +#: ../../library/omv.image.rst:3808 ../../library/omv.image.rst:3841 +#: ../../library/omv.image.rst:3874 ../../library/omv.image.rst:3904 +#: ../../library/omv.image.rst:3950 ../../library/omv.image.rst:3993 +msgid "" +"Returns the image object so you can call another method using ``.`` " +"notation." +msgstr "返回图像对象,以便您可以使用 ``.`` 符号调用另一个方法。" + +#: ../../library/omv.image.rst:1762 +msgid "" +"``pixel`` may either be an RGB888 tuple (r, g, b) or the underlying pixel" +" value (i.e. a RGB565 value for RGB565 images or an 8-bit value for " +"grayscale images." +msgstr "" +"``pixel`` 可以是 RGB888 元组 (r, g, b) 或底层像素值(即 RGB565 图像的 RGB565 值或灰度图像的 8 " +"位值)。" + +#: ../../library/omv.image.rst:1770 +msgid "" +"`Image.get_pixel()` and `Image.set_pixel()` are the only methods that " +"allow you to manipulate bayer pattern images. Bayer pattern images are " +"literal images where pixels in the image are R/G/R/G/etc. for even rows " +"and G/B/G/B/etc. for odd rows. Each pixel is 8-bits. If you call this " +"method with an RGB888 tuple the grayscale value of that RGB888 tuple is " +"extracted and set to the pixel location." +msgstr "" +"`Image.get_pixel()` 和 `Image.set_pixel()` 是唯一允许您操作 Bayer 模式图像的方法。Bayer " +"模式图像是字面意义上的图像,其中图像中偶数行的像素为 R/G/R/G 等,奇数行的像素为 G/B/G/B 等。每个像素为 8 位。如果以 " +"RGB888 元组调用此方法,则提取该 RGB888 元组的灰度值,并将其设置为像素位置。" + +#: ../../library/omv.image.rst:1777 +msgid "Conversion Methods" +msgstr "转换方法" + +#: ../../library/omv.image.rst:1781 +msgid "" +"Returns a ``ndarray`` object created from the image. This only works for " +"GRAYSCALE or RGB565 images currently." +msgstr "返回一个由图像创建的 ``ndarray`` 对象。目前,仅适用于GRAYSCALE或RGB565格式的图像。" + +#: ../../library/omv.image.rst:1784 +msgid "" +"``dtype`` can be ``b``, ``B``, or ``f`` for creating a signed 8-bit, " +"unsigned 8-bit, or 32-bit floating point ``ndarray``. GRAYSCALE images " +"are directly converted to unsigned 8-bit ``ndarray`` objects. For signed " +"8-bit ``ndarray`` objects the values (0:255) are mapped to (-127:128). " +"For float 32-bit ``ndarray`` objects the values are mapped to " +"(0.0:255.0). RGB565 images are converted to 3-channel ``ndarray`` objects" +" and the same process described above for GRAYSCALE images is applied to " +"each channel depending on ``dtype``. Note that ``dtype`` also accepts the" +" integer values (e.g. `ord()`) of ``b``, ``B``, and ``f`` respectively." +msgstr "" +"``dtype`` 可以是 ``b``、``B`` 或 ``f``,分别用于创建有符号 8 位、无符号 8 位或 32 位浮点型的 " +"``ndarray``。灰度图像会直接转换为无符号 8 位的 ``ndarray`` 对象。对于有符号 8 位的 ``ndarray`` " +"对象,值会从 (0:255) 映射到 (-127:128)。对于 32 位浮点型的 ``ndarray`` 对象,值会从 (0.0:255.0) " +"映射。RGB565 图像会转换为 3 通道的 ``ndarray`` 对象,并且上述对灰度图像的处理过程会应用到每个通道,具体取决于 " +"``dtype``。需要注意的是,``dtype`` 也可以接受整数值(例如 `ord()` 函数的返回值)来表示 ``b``、``B`` 和 " +"``f``。" + +#: ../../library/omv.image.rst:1791 +msgid "" +"``buffer`` if not ``None`` is a ``bytearray`` object to use as the buffer" +" for the ``ndarray``. If ``None`` a new buffer is allocated on the heap " +"to store the ``ndarray`` image data. You can use the ``buffer`` argument " +"to directly allocate the ``ndarray`` in a pre-allocated buffer saving a " +"heap allocation and a copy operation." +msgstr "" +"如果 ``buffer`` 不为 ``None`` ,则它是一个 ``bytearray`` 对象,用作 ``ndarray`` 的缓冲区。如果 " +"``buffer`` 为 ``None`` ,则会在堆上分配一个新的缓冲区来存储 ``ndarray`` 图像数据。你可以使用 " +"``buffer`` 参数直接在预分配的缓冲区中分配 ``ndarray`` ,从而避免堆分配和复制操作。" + +#: ../../library/omv.image.rst:1796 +msgid "" +"The ``ndarray`` returned has the shape of ``(height, width)`` for " +"GRAYSCALE images and ``(height, width, 3)`` for RGB565 images." +msgstr "" +"返回的 ``ndarray`` 具有以下形状: 对于灰度图像(GRAYSCALE),形状为 ``(height, width)`` " +";对于RGB565图像,形状为 ``(height, width, 3)`` 。" + +#: ../../library/omv.image.rst:1801 +msgid "Converts an image to a bitmap image (1 bit per pixel)." +msgstr "将图像转换为位图图像(每个像素 1 位)。" + +#: ../../library/omv.image.rst:1803 ../../library/omv.image.rst:1880 +#: ../../library/omv.image.rst:1944 ../../library/omv.image.rst:2008 +#: ../../library/omv.image.rst:2072 ../../library/omv.image.rst:2136 +#: ../../library/omv.image.rst:2200 ../../library/omv.image.rst:2264 +#: ../../library/omv.image.rst:2328 ../../library/omv.image.rst:2401 +#: ../../library/omv.image.rst:2465 ../../library/omv.image.rst:2542 +#: ../../library/omv.image.rst:2602 ../../library/omv.image.rst:2666 +#: ../../library/omv.image.rst:2935 ../../library/omv.image.rst:4022 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向上的缩放比例(浮动类型)。如果该值为负,图像将水平翻转。请注意,如果没有指定 ``y_scale`` " +",则其值将与 ``x_scale`` 相同,以保持图像的纵横比。" + +#: ../../library/omv.image.rst:1807 ../../library/omv.image.rst:1884 +#: ../../library/omv.image.rst:1948 ../../library/omv.image.rst:2012 +#: ../../library/omv.image.rst:2076 ../../library/omv.image.rst:2140 +#: ../../library/omv.image.rst:2204 ../../library/omv.image.rst:2268 +#: ../../library/omv.image.rst:2332 ../../library/omv.image.rst:2405 +#: ../../library/omv.image.rst:2469 ../../library/omv.image.rst:2546 +#: ../../library/omv.image.rst:2606 ../../library/omv.image.rst:2670 +#: ../../library/omv.image.rst:2939 ../../library/omv.image.rst:4026 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向上的缩放比例(浮动类型)。如果该值为负,图像将垂直翻转。请注意,如果没有指定 ``x_scale`` " +",则其值将与 ``x_scale`` 相同,以保持图像的纵横比。" + +#: ../../library/omv.image.rst:1811 ../../library/omv.image.rst:1888 +#: ../../library/omv.image.rst:1952 ../../library/omv.image.rst:2016 +#: ../../library/omv.image.rst:2080 ../../library/omv.image.rst:2144 +#: ../../library/omv.image.rst:2208 ../../library/omv.image.rst:2272 +#: ../../library/omv.image.rst:2336 ../../library/omv.image.rst:2409 +#: ../../library/omv.image.rst:2473 ../../library/omv.image.rst:2550 +#: ../../library/omv.image.rst:2610 ../../library/omv.image.rst:2674 +#: ../../library/omv.image.rst:2943 ../../library/omv.image.rst:4030 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"source image to draw. This allows you to extract just the pixels in the " +"ROI to scale and draw on the destination image." +msgstr "``roi`` 是源图像要绘制的感兴趣区域的矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域中的像素以在目标图像上进行缩放和绘制。" + +#: ../../library/omv.image.rst:1814 ../../library/omv.image.rst:1891 +#: ../../library/omv.image.rst:1955 ../../library/omv.image.rst:2019 +#: ../../library/omv.image.rst:2083 ../../library/omv.image.rst:2147 +#: ../../library/omv.image.rst:2211 ../../library/omv.image.rst:2275 +#: ../../library/omv.image.rst:2339 ../../library/omv.image.rst:2412 +#: ../../library/omv.image.rst:2476 ../../library/omv.image.rst:2553 +#: ../../library/omv.image.rst:2613 ../../library/omv.image.rst:2677 +#: ../../library/omv.image.rst:2946 ../../library/omv.image.rst:4033 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render onto the destination image. For " +"example, if you pass ``rgb_channel=1`` this will extract the green " +"channel of the source RGB565 image and draw that in grayscale on the " +"destination image." +msgstr "" +"``rgb_channel`` 是要从 RGB565 图像(如果传入)中提取的 RGB 通道(0=R,1=G,2=B" +"),并渲染到目标图像上。例如,如果传递 ``rgb_channel=1``,则会提取源 RGB565 " +"图像的绿色通道,并以灰度形式绘制到目标图像上。" + +#: ../../library/omv.image.rst:1819 ../../library/omv.image.rst:1896 +#: ../../library/omv.image.rst:1960 ../../library/omv.image.rst:2024 +#: ../../library/omv.image.rst:2088 ../../library/omv.image.rst:2152 +#: ../../library/omv.image.rst:2216 ../../library/omv.image.rst:2280 +#: ../../library/omv.image.rst:2344 ../../library/omv.image.rst:2417 +#: ../../library/omv.image.rst:2481 ../../library/omv.image.rst:2558 +#: ../../library/omv.image.rst:2618 ../../library/omv.image.rst:2682 +#: ../../library/omv.image.rst:2951 ../../library/omv.image.rst:4038 +msgid "" +"``alpha`` controls how much of the source image to blend into the " +"destination image. A value of 255 draws an opaque source image while a " +"value lower than 255 produces a blend between the source and destination " +"image. 0 results in no modification to the destination image." +msgstr "" +"``alpha`` 控制要混合到目标图像中的源图像的程度。255 的值绘制不透明的源图像,而低于 255 的值会在源图像和目标图像之间产生混合。0" +" 表示不对目标图像进行修改。" + +#: ../../library/omv.image.rst:1823 ../../library/omv.image.rst:1900 +#: ../../library/omv.image.rst:1964 ../../library/omv.image.rst:2028 +#: ../../library/omv.image.rst:2092 ../../library/omv.image.rst:2220 +#: ../../library/omv.image.rst:2284 ../../library/omv.image.rst:2348 +#: ../../library/omv.image.rst:2421 ../../library/omv.image.rst:2485 +#: ../../library/omv.image.rst:2562 ../../library/omv.image.rst:2622 +#: ../../library/omv.image.rst:2686 ../../library/omv.image.rst:2955 +#: ../../library/omv.image.rst:4042 +msgid "" +"``color_palette`` if not ``None`` can be an a color palette enum or a 256" +" pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the source image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不为 ``None``,可以是调色板枚举值,或一个包含 256 个像素的 RGB565 " +"图像,用作源图像的灰度值的颜色查找表。如果使用了 ``rgb_channel`` 提取,则该调色板将在提取后应用。" + +#: ../../library/omv.image.rst:1827 ../../library/omv.image.rst:1904 +#: ../../library/omv.image.rst:1968 ../../library/omv.image.rst:2032 +#: ../../library/omv.image.rst:2096 ../../library/omv.image.rst:2160 +#: ../../library/omv.image.rst:2224 ../../library/omv.image.rst:2288 +#: ../../library/omv.image.rst:2352 ../../library/omv.image.rst:2425 +#: ../../library/omv.image.rst:2489 ../../library/omv.image.rst:2566 +#: ../../library/omv.image.rst:2626 ../../library/omv.image.rst:2690 +#: ../../library/omv.image.rst:2959 ../../library/omv.image.rst:4046 +msgid "" +"``alpha_palette`` if not ``None`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the source image being drawn at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不为 ``None`` ,可以是一个包含 256 个像素的灰度图像,用作 alpha " +"调色板,按像素级别调节源图像的 ``alpha`` 值,使你能够基于灰度值精确控制像素的透明度。alpha 查找表中像素值为 255 " +"时表示不透明,低于 255 的值则使像素变得更加透明,直到 0。此操作会在使用 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.image.rst:1833 ../../library/omv.image.rst:1910 +#: ../../library/omv.image.rst:1974 ../../library/omv.image.rst:2038 +#: ../../library/omv.image.rst:2102 ../../library/omv.image.rst:2166 +#: ../../library/omv.image.rst:2230 ../../library/omv.image.rst:2294 +#: ../../library/omv.image.rst:2358 ../../library/omv.image.rst:2431 +#: ../../library/omv.image.rst:2495 ../../library/omv.image.rst:2572 +#: ../../library/omv.image.rst:2632 ../../library/omv.image.rst:2696 +#: ../../library/omv.image.rst:2965 ../../library/omv.image.rst:4052 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.image.rst:1835 ../../library/omv.image.rst:1912 +#: ../../library/omv.image.rst:1976 ../../library/omv.image.rst:2040 +#: ../../library/omv.image.rst:2104 ../../library/omv.image.rst:2168 +#: ../../library/omv.image.rst:2232 ../../library/omv.image.rst:2296 +#: ../../library/omv.image.rst:2360 ../../library/omv.image.rst:2433 +#: ../../library/omv.image.rst:2497 ../../library/omv.image.rst:2574 +#: ../../library/omv.image.rst:2634 ../../library/omv.image.rst:2698 +#: ../../library/omv.image.rst:2967 ../../library/omv.image.rst:4054 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.image.rst:1836 ../../library/omv.image.rst:1913 +#: ../../library/omv.image.rst:1977 ../../library/omv.image.rst:2041 +#: ../../library/omv.image.rst:2105 ../../library/omv.image.rst:2169 +#: ../../library/omv.image.rst:2233 ../../library/omv.image.rst:2297 +#: ../../library/omv.image.rst:2361 ../../library/omv.image.rst:2434 +#: ../../library/omv.image.rst:2498 ../../library/omv.image.rst:2575 +#: ../../library/omv.image.rst:2635 ../../library/omv.image.rst:2699 +#: ../../library/omv.image.rst:2968 ../../library/omv.image.rst:4055 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.image.rst:1837 ../../library/omv.image.rst:1914 +#: ../../library/omv.image.rst:1978 ../../library/omv.image.rst:2042 +#: ../../library/omv.image.rst:2106 ../../library/omv.image.rst:2170 +#: ../../library/omv.image.rst:2234 ../../library/omv.image.rst:2298 +#: ../../library/omv.image.rst:2362 ../../library/omv.image.rst:2435 +#: ../../library/omv.image.rst:2499 ../../library/omv.image.rst:2576 +#: ../../library/omv.image.rst:2636 ../../library/omv.image.rst:2700 +#: ../../library/omv.image.rst:2969 ../../library/omv.image.rst:4056 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.image.rst:1838 ../../library/omv.image.rst:1915 +#: ../../library/omv.image.rst:1979 ../../library/omv.image.rst:2043 +#: ../../library/omv.image.rst:2107 ../../library/omv.image.rst:2171 +#: ../../library/omv.image.rst:2235 ../../library/omv.image.rst:2299 +#: ../../library/omv.image.rst:2363 ../../library/omv.image.rst:2436 +#: ../../library/omv.image.rst:2500 ../../library/omv.image.rst:2577 +#: ../../library/omv.image.rst:2637 ../../library/omv.image.rst:2701 +#: ../../library/omv.image.rst:2970 ../../library/omv.image.rst:4057 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.image.rst:1839 ../../library/omv.image.rst:1916 +#: ../../library/omv.image.rst:1980 ../../library/omv.image.rst:2044 +#: ../../library/omv.image.rst:2108 ../../library/omv.image.rst:2172 +#: ../../library/omv.image.rst:2236 ../../library/omv.image.rst:2300 +#: ../../library/omv.image.rst:2364 ../../library/omv.image.rst:2437 +#: ../../library/omv.image.rst:2501 ../../library/omv.image.rst:2578 +#: ../../library/omv.image.rst:2638 ../../library/omv.image.rst:2702 +#: ../../library/omv.image.rst:2971 ../../library/omv.image.rst:4058 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.image.rst:1840 ../../library/omv.image.rst:1917 +#: ../../library/omv.image.rst:1981 ../../library/omv.image.rst:2045 +#: ../../library/omv.image.rst:2109 ../../library/omv.image.rst:2173 +#: ../../library/omv.image.rst:2237 ../../library/omv.image.rst:2301 +#: ../../library/omv.image.rst:2365 ../../library/omv.image.rst:2438 +#: ../../library/omv.image.rst:2502 ../../library/omv.image.rst:2579 +#: ../../library/omv.image.rst:2639 ../../library/omv.image.rst:2703 +#: ../../library/omv.image.rst:2972 ../../library/omv.image.rst:4059 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.image.rst:1841 ../../library/omv.image.rst:1918 +#: ../../library/omv.image.rst:1982 ../../library/omv.image.rst:2046 +#: ../../library/omv.image.rst:2110 ../../library/omv.image.rst:2174 +#: ../../library/omv.image.rst:2238 ../../library/omv.image.rst:2302 +#: ../../library/omv.image.rst:2366 ../../library/omv.image.rst:2439 +#: ../../library/omv.image.rst:2503 ../../library/omv.image.rst:2580 +#: ../../library/omv.image.rst:2640 ../../library/omv.image.rst:2704 +#: ../../library/omv.image.rst:2973 ../../library/omv.image.rst:4060 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.image.rst:1842 ../../library/omv.image.rst:1919 +#: ../../library/omv.image.rst:1983 ../../library/omv.image.rst:2047 +#: ../../library/omv.image.rst:2111 ../../library/omv.image.rst:2175 +#: ../../library/omv.image.rst:2239 ../../library/omv.image.rst:2303 +#: ../../library/omv.image.rst:2367 ../../library/omv.image.rst:2440 +#: ../../library/omv.image.rst:2504 ../../library/omv.image.rst:2581 +#: ../../library/omv.image.rst:2641 ../../library/omv.image.rst:2705 +#: ../../library/omv.image.rst:2974 ../../library/omv.image.rst:4061 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.image.rst:1843 ../../library/omv.image.rst:1920 +#: ../../library/omv.image.rst:1984 ../../library/omv.image.rst:2048 +#: ../../library/omv.image.rst:2112 ../../library/omv.image.rst:2176 +#: ../../library/omv.image.rst:2240 ../../library/omv.image.rst:2304 +#: ../../library/omv.image.rst:2368 ../../library/omv.image.rst:2441 +#: ../../library/omv.image.rst:2505 ../../library/omv.image.rst:2582 +#: ../../library/omv.image.rst:2642 ../../library/omv.image.rst:2706 +#: ../../library/omv.image.rst:2975 ../../library/omv.image.rst:4062 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.image.rst:1844 ../../library/omv.image.rst:1921 +#: ../../library/omv.image.rst:1985 ../../library/omv.image.rst:2049 +#: ../../library/omv.image.rst:2113 ../../library/omv.image.rst:2177 +#: ../../library/omv.image.rst:2241 ../../library/omv.image.rst:2305 +#: ../../library/omv.image.rst:2369 ../../library/omv.image.rst:2442 +#: ../../library/omv.image.rst:2506 ../../library/omv.image.rst:2583 +#: ../../library/omv.image.rst:2643 ../../library/omv.image.rst:2707 +#: ../../library/omv.image.rst:2976 ../../library/omv.image.rst:4063 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP`: 缩放绘制的图像,使其适应显示区域。" + +#: ../../library/omv.image.rst:1845 ../../library/omv.image.rst:1922 +#: ../../library/omv.image.rst:1986 ../../library/omv.image.rst:2050 +#: ../../library/omv.image.rst:2114 ../../library/omv.image.rst:2178 +#: ../../library/omv.image.rst:2242 ../../library/omv.image.rst:2306 +#: ../../library/omv.image.rst:2370 ../../library/omv.image.rst:2443 +#: ../../library/omv.image.rst:2507 ../../library/omv.image.rst:2584 +#: ../../library/omv.image.rst:2644 ../../library/omv.image.rst:2708 +#: ../../library/omv.image.rst:2977 ../../library/omv.image.rst:4064 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND`: 缩放绘制的图像,使其填满显示区域(会导致裁剪)" + +#: ../../library/omv.image.rst:1846 ../../library/omv.image.rst:1923 +#: ../../library/omv.image.rst:1987 ../../library/omv.image.rst:2051 +#: ../../library/omv.image.rst:2115 ../../library/omv.image.rst:2179 +#: ../../library/omv.image.rst:2243 ../../library/omv.image.rst:2307 +#: ../../library/omv.image.rst:2371 ../../library/omv.image.rst:2444 +#: ../../library/omv.image.rst:2508 ../../library/omv.image.rst:2585 +#: ../../library/omv.image.rst:2645 ../../library/omv.image.rst:2709 +#: ../../library/omv.image.rst:2978 ../../library/omv.image.rst:4065 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE`: 缩放绘制的图像,使其填满显示区域(会导致拉伸)。" + +#: ../../library/omv.image.rst:1847 ../../library/omv.image.rst:1924 +#: ../../library/omv.image.rst:1988 ../../library/omv.image.rst:2052 +#: ../../library/omv.image.rst:2116 ../../library/omv.image.rst:2180 +#: ../../library/omv.image.rst:2244 ../../library/omv.image.rst:2308 +#: ../../library/omv.image.rst:2372 ../../library/omv.image.rst:2445 +#: ../../library/omv.image.rst:2509 ../../library/omv.image.rst:2586 +#: ../../library/omv.image.rst:2646 ../../library/omv.image.rst:2710 +#: ../../library/omv.image.rst:2979 ../../library/omv.image.rst:4066 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.image.rst:1848 ../../library/omv.image.rst:1925 +#: ../../library/omv.image.rst:1989 ../../library/omv.image.rst:2053 +#: ../../library/omv.image.rst:2117 ../../library/omv.image.rst:2181 +#: ../../library/omv.image.rst:2245 ../../library/omv.image.rst:2309 +#: ../../library/omv.image.rst:2373 ../../library/omv.image.rst:2446 +#: ../../library/omv.image.rst:2510 ../../library/omv.image.rst:2587 +#: ../../library/omv.image.rst:2647 ../../library/omv.image.rst:2711 +#: ../../library/omv.image.rst:2980 ../../library/omv.image.rst:4067 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.image.rst:1849 ../../library/omv.image.rst:1926 +#: ../../library/omv.image.rst:1990 ../../library/omv.image.rst:2054 +#: ../../library/omv.image.rst:2118 ../../library/omv.image.rst:2182 +#: ../../library/omv.image.rst:2246 ../../library/omv.image.rst:2310 +#: ../../library/omv.image.rst:2374 ../../library/omv.image.rst:2447 +#: ../../library/omv.image.rst:2511 ../../library/omv.image.rst:2588 +#: ../../library/omv.image.rst:2648 ../../library/omv.image.rst:2712 +#: ../../library/omv.image.rst:2981 ../../library/omv.image.rst:4068 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.image.rst:1851 ../../library/omv.image.rst:1928 +#: ../../library/omv.image.rst:1992 ../../library/omv.image.rst:2056 +#: ../../library/omv.image.rst:2120 ../../library/omv.image.rst:2184 +#: ../../library/omv.image.rst:2248 ../../library/omv.image.rst:2312 +#: ../../library/omv.image.rst:2376 ../../library/omv.image.rst:2449 +#: ../../library/omv.image.rst:2513 ../../library/omv.image.rst:2590 +#: ../../library/omv.image.rst:2650 ../../library/omv.image.rst:2714 +#: ../../library/omv.image.rst:2984 ../../library/omv.image.rst:4071 +msgid "" +"``transform`` is 3x3 ``ndarray`` that is used to perform a persepective " +"transformation on the image. Only supported on the OpenMV Cam N6 " +"currently as it has a GPU that can do this in hardware." +msgstr "``transform`` 是一个 3x3 的 ``ndarray``,用于对图像执行透视变换。目前仅在 OpenMV Cam N6 上支持,因为它有可以在硬件中完成此操作的 GPU。" + +#: ../../library/omv.image.rst:1854 ../../library/omv.image.rst:1931 +#: ../../library/omv.image.rst:1995 ../../library/omv.image.rst:2059 +#: ../../library/omv.image.rst:2123 ../../library/omv.image.rst:2187 +#: ../../library/omv.image.rst:2251 ../../library/omv.image.rst:2315 +#: ../../library/omv.image.rst:2379 ../../library/omv.image.rst:2452 +#: ../../library/omv.image.rst:2516 ../../library/omv.image.rst:2653 +#: ../../library/omv.image.rst:2717 +msgid "" +"``copy`` if True create a deep-copy on the heap of the image that's been " +"converted versus converting the original image in-place." +msgstr "``copy`` 如果为 True,则在堆上创建图像的深拷贝,而不是就地转换原始图像。" + +#: ../../library/omv.image.rst:1857 ../../library/omv.image.rst:1934 +#: ../../library/omv.image.rst:1998 ../../library/omv.image.rst:2062 +#: ../../library/omv.image.rst:2126 ../../library/omv.image.rst:2190 +#: ../../library/omv.image.rst:2254 ../../library/omv.image.rst:2318 +#: ../../library/omv.image.rst:2382 ../../library/omv.image.rst:2455 +#: ../../library/omv.image.rst:2519 ../../library/omv.image.rst:2656 +#: ../../library/omv.image.rst:2720 +msgid "" +"``copy_to_fb`` if True the image is loaded directly into the frame " +"buffer. ``copy_to_fb`` has priority over ``copy``. This has no special " +"effect if the image is already in the frame buffer." +msgstr "" +"``copy_to_fb`` 如果为 True,图像将直接加载到帧缓冲区。``copy_to_fb`` 优先于 " +"``copy``。如果图像已经在帧缓冲区中,则此设置不会产生任何特殊效果。" + +#: ../../library/omv.image.rst:1863 ../../library/omv.image.rst:3139 +msgid "" +"Bitmap images are like grayscale images with only two pixels values - 0 " +"and 1. Additionally, bitmap images are packed such that they only store 1" +" bit per pixel making them very small. The OpenMV image library allows " +"bitmap images to be used in all places `sensor.GRAYSCALE` and " +"`sensor.RGB565` images can be used. However, many operations when applied" +" on bitmap images don't make any sense becuase bitmap images only have 2 " +"values. OpenMV recommends using bitmap images for ``mask`` values in " +"operations and such as they fit on the MicroPython heap quite easily. " +"Finally, bitmap image pixel values 0 and 1 are interpreted as black and " +"white when being applied to `sensor.GRAYSCALE` or `sensor.RGB565` images." +" The library automatically handles conversion." +msgstr "" +"位图图像类似于灰度图像,但只有两种像素值——0 和 1。此外,位图图像被打包成每个像素仅占用 1 位,因此它们非常小。OpenMV " +"图像库允许在所有可以使用 `sensor.GRAYSCALE` 和 `sensor.RGB565` " +"图像的地方使用位图图像。然而,许多应用于位图图像的操作没有意义,因为位图图像仅有 2 个值。OpenMV 推荐将位图图像用于操作中的 " +"``mask`` 值,因为它们可以非常容易地适应 MicroPython 堆内存。最后,位图图像的像素值 0 和 1 在应用于 " +"`sensor.GRAYSCALE` 或 `sensor.RGB565` 图像时被解释为黑色和白色。库会自动处理这种转换。" + +#: ../../library/omv.image.rst:1878 +msgid "Converts an image to a grayscale image (8-bits per pixel)." +msgstr "将图像转换为灰度图像(每个像素 8 位)。" + +#: ../../library/omv.image.rst:1942 +msgid "Converts an image to an RGB565 image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2006 +msgid "Converts an image to an RGB565 rainbow image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 彩虹图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2070 +msgid "Converts an image to an RGB565 ironbow image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 铁道彩虹(Ironbow)图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2134 +msgid "Converts an image to an RGB565 Depth Image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 深度图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2156 +msgid "" +"``color_palette`` if not ``None`` can be `image.PALETTE_DEPTH` or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the source image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不为 ``None``,可以是 " +"`image.PALETTE_DEPTH`,或一个包含 256 个像素的 RGB565 " +"图像,用作源图像的灰度值的颜色查找表。如果使用了 ``rgb_channel`` 提取,则该调色板将在提取后应用。" + +#: ../../library/omv.image.rst:2198 +msgid "Converts an image to an RGB565 Dark Event Image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 暗事件图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2262 +msgid "Converts an image to an RGB565 Light Event Image (16-bits per pixel)." +msgstr "将图像转换为 RGB565 亮事件图像(每个像素 16 位)。" + +#: ../../library/omv.image.rst:2326 ../../library/omv.image.rst:2463 +msgid "Converts an image to a JPEG image." +msgstr "将图像转换为 JPEG 图像。" + +#: ../../library/omv.image.rst:2386 ../../library/omv.image.rst:2523 +msgid "" +"``quality`` controls the jpeg image compression quality. The value can be" +" between 0 and 100." +msgstr "" +"``quality`` 控制 JPEG 图像的压缩质量。该值可以在 0 到 100 " +"之间,值越高表示图像质量越好,压缩率越低;值越低则表示图像质量较差,压缩率较高。" + +#: ../../library/omv.image.rst:2388 ../../library/omv.image.rst:2525 +msgid "``subsampling`` can be:" +msgstr "``subsampling`` 可以是:" + +#: ../../library/omv.image.rst:2390 ../../library/omv.image.rst:2527 +msgid "" +"`image.JPEG_SUBSAMPLING_AUTO`: Use the best subsampling for the image " +"based on the quality." +msgstr "`image.JPEG_SUBSAMPLING_AUTO`: 根据图像的质量自动选择最佳的子采样方式。" + +#: ../../library/omv.image.rst:2391 ../../library/omv.image.rst:2528 +msgid "`image.JPEG_SUBSAMPLING_444`: Use 4:4:4 subsampling." +msgstr "`image.JPEG_SUBSAMPLING_444`: 使用 4:4:4 子采样。" + +#: ../../library/omv.image.rst:2392 ../../library/omv.image.rst:2529 +msgid "`image.JPEG_SUBSAMPLING_422`: Use 4:2:2 subsampling." +msgstr "`image.JPEG_SUBSAMPLING_422`: 使用 4:2:2 子采样。" + +#: ../../library/omv.image.rst:2393 ../../library/omv.image.rst:2530 +msgid "`image.JPEG_SUBSAMPLING_420`: Use 4:2:0 subsampling." +msgstr "`image.JPEG_SUBSAMPLING_420`: 使用 4:2:0 子采样。" + +#: ../../library/omv.image.rst:2399 +msgid "Converts an image to a PNG image." +msgstr "将图像转换为 PNG 图像。" + +#: ../../library/omv.image.rst:2536 +msgid "`Image.compress` is an alias for `Image.to_jpeg`." +msgstr "`Image.compress` 是 `Image.to_jpeg` 的别名。" + +#: ../../library/omv.image.rst:2540 +msgid "Creates a deep copy of the image object." +msgstr "创建图像对象的深拷贝。" + +#: ../../library/omv.image.rst:2593 +msgid "" +"``copy_to_fb`` if True the image is loaded directly into the frame " +"buffer. This has no special effect if the image is already in the frame " +"buffer." +msgstr "``copy_to_fb`` 如果为 True,图像将直接加载到帧缓冲区。如果图像已经在帧缓冲区中,则此设置不会产生任何特殊效果。" + +#: ../../library/omv.image.rst:2600 ../../library/omv.image.rst:2664 +msgid "Modifies an image in-place without changing the underlying image type." +msgstr "在不改变图像类型的情况下,就地修改图像。" + +#: ../../library/omv.image.rst:2728 +msgid "`Image.scale` is an alias for `Image.crop`." +msgstr "`Image.scale` 是 `Image.crop` 的别名。" + +#: ../../library/omv.image.rst:2732 +msgid "Saves a copy of the image to the filesystem at ``path``." +msgstr "将图像的副本保存到文件系统中的 ``path`` 处。" + +#: ../../library/omv.image.rst:2734 +msgid "" +"Supports bmp/pgm/ppm/jpg/jpeg image files. Note that you cannot save jpeg" +" compressed images to an uncompressed format." +msgstr "支持 bmp/pgm/ppm/jpg/jpeg 图像文件。请注意,您不能将 jpeg 压缩图像保存为未压缩格式。" + +#: ../../library/omv.image.rst:2737 +msgid "" +"``roi`` is the region-of-interest rectangle (x, y, w, h) to save from. If" +" not specified, it is equal to the image rectangle which copies the " +"entire image. This argument is not applicable for JPEG images." +msgstr "``roi`` 是要保存的感兴趣区域矩形 (x, y, w, h)。如果未指定,则等于复制整个图像的图像矩形。此参数不适用于 JPEG 图像。" + +#: ../../library/omv.image.rst:2741 +msgid "" +"``quality`` is the jpeg compression quality to use to save the image to " +"jpeg format if the image is not already compressed (0-100) (int)." +msgstr "``quality`` 是要用于将图像保存为 JPEG 格式的 jpeg 压缩质量(0-100)(int)。" + +#: ../../library/omv.image.rst:2748 +msgid "" +"Updates the frame buffer in the IDE with the image in the frame buffer on" +" the camera." +msgstr "使用相机上帧缓冲区中的图像更新 IDE 中的帧缓冲区。" + +#: ../../library/omv.image.rst:2751 +msgid "Drawing Methods" +msgstr "绘图方法" + +#: ../../library/omv.image.rst:2755 +msgid "Sets all pixels in the image to zero (very fast)." +msgstr "将图像中的所有像素设置为零(非常快)。" + +#: ../../library/omv.image.rst:2757 ../../library/omv.image.rst:3124 +#: ../../library/omv.image.rst:3175 ../../library/omv.image.rst:3193 +#: ../../library/omv.image.rst:3211 ../../library/omv.image.rst:3229 +#: ../../library/omv.image.rst:3247 ../../library/omv.image.rst:3265 +#: ../../library/omv.image.rst:3445 ../../library/omv.image.rst:3466 +#: ../../library/omv.image.rst:3484 ../../library/omv.image.rst:3502 +#: ../../library/omv.image.rst:3520 ../../library/omv.image.rst:3543 +#: ../../library/omv.image.rst:3565 ../../library/omv.image.rst:3590 +#: ../../library/omv.image.rst:3612 ../../library/omv.image.rst:3626 +#: ../../library/omv.image.rst:3640 ../../library/omv.image.rst:3653 +#: ../../library/omv.image.rst:3664 ../../library/omv.image.rst:3685 +#: ../../library/omv.image.rst:3714 ../../library/omv.image.rst:3740 +#: ../../library/omv.image.rst:3767 ../../library/omv.image.rst:3803 +#: ../../library/omv.image.rst:3836 ../../library/omv.image.rst:3869 +#: ../../library/omv.image.rst:3899 +msgid "" +"``mask`` is another image to use as a pixel level mask for the operation." +" The mask should be an image with just black or white pixels and should " +"be the same size as the image being operated on. Only pixels set in the " +"mask are modified." +msgstr "" +"``mask`` " +"是另一个图像,用作像素级掩码以进行操作。掩码应该是一个只有黑色或白色像素的图像,应该与正在操作的图像大小相同。仅修改掩码中设置的像素。" + +#: ../../library/omv.image.rst:2768 +msgid "" +"Draws a line from (x0, y0) to (x1, y1) on the image. You may either pass " +"x0, y0, x1, y1 separately or as a tuple (x0, y0, x1, y1)." +msgstr "" +"在图像上从 (x0, y0) 到 (x1, y1) 绘制一条线。您可以分别传递 x0、y0、x1、y1,或作为元组 (x0, y0, x1, " +"y1) 传递。" + +#: ../../library/omv.image.rst:2771 ../../library/omv.image.rst:2786 +#: ../../library/omv.image.rst:2803 ../../library/omv.image.rst:2820 +#: ../../library/omv.image.rst:2840 ../../library/omv.image.rst:2880 +#: ../../library/omv.image.rst:2897 ../../library/omv.image.rst:2912 +#: ../../library/omv.image.rst:2996 ../../library/omv.image.rst:3021 +msgid "" +"``color`` is an RGB888 tuple for Grayscale or RGB565 images. Defaults to " +"white. However, you may also pass the underlying pixel value (0-255) for " +"grayscale images or a RGB565 value for RGB565 images." +msgstr "" +"``color`` 是 Grayscale 或 RGB565 图像的 RGB888 " +"元组。默认为白色。但是,您还可以传递灰度图像的底层像素值(0-255)或 RGB565 图像的 RGB565 值。" + +#: ../../library/omv.image.rst:2775 ../../library/omv.image.rst:2901 +#: ../../library/omv.image.rst:2918 ../../library/omv.image.rst:3002 +msgid "``thickness`` controls how thick the line is in pixels." +msgstr "``thickness`` 控制线的厚度(以像素为单位)。" + +#: ../../library/omv.image.rst:2779 ../../library/omv.image.rst:2796 +#: ../../library/omv.image.rst:2813 ../../library/omv.image.rst:2830 +#: ../../library/omv.image.rst:2873 ../../library/omv.image.rst:2890 +#: ../../library/omv.image.rst:2905 ../../library/omv.image.rst:2924 +#: ../../library/omv.image.rst:3008 ../../library/omv.image.rst:3038 +#: ../../library/omv.image.rst:3064 ../../library/omv.image.rst:3073 +#: ../../library/omv.image.rst:3082 ../../library/omv.image.rst:3152 +#: ../../library/omv.image.rst:3182 ../../library/omv.image.rst:3200 +#: ../../library/omv.image.rst:3218 ../../library/omv.image.rst:3236 +#: ../../library/omv.image.rst:3254 ../../library/omv.image.rst:3272 +#: ../../library/omv.image.rst:3426 ../../library/omv.image.rst:3452 +#: ../../library/omv.image.rst:3473 ../../library/omv.image.rst:3491 +#: ../../library/omv.image.rst:3509 ../../library/omv.image.rst:3527 +#: ../../library/omv.image.rst:3550 ../../library/omv.image.rst:3572 +#: ../../library/omv.image.rst:3919 ../../library/omv.image.rst:3932 +#: ../../library/omv.image.rst:3952 ../../library/omv.image.rst:3995 +#: ../../library/omv.image.rst:4137 ../../library/omv.image.rst:4201 +#: ../../library/omv.image.rst:4261 ../../library/omv.image.rst:4360 +#: ../../library/omv.image.rst:4394 ../../library/omv.image.rst:4641 +#: ../../library/omv.image.rst:4647 +msgid "Not supported on compressed images or bayer images." +msgstr "不支持压缩图像或 Bayer 图像。" + +#: ../../library/omv.image.rst:2783 +msgid "" +"Draws a rectangle on the image. You may either pass x, y, w, h separately" +" or as a tuple (x, y, w, h)." +msgstr "在图像上绘制一个矩形。您可以分别传递 x、y、w、h,或作为元组 (x、y、w、h) 传递。" + +#: ../../library/omv.image.rst:2790 +msgid "``thickness`` controls how thick the lines are in pixels." +msgstr "``thickness`` 控制线的厚度(以像素为单位)。" + +#: ../../library/omv.image.rst:2792 +msgid "Pass ``fill`` set to True to fill the rectangle." +msgstr "将 ``fill`` 设置为 True 以填充矩形。" + +#: ../../library/omv.image.rst:2800 +msgid "" +"Draws a circle on the image. You may either pass x, y, radius separately " +"or as a tuple (x, y, radius)." +msgstr "在图像上绘制一个圆。您可以分别传递 x、y、半径,或作为元组 (x、y、半径) 传递。" + +#: ../../library/omv.image.rst:2807 ../../library/omv.image.rst:2824 +#: ../../library/omv.image.rst:2886 +msgid "``thickness`` controls how thick the edges are in pixels." +msgstr "``thickness`` 控制边缘的粗细(以像素为单位)。" + +#: ../../library/omv.image.rst:2809 +msgid "Pass ``fill`` set to True to fill the circle." +msgstr "将 ``fill`` 设置为 True 以填充圆。" + +#: ../../library/omv.image.rst:2817 +msgid "" +"Draws an ellipse on the image. You may either pass cx, cy, rx, ry, and " +"the rotation (in degrees) separately or as a tuple (cx, yc, rx, ry, " +"rotation)." +msgstr "" +"在图像上绘制一个椭圆。您可以分别传递 cx、cy、rx、ry 和rotation(以度为单位),或作为元组 " +"(cx、cy、rx、ry、rotation) 传递。" + +#: ../../library/omv.image.rst:2826 +msgid "Pass ``fill`` set to True to fill the ellipse." +msgstr "将 ``fill`` 设置为 True 以填充椭圆。" + +#: ../../library/omv.image.rst:2834 +msgid "" +"Draws 8x10 text starting at location (x, y) in the image. You may either " +"pass x, y separately or as a tuple (x, y)." +msgstr "在图像中的位置 (x, y) 处绘制 8x10 文本。可以分别传递 x 和 y,也可以作为元组 (x, y) 传递。" + +#: ../../library/omv.image.rst:2837 +msgid "" +"``text`` is a string to write to the image. ``\\n``, ``\\r``, and " +"``\\r\\n`` line endings move the cursor to the next line." +msgstr "``text`` 是要写入图像的字符串。``\\n``、``\\r`` 和 ``\\r\\n`` 行结束符将光标移动到下一行。" + +#: ../../library/omv.image.rst:2844 +msgid "" +"``scale`` may be increased to increase/decrease the size of the text on " +"the image. You can pass greater than 0 integer or floating point values." +msgstr "可以增加 ``scale`` 来增加/减小图像上文本的大小。可以传递大于 0 的整数或浮点值。" + +#: ../../library/omv.image.rst:2847 +msgid "" +"``x_spacing`` allows you to add (if positive) or subtract (if negative) x" +" pixels between cahracters." +msgstr "``x_spacing`` 允许你在字符之间添加(如果为正值)或减去(如果为负值) x 个像素。" + +#: ../../library/omv.image.rst:2850 +msgid "" +"``y_spacing`` allows you to add (if positive) or subtract (if negative) y" +" pixels between cahracters (for multi-line text)." +msgstr "``y_spacing`` 允许你在字符之间添加(如果为正值)或减去(如果为负值) y 个像素(用于多行文本)。" + +#: ../../library/omv.image.rst:2853 +msgid "" +"``mono_space`` defaults to True which forces text to be fixed spaced. For" +" large text scales this looks terrible. Set the False to get non-fixed " +"width character spacing which looks A LOT better." +msgstr "" +"``mono_space`` 默认为 True,强制文本为固定间距。对于大文本比例,这看起来很糟糕。将其设置为 False " +"可以得到非固定宽度字符间距,效果要好得多。" + +#: ../../library/omv.image.rst:2857 +msgid "" +"``char_rotation`` may be 0, 90, 180, 270 to rotate each character in the " +"string by this amount." +msgstr "``char_rotation`` 可以是 0、90、180、270,以按此数量旋转字符串中的每个字符。" + +#: ../../library/omv.image.rst:2860 +msgid "" +"``char_hmirror`` if True horizontally mirrors all characters in the " +"string." +msgstr "``char_hmirror`` 如果为 True,则水平镜像字符串中的所有字符。" + +#: ../../library/omv.image.rst:2862 +msgid "``char_vflip`` if True vertically flips all characters in the string." +msgstr "``char_vflip`` 如果为 True,则垂直翻转字符串中的所有字符。" + +#: ../../library/omv.image.rst:2864 +msgid "" +"``string_rotation`` may be 0, 90, 180, 270 to rotate the string by this " +"amount." +msgstr "``string_rotation`` 可以是 0、90、180、270,以按此数量旋转字符串。" + +#: ../../library/omv.image.rst:2867 +msgid "``string_hmirror`` if True horizontally mirrors the string." +msgstr "``string_hmirror`` 如果为 True,则水平镜像字符串。" + +#: ../../library/omv.image.rst:2869 +msgid "``string_vflip`` if True vertically flips the string." +msgstr "``string_vflip`` 如果为 True,则垂直翻转字符串。" + +#: ../../library/omv.image.rst:2877 +msgid "" +"Draws a cross at location x, y. You may either pass x, y separately or as" +" a tuple (x, y)." +msgstr "在位置 x、y 处绘制十字。可以分别传递 x 和 y,也可以作为元组 (x, y) 传递。" + +#: ../../library/omv.image.rst:2884 +msgid "``size`` controls how long the lines of the cross extend." +msgstr "``size`` 控制十字的线条长度。" + +#: ../../library/omv.image.rst:2894 +msgid "" +"Draws an arrow from (x0, y0) to (x1, y1) on the image. You may either " +"pass x0, y0, x1, y1 separately or as a tuple (x0, y0, x1, y1)." +msgstr "" +"在图像上从 (x0, y0) 到 (x1, y1) 绘制箭头。可以分别传递 x0、y0、x1 和 y1,也可以作为元组 (x0, y0, x1, " +"y1) 传递。" + +#: ../../library/omv.image.rst:2909 +msgid "" +"Draws line edges between a corner list returned by methods like " +"`blob.corners`. Coners is a four valued tuple of two valued x/y tuples. " +"E.g. [(x1,y1),(x2,y2),(x3,y3),(x4,y4)]." +msgstr "" +"在由像 `blob.corners` 等方法返回的角点列表之间绘制线条边缘。角点是一个包含四个值的元组,每个值是一个包含 x/y " +"坐标的二元组。例如:[(x1, y1), (x2, y2), (x3, y3), (x4, y4)]。" + +#: ../../library/omv.image.rst:2916 +msgid "" +"``size`` if greater than 0 causes the corners to be drawn as circles of " +"radius ``size``." +msgstr "``size`` 如果大于 0,则会将角点绘制为半径为 ``size`` 的圆。" + +#: ../../library/omv.image.rst:2920 +msgid "Pass ``fill`` set to True to fill the corner circles if drawn." +msgstr "将 ``fill`` 设置为 True 以填充角点圆(如果绘制)。" + +#: ../../library/omv.image.rst:2928 +msgid "" +"Draws an ``image`` whose top-left corner starts at location x, y. You may" +" either pass x, y separately or as a tuple (x, y). This method " +"automatically handles rendering the image passed into the correct pixel " +"format for the destination image while also handling clipping seamlessly." +msgstr "绘制一个 ``image``,其左上角从位置 x, y 开始。可以单独传递 x, y 或作为元组 (x, y) 传递。此方法会自动将传入的图像渲染为目标图像的正确像素格式,同时无缝处理裁剪。" + +#: ../../library/omv.image.rst:2932 +msgid "" +"You may also pass a path instead of an image object for this method to " +"automatically load the image from disk and use it in one step. E.g. " +"``draw_image(\"test.jpg\")``." +msgstr "你也可以传递一个路径,而不是图像对象,这样该方法会自动从磁盘加载图像并一步到位地使用它。例如,``draw_image(\"test.jpg\")``。" + +#: ../../library/omv.image.rst:2982 ../../library/omv.image.rst:4069 +msgid "" +"`image.BLACK_BACKGROUND`: Assume the background image being drawn on is " +"black speeding up blending." +msgstr "`image.BLACK_BACKGROUND`: 假设正在绘制的目标图像背景为黑色,从而加速混合操作。" + +#: ../../library/omv.image.rst:2991 +msgid "" +"Draws the keypoints of a keypoints object on the image. You may also pass" +" a list of three value tuples containing the (x, y, " +"rotation_angle_in_degrees) to re-use this method for drawing keypoint " +"glyphs which are a cirle with a line pointing in a particular direction." +msgstr "在图像上绘制关键点对象的关键点。你还可以传递一个包含三元组的列表,每个三元组包含(x,y,旋转角度_单位为度),以便重用此方法绘制关键点符号,这些符号是一个圆圈,圆圈中有一条指向特定方向的线。" + +#: ../../library/omv.image.rst:3000 +msgid "``size`` controls how large the keypoints are." +msgstr "``size`` 控制关键点的大小。" + +#: ../../library/omv.image.rst:3004 +msgid "Pass ``fill`` set to True to fill the keypoints." +msgstr "设置 ``fill`` 为 True 以填充关键点。" + +#: ../../library/omv.image.rst:3012 +msgid "" +"Flood fills a region of the image starting from location x, y. You may " +"either pass x, y separately or as a tuple (x, y)." +msgstr "从位置 x、y 开始填充图像的一个区域。可以单独传递 x、y,也可以传递元组 (x, y)。" + +#: ../../library/omv.image.rst:3015 +msgid "" +"``seed_threshold`` controls how different any pixel in the fill area may " +"be from the original starting pixel." +msgstr "``seed_threshold`` 控制填充区域中的任何像素与原始起始像素的差异程度。" + +#: ../../library/omv.image.rst:3018 +msgid "" +"``floating_threshold`` controls how different any pixel in the fill area " +"may be from any neighbor pixels." +msgstr "``floating_threshold`` 控制填充区域中的任何像素与任何相邻像素的差异程度。" + +#: ../../library/omv.image.rst:3025 +msgid "" +"Pass ``invert`` as True to re-color everything outside of the flood-fill " +"connected area." +msgstr "设置 ``invert`` 为 True 以重新着色填充连接区域之外的所有内容。" + +#: ../../library/omv.image.rst:3028 +msgid "" +"Pass ``clear_background`` as True to zero the rest of the pixels that " +"flood-fill did not re-color." +msgstr "设置 ``clear_background`` 为 True 以将泛色填充未重新着色的其余像素设置为零。" + +#: ../../library/omv.image.rst:3031 +msgid "" +"``mask`` is another image to use as a pixel level mask for the operation." +" The mask should be an image with just black or white pixels and should " +"be the same size as the image being operated on. Only pixels set in the " +"mask are evaluated when flood filling." +msgstr "" +"``mask`` " +"是另一个图像,用作操作像素级掩码。掩码应该是一个只有黑色或白色像素的图像,大小应与正在操作的图像相同。只有在掩码中设置的像素在进行泛色填充时才会被评估。" + +#: ../../library/omv.image.rst:3040 ../../library/omv.image.rst:3921 +#: ../../library/omv.image.rst:3934 ../../library/omv.image.rst:3997 +#: ../../library/omv.image.rst:4396 ../../library/omv.image.rst:4416 +#: ../../library/omv.image.rst:4456 ../../library/omv.image.rst:4474 +#: ../../library/omv.image.rst:4494 ../../library/omv.image.rst:4551 +#: ../../library/omv.image.rst:4580 ../../library/omv.image.rst:4618 +#: ../../library/omv.image.rst:4649 ../../library/omv.image.rst:4789 +msgid "This method is not available on the OpenMV Cam M4." +msgstr "此方法在 OpenMV Cam M4 上不可用。" + +#: ../../library/omv.image.rst:3044 +msgid "" +"Draws an ndarray of events from the GENX320 camera module onto an " +"`Image`. The image buffer should be a 320x320 GRAYSCALE image." +msgstr "将 GENX320 摄像头模块的事件 ndarray 绘制到 `Image` 上。图像缓冲区应为 320x320 灰度图像。" + +#: ../../library/omv.image.rst:3047 +msgid "``clear`` if True zeros the image buffer before drawing on it." +msgstr "``clear`` 如果为 True,则在绘制之前将图像缓冲区清零。" + +#: ../../library/omv.image.rst:3049 +msgid "``brightness`` controls the default value of pixels to be cleared to." +msgstr "``brightness`` 控制像素被清除时的默认值。" + +#: ../../library/omv.image.rst:3051 +msgid "" +"``contrast`` controls how much to add/subtract from a pixel per event in " +"the ndarray of events (events can be positive or negative). Values are " +"clampped between 0-255." +msgstr "``contrast`` 控制每个事件对像素增加/减去的量(事件可以是正或负)。值被限制在 0-255 之间。" + +#: ../../library/omv.image.rst:3055 +msgid "Masking Methods" +msgstr "掩码方法" + +#: ../../library/omv.image.rst:3059 +msgid "" +"Zeros a rectangular part of the image. If no arguments are supplied this " +"method zeros the center of the image." +msgstr "将图像的矩形部分置零。如果未提供参数,则此方法将图像的中心置零。" + +#: ../../library/omv.image.rst:3068 +msgid "" +"Zeros a circular part of the image. If no arguments are supplied this " +"method zeros the center of the image." +msgstr "将图像的圆形部分置零。如果未提供参数,则此方法将图像的中心置零。" + +#: ../../library/omv.image.rst:3077 +msgid "" +"Zeros an ellipsed shaped part of the image. If no arguments are supplied " +"this method zeros the center of the image." +msgstr "将图像的椭圆形状部分置零。如果未提供参数,则此方法将图像的中心置零。" + +#: ../../library/omv.image.rst:3085 +msgid "Binary Methods" +msgstr "二值方法" + +#: ../../library/omv.image.rst:3089 +msgid "" +"Sets all pixels in the image to black or white depending on if the pixel " +"is inside of a threshold in the threshold list ``thresholds`` or not." +msgstr "根据像素是否在阈值列表 ``thresholds`` 范围内,将图像中的所有像素设置为黑色或白色。" + +#: ../../library/omv.image.rst:3092 ../../library/omv.image.rst:4087 +#: ../../library/omv.image.rst:4149 ../../library/omv.image.rst:4218 +msgid "" +"``thresholds`` must be a list of tuples ``[(lo, hi), (lo, hi), ..., (lo, " +"hi)]`` defining the ranges of color you want to track. For grayscale " +"images each tuple needs to contain two values - a min grayscale value and" +" a max grayscale value. Only pixel regions that fall between these " +"thresholds will be considered. For RGB565 images each tuple needs to have" +" six values (l_lo, l_hi, a_lo, a_hi, b_lo, b_hi) - which are minimums and" +" maximums for the LAB L, A, and B channels respectively. For easy usage " +"this function will automatically fix swapped min and max values. " +"Additionally, if a tuple is larger than six values the rest are ignored. " +"Conversely, if the tuple is too short the rest of the thresholds are " +"assumed to be at maximum range." +msgstr "" +"``thresholds`` 必须是包含元组的列表 ``[(lo, hi), (lo, hi), ..., (lo, " +"hi)]``,定义您要跟踪的颜色范围。对于灰度图像,每个元组都需要包含两个值 - " +"最小灰度值和最大灰度值。仅将处于这些阈值之间的像素区域视为符合条件。对于 RGB565 " +"图像,每个元组需要有六个值(l_lo、l_hi、a_lo、a_hi、b_lo、b_hi) - 分别是 LAB L、A 和 B " +"通道的最小值和最大值。为了简化使用,此函数将自动修复颠倒的最小值和最大值。此外,如果元组的长度大于六个值,则其余部分将被忽略。反之,如果元组太短,则其余的阈值被假定为在最大范围内。" + +#: ../../library/omv.image.rst:3105 ../../library/omv.image.rst:4102 +#: ../../library/omv.image.rst:4164 ../../library/omv.image.rst:4233 +#: ../../library/omv.image.rst:4287 +msgid "" +"To get the thresholds for the object you want to track just select (click" +" and drag) on the object you want to track in the IDE frame buffer. The " +"histogram will then update to just be in that area. Then just write down " +"where the color distribution starts and falls off in each histogram " +"channel. These will be your low and high values for ``thresholds``. It's " +"best to manually determine the thresholds versus using the upper and " +"lower quartile statistics because they are too tight." +msgstr "" +"要获取要跟踪的对象的阈值,请在 IDE " +"帧缓冲区中选择(单击并拖动)要跟踪的对象。然后,直方图将更新为仅位于该区域中。然后,只需写下直方图通道中颜色分布开始和结束的位置。这些将是您的 " +"``thresholds`` 的低值和高值。最好手动确定阈值,而不是使用上四分位数统计数据,因为它们太紧密了。" + +#: ../../library/omv.image.rst:3113 ../../library/omv.image.rst:4110 +#: ../../library/omv.image.rst:4172 ../../library/omv.image.rst:4241 +#: ../../library/omv.image.rst:4295 +msgid "" +"You may also determine color thresholds by going into ``Tools->Machine " +"Vision->Threshold Editor`` in OpenMV IDE and selecting thresholds from " +"the GUI slider window." +msgstr "" +"您还可以通过进入 OpenMV IDE 中的 ``Tools->Machine Vision->Threshold Editor`` 并从 GUI" +" 滑块窗口中选择阈值来确定颜色阈值。" + +#: ../../library/omv.image.rst:3117 ../../library/omv.image.rst:4114 +#: ../../library/omv.image.rst:4176 ../../library/omv.image.rst:4245 +#: ../../library/omv.image.rst:4299 +msgid "" +"``invert`` inverts the thresholding operation such that instead of " +"matching pixels inside of some known color bounds pixels are matched that" +" are outside of the known color bounds." +msgstr "``invert`` 反转阈值操作,使得匹配像素不是在某些已知颜色范围内,而是在已知颜色范围之外。" + +#: ../../library/omv.image.rst:3121 +msgid "" +"Set ``zero`` to True to instead zero thresholded pixels and leave pixels " +"not in the threshold list untouched." +msgstr "将 ``zero`` 设置为 True,以零化阈值像素,并保持不在阈值列表中的像素不变。" + +#: ../../library/omv.image.rst:3129 +msgid "" +"``to_bitmap`` turns the image data into a binary bitmap image where each " +"pixel is stored in 1 bit. For very small images the new bitmap image may " +"not fit inside of the original image requiring an out-of-place operation " +"using ``copy``." +msgstr "" +"``to_bitmap`` 将图像数据转换为二进制位图图像,其中每个像素都以 1 " +"位存储。对于非常小的图像,新的位图图像可能无法适应原始图像,需要使用 ``copy`` 进行out-of-place 操作。" + +#: ../../library/omv.image.rst:3134 +msgid "" +"``copy`` if True creates a copy of the binarized image on the heap versus" +" modifying the source image." +msgstr "``copy`` 如果为True,则在堆上创建二值化图像的副本,而不是修改源图像。" + +#: ../../library/omv.image.rst:3156 ../../library/omv.image.rst:3374 +msgid "" +"Flips (binary inverts) all pixels values in the image. Note that binary " +"inversion is the same as numerical inversion for images because:" +msgstr "翻转(对二进制图像进行反转)图像中的所有像素值。请注意,二进制反转对于图像来说与数值反转是相同的,因为:" + +#: ../../library/omv.image.rst:3159 ../../library/omv.image.rst:3377 +msgid "" +"``(255 - pixel) % 256 == (255 + ~pixel + 1) % 256 == (~pixel + 256) % 256" +" == ~pixel`` and this holds for any value that's in a range of " +"``(0-2^n-1)`` which is true for all mutable image datatypes." +msgstr "" +"``(255 - pixel) % 256 == (255 + ~pixel + 1) % 256 == (~pixel + 256) % 256" +" == ~pixel``,并且这个关系对任何在 ``(0-2^n-1)`` 范围内的值成立,而这个范围对于所有可变图像数据类型都是适用的。" + +#: ../../library/omv.image.rst:3164 ../../library/omv.image.rst:3317 +#: ../../library/omv.image.rst:3382 ../../library/omv.image.rst:3597 +#: ../../library/omv.image.rst:3619 ../../library/omv.image.rst:3633 +#: ../../library/omv.image.rst:3647 ../../library/omv.image.rst:3658 +#: ../../library/omv.image.rst:3669 ../../library/omv.image.rst:3692 +#: ../../library/omv.image.rst:3721 ../../library/omv.image.rst:3747 +#: ../../library/omv.image.rst:3774 ../../library/omv.image.rst:3810 +#: ../../library/omv.image.rst:3843 ../../library/omv.image.rst:3876 +#: ../../library/omv.image.rst:3906 +msgid "Not supported on compressed images or bayer/yuv images." +msgstr "不支持压缩图像或 Bayer/YUV 图像。" + +#: ../../library/omv.image.rst:3168 +msgid "Logically ANDs this image with another image." +msgstr "将此图像与另一个图像进行逻辑与(AND)运算。" + +#: ../../library/omv.image.rst:3170 ../../library/omv.image.rst:3188 +#: ../../library/omv.image.rst:3206 ../../library/omv.image.rst:3224 +#: ../../library/omv.image.rst:3242 ../../library/omv.image.rst:3260 +#: ../../library/omv.image.rst:3440 ../../library/omv.image.rst:3458 +#: ../../library/omv.image.rst:3479 ../../library/omv.image.rst:3497 +#: ../../library/omv.image.rst:3515 ../../library/omv.image.rst:3533 +msgid "" +"``image`` can either be an image object, a path to an uncompressed image " +"file (bmp/pgm/ppm), or a scalar value. If a scalar value the value can " +"either be an RGB888 tuple or the underlying pixel value (e.g. an 8-bit " +"grayscale for grayscale images or a RGB565 value for RGB images)." +msgstr "``image`` 可以是图像对象、未压缩图像文件的路径(bmp/pgm/ppm)或标量值。如果是标量值,可以是 RGB888 元组或底层像素值(例如灰度图像的 8 位灰度值或 RGB 图像的 RGB565 值)。" + +#: ../../library/omv.image.rst:3186 +msgid "Logically NANDs this image with another image." +msgstr "将此图像与另一个图像进行逻辑与非(NAND)运算。" + +#: ../../library/omv.image.rst:3204 +msgid "Logically ORs this image with another image." +msgstr "将此图像与另一个图像进行逻辑或(OR)运算。" + +#: ../../library/omv.image.rst:3222 +msgid "Logically NORs this image with another image." +msgstr "将此图像与另一个图像进行逻辑或非(NOR)运算。" + +#: ../../library/omv.image.rst:3240 +msgid "Logically XORs this image with another image." +msgstr "将此图像与另一个图像进行逻辑异或(XOR)运算。" + +#: ../../library/omv.image.rst:3258 +msgid "Logically XNORs this image with another image." +msgstr "将此图像与另一个图像进行逻辑同或(XNOR)运算。" + +#: ../../library/omv.image.rst:3275 +msgid "ISP Methods" +msgstr "ISP方法" + +#: ../../library/omv.image.rst:3279 +msgid "" +"Performs automatic white balance on the image using the gray-world " +"algorithm. This method operates on RAW Bayer Images so that you can " +"improve image quality before converting to RGB565 or passing the RAW " +"Bayer Image to an image processing funciton. You may also call this on a " +"RGB565. This method has no affect on binary/grayscale images." +msgstr "" +"使用灰世界算法对图像执行自动白平衡。此方法作用于RAW Bayer图像,因此可以在将图像转换为RGB565或将RAW " +"Bayer图像传递给图像处理函数之前提高图像质量。你也可以在RGB565图像上调用此方法。此方法对二值图像或灰度图像没有任何影响。" + +#: ../../library/omv.image.rst:3284 +msgid "``max`` if True uses the white-patch algorithm instead." +msgstr "如果 ``max`` 为 True,则使用白补丁算法。" + +#: ../../library/omv.image.rst:3288 +msgid "Not supported on compressed or yuv images." +msgstr "不支持压缩图像或YUV图像。" + +#: ../../library/omv.image.rst:3292 +msgid "" +"Multiples the passed floating-point color-correction-matrix with the " +"image. Matrices may be in the form of::" +msgstr "将传递的浮点色彩校正矩阵与图像相乘。矩阵可以是以下形式之一:" + +#: ../../library/omv.image.rst:3302 +msgid "The CCM Method does::" +msgstr "CCM 方法为::" + +#: ../../library/omv.image.rst:3309 +msgid "" +"Note that the sum of each row in the 3x3 matrix should generally be -1, " +"+1, or 0. Weights may either be positive or negative." +msgstr "请注意,3x3 矩阵中每行的总和通常应为 -1、+1 或 0。权重可以是正数或负数。" + +#: ../../library/omv.image.rst:3312 +msgid "" +"You may want to use this method to eliminate systemic cross talk between " +"color channels. Or alternatively, to do color correction on the whole " +"image." +msgstr "您可能希望使用此方法消除颜色通道之间的系统性串扰。或者,对整个图像进行颜色校正。" + +#: ../../library/omv.image.rst:3321 ../../library/omv.image.rst:3344 +msgid "Quickly changes the image gamma, contrast, and brightness." +msgstr "快速更改图像的 gamma、对比度和亮度。" + +#: ../../library/omv.image.rst:3323 +msgid "" +"``gamma`` with values greater than 1.0 makes the image brighter in a non-" +"linear manner while less than 1.0 makes the image darker. The gamma value" +" is applied to the image by scaling all pixel color channels to be " +"between [0:1) and then doing a remapping of ``pow(pixel, 1/gamma)`` on " +"all pixels before scaling back." +msgstr "" +"``gamma`` 大于 1.0 的值使图像以非线性方式变亮,而小于 1.0 的值使图像变暗。将 gamma " +"值应用于图像,将所有像素颜色通道缩放到 [0:1) 并在缩放回来之前对所有像素执行 ``pow(pixel, 1/gamma)`` 的重映射。" + +#: ../../library/omv.image.rst:3328 ../../library/omv.image.rst:3351 +msgid "" +"``contrast`` with values greater than 1.0 makes the image brighter in a " +"linear manner while less than 1.0 makes the image darker. The contrast " +"value is applied to the image by scaling all pixel color channels to be " +"between [0:1) and then doing a remapping of ``pixel * contrast`` on all " +"pixels before scaling back." +msgstr "" +"``contrast`` 大于 1.0 的值使图像以线性方式变亮,而小于 1.0 的值使图像变暗。将对比度值应用于图像,将所有像素颜色通道缩放到 " +"[0:1) 并在缩放回来之前对所有像素执行 ``pixel * contrast`` 的重映射。" + +#: ../../library/omv.image.rst:3333 ../../library/omv.image.rst:3356 +msgid "" +"``brightness`` with values greater than 0.0 makes the image brighter in a" +" constant manner while less than 0.0 makes the image darker. The " +"brightness value is applied to the image by scaling all pixel color " +"channels to be between [0:1) and then doing a remapping of ``pixel + " +"brightness`` on all pixels before scaling back." +msgstr "" +"``brightness`` 大于 0.0 的值以恒定方式使图像变亮,而小于 0.0 的值使图像变暗。将亮度值应用于图像,将所有像素颜色通道缩放到" +" [0:1) 并在缩放回来之前对所有像素执行 ``pixel + brightness`` 的重映射。" + +#: ../../library/omv.image.rst:3340 ../../library/omv.image.rst:3363 +msgid "Not supported on compressed or bayer/yuv images." +msgstr "不支持压缩图像或Bayer/YUV图像。" + +#: ../../library/omv.image.rst:3346 +msgid "" +"``gamma`` with values greater than 1.0 makes the image darker in a non-" +"linear manner while less than 1.0 makes the image brighter. The gamma " +"value is applied to the image by scaling all pixel color channels to be " +"between [0:1) and then doing a remapping of ``pow(pixel, 1/gamma)`` on " +"all pixels before scaling back." +msgstr "" +"``gamma`` 大于 1.0 的值使图像以非线性方式变暗,而小于 1.0 的值使图像变亮。将 gamma " +"值应用于图像,将所有像素颜色通道缩放到 [0:1) 并在缩放回来之前对所有像素执行 ``pow(pixel, 1/gamma)`` 的重映射。" + +#: ../../library/omv.image.rst:3367 +msgid "`Image.gamma_corr` is an alias for `Image.gamma`." +msgstr "`Image.gamma_corr` 是 `Image.gamma` 的别名。" + +#: ../../library/omv.image.rst:3370 +msgid "Math Methods" +msgstr "数学方法" + +#: ../../library/omv.image.rst:3386 +msgid "`Image.negate` is an alias for `Image.invert`." +msgstr "`Image.negate` 是 `Image.invert` 的别名。" + +#: ../../library/omv.image.rst:3390 +msgid "Replaces all pixels in the image object with a new image." +msgstr "用新图像替换图像对象中的所有像素。" + +#: ../../library/omv.image.rst:3392 +msgid "" +"``image`` can either be another image object, a path to an uncompressed " +"image file (bmp/pgm/ppm), or a scalar value. If a scalar value the value " +"can either be an RGB888 tuple or the underlying pixel value (e.g. an " +"8-bit grayscale for grayscale images or a RGB565 value for RGB images)." +msgstr "``image`` 可以是另一个图像对象、未压缩图像文件的路径(bmp/pgm/ppm)或标量值。如果是标量值,可以是 RGB888 元组或底层像素值(例如灰度图像的 8 位灰度值或 RGB 图像的 RGB565 值)。" + +#: ../../library/omv.image.rst:3397 +msgid "Set ``hmirror`` to True to horizontally mirror the replacing image." +msgstr "设置 ``hmirror`` 为 True 以水平镜像替换的图像。" + +#: ../../library/omv.image.rst:3399 +msgid "Set ``vflip`` to True to vertically flip the replacing image." +msgstr "设置 ``vflip`` 为 True 以垂直翻转替换的图像。" + +#: ../../library/omv.image.rst:3401 +msgid "" +"Set ``transpose`` to True to flip the image along the diagonal (this " +"changes the image image width/height if the image is non-square)." +msgstr "设置 ``transpose`` 为 True 以沿对角线翻转图像(如果图像不是正方形,这将改变图像的宽度/高度)。" + +#: ../../library/omv.image.rst:3404 +msgid "" +"If you want to rotate an image by multiples of 90 degrees pass the " +"following:" +msgstr "如果要将图像旋转 90 度的倍数,请传递以下参数:" + +#: ../../library/omv.image.rst:3406 +msgid "vflip=False, hmirror=False, transpose=False -> 0 degree rotation" +msgstr "vflip=False, hmirror=False, transpose=False -> 旋转 0 度" + +#: ../../library/omv.image.rst:3407 +msgid "vflip=True, hmirror=False, transpose=True -> 90 degree rotation" +msgstr "vflip=True, hmirror=False, transpose=True -> 旋转 90 度" + +#: ../../library/omv.image.rst:3408 +msgid "vflip=True, hmirror=True, transpose=False -> 180 degree rotation" +msgstr "vflip=True, hmirror=True, transpose=False -> 旋转 180 度" + +#: ../../library/omv.image.rst:3409 +msgid "vflip=False, hmirror=True, transpose=True -> 270 degree rotation" +msgstr "vflip=False, hmirror=True, transpose=True -> 旋转 270 度" + +#: ../../library/omv.image.rst:3413 +msgid "" +"If you don't pass an ``image`` this method will operate on the underlying" +" image that you were going to replace by applying the ``hmirror``, " +"``vflip``, and ``transpose`` options to rotate the image around. E.g. if " +"you want to do ``img.replace(img, etc...)`` you just need to do " +"``img.replace(etc..)``." +msgstr "" +"如果不传递 ``image``,此方法将通过应用 ``hmirror``、``vflip`` 和 ``transpose`` " +"选项对底层图像本身进行旋转操作。例如,如果你想执行 ``img.replace(img, etc...)``," +"只需执行 ``img.replace(etc..)`` 即可。" + +#: ../../library/omv.image.rst:3418 +msgid "" +"``mask`` is another image to use as a pixel level mask for the operation." +" The mask should be an image with just black or white pixels and should " +"be the same size as the image being operated on. Only pixels set in the " +"mask are modified. Note that the mask is applied on the image before " +"hmirror/vflip/transpose so the mask should be the same width/height of " +"the initial unmodifed image." +msgstr "" +"``mask`` " +"是另一个图像,用作操作的像素级掩码。掩码应该是一个只有黑色或白色像素的图像,大小应与正在操作的图像相同。只有掩码中设置的像素才会被修改。请注意,掩码是在" +" hmirror/vflip/transpose 之前应用于图像的,因此掩码的宽度/高度应与初始未修改的图像相同。" + +#: ../../library/omv.image.rst:3430 ../../library/omv.image.rst:3434 +msgid "Alias for `Image.replace`." +msgstr "`Image.replace` 的别名。" + +#: ../../library/omv.image.rst:3438 +msgid "Adds an image pixel-wise to this one." +msgstr "将一个图像逐像素地加到此图像上。" + +#: ../../library/omv.image.rst:3456 +msgid "Subtracts an image pixel-wise to this one." +msgstr "将一个图像逐像素地从此图像中减去。" + +#: ../../library/omv.image.rst:3463 +msgid "" +"Set ``reverse`` to True to reverse the subtraction operation from " +"``this_image-image`` to ``image-this_image``." +msgstr "设置 ``reverse`` 为 True 可将减法运算从 ``this_image-image`` 反转为 ``image-this_image``。" + +#: ../../library/omv.image.rst:3477 +msgid "Returns the minimum image of two images pixel-wise." +msgstr "逐像素返回两个图像的最小值图像。" + +#: ../../library/omv.image.rst:3495 +msgid "Returns the maximum image of two images pixel-wise." +msgstr "逐像素返回两个图像的最大值图像。" + +#: ../../library/omv.image.rst:3513 +msgid "Returns the absolute difference image between two images (e.g. ||a-b||)." +msgstr "返回两个图像之间的绝对差值图像(例如 ||a-b||)。" + +#: ../../library/omv.image.rst:3531 +msgid "Alpha blends two images with each other." +msgstr "将两个图像进行 Alpha 混合。" + +#: ../../library/omv.image.rst:3538 +msgid "" +"``alpha`` controls how much of the other image to blend into this image. " +"``alpha`` should be an integer value between 0 and 256. A value closer to" +" zero blends more of the other image into this image and a value closer " +"to 256 does the opposite." +msgstr "``alpha`` 控制将另一个图像混合到此图像中的程度。``alpha`` 应为 0 到 256 之间的整数值。接近零的值会将更多的另一个图像混合到此图像中,接近 256 的值则相反。" + +#: ../../library/omv.image.rst:3554 +msgid "" +"Runs the histogram equalization algorithm on the image. Histogram " +"equalization normalizes the contrast and brightness in the image." +msgstr "在图像上运行直方图均衡算法。直方图均衡将图像中的对比度和亮度标准化。" + +#: ../../library/omv.image.rst:3557 +msgid "" +"If you pass ``adaptive`` as True then an adaptive histogram equalization " +"method will be run on the image instead which as generally better results" +" than non-adaptive histogram qualization but a longer run time." +msgstr "" +"如果将 ``adaptive`` 设置为 " +"True,则会在图像上运行自适应直方图均衡方法,其结果通常比非自适应直方图均衡具有更好的结果,但运行时间较长。" + +#: ../../library/omv.image.rst:3561 +msgid "" +"``clip_limit`` provides a way to limit the contrast of the adaptive " +"histogram qualization. Use a small value for this, like 10, to produce " +"good histogram equalized contrast limited images." +msgstr "``clip_limit`` 提供了一种限制自适应直方图均衡的对比度的方法。使用一个较小的值,如 10,可以产生对比度限制良好的直方图均衡的图像。" + +#: ../../library/omv.image.rst:3575 +msgid "Filtering Methods" +msgstr "滤波方法" + +#: ../../library/omv.image.rst:3579 +msgid "Removes pixels from the edges of segmented areas." +msgstr "移除分段区域的边缘像素。" + +#: ../../library/omv.image.rst:3581 +msgid "" +"This method works by convolving a kernel of ``((size*2)+1)x((size*2)+1)``" +" pixels across the image and zeroing the center pixel of the kernel if " +"the sum of the neighbour pixels clear is greater than ``threshold``." +msgstr "" +"此方法通过对图像进行卷积,使用一个大小为 ``((size*2)+1) x ((size*2)+1)`` 的内核,并在相邻像素的和大于 " +"``threshold`` 时,将内核的中心像素置为零。" + +#: ../../library/omv.image.rst:3585 +msgid "" +"This method works like the standard erode method if threshold is not set." +" If ``threshold`` is set then you can specify erode to only erode pixels " +"that have, for example, more than 2 pixels clear in the kernel region " +"with a threshold of 2." +msgstr "" +"如果没有设置 ``threshold`` ,此方法的工作方式与标准的腐蚀(erode)方法相同。如果设置了 ``threshold`` " +",则可以指定仅对内核区域中清晰像素超过指定数量的像素进行腐蚀,例如,当内核区域中有超过2个清晰像素且阈值为2时,才执行腐蚀操作。" + +#: ../../library/omv.image.rst:3601 +msgid "Adds pixels to the edges of segmented areas." +msgstr "在分段区域的边缘添加像素。" + +#: ../../library/omv.image.rst:3603 +msgid "" +"This method works by convolving a kernel of ``((size*2)+1)x((size*2)+1)``" +" pixels across the image and setting the center pixel of the kernel if " +"the sum of the neighbour pixels set is greater than ``threshold``." +msgstr "" +"此方法通过对图像进行卷积,使用一个大小为 ``((size*2)+1) x ((size*2)+1)`` 的内核,并在相邻像素的和大于 " +"``threshold`` 时,将内核的中心像素设置为1(或“激活”)。" + +#: ../../library/omv.image.rst:3607 +msgid "" +"This method works like the standard dilate method if threshold is not " +"set. If ``threshold`` is set then you can specify dilate to only dilate " +"pixels that have, for example, more than 2 pixels set in the kernel " +"region with a threshold of 2." +msgstr "" +"如果没有设置 ``threshold`` ,此方法的工作方式与标准的膨胀(dilate)方法相同。如果设置了 ``threshold`` " +",则可以指定仅对内核区域中有超过指定数量已激活像素的像素进行膨胀操作。例如,当内核区域中有超过2个激活像素,且阈值为2时,才执行膨胀操作。" + +#: ../../library/omv.image.rst:3623 +msgid "" +"Performs erosion and dilation on an image in order. Please see " +"`Image.erode()` and `Image.dilate()` for more information." +msgstr "依次执行图像上的腐蚀和膨胀。有关更多信息,请参阅 `Image.erode()` 和 `Image.dilate()`。" + +#: ../../library/omv.image.rst:3637 +msgid "" +"Performs dilation and erosion on an image in order. Please see " +"`Image.dilate()` and `Image.erode()` for more information." +msgstr "依次执行图像上的膨胀和腐蚀。有关更多信息,请参阅 `Image.dilate()` 和 `Image.erode()`。" + +#: ../../library/omv.image.rst:3651 +msgid "Returns the image difference of the image and `Image.open()`'ed image." +msgstr "返回图像与 `Image.open()` 的图像之间的差异。" + +#: ../../library/omv.image.rst:3662 +msgid "Returns the image difference of the image and `Image.close()`'ed image." +msgstr "返回图像与 `Image.close()` 的图像之间的差异。" + +#: ../../library/omv.image.rst:3673 +msgid "Standard mean blurring filter using a box filter." +msgstr "使用框滤波器进行标准均值模糊滤波。" + +#: ../../library/omv.image.rst:3675 ../../library/omv.image.rst:3699 +#: ../../library/omv.image.rst:3730 ../../library/omv.image.rst:3754 +#: ../../library/omv.image.rst:3816 ../../library/omv.image.rst:3849 +#: ../../library/omv.image.rst:3883 +msgid "``size`` is the kernel size. Use 1 (3x3 kernel), 2 (5x5 kernel), etc." +msgstr "``size`` 是内核大小。使用 1 (3x3 内核),2 (5x5 内核),等等。" + +#: ../../library/omv.image.rst:3677 ../../library/omv.image.rst:3706 +#: ../../library/omv.image.rst:3732 ../../library/omv.image.rst:3759 +#: ../../library/omv.image.rst:3795 ../../library/omv.image.rst:3828 +#: ../../library/omv.image.rst:3861 ../../library/omv.image.rst:3891 +msgid "" +"If you'd like to adaptive threshold the image on the output of the filter" +" you can pass ``threshold=True`` which will enable adaptive thresholding " +"of the image which sets pixels to one or zero based on a pixel's " +"brightness in relation to the brightness of the kernel of pixels around " +"them. A negative ``offset`` value sets more pixels to 1 as you make it " +"more negative while a positive value only sets the sharpest contrast " +"changes to 1. Set ``invert`` to invert the binary image resulting output." +msgstr "" +"如果您想要在滤波器输出端对图像自适应阈值处理,您可以传递 " +"``threshold=True``,这将启用自适应阈值化,根据像素的亮度与周围像素的内核亮度之间的关系将像素设置为一或零。负 " +"``offset`` 值会随着您将其设置为负值而将更多像素设置为 1,而正值仅将最锐利的对比度变化设置为 1。设置 ``invert`` " +"以反转二值图像的输出结果。" + +#: ../../library/omv.image.rst:3696 +msgid "" +"Runs the median filter on the image. The median filter is the best filter" +" for smoothing surfaces while preserving edges but it is very slow." +msgstr "在图像上运行中值滤波器。中值滤波器是平滑表面同时保持边缘的最佳滤波器,但速度很慢。" + +#: ../../library/omv.image.rst:3701 +msgid "" +"``percentile`` controls the percentile of the value used in the kernel. " +"By default each pixel is replaced with the 50th percentile (center) of " +"its neighbors. You can set this to 0 for a min filter, 0.25 for a lower " +"quartile filter, 0.75 for an upper quartile filter, and 1.0 for a max " +"filter." +msgstr "" +"``percentile`` 控制内核中使用的值的百分位数。默认情况下,每个像素将替换为其邻居的第 50个 百分位数(中心)。您可以将此设置为 0" +" 进行最小值滤波器,0.25 进行下四分位数滤波器,0.75 进行上四分位数滤波器,以及 1.0 进行最大值滤波器。" + +#: ../../library/omv.image.rst:3725 +msgid "" +"Runs the mode filter on the image by replacing each pixel with the mode " +"of their neighbors. This method works great on grayscale images. However," +" on RGB images it creates a lot of artifacts on edges because of the non-" +"linear nature of the operation." +msgstr "" +"通过将每个像素替换为其邻居的模式来运行模式滤波器。该方法在灰度图像上效果很好。但是,在 RGB " +"图像上,由于操作的非线性特性,它在边缘上产生许多伪影。" + +#: ../../library/omv.image.rst:3751 +msgid "" +"Runs the midpoint filter on the image. This filter finds the midpoint " +"((max-min)/2) of each pixel neighborhood in the image." +msgstr "在图像上运行中点滤波器。该滤波器在图像中的每个像素邻域中找到中点((max-min)/2)。" + +#: ../../library/omv.image.rst:3756 +msgid "" +"``bias`` controls the min/max mixing. 0 for min filtering only, 1.0 for " +"max filtering only. By using the ``bias`` you can min/max filter the " +"image." +msgstr "``bias`` 控制最小/最大混合。0 仅用于最小滤波,1.0 仅用于最大滤波。通过使用 ``bias`` 您可以对图像进行最小/最大滤波。" + +#: ../../library/omv.image.rst:3778 +msgid "" +"Convolves the image by a filter kernel. This allows you to do general " +"purpose convolutions on an image." +msgstr "使用滤波器内核对图像进行卷积。这允许您在图像上进行常规用途的卷积。" + +#: ../../library/omv.image.rst:3781 +msgid "" +"``size`` controls the size of the kernel which must be " +"``((size*2)+1)x((size*2)+1)`` elements big." +msgstr "``size`` 控制内核的大小,内核的尺寸必须为 ``((size*2)+1) x ((size*2)+1)`` 元素。" + +#: ../../library/omv.image.rst:3784 +msgid "" +"``kernel`` is the kernel to convolve the image by. The kernel can either " +"be a 1D tuple or list or a 2D tuple or list. For 1D kernels the " +"tuple/list must be ``((size*2)+1)x((size*2)+1)`` elements big. For 2D " +"tuples/lists each row must be ``((size*2)+1)`` elements big and there " +"must be ``((size*2)+1)`` rows." +msgstr "" +"``kernel`` 是用于卷积图像的内核。内核可以是 1D 元组或列表,也可以是 2D 元组或列表。对于 1D 内核,元组/列表的大小必须为 " +"``((size*2)+1) x ((size*2)+1)`` 元素。对于 2D 元组/列表,每行必须有 ``((size*2)+1)`` " +"个元素,并且必须有 ``((size*2)+1)`` 行。" + +#: ../../library/omv.image.rst:3789 ../../library/omv.image.rst:3822 +#: ../../library/omv.image.rst:3855 +msgid "" +"``mul`` allows you to do a global contrast adjustment. It's value should " +"be greater than 0.0. The default value is 1.0 which does nothing." +msgstr "``mul`` 允许你进行全局对比度调整。它的值应该大于 0.0。默认值为 1.0,表示不做任何调整。" + +#: ../../library/omv.image.rst:3792 ../../library/omv.image.rst:3825 +#: ../../library/omv.image.rst:3858 +msgid "" +"``add`` allows you to do a global brightness adjustment. It's value " +"should be between 0.0 and 1.0. The default value is 0.0 which does " +"nothing." +msgstr "``add`` 允许你进行全局亮度调整。它的值应该在 0.0 到 1.0 之间。默认值为 0.0,表示不做任何调整。" + +#: ../../library/omv.image.rst:3814 +msgid "Convolves the image by a smoothing guassian kernel." +msgstr "使用平滑的高斯内核对图像进行卷积。" + +#: ../../library/omv.image.rst:3818 +msgid "" +"If ``unsharp`` is set to the True then instead of doing just a guassian " +"filtering operation this method will perform an unsharp mask operation " +"which improves image sharpness on edges." +msgstr "" +"如果 ``unsharp`` 设置为True,则此方法不仅执行高斯滤波操作,还会执行反锐化掩模(unsharp " +"mask)操作,从而增强图像边缘的锐度。" + +#: ../../library/omv.image.rst:3847 +msgid "Convolves the image by a edge detecting laplacian kernel." +msgstr "使用边缘检测拉普拉斯内核对图像进行卷积。" + +#: ../../library/omv.image.rst:3851 +msgid "" +"If ``sharpen`` is set to the True then instead of just outputting an " +"unthresholded edge detection image this method will instead sharpen the " +"image. Increase the kernel size then to increase the image sharpness." +msgstr "如果 ``sharpen`` 设置为 True,则不仅会输出未经阈值处理的边缘检测图像,而是会使图像变锐。增加内核大小可以增加图像锐度。" + +#: ../../library/omv.image.rst:3880 +msgid "" +"Convolves the image by a bilateral filter. The bilateral filter smooths " +"the image while keeping edges in the image." +msgstr "使用双边滤波器对图像进行卷积。双边滤波器平滑图像同时保持图像中的边缘。" + +#: ../../library/omv.image.rst:3885 +msgid "" +"``color_sigma`` controls how closely colors are matched using the " +"bilateral filter. Increase this to increase color blurring." +msgstr "``color_sigma`` 控制使用双边滤波器时颜色匹配的紧密程度。增加此值可增加颜色模糊。" + +#: ../../library/omv.image.rst:3888 +msgid "" +"``space_sigma`` controls how closely pixels space-wise are blurred with " +"each other. Increase this to increase pixel blurring." +msgstr "``space_sigma`` 控制像素空间之间模糊程度。增加此值可增加像素模糊。" + +#: ../../library/omv.image.rst:3909 +msgid "Geometric Methods" +msgstr "几何方法" + +#: ../../library/omv.image.rst:3913 +msgid "" +"Re-project's and image from cartessian coordinates to linear polar " +"coordinates." +msgstr "将图像从笛卡尔坐标重新投影到线性极坐标。" + +#: ../../library/omv.image.rst:3915 ../../library/omv.image.rst:3927 +msgid "Set ``reverse=True`` to re-project in the opposite direction." +msgstr "设置 ``reverse=True`` 以在相反方向重新投影。" + +#: ../../library/omv.image.rst:3917 +msgid "Linear polar re-projection turns rotation of an image into x-translation." +msgstr "线性极坐标重新投影将图像的旋转转换为 x 平移。" + +#: ../../library/omv.image.rst:3925 +msgid "" +"Re-project's and image from cartessian coordinates to log polar " +"coordinates." +msgstr "将图像从笛卡尔坐标重新投影到对数极坐标。" + +#: ../../library/omv.image.rst:3929 +msgid "" +"Log polar re-projection turns rotation of an image into x-translation and" +" scaling/zooming into y-translation." +msgstr "对数极坐标重新投影将图像的旋转转换为 x 平移,并将缩放/缩放转换为 y 平移。" + +#: ../../library/omv.image.rst:3938 +msgid "" +"Performs lens correction to un-fisheye the image due to the lens " +"distortion." +msgstr "对图像进行镜头校正,以消除由于镜头畸变而产生的鱼眼效果。" + +#: ../../library/omv.image.rst:3940 +msgid "" +"``strength`` is a float defining how much to un-fisheye the image. Try " +"1.8 out by default and then increase or decrease from there until the " +"image looks good." +msgstr "" +"``strength`` 是一个浮点数,定义了要对图像进行多少程度的鱼眼效果消除。默认为 " +"1.8,您可以从这个值开始,并根据需要增加或减少,直到图像看起来良好为止。" + +#: ../../library/omv.image.rst:3944 ../../library/omv.image.rst:3973 +msgid "``zoom`` is the amount to zoom in on the image by. 1.0 by default." +msgstr "``zoom`` 是图像缩放的大小。默认为 1.0。" + +#: ../../library/omv.image.rst:3946 +msgid "" +"``x_corr`` floating point pixel offset from center. Can be negative or " +"positive." +msgstr "``x_corr`` 是从中心点偏移的浮点像素值。可以是负数或正数。" + +#: ../../library/omv.image.rst:3948 +msgid "" +"``y_corr`` floating point pixel offset from center. Can be negative or " +"positive." +msgstr "``y_corr`` 是从中心点偏移的浮点像素值。可以是负数或正数。" + +#: ../../library/omv.image.rst:3956 +msgid "" +"Corrects perspective issues in the image by doing a 3D rotation of the " +"frame buffer." +msgstr "通过对帧缓冲区进行3D旋转来校正图像的透视问题。" + +#: ../../library/omv.image.rst:3958 +msgid "" +"``x_rotation`` is the number of degrees to rotation the image in the " +"frame buffer around the x axis (i.e. this spins the image up and down)." +msgstr "``x_rotation`` 是在帧缓冲区中旋转图像的度数,绕x轴旋转(即上下旋转图像)。" + +#: ../../library/omv.image.rst:3961 +msgid "" +"``y_rotation`` is the number of degrees to rotation the image in the " +"frame buffer around the y axis (i.e. this spins the image left and " +"right)." +msgstr "``y_rotation`` 是在帧缓冲区中旋转图像的度数,绕y轴旋转(即左右旋转图像)。" + +#: ../../library/omv.image.rst:3964 +msgid "" +"``z_rotation`` is the number of degrees to rotation the image in the " +"frame buffer around the z axis (i.e. this spins the image in place)." +msgstr "``z_rotation`` 是在帧缓冲区中旋转图像的度数,绕z轴旋转(即原地旋转图像)。" + +#: ../../library/omv.image.rst:3967 +msgid "" +"``x_translation`` is the number of units to move the image to the left or" +" right after rotation. Because this translation is applied in 3D space " +"the units aren't pixels..." +msgstr "``x_translation`` 是旋转后将图像向左或向右移动的单位数。由于此平移是在3D空间中应用的,单位不是像素..." + +#: ../../library/omv.image.rst:3970 +msgid "" +"``y_translation`` is the number of units to move the image to the up or " +"down after rotation. Because this translation is applied in 3D space the " +"units aren't pixels..." +msgstr "``y_translation`` 是旋转后将图像向上或向下移动的单位数。由于此平移是在3D空间中应用的,单位不是像素..." + +#: ../../library/omv.image.rst:3975 +msgid "" +"``fov`` is the field-of-view to use internally when doing 2D->3D " +"projection before rotating the image in 3D space. As this value " +"approaches 0 the image is placed at infinity away from the viewport. As " +"this value approaches 180 the image is placed within the viewport. " +"Typically, you should not change this value but you can modify it to " +"change the 2D->3D mapping effect." +msgstr "" +"``fov`` " +"是在3D空间中旋转图像之前进行2D->3D投影时使用的内部视场。当此值接近0时,图像被放置在视口的无限远处。当此值接近180时,图像被放置在视口内部。通常情况下,您不应更改此值,但可以修改它以更改2D->3D映射效果。" + +#: ../../library/omv.image.rst:3980 +msgid "" +"``corners`` is a list of four (x,y) tuples representing four corners used" +" to create a 4-point correspondence homography that will map the first " +"corner to (0, 0), the second corner to (image_width-1, 0), the third " +"corner to (image_width-1, image_height-1), and the fourth corner to (0, " +"image_height-1). The 3D rotation is then applied after the image is re-" +"mapped. This argument lets you use `rotation_corr` to do things like " +"birds-eye-view transforms. E.g::" +msgstr "" +"``corners`` " +"是一个包含四个(x,y)元组的列表,表示用于创建四点对应单应性的四个角,第一个角映射到(0,0),第二个角映射到(image_width-1,0),第三个角映射到(image_width-1,image_height-1),第四个角映射到(0,image_height-1)。然后在图像重新映射后应用3D旋转。此参数允许您可以使用" +" `rotation_corr` 执行类似鸟瞰变换的操作。例如::" + +#: ../../library/omv.image.rst:4000 +msgid "Get Methods" +msgstr "Get 方法" + +#: ../../library/omv.image.rst:4004 +msgid "" +"Computes the similarity between two images. The similarity is computed by" +" using the structural similiary index (SSIM). The SSIM is a metric that " +"compares the structural similarity between two images. The SSIM is a " +"value between -1 and 1. A value of 1 means the images are identical, a " +"value of 0 means the images are not similar, and a value of -1 means the " +"images are perfectly the opposite of each other. Typically, if you want " +"to check if two images are different you should look to see how negative " +"the SSIM value is." +msgstr "" +"计算两张图像之间的相似度。相似度是通过使用结构相似性指数(SSIM)来计算的。SSIM 是一种度量方法,用于比较两张图像之间的结构相似性。SSIM" +" 的值范围在 -1 和 1 之间。值为 1 表示两张图像完全相同,值为 0 表示两张图像不相似,值为 -1 " +"表示两张图像完全相反。通常,如果你想检查两张图像是否不同,应该查看 SSIM 值的负值程度。" + +#: ../../library/omv.image.rst:4013 +msgid "``image`` is the image to compare to." +msgstr "``image`` 是要进行比较的图像。" + +#: ../../library/omv.image.rst:4015 +msgid "" +"You may also pass a path instead of an image object for this method to " +"automatically load the image from disk and use it in one step. E.g. " +"``get_similarity(\"test.jpg\")``." +msgstr "你也可以传递一个路径,而不是图像对象,这样该方法会自动从磁盘加载图像并一步到位地使用它。例如,``get_similarity(\"test.jpg\")``。" + +#: ../../library/omv.image.rst:4018 +msgid "``x`` is the x offset to start comparing the image at." +msgstr "``x`` 是开始比较图像的 x 偏移量。" + +#: ../../library/omv.image.rst:4020 +msgid "``y`` is the y offset to start comparing the image at." +msgstr "``y`` 是开始比较图像的 y 偏移量。" + +#: ../../library/omv.image.rst:4074 +msgid "" +"``dssim`` if true will compute the structual disimilarity index (DSSIM) " +"instead of the SSIM. A value of 0 means the images are identical. A value" +" of 1 means the images are completely different." +msgstr "" +"``dssim`` 如果设置为 true,将计算结构性不相似度指数(DSSIM)而不是 SSIM。值为 0 表示图像完全相同,值为 1 " +"表示图像完全不同。" + +#: ../../library/omv.image.rst:4077 +msgid "Returns a `image.Similarity` object." +msgstr "返回一个 `image.Similarity` 对象。" + +#: ../../library/omv.image.rst:4081 +msgid "" +"Computes the normalized histogram on all color channels for an ``roi`` " +"and returns a `image.histogram` object. Please see the `image.histogram` " +"object for more information. You can also invoke this method by using " +"``Image.get_hist()`` or ``Image.histogram()``. If you pass a list of " +"``thresholds`` then the histogram information will only be computed from " +"pixels within the threshold list." +msgstr "" +"计算 ``roi`` 中所有颜色通道的归一化直方图,并返回一个 `image.histogram` 对象。请参阅 " +"`image.histogram` 对象获取更多信息。您还可以通过使用 ``Image.get_hist()`` 或 " +"``Image.histogram()`` 来调用此方法。如果传递了 ``thresholds`` " +"的列表,则直方图信息将仅计算来自阈值列表内的像素。" + +#: ../../library/omv.image.rst:4118 +msgid "" +"Unless you need to do something advanced with color statistics just use " +"the `Image.get_statistics()` method instead of this method for looking at" +" pixel areas in an image." +msgstr "除非您需要对颜色统计执行一些高级操作,否则只需使用 `Image.get_statistics()` 方法而不是此方法来查看图像中的像素区域。" + +#: ../../library/omv.image.rst:4122 ../../library/omv.image.rst:4186 +#: ../../library/omv.image.rst:4249 ../../library/omv.image.rst:4303 +#: ../../library/omv.image.rst:4367 ../../library/omv.image.rst:4403 +#: ../../library/omv.image.rst:4423 ../../library/omv.image.rst:4465 +#: ../../library/omv.image.rst:4490 ../../library/omv.image.rst:4517 +#: ../../library/omv.image.rst:4567 ../../library/omv.image.rst:4614 +#: ../../library/omv.image.rst:4664 ../../library/omv.image.rst:4697 +#: ../../library/omv.image.rst:4713 ../../library/omv.image.rst:4725 +#: ../../library/omv.image.rst:4738 ../../library/omv.image.rst:4783 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h). If not " +"specified, it is equal to the image rectangle. Only pixels within the " +"``roi`` are operated on." +msgstr "``roi`` 是感兴趣区域的矩形元组(x, y, w, h)。如果未指定,则等于图像矩形。仅操作 ``roi`` 内的像素。" + +#: ../../library/omv.image.rst:4126 ../../library/omv.image.rst:4190 +msgid "" +"``bins`` and others are the number of bins to use for the histogram " +"channels. For grayscale images use ``bins`` and for RGB565 images use the" +" others for each channel. The bin counts must be greater than 2 for each " +"channel. Additionally, it makes no sense to set the bin count larger than" +" the number of unique pixel values for each channel. By default, the " +"historgram will have the maximum number of bins per channel." +msgstr "" +"``bins`` 和其他参数是用于直方图通道的 bin 数量。对于灰度图像使用 ``bins``,对于 RGB565 " +"图像则使用其他参数分别设置每个通道的 bin 数量。每个通道的 bin 数量必须大于 2。此外,将 bin " +"数量设置为大于每个通道的唯一像素值数量是没有意义的。默认情况下,直方图将使用每个通道的最大 bin 数量。" + +#: ../../library/omv.image.rst:4133 ../../library/omv.image.rst:4197 +msgid "" +"``difference`` may be set to an image object to cause this method to " +"operate on the difference image between the current image and the " +"``difference`` image object. This saves having to use a separate buffer." +msgstr "" +"可以设置 ``difference`` 为一个图像对象,以使此方法对当前图像和 ``difference`` " +"图像对象之间的差异图像上操作。这样可以避免使用单独的缓冲区。" + +#: ../../library/omv.image.rst:4141 +msgid "" +"Computes the mean, median, mode, standard deviation, min, max, lower " +"quartile, and upper quartile for all color channels for an ``roi`` and " +"returns a `image.statistics` object. Please see the `image.statistics` " +"object for more information. You can also invoke this method by using " +"``Image.get_stats()`` or ``Image.statistics()``. If you pass a list of " +"``thresholds`` then the histogram information will only be computed from " +"pixels within the threshold list." +msgstr "" +"计算 ``roi`` 中所有颜色通道的均值、中位数、模式、标准差、最小值、最大值、下四分位数和上四分位数,并返回一个 " +"`image.statistics` 对象。更多信息请参阅 `image.statistics` 对象。也可以通过 " +"``Image.get_stats()`` 或 ``Image.statistics()`` 调用此方法。如果传递了 ``thresholds``" +" 的列表,则直方图信息将仅计算在阈值列表内的像素。" + +#: ../../library/omv.image.rst:4180 +msgid "" +"You'll want to use this method any time you need to get information about" +" the values of an area of pixels in an image. For example, after if " +"you're trying to detect motion using frame differencing you'll want to " +"use this method to determine a change in the color channels of the image " +"to trigger your motion detection threshold." +msgstr "每当需要获取图像中像素区域的值的信息时,您都会使用此方法。例如,如果您正在使用帧差法检测运动,那么您将使用此方法来确定图像的颜色通道的变化以触发您的运动检测阈值。" + +#: ../../library/omv.image.rst:4205 +#, python-format +msgid "" +"Computes a linear regression on all the thresholded pixels in the image. " +"The linear regression is computed using least-squares normally which is " +"fast but cannot handle any outliers. If ``robust`` is True then the " +"Theil–Sen linear regression is used instead which computes the median of " +"all slopes between all thresholded pixels in the image. This is an N^2 " +"operation which may drops your FPS down to below 5 even on an 80x60 image" +" if too many pixels are set after thresholding. However, as long as the " +"number of pixels set after thresholding remains low the linear regression" +" will be valid even in the case of up to 30% of the thresholded pixels " +"being outliers (e.g. it's robust)." +msgstr "" +"在图像中的所有阈值化像素上计算线性回归。线性回归通常使用最小二乘法计算,这很快,但不能处理任何异常值。如果 ``robust`` 为 " +"True,则改用 Theil–Sen 线性回归,它计算图像中所有阈值化像素之间的所有斜率的中值。这是一个 N^2 " +"的操作,即使在80×60的图像上,如果阈值化后设置太多像素,也可能将您的 FPS 降低到 5 " +"以下。然而,只要阈值化后的像素数保持较低,即使在阈值化后的像素中有多达 30% 的异常值(例如,它是鲁棒的),线性回归也将有效。" + +#: ../../library/omv.image.rst:4215 +msgid "" +"This method returns a `image.line` object. See this blog post on how to " +"use the line object easily: https://openmv.io/blogs/news/linear-" +"regression-line-following" +msgstr "" +"此方法返回一个 `image.line` 对象。请参阅此博客文章,了解如何轻松使用线对象:https://openmv.io/blogs/news" +"/linear-regression-line-following" + +#: ../../library/omv.image.rst:4253 +msgid "" +"``x_stride`` is the number of x pixels to skip over when evaluating the " +"image." +msgstr "``x_stride`` 是在评估图像时要跳过的x像素数。" + +#: ../../library/omv.image.rst:4255 +msgid "" +"``y_stride`` is the number of y pixels to skip over when evaluating the " +"image." +msgstr "``y_stride`` 是在评估图像时要跳过的y像素数。" + +#: ../../library/omv.image.rst:4257 +msgid "" +"If the regression's bounding box area is less than ``area_threshold`` " +"then None is returned." +msgstr "如果回归的边界框面积小于 ``area_threshold`` ,则返回None。" + +#: ../../library/omv.image.rst:4259 +msgid "" +"If the regression's pixel count is less than ``pixels_threshold`` then " +"None is returned." +msgstr "如果回归的像素计数少于 ``pixels_threshold`` ,则返回None。" + +#: ../../library/omv.image.rst:4264 +msgid "Detection Methods" +msgstr "检测方法" + +#: ../../library/omv.image.rst:4268 +msgid "" +"Finds all blobs (connected pixel regions that pass a threshold test) in " +"the image and returns a list of `image.blob` objects which describe each " +"blob. Please see the `image.blob` object more more information." +msgstr "" +"在图像中查找所有blob(通过阈值测试的连接像素区域)并返回描述每个blob的 `image.blob` 对象列表。有关更多信息,请参阅 " +"`image.blob` 对象。" + +#: ../../library/omv.image.rst:4272 +msgid "" +"``thresholds`` must be a list of tuples ``[(lo, hi), (lo, hi), ..., (lo, " +"hi)]`` defining the ranges of color you want to track. You may pass up to" +" 32 threshold tuples in one call. For grayscale images each tuple needs " +"to contain two values - a min grayscale value and a max grayscale value. " +"Only pixel regions that fall between these thresholds will be considered." +" For RGB565 images each tuple needs to have six values (l_lo, l_hi, a_lo," +" a_hi, b_lo, b_hi) - which are minimums and maximums for the LAB L, A, " +"and B channels respectively. For easy usage this function will " +"automatically fix swapped min and max values. Additionally, if a tuple is" +" larger than six values the rest are ignored. Conversely, if the tuple is" +" too short the rest of the thresholds are assumed to be at maximum range." +msgstr "" +"``thresholds`` 必须是元组列表 ``[(lo, hi), (lo, hi), ..., (lo, " +"hi)]``,定义要跟踪的颜色范围。您可以在一次调用中传递多达32个阈值元组。对于灰度图像,每个元组需要包含两个值 - " +"最小灰度值和最大灰度值。只有落在这些阈值之间的像素区域才会被考虑。对于RGB565图像,每个元组需要有六个值(l_lo,l_hi,a_lo,a_hi,b_lo,b_hi)" +" - 分别是LAB " +"L,A和B通道的最小值和最大值。为了方便使用,此函数将自动修复交换的最小和最大值。此外,如果元组大于六个值,则其余的值将被忽略。相反,如果元组太短,则其余的阈值将被假定为最大范围。" + +#: ../../library/omv.image.rst:4307 +msgid "" +"``x_stride`` is the number of x pixels to skip when searching for a blob." +" Once a blob is found the line fill algorithm will be pixel accurate. " +"Increase ``x_stride`` to speed up finding blobs if blobs are known to be " +"large." +msgstr "" +"``x_stride`` 是在搜索blob时要跳过的x像素数。一旦找到一个blob,线填充算法将是像素精确的。如果已知blob很大,则增加 " +"``x_stride`` 以加快查找blob的速度。" + +#: ../../library/omv.image.rst:4311 +msgid "" +"``y_stride`` is the number of y pixels to skip when searching for a blob." +" Once a blob is found the line fill algorithm will be pixel accurate. " +"Increase ``y_stride`` to speed up finding blobs if blobs are known to be " +"large." +msgstr "" +"``y_stride`` 是在搜索blob时要跳过的y像素数。一旦找到一个blob,线填充算法将是像素精确的。如果已知blob很大,则增加 " +"``y_stride`` 以加快查找blob的速度。" + +#: ../../library/omv.image.rst:4315 +msgid "" +"If a blob's bounding box area is less than ``area_threshold`` it is " +"filtered out." +msgstr "如果blob的边界框面积小于 ``area_threshold`` ,则过滤掉它。" + +#: ../../library/omv.image.rst:4318 +msgid "" +"If a blob's pixel count is less than ``pixels_threshold`` it is filtered " +"out." +msgstr "如果blob的像素计数少于 ``pixels_threshold`` ,则过滤掉它。" + +#: ../../library/omv.image.rst:4320 +msgid "" +"``merge`` if True merges all not filtered out blobs whos bounding " +"rectangles intersect each other. ``margin`` can be used to increase or " +"decrease the size of the bounding rectangles for blobs during the " +"intersection test. For example, with a margin of 1 blobs whos bounding " +"rectangles are 1 pixel away from each other will be merged." +msgstr "" +"``merge`` 如果为 True,则会合并所有未被过滤掉且其边界矩形相互交叉的斑点。``margin`` " +"可用于在交叉测试期间增加或减少斑点边界矩形的大小。例如,当 ``margin`` 为 1 时,边界矩形相距 1 像素的斑点将被合并。" + +#: ../../library/omv.image.rst:4326 +msgid "" +"Merging blobs allows you to implement color code tracking. Each blob " +"object has a ``code`` value which is a bit vector made up of 1s for each " +"color threshold. For example, if you pass `Image.find_blobs` two color " +"thresholds then the first threshold has a code of 1 and the second 2 (a " +"third threshold would be 4 and a fourth would be 8 and so on). Merged " +"blobs logically OR all their codes together so that you know what colors " +"produced them. This allows you to then track two colors if you get a blob" +" object back with two colors then you know it might be a color code." +msgstr "" +"合并blob允许您实现颜色代码跟踪。每个blob对象都有一个 ``code`` 值,它是由每个颜色阈值的1组成的位向量。例如,如果向 " +"`Image.find_blobs` " +"传递两个颜色阈值,则第一个阈值的代码为1,第二个为2(第三个阈值为4,第四个为8,依此类推)。合并的blob逻辑OR它们的代码,以便您知道产生它们的颜色。这样,如果您得到一个具有两种颜色的blob对象,则知道它可能是一个颜色代码。" + +#: ../../library/omv.image.rst:4335 +msgid "" +"You might also want to merge blobs if you are using tight color bounds " +"which do not fully track all the pixels of an object you are trying to " +"follow." +msgstr "如果您使用的颜色边界较窄,无法完全跟踪所要跟踪对象的所有像素,您可能还需要合并 Blobs。" + +#: ../../library/omv.image.rst:4338 +msgid "" +"Finally, if you want to merge blobs, but, don't want two color thresholds" +" to be merged then just call `Image.find_blobs` twice with separate " +"thresholds so that blobs aren't merged." +msgstr "" +"最后,如果您想要合并blob,但不想合并两个颜色阈值,则只需两次调用 `Image.find_blobs` " +",每次使用不同的阈值,以便不合并blob。" + +#: ../../library/omv.image.rst:4342 +msgid "" +"``threshold_cb`` may be set to the function to call on every blob after " +"its been thresholded to filter it from the list of blobs to be merged. " +"The call back function will receive one argument - the blob object to be " +"filtered. The call back then must return True to keep the blob and False " +"to filter it." +msgstr "" +"``threshold_cb`` 可以设置为在每个blob阈值化后调用的函数,以将其从要合并的blob列表中筛选出来。回调函数将接收一个参数 - " +"要过滤的blob对象。然后,回调必须返回True以保留blob,False以过滤它。" + +#: ../../library/omv.image.rst:4347 +msgid "" +"``merge_cb`` may be set to the function to call on every two blobs about " +"to be merged to prevent or allow the merge. The call back function will " +"receive two arguments - the two blob objects to be merged. The call back " +"then must return True to merge the blobs or False to prevent merging the " +"blobs." +msgstr "" +"``merge_cb`` 可以设置为在每两个即将合并的blob上调用的函数,以防止或允许合并。回调函数将接收两个参数 - " +"即将合并的两个blob对象。然后,回调必须返回True以合并blob,False以防止合并blob。" + +#: ../../library/omv.image.rst:4352 +msgid "" +"``x_hist_bins_max`` if set to non-zero populates a histogram buffer in " +"each blob object with an x_histogram projection of all columns in the " +"object. This value then sets the number of bins for that projection." +msgstr "" +"``x_hist_bins_max`` " +"如果设置为非零,则在每个blob对象中填充一个直方图缓冲区,其中包含对象中所有列的x_histogram投影。然后,此值设置该投影的bin数。" + +#: ../../library/omv.image.rst:4356 +msgid "" +"``y_hist_bins_max`` if set to non-zero populates a histogram buffer in " +"each blob object with an y_histogram projection of all rows in the " +"object. This value then sets the number of bins for that projection." +msgstr "" +"``y_hist_bins_max`` " +"如果设置为非零,则在每个blob对象中填充一个直方图缓冲区,其中包含对象中所有行的y_histogram投影。然后,此值设置该投影的bin数。" + +#: ../../library/omv.image.rst:4364 +msgid "" +"Finds all infinite lines in the image using the hough transform. Returns " +"a list of `image.line` objects." +msgstr "使用霍夫变换在图像中查找所有无限线条。返回 `image.line` 对象的列表。" + +#: ../../library/omv.image.rst:4371 +msgid "" +"``x_stride`` is the number of x pixels to skip when doing the hough " +"transform. Only increase this if lines you are searching for are large " +"and bulky." +msgstr "``x_stride`` 是在进行霍夫变换时要跳过的x像素数。仅当要搜索的线条较大且笨重时才增加此值。" + +#: ../../library/omv.image.rst:4374 +msgid "" +"``y_stride`` is the number of y pixels to skip when doing the hough " +"transform. Only increase this if lines you are searching for are large " +"and bulky." +msgstr "``y_stride`` 是在进行霍夫变换时要跳过的y像素数。仅当要搜索的线条较大且笨重时才增加此值。" + +#: ../../library/omv.image.rst:4377 +msgid "" +"``threshold`` controls what lines are detected from the hough transform. " +"Only lines with a magnitude greater than or equal to ``threshold`` are " +"returned. The right value of ``threshold`` for your application is image " +"dependent. Note that the magnitude of a line is the sum of all sobel " +"filter magnitudes of pixels that make up that line." +msgstr "" +"``threshold`` 控制从霍夫变换中检测到的线条。仅返回幅度大于或等于 ``threshold`` 的线条。对于您的应用程序, " +"``threshold`` 的正确值取决于图像。请注意,线的幅度是由构成该线的所有sobel滤波器幅度的像素的总和。" + +#: ../../library/omv.image.rst:4383 +msgid "" +"``theta_margin`` controls the merging of detected lines. Lines which are " +"``theta_margin`` degrees apart and ``rho_margin`` rho apart are merged." +msgstr "" +"``theta_margin`` 控制检测到的线条的合并。相隔 ``theta_margin`` 度且相隔 ``rho_margin`` " +"rho的线条将被合并。" + +#: ../../library/omv.image.rst:4386 +msgid "" +"``rho_margin`` controls the merging of detected lines. Lines which are " +"``theta_margin`` degrees apart and ``rho_margin`` rho apart are merged." +msgstr "" +"``rho_margin`` 控制检测到的线条的合并。相隔 ``theta_margin`` 度且相隔 ``rho_margin`` " +"rho的线条将被合并。" + +#: ../../library/omv.image.rst:4389 +msgid "" +"This method working by running the sobel filter over the image and taking" +" the magnitude and gradient responses from the sobel filter to feed a " +"hough transform. It does not require any preprocessing on the image " +"first. However, my cleaning up the image using filtering you may get more" +" stable results." +msgstr "此方法通过对图像运行sobel滤波器并从sobel滤波器中获取幅度和梯度响应来进行霍夫变换。它不需要对图像进行任何预处理。但是,通过使用滤波器清理图像,您可能会获得更稳定的结果。" + +#: ../../library/omv.image.rst:4400 +msgid "" +"Finds line segments in the image using the hough transform. Returns a " +"list of `image.line` objects ." +msgstr "使用霍夫变换在图像中查找线段。返回 `image.line` 对象的列表。" + +#: ../../library/omv.image.rst:4407 +msgid "" +"``merge_distance`` specifies the maximum number of pixels two line " +"segements can be seperated by each other (at any point on one line) to be" +" merged." +msgstr "``merge_distance`` 指定两条线段在任意一点的最大像素间距,只有在此距离内它们才会被合并。" + +#: ../../library/omv.image.rst:4410 +msgid "" +"``max_theta_difference`` is the maximum theta difference in degrees two " +"line segements that are ``merge_distance`` apart to be merged." +msgstr "``max_theta_difference`` 是两条线段在 ``merge_distance`` 范围内被合并时的最大角度差(以度为单位)。" + +#: ../../library/omv.image.rst:4413 +msgid "" +"This method uses the LSD library (also used by OpenCV) to find line " +"segements in the image. It's somewhat slow but very accurate and lines " +"don't jump around." +msgstr "此方法使用 LSD 库(OpenCV 也使用该库)在图像中查找线段。尽管速度较慢,但精度非常高,而且线段不会出现跳动。" + +#: ../../library/omv.image.rst:4420 +msgid "" +"Finds circles in the image using the hough transform. Returns a list of " +"`image.circle` objects." +msgstr "使用霍夫变换在图像中查找圆。返回 `image.circle` 对象的列表。" + +#: ../../library/omv.image.rst:4427 +msgid "" +"``x_stride`` is the number of x pixels to skip when doing the hough " +"transform. Only increase this if circles you are searching for are large " +"and bulky." +msgstr "``x_stride`` 是在进行霍夫变换时要跳过的x像素数。仅当要搜索的圆较大且笨重时才增加此值。" + +#: ../../library/omv.image.rst:4430 +msgid "" +"``y_stride`` is the number of y pixels to skip when doing the hough " +"transform. Only increase this if circles you are searching for are large " +"and bulky." +msgstr "``y_stride`` 是在进行霍夫变换时要跳过的y像素数。仅当要搜索的圆较大且笨重时才增加此值。" + +#: ../../library/omv.image.rst:4433 +msgid "" +"``threshold`` controls what circles are detected from the hough " +"transform. Only circles with a magnitude greater than or equal to " +"``threshold`` are returned. The right value of ``threshold`` for your " +"application is image dependent. Note that the magnitude of a circle is " +"the sum of all sobel filter magnitudes of pixels that make up that " +"circle." +msgstr "" +"``threshold`` 控制从霍夫变换中检测到的圆。仅返回幅度大于或等于 ``threshold`` " +"的圆。对于您的应用程序,``threshold`` 的正确值取决于图像。请注意,圆的幅度是由构成该圆的所有sobel滤波器幅度的像素的总和。" + +#: ../../library/omv.image.rst:4439 +msgid "" +"``x_margin`` controls the merging of detected circles. Circles which are " +"``x_margin``, ``y_margin``, and ``r_margin`` pixels apart are merged." +msgstr "" +"``x_margin`` 控制检测到的圆的合并。相隔 ``x_margin`` 、 ``y_margin`` 和 ``r_margin`` " +"像素的圆将被合并。" + +#: ../../library/omv.image.rst:4442 +msgid "" +"``y_margin`` controls the merging of detected circles. Circles which are " +"``x_margin``, ``y_margin``, and ``r_margin`` pixels apart are merged." +msgstr "" +"``y_margin`` 控制检测到的圆的合并。相隔 ``x_margin`` 、 ``y_margin`` 和 ``r_margin`` " +"像素的圆将被合并。" + +#: ../../library/omv.image.rst:4445 +msgid "" +"``r_margin`` controls the merging of detected circles. Circles which are " +"``x_margin``, ``y_margin``, and ``r_margin`` pixels apart are merged." +msgstr "" +"``r_margin`` 控制检测到的圆的合并。相隔 ``x_margin`` 、 ``y_margin`` 和 ``r_margin`` " +"像素的圆将被合并。" + +#: ../../library/omv.image.rst:4448 +msgid "" +"``r_min`` controls the minimum circle radius detected. Increase this to " +"speed up the algorithm. Defaults to 2." +msgstr "``r_min`` 控制检测到的最小圆半径。增加此值以加快算法。默认为2。" + +#: ../../library/omv.image.rst:4451 +msgid "" +"``r_max`` controls the maximum circle radius detected. Decrease this to " +"speed up the algorithm. Defaults to min(roi.w/2, roi.h/2)." +msgstr "``r_max`` 控制检测到的最大圆半径。减小此值以加快算法。默认为min(roi.w/2, roi.h/2)。" + +#: ../../library/omv.image.rst:4454 +msgid "``r_step`` controls how to step the radius detection by. Defaults to 2." +msgstr "``r_step`` 控制半径检测的步长。默认为2。" + +#: ../../library/omv.image.rst:4460 +msgid "" +"Find rectangles in the image using the same quad detection algorithm used" +" to find apriltags. Works best of rectangles that have good contrast " +"against the background. The apriltag quad detection algorithm can handle " +"any scale/rotation/shear on rectangles. Returns a list of `image.rect` " +"objects." +msgstr "" +"使用用于查找apriltags的相同四边形检测算法来查找图像中的矩形。对于对背景具有良好对比度的矩形效果最佳。apriltag四边形检测算法可以处理任何矩形的缩放/旋转/剪切。返回" +" `image.rect` 对象的列表。" + +#: ../../library/omv.image.rst:4469 +msgid "" +"Rectangles which have an edge magnitude (which is computed by sliding the" +" sobel operator across all pixels on the edges of the rectangle and " +"summing their values) less than ``threshold`` are filtered out of the " +"returned list. The correct value of ``threshold`` is depended on your " +"application/scene." +msgstr "" +"边缘幅度(通过在矩形边缘上的所有像素上滑动sobel运算符并将其值求和来计算)小于 ``threshold`` 的矩形将被过滤出返回列表。 " +"``threshold`` 的正确值取决于您的应用程序/场景。" + +#: ../../library/omv.image.rst:4478 +msgid "" +"Finds all qrcodes within the ``roi`` and returns a list of `image.qrcode`" +" objects. Please see the `image.qrcode` object for more information." +msgstr "" +"查找 ``roi`` 内的所有qrcodes,并返回一个 `image.qrcode` 对象列表。请参阅 `image.qrcode` " +"对象以获取更多信息。" + +#: ../../library/omv.image.rst:4481 +msgid "" +"QR Codes need to be relatively flat in the image for this method to work." +" You can achieve a flatter image that is not effected by lens distortion " +"by either using the `sensor.set_windowing()` function to zoom in the on " +"the center of the lens, `Image.lens_corr()` to undo lens barrel " +"distortion, or by just changing out the lens for something with a " +"narrower fields of view. There are machine vision lenses available which " +"do not cause barrel distortion but they are much more expensive to than " +"the standard lenses supplied by OpenMV." +msgstr "" +"为使此方法有效工作,图像中的QR码需要相对平坦。您可以通过以下方式实现图像更平坦,不受镜头畸变影响:使用 " +"`sensor.set_windowing()` 函数放大镜头中心,使用 `Image.lens_corr()` " +"消除镜头桶形失真,或者更换镜头为具有较窄视场的镜头。有一些机器视觉镜头可用,它们不会导致桶形失真,但价格比OpenMV提供的标准镜头高得多。" + +#: ../../library/omv.image.rst:4498 +msgid "" +"Finds all apriltags within the ``roi`` and returns a list of " +"`image.apriltag` objects. Please see the `image.apriltag` object for more" +" information." +msgstr "" +"查找 ``roi`` 内的所有AprilTags,并返回一个 `image.apriltag` 对象列表。请参阅 `image.apriltag`" +" 对象以获取更多信息。" + +#: ../../library/omv.image.rst:4501 +msgid "" +"Unlike QR Codes, AprilTags can be detected at much farther distances, " +"worse lighting, in warped images, etc. AprilTags are robust too all kinds" +" of image distortion issues that QR Codes are not to. That said, " +"AprilTags can only encode a numeric ID as their payload." +msgstr "与QR码不同,AprilTags可以在距离更远的情况下、光照更差的情况下、变形的图像中等情况下被检测到。AprilTags对各种图像失真问题都非常强大,而QR码则不是。即便如此,AprilTags只能将数值ID编码为其有效载荷。" + +#: ../../library/omv.image.rst:4506 +msgid "" +"AprilTags can also be used for localization purposes. Each " +"`image.apriltag` object returns its translation and rotation from the " +"camera. The units of the translation are determined by ``fx``, ``fy``, " +"``cx``, and ``cy`` which are the focal lengths and center points of the " +"image in the X and Y directions respectively." +msgstr "" +"AprilTags也可用于定位目的。每个 `image.apriltag` 对象都会返回相机的平移和旋转。平移的单位由 " +"``fx``、``fy``、``cx`` 和 ``cy`` 确定,它们分别是图像在X和Y方向上的焦距和中心点。" + +#: ../../library/omv.image.rst:4514 +msgid "" +"To create AprilTags use the tag generator tool built-in to OpenMV IDE. " +"The tag generator can create printable 8.5\"x11\" AprilTags." +msgstr "若要创建AprilTags,请使用OpenMV IDE内置的标签生成器工具。该标签生成器可以创建可打印的8.5\"x11\" AprilTags。" + +#: ../../library/omv.image.rst:4521 +msgid "" +"``families`` is bitmask of tag families to decode. It is the logical OR " +"of:" +msgstr "``families`` 是要解码的标签族的位掩码。它是以下内容的逻辑或:" + +#: ../../library/omv.image.rst:4523 +msgid "`image.TAG16H5`" +msgstr "`image.TAG16H5`" + +#: ../../library/omv.image.rst:4524 +msgid "`image.TAG25H7`" +msgstr "`image.TAG25H7`" + +#: ../../library/omv.image.rst:4525 +msgid "`image.TAG25H9`" +msgstr "`image.TAG25H9`" + +#: ../../library/omv.image.rst:4526 +msgid "`image.TAG36H10`" +msgstr "`image.TAG36H10`" + +#: ../../library/omv.image.rst:4527 +msgid "`image.TAG36H11`" +msgstr "`image.TAG36H11`" + +#: ../../library/omv.image.rst:4528 +msgid "`image.ARTOOLKIT`" +msgstr "`image.ARTOOLKIT`" + +#: ../../library/omv.image.rst:4530 +msgid "" +"By default it is just `image.TAG36H11` which is the best tag family to " +"use. Note that `Image.find_apriltags()` slows down per enabled tag " +"family." +msgstr "" +"默认值仅为 `image.TAG36H11`,这是最佳标签族。请注意,每启用一个标签族,`Image.find_apriltags()` " +"的速度就会减慢。" + +#: ../../library/omv.image.rst:4533 +msgid "" +"``fx`` is the camera X focal length in pixels. For the standard OpenMV " +"Cam this is (2.8 / 3.984) * 656. Which is the lens focal length in mm, " +"divided by the camera sensor length in the X direction multiplied by the " +"number of camera sensor pixels in the X direction (for the OV7725 " +"camera)." +msgstr "" +"``fx`` 是相机X方向的焦距(像素)。对于标准的OpenMV Cam,这是 (2.8 / 3.984) * " +"656。这是以mm为单位的镜头焦距,除以X方向的相机传感器长度,再乘以X方向上相机传感器的像素数(适用于OV7725相机)。" + +#: ../../library/omv.image.rst:4538 +msgid "" +"``fx`` is the camera Y focal length in pixels. For the standard OpenMV " +"Cam this is (2.8 / 2.952) * 488. Which is the lens focal length in mm, " +"divided by the camera sensor length in the Y direction multiplied by the " +"number of camera sensor pixels in the Y direction (for the OV7725 " +"camera)." +msgstr "" +"``fy`` 是相机Y方向的焦距(像素)。对于标准的OpenMV Cam,这是 (2.8 / 2.952) * " +"488。这是以mm为单位的镜头焦距,除以Y方向的相机传感器长度,再乘以Y方向上相机传感器的像素数(适用于OV7725相机)。" + +#: ../../library/omv.image.rst:4543 +msgid "" +"``cx`` is the image center which is just ``image.width()/2``. This is not" +" ``roi.w()/2``." +msgstr "``cx`` 是图像中心,即 ``image.width()/2``。这不是 ``roi.w()/2``。" + +#: ../../library/omv.image.rst:4546 +msgid "" +"``cy`` is the image center which is just ``image.height()/2``. This is " +"not ``roi.h()/2``." +msgstr "``cy`` 是图像中心,即 ``image.height()/2``。这不是 ``roi.h()/2``。" + +#: ../../library/omv.image.rst:4555 +msgid "" +"Finds all datamatrices within the ``roi`` and returns a list of " +"`image.datamatrix` objects. Please see the `image.datamatrix` object for " +"more information." +msgstr "" +"查找 ``roi`` 内的所有数据矩阵,并返回一个 `image.datamatrix` 对象列表。请参阅 `image.datamatrix` " +"对象以获取更多信息。" + +#: ../../library/omv.image.rst:4558 +msgid "" +"Data Matrices need to be relatively flat in the image for this method to " +"work. You can achieve a flatter image that is not effected by lens " +"distortion by either using the `sensor.set_windowing()` function to zoom " +"in the on the center of the lens, `Image.lens_corr()` to undo lens barrel" +" distortion, or by just changing out the lens for something with a " +"narrower fields of view. There are machine vision lenses available which " +"do not cause barrel distortion but they are much more expensive to than " +"the standard lenses supplied by OpenMV." +msgstr "" +"为使此方法有效工作,图像中的数据矩阵需要相对平坦。您可以通过以下方式实现图像更平坦,不受镜头畸变影响:使用 " +"`sensor.set_windowing()` 函数放大镜头中心,使用 `Image.lens_corr()` " +"消除镜头桶形失真,或者更换镜头为具有较窄视场的镜头。有一些机器视觉镜头可用,它们不会导致桶形失真,但价格比OpenMV提供的标准镜头高得多。" + +#: ../../library/omv.image.rst:4571 +msgid "" +"``effort`` controls how much time to spend trying to find data matrix " +"matches. The default value of 200 should be good for all use-cases. " +"However, you may increase the effort, at a cost of the frame rate, to " +"increase detection. You may also lower the effort to increase the frame " +"rate, but, at a cost of detections... note that when ``effort`` is set to" +" below 160 or so you will not detect anything anymore. Also note that you" +" can make ``effort`` as high as you like. But, any values above 240 or so" +" do not result in much increase in the detection rate." +msgstr "" +"``effort`` " +"控制尝试查找数据矩阵匹配的时间量。默认200对于所有用例应该很好。但是,您可以增加effort,以牺牲帧速率来增加检测。您也可以降低effort来增加帧速率,但是会牺牲检测率......请注意,当" +" ``effort`` 设置低于160左右时,将不再检测到任何内容。还要注意,可以使 ``effort`` " +"设置的尽可能高。但是,高于240左右的任何值都不会导致检测率显著增加。" + +#: ../../library/omv.image.rst:4584 +msgid "" +"Finds all 1D barcodes within the ``roi`` and returns a list of " +"`image.barcode` objects. Please see the `image.barcode` object for more " +"information." +msgstr "" +"查找 ``roi`` 内的所有一维条形码,并返回一个 `image.barcode` 对象列表。请参阅 `image.barcode` " +"对象以获取更多信息。" + +#: ../../library/omv.image.rst:4587 +msgid "" +"For best results use a 640 by 40/80/160 window. The lower the vertical " +"res the faster everything will run. Since bar codes are linear 1D images " +"you just need a lot of resolution in one direction and just a little " +"resolution in the other direction. Note that this function scans both " +"horizontally and vertically so you can use a 40/80/160 by 480 window if " +"you want. Finally, make sure to adjust your lens so that the bar code is " +"positioned where the focal length produces the sharpest image. Blurry bar" +" codes can't be decoded." +msgstr "" +"为获得最佳结果,请使用640 x " +"40/80/160窗口。垂直分辨率越低,所有操作运行速度越快。由于条形码是线性1D图像,因此您只需在一个方向上拥有很高的分辨率,在另一个方向上只需要很少的分辨率。请注意,此函数水平和垂直扫描,因此您可以使用40/80/160" +" x 480窗口。最后,请确保调整镜头,使条形码位于焦距产生最清晰图像的位置。模糊的条形码无法解码。" + +#: ../../library/omv.image.rst:4595 +msgid "This function supports all these 1D barcodes (basically all barcodes):" +msgstr "此函数支持所有这些一维条形码(基本上是所有条形码):" + +#: ../../library/omv.image.rst:4597 +msgid "`image.EAN2`" +msgstr "`image.EAN2`" + +#: ../../library/omv.image.rst:4598 +msgid "`image.EAN5`" +msgstr "`image.EAN5`" + +#: ../../library/omv.image.rst:4599 +msgid "`image.EAN8`" +msgstr "`image.EAN8`" + +#: ../../library/omv.image.rst:4600 +msgid "`image.UPCE`" +msgstr "`image.UPCE`" + +#: ../../library/omv.image.rst:4601 +msgid "`image.ISBN10`" +msgstr "`image.ISBN10`" + +#: ../../library/omv.image.rst:4602 +msgid "`image.UPCA`" +msgstr "`image.UPCA`" + +#: ../../library/omv.image.rst:4603 +msgid "`image.EAN13`" +msgstr "`image.EAN13`" + +#: ../../library/omv.image.rst:4604 +msgid "`image.ISBN13`" +msgstr "`image.ISBN13`" + +#: ../../library/omv.image.rst:4605 +msgid "`image.I25`" +msgstr "`image.I25`" + +#: ../../library/omv.image.rst:4606 +msgid "`image.DATABAR` (RSS-14)" +msgstr "`image.DATABAR` (RSS-14)" + +#: ../../library/omv.image.rst:4607 +msgid "`image.DATABAR_EXP` (RSS-Expanded)" +msgstr "`image.DATABAR_EXP` (RSS-Expanded)" + +#: ../../library/omv.image.rst:4608 +msgid "`image.CODABAR`" +msgstr "`image.CODABAR`" + +#: ../../library/omv.image.rst:4609 +msgid "`image.CODE39`" +msgstr "`image.CODE39`" + +#: ../../library/omv.image.rst:4610 +msgid "`image.PDF417`" +msgstr "`image.PDF417`" + +#: ../../library/omv.image.rst:4611 +msgid "`image.CODE93`" +msgstr "`image.CODE93`" + +#: ../../library/omv.image.rst:4612 +msgid "`image.CODE128`" +msgstr "`image.CODE128`" + +#: ../../library/omv.image.rst:4622 +msgid "" +"Find the translation offset of the this image from the template. This " +"method can be used to do optical flow. This method returns a " +"`image.displacement` object with the results of the displacement " +"calculation using phase correlation." +msgstr "" +"查找此图像相对于模板的平移偏移。此方法可用于光流。此方法返回一个包含使用相位相关性进行位移计算结果的 `image.displacement` " +"对象。" + +#: ../../library/omv.image.rst:4626 +msgid "" +"``roi`` is the region-of-interest rectangle (x, y, w, h) to work in. If " +"not specified, it is equal to the image rectangle." +msgstr "``roi`` 是要处理的感兴趣区域矩形 (x, y, w, h)。如果未指定,则等于图像矩形。" + +#: ../../library/omv.image.rst:4629 +msgid "" +"``template_roi`` is the region-of-interest rectangle (x, y, w, h) to work" +" in. If not specified, it is equal to the image rectangle." +msgstr "``template_roi`` 是要处理的模板感兴趣区域矩形 (x, y, w, h)。如果未指定,则等于图像矩形。" + +#: ../../library/omv.image.rst:4632 +msgid "" +"``roi`` and ``template`` roi must have the same w/h but may have any x/y " +"location in the image. You may slide smaller rois arround a larger image " +"to get an optical flow gradient image..." +msgstr "" +"``roi`` 和 ``template`` 的区域必须具有相同的宽度和高度,但在图像中可以具有任意的 x/y " +"位置。您可以在较大的图像中滑动较小的区域,以获取光流梯度图像……" + +#: ../../library/omv.image.rst:4636 +msgid "" +"`Image.find_displacement()` normally computes the x/y translation between" +" two images. However, if you pass ``logpolar=True`` it will instead find " +"rotation and scale changes between the two images. The same " +"`image.displacement` object result encodes both possible repsonses." +msgstr "" +"`Image.find_displacement()` 通常用于计算两幅图像之间的 x/y 平移。然而,如果传入 " +"``logpolar=True``,它将改为查找两幅图像之间的旋转和缩放变化。相同的 `image.displacement` " +"对象结果会同时编码这两种可能的响应。" + +#: ../../library/omv.image.rst:4645 +msgid "Please use this method on power-of-2 image sizes (e.g. `sensor.B64X64`)." +msgstr "请在2的幂图像尺寸上使用此方法(例如 `sensor.B64X64` )。" + +#: ../../library/omv.image.rst:4653 +msgid "" +"Tries to find the first location in the image where template matches " +"using Normalized Cross Correlation. Returns a bounding box tuple (x, y, " +"w, h) for the matching location otherwise None." +msgstr "尝试在图像中找到模板匹配的第一个位置,使用归一化互相关。如果找到匹配位置,则返回一个边界框元组 (x, y, w, h),否则返回None。" + +#: ../../library/omv.image.rst:4657 +msgid "" +"``template`` is a small image object that is matched against this image " +"object. Note that both images must be grayscale." +msgstr "``template`` 是要与此图像对象匹配的小图像对象。请注意,两个图像都必须是灰度图像。" + +#: ../../library/omv.image.rst:4660 +msgid "" +"``threshold`` is floating point number (0.0-1.0) where a higher threshold" +" prevents false positives while lowering the detection rate while a lower" +" threshold does the opposite." +msgstr "``threshold`` 是一个浮点数(0.0-1.0),其中较高的阈值可以防止错误的正检率,同时降低检测率,而较低的阈值则相反。" + +#: ../../library/omv.image.rst:4668 +msgid "" +"``step`` is the number of pixels to skip past while looking for the " +"template. Skipping pixels considerably speeds the algorithm up. This only" +" affects the algorithm in SERACH_EX mode." +msgstr "``step`` 是在查找模板时要跳过的像素数。跳过像素可以大大加快算法速度。这仅影响SEARCH_EX模式下的算法。" + +#: ../../library/omv.image.rst:4672 +msgid "" +"``search`` can be either ``image.SEARCH_DS`` or ``image.SEARCH_EX``. " +"``image.SEARCH_DS`` searches for the template using as faster algorithm " +"than ``image.SEARCH_EX`` but may not find the template if it's near the " +"edges of the image. ``image.SEARCH_EX`` does an exhaustive search for the" +" image but can be much slower than ``image.SEARCH_DS``." +msgstr "" +"``search`` 可以是 ``image.SEARCH_DS`` 或 ``image.SEARCH_EX``。 " +"``image.SEARCH_DS`` 使用比 ``image.SEARCH_EX`` 更快的算法搜索模板,但可能无法在图像边缘附近找到模板。 " +"``image.SEARCH_EX`` 对图像进行穷举搜索,但比 ``image.SEARCH_DS`` 慢得多。" + +#: ../../library/omv.image.rst:4678 ../../library/omv.image.rst:4717 +#: ../../library/omv.image.rst:4729 ../../library/omv.image.rst:4763 +#: ../../library/omv.image.rst:4776 ../../library/omv.image.rst:4787 +msgid "Only works on grayscale images." +msgstr "仅适用于灰度图像。" + +#: ../../library/omv.image.rst:4682 +msgid "" +"This method searches the image for all areas that match the passed in " +"Haar Cascade and returns a list of bounding box rectangles tuples (x, y, " +"w, h) around those features. Returns an empty list if no features are " +"found." +msgstr "" +"此方法在图像中搜索所有与传入的Haar级联匹配的区域,并返回一个围绕这些特征的边界框矩形元组列表 (x, y, w, " +"h)。如果未找到特征,则返回一个空列表。" + +#: ../../library/omv.image.rst:4686 +msgid "" +"``cascade`` is a Haar Cascade object. See `image.HaarCascade()` for more " +"details." +msgstr "``cascade`` 是一个Haar级联对象。有关详细信息,请参阅 `image.HaarCascade()`。" + +#: ../../library/omv.image.rst:4689 +msgid "" +"``threshold`` is a threshold (0.0-1.0) where a smaller value increase the" +" detection rate while raising the false positive rate. Conversely, a " +"higher value decreases the detection rate while lowering the false " +"positive rate." +msgstr "``threshold`` 是一个阈值(0.0-1.0),较小的值会增加检测率,但会提高误检率。相反,较高的值会降低检测率,但会降低误检率。" + +#: ../../library/omv.image.rst:4693 +msgid "" +"``scale`` is a float that must be greater than 1.0. A higher scale factor" +" will run faster but will have much poorer image matches. A good value is" +" between 1.35 and 1.5." +msgstr "``scale`` 是一个浮点数,必须大于1.0。较高的比例因子会运行得更快,但图像匹配效果会大打折扣。一个好的值介于1.35和1.5之间。" + +#: ../../library/omv.image.rst:4703 +msgid "" +"Searches for the pupil in a region-of-interest (x, y, w, h) tuple around " +"an eye. Returns a tuple with the (x, y) location of the pupil in the " +"image. Returns (0,0) if no pupils are found." +msgstr "" +"在眼睛周围的感兴趣区域 (x, y, w, h) 元组中搜索瞳孔。返回一个元组,其中包含图像中瞳孔的 (x, y) 位置。如果找不到瞳孔,则返回 " +"(0,0)。" + +#: ../../library/omv.image.rst:4707 +msgid "" +"To use this function first use `Image.find_features()` with the " +"``frontalface`` HaarCascade to find someone's face. Then use " +"`Image.find_features()` with the ``eye`` HaarCascade to find the eyes on " +"the face. Finally, call this method on the eye ROI returned by " +"`Image.find_features()` to get the pupil coordinates." +msgstr "" +"要使用此函数,首先使用 `Image.find_features()` 和 ``frontalface`` " +"HaarCascade找到某人的面部。然后使用 `Image.find_features()` 和 ``eye`` " +"HaarCascade找到面部上的眼睛。最后,在由 `Image.find_features()` 返回的眼睛ROI上调用此方法,以获取瞳孔坐标。" + +#: ../../library/omv.image.rst:4721 +msgid "" +"Extracts LBP (local-binary-patterns) keypoints from the region-of-" +"interest (x, y, w, h) tuple. You can then use then use the " +"`image.match_descriptor()` function to compare two sets of keypoints to " +"get the matching distance." +msgstr "" +"从感兴趣区域 (x, y, w, h) 元组中提取LBP(局部二值模式)关键点。然后可以使用 `image.match_descriptor()`" +" 函数比较两组关键点以获取匹配距离。" + +#: ../../library/omv.image.rst:4733 +msgid "" +"Extracts ORB keypoints from the region-of-interest (x, y, w, h) tuple. " +"You can then use then use the `image.match_descriptor()` function to " +"compare two sets of keypoints to get the matching areas. Returns None if " +"no keypoints were found." +msgstr "" +"从感兴趣区域 (x, y, w, h) 元组中提取ORB关键点。然后可以使用 `image.match_descriptor()` " +"函数比较两组关键点以获取匹配区域。如果未找到关键点,则返回None。" + +#: ../../library/omv.image.rst:4742 +msgid "" +"``threshold`` is a number (between 0 - 255) which controls the number of " +"extracted corners. For the default AGAST corner detector this should be " +"around 20. FOr the FAST corner detector this should be around 60-80. The " +"lower the threshold the more extracted corners you get." +msgstr "" +"``threshold`` 是一个数字(介于0 - " +"255之间),控制提取的角点数量。对于默认的AGAST角点检测器,此值应该大约为20。对于FAST角点检测器,此值应该大约为60-80。阈值越低,提取的角点就越多。" + +#: ../../library/omv.image.rst:4747 +msgid "" +"``normalized`` is a boolean value that if True turns off extracting " +"keypoints at multiple resolutions. Set this to true if you don't care " +"about dealing with scaling issues and want the algorithm to run faster." +msgstr "" +"``normalized`` " +"是一个布尔值,如果为True,则关闭在多个分辨率提取关键点。如果您不关心处理缩放问题,并希望算法运行得更快,则将其设置为true。" + +#: ../../library/omv.image.rst:4751 +msgid "" +"``scale_factor`` is a float that must be greater than 1.0. A higher scale" +" factor will run faster but will have much poorer image matches. A good " +"value is between 1.35 and 1.5." +msgstr "" +"``scale_factor`` " +"是一个浮点数,必须大于1.0。较高的比例因子会运行得更快,但图像匹配效果会大打折扣。一个好的值介于1.35和1.5之间。" + +#: ../../library/omv.image.rst:4755 +msgid "" +"``max_keypoints`` is the maximum number of keypoints a keypoint object " +"may hold. If keypoint objects are too big and causing out of RAM issues " +"then decrease this value." +msgstr "``max_keypoints`` 是一个关键点对象可以持有的最大关键点数。如果关键点对象太大并导致内存不足问题,则减小此值。" + +#: ../../library/omv.image.rst:4759 +msgid "" +"``corner_detector`` is the corner detector algorithm to use which " +"extracts keypoints from the image. It can be either `image.CORNER_FAST` " +"or `image.CORNER_AGAST`. The FAST corner detector is faster but much less" +" accurate." +msgstr "" +"``corner_detector`` 是用于提取图像关键点的角点检测算法。可以是 `image.CORNER_FAST` 或 " +"`image.CORNER_AGAST`。FAST角点检测算法速度更快,但准确度较低。" + +#: ../../library/omv.image.rst:4767 +msgid "Turns the image to black and white leaving only the edges as white pixels." +msgstr "将图像转换为黑白图像,仅保留边缘为白色像素。" + +#: ../../library/omv.image.rst:4769 +msgid "image.EDGE_SIMPLE - Simple thresholded high pass filter algorithm." +msgstr "image.EDGE_SIMPLE - 简单的阈值高通滤波算法。" + +#: ../../library/omv.image.rst:4770 +msgid "image.EDGE_CANNY - Canny edge detection algorithm." +msgstr "image.EDGE_CANNY - Canny边缘检测算法。" + +#: ../../library/omv.image.rst:4772 +msgid "" +"``threshold`` is a two valued tuple containing a low threshold and high " +"threshold. You can control the quality of edges by adjusting these " +"values. It defaults to (100, 200)." +msgstr "``threshold`` 是包含低阈值和高阈值的两个值的元组,您可以通过调整这些值来控制边缘的质量。默认为 (100, 200)。" + +#: ../../library/omv.image.rst:4780 +msgid "" +"Replaces the pixels in the ROI with HOG (histogram of orientated " +"graidients) lines." +msgstr "用HOG(方向梯度直方图)线替换ROI中的像素。" + +#: ../../library/omv.image.rst:4793 +msgid "" +"Takes a double wide grayscale image that contains the output of two " +"camera sensors side-by-side and replaces one of the images in the double " +"wide image with the stero-disparity image where each pixel reprsents " +"depth. E.g. if you have two 320x240 cameras then this method takes a " +"640x240 image." +msgstr "" +"处理一个双宽灰度图像,该图像由两个摄像头传感器的输出并排组成,并用立体视差图像替换双宽图像中的其中一个图像,其中每个像素表示深度。例如,如果您有两个" +" 320x240 的摄像头,那么此方法将处理一个 640x240 的图像。" + +#: ../../library/omv.image.rst:4798 +msgid "" +"``reversed`` By default the left image is compared to the right image and" +" the right image is then replaced. Pass true to compare the right image " +"to the left image and replace the left image." +msgstr "``reversed`` 默认情况下,将左图像与右图像进行比较,然后替换右图像。传递true以将右图像与左图像进行比较并替换左图像。" + +#: ../../library/omv.image.rst:4804 +msgid "" +"The algorithm only works comparing left->right or right->left. If your " +"camrea setup does not match this then you will get useless results." +msgstr "该算法仅适用于左->右或右->左比较。如果您的相机设置不匹配,则会得到无用的结果。" + +#: ../../library/omv.image.rst:4807 +msgid "" +"``max_disparity`` is the maximum distance to search for a matching pixel " +"block using the sum-of-absolute differences algorith. Larger values take " +"exponentially longer to search with but result in higher quality images. " +"Lower values make the algorithm run faster but may result in nonsense " +"output." +msgstr "" +"``max_disparity`` " +"是使用绝对差值和算法搜索匹配像素块时的最大距离。较大的值会显著增加搜索时间,但能生成更高质量的图像;较小的值会加快算法运行速度,但可能产生无意义的输出。" + +#: ../../library/omv.image.rst:4812 +msgid "" +"``threshold`` if the sum-of-absolute differences between two blocks is " +"less than or equal to this threshold they are considered to be matching." +msgstr "``threshold`` 如果两个块之间的绝对差值之和小于或等于此阈值,则认为它们匹配。" + +#: ../../library/omv.image.rst:4815 +msgid "This method is only available on the Arduino Portenta." +msgstr "此方法仅适用于Arduino Portenta。" + +#: ../../library/omv.image.rst:4819 +msgid "" +"Even with our best SIMD effort this algorithm is not real-time on the " +"Cortex-M7 processor. This is just a toy example algorithm showing off " +"stero-disparity." +msgstr "即使在我们最好的SIMD努力下,该算法在Cortex-M7处理器上也不是实时的。这只是一个玩具示例算法,展示立体视差。" + +#: ../../library/omv.image.rst:4823 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.image.rst:4828 +msgid "BINARY (bitmap) pixel format. Each pixel is 1-bit." +msgstr "二进制(位图)像素格式。每个像素为1位。" + +#: ../../library/omv.image.rst:4833 +msgid "GRAYSCALE pixel format. Each pixel is 8-bits, 1-byte." +msgstr "灰度像素格式。每个像素为8位,即1字节。" + +#: ../../library/omv.image.rst:4838 +msgid "" +"RGB565 pixel format. Each pixel is 16-bits, 2-bytes. 5-bits are used for " +"red, 6-bits are used for green, and 5-bits are used for blue." +msgstr "RGB565像素格式。每个像素为16位,即2字节。5位用于红色,6位用于绿色,5位用于蓝色。" + +#: ../../library/omv.image.rst:4844 +msgid "" +"RAW BAYER image pixel format. If you try to make the frame size too big " +"to fit in the frame buffer your OpenMV Cam will set the pixel format to " +"BAYER so that you can capture images but no image processing methods will" +" be operational." +msgstr "" +"原始BAYER图像像素格式。如果尝试将帧大小设置得太大而无法适应帧缓冲区,则OpenMV " +"Cam将像素格式设置为BAYER,以便您可以捕获图像,但不会进行任何图像处理方法。" + +#: ../../library/omv.image.rst:4852 +msgid "" +"A pixel format that is very easy to jpeg compress. Each pixel is stored " +"as a grayscale 8-bit Y value followed by alternating 8-bit U/V color " +"values that are shared between two Y values (8-bits Y1, 8-bits U, 8-bits " +"Y2, 8-bits V, etc.). Only some image processing methods work with YUV422." +msgstr "非常容易进行JPEG压缩的像素格式。每个像素都存储为一个灰度8位Y值,后跟交替的8位U/V颜色值,这些值在两个Y值之间共享(8位Y1,8位U,8位Y2,8位V,等等)。只有一些图像处理方法适用于YUV422。" + +#: ../../library/omv.image.rst:4860 +msgid "A JPEG image." +msgstr "JPEG图像。" + +#: ../../library/omv.image.rst:4865 +msgid "A PNG image." +msgstr "PNG图像。" + +#: ../../library/omv.image.rst:4870 +msgid "" +"Default OpenMV Cam color palette for thermal images using a smooth color " +"wheel." +msgstr "OpenMV Cam的默认热像仪颜色调色板,使用平滑的颜色轮。" + +#: ../../library/omv.image.rst:4875 +msgid "" +"Makes images look like the FLIR Lepton thermal images using a very non-" +"linear color palette." +msgstr "使用非常非线性的颜色调色板使图像看起来像FLIR Lepton热成像。" + +#: ../../library/omv.image.rst:4880 +msgid "Depth color palette for depth images." +msgstr "用于深度图像的深度调色板。" + +#: ../../library/omv.image.rst:4885 +msgid "Dark background color palette for event images." +msgstr "用于事件图像的深色背景调色板。" + +#: ../../library/omv.image.rst:4890 +msgid "Light background color palette for event images." +msgstr "用于事件图像的浅色背景调色板。" + +#: ../../library/omv.image.rst:4895 +msgid "" +"Use area scaling when downscaling an image (Nearest Neighbor is used for " +"upscaling)." +msgstr "在缩小图像时使用区域缩放(放大时使用最近邻方法)。" + +#: ../../library/omv.image.rst:4897 +msgid "" +"You should use area scaling when downscaling for the highest visual " +"quality." +msgstr "当缩小图像以获得最高的视觉质量时,应使用区域缩放。" + +#: ../../library/omv.image.rst:4902 +msgid "" +"Use bilinear scaling when upscaling an image. This produces a good " +"quality scaled image output and is fast." +msgstr "在放大图像时使用双线性缩放。这会产生良好质量的缩放图像输出,并且速度较快。" + +#: ../../library/omv.image.rst:4905 ../../library/omv.image.rst:4914 +msgid "" +"When downscaling an image this method will subsample the input image to " +"produce the downscaled image. Use `image.AREA` for the higest quality " +"downscaling if speed is not an issue." +msgstr "当缩小图像时,此方法会对输入图像进行子采样以生成缩小后的图像。如果速度不是问题,可使用 `image.AREA` 方法以获得最高质量的缩小效果。" + +#: ../../library/omv.image.rst:4911 +msgid "" +"Use bicubic scaling when upscaling an image. This produces a high quality" +" scaled image output, but is slow." +msgstr "在放大图像时使用双三次插值。这会产生高质量的缩放图像输出,但速度较慢。" + +#: ../../library/omv.image.rst:4920 +msgid "Vertically flip the image being drawn by `draw_image`." +msgstr "垂直翻转由 `draw_image` 绘制的图像。" + +#: ../../library/omv.image.rst:4925 +msgid "Horizontally mirror the image being drawn by `draw_image`." +msgstr "水平镜像由 `draw_image` 绘制的图像。" + +#: ../../library/omv.image.rst:4930 +msgid "Transpose (swap x/y) the image being draw by `draw_image`." +msgstr "转置(交换x/y)由 `draw_image` 绘制的图像。" + +#: ../../library/omv.image.rst:4935 +msgid "" +"Center the image being drawn to the center of the image/canvas it's being" +" drawn on. Any x/y offsets passed will move the image being drawn from " +"the center by that amount." +msgstr "将要绘制的图像居中绘制到其绘制的图像/画布中。传递的任何x/y偏移量将通过该偏移量将要绘制的图像从中心移动。" + +#: ../../library/omv.image.rst:4941 +msgid "" +"When extracting an RGB channel from an RGB image using `draw_image` " +"extract the channel first before scaling versus afterwards to prevent any" +" artifacts." +msgstr "使用 `draw_image` 从RGB图像中提取RGB通道,首先提取通道,然后进行缩放,以避免任何伪影。" + +#: ../../library/omv.image.rst:4947 +msgid "" +"When applying a color lookup table to an image using `draw_image` apply " +"the color look table first before scaling versus afterwards to prevent " +"any artifacts." +msgstr "使用 `draw_image` 将颜色查找表应用于图像时,首先应用颜色查找表,然后进行缩放,以避免任何伪影。" + +#: ../../library/omv.image.rst:4953 +msgid "" +"Scale the image being drawn to fit inside of the image/canvas being drawn" +" on while maintaining the aspect ratio. Unless the image aspect ratios " +"match the image being drawn will not completley cover the image/canvas " +"being drawn on. Any x_scale/y_scale values passed will additionally scale" +" the scaled image." +msgstr "" +"将绘制的图像缩放以适应绘制的图像/画布,同时保持纵横比。除非图像的纵横比匹配,否则绘制的图像将无法完全覆盖目标图像/画布。传递的任何 " +"x_scale/y_scale 值将进一步缩放已缩放的图像。" + +#: ../../library/omv.image.rst:4961 +msgid "" +"Scale the image being drawn to fill image/canvas being drawn on while " +"maintaining the aspect ratio. Unless the image aspect ratios match the " +"image being drawn will be cropped. Any x_scale/y_scale values passed will" +" additionally scale the scaled image." +msgstr "将要绘制的图像缩放以填充绘制的图像/画布,同时保持纵横比。除非图像的纵横比匹配,否则将裁剪绘制的图像。传递的任何x_scale/y_scale值还将缩放缩放后的图像。" + +#: ../../library/omv.image.rst:4968 +msgid "" +"Scale the image being drawn to fill the image/canvas being drawn on. This" +" does not maintain the aspect ratio of the image being drawn. Any " +"x_scale/y_scale values passed will additionally scale the scaled image." +msgstr "将要绘制的图像缩放以填充绘制的图像/画布。这不会保持绘制的图像的纵横比。传递的任何x_scale/y_scale值还将缩放缩放后的图像。" + +#: ../../library/omv.image.rst:4975 +msgid "" +"Speeds up `draw_image` when drawing on a black destination image when " +"using alpha effects that require reading both source and destination " +"pixels. This skips reading the destination pixel." +msgstr "在黑色目标图像上绘制图像时加快 `draw_image` 的速度,当使用需要读取源像素和目标像素的alpha效果时,跳过读取目标像素。" + +#: ../../library/omv.image.rst:4981 +msgid "" +"Rotate the image by 90 degrees (this is just `image.VFLIP` ORed with " +"`image.TRANSPOSE`)." +msgstr "将图像旋转90度(这只是 `image.VFLIP` 与 `image.TRANSPOSE` 进行“或”运算)。" + +#: ../../library/omv.image.rst:4986 +msgid "" +"Rotate the image by 180 degrees (this is just `image.HMIRROR` ORed with " +"`image.VFLIP`)." +msgstr "将图像旋转180度(这只是 `image.HMIRROR` 与 `image.VFLIP` 进行“或”运算)。" + +#: ../../library/omv.image.rst:4991 +msgid "" +"Rotate the image by 270 degrees (this is just `image.HMIRROR` ORed with " +"`image.TRANSPOSE`)." +msgstr "将图像旋转270度(这只是 `image.HMIRROR` 与 `image.TRANSPOSE` 进行“或”运算)。" + +#: ../../library/omv.image.rst:4996 +msgid "" +"Automatically select the best JPEG subsampling based on the image quality" +" parameter." +msgstr "根据图像质量参数自动选择最佳的 JPEG 子采样方式。" + +#: ../../library/omv.image.rst:5001 +msgid "Use 4:4:4 JPEG subsampling." +msgstr "使用 4:4:4 JPEG 子采样。" + +#: ../../library/omv.image.rst:5006 +msgid "" +"Use 4:2:2 JPEG subsampling. Note, you should force the jpeg subsampling " +"to be 4:2:2 if you are streaming video via MJPEG for the best " +"compatibility with third-party video players." +msgstr "" +"使用 4:2:2 JPEG 子采样。注意,如果您通过 MJPEG 流式传输视频,为了与第三方视频播放器的最佳兼容性,应该强制将 JPEG " +"子采样设置为 4:2:2。" + +#: ../../library/omv.image.rst:5012 +msgid "Use 4:2:0 JPEG subsampling." +msgstr "使用 4:2:0 JPEG 子采样。" + +#: ../../library/omv.image.rst:5017 +msgid "Exhaustive template matching search." +msgstr "详尽的模板匹配搜索。" + +#: ../../library/omv.image.rst:5022 +msgid "Faster template matching search." +msgstr "更快的模板匹配搜索。" + +#: ../../library/omv.image.rst:5027 +msgid "" +"Use the canny edge detection algorithm for doing edge detection on an " +"image." +msgstr "使用Canny边缘检测算法进行图像边缘检测。" + +#: ../../library/omv.image.rst:5032 +msgid "" +"Use a simple thresholded high pass filter algorithm for doing edge " +"detection on an image." +msgstr "使用简单的阈值高通滤波算法进行图像边缘检测。" + +#: ../../library/omv.image.rst:5038 +msgid "Faster and less accurate corner detection algorithm for ORB keypoints." +msgstr "针对 ORB 关键点的更快、精度更低的角点检测算法。" + +#: ../../library/omv.image.rst:5043 +msgid "Slower and more accurate corner detection algorithm for ORB keypoints." +msgstr "针对ORB关键点的较慢且准确度较高的角点检测算法。" + +#: ../../library/omv.image.rst:5048 +msgid "TAG1H5 tag family bit mask enum. Used for AprilTags." +msgstr "TAG1H5标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5053 +msgid "TAG25H7 tag family bit mask enum. Used for AprilTags." +msgstr "TAG25H7标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5058 +msgid "TAG25H9 tag family bit mask enum. Used for AprilTags." +msgstr "TAG25H9标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5063 +msgid "TAG36H10 tag family bit mask enum. Used for AprilTags." +msgstr "TAG36H10标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5068 +msgid "TAG36H11 tag family bit mask enum. Used for AprilTags." +msgstr "TAG36H11标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5073 +msgid "ARTOOLKIT tag family bit mask enum. Used for AprilTags." +msgstr "ARTOOLKIT标签族位掩码枚举。用于AprilTags。" + +#: ../../library/omv.image.rst:5078 +msgid "EAN2 barcode type enum." +msgstr "EAN2条形码类型枚举。" + +#: ../../library/omv.image.rst:5083 +msgid "EAN5 barcode type enum." +msgstr "EAN5条形码类型枚举。" + +#: ../../library/omv.image.rst:5088 +msgid "EAN8 barcode type enum." +msgstr "EAN8条形码类型枚举。" + +#: ../../library/omv.image.rst:5093 +msgid "UPCE barcode type enum." +msgstr "UPCE条形码类型枚举。" + +#: ../../library/omv.image.rst:5098 +msgid "ISBN10 barcode type enum." +msgstr "ISBN10条形码类型枚举。" + +#: ../../library/omv.image.rst:5103 +msgid "UPCA barcode type enum." +msgstr "UPCA条形码类型枚举。" + +#: ../../library/omv.image.rst:5108 +msgid "EAN13 barcode type enum." +msgstr "EAN13条形码类型枚举。" + +#: ../../library/omv.image.rst:5113 +msgid "ISBN13 barcode type enum." +msgstr "ISBN13条形码类型枚举。" + +#: ../../library/omv.image.rst:5118 +msgid "I25 barcode type enum." +msgstr "I25条形码类型枚举。" + +#: ../../library/omv.image.rst:5123 +msgid "DATABAR barcode type enum." +msgstr "DATABAR条形码类型枚举。" + +#: ../../library/omv.image.rst:5128 +msgid "DATABAR_EXP barcode type enum." +msgstr "DATABAR_EXP条形码类型枚举。" + +#: ../../library/omv.image.rst:5133 +msgid "CODABAR barcode type enum." +msgstr "CODABAR条形码类型枚举。" + +#: ../../library/omv.image.rst:5138 +msgid "CODE39 barcode type enum." +msgstr "CODE39条形码类型枚举。" + +#: ../../library/omv.image.rst:5143 +msgid "PDF417 barcode type enum - Future (e.g. doesn't work right now)." +msgstr "PDF417条形码类型枚举 - 未来(例如,目前无法正常工作)。" + +#: ../../library/omv.image.rst:5148 +msgid "CODE93 barcode type enum." +msgstr "CODE93条形码类型枚举。" + +#: ../../library/omv.image.rst:5153 +msgid "CODE128 barcode type enum." +msgstr "CODE128条形码类型枚举。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.imu.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.imu.po new file mode 100644 index 0000000000000..8322850cb0f45 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.imu.po @@ -0,0 +1,112 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.imu.rst:2 +msgid ":mod:`imu` --- imu sensor" +msgstr ":mod:`imu` --- IMU 传感器" + +#: ../../library/omv.imu.rst:7 +msgid "" +"The ``imu`` module is used for reading the IMU sensor under the camera " +"sensor." +msgstr "``imu`` 模块用于读取摄像头传感器下的 IMU 传感器。" + +#: ../../library/omv.imu.rst:11 +msgid "The IMU sensor (and this module) is not present on all OpenMV Cam models." +msgstr "IMU传感器(以及此模块)并非所有OpenMV Cam型号都具备。" + +#: ../../library/omv.imu.rst:14 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.imu.rst:18 +msgid "Returns the acceleration for (x, y, z) in a float tuple in milli-g's." +msgstr "返回浮点元组中(x,y,z)的加速度,单位为毫克(mg)。" + +#: ../../library/omv.imu.rst:20 ../../library/omv.imu.rst:30 +msgid "For when the camera board is lying on a table face up:" +msgstr "当摄像头板面朝上放在桌子上时:" + +#: ../../library/omv.imu.rst:22 ../../library/omv.imu.rst:32 +msgid "" +"X points to the right of the camera sensor Y points down below the camera" +" sensor (towards the bottom on the board) Z points in the reverse " +"direction of the camera sensor (into the table)" +msgstr "X 指向相机传感器的右侧 Y 指向相机传感器下方(朝向板子的底部) Z 指向相机传感器的相反方向(进入桌子)" + +#: ../../library/omv.imu.rst:28 +msgid "" +"Returns the angular rate for (x, y, z) in a float tuple in milli-degrees-" +"per-second." +msgstr "返回以毫度每秒(mdps)为单位的角速率 (x, y, z) 的浮点元组。" + +#: ../../library/omv.imu.rst:38 +msgid "Not available if the IMU only provides acceleration data." +msgstr "如果 IMU 仅提供加速度数据,则不可用。" + +#: ../../library/omv.imu.rst:42 +msgid "Returns the temperature in celsius (float)." +msgstr "返回摄氏温度(浮点数)。" + +#: ../../library/omv.imu.rst:46 ../../library/omv.imu.rst:55 +msgid "Returns the rotation angle in degrees (float) of the camera module." +msgstr "返回相机模块以度为单位(浮点数)的旋转角度。" + +#: ../../library/omv.imu.rst:48 ../../library/omv.imu.rst:57 +msgid "0 -> Camera is standing up." +msgstr "0 -> 相机直立。" + +#: ../../library/omv.imu.rst:49 +msgid "90 -> Camera is roated left." +msgstr "90 -> 相机向左旋转。" + +#: ../../library/omv.imu.rst:50 ../../library/omv.imu.rst:59 +msgid "180 -> Camera is upside down." +msgstr "180 -> 相机倒置。" + +#: ../../library/omv.imu.rst:51 +msgid "270 -> Camera is rotated right." +msgstr "270 -> 相机向右旋转。" + +#: ../../library/omv.imu.rst:58 +msgid "90 -> Camera is pointing down." +msgstr "90 -> 相机向下指向。" + +#: ../../library/omv.imu.rst:60 +msgid "270 -> Camera is pointing up." +msgstr "270 -> 相机向上指向。" + +#: ../../library/omv.imu.rst:64 +msgid "" +"Pass ``True`` to put the IMU sensor to sleep. ``False`` to wake it back " +"up (the default)." +msgstr "传入 ``True`` 将 IMU 传感器置于睡眠状态。传入 ``False`` 将其唤醒(默认情况下)。" + +#: ../../library/omv.imu.rst:68 +msgid "Set a register ``addr`` to a ``val``." +msgstr "将寄存器 ``addr`` 设置为 ``val``。" + +#: ../../library/omv.imu.rst:72 +msgid "Get a register from ``addr``." +msgstr "获取寄存器 ``addr`` 的值。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.mjpeg.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.mjpeg.po new file mode 100644 index 0000000000000..9c88a2d6a7e91 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.mjpeg.po @@ -0,0 +1,277 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.mjpeg.rst:2 +msgid ":mod:`mjpeg` --- mjpeg recording" +msgstr ":mod:`mjpeg` --- mjpeg 录音" + +#: ../../library/omv.mjpeg.rst:7 +msgid "The ``mjpeg`` module is used for mjpeg recording." +msgstr "``mjpeg`` 模块用于mjpeg录音。" + +#: ../../library/omv.mjpeg.rst:10 +msgid "class Mjpeg -- Mjpeg recorder" +msgstr "class Mjpeg -- Mjpeg 记录器" + +#: ../../library/omv.mjpeg.rst:12 +msgid "" +"You can use the mjpeg module to record large video clips. Note that mjpeg" +" files save compressed image data. So, they are best for recording long " +"video clips that you want to share. Use `gif` for short clips." +msgstr "" +"您可以使用mjpeg模块来录制大型视频片段。请注意,mjpeg文件保存压缩图像数据。因此,它们最适合录制您想要分享的长视频片段。短视频片段用 " +"`gif` 。" + +#: ../../library/omv.mjpeg.rst:16 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/omv.mjpeg.rst:39 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.mjpeg.rst:43 +msgid "" +"Create a Mjpeg object which you can add frames to. ``filename`` is the " +"path to save the mjpeg recording to." +msgstr "创建一个可以添加帧的Mjpeg对象。``filename`` 是保存mjpeg录制的路径。" + +#: ../../library/omv.mjpeg.rst:46 +msgid "" +"``width`` is automatically set equal to the image sensor horizontal " +"resolution unless explicitly overridden." +msgstr "``width`` 被自动设置为图像传感器的水平分辨率,除非明确覆盖。" + +#: ../../library/omv.mjpeg.rst:49 +msgid "" +"``height`` is automatically set equal to the image sensor vertical " +"resolution unless explicitly overridden." +msgstr "``height`` 被自动设置为图像传感器的垂直分辨率,除非明确覆盖。" + +#: ../../library/omv.mjpeg.rst:53 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.mjpeg.rst:57 +msgid "" +"Return True if the file was closed. You cannot write more data to a " +"closed file." +msgstr "如果文件关闭则返回True。您不能向已关闭的文件写入更多数据。" + +#: ../../library/omv.mjpeg.rst:61 +msgid "Returns the width (horizontal resolution) for the mjpeg file." +msgstr "返回mjpeg文件的宽度(水平分辨率)。" + +#: ../../library/omv.mjpeg.rst:65 +msgid "Returns the height (vertical resolution) for the mjpeg file." +msgstr "返回mjpeg的高度(垂直分辨率)。" + +#: ../../library/omv.mjpeg.rst:69 +msgid "Returns the number of frames in the mjpeg file." +msgstr "返回mjpeg文件的帧数。" + +#: ../../library/omv.mjpeg.rst:73 +msgid "" +"Returns the file size in bytes of the mjpeg so far. This value is updated" +" after adding frames." +msgstr "返回目前为止mjpeg的文件大小(以字节为单位)。添加帧后会更新此值。" + +#: ../../library/omv.mjpeg.rst:77 +msgid "" +"Add an image to the mjpeg recording. The added image is automatically " +"scaled up/down while preserving the aspect-ratio to the resolution " +"specified when the mjpeg file was created." +msgstr "向mjpeg录制添加图像。添加的图像会自动放大/缩小,同时保持与创建mjpeg文件时指定的分辨率相同的宽高比。" + +#: ../../library/omv.mjpeg.rst:80 +msgid "" +"``image`` can be any image format. Even PNG images or JPEG images at the " +"wrong resolution. This method will automatically decompress, " +"scale/convert, and re-compress images for the file." +msgstr "``image`` 可以是任何图像格式。甚至是分辨率错误的PNG图像或JPEG图像。此方法将自动为文件解压、缩放/转换和重新压缩图像。" + +#: ../../library/omv.mjpeg.rst:83 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"image. This allows you to extract just the pixels in the ROI. By default " +"this is the whole image." +msgstr "``roi`` 是图像的感兴趣区域矩形元组(x, y, w, h)。这允许您仅提取ROI中的像素。默认情况下,这是整个图像。" + +#: ../../library/omv.mjpeg.rst:86 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render onto the destination. For example," +" if you pass ``rgb_channel=1`` this will extract the green channel of the" +" source RGB565 image and draw that in grayscale on the destination." +msgstr "" +"``rgb_channel`` 是RGB通道(0=R, G=1, B=2)从RGB565图像(如果传递)中提取并渲染到目的地。例如,如果您传递 " +"``rgb_channel=1``,这将提取源RGB565图像的绿色通道,并在目标上以灰度绘制。" + +#: ../../library/omv.mjpeg.rst:91 +msgid "" +"``alpha`` controls how much of the source image to blend into the " +"destination. A value of 255 draws an opaque source image while a value " +"lower than 255 produces a blend between the source and destination (which" +" is a black background in this case). 0 results in a black image." +msgstr "" +"``alpha`` " +"控制源图像与目标图像混合的程度。值 255 绘制不透明的源图像,而值低于 255 则生成源图像和目标之间的混合图像(在本例中为黑色背景)。0 的结果是黑色图像。" + +#: ../../library/omv.mjpeg.rst:95 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the source image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1``,可以是调色板枚举值,或者总像素 256 的 RGB565 " +"图像,用作对源图像的灰度值进行颜色查找表。如果使用,此操作将在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.mjpeg.rst:99 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the source image being drawn at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总像素256 的 GRAYSCALE 图像,用作调制被绘制到像素级别的源图像的 " +"``alpha`` 值的 alpha 调色板,从而允许您根据它们的灰度值精确控制像素的 alpha 值。在 alpha 查找表中的像素值为 255" +" 时是不透明的,小于 255 的任何值都会变得更透明,直到 0。如果使用,此操作将在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.mjpeg.rst:105 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.mjpeg.rst:107 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.mjpeg.rst:108 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.mjpeg.rst:109 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.mjpeg.rst:110 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.mjpeg.rst:111 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.mjpeg.rst:112 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.mjpeg.rst:113 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.mjpeg.rst:114 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.mjpeg.rst:115 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.mjpeg.rst:116 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.mjpeg.rst:117 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.mjpeg.rst:118 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.mjpeg.rst:119 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.mjpeg.rst:120 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.mjpeg.rst:121 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.mjpeg.rst:123 +msgid "" +"``quality`` is the compression quality (0-100) (int) to be used for non-" +"JPEG images." +msgstr "``quality`` 是用于非jpeg图像的压缩质量(0-100)(int)。" + +#: ../../library/omv.mjpeg.rst:125 ../../library/omv.mjpeg.rst:136 +#: ../../library/omv.mjpeg.rst:143 +msgid "Returns the object." +msgstr "返回对象。" + +#: ../../library/omv.mjpeg.rst:129 +msgid "Alias for `Mjpeg.add_frame()`." +msgstr "`Mjpeg.add_frame()` 的别称。" + +#: ../../library/omv.mjpeg.rst:133 +msgid "" +"Flushes the mjpeg file to disk but keeps the file open for writing more " +"data. You should call flush periodically ensure that the file is saved to" +" disk." +msgstr "将mjpeg文件刷新到磁盘,但保持文件打开以写入更多数据。您应该定期调用flush以确保文件保存到磁盘。" + +#: ../../library/omv.mjpeg.rst:140 +msgid "" +"Finalizes the mjpeg recording. This method must be called once the " +"recording is complete to make the file viewable." +msgstr "完成mjpeg录制。录制完成后必须调用此方法才能查看文件。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.apps.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.apps.po new file mode 100644 index 0000000000000..7d48615945721 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.apps.po @@ -0,0 +1,116 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:30+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.ml.apps.rst:4 +msgid ":mod:`ml.apps` --- ML Apps" +msgstr ":mod:`ml.apps` --- ML Apps" + +#: ../../library/omv.ml.apps.rst:9 +msgid "The `ml.apps` module contains various ML application classes." +msgstr "`ml.apps` 模块包含各种机器学习应用类。" + +#: ../../library/omv.ml.apps.rst:14 +msgid "class MicroSpeech -- Speech Recognition" +msgstr "class MicroSpeech -- 语音识别" + +#: ../../library/omv.ml.apps.rst:16 +msgid "" +"The MicroSpeech object is used to recognize simple spoken words using the" +" MicroSpeech model from TensorFlow Lite for Microcontrollers. The model " +"recognizes the words \"yes\" and \"no\" by default." +msgstr "" +"MicroSpeech对象用于使用TensorFlow Lite for Microcontrollers中的MicroSpeech模" +"型识别简单的口语单词。默认情况下,该模型识别“yes”和“no”这两个词。" + +#: ../../library/omv.ml.apps.rst:19 +msgid "" +"You can customize the model to recognize other words by training a new " +"model. See the `Micro Speech `__ guide." +msgstr "" +"您可以通过训练一个新模型来自定义该模型,以识别其他单词。请参阅 `Micro Speech " +"`__ 指南。" + +#: ../../library/omv.ml.apps.rst:24 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.ml.apps.rst:28 +msgid "" +"Creates a MicroSpeech object. If no preprocessor is provided, the default" +" preprocessor is used. If no micro_speech model is provided, the default " +"model is used. If no labels are provided, the default labels are used " +"from the default model." +msgstr "" +"创建一个MicroSpeech对象。如果没有提供预处理器,则使用默认的预处理器。如果没有" +"提供micro_speech模型,则使用默认模型。如果没有提供标签,则使用默认模型中的默" +"认标签。" + +#: ../../library/omv.ml.apps.rst:33 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.ml.apps.rst:37 +msgid "" +"Listens for a spoken word and returns the word and confidence level as a " +"tuple if the confidence level is above the threshold and the word is in " +"the filter list." +msgstr "监听一个口语单词,并在置信度超过阈值且该单词在过滤列表中时,返回该单词和置信" +"度水平的元组。" + +#: ../../library/omv.ml.apps.rst:40 +msgid "" +"``timeout`` is the maximum time in milliseconds to listen for a word. If " +"zero, the method will listen indefinitely until a word is recognized. If " +"-1 is passed, the method will not block and will return immediately with " +"the result tuple which may contain ``None`` if no word is recognized. If " +"a positive value is passed, the method will listen for that amount of " +"time in milliseconds and then return the result tuple." +msgstr "" +"``timeout`` 是监听一个单词的最大时间(以毫秒为单位)。如果为零,则该方法将无限期地监听,直到识别到一个单词。如果传入-1,该方法将不会阻" +"塞,并会立即返回结果元组,如果未识别到任何单词,元组中可能包含 " +"``None``。如果传入一个正值,该方法将在该时间(以毫秒为单位)内监听,然后返回结果元组。" + +#: ../../library/omv.ml.apps.rst:46 +msgid "" +"``callback`` is a function that will be called with the word and " +"confidence level instead of returning the result. When combined with a " +"timeout of zero, this allows you to listen for words indefinitely and " +"process them as they are recognized." +msgstr "" +"``callback`` 是一个函数,当识别到单词时,它将被调用,并传入单词和置信度水平," +"而不是返回结果。当与零超时结合使用时,这允许您无限期地监听单词,并在单词被识" +"别时进行处理。" + +#: ../../library/omv.ml.apps.rst:50 +msgid "``threshold`` is the minimum confidence level required to return a result." +msgstr "``threshold`` 是返回结果所需的最低置信度水平。" + +#: ../../library/omv.ml.apps.rst:52 +msgid "" +"``filter`` is a list of words that the model should recognize. If the " +"recognized word is not in the filter list, the result is ignored." +msgstr "``filter`` 是一个单词列表,模型应该识别这些单词。如果识别到的单词不在过滤列表" +"中,则该结果将被忽略。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.po new file mode 100644 index 0000000000000..57a9e54cb7e2e --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.po @@ -0,0 +1,313 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.rst:2 +msgid ":mod:`ml` --- Machine Learning" +msgstr ":mod:`ml` --- 机器学习" + +#: ../../library/omv.ml.rst:7 +msgid "" +"The `ml` module contains functionality for processing machine learning " +"models on the OpenMV Cam." +msgstr "`ml` 模块包含在 OpenMV Cam 上处理机器学习模型的功能。" + +#: ../../library/omv.ml.rst:9 +msgid "" +"The heart of the `ml` module is the `Model()` object which is used to " +"load and execute TensorFlow Lite models. The `Model()` object accepts a " +"list of up to 4D input tensors for each model input tensor and returns a " +"list of up to 4D output tensors for each model output tensor. Each " +"input/output tensor works using a numpy ``ndarray``." +msgstr "" +"`ml` 模块的核心是 `Model()` 对象,用于加载和执行 TensorFlow Lite 模型。`Model()` 对象接受一个最多为 " +"4D 的输入张量列表,表示每个模型输入张量,并返回一个最多为 4D 的输出张量列表,表示每个模型输出张量。每个输入/输出张量都使用 numpy 的" +" ``ndarray`` 进行操作。" + +#: ../../library/omv.ml.rst:14 +msgid "" +"For TensorFlow Lite models, the `Model()` object handles all ops enabled " +"`here " +"`_." +" The `Model()` object will automatically leverage CMSIS-NN, Helium, and " +"an Ethos NPU if available to speed up inference. Availability of these " +"accelerators is dependent on the OpenMV Cam model." +msgstr "" +"对于 TensorFlow Lite 模型,`Model()` 对象处理所有启用的操作,具体见 " +"[此处](https://github.com/openmv/openmv/blob/master/src/lib/tflm/tflm_backend.cc)。`Model()`" +" 对象会自动利用 CMSIS-NN、Helium 和 Ethos NPU(如果可用)来加速推理。这些加速器的可用性取决于 OpenMV Cam " +"的型号。" + +#: ../../library/omv.ml.rst:19 +msgid "" +"For image processing support the `ml` module automatically converts " +"passed image objects to numpy ``ndarray`` objects by wrapping them with " +"the `Normalization()` object which handles this conversion. The " +"`Normalization()` object can also be manually created to control the " +"conversion process, select an ROI, and etc." +msgstr "" +"对于图像处理支持,`ml` 模块会通过将传递的图像对象包装在 `Normalization()` " +"对象中,自动将其转换为 numpy ``ndarray`` 对象,该对象负责处理这一转换过程。 `Normalization()` " +"对象也可以手动创建,以便控制转换过程、选择感兴趣区域(ROI)等。" + +#: ../../library/omv.ml.rst:24 +msgid "" +"For more information on ``ndarray`` objects see the `ulab documentation " +"`_. All OpenMV Cams " +"support ndarray objects up to rank 4 (meaning 4D tensors)." +msgstr "" +"有关 ``ndarray`` 对象的更多信息,请参阅 `ulab documentation " +"`_。所有 OpenMV Cam " +"都支持最多 4 维的 ndarray 对象(即 4D 张量)。" + +#: ../../library/omv.ml.rst:30 +msgid "" +"Complex number support and the `scipy special module `_ are " +"currently disabled on all OpenMV Cams at the moment to save flash space." +msgstr "" +"为了节省闪存空间,目前所有 OpenMV Cam 上都禁用了复数支持和 `scipy special module " +"`_。" + +#: ../../library/omv.ml.rst:34 +msgid "Sub Modules" +msgstr "子模块" + +#: ../../library/omv.ml.rst:49 +msgid "class model -- Model Container" +msgstr "类 model -- 模型容器" + +#: ../../library/omv.ml.rst:51 +msgid "" +"A model object is used to load and execute TensorFlow Lite models. The " +"model object accepts a list of up to 4D input tensors per model " +"corresponding to the number of tensor inputs of the model and returns a " +"list of up to 4D output tensors corresponding to the number of tensor " +"outputs of the model. Each input/output tensor is an numpy ``ndarray``." +msgstr "" +"模型对象用于加载和执行 TensorFlow Lite 模型。该模型对象接受一个最多为 4D " +"的输入张量列表,每个输入张量对应模型的输入张量数量,并返回一个最多为 4D 的输出张量列表,对应模型的输出张量数量。每个输入/输出张量都是一个 " +"numpy ``ndarray``。" + +#: ../../library/omv.ml.rst:57 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.ml.rst:61 +msgid "" +"Loads a model from ``path`` into memory and prepares it for being " +"executed. ``path`` can either be a file on disk or the name of a built-in" +" model which will be loaded from internal flash. Models that are built-in" +" to the internal flash firmware image do not take up RAM to store the " +"model weights when used." +msgstr "" +"从 ``path`` 加载模型到内存并准备执行。``path`` " +"可以是磁盘上的文件路径,也可以是内置模型的名称,内置模型会从内部闪存加载。内置于内部闪存固件映像中的模型在使用时不会占用 RAM 来存储模型权重。" + +#: ../../library/omv.ml.rst:65 +msgid "" +"If the model you are trying to load is very large and doesn't fit in the " +"MicroPython heap you can set ``load_to_fb`` to True to load the model " +"into the frame buffer stack instead. This allows you to get around the " +"heap size limitations. However, models loaded this way need to be " +"deallocated in-order with anything else that uses the frame buffer stack " +"versus the MicroPython heap. Typically, the frame buffer stack is much " +"larger than the MicroPython heap so you can load much larger models using" +" this option, but, you need to be careful if you deallocate." +msgstr "" +"如果您尝试加载的模型非常大,无法适应 MicroPython 堆(heap),可以将 ``load_to_fb`` 设置为 " +"True,将模型加载到帧缓冲区栈(frame buffer " +"stack)中。这可以绕过堆大小的限制。然而,采用这种方式加载的模型需要与其他使用帧缓冲区栈的对象一起按顺序释放,而不是与 MicroPython" +" 堆一起释放。通常,帧缓冲区栈比 MicroPython 堆要大得多,因此使用此选项可以加载更大的模型,但在释放时需要小心。" + +#: ../../library/omv.ml.rst:72 +msgid "" +"Once a model is loaded you can execute it multiple times with different " +"inputs using `predict()`. The model will rember its internal state " +"between calls to `predict()`." +msgstr "一旦模型加载完成,您可以使用 `predict()` 多次执行它,并传入不同的输入。模型将在多次调用 `predict()` 之间记住其内部状态。" + +#: ../../library/omv.ml.rst:75 +msgid "" +"When deleted the model will automatically free up any memory it used from" +" the heap or frame buffer stack." +msgstr "当模型被删除时,它将自动释放其使用的内存,无论是来自堆(heap)还是帧缓冲区栈(frame buffer stack)。" + +#: ../../library/omv.ml.rst:77 +msgid "" +"``postprocess`` is a class which will be called by `Model.predict` after " +"inference to post-process the Model output. E.g. turn YOLO ``ndarray`` " +"output into bounding boxes. See `Model.predict` for more details." +msgstr "" +"``postprocess`` 是一个类,将在推理后由 `Model.predict` 调用以对模型输出进行后处理。" +"例如,将 YOLO ``ndarray`` 输出转换为边界框。有关更多详细信息,请参阅 `Model.predict`。" + +#: ../../library/omv.ml.rst:81 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.ml.rst:85 +msgid "" +"Executes the model with the given inputs. The inputs should be a list of " +"numpy ``ndarray`` objects corresponding to the number of input tensors " +"the model supports. The method returns a list of numpy ``ndarray`` " +"objects corresponding to the number of output tensors the model has." +msgstr "" +"使用给定的输入执行模型。输入应该是一个 numpy ``ndarray`` 对象的列表,数量对应模型支持的输入张量数。该方法返回一个 numpy " +"``ndarray`` 对象的列表,数量对应模型的输出张量数。" + +#: ../../library/omv.ml.rst:89 +msgid "" +"The model input tensors can be up to 4D tensors of uint8, int8, int16, or" +" float32 values. The passed numpy ``ndarray`` for an input tensor is then" +" converted to floating point and scaled/offset based on the input " +"tensor's scale and zero point values before being passed to the model. " +"For example, an ``ndarray`` of uint8 values will be converted to float32s" +" between 0.0-255.0, divided by the input tensor's scale, and then have " +"the input tensor's zero point added to it. The same process is done for " +"int8 and int16 values whereas float32 values are passed directly to the " +"model ignoring the scale and zero point values." +msgstr "" +"模型的输入张量可以是最大为 4D 的 uint8、int8、int16 或 float32 类型的张量。传递的 numpy " +"``ndarray`` 对象会根据输入张量的缩放(scale)和零点(zero " +"point)值,先转换为浮点数,并进行缩放/偏移,然后传递给模型。例如,一个 ``ndarray`` 类型的 uint8 值会被转换为 0.0 到" +" 255.0 之间的 float32 值,再除以输入张量的缩放因子,然后加上输入张量的零点值。对于 int8 和 int16 " +"值,也会执行相同的过程,而 float32 值则直接传递给模型,忽略缩放和零点值。" + +#: ../../library/omv.ml.rst:96 +msgid "" +"The model's output tensors can be up to 4D tensors of uint8, int8, or " +"float32 values. For uint8 and int8 tensors the returned numpy ndarray is " +"created by subtracting the output tensor's zero point value before " +"multiplying by the output tensor's scale value. For float32 tensors, " +"values are passed directly to the output without any scaling or offset " +"being applied. By this method, the output is always float32, unless a " +"``postprocessor`` is used (passed when creating the model object)." +msgstr "" +"模型的输出张量可以是最大为 4D 的 uint8、int8 或 float32 类型的张量。对于 " +"uint8 和 int8 张量,返回的 numpy ndarray " +"会通过先减去输出张量的零点值,再乘以输出张量的缩放值来创建。对于 float32 张量,值会直接传递到输出,不进行任何缩放或偏移。" +"通过这种方式,输出始终是 float32 类型,除非使用了 ``postprocessor`` (在创建模型对象时传入)。" + +#: ../../library/omv.ml.rst:102 +msgid "" +"Note that `predict()` requires the shape of the input ``ndarray`` objects" +" to match the shape of the model input tensors exactly. You can use the " +"``reshape()`` method of an ndarray with the `input_shape` attribute of " +"the model to reshape the input data to the correct shape if necessary." +msgstr "" +"请注意,`predict()` 方法要求输入的 ``ndarray`` 对象的形状必须与模型输入张量的形状完全匹配。如果需要,您可以使用 " +"ndarray 的 ``reshape()`` 方法,结合模型的 `input_shape` 属性,将输入数据重塑为正确的形状。" + +#: ../../library/omv.ml.rst:106 +msgid "" +"If a ``postprocessor`` is passed then it will receive the `Model`, " +"``inputs``, and ``outputs`` as arguments which allows for custom post-" +"processing of the model outputs. The callback may then return whatever it" +" likes which will be returned by `predict()`. The ``postprocessor`` " +"allows for building up a library of post-processing functions that can be" +" used on demand for different models. Note that the callback will receive" +" the outputs ``ndarray`` in RAW form from the model, like int8. This is " +"done to improve performance for post-processing large ``ndarrays``." +msgstr "" +"如果传递了一个 ``postprocessor``,它将接收 `Model`、``inputs`` 和 ``outputs`` " +"作为参数,这允许对模型输出进行自定义后处理。然后,回调函数可以返回任何它想要的内容,这将作为 `predict()` " +"的返回值。``postprocessor`` 使得可以构建一个后处理函数库,可以根据不同模型的需求随时调用。" +"请注意,回调函数将从模型中接收到原始(RAW)形式的输出 ``ndarray``,例如 int8。" +"这样做是为了提高对大型 ``ndarray`` 进行后处理时的性能。" + +#: ../../library/omv.ml.rst:113 +msgid "" +"For custom pre-processing, `predict()` also accepts \"callable\" objects " +"as inputs. Any object implementing the ``__call__`` method can be passed " +"to `predict()` as an input. `predict()` will then call the object with a " +"writeable bytearray representing the input tensor, the input tensor's " +"shape tuple, and the input tensors data type value (as an int). The " +"object should then set the input tensor data in the bytearray to what the" +" model expects. This is how `Normalization()` converts image objects to " +"input tensors." +msgstr "" +"对于自定义预处理,`predict()` 也接受可调用(\"callable\")对象作为输入。任何实现了 ``__call__`` " +"方法的对象都可以作为输入传递给 `predict()`。`predict()` " +"会使用一个可写的字节数组(bytearray)表示输入张量,并传递该张量的形状元组和数据类型值(作为整数)来调用该对象。然后,该对象应该将字节数组中的输入张量数据设置为模型所期望的内容。这就是" +" `Normalization()` 如何将图像对象转换为输入张量的方式。" + +#: ../../library/omv.ml.rst:120 +msgid "Attributes" +msgstr "属性" + +#: ../../library/omv.ml.rst:125 +msgid "The size of the loaded model in bytes." +msgstr "加载的模型的大小(以字节为单位)。" + +#: ../../library/omv.ml.rst:130 +msgid "The amount of RAM used by the model for it's tensor arena." +msgstr "模型用于其张量区域(tensor arena)所使用的 RAM 大小。" + +#: ../../library/omv.ml.rst:135 +msgid "A list of tuples containing the shape of each input tensor." +msgstr "包含每个输入张量形状的元组列表。" + +#: ../../library/omv.ml.rst:140 +msgid "" +"A list of strings containing the data type of each input tensor. 'b', " +"'B', 'h', and 'f' respectively for uint8, int8, int16, and float32." +msgstr "" +"包含每个输入张量数据类型的字符串列表。分别为 'b'(uint8)、'B'(int8)、'h'(int16)和 " +"'f'(float32)。" + +#: ../../library/omv.ml.rst:146 +msgid "A list of floats containing the scale of each input tensor." +msgstr "包含每个输入张量缩放因子的浮动列表。" + +#: ../../library/omv.ml.rst:151 +msgid "A list of integers containing the zero point of each input tensor." +msgstr "包含每个输入张量零点的整数列表。" + +#: ../../library/omv.ml.rst:156 +msgid "A list of tuples containing the shape of each output tensor." +msgstr "包含每个输出张量形状的元组列表。" + +#: ../../library/omv.ml.rst:161 +msgid "" +"A list of strings containing the data type of each output tensor. 'b', " +"'B' and 'f' respectively for uint8, int8 and float32." +msgstr "包含每个输出张量数据类型的字符串列表。分别为 'b'(int8)、'B'(uint8)和 'f'(float32)。" + +#: ../../library/omv.ml.rst:167 +msgid "A list of floats containing the scale of each output tensor." +msgstr "包含每个输出张量缩放因子的浮动列表。" + +#: ../../library/omv.ml.rst:172 +msgid "A list of integers containing the zero point of each output tensor." +msgstr "包含每个输出张量零点的整数列表。" + +#: ../../library/omv.ml.rst:176 +msgid "The attached post-processor class." +msgstr "关联的后处理器类。" + +#: ../../library/omv.ml.rst:181 +msgid "" +"A list of strings containing the labels for the model (if it was built-in" +" to the firmware with labels, otherwise, ``None``)." +msgstr "包含模型标签的字符串列表(如果模型内置在固件中并带有标签,否则为 ``None``)。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.darknet.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.darknet.po new file mode 100644 index 0000000000000..6f94fab09091f --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.darknet.po @@ -0,0 +1,91 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.postprocessing.darknet.rst:4 +msgid ":mod:`ml.postprocessing.darknet` --- Darknet" +msgstr ":mod:`ml.postprocessing.darknet` --- Darknet" + +#: ../../library/omv.ml.postprocessing.darknet.rst:9 +msgid "The `ml.postprocessing.darknet` module contains classes for Darknet." +msgstr "`ml.postprocessing.darknet` 模块包含用于 Darknet 的类。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:12 +msgid "class YoloLC -- YOLO LC" +msgstr "类 YoloLC -- YOLO LC" + +#: ../../library/omv.ml.postprocessing.darknet.rst:14 +msgid "Used to post-process YOLO LC model output." +msgstr "用于后处理 YOLO LC 模型输出。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:17 +#: ../../library/omv.ml.postprocessing.darknet.rst:37 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.ml.postprocessing.darknet.rst:21 +msgid "Create a YOLO LC postprocessor." +msgstr "创建一个 YOLO LC 后处理器。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:23 +#: ../../library/omv.ml.postprocessing.darknet.rst:43 +msgid "``threshold`` The threshold to use for postprocessing." +msgstr "``threshold`` 用于后处理的阈值。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:25 +msgid "" +"``anchors`` A list of anchor points ``(x, y)`` the model was trained on " +"to use for postprocessing." +msgstr "" +"``anchors`` 模型训练时使用的锚点 ``(x, y)`` 列表,用于后处理。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:27 +#: ../../library/omv.ml.postprocessing.darknet.rst:47 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]`` and score " +"tuples for each class in the model output. E.g. ``[[((x, y, w, h), " +"score)]]``. Note that empty class list are included in the output to " +"ensure the position of each class list in the output matches the position" +" of the class index in the model output." +msgstr "" +"此后处理器返回模型输出中每个类别的矩形 ``[x, y, w, h]`` 和分数元组的列表。" +"例如 ``[[((x, y, w, h), score)]]``。注意,输出中包含空的类别列表," +"以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:32 +msgid "class YoloV2 -- YOLO V2" +msgstr "类 YoloV2 -- YOLO V2" + +#: ../../library/omv.ml.postprocessing.darknet.rst:34 +msgid "Used to post-process YOLO V2 model output." +msgstr "用于后处理 YOLO V2 模型输出。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:41 +msgid "Create a YOLO V2 postprocessor." +msgstr "创建一个 YOLO V2 后处理器。" + +#: ../../library/omv.ml.postprocessing.darknet.rst:45 +msgid "" +"``anchors`` A list of anchor points ``(x, y)`` the model was trained on " +"to use for postprocessing." +msgstr "" +"``anchors`` 模型训练时使用的锚点 ``(x, y)`` 列表,用于后处理。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.edgeimpulse.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.edgeimpulse.po new file mode 100644 index 0000000000000..98f4333eb372c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.edgeimpulse.po @@ -0,0 +1,73 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:4 +msgid ":mod:`ml.postprocessing.edgeimpulse` --- Edge Impulse" +msgstr ":mod:`ml.postprocessing.edgeimpulse` --- Edge Impulse" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:9 +msgid "" +"The `ml.postprocessing.edgeimpulse` module contains classes for Edge " +"Impulse." +msgstr "`ml.postprocessing.edgeimpulse` 模块包含用于 Edge Impulse 的类。" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:12 +msgid "class Fomo -- Fast Objects More Objects" +msgstr "类 Fomo -- 快速目标多目标检测" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:14 +msgid "Used to post-process FOMO model output." +msgstr "用于后处理 FOMO 模型输出。" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:17 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:21 +msgid "Create a FOMO postprocessor." +msgstr "创建一个 FOMO 后处理器。" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:23 +msgid "``threshold`` The threshold to use for postprocessing." +msgstr "``threshold`` 用于后处理的阈值。" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:25 +msgid "" +"``w/h_scale`` Are used to control how much grid cell sizes are scaled by " +"on return. Making this larger helps join cells close by each other into " +"one cell during non-max-suppression." +msgstr "" +"``w/h_scale`` 用于控制返回时网格单元大小的缩放比例。" +"增大此值有助于在非极大值抑制过程中将彼此相邻的单元合并为一个单元。" + +#: ../../library/omv.ml.postprocessing.edgeimpulse.rst:28 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]`` and score " +"tuples for each class in the model output. E.g. ``[[((x, y, w, h), " +"score)]]``. Note that empty class list are included in the output to " +"ensure the position of each class list in the output matches the position" +" of the class index in the model output." +msgstr "" +"此后处理器返回模型输出中每个类别的矩形 ``[x, y, w, h]`` 和分数元组的列表。" +"例如 ``[[((x, y, w, h), score)]]``。注意,输出中包含空的类别列表," +"以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.mediapipe.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.mediapipe.po new file mode 100644 index 0000000000000..63558b966f14f --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.mediapipe.po @@ -0,0 +1,139 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:4 +msgid ":mod:`ml.postprocessing.mediapipe` --- Google Mediapipe" +msgstr ":mod:`ml.postprocessing.mediapipe` --- Google Mediapipe" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:9 +msgid "" +"The `ml.postprocessing.mediapipe` module contains classes for Google " +"Mediapipe." +msgstr "`ml.postprocessing.mediapipe` 模块包含用于 Google Mediapipe 的类。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:12 +msgid "class BlazeFace -- Face Detection" +msgstr "类 BlazeFace -- 人脸检测" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:14 +msgid "Used to post-process BlazeFace model output." +msgstr "用于后处理 BlazeFace 模型输出。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:17 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:37 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:57 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:75 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:21 +msgid "Create a BlazeFace postprocessor." +msgstr "创建一个 BlazeFace 后处理器。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:23 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:43 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:63 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:81 +msgid "``threshold`` The threshold to use for postprocessing." +msgstr "``threshold`` 用于后处理的阈值。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:25 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:45 +msgid "" +"``anchors`` A list of anchor points ``(x, y)`` the model was trained on " +"to use for postprocessing." +msgstr "``anchors`` 模型训练时使用的锚点 ``(x, y)`` 列表,用于后处理。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:27 +#: ../../library/omv.ml.postprocessing.mediapipe.rst:47 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]``, score, and " +"(x, y) keypoint list tuples. E.g. ``[((x, y, w, h), score, keypoints)]``." +" Note that empty class list are included in the output to ensure the " +"position of each class list in the output matches the position of the " +"class index in the model output." +msgstr "" +"此后处理器返回矩形 ``[x, y, w, h]``、分数和 (x, y) 关键点列表元组的列表。" +"例如 ``[((x, y, w, h), score, keypoints)]``。注意,输出中包含空的类别列表," +"以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:32 +msgid "class BlazePalm -- Palm Detection" +msgstr "类 BlazePalm -- 手掌检测" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:34 +msgid "Used to post-process BlazePalm model output." +msgstr "用于后处理 BlazePalm 模型输出。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:41 +msgid "Create a BlazePalm postprocessor." +msgstr "创建一个 BlazePalm 后处理器。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:52 +msgid "class FaceLandmarks -- Face Landmarks" +msgstr "类 FaceLandmarks -- 人脸关键点" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:54 +msgid "Used to post-process FaceLandmarks model output." +msgstr "用于后处理 FaceLandmarks 模型输出。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:61 +msgid "Create a FaceLandmarks postprocessor." +msgstr "创建一个 FaceLandmarks 后处理器。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:65 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]``, score, and " +"(x, y, z) keypoint list tuples. E.g. ``[((x, y, w, h), score, " +"keypoints)]``. Note that empty class list are included in the output to " +"ensure the position of each class list in the output matches the position" +" of the class index in the model output." +msgstr "" +"此后处理器返回矩形 ``[x, y, w, h]``、分数和 (x, y, z) 关键点列表元组的列表。" +"例如 ``[((x, y, w, h), score, keypoints)]``。注意,输出中包含空的类别列表," +"以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:70 +msgid "class HandLandmarks -- Hand Landmarks" +msgstr "类 HandLandmarks -- 手部关键点" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:72 +msgid "Used to post-process HandLandmarks model output." +msgstr "用于后处理 HandLandmarks 模型输出。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:79 +msgid "Create a HandLandmarks postprocessor." +msgstr "创建一个 HandLandmarks 后处理器。" + +#: ../../library/omv.ml.postprocessing.mediapipe.rst:83 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]``, score, and " +"(x, y, z) keypoint list tuples for each class in the model output " +"(left=0, or right=1) E.g. ``[[((x, y, w, h), score, keypoints)]]``. Note " +"that empty class list are included in the output to ensure the position " +"of each class list in the output matches the position of the class index " +"in the model output." +msgstr "" +"此后处理器返回模型输出中每个类别(left=0 或 right=1)的矩形 ``[x, y, w, h]``、" +"分数和 (x, y, z) 关键点列表元组的列表。例如 ``[[((x, y, w, h), score, keypoints)]]``。" +"注意,输出中包含空的类别列表,以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.po new file mode 100644 index 0000000000000..544a881cf31dd --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.po @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.postprocessing.rst:4 +msgid ":mod:`ml.postprocessing` --- ML Postprocessing" +msgstr ":mod:`ml.postprocessing` --- ML 后处理" + +#: ../../library/omv.ml.postprocessing.rst:9 +msgid "" +"The `ml.postprocessing` module contains classes for postprocessing model " +"output." +msgstr "`ml.postprocessing` 模块包含用于后处理模型输出的类。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.ultralytics.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.ultralytics.po new file mode 100644 index 0000000000000..ebd7f0e077b92 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.postprocessing.ultralytics.po @@ -0,0 +1,79 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:4 +msgid ":mod:`ml.postprocessing.ultralytics` --- Ultralytics" +msgstr ":mod:`ml.postprocessing.ultralytics` --- Ultralytics" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:9 +msgid "" +"The `ml.postprocessing.ultralytics` module contains classes for " +"Ultralytics." +msgstr "`ml.postprocessing.ultralytics` 模块包含用于 Ultralytics 的类。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:12 +msgid "class YoloV5 -- YOLO V5" +msgstr "类 YoloV5 -- YOLO V5" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:14 +msgid "Used to post-process YOLO V5 model output." +msgstr "用于后处理 YOLO V5 模型输出。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:17 +#: ../../library/omv.ml.postprocessing.ultralytics.rst:35 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:21 +msgid "Create a YOLO V5 postprocessor." +msgstr "创建一个 YOLO V5 后处理器。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:23 +#: ../../library/omv.ml.postprocessing.ultralytics.rst:41 +msgid "``threshold`` The threshold to use for postprocessing." +msgstr "``threshold`` 用于后处理的阈值。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:25 +#: ../../library/omv.ml.postprocessing.ultralytics.rst:43 +msgid "" +"This post-processor returns a list of rect ``[x, y, w, h]`` and score " +"tuples for each class in the model output. E.g. ``[[((x, y, w, h), " +"score)]]``. Note that empty class list are included in the output to " +"ensure the position of each class list in the output matches the position" +" of the class index in the model output." +msgstr "" +"此后处理器返回模型输出中每个类别的矩形 ``[x, y, w, h]`` 和分数元组的列表。" +"例如 ``[[((x, y, w, h), score)]]``。注意,输出中包含空的类别列表," +"以确保输出中每个类别列表的位置与模型输出中类别索引的位置匹配。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:30 +msgid "class YoloV8 -- YOLO V8" +msgstr "类 YoloV8 -- YOLO V8" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:32 +msgid "Used to post-process YOLO V8 model output." +msgstr "用于后处理 YOLO V8 模型输出。" + +#: ../../library/omv.ml.postprocessing.ultralytics.rst:39 +msgid "Create a YOLO V8 postprocessor." +msgstr "创建一个 YOLO V8 后处理器。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.preprocessing.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.preprocessing.po new file mode 100644 index 0000000000000..37ae2996e79c9 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.preprocessing.po @@ -0,0 +1,109 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.preprocessing.rst:4 +msgid ":mod:`ml.preprocessing` --- ML Preprocessing" +msgstr ":mod:`ml.preprocessing` --- ML 预处理" + +#: ../../library/omv.ml.preprocessing.rst:9 +msgid "" +"The `ml.preprocessing` module contains classes for preprocessing images " +"for use with machine learning models." +msgstr "`ml.preprocessing` 模块包含用于图像预处理的类,以便与机器学习模型一起使用。" + +#: ../../library/omv.ml.preprocessing.rst:14 +msgid "class Normalization -- Image Normalization" +msgstr "class Normalization -- 图像归一化" + +#: ../../library/omv.ml.preprocessing.rst:16 +msgid "" +"The `Normalization` object is used to convert image objects to numpy " +"``ndarray`` objects for use with the `Model` object. It's automatically " +"created by the `Model` object when an image object is passed to " +"`predict()`. However, you can also manually create a `Normalization` " +"object to control the conversion process, select an ROI, etc." +msgstr "" +"`Normalization` 对象用于将图像对象转换为 numpy ``ndarray`` 对象,以便与 `Model` " +"对象一起使用。当图像对象被传递给 `predict()` 时,它会被 `Model` 对象自动创建。然而,你也可以手动创建一个 " +"`Normalization` 对象,以控制转换过程、选择 ROI(感兴趣区域)等。" + +#: ../../library/omv.ml.preprocessing.rst:20 +msgid "For example::" +msgstr "举例::" + +#: ../../library/omv.ml.preprocessing.rst:27 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.ml.preprocessing.rst:31 +msgid "" +"Creates a `Normalization` object which is used to convert image objects " +"to numpy arrays for use with the `predict()`. The object can also be used" +" to select a region of interest (ROI) in the image to convert to a numpy " +"array." +msgstr "" +"创建一个 `Normalization` 对象,用于将图像对象转换为 numpy 数组,以供 `predict()` " +"使用。该对象还可用于选择图像中的感兴趣区域 (ROI) 并将其转换为 numpy 数组。" + +#: ../../library/omv.ml.preprocessing.rst:35 +msgid "" +"The Normalization object automatically converts any image type passed " +"(including compressed images) into either a single channel (grayscale) or" +" three channel (RGB888) image which is passed to the tensor input of the " +"model. Images are centered, scaled up/down (using bilinear/area scaling)," +" and cropped as necessary to match the input tensor size of the model." +msgstr "" +"Normalization " +"对象会自动将传入的任何图像类型(包括压缩图像)转换为单通道(灰度)或三通道(RGB888)图像,并将其传递到模型的张量输入中。图像会根据需要居中、按比例放大/缩小(使用双线性或区域缩放)、并裁剪,以匹配模型输入张量的大小。" + +#: ../../library/omv.ml.preprocessing.rst:40 +msgid "" +"For ``uint8`` input tensors the image is directly passed ignoring scale " +"and mean/stdev. For ``int8`` input tensors the image is shifted to be " +"within the ``int8`` range from the ``uint8`` range and then directly " +"passed ignoring scale and mean/stdev. Tensors that accept either of these" +" formats can be processed more quickly than tensors that require floating" +" point inputs." +msgstr "" +"对于 ``uint8`` 输入张量,图像会被直接传递,忽略缩放和均值/标准差处理。对于 ``int8`` 输入张量,图像会从 ``uint8`` " +"范围平移到 ``int8`` 范围,然后直接传递,同样忽略缩放和均值/标准差处理。接受这些格式的张量比需要浮点数输入的张量处理速度更快。" + +#: ../../library/omv.ml.preprocessing.rst:45 +msgid "" +"For floating point input tensors it's not possible to guess the correct " +"range that the model expects. While each input tensor encodes a scale and" +" zero point value that can be used to convert the input to the correct " +"range, these values do not tell you what the range of the input data " +"should be in floating point. E.g. should image RGB values be within the " +"range of (0.0, 1.0), (-1.0, 1.0), (0.0, 255.0), and etc. before applying " +"a scale and zero point? The answer is that it depends on the model and " +"how it was trained. So, the normalization object instead allows you to " +"directly specify the range of the input data, the mean, and the standard " +"deviation. The Grayscale or RGB88 image is then converted into a floating" +" point tensor for the model to process based on these values." +msgstr "" +"对于浮点数输入张量,无法推测模型期望的正确范围。虽然每个输入张量都编码了一个缩放值和零点值,可用于将输入转换到正确范围,但这些值并未指示浮点数输入数据应处于何种范围。例如,图像的" +" RGB 值在应用缩放和零点之前,应该在 (0.0, 1.0)、(-1.0, 1.0)、(0.0, 255.0) " +"等范围内?答案取决于模型及其训练方式。因此,Normalization 对象允许您直接指定输入数据的范围、均值和标准差。然后,灰度图像或 " +"RGB888 图像会根据这些值转换为浮点数张量,以供模型处理。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.utils.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.utils.po new file mode 100644 index 0000000000000..0f90ccd698f28 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.ml.utils.po @@ -0,0 +1,202 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.ml.utils.rst:4 +msgid ":mod:`ml.utils` --- ML Utils" +msgstr ":mod:`ml.utils` --- ML 工具集" + +#: ../../library/omv.ml.utils.rst:9 +msgid "" +"The `ml.utils` module contains utility classes and functions for machine " +"learning." +msgstr "`ml.utils` 模块包含用于机器学习的工具类和函数。" + +#: ../../library/omv.ml.utils.rst:13 +msgid "Returns the logit of all values in the passed ``ndarray`` array." +msgstr "返回传入的 ``ndarray`` 数组中所有值的 logit。" + +#: ../../library/omv.ml.utils.rst:17 +msgid "Returns the sigmod of all values in the passed ``ndarray`` array." +msgstr "返回传入的 ``ndarray`` 数组中所有值的 sigmoid。" + +#: ../../library/omv.ml.utils.rst:21 +msgid "" +"Thresholds ``scores``, a quantized ``ndarray`` (int8, uint8, int16, " +"uint16) by a quantized ``threshold`` and then returns an ``ndarray`` of " +"all indices passing the threshold. ``scale`` is tested to determine if " +"the dequantized values are positive or negative." +msgstr "" +"对量化的 ``ndarray``(int8、uint8、int16、uint16)``scores`` 按量化的 ``threshold`` " +"进行阈值过滤,然后返回所有通过阈值的索引的 ``ndarray``。``scale`` 用于判断反量化后的值是正还是负。" + +#: ../../library/omv.ml.utils.rst:25 +msgid "" +"``find_max`` if True, replaces ``scores`` internally with an ``ndarray`` " +"of the max of the ``find_max_axis``. This is useful, for example, when " +"you need to find the max class value per row in an array of bounding box " +"candidate outputs and then threshold the max value per row and return the" +" list of passing indices." +msgstr "" +"``find_max`` 如果为 True,则在内部将 ``scores`` 替换为 ``find_max_axis`` 上最大值的 ``ndarray``。" +"这在需要查找边界框候选输出数组中每行的最大类别值,然后对每行最大值进行阈值过滤并返回通过的索引列表时非常有用。" + +#: ../../library/omv.ml.utils.rst:31 +msgid "" +"Converts the passed ``ndarray`` by dividing by the scale and adding the " +"zero point of the model. Returns a floating point ``ndarray``." +msgstr "" +"通过除以模型的缩放因子并加上零点来转换传入的 ``ndarray``。返回浮点型 ``ndarray``。" + +#: ../../library/omv.ml.utils.rst:34 +msgid "" +"``index`` selects which tensor output of the ``model`` to quantize " +"against." +msgstr "``index`` 选择对 ``model`` 的哪个张量输出进行量化。" + +#: ../../library/omv.ml.utils.rst:38 +msgid "" +"Converts the passed ``ndarray`` by subtracting the zero point and then " +"multiplying by the scale of the model. Returns a floating point " +"``ndarray``." +msgstr "" +"通过减去零点然后乘以模型的缩放因子来转换传入的 ``ndarray``。返回浮点型 ``ndarray``。" + +#: ../../library/omv.ml.utils.rst:41 +msgid "" +"``index`` selects which tensor output of the ``model`` to dequantize " +"against." +msgstr "``index`` 选择对 ``model`` 的哪个张量输出进行反量化。" + +#: ../../library/omv.ml.utils.rst:45 +msgid "" +"Draws bounding boxes with text labels from the list of ``boxes`` (x, y, " +"w, h) using the list of ``labels`` strings and ``colors`` (r, g, b) " +"tuples." +msgstr "" +"使用 ``labels`` 字符串列表和 ``colors`` (r, g, b) 元组列表," +"从 ``boxes`` (x, y, w, h) 列表中绘制带有文本标签的边界框。" + +#: ../../library/omv.ml.utils.rst:49 +msgid "Draws an ``ndarray`` of keypoint (x, y, ...) values on the image." +msgstr "在图像上绘制关键点 (x, y, ...) 值的 ``ndarray``。" + +#: ../../library/omv.ml.utils.rst:53 +msgid "" +"Draws an ``ndarray`` of keypoint (x, y, ...) values on the image and then" +" lines between the keypoints from a list of ``lines`` (kp0_idx, kp1_idx)" +" tuples." +msgstr "" +"在图像上绘制关键点 (x, y, ...) 值的 ``ndarray``," +"然后根据 ``lines`` (kp0_idx, kp1_idx) 元组列表在关键点之间绘制连线。" + +#: ../../library/omv.ml.utils.rst:58 +msgid "class NMS - Soft-Non-Maximum Suppression" +msgstr "class NMS - 软非最大抑制 (Soft-Non-Maximum Suppression)" + +#: ../../library/omv.ml.utils.rst:60 +msgid "" +"The `NMS` object is used to collect a list of bounding boxes and their " +"associated scores and then filter out overlapping bounding boxes with " +"lower scores. Additionally, it remaps bounding boxes detected in a sub-" +"window back to the original image coordinates." +msgstr "`NMS` 对象用于收集一组边界框及其关联的分数,然后筛选出重叠且分数较低的边界框。此外,它还将子窗口中检测到的边界框重新映射回原始图像坐标。" + +#: ../../library/omv.ml.utils.rst:65 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.ml.utils.rst:69 +msgid "" +"Creates a `NMS` object with the given window size and region of interest " +"(ROI). The window is width/height of the input tensor of image model. The" +" ROI is the region of interest that returned by the `Normalization()` " +"object which corresponds to the region of the image that the model was " +"run on. This allows the `NMS` object to remap bounding boxes detected in " +"a sub-window back to the original image coordinates." +msgstr "" +"创建一个 `NMS` 对象,指定给定的窗口大小和感兴趣区域(ROI)。窗口的宽度/高度与图像模型的输入张量相同。ROI 是由 " +"`Normalization()` 对象返回的感兴趣区域,它对应于模型运行时图像的区域。这允许 `NMS` " +"对象将子窗口中检测到的边界框重新映射回原始图像坐标。" + +#: ../../library/omv.ml.utils.rst:76 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.ml.utils.rst:80 +msgid "" +"Adds a bounding box to the `NMS` object with the given coordinates, " +"score, and label index." +msgstr "向 `NMS` 对象添加一个边界框,包含给定的坐标、分数和标签索引。" + +#: ../../library/omv.ml.utils.rst:82 +msgid "" +"``xmin``, ``ymin``, ``xmax``, and ``ymax`` are the bounding box " +"coordinates in the range of 0.0 to 1.0 where (0.0, 0.0) is the top-left " +"corner of the image and (1.0, 1.0) is the bottom-right corner of the " +"image." +msgstr "" +"``xmin``、``ymin``、``xmax`` 和 ``ymax`` 是边界框的坐标,范围为 0.0 到 1.0,其中 (0.0, 0.0)" +" 是图像的左上角,(1.0, 1.0) 是图像的右下角。" + +#: ../../library/omv.ml.utils.rst:85 +msgid "``score`` is the confidence score of the bounding box (0.0-1.0)." +msgstr "``score`` 是边界框的置信度分数(0.0-1.0)。" + +#: ../../library/omv.ml.utils.rst:87 +msgid "" +"``label_index`` is the index of the label associated with the bounding " +"box." +msgstr "``label_index`` 是与边界框相关联的标签索引。" + +#: ../../library/omv.ml.utils.rst:89 +msgid "``keypoints`` is an ``ndarray`` of keypoint (x, y, ...) values." +msgstr "``keypoints`` 是关键点 (x, y, ...) 值的 ``ndarray``。" + +#: ../../library/omv.ml.utils.rst:93 +msgid "" +"Returns a list of bounding boxes that have been filtered by the `NMS` " +"object and remapped to the original image coordinates. Bounding box " +"tuples are ``(x, y, w, h, score, label_index)``. After calling this " +"method you should create a new `NMS` object if you want to process a new " +"set of bounding boxes. If ``keypoints`` was not None when adding then the" +" tuple will be extended with a list of ``keypoints``. The keypoints are " +"mapped to the correct coordinates like the bounding boxes." +msgstr "" +"返回一个已被 `NMS` 对象过滤并重新映射到原始图像坐标的边界框列表。边界框元组为 ``(x, y, w, h, score, " +"label_index)``。调用此方法后,如果您希望处理一组新的边界框,应创建一个新的 `NMS` 对象。如果添加时 ``keypoints`` 不为 None," +"则元组将扩展一个 ``keypoints`` 列表。关键点会像边界框一样被映射到正确的坐标。" + +#: ../../library/omv.ml.utils.rst:100 +msgid "Bounding boxes must have a higher score then ``threshold`` to be kept." +msgstr "边界框的分数必须高于 ``threshold`` 才会被保留。" + +#: ../../library/omv.ml.utils.rst:102 +msgid "" +"``sigma`` controls the gaussian used to apply a score penalty to " +"overlapping bounding boxes using the Soft-Non-Maximum-Suppression " +"algorithm. A higher ``sigma`` will result in a more aggressive " +"suppression of overlapping bounding boxes." +msgstr "" +"``sigma`` 控制用于通过软非最大抑制算法对重叠边界框应用分数惩罚的高斯函数。较高的 ``sigma`` " +"值将导致对重叠边界框进行更强烈的抑制。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.omv.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.omv.po new file mode 100644 index 0000000000000..a85094fc32566 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.omv.po @@ -0,0 +1,69 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 07:53+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.omv.rst:2 +msgid ":mod:`omv` --- OpenMV Cam Information" +msgstr ":mod:`omv` --- OpenMV Cam 信息" + +#: ../../library/omv.omv.rst:7 +msgid "The ``omv`` module is used to get OpenMV Cam information." +msgstr "``omv`` 模块用于获取 OpenMV Cam 信息。" + +#: ../../library/omv.omv.rst:10 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.omv.rst:14 +msgid "Returns the major version number (int)." +msgstr "返回主版本号(int)。" + +#: ../../library/omv.omv.rst:18 +msgid "Returns the minor version number (int)." +msgstr "返回次版本号(int)。" + +#: ../../library/omv.omv.rst:22 +msgid "Returns the patch version number (int)." +msgstr "返回补丁版本号(int)。" + +#: ../../library/omv.omv.rst:26 +msgid "Returns the version string (e.g. \"2.8.0\")." +msgstr "返回补丁字符串(例如 \"2.8.0\")。" + +#: ../../library/omv.omv.rst:30 +msgid "" +"Returns the board architecture string. This string is really just meant " +"for OpenMV IDE but you can get it with this function." +msgstr "返回板子架构字符串。该字符串实际上是为OpenMV IDE设计的,但您可以使用此函数获取它。" + +#: ../../library/omv.omv.rst:35 +msgid "" +"Returns the board type string. This string is really just meant for " +"OpenMV IDE but you can get it with this function." +msgstr "返回板子类型字符串。该字符串实际上是为了OpenMV IDE 设计的,但您可以使用此函数获取它。" + +#: ../../library/omv.omv.rst:40 +msgid "" +"Returns the board id string. This string is really just meant for OpenMV " +"IDE but you can get it with this function." +msgstr "返回板子 ID 字符串。该字符串实际上是为了OpenMV IDE 设计的。但您可以使用此函数获取它。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.pca9674a.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.pca9674a.po new file mode 100644 index 0000000000000..ab31a65f5be3c --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.pca9674a.po @@ -0,0 +1,67 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.pca9674a.rst:2 +msgid ":mod:`pca9674a` --- I2C Expander Driver" +msgstr ":mod:`pca9674a` --- I2C 扩展器驱动" + +#: ../../library/omv.pca9674a.rst:7 +msgid "8-bit I/O expander." +msgstr "8 位 I/O 扩展器。" + +#: ../../library/omv.pca9674a.rst:10 +msgid "class PCA9674A -- 8-bit I/O expander" +msgstr "类 PCA9674A -- 8 位 I/O 扩展器" + +#: ../../library/omv.pca9674a.rst:12 +msgid "The `PCA9674A` class is used to initialize the I/O expander." +msgstr "`PCA9674A` 类用于初始化 I/O 扩展器。" + +#: ../../library/omv.pca9674a.rst:15 +msgid "Constructors" +msgstr "构造函数" + +#: ../../library/omv.pca9674a.rst:19 +msgid "" +"Creates an interface to talk to the I/O expander on I2C bus number " +"``bus`` using IRQ pin ``irq_pin``. The address to use can be set with " +"``address``. ``callback`` is called on any pin state changing." +msgstr "" +"创建一个接口,用于通过 I2C 总线号 ``bus`` 和 IRQ 引脚 ``irq_pin`` 与 I/O 扩展器通信。" +"可以使用 ``address`` 设置要使用的地址。当任何引脚状态发生变化时,将调用 ``callback``。" + +#: ../../library/omv.pca9674a.rst:23 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.pca9674a.rst:27 +msgid "Writes the 8-bit ``value`` to the I/O expander pins." +msgstr "将 8 位 ``value`` 写入 I/O 扩展器的引脚。" + +#: ../../library/omv.pca9674a.rst:31 +msgid "Returns an 8-bit value representing the pins of the I/O expander." +msgstr "返回一个表示 I/O 扩展器引脚的 8 位值。" + +#: ../../library/omv.pca9674a.rst:35 +msgid "Resets and initializes the I/O expander." +msgstr "重置并初始化 I/O 扩展器。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.rpc.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.rpc.po new file mode 100644 index 0000000000000..fb53705dc0727 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.rpc.po @@ -0,0 +1,617 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.rpc.rst:2 +msgid ":mod:`rpc` --- rpc library" +msgstr ":mod:`rpc` --- rpc 库" + +#: ../../library/omv.rpc.rst:7 +msgid "" +"The ``rpc`` module on the OpenMV Cam allows you to connect your OpenMV " +"Cam to another microcontroller or computer and execute remote python (or " +"procedure) calls on your OpenMV Cam. The ``rpc`` module also allows for " +"the reverse too if you want your OpenMV Cam to be able to execute remote " +"procedure (or python) calls on another microcontroller or computer." +msgstr "" +"OpenMV Cam上的 ``rpc`` 模块允许您将您的OpenMV Cam连接到另一个微控制器或计算机,并在您的OpenMV " +"Cam上执行远程Python(或过程)调用。``rpc`` 模块还允许反向操作,如果您希望您的OpenMV " +"Cam能够在另一个微控制器或计算机上执行远程过程(或Python)调用。" + +#: ../../library/omv.rpc.rst:13 +msgid "How to use the Library" +msgstr "如何使用该库" + +#: ../../library/omv.rpc.rst:15 +msgid "" +"Please checkout the example scripts in OpenMV IDE under ``Remote " +"Control``." +msgstr "请查看OpenMV IDE 中的 ``Remote Control`` 下的示例脚本。" + +#: ../../library/omv.rpc.rst:17 +msgid "" +"You will need to edit the example code to choose which interface you want" +" to use and to play with the settings the scripts use." +msgstr "您需要编辑示例代码以选择要使用的接口,并调整脚本的使用设置。" + +#: ../../library/omv.rpc.rst:20 +msgid "" +"In general, for the controller device to use the ``rpc`` library you will" +" create an interface object using the ``rpc`` library. For example::" +msgstr "一般来说,要使用 ``rpc`` 库的控制器设备,您将使用 ``rpc`` 库创建一个接口对象。例如:" + +#: ../../library/omv.rpc.rst:25 +msgid "This create a UART interface to talk to an ``rpc`` slave." +msgstr "这将创建一个UART接口,用于与 ``rpc`` 从设备进行通信。" + +#: ../../library/omv.rpc.rst:27 +msgid "Once the interface is created you just need to do::" +msgstr "一旦接口创建完成,您仅需要执行::" + +#: ../../library/omv.rpc.rst:31 +msgid "" +"And the ``rpc`` library will try to execute that " +"``\"remote_function_or_method_name\"`` on the slave. The remote function " +"or method will receive the ``bytes_object_argument`` which can be up to " +"2^32-1 bytes in size. Once the remote method finishes executing it will " +"return a ``memory_view_object_result`` which can also be up to 2^32-1 " +"bytes in size. Because the argument and response are both generic byte " +"containers you can pass anything through the ``rpc`` library and receive " +"any type of response. A simple way to pass arguments is to use " +"``struct.pack()`` to create the argument and ``struct.unpack()`` to " +"receieve the argument on the other side. For the response, the other side" +" may send a string object or json string as the result which the master " +"can then interpret." +msgstr "" +"然后 ``rpc`` 库将尝试在从属设备上执行 ``\"remote_function_or_method_name\"``。远程函数或方法将接收 " +"``bytes_object_argument``,其大小最大为 2^32-1 字节。远程方法执行完毕后,将返回一个 " +"``memory_view_object_result``,其大小也最大为 2^32-1 字节。由于参数和响应都是通用的字节容器,您可以通过 " +"``rpc`` 库传递任何内容并接收任何类型的响应。传递参数的一种简单方法是使用 ``struct.pack()`` 创建参数,并使用 " +"``struct.unpack()`` 在另一端接收该参数。对于响应,另一端可以发送字符串对象或 JSON " +"字符串作为结果,主设备可以对其进行解释。" + +#: ../../library/omv.rpc.rst:40 +msgid "" +"As for errors, if you try to execute a non-existant function or method " +"name the ``rpc_master.call()`` method will return an empty ``bytes()`` " +"object. If the ``rpc`` library failed to communicate with the slave the " +"``rpc`` library will return None." +msgstr "" +"至于错误,如果尝试执行一个不存在的函数或方法名,``rpc_master.call()`` 方法将返回一个空的 ``bytes()`` 对象。如果" +" ``rpc`` 库未能与从属设备通信,则 ``rpc`` 库将返回 None。" + +#: ../../library/omv.rpc.rst:44 +msgid "" +"To keep things simple the ``rpc`` library doesn't maintain a connection " +"between the master and slave devices. The ``rpc_master.call()`` method " +"encapsulates trying to connect to the slave, starting execution of the " +"remote function or method, and getting the result." +msgstr "" +"为了保持简单,``rpc`` 库不会维护主设备和从设备之间的连接。 ``rpc_master.call()`` " +"方法封装了尝试连接到从设备、开始执行远程函数或方法以及获取结果的过程。" + +#: ../../library/omv.rpc.rst:48 +msgid "" +"Now, on the slave side of things you have to create an ``rpc`` interface " +"to communicate with the master. This looks like::" +msgstr "现在,在从设备方面,您必须创建一个 ``rpc`` 接口以与主设备通信。这看起来像这样::" + +#: ../../library/omv.rpc.rst:53 +msgid "This will create the UART interface layer to talk to an ``rpc`` master." +msgstr "这将创建UART接口层,用于与 ``rpc`` 主设备通信。" + +#: ../../library/omv.rpc.rst:55 +msgid "" +"Once you create the slave interface you then need to register call backs " +"that the master can call with the interface object::" +msgstr "一旦创建了从设备接口,您就需要注册主设备可以调用的回调函数,使用接口对象::" + +#: ../../library/omv.rpc.rst:64 +msgid "" +"You may register as many callbacks as you like on the slave. Finally, " +"once you are done registering callbacks you just need to execute::" +msgstr "您可以在从设备上注册尽可能多的回调。最后,一旦完成注册回调,您只需要执行::" + +#: ../../library/omv.rpc.rst:69 +msgid "" +"On the slave to start the ``rpc`` library up and begin listening for the " +"master. Note that the ``rpc_slave.loop()`` method does not return. Also, " +"to make your slave more robust against errors you may want to wrap the " +"``rpc_slave.loop()`` with ``try:`` and ``except:`` for whatever " +"exceptions might be thrown by your callback methods. The ``rpc`` library " +"will not generate any exceptions itself. Note: passing large data " +"structures around (like jpeg images) can potentially exhaust the heap on " +"the OpenMV Cam and generate `MemoryError` exceptions." +msgstr "" +"在从设备上启动 ``rpc`` 库,并开始监听主设备。请注意,``rpc_slave.loop()`` " +"方法不会返回。此外,为了使从设备更具有抗错误性,您可能希望在 ``try:`` 和 ``except:`` 中包装 " +"``rpc_slave.loop()``,以捕获由您的回调方法抛出的任何异常。 ``rpc`` 库本身不会生成任何异常。注意:在OpenMV " +"Cam上,传输大型数据结构(如jpeg图像)可能会耗尽堆内存,并生成 `MemoryError` 异常。" + +#: ../../library/omv.rpc.rst:76 +msgid "And that is it! The ``rpc`` library is designed to be simple to use." +msgstr "就是这样!``rpc`` 库被设计为简单易用。" + +#: ../../library/omv.rpc.rst:79 +msgid "class rpc - rpc virtual class" +msgstr "class rpc - rpc 虚拟类" + +#: ../../library/omv.rpc.rst:81 +msgid "" +"The rpc base class is reimplemented by the `rpc_master` and `rpc_slave` " +"classes to create the master and slave interfaces. It is a pure virtual " +"class and not meant to be used directly." +msgstr "rpc基类由 `rpc_master` 和 `rpc_slave` 类重新实现,以创建主和从接口。它是一个纯虚拟类,不应直接使用。" + +#: ../../library/omv.rpc.rst:85 ../../library/omv.rpc.rst:149 +#: ../../library/omv.rpc.rst:181 ../../library/omv.rpc.rst:257 +#: ../../library/omv.rpc.rst:277 ../../library/omv.rpc.rst:297 +#: ../../library/omv.rpc.rst:316 ../../library/omv.rpc.rst:334 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.rpc.rst:89 +msgid "Creates an rpc object. This constructor is not meant to be used directly." +msgstr "创建一个rpc对象。这个构造函数不应该直接使用。" + +#: ../../library/omv.rpc.rst:92 ../../library/omv.rpc.rst:156 +#: ../../library/omv.rpc.rst:188 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.rpc.rst:96 +msgid "" +"This method is meant to be reimplemented by specific interface classes of" +" `rpc_master` and `rpc_slave`. It should fill the ``buff`` argument which" +" is either a `bytearray` or `memoryview` object of bytes from the " +"interface equal to the length of the ``buff`` object in ``timeout_ms`` " +"milliseconds. On timeout this method should return ``None``. Note that " +"for master and slave synchronization this method should try to always " +"complete in at least ``timeout_ms`` milliseconds and not faster as the " +"`rpc_master` and `rpc_slave` objects will automatically increase the " +"``timeout_ms`` to synchronize." +msgstr "" +"这个方法应该由 `rpc_master` 和 `rpc_slave` 的特定接口类重新实现。它应该将来自接口的字节填充到 ``buff`` " +"参数中,``buff`` 是一个与 ``timeout_ms`` 毫秒长的接口字节对象或内存视图对象相等的 `bytearray` 或 " +"`memoryview` 对象。在超时时,此方法应返回 ``None``。注意,为了主从同步,该方法应尝试始终在至少 ``timeout_ms`` " +"毫秒内完成,并且不要太快,因为 `rpc_master` 和 `rpc_slave` 对象会自动增加 ``timeout_ms`` 以进行同步。" + +#: ../../library/omv.rpc.rst:105 +msgid "" +"This method is meant to be reimplemented by specific interface classes of" +" `rpc_master` and `rpc_slave`. It should send ``data`` bytes on the " +"interface within ``timeout_ms`` milliseconds. If it completes faster than" +" the timeout that is okay. No return value is expected." +msgstr "" +"这个方法应该由 `rpc_master` 和 `rpc_slave` 的特定接口类重新实现。它应该在 ``timeout_ms`` " +"毫秒内在接口上发生 ``data`` 字节。如果完成速度比超时快,那没问题。不需要返回值。" + +#: ../../library/omv.rpc.rst:111 +msgid "" +"This method is meant to be called directly. After synchronization of the " +"master and slave on return of a callback ``stream_reader`` may be called " +"to receive data as fast as possible from the master or slave device. " +"``call_back`` will be called repeatedly with a ``bytes_or_memory_view " +"argument`` that was sent by the ``stream_writer``. ``call_back`` is not " +"expected to return anything. ``queue_depth`` defines how many frames of " +"data the ``stream_writer`` may generate before slowing down and waiting " +"on the ``stream_reader``. Higher ``queue_depth`` values lead to higher " +"performance (up to a point) but require the ``stream_reader`` to be able " +"to handle outstanding packets in its interface layer. If you make the " +"``queue_depth`` larger than 1 then ``call_back`` should return very " +"quickly and not block. Finally, ``read_timeout_ms`` defines how many " +"milliseconds to wait to receive the ``bytes_or_memory_view`` payload per " +"call_back." +msgstr "" +"这个方法应该直接调用。在主和从设备同步后,可以调用 ``stream_reader`` " +"以尽可能快地从主或从设备接收数据。``call_back`` 将重复调用,其参数是由 ``stream_writer`` 发送的 " +"``bytes_or_memory_view`` 参数。``call_back`` 不应返回任何内容。``queue_depth`` 定义了 " +"``stream_writer`` 在减速并等待 ``stream_writer`` 之前可能生成多少帧数据。更高的 " +"``queue_depth`` 值会导致更高的性能(在一定程度上),但是需要 ``stream_reader`` " +"能够处理接口层中的未完成数据包。如果使 ``queue_depth`` 大于1,则 ``call_back`` " +"应该非常快速且不阻塞。最后,``read_timeout_ms`` 定义了每次调用要等待多少毫秒才能接收到 " +"``bytes_or_memory_view`` 负载。" + +#: ../../library/omv.rpc.rst:121 +msgid "" +"On any errors ``stream_reader`` will return. The master and slave devices" +" can try to setup the stream again afterwards to continue." +msgstr "在任何错误上,``stream_reader`` 将返回。主和从设备可以尝试在之后重新设置流以继续。" + +#: ../../library/omv.rpc.rst:124 +msgid "" +"If you need to cancel the ``stream_reader`` just raise an exception in " +"the ``call_back`` and catch it. The remote side will automatically " +"timeout." +msgstr "如果需要取消 ``stream_reader`` ,只需在 ``call_back`` 中引发异常并捕捉它。远程端将自动超时。" + +#: ../../library/omv.rpc.rst:129 +msgid "" +"This method is meant to be called directly. After synchronization of the " +"master and slave on return of a ``callback`` ``stream_writer`` may be " +"called to send data as fast as possible from the master or slave device. " +"``call_back`` will be called repeatedly and should return a " +"``bytes_or_memory_view`` object that will be sent to the " +"``stream_reader``. ``call_back`` should not take any arguments. Finally, " +"``write_timeout_ms`` defines how many milliseconds to wait to send the " +"``bytes_or_memory_view`` object returned by ``call_back``." +msgstr "" +"这个方法应该直接调用。在主和从设备同步后,在返回 ``callback`` 的回调时,可以调用 ``stream_writer`` " +"以尽可能快地从主或从设备发送数据。``call_back`` 将重复调用,并且应该返回一个由 ``stream_reader`` 发送到 " +"``bytes_or_memory_view`` 对象的对象。 ``call_back`` " +"不应该接受任何参数。最后,``write_timeout_ms`` 定义了等待多少毫秒来发送 ``call_back`` 返回的 " +"``bytes_or_memory_view`` 对象。" + +#: ../../library/omv.rpc.rst:136 +msgid "" +"On any errors ``stream_writer`` will return. The master and slave devices" +" can try to setup the stream again afterwards to continue." +msgstr "在任何错误上,``stream_writer`` 将返回。主和从设备可以尝试在之后重新设置流以继续。" + +#: ../../library/omv.rpc.rst:139 +msgid "" +"If you need to cancel the ``stream_writer`` just raise an exception in " +"the ``call_back`` and catch it. The remote side will automatically " +"timeout." +msgstr "如果需要取消 ``stream_writer``,只需要在 ``call_back`` 中引发异常并捕获它。远程端将自动超时。" + +#: ../../library/omv.rpc.rst:143 +msgid "class rpc_master - rpc_master virtual class" +msgstr "class rpc_master - rpc_master 虚拟类" + +#: ../../library/omv.rpc.rst:145 +msgid "" +"The rpc_master is a pure virtual class and not meant to be used directly." +" Specific interface classes should reimplement rpc_master." +msgstr "rpc_master是一个纯虚拟类,不应直接使用。特定接口类应该重新实现rpc_master。" + +#: ../../library/omv.rpc.rst:153 +msgid "" +"Creates an rpc_master object. This constructor is not meant to be used " +"directly." +msgstr "创建一个rpc_master对象。这个构造函数不应该直接使用。" + +#: ../../library/omv.rpc.rst:160 +msgid "" +"Executes a remote call on the slave device. ``name`` is a string name of " +"the remote function or method to execute. ``data`` is the ``bytes`` like " +"object that will be sent as the argument of the remote function or method" +" to exeucte. ``send_timeout`` defines how many milliseconds to wait while" +" trying to connect to the slave and get it to execute the remote function" +" or method. Once the master starts sending the argument to the slave " +"deivce ``send_timeout`` does not apply. The library will allow the " +"argument to take up to 5 seconds to be sent. ``recv_timeout`` defines how" +" many milliseconds to wait after the slave started executing the remote " +"method to receive the repsonse. Note that once the master starts " +"receiving the repsonse ``recv_timeout`` does not apply. The library will " +"allow the response to take up to 5 seconds to be received." +msgstr "" +"在从属设备上执行远程调用。``name`` 是要执行的远程函数或方法的字符串名称。``data`` 是将作为远程函数或方法参数发送的类似 " +"``bytes`` 的对象。``send_timeout`` " +"定义了在尝试连接到从属设备并让其执行远程函数或方法时等待的毫秒数。一旦主设备开始将参数发送到从属设备,``send_timeout`` " +"就不再适用。库将允许参数的发送最多花费 5 秒钟。``recv_timeout`` " +"定义了在从属设备开始执行远程方法后,等待接收响应的毫秒数。请注意,一旦主设备开始接收响应,``recv_timeout`` " +"就不再适用。库将允许响应的接收最多花费 5 秒钟。" + +#: ../../library/omv.rpc.rst:170 +msgid "" +"Note that a new packet that includes a copy of ``data`` will be created " +"internally inside the ``rpc`` library. You may encounter memory issues on" +" the OpenMV Cam if you try to pass very large data arguments." +msgstr "" +"请注意,内部将创建包含 ``data`` 副本的新数据包,该数据包将在 ``rpc`` 库内部创建。如果尝试传递非常大的数据参数,则可能会在 " +"OpenMV Cam 上遇到内存问题。" + +#: ../../library/omv.rpc.rst:175 +msgid "class rpc_slave - rpc_slave virtual class" +msgstr "class rpc_slave - rpc_slave虚拟类" + +#: ../../library/omv.rpc.rst:177 +msgid "" +"The rpc_slave is a pure virtual class and not meant to be used directly. " +"Specific interface classes should reimplement rpc_slave." +msgstr "rpc_slave 是一个纯虚拟类,不应直接使用。特定接口类应该重新实现rpc_slave。" + +#: ../../library/omv.rpc.rst:185 +msgid "" +"Creates an rpc_slave object. This constructor is not meant to be used " +"directly." +msgstr "创建一个rpc_slave对象。这个构造函数不应该直接使用。" + +#: ../../library/omv.rpc.rst:192 +msgid "" +"Registers a call back that can be executed by the master device. The call" +" back should take one argument which will be a ``memoryview`` object and " +"it should return a ``bytes()`` like object as the result. The call back " +"should return in less than 1 second if possible." +msgstr "" +"注册可以由主设备执行的回调。回调应该接受一个参数,该参数将是一个 ``memoryview`` 对象,它应该返回一个 ``bytes()`` " +"类似的对象作为结果。回调应该在可能的情况下在1秒内返回。" + +#: ../../library/omv.rpc.rst:198 +msgid "" +"After you execute ``rpc_slave.loop()`` it is not possible to execute long" +" running operations outside of the ``rpc`` library. ``schedule_callback``" +" allows you to break out of the ``rpc`` library temporarily after " +"completion of an call back. You should execute ``schedule_callback`` " +"during the execution of an ``rpc`` call back method to register a new " +"non-rpc call back that will be executed immediately after the successful " +"completion of that call back you executed ``schedule_callback`` in. The " +"function or method should not take any arguments. After the the call back" +" that was registered returns it must be registered again in the next " +"parent call back. On any error of the parent call back the registered " +"call back will not be called and must be registered again. Here's how to " +"use this::" +msgstr "" +"在执行完 ``rpc_slave.loop()`` 后,不可能在 ``rpc`` 库外执行长时间运行的操作。 " +"``schedule_callback`` 允许您在完成调用回调后暂时退出 ``rpc`` 库。您应该在执行 ``rpc`` 回调方法时执行 " +"``schedule_callback`` ,以注册一个新的非rpc回调,该回调将在成功完成您在其中执行 " +"``schedule_callback`` " +"的回调后立即执行。该函数或方法不应该接受任何参数。在注册的回调返回后,必须在下一个父回调中重新注册。如果父回调发生任何错误,则注册的回调将不会被调用,并且必须再次注册。下面是如何使用它的示例::" + +#: ../../library/omv.rpc.rst:219 +msgid "" +"``schedule_callback`` in particular allows you to use the ``get_bytes`` " +"and ``put_bytes`` methods for cut-through data transfer between one " +"device and another without the cost of packetization which limits the " +"size of the data moved inside the ``rpc`` library without running out of " +"memory on the OpenMV Cam." +msgstr "" +"特别是 ``schedule_callback`` 允许您使用 ``get_bytes`` 和 ``put_bytes`` " +"方法进行直通式数据传输,该方法可在设备之间进行数据传输而不需要包装成数据包,这会限制在 ``rpc`` 库内部移动的数据大小而不会耗尽OpenMV" +" Cam的内存。" + +#: ../../library/omv.rpc.rst:226 +msgid "" +"The loop call back is called every loop iteration of " +"``rpc_slave.loop()``. Unlike the ``rpc.schedule_callback()`` call back " +"this call back stays registered after being registered once. You can use " +"the loop call back to blink an activity LED or something like that. You " +"should not use the loop call back to execute any blocking code as this " +"will get in the way of polling for communication from the master. " +"Additionally, the loop call back will be called at a variable rate " +"depending on when and what call backs the master is trying to execute. " +"Given this, the loop call back is not suitable for any method that needs " +"to be executed at a fixed frequency." +msgstr "" +"循环回调在 ``rpc_slave.loop()`` 的每个循环迭代中调用。与 ``rpc.schedule_callback()`` " +"回调不同,一旦注册,此回调将保持注册状态。您可以使用循环回调来闪烁活动LED等。您不应该使用循环回调来执行任何阻塞代码,因为这会妨碍从主服务器轮询通信。此外,循环回调将根据主服务器尝试执行的回调的时间和内容以可变速率调用。鉴于此,循环回调不适用于任何需要以固定频率执行的方法。" + +#: ../../library/omv.rpc.rst:234 +msgid "" +"On the OpenMV Cam, if you need to execute something at a fixed frequency," +" you should setup a timer before executing ``rpc_slave.loop()`` and use a" +" timer interrupt based callback to execute some function or method at a " +"fixed frequency. Please see how to Write Interrupt Handlers for more " +"information. Note: The `Mutex` library is installed on your OpenMV Cam " +"along with the ``rpc`` library." +msgstr "" +"在OpenMV Cam上,如果需要以固定频率执行某些操作,应在执行 ``rpc_slave.loop()`` " +"之前设置一个定时器,并使用基于定时器中断的回调以固定频率执行某些函数或方法。有关更多信息,请参阅如何编写中断处理程序。注意:`Mutex` 库与 " +"``rpc`` 库一起安装在您的OpenMV Cam上。" + +#: ../../library/omv.rpc.rst:241 +msgid "" +"Starts execution of the ``rpc`` library on the slave to receive data. " +"This method does not return (except via an exception from a call back). " +"You should register all call backs first before executing this method. " +"However, it is possible to register new call backs inside of a call back " +"previously being registered that is executing." +msgstr "" +"开始在从设备上执行 ``rpc`` " +"库以接收数据。此方法不返回(除非来自回调的异常)。在执行此方法之前,应首先注册所有回调。但是,在正在注册的回调内部执行此方法是可能的。" + +#: ../../library/omv.rpc.rst:246 +msgid "" +"``recv_timeout`` defines how long to wait to receive a command from the " +"master device before trying again. ``send_timeout`` defines how long the " +"slave will wait for the master to receive the call back response before " +"going back to trying to receive. The loop call back will be executed " +"before trying to receive again." +msgstr "" +"``recv_timeout`` 定义了在再次尝试从主设备接收命令之前要等待多长时间。 ``send_timeout`` " +"定义了从设备在等待主设备接收回调响应之前要等待多长时间。在再次尝试接收之前,循环回调将被执行。" + +#: ../../library/omv.rpc.rst:252 +msgid "class rpc_can_master - CAN Master Interface" +msgstr "class rpc_can_master - CAN 主接口" + +#: ../../library/omv.rpc.rst:254 +msgid "Control another ``rpc`` device over CAN." +msgstr "通过CAN控制另一个 ``rpc`` 设备。" + +#: ../../library/omv.rpc.rst:261 +msgid "Creates a CAN ``rpc`` master. This interface can move up to 1 Mb/s." +msgstr "创建一个CAN ``rpc`` 主设备。该接口可移动达1 Mb/s。" + +#: ../../library/omv.rpc.rst:263 ../../library/omv.rpc.rst:283 +msgid "" +"message_id - CAN message to use for data transport on the can bus " +"(11-bit)." +msgstr "message_id - CAN总线上用于数据传输的CAN消息(11位)。" + +#: ../../library/omv.rpc.rst:264 ../../library/omv.rpc.rst:284 +msgid "bit_rate - CAN bit rate." +msgstr "bit_rate - CAN比特率。" + +#: ../../library/omv.rpc.rst:265 ../../library/omv.rpc.rst:285 +msgid "" +"sample_point - Tseg1/Tseg2 ratio. Typically 75%. (50.0, 62.5, 75, 87.5, " +"etc.)" +msgstr "sample_point - Tseg1/Tseg2 比率。通常为75%。 (50.0、62.5、75、87.5等)" + +#: ../../library/omv.rpc.rst:266 ../../library/omv.rpc.rst:286 +msgid "can_bus - CAN Bus number to use" +msgstr "can_bus - 要使用的CAN总线号" + +#: ../../library/omv.rpc.rst:268 ../../library/omv.rpc.rst:288 +msgid "" +"NOTE: Master and slave message ids and can bit rates must match. Connect " +"master can high to slave can high and master can low to slave can lo. The" +" can bus must be terminated with 120 ohms." +msgstr "注意:主和从消息id和can比特率必须匹配。将主can高连接到从can高,将主can低连接到从can低。CAN总线必须使用120欧姆终端电阻终止。" + +#: ../../library/omv.rpc.rst:272 +msgid "class rpc_can_slave - CAN Slave Interface" +msgstr "class rpc_can_slave - CAN从接口" + +#: ../../library/omv.rpc.rst:274 +msgid "Be controlled by another ``rpc`` device over CAN." +msgstr "通过CAN接口由另一个 ``rpc`` 设备控制。" + +#: ../../library/omv.rpc.rst:281 +msgid "Creates a CAN ``rpc`` slave. This interface can move up to 1 Mb/s." +msgstr "创建一个CAN ``rpc`` 从设备。该接口可移动达 1 Mb/s。" + +#: ../../library/omv.rpc.rst:292 +msgid "class rpc_i2c_master - I2C Master Interface" +msgstr "class rpc_i2c_master - I2C 主接口" + +#: ../../library/omv.rpc.rst:294 +msgid "Control another ``rpc`` device over I2C." +msgstr "通过I2C控制另一个 ``rpc`` 设备。" + +#: ../../library/omv.rpc.rst:301 +msgid "Creates a I2C ``rpc`` master. This interface can move up to 1 Mb/s." +msgstr "创建一个 I2C ``rpc`` 主设备。该接口可移动达 1 Mb/s。" + +#: ../../library/omv.rpc.rst:303 ../../library/omv.rpc.rst:322 +msgid "slave_addr - I2C address." +msgstr "slave_addr - I2C 地址。" + +#: ../../library/omv.rpc.rst:304 +msgid "rate - I2C Bus Clock Frequency." +msgstr "rate - I2C 总线时钟频率。" + +#: ../../library/omv.rpc.rst:305 ../../library/omv.rpc.rst:323 +msgid "i2c_bus - I2C bus number to use." +msgstr "i2c_bus - 要使用的I2C总线号。" + +#: ../../library/omv.rpc.rst:307 ../../library/omv.rpc.rst:325 +msgid "" +"NOTE: Master and slave addresses must match. Connect master scl to slave " +"scl and master sda to slave sda. You must use external pull ups. Finally," +" both devices must share a ground." +msgstr "注意:主和从地址必须匹配。将主scl连接到从scl,将主sda连接到从sda。您必须使用外部上拉电阻。最后,两个设备必须共享地线。" + +#: ../../library/omv.rpc.rst:311 +msgid "class rpc_i2c_slave - I2C Slave Interface" +msgstr "class rpc_i2c_slave - I2C 从接口" + +#: ../../library/omv.rpc.rst:313 +msgid "Be controlled by another ``rpc`` device over I2C." +msgstr "通过I2C接口由另一个 ``rpc`` 设备控制。" + +#: ../../library/omv.rpc.rst:320 +msgid "Creates a I2C ``rpc`` slave. This interface can move up to 1 Mb/s." +msgstr "创建一个I2C ``rpc`` 从设备。该接口可移动达1 Mb/s。" + +#: ../../library/omv.rpc.rst:329 +msgid "class rpc_spi_master - SPI Master Interface" +msgstr "class rpc_spi_master - SPI 主接口" + +#: ../../library/omv.rpc.rst:331 +msgid "Control another ``rpc`` device over SPI." +msgstr "通过SPI控制另一个 ``rpc`` 设备。" + +#: ../../library/omv.rpc.rst:338 +msgid "Creates a SPI ``rpc`` master. This interface can move up to 80 Mb/s." +msgstr "创建一个SPI ``rpc`` 主设备。该接口可以动达 80 Mb/s。" + +#: ../../library/omv.rpc.rst:340 ../../library/omv.rpc.rst:358 +msgid "cs_pin - Slave Select Pin." +msgstr "cs_pin - 从设备选择引脚。" + +#: ../../library/omv.rpc.rst:341 +msgid "freq - SPI Bus Clock Frequency." +msgstr "freq - SPI 总线时钟频率。" + +#: ../../library/omv.rpc.rst:342 ../../library/omv.rpc.rst:359 +msgid "clk_polarity - Idle clock level (0 or 1)." +msgstr "clk_polarity - 闲置时钟电平(0或1)。" + +#: ../../library/omv.rpc.rst:343 ../../library/omv.rpc.rst:360 +msgid "clk_phase - Sample data on the first (0) or second edge (1) of the clock." +msgstr "clk_phase - 在时钟的第一个(0)或第二个(1)边沿上对数据进行采样。" + +#: ../../library/omv.rpc.rst:344 ../../library/omv.rpc.rst:361 +msgid "spi_bus - SPI bus number to use." +msgstr "spi_bus - 要使用的SPI总线号。" + +#: ../../library/omv.rpc.rst:346 ../../library/omv.rpc.rst:363 +msgid "" +"NOTE: Master and slave settings much match. Connect CS, SCLK, MOSI, MISO " +"to CS, SCLK, MOSI, MISO. Finally, both devices must share a common " +"ground." +msgstr "注意:主和从设备必须匹配。将CS、SCLK、MOSI、MISO连接到CS、SCLK、MOSI、MISO。最后,两个设备必须共享一个公共地线。" + +#: ../../library/omv.rpc.rst:350 +msgid "class rpc_spi_slave - SPI Slave Interface" +msgstr "class rpc_spi_slave - SPI 从接口" + +#: ../../library/omv.rpc.rst:352 +msgid "Be controlled by another ``rpc`` device over SPI." +msgstr "通过SPI由另一个 ``rpc`` 设备控制。" + +#: ../../library/omv.rpc.rst:356 +msgid "Creates a SPI ``rpc`` slave. This interface can move up to 80 Mb/s." +msgstr "创建一个 SPI ``rpc`` 从设备。该接口可移动达 80 Mb/s。" + +#: ../../library/omv.rpc.rst:367 +msgid "class rpc_uart_master - UART Master Interface" +msgstr "class rpc_uart_master - UART 主接口" + +#: ../../library/omv.rpc.rst:369 +msgid "Control another ``rpc`` device over Async Serial (UART)." +msgstr "通过异步串行(UART)控制另一个 ``rpc`` 设备。" + +#: ../../library/omv.rpc.rst:373 +msgid "Creates a UART ``rpc`` master. This interface can move up to 7.5 Mb/s." +msgstr "创建一个UART ``rpc`` 主设备。该接口可移动达 7.5 Mb/s。" + +#: ../../library/omv.rpc.rst:375 ../../library/omv.rpc.rst:390 +msgid "baudrate - Serial Baudrate." +msgstr "baudrate - 串行波特率。" + +#: ../../library/omv.rpc.rst:376 ../../library/omv.rpc.rst:391 +msgid "uart_port - UART port to use." +msgstr "uart_port - 要使用的UART端口。" + +#: ../../library/omv.rpc.rst:378 ../../library/omv.rpc.rst:393 +msgid "" +"NOTE: Master and slave baud rates must match. Connect master tx to slave " +"rx and master rx to slave tx. Finally, both devices must share a common " +"ground." +msgstr "注意:主和从波特率必须匹配。将主tx连接到从rx,将主rx连接到从tx。最后,两个设备必须共享一个公共地线。" + +#: ../../library/omv.rpc.rst:382 +msgid "class rpc_uart_slave - UART Slave Interface" +msgstr "class rpc_uart_slave - UART 从接口" + +#: ../../library/omv.rpc.rst:384 +msgid "Be controlled by another ``rpc`` device over Async Serial (UART)." +msgstr "通过异步串行(UART)由另一个 ``rpc`` 设备控制。" + +#: ../../library/omv.rpc.rst:388 +msgid "Creates a UART ``rpc`` slave. This interface can move up to 7.5 Mb/s." +msgstr "创建一个UART ``rpc`` 从设备。该接口可移动达7.5 Mb/s." + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.rtsp.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.rtsp.po new file mode 100644 index 0000000000000..14af70a055a0b --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.rtsp.po @@ -0,0 +1,188 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.rtsp.rst:2 +msgid ":mod:`rtsp` --- rtsp library" +msgstr ":mod:`rtsp` --- rtsp库" + +#: ../../library/omv.rtsp.rst:7 +msgid "" +"The ``rtsp`` module on the OpenMV Cam allows you to stream video from " +"your OpenMV Cam to any compatible RTSP client (like `VLC " +"`_)." +msgstr "" +"OpenMV Cam上的 ``rtsp`` 模块允许您将视频从OpenMV " +"Cam流式传输到任何兼容的RTSP客户端(如 `VLC `_)。" + +#: ../../library/omv.rtsp.rst:11 +msgid "How to use the Library" +msgstr "如何使用该库" + +#: ../../library/omv.rtsp.rst:13 +msgid "Please checkout the example scripts in OpenMV IDE under ``Web Servers``." +msgstr "请查看OpenMV IDE中的示例脚本,位于 ``Web Servers`` 下。" + +#: ../../library/omv.rtsp.rst:15 +msgid "" +"The `rtsp_server` is very easy to use. After being created you just need " +"to call the `rtsp_server.stream()` method with a call back function to " +"generate image objects. For example::" +msgstr "" +"`rtsp_server` 非常易于使用。创建后,您只需使用回调函数调用 `rtsp_server." +"stream()` 方法来生成图像对象。例如::" + +#: ../../library/omv.rtsp.rst:28 +msgid "" +"Note that not all RTSP clients can decode all types of JPEG images " +"streamed. For best results please use the OV2640/OV5640 camera modules " +"`sensor.JPEG` mode for streaming RTSP JPEG video." +msgstr "" +"请注意,并非所有RTSP客户端都能解码流式传输的所有类型的JPEG图像。为获得最佳效" +"果,请使用OV2640/OV5640摄像头模块的 `sensor.JPEG` 模式来流式传输RTSP JPEG " +"视频。" + +#: ../../library/omv.rtsp.rst:32 +msgid "class rtsp_server - rtsp_server class" +msgstr "class rtsp_server - rtsp_server 类" + +#: ../../library/omv.rtsp.rst:34 +msgid "" +"The `rtsp_server` class creates a single connection RTSP web server on " +"your OpenMV Cam." +msgstr "`rtsp_server` 类在您的OpenMV Cam上创建一个单连接的RTSP Web服务器。" + +#: ../../library/omv.rtsp.rst:37 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.rtsp.rst:41 +msgid "Creates a WiFi ``rtsp`` server." +msgstr "创建一个WiFi ``rtsp`` 服务器。" + +#: ../../library/omv.rtsp.rst:43 +msgid "" +"``network_if`` is the network module interface created from " +"``network.LAN()``, ``network.WLAN()``, or etc." +msgstr "``network_if`` 是从 ``network.LAN()``、``network.WLAN()`` " +"等创建的网络模块接口。" + +#: ../../library/omv.rtsp.rst:45 +msgid "``port`` is the port number to use. The default RTSP port is 554." +msgstr "``port`` 是要使用的端口号。默认的RTSP端口是554。" + +#: ../../library/omv.rtsp.rst:48 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.rtsp.rst:52 +msgid "" +"Bind a call back (``cb``) to be executed when a client sets up a RTSP " +"connection with the `rtsp_server`." +msgstr "将回调函数(``cb``)绑定到当客户端与 `rtsp_server` 建立RTSP连接时执行。" + +#: ../../library/omv.rtsp.rst:54 ../../library/omv.rtsp.rst:69 +#: ../../library/omv.rtsp.rst:84 ../../library/omv.rtsp.rst:101 +msgid "Registering a call back is not required for the `rtsp_server` to work." +msgstr "注册回调函数不是 `rtsp_server` 工作的必需条件。" + +#: ../../library/omv.rtsp.rst:56 ../../library/omv.rtsp.rst:71 +#: ../../library/omv.rtsp.rst:88 ../../library/omv.rtsp.rst:103 +#: ../../library/omv.rtsp.rst:124 +msgid "The call back should accept two arguments:" +msgstr "回调函数应该接受两个参数:" + +#: ../../library/omv.rtsp.rst:58 ../../library/omv.rtsp.rst:73 +#: ../../library/omv.rtsp.rst:90 ../../library/omv.rtsp.rst:105 +#: ../../library/omv.rtsp.rst:126 +msgid "" +"``pathname`` is the name of the stream resource the client wants. You can" +" ignore this if it's not needed. Otherwise, you can use it to determine " +"what image object to return. By default the ``pathname`` will be \"/\"." +msgstr "" +"``pathname`` 是客户端想要的流资源的名称。如果不需要,可以忽略这一点。否则,您" +"可以使用它来确定要返回的图像对象。默认情况下,``pathname`` 将为\"/\"。" + +#: ../../library/omv.rtsp.rst:62 ../../library/omv.rtsp.rst:77 +#: ../../library/omv.rtsp.rst:94 ../../library/omv.rtsp.rst:109 +#: ../../library/omv.rtsp.rst:130 +msgid "" +"``session`` is random number that will change when a new connection is " +"established. You can use ``session`` with a dictionary to differentiate " +"different accesses to the same ``pathname``." +msgstr "" +"``session`` 是一个随机数,在建立新连接时会更改。您可以将 ``session`` " +"与字典一起使用,以区分对同一 ``pathname`` 的不同访问。" + +#: ../../library/omv.rtsp.rst:67 +msgid "" +"Bind a call back (``cb``) to be executed when a client wants to start " +"streaming." +msgstr "将回调函数(``cb``)绑定到当前客户端想要开始流式传输时执行。" + +#: ../../library/omv.rtsp.rst:82 +msgid "" +"Bind a call back (``cb``) to be executed when a client wants to pause " +"streaming." +msgstr "将回调函数(``cb``)绑定到当客户端想要暂停流式传输时执行。" + +#: ../../library/omv.rtsp.rst:86 +msgid "" +"NOTE: When you click the pause button on `VLC " +"`_ in does not tell the server " +"to pause." +msgstr "注意:在 `VLC `_ 上单击暂停按钮不会告诉服务器暂停。" + +#: ../../library/omv.rtsp.rst:99 +msgid "" +"Bind a call back (``cb``) to be executed when a client wants tear down a " +"RTSP connection with the `rtsp_server`." +msgstr "将回调函数(``cb``)绑定到当前客户端想要拆除与 `rtsp_server` " +"的RTSP连接时执行。" + +#: ../../library/omv.rtsp.rst:114 +msgid "" +"Starts running the `rtsp_server` logic and does not return. Make sure to " +"setup everything you want to first before calling this method. Once " +"called the `rtsp_server` will start accepting connections and streaming " +"video data." +msgstr "" +"启动 `rtsp_server` 逻辑并且不返回。在调用此方法之前,请确保首先设置好一切。一" +"旦调用,`rtsp_server` 将开始接受连接并流式传输视频数据。" + +#: ../../library/omv.rtsp.rst:118 +msgid "" +"``cb`` should be a call back that returns an `Image` object which the " +"RTSP library will jpeg compress and stream to the remote client. You are " +"free to modify a `sensor.snapshot()` image as much as you like before " +"returning the image object to be sent." +msgstr "" +"``cb`` 应该是一个回调函数,返回一个 `Image` " +"对象,RTSP库将对其进行jpeg压缩并流式传输到远程客户端。" +"您可以在返回图像对象之前自由修改 `sensor.snapshot()` 图像。" + +#: ../../library/omv.rtsp.rst:122 +msgid "``quality`` is the JPEG compression quality to use while streaming." +msgstr "``quality`` 是在流式传输时使用的JPEG压缩质量。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.sensor.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.sensor.po new file mode 100644 index 0000000000000..a3e8adddb7ed1 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.sensor.po @@ -0,0 +1,1919 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.sensor.rst:2 +msgid ":mod:`sensor` --- camera sensor" +msgstr ":mod:`sensor` --- 相机传感器" + +#: ../../library/omv.sensor.rst:7 +msgid "" +"**THIS MODULE IS NOW DEPRECATED AND TO BE REPLACED BY THE CSI MODULE. " +"PLEASE UPDATE YOUR CODE TO USE THE NEW CSI MODULE. NO NEW FEATURES WILL " +"BE ADDED TO THE SENSOR MODULE AND IT MAY BE REMOVED IN THE FUTURE.**" +msgstr "" +"**此模块现已弃用,将由 CSI 模块替代。请更新您的代码以使用新的 CSI 模块。" +"sensor 模块将不再添加新功能,并且将来可能会被移除。**" + +#: ../../library/omv.sensor.rst:11 +msgid "The ``sensor`` module is used for taking pictures." +msgstr "``sensor`` 模块用于拍照。" + +#: ../../library/omv.sensor.rst:13 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/omv.sensor.rst:28 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.sensor.rst:32 +msgid "Initializes the camera sensor." +msgstr "初始化相机传感器。" + +#: ../../library/omv.sensor.rst:36 +msgid "Puts the camera to sleep if enable is True. Otherwise, wakes it back up." +msgstr "如果enable是True,则让相机进入睡眠状态。否则,唤醒相机。" + +#: ../../library/omv.sensor.rst:40 +msgid "" +"Puts the camera into a lower power mode than sleep (but the camera must " +"be reset on being woken up)." +msgstr "将相机置于比睡眠模式更低的功耗模式(但相机必须在唤醒时进行重置)。" + +#: ../../library/omv.sensor.rst:44 +msgid "" +"Copies whatever was in the frame buffer to the IDE. You should call this " +"method to display the last image your OpenMV Cam takes if it's not " +"running a script with an infinite loop. Note that you'll need to add a " +"delay time of about a second after your script finishes for the IDE to " +"grab the image from your camera. Otherwise, this method will have no " +"effect." +msgstr "" +"将帧缓冲区中的内容复制到IDE中。如果不是在运行带有无循环的脚本,则应调用此方法来显示OpenMV " +"Cam拍摄的最后一张图像。请注意,在脚本完成后,您需要添加约一秒的延迟时间,以便IDE从相机中获取图像。否则,此方法无效。" + +#: ../../library/omv.sensor.rst:52 +msgid "Takes a picture using the camera and returns an ``image`` object." +msgstr "使用相机拍照并返回一个 ``image`` 对象。" + +#: ../../library/omv.sensor.rst:54 +msgid "" +"The OpenMV Cam has two memory areas for images. The classical stack/heap " +"area used for normal MicroPython processing can store small images within" +" it's heap. However, the MicroPython heap is only about ~100 KB which is " +"not enough to store larger images. So, your OpenMV Cam has a secondary " +"frame buffer memory area that stores images taken by `sensor.snapshot()`." +" Images are stored on the bottom of this memory area. Any memory that's " +"left over is then available for use by the frame buffer stack which your " +"OpenMV Cam's firmware uses to hold large temporary data structures for " +"image processing algorithms." +msgstr "" +"OpenMV Cam 有两个用于图像的内存区域。用于正常 MicroPython " +"处理的经典堆栈/堆区可以在其堆区中存储小型图像。但是,MicroPython 堆的大小仅约为 ~100 KB,这不足以存储较大的图像。因此,您的 " +"OpenMV Cam 具有用于存储由 `sensor.snapshot()` " +"拍摄的图像的第二个帧缓冲区内存区域。图像存储在此内存区域的底部。剩余的任何内存将可供帧缓冲区堆栈使用,您的 OpenMV Cam " +"固件用于保存用于图像处理算法的大型临时数据结构。" + +#: ../../library/omv.sensor.rst:64 +msgid "" +"If you need room to hold multiple frames you may \"steal\" frame buffer " +"space by calling `sensor.alloc_extra_fb()`." +msgstr "如果您需要空间来存储多个帧,可以通过调用 `sensor.alloc_extra_fb()` 来“窃取”帧缓冲区空间。" + +#: ../../library/omv.sensor.rst:67 +msgid "" +"If `sensor.set_auto_rotation()` is enabled this method will return a new " +"already rotated `image` object." +msgstr "如果启用了 `sensor.set_auto_rotation()`,则此方法将返回一个新的已旋转的 `image` 对象。" + +#: ../../library/omv.sensor.rst:72 +msgid "" +"`sensor.snapshot()` may apply cropping parameters to fit the snapshot in " +"the available RAM the pixformat, framesize, windowing, and framebuffers. " +"The cropping parameters will be applied to maintain the aspect ratio and " +"will stay until `sensor.set_framesize()` or `sensor.set_windowing()` are " +"called." +msgstr "" +"`sensor.snapshot()` 可能会应用裁剪参数,以适应快照在可用 RAM " +"中的大小,包括像素格式、帧大小、窗口化和帧缓冲区。裁剪参数将应用于保持纵横比,并保持到调用 `sensor.set_framesize()` 或 " +"`sensor.set_windowing()` 为止。" + +#: ../../library/omv.sensor.rst:78 +msgid "" +"Takes ``n`` number of snapshots to let the camera image stabilize after " +"changing camera settings. ``n`` is passed as normal argument, e.g. " +"``skip_frames(10)`` to skip 10 frames. You should call this function " +"after changing camera settings." +msgstr "" +"获取 ``n`` 个快照,以使相机图像在更改相机设置后稳定。 ``n`` 作为常规参数传递,例如 ``skip_frames(10)`` 跳过 " +"10 帧。在更改相机设置后,应调用此函数。" + +#: ../../library/omv.sensor.rst:83 +msgid "" +"Alternatively, you can pass the keyword argument ``time`` to skip frames " +"for some number of milliseconds, e.g. ``skip_frames(time = 2000)`` to " +"skip frames for 2000 milliseconds." +msgstr "" +"或者,您可以传递关键字参数 ``time`` 来跳过一些毫秒数的帧,例如 ``skip_frames(time = 2000)`` 跳过 2000" +" 毫秒的帧。" + +#: ../../library/omv.sensor.rst:87 +msgid "" +"If neither ``n`` nor ``time`` is specified this method skips frames for " +"300 milliseconds." +msgstr "如果未指定 ``n`` 或 ``time``,则此方法将跳过300毫秒的帧。" + +#: ../../library/omv.sensor.rst:90 +msgid "" +"If both are specified this method skips ``n`` number of frames but will " +"timeout after ``time`` milliseconds." +msgstr "如果两者都指定,则此方法将跳过 ``n`` 个帧,但在 ``time`` 毫秒后超时。" + +#: ../../library/omv.sensor.rst:95 +msgid "" +"`sensor.snapshot()` may apply cropping parameters to fit the snapshot in " +"the available RAM given the pixformat, framesize, windowing, and " +"framebuffers. The cropping parameters will be applied to maintain the " +"aspect ratio and will stay until `sensor.set_framesize()` or " +"`sensor.set_windowing()` are called." +msgstr "" +"`sensor.snapshot()` 可能会应用裁剪参数,以适应快照在可用 RAM " +"中的大小,包括像素格式、帧大小、窗口化和帧缓冲区。裁剪参数将应用于保持纵横比,并保持到调用 `sensor.set_framesize()` 或 " +"`sensor.set_windowing()` 为止。" + +#: ../../library/omv.sensor.rst:101 +msgid "Returns the sensor resolution width." +msgstr "返回传感器分辨率的宽度。" + +#: ../../library/omv.sensor.rst:105 +msgid "Returns the sensor resolution height." +msgstr "返回传感器分辨率的高度。" + +#: ../../library/omv.sensor.rst:109 +msgid "" +"(Get Frame Buffer) Returns the image object returned by a previous call " +"of `sensor.snapshot()`. If `sensor.snapshot()` had not been called before" +" then ``None`` is returned." +msgstr "" +"(获取帧缓冲区)返回先前调用 `sensor.snapshot()` 返回的图像对象。如果之前未调用过 " +"`sensor.snapshot()`,则返回 ``None``。" + +#: ../../library/omv.sensor.rst:115 +msgid "Returns the camera module ID." +msgstr "返回相机模块ID。" + +#: ../../library/omv.sensor.rst:117 +msgid "`sensor.OV2640`: Second gen OpenMV Cam sensor - never released." +msgstr "`sensor.OV2640`:第二代 OpenMV Cam传感器 - 从未发布。" + +#: ../../library/omv.sensor.rst:118 +msgid "`sensor.OV5640`: High-res OpenMV Cam H7 Plus sensor." +msgstr "`sensor.OV5640`:高分辨率 OpenMV Cam H7 Plus 传感器。" + +#: ../../library/omv.sensor.rst:119 +msgid "`sensor.OV7670`: Arduino Giga Sensor Module." +msgstr "`sensor.OV7670`:Arduino Giga 传感器模块。" + +#: ../../library/omv.sensor.rst:120 +msgid "`sensor.OV7690`: OpenMV Cam Micro sensor module." +msgstr "`sensor.OV7690`: OpenMV Cam Micro传感器模块。" + +#: ../../library/omv.sensor.rst:121 +msgid "`sensor.OV7725`: Rolling shutter sensor module." +msgstr "`sensor.OV7725`:滚动快门传感器模块。" + +#: ../../library/omv.sensor.rst:122 +msgid "`sensor.OV9650`: First gen OpenMV Cam sensor - never released." +msgstr "`sensor.OV9650`:第一代 OpenMV Cam 传感器 - 从未发布。" + +#: ../../library/omv.sensor.rst:123 +msgid "`sensor.MT9V022`: Global shutter sensor module." +msgstr "`sensor.MT9V022`:全局快门传感器模块。" + +#: ../../library/omv.sensor.rst:124 +msgid "`sensor.MT9V024`: Global shutter sensor module." +msgstr "`sensor.MT9V024`:全局快门传感器模块。" + +#: ../../library/omv.sensor.rst:125 +msgid "`sensor.MT9V032`: Global shutter sensor module." +msgstr "`sensor.MT9V032`:全局快门传感器模块。" + +#: ../../library/omv.sensor.rst:126 +msgid "`sensor.MT9V034`: Global shutter sensor module." +msgstr "`sensor.MT9V034`:全局快门传感器模块。" + +#: ../../library/omv.sensor.rst:127 +msgid "`sensor.MT9M114`: OV7725 replacement rolling shutter sensor module." +msgstr "`sensor.MT9M114`:OV7725 替代型滚动快门传感器模块。" + +#: ../../library/omv.sensor.rst:128 +msgid "`sensor.BOSON320`: Boson 320x256 thermal sensor module." +msgstr "`sensor.BOSON320`:Boson 320x256 热成像传感器模块。" + +#: ../../library/omv.sensor.rst:129 +msgid "`sensor.BOSON640`: Boson 640x512 thermal sensor module." +msgstr "`sensor.BOSON640`:Boson 640x512 热成像传感器模块。" + +#: ../../library/omv.sensor.rst:130 +msgid "`sensor.LEPTON`: Lepton1/2/3 sensor module." +msgstr "`sensor.LEPTON`:Lepton1/2/3传感器模块。" + +#: ../../library/omv.sensor.rst:131 +msgid "`sensor.HM01B0`: Arduino Portenta H7 sensor module." +msgstr "`sensor.HM01B0`: Arduino Portenta H7 传感器模块。" + +#: ../../library/omv.sensor.rst:132 +msgid "`sensor.HM0360`: Arduino Portenta H7 sensor module." +msgstr "`sensor.HM0360`:Arduino Portenta H7 传感器模块。" + +#: ../../library/omv.sensor.rst:133 +msgid "`sensor.GC2145`: Arduino Nicla Vision H7 sensor module." +msgstr "`sensor.GC2145`: Arduino Nicla Vision H7传感器模块。" + +#: ../../library/omv.sensor.rst:134 +msgid "" +"`sensor.GENX320ES`: Prophesee Event Camera sensor module (engineering " +"sample)." +msgstr "`sensor.GENX320ES`:Prophesee 事件相机传感器模块(工程样品)。" + +#: ../../library/omv.sensor.rst:135 +msgid "`sensor.GENX320`: Prophesee Event Camera sensor module." +msgstr "`sensor.GENX320`:Prophesee 事件相机传感器模块。" + +#: ../../library/omv.sensor.rst:136 +msgid "`sensor.PAG7920`: PixArt Imaging sensor Module." +msgstr "`sensor.PAG7920`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.sensor.rst:137 +msgid "`sensor.PAG7936`: PixArt Imaging sensor Module." +msgstr "`sensor.PAG7936`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.sensor.rst:138 +msgid "`sensor.PAJ6100`: PixArt Imaging sensor Module." +msgstr "`sensor.PAJ6100`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.sensor.rst:139 +msgid "`sensor.PSS5520`: PixArt Imaging sensor Module." +msgstr "`sensor.PSS5520`:PixArt Imaging 传感器模块。" + +#: ../../library/omv.sensor.rst:140 +msgid "" +"`sensor.FROGEYE2020` : FrogEye2020 event camera sensor module - never " +"released." +msgstr "`sensor.FROGEYE2020`:FrogEye2020 事件相机传感器模块 - 从未发布。" + +#: ../../library/omv.sensor.rst:144 +msgid "" +"Allocates another frame buffer for image storage from the frame buffer " +"stack and returns an ``image`` object of ``width``, ``height``, and " +"``pixformat``." +msgstr "" +"从帧缓冲区堆栈中为图像存储分配另一个帧缓冲区,并返回 ``width`` 、 ``height`` 和 ``pixformat`` 的 " +"``image`` 对象。" + +#: ../../library/omv.sensor.rst:147 +msgid "" +"You may call this function as many times as you like as long as there's " +"memory available to allocate any number of extra frame buffers." +msgstr "只要有可用的内存,您可以调用此函数任意次数,以分配任意数量的额外帧缓冲区。" + +#: ../../library/omv.sensor.rst:150 +msgid "" +"If ``pixformat`` is a number >= 4 then this will allocate a JPEG image. " +"You can then do `Image.bytearray()` to get byte level read/write access " +"to the JPEG image." +msgstr "" +"如果 ``pixformat`` 是大于等于 4 的数字,则将分配 JPEG 图像。然后,您可以使用 `Image.bytearray()` " +"来获得对 JPEG 图像的字节级读写访问。" + +#: ../../library/omv.sensor.rst:155 +msgid "" +"Creating secondary images normally requires creating them on the heap " +"which has a limited amount of RAM... but, also gets fragmented making it " +"hard to grab a large contigous memory array to store an image in. With " +"this method you are able to allocate a very large memory array for an " +"image instantly by taking space away from our frame buffer stack memory " +"which we use for computer vision algorithms. That said, this also means " +"you'll run out of memory more easily if you try to execute more memory " +"intensive machine vision algorithms like `Image.find_apriltags()`." +msgstr "" +"创建次级图像通常需要在堆上分配内存,而堆的内存量是有限的,而且堆内存还会发生碎片化,这使得很难获得一块足够大的连续内存区域来存储图像。通过这种方法,你可以通过从用于计算机视觉算法的帧缓冲区栈内存中分配空间,瞬间为图像分配一个非常大的内存数组。也就是说,这种方法让你能够更高效地处理图像,但这也意味着,如果你尝试执行更高内存需求的机器视觉算法(例如" +" `Image.find_apriltags()`),你可能会更容易用完内存。" + +#: ../../library/omv.sensor.rst:166 +msgid "" +"Deallocates the last previously allocated extra frame buffer. Extra frame" +" buffers are stored in a stack like structure." +msgstr "释放上一个先前分配的额外帧缓冲区。额外帧缓冲区用于存储在类似堆栈的结构中。" + +#: ../../library/omv.sensor.rst:171 +msgid "" +"Your OpenMV Cam has two memory areas. First, you have your classical " +".data/.bss/heap/stack memory area. The .data/.bss/heap regions are fixed " +"by firmware. The stack then grows down until it hits the heap. Next, " +"frame buffers are stored in a secondary memory region. Memory is liad out" +" with the main frame buffer on the bottom and the frame buffer stack on " +"the top. When `sensor.snapshot()` is called it fills the frame bufer from" +" the bottom. The frame buffer stack is then able to use whatever is left " +"over. This memory allocation method is extremely efficent for computer " +"vision on microcontrollers." +msgstr "" +"您的OpenMV " +"Cam有两个内存区域。首先,你有传统的.data/.bss/heap/stack内存区域。.data/.bss/heap区域由固件固定。栈区会向下增长,直到与堆区相遇。接下来,帧缓冲区存储在一个次级内存区域中。内存的布局是:主帧缓冲区位于底部,帧缓冲区栈位于顶部。当调用" +" `sensor.snapshot()` " +"时,它会从底部开始填充帧缓冲区。帧缓冲区栈则可以使用剩余的内存。这种内存分配方法对于微控制器上的计算机视觉非常高效。" + +#: ../../library/omv.sensor.rst:183 +msgid "Sets the pixel format for the camera module." +msgstr "设置相机模块的像素格式。" + +#: ../../library/omv.sensor.rst:185 +msgid "`sensor.GRAYSCALE`: 8-bits per pixel." +msgstr "`sensor.GRAYSCALE`:每像素8位。" + +#: ../../library/omv.sensor.rst:186 +msgid "`sensor.RGB565`: 16-bits per pixel." +msgstr "`sensor.RGB565`:每像素16位。" + +#: ../../library/omv.sensor.rst:187 +msgid "`sensor.BAYER`: 8-bits per pixel bayer pattern." +msgstr "`sensor.BAYER`:每像素8位bayer模式。" + +#: ../../library/omv.sensor.rst:188 +msgid "" +"`sensor.YUV422`: 16-bits per pixel (8-bits Y1, 8-bits U, 8-bits Y2, " +"8-bits V, etc.)" +msgstr "`sensor.YUV422`:每像素16位(8位Y1,8位U,8位Y2,8位V,等等)" + +#: ../../library/omv.sensor.rst:189 +msgid "`sensor.JPEG`: Compressed JPEG data. Only for the OV2640/OV5640." +msgstr "`sensor.JPEG`:压缩的 JPEG 数据。仅适用于 OV2640/OV5640。" + +#: ../../library/omv.sensor.rst:191 +msgid "" +"If you are trying to take JPEG images with the OV2640 or OV5640 camera " +"modules at high resolutions you should set the pixformat to " +"`sensor.JPEG`. You can control the image quality then with " +"`sensor.set_quality()`." +msgstr "" +"如果您正在尝试使用 OV2640 或 OV5640 相机模块拍摄 JPEG 图像,并且分辨率较高,则应将 pixformat 设置为 " +"`sensor.JPEG`。然后,您可以使用 `sensor.set_quality()` 控制图像质量。" + +#: ../../library/omv.sensor.rst:197 +msgid "Returns the pixformat for the camera module." +msgstr "返回相机模块的像素格式。" + +#: ../../library/omv.sensor.rst:201 +msgid "Sets the frame size for the camera module." +msgstr "设置相机模块的帧大小。" + +#: ../../library/omv.sensor.rst:203 +msgid "`sensor.QQCIF`: 88x72" +msgstr "`sensor.QQCIF`:88x72" + +#: ../../library/omv.sensor.rst:204 +msgid "`sensor.QCIF`: 176x144" +msgstr "`sensor.QCIF`:176x144" + +#: ../../library/omv.sensor.rst:205 +msgid "`sensor.CIF`: 352x288" +msgstr "`sensor.CIF`:352x288" + +#: ../../library/omv.sensor.rst:206 +msgid "`sensor.QQSIF`: 88x60" +msgstr "`sensor.QQSIF`:88x60" + +#: ../../library/omv.sensor.rst:207 +msgid "`sensor.QSIF`: 176x120" +msgstr "`sensor.QSIF`:176x120" + +#: ../../library/omv.sensor.rst:208 +msgid "`sensor.SIF`: 352x240" +msgstr "`sensor.SIF`:352x240" + +#: ../../library/omv.sensor.rst:209 +msgid "`sensor.QQQQVGA`: 40x30" +msgstr "`sensor.QQQQVGA`:40x30" + +#: ../../library/omv.sensor.rst:210 +msgid "`sensor.QQQVGA`: 80x60" +msgstr "`sensor.QQQVGA`:80x60" + +#: ../../library/omv.sensor.rst:211 +msgid "`sensor.QQVGA`: 160x120" +msgstr "`sensor.QQVGA`:160x120" + +#: ../../library/omv.sensor.rst:212 +msgid "`sensor.QVGA`: 320x240" +msgstr "`sensor.QVGA`:320x240" + +#: ../../library/omv.sensor.rst:213 +msgid "`sensor.VGA`: 640x480" +msgstr "`sensor.VGA`:640x480" + +#: ../../library/omv.sensor.rst:214 +msgid "`sensor.HQQQQVGA`: 30x20" +msgstr "`sensor.HQQQQVGA`:30x20" + +#: ../../library/omv.sensor.rst:215 +msgid "`sensor.HQQQVGA`: 60x40" +msgstr "`sensor.HQQQVGA`:60x40" + +#: ../../library/omv.sensor.rst:216 +msgid "`sensor.HQQVGA`: 120x80" +msgstr "`sensor.HQQVGA`:120x80" + +#: ../../library/omv.sensor.rst:217 +msgid "`sensor.HQVGA`: 240x160" +msgstr "`sensor.HQVGA`:240x160" + +#: ../../library/omv.sensor.rst:218 +msgid "`sensor.HVGA`: 480x320" +msgstr "`sensor.HVGA`:480x320" + +#: ../../library/omv.sensor.rst:219 +msgid "`sensor.B64X32`: 64x32 (for use with `Image.find_displacement()`)" +msgstr "`sensor.B64X32`:64x32(用于 `Image.find_displacement()`)" + +#: ../../library/omv.sensor.rst:220 +msgid "`sensor.B64X64`: 64x64 (for use with `Image.find_displacement()`)" +msgstr "`sensor.B64X64`:64x64(用于 `Image.find_displacement()`)" + +#: ../../library/omv.sensor.rst:221 +msgid "`sensor.B128X64`: 128x64 (for use with `Image.find_displacement()`)" +msgstr "`sensor.B128X64`:128x64(用于 `Image.find_displacement()`)" + +#: ../../library/omv.sensor.rst:222 +msgid "`sensor.B128X128`: 128x128 (for use with `Image.find_displacement()`)" +msgstr "`sensor.B128X128`:128x128(用于 `Image.find_displacement()`)" + +#: ../../library/omv.sensor.rst:223 +msgid "`sensor.B160X160`: 160x160 (for the HM01B0)" +msgstr "`sensor.B160X160`:160x160(用于 HM01B0)" + +#: ../../library/omv.sensor.rst:224 +msgid "`sensor.B320X320`: 320x320 (for the HM01B0)" +msgstr "`sensor.B320X320`:320x320(用于 HM01B0)" + +#: ../../library/omv.sensor.rst:225 +msgid "`sensor.LCD`: 128x160 (for use with the lcd shield)" +msgstr "`sensor.LCD`:128x160(用于 LCD 屏幕)" + +#: ../../library/omv.sensor.rst:226 +msgid "`sensor.QQVGA2`: 128x160 (for use with the lcd shield)" +msgstr "`sensor.QQVGA2`:128x160(用于 LCD 屏幕)" + +#: ../../library/omv.sensor.rst:227 +msgid "`sensor.WVGA`: 720x480 (for the MT9V034)" +msgstr "`sensor.WVGA`:720x480(用于 MT9V034)" + +#: ../../library/omv.sensor.rst:228 +msgid "`sensor.WVGA2`:752x480 (for the MT9V034)" +msgstr "`sensor.WVGA2`:752x480(用于 MT9V034)" + +#: ../../library/omv.sensor.rst:229 +msgid "`sensor.SVGA`: 800x600 (only for the OV2640/OV5640 sensor)" +msgstr "`sensor.SVGA`:800x600(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.sensor.rst:230 +msgid "`sensor.XGA`: 1024x768 (only for the OV2640/OV5640 sensor)" +msgstr "`sensor.XGA`:1024x768(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.sensor.rst:231 +msgid "`sensor.WXGA`: 1280x768 (for the MT9M114)" +msgstr "`sensor.WXGA`:1280x768(用于 MT9M114)" + +#: ../../library/omv.sensor.rst:232 +msgid "`sensor.SXGA`: 1280x1024 (only for the OV2640/OV5640 sensor)" +msgstr "`sensor.SXGA`:1280x1024(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.sensor.rst:233 +msgid "`sensor.SXGAM`: 1280x960 (for the MT9M114)" +msgstr "`sensor.SXGAM`:1280x960(用于 MT9M114)" + +#: ../../library/omv.sensor.rst:234 +msgid "`sensor.UXGA`: 1600x1200 (only for the OV2640/OV5640 sensor)" +msgstr "`sensor.UXGA`:1600x1200(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.sensor.rst:235 +msgid "`sensor.HD`: 1280x720 (only for the OV2640/OV5640 sensor)" +msgstr "`sensor.HD`:1280x720(仅适用于 OV2640/OV5640 传感器)" + +#: ../../library/omv.sensor.rst:236 +msgid "`sensor.FHD`: 1920x1080 (only for the OV5640/PSS520 sensor)" +msgstr "`sensor.FHD`:1920x1080(仅适用于 OV5640/PSS520 传感器)" + +#: ../../library/omv.sensor.rst:237 +msgid "`sensor.QHD`: 2560x1440 (only for the OV5640 sensor)" +msgstr "`sensor.QHD`:2560x1440(仅适用于 OV5640 传感器" + +#: ../../library/omv.sensor.rst:238 +msgid "`sensor.QXGA`: 2048x1536 (only for the OV5640 sensor)" +msgstr "`sensor.QXGA`:2048x1536(仅适用于 OV5640 传感器)" + +#: ../../library/omv.sensor.rst:239 +msgid "`sensor.WQXGA`: 2560x1600 (only for the OV5640 sensor)" +msgstr "`sensor.WQXGA`:2560x1600(仅适用于 OV5640 传感器)" + +#: ../../library/omv.sensor.rst:240 +msgid "`sensor.WQXGA2`: 2592x1944 (only for the OV5640 sensor)" +msgstr "`sensor.WQXGA2`:2592x1944(仅适用于 OV5640 传感器)" + +#: ../../library/omv.sensor.rst:244 +msgid "Returns the frame size for the camera module." +msgstr "返回相机模块的帧大小。" + +#: ../../library/omv.sensor.rst:248 +msgid "Sets the frame rate in hz for the camera module." +msgstr "设置相机模块的帧率(以赫兹为单位)。" + +#: ../../library/omv.sensor.rst:252 +msgid "" +"`set_framerate` works by dropping frames received by the camera module to" +" keep the frame rate equal to (or below) the rate you specify. By default" +" the camera will run at the maximum frame rate. If implemented for the " +"particular camera sensor then `set_framerate` will also reduce the camera" +" sensor frame rate internally to save power and improve image quality by " +"increasing the sensor exposure. `set_framerate` may conflict with " +"`set_auto_exposure` on some cameras." +msgstr "" +"`set_framerate` " +"通过丢弃相机模块接收到的帧来保持帧率等于(或低于)您指定的速率。默认情况下,相机将以最大帧率运行。如果为特定相机传感器实现了 " +"`set_framerate`,那么它还将在内部降低相机传感器的帧率,以节省功耗并通过增加传感器曝光来提高图像质量。`set_framerate`" +" 可能会与某些相机上的 `set_auto_exposure` 冲突。" + +#: ../../library/omv.sensor.rst:260 +msgid "Returns the frame rate in hz for the camera module." +msgstr "返回相机模块的帧率(以赫兹为单位)。" + +#: ../../library/omv.sensor.rst:264 +msgid "" +"Sets the resolution of the camera to a sub resolution inside of the " +"current resolution. For example, setting the resolution to `sensor.VGA` " +"and then the windowing to (120, 140, 200, 200) sets `sensor.snapshot()` " +"to capture the 200x200 center pixels of the VGA resolution outputted by " +"the camera sensor. You can use windowing to get custom resolutions. Also," +" when using windowing on a larger resolution you effectively are digital " +"zooming." +msgstr "" +"将相机的分辨率设置为当前分辨率内的子分辨率。例如,将分辨率设置为 `sensor.VGA`,然后将窗口设置为(120,140,200,200)将使" +" `sensor.snapshot()` " +"捕获相机传感器输出的VGA分辨率的中心200×200像素。您可以使用窗口化来获取自定义分辨率。此外,在较大分辨率上使用窗口化实际上是数字变焦。" + +#: ../../library/omv.sensor.rst:271 +msgid "" +"``roi`` is a rect tuple (x, y, w, h). However, you may just pass (w, h) " +"and the ``roi`` will be centered on the frame. You may also pass roi not " +"in parens." +msgstr "" +"``roi`` 是一个矩形元组 (x, y, w, h)。但是,您也可以只传递 (w, h),并且 ``roi`` " +"将在帧中居中。您还可以不使用括号传递 roi。" + +#: ../../library/omv.sensor.rst:274 +msgid "" +"This function will automatically handle cropping the passed roi to the " +"framesize." +msgstr "此函数将自动处理将传递的roi裁剪到帧大小。" + +#: ../../library/omv.sensor.rst:278 +msgid "" +"Returns the ``roi`` tuple (x, y, w, h) previously set with " +"`sensor.set_windowing()`." +msgstr "返回先前使用 `sensor.set_windowing()` 设置的 ``roi`` 元组 (x, y, w, h)。" + +#: ../../library/omv.sensor.rst:282 +msgid "Set the camera image gainceiling. 2, 4, 8, 16, 32, 64, or 128." +msgstr "设置相机图像增益上限。2、4、8、16、32、64 或 128。" + +#: ../../library/omv.sensor.rst:286 +msgid "Set the camera image contrast. -3 to +3." +msgstr "设计相机图像对比度。-3 到 +3。" + +#: ../../library/omv.sensor.rst:290 +msgid "Set the camera image brightness. -3 to +3." +msgstr "设置相机图像亮度。-3 到 +3。" + +#: ../../library/omv.sensor.rst:294 +msgid "Set the camera image saturation. -3 to +3." +msgstr "设置相机图像饱和度。-3 到 +3。" + +#: ../../library/omv.sensor.rst:298 +msgid "Set the camera image JPEG compression quality. 0 - 100." +msgstr "设置相机图像JPEG压缩质量。0 - 100。" + +#: ../../library/omv.sensor.rst:302 +msgid "Only for the OV2640/OV5640 cameras." +msgstr "仅适用于 OV2640/OV5640 相机。" + +#: ../../library/omv.sensor.rst:306 +msgid "Turns color bar mode on (True) or off (False). Defaults to off." +msgstr "打开(True)或关闭(False)彩色条模式。默认为关闭。" + +#: ../../library/omv.sensor.rst:310 +msgid "" +"``enable`` turns auto gain control on (True) or off (False). The camera " +"will startup with auto gain control on." +msgstr "``enable`` 打开(True)或关闭(False)自动增益控制。相机将启动时默认启用自动增益控制。" + +#: ../../library/omv.sensor.rst:313 +msgid "" +"If ``enable`` is False you may set a fixed gain in decibels with " +"``gain_db``." +msgstr "如果 ``enable`` 为 False,则可以使用 ``gain_db`` 设置固定增益(以分贝为单位)。" + +#: ../../library/omv.sensor.rst:315 +msgid "" +"If ``enable`` is True you may set the maximum gain ceiling in decibels " +"with ``gain_db_ceiling`` for the automatic gain control algorithm." +msgstr "如果 ``enable`` 为 True,则可以使用 ``gain_db_ceiling`` 设置自动增益控制算法的最大增益上限(以分贝为单位)。" + +#: ../../library/omv.sensor.rst:320 +msgid "You need to turn off white balance too if you want to track colors." +msgstr "如果要跟踪颜色,您需要关闭白平衡。" + +#: ../../library/omv.sensor.rst:324 +msgid "Returns the current camera gain value in decibels (float)." +msgstr "以分贝(float)为单位返回当前相机增益值。" + +#: ../../library/omv.sensor.rst:328 +msgid "" +"``enable`` turns auto exposure control on (True) or off (False). The " +"camera will startup with auto exposure control on." +msgstr "``enable`` 打开(True)或关闭(False)自动曝光控制。相机启动时将打开自动曝光控制。" + +#: ../../library/omv.sensor.rst:331 +msgid "" +"If ``enable`` is False you may set a fixed exposure time in microseconds " +"with ``exposure_us``." +msgstr "如果 ``enable`` 为 False,则可以使用 ``exposure_us`` 设置固定曝光时间(以微秒为单位)。" + +#: ../../library/omv.sensor.rst:336 +msgid "" +"Camera auto exposure algorithms are pretty conservative about how much " +"they adjust the exposure value by and will generally avoid changing the " +"exposure value by much. Instead, they change the gain value a lot to deal" +" with changing lighting." +msgstr "相机的自动曝光算法在调整曝光值时非常保守,通常不会大幅度改变曝光值。相反,算法会通过大幅调整增益值来应对光照变化。" + +#: ../../library/omv.sensor.rst:343 +msgid "Returns the current camera exposure value in microseconds (int)." +msgstr "返回以微秒(int)为单位的当前相机曝光时间。" + +#: ../../library/omv.sensor.rst:347 +msgid "" +"``enable`` turns auto white balance on (True) or off (False). The camera " +"will startup with auto white balance on." +msgstr "``enable`` 参数用于打开(True)或关闭(False)自动白平衡。相机将以自动白平衡状态启动。" + +#: ../../library/omv.sensor.rst:350 +msgid "" +"If ``enable`` is False you may set a fixed gain in decibels for the red, " +"green, and blue channels respectively with ``rgb_gain_db``." +msgstr "如果 ``enable`` 为 False,则可以使用 ``rgb_gain_db`` 分别设置红色、绿色和蓝色通道的固定增益(以分贝为单位)。" + +#: ../../library/omv.sensor.rst:355 +msgid "You need to turn off gain control too if you want to track colors." +msgstr "如果要跟踪颜色,则还需要关闭增益控制。" + +#: ../../library/omv.sensor.rst:359 +msgid "" +"Returns a tuple with the current camera red, green, and blue gain values " +"in decibels ((float, float, float))." +msgstr "返回当前相机的红色、绿色、蓝色增益值的元组,以分贝为单位((float, float, float))。" + +#: ../../library/omv.sensor.rst:364 +msgid "Sets the auto black line calibration (blc) control on the camera." +msgstr "设置相机的自动黑色校准(blc)控制。" + +#: ../../library/omv.sensor.rst:366 +msgid "" +"``enable`` pass `True` or `False` to turn BLC on or off. You typically " +"always want this on." +msgstr "``enable`` 传入 `True` 或 `False` 以打开或关闭 BLC。通常情况下,您始终希望将其打开。" + +#: ../../library/omv.sensor.rst:368 +msgid "" +"``regs`` if disabled then you can manually set the blc register values " +"via the values you got previously from `get_blc_regs()`." +msgstr "``regs`` 如果禁用,则可以通过先前从 `get_blc_regs()` 获得的值手动设置 blc 寄存器的值。" + +#: ../../library/omv.sensor.rst:373 +msgid "" +"Returns the sensor blc registers as an opaque tuple of integers. For use " +"with `set_auto_blc`." +msgstr "以不透明的整数元组形式返回传感器blc寄存器。用于 `set_auto_blc`。" + +#: ../../library/omv.sensor.rst:377 +msgid "Turns horizontal mirror mode on (True) or off (False). Defaults to off." +msgstr "打开(True)或关闭(False)水平镜像模式。默认为关闭。" + +#: ../../library/omv.sensor.rst:381 +msgid "Returns if horizontal mirror mode is enabled." +msgstr "如果启用了水平镜像模式则返回。" + +#: ../../library/omv.sensor.rst:385 +msgid "Turns vertical flip mode on (True) or off (False). Defaults to off." +msgstr "打开(True)或关闭(False)垂直翻转模式。默认为关闭。" + +#: ../../library/omv.sensor.rst:389 +msgid "Returns if vertical flip mode is enabled." +msgstr "如果垂直翻转模式启用则返回。" + +#: ../../library/omv.sensor.rst:393 +msgid "Turns transpose mode on (True) or off (False). Defaults to off." +msgstr "打开(True)或关闭(False)转置模式。默认为关闭。" + +#: ../../library/omv.sensor.rst:395 +msgid "vflip=False, hmirror=False, transpose=False -> 0 degree rotation" +msgstr "vflip=False, hmirror=False, transpose=False -> 0 度旋转" + +#: ../../library/omv.sensor.rst:396 +msgid "vflip=True, hmirror=False, transpose=True -> 90 degree rotation" +msgstr "vflip=True, hmirror=False, transpose=True -> 90 度旋转" + +#: ../../library/omv.sensor.rst:397 +msgid "vflip=True, hmirror=True, transpose=False -> 180 degree rotation" +msgstr "vflip=True, hmirror=True, transpose=False -> 180 度旋转" + +#: ../../library/omv.sensor.rst:398 +msgid "vflip=False, hmirror=True, transpose=True -> 270 degree rotation" +msgstr "vflip=False, hmirror=True, transpose=True -> 270 度旋转" + +#: ../../library/omv.sensor.rst:402 +msgid "Returns if transpose mode is enabled." +msgstr "如果转置模式启用则返回。" + +#: ../../library/omv.sensor.rst:406 +msgid "Turns auto rotation mode on (True) or off (False). Defaults to off." +msgstr "打开(True)或关闭(False)自动旋转模式。默认为关闭。" + +#: ../../library/omv.sensor.rst:410 ../../library/omv.sensor.rst:418 +msgid "" +"This function only works when the OpenMV Cam has an `imu` installed and " +"is enabled automatically." +msgstr "仅当OpenMV Cam安装了 `imu` 并自动启动时,此函数才有效。" + +#: ../../library/omv.sensor.rst:414 +msgid "Returns if auto rotation mode is enabled." +msgstr "如果自动旋转模式启用则返回。" + +#: ../../library/omv.sensor.rst:422 +msgid "" +"Sets the number of frame buffers used to receive image data. By default " +"your OpenMV Cam will automatically try to allocate the maximum number of " +"frame buffers it can possibly allocate without using more than 1/2 of the" +" available frame buffer RAM at the time of allocation to ensure the best " +"performance. Automatic reallocation of frame buffers occurs whenever you " +"call `sensor.set_pixformat()`, `sensor.set_framesize()`, and " +"`sensor.set_windowing()`." +msgstr "" +"设置用于接收图像数据的帧缓冲区数量。默认情况下,您的 OpenMV Cam 将尝试自动分配尽可能多的帧缓冲区,以确保在分配时不超过可用帧缓冲区 " +"RAM 的一半,以确保获得最佳性能。每当调用 `sensor.set_pixformat()`、`sensor.set_framesize()` " +"和 `sensor.set_windowing()` 时,都会自动重新分配帧缓冲区。" + +#: ../../library/omv.sensor.rst:428 +msgid "" +"`sensor.snapshot()` will automatically handle switching active frame " +"buffers in the background. From your code's perspective there is only " +"ever 1 active frame buffer even though there might be more than 1 frame " +"buffer on the system and another frame buffer reciving data in the " +"background." +msgstr "" +"`sensor.snapshot()` " +"会在后台自动处理切换活动帧缓冲区。从你的代码角度来看,始终只有一个活动帧缓冲区,尽管系统中可能有多个帧缓冲区,并且另一个帧缓冲区在后台接收数据。" + +#: ../../library/omv.sensor.rst:432 +msgid "If count is:" +msgstr "如果计数为:" + +#: ../../library/omv.sensor.rst:434 +msgid "1 - Single Buffer Mode (you may also pass `sensor.SINGLE_BUFFER`)" +msgstr "1 - 单缓冲区模式(也可以传递 `sensor.SINGLE_BUFFER`)" + +#: ../../library/omv.sensor.rst:435 +msgid "" +"In single buffer mode your OpenMV Cam will allocate one frame buffer for " +"receiving images. When you call `sensor.snapshot()` that framebuffer will" +" be used to receive the image and the camera driver will continue to run." +" In the advent you call `sensor.snapshot()` again before the first line " +"of the next frame is received your code will execute at the frame rate of" +" the camera. Otherwise, the image will be dropped." +msgstr "" +"在单缓冲区模式下,您的 OpenMV Cam 将为接收图像分配一个帧缓冲区。当您调用 `sensor.snapshot()` " +"时,该帧缓冲区将用于接收图像,并且相机驱动程序将继续运行。如果在接收下一帧的第一行之前再次调用 " +"`sensor.snapshot()`,则您的代码将以相机的帧速率执行。否则,图像将被丢弃。" + +#: ../../library/omv.sensor.rst:441 +msgid "2 - Double Buffer Mode (you may also pass `sensor.DOUBLE_BUFFER`)" +msgstr "2 - 双缓冲区模式(也可以传递 `sensor.DOUBLE_BUFFER`)" + +#: ../../library/omv.sensor.rst:442 +msgid "" +"In double buffer mode your OpenMV Cam will allocate two frame buffers for" +" receiving images. When you call `sensor.snapshot()` one framebuffer will" +" be used to receive the image and the camera driver will continue to run." +" When the next frame is received it will be stored in the other frame " +"buffer. In the advent you call `sensor.snapshot()` again before the first" +" line of the next frame after is received your code will execute at the " +"frame rate of the camera. Otherwise, the image will be dropped." +msgstr "" +"在双缓冲模式下,你的 OpenMV 相机会分配两个帧缓冲区来接收图像。当你调用 `sensor.snapshot()` " +"时,一个帧缓冲区将用于接收图像,摄像头驱动将继续运行。当下一帧图像接收时,它将被存储在另一个帧缓冲区。如果你在接收到下一帧的第一行图像之前再次调用" +" `sensor.snapshot()` ,你的代码将以相机的帧率执行。否则,图像将被丢弃。" + +#: ../../library/omv.sensor.rst:449 +msgid "3 - Triple Buffer Mode (you may also pass `sensor.TRIPLE_BUFFER`)" +msgstr "3 - 三重缓冲区模式(也可以传递 `sensor.TRIPLE_BUFFER`)" + +#: ../../library/omv.sensor.rst:450 +msgid "" +"In triple buffer mode your OpenMV Cam will allocate three buffers for " +"receiving images. In this mode there is always a frame buffer to store " +"the received image to in the background resulting in the highest " +"performance and lowest latency for reading the latest received frame. No " +"frames are ever dropped in this mode. The next frame read by " +"`sensor.snapshot()` is the last captured frame by the sensor driver (e.g." +" if you are reading slower than the camera frame rate then the older " +"frame in the possible frames available is skipped)." +msgstr "" +"在三重缓冲区模式下,您的 OpenMV Cam " +"将为接收图像分配三个缓冲区。在此模式下,始终有一个帧缓冲区在后台存储接收到的图像,从而实现读取最新接收帧的性能最佳且延迟最低。在此模式下永远不会丢失帧。由" +" `sensor.snapshot()` " +"读取的下一帧是传感器驱动程序捕获的最后一帧(例如,如果您的读取速度比相机帧速率慢,则跳过可用帧中较旧的帧)。" + +#: ../../library/omv.sensor.rst:457 +msgid "" +"Regarding the reallocation above, triple buffering is tried first, then " +"double buffering, and if these both fail to fit in 1/2 of the available " +"frame buffer RAM then single buffer mode is used." +msgstr "关于上述重新分配,首先尝试三重缓冲区,然后是双重缓冲区,如果这两种都无法适应可用帧缓冲区RAM的一半,则使用单缓冲区模式。" + +#: ../../library/omv.sensor.rst:460 +msgid "" +"You may pass a value of 4 or greater to put the sensor driver into video " +"FIFO mode where received images are stored in a frame buffer FIFO with " +"``count`` buffers. This is useful for video recording to an SD card which" +" may randomly block your code from writing data when the SD card is " +"performing house-keeping tasks like pre-erasing blocks to write data to." +msgstr "" +"您可以传递大于4的值,将传感器驱动程序设置为视频FIFO模式,其中接收到的图像存储在带有 ``count`` " +"个缓冲区的帧缓冲区FIFO中。这对于视频记录到SD卡非常有用,当SD卡执行诸如预擦除块以写入数据时,可能会随机阻塞您的代码。" + +#: ../../library/omv.sensor.rst:467 +msgid "" +"On frame drop (no buffers available to receive the next frame) all frame " +"buffers are automatically cleared except the active frame buffer. This is" +" done to ensure `sensor.snapshot()` returns current frames and not frames" +" from long ago." +msgstr "" +"在帧丢失(没有可用缓冲区接收下一帧)时,所有帧缓冲区都会自动清除,除了活动帧缓冲区。这样做是为了确保 `sensor.snapshot()` " +"返回当前帧,而不是很久以前的帧。" + +#: ../../library/omv.sensor.rst:471 +msgid "" +"Fun fact, you can pass a value of 100 or so on OpenMV Cam's with SDRAM " +"for a huge video fifo. If you then call snapshot slower than the camera " +"frame rate (by adding `machine.sleep()`) you'll get slow-mo effects in " +"OpenMV IDE. However, you will also see the above policy effect of " +"resetting the frame buffer on a frame drop to ensure that frames do not " +"get too old. If you want to record slow-mo video just record video " +"normally to the SD card and then play the video back on a desktop machine" +" slower than it was recorded." +msgstr "" +"有趣的事实是,在带有 SDRAM 的 OpenMV Cam 上可以传递大约 100 的值以获得巨大的视频 " +"FIFO。然后,如果您以比相机帧速率慢的速度调用快照(通过添加 `machine.sleep()`),您将在 OpenMV IDE " +"中获得慢动作效果。但是,您还将看到上述策略效果,即在帧丢失时重置帧缓冲区,以确保帧不会过时。如果要记录慢动作视频,请正常将视频记录到 SD " +"卡,然后在桌面计算机上以比记录速度慢的速度播放视频。" + +#: ../../library/omv.sensor.rst:480 +msgid "Returns the current number of frame buffers allocated." +msgstr "返回当前分配的帧缓冲区数量。" + +#: ../../library/omv.sensor.rst:484 +msgid "" +"If ``disable`` is ``True`` then disable all settling time delays in the " +"sensor module. Whenever you reset the camera module, change modes, etc. " +"the sensor driver delays to prevent you can from calling `snapshot` to " +"quickly afterwards and receiving corrupt frames from the camera module. " +"By disabling delays you can quickly update the camera module settings in " +"bulk via multiple function calls before delaying at the end and calling " +"`snapshot`." +msgstr "" +"如果 ``disable`` 是 " +"``True``,则禁用传感器模块中的所有延迟时间。每当您重置相机模块、更改模式等,传感器驱动程序都会延迟,以防止您在之后很快调用 " +"`snapshot` 并从相机模块接收损坏的帧。通过禁用延迟,您可以在最后延迟并调用 `snapshot` " +"之前通过多个函数调用快速更新相机模块设置。" + +#: ../../library/omv.sensor.rst:490 +msgid "" +"If this function is called with no arguments it returns if delays are " +"disabled." +msgstr "如果此函数不带参数调用,则在禁用延迟时返回。" + +#: ../../library/omv.sensor.rst:494 +msgid "" +"If ``disable`` is ``True`` then automatic framebuffer flushing mentioned " +"in `set_framebuffers` is disabled. This removes any time limit on frames " +"in the frame buffer fifo. For example, if you set the number of frame " +"buffers to 30 and set the frame rate to 30 you can now precisely record 1" +" second of video from the camera without risk of frame loss." +msgstr "" +"如果 ``disable`` 是 ``True``,则禁用 `set_framebuffers` 中提到的自动帧缓冲刷新。这将移除帧缓冲 FIFO" +" 中帧的任何时间限制。例如,如果您将帧缓冲区数设置为 30,并将帧速率设置为 30,现在您可以精确地从相机记录 1 秒的视频,而不会丢失帧。" + +#: ../../library/omv.sensor.rst:499 +msgid "" +"If this function is called with no arguments it returns if automatic " +"flushing is disabled. By default automatic flushing on frame drop is " +"enabled to clear out stale frames." +msgstr "如果此函数不带参数调用,则返回自动刷新是否已禁用。默认情况下,启用帧丢失时的自动刷新以清除陈旧的帧。" + +#: ../../library/omv.sensor.rst:504 +msgid "" +"`snapshot` starts the frame capture process which will continue to " +"capture frames until there is no space to hold a frame at which point the" +" frame capture process stops. The process always stops when there is no " +"space to hold the next frame." +msgstr "`snapshot` 启动帧捕获过程,该过程将继续捕获帧,直到没有空间来容纳帧为止,此时帧捕获过程停止。当没有空间来容纳下一个帧时,进程始终会停止。" + +#: ../../library/omv.sensor.rst:510 +msgid "" +"``enable`` True to enable and False to disable (bool). ``radi`` integer " +"radius of pixels to correct (int). ``coef`` power of correction (int)." +msgstr "" +"``enable`` 为 True 则启用,为 False 则禁用(bool)。``radi`` 要更正的像素半径(int)。``coef`` " +"更正的幂(int)。" + +#: ../../library/omv.sensor.rst:516 +msgid "" +"Registers callback ``cb`` to be executed (in interrupt context) whenever " +"the camera module generates a new frame (but, before the frame is " +"received)." +msgstr "注册回调函数 ``cb`` (在中断上下文中执行),每当相机模块生成新帧时(但在接收到帧之前)执行。" + +#: ../../library/omv.sensor.rst:519 +msgid "" +"``cb`` takes one argument and is passed the current state of the vsync " +"pin after changing." +msgstr "``cb`` 接受一个参数,并传递更改后的垂直同步引脚的当前状态。" + +#: ../../library/omv.sensor.rst:523 +msgid "" +"Registers callback ``cb`` to be executed (in interrupt context) whenever " +"the camera module generates a new frame and the frame is ready to be read" +" via `sensor.snapshot()`." +msgstr "注册回调函数 ``cb`` (在中断上下文中执行),每当相机模块生成新帧并准备通过 `sensor.snapshot()` 读取时执行。" + +#: ../../library/omv.sensor.rst:526 +msgid "``cb`` takes no arguments." +msgstr "``cb`` 不接受参数。" + +#: ../../library/omv.sensor.rst:528 +msgid "" +"Use this to get an interrupt to schedule reading a frame later with " +"`micropython.schedule()`." +msgstr "使用此功能获取中断以稍后使用 `micropython.schedule()` 读取帧。" + +#: ../../library/omv.sensor.rst:532 +msgid "" +"Returns True if a frame is available to read by calling " +"`sensor.snapshot()`." +msgstr "如果通过调用 `sensor.snapshot()` 读取帧,则返回True。" + +#: ../../library/omv.sensor.rst:536 +msgid "Executes a sensor specific method:" +msgstr "执行传感器特定方法:" + +#: ../../library/omv.sensor.rst:538 +msgid "" +"`sensor.IOCTL_SET_READOUT_WINDOW` - Pass this enum followed by a rect " +"tuple (x, y, w, h) or a size tuple (w, h)." +msgstr "" +"`sensor.IOCTL_SET_READOUT_WINDOW` - 在此枚举后传递一个矩形元组 (x, y, w, h) 或大小元组 (w, " +"h)。" + +#: ../../library/omv.sensor.rst:539 +msgid "" +"This IOCTL allows you to control the readout window of the camera sensor " +"which dramatically improves the frame rate at the cost of field-of-view." +msgstr "此 IOCTL 允许您控制相机传感器的读出窗口,这会大大提高帧速率,但会减少视场。" + +#: ../../library/omv.sensor.rst:540 +msgid "" +"If you pass a rect tuple (x, y, w, h) the readout window will be " +"positoned on that rect tuple. The rect tuple's x/y position will be " +"adjusted so the size w/h fits. Additionally, the size w/h will be " +"adjusted to not be smaller than the ``framesize``." +msgstr "" +"如果传递一个矩形元组 (x, y, w, h),读取窗口将定位于该矩形元组的位置。矩形元组的 x/y 坐标将被调整,以便大小 w/h " +"适配。同时,大小 w/h 会被调整,确保其不小于 ``framesize``。" + +#: ../../library/omv.sensor.rst:541 +msgid "" +"If you pass a size tuple (w, h) the readout window will be centered given" +" the w/h. Additionally, the size w/h will be adjusted to not be smaller " +"than the ``framesize``." +msgstr "如果传递一个大小元组 (w, h),则读取窗口将根据 w/h 居中。此外,大小 w/h 将被调整为不小于 ``framesize``。" + +#: ../../library/omv.sensor.rst:542 +msgid "" +"This IOCTL is extremely helpful for increasing the frame rate on higher " +"resolution cameras like the OV2640/OV5640." +msgstr "此 IOCTL 对于增加 OV2640/OV5640 等较高分辨率相机的帧速率非常有帮助。" + +#: ../../library/omv.sensor.rst:543 +msgid "" +"`sensor.IOCTL_GET_READOUT_WINDOW` - Pass this enum for `sensor.ioctl` to " +"return the current readout window rect tuple (x, y, w, h). By default " +"this is (0, 0, maximum_camera_sensor_pixel_width, " +"maximum_camera_sensor_pixel_height)." +msgstr "" +"`sensor.IOCTL_GET_READOUT_WINDOW` - 在 `sensor.ioctl` 中传递此枚举以返回当前读出窗口矩形元组 " +"(x, y, w, h)。默认情况下为 (0, 0, maximum_camera_sensor_pixel_width, " +"maximum_camera_sensor_pixel_height)。" + +#: ../../library/omv.sensor.rst:544 +msgid "" +"`sensor.IOCTL_SET_TRIGGERED_MODE` - Pass this enum followed by True or " +"False set triggered mode for the MT9V034 sensor." +msgstr "" +"`sensor.IOCTL_SET_TRIGGERED_MODE` - 在此枚举后传递 True 或 False 为 MT9V034 " +"传感器设置触发模式。" + +#: ../../library/omv.sensor.rst:545 +msgid "" +"`sensor.IOCTL_GET_TRIGGERED_MODE` - Pass this enum for `sensor.ioctl` to " +"return the current triggered mode state." +msgstr "`sensor.IOCTL_GET_TRIGGERED_MODE` - 在 `sensor.ioctl` 中传递此枚举以返回当前触发模式状态。" + +#: ../../library/omv.sensor.rst:546 +msgid "" +"`sensor.IOCTL_SET_FOV_WIDE` - Pass this enum followed by True or False " +"enable `sensor.set_framesize()` to optimize for the field-of-view over " +"FPS." +msgstr "" +"`sensor.IOCTL_SET_FOV_WIDE` - 在此枚举后传递 True 或 False 以启用 " +"`sensor.set_framesize()` 以优化视场而不是 FPS。" + +#: ../../library/omv.sensor.rst:547 +msgid "" +"`sensor.IOCTL_GET_FOV_WIDE` - Pass this enum for `sensor.ioctl` to return" +" the current field-of-view over fps optimization state." +msgstr "`sensor.IOCTL_GET_FOV_WIDE` - 在 `sensor.ioctl` 中传递此枚举以返回当前视场优先于 FPS 优化状态。" + +#: ../../library/omv.sensor.rst:548 +msgid "" +"`sensor.IOCTL_TRIGGER_AUTO_FOCUS` - Pass this enum for `sensor.ioctl` to " +"trigger auto focus on the OV5640 FPC camera module." +msgstr "" +"`sensor.IOCTL_TRIGGER_AUTO_FOCUS` - 在 `sensor.ioctl` 中传递此枚举以触发 OV5640 FPC" +" 相机模块的自动对焦。" + +#: ../../library/omv.sensor.rst:549 +msgid "" +"`sensor.IOCTL_PAUSE_AUTO_FOCUS` - Pass this enum for `sensor.ioctl` to " +"pause auto focus (after triggering) on the OV5640 FPC camera module." +msgstr "" +"`sensor.IOCTL_PAUSE_AUTO_FOCUS` - 在 `sensor.ioctl` 中传递此枚举以暂停 OV5640 FPC " +"相机模块的自动对焦(在触发后)。" + +#: ../../library/omv.sensor.rst:550 +msgid "" +"`sensor.IOCTL_RESET_AUTO_FOCUS` - Pass this enum for `sensor.ioctl` to " +"reset auto focus (after triggering) on the OV5640 FPC camera module." +msgstr "" +"`sensor.IOCTL_RESET_AUTO_FOCUS` - 在 `sensor.ioctl` 中传递此枚举以重置 OV5640 FPC " +"相机模块的自动对焦(在触发后)。" + +#: ../../library/omv.sensor.rst:551 +msgid "" +"`sensor.IOCTL_WAIT_ON_AUTO_FOCUS` - Pass this enum for `sensor.ioctl` to " +"wait for auto focus (after triggering) to finish on the OV5640 FPC camera" +" module. You may pass a second argument of the timeout in milliseconds. " +"The default is 5000 ms." +msgstr "" +"`sensor.IOCTL_WAIT_ON_AUTO_FOCUS` - 在 `sensor.ioctl` 中传递此枚举以等待 OV5640 FPC" +" 相机模块的自动对焦(在触发后)完成。您可以传递第二个参数作为超时时间(以毫秒为单位)。默认值为 5000 毫秒。" + +#: ../../library/omv.sensor.rst:552 +msgid "" +"`sensor.IOCTL_SET_NIGHT_MODE` - Pass this enum followed by True or False " +"set nightmode the OV7725 and OV5640 sensors." +msgstr "" +"`sensor.IOCTL_SET_NIGHT_MODE` - 在此枚举后传递 True 或 False 以设置 OV7725 和 OV5640 " +"传感器的夜间模式。" + +#: ../../library/omv.sensor.rst:553 +msgid "" +"`sensor.IOCTL_GET_NIGHT_MODE` - Pass this enum for `sensor.ioctl` to " +"return the current night mode state." +msgstr "`sensor.IOCTL_GET_NIGHT_MODE` - 在 `sensor.ioctl` 中传递此枚举以返回当前夜间模式状态。" + +#: ../../library/omv.sensor.rst:554 +msgid "" +"`sensor.IOCTL_LEPTON_GET_WIDTH` - Pass this enum to get the FLIR Lepton " +"image width in pixels." +msgstr "`sensor.IOCTL_LEPTON_GET_WIDTH` - 传递此枚举以获取 FLIR Lepton 图像宽度(以像素为单位)。" + +#: ../../library/omv.sensor.rst:555 +msgid "" +"`sensor.IOCTL_LEPTON_GET_HEIGHT` - Pass this enum to get the FLIR Lepton " +"image height in pixels." +msgstr "`sensor.IOCTL_LEPTON_GET_HEIGHT` - 传递此枚举以获取 FLIR Lepton 图像高度(以像素为单位)。" + +#: ../../library/omv.sensor.rst:556 +msgid "" +"`sensor.IOCTL_LEPTON_GET_RADIOMETRY` - Pass this enum to get the FLIR " +"Lepton type (radiometric or not)." +msgstr "`sensor.IOCTL_LEPTON_GET_RADIOMETRY` - 传递此枚举以获取 FLIR Lepton 类型(辐射或非辐射)。" + +#: ../../library/omv.sensor.rst:557 +msgid "" +"`sensor.IOCTL_LEPTON_GET_REFRESH` - Pass this enum to get the FLIR Lepton" +" refresh rate in hertz." +msgstr "`sensor.IOCTL_LEPTON_GET_REFRESH` - 传递此枚举以获取 FLIR Lepton 刷新率(以赫兹为单位)。" + +#: ../../library/omv.sensor.rst:558 +msgid "" +"`sensor.IOCTL_LEPTON_GET_RESOLUTION` - Pass this enum to get the FLIR " +"Lepton ADC resolution in bits." +msgstr "" +"`sensor.IOCTL_LEPTON_GET_RESOLUTION` - 传递此枚举以获取 FLIR Lepton ADC " +"分辨率(以位为单位)。" + +#: ../../library/omv.sensor.rst:559 +msgid "" +"`sensor.IOCTL_LEPTON_RUN_COMMAND` - Pass this enum to execute a FLIR " +"Lepton SDK command. You need to pass an additional 16-bit value after the" +" enum as the command to execute." +msgstr "" +"`sensor.IOCTL_LEPTON_RUN_COMMAND` - 传递此枚举以执行 FLIR Lepton SDK " +"命令。您需要在枚举后传递一个额外的 16 位值作为要执行的命令。" + +#: ../../library/omv.sensor.rst:560 +msgid "" +"`sensor.IOCTL_LEPTON_SET_ATTRIBUTE` - Pass this enum to set a FLIR Lepton" +" SDK attribute." +msgstr "`sensor.IOCTL_LEPTON_SET_ATTRIBUTE` - 传递此枚举以设置 FLIR Lepton SDK 属性。" + +#: ../../library/omv.sensor.rst:561 ../../library/omv.sensor.rst:564 +msgid "" +"The first argument is the 16-bit attribute ID to set (set the FLIR Lepton" +" SDK)." +msgstr "第一个参数是要设置的 16 位属性 ID(设置 FLIR Lepton SDK)。" + +#: ../../library/omv.sensor.rst:562 +msgid "" +"The second argument is a MicroPython byte array of bytes to write (should" +" be a multiple of 16-bits). Create the byte array using ``struct`` " +"following the FLIR Lepton SDK." +msgstr "" +"第二个参数是要写入的字节的 MicroPython 字节数组(应为 16 位的倍数)。使用 ``struct`` 创建字节数组,遵循 FLIR " +"Lepton SDK。" + +#: ../../library/omv.sensor.rst:563 +msgid "" +"`sensor.IOCTL_LEPTON_GET_ATTRIBUTE` - Pass this enum to get a FLIR Lepton" +" SDK attribute." +msgstr "`sensor.IOCTL_LEPTON_GET_ATTRIBUTE` - 传递此枚举以获取 FLIR Lepton SDK 属性。" + +#: ../../library/omv.sensor.rst:565 +msgid "" +"Returns a MicroPython byte array of the attribute. Use ``struct`` to " +"deserialize the byte array following the FLIR Lepton SDK." +msgstr "返回属性的 MicroPython 字节数组。使用 ``struct`` 按照 FLIR Lepton SDK 反序列化字节数组。" + +#: ../../library/omv.sensor.rst:566 +msgid "" +"`sensor.IOCTL_LEPTON_GET_FPA_TEMP` - Pass this enum to get the FLIR " +"Lepton FPA Temp in celsius." +msgstr "" +"`sensor.IOCTL_LEPTON_GET_FPA_TEMP` - 传递此枚举以获取 FLIR Lepton FPA " +"温度(摄氏度)。" + +#: ../../library/omv.sensor.rst:567 +msgid "" +"`sensor.IOCTL_LEPTON_GET_AUX_TEMP` - Pass this enum to get the FLIR " +"Lepton AUX Temp in celsius." +msgstr "" +"`sensor.IOCTL_LEPTON_GET_AUX_TEMP` - 传递此枚举以获取 FLIR Lepton AUX " +"温度(摄氏度)。" + +#: ../../library/omv.sensor.rst:568 +msgid "" +"`sensor.IOCTL_LEPTON_SET_MODE` - Pass this followed by True or False to " +"turn off automatic gain control on the FLIR Lepton and force it to output" +" an image where each pixel value represents an exact temperature value in" +" celsius. A second True enables high temperature mode enabling " +"measurements up to 500C on the Lepton 3.5, False is the default low " +"temperature mode." +msgstr "" +"`sensor.IOCTL_LEPTON_SET_MODE` - 传递此参数,后跟 True 或 False 以关闭 " +"FLIR Lepton 上的自动增益控制,并强制它输出每个像素值都代表摄氏度的精确温度值的图像。第二个 True 启用高温模式,在 Lepton " +"3.5 上启用高达 500C 的测量。False 是默认为低温模式。" + +#: ../../library/omv.sensor.rst:569 +msgid "" +"`sensor.IOCTL_LEPTON_GET_MODE` - Pass this to get a tuple for " +"(measurement-mode-enabled, high-temp-enabled)." +msgstr "`sensor.IOCTL_LEPTON_GET_MODE` - 传递此枚举以获取 (测量模式启用,高温启用) 元组。" + +#: ../../library/omv.sensor.rst:570 +msgid "" +"`sensor.IOCTL_LEPTON_SET_RANGE` - Pass this when measurement mode is " +"enabled to set the temperature range in celsius for the mapping " +"operation. The temperature image returned by the FLIR Lepton will then be" +" clamped between these min and max values and then scaled to values " +"between 0 to 255. To map a pixel value back to a temperature (on a " +"grayscale image) do: ((pixel * (max_temp_in_celsius - " +"min_temp_in_celsius)) / 255.0) + min_temp_in_celsius." +msgstr "" +"`sensor.IOCTL_LEPTON_SET_RANGE` - " +"在启用测量模式时传递此枚举以设置映射操作的温度范围(以摄氏度为单位)。然后,FLIR Lepton " +"返回的温度图像将在这些最小和最大值之间夹紧,然后缩放到 0 到 255 之间的值。要将像素值映射回温度(在灰度图像上),请执行以下操作:((像素 " +"* (最大摄氏度 - 最小摄氏度)) / 255.0) + 最小摄氏度。" + +#: ../../library/omv.sensor.rst:571 +msgid "The first arugment should be the min temperature in celsius." +msgstr "第一个参数应为摄氏度中的最小温度。" + +#: ../../library/omv.sensor.rst:572 +msgid "" +"The second argument should be the max temperature in celsius. If the " +"arguments are reversed the library will automatically swap them for you." +msgstr "第二个参数应该为以摄氏度为单位的最大温度。如果参数颠倒,库将自动为您交换它们。" + +#: ../../library/omv.sensor.rst:573 +msgid "" +"`sensor.IOCTL_LEPTON_GET_RANGE` - Pass this to return the sorted (min, " +"max) 2 value temperature range tuple. The default is -10C to 40C if not " +"set yet." +msgstr "" +"`sensor.IOCTL_LEPTON_GET_RANGE` - 传递此枚举以返回排序的 (最小,最大) 2 " +"值温度范围元组。如果尚未设置,默认为 -10C 到 40C。" + +#: ../../library/omv.sensor.rst:574 +msgid "" +"`sensor.IOCTL_HIMAX_MD_ENABLE` - Pass this enum followed by " +"``True``/``False`` to enable/disable motion detection on the HM01B0. You " +"should also enable the I/O pin (PC15 on the Arduino Portenta) attached " +"the HM01B0 motion detection line to receive an interrupt." +msgstr "" +"`sensor.IOCTL_HIMAX_MD_ENABLE` - 传递此枚举后跟 ``True``/``False`` 以启用/禁用 HM01B0" +" 上的运动检测。您还应该启用 I/O 引脚(Arduino Portenta 上的 PC15)连接到 HM01B0 运动检测线以接收中断。" + +#: ../../library/omv.sensor.rst:575 +msgid "" +"`sensor.IOCTL_HIMAX_MD_CLEAR` - Pass this enum to clear the motion " +"detection interrupt on the HM01B0." +msgstr "`sensor.IOCTL_HIMAX_MD_CLEAR` - 传递此枚举以清除 HM01B0 上的运动检测中断。" + +#: ../../library/omv.sensor.rst:576 +msgid "" +"`sensor.IOCTL_HIMAX_MD_WINDOW` - Pass this enum followed by (x1, y1, x2, " +"y2) to set the motion detection window on the HM01B0." +msgstr "" +"`sensor.IOCTL_HIMAX_MD_WINDOW` - 传递此枚举后跟 (x1, y1, x2, y2) 以在 HM01B0 " +"上设置运动检测窗口。" + +#: ../../library/omv.sensor.rst:577 +msgid "" +"`sensor.IOCTL_HIMAX_MD_THRESHOLD` - Pass this enum followed by a " +"threshold value (0-255) to set the motion detection threshold on the " +"HM01B0." +msgstr "" +"`sensor.IOCTL_HIMAX_MD_THRESHOLD` - 传递此枚举后跟阈值值 (0-255) 以设置 HM01B0 " +"上的运动检测阈值。" + +#: ../../library/omv.sensor.rst:578 +msgid "" +"`sensor.IOCTL_HIMAX_OSC_ENABLE` - Pass this enum followed by " +"``True``/``False`` to enable/disable the oscillator HM01B0 to save power." +msgstr "" +"`sensor.IOCTL_HIMAX_OSC_ENABLE` - 传递此枚举后跟 ``True``/``False`` 以启用/禁用 " +"HM01B0 上的振荡器以节省功耗。" + +#: ../../library/omv.sensor.rst:579 +msgid "" +"`sensor.IOCTL_RGB_STATS` - Pass this enum to get the RGB statistics from " +"the camera sensor. Returns a tuple of (r, gb, gr, b) values." +msgstr "" +"`sensor.IOCTL_RGB_STATS` - 传递此枚举以获取相机传感器的 RGB 统计信息。" +"返回一个 (r, gb, gr, b) 值的元组。" + +#: ../../library/omv.sensor.rst:580 +msgid "" +"`sensor.IOCTL_GENX320_SET_BIASES` - Pass this enum followed by a bias " +"enum to set the GENX320 sensor biases." +msgstr "" +"`sensor.IOCTL_GENX320_SET_BIASES` - 传递此枚举,后跟一个偏置枚举以设置 GENX320 " +"传感器偏置。" + +#: ../../library/omv.sensor.rst:581 +msgid "" +"`sensor.IOCTL_GENX320_SET_BIAS` - Pass this enum followed by a bias enum " +"and a bias value to set the GENX320 sensor bias." +msgstr "" +"`sensor.IOCTL_GENX320_SET_BIAS` - 传递此枚举,后跟一个偏置枚举和一个偏置值以设置 GENX320 " +"传感器偏置。" + +#: ../../library/omv.sensor.rst:582 +msgid "" +"`sensor.IOCTL_GENX320_SET_AFK` - Pass this enum followed by ``enable``, " +"``freq_low_in_hz``, ``freq_high_in_hz`` to change the GENX320 anti-" +"flickering-filter settings." +msgstr "" +"`sensor.IOCTL_GENX320_SET_AFK` - 传递此枚举,后跟 ``enable``、" +"``freq_low_in_hz``、``freq_high_in_hz`` 以更改 GENX320 抗闪烁滤波器设置。" + +#: ../../library/omv.sensor.rst:586 +msgid "" +"Sets the color palette to use for FLIR Lepton grayscale to RGB565 " +"conversion." +msgstr "设置用于 FLIR Lepton 灰度到 RGB565 转换的颜色调色板。" + +#: ../../library/omv.sensor.rst:590 +msgid "" +"Returns the current color palette setting. Defaults to " +"`image.PALETTE_RAINBOW`." +msgstr "返回当前的颜色调色板设置。默认为 `image.PALETTE_RAINBOW`。" + +#: ../../library/omv.sensor.rst:594 +msgid "Write ``value`` (int) to camera register at ``address`` (int)." +msgstr "将 ``value`` (int)写入到地址为 ``address`` (int)的相机寄存器中。" + +#: ../../library/omv.sensor.rst:596 ../../library/omv.sensor.rst:602 +msgid "See the camera data sheet for register info." +msgstr "有关寄存器信息,请参阅相机数据表。" + +#: ../../library/omv.sensor.rst:600 +msgid "Read camera register at ``address`` (int)." +msgstr "读取地址为 ``address`` (int)的相机寄存器。" + +#: ../../library/omv.sensor.rst:605 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.sensor.rst:610 +msgid "BINARY (bitmap) pixel format. Each pixel is 1-bit." +msgstr "二进制(位图)像素格式。每个像素为1位。" + +#: ../../library/omv.sensor.rst:612 +msgid "" +"This format is usful for mask storage. Can be used with `Image()` and " +"`sensor.alloc_extra_fb()`." +msgstr "此格式对于掩码存储很有用。可以与 `Image()` 和 `sensor.alloc_extra_fb()` 一起使用。" + +#: ../../library/omv.sensor.rst:618 +msgid "GRAYSCALE pixel format (Y from YUV422). Each pixel is 8-bits, 1-byte." +msgstr "灰度像素格式(来自YUV422的Y)。每个像素为8位,1字节。" + +#: ../../library/omv.sensor.rst:620 +msgid "" +"All of our computer vision algorithms run faster on grayscale images than" +" RGB565 images." +msgstr "所有我们的计算机视觉算法在灰度图像上运行速度比RGB565图像快。" + +#: ../../library/omv.sensor.rst:626 +msgid "" +"RGB565 pixel format. Each pixel is 16-bits, 2-bytes. 5-bits are used for " +"red, 6-bits are used for green, and 5-bits are used for blue." +msgstr "RGB565像素格式。每个像素为16位,即2字节。5位用于红色,6位用于绿色,5位用于蓝色。" + +#: ../../library/omv.sensor.rst:629 +msgid "" +"All of our computer vision algorithms run slower on RGB565 images than " +"grayscale images." +msgstr "所有我们的计算机视觉算法在RGB565图像上运行速度比灰度图像慢。" + +#: ../../library/omv.sensor.rst:635 +msgid "" +"RAW BAYER image pixel format. If you try to make the frame size too big " +"to fit in the frame buffer your OpenMV Cam will set the pixel format to " +"BAYER so that you can capture images but only some image processing " +"methods will be operational." +msgstr "" +"RAW BAYER图像像素格式。如果尝试使帧大小过大而无法适应帧缓冲区,则您的OpenMV " +"Cam将像素格式设置为BAYER,以便您可以捕获图像,但只有一些图像处理方法将可用。" + +#: ../../library/omv.sensor.rst:643 +msgid "" +"A pixel format that is very easy to jpeg compress. Each pixel is stored " +"as a grayscale 8-bit Y value followed by alternating 8-bit U/V color " +"values that are shared between two Y values (8-bits Y1, 8-bits U, 8-bits " +"Y2, 8-bits V, etc.). Only some image processing methods work with YUV422." +msgstr "非常容易进行JPEG压缩的像素格式。每个像素都存储为一个灰度8位Y值,后跟交替的8位U/V颜色值,这些值在两个Y值之间共享(8位Y1,8位U,8位Y2,8位V,等等)。只有一些图像处理方法适用于YUV422。" + +#: ../../library/omv.sensor.rst:651 +msgid "" +"JPEG mode. The camera module outputs compressed jpeg images. Use " +"`sensor.set_quality()` to control the jpeg quality. Only works for the " +"OV2640/OV5640 cameras." +msgstr "" +"JPEG模式。摄像头模块输出压缩的jpeg图像。使用 `sensor.set_quality()` " +"控制jpeg质量。仅适用于OV2640/OV5640摄像头。" + +#: ../../library/omv.sensor.rst:658 +msgid "`sensor.get_id()` returns this for the OV2640 camera." +msgstr "`sensor.get_id()` 返回OV2640相机的值。" + +#: ../../library/omv.sensor.rst:663 +msgid "`sensor.get_id()` returns this for the OV5640 camera." +msgstr "`sensor.get_id()` 返回OV5640相机的值。" + +#: ../../library/omv.sensor.rst:668 +msgid "`sensor.get_id()` returns this for the OV7670 camera." +msgstr "`sensor.get_id()` 返回OV7670相机的值。" + +#: ../../library/omv.sensor.rst:673 +msgid "`sensor.get_id()` returns this for the OV7690 camera." +msgstr "`sensor.get_id()` 返回OV7690相机的值。" + +#: ../../library/omv.sensor.rst:678 +msgid "`sensor.get_id()` returns this for the OV7725 camera." +msgstr "`sensor.get_id()` 返回OV7725相机的值。" + +#: ../../library/omv.sensor.rst:683 +msgid "`sensor.get_id()` returns this for the OV9650 camera." +msgstr "`sensor.get_id()` 返回OV9650相机的值。" + +#: ../../library/omv.sensor.rst:688 +msgid "`sensor.get_id()` returns this for the MT9V022 camera." +msgstr "`sensor.get_id()` 返回MT9V022相机的值。" + +#: ../../library/omv.sensor.rst:693 +msgid "`sensor.get_id()` returns this for the MT9V024 camera." +msgstr "`sensor.get_id()` 返回MT9V024相机的值。" + +#: ../../library/omv.sensor.rst:698 +msgid "`sensor.get_id()` returns this for the MT9V032 camera." +msgstr "`sensor.get_id()` 返回MT9V032相机的值。" + +#: ../../library/omv.sensor.rst:703 +msgid "`sensor.get_id()` returns this for the MT9V034 camera." +msgstr "`sensor.get_id()` 返回MT9V034相机的值。" + +#: ../../library/omv.sensor.rst:708 +msgid "`sensor.get_id()` returns this for the MT9M114 camera." +msgstr "`sensor.get_id()` 返回MT9M114相机的值。" + +#: ../../library/omv.sensor.rst:713 +msgid "`sensor.get_id()` returns this for the BOSON 320x256 camera." +msgstr "`sensor.get_id()` 返回 BOSON 320x256 相机的值。" + +#: ../../library/omv.sensor.rst:718 +msgid "`sensor.get_id()` returns this for the BOSON 640x512 camera." +msgstr "`sensor.get_id()` 返回 BOSON 640x512 相机的值。" + +#: ../../library/omv.sensor.rst:723 +msgid "`sensor.get_id()` returns this for the LEPTON1/2/3 cameras." +msgstr "`sensor.get_id()` 返回LEPTON1/2/3相机的值。" + +#: ../../library/omv.sensor.rst:728 +msgid "`sensor.get_id()` returns this for the HM01B0 camera." +msgstr "`sensor.get_id()` 返回HM01B0相机的值。" + +#: ../../library/omv.sensor.rst:733 +msgid "`sensor.get_id()` returns this for the HM0360 camera." +msgstr "`sensor.get_id()` 返回 HM0360 相机的值。" + +#: ../../library/omv.sensor.rst:738 +msgid "`sensor.get_id()` returns this for the GC2145 camera." +msgstr "`sensor.get_id()` 返回GC2145相机的值。" + +#: ../../library/omv.sensor.rst:743 +msgid "" +"`sensor.get_id()` returns this for the GENX320 (Engineering Samples) " +"camera." +msgstr "`sensor.get_id()` 返回 GENX320(工程样品)相机的值。" + +#: ../../library/omv.sensor.rst:748 +msgid "`sensor.get_id()` returns this for the GENX320 camera." +msgstr "`sensor.get_id()` 返回 GENX320 相机的值。" + +#: ../../library/omv.sensor.rst:753 +msgid "`sensor.get_id()` returns this for the PAG7920 camera." +msgstr "`sensor.get_id()` 对于 PAG7920 摄像头返回此值。" + +#: ../../library/omv.sensor.rst:758 +msgid "`sensor.get_id()` returns this for the PAG7936 camera." +msgstr "`sensor.get_id()` 返回 PAG7936 相机的值。" + +#: ../../library/omv.sensor.rst:763 +msgid "`sensor.get_id()` returns this for the PS5520 camera." +msgstr "`sensor.get_id()` 返回 PS5520 相机的值。" + +#: ../../library/omv.sensor.rst:768 +msgid "`sensor.get_id()` returns this for the PAJ6100 camera." +msgstr "`sensor.get_id()` 返回PAJ6100相机的值。" + +#: ../../library/omv.sensor.rst:773 +msgid "`sensor.get_id()` returns this for the FROGEYE2020 camera." +msgstr "`sensor.get_id()` 返回FROGEYE2020相机的值。" + +#: ../../library/omv.sensor.rst:778 +msgid "88x72 resolution for the camera sensor." +msgstr "88x72分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:783 +msgid "176x144 resolution for the camera sensor." +msgstr "176x144 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:788 +msgid "352x288 resolution for the camera sensor." +msgstr "352x288 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:793 +msgid "88x60 resolution for the camera sensor." +msgstr "88x60 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:798 +msgid "176x120 resolution for the camera sensor." +msgstr "176x120 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:803 +msgid "352x240 resolution for the camera sensor." +msgstr "352x240 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:808 +msgid "40x30 resolution for the camera sensor." +msgstr "40x30 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:813 +msgid "80x60 resolution for the camera sensor." +msgstr "80x60 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:818 +msgid "160x120 resolution for the camera sensor." +msgstr "160x120 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:823 +msgid "320x240 resolution for the camera sensor." +msgstr "320x240 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:828 +msgid "640x480 resolution for the camera sensor." +msgstr "640x480 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:833 +msgid "30x20 resolution for the camera sensor." +msgstr "30x20 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:838 +msgid "60x40 resolution for the camera sensor." +msgstr "60x40 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:843 +msgid "120x80 resolution for the camera sensor." +msgstr "120x80 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:848 +msgid "240x160 resolution for the camera sensor." +msgstr "240x160 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:853 +msgid "480x320 resolution for the camera sensor." +msgstr "480x320 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:858 +msgid "64x32 resolution for the camera sensor." +msgstr "64x32 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:860 ../../library/omv.sensor.rst:867 +#: ../../library/omv.sensor.rst:874 ../../library/omv.sensor.rst:881 +msgid "" +"For use with `Image.find_displacement()` and any other FFT based " +"algorithm." +msgstr "用于 `Image.find_displacement()` 和任何其他基于FFT的算法。" + +#: ../../library/omv.sensor.rst:865 +msgid "64x64 resolution for the camera sensor." +msgstr "64x64 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:872 +msgid "128x64 resolution for the camera sensor." +msgstr "128x64 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:879 +msgid "128x128 resolution for the camera sensor." +msgstr "128x128 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:886 +msgid "160x160 resolution for the HM01B0 camera sensor." +msgstr "HM01B0相机传感器的160x160分辨率。" + +#: ../../library/omv.sensor.rst:891 +msgid "320x320 resolution for the HM01B0 camera sensor." +msgstr "HM01B0相机传感器的320x320分辨率。" + +#: ../../library/omv.sensor.rst:896 ../../library/omv.sensor.rst:901 +msgid "128x160 resolution for the camera sensor (for use with the lcd shield)." +msgstr "相机传感器的分辨率为 128x160(与 LCD 保护罩一起使用)。" + +#: ../../library/omv.sensor.rst:906 +msgid "720x480 resolution for the MT9V034 camera sensor." +msgstr "MT9V034相机传感器的720x480分辨率。" + +#: ../../library/omv.sensor.rst:911 +msgid "752x480 resolution for the MT9V034 camera sensor." +msgstr "MT9V034相机传感器的752x480分辨率。" + +#: ../../library/omv.sensor.rst:916 +msgid "800x600 resolution for the camera sensor." +msgstr "800x600 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:921 +msgid "1024x768 resolution for the camera sensor." +msgstr "1024x768 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:926 +msgid "1280x768 resolution for the MT9M114 camera sensor." +msgstr "MT9M114相机传感器的1280x768分辨率。" + +#: ../../library/omv.sensor.rst:931 +msgid "" +"1280x1024 resolution for the camera sensor. Only works for the " +"OV2640/OV5640 cameras." +msgstr "1280x1024 分辨率的相机传感器。仅适用于OV2640/OV5640相机。" + +#: ../../library/omv.sensor.rst:936 +msgid "1280x960 resolution for the MT9M114 camera sensor." +msgstr "MT9M114相机传感器的1280x960分辨率。" + +#: ../../library/omv.sensor.rst:941 +msgid "" +"1600x1200 resolution for the camera sensor. Only works for the " +"OV2640/OV5640 cameras." +msgstr "1600x1200 分辨率的相机传感器。仅适用于 OV2640/OV5640相机。" + +#: ../../library/omv.sensor.rst:946 +msgid "1280x720 resolution for the camera sensor." +msgstr "1280x720 分辨率的相机传感器。" + +#: ../../library/omv.sensor.rst:951 +msgid "" +"1920x1080 resolution for the camera sensor. Only works for the " +"OV5640/PSS520 camera." +msgstr "1920x1080 分辨率的相机传感器。仅适用于 OV5640/PSS520 相机。" + +#: ../../library/omv.sensor.rst:956 +msgid "" +"2560x1440 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "2560x1440 分辨率的相机传感器。仅适用于 OV5640 相机。" + +#: ../../library/omv.sensor.rst:961 +msgid "" +"2048x1536 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "2048x1536 分辨率的相机传感器。仅适用于 OV5640 相机。" + +#: ../../library/omv.sensor.rst:966 +msgid "" +"2560x1600 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "2560x1600 分辨率的相机传感器。仅适用于 OV5640 相机。" + +#: ../../library/omv.sensor.rst:971 +msgid "" +"2592x1944 resolution for the camera sensor. Only works for the OV5640 " +"camera." +msgstr "2592x1944 分辨率的相机传感器。仅适用于 OV5640 相机。" + +#: ../../library/omv.sensor.rst:976 +msgid "Lets you set the readout window for the OV5640." +msgstr "允许您设置OV5640的读出窗口。" + +#: ../../library/omv.sensor.rst:981 +msgid "Lets you get the readout window for the OV5640." +msgstr "允许您获取OV5640的读出窗口。" + +#: ../../library/omv.sensor.rst:986 +msgid "Lets you set the triggered mode for the MT9V034." +msgstr "允许您设置MT9V034的触发模式。" + +#: ../../library/omv.sensor.rst:991 +msgid "Lets you get the triggered mode for the MT9V034." +msgstr "允许您获取MT9V034的触发模式。" + +#: ../../library/omv.sensor.rst:996 +msgid "" +"Enable `sensor.set_framesize()` to optimize for the field-of-view over " +"FPS." +msgstr "启用 `sensor.set_framesize()` 以优化视场而不是FPS。" + +#: ../../library/omv.sensor.rst:1001 +msgid "" +"Return if `sensor.set_framesize()` is optimizing for field-of-view over " +"FPS." +msgstr "如果 `sensor.set_framesize()` 正在针对 FPS 的视野进行优化,则返回。" + +#: ../../library/omv.sensor.rst:1006 +msgid "Used to trigger auto focus for the OV5640 FPC camera module." +msgstr "用于触发OV5640 FPC相机模块的自动对焦。" + +#: ../../library/omv.sensor.rst:1011 +msgid "Used to pause auto focus (while running) for the OV5640 FPC camera module." +msgstr "用于暂停OV5640 FPC相机模块的自动对焦(在运行时)。" + +#: ../../library/omv.sensor.rst:1016 +msgid "" +"Used to reset auto focus back to the default for the OV5640 FPC camera " +"module." +msgstr "用于将自动对焦重置为OV5640 FPC相机模块的默认设置。" + +#: ../../library/omv.sensor.rst:1021 +msgid "" +"Used to wait on auto focus to finish after being triggered for the OV5640" +" FPC camera module." +msgstr "用于等待OV5640 FPC相机模块触发后自动对焦完成。" + +#: ../../library/omv.sensor.rst:1026 +msgid "" +"Used to turn night mode on or off on a sensor. Nightmode reduces the " +"frame rate to increase exposure dynamically." +msgstr "用于在传感器上打开或关闭夜间模式。夜间模式会降低帧速率以动态增加曝光。" + +#: ../../library/omv.sensor.rst:1031 +msgid "" +"Gets the current value of if night mode is enabled or disabled for your " +"sensor." +msgstr "获取传感器是否启用或禁用夜间模式的当前值。" + +#: ../../library/omv.sensor.rst:1036 +msgid "Lets you get the FLIR Lepton image resolution width in pixels." +msgstr "允许您获取FLIR Lepton图像分辨率的宽度(以像素为单位)。" + +#: ../../library/omv.sensor.rst:1041 +msgid "Lets you get the FLIR Lepton image resolution height in pixels." +msgstr "允许您获取 FLIR Lepton 图像分辨率的高度(以像素为单位)。" + +#: ../../library/omv.sensor.rst:1046 +msgid "Lets you get the FLIR Lepton type (radiometric or not)." +msgstr "允许您获取 FLIR Lepton 类型(辐射或非辐射)。" + +#: ../../library/omv.sensor.rst:1051 +msgid "Lets you get the FLIR Lepton refresh rate in hertz." +msgstr "允许您获取 FLIR Lepton 刷新率(以赫兹为单位)。" + +#: ../../library/omv.sensor.rst:1056 +msgid "Lets you get the FLIR Lepton ADC resolution in bits." +msgstr "允许您获取 FLIR Lepton ADC 分辨率(以位为单位)。" + +#: ../../library/omv.sensor.rst:1061 +msgid "Executes a 16-bit command given the FLIR Lepton SDK." +msgstr "根据FLIR Lepton SDK执行16位命令。" + +#: ../../library/omv.sensor.rst:1066 +msgid "Sets a FLIR Lepton Attribute given the FLIR Lepton SDK." +msgstr "根据 FLIR Lepton SDK 设置 FLIR Lepton 属性。" + +#: ../../library/omv.sensor.rst:1071 +msgid "Gets a FLIR Lepton Attribute given the FLIR Lepton SDK." +msgstr "根据 FLIR Lepton SDK获取 FLIR Lepton 属性。" + +#: ../../library/omv.sensor.rst:1076 +msgid "Gets the FLIR Lepton FPA temp in celsius." +msgstr "获取以摄氏度为单位的 FLIR Lepton FPA 温度。" + +#: ../../library/omv.sensor.rst:1081 +msgid "Gets the FLIR Lepton AUX temp in celsius." +msgstr "获取以摄氏度为单位的 FLIR Lepton AUX 温度。" + +#: ../../library/omv.sensor.rst:1086 +msgid "" +"Lets you set the FLIR Lepton driver into a mode where you can get a valid" +" temperature value per pixel. See `sensor.ioctl()` for more information." +msgstr "允许您将 FLIR Lepton 驱动程序设置为可以获取每个像素的有效温度值的模式。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1091 +msgid "" +"Lets you get if measurement mode is enabled or not for the FLIR Lepton " +"sensor. See `sensor.ioctl()` for more information." +msgstr "允许您获取FLIR Lepton 传感器是否启用了测量模式。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1096 +msgid "" +"Lets you set the temperature range you want to map pixels in the image to" +" when in measurement mode. See `sensor.ioctl()` for more information." +msgstr "允许您在测量模式下将像素映射到的温度范围。有关更多信息,请参见 `sensor.ioctl()` 。" + +#: ../../library/omv.sensor.rst:1101 +msgid "" +"Lets you get the temperature range used for measurement mode. See " +"`sensor.ioctl()` for more information." +msgstr "允许您获取用于测量模式的温度范围。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1106 ../../library/omv.sensor.rst:1111 +#: ../../library/omv.sensor.rst:1116 ../../library/omv.sensor.rst:1121 +msgid "" +"Lets you control the motion detection interrupt on the HM01B0. See " +"`sensor.ioctl()` for more information." +msgstr "允许您控制HM01B0的运动检测中断。有关更多信息,请参见 `sensor.ioctl()`." + +#: ../../library/omv.sensor.rst:1126 +msgid "" +"Lets you control the internal oscillator on the HM01B0. See " +"`sensor.ioctl()` for more information." +msgstr "允许您控制HM01B0上的内部振荡器。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1131 +msgid "" +"Lets you get the RGB statistics from the camera sensor. See " +"`sensor.ioctl()` for more information." +msgstr "允许您获取相机传感器的 RGB 统计信息。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1136 +msgid "" +"Lets you set the GENX320 camera sensor biases. See `sensor.ioctl()` for " +"more information." +msgstr "允许您设置 GENX320 相机传感器偏置。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1141 +msgid "" +"Lets you set the GENX320 camera sensor anti-flickering-filter. See " +"`sensor.ioctl()` for more information." +msgstr "允许您设置 GENX320 相机传感器抗闪烁滤波器。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1146 +msgid "Default biases for the GENX320 camera sensor." +msgstr "GENX320 相机传感器的默认偏置。" + +#: ../../library/omv.sensor.rst:1151 +msgid "Low light biases for the GENX320 camera sensor." +msgstr "GENX320 相机传感器的低光照偏置。" + +#: ../../library/omv.sensor.rst:1156 +msgid "Active marker biases for the GENX320 camera sensor." +msgstr "GENX320 相机传感器的主动标记偏置。" + +#: ../../library/omv.sensor.rst:1161 +msgid "Low noise biases for the GENX320 camera sensor." +msgstr "GENX320 相机传感器的低噪声偏置。" + +#: ../../library/omv.sensor.rst:1166 +msgid "High speed biases for the GENX320 camera sensor." +msgstr "GENX320 相机传感器的高速偏置。" + +#: ../../library/omv.sensor.rst:1171 +msgid "" +"Lets you set a single GENX320 camera sensor bias. See `sensor.ioctl()` " +"for more information." +msgstr "允许您设置单个 GENX320 相机传感器偏置。有关更多信息,请参见 `sensor.ioctl()`。" + +#: ../../library/omv.sensor.rst:1176 +msgid "Set the GENX320 DIFF OFF bias." +msgstr "设置 GENX320 DIFF OFF 偏置。" + +#: ../../library/omv.sensor.rst:1181 +msgid "Set the GENX320 DIFF ON bias." +msgstr "设置 GENX320 DIFF ON 偏置。" + +#: ../../library/omv.sensor.rst:1186 +msgid "Set the GENX320 FO bias." +msgstr "设置 GENX320 FO 偏置。" + +#: ../../library/omv.sensor.rst:1191 +msgid "Set the GENX320 HPF bias." +msgstr "设置 GENX320 HPF 偏置。" + +#: ../../library/omv.sensor.rst:1196 +msgid "Set the GENX320 REFR bias." +msgstr "设置 GENX320 REFR 偏置。" + +#: ../../library/omv.sensor.rst:1201 +msgid "Pass to `sensor.set_framebuffers()` to set single buffer mode (1 buffer)." +msgstr "传递给 `sensor.set_framebuffers()` 以设置单缓冲区模式(1缓冲区)。" + +#: ../../library/omv.sensor.rst:1206 +msgid "Pass to `sensor.set_framebuffers()` to set double buffer mode (2 buffers)." +msgstr "传递给 `sensor.set_framebuffers()` 以设置双缓冲区模式(2缓冲区)。" + +#: ../../library/omv.sensor.rst:1211 +msgid "Pass to `sensor.set_framebuffers()` to set triple buffer mode (3 buffers)." +msgstr "传递给 `sensor.set_framebuffers()` 以设置三缓冲区模式(3缓冲区)。" + +#: ../../library/omv.sensor.rst:1216 +msgid "Pass to `sensor.set_framebuffers()` to set video FIFO mode (4 buffers)." +msgstr "传递给 `sensor.set_framebuffers()` 以设置视频FIFO模式(4缓冲区)。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.tfp410.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tfp410.po new file mode 100644 index 0000000000000..497aa0dfc4521 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tfp410.po @@ -0,0 +1,72 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/omv.tfp410.rst:2 +msgid ":mod:`tfp410` --- DVI/HDMI Controller" +msgstr ":mod:`tfp410` --- DVI/HDMI 控制器" + +#: ../../library/omv.tfp410.rst:7 +msgid "DVI/HDMI Controller for the OpenMV Pure Thermal." +msgstr "OpenMV Pure Thermal 的 DVI/HDMI 控制器。" + +#: ../../library/omv.tfp410.rst:11 +msgid "This will be refactored to be under the display module soon." +msgstr "这将很快被重构到显示模块下。" + +#: ../../library/omv.tfp410.rst:14 +msgid "Constructors" +msgstr "构造" + +#: ../../library/omv.tfp410.rst:18 +msgid "" +"Initializes the TFP410 DVI/HDMI controller chip to drive an external " +"DVI/HDMI display via a 24-bit parallel LCD bus. You just need to create " +"this object to initialize the display." +msgstr "" +"初始化 TFP410 DVI/HDMI 控制器芯片,以通过 24 位并行 LCD 总线驱动外部 DVI/" +"HDMI 显示器。您只需创建此对象即可初始化显示器。" + +#: ../../library/omv.tfp410.rst:22 +msgid "Methods" +msgstr "方法" + +#: ../../library/omv.tfp410.rst:26 +msgid "Returns if an external display is connected." +msgstr "如果连接了外部显示器则返回。" + +#: ../../library/omv.tfp410.rst:30 +msgid "" +"Registers a ``callback`` function that be called whenever the state of an" +" external display being connected changes. The new state will be passed " +"as an argument." +msgstr "注册一个 ``callback`` 函数,每当外部显示器连接状态发生变化时,都会调用该函数" +"。新状态将作为参数传递。" + +#: ../../library/omv.tfp410.rst:33 +msgid "" +"If you use this method do not call `TFP410.isconnected()` anymore until " +"the callback is disabled by pass ``None`` as the callback for this " +"method." +msgstr "如果使用此方法,请不要再调用 `TFP410.isconnected()`,直到通过将 ``None`` " +"作为此方法的回调来禁用回调为止。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.tof.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tof.po new file mode 100644 index 0000000000000..47629503ba3ba --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tof.po @@ -0,0 +1,371 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.tof.rst:2 +msgid ":mod:`tof` --- time-of-flight sensor driver" +msgstr ":mod:`tof` --- 飞行时间传感器驱动" + +#: ../../library/omv.tof.rst:7 +msgid "The ``tof`` module is used for controlling the time-of-flight sensor." +msgstr "``tof`` 模块用于控制飞行时间传感器。" + +#: ../../library/omv.tof.rst:9 +msgid "Example usage::" +msgstr "用法示例::" + +#: ../../library/omv.tof.rst:30 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.tof.rst:34 +msgid "Initializes an onboard depth sensor." +msgstr "初始化板载深度传感器。" + +#: ../../library/omv.tof.rst:36 ../../library/omv.tof.rst:48 +msgid "``type`` indicates the type of thermopile shield:" +msgstr "``type`` 指示热电堆扩展板的类型:" + +#: ../../library/omv.tof.rst:38 ../../library/omv.tof.rst:50 +#: ../../library/omv.tof.rst:64 ../../library/omv.tof.rst:71 +msgid "`tof.TOF_NONE`: 0 pixels." +msgstr "`tof.TOF_NONE`: 0 像素。" + +#: ../../library/omv.tof.rst:39 ../../library/omv.tof.rst:51 +msgid "`tof.TOF_VL53LX`: 8x8 pixels." +msgstr "`tof.TOF_VL53LX`: 8x8 像素。" + +#: ../../library/omv.tof.rst:41 ../../library/omv.tof.rst:53 +msgid "" +"By default type is ``-1`` which will cause `tof.init()` to automatically " +"scan and initialize an attached thermal sensor based on the I2C address." +msgstr "默认 type 为 ``-1``,这将使 `tof.init()` 根据 I2C 地址自动扫描并初始化连接的热传感器。" + +#: ../../library/omv.tof.rst:46 +msgid "Re-initializes an onboard depth sensor." +msgstr "重新初始化板载深度传感器。" + +#: ../../library/omv.tof.rst:58 +msgid "Deinitializes the depth sensor freeing up resources." +msgstr "反初始化深度传感器并释放资源。" + +#: ../../library/omv.tof.rst:62 +msgid "Returns the width (horizontal resolution) of the depth sensor in-use:" +msgstr "返回正在使用的深度传感器的宽度(水平分辨率):" + +#: ../../library/omv.tof.rst:65 ../../library/omv.tof.rst:72 +msgid "`tof.TOF_VL53LX`: 8 pixels." +msgstr "`tof.TOF_VL53LX`: 8 像素。" + +#: ../../library/omv.tof.rst:69 +msgid "Returns the height (vertical resolution) of the depth sensor in-use:" +msgstr "返回正在使用的深度传感器的高度(垂直分辨率):" + +#: ../../library/omv.tof.rst:76 +msgid "Returns the type of the depth sensor in-use:" +msgstr "返回正在使用的深度传感器的类型:" + +#: ../../library/omv.tof.rst:78 +msgid "`tof.TOF_NONE`" +msgstr "`tof.TOF_NONE`" + +#: ../../library/omv.tof.rst:79 +msgid "`tof.TOF_VL53LX`" +msgstr "`tof.TOF_VL53LX`" + +#: ../../library/omv.tof.rst:83 +msgid "Returns the refresh rate of the depth sensor in-use:" +msgstr "返回正在使用的深度传感器的刷新率:" + +#: ../../library/omv.tof.rst:85 +msgid "`tof.TOF_NONE`: 0 Hz." +msgstr "`tof.TOF_NONE`: 0 Hz。" + +#: ../../library/omv.tof.rst:86 +msgid "`tof.TOF_VL53LX`: 15 Hz." +msgstr "`tof.TOF_VL53LX`: 15 Hz。" + +#: ../../library/omv.tof.rst:90 +msgid "" +"Returns a tuple containing the depth list (width * height), the minimum " +"depth seen, and the maximum depth seen." +msgstr "返回一个包含深度列表(width * height)、最小深度和最大深度的元组。" + +#: ../../library/omv.tof.rst:93 +msgid "``hmirror`` if set to True horizontally mirrors the ``depth`` array." +msgstr "``hmirror`` 如果设置为 True,则水平镜像 ``depth`` 数组。" + +#: ../../library/omv.tof.rst:95 +msgid "``vflip`` if set to True vertically flips the ``depth`` array." +msgstr "``vflip`` 如果设置为 True,则垂直翻转 ``depth`` 数组。" + +#: ../../library/omv.tof.rst:97 +msgid "``transpose`` if set to True transposes the ``depth`` array." +msgstr "``transpose`` 如果设置为 True,则转置 ``depth`` 数组。" + +#: ../../library/omv.tof.rst:99 ../../library/omv.tof.rst:257 +msgid "" +"``timeout`` if not -1 then how many milliseconds to wait for the new " +"frame." +msgstr "``timeout`` 如果不为 -1,则表示等待新帧的毫秒数。" + +#: ../../library/omv.tof.rst:101 ../../library/omv.tof.rst:197 +msgid "" +"If you want to rotate an image by multiples of 90 degrees pass the " +"following::" +msgstr "如果要将图像旋转 90 度的倍数,请传递以下参数::" + +#: ../../library/omv.tof.rst:108 +msgid "Example::" +msgstr "示例::" + +#: ../../library/omv.tof.rst:112 +msgid "The values returned are floats that represent the depth in mm." +msgstr "返回的值是表示深度(单位为毫米)的浮点数。" + +#: ../../library/omv.tof.rst:116 +msgid "``depth`` is a (width * height) list of floats (4-bytes each)." +msgstr "``depth`` 是一个 (width * height) 的浮点数列表(每个 4 字节)。" + +#: ../../library/omv.tof.rst:120 +msgid "" +"Draws an ``depth`` array on ``image`` whose top-left corner starts at " +"location x, y. This method automatically handles rendering the image " +"passed into the correct pixel format for the destination image while also" +" handling clipping seamlessly." +msgstr "在 ``image`` 上绘制 ``depth`` 数组,其左上角从位置 x, y 开始。此方法会自动将传入的图像渲染为目标图像的正确像素格式,同时无缝处理裁剪。" + +#: ../../library/omv.tof.rst:124 ../../library/omv.tof.rst:204 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "``x_scale`` 控制显示图像在 x 方向上的缩放比例(浮点数)。如果此值为负,图像将水平翻转。注意,如果未指定 ``y_scale``,则它将匹配 ``x_scale`` 以保持纵横比。" + +#: ../../library/omv.tof.rst:128 ../../library/omv.tof.rst:208 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "``y_scale`` 控制显示图像在 y 方向上的缩放比例(浮点数)。如果此值为负,图像将垂直翻转。注意,如果未指定 ``x_scale``,则它将匹配 ``x_scale`` 以保持纵横比。" + +#: ../../library/omv.tof.rst:132 ../../library/omv.tof.rst:212 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"source image to draw. This allows you to extract just the pixels in the " +"ROI to scale and draw on the destination image." +msgstr "``roi`` 是源图像要绘制的感兴趣区域矩形元组 (x, y, w, h)。这允许您仅提取 ROI 中的像素进行缩放并绘制到目标图像上。" + +#: ../../library/omv.tof.rst:135 ../../library/omv.tof.rst:215 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render onto the destination image. For " +"example, if you pass ``rgb_channel=1`` this will extract the green " +"channel of the source RGB565 image and draw that in grayscale on the " +"destination image." +msgstr "``rgb_channel`` 是要从 RGB565 图像中提取的 RGB 通道(0=R, G=1, B=2)(如果传入),并渲染到目标图像上。例如,如果传递 ``rgb_channel=1``,这将提取源 RGB565 图像的绿色通道并以灰度绘制到目标图像上。" + +#: ../../library/omv.tof.rst:140 ../../library/omv.tof.rst:220 +msgid "" +"``alpha`` controls how much of the source image to blend into the " +"destination image. A value of 255 draws an opaque source image while a " +"value lower than 255 produces a blend between the source and destination " +"image. 0 results in no modification to the destination image." +msgstr "``alpha`` 控制源图像混合到目标图像中的程度。值为 255 时绘制不透明的源图像,低于 255 的值会在源图像和目标图像之间产生混合效果。0 表示不修改目标图像。" + +#: ../../library/omv.tof.rst:144 ../../library/omv.tof.rst:224 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the source image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "``color_palette`` 如果不为 ``-1``,可以是颜色调色板枚举或总共 256 像素的 RGB565 图像,用作源图像灰度值的颜色查找表。如果使用,这在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.tof.rst:148 ../../library/omv.tof.rst:228 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the source image being drawn at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不为 ``-1``,可以是总共 256 像素的灰度图像,用作 alpha 调色板," +"在像素级别调制正在绘制的源图像的 ``alpha`` 值,允许您根据灰度值精确控制像素的 alpha 值。" +"alpha 查找表中像素值为 255 表示不透明,小于 255 的值变得更加透明直到 0。如果使用,这在 ``rgb_channel`` 提取之后应用。" + +#: ../../library/omv.tof.rst:154 ../../library/omv.tof.rst:234 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是以下标志的逻辑或:" + +#: ../../library/omv.tof.rst:156 ../../library/omv.tof.rst:236 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA`:缩小时使用区域缩放而非默认的最近邻缩放。" + +#: ../../library/omv.tof.rst:157 ../../library/omv.tof.rst:237 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR`:使用双线性缩放而非默认的最近邻缩放。" + +#: ../../library/omv.tof.rst:158 ../../library/omv.tof.rst:238 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放而非默认的最近邻缩放。" + +#: ../../library/omv.tof.rst:159 ../../library/omv.tof.rst:239 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER`:将绘制的图像居中显示。这在缩放之后应用。" + +#: ../../library/omv.tof.rst:160 ../../library/omv.tof.rst:240 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.tof.rst:161 ../../library/omv.tof.rst:241 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP`:垂直翻转图像。" + +#: ../../library/omv.tof.rst:162 ../../library/omv.tof.rst:242 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE`:转置图像(交换 x/y)。" + +#: ../../library/omv.tof.rst:163 ../../library/omv.tof.rst:243 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST`:在缩放之前提取 rgb_channel。" + +#: ../../library/omv.tof.rst:164 ../../library/omv.tof.rst:244 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST`:在缩放之前应用颜色调色板。" + +#: ../../library/omv.tof.rst:165 ../../library/omv.tof.rst:245 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP`:缩放绘制的图像以适应显示区域。" + +#: ../../library/omv.tof.rst:166 ../../library/omv.tof.rst:246 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND`:缩放绘制的图像以填满显示区域(会导致裁剪)" + +#: ../../library/omv.tof.rst:167 ../../library/omv.tof.rst:247 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE`:缩放绘制的图像以填满显示区域(会导致拉伸)。" + +#: ../../library/omv.tof.rst:168 ../../library/omv.tof.rst:248 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90`:将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.tof.rst:169 ../../library/omv.tof.rst:249 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180`:将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.tof.rst:170 ../../library/omv.tof.rst:250 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270`:将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.tof.rst:172 ../../library/omv.tof.rst:252 +msgid "" +"``scale`` is a two value tuple which controls the min and max depth (in " +"mm) to scale the ``depth`` image. By default it's equal to the image " +"``depth`` min and ``depth`` max." +msgstr "``scale`` 是一个双值元组,控制缩放 ``depth`` 图像的最小和最大深度(单位为毫米)。默认等于图像的 ``depth`` 最小值和 ``depth`` 最大值。" + +#: ../../library/omv.tof.rst:175 +msgid "" +"If x/y are not specified the image will be centered in the field of view." +" If x_scale/y_scale or x_size/y_size are not specified the ``depth`` " +"array will be scaled to fit on the ``image``." +msgstr "如果未指定 x/y,图像将在视野中居中。如果未指定 x_scale/y_scale 或 x_size/y_size,``depth`` 数组将被缩放以适应 ``image``。" + +#: ../../library/omv.tof.rst:180 +msgid "" +"To handle a transposed ``depth`` array `read_depth` remembers if it was " +"called with ``transposed`` ``True``. This is then passed to " +"``draw_depth`` internally." +msgstr "为了处理转置的 ``depth`` 数组,`read_depth` 会记住是否使用 ``transposed`` ``True`` 调用。然后在内部将此信息传递给 ``draw_depth``。" + +#: ../../library/omv.tof.rst:185 +msgid "" +"Works like `sensor.snapshot()` and returns an `image` object that is " +"either `image.GRAYSCALE` (grayscale) or `image.RGB565` (color). If " +"``copy_to_fb`` is False then the new image is allocated on the " +"MicroPython heap. However, the MicroPython heap is limited and may not " +"have space to store the new image if exhausted. Instead, set " +"``copy_to_fb`` to True to set the frame buffer to the new image making " +"this function work just like `sensor.snapshot()`." +msgstr "" +"类似于 `sensor.snapshot()` 工作,返回一个 `image` 对象," +"可以是 `image.GRAYSCALE` (灰度)或 `image.RGB565` (彩色)。如果 ``copy_to_fb`` 为 False," +"则新图像在 MicroPython 堆上分配。然而,MicroPython 堆是有限的,如果耗尽可能没有空间存储新图像。" +"因此,将 ``copy_to_fb`` 设置为 True 可以将帧缓冲区设置为新图像,使此函数像 `sensor.snapshot()` 一样工作。" + +#: ../../library/omv.tof.rst:191 +msgid "``hmirror`` if set to True horizontally mirrors the new image." +msgstr "``hmirror`` 如果设置为 True,则水平镜像新图像。" + +#: ../../library/omv.tof.rst:193 +msgid "``vflip`` if set to True vertically flips the new image." +msgstr "``vflip`` 如果设置为 True,则垂直翻转新图像。" + +#: ../../library/omv.tof.rst:195 +msgid "``transpose`` if set to True transposes the new image." +msgstr "``transpose`` 如果设置为 True,则转置新图像。" + +#: ../../library/omv.tof.rst:255 +msgid "``pixformat`` if specified controls the final image pixel format." +msgstr "``pixformat`` 如果指定,则控制最终图像的像素格式。" + +#: ../../library/omv.tof.rst:259 +msgid "Returns an image object." +msgstr "返回一个图像对象。" + +#: ../../library/omv.tof.rst:262 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.tof.rst:267 +msgid "No TOF sensor type." +msgstr "无 TOF 传感器类型。" + +#: ../../library/omv.tof.rst:272 +msgid "VL53L5CX or VL53L8CX TOF sensor." +msgstr "VL53L5CX 或 VL53L8CX TOF 传感器。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/omv.tv.po b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tv.po new file mode 100644 index 0000000000000..b542eaf30a114 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/omv.tv.po @@ -0,0 +1,266 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 07:53+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/omv.tv.rst:2 +msgid ":mod:`tv` --- tv shield driver" +msgstr ":mod:`tv` --- 图传扩展板板驱动程序" + +#: ../../library/omv.tv.rst:7 +msgid "The ``tv`` module is used for controlling the tv shield." +msgstr "``tv`` 模块用于控制图传扩展板。" + +#: ../../library/omv.tv.rst:9 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/omv.tv.rst:25 +msgid "Functions" +msgstr "函数" + +#: ../../library/omv.tv.rst:29 +msgid "Initializes an attached tv output module." +msgstr "初始化连接的图传输出模型。" + +#: ../../library/omv.tv.rst:31 +msgid "``type`` indicates how the lcd module should be initialized:" +msgstr "``type`` 表示应如何初始化 lcd 模块:" + +#: ../../library/omv.tv.rst:33 +msgid "`tv.TV_NONE`: Do nothing." +msgstr "`tv.TV_NONE`: 什么也不做。" + +#: ../../library/omv.tv.rst:34 +msgid "" +"`tv.TV_SHIELD`: Initialize a TV output module. Uses pins P0, P1, P2, and " +"P3." +msgstr "`tv.TV_SHIELD`: 初始化图传输出模块。 使用 P0、P1、P2 和 P3 引脚。" + +#: ../../library/omv.tv.rst:36 +msgid "" +"``triple_buffer`` If True then makes updates to the screen non-blocking " +"in `tv.TV_SHIELD` mode at the cost of 3X the display RAM (495 KB)." +msgstr "" +"``triple_buffer`` 如果为 True,则在 `tv.TV_SHIELD` 模式下使屏幕更新变得非阻塞,但以 3 倍的显示 " +"RAM(495 KB)为代价。" + +#: ../../library/omv.tv.rst:41 +msgid "Deinitializes the tv module, internal/external hardware, and I/O pins." +msgstr "取消初始化tv模块、内部/外部硬件和I/O引脚。" + +#: ../../library/omv.tv.rst:45 +msgid "Returns 352 pixels. This is the `sensor.SIF` resolution." +msgstr "返回352像素。这是 `sensor.SIF` 分辨率。" + +#: ../../library/omv.tv.rst:49 +msgid "Returns 240 pixels. This is the `sensor.SIF` resolution." +msgstr "返回240像素。这是 `sensor.SIF` 分辨率。" + +#: ../../library/omv.tv.rst:53 +msgid "Returns the type of the screen that was set during `tv.init()`." +msgstr "返回在 `tv.init()` 期间设置的屏幕类型。" + +#: ../../library/omv.tv.rst:57 +msgid "Returns if triple buffering is enabled that was set during `tv.init()`." +msgstr "如果在 `tv.init()` 期间设置的三重缓冲区已启用则返回。" + +#: ../../library/omv.tv.rst:61 +msgid "Returns 60 Hz." +msgstr "返回60Hz。" + +#: ../../library/omv.tv.rst:65 +msgid "" +"For the wireless TV shield this sets the broadcast channel between 1-8. " +"If passed without a channel argument then this method returns the " +"previously set channel (1-8). Default is channel 8." +msgstr "对于无线图传扩展板,这将设置1-8之间的广播信道。如果没有传递频道参数,则此方法返回先前设置的频道(1-8)。默认频道为8。" + +#: ../../library/omv.tv.rst:70 +msgid "Displays an ``image`` whose top-left corner starts at location x, y." +msgstr "显示一个左上角从位置x,y开始的 ``image``。" + +#: ../../library/omv.tv.rst:72 +msgid "" +"``x_scale`` controls how much the displayed image is scaled by in the x " +"direction (float). If this value is negative the image will be flipped " +"horizontally. Note that if ``y_scale`` is not specified then it will " +"match ``x_scale`` to maintain the aspect ratio." +msgstr "" +"``x_scale`` 控制图像在 x 方向的显示比例(float)。如果此值为负,则图像将水平翻转。注意,如果未指定 " +"``y_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.tv.rst:76 +msgid "" +"``y_scale`` controls how much the displayed image is scaled by in the y " +"direction (float). If this value is negative the image will be flipped " +"vertically. Note that if ``x_scale`` is not specified then it will match " +"``x_scale`` to maintain the aspect ratio." +msgstr "" +"``y_scale`` 控制图像在 y 方向的显示比例(float)。如果此值为负,则图像将垂直翻转。注意,如果未指定 " +"``x_scale``,则它将与 ``x_scale`` 匹配,以保持纵横比。" + +#: ../../library/omv.tv.rst:80 +msgid "" +"``roi`` is the region-of-interest rectangle tuple (x, y, w, h) of the " +"image to display. This allows you to extract just the pixels in the ROI " +"to scale." +msgstr "``roi`` 是要显示的图像的感兴趣区域矩形元组(x、y、w、h)。这允许您仅提取感兴趣区域的像素以进行缩放。" + +#: ../../library/omv.tv.rst:83 +msgid "" +"``rgb_channel`` is the RGB channel (0=R, G=1, B=2) to extract from an " +"RGB565 image (if passed) and to render on the display. For example, if " +"you pass ``rgb_channel=1`` this will extract the green channel of the " +"RGB565 image and display that in grayscale." +msgstr "" +"``rgb_channel`` 是从RGB565图像(如果传递)中提取和在显示屏上渲染的RGB通道(0=R, G=1, B=2)。例如,如果传递 " +"``rgb_channel=1`` ,则会提取RGB565图像的绿色通道并以灰度显示。" + +#: ../../library/omv.tv.rst:87 +msgid "" +"``alpha`` controls how opaque the image is. A value of 256 displays an " +"opaque image while a value lower than 256 produces a black transparent " +"image. 0 results in a perfectly black image." +msgstr "``alpha`` 控制图像的不透明度。职位256显示不透明图像,而低于256的值会产生黑色透明图像。0会产生完全黑色图像。" + +#: ../../library/omv.tv.rst:90 +msgid "" +"``color_palette`` if not ``-1`` can be an a color palette enum or a 256 " +"pixel in total RGB565 image to use as a color lookup table on the " +"grayscale value of whatever the input image is. This is applied after " +"``rgb_channel`` extraction if used." +msgstr "" +"``color_palette`` 如果不是 ``-1``,可以是调色板枚举值" +"或总共 256 像素的 RGB565 图像,用作输入图像灰度值的颜色查找表。如果使用了 ``rgb_channel``,则会在提取之后应用此选项。" + +#: ../../library/omv.tv.rst:94 +msgid "" +"``alpha_palette`` if not ``-1`` can be a 256 pixel in total GRAYSCALE " +"image to use as a alpha palette which modulates the ``alpha`` value of " +"the input image being displayed at a pixel pixel level allowing you to " +"precisely control the alpha value of pixels based on their grayscale " +"value. A pixel value of 255 in the alpha lookup table is opaque which " +"anything less than 255 becomes more transparent until 0. This is applied " +"after ``rgb_channel`` extraction if used." +msgstr "" +"``alpha_palette`` 如果不是 ``-1``,可以是总共 256 像素的 GRAYSCALE 图像,用作 alpha " +"调色板,以像素级别调制正在显示的输入图像的 ``alpha`` 值,从而精确控制根据其灰度值的像素的 alpha 值。 alpha 查找表中值为 " +"255 的像素是不透明的,小于 255 的值会更加透明直到 0。如果使用了 ``rgb_channel``,则会在缩放之后应用此选项。" + +#: ../../library/omv.tv.rst:100 +msgid "``hint`` can be a logical OR of the flags:" +msgstr "``hint`` 可以是标志的逻辑 OR:" + +#: ../../library/omv.tv.rst:102 +msgid "" +"`image.AREA`: Use area scaling when downscaling versus the default of " +"nearest neighbor." +msgstr "`image.AREA` :在缩小时使用区域缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.tv.rst:103 +msgid "" +"`image.BILINEAR`: Use bilinear scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BILINEAR` :使用双线性缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.tv.rst:104 +msgid "" +"`image.BICUBIC`: Use bicubic scaling versus the default of nearest " +"neighbor scaling." +msgstr "`image.BICUBIC`:使用双三次缩放,而不是默认的最近邻插值。" + +#: ../../library/omv.tv.rst:105 +msgid "" +"`image.CENTER`: Center the image being drawn on the display. This is " +"applied after scaling." +msgstr "`image.CENTER` :将要绘制的图像居中显示。这将在缩放后应用。" + +#: ../../library/omv.tv.rst:106 +msgid "`image.HMIRROR`: Horizontally mirror the image." +msgstr "`image.HMIRROR`:水平镜像图像。" + +#: ../../library/omv.tv.rst:107 +msgid "`image.VFLIP`: Vertically flip the image." +msgstr "`image.VFLIP` :垂直翻转图像。" + +#: ../../library/omv.tv.rst:108 +msgid "`image.TRANSPOSE`: Transpose the image (swap x/y)." +msgstr "`image.TRANSPOSE` :转置图像(交换 x/y)。" + +#: ../../library/omv.tv.rst:109 +msgid "" +"`image.EXTRACT_RGB_CHANNEL_FIRST`: Do rgb_channel extraction before " +"scaling." +msgstr "`image.EXTRACT_RGB_CHANNEL_FIRST` :在缩放之前执行 rgb_channel 提取。" + +#: ../../library/omv.tv.rst:110 +msgid "`image.APPLY_COLOR_PALETTE_FIRST`: Apply color palette before scaling." +msgstr "`image.APPLY_COLOR_PALETTE_FIRST` :在缩放之前应用颜色调色板。" + +#: ../../library/omv.tv.rst:111 +msgid "" +"`image.SCALE_ASPECT_KEEP`: Scale the image being drawn to fit inside the " +"display." +msgstr "`image.SCALE_ASPECT_KEEP` :将要绘制的图像缩放以适应显示器内部。" + +#: ../../library/omv.tv.rst:112 +msgid "" +"`image.SCALE_ASPECT_EXPAND`: Scale the image being drawn to fill the " +"display (results in cropping)" +msgstr "`image.SCALE_ASPECT_EXPAND` :将要绘制的图像缩放以填充显示器(会导致裁剪)" + +#: ../../library/omv.tv.rst:113 +msgid "" +"`image.SCALE_ASPECT_IGNORE`: Scale the image being drawn to fill the " +"display (results in stretching)." +msgstr "`image.SCALE_ASPECT_IGNORE` :将要绘制的图像缩放以填充显示器(会导致拉伸)。" + +#: ../../library/omv.tv.rst:114 +msgid "" +"`image.ROTATE_90`: Rotate the image by 90 degrees (this is just VFLIP | " +"TRANSPOSE)." +msgstr "`image.ROTATE_90` :将图像旋转 90 度(这只是 VFLIP | TRANSPOSE)。" + +#: ../../library/omv.tv.rst:115 +msgid "" +"`image.ROTATE_180`: Rotate the image by 180 degrees (this is just HMIRROR" +" | VFLIP)." +msgstr "`image.ROTATE_180` :将图像旋转 180 度(这只是 HMIRROR | VFLIP)。" + +#: ../../library/omv.tv.rst:116 +msgid "" +"`image.ROTATE_270`: Rotate the image by 270 degrees (this is just HMIRROR" +" | TRANSPOSE)." +msgstr "`image.ROTATE_270` :将图像旋转 270 度(这只是 HMIRROR | TRANSPOSE)。" + +#: ../../library/omv.tv.rst:119 +msgid "Constants" +msgstr "常量" + +#: ../../library/omv.tv.rst:124 +msgid "Returned by `tv.type()` when the this module is not initialized." +msgstr "当此模块未初始化时由 `tv.type()` 返回。" + +#: ../../library/omv.tv.rst:129 +msgid "Used to initialize the TV module." +msgstr "用于初始化TV模型。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/openamp.po b/docs/locale/zh_CN/LC_MESSAGES/library/openamp.po new file mode 100644 index 0000000000000..6aa7d0325b7d5 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/openamp.po @@ -0,0 +1,197 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/openamp.rst:2 +msgid "" +":mod:`openamp` -- provides standard Asymmetric Multiprocessing (AMP) " +"support" +msgstr ":mod:`openamp` -- 提供标准的非对称多处理(AMP)支持" + +#: ../../library/openamp.rst:7 +msgid "" +"The ``openamp`` module provides a standard inter-processor communications" +" infrastructure for MicroPython. The module handles all of the details of" +" OpenAMP, such as setting up the shared resource table, initializing " +"vrings, etc. It provides an API for using the RPMsg bus infrastructure " +"with the `Endpoint` class, and provides processor Life Cycle Management " +"(LCM) support, such as loading firmware and starting and stopping a " +"remote core, via the `RemoteProc` class." +msgstr "" +"``openamp`` 模块为 MicroPython 提供了标准的进程间通信基础设施。该模块处理 " +"OpenAMP 的所有细节,如设置共享资源表、初始化虚拟环 (vrings) 等。它通过 " +"`Endpoint` 类提供了使用 RPMsg 总线基础设施的 API,并通过 `RemoteProc` " +"类提供了处理器生命周期管理(LCM)支持,如加载固件、启动和停止远程核心等。" + +#: ../../library/openamp.rst:14 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/openamp.rst:33 +msgid "Functions" +msgstr "函数" + +#: ../../library/openamp.rst:37 +msgid "Set the new service callback." +msgstr "设置新的服务回调。" + +#: ../../library/openamp.rst:39 +msgid "" +"The *ns_callback* argument is a function that will be called when the " +"remote processor announces new services. At that point the host processor" +" can choose to create the announced endpoint, if this particular service " +"is supported, or ignore it if it's not. If this function is not set, the " +"host processor should first register the endpoint locally, and it will be" +" automatically bound when the remote announces the service." +msgstr "" +"*ns_callback* 参数是一个函数,当远程处理器宣布新服务时,该函数将被调用。此" +"时,主机处理器可以选择创建已宣布的端点(如果该服务受支持),或者忽略它(如果" +"不受支持)。如果未设置此函数,主机处理器应首先在本地注册端点,并且在远程宣布" +"服务时,它将自动绑定。" + +#: ../../library/openamp.rst:47 +msgid "Endpoint class" +msgstr "Endpoint 类" + +#: ../../library/openamp.rst:51 +msgid "" +"Construct a new RPMsg Endpoint. An endpoint is a bidirectional " +"communication channel between two cores." +msgstr "构建一个新的RPMsg端点。端点是两个核心之间的双向通信通道。" + +#: ../../library/openamp.rst:54 ../../library/openamp.rst:78 +msgid "Arguments are:" +msgstr "参数是:" + +#: ../../library/openamp.rst:56 +msgid "*name* is the name of the endpoint." +msgstr "*name* 是端点的名称。" + +#: ../../library/openamp.rst:57 +msgid "" +"*callback* is a function that is called when the endpoint receives data " +"with the source address of the remote point, and the data as bytes passed" +" by reference." +msgstr "*callback* 是当端点接收到数据时调用的函数,数据包含远程点的源地址,以及作为引" +"用传递的字节数据。" + +#: ../../library/openamp.rst:59 +msgid "" +"*src* is the endpoint source address. If none is provided one will be " +"assigned to the endpoint by the library." +msgstr "*src* 是端点的源地址。如果没有提供,库将为端点分配一个地址。" + +#: ../../library/openamp.rst:61 +msgid "" +"*dest* is the endpoint destination address. If the endpoint is created " +"from the new_service_callback, this must be provided and it must match " +"the remote endpoint's source address. If the endpoint is registered " +"locally, before the announcement, the destination address will be " +"assigned by the library when the endpoint is bound." +msgstr "" +"*dest* 是端点的目标地址。如果端点是通过 new_service_callback 创建的,则必须提" +"供此地址,并且它必须与远程端点的源地址匹配。如果端点在本地注册,且在公告之前" +",目标地址将在端点绑定时由库分配。" + +#: ../../library/openamp.rst:68 +msgid "Destroy the endpoint and release all of its resources." +msgstr "销毁端点并释放其所有资源。" + +#: ../../library/openamp.rst:72 +msgid "" +"Returns True if the endpoint is ready to send (i.e., has both a source " +"and destination addresses)" +msgstr "如果端点准备好发送(即,具有源地址和目标地址),则返回True" + +#: ../../library/openamp.rst:76 +msgid "Send a message to the remote processor over this endpoint." +msgstr "通过此端点向远程处理器发送消息。" + +#: ../../library/openamp.rst:80 +msgid "" +"*src* is the source endpoint address of the message. If none is provided," +" the source address the endpoint is bound to is used." +msgstr "*src* 是消息的源端点地址。如果没有提供,将使用端点绑定的源地址。" + +#: ../../library/openamp.rst:82 +msgid "" +"*dest* is the destination endpoint address of the message. If none is " +"provided, the destination address the endpoint is bound to is used." +msgstr "*dest* 是消息的目标端点地址。如果没有提供,将使用端点绑定的目标地址。" + +#: ../../library/openamp.rst:84 +msgid "" +"*timeout* specifies the time in milliseconds to wait for a free buffer. " +"By default the function is blocking." +msgstr "*timeout* " +"指定等待空闲缓冲区的时间(以毫秒为单位)。默认情况下,函数是阻塞的。" + +#: ../../library/openamp.rst:88 +msgid "RemoteProc class" +msgstr "RemoteProc 类" + +#: ../../library/openamp.rst:92 +msgid "" +"The RemoteProc object provides processor Life Cycle Management (LCM) " +"support, such as loading firmware, starting and stopping a remote core." +msgstr "RemoteProc " +"对象提供处理器生命周期管理(LCM)支持,例如加载固件、启动和停止远程核心。" + +#: ../../library/openamp.rst:95 +msgid "" +"The *entry* argument can be a path to firmware image, in which case the " +"firmware is loaded from file to its target memory, or an entry point " +"address, in which case the firmware must be loaded already at the given " +"address." +msgstr "" +"*entry* 参数可以是固件镜像的路径,在这种情况下,固件将从文件加载到目标内存;" +"或者是入口点地址,在这种情况下,固件必须已经加载到给定的地址。" + +#: ../../library/openamp.rst:101 +msgid "Starts the remote processor." +msgstr "启动远程处理器。" + +#: ../../library/openamp.rst:105 +msgid "" +"Stops the remote processor. The exact behavior is platform-dependent. On " +"the STM32H7 for example it's not possible to stop and then restart the " +"Cortex-M4 core, so a complete system reset is performed on a call to this" +" function." +msgstr "" +"停止远程处理器。具体行为取决于平台。例如,在STM32H7上,无法停止然后重新启动Co" +"rtex-M4核心,因此调用此函数时会执行完整的系统重置。" + +#: ../../library/openamp.rst:111 +msgid "" +"Shutdown stops the remote processor and releases all of its resources. " +"The exact behavior is platform-dependent, however typically it disables " +"power and clocks to the remote core. This function is also used as the " +"finaliser (i.e., called when ``RemoteProc`` object is collected). Note " +"that on the STM32H7, it's not possible to stop and then restart the " +"Cortex-M4 core, so a complete system reset is performed on a call to this" +" function." +msgstr "" +"Shutdown 停止远程处理器并释放其所有资源。具体行为取决于平台,但通常会禁用远程" +"核心的电源和时钟。此函数还作为最终处理函数(即在 ``RemoteProc`` 对象被回收时" +"调用)。请注意,在STM32H7上,无法停止然后重新启动Cortex-M4核心,因此调用此函" +"数时会执行完整的系统重置。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/os.po b/docs/locale/zh_CN/LC_MESSAGES/library/os.po new file mode 100644 index 0000000000000..6744473346b50 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/os.po @@ -0,0 +1,294 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/os.rst:2 +msgid ":mod:`os` -- basic \"operating system\" services" +msgstr ":mod:`os` -- 基本的“操作系统”服务" + +#: ../../library/os.rst:7 +msgid "|see_cpython_module| :mod:`python:os`." +msgstr "|see_cpython_module| :mod:`python:os`。" + +#: ../../library/os.rst:9 +msgid "" +"The ``os`` module contains functions for filesystem access and mounting, " +"terminal redirection and duplication, and the ``uname`` and ``urandom`` " +"functions." +msgstr "``os`` 模块包含用于文件系统访问和挂载、终端重定向和复制以及 ``uname`` 和 ``urandom`` 函数的功能。" + +#: ../../library/os.rst:14 +msgid "General functions" +msgstr "通用函数" + +#: ../../library/os.rst:18 +msgid "" +"Return a tuple (possibly a named tuple) containing information about the " +"underlying machine and/or its operating system. The tuple has five " +"fields in the following order, each of them being a string:" +msgstr "返回一个元组(可能是一个命名元组),其中包含关于底层机器和/或其操作系统的信息。元组按照以下顺序有五个字段,每个字段都是一个字符串:" + +#: ../../library/os.rst:22 +msgid "``sysname`` -- the name of the underlying system" +msgstr "``sysname`` -- 底层系统的名称" + +#: ../../library/os.rst:23 +msgid "``nodename`` -- the network name (can be the same as ``sysname``)" +msgstr "``nodename`` -- 网络名称(可以与 ``sysname`` 相同)" + +#: ../../library/os.rst:24 +msgid "``release`` -- the version of the underlying system" +msgstr "``release`` -- 底层系统的版本" + +#: ../../library/os.rst:25 +msgid "``version`` -- the MicroPython version and build date" +msgstr "``version`` -- MicroPython 版本和构建日期" + +#: ../../library/os.rst:26 +msgid "``machine`` -- an identifier for the underlying hardware (eg board, CPU)" +msgstr "``machine`` -- 底层硬件的标识符(例如板子、CPU)" + +#: ../../library/os.rst:30 +msgid "" +"Return a bytes object with *n* random bytes. Whenever possible, it is " +"generated by the hardware random number generator." +msgstr "返回一个包含 *n* 个随机字节的字节对象。尽可能使用硬件随机数生成器生成。" + +#: ../../library/os.rst:34 +msgid "Filesystem access" +msgstr "文件系统访问" + +#: ../../library/os.rst:38 +msgid "Change current directory." +msgstr "更改当前目录。" + +#: ../../library/os.rst:42 +msgid "Get the current directory." +msgstr "获取当前目录。" + +#: ../../library/os.rst:46 +msgid "" +"This function returns an iterator which then yields tuples corresponding " +"to the entries in the directory that it is listing. With no argument it " +"lists the current directory, otherwise it lists the directory given by " +"*dir*." +msgstr "此函数返回一个迭代器,然后产生与其正在列出的目录中的条目对应的元组。如果没有参数,则列出当前目录,否则列出由 *dir* 给定的目录。" + +#: ../../library/os.rst:50 +msgid "The tuples have the form *(name, type, inode[, size])*:" +msgstr "元组的形式为 *(name, type, inode[, size])*:" + +#: ../../library/os.rst:52 +msgid "" +"*name* is a string (or bytes if *dir* is a bytes object) and is the name " +"of the entry;" +msgstr "*name* 是一个字符串(如果 *dir* 是一个字节对象,则是字节)并且是条目的名称;" + +#: ../../library/os.rst:54 +msgid "" +"*type* is an integer that specifies the type of the entry, with 0x4000 " +"for directories and 0x8000 for regular files;" +msgstr "*type* 是一个整数,指定条目的类型,对于目录为0×4000,对于常规文件为0×8000;" + +#: ../../library/os.rst:56 +msgid "" +"*inode* is an integer corresponding to the inode of the file, and may be " +"0 for filesystems that don't have such a notion." +msgstr "*inode* 是文件的inode对应的整数,对于没有此概念的文件系统可能为0。" + +#: ../../library/os.rst:58 +msgid "" +"Some platforms may return a 4-tuple that includes the entry's *size*. " +"For file entries, *size* is an integer representing the size of the file " +"or -1 if unknown. Its meaning is currently undefined for directory " +"entries." +msgstr "一些平台可能返回包含条目的 *size* 的4元组。对于文件条目,*size* 是一个表示文件大小的整数,如果大小未知则为-1。对于目录条目,其含义目前未定义。" + +#: ../../library/os.rst:65 +msgid "" +"With no argument, list the current directory. Otherwise list the given " +"directory." +msgstr "如果没有参数,则列出当前目录。否则列出给定目录。" + +#: ../../library/os.rst:69 +msgid "Create a new directory." +msgstr "创建一个新的目录。" + +#: ../../library/os.rst:73 +msgid "Remove a file." +msgstr "删除一个文件。" + +#: ../../library/os.rst:77 +msgid "Remove a directory." +msgstr "删除一个目录。" + +#: ../../library/os.rst:81 +msgid "Rename a file." +msgstr "重命名一个文件。" + +#: ../../library/os.rst:85 +msgid "Get the status of a file or directory." +msgstr "获取文件或目录的状态。" + +#: ../../library/os.rst:89 +msgid "Get the status of a filesystem." +msgstr "获取系统文件的状态。" + +#: ../../library/os.rst:91 +msgid "Returns a tuple with the filesystem information in the following order:" +msgstr "返回一个元组,其中包含以下顺序的文件系统信息:" + +#: ../../library/os.rst:93 +msgid "``f_bsize`` -- file system block size" +msgstr "``f_bsize`` -- 文件系统块大小" + +#: ../../library/os.rst:94 +msgid "``f_frsize`` -- fragment size" +msgstr "``f_frsize`` -- 片段大小" + +#: ../../library/os.rst:95 +msgid "``f_blocks`` -- size of fs in f_frsize units" +msgstr "``f_blocks`` -- 以f_frsize为单位的fs大小" + +#: ../../library/os.rst:96 +msgid "``f_bfree`` -- number of free blocks" +msgstr "``f_bfree`` -- 空闲块数" + +#: ../../library/os.rst:97 +msgid "``f_bavail`` -- number of free blocks for unprivileged users" +msgstr "``f_bavail`` -- 非特权用户使用的空闲块数" + +#: ../../library/os.rst:98 +msgid "``f_files`` -- number of inodes" +msgstr "``f_files`` -- inode 数量" + +#: ../../library/os.rst:99 +msgid "``f_ffree`` -- number of free inodes" +msgstr "``f_ffree`` -- 空闲 inode 数量" + +#: ../../library/os.rst:100 +msgid "``f_favail`` -- number of free inodes for unprivileged users" +msgstr "``f_favail`` -- 非特权用户的可用空闲 inode 数量" + +#: ../../library/os.rst:101 +msgid "``f_flag`` -- mount flags" +msgstr "``f_flag`` -- 挂载标志" + +#: ../../library/os.rst:102 +msgid "``f_namemax`` -- maximum filename length" +msgstr "``f_namemax`` -- 最大文件名长度" + +#: ../../library/os.rst:104 +msgid "" +"Parameters related to inodes: ``f_files``, ``f_ffree``, ``f_avail`` and " +"the ``f_flags`` parameter may return ``0`` as they can be unavailable in " +"a port-specific implementation." +msgstr "" +"与 inode 相关的参数:``f_files``、``f_ffree``、``f_avail`` 和 ``f_flags`` 参数可能返回 " +"``0``,因为它们可能在移植版本特定的实现中不可用。" + +#: ../../library/os.rst:110 +msgid "Sync all filesystems." +msgstr "同步所有文件系统。" + +#: ../../library/os.rst:113 +msgid "Terminal redirection and duplication" +msgstr "终端重定向和复制" + +#: ../../library/os.rst:117 +msgid "" +"Duplicate or switch the MicroPython terminal (the REPL) on the given " +":std:term:`stream`-like object. The *stream_object* argument must be a " +"native stream object, or derive from ``io.IOBase`` and implement the " +"``readinto()`` and ``write()`` methods. The stream should be in non-" +"blocking mode and ``readinto()`` should return ``None`` if there is no " +"data available for reading." +msgstr "" +"复制或切换给定的 :std:term:`stream` 类对象上的 MicroPython 终端(REPL)。*stream_object* " +"参数必须是本机流对象,或派生自 ``io.IOBase`` 并实现 ``readinto()`` 和 ``write()`` " +"方法。流应处于非阻塞模式,如果没有数据可用于读取,则 ``readinto()`` 应返回 ``None``。" + +#: ../../library/os.rst:123 +msgid "" +"After calling this function all terminal output is repeated on this " +"stream, and any input that is available on the stream is passed on to the" +" terminal input." +msgstr "调用此函数后,所有终端输出都会在此流上重复,任何可用于流上的输入都会传递到终端输入。" + +#: ../../library/os.rst:126 +msgid "" +"The *index* parameter should be a non-negative integer and specifies " +"which duplication slot is set. A given port may implement more than one " +"slot (slot 0 will always be available) and in that case terminal input " +"and output is duplicated on all the slots that are set." +msgstr "" +"*index* 参数应为非负整数,并指定设置的复制槽。给定移植版本可能实现多个槽(槽 0 " +"总是可用),在这种情况下,终端输入和输出会复制到所有设置的槽上。" + +#: ../../library/os.rst:131 +msgid "" +"If ``None`` is passed as the *stream_object* then duplication is " +"cancelled on the slot given by *index*." +msgstr "如果将 ``None`` 作为 *stream_object* 传递,则在给定的 *index* 槽上取消复制。" + +#: ../../library/os.rst:134 +msgid "The function returns the previous stream-like object in the given slot." +msgstr "函数返回给定槽中的以前的类似流对象。" + +#: ../../library/os.rst:137 +msgid "Filesystem mounting" +msgstr "文件系统挂载" + +#: ../../library/os.rst:139 +msgid "" +"The following functions and classes have been moved to the :mod:`vfs` " +"module. They are provided in this module only for backwards compatibility" +" and will be removed in version 2 of MicroPython." +msgstr "以下函数和类已被移至 :mod:`vfs` " +"模块。它们仅在此模块中提供,以保持向后兼容性,并将在 MicroPython 2 " +"版本中移除。" + +#: ../../library/os.rst:145 +msgid "See `vfs.mount`." +msgstr "请参见 `vfs.mount`。" + +#: ../../library/os.rst:149 +msgid "See `vfs.umount`." +msgstr "请参见 `vfs.umount`。" + +#: ../../library/os.rst:153 +msgid "See `vfs.VfsFat`." +msgstr "请参见 `vfs.VfsFat`。" + +#: ../../library/os.rst:157 +msgid "See `vfs.VfsLfs1`." +msgstr "请参见 `vfs.VfsLfs1`。" + +#: ../../library/os.rst:161 +msgid "See `vfs.VfsLfs2`." +msgstr "请参见 `vfs.VfsLfs2`。" + +#: ../../library/os.rst:165 +msgid "See `vfs.VfsPosix`." +msgstr "请参见 `vfs.VfsPosix`。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/platform.po b/docs/locale/zh_CN/LC_MESSAGES/library/platform.po new file mode 100644 index 0000000000000..b1dbbc27240e1 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/platform.po @@ -0,0 +1,90 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-07-09 01:38+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/platform.rst:2 +msgid ":mod:`platform` -- access to underlying platform’s identifying data" +msgstr ":mod:`platform` -- 访问底层平台的识别数据" + +#: ../../library/platform.rst:7 +msgid "|see_cpython_module| :mod:`python:platform`." +msgstr "|see_cpython_module| :mod:`python:platform`。" + +#: ../../library/platform.rst:9 +msgid "" +"This module tries to retrieve as much platform-identifying data as " +"possible. It makes this information available via function APIs." +msgstr "该模块尝试尽可能多地检索平台识别数据。它通过函数API提供此信息。" + +#: ../../library/platform.rst:13 +msgid "Functions" +msgstr "函数" + +#: ../../library/platform.rst:17 +msgid "" +"Returns a string identifying the underlying platform. This string is " +"composed of several substrings in the following order, delimited by " +"dashes (``-``):" +msgstr "返回一个字符串,标识底层平台。此字符串由几个子字符串组成,按照以下顺序用破折" +"号(``-``)分隔:" + +#: ../../library/platform.rst:20 +msgid "the name of the platform system (e.g. Unix, Windows or MicroPython)" +msgstr "平台系统的名称(例如 Unix、Windows 或 MicroPython)" + +#: ../../library/platform.rst:21 +msgid "the MicroPython version" +msgstr "MicroPython 版本" + +#: ../../library/platform.rst:22 +msgid "the architecture of the platform" +msgstr "平台的架构" + +#: ../../library/platform.rst:23 +msgid "the version of the underlying platform" +msgstr "底层平台的版本" + +#: ../../library/platform.rst:24 +msgid "" +"the concatenation of the name of the libc that MicroPython is linked to " +"and its corresponding version." +msgstr "MicroPython 链接到的 libc 的名称和其相应版本的连接字符串。" + +#: ../../library/platform.rst:27 +msgid "" +"For example, this could be ``\"MicroPython-1.20.0-xtensa-IDFv4.2.4-with-" +"newlib3.0.0\"``." +msgstr "例如,可能是 ``\"MicroPython-1.20.0-xtensa-IDFv4.2.4-with-newlib3.0.0\"``。" + +#: ../../library/platform.rst:32 +msgid "Returns a string identifying the compiler used for compiling MicroPython." +msgstr "返回一个字符串,标识用于编译 MicroPython 的编译器。" + +#: ../../library/platform.rst:36 +msgid "" +"Returns a tuple of strings *(lib, version)*, where *lib* is the name of " +"the libc that MicroPython is linked to, and *version* the corresponding " +"version of this libc." +msgstr "" +"返回一个字符串元组 *(lib, version)*,其中 *lib* 是 MicroPython 链接到的 libc " +"的名称,*version* 是该 libc 的相应版本。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ADC.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ADC.po new file mode 100644 index 0000000000000..d815d27166408 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ADC.po @@ -0,0 +1,198 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.ADC.rst:5 +msgid "class ADC -- analog to digital conversion" +msgstr "class ADC -- 模拟到数字转换" + +#: ../../library/pyb.ADC.rst:7 +msgid "Usage::" +msgstr "用法::" + +#: ../../library/pyb.ADC.rst:24 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.ADC.rst:28 +msgid "" +"Create an ADC object associated with the given pin. This allows you to " +"then read analog values on that pin." +msgstr "创建与引脚关联的ADC对象。这使您可以在该引脚上读取模拟值。" + +#: ../../library/pyb.ADC.rst:32 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.ADC.rst:36 +msgid "" +"Read the value on the analog pin and return it. The returned value will " +"be between 0 and 4095." +msgstr "读取模拟引脚上的值并返回它。返回值将在 0 和 4095 之间。" + +#: ../../library/pyb.ADC.rst:41 +msgid "Read analog values into ``buf`` at a rate set by the ``timer`` object." +msgstr "以由 ``timer`` 对象设置的速率将模拟值读取到 ``buf`` 中。" + +#: ../../library/pyb.ADC.rst:43 +msgid "" +"``buf`` can be bytearray or array.array for example. The ADC values have" +" 12-bit resolution and are stored directly into ``buf`` if its element " +"size is 16 bits or greater. If ``buf`` has only 8-bit elements (eg a " +"bytearray) then the sample resolution will be reduced to 8 bits." +msgstr "" +"``buf`` 可以是 bytearray 或 array.array。以Array为例。ADC 值具有 12 " +"位分辨率,如果 ``buf`` 的元素大小为 16 位或更大,则直接存储到 ``buf`` 中。" +"如果 ``buf`` 只有 8 位元素(例如 bytearray),则采样分辨率将降低为 8 位。" + +#: ../../library/pyb.ADC.rst:48 +msgid "" +"``timer`` should be a Timer object, and a sample is read each time the " +"timer triggers. The timer must already be initialised and running at the" +" desired sampling frequency." +msgstr "``timer`` 应该是一个 Timer 对象,并且每次计时器触发时都会读取一个样本。计时器" +"必须已初始化并以所需的采样频率运行。" + +#: ../../library/pyb.ADC.rst:52 +msgid "" +"To support previous behaviour of this function, ``timer`` can also be an " +"integer which specifies the frequency (in Hz) to sample at. In this case" +" Timer(6) will be automatically configured to run at the given frequency." +msgstr "" +"支持此函数以前的行为,``timer`` " +"也可以是一个整数,指定要采样的频率(以赫兹为单位)。在这种情况下,Timer(6) " +"将自动配置为以给定频率运行。" + +#: ../../library/pyb.ADC.rst:56 +msgid "Example using a Timer object (preferred way)::" +msgstr "使用 Timer 对象的示例(首选方法)::" + +#: ../../library/pyb.ADC.rst:63 +msgid "Example using an integer for the frequency::" +msgstr "使用整数表示频率的示例::" + +#: ../../library/pyb.ADC.rst:72 +msgid "" +"This function does not allocate any heap memory. It has blocking " +"behaviour: it does not return to the calling program until the buffer is " +"full." +msgstr "此函数不分配任何堆内存。它具有阻塞行为:在缓冲区填满之前,它不会返回到调用程" +"序。" + +#: ../../library/pyb.ADC.rst:76 +msgid "The ADCAll Object" +msgstr "ADCAll 对象" + +#: ../../library/pyb.ADC.rst:78 +msgid "" +"Instantiating this changes all masked ADC pins to analog inputs. The " +"preprocessed MCU temperature, VREF and VBAT data can be accessed on ADC " +"channels 16, 17 and 18 respectively. Appropriate scaling is handled " +"according to reference voltage used (usually 3.3V). The temperature " +"sensor on the chip is factory calibrated and allows to read the die " +"temperature to +/- 1 degree centigrade. Although this sounds pretty " +"accurate, don't forget that the MCU's internal temperature is measured. " +"Depending on processing loads and I/O subsystems active the die " +"temperature may easily be tens of degrees above ambient temperature. On " +"the other hand a pyboard woken up after a long standby period will show " +"correct ambient temperature within limits mentioned above." +msgstr "" +"实例化此对象将所有掩码 ADC 引脚更改为模拟输入。预处理的 MCU 温度、VREF 和 " +"VBAT 数据可以通过分别在 ADC 通道 16、17 和 18 上访问。根据所使用的参考电压(" +"通常为 3.3V),将进行适当的缩放。芯片上的温度传感器经过出厂校准," +"允许将芯片温度读取到 +/- 1 摄氏度。尽管听起来相当准确,但不要忘记 MCU " +"的内部温度是被测量的。根据处理负载和活动的 I/O " +"子系统,芯片温度可能轻易高出环境温度十多度。另一方面,长时间待机后唤醒的 " +"pyboard 将在上述限制内显示正确的环境温度。" + +#: ../../library/pyb.ADC.rst:87 +msgid "" +"The ``ADCAll`` ``read_core_vbat()``, ``read_vref()`` and " +"``read_core_vref()`` methods read the backup battery voltage, reference " +"voltage and the (1.21V nominal) reference voltage using the actual supply" +" as a reference. All results are floating point numbers giving direct " +"voltage values." +msgstr "" +"``ADCAll`` 的 ``read_core_vbat()``, ``read_vref()`` 和 ``read_core_vref()`` " +"方法读取备用电池电压、参考电压和(1.21V " +"名义)参考电压,使用实际供电作为参考。所有结果都是浮点数,提供直接电压值。" + +#: ../../library/pyb.ADC.rst:91 +msgid "" +"``read_core_vbat()`` returns the voltage of the backup battery. This " +"voltage is also adjusted according to the actual supply voltage. To avoid" +" analog input overload the battery voltage is measured via a voltage " +"divider and scaled according to the divider value. To prevent excessive " +"loads to the backup battery, the voltage divider is only active during " +"ADC conversion." +msgstr "" +"``read_core_vbat()`` 返回备用电池电压。该电压也根据实际供电电压进行调整。为了" +"避免模拟输入过载,电池电压是通过电压分压器测量的,并根据分压器值进行缩放。为" +"了防止对备用电池造成过大负载,只有在 ADC 转换期间才会激活电压分压器。" + +#: ../../library/pyb.ADC.rst:96 +msgid "" +"``read_vref()`` is evaluated by measuring the internal voltage reference " +"and backscale it using factory calibration value of the internal voltage " +"reference. In most cases the reading would be close to 3.3V. If the " +"pyboard is operated from a battery, the supply voltage may drop to values" +" below 3.3V. The pyboard will still operate fine as long as the operating" +" conditions are met. With proper settings of MCU clock, flash access " +"speed and programming mode it is possible to run the pyboard down to 2 V " +"and still get useful ADC conversion." +msgstr "" +"``read_vref()`` 通过测量内部电压参考并使用内部电压参考的工厂校准值进行反向缩" +"放。在大多数情况下,读数将接近 3.3V。如果 pyboard 由电池供电," +"供电电压可能会降至低于 3.3V 的值。只要满足操作条件,pyboard 仍然会正常运行。" +"通过正确设置 MCU 时钟、闪存访问速度和编程模式,可以将 pyboard 运行到 2V " +"以下,仍然可以获得有用的 ADC 转换。" + +#: ../../library/pyb.ADC.rst:103 +msgid "" +"It is very important to make sure analog input voltages never exceed " +"actual supply voltage." +msgstr "非常重要的是确保模拟输入电压永远不要超过实际供电电压。" + +#: ../../library/pyb.ADC.rst:105 +msgid "" +"Other analog input channels (0..15) will return unscaled integer values " +"according to the selected precision." +msgstr "其他模拟输入通道(0..15)将根据所选精度返回未缩放的整数值。" + +#: ../../library/pyb.ADC.rst:108 +msgid "" +"To avoid unwanted activation of analog inputs (channel 0..15) a second " +"parameter can be specified. This parameter is a binary pattern where each" +" requested analog input has the corresponding bit set. The default value " +"is 0xffffffff which means all analog inputs are active. If just the " +"internal channels (16..18) are required, the mask value should be " +"0x70000." +msgstr "" +"为了避免意外激活模拟输入(通道 0..15),可以指定第二个参数。该参数是一个二进" +"制模式,其中每个请求的模拟输入都具有相应的位设置。默认值为 " +"0xffffffff,表示所有模拟输入都处于活动状态。如果只需要内部通道(16..18)," +"则掩码值应为 0x70000。" + +#: ../../library/pyb.ADC.rst:113 +msgid "Example::" +msgstr "例子::" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.CAN.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.CAN.po new file mode 100644 index 0000000000000..0e33d060aa2de --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.CAN.po @@ -0,0 +1,728 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/pyb.CAN.rst:5 +msgid "class CAN -- controller area network communication bus" +msgstr "class CAN -- 控制器局域网通信总线" + +#: ../../library/pyb.CAN.rst:7 +msgid "" +"CAN implements support for classic CAN (available on F4, F7 MCUs) and CAN" +" FD (H7 series) controllers. At the physical level CAN bus consists of 2 " +"lines: RX and TX. Note that to connect the pyboard to a CAN bus you must" +" use a CAN transceiver to convert the CAN logic signals from the pyboard " +"to the correct voltage levels on the bus." +msgstr "" +"CAN 实现了对经典 CAN(适用于 F4、F7 MCU)和 CAN FD(H7 系列)控制器的支持。在物理层,CAN 总线由 2 条线组成:RX" +" 和 TX。注意,要将 pyboard 连接到 CAN 总线,必须使用CAN 转换器将 pyboard 上的 CAN " +"逻辑信号转换为总线上的正确电压水平。" + +#: ../../library/pyb.CAN.rst:12 +msgid "" +"Example usage for classic CAN controller in Loopback (transceiver-less) " +"mode::" +msgstr "经典 CAN 控制器在回环(无需收发器)模式下的示例用法:" + +#: ../../library/pyb.CAN.rst:20 +msgid "" +"Example usage for CAN FD controller with all of the possible options " +"enabled::" +msgstr "CAN FD 控制器在启用了所有可能的选项的示例用法:" + +#: ../../library/pyb.CAN.rst:28 +msgid "" +"The following CAN module functions and their arguments are available for " +"both classic and FD CAN controllers, unless otherwise stated." +msgstr "以下是经典CAN和FD CAN控制器可用的函数及其参数,除非另有说明。" + +#: ../../library/pyb.CAN.rst:32 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.CAN.rst:36 +msgid "" +"Construct a CAN object on the given bus. *bus* can be 1-2, or ``'YA'`` " +"or ``'YB'``. With no additional parameters, the CAN object is created but" +" not initialised (it has the settings from the last initialisation of the" +" bus, if any). If extra arguments are given, the bus is initialised. See" +" :meth:`CAN.init` for parameters of initialisation." +msgstr "" +"在给定的总线上构造一个 CAN 对象。*bus* 可以是 1-2,或者 ``'YA'`` 或 " +"``'YB'``。如果没有额外的参数,则创建但不初始化 CAN " +"对象(使用上一次初始化总线的设置,如果有)。如果给定了额外的参数,则初始化总线。有关初始化参数,请参阅 :meth:`CAN.init`。" + +#: ../../library/pyb.CAN.rst:42 +msgid "The physical pins of the CAN buses are:" +msgstr "CAN总线的物理引脚如下:" + +#: ../../library/pyb.CAN.rst:44 +msgid "``CAN(1)`` is on ``YA``: ``(RX, TX) = (Y3, Y4) = (PB8, PB9)``" +msgstr "``CAN(1)`` 在 ``YA`` 上:``(RX, TX) = (Y3, Y4) = (PB8, PB9)``" + +#: ../../library/pyb.CAN.rst:45 +msgid "``CAN(2)`` is on ``YB``: ``(RX, TX) = (Y5, Y6) = (PB12, PB13)``" +msgstr "``CAN(2)`` 在 ``YB`` 上:``(RX, TX) = (Y5, Y6) = (PB12, PB13)``" + +#: ../../library/pyb.CAN.rst:48 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.CAN.rst:53 +msgid "Initialise the CAN bus with the given parameters:" +msgstr "使用给定参数初始化CAN总线:" + +#: ../../library/pyb.CAN.rst:55 +msgid "*mode* is one of: NORMAL, LOOPBACK, SILENT, SILENT_LOOPBACK" +msgstr "*mode* 可以是以下之一:NORMAL、LOOPBACK、SILENT、SILENT_LOOPBACK" + +#: ../../library/pyb.CAN.rst:56 +msgid "" +"*prescaler* is the value by which the CAN input clock is divided to " +"generate the nominal bit time quanta. The prescaler can be a value " +"between 1 and 1024 inclusive for classic CAN, and between 1 and 512 " +"inclusive for CAN FD." +msgstr "" +"*prescaler* 是用于生成标称比特时间量的 CAN 输入时钟除数值。对于经典 CAN,预分频器可以是介于 1 和 1024(含1024) " +"之间的值,对于 CAN FD,可以是介于 1 和 512 (含512)之间的值。" + +#: ../../library/pyb.CAN.rst:59 +msgid "" +"*sjw* is the resynchronisation jump width in units of time quanta for " +"nominal bits; it can be a value between 1 and 4 inclusive for classic " +"CAN, and between 1 and 128 inclusive for CAN FD." +msgstr "" +"*sjw* 是标称位的重新同步跳跃宽度,以时间单位计算;对于经典 CAN,它可以是介于 1 和 4 (含4)之间的值,对于 CAN " +"FD,可以是介于 1 和 128 (含128)之间的值。" + +#: ../../library/pyb.CAN.rst:61 +msgid "" +"*bs1* defines the location of the sample point in units of the time " +"quanta for nominal bits; it can be a value between 1 and 16 inclusive for" +" classic CAN, and between 2 and 256 inclusive for CAN FD." +msgstr "" +"*bs1* 定义了采样点在标称位的时间单位中的位置;对于经典 CAN,它可以是介于 1 和 16(含16) 之间的值,对于 CAN " +"FD,可以是介于 2 和 256 (含256)之间的值。" + +#: ../../library/pyb.CAN.rst:63 +msgid "" +"*bs2* defines the location of the transmit point in units of the time " +"quanta for nominal bits; it can be a value between 1 and 8 inclusive for " +"classic CAN, and between 2 and 128 inclusive for CAN FD." +msgstr "" +"*bs2* 定义了传输点在标称位的时间单位中的位置;对于经典 CAN,它可以是介于 1 和 8(含8) 之间的值,对于 CAN FD,可以是介于 " +"2 和 128 (含128)之间的值。" + +#: ../../library/pyb.CAN.rst:65 +msgid "" +"*auto_restart* sets whether the controller will automatically try and " +"restart communications after entering the bus-off state; if this is " +"disabled then :meth:`~CAN.restart()` can be used to leave the bus-off " +"state" +msgstr "" +"*auto_restart* 设置控制器是否会在进入总线关闭状态后自动尝试重新启动通信;如果禁用了此功能,则可以使用 " +":meth:`~CAN.restart()` 来离开总线关闭状态" + +#: ../../library/pyb.CAN.rst:68 +msgid "" +"*baudrate* if a baudrate other than 0 is provided, this function will try" +" to automatically calculate the CAN nominal bit time (overriding " +"*prescaler*, *bs1* and *bs2*) that satisfies both the *baudrate* (within " +".1%) and the desired *sample_point* (to the nearest 1%). For more precise" +" control over the CAN timing, set the *prescaler*, *bs1* and *bs2* " +"parameters directly." +msgstr "" +"*baudrate* 如果提供了一个非 0 的波特率,该函数将尝试自动计算满足 *baudrate*(误差在 0.1% 以内)和所需 " +"*sample_point*(精确到最近 1%)的 CAN 标称比特时间(覆盖 *prescaler*、*bs1* 和 *bs2*)。如需更精确地控制 " +"CAN 时序,请直接设置 *prescaler*、*bs1* 和 *bs2* 参数。" + +#: ../../library/pyb.CAN.rst:72 +msgid "" +"*sample_point* specifies the position of the bit sample with respect to " +"the whole nominal bit time, expressed as an integer percentage of the " +"nominal bit time. The default *sample_point* is 75%. This parameter is " +"ignored unless *baudrate* is set." +msgstr "" +"*sample_point* 指定位采样相对于整个标称比特时间的位置,以标称比特时间的整数百分比表示。默认的 *sample_point* 是 " +"75%。除非设置了 *baudrate*,否则将忽略此参数。" + +#: ../../library/pyb.CAN.rst:75 +msgid "" +"*num_filter_banks* for classic CAN, this is the number of banks that will" +" be assigned to CAN(1), the rest of the 28 are assigned to CAN(2)." +msgstr "*num_filter_banks* 对于经典 CAN,这是将分配给 CAN(1) 的组数,剩下的 28 个将分配给 CAN(2)。" + +#: ../../library/pyb.CAN.rst:78 +msgid "" +"The remaining parameters are only present on boards with CAN FD support, " +"and configure the optional CAN FD Bit Rate Switch (BRS) feature:" +msgstr "其余参数仅存在于支持 CAN FD 的板上,用于配置可选的 CAN FD 比特率切换(BRS)功能:" + +#: ../../library/pyb.CAN.rst:81 +msgid "" +"*brs_prescaler* is the value by which the CAN FD input clock is divided " +"to generate the data bit time quanta. The prescaler can be a value " +"between 1 and 32 inclusive." +msgstr "*brs_prescaler* 用于生成数据比特时间量的 CAN FD 输入时钟的值。预分频器可以是介于 1 和 32 (含32)之间的值。" + +#: ../../library/pyb.CAN.rst:83 +msgid "" +"*brs_sjw* is the resynchronisation jump width in units of time quanta for" +" data bits; it can be a value between 1 and 16 inclusive" +msgstr "*brs_sjw* 是数据位的重新同步跳跃宽度,以时间单位计算;它可以是介于 1 和 16(含16) 之间的值" + +#: ../../library/pyb.CAN.rst:85 +msgid "" +"*brs_bs1* defines the location of the sample point in units of the time " +"quanta for data bits; it can be a value between 1 and 32 inclusive" +msgstr "*brs_bs1* 定义了采样点在数据位的时间单位中的位置;它可以是介于 1 和 32(含32) 之间的值" + +#: ../../library/pyb.CAN.rst:87 +msgid "" +"*brs_bs2* defines the location of the transmit point in units of the time" +" quanta for data bits; it can be a value between 1 and 16 inclusive" +msgstr "*brs_bs2* 定义了传输点在数据位的时间单位中的位置;它可以是介于 1 和 16 (含16)之间的值" + +#: ../../library/pyb.CAN.rst:89 +msgid "" +"*brs_baudrate* if a baudrate other than 0 is provided, this function will" +" try to automatically calculate the CAN data bit time (overriding " +"*brs_prescaler*, *brs_bs1* and *brs_bs2*) that satisfies both the " +"*brs_baudrate* (within .1%) and the desired *brs_sample_point* (to the " +"nearest 1%). For more precise control over the BRS timing, set the " +"*brs_prescaler*, *brs_bs1* and *brs_bs2* parameters directly." +msgstr "" +"*brs_baudrate* 如果提供了一个非 0 的波特率,该函数将尝试自动计算满足 *brs_baudrate*(误差在 0.1% 以内)和所需 " +"*brs_sample_point*(精确到最近 1%)的 CAN 数据比特时间(覆盖 *brs_prescaler*、*brs_bs1* 和 " +"*brs_bs2*)。如需更精确地控制 BRS 时序,请直接设置 *brs_prescaler*、*brs_bs1* 和 *brs_bs2* 参数。" + +#: ../../library/pyb.CAN.rst:93 +msgid "" +"*brs_sample_point* specifies the position of the bit sample with respect " +"to the whole nominal bit time, expressed as an integer percentage of the " +"nominal bit time. The default *brs_sample_point* is 75%. This parameter " +"is ignored unless *brs_baudrate* is set." +msgstr "" +"*brs_sample_point* 指定位采样相对于整个标称比特时间的位置,以标称比特时间的整数百分比表示。" +"默认的 *brs_sample_point* 为 75%。除非设置了 *brs_baudrate*,否则将忽略此参数。" + +#: ../../library/pyb.CAN.rst:97 +msgid "" +"The time quanta tq is the basic unit of time for the CAN bus. tq is the " +"CAN prescaler value divided by PCLK1 (the frequency of internal " +"peripheral bus 1); see :meth:`pyb.freq()` to determine PCLK1." +msgstr "" +"时间量 tq 是 CAN 总线的基本时间单位。tq 是 CAN 预分频器值除以 PCLK1(内部外围总线 1 的频率)得到的值;请参阅 " +":meth:`pyb.freq()` 以确定 PCLK1。" + +#: ../../library/pyb.CAN.rst:101 +msgid "" +"A single bit is made up of the synchronisation segment, which is always 1" +" tq. Then follows bit segment 1, then bit segment 2. The sample point is" +" after bit segment 1 finishes. The transmit point is after bit segment 2" +" finishes. The baud rate will be 1/bittime, where the bittime is 1 + BS1 " +"+ BS2 multiplied by the time quanta tq." +msgstr "" +"单个位由同步段组成,始终为 1 tq。然后是位段 1,然后是位段 2。采样点位于位段 1 结束后。传输点位于位段 2 结束后。波特率将是 " +"1/比特时间,其中比特时间是 1 + BS1 + BS2 乘以时间量 tq。" + +#: ../../library/pyb.CAN.rst:107 +msgid "" +"For example, with PCLK1=42MHz, prescaler=100, sjw=1, bs1=6, bs2=8, the " +"value of tq is 2.38 microseconds. The bittime is 35.7 microseconds, and " +"the baudrate is 28kHz." +msgstr "" +"例如,对于 PCLK1=42MHz,预分频器=100,sjw=1,bs1=6,bs2=8,tq 的值为 2.38 微秒。比特时间为 35.7 " +"微秒,波特率为 28kHz。" + +#: ../../library/pyb.CAN.rst:111 +msgid "See page 680 of the STM32F405 datasheet for more details." +msgstr "更多细节请参阅STM32F405数据手册680页。" + +#: ../../library/pyb.CAN.rst:115 +msgid "Turn off the CAN bus." +msgstr "关闭CAN总线。" + +#: ../../library/pyb.CAN.rst:119 +msgid "" +"Force a software restart of the CAN controller without resetting its " +"configuration." +msgstr "强制软件重新启动CAN控制器,而不是重置其配置。" + +#: ../../library/pyb.CAN.rst:122 +msgid "" +"If the controller enters the bus-off state then it will no longer " +"participate in bus activity. If the controller is not configured to " +"automatically restart (see :meth:`~CAN.init()`) then this method can be " +"used to trigger a restart, and the controller will follow the CAN " +"protocol to leave the bus-off state and go into the error active state." +msgstr "" +"如果控制器进入总线关闭状态,则它将不再参与总线活动。如果控制器未配置为自动重新启动(请参阅 " +":meth:`~CAN.init()`),则可以使用此方法触发重新启动,并且控制器将遵循 CAN 协议以离开总线关闭状态并进入错误激活状态。" + +#: ../../library/pyb.CAN.rst:130 +msgid "Return the state of the controller. The return value can be one of:" +msgstr "返回控制器的状态。返回值可以是以下之一:" + +#: ../../library/pyb.CAN.rst:132 +msgid "``CAN.STOPPED`` -- the controller is completely off and reset;" +msgstr "``CAN.STOPPED`` -- 控制器完全关闭并重置;" + +#: ../../library/pyb.CAN.rst:133 +msgid "" +"``CAN.ERROR_ACTIVE`` -- the controller is on and in the Error Active " +"state (both TEC and REC are less than 96);" +msgstr "``CAN.ERROR_ACTIVE`` -- 控制器开启且处于错误激活状态(TEC和REC都小于96);" + +#: ../../library/pyb.CAN.rst:135 +msgid "" +"``CAN.ERROR_WARNING`` -- the controller is on and in the Error Warning " +"state (at least one of TEC or REC is 96 or greater);" +msgstr "``CAN.ERROR_WARNING`` -- 控制器开启且处于错误警告状态(TEC或REC至少为96);" + +#: ../../library/pyb.CAN.rst:137 +msgid "" +"``CAN.ERROR_PASSIVE`` -- the controller is on and in the Error Passive " +"state (at least one of TEC or REC is 128 or greater);" +msgstr "``CAN.ERROR_PASSIVE`` -- 控制器开启且处于错误被动状态(TEC或REC至少为128);" + +#: ../../library/pyb.CAN.rst:139 +msgid "" +"``CAN.BUS_OFF`` -- the controller is on but not participating in bus " +"activity (TEC overflowed beyond 255)." +msgstr "``CAN.BUS_OFF`` -- 控制器开启但不参与总线活动(TEC溢出超过255)。" + +#: ../../library/pyb.CAN.rst:144 +msgid "" +"Get information about the controller's error states and TX and RX " +"buffers. If *list* is provided then it should be a list object with at " +"least 8 entries, which will be filled in with the information. Otherwise" +" a new list will be created and filled in. In both cases the return " +"value of the method is the populated list." +msgstr "" +"获取有关控制器的错误状态以及 TX 和 RX 缓冲区的信息。如果提供了 *list*,则应该是一个至少有 8 " +"个条目的列表对象,将用信息填充其中。否则将创建一个新列表并填充其中。在两种情况下,方法的返回值是填充的列表。" + +#: ../../library/pyb.CAN.rst:150 +msgid "The values in the list are:" +msgstr "列表中的值为:" + +#: ../../library/pyb.CAN.rst:152 +msgid "TEC value" +msgstr "TEC值" + +#: ../../library/pyb.CAN.rst:153 +msgid "REC value" +msgstr "REC值" + +#: ../../library/pyb.CAN.rst:154 +msgid "" +"number of times the controller enterted the Error Warning state (wrapped " +"around to 0 after 65535)" +msgstr "控制器进入错误警告状态的次数(在达到65535后环绕为0)" + +#: ../../library/pyb.CAN.rst:156 +msgid "" +"number of times the controller enterted the Error Passive state (wrapped " +"around to 0 after 65535)" +msgstr "控制器进入错误被动状态的次数(在达到65535后环绕为0)" + +#: ../../library/pyb.CAN.rst:158 +msgid "" +"number of times the controller enterted the Bus Off state (wrapped around" +" to 0 after 65535)" +msgstr "控制器进入总线关闭状态的次数(在达到65535后环绕为0)" + +#: ../../library/pyb.CAN.rst:160 +msgid "number of pending TX messages" +msgstr "待处理的TX消息数" + +#: ../../library/pyb.CAN.rst:161 +msgid "number of pending RX messages on fifo 0" +msgstr "FIFO 0 上待处理的 RX 消息数" + +#: ../../library/pyb.CAN.rst:162 +msgid "number of pending RX messages on fifo 1" +msgstr "FIFO 1 上待处理的 RX 消息数" + +#: ../../library/pyb.CAN.rst:166 +msgid "Configure a filter bank:" +msgstr "配置一个过滤器组:" + +#: ../../library/pyb.CAN.rst:168 +msgid "" +"*bank* is the classic CAN controller filter bank, or CAN FD filter index," +" to configure." +msgstr "*bank* 是要配置的经典 CAN 控制器过滤器组或 CAN FD 过滤器索引。" + +#: ../../library/pyb.CAN.rst:169 +msgid "*mode* is the mode the filter should operate in, see the tables below." +msgstr "*mode* 是过滤器应该操作的模式,请参阅下表。" + +#: ../../library/pyb.CAN.rst:170 +msgid "" +"*fifo* is which fifo (0 or 1) a message should be stored in, if it is " +"accepted by this filter." +msgstr "*fifo* 是应将消息存储在其中的 FIFO(0 或 1),如果它被此过滤器接受。" + +#: ../../library/pyb.CAN.rst:171 +msgid "" +"*params* is an array of values the defines the filter. The contents of " +"the array depends on the *mode* argument." +msgstr "*params* 是定义过滤器的值数组。数组的内容取决于 *mode* 参数。" + +#: ../../library/pyb.CAN.rst:174 ../../library/pyb.CAN.rst:190 +#: ../../library/pyb.CAN.rst:205 +msgid "*mode*" +msgstr "*mode*" + +#: ../../library/pyb.CAN.rst:174 +msgid "Contents of *params* array for classic CAN controller" +msgstr "经典 CAN 控制器所使用的 *params* 数组内容" + +#: ../../library/pyb.CAN.rst:176 ../../library/pyb.CAN.rst:207 +msgid "CAN.LIST16" +msgstr "CAN.LIST16" + +#: ../../library/pyb.CAN.rst:176 +msgid "Four 16 bit ids that will be accepted" +msgstr "将被接受的四个16位ID" + +#: ../../library/pyb.CAN.rst:178 ../../library/pyb.CAN.rst:209 +msgid "CAN.LIST32" +msgstr "CAN.LIST32" + +#: ../../library/pyb.CAN.rst:178 +msgid "Two 32 bit ids that will be accepted" +msgstr "将被接受的两个32位ID" + +#: ../../library/pyb.CAN.rst:180 ../../library/pyb.CAN.rst:211 +msgid "CAN.MASK16" +msgstr "CAN.MASK16" + +#: ../../library/pyb.CAN.rst:180 +msgid "Two 16 bit id/mask pairs. E.g. (1, 3, 4, 4)" +msgstr "两个 16 位 ID/掩码对。例如 (1, 3, 4, 4)" + +#: ../../library/pyb.CAN.rst:181 +msgid "The first pair, 1 and 3 will accept all ids" +msgstr "第一对,1 和 3,将接受所有 ID" + +#: ../../library/pyb.CAN.rst:182 +msgid "that have bit 0 = 1 and bit 1 = 0." +msgstr "其中位 0 = 1 且位 1 = 0。" + +#: ../../library/pyb.CAN.rst:183 +msgid "The second pair, 4 and 4, will accept all ids" +msgstr "第二对,4 和 4,将接受所有 ID" + +#: ../../library/pyb.CAN.rst:184 +msgid "that have bit 2 = 1." +msgstr "其中位 2 = 1。" + +#: ../../library/pyb.CAN.rst:186 ../../library/pyb.CAN.rst:213 +msgid "CAN.MASK32" +msgstr "CAN.MASK32" + +#: ../../library/pyb.CAN.rst:186 +msgid "As with CAN.MASK16 but with only one 32 bit id/mask pair." +msgstr "与 CAN.MASK16 相同,但只有一个 32 位 ID/掩码对。" + +#: ../../library/pyb.CAN.rst:190 +msgid "Contents of *params* array for CAN FD controller" +msgstr "CAN FD 控制器所使用的 *params* 数组内容" + +#: ../../library/pyb.CAN.rst:192 +msgid "CAN.RANGE" +msgstr "CAN.RANGE" + +#: ../../library/pyb.CAN.rst:192 +msgid "Two ids that represent a range of accepted ids." +msgstr "代表接受的 ID 范围的两个 ID。" + +#: ../../library/pyb.CAN.rst:194 +msgid "CAN.DUAL" +msgstr "CAN.DUAL" + +#: ../../library/pyb.CAN.rst:194 +msgid "Two ids that will be accepted. For example (1, 2)" +msgstr "将被接受的两个 ID。例如 (1, 2)" + +#: ../../library/pyb.CAN.rst:196 +msgid "CAN.MASK" +msgstr "CAN.MASK" + +#: ../../library/pyb.CAN.rst:196 +msgid "One filter ID and a mask. For example (0x111, 0x7FF)" +msgstr "一个过滤器 ID 和掩码。例如 (0x111, 0x7FF)" + +#: ../../library/pyb.CAN.rst:199 +msgid "" +"*rtr* For classic CAN controllers, this is an array of booleans that " +"states if a filter should accept a remote transmission request message. " +"If this argument is not given then it defaults to ``False`` for all " +"entries. The length of the array depends on the *mode* argument. For CAN " +"FD, this argument is ignored." +msgstr "" +"*rtr* 对于经典 CAN 控制器,这是一个布尔值数组,指示过滤器是否应接受远程传输请求消息。如果未给出此参数,则对所有条目默认为 " +"``False``。数组的长度取决于 *mode* 参数。对于 CAN FD,将忽略此参数。" + +#: ../../library/pyb.CAN.rst:205 +msgid "length of *rtr* array" +msgstr "*rtr* 数组的长度" + +#: ../../library/pyb.CAN.rst:207 +msgid "4" +msgstr "4" + +#: ../../library/pyb.CAN.rst:209 ../../library/pyb.CAN.rst:211 +#: ../../library/pyb.CAN.rst:310 +msgid "2" +msgstr "2" + +#: ../../library/pyb.CAN.rst:213 ../../library/pyb.CAN.rst:308 +msgid "1" +msgstr "1" + +#: ../../library/pyb.CAN.rst:216 +msgid "" +"*extframe* If True the frame will have an extended identifier (29 bits), " +"otherwise a standard identifier (11 bits) is used." +msgstr "*extframe* 如果为 True,则帧将具有扩展标识符(29 位),否则将使用标准标识符(11 位)。" + +#: ../../library/pyb.CAN.rst:222 +msgid "Clear and disables a filter bank:" +msgstr "清除并禁用一个过滤器组:" + +#: ../../library/pyb.CAN.rst:224 +msgid "" +"*bank* is the classic CAN controller filter bank, or CAN FD filter index," +" to clear." +msgstr "*bank* 是要清除的经典 CAN 控制器过滤器组或 CAN FD 过滤器索引。" + +#: ../../library/pyb.CAN.rst:225 +msgid "" +"*extframe* For CAN FD controllers, if True, clear an extended filter " +"(configured with extframe=True), otherwise the clear a standard " +"identifier (configured with extframe=False)." +msgstr "" +"*extframe* 对于 CAN FD 控制器,如果为 True,则清除扩展过滤器(配置为 " +"extframe=True),否则清除标准标识符(配置为 extframe=False)。" + +#: ../../library/pyb.CAN.rst:230 +msgid "Return ``True`` if any message waiting on the FIFO, else ``False``." +msgstr "如果 FIFO 上有任何消息等待,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/pyb.CAN.rst:234 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/pyb.CAN.rst:236 +msgid "*fifo* is an integer, which is the FIFO to receive on" +msgstr "*fifo* 是一个整数,表示接收数据的 FIFO" + +#: ../../library/pyb.CAN.rst:237 +msgid "*list* is an optional list object to be used as the return value" +msgstr "*list* 是一个可选的列表对象,用作返回值" + +#: ../../library/pyb.CAN.rst:238 +msgid "*timeout* is the timeout in milliseconds to wait for the receive." +msgstr "*timeout* 是等待接收的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.CAN.rst:240 +msgid "Return value: A tuple containing five values." +msgstr "返回值:包含五个值的元组。" + +#: ../../library/pyb.CAN.rst:242 +msgid "The id of the message." +msgstr "消息的 ID。" + +#: ../../library/pyb.CAN.rst:243 +msgid "A boolean that indicates if the message ID is standard or extended." +msgstr "一个布尔值,指示消息 ID 是否为标准或扩展。" + +#: ../../library/pyb.CAN.rst:244 +msgid "A boolean that indicates if the message is an RTR message." +msgstr "一个布尔值,指示消息是否为 RTR 消息。" + +#: ../../library/pyb.CAN.rst:245 +msgid "The FMI (Filter Match Index) value." +msgstr "FMI(过滤器匹配索引)值。" + +#: ../../library/pyb.CAN.rst:246 +msgid "An array containing the data." +msgstr "包含数据的数组。" + +#: ../../library/pyb.CAN.rst:248 +msgid "" +"If *list* is ``None`` then a new tuple will be allocated, as well as a " +"new bytes object to contain the data (as the fifth element in the tuple)." +msgstr "如果 *list* 是 ``None``,则将分配一个新的元组,以及一个新的字节对象来包含数据(作为元组的第五个元素)。" + +#: ../../library/pyb.CAN.rst:251 +msgid "" +"If *list* is not ``None`` then it should be a list object with a least " +"five elements. The fifth element should be a memoryview object which is " +"created from either a bytearray or an array of type 'B' or 'b', and this " +"array must have enough room for at least 8 bytes. The list object will " +"then be populated with the first four return values above, and the " +"memoryview object will be resized inplace to the size of the data and " +"filled in with that data. The same list and memoryview objects can be " +"reused in subsequent calls to this method, providing a way of receiving " +"data without using the heap. For example::" +msgstr "" +"如果 *list* 不是 ``None``,则它应该是一个列表对象,至少有五个元素。第五个元素应该是从 bytearray 或类型为 'B' 或 " +"'b' 的数组创建的 memoryview 对象,此数组必须至少有 8 个字节的空间。然后列表对象将用上述前四个返回值填充,并且 " +"memoryview 对象将被就地调整为数据的大小,并用该数据填充。可以在后续调用此方法时重用相同的列表和 memoryview " +"对象,从而提供了一种在不使用堆内存的情况下接收数据的方式。例如::" + +#: ../../library/pyb.CAN.rst:268 +msgid "Send a message on the bus:" +msgstr "在总线上发送消息:" + +#: ../../library/pyb.CAN.rst:270 +msgid "*data* is the data to send (an integer to send, or a buffer object)." +msgstr "*data* 是要发送的数据(要发送的整数或缓冲区对象)。" + +#: ../../library/pyb.CAN.rst:271 +msgid "*id* is the id of the message to be sent." +msgstr "*id* 是要发送的消息的 ID。" + +#: ../../library/pyb.CAN.rst:272 +msgid "*timeout* is the timeout in milliseconds to wait for the send." +msgstr "*timeout* 是等待发送的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.CAN.rst:273 +msgid "" +"*rtr* is a boolean that specifies if the message shall be sent as a " +"remote transmission request. If *rtr* is True then only the length of " +"*data* is used to fill in the DLC slot of the frame; the actual bytes in " +"*data* are unused." +msgstr "" +"*rtr* 是一个布尔值,指定消息是否应作为远程传输请求发送。如果 *rtr* 为 True,则只使用 *data* 的长度填充帧的 DLC " +"槽;*data* 中的实际字节不使用。" + +#: ../../library/pyb.CAN.rst:277 +msgid "" +"*extframe* if True the frame will have an extended identifier (29 bits), " +"otherwise a standard identifier (11 bits) is used." +msgstr "*extframe* 如果为 True,则帧将具有扩展标识符(29 位),否则将使用标准标识符(11 位)。" + +#: ../../library/pyb.CAN.rst:279 +msgid "" +"*fdf* for CAN FD controllers, if set to True, the frame will have an FD " +"frame format, which supports data payloads up to 64 bytes." +msgstr "*fdf* 对于 CAN FD 控制器,如果设置为 True,则帧将具有 FD 帧格式,支持最多 64 字节的数据负载。" + +#: ../../library/pyb.CAN.rst:281 +msgid "" +"*brs* for CAN FD controllers, if set to True, the bitrate switching mode " +"is enabled, in which the data phase is transmitted at a different " +"bitrate. See :meth:`CAN.init` for the data bit timing configuration " +"parameters." +msgstr "" +"*brs* 对于 CAN FD 控制器,如果设置为 True,则启用比特率切换模式,其中数据阶段以不同的比特率传输。有关数据位时序配置参数,请参阅" +" :meth:`CAN.init`。" + +#: ../../library/pyb.CAN.rst:285 +msgid "" +"If timeout is 0 the message is placed in a buffer in one of three " +"hardware buffers and the method returns immediately. If all three buffers" +" are in use an exception is thrown. If timeout is not 0, the method waits" +" until the message is transmitted. If the message can't be transmitted " +"within the specified time an exception is thrown." +msgstr "" +"如果超时为 0,则消息将放置在三个硬件缓冲区中的一个中,并立即返回该方法。如果三个缓冲区都在使用中,则会抛出异常。如果超时不为 " +"0,则方法将等待消息发送。如果消息无法在指定时间内发送,则会抛出异常。" + +#: ../../library/pyb.CAN.rst:291 +msgid "Return value: ``None``." +msgstr "返回值:``None``。" + +#: ../../library/pyb.CAN.rst:295 +msgid "" +"Register a function to be called when a message is accepted into a empty " +"fifo:" +msgstr "注册一个函数,在将消息接受到空的 fifo 时调用:" + +#: ../../library/pyb.CAN.rst:297 +msgid "*fifo* is the receiving fifo." +msgstr "*fifo* 是接收 fifo。" + +#: ../../library/pyb.CAN.rst:298 +msgid "*fun* is the function to be called when the fifo becomes non empty." +msgstr "*fun* 是 fifo 变为非空时要调用的函数。" + +#: ../../library/pyb.CAN.rst:300 +msgid "" +"The callback function takes two arguments the first is the can object it " +"self the second is a integer that indicates the reason for the callback." +msgstr "回调函数接受两个参数,第一个是 CAN 对象本身,第二个是表示回调原因的整数。" + +#: ../../library/pyb.CAN.rst:304 +msgid "Reason" +msgstr "原因" + +#: ../../library/pyb.CAN.rst:306 +msgid "0" +msgstr "0" + +#: ../../library/pyb.CAN.rst:306 +msgid "A message has been accepted into a empty FIFO." +msgstr "消息已被接受到空的FIFO中。" + +#: ../../library/pyb.CAN.rst:308 +msgid "The FIFO is full" +msgstr "FIFO已满" + +#: ../../library/pyb.CAN.rst:310 +msgid "A message has been lost due to a full FIFO" +msgstr "由于FIFO已满,消息已丢失" + +#: ../../library/pyb.CAN.rst:313 +msgid "Example use of rxcallback::" +msgstr "rxcallback的示例用法::" + +#: ../../library/pyb.CAN.rst:328 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.CAN.rst:335 +msgid "The mode of the CAN bus used in :meth:`~CAN.init()`." +msgstr "在 :meth:`~CAN.init()` 中使用的 CAN 总线模式。" + +#: ../../library/pyb.CAN.rst:343 +msgid "Possible states of the CAN controller returned from :meth:`~CAN.state()`." +msgstr "从 :meth:`~CAN.state()` 返回CAN控制器的可能状态。" + +#: ../../library/pyb.CAN.rst:350 +msgid "" +"The operation mode of a filter used in :meth:`~CAN.setfilter()` for " +"classic CAN." +msgstr "在 :meth:`~CAN.setfilter()` 中用于经典 CAN的过滤器的操作模式。" + +#: ../../library/pyb.CAN.rst:356 +msgid "" +"The operation mode of a filter used in :meth:`~CAN.setfilter()` for CAN " +"FD." +msgstr "用于在 :meth:`~CAN.setfilter()` 中的 CAN FD 过滤器的操作模式。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.DAC.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.DAC.po new file mode 100644 index 0000000000000..6815d1a47e5f5 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.DAC.po @@ -0,0 +1,181 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-24 16:38+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.DAC.rst:5 +msgid "class DAC -- digital to analog conversion" +msgstr "class DAC -- 数字模拟转换" + +#: ../../library/pyb.DAC.rst:7 +msgid "" +"The DAC is used to output analog values (a specific voltage) on pin X5 or" +" pin X6. The voltage will be between 0 and 3.3V." +msgstr "DAC用于在引脚 X5 或引脚 X6 上输出模拟值(特定电压)。输出的电压范围在 0 到 3.3V 之间。" + +#: ../../library/pyb.DAC.rst:10 +msgid "*This module will undergo changes to the API.*" +msgstr "*此模块将对 API 进行更改。*" + +#: ../../library/pyb.DAC.rst:12 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/pyb.DAC.rst:22 +msgid "To output a continuous sine-wave::" +msgstr "输出连续正弦波的示例::" + +#: ../../library/pyb.DAC.rst:36 +msgid "To output a continuous sine-wave at 12-bit resolution::" +msgstr "以12位分辨率输出连续正弦波的示例::" + +#: ../../library/pyb.DAC.rst:50 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.DAC.rst:54 +msgid "Construct a new DAC object." +msgstr "构建一个新的DAC对象。" + +#: ../../library/pyb.DAC.rst:56 +msgid "" +"``port`` can be a pin object, or an integer (1 or 2). DAC(1) is on pin X5" +" and DAC(2) is on pin X6." +msgstr "``port`` 可以是一个引脚对象,也可以是一个整数(1或2)。DAC(1)对应引脚 X5,DAC(2)对应引脚 X6。" + +#: ../../library/pyb.DAC.rst:59 +msgid "" +"``bits`` is an integer specifying the resolution, and can be 8 or 12. The" +" maximum value for the write and write_timed methods will be " +"2\\*\\*``bits``-1." +msgstr "" +"``bits`` 是一个指定分辨率的整数,可以是 8 或 12。write 和 write_timed 方法的最大值将是 " +"2\\*\\*``bits``-1。" + +#: ../../library/pyb.DAC.rst:63 +msgid "" +"The *buffering* parameter selects the behaviour of the DAC op-amp output " +"buffer, whose purpose is to reduce the output impedance. It can be " +"``None`` to select the default (buffering enabled for :meth:`DAC.noise`, " +":meth:`DAC.triangle` and :meth:`DAC.write_timed`, and disabled for " +":meth:`DAC.write`), ``False`` to disable buffering completely, or " +"``True`` to enable output buffering." +msgstr "" +"*buffering* 参数选择 DAC 运算放大器输出缓冲区的行为,其目的是减少输出阻抗。" +"它可以是 ``None``,以选择默认值(对于 :meth:`DAC.noise`、:meth:`DAC.triangle`" +" 和 :meth:`DAC.write_timed` 启用缓冲,对于 :meth:`DAC.write` 禁用缓冲)," +"也可以是 ``False``,以完全禁用缓冲,或者是 ``True``,以启用输出缓冲。" + +#: ../../library/pyb.DAC.rst:70 +msgid "" +"When buffering is enabled the DAC pin can drive loads down to 5KΩ. " +"Otherwise it has an output impedance of 15KΩ maximum: consequently to " +"achieve a 1% accuracy without buffering requires the applied load to be " +"less than 1.5MΩ. Using the buffer incurs a penalty in accuracy, " +"especially near the extremes of range." +msgstr "" +"当启用缓冲时,DAC 引脚可以驱动负载,最低为 5KΩ。否则,它的输出阻抗最大为 15KΩ:因此,为了在没有缓冲的情况下获得 1% " +"的精度,应用负载的要求是小于 1.5MΩ。 使用缓冲会降低精度,特别是在范围的极端处。" + +#: ../../library/pyb.DAC.rst:77 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.DAC.rst:81 +msgid "" +"Reinitialise the DAC. *bits* can be 8 or 12. *buffering* can be " +"``None``, ``False`` or ``True``; see above constructor for the meaning of" +" this parameter." +msgstr "" +"重新初始化 DAC。*bits* 可以是 8 或 12。*buffering* 可以是 ``None``、``False`` 或 " +"``True``;有关此参数的含义,请参阅上述构造函数。" + +#: ../../library/pyb.DAC.rst:87 +msgid "De-initialise the DAC making its pin available for other uses." +msgstr "反初始化 DAC,使其引脚可供其他用途使用。" + +#: ../../library/pyb.DAC.rst:91 +msgid "" +"Generate a pseudo-random noise signal. A new random sample is written to" +" the DAC output at the given frequency." +msgstr "生成一个伪随机噪声信号。以给定频率向 DAC 输出写入一个新的随机样本。" + +#: ../../library/pyb.DAC.rst:96 +msgid "" +"Generate a triangle wave. The value on the DAC output changes at the " +"given frequency and ramps through the full 12-bit range (up and down). " +"Therefore the frequency of the repeating triangle wave itself is 8192 " +"times smaller." +msgstr "" +"生成一个三角波。DAC 输出的值以给定频率变化,并通过完整的 12 位范围(上升和下降)进行斜坡变化。因此,重复的三角波的频率自身要小 8192 " +"倍。" + +#: ../../library/pyb.DAC.rst:102 +msgid "" +"Direct access to the DAC output. The minimum value is 0. The maximum " +"value is 2\\*\\*``bits``-1, where ``bits`` is set when creating the DAC " +"object or by using the ``init`` method." +msgstr "" +"直接访问 DAC 输出。最小值为 0。最大值为 2\\*\\*``bits``-1,其中 ``bits`` 是在创建 DAC " +"对象时设置的,或者通过使用 ``init`` 方法设置的。" + +#: ../../library/pyb.DAC.rst:108 +msgid "" +"Initiates a burst of RAM to DAC using a DMA transfer. The input data is " +"treated as an array of bytes in 8-bit mode, and an array of unsigned " +"half-words (array typecode 'H') in 12-bit mode." +msgstr "" +"使用 DMA 启动 RAM 到 DAC 的快速传输。输入数据在 8 位模式下被视为字节数组,在 12 位模式下被视为无符号半字数组(数组类型代码为" +" 'H')。" + +#: ../../library/pyb.DAC.rst:112 +msgid "" +"``freq`` can be an integer specifying the frequency to write the DAC " +"samples at, using Timer(6). Or it can be an already-initialised Timer " +"object which is used to trigger the DAC sample. Valid timers are 2, 4, " +"5, 6, 7 and 8." +msgstr "" +"``freq`` 可以是一个整数,指定以 Timer(6) 写入 DAC 样本的频率。或者它可以是已经初始化的 Timer 对象,用于触发 DAC" +" 样本。有效的定时器有 2、4、5、6、7 和 8。" + +#: ../../library/pyb.DAC.rst:117 +msgid "``mode`` can be ``DAC.NORMAL`` or ``DAC.CIRCULAR``." +msgstr "``mode`` 可以是 ``DAC.NORMAL`` 或 ``DAC.CIRCULAR``。" + +#: ../../library/pyb.DAC.rst:119 +msgid "Example using both DACs at the same time::" +msgstr "同时使用两个 DAC 的示例::" + +#: ../../library/pyb.DAC.rst:127 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.DAC.rst:131 +msgid "NORMAL mode does a single transmission of the waveform in the data buffer," +msgstr "NORMAL 模式对数据缓冲区中的波形进行单次传输," + +#: ../../library/pyb.DAC.rst:135 +msgid "" +"CIRCULAR mode does a transmission of the waveform in the data buffer, and" +" wraps around to the start of the data buffer every time it reaches the " +"end of the table." +msgstr "CIRCULAR 模式对数据缓冲区中的波形进行传输,并在达到表格末尾时重新回到表格的开头。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ExtInt.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ExtInt.po new file mode 100644 index 0000000000000..732036aa8518a --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.ExtInt.po @@ -0,0 +1,193 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.ExtInt.rst:5 +msgid "class ExtInt -- configure I/O pins to interrupt on external events" +msgstr "class ExtInt -- 配置 I/O 引脚以在外部事件上触发中断" + +#: ../../library/pyb.ExtInt.rst:7 +msgid "" +"There are a total of 22 interrupt lines. 16 of these can come from GPIO " +"pins and the remaining 6 are from internal sources." +msgstr "总共有22条中断线路。其中16条可以来自 GPIO引脚,剩下6条来自内部源。" + +#: ../../library/pyb.ExtInt.rst:10 +msgid "" +"For lines 0 through 15, a given line can map to the corresponding line " +"from an arbitrary port. So line 0 can map to Px0 where x is A, B, C, ... " +"and line 1 can map to Px1 where x is A, B, C, ... ::" +msgstr "" +"对于 0 到 15 号线,给定的线路可以映射到任意端口的相应线路。因此,线路 0 " +"可以映射到 Px0,其中 x 是 A、B、C,...,而线路 1 可以映射到 Px1,其中 x 是 " +"A、B、C,... ::" + +#: ../../library/pyb.ExtInt.rst:17 +msgid "Note: ExtInt will automatically configure the gpio line as an input. ::" +msgstr "注意:ExtInt 将自动将 gpio 引线配置为输入。::" + +#: ../../library/pyb.ExtInt.rst:21 +msgid "" +"Now every time a falling edge is seen on the pin, the callback will be " +"called. Caution: mechanical pushbuttons have \"bounce\" and pushing or " +"releasing a switch will often generate multiple edges. See: " +"http://www.eng.utah.edu/~cs5780/debouncing.pdf for a detailed " +"explanation, along with various techniques for debouncing." +msgstr "" +"现在,每当在引脚上看到下降沿时,将调用回调函数。注意:机械按键存在“抖动”,按" +"下或释放开关通常会生成多个边缘。参见:http://www.eng.utah.edu/~cs5780/" +"debouncing.pdf,其中详细说明了去抖动的各种技术。" + +#: ../../library/pyb.ExtInt.rst:27 +msgid "Trying to register 2 callbacks onto the same pin will throw an exception." +msgstr "尝试在用一个引脚上注册2个回调将引发异常。" + +#: ../../library/pyb.ExtInt.rst:29 +msgid "" +"If pin is passed as an integer, then it is assumed to map to one of the " +"internal interrupt sources, and must be in the range 16 through 22." +msgstr "如果将引脚传递为整数,则假定它映射到内部中断源之一,并且必须在16到22范围内。" + +#: ../../library/pyb.ExtInt.rst:32 +msgid "" +"All other pin objects go through the pin mapper to come up with one of " +"the gpio pins. ::" +msgstr "所以其他引脚对象都通过引脚映射器来获取其中一个GPIO引脚。::" + +#: ../../library/pyb.ExtInt.rst:37 +msgid "" +"Valid modes are pyb.ExtInt.IRQ_RISING, pyb.ExtInt.IRQ_FALLING, " +"pyb.ExtInt.IRQ_RISING_FALLING, pyb.ExtInt.EVT_RISING, " +"pyb.ExtInt.EVT_FALLING, and pyb.ExtInt.EVT_RISING_FALLING." +msgstr "" +"有效的模式为 pyb.ExtInt.IRQ_RISING、pyb.ExtInt.IRQ_FALLING、pyb.ExtInt." +"IRQ_RISING_FALLING、pyb.ExtInt.EVT_RISING、pyb.ExtInt.EVT_FALLING 和 pyb." +"ExtInt.EVT_RISING_FALLING。" + +#: ../../library/pyb.ExtInt.rst:41 +msgid "" +"Only the IRQ_xxx modes have been tested. The EVT_xxx modes have something" +" to do with sleep mode and the WFE instruction." +msgstr "只测试了 IRQ_xxx 模式。EVT_xxx 模式与睡眠模式和 WFE 指令有关。" + +#: ../../library/pyb.ExtInt.rst:44 +msgid "" +"Valid pull values are pyb.Pin.PULL_UP, pyb.Pin.PULL_DOWN, " +"pyb.Pin.PULL_NONE." +msgstr "有效的拉电阻值为 pyb.Pin.PULL_UP、pyb.Pin.PULL_DOWN、pyb.Pin.PULL_NONE。" + +#: ../../library/pyb.ExtInt.rst:46 +msgid "" +"There is also a C API, so that drivers which require EXTI interrupt lines" +" can also use this code. See extint.h for the available functions and " +"usrsw.h for an example of using this." +msgstr "" +"还有一个 C API,因此需要 EXTI 中断线路的驱动程序也可以使用此代码。请参阅 " +"extint.h 以获取可用函数和 usrsw.h 以获取使用示例。" + +#: ../../library/pyb.ExtInt.rst:52 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.ExtInt.rst:56 +msgid "Create an ExtInt object:" +msgstr "创建一个 ExtInt 对象:" + +#: ../../library/pyb.ExtInt.rst:58 +msgid "" +"``pin`` is the pin on which to enable the interrupt (can be a pin object " +"or any valid pin name)." +msgstr "``pin`` 是要启用中断的引脚(可以是引脚对象或任何有效的引脚名称)。" + +#: ../../library/pyb.ExtInt.rst:59 +msgid "" +"``mode`` can be one of: - ``ExtInt.IRQ_RISING`` - trigger on a rising " +"edge; - ``ExtInt.IRQ_FALLING`` - trigger on a falling edge; - " +"``ExtInt.IRQ_RISING_FALLING`` - trigger on a rising or falling edge." +msgstr "" +"``mode`` 可以是以下之一:- ``ExtInt.IRQ_RISING`` - 在上升沿触发;- ``ExtInt." +"IRQ_FALLING`` - 在下降沿触发;- ``ExtInt.IRQ_RISING_FALLING`` - " +"在上升沿或下降沿触发。" + +#: ../../library/pyb.ExtInt.rst:63 +msgid "" +"``pull`` can be one of: - ``pyb.Pin.PULL_NONE`` - no pull up or down " +"resistors; - ``pyb.Pin.PULL_UP`` - enable the pull-up resistor; - " +"``pyb.Pin.PULL_DOWN`` - enable the pull-down resistor." +msgstr "" +"``pull`` 可以是以下之一:- ``pyb.Pin.PULL_NONE`` - 无拉电阻;- ``pyb.Pin." +"PULL_UP`` - 启用上拉电阻;- ``pyb.Pin.PULL_DOWN`` - 启用下拉电阻。" + +#: ../../library/pyb.ExtInt.rst:67 +msgid "" +"``callback`` is the function to call when the interrupt triggers. The " +"callback function must accept exactly 1 argument, which is the line that " +"triggered the interrupt." +msgstr "``callback`` 是触发中断时要调用的函数。回调函数必须接受恰好 1 " +"个参数,即触发中断的线路。" + +#: ../../library/pyb.ExtInt.rst:73 +msgid "Class methods" +msgstr "类方法" + +#: ../../library/pyb.ExtInt.rst:77 +msgid "Dump the values of the EXTI registers." +msgstr "转储 EXTI 寄存器的值。" + +#: ../../library/pyb.ExtInt.rst:81 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.ExtInt.rst:85 +msgid "" +"Disable the interrupt associated with the ExtInt object. This could be " +"useful for debouncing." +msgstr "禁用与 ExtInt 对象关联的中断。这对去抖动可能很有用。" + +#: ../../library/pyb.ExtInt.rst:90 +msgid "Enable a disabled interrupt." +msgstr "启用已禁用的中断。" + +#: ../../library/pyb.ExtInt.rst:94 +msgid "Return the line number that the pin is mapped to." +msgstr "返回引脚映射到的线路号。" + +#: ../../library/pyb.ExtInt.rst:98 +msgid "Trigger the callback from software." +msgstr "通过软件触发回调。" + +#: ../../library/pyb.ExtInt.rst:102 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.ExtInt.rst:106 +msgid "interrupt on a falling edge" +msgstr "下降沿中断" + +#: ../../library/pyb.ExtInt.rst:110 +msgid "interrupt on a rising edge" +msgstr "上升沿中断" + +#: ../../library/pyb.ExtInt.rst:114 +msgid "interrupt on a rising or falling edge" +msgstr "上升沿和下降沿中断" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Flash.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Flash.po new file mode 100644 index 0000000000000..223cd83d0daa7 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Flash.po @@ -0,0 +1,105 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.Flash.rst:5 +msgid "class Flash -- access to built-in flash storage" +msgstr "class Flash -- 访问内置闪存存储" + +#: ../../library/pyb.Flash.rst:7 +msgid "" +"The Flash class allows direct access to the primary flash device on the " +"pyboard." +msgstr "Flash 类允许直接访问 pyboard 上的主闪存设备。" + +#: ../../library/pyb.Flash.rst:9 +msgid "" +"In most cases, to store persistent data on the device, you'll want to use" +" a higher-level abstraction, for example the filesystem via Python's " +"standard file API, but this interface is useful to :ref:`customise the " +"filesystem configuration ` or implement a low-level storage " +"system for your application." +msgstr "" +"在大多数情况下,要在设备上存储持久数据,您将希望使用更高级的抽象概念,例如通过 Python 的标准文件 API 访问文件系统,但这个接口对于 " +":ref:`customise the filesystem configuration ` " +"或为您的应用程序实现低级存储系统都很有用。" + +#: ../../library/pyb.Flash.rst:16 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.Flash.rst:20 +msgid "" +"Create and return a block device that represents the flash device " +"presented to the USB mass storage interface." +msgstr "创建并返回表示向 USB 大容量存储接口呈现的闪存设备的块设备。" + +#: ../../library/pyb.Flash.rst:23 +msgid "" +"It includes a virtual partition table at the start, and the actual flash " +"starts at block ``0x100``." +msgstr "它在开始处包括一个虚拟分区表,并且实际闪存从块 ``0x100`` 开始。" + +#: ../../library/pyb.Flash.rst:26 +msgid "" +"This constructor is deprecated and will be removed in a future version of" +" MicroPython." +msgstr "此构造函数已弃用,并将在将来的 MicroPython 版本中删除。" + +#: ../../library/pyb.Flash.rst:31 +msgid "" +"Create and return a block device that accesses the flash at the specified" +" offset. The length defaults to the remaining size of the device." +msgstr "创建并返回一个访问指定偏移处闪存的块设备。长度默认为设备的剩余大小。" + +#: ../../library/pyb.Flash.rst:33 +msgid "" +"The *start* and *len* offsets are in bytes, and must be a multiple of the" +" block size (typically 512 for internal flash)." +msgstr "*start* 和 *len* 偏移量以字节为单位,并且必须是块大小的倍数(对于内部闪存,通常为 512)。" + +#: ../../library/pyb.Flash.rst:36 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.Flash.rst:44 +msgid "" +"These methods implement the simple and :ref:`extended ` block protocol defined by :class:`vfs.AbstractBlockDev`." +msgstr "" +"这些方法实现了由 :class:`vfs.AbstractBlockDev` 定义的简单和 :ref:`extended " +"` 块协议。" + +#: ../../library/pyb.Flash.rst:49 +msgid "Hardware Note" +msgstr "硬件注意事项" + +#: ../../library/pyb.Flash.rst:51 +msgid "" +"On boards with external spiflash (e.g. Pyboard D or the OpenMV Cam H7 " +"Plus), the MicroPython firmware will be configured to use that as the " +"primary flash storage. On all other boards, the internal flash inside the" +" :term:`MCU` will be used." +msgstr "" +"对于具有外部 spiflash(例如 Pyboard D 或 OpenMV Cam H7 Plus)的板卡,MicroPython " +"固件将配置为使用该外部 spiflash 作为主闪存存储。在所有其他板卡上,将使用 :term::term:`MCU` 内部闪存作为主闪存。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.I2C.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.I2C.po new file mode 100644 index 0000000000000..c7913343c21ac --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.I2C.po @@ -0,0 +1,260 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/pyb.I2C.rst:5 +msgid "class I2C -- a two-wire serial protocol" +msgstr "class I2C -- 一种两线串行协议" + +#: ../../library/pyb.I2C.rst:7 +msgid "" +"I2C is a two-wire protocol for communicating between devices. At the " +"physical level it consists of 2 wires: SCL and SDA, the clock and data " +"lines respectively. OpenMV Cam does not provide Pullups on the SDA or SCL" +" lines and external pullups are required on both SDA and SCL lines for " +"the I2C bus to be functional." +msgstr "" +"I2C 是一种用于设备之间通信的两线协议。在物理层面上,它由 2 条线构成:SCL 和 SDA,分别是时钟线和数据线。OpenMV " +"Cam在SDA或SCL线上不提供上拉,因此在I2C总线上,SDA和SCL线都需要外部上拉电阻才能正常工作。" + +#: ../../library/pyb.I2C.rst:12 +msgid "" +"I2C objects are created attached to a specific bus. They can be " +"initialised when created, or initialised later on." +msgstr "I2C 对象被创建并连接到特定的总线上。它们可以在创建时初始化,也可以稍后初始化。" + +#: ../../library/pyb.I2C.rst:15 +msgid "Example::" +msgstr "例子::" + +#: ../../library/pyb.I2C.rst:25 +msgid "Printing the i2c object gives you information about its configuration." +msgstr "打印 i2c 对象会给出有关其配置的信息。" + +#: ../../library/pyb.I2C.rst:27 +msgid "The basic methods are send and recv::" +msgstr "基本方法是 send 和 recv::" + +#: ../../library/pyb.I2C.rst:33 +msgid "To receive inplace, first create a bytearray::" +msgstr "要就地接收,首先创建一个 bytearray::" + +#: ../../library/pyb.I2C.rst:38 +msgid "You can specify a timeout (in ms)::" +msgstr "您可以指定超时时间(以毫秒为单位)::" + +#: ../../library/pyb.I2C.rst:42 +msgid "A controller must specify the recipient's address::" +msgstr "控制器必须指定接收者的地址::" + +#: ../../library/pyb.I2C.rst:48 +msgid "Master also has other methods::" +msgstr "主设备还有其他方法::" + +#: ../../library/pyb.I2C.rst:59 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.I2C.rst:63 +msgid "" +"Construct an I2C object on the given bus. ``bus`` can be 2 or 4. With no" +" additional parameters, the I2C object is created but not initialised (it" +" has the settings from the last initialisation of the bus, if any). If " +"extra arguments are given, the bus is initialised. See ``init`` for " +"parameters of initialisation." +msgstr "" +"在给定总线上构造一个I2C对象。``bus`` " +"可以是2或4。如果没有额外的参数,将创建但不初始化I2C对象(它具有总线上最后一次初始化的设置,如果有的话)。如果提供了额外的参数,则会初始化总线。有关初始化参数,请参阅" +" ``init``。" + +#: ../../library/pyb.I2C.rst:69 +msgid "The physical pins of the I2C busses on the OpenMV Cam are:" +msgstr "OpenMV Cam 上 I2C 总线的物理引脚是:" + +#: ../../library/pyb.I2C.rst:71 ../../library/pyb.I2C.rst:75 +msgid "``I2C(2)`` is on the Y position: ``(SCL, SDA) = (P4, P5) = (PB10, PB11)``" +msgstr "``I2C(2)`` 在Y位置: ``(SCL, SDA) = (P4, P5) = (PB10, PB11)``" + +#: ../../library/pyb.I2C.rst:73 +msgid "The physical pins of the I2C busses on the OpenMV Cam M7 are:" +msgstr "OpenMV Cam M7 上 I2C 总线的物理引脚是:" + +#: ../../library/pyb.I2C.rst:76 +msgid "``I2C(4)`` is on the Y position: ``(SCL, SDA) = (P7, P8) = (PD12, PD13)``" +msgstr "``I2C(4)`` 在Y位置: ``(SCL, SDA) = (P7, P8) = (PD12, PD13)``" + +#: ../../library/pyb.I2C.rst:79 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.I2C.rst:83 +msgid "Turn off the I2C bus." +msgstr "关闭 I2C 总线。" + +#: ../../library/pyb.I2C.rst:87 +msgid "Initialise the I2C bus with the given parameters:" +msgstr "使用给定的参数初始化 I2C 总线:" + +#: ../../library/pyb.I2C.rst:89 +msgid "``mode`` must be either ``I2C.CONTROLLER`` or ``I2C.PERIPHERAL``" +msgstr "``mode`` 必须是 ``I2C.CONTROLLER`` 或 ``I2C.PERIPHERAL``" + +#: ../../library/pyb.I2C.rst:90 +msgid "``addr`` is the 7-bit address (only sensible for a peripheral)" +msgstr "``addr`` 是 7 位地址(仅适用于外设)" + +#: ../../library/pyb.I2C.rst:91 +msgid "``baudrate`` is the SCL clock rate (only sensible for a controller)" +msgstr "``baudrate`` 是 SCL 时钟率(仅适用于控制器)" + +#: ../../library/pyb.I2C.rst:92 +msgid "``gencall`` is whether to support general call mode" +msgstr "``gencall`` 是是否支持通用调用模式" + +#: ../../library/pyb.I2C.rst:93 +msgid "" +"``dma`` is whether to allow the use of DMA for the I2C transfers (note " +"that DMA transfers have more precise timing but currently do not handle " +"bus errors properly)" +msgstr "``dma`` 是是否允许使用 DMA 进行 I2C 传输(注意,DMA 传输具有更精确的定时,但目前无法正确处理总线错误)" + +#: ../../library/pyb.I2C.rst:97 +msgid "" +"The actual clock frequency may be lower than the requested frequency. " +"This is dependent on the platform hardware. The actual rate may be " +"determined by printing the I2C object." +msgstr "实际的时钟频率可能低于请求的频率。这取决于平台硬件。可以通过打印 I2C 对象来确定实际速率。" + +#: ../../library/pyb.I2C.rst:103 +msgid "" +"Check if an I2C device responds to the given address. Only valid when in" +" controller mode." +msgstr "检查是否有 I2C 设备响应给定的地址。仅在控制器模式下有效。" + +#: ../../library/pyb.I2C.rst:107 +msgid "Read from the memory of an I2C device:" +msgstr "从 I2C 设备的存储器中读取:" + +#: ../../library/pyb.I2C.rst:109 +msgid "" +"``data`` can be an integer (number of bytes to read) or a buffer to read " +"into" +msgstr "``data`` 可以是一个整数(要读取的字节数)或要读入的缓冲区" + +#: ../../library/pyb.I2C.rst:110 ../../library/pyb.I2C.rst:123 +msgid "``addr`` is the I2C device address" +msgstr "``addr`` 是 I2C 设备地址" + +#: ../../library/pyb.I2C.rst:111 ../../library/pyb.I2C.rst:124 +msgid "``memaddr`` is the memory location within the I2C device" +msgstr "``memaddr`` 是 I2C 设备内存中的存储位置" + +#: ../../library/pyb.I2C.rst:112 +msgid "``timeout`` is the timeout in milliseconds to wait for the read" +msgstr "``timeout`` 是等待读取的超时时间(毫秒)" + +#: ../../library/pyb.I2C.rst:113 ../../library/pyb.I2C.rst:126 +msgid "``addr_size`` selects width of memaddr: 8 or 16 bits" +msgstr "``addr_size`` 选择 memaddr 的宽度:8 或 16 位" + +#: ../../library/pyb.I2C.rst:115 +msgid "Returns the read data. This is only valid in controller mode." +msgstr "返回读取的数据。仅在控制器模式下有效。" + +#: ../../library/pyb.I2C.rst:120 +msgid "Write to the memory of an I2C device:" +msgstr "向 I2C 设备的存储器中写入:" + +#: ../../library/pyb.I2C.rst:122 +msgid "``data`` can be an integer or a buffer to write from" +msgstr "``data`` 可以是一个整数或要写入的缓冲区" + +#: ../../library/pyb.I2C.rst:125 +msgid "``timeout`` is the timeout in milliseconds to wait for the write" +msgstr "``timeout`` 是等待写入的超时时间(毫秒)" + +#: ../../library/pyb.I2C.rst:128 +msgid "Returns ``None``. This is only valid in controller mode." +msgstr "返回 ``None``。仅在控制器模式下有效。" + +#: ../../library/pyb.I2C.rst:133 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/pyb.I2C.rst:135 +msgid "" +"``recv`` can be an integer, which is the number of bytes to receive, or a" +" mutable buffer, which will be filled with received bytes" +msgstr "``recv`` 可以是一个整数,表示要接收的字节数,或者是一个可变缓冲区,将填充接收到的字节" + +#: ../../library/pyb.I2C.rst:137 +msgid "``addr`` is the address to receive from (only required in controller mode)" +msgstr "``addr`` 是要接收的地址(仅在控制器模式下需要)" + +#: ../../library/pyb.I2C.rst:138 +msgid "``timeout`` is the timeout in milliseconds to wait for the receive" +msgstr "``timeout`` 是等待接收的超时时间(毫秒)" + +#: ../../library/pyb.I2C.rst:140 +msgid "" +"Return value: if ``recv`` is an integer then a new buffer of the bytes " +"received, otherwise the same buffer that was passed in to ``recv``." +msgstr "返回值:如果 ``recv`` 是整数,则返回接收到的字节的新缓冲区,否则返回传入 ``recv`` 的相同缓冲区。" + +#: ../../library/pyb.I2C.rst:145 +msgid "Send data on the bus:" +msgstr "在总线上发送数据:" + +#: ../../library/pyb.I2C.rst:147 +msgid "``send`` is the data to send (an integer to send, or a buffer object)" +msgstr "``send`` 是要发送的数据(一个要发送的整数或缓冲区对象)" + +#: ../../library/pyb.I2C.rst:148 +msgid "``addr`` is the address to send to (only required in controller mode)" +msgstr "``addr`` 是要发送到的地址(仅在控制器模式下需要)" + +#: ../../library/pyb.I2C.rst:149 +msgid "``timeout`` is the timeout in milliseconds to wait for the send" +msgstr "``timeout`` 是等待发送的超时时间(毫秒)" + +#: ../../library/pyb.I2C.rst:151 +msgid "Return value: ``None``." +msgstr "返回值:``None``。" + +#: ../../library/pyb.I2C.rst:155 +msgid "" +"Scan all I2C addresses from 0x01 to 0x7f and return a list of those that " +"respond. Only valid when in controller mode." +msgstr "扫描总线上的所有 I2C 地址,从 0x01 到 0x7f,并返回响应的地址列表。仅在控制器模式下有效。" + +#: ../../library/pyb.I2C.rst:159 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.I2C.rst:163 +msgid "for initialising the bus to controller mode" +msgstr "用于将总线初始化为控制器模式" + +#: ../../library/pyb.I2C.rst:167 +msgid "for initialising the bus to peripheral mode" +msgstr "用于将总线初始化为外设模式" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.LED.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.LED.po new file mode 100644 index 0000000000000..a0a2cd019acf9 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.LED.po @@ -0,0 +1,85 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.LED.rst:5 +msgid "class LED -- LED object" +msgstr "class LED -- LED对象" + +#: ../../library/pyb.LED.rst:7 +msgid "The LED object controls an individual LED (Light Emitting Diode)." +msgstr "LED对象控制一个单独的LED(发光二极管)。" + +#: ../../library/pyb.LED.rst:11 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.LED.rst:15 +msgid "Create an LED object associated with the given LED:" +msgstr "创建一个与指定LED相关联的LED对象:" + +#: ../../library/pyb.LED.rst:17 +msgid "``id`` is the LED number, 1-4." +msgstr "``id`` 是LED编号,范围为1-4。" + +#: ../../library/pyb.LED.rst:21 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.LED.rst:27 +msgid "" +"Get or set the LED intensity. Intensity ranges between 0 (off) and 255 " +"(full on). If no argument is given, return the LED intensity. If an " +"argument is given, set the LED intensity and return ``None``." +msgstr "" +"获取或设置LED的亮度。亮度范围从0(关闭)到255(全开)。如果没有给出参数,则返" +"回LED的亮度。如果给出了参数,则设置LED的亮度并返回 ``None``。" + +#: ../../library/pyb.LED.rst:31 +msgid "" +"*Note:* Only LED(3) and LED(4) can have a smoothly varying intensity, and" +" they use timer PWM to implement it. LED(3) uses Timer(2) and LED(4) " +"uses Timer(3). These timers are only configured for PWM if the intensity" +" of the relevant LED is set to a value between 1 and 254. Otherwise the " +"timers are free for general purpose use." +msgstr "" +"*注意:* " +"仅LED(3)和LED(4)可以具有平滑变化的亮度,并且它们使用定时器PWM来实现。LED(3) " +"使用 Timer(2) 而 LED(4) 使用 Timer(3)。只有在相关LED的亮度设置为1到254之间的" +"值时,这些定时器才会配置为PWM。否则,这些定时器可以用于通用目的。" + +#: ../../library/pyb.LED.rst:39 +msgid "Turn the LED off." +msgstr "关闭LED。" + +#: ../../library/pyb.LED.rst:43 +msgid "Turn the LED on, to maximum intensity." +msgstr "打开LED,设置为最大强度。" + +#: ../../library/pyb.LED.rst:47 +msgid "" +"Toggle the LED between on (maximum intensity) and off. If the LED is at " +"non-zero intensity then it is considered \"on\" and toggle will turn it " +"off." +msgstr "在打开(最大强度)和关闭之间切换LED。如果LED的强度为非零,则被视为“打开”,tog" +"gle将其关闭。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Pin.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Pin.po new file mode 100644 index 0000000000000..709578a5e1135 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Pin.po @@ -0,0 +1,411 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.Pin.rst:5 +msgid "class Pin -- control I/O pins" +msgstr "class Pin -- 控制I/O引脚" + +#: ../../library/pyb.Pin.rst:7 +msgid "" +"A pin is the basic object to control I/O pins. It has methods to set the" +" mode of the pin (input, output, etc) and methods to get and set the " +"digital logic level. For analog control of a pin, see the ADC class." +msgstr "" +"引脚是控制I/O引脚的基本对象。它具有设置引脚模式(输入、输出等)的方法,以及获" +"取和设置数字逻辑电平的方法。对于引脚的模拟控制,请参阅ADC类。" + +#: ../../library/pyb.Pin.rst:11 +msgid "Usage Model:" +msgstr "使用模型:" + +#: ../../library/pyb.Pin.rst:13 +msgid "All Board Pins are predefined as pyb.Pin.board.Name::" +msgstr "所有电路板引脚都预定义为 pyb.Pin.board.Name::" + +#: ../../library/pyb.Pin.rst:19 +msgid "" +"CPU pins which correspond to the board pins are available as " +"``pyb.Pin.cpu.Name``. For the CPU pins, the names are the port letter " +"followed by the pin number. On the PYBv1.0, ``pyb.Pin.board.X1`` and " +"``pyb.Pin.cpu.A0`` are the same pin." +msgstr "" +"与板载引脚对应的CPU引脚可用作 ``pyb.Pin.cpu." +"Name``。对于CPU引脚,名称是移植版本字母后跟引脚号。在PYBv1.0上,``pyb.Pin." +"board.X1`` 和 ``pyb.Pin.cpu.A0`` 是同一个引脚。" + +#: ../../library/pyb.Pin.rst:24 +msgid "You can also use strings::" +msgstr "您还可以使用字符串::" + +#: ../../library/pyb.Pin.rst:28 +msgid "Users can add their own names::" +msgstr "用户可以自己添加名称::" + +#: ../../library/pyb.Pin.rst:34 +msgid "and can query mappings::" +msgstr "并且可以查询映射::" + +#: ../../library/pyb.Pin.rst:38 +msgid "Users can also add their own mapping function::" +msgstr "用户还可以添加自己的映射函数::" + +#: ../../library/pyb.Pin.rst:46 +msgid "" +"So, if you were to call: ``pyb.Pin(\"LeftMotorDir\", pyb.Pin.OUT_PP)`` " +"then ``\"LeftMotorDir\"`` is passed directly to the mapper function." +msgstr "" +"因此,如果调用:``pyb.Pin(\"LeftMotorDir\", pyb.Pin.OUT_PP)`` ,那么 ``" +"\"LeftMotorDir\"`` 将直接传递给映射器函数。" + +#: ../../library/pyb.Pin.rst:49 +msgid "" +"To summarise, the following order determines how things get mapped into " +"an ordinal pin number:" +msgstr "总结一下,以下顺序确定如何将事物映射到序数引脚号:" + +#: ../../library/pyb.Pin.rst:52 +msgid "Directly specify a pin object" +msgstr "直接指定引脚对象" + +#: ../../library/pyb.Pin.rst:53 +msgid "User supplied mapping function" +msgstr "用户提供的映射函数" + +#: ../../library/pyb.Pin.rst:54 +msgid "User supplied mapping (object must be usable as a dictionary key)" +msgstr "用户提供的映射(对象必须可用作字典键)" + +#: ../../library/pyb.Pin.rst:55 +msgid "Supply a string which matches a board pin" +msgstr "提供与板载引脚匹配的字符串" + +#: ../../library/pyb.Pin.rst:56 +msgid "Supply a string which matches a CPU port/pin" +msgstr "提供与CPU端口/引脚匹配的字符串" + +#: ../../library/pyb.Pin.rst:58 +msgid "" +"You can set ``pyb.Pin.debug(True)`` to get some debug information about " +"how a particular object gets mapped to a pin." +msgstr "您可以设置 ``pyb.Pin.debug(True)`` " +"以获取有关特定对象如何映射到引脚的一些调试信息。" + +#: ../../library/pyb.Pin.rst:61 +msgid "" +"All pin objects go through the pin mapper to come up with one of the gpio" +" pins." +msgstr "所有引脚对象都通过引脚映射器进行处理,以得到其中一个GPIO引脚。" + +#: ../../library/pyb.Pin.rst:65 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.Pin.rst:69 +msgid "" +"Create a new Pin object associated with the id. If additional arguments " +"are given, they are used to initialise the pin. See :meth:`pin.init`." +msgstr "创建与id相关联的新Pin对象。如果提供了额外的参数,则使用它们来初始化引脚。" +"参见 :meth:`pin.init`。" + +#: ../../library/pyb.Pin.rst:73 +msgid "Class methods" +msgstr "类方法" + +#: ../../library/pyb.Pin.rst:77 +msgid "Get or set the debugging state (``True`` or ``False`` for on or off)." +msgstr "获取或设置调试状态(``True`` 表示开启,``False`` 表示关闭)。" + +#: ../../library/pyb.Pin.rst:81 +msgid "Get or set the pin mapper dictionary." +msgstr "获取或设置引脚映射字典。" + +#: ../../library/pyb.Pin.rst:85 +msgid "Get or set the pin mapper function." +msgstr "获取或设置引脚映射函数。" + +#: ../../library/pyb.Pin.rst:89 ../../library/pyb.Pin.rst:252 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.Pin.rst:93 +msgid "Initialise the pin:" +msgstr "初始化引脚:" + +#: ../../library/pyb.Pin.rst:95 +msgid "*mode* can be one of:" +msgstr "*mode* 可以是以下之一:" + +#: ../../library/pyb.Pin.rst:97 +msgid "``Pin.IN`` - configure the pin for input;" +msgstr "``Pin.IN`` - 将引脚配置为输入;" + +#: ../../library/pyb.Pin.rst:98 +msgid "``Pin.OUT_PP`` - configure the pin for output, with push-pull control;" +msgstr "``Pin.OUT_PP`` - 将引脚配置为输出,带推挽控制;" + +#: ../../library/pyb.Pin.rst:99 +msgid "``Pin.OUT_OD`` - configure the pin for output, with open-drain control;" +msgstr "``Pin.OUT_OD`` - 将引脚配置为输出,带开漏控制;" + +#: ../../library/pyb.Pin.rst:100 +msgid "``Pin.ALT`` - configure the pin for alternate function, input or output;" +msgstr "``Pin.ALT`` - 将引脚配置为替代功能,输入或输出;" + +#: ../../library/pyb.Pin.rst:101 +msgid "``Pin.AF_PP`` - configure the pin for alternate function, push-pull;" +msgstr "``Pin.AF_PP`` - 将引脚配置为替代功能,推挽;" + +#: ../../library/pyb.Pin.rst:102 +msgid "``Pin.AF_OD`` - configure the pin for alternate function, open-drain;" +msgstr "``Pin.AF_OD`` - 将引脚配置为替代功能,开漏;" + +#: ../../library/pyb.Pin.rst:103 +msgid "``Pin.ANALOG`` - configure the pin for analog." +msgstr "``Pin.ANALOG`` - 将引脚配置为模拟。" + +#: ../../library/pyb.Pin.rst:105 +msgid "*pull* can be one of:" +msgstr "*pull* 可以是以下之一:" + +#: ../../library/pyb.Pin.rst:107 +msgid "``Pin.PULL_NONE`` - no pull up or down resistors;" +msgstr "``Pin.PULL_NONE`` - 不启用上拉或下拉电阻;" + +#: ../../library/pyb.Pin.rst:108 +msgid "``Pin.PULL_UP`` - enable the pull-up resistor;" +msgstr "``Pin.PULL_UP`` - 启用上拉电阻;" + +#: ../../library/pyb.Pin.rst:109 +msgid "``Pin.PULL_DOWN`` - enable the pull-down resistor." +msgstr "``Pin.PULL_DOWN`` - 启用下拉电阻。" + +#: ../../library/pyb.Pin.rst:111 +msgid "" +"When a pin has the ``Pin.PULL_UP`` or ``Pin.PULL_DOWN`` pull-mode " +"enabled, that pin has an effective 40k Ohm resistor pulling it to 3V3 or " +"GND respectively (except pin Y5 which has 11k Ohm resistors)." +msgstr "" +"当引脚启用 ``Pin.PULL_UP`` 或 ``Pin.PULL_DOWN`` " +"拉模式时,该引脚具有将其分别拉向3V3或GND的有效40k欧姆电阻(除了引脚 Y5 " +"具有11k欧姆电阻)。" + +#: ../../library/pyb.Pin.rst:115 +msgid "" +"*value* if not None will set the port output value before enabling the " +"pin." +msgstr "如果不是 None,*value* 将在启用引脚之前设置端口输出值。" + +#: ../../library/pyb.Pin.rst:117 +msgid "" +"*alt* can be used when mode is ``Pin.ALT`` , ``Pin.AF_PP`` or " +"``Pin.AF_OD`` to set the index or name of one of the alternate functions " +"associated with a pin. This arg was previously called *af* which can " +"still be used if needed." +msgstr "" +"*alt* 可以在模式为 ``Pin.ALT`` 、``Pin.AF_PP`` 或 ``Pin.AF_OD`` " +"时使用,以设置与引脚关联的替代功能之一的索引或名称。如果需要,此参数以前称为 " +"*af* ,仍然可以使用。" + +#: ../../library/pyb.Pin.rst:121 +msgid "Returns: ``None``." +msgstr "返回: ``None``。" + +#: ../../library/pyb.Pin.rst:125 +msgid "Get or set the digital logic level of the pin:" +msgstr "获取或设置引脚的数字逻辑电平:" + +#: ../../library/pyb.Pin.rst:127 +msgid "With no argument, return 0 or 1 depending on the logic level of the pin." +msgstr "没有参数时,根据引脚的逻辑电平返回0或1。" + +#: ../../library/pyb.Pin.rst:128 +msgid "" +"With ``value`` given, set the logic level of the pin. ``value`` can be " +"anything that converts to a boolean. If it converts to ``True``, the pin" +" is set high, otherwise it is set low." +msgstr "" +"给出 ``value`` 时,设置引脚的逻辑电平。``value`` 可以转换为布尔值的任何内容。" +"如果转换为 ``True``,则引脚设置为高电平,否则设置为低电平。" + +#: ../../library/pyb.Pin.rst:134 +msgid "Return a string describing the pin object." +msgstr "返回描述引脚对象的字符串。" + +#: ../../library/pyb.Pin.rst:138 +msgid "" +"Returns the currently configured alternate-function of the pin. The " +"integer returned will match one of the allowed constants for the af " +"argument to the init function." +msgstr "返回引脚当前配置的替代功能。返回的整数将匹配 init 函数的 af " +"参数的允许的常量之一。" + +#: ../../library/pyb.Pin.rst:144 +msgid "Returns an array of alternate functions available for this pin." +msgstr "返回此引脚可用的替代功能数组。" + +#: ../../library/pyb.Pin.rst:148 +msgid "Returns the base address of the GPIO block associated with this pin." +msgstr "返回与此引脚关联的 GPIO 块的基地址。" + +#: ../../library/pyb.Pin.rst:152 +msgid "" +"Returns the currently configured mode of the pin. The integer returned " +"will match one of the allowed constants for the mode argument to the init" +" function." +msgstr "返回引脚当前配置的模式。返回的整数将匹配 init 函数的 mode " +"参数的允许的常量之一。" + +#: ../../library/pyb.Pin.rst:158 +msgid "Get the pin name." +msgstr "获取引脚名称。" + +#: ../../library/pyb.Pin.rst:162 +msgid "Returns the cpu and board names for this pin." +msgstr "返回此引脚的cpu和板载名称。" + +#: ../../library/pyb.Pin.rst:166 +msgid "Get the pin number." +msgstr "获取引脚号。" + +#: ../../library/pyb.Pin.rst:170 +msgid "Get the pin port." +msgstr "获取引脚端口。" + +#: ../../library/pyb.Pin.rst:174 +msgid "" +"Returns the currently configured pull of the pin. The integer returned " +"will match one of the allowed constants for the pull argument to the init" +" function." +msgstr "返回引脚当前配置的拉模式。返回的整数将匹配 init 函数的 pull " +"参数的允许的常量之一。" + +#: ../../library/pyb.Pin.rst:179 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.Pin.rst:183 +msgid "initialise the pin to alternate-function mode for input or output" +msgstr "将引脚初始化为输入或输出的替代功能模式" + +#: ../../library/pyb.Pin.rst:187 +msgid "initialise the pin to alternate-function mode with an open-drain drive" +msgstr "将引脚初始化为带开漏驱动的替代功能模式" + +#: ../../library/pyb.Pin.rst:191 +msgid "initialise the pin to alternate-function mode with a push-pull drive" +msgstr "将引脚初始化为带推挽驱动的替代功能模式" + +#: ../../library/pyb.Pin.rst:195 +msgid "initialise the pin to analog mode" +msgstr "将引脚初始化为模拟模式" + +#: ../../library/pyb.Pin.rst:199 +msgid "initialise the pin to input mode" +msgstr "将引脚初始化为输入模式" + +#: ../../library/pyb.Pin.rst:203 +msgid "initialise the pin to output mode with an open-drain drive" +msgstr "将引脚初始化为带开漏驱动的输出模式" + +#: ../../library/pyb.Pin.rst:207 +msgid "initialise the pin to output mode with a push-pull drive" +msgstr "将引脚初始化为带推挽驱动的输出模式" + +#: ../../library/pyb.Pin.rst:211 +msgid "enable the pull-down resistor on the pin" +msgstr "在引脚上启用下拉电阻" + +#: ../../library/pyb.Pin.rst:215 +msgid "don't enable any pull up or down resistors on the pin" +msgstr "在引脚上不启用任何上拉或下拉电阻" + +#: ../../library/pyb.Pin.rst:219 +msgid "enable the pull-up resistor on the pin" +msgstr "在引脚上启用上拉电阻" + +#: ../../library/pyb.Pin.rst:222 +msgid "class PinAF -- Pin Alternate Functions" +msgstr "class PinAF -- 引脚替代功能" + +#: ../../library/pyb.Pin.rst:224 +msgid "" +"A Pin represents a physical pin on the microprocessor. Each pin can have " +"a variety of functions (GPIO, I2C SDA, etc). Each PinAF object represents" +" a particular function for a pin." +msgstr "Pin代表微处理器上的物理引脚。每个引脚都可以有各种功能(GPIO、I2C " +"SDA等)。每个PinAF对象表示引脚的特定功能。" + +#: ../../library/pyb.Pin.rst:228 +msgid "Usage Model::" +msgstr "使用模型::" + +#: ../../library/pyb.Pin.rst:233 +msgid "" +"x3_af will now contain an array of PinAF objects which are available on " +"pin X3." +msgstr "现在,x3_af 将包含一个 PinAF 对象数组,这些对象在引脚 X3 上可用。" + +#: ../../library/pyb.Pin.rst:237 +msgid "For the pyboard, x3_af would contain:" +msgstr "对于 pyboard,x3_af 将包含:" + +#: ../../library/pyb.Pin.rst:237 +msgid "[Pin.AF1_TIM2, Pin.AF2_TIM5, Pin.AF3_TIM9, Pin.AF7_USART2]" +msgstr "[Pin.AF1_TIM2, Pin.AF2_TIM5, Pin.AF3_TIM9, Pin.AF7_USART2]" + +#: ../../library/pyb.Pin.rst:239 +msgid "" +"Normally, each peripheral would configure the alternate function " +"automatically, but sometimes the same function is available on multiple " +"pins, and having more control is desired." +msgstr "通常,每个外设都会自动配置替代功能,但有时相同的功能可能在多个引脚上可用,并" +"且希望有更多控制。" + +#: ../../library/pyb.Pin.rst:243 +msgid "To configure X3 to expose TIM2_CH3, you could use::" +msgstr "要将 X3 配置为暴露 TIM2_CH3,您可以使用::" + +#: ../../library/pyb.Pin.rst:247 +msgid "or::" +msgstr "或::" + +#: ../../library/pyb.Pin.rst:256 +msgid "Return a string describing the alternate function." +msgstr "返回描述替代功能的字符串。" + +#: ../../library/pyb.Pin.rst:260 +msgid "Return the alternate function index." +msgstr "返回替代功能索引。" + +#: ../../library/pyb.Pin.rst:264 +msgid "Return the name of the alternate function." +msgstr "返回替代功能的名称。" + +#: ../../library/pyb.Pin.rst:268 +msgid "" +"Return the base register associated with the peripheral assigned to this " +"alternate function. For example, if the alternate function were TIM2_CH3 " +"this would return stm.TIM2" +msgstr "返回与分配给此替代功能的外设相关联的基本寄存器。例如,如果替代功能是 " +"TIM2_CH3,则会返回 stm.TIM2" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.RTC.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.RTC.po new file mode 100644 index 0000000000000..95795e6398518 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.RTC.po @@ -0,0 +1,141 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.RTC.rst:5 +msgid "class RTC -- real time clock" +msgstr "class RTC -- 实时时钟" + +#: ../../library/pyb.RTC.rst:7 +msgid "The RTC is an independent clock that keeps track of the date and time." +msgstr "RTC 是一个独立的时钟,用于跟踪日期和时间。" + +#: ../../library/pyb.RTC.rst:10 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/pyb.RTC.rst:18 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.RTC.rst:22 +msgid "Create an RTC object." +msgstr "创建一个 RTC 对象。" + +#: ../../library/pyb.RTC.rst:26 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.RTC.rst:30 +msgid "Get or set the date and time of the RTC." +msgstr "获取或设置 RTC 的日期和时间。" + +#: ../../library/pyb.RTC.rst:32 +msgid "" +"With no arguments, this method returns an 8-tuple with the current date " +"and time. With 1 argument (being an 8-tuple) it sets the date and time " +"(and ``subseconds`` is reset to 255)." +msgstr "" +"当没有参数时,此方法返回一个包含当前日期和时间的 8 元组。当有 1 个参数时(为 " +"8 元组),它设置日期和时间(并将 ``subseconds`` 重置为 255)。" + +#: ../../library/pyb.RTC.rst:36 +msgid "The 8-tuple has the following format:" +msgstr "8 元组具有以下格式:" + +#: ../../library/pyb.RTC.rst:38 +msgid "(year, month, day, weekday, hours, minutes, seconds, subseconds)" +msgstr "(年, 月, 日, 星期, 小时, 分钟, 秒, 子秒)" + +#: ../../library/pyb.RTC.rst:40 +msgid "``weekday`` is 1-7 for Monday through Sunday." +msgstr "``weekday`` 表示星期一到星期日的值为 1-7。" + +#: ../../library/pyb.RTC.rst:42 +msgid "``subseconds`` counts down from 255 to 0" +msgstr "``subseconds`` 从 255 倒数到 0" + +#: ../../library/pyb.RTC.rst:46 +msgid "" +"Set the RTC wakeup timer to trigger repeatedly at every ``timeout`` " +"milliseconds. This trigger can wake the pyboard from both the sleep " +"states: :meth:`pyb.stop` and :meth:`pyb.standby`." +msgstr "" +"将 RTC 唤醒定时器设置为每隔 ``timeout`` " +"毫秒触发一次。此触发器可以从睡眠状态::meth:`pyb.stop` 和 :meth:`pyb.standby`" +" 中唤醒 pyboard。" + +#: ../../library/pyb.RTC.rst:50 +msgid "If ``timeout`` is ``None`` then the wakeup timer is disabled." +msgstr "如果 ``timeout`` 是 ``None``,则唤醒定时器将被禁用。" + +#: ../../library/pyb.RTC.rst:52 +msgid "" +"If ``callback`` is given then it is executed at every trigger of the " +"wakeup timer. ``callback`` must take exactly one argument." +msgstr "如果给定了 ``callback``,则它将在每次唤醒定时器触发时执行。``callback`` " +"必须只接受一个参数。" + +#: ../../library/pyb.RTC.rst:57 +msgid "Get information about the startup time and reset source." +msgstr "获取有关启动时间和复位源的信息。" + +#: ../../library/pyb.RTC.rst:59 +msgid "The lower 0xffff are the number of milliseconds the RTC took to start up." +msgstr "较低的 0xffff 是 RTC 启动所花费的毫秒数。" + +#: ../../library/pyb.RTC.rst:61 +msgid "Bit 0x10000 is set if a power-on reset occurred." +msgstr "如果发生了上电复位,则位0x10000被置位。" + +#: ../../library/pyb.RTC.rst:62 +msgid "Bit 0x20000 is set if an external reset occurred" +msgstr "如果发生了外部复位,则位0x20000被置位" + +#: ../../library/pyb.RTC.rst:66 +msgid "Get or set RTC calibration." +msgstr "获取或设置RTC校准。" + +#: ../../library/pyb.RTC.rst:68 +msgid "" +"With no arguments, ``calibration()`` returns the current calibration " +"value, which is an integer in the range [-511 : 512]. With one argument " +"it sets the RTC calibration." +msgstr "" +"当没有参数时,``calibration()`` 返回当前校准值,该值为范围在 [-511 : 512] " +"的整数。当有一个参数时,它设置 RTC 校准。" + +#: ../../library/pyb.RTC.rst:72 +msgid "" +"The RTC Smooth Calibration mechanism adjusts the RTC clock rate by adding" +" or subtracting the given number of ticks from the 32768 Hz clock over a " +"32 second period (corresponding to 2^20 clock ticks.) Each tick added " +"will speed up the clock by 1 part in 2^20, or 0.954 ppm; likewise the RTC" +" clock it slowed by negative values. The usable calibration range is: " +"(-511 * 0.954) ~= -487.5 ppm up to (512 * 0.954) ~= 488.5 ppm" +msgstr "" +"RTC 平滑校准机制通过在 32 秒期间(对应 2^20 个时钟周期)从 32768 Hz " +"时钟中添加或减去给定数量的时钟周期来调整 RTC 时钟速率。" +"每个添加的时钟周期会使时钟快速移动 2^20 中的一部分,或 0.954 ppm;同样,RTC " +"时钟减慢为负值。可用的校准范围为:(-511 * 0.954) ~= -487.5 ppm 到 (512 * 0." +"954) ~= 488.5 ppm" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.SPI.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.SPI.po new file mode 100644 index 0000000000000..c575988485d5b --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.SPI.po @@ -0,0 +1,232 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.SPI.rst:5 +msgid "class SPI -- a controller-driven serial protocol" +msgstr "class SPI -- 由控制器驱动的串行协议" + +#: ../../library/pyb.SPI.rst:7 +msgid "" +"SPI is a serial protocol that is driven by a controller. At the physical" +" level there are 3 lines: SCK, MOSI, MISO." +msgstr "SPI 是一种由控制器驱动的串行协议。在物理层面上有 3 条线:SCK、MOSI、MISO。" + +#: ../../library/pyb.SPI.rst:10 +msgid "" +"See usage model of I2C; SPI is very similar. Main difference is " +"parameters to init the SPI bus::" +msgstr "查看 I2C 的使用模型;SPI 非常相似。主要区别在于初始化 SPI 总线时的参数:" + +#: ../../library/pyb.SPI.rst:16 +msgid "" +"Only required parameter is mode, SPI.CONTROLLER or SPI.PERIPHERAL. " +"Polarity can be 0 or 1, and is the level the idle clock line sits at. " +"Phase can be 0 or 1 to sample data on the first or second clock edge " +"respectively. Crc can be None for no CRC, or a polynomial specifier." +msgstr "" +"唯一必需的参数是 mode,可以是 SPI.CONTROLLER 或 SPI.PERIPHERAL。极性可以是 0 " +"或 1,表示空闲时钟线的电平。相位可以是 0 或 " +"1,分别在第一个或第二个时钟边沿上采样数据。CRC 可以为 None 表示无 " +"CRC,或者是一个多项式指示器。" + +#: ../../library/pyb.SPI.rst:21 +msgid "Additional methods for SPI::" +msgstr "SPI的其他方法::" + +#: ../../library/pyb.SPI.rst:29 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.SPI.rst:33 +msgid "" +"Construct an SPI object on the given bus. ``bus`` can be 2. With no " +"additional parameters, the SPI object is created but not initialised (it " +"has the settings from the last initialisation of the bus, if any). If " +"extra arguments are given, the bus is initialised. See ``init`` for " +"parameters of initialisation." +msgstr "" +"在给定总线上构造一个 SPI 对象。``bus`` 可以是 2。如果没有额外的参数,则创建 " +"SPI 对象但不初始化(它具有总线上最后一次初始化的设置,如果有的话)。如果给定" +"了额外的参数,则会初始化总线。请参阅 ``init`` 来了解初始化的参数。" + +#: ../../library/pyb.SPI.rst:39 +msgid "The physical pins of the SPI buses are:" +msgstr "SPI总线的物理引脚如下:" + +#: ../../library/pyb.SPI.rst:41 +msgid "" +"``SPI(2)``: ``(NSS, SCK, MISO, MOSI) = (P3, P2, P1, P0) = (PB12, PB13, " +"PB14, PB15)``" +msgstr "" +"``SPI(2)``: ``(NSS, SCK, MISO, MOSI) = (P3, P2, P1, P0) = (PB12, PB13, PB14, " +"PB15)``" + +#: ../../library/pyb.SPI.rst:43 +msgid "" +"At the moment, the NSS pin is not used by the SPI driver and is free for " +"other use." +msgstr "目前,NSS引脚未被SPI驱动程序使用,可供其他用途使用。" + +#: ../../library/pyb.SPI.rst:47 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.SPI.rst:51 +msgid "Turn off the SPI bus." +msgstr "关闭SPI总线。" + +#: ../../library/pyb.SPI.rst:55 +msgid "Initialise the SPI bus with the given parameters:" +msgstr "使用给定的参数初始化 SPI 总线:" + +#: ../../library/pyb.SPI.rst:57 +msgid "``mode`` must be either ``SPI.CONTROLLER`` or ``SPI.PERIPHERAL``." +msgstr "``mode`` 必须是 ``SPI.CONTROLLER`` 或 ``SPI.PERIPHERAL``。" + +#: ../../library/pyb.SPI.rst:58 +msgid "``baudrate`` is the SCK clock rate (only sensible for a controller)." +msgstr "``baudrate`` 是 SCK 时钟速率(仅适用于控制器)。" + +#: ../../library/pyb.SPI.rst:59 +msgid "" +"``prescaler`` is the prescaler to use to derive SCK from the APB bus " +"frequency; use of ``prescaler`` overrides ``baudrate``." +msgstr "" +"``prescaler`` 是用于从 APB 总线频率导出 SCK 的预分频器;使用 ``prescaler`` " +"将覆盖 ``baudrate``。" + +#: ../../library/pyb.SPI.rst:61 +msgid "``polarity`` can be 0 or 1, and is the level the idle clock line sits at." +msgstr "``polarity`` 可以是 0 或 1,表示空闲时钟线的电平。" + +#: ../../library/pyb.SPI.rst:62 +msgid "" +"``phase`` can be 0 or 1 to sample data on the first or second clock edge " +"respectively." +msgstr "``phase`` 可以是 0 或 1,在第一个或第二个时钟边沿上采样数据。" + +#: ../../library/pyb.SPI.rst:64 +msgid "" +"``bits`` can be 8 or 16, and is the number of bits in each transferred " +"word." +msgstr "``bits`` 可以是 8 或 16,是每个传输字中的位数。" + +#: ../../library/pyb.SPI.rst:65 +msgid "``firstbit`` can be ``SPI.MSB`` or ``SPI.LSB``." +msgstr "``firstbit`` 可以是 ``SPI.MSB`` 或 ``SPI.LSB``。" + +#: ../../library/pyb.SPI.rst:66 +msgid "" +"``ti`` True indicates Texas Instruments, as opposed to Motorola, signal " +"conventions." +msgstr "``ti`` 为 True 表示 Texas Instruments,与 Motorola 信号约定相对。" + +#: ../../library/pyb.SPI.rst:67 +msgid "``crc`` can be None for no CRC, or a polynomial specifier." +msgstr "``crc`` 可以为 None 表示无 CRC,或者是一个多项式指示器。" + +#: ../../library/pyb.SPI.rst:69 +msgid "" +"Note that the SPI clock frequency will not always be the requested " +"baudrate. The hardware only supports baudrates that are the APB bus " +"frequency divided by a prescaler, which can be 2, 4, 8, 16, 32, 64, 128 " +"or 256. SPI(2) is on AHB1. For precise control over the SPI clock " +"frequency, specify ``prescaler`` instead of ``baudrate``." +msgstr "" +"请注意,SPI 时钟频率不总是请求的波特率。硬件仅支持 APB " +"总线频率除以预分频器得到的波特率,预分频器可以为 2、4、8、16、32、64、128 或 " +"256。SPI(2) 在 AHB1 上。为了精确控制 SPI 时钟频率,请指定 ``prescaler`` " +"而不是 ``baudrate``。" + +#: ../../library/pyb.SPI.rst:76 +msgid "" +"Printing the SPI object will show you the computed baudrate and the " +"chosen prescaler." +msgstr "打印SPI对象将显示计算出的波特率和选择的预分频器。" + +#: ../../library/pyb.SPI.rst:81 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/pyb.SPI.rst:83 +msgid "" +"``recv`` can be an integer, which is the number of bytes to receive, or a" +" mutable buffer, which will be filled with received bytes." +msgstr "``recv`` 可以是一个整数,表示要接收的字节数,或者是一个可变缓冲区,将用接收到" +"的字节填充它。" + +#: ../../library/pyb.SPI.rst:85 ../../library/pyb.SPI.rst:107 +msgid "``timeout`` is the timeout in milliseconds to wait for the receive." +msgstr "``timeout`` 是等待接收的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.SPI.rst:87 +msgid "" +"Return value: if ``recv`` is an integer then a new buffer of the bytes " +"received, otherwise the same buffer that was passed in to ``recv``." +msgstr "返回值:如果 ``recv`` 是整数,则返回接收到的字节的新缓冲区,否则返回传入 " +"``recv`` 的相同缓冲区。" + +#: ../../library/pyb.SPI.rst:92 +msgid "Send data on the bus:" +msgstr "在总线上发送数据:" + +#: ../../library/pyb.SPI.rst:94 ../../library/pyb.SPI.rst:103 +msgid "``send`` is the data to send (an integer to send, or a buffer object)." +msgstr "``send`` 是要发送的数据(一个要发送的整数或缓冲区对象)。" + +#: ../../library/pyb.SPI.rst:95 +msgid "``timeout`` is the timeout in milliseconds to wait for the send." +msgstr "``timeout`` 是等待发送的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.SPI.rst:97 +msgid "Return value: ``None``." +msgstr "返回值:``None``。" + +#: ../../library/pyb.SPI.rst:101 +msgid "Send and receive data on the bus at the same time:" +msgstr "同时在总线上发送和接收数据:" + +#: ../../library/pyb.SPI.rst:104 +msgid "" +"``recv`` is a mutable buffer which will be filled with received bytes. It" +" can be the same as ``send``, or omitted. If omitted, a new buffer will " +"be created." +msgstr "``recv`` 是一个可变缓冲区,将用接收到的字节填充它。它可以与 ``send`` " +"相同,也可以省略。如果省略,则会创建一个新的缓冲区。" + +#: ../../library/pyb.SPI.rst:109 +msgid "Return value: the buffer with the received bytes." +msgstr "返回值:接收到字节的缓冲区。" + +#: ../../library/pyb.SPI.rst:112 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.SPI.rst:117 +msgid "for initialising the SPI bus to controller or peripheral mode" +msgstr "用于将 SPI 总线初始化为控制器或外围设备模式" + +#: ../../library/pyb.SPI.rst:122 +msgid "set the first bit to be the least or most significant bit" +msgstr "将第一位设置为最小有效位或最大有效位" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Servo.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Servo.po new file mode 100644 index 0000000000000..49e2fa6141de6 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Servo.po @@ -0,0 +1,139 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.Servo.rst:5 +msgid "class Servo -- 3-wire hobby servo driver" +msgstr "class Servo -- 3线航模伺服驱动器" + +#: ../../library/pyb.Servo.rst:7 +msgid "" +"Servo objects control standard hobby servo motors with 3-wires (ground, " +"power, signal)." +msgstr "Servo 对象控制带有 3 条线(地线、电源、信号)的标准航模伺服电机。" + +#: ../../library/pyb.Servo.rst:10 +msgid "Example usage::" +msgstr "示例用法::" + +#: ../../library/pyb.Servo.rst:24 +msgid "" +"The Servo objects use Timer(5) to produce the PWM output. You can use " +"Timer(5) for Servo control, or your own purposes, but not both at the " +"same time." +msgstr "" +"Servo 对象使用 Timer(5) 产生 PWM 输出。您可以使用 Timer(5) " +"进行航模伺服控制,或者自己用于其他用途,但不能同时进行两者。" + +#: ../../library/pyb.Servo.rst:29 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.Servo.rst:33 +msgid "" +"Create a servo object. ``id`` is 1-3, and corresponds to pins P7 through" +" P9." +msgstr "创建一个航模伺服对象。``id`` 为 1-3,对应引脚 P7 到 P9。" + +#: ../../library/pyb.Servo.rst:36 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.Servo.rst:40 +msgid "If no arguments are given, this function returns the current angle." +msgstr "如果没有给出参数,则此函数返回当前角度。" + +#: ../../library/pyb.Servo.rst:42 +msgid "If arguments are given, this function sets the angle of the servo:" +msgstr "如果给出了参数,则此函数设置航模伺服的角度:" + +#: ../../library/pyb.Servo.rst:44 +msgid "``angle`` is the angle to move to in degrees." +msgstr "``angle`` 是要转到的角度,单位为度。" + +#: ../../library/pyb.Servo.rst:45 +msgid "" +"``time`` is the number of milliseconds to take to get to the specified " +"angle. If omitted, then the servo moves as quickly as possible to its " +"new position." +msgstr "``time`` 是到达指定角度所需的毫秒数。如果省略,则航模伺服尽快移动到新位置。" + +#: ../../library/pyb.Servo.rst:51 +msgid "If no arguments are given, this function returns the current speed." +msgstr "如果没有给出参数,则此函数返回当前速度。" + +#: ../../library/pyb.Servo.rst:53 +msgid "If arguments are given, this function sets the speed of the servo:" +msgstr "如果给出了参数,则此函数设置航模伺服的速度:" + +#: ../../library/pyb.Servo.rst:55 +msgid "``speed`` is the speed to change to, between -100 and 100." +msgstr "``speed`` 是要改变的速度,范围在 -100 到 100。" + +#: ../../library/pyb.Servo.rst:56 +msgid "" +"``time`` is the number of milliseconds to take to get to the specified " +"speed. If omitted, then the servo accelerates as quickly as possible." +msgstr "``time`` 是到达指定速度所需的毫秒数。如果省略,则航模伺服尽快加速。" + +#: ../../library/pyb.Servo.rst:61 +msgid "" +"If no arguments are given, this function returns the current raw pulse-" +"width value." +msgstr "如果没有给出参数,则此函数返回当前原始脉冲宽度值。" + +#: ../../library/pyb.Servo.rst:64 +msgid "If an argument is given, this function sets the raw pulse-width value." +msgstr "如果给出了参数,则此函数设置原始脉冲宽度值。" + +#: ../../library/pyb.Servo.rst:68 +msgid "" +"If no arguments are given, this function returns the current calibration " +"data, as a 5-tuple." +msgstr "如果没有给出参数,则此函数返回当前校准数据,返回一个 5 元组。" + +#: ../../library/pyb.Servo.rst:71 +msgid "If arguments are given, this function sets the timing calibration:" +msgstr "如果给出了参数,则此函数设置定时校准:" + +#: ../../library/pyb.Servo.rst:73 +msgid "``pulse_min`` is the minimum allowed pulse width." +msgstr "``pulse_min`` 是允许的最小脉冲宽度。" + +#: ../../library/pyb.Servo.rst:74 +msgid "``pulse_max`` is the maximum allowed pulse width." +msgstr "``pulse_max`` 是允许的最大脉冲宽度。" + +#: ../../library/pyb.Servo.rst:75 +msgid "" +"``pulse_centre`` is the pulse width corresponding to the centre/zero " +"position." +msgstr "``pulse_centre`` 是对应于中心/零位置的脉冲宽度。" + +#: ../../library/pyb.Servo.rst:76 +msgid "``pulse_angle_90`` is the pulse width corresponding to 90 degrees." +msgstr "``pulse_angle_90`` 是对应于 90 度的脉冲宽度。" + +#: ../../library/pyb.Servo.rst:77 +msgid "``pulse_speed_100`` is the pulse width corresponding to a speed of 100." +msgstr "``pulse_speed_100`` 是对应于速度为 100 的脉冲宽度。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Timer.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Timer.po new file mode 100644 index 0000000000000..6b772555f1668 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.Timer.po @@ -0,0 +1,503 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/pyb.Timer.rst:5 +msgid "class Timer -- control internal timers" +msgstr "class Timer -- 控制内部定时器" + +#: ../../library/pyb.Timer.rst:7 +msgid "" +"Timers can be used for a great variety of tasks. At the moment, only the" +" simplest case is implemented: that of calling a function periodically." +msgstr "定时器可用于各种任务。目前,仅实现了最简单的情况:定期调用函数。" + +#: ../../library/pyb.Timer.rst:10 +msgid "" +"Each timer consists of a counter that counts up at a certain rate. The " +"rate at which it counts is the peripheral clock frequency (in Hz) divided" +" by the timer prescaler. When the counter reaches the timer period it " +"triggers an event, and the counter resets back to zero. By using the " +"callback method, the timer event can call a Python function." +msgstr "" +"每个定时器由一个在特定速率下计数的计数器组成。计数速率是外设时钟频率(以 Hz " +"为单位)除以定时器分频器。当计数器达到定时器周期时,它会触发一个事件,并且计数器将重置为零。通过使用回调方法,定时器事件可以调用一个 Python" +" 函数。" + +#: ../../library/pyb.Timer.rst:16 +msgid "Example usage to toggle an LED at a fixed frequency::" +msgstr "在固定频率下切换 LED 的示例用法::" + +#: ../../library/pyb.Timer.rst:22 +msgid "Example using named function for the callback::" +msgstr "使用命名函数进行回调的示例::" + +#: ../../library/pyb.Timer.rst:29 +msgid "Further examples::" +msgstr "更多示例::" + +#: ../../library/pyb.Timer.rst:39 +msgid "" +"*Note:* Timer(1) is used for the camera. Similarly, Timer(5) controls " +"the servo driver, and Timer(6) is used for timed ADC/DAC reading/writing." +" It is recommended to use the other timers in your programs." +msgstr "" +"*注意:* Timer(1) 被使用于摄像头。同样,Timer(5) 控制伺服驱动器,Timer(6) 用于定时 ADC/DAC " +"读写。建议在您的程序中使用其他定时器。" + +#: ../../library/pyb.Timer.rst:43 +msgid "" +"*Note:* Memory can't be allocated during a callback (an interrupt) and so" +" exceptions raised within a callback don't give much information. See " +":func:`micropython.alloc_emergency_exception_buf` for how to get around " +"this limitation." +msgstr "" +"*注意:* 在回调期间(中断期间)无法分配内存,因此在回调中引发的异常不会提供太多信息。请参阅 " +":func:`micropython.alloc_emergency_exception_buf` 以解决此限制。" + +#: ../../library/pyb.Timer.rst:50 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.Timer.rst:54 +msgid "" +"Construct a new timer object of the given id. If additional arguments " +"are given, then the timer is initialised by ``init(...)``. ``id`` can be " +"1 to 14." +msgstr "" +"构造一个给定 id 的新定时器对象。如果给出了额外的参数,则定时器将通过 ``init(...)`` 进行初始化。``id`` 可以是 1 到 " +"14。" + +#: ../../library/pyb.Timer.rst:59 ../../library/pyb.Timer.rst:244 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.Timer.rst:63 +msgid "" +"Initialise the timer. Initialisation must be either by frequency (in Hz)" +" or by prescaler and period::" +msgstr "初始化定时器。初始化必须是通过频率(以 Hz 为单位)或按分频器和周期进行的::" + +#: ../../library/pyb.Timer.rst:69 ../../library/pyb.Timer.rst:142 +msgid "Keyword arguments:" +msgstr "关键字参数:" + +#: ../../library/pyb.Timer.rst:71 +msgid "" +"``freq`` --- specifies the periodic frequency of the timer. You might " +"also view this as the frequency with which the timer goes through one " +"complete cycle." +msgstr "``freq`` --- 指定定时器的周期性频率。您也可以将其视为定时器完成一个完整周期的频率。" + +#: ../../library/pyb.Timer.rst:74 +msgid "" +"``prescaler`` [0-0xffff] - specifies the value to be loaded into the " +"timer's Prescaler Register (PSC). The timer clock source is divided by " +"(``prescaler + 1``) to arrive at the timer clock. Timers 2-7 and 12-14 " +"have a clock source of 84 MHz (pyb.freq()[2] \\* 2), and Timers 1, and " +"8-11 have a clock source of 168 MHz (pyb.freq()[3] \\* 2)." +msgstr "" +"``prescaler`` [0-0xffff] - 指定要加载到定时器预分频器寄存器(PSC)的值。定时器时钟源被分频为(``prescaler" +" + 1``)以获得定时器时钟。定时器 2-7 和 12-14 的时钟源为 84 MHz(pyb.freq()[2] \\* 2),而定时器 1 " +"和 8-11 的时钟源为 168 MHz(pyb.freq()[3] \\* 2)。" + +#: ../../library/pyb.Timer.rst:80 +msgid "" +"``period`` [0-0xffff] for timers 1, 3, 4, and 6-15. [0-0x3fffffff] for " +"timers 2 & 5. Specifies the value to be loaded into the timer's " +"AutoReload Register (ARR). This determines the period of the timer (i.e. " +"when the counter cycles). The timer counter will roll-over after ``period" +" + 1`` timer clock cycles." +msgstr "" +"``period`` [0-0xffff] 适用于定时器 1、3、4 和 6-15。[0-0x3fffffff] 适用于定时器 2 和 " +"5。指定要加载到定时器自动重载寄存器(ARR)的值。这确定了定时器的周期(即计数器循环的时机)。定时器计数器将在 ``period + 1`` " +"定时器时钟周期后溢出。" + +#: ../../library/pyb.Timer.rst:86 ../../library/pyb.Timer.rst:144 +msgid "``mode`` can be one of:" +msgstr "``mode`` 可以是以下之一:" + +#: ../../library/pyb.Timer.rst:88 +msgid "``Timer.UP`` - configures the timer to count from 0 to ARR (default)" +msgstr "``Timer.UP`` - 配置定时器从 0 到 ARR 计数(默认)" + +#: ../../library/pyb.Timer.rst:89 +msgid "``Timer.DOWN`` - configures the timer to count from ARR down to 0." +msgstr "``Timer.DOWN`` - 配置定时器从 ARR 计数到 0。" + +#: ../../library/pyb.Timer.rst:90 +msgid "" +"``Timer.CENTER`` - configures the timer to count from 0 to ARR and then " +"back down to 0." +msgstr "``Timer.CENTER`` - 配置定时器从 0 到 ARR,然后返回到 0。" + +#: ../../library/pyb.Timer.rst:93 +msgid "" +"``div`` can be one of 1, 2, or 4. Divides the timer clock to determine " +"the sampling clock used by the digital filters." +msgstr "``div`` 可以是 1、2 或 4 中的一个。将定时器时钟分割以确定数字滤波器使用的采样时钟。" + +#: ../../library/pyb.Timer.rst:96 +msgid "``callback`` - as per Timer.callback()" +msgstr "``callback`` - 与 Timer.callback() 一样" + +#: ../../library/pyb.Timer.rst:98 +msgid "" +"``deadtime`` - specifies the amount of \"dead\" or inactive time between " +"transitions on complimentary channels (both channels will be inactive) " +"for this time). ``deadtime`` may be an integer between 0 and 1008, with " +"the following restrictions: 0-128 in steps of 1. 128-256 in steps of 2, " +"256-512 in steps of 8, and 512-1008 in steps of 16. ``deadtime`` measures" +" ticks of ``source_freq`` divided by ``div`` clock ticks. ``deadtime`` is" +" only available on timers 1 and 8." +msgstr "" +"``deadtime`` - 指定在补偿通道(两个通道都将处于非活动状态)之间的“死”或非活动时间之间的量。``deadtime`` 可以是介于 " +"0 和 1008 之间的整数,其约束如下:1 步 0-128、2 步 128-256、8 步 256-512 和 16 步 " +"512-1008。``deadtime`` 是由 ``source_freq`` 除以 ``div`` " +"时钟周期刻度测量的。``deadtime`` 仅适用于定时器 1 和 8。" + +#: ../../library/pyb.Timer.rst:106 +msgid "" +"``brk`` - specifies if the break mode is used to kill the output of the " +"PWM when the ``BRK_IN`` input is asserted. The value of this argument " +"determines if break is enabled and what the polarity is, and can be one " +"of ``Timer.BRK_OFF``, ``Timer.BRK_LOW`` or ``Timer.BRK_HIGH``. To select " +"the ``BRK_IN`` pin construct a Pin object with ``mode=Pin.ALT, " +"alt=Pin.AFn_TIMx``. The pin's GPIO input features are available in alt " +"mode - ``pull=`` , ``value()`` and ``irq()``." +msgstr "" +"``brk`` - 指定在断开输入(``BRK_IN`` 输入被断开时)时是否使用断开模式来关闭 PWM " +"的输出。此参数的值确定是否启用断开模式以及极性如何,可以是以下之一: ``Timer.BRK_OFF``、``Timer.BRK_LOW`` 或 " +"``Timer.BRK_HIGH``。要选择 ``BRK_IN`` 引脚,请使用 ``mode=Pin.ALT, " +"alt=Pin.AFn_TIMx`` 构造一个 Pin 对象。引脚的 GPIO 输入功能在 alt 模式下可用 - " +"``pull=``、``value()`` 和 ``irq()``。" + +#: ../../library/pyb.Timer.rst:114 +msgid "You must either specify freq or both of period and prescaler." +msgstr "您必须指定 freq 或 period 和 prescaler 中的两者。" + +#: ../../library/pyb.Timer.rst:118 +msgid "Deinitialises the timer." +msgstr "分初始化定时器。" + +#: ../../library/pyb.Timer.rst:120 +msgid "Disables the callback (and the associated irq)." +msgstr "禁用回调(及其关联的 irq)。" + +#: ../../library/pyb.Timer.rst:122 +msgid "" +"Disables any channel callbacks (and the associated irq). Stops the timer," +" and disables the timer peripheral." +msgstr "禁用任何通道回调(及其关联的 irq)。停止定时器,并禁用定时器外设。" + +#: ../../library/pyb.Timer.rst:127 +msgid "" +"Set the function to be called when the timer triggers. ``fun`` is passed " +"1 argument, the timer object. If ``fun`` is ``None`` then the callback " +"will be disabled." +msgstr "设置定时器触发时要调用的函数。``fun`` 传递 1 个参数,即定时器对象。如果 ``fun`` 是 ``None``,则将禁用回调。" + +#: ../../library/pyb.Timer.rst:133 +msgid "" +"If only a channel number is passed, then a previously initialized channel" +" object is returned (or ``None`` if there is no previous channel)." +msgstr "如果只传递了通道号,则返回先前初始化的通道对象(如果没有先前的通道,则返回 ``None``)。" + +#: ../../library/pyb.Timer.rst:136 +msgid "Otherwise, a TimerChannel object is initialized and returned." +msgstr "否则,将初始化并返回一个 TimerChannel 对象。" + +#: ../../library/pyb.Timer.rst:138 +msgid "" +"Each channel can be configured to perform pwm, output compare, or input " +"capture. All channels share the same underlying timer, which means that " +"they share the same timer clock." +msgstr "每个通道可以配置为执行 pwm、输出比较或输入捕获。所有通道共享相同的底层定时器,这意味着它们共享相同的定时器时钟。" + +#: ../../library/pyb.Timer.rst:146 +msgid "``Timer.PWM`` --- configure the timer in PWM mode (active high)." +msgstr "``Timer.PWM`` --- 将定时器配置为 PWM 模式(高电平有效)。" + +#: ../../library/pyb.Timer.rst:147 +msgid "``Timer.PWM_INVERTED`` --- configure the timer in PWM mode (active low)." +msgstr "``Timer.PWM_INVERTED`` --- 将定时器配置为 PWM 模式(低电平有效)。" + +#: ../../library/pyb.Timer.rst:148 +msgid "``Timer.OC_TIMING`` --- indicates that no pin is driven." +msgstr "``Timer.OC_TIMING`` --- 表示不驱动任何引脚。" + +#: ../../library/pyb.Timer.rst:149 +msgid "" +"``Timer.OC_ACTIVE`` --- the pin will be made active when a compare match " +"occurs (active is determined by polarity)" +msgstr "``Timer.OC_ACTIVE`` --- 当发生比较匹配时,将使引脚处于活动状态(活动状态由极性确定)" + +#: ../../library/pyb.Timer.rst:150 +msgid "" +"``Timer.OC_INACTIVE`` --- the pin will be made inactive when a compare " +"match occurs." +msgstr "``Timer.OC_INACTIVE`` --- 当发生比较匹配时,将使引脚处于非活动状态。" + +#: ../../library/pyb.Timer.rst:151 +msgid "" +"``Timer.OC_TOGGLE`` --- the pin will be toggled when an compare match " +"occurs." +msgstr "``Timer.OC_TOGGLE`` --- 当发生比较匹配时,将切换引脚的状态。" + +#: ../../library/pyb.Timer.rst:152 +msgid "" +"``Timer.OC_FORCED_ACTIVE`` --- the pin is forced active (compare match is" +" ignored)." +msgstr "``Timer.OC_FORCED_ACTIVE`` --- 强制使引脚处于活动状态(比较匹配将被忽略)。" + +#: ../../library/pyb.Timer.rst:153 +msgid "" +"``Timer.OC_FORCED_INACTIVE`` --- the pin is forced inactive (compare " +"match is ignored)." +msgstr "``Timer.OC_FORCED_INACTIVE`` --- 强制使引脚处于非活动状态(比较匹配将被忽略)。" + +#: ../../library/pyb.Timer.rst:154 +msgid "``Timer.IC`` --- configure the timer in Input Capture mode." +msgstr "``Timer.IC`` --- 将定时器配置为输入捕获模式。" + +#: ../../library/pyb.Timer.rst:155 +msgid "" +"``Timer.ENC_A`` --- configure the timer in Encoder mode. The counter only" +" changes when CH1 changes." +msgstr "``Timer.ENC_A`` --- 将定时器配置为编码器模式。计数器仅在 CH1 更改时才会变化。" + +#: ../../library/pyb.Timer.rst:156 +msgid "" +"``Timer.ENC_B`` --- configure the timer in Encoder mode. The counter only" +" changes when CH2 changes." +msgstr "``Timer.ENC_B`` --- 将定时器配置为编码器模式。计数器仅在 CH2 更改时才会变化。" + +#: ../../library/pyb.Timer.rst:157 +msgid "" +"``Timer.ENC_AB`` --- configure the timer in Encoder mode. The counter " +"changes when CH1 or CH2 changes." +msgstr "``Timer.ENC_AB`` --- 将定时器配置为编码器模式。计数器在 CH1 或 CH2 更改时变化。" + +#: ../../library/pyb.Timer.rst:159 +msgid "``callback`` - as per TimerChannel.callback()" +msgstr "``callback`` - 与 TimerChannel.callback() 一样" + +#: ../../library/pyb.Timer.rst:161 +msgid "" +"``pin`` None (the default) or a Pin object. If specified (and not None) " +"this will cause the alternate function of the indicated pin to be " +"configured for this timer channel. An error will be raised if the pin " +"doesn't support any alternate functions for this timer channel." +msgstr "" +"``pin`` 默认为 None,或者是一个 Pin 对象。如果指定了 pin(并且不是 " +"None),则会导致为此定时器通道配置指定引脚的备用功能。如果引脚不支持此定时器通道的任何备用功能,则会引发错误。" + +#: ../../library/pyb.Timer.rst:166 +msgid "Keyword arguments for Timer.PWM modes:" +msgstr "Timer.PWM 模式的关键字参数:" + +#: ../../library/pyb.Timer.rst:168 +msgid "``pulse_width`` - determines the initial pulse width value to use." +msgstr "``pulse_width`` - 确定要使用的初始脉冲宽度值。" + +#: ../../library/pyb.Timer.rst:169 +msgid "" +"``pulse_width_percent`` - determines the initial pulse width percentage " +"to use." +msgstr "``pulse_width_percent`` - 确定要使用的初始脉冲宽度百分比。" + +#: ../../library/pyb.Timer.rst:171 +msgid "Keyword arguments for Timer.OC modes:" +msgstr "Timer.OC 模式的关键字参数:" + +#: ../../library/pyb.Timer.rst:173 +msgid "``compare`` - determines the initial value of the compare register." +msgstr "``compare`` - 确定比较寄存器的初始值。" + +#: ../../library/pyb.Timer.rst:175 ../../library/pyb.Timer.rst:182 +msgid "``polarity`` can be one of:" +msgstr "``polarity`` 可以是以下之一:" + +#: ../../library/pyb.Timer.rst:177 +msgid "``Timer.HIGH`` - output is active high" +msgstr "``Timer.HIGH`` - 输出为高电平" + +#: ../../library/pyb.Timer.rst:178 +msgid "``Timer.LOW`` - output is active low" +msgstr "``Timer.LOW`` - 输出为低电平" + +#: ../../library/pyb.Timer.rst:180 +msgid "Optional keyword arguments for Timer.IC modes:" +msgstr "Timer.IC 模式的可选关键字参数:" + +#: ../../library/pyb.Timer.rst:184 +msgid "``Timer.RISING`` - captures on rising edge." +msgstr "``Timer.RISING`` - 捕获上升沿。" + +#: ../../library/pyb.Timer.rst:185 +msgid "``Timer.FALLING`` - captures on falling edge." +msgstr "``Timer.FALLING`` - 捕获下降沿。" + +#: ../../library/pyb.Timer.rst:186 +msgid "``Timer.BOTH`` - captures on both edges." +msgstr "``Timer.BOTH`` - 捕获任何边沿。" + +#: ../../library/pyb.Timer.rst:188 +msgid "" +"Note that capture only works on the primary channel, and not on the " +"complimentary channels." +msgstr "请注意,捕获仅适用于主通道,而不适用于补充通道。" + +#: ../../library/pyb.Timer.rst:191 +msgid "Notes for Timer.ENC modes:" +msgstr "Timer.ENC 模式的注意事项:" + +#: ../../library/pyb.Timer.rst:193 +msgid "" +"Requires 2 pins, so one or both pins will need to be configured to use " +"the appropriate timer AF using the Pin API." +msgstr "需要 2 个引脚,因此一个或两个引脚将需要使用 Pin API 配置使用适当的定时器 AF。" + +#: ../../library/pyb.Timer.rst:195 +msgid "Read the encoder value using the timer.counter() method." +msgstr "使用 timer.counter() 方法读取编码器值。" + +#: ../../library/pyb.Timer.rst:196 +msgid "Only works on CH1 and CH2 (and not on CH1N or CH2N)" +msgstr "仅在 CH1 和 CH2 上有效(不在 CH1N 或 CH2N 上有效)" + +#: ../../library/pyb.Timer.rst:197 +msgid "The channel number is ignored when setting the encoder mode." +msgstr "在设置编码器模式时,通道号将被忽略。" + +#: ../../library/pyb.Timer.rst:199 +msgid "PWM Example::" +msgstr "PWM 示例::" + +#: ../../library/pyb.Timer.rst:205 +msgid "" +"PWM Motor Example with complementary outputs, dead time, break input and " +"break callback::" +msgstr "具有互补输出、死区时间、断开输入和断开回调的 PWM 电机示例::" + +#: ../../library/pyb.Timer.rst:218 +msgid "Get or set the timer counter." +msgstr "获取或设置定时器计数器。" + +#: ../../library/pyb.Timer.rst:222 +msgid "" +"Get or set the frequency for the timer (changes prescaler and period if " +"set)." +msgstr "获取或设置定时器的频率(如果设置,则更改分频器和周期)。" + +#: ../../library/pyb.Timer.rst:226 +msgid "Get or set the period of the timer." +msgstr "获取或设置定时器的周期。" + +#: ../../library/pyb.Timer.rst:230 +msgid "Get or set the prescaler for the timer." +msgstr "获取或设置定时器的分频器。" + +#: ../../library/pyb.Timer.rst:234 +msgid "Get the frequency of the source of the timer." +msgstr "获取定时器源的频率。" + +#: ../../library/pyb.Timer.rst:237 +msgid "class TimerChannel --- setup a channel for a timer" +msgstr "class TimerChannel --- 为定时器设置通道" + +#: ../../library/pyb.Timer.rst:239 +msgid "Timer channels are used to generate/capture a signal using a timer." +msgstr "定时器通道用于使用定时器生成/捕获信号。" + +#: ../../library/pyb.Timer.rst:241 +msgid "TimerChannel objects are created using the Timer.channel() method." +msgstr "使用 Timer.channel() 方法创建 TimerChannel 对象。" + +#: ../../library/pyb.Timer.rst:248 +msgid "" +"Set the function to be called when the timer channel triggers. ``fun`` is" +" passed 1 argument, the timer object. If ``fun`` is ``None`` then the " +"callback will be disabled." +msgstr "设置当定时器通道触发时要调用的函数。``fun`` 传递 1 个参数,即定时器对象。如果 ``fun`` 是 ``None``,则将禁用回调。" + +#: ../../library/pyb.Timer.rst:254 +msgid "" +"Get or set the capture value associated with a channel. capture, compare," +" and pulse_width are all aliases for the same function. capture is the " +"logical name to use when the channel is in input capture mode." +msgstr "" +"获取或设置与通道关联的捕获值。capture、compare 和 pulse_width " +"都是与同一函数的别名。capture是通道处于输入捕获模式时使用的逻辑名称。" + +#: ../../library/pyb.Timer.rst:260 +msgid "" +"Get or set the compare value associated with a channel. capture, compare," +" and pulse_width are all aliases for the same function. compare is the " +"logical name to use when the channel is in output compare mode." +msgstr "" +"获取或设置与通道关联的比较值。capture、compare 和 pulse_width " +"都是与同一函数的别名。Compare是通道处于输出比较模式时要使用的逻辑名称。" + +#: ../../library/pyb.Timer.rst:266 +msgid "" +"Get or set the pulse width value associated with a channel. capture, " +"compare, and pulse_width are all aliases for the same function. " +"pulse_width is the logical name to use when the channel is in PWM mode." +msgstr "" +"获取或设置与通道关联的脉冲宽度值。capture、compare 和 pulse_width " +"都是与同一函数的别名。pulse_width是通道处于 PWM 模式时要使用的逻辑名称。" + +#: ../../library/pyb.Timer.rst:270 +msgid "" +"In edge aligned mode, a pulse_width of ``period + 1`` corresponds to a " +"duty cycle of 100% In center aligned mode, a pulse width of ``period`` " +"corresponds to a duty cycle of 100%" +msgstr "" +"在边缘对齐模式下,``period + 1`` 的脉冲宽度对应于 100% 的占空比。在中心对齐模式下,脉冲宽度为 ``period`` 对应于 " +"100% 的占空比" + +#: ../../library/pyb.Timer.rst:275 +msgid "" +"Get or set the pulse width percentage associated with a channel. The " +"value is a number between 0 and 100 and sets the percentage of the timer " +"period for which the pulse is active. The value can be an integer or " +"floating-point number for more accuracy. For example, a value of 25 " +"gives a duty cycle of 25%." +msgstr "" +"获取或设置与通道关联的脉冲宽度百分比。该值是介于 0 和 100 " +"之间的数字,并设置脉冲处于活动状态的定时器周期的百分比。该值可以是整数或浮点数,以获得更高的精度。例如,值为 25 表示 25% 的占空比。" + +#: ../../library/pyb.Timer.rst:282 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.Timer.rst:288 +msgid "" +"Configures the timer to count Up, Down, or from 0 to ARR and then back " +"down to 0." +msgstr "将定时器配置为向上、向下计数,或从 0 到 ARR 再返回到 0。" + +#: ../../library/pyb.Timer.rst:294 +msgid "Configures the break mode when passed to the ``brk`` keyword argument." +msgstr "当传递给 ``brk`` 关键字参数时,配置断开模式。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.UART.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.UART.po new file mode 100644 index 0000000000000..76a697abba1ba --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.UART.po @@ -0,0 +1,377 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/pyb.UART.rst:5 +msgid "class UART -- duplex serial communication bus" +msgstr "class UART -- 双工串行通信总线" + +#: ../../library/pyb.UART.rst:7 +msgid "" +"UART implements the standard UART/USART duplex serial communications " +"protocol. At the physical level it consists of 2 lines: RX and TX. The " +"unit of communication is a character (not to be confused with a string " +"character) which can be 8 or 9 bits wide." +msgstr "" +"UART 实现了标准的 UART/USART 双工串行通信协议。在物理层面上,它由 2 条线组成:RX 和 " +"TX。通信的单位是一个字符(不要与字符串字符混淆),可以是 8 位或 9 位宽。" + +#: ../../library/pyb.UART.rst:12 +msgid "UART objects can be created and initialised using::" +msgstr "可以使用以下方式创建和初始化 UART 对象::" + +#: ../../library/pyb.UART.rst:19 +msgid "" +"Bits can be 7, 8 or 9. Parity can be None, 0 (even) or 1 (odd). Stop " +"can be 1 or 2." +msgstr "位数可以是 7、8 或 9。奇偶校验可以是 None、0(偶数)或 1(奇数)。停止位可以是 1 或 2。" + +#: ../../library/pyb.UART.rst:21 ../../library/pyb.UART.rst:85 +msgid "" +"*Note:* with parity=None, only 8 and 9 bits are supported. With parity " +"enabled, only 7 and 8 bits are supported." +msgstr "*注意:* 当奇偶校验为 None 时,仅支持 8 和 9 位。启用奇偶校验时,仅支持 7 和 8 位。" + +#: ../../library/pyb.UART.rst:24 +msgid "" +"A UART object acts like a :std:term:`stream` object and reading and " +"writing is done using the standard stream methods::" +msgstr "UART 对象的行为类似于 :std:term:`stream` 对象,使用标准的流方法进行读写::" + +#: ../../library/pyb.UART.rst:33 +msgid "Individual characters can be read/written using::" +msgstr "可以使用以下方式读取/写入单个字符::" + +#: ../../library/pyb.UART.rst:38 +msgid "To check if there is anything to be read, use::" +msgstr "要检查是否有待读取的内容,请使用::" + +#: ../../library/pyb.UART.rst:42 +msgid "" +"*Note:* The stream functions ``read``, ``write``, etc. are new in " +"MicroPython v1.3.4. Earlier versions use ``uart.send`` and ``uart.recv``." +msgstr "" +"*注意:* 流函数 ``read``、``write`` 等是 MicroPython v1.3.4 中新增的。早期版本使用 " +"``uart.send`` 和 ``uart.recv``。" + +#: ../../library/pyb.UART.rst:46 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.UART.rst:50 +msgid "" +"Construct a UART object on the given bus. ``bus`` can be 1/3. With no " +"additional parameters, the UART object is created but not initialised (it" +" has the settings from the last initialisation of the bus, if any). If " +"extra arguments are given, the bus is initialised. See ``init`` for " +"parameters of initialisation." +msgstr "" +"在给定总线上构造一个UART对象。 ``bus`` " +"可以是1或3。如果没有额外的参数,则创建但不初始化UART对象(它具有总线上最后一次初始化的设置,如果有的话)。如果提供了额外的参数,则会初始化总线。有关初始化参数,请参阅" +" ``init``。" + +#: ../../library/pyb.UART.rst:56 +msgid "The physical pins of the UART bus are for the OpenMV Cam:" +msgstr "对于OpenMV Cam,UART总线的物理引脚为:" + +#: ../../library/pyb.UART.rst:58 ../../library/pyb.UART.rst:63 +msgid "``UART(3)``: ``(TX, RX) = (P4, P5) = (PB10, PB11)``" +msgstr "``UART(3)``: ``(TX, RX) = (P4, P5) = (PB10, PB11)``" + +#: ../../library/pyb.UART.rst:60 +msgid "The physical pins of the UART busses are for the OpenMV Cam M7 and H7:" +msgstr "OpenMV Cam M7 和 H7 上 UART 总线的物理引脚为:" + +#: ../../library/pyb.UART.rst:62 +msgid "``UART(1)``: ``(TX, RX) = (P1, P0) = (PB14, PB15)``" +msgstr "``UART(1)``: ``(TX, RX) = (P1, P0) = (PB14, PB15)``" + +#: ../../library/pyb.UART.rst:66 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.UART.rst:70 +msgid "Initialise the UART bus with the given parameters:" +msgstr "使用给定的参数初始化 UART 总线:" + +#: ../../library/pyb.UART.rst:72 +msgid "``baudrate`` is the clock rate." +msgstr "``baudrate`` 是时钟速率。" + +#: ../../library/pyb.UART.rst:73 +msgid "``bits`` is the number of bits per character, 7, 8 or 9." +msgstr "``bits`` 是每个字符的位数,为 7、8 或 9。" + +#: ../../library/pyb.UART.rst:74 +msgid "``parity`` is the parity, ``None``, 0 (even) or 1 (odd)." +msgstr "``parity`` 是奇偶校验,``None``、0(偶数)或 1(奇数)。" + +#: ../../library/pyb.UART.rst:75 +msgid "``stop`` is the number of stop bits, 1 or 2." +msgstr "``stop`` 是停止位数,为 1 或 2。" + +#: ../../library/pyb.UART.rst:76 +msgid "" +"``flow`` sets the flow control type. Can be 0, ``UART.RTS``, ``UART.CTS``" +" or ``UART.RTS | UART.CTS``." +msgstr "" +"``flow`` 设置流控制类型。可以是 0, ``UART.RTS``, ``UART.CTS`` 或 ``UART.RTS | " +"UART.CTS``。" + +#: ../../library/pyb.UART.rst:78 +msgid "" +"``timeout`` is the timeout in milliseconds to wait for writing/reading " +"the first character." +msgstr "``timeout`` 是等待写入/读取第一个字符的超时时间(毫秒)。" + +#: ../../library/pyb.UART.rst:79 +msgid "" +"``timeout_char`` is the timeout in milliseconds to wait between " +"characters while writing or reading." +msgstr "``timeout_char`` 是写入或读取时等待字符之间的超时时间(毫秒)。" + +#: ../../library/pyb.UART.rst:80 +msgid "" +"``read_buf_len`` is the character length of the read buffer (0 to " +"disable)." +msgstr "``read_buf_len`` 是读取缓冲区的字符长度(0 禁用)。" + +#: ../../library/pyb.UART.rst:82 +#, python-format +msgid "" +"This method will raise an exception if the baudrate could not be set " +"within 5% of the desired value." +msgstr "如果无法在期望值的 5% 内设置波特率,则此方法将引发异常。" + +#: ../../library/pyb.UART.rst:90 +msgid "Turn off the UART bus." +msgstr "关闭 UART 总线。" + +#: ../../library/pyb.UART.rst:94 +msgid "Returns the number of bytes waiting (may be 0)." +msgstr "返回等待的字节数(可能为 0)。" + +#: ../../library/pyb.UART.rst:98 +msgid "" +"Read characters. If ``nbytes`` is specified then read at most that many " +"bytes. If ``nbytes`` are available in the buffer, returns immediately, " +"otherwise returns when sufficient characters arrive or the timeout " +"elapses." +msgstr "" +"读取字符。如果指定了 ``nbytes``,则最多读取该数量的字节。如果缓冲区中有足够数量的 " +"``nbytes``,则立即返回,否则在足够的字符到达或超时后返回。" + +#: ../../library/pyb.UART.rst:102 +msgid "" +"If ``nbytes`` is not given then the method reads as much data as " +"possible. It returns after the timeout has elapsed." +msgstr "如果未给出 ``nbytes``,则该方法读取尽可能多的数据。在超时后返回。" + +#: ../../library/pyb.UART.rst:105 +msgid "" +"*Note:* for 9 bit characters each character takes two bytes, ``nbytes`` " +"must be even, and the number of characters is ``nbytes/2``." +msgstr "*注意:* 对于 9 位字符,每个字符占两个字节,``nbytes`` 必须是偶数,字符的数量为 ``nbytes/2``。" + +#: ../../library/pyb.UART.rst:108 +msgid "" +"Return value: a bytes object containing the bytes read in. Returns " +"``None`` on timeout." +msgstr "返回值:包含读取的字节的 bytes 对象。超时时返回 ``None``。" + +#: ../../library/pyb.UART.rst:113 +msgid "Receive a single character on the bus." +msgstr "在总线上接收单个字符。" + +#: ../../library/pyb.UART.rst:115 +msgid "Return value: The character read, as an integer. Returns -1 on timeout." +msgstr "返回值:读取的字符,作为整数。超时时返回 -1。" + +#: ../../library/pyb.UART.rst:119 +msgid "" +"Read bytes into the ``buf``. If ``nbytes`` is specified then read at " +"most that many bytes. Otherwise, read at most ``len(buf)`` bytes." +msgstr "将字节读入 ``buf``。如果指定了 ``nbytes``,则最多读取该数量的字节。否则,最多读取 ``len(buf)`` 字节。" + +#: ../../library/pyb.UART.rst:122 +msgid "" +"Return value: number of bytes read and stored into ``buf`` or ``None`` on" +" timeout." +msgstr "返回值:读取并存储到 ``buf`` 中的字节数,或超时时返回 ``None``。" + +#: ../../library/pyb.UART.rst:127 +msgid "" +"Read a line, ending in a newline character. If such a line exists, return" +" is immediate. If the timeout elapses, all available data is returned " +"regardless of whether a newline exists." +msgstr "读取一行,以换行符结束。如果存在这样的行,则立即返回。如果超时,则返回所有可用数据,而不管是否存在换行符。" + +#: ../../library/pyb.UART.rst:131 +msgid "" +"Return value: the line read or ``None`` on timeout if no data is " +"available." +msgstr "返回值:读取的行或超时时返回 ``None`` (如果没有可用数据)。" + +#: ../../library/pyb.UART.rst:135 +msgid "" +"Write the buffer of bytes to the bus. If characters are 7 or 8 bits wide" +" then each byte is one character. If characters are 9 bits wide then two" +" bytes are used for each character (little endian), and ``buf`` must " +"contain an even number of bytes." +msgstr "" +"将字节缓冲区写入总线。如果字符宽度为 7 或 8 位,则每个字节为一个字符。如果字符宽度为 9 位,则每个字符使用两个字节(小端序),并且 " +"``buf`` 必须包含偶数个字节。" + +#: ../../library/pyb.UART.rst:140 +msgid "" +"Return value: number of bytes written. If a timeout occurs and no bytes " +"were written returns ``None``." +msgstr "返回值:写入的字节数。如果发生超时并且没有写入任何字节,则返回 ``None``。" + +#: ../../library/pyb.UART.rst:145 +msgid "" +"Write a single character on the bus. ``char`` is an integer to write. " +"Return value: ``None``. See note below if CTS flow control is used." +msgstr "在总线上写入单个字符。``char`` 是要写入的整数。返回值:``None``。如果使用了 CTS 流控制,请参阅下面的注意事项。" + +#: ../../library/pyb.UART.rst:150 +msgid "" +"Send a break condition on the bus. This drives the bus low for a " +"duration of 13 bits. Return value: ``None``." +msgstr "在总线上发送中断条件。这将使总线低电平持续 13 位时间。返回值:``None``。" + +#: ../../library/pyb.UART.rst:155 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.UART.rst:160 +msgid "to select the flow control type." +msgstr "选择流控制类型。" + +#: ../../library/pyb.UART.rst:163 +msgid "Flow Control" +msgstr "流控制" + +#: ../../library/pyb.UART.rst:165 +msgid "" +"``UART(3)`` support RTS/CTS hardware flow control using the following " +"pins:" +msgstr "``UART(3)`` 使用以下接口支持 RTS/CTS 硬件流控制:" + +#: ../../library/pyb.UART.rst:167 +msgid "" +"``UART(3)`` is on :``(TX, RX, nRTS, nCTS) = (P4, P5, P1, P2) = (PB10, " +"PB11, PB14, PB13)``" +msgstr "" +"``UART(3)`` 开启 :``(TX, RX, nRTS, nCTS) = (P4, P5, P1, P2) = (PB10, PB11, " +"PB14, PB13)``" + +#: ../../library/pyb.UART.rst:169 +msgid "" +"In the following paragraphs the term \"target\" refers to the device " +"connected to the UART." +msgstr "在以下段落中,“目标”一词指的是连接到 UART 的设备。" + +#: ../../library/pyb.UART.rst:172 +msgid "" +"When the UART's ``init()`` method is called with ``flow`` set to one or " +"both of ``UART.RTS`` and ``UART.CTS`` the relevant flow control pins are " +"configured. ``nRTS`` is an active low output, ``nCTS`` is an active low " +"input with pullup enabled. To achieve flow control the Pyboard's ``nCTS``" +" signal should be connected to the target's ``nRTS`` and the Pyboard's " +"``nRTS`` to the target's ``nCTS``." +msgstr "" +"当调用 UART 的 ``init()`` 方法并将 ``flow`` 设置为 ``UART.RTS`` 和 ``UART.CTS`` " +"中的一个或两个时,相关的流控制引脚将被配置。``nRTS`` 是一个低电平输出,``nCTS`` " +"是一个启用了上拉的低电平输入。要实现流控制,Pyboard 的 ``nCTS`` 信号应连接到目标的 ``nRTS``,Pyboard 的 " +"``nRTS`` 应连接到目标的 ``nCTS``。" + +#: ../../library/pyb.UART.rst:179 +msgid "CTS: target controls OpenMV Cam transmitter" +msgstr "CTS: 目标控制 OpenMV Cam 发射机" + +#: ../../library/pyb.UART.rst:181 +msgid "If CTS flow control is enabled the write behaviour is as follows:" +msgstr "如果启用了 CTS 流控制,则写入行为如下:" + +#: ../../library/pyb.UART.rst:183 +msgid "" +"If the OpenMV Cam's ``UART.write(buf)`` method is called, transmission " +"will stall for any periods when ``nCTS`` is ``False``. This will result " +"in a timeout if the entire buffer was not transmitted in the timeout " +"period. The method returns the number of bytes written, enabling the user" +" to write the remainder of the data if required. In the event of a " +"timeout, a character will remain in the UART pending ``nCTS``. The number" +" of bytes composing this character will be included in the return value." +msgstr "" +"如果调用 OpenMV Cam 的 ``UART.write(buf)`` 方法,则在 ``nCTS`` 为 ``False`` " +"时,传输将暂停。如果在超时期间未传输整个缓冲区,则会导致超时。该方法返回写入的字节数,使用户可以在需要时写入剩余数据。在超时情况下,一个字符将保留在" +" UART 中等待 ``nCTS``。组成此字符的字节数将包括在返回值中。" + +#: ../../library/pyb.UART.rst:190 +msgid "" +"If ``UART.writechar()`` is called when ``nCTS`` is ``False`` the method " +"will time out unless the target asserts ``nCTS`` in time. If it times out" +" ``OSError 116`` will be raised. The character will be transmitted as " +"soon as the target asserts ``nCTS``." +msgstr "" +"如果在 ``nCTS`` 为 ``False`` 时调用 ``UART.writechar()``,则该方法将超时,除非目标及时断言 " +"``nCTS``。如果超时,将引发 ``OSError 116``。字符将在目标断言 ``nCTS`` 后立即传输。" + +#: ../../library/pyb.UART.rst:195 +msgid "RTS: OpenMV Cam controls target's transmitter" +msgstr "RTS: OpenMV Cam 控制目标的发射机" + +#: ../../library/pyb.UART.rst:197 +msgid "If RTS flow control is enabled, behaviour is as follows:" +msgstr "如果启用了 RTS 流控制,则行为如下:" + +#: ../../library/pyb.UART.rst:199 +msgid "" +"If buffered input is used (``read_buf_len`` > 0), incoming characters are" +" buffered. If the buffer becomes full, the next character to arrive will " +"cause ``nRTS`` to go ``False``: the target should cease transmission. " +"``nRTS`` will go ``True`` when characters are read from the buffer." +msgstr "" +"如果使用了缓冲输入(``read_buf_len`` > 0),则会对输入的字符进行缓冲。如果缓冲区变满,下一个到达的字符将导致 ``nRTS``" +" 变为 ``False``:目标应停止传输。当从缓冲区中读取字符时,``nRTS`` 将变为 ``True``。" + +#: ../../library/pyb.UART.rst:204 +msgid "" +"Note that the ``any()`` method returns the number of bytes in the buffer." +" Assume a buffer length of ``N`` bytes. If the buffer becomes full, and " +"another character arrives, ``nRTS`` will be set False, and ``any()`` will" +" return the count ``N``. When characters are read the additional " +"character will be placed in the buffer and will be included in the result" +" of a subsequent ``any()`` call." +msgstr "" +"请注意,``any()`` 方法返回缓冲区中的字节数。假设缓冲区长度为 ``N`` 字节。如果缓冲区变满,并且另一个字符到达,则 ``nRTS``" +" 将被设置为 False,并且 ``any()`` 将返回计数 ``N``。当读取字符时,附加字符将放置在缓冲区中,并将包含在随后的 " +"``any()`` 调用结果中。" + +#: ../../library/pyb.UART.rst:210 +msgid "" +"If buffered input is not used (``read_buf_len`` == 0) the arrival of a " +"character will cause ``nRTS`` to go ``False`` until the character is " +"read." +msgstr "如果未使用缓冲输入(``read_buf_len`` == 0),则到达字符将导致 ``nRTS`` 变为 ``False``,直到读取该字符。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_HID.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_HID.po new file mode 100644 index 0000000000000..cedc909bcffab --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_HID.po @@ -0,0 +1,83 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.USB_HID.rst:5 +msgid "class USB_HID -- USB Human Interface Device (HID)" +msgstr "class USB_HID -- USB人机接口设备(HID)" + +#: ../../library/pyb.USB_HID.rst:7 +msgid "" +"The USB_HID class allows creation of an object representing the USB Human" +" Interface Device (HID) interface. It can be used to emulate a " +"peripheral such as a mouse or keyboard." +msgstr "USB_HID类允许创建表示USB人机接口设备(HID)接口的对象。它可用于模拟鼠标或键盘" +"等外设。" + +#: ../../library/pyb.USB_HID.rst:11 +msgid "" +"Before you can use this class, you need to use :meth:`pyb.usb_mode()` to " +"set the USB mode to include the HID interface." +msgstr "在使用此类之前,您需要使用 :meth:`pyb.usb_mode()` 将USB模式设置为包含HID接口。" + +#: ../../library/pyb.USB_HID.rst:14 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.USB_HID.rst:18 +msgid "Create a new USB_HID object." +msgstr "创建一个新的 USB_HID 对象。" + +#: ../../library/pyb.USB_HID.rst:22 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.USB_HID.rst:26 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/pyb.USB_HID.rst:28 +msgid "" +"``data`` can be an integer, which is the number of bytes to receive, or a" +" mutable buffer, which will be filled with received bytes." +msgstr "``data`` 可以是一个整数,表示要接收的字节数,或者是一个可变缓冲区,将填充接收" +"到的字节。" + +#: ../../library/pyb.USB_HID.rst:30 +msgid "``timeout`` is the timeout in milliseconds to wait for the receive." +msgstr "``timeout`` 是等待接收的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.USB_HID.rst:32 +msgid "" +"Return value: if ``data`` is an integer then a new buffer of the bytes " +"received, otherwise the number of bytes read into ``data`` is returned." +msgstr "返回值:如果 ``data`` 是一个整数,则返回接收到的字节的新缓冲区,否则返回读入 " +"``data`` 的字节数。" + +#: ../../library/pyb.USB_HID.rst:37 +msgid "Send data over the USB HID interface:" +msgstr "通过USB HID接口发送数据:" + +#: ../../library/pyb.USB_HID.rst:39 +msgid "``data`` is the data to send (a tuple/list of integers, or a bytearray)." +msgstr "``data`` 是要发送的数据(整数的元组/列表,或一个bytearray)。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_VCP.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_VCP.po new file mode 100644 index 0000000000000..9cfa38997e745 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.USB_VCP.po @@ -0,0 +1,227 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/pyb.USB_VCP.rst:5 +msgid "class USB_VCP -- USB virtual comm port" +msgstr "class USB_VCP -- USB虚拟通讯端口" + +#: ../../library/pyb.USB_VCP.rst:7 +msgid "" +"The USB_VCP class allows creation of a :std:term:`stream`-like object " +"representing the USB virtual comm port. It can be used to read and write" +" data over USB to the connected host." +msgstr "USB_VCP类允许创建表示USB虚拟通讯端口的类似 :std:term:`stream` " +"的对象。它可用于通过USB与连接的主机读写数据。" + +#: ../../library/pyb.USB_VCP.rst:13 +msgid "Constructors" +msgstr "构造" + +#: ../../library/pyb.USB_VCP.rst:17 +msgid "" +"Create a new USB_VCP object. The *id* argument specifies which USB VCP " +"port to use." +msgstr "创建一个新的USB_VCP对象。*id* 参数指定要使用哪个USB VCP端口。" + +#: ../../library/pyb.USB_VCP.rst:20 +msgid "Create a new USB_VCP object." +msgstr "创建一个新的 USB_VCP 对象。" + +#: ../../library/pyb.USB_VCP.rst:23 +msgid "Methods" +msgstr "方法" + +#: ../../library/pyb.USB_VCP.rst:27 +msgid "" +"Configure the USB VCP port. If the *flow* argument is not -1 then the " +"value sets the flow control, which can be a bitwise-or of ``USB_VCP.RTS``" +" and ``USB_VCP.CTS``. RTS is used to control read behaviour and CTS, to " +"control write behaviour." +msgstr "" +"配置USB VCP端口。如果 *flow* 参数不是-1,则该值设置流控制,它可以是 ``USB_VCP.RTS`` 和 " +"``USB_VCP.CTS`` 的按位或。RTS用于控制读取行为,CTS用于控制写入行为。" + +#: ../../library/pyb.USB_VCP.rst:33 +msgid "" +"Set the character which interrupts running Python code. This is set to 3" +" (CTRL-C) by default, and when a CTRL-C character is received over the " +"USB VCP port, a KeyboardInterrupt exception is raised." +msgstr "" +"设置中断正在运行的Python代码的字符。默认情况下,这设置为3(CTRL-C)," +"当通过USB VCP端口接收到CTRL-C字符时,会引发KeyboardInterrupt异常。" + +#: ../../library/pyb.USB_VCP.rst:37 +msgid "" +"Set to -1 to disable this interrupt feature. This is useful when you " +"want to send raw bytes over the USB VCP port." +msgstr "设置为-1以禁用此中断功能。当您想通过USB VCP端口发送原始字节时,这很有用。" + +#: ../../library/pyb.USB_VCP.rst:42 +msgid "Return ``True`` if USB is connected as a serial device, else ``False``." +msgstr "如果USB已连接为串行设备,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/pyb.USB_VCP.rst:46 +msgid "Return ``True`` if OpenMV IDE is connected to the OpenMV Cam." +msgstr "如果OpenMV IDE 连接到 OpenMV CAM 那么返回 ``True``。" + +#: ../../library/pyb.USB_VCP.rst:50 +msgid "Return ``True`` if any characters waiting, else ``False``." +msgstr "如果有任何等待的字符,则返回 ``True``,否则返回 ``False``。" + +#: ../../library/pyb.USB_VCP.rst:54 +msgid "" +"This method does nothing. It exists so the USB_VCP object can act as a " +"file." +msgstr "此方法什么也不做。它存在是为了USB_VCP对象可以充当文件。" + +#: ../../library/pyb.USB_VCP.rst:59 +msgid "" +"Read at most ``nbytes`` from the serial device and return them as a bytes" +" object. If ``nbytes`` is not specified then the method reads all " +"available bytes from the serial device. USB_VCP :std:term:`stream` " +"implicitly works in non-blocking mode, so if no pending data available, " +"this method will return immediately with ``None`` value." +msgstr "" +"从串行设备中最多读取 ``nbytes`` 字节,并将它们作为一个字节对象返回。" +"如果未指定 ``nbytes``,则该方法从串行设备读取所有可用的字节。USB_VCP " +":std:term:`stream` 隐式地在非阻塞模式下工作,因此,如果没有挂起的数据可用," +"则此方法将立即返回带有 ``None`` 值。" + +#: ../../library/pyb.USB_VCP.rst:68 +msgid "" +"Read bytes from the serial device and store them into ``buf``, which " +"should be a buffer-like object. At most ``len(buf)`` bytes are read. If " +"``maxlen`` is given and then at most ``min(maxlen, len(buf))`` bytes are " +"read." +msgstr "" +"从串行设备中读取字节并将其存储到 ``buf`` 中,``buf`` " +"应该是一个类似缓冲区的对象。最多读取 ``len(buf)`` 字节。如果给出了 " +"``maxlen``,则最多读取 ``min(maxlen, len(buf))`` 字节。" + +#: ../../library/pyb.USB_VCP.rst:73 +msgid "" +"Returns the number of bytes read and stored into ``buf`` or ``None`` if " +"no pending data available." +msgstr "返回读取并存储到 ``buf`` 中的字节数,如果没有挂起的数据可用,则返回 " +"``None``。" + +#: ../../library/pyb.USB_VCP.rst:78 +msgid "Read a whole line from the serial device." +msgstr "从串行设备中读取一整行。" + +#: ../../library/pyb.USB_VCP.rst:80 +msgid "" +"Returns a bytes object containing the data, including the trailing " +"newline character or ``None`` if no pending data available." +msgstr "返回一个包含数据的字节对象,包括尾随的换行字符,如果没有挂起的数据可用," +"则返回 ``None``。" + +#: ../../library/pyb.USB_VCP.rst:85 +msgid "" +"Read as much data as possible from the serial device, breaking it into " +"lines." +msgstr "尽可能多地从串行设备中读取数据,将其分解为行。" + +#: ../../library/pyb.USB_VCP.rst:88 +msgid "" +"Returns a list of bytes objects, each object being one of the lines. Each" +" line will include the newline character." +msgstr "返回一个字节对象列表,每个对象都是其中一行。每行将包括换行字符。" + +#: ../../library/pyb.USB_VCP.rst:93 +msgid "Write the bytes from ``buf`` to the serial device." +msgstr "将 ``buf`` 中的字节写入串行设备。" + +#: ../../library/pyb.USB_VCP.rst:95 +msgid "Returns the number of bytes written." +msgstr "返回写入的字节数。" + +#: ../../library/pyb.USB_VCP.rst:99 +msgid "Receive data on the bus:" +msgstr "在总线上接收数据:" + +#: ../../library/pyb.USB_VCP.rst:101 +msgid "" +"``data`` can be an integer, which is the number of bytes to receive, or a" +" mutable buffer, which will be filled with received bytes." +msgstr "``data`` 可以是一个整数,表示要接收的字节数,或者是一个可变缓冲区,将填充接收" +"到的字节。" + +#: ../../library/pyb.USB_VCP.rst:103 +msgid "``timeout`` is the timeout in milliseconds to wait for the receive." +msgstr "``timeout`` 是等待接收的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.USB_VCP.rst:105 +msgid "" +"Return value: if ``data`` is an integer then a new buffer of the bytes " +"received, otherwise the number of bytes read into ``data`` is returned." +msgstr "返回值:如果 ``data`` 是一个整数,则返回接收到的字节的新缓冲区,否则返回读入 " +"``data`` 的字节数。" + +#: ../../library/pyb.USB_VCP.rst:110 +msgid "Send data over the USB VCP:" +msgstr "通过 USB VCP 发送数据:" + +#: ../../library/pyb.USB_VCP.rst:112 +msgid "``data`` is the data to send (an integer to send, or a buffer object)." +msgstr "``data`` 是要发送的数据(要发送的整数或缓冲区对象)。" + +#: ../../library/pyb.USB_VCP.rst:113 +msgid "``timeout`` is the timeout in milliseconds to wait for the send." +msgstr "``timeout`` 是等待发送的超时时间(以毫秒为单位)。" + +#: ../../library/pyb.USB_VCP.rst:115 +msgid "Return value: number of bytes sent." +msgstr "返回值:发送的字节数。" + +#: ../../library/pyb.USB_VCP.rst:119 +msgid "" +"Register *handler* to be called whenever an event specified by *trigger* " +"occurs. The *handler* function must take exactly one argument, which " +"will be the USB VCP object. Pass in ``None`` to disable the callback." +msgstr "" +"注册 *handler*,以便在发生 *trigger* 指定的事件时调用。*handler* 函数必须接受一个参数,这将是USB " +"VCP对象。传入 ``None`` 以禁用回调。" + +#: ../../library/pyb.USB_VCP.rst:123 +msgid "Valid values for *trigger* are:" +msgstr "*trigger* 的有效值为:" + +#: ../../library/pyb.USB_VCP.rst:125 +msgid "" +"``USB_VCP.IRQ_RX``: new data is available for reading from the USB VCP " +"object." +msgstr "``USB_VCP.IRQ_RX``:可从 USB VCP 对象读取新数据。" + +#: ../../library/pyb.USB_VCP.rst:129 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.USB_VCP.rst:134 +msgid "to select the flow control type." +msgstr "选择流控制类型。" + +#: ../../library/pyb.USB_VCP.rst:138 +msgid "IRQ trigger values for :meth:`USB_VCP.irq`." +msgstr ":meth:`USB_VCP.irq` 的IRQ触发值。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/pyb.po b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.po new file mode 100644 index 0000000000000..9a2148f3844f4 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/pyb.po @@ -0,0 +1,436 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/pyb.rst:2 +msgid ":mod:`pyb` --- functions related to the board" +msgstr ":mod:`pyb` --- 与板子相关的函数" + +#: ../../library/pyb.rst:7 +msgid "The ``pyb`` module contains specific functions related to the board." +msgstr "``pyb`` 模块包含与板子相关的特定函数。" + +#: ../../library/pyb.rst:10 +msgid "Time related functions" +msgstr "与时间相关函数" + +#: ../../library/pyb.rst:14 +msgid "Delay for the given number of milliseconds." +msgstr "延迟给定的毫秒数。" + +#: ../../library/pyb.rst:18 +msgid "Delay for the given number of microseconds." +msgstr "延迟给定的微秒数。" + +#: ../../library/pyb.rst:22 +msgid "Returns the number of milliseconds since the board was last reset." +msgstr "返回自上次重置板子以来的毫秒数。" + +#: ../../library/pyb.rst:24 +msgid "" +"The result is always a MicroPython smallint (31-bit signed number), so " +"after 2^30 milliseconds (about 12.4 days) this will start to return " +"negative numbers." +msgstr "结果始终为 MicroPython 的小整数(31位有符号数),因此在 2^30毫秒(约12.4天)后,此函数将开始返回负数。" + +#: ../../library/pyb.rst:28 +msgid "" +"Note that if :meth:`pyb.stop()` is issued the hardware counter supporting" +" this function will pause for the duration of the \"sleeping\" state. " +"This will affect the outcome of :meth:`pyb.elapsed_millis()`." +msgstr "" +"请注意,如果发出 :meth:`pyb.stop()` 命令,则支持此函数的硬件计数器将在“休眠”状态的持续时间内暂停。这会影响 " +":meth:`pyb.elapsed_millis()` 的结果。" + +#: ../../library/pyb.rst:34 +msgid "Returns the number of microseconds since the board was last reset." +msgstr "返回自上次重置板子以来的微秒数。" + +#: ../../library/pyb.rst:36 +msgid "" +"The result is always a MicroPython smallint (31-bit signed number), so " +"after 2^30 microseconds (about 17.8 minutes) this will start to return " +"negative numbers." +msgstr "结果始终为 MicroPython 的小整数(31 位有符号数),因此在 2^30 微秒(约 17.8 分钟)后,此函数将开始返回负数。" + +#: ../../library/pyb.rst:40 +msgid "" +"Note that if :meth:`pyb.stop()` is issued the hardware counter supporting" +" this function will pause for the duration of the \"sleeping\" state. " +"This will affect the outcome of :meth:`pyb.elapsed_micros()`." +msgstr "" +"请注意,如果发出 :meth:`pyb.stop()` 命令,则支持此函数的硬件计数器将在“休眠”状态的持续时间内暂停。这会影响 " +":meth:`pyb.elapsed_micros()` 的结果。" + +#: ../../library/pyb.rst:46 +msgid "Returns the number of milliseconds which have elapsed since ``start``." +msgstr "返回自 ``start`` 以来经过的毫秒数。" + +#: ../../library/pyb.rst:48 +msgid "" +"This function takes care of counter wrap, and always returns a positive " +"number. This means it can be used to measure periods up to about 12.4 " +"days." +msgstr "此函数会处理计数器溢出,并始终返回正数。这意味着它可用于测量长达约 12.4 天的时间段。" + +#: ../../library/pyb.rst:51 ../../library/pyb.rst:64 +msgid "Example::" +msgstr "例子::" + +#: ../../library/pyb.rst:59 +msgid "Returns the number of microseconds which have elapsed since ``start``." +msgstr "返回自 ``start`` 以来经过的微秒数。" + +#: ../../library/pyb.rst:61 +msgid "" +"This function takes care of counter wrap, and always returns a positive " +"number. This means it can be used to measure periods up to about 17.8 " +"minutes." +msgstr "此函数会处理计数器溢出,并始终返回正数。这意味着它可用于测量长达约 17.8 分钟的时间段。" + +#: ../../library/pyb.rst:72 +msgid "Reset related functions" +msgstr "与重置相关的函数" + +#: ../../library/pyb.rst:76 +msgid "" +"Resets the OpenMV Cam in a manner similar to pushing the external RESET " +"button." +msgstr "以类似于按下外部 RESET 按钮的方式重置 OpenMV Cam。" + +#: ../../library/pyb.rst:81 +msgid "Activate the bootloader without BOOT\\* pins." +msgstr "激活引导加载程序,而无需 BOOT\\* 引脚。" + +#: ../../library/pyb.rst:85 +msgid "" +"Enable or disable hard-fault debugging. A hard-fault is when there is a " +"fatal error in the underlying system, like an invalid memory access." +msgstr "启用或禁用硬件故障调试。当底层系统出现致命错误,如无效内存访问时,会发生硬件故障。" + +#: ../../library/pyb.rst:88 +msgid "" +"If the *value* argument is ``False`` then the board will automatically " +"reset if there is a hard fault." +msgstr "如果 *value* 参数为 ``False``,则如果出现硬件故障,则板子将自动复位。" + +#: ../../library/pyb.rst:91 +msgid "" +"If *value* is ``True`` then, when the board has a hard fault, it will " +"print the registers and the stack trace, and then cycle the LEDs " +"indefinitely." +msgstr "如果 *value* 为 ``True``,则当板子发生硬件故障时,它将打印寄存器和堆栈跟踪,然后无限循环 LED。" + +#: ../../library/pyb.rst:94 +msgid "The default value is disabled, i.e. to automatically reset." +msgstr "默认值为禁用,即自动复位。" + +#: ../../library/pyb.rst:97 +msgid "Interrupt related functions" +msgstr "与中断相关的函数" + +#: ../../library/pyb.rst:101 +msgid "" +"Disable interrupt requests. Returns the previous IRQ state: " +"``False``/``True`` for disabled/enabled IRQs respectively. This return " +"value can be passed to enable_irq to restore the IRQ to its original " +"state." +msgstr "" +"禁用中断请求。返回先前的IRQ状态:对于禁用的/启用的IRQ,分别返回 " +"``False``/``True``。此返回值可传递给enable_irq以恢复IRQ到其原始状态。" + +#: ../../library/pyb.rst:108 +msgid "" +"Enable interrupt requests. If ``state`` is ``True`` (the default value) " +"then IRQs are enabled. If ``state`` is ``False`` then IRQs are disabled." +" The most common use of this function is to pass it the value returned " +"by ``disable_irq`` to exit a critical section." +msgstr "" +"启用中断请求。如果 ``state`` 为 ``True`` (默认值),则启用IRQ。如果 ``state`` 为 " +"``False``,则禁用IRQ。这个函数的最常见用法是将 ``disable_irq`` 返回的值传递给它,以退出临界区。" + +#: ../../library/pyb.rst:115 +msgid "Power related functions" +msgstr "与电源相关的函数" + +#: ../../library/pyb.rst:119 +msgid "Wait for an internal or external interrupt." +msgstr "等待内部或外部中断。" + +#: ../../library/pyb.rst:121 +msgid "" +"This executes a ``wfi`` instruction which reduces power consumption of " +"the MCU until any interrupt occurs (be it internal or external), at which" +" point execution continues. Note that the system-tick interrupt occurs " +"once every millisecond (1000Hz) so this function will block for at most " +"1ms." +msgstr "" +"这会执行一个 ``wfi`` " +"指令,该指令会降低MCU的功耗,直到发生任何中断(无论是内部还是外部),此时执行会继续。请注意,系统滴答中断每毫秒发生一次(1000Hz),因此此函数最多会阻塞1ms。" + +#: ../../library/pyb.rst:129 +msgid "Put the OpenMV Cam in a \"sleeping\" state." +msgstr "将OpenMV Cam置于“休眠”状态。" + +#: ../../library/pyb.rst:131 +msgid "" +"This reduces power consumption to less than 500 uA. To wake from this " +"sleep state requires an external interrupt or a real-time-clock event. " +"Upon waking execution continues where it left off." +msgstr "这将使功耗降低到低于500微安。要从此睡眠状态唤醒,需要外部中断或一个实时时钟事件。唤醒后,执行会在之前离开的地方继续。" + +#: ../../library/pyb.rst:135 ../../library/pyb.rst:145 +msgid "See :meth:`rtc.wakeup` to configure a real-time-clock wakeup event." +msgstr "有关配置实时时钟唤醒事件,请参阅 :meth:`rtc.wakeup`。" + +#: ../../library/pyb.rst:139 +msgid "Put the OpenMV Cam into a \"deep sleep\" state." +msgstr "将 OpenMV Cam 置于“深度睡眠”状态。" + +#: ../../library/pyb.rst:141 +msgid "" +"This reduces power consumption to less than 50 uA. To wake from this " +"sleep state requires a real-time-clock event. Upon waking the system " +"undergoes a hard reset." +msgstr "这将使功耗降低到低于 50 微安。要从此睡眠状态唤醒,需要一个实时时钟事件。唤醒后,系统会执行硬复位。" + +#: ../../library/pyb.rst:148 +msgid "Miscellaneous functions" +msgstr "杂项函数" + +#: ../../library/pyb.rst:152 +msgid "Return True if USB is connected as a serial device, False otherwise." +msgstr "如果USB连接为串行设备,则返回True,否则返回False。" + +#: ../../library/pyb.rst:154 +msgid "This function is deprecated. Use pyb.USB_VCP().isconnected() instead." +msgstr "此函数已被弃用。请改用 pyb.USB_VCP().isconnected() instead。" + +#: ../../library/pyb.rst:158 +msgid "" +"Takes a 4-tuple (or list) and sends it to the USB host (the PC) to signal" +" a HID mouse-motion event." +msgstr "获取一个4元组(或列表)并将其发送到USB主机(PC)以发送HID鼠标移动事件。" + +#: ../../library/pyb.rst:161 +msgid "This function is deprecated. Use :meth:`pyb.USB_HID.send()` instead." +msgstr "此函数已被弃用。请改用 :meth:`pyb.USB_HID.send()`。" + +#: ../../library/pyb.rst:165 +msgid "Print out lots of information about the board." +msgstr "打印关于板子的大量信息。" + +#: ../../library/pyb.rst:169 +msgid "" +"Set the filename of the main script to run after :ref:`boot.py` is " +"finished. If this function is not called then the default file " +":ref:`main.py` will be executed." +msgstr "设置在 :ref:`boot.py` 完成后运行的主脚本文件名。如果未调用此函数,则将执行默认文件 :ref:`main.py`。" + +#: ../../library/pyb.rst:173 +msgid "It only makes sense to call this function from within boot.py." +msgstr "仅在 boot.py 中调用此函数才有意义。" + +#: ../../library/pyb.rst:177 +msgid "" +"This function is deprecated. Mounting and unmounting devices should be " +"performed by :meth:`vfs.mount` and :meth:`vfs.umount` instead." +msgstr "此函数已被弃用。设备的挂载和卸载应通过 :meth:`vfs.mount` 和 :meth:`vfs.umount` 来执行。" + +#: ../../library/pyb.rst:180 +msgid "" +"Mount a block device and make it available as part of the filesystem. " +"``device`` must be an object that provides the block protocol. (The " +"following is also deprecated. See :class:`vfs.AbstractBlockDev` for the " +"correct way to create a block device.)" +msgstr "" +"挂载一个块设备并将其作为文件系统的一部分使其可用。``device`` 必须是一个提供块协议的对象。(以下内容也已弃用。请参见 " +":class:`vfs.AbstractBlockDev` 了解正确的块设备创建方式。)" + +#: ../../library/pyb.rst:185 +msgid "``readblocks(self, blocknum, buf)``" +msgstr "``readblocks(self, blocknum, buf)``" + +#: ../../library/pyb.rst:186 +msgid "``writeblocks(self, blocknum, buf)`` (optional)" +msgstr "``writeblocks(self, blocknum, buf)`` (可选)" + +#: ../../library/pyb.rst:187 +msgid "``count(self)``" +msgstr "``count(self)``" + +#: ../../library/pyb.rst:188 +msgid "``sync(self)`` (optional)" +msgstr "``sync(self)`` (可选)" + +#: ../../library/pyb.rst:190 +msgid "" +"``readblocks`` and ``writeblocks`` should copy data between ``buf`` and " +"the block device, starting from block number ``blocknum`` on the device. " +"``buf`` will be a bytearray with length a multiple of 512. If " +"``writeblocks`` is not defined then the device is mounted read-only. The " +"return value of these two functions is ignored." +msgstr "" +"``readblocks`` 和 ``writeblocks`` 应该在设备上从块号 ``blocknum`` 开始将数据复制到 ``buf`` " +"和设备之间。``buf`` 将是一个长度为 512 的倍数的字节数组。如果未定义 " +"``writeblocks``,则将只读方式挂载设备。这两个函数的返回值将被忽略。" + +#: ../../library/pyb.rst:196 +msgid "" +"``count`` should return the number of blocks available on the device. " +"``sync``, if implemented, should sync the data on the device." +msgstr "``count`` 应该返回设备上可用的块数。``sync``,如果实现了,应该同步设备上的数据。" + +#: ../../library/pyb.rst:199 +msgid "" +"The parameter ``mountpoint`` is the location in the root of the " +"filesystem to mount the device. It must begin with a forward-slash." +msgstr "参数 ``mountpoint`` 是文件系统根目录中挂载设备的位置。它必须以斜杠开头。" + +#: ../../library/pyb.rst:202 +msgid "" +"If ``readonly`` is ``True``, then the device is mounted read-only, " +"otherwise it is mounted read-write." +msgstr "如果 ``readonly`` 为 ``True``,则以只读方式挂载设备,否则以读写方式挂载。" + +#: ../../library/pyb.rst:205 +msgid "" +"If ``mkfs`` is ``True``, then a new filesystem is created if one does not" +" already exist." +msgstr "如果 ``mkfs`` 为 ``True``,则如果不存在文件系统,则创建一个新的文件系统。" + +#: ../../library/pyb.rst:210 +msgid "Get or set the UART object where the REPL is repeated on." +msgstr "获取或设置 REPL 重复的 UART 对象。" + +#: ../../library/pyb.rst:214 +msgid "Return a 30-bit hardware generated random number." +msgstr "返回一个 30 位硬件生成的随机数。" + +#: ../../library/pyb.rst:218 +msgid "Sync all file systems." +msgstr "同步所有文件系统。" + +#: ../../library/pyb.rst:222 +msgid "Returns a string of 12 bytes (96 bits), which is the unique ID of the MCU." +msgstr "返回一个长度为 12 字节(96 位)的字符串,该字符串是 MCU 的唯一 ID。" + +#: ../../library/pyb.rst:226 +msgid "If called with no arguments, return the current USB mode as a string." +msgstr "如果不带参数调用,则以字符串形式返回当前USB模式。" + +#: ../../library/pyb.rst:228 +msgid "" +"If called with *modestr* provided, attempts to configure the USB mode. " +"The following values of *modestr* are understood:" +msgstr "如果在提供了 *modestr* 的情况下调用,则尝试配置 USB 模式。*modestr* 的以下值被理解:" + +#: ../../library/pyb.rst:231 +msgid "``None``: disables USB" +msgstr "``None``:禁用 USB" + +#: ../../library/pyb.rst:232 +msgid "``'VCP'``: enable with VCP (Virtual COM Port) interface" +msgstr "``'VCP'``:启用 VCP(虚拟串口)接口" + +#: ../../library/pyb.rst:233 +msgid "``'MSC'``: enable with MSC (mass storage device class) interface" +msgstr "``'MSC'``:启用 MSC(大容量存储设备类)接口" + +#: ../../library/pyb.rst:234 +msgid "``'VCP+MSC'``: enable with VCP and MSC" +msgstr "``'VCP+MSC'``:启用 VCP 和 MSC" + +#: ../../library/pyb.rst:235 +msgid "``'VCP+HID'``: enable with VCP and HID (human interface device)" +msgstr "``'VCP+HID'``:启用 VCP 和 HID(人机界面设备)" + +#: ../../library/pyb.rst:236 +msgid "" +"``'VCP+MSC+HID'``: enabled with VCP, MSC and HID (only available on PYBD " +"boards)" +msgstr "``'VCP+MSC+HID'``:启用 VCP、MSC 和 HID(仅适用于 PYBD 板)" + +#: ../../library/pyb.rst:238 +msgid "" +"For backwards compatibility, ``'CDC'`` is understood to mean ``'VCP'`` " +"(and similarly for ``'CDC+MSC'`` and ``'CDC+HID'``)." +msgstr "为了向后兼容,``'CDC'`` 被理解为 ``'VCP'``(``'CDC+MSC'`` 和 ``'CDC+HID'`` 也类似)。" + +#: ../../library/pyb.rst:241 +msgid "" +"The *port* parameter should be an integer (0, 1, ...) and selects which " +"USB port to use if the board supports multiple ports. A value of -1 uses" +" the default or automatically selected port." +msgstr "*port* 参数应为整数(0、1、...),并选择要在板支持多个端口的情况下使用的 USB 端口。值为 -1 会使用默认或自动选择的端口。" + +#: ../../library/pyb.rst:245 +msgid "" +"The *vid* and *pid* parameters allow you to specify the VID (vendor id) " +"and PID (product id). A *pid* value of -1 will select a PID based on the" +" value of *modestr*." +msgstr "" +"*vid* 和 *pid* 参数允许您指定 VID(供应商 ID)和 PID(产品 ID)。 *pid* 值为 -1 将根据 *modestr* " +"的值选择 PID。" + +#: ../../library/pyb.rst:249 +msgid "" +"If enabling MSC mode, the *msc* parameter can be used to specify a list " +"of SCSI LUNs to expose on the mass storage interface. For example " +"``msc=(pyb.Flash(), pyb.SDCard())``." +msgstr "" +"如果启用 MSC 模式,则 *msc* 参数可用于指定要在大容量存储接口上公开的 SCSI LUN 列表。例如 " +"``msc=(pyb.Flash(), pyb.SDCard())``。" + +#: ../../library/pyb.rst:253 +msgid "" +"If enabling HID mode, you may also specify the HID details by passing the" +" *hid* keyword parameter. It takes a tuple of (subclass, protocol, max " +"packet length, polling interval, report descriptor). By default it will " +"set appropriate values for a USB mouse. There is also a " +"``pyb.hid_keyboard`` constant, which is an appropriate tuple for a USB " +"keyboard." +msgstr "" +"如果启用 HID 模式,还可以通过传递 *hid* 关键字参数来指定 HID " +"的详细信息。它接受一个元组(子类、协议、最大数据包长度、轮询间隔、报告描述符)。默认情况下,它将设置 USB 鼠标的适当值。还有一个 " +"``pyb.hid_keyboard`` 常量,它是 USB 键盘的适当元组。" + +#: ../../library/pyb.rst:260 +msgid "" +"The *high_speed* parameter, when set to ``True``, enables USB HS mode if " +"it is supported by the hardware." +msgstr "当将 *high_speed* 参数设置为 ``True`` 时,如果硬件支持,则启用 USB HS 模式。" + +#: ../../library/pyb.rst:264 +msgid "Constants" +msgstr "常量" + +#: ../../library/pyb.rst:269 +msgid "" +"A tuple of (subclass, protocol, max packet length, polling interval, " +"report descriptor) to set appropriate values for a USB mouse or keyboard." +msgstr "为 USB 鼠标或键盘设置适当值的元组(子类、协议、最大数据包长度、轮询间隔、报告描述符)。" + +#: ../../library/pyb.rst:273 +msgid "Classes" +msgstr "类" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/random.po b/docs/locale/zh_CN/LC_MESSAGES/library/random.po new file mode 100644 index 0000000000000..01da5260eb008 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/random.po @@ -0,0 +1,135 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/random.rst:2 +msgid ":mod:`random` -- generate random numbers" +msgstr ":mod:`random` -- 生成随机数" + +#: ../../library/random.rst:7 +msgid "This module implements a pseudo-random number generator (PRNG)." +msgstr "该模块实现了一个伪随机数生成器(PRNG)。" + +#: ../../library/random.rst:9 +msgid "|see_cpython_module| :mod:`python:random` ." +msgstr "|see_cpython_module| :mod:`python:random` 。" + +#: ../../library/random.rst:13 +msgid "The following notation is used for intervals:" +msgstr "以下符号用于表示区间:" + +#: ../../library/random.rst:15 +msgid "" +"() are open interval brackets and do not include their endpoints. For " +"example, (0, 1) means greater than 0 and less than 1. In set notation: " +"(0, 1) = {x | 0 < x < 1}." +msgstr "() 表示开区间,不包括端点。例如,(0, 1) 表示大于 0 且小于 1。在集合表示中:(" +"0, 1) = {x | 0 < x < 1}。" + +#: ../../library/random.rst:19 +msgid "" +"[] are closed interval brackets which include all their limit points. For" +" example, [0, 1] means greater than or equal to 0 and less than or equal " +"to 1. In set notation: [0, 1] = {x | 0 <= x <= 1}." +msgstr "" +"[] 表示闭区间,包括所有的极限点。例如,[0, 1] 表示大于等于 0 且小于等于 " +"1。在集合表示中:[0, 1] = {x | 0 <= x <= 1}。" + +#: ../../library/random.rst:26 +msgid "" +"The :func:`randrange`, :func:`randint` and :func:`choice` functions are " +"only available if the ``MICROPY_PY_RANDOM_EXTRA_FUNCS`` configuration " +"option is enabled." +msgstr "" +"只有在启用 ``MICROPY_PY_RANDOM_EXTRA_FUNCS`` 配置选项时,才能使用 " +":func:`randrange`、:func:`randint` 和 :func:`choice` 函数。" + +#: ../../library/random.rst:32 +msgid "Functions for integers" +msgstr "整数函数" + +#: ../../library/random.rst:36 +msgid "Return an integer with *n* random bits (0 <= n <= 32)." +msgstr "返回一个具有 *n* 个随机位的整数(0 <= n <= 32)。" + +#: ../../library/random.rst:40 +msgid "Return a random integer in the range [*a*, *b*]." +msgstr "返回范围在 [*a*, *b*] 内的随机整数。" + +#: ../../library/random.rst:46 +msgid "" +"The first form returns a random integer from the range [0, *stop*). The " +"second form returns a random integer from the range [*start*, *stop*). " +"The third form returns a random integer from the range [*start*, *stop*) " +"in steps of *step*. For instance, calling ``randrange(1, 10, 2)`` will " +"return odd numbers between 1 and 9 inclusive." +msgstr "" +"第一种形式从范围 [0, *stop*) 中返回一个随机整数。第二种形式从范围 [*start*, " +"*stop*) 中返回一个随机整数。第三种形式从范围 [*start*, *stop*) 中以 *step* " +"为步长返回一个随机整数。例如,调用 ``randrange(1, 10, 2)`` 将返回介于 1 和 " +"9(包括)之间的奇数。" + +#: ../../library/random.rst:54 +msgid "Functions for floats" +msgstr "浮点数函数" + +#: ../../library/random.rst:58 +msgid "Return a random floating point number in the range [0.0, 1.0)." +msgstr "返回范围在 [0.0, 1.0) 内的一个随机浮点数。" + +#: ../../library/random.rst:62 +msgid "" +"Return a random floating point number N such that *a* <= N <= *b* for *a*" +" <= *b*, and *b* <= N <= *a* for *b* < *a*." +msgstr "" +"返回一个随机浮点数 N,使得对于 *a* <= *b*,*a* <= N <= *b*,对于 *b* < " +"*a*,*b* <= N <= *a*。" + +#: ../../library/random.rst:67 +msgid "Other Functions" +msgstr "其他函数" + +#: ../../library/random.rst:71 +msgid "" +"Initialise the random number generator module with the seed *n* which " +"should be an integer. When no argument (or ``None``) is passed in it " +"will (if supported by the port) initialise the PRNG with a true random " +"number (usually a hardware generated random number)." +msgstr "" +"使用种子 *n* (应为整数)初始化随机数生成器模块。当不传入参数(或传入 " +"``None`` )时,如果支持的话,它将使用真随机数(通常是硬件生成的随机数)初始化 " +"PRNG。" + +#: ../../library/random.rst:76 +msgid "" +"The ``None`` case only works if ``MICROPY_PY_RANDOM_SEED_INIT_FUNC`` is " +"enabled by the port, otherwise it raises ``ValueError``." +msgstr "" +"如果由移植版本启用了 ``MICROPY_PY_RANDOM_SEED_INIT_FUNC``,则 ``None`` " +"情况才能工作,否则会引发 ``ValueError``。" + +#: ../../library/random.rst:81 +msgid "" +"Chooses and returns one item at random from *sequence* (tuple, list or " +"any object that supports the subscript operation)." +msgstr "从 *sequence* (元组、列表或支持下标操作的任何对象)中随机选择并返回一个项目。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/re.po b/docs/locale/zh_CN/LC_MESSAGES/library/re.po new file mode 100644 index 0000000000000..eeb7bcff61315 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/re.po @@ -0,0 +1,396 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/re.rst:2 +msgid ":mod:`re` -- simple regular expressions" +msgstr ":mod:`re` -- 简单的正则表达式" + +#: ../../library/re.rst:7 +msgid "|see_cpython_module| :mod:`python:re`." +msgstr "|see_cpython_module| :mod:`python:re`。" + +#: ../../library/re.rst:9 +msgid "" +"This module implements regular expression operations. Regular expression " +"syntax supported is a subset of CPython ``re`` module (and actually is a " +"subset of POSIX extended regular expressions)." +msgstr "该模块实现了正则表达式操作。支持的正则表达式语法是 CPython ``re`` " +"模块的子集(实际上是 POSIX 扩展正则表达式的子集)。" + +#: ../../library/re.rst:13 +msgid "Supported operators and special sequences are:" +msgstr "支持的运算符和特殊序列包括:" + +#: ../../library/re.rst:16 +msgid "``.``" +msgstr "``.``" + +#: ../../library/re.rst:16 +msgid "Match any character." +msgstr "匹配任字符。" + +#: ../../library/re.rst:20 +msgid "``[...]``" +msgstr "``[...]``" + +#: ../../library/re.rst:19 +msgid "" +"Match set of characters. Individual characters and ranges are supported, " +"including negated sets (e.g. ``[^a-c]``)." +msgstr "匹配字符集。支持单个字符和范围,包括否定集(例如,``[^a-c]``)。" + +#: ../../library/re.rst:23 +msgid "``^``" +msgstr "``^``" + +#: ../../library/re.rst:23 +msgid "Match the start of the string." +msgstr "匹配字符串的开头。" + +#: ../../library/re.rst:26 +msgid "``$``" +msgstr "``$``" + +#: ../../library/re.rst:26 +msgid "Match the end of the string." +msgstr "匹配字符串的结尾。" + +#: ../../library/re.rst:29 +msgid "``?``" +msgstr "``?``" + +#: ../../library/re.rst:29 +msgid "Match zero or one of the previous sub-pattern." +msgstr "匹配前一个子模式的零个或一个。" + +#: ../../library/re.rst:32 +msgid "``*``" +msgstr "``*``" + +#: ../../library/re.rst:32 +msgid "Match zero or more of the previous sub-pattern." +msgstr "匹配前一个子模式的零个或多个。" + +#: ../../library/re.rst:35 +msgid "``+``" +msgstr "``+``" + +#: ../../library/re.rst:35 +msgid "Match one or more of the previous sub-pattern." +msgstr "匹配前一个子模式的一个或多个。" + +#: ../../library/re.rst:39 +msgid "``??``" +msgstr "``??``" + +#: ../../library/re.rst:38 +msgid "" +"Non-greedy version of ``?``, match zero or one, with the preference for zero." +msgstr "``?`` 的非贪婪版本,匹配零个或一个,优先匹配零个。" + +#: ../../library/re.rst:43 +msgid "``*?``" +msgstr "``*?``" + +#: ../../library/re.rst:42 +msgid "" +"Non-greedy version of ``*``, match zero or more, with the preference for the " +"shortest match." +msgstr "``*`` 的非贪婪版本,匹配零个或多个,优先匹配最短匹配。" + +#: ../../library/re.rst:47 +msgid "``+?``" +msgstr "``+?``" + +#: ../../library/re.rst:46 +msgid "" +"Non-greedy version of ``+``, match one or more, with the preference for the " +"shortest match." +msgstr "``+`` 的非贪婪版本,匹配一个或多个,优先匹配最短匹配。" + +#: ../../library/re.rst:51 +msgid "``|``" +msgstr "``|``" + +#: ../../library/re.rst:50 +msgid "" +"Match either the left-hand side or the right-hand side sub-patterns of this " +"operator." +msgstr "匹配该运算符的左边或右边子模式。" + +#: ../../library/re.rst:55 +msgid "``(...)``" +msgstr "``(...)``" + +#: ../../library/re.rst:54 +msgid "" +"Grouping. Each group is capturing (a substring it captures can be accessed " +"with `match.group()` method)." +msgstr "分组。每个组都是捕获的(可以通过 `match.group()` 方法访问其捕获的子字符串)。" + +#: ../../library/re.rst:58 +msgid "``\\d``" +msgstr "``\\d``" + +#: ../../library/re.rst:58 +msgid "Matches digit. Equivalent to ``[0-9]``." +msgstr "匹配数字。相当于 ``[0-9]``。" + +#: ../../library/re.rst:61 +msgid "``\\D``" +msgstr "``\\D``" + +#: ../../library/re.rst:61 +msgid "Matches non-digit. Equivalent to ``[^0-9]``." +msgstr "匹配非数字。相当于 ``[^0-9]``。" + +#: ../../library/re.rst:64 +msgid "``\\s``" +msgstr "``\\s``" + +#: ../../library/re.rst:64 +msgid "Matches whitespace. Equivalent to ``[ \\t-\\r]``." +msgstr "匹配空白字符。相当于 ``[ \\t-\\r]``。" + +#: ../../library/re.rst:67 +msgid "``\\S``" +msgstr "``\\S``" + +#: ../../library/re.rst:67 +msgid "Matches non-whitespace. Equivalent to ``[^ \\t-\\r]``." +msgstr "匹配非空白字符。相当于 ``[^ \\t-\\r]``。" + +#: ../../library/re.rst:70 +msgid "``\\w``" +msgstr "``\\w``" + +#: ../../library/re.rst:70 +msgid "" +"Matches \"word characters\" (ASCII only). Equivalent to ``[A-Za-z0-9_]``." +msgstr "匹配 \"word characters\"(仅 ASCII)。相当于 ``[A-Za-z0-9_]``。" + +#: ../../library/re.rst:73 +msgid "``\\W``" +msgstr "``\\W``" + +#: ../../library/re.rst:73 +msgid "" +"Matches non \"word characters\" (ASCII only). Equivalent to ``[^A-Za-" +"z0-9_]``." +msgstr "匹配非 \"word characters\"(仅 ASCII)。相当于 ``[^A-Za-z0-9_]``。" + +#: ../../library/re.rst:84 +msgid "``\\``" +msgstr "``\\``" + +#: ../../library/re.rst:76 +msgid "" +"Escape character. Any other character following the backslash, except for " +"those listed above, is taken literally. For example, ``\\*`` is equivalent " +"to literal ``*`` (not treated as the ``*`` operator). Note that ``\\r``, " +"``\\n``, etc. are not handled specially, and will be equivalent to literal " +"letters ``r``, ``n``, etc. Due to this, it's not recommended to use raw " +"Python strings (``r\"\"``) for regular expressions. For example, " +"``r\"\\r\\n\"`` when used as the regular expression is equivalent to " +"``\"rn\"``. To match CR character followed by LF, use ``\"\\r\\n\"``." +msgstr "" +"转义字符。除上面列出的字符外,反斜杠后面的任何其他字符都是字面意思。例如,``" +"\\*`` 等同于字面上的 ``*`` (不会被视为 ``*`` 运算符)。请注意,``\\r`` 、 ``\\n" +"`` 等不会被特殊处理,将等同于字面上的字母 ``r`` 、 ``n`` 等。因此," +"不建议对正则表达式使用原始 Python 字符串( ``r\"\"`` )。例如," +"用作正则表达式的 ``r\"\\r\\n" +"\"`` 等同于 ``\"rn\"`` 。要匹配 CR 字符后跟 LF,请使用 ``\"\\r\\n" +"\"`` 。" + +#: ../../library/re.rst:86 +msgid "**NOT SUPPORTED**:" +msgstr "**不支持**:" + +#: ../../library/re.rst:88 +msgid "counted repetitions (``{m,n}``)" +msgstr "计数重复(``{m,n}``)" + +#: ../../library/re.rst:89 +msgid "named groups (``(?P...)``)" +msgstr "命名组(``(?P...)``)" + +#: ../../library/re.rst:90 +msgid "non-capturing groups (``(?:...)``)" +msgstr "非捕获组(``(?:...)``)" + +#: ../../library/re.rst:91 +msgid "more advanced assertions (``\\b``, ``\\B``)" +msgstr "更高级的断言(``\\b``、``\\B``)" + +#: ../../library/re.rst:92 +msgid "" +"special character escapes like ``\\r``, ``\\n`` - use Python's own escaping " +"instead" +msgstr "" +"特殊字符转义如 ``\\r``、``\\n" +"`` - 使用 Python 自己的转义" + +#: ../../library/re.rst:94 +msgid "etc." +msgstr "等等。" + +#: ../../library/re.rst:96 +msgid "Example::" +msgstr "例子::" + +#: ../../library/re.rst:110 +msgid "Functions" +msgstr "函数" + +#: ../../library/re.rst:114 +msgid "Compile regular expression, return `regex ` object." +msgstr "编译正则表达式,返回 `regex ` 对象。" + +#: ../../library/re.rst:118 +msgid "" +"Compile *regex_str* and match against *string*. Match always happens from " +"starting position in a string." +msgstr "编译 *regex_str* 并匹配 *string*。匹配始终从字符串的起始位置开始。" + +#: ../../library/re.rst:123 +msgid "" +"Compile *regex_str* and search it in a *string*. Unlike `match`, this will " +"search string for first position which matches regex (which still may be 0 " +"if regex is anchored)." +msgstr "" +"编译 *regex_str* 并在 *string* 中搜索它。与 `match` " +"不同,这将搜索第一个与正则表达式匹配的位置(如果正则表达式被锚定,则仍可能为 " +"0)。" + +#: ../../library/re.rst:129 +msgid "" +"Compile *regex_str* and search for it in *string*, replacing all matches " +"with *replace*, and returning the new string." +msgstr "编译 *regex_str* 并在 *string* 中搜索它,用 *replace* " +"替换所有匹配项,并返回新字符串。" + +#: ../../library/re.rst:132 +msgid "" +"*replace* can be a string or a function. If it is a string then escape " +"sequences of the form ``\\`` and ``\\g`` can be used to " +"expand to the corresponding group (or an empty string for unmatched groups). " +"If *replace* is a function then it must take a single argument (the match) " +"and should return a replacement string." +msgstr "" +"*replace* 可以是字符串或函数。如果是字符串,则可以使用形式为 ``\\`` " +"和 ``\\g`` " +"的转义序列来扩展到相应的组(或对于未匹配的组扩展为空字符串)。如果 *replace* " +"是一个函数,则必须接受一个参数(匹配项),并应返回一个替换字符串。" + +#: ../../library/re.rst:138 +msgid "" +"If *count* is specified and non-zero then substitution will stop after this " +"many substitutions are made. The *flags* argument is ignored." +msgstr "如果指定了 *count* 并且非零,则替换将在进行此数量的替换后停止。忽略 *flags* " +"参数。" + +#: ../../library/re.rst:141 +msgid "" +"Note: availability of this function depends on :term:`MicroPython port`." +msgstr "注意:此函数的可用性取决于 :term:`MicroPython port`。" + +#: ../../library/re.rst:145 +msgid "" +"Flag value, display debug information about compiled expression. " +"(Availability depends on :term:`MicroPython port`.)" +msgstr "" +"标志值,显示有关编译表达式的调试信息。(可用性取决于 :term:`MicroPython port`。)" + +#: ../../library/re.rst:152 +msgid "Regex objects" +msgstr "正则表达式对象" + +#: ../../library/re.rst:154 +msgid "" +"Compiled regular expression. Instances of this class are created using `re." +"compile()`." +msgstr "已编译的正则表达式。使用 `re.compile()` 创建此类的实例。" + +#: ../../library/re.rst:161 +msgid "" +"Similar to the module-level functions :meth:`match`, :meth:`search` and :" +"meth:`sub`. Using methods is (much) more efficient if the same regex is " +"applied to multiple strings." +msgstr "" +"类似于模块级函数 :meth:`match`、:meth:`search` 和 " +":meth:`sub`。如果对多个字符串应用相同的正则表达式,则使用方法效率更高。" + +#: ../../library/re.rst:168 +msgid "" +"Split a *string* using regex. If *max_split* is given, it specifies maximum " +"number of splits to perform. Returns list of strings (there may be up to " +"*max_split+1* elements if it's specified)." +msgstr "" +"使用正则表达式拆分 *string*。如果给定 " +"*max_split*,它指定要执行的最大拆分数。返回字符串列表(如果指定了," +"则可能有多达 *max_split+1* 个元素)。" + +#: ../../library/re.rst:173 +msgid "Match objects" +msgstr "匹配对象" + +#: ../../library/re.rst:175 +msgid "" +"Match objects as returned by `match()` and `search()` methods, and passed to " +"the replacement function in `sub()`." +msgstr "由 `match()` 和 `search()` 方法返回,并传递给 `sub()` " +"中的替换函数的匹配对象。" + +#: ../../library/re.rst:180 +msgid "" +"Return matching (sub)string. *index* is 0 for entire match, 1 and above for " +"each capturing group. Only numeric groups are supported." +msgstr "返回匹配的(子)字符串。对于整个匹配,*index* 为 0,对于每个捕获组,*index* " +"为 1 及以上。仅支持数字组。" + +#: ../../library/re.rst:185 +msgid "" +"Return a tuple containing all the substrings of the groups of the match." +msgstr "返回一个包含匹配 的所有组的子字符串的元组。" + +#: ../../library/re.rst:187 ../../library/re.rst:202 +msgid "Note: availability of this method depends on :term:`MicroPython port`." +msgstr "注意:此方法的可用性取决于 :term:`MicroPython port`。" + +#: ../../library/re.rst:192 +msgid "" +"Return the index in the original string of the start or end of the substring " +"group that was matched. *index* defaults to the entire group, otherwise it " +"will select a group." +msgstr "返回原始字符串中匹配的子字符串组的开始或结束索引。*index* " +"默认为整个组,否则将选择一个组。" + +#: ../../library/re.rst:196 +msgid "" +"Note: availability of these methods depends on :term:`MicroPython port`." +msgstr "注意:这些方法的可用性取决于 :term:`MicroPython port`。" + +#: ../../library/re.rst:200 +msgid "Returns the 2-tuple ``(match.start(index), match.end(index))``." +msgstr "返回 2 元组 ``(match.start(index), match.end(index))``。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/requests.po b/docs/locale/zh_CN/LC_MESSAGES/library/requests.po new file mode 100644 index 0000000000000..850a2bba83b48 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/requests.po @@ -0,0 +1,145 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2025, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2026. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.26\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: zh_CN\n" +"Language-Team: zh_CN \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/requests.rst:2 +msgid ":mod:`requests` --- Related functions of HTTP client" +msgstr ":mod:`requests` --- HTTP 客户端相关函数" + +#: ../../library/requests.rst:7 +msgid "" +"Relevant functional functions of the HTTP client, providing various HTTP " +"request methods" +msgstr "HTTP 客户端的相关功能函数,提供各种 HTTP 请求方法" + +#: ../../library/requests.rst:10 +msgid "Response class" +msgstr "Response 类" + +#: ../../library/requests.rst:14 +msgid "" +"The Response class object contains the server's response to the HTTP " +"request." +msgstr "Response 类对象包含服务器对 HTTP 请求的响应。" + +#: ../../library/requests.rst:17 +msgid "Methods" +msgstr "方法" + +#: ../../library/requests.rst:21 +msgid "Returns the headers." +msgstr "返回响应头。" + +#: ../../library/requests.rst:25 +msgid "Returns the content of the response, in bytes." +msgstr "以字节形式返回响应内容。" + +#: ../../library/requests.rst:29 +msgid "Return response json encoded content and convert to dict type." +msgstr "返回响应的 JSON 编码内容并转换为字典类型。" + +#: ../../library/requests.rst:32 +msgid "Functions" +msgstr "函数" + +#: ../../library/requests.rst:36 +msgid "Send an HTTP request to the server." +msgstr "向服务器发送 HTTP 请求。" + +#: ../../library/requests.rst:38 +msgid "``function`` - HTTP function to use" +msgstr "``function`` - 要使用的 HTTP 方法" + +#: ../../library/requests.rst:39 +msgid "``url`` - URL to send" +msgstr "``url`` - 要发送的 URL" + +#: ../../library/requests.rst:40 +msgid "" +"``data`` - To append to the body of the request. If a dictionary or tuple" +" list is provided, the form will be encoded." +msgstr "``data`` - 附加到请求正文中。如果提供字典或元组列表,则会进行表单编码。" + +#: ../../library/requests.rst:41 +msgid "``json`` - json is used to attach to the body of the request." +msgstr "``json`` - json 用于附加到请求正文中。" + +#: ../../library/requests.rst:42 +#, python-brace-format +msgid "" +"``files`` - Used for file upload, the type is 2-tuple, which defines the " +"file name, file path and content type. As follows,{‘name’, (file " +"directory,content-type)}" +msgstr "" +"``files`` - 用于文件上传,类型为 2 元组,定义文件名、文件路径和内容类型。格式如下:{‘name’, (文件目录, content-type)}" + +#: ../../library/requests.rst:43 +msgid "``headers`` - Dictionary of headers to send." +msgstr "``headers`` - 要发送的请求头字典。" + +#: ../../library/requests.rst:44 +msgid "``auth`` - Auth tuple to enable Basic/Digest/Custom HTTP Auth." +msgstr "``auth`` - 用于启用 Basic/Digest/自定义 HTTP 认证的认证元组。" + +#: ../../library/requests.rst:48 +msgid "Send HEAD request and return Response object." +msgstr "发送 HEAD 请求并返回 Response 对象。" + +#: ../../library/requests.rst:50 ../../library/requests.rst:57 +#: ../../library/requests.rst:64 ../../library/requests.rst:78 +#: ../../library/requests.rst:85 +msgid "``url`` - Request object URL" +msgstr "``url`` - 请求对象的 URL" + +#: ../../library/requests.rst:51 +msgid "``**kw`` - The parameters of the request function." +msgstr "``**kw`` - request 函数的参数。" + +#: ../../library/requests.rst:55 +msgid "Send GET request and return Response object." +msgstr "发送 GET 请求并返回 Response 对象。" + +#: ../../library/requests.rst:58 ../../library/requests.rst:65 +#: ../../library/requests.rst:72 ../../library/requests.rst:79 +#: ../../library/requests.rst:86 +msgid "``**kw`` - Parameters of request function." +msgstr "``**kw`` - request 函数的参数。" + +#: ../../library/requests.rst:62 +msgid "Send POST request and return Response object." +msgstr "发送 POST 请求并返回 Response 对象。" + +#: ../../library/requests.rst:69 +msgid "Send PUT request and return Response object." +msgstr "发送 PUT 请求并返回 Response 对象。" + +#: ../../library/requests.rst:71 +msgid "``url`` - RRequest object URL" +msgstr "``url`` - 请求对象的 URL" + +#: ../../library/requests.rst:76 +msgid "Send PATCH request, return Response object." +msgstr "发送 PATCH 请求,返回 Response 对象。" + +#: ../../library/requests.rst:83 +msgid "Send a DELETE request. Return Response object。" +msgstr "发送 DELETE 请求。返回 Response 对象。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/select.po b/docs/locale/zh_CN/LC_MESSAGES/library/select.po new file mode 100644 index 0000000000000..01ca3dd238f89 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/select.po @@ -0,0 +1,182 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/select.rst:2 +msgid ":mod:`select` -- wait for events on a set of streams" +msgstr ":mod:`select` -- 等待一组流上的事件" + +#: ../../library/select.rst:7 +msgid "|see_cpython_module| :mod:`python:select`." +msgstr "|see_cpython_module| :mod:`python:select`。" + +#: ../../library/select.rst:9 +msgid "" +"This module provides functions to efficiently wait for events on multiple" +" :std:term:`streams ` (select streams which are ready for " +"operations)." +msgstr "该模块提供了一组函数,用于有效地等待多个 :std:term:`streams " +"` (已准备好进行操作的选择流)上的事件。" + +#: ../../library/select.rst:13 +msgid "Functions" +msgstr "函数" + +#: ../../library/select.rst:17 +msgid "Create an instance of the Poll class." +msgstr "创建一个Poll类的实例。" + +#: ../../library/select.rst:21 +msgid "Wait for activity on a set of objects." +msgstr "等待一组对象上的活动。" + +#: ../../library/select.rst:23 +msgid "" +"This function is provided by some MicroPython ports for compatibility and" +" is not efficient. Usage of :class:`Poll` is recommended instead." +msgstr "此函数由某些MicroPython移植版本提供以确保兼容性,但效率不高。建议使用 " +":class:`Poll`。" + +#: ../../library/select.rst:29 +msgid "class ``Poll``" +msgstr "类 ``Poll``" + +#: ../../library/select.rst:32 +msgid "Methods" +msgstr "方法" + +#: ../../library/select.rst:36 +msgid "" +"Register :std:term:`stream` *obj* for polling. *eventmask* is logical OR " +"of:" +msgstr "" +"将 :std:term:`stream` *obj* 注册到轮询中。*eventmask* 是以下值的逻辑或:" + +#: ../../library/select.rst:38 +msgid "``select.POLLIN`` - data available for reading" +msgstr "``select.POLLIN`` - 可读数据" + +#: ../../library/select.rst:39 +msgid "``select.POLLOUT`` - more data can be written" +msgstr "``select.POLLOUT`` - 可写入更多数据" + +#: ../../library/select.rst:41 +msgid "" +"Note that flags like ``select.POLLHUP`` and ``select.POLLERR`` are *not* " +"valid as input eventmask (these are unsolicited events which will be " +"returned from `poll()` regardless of whether they are asked for). This " +"semantics is per POSIX." +msgstr "" +"请注意,像 ``select.POLLHUP`` 和 ``select.POLLERR`` " +"这样的标志作为输入事件掩码不是有效的(这些是不被请求的事件,无论是否请求," +"都将从 `poll()` 返回)。这一语义符合POSIX标准。" + +#: ../../library/select.rst:46 +msgid "*eventmask* defaults to ``select.POLLIN | select.POLLOUT``." +msgstr "*eventmask* 默认为 ``select.POLLIN | select.POLLOUT``。" + +#: ../../library/select.rst:48 +msgid "" +"It is OK to call this function multiple times for the same *obj*. " +"Successive calls will update *obj*'s eventmask to the value of " +"*eventmask* (i.e. will behave as `modify()`)." +msgstr "" +"可以多次调用此函数以对同一 *obj* 进行注册。连续调用将更新 *obj* 的事件掩码为 " +"*eventmask* 的值(即将表现为 `modify()`)。" + +#: ../../library/select.rst:54 +msgid "Unregister *obj* from polling." +msgstr "将 *obj* 从轮询中注销。" + +#: ../../library/select.rst:58 +msgid "" +"Modify the *eventmask* for *obj*. If *obj* is not registered, `OSError` " +"is raised with error of ENOENT." +msgstr "修改 *obj* 的 *eventmask*。如果 *obj* 未注册,则引发 `OSError` 并显示 ENOENT " +"错误。" + +#: ../../library/select.rst:63 +msgid "" +"Wait for at least one of the registered objects to become ready or have " +"an exceptional condition, with optional timeout in milliseconds (if " +"*timeout* arg is not specified or -1, there is no timeout)." +msgstr "等待至少一个已注册对象变为就绪或出现异常情况,可选择指定毫秒级超时(" +"如果未指定 *timeout* 参数或为-1,则没有超时)。" + +#: ../../library/select.rst:67 +msgid "" +"Returns list of (``obj``, ``event``, ...) tuples. There may be other " +"elements in tuple, depending on a platform and version, so don't assume " +"that its size is 2. The ``event`` element specifies which events happened" +" with a stream and is a combination of ``select.POLL*`` constants " +"described above. Note that flags ``select.POLLHUP`` and " +"``select.POLLERR`` can be returned at any time (even if were not asked " +"for), and must be acted on accordingly (the corresponding stream " +"unregistered from poll and likely closed), because otherwise all further " +"invocations of `poll()` may return immediately with these flags set for " +"this stream again." +msgstr "" +"返回 (``obj``, ``event``, ...) " +"元组列表。元组中可能还有其他元素,这取决于平台和版本,因此不要假设其大小为2。" +" ``event`` 元素指定流发生了哪些事件,并且是上述 ``select.POLL*`` " +"常量的组合。请注意,标志 ``select.POLLHUP`` 和 ``select.POLLERR`` 可以随时返" +"回(即使没有被请求),必须相应地进行处理(从轮询中注销相应的流并可能关闭)," +"因为否则所有后续对 `poll()` 的调用可能会立即返回,并再次设置这些流的标志。" + +#: ../../library/select.rst:77 +msgid "In case of timeout, an empty list is returned." +msgstr "在超时情况下,返回一个空列表。" + +#: ../../library/select.rst:79 ../../library/select.rst:96 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/select.rst:82 +msgid "Tuples returned may contain more than 2 elements as described above." +msgstr "如上所述,返回的元组可能包含2个以上元素。" + +#: ../../library/select.rst:86 +msgid "" +"Like :meth:`poll.poll`, but instead returns an iterator which yields a " +"`callee-owned tuple`. This function provides an efficient, allocation-" +"free way to poll on streams." +msgstr "" +"类似于 :meth:`poll.poll`,但返回一个迭代器,该迭代器生成 `callee-owned " +"tuple`。此函数提供了一种有效的,无分配的方式来轮询流。" + +#: ../../library/select.rst:90 +msgid "" +"If *flags* is 1, one-shot behaviour for events is employed: streams for " +"which events happened will have their event masks automatically reset " +"(equivalent to ``poll.modify(obj, 0)``), so new events for such a stream " +"won't be processed until new mask is set with `poll.modify()`. This " +"behaviour is useful for asynchronous I/O schedulers." +msgstr "" +"如果 *flags* " +"为1,则采用一次性行为以处理事件:发生事件的流将自动重置其事件掩码(相当于 " +"``poll.modify(obj, 0)``),因此对于这样的流,新事件将不会被处理,直到使用 " +"`poll.modify()` 设置了新的掩码。这种行为对于异步I/O调度器非常有用。" + +#: ../../library/select.rst:99 +msgid "This function is a MicroPython extension." +msgstr "此函数是MicroPython 的扩展。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/socket.po b/docs/locale/zh_CN/LC_MESSAGES/library/socket.po new file mode 100644 index 0000000000000..aa338c1a10359 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/socket.po @@ -0,0 +1,498 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/socket.rst:3 +msgid ":mod:`socket` -- socket module" +msgstr ":mod:`socket` -- socket模块" + +#: ../../library/socket.rst:8 +msgid "|see_cpython_module| :mod:`python:socket`." +msgstr "|see_cpython_module| :mod:`python:socket`。" + +#: ../../library/socket.rst:10 +msgid "This module provides access to the BSD socket interface." +msgstr "该模块提供了对BSD套接字接口的访问。" + +#: ../../library/socket.rst:12 ../../library/socket.rst:96 +#: ../../library/socket.rst:284 ../../library/socket.rst:308 +#: ../../library/socket.rst:314 ../../library/socket.rst:355 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/socket.rst:15 +msgid "" +"For efficiency and consistency, socket objects in MicroPython implement a" +" :std:term:`stream` (file-like) interface directly. In CPython, you need " +"to convert a socket to a file-like object using `makefile()` method. This" +" method is still supported by MicroPython (but is a no-op), so where " +"compatibility with CPython matters, be sure to use it." +msgstr "" +"为了效率和一致性,在MicroPython中,套接字对象直接实现了 " +":std:term:`stream` (类似文件)接口。在CPython中,您需要使用 `makefile()` " +"方法将套接字转换为类似文件的对象。此方法仍受MicroPython支持(但不执行任何操作),因此在与CPython兼容性有关的情况下,请确保使用它。" + +#: ../../library/socket.rst:22 +msgid "Socket address format(s)" +msgstr "套接字地址格式" + +#: ../../library/socket.rst:24 +msgid "" +"The native socket address format of the ``socket`` module is an opaque " +"data type returned by `getaddrinfo` function, which must be used to " +"resolve textual address (including numeric addresses)::" +msgstr "" +"``socket`` 模块的原生套接字地址格式是由 `getaddrinfo` " +"函数返回的不透明数据类型,必须使用它来解析文本地址(包括数值地址)::" + +#: ../../library/socket.rst:34 +msgid "" +"Using `getaddrinfo` is the most efficient (both in terms of memory and " +"processing power) and portable way to work with addresses." +msgstr "使用 `getaddrinfo` 是处理地址的最有效(无论是在内存还是处理能力方面)和可移植的方法。" + +#: ../../library/socket.rst:37 +msgid "" +"However, ``socket`` module (note the difference with native MicroPython " +"``socket`` module described here) provides CPython-compatible way to " +"specify addresses using tuples, as described below. Note that depending " +"on a :term:`MicroPython port`, ``socket`` module can be builtin or need " +"to be installed from `micropython-lib` (as in the case of " +":term:`MicroPython Unix port`), and some ports still accept only numeric " +"addresses in the tuple format, and require to use `getaddrinfo` function " +"to resolve domain names." +msgstr "" +"但是,``socket`` 模块(请注意,这与本文描述的原生MicroPython ``socket`` " +"模块有所不同)提供了一种与CPython兼容的方式来使用元组指定地址,如下所述。请注意,根据 :term:`MicroPython port`," +"``socket`` 模块可以是内置的,也可以需要从 `micropython-lib` (如 " +":term:`MicroPython Unix port` )安装,并且一些移植版本仍然仅接受元组格式的数值地址,并且需要使用 `getaddrinfo` 函数来解析域名。" + +#: ../../library/socket.rst:45 +msgid "Summing up:" +msgstr "总结:" + +#: ../../library/socket.rst:47 +msgid "Always use `getaddrinfo` when writing portable applications." +msgstr "编写可移植应用程序时,请始终使用 `getaddrinfo`。" + +#: ../../library/socket.rst:48 +msgid "" +"Tuple addresses described below can be used as a shortcut for quick hacks" +" and interactive use, if your port supports them." +msgstr "如果您的移植版本支持它们,则可以将下面描述的元组地址用作快速处理和交互使用的快捷方式。" + +#: ../../library/socket.rst:51 +msgid "Tuple address format for ``socket`` module:" +msgstr "``socket`` 模块的元组地址格式:" + +#: ../../library/socket.rst:53 +msgid "" +"IPv4: *(ipv4_address, port)*, where *ipv4_address* is a string with dot-" +"notation numeric IPv4 address, e.g. ``\"8.8.8.8\"``, and *port* is and " +"integer port number in the range 1-65535. Note the domain names are not " +"accepted as *ipv4_address*, they should be resolved first using " +"`socket.getaddrinfo()`." +msgstr "" +"IPv4:*(ipv4_address, port)*,其中 *ipv4_address* 是具有点符号数值IPv4地址的字符串,例如 " +"``\"8.8.8.8\"``,而 *port* 是1-65535范围内的整数端口号。请注意,域名不被接受为 " +"*ipv4_address*,它们应首先使用 `socket.getaddrinfo()` 解析。" + +#: ../../library/socket.rst:58 +msgid "" +"IPv6: *(ipv6_address, port, flowinfo, scopeid)*, where *ipv6_address* is " +"a string with colon-notation numeric IPv6 address, e.g. " +"``\"2001:db8::1\"``, and *port* is an integer port number in the range " +"1-65535. *flowinfo* must be 0. *scopeid* is the interface scope " +"identifier for link-local addresses. Note the domain names are not " +"accepted as *ipv6_address*, they should be resolved first using " +"`socket.getaddrinfo()`. Availability of IPv6 support depends on a " +":term:`MicroPython port`." +msgstr "" +"IPv6:*(ipv6_address, port, flowinfo, scopeid)*,其中 *ipv6_address* " +"是具有冒号表示法数值IPv6地址的字符串,例如 ``\"2001:db8::1\"``,而 *port* " +"是1-65535范围内的整数端口号。*flowinfo* 必须为0。*scopeid* 是链路本地地址的接口范围标识符。请注意,域名不被接受为 " +"*ipv6_address*,它们应首先使用 `socket.getaddrinfo()` 解析。IPv6支持的可用性取决于 " +":term:`MicroPython port`。" + +#: ../../library/socket.rst:67 +msgid "Functions" +msgstr "函数" + +#: ../../library/socket.rst:71 +msgid "" +"Translate the host/port argument into a sequence of 5-tuples that contain" +" all the necessary arguments for creating a socket connected to that " +"service. Arguments *af*, *type*, and *proto* (which have the same meaning" +" as for the `socket()` function) can be used to filter which kind of " +"addresses are returned. If a parameter is not specified or zero, all " +"combinations of addresses can be returned (requiring filtering on the " +"user side)." +msgstr "" +"将主机/端口参数转换为一个包含所有必要参数的5元组序列,以便创建连接到该服务的套接字。参数 *af* 、 *type* 和 *proto* (与 " +"`socket()` 函数的含义相同)可用于过滤返回的地址类型。如果未指定或设置为零,则可以返回所有地址组合(在用户端需要进行过滤)。" + +#: ../../library/socket.rst:78 +msgid "The resulting list of 5-tuples has the following structure::" +msgstr "结果列表的5元组具有以下结构::" + +#: ../../library/socket.rst:82 +msgid "The following example shows how to connect to a given url::" +msgstr "以下示例显示了如何连接到给定的url::" + +#: ../../library/socket.rst:89 +msgid "Recommended use of filtering params::" +msgstr "推荐使用过滤参数::" + +#: ../../library/socket.rst:99 +msgid "" +"CPython raises a ``socket.gaierror`` exception (`OSError` subclass) in " +"case of error in this function. MicroPython doesn't have " +"``socket.gaierror`` and raises OSError directly. Note that error numbers " +"of `getaddrinfo()` form a separate namespace and may not match error " +"numbers from the :mod:`errno` module. To distinguish `getaddrinfo()` " +"errors, they are represented by negative numbers, whereas standard system" +" errors are positive numbers (error numbers are accessible using " +"``e.args[0]`` property from an exception object). The use of negative " +"values is a provisional detail which may change in the future." +msgstr "" +"在此函数出错时,CPython会引发一个 ``socket.gaierror`` 异常(`OSError` 子类)。MicroPython没有 " +"``socket.gaierror``,而是直接引发OSError。请注意,`getaddrinfo()` " +"的错误编号形成了一个独立的命名空间,可能与 :mod:`errno` 模块中的错误编号不匹配。为了区分 `getaddrinfo()` " +"错误,它们用负数表示,而标准系统错误使用正数表示(可以使用异常对象的 ``e.args[0]`` " +"属性访问错误编号)。负值的使用是一个临时的细节,将来可能会改变。" + +#: ../../library/socket.rst:111 +msgid "" +"Convert a binary network address *bin_addr* of the given address family " +"*af* to a textual representation::" +msgstr "将给定地址族 *af* 的二进制网络地址 *bin_addr* 转换为文本表示::" + +#: ../../library/socket.rst:119 +msgid "" +"Convert a textual network address *txt_addr* of the given address family " +"*af* to a binary representation::" +msgstr "将给定地址族 *af* 的文本网络地址 *txt_addr* 转换为二进制表示::" + +#: ../../library/socket.rst:126 +msgid "Constants" +msgstr "常量" + +#: ../../library/socket.rst:131 +msgid "" +"Address family types. Availability depends on a particular " +":term:`MicroPython port`." +msgstr "地址族类型。可用性取决于特定的 :term:`MicroPython port`。" + +#: ../../library/socket.rst:136 +msgid "Socket types." +msgstr "套接字类型。" + +#: ../../library/socket.rst:141 +msgid "" +"IP protocol numbers. Availability depends on a particular " +":term:`MicroPython port`. Note that you don't need to specify these in a " +"call to `socket.socket()`, because `SOCK_STREAM` socket type " +"automatically selects `IPPROTO_TCP`, and `SOCK_DGRAM` - `IPPROTO_UDP`. " +"Thus, the only real use of these constants is as an argument to " +"`setsockopt()`." +msgstr "" +"IP协议号。可用性取决于特定的 :term:`MicroPython port`。请注意,您不需要在调用 `socket.socket()` " +"时指定这些值,因为 `SOCK_STREAM` 套接字类型会自动选择 `IPPROTO_TCP`,和 `SOCK_DGRAM` - " +"`IPPROTO_UDP`。因此,这些常量的唯一真正用途是作为 `setsockopt()` 的参数。" + +#: ../../library/socket.rst:149 +msgid "" +"Socket option levels (an argument to `setsockopt()`). The exact inventory" +" depends on a :term:`MicroPython port`." +msgstr "套接字选项级别(用于 `setsockopt()` 的参数)。确切的清单取决于 :term:`MicroPython port`。" + +#: ../../library/socket.rst:154 +msgid "" +"Socket options (an argument to `setsockopt()`). The exact inventory " +"depends on a :term:`MicroPython port`." +msgstr "套接字选项(用于 `setsockopt()` 的参数)。确切的清单取决于 :term:`MicroPython port`。" + +#: ../../library/socket.rst:161 +msgid "Special protocol value to create SSL-compatible socket." +msgstr "创建与SSL兼容的套接字的特殊协议值。" + +#: ../../library/socket.rst:164 +msgid "class socket" +msgstr "类 socket" + +#: ../../library/socket.rst:168 +msgid "" +"Create a new socket using the given address family, socket type and " +"protocol number. Note that specifying *proto* in most cases is not " +"required (and not recommended, as some MicroPython ports may omit " +"``IPPROTO_*`` constants). Instead, *type* argument will select needed " +"protocol automatically::" +msgstr "" +"使用给定的地址族、套接字类型和协议号创建一个新的套接字。请注意,在大多数情况下,指定 *proto* " +"是不需要的(也不建议的,因为一些MicroPython移植版本可能会省略 ``IPPROTO_*`` 常量)。相反,*type* " +"参数将自动选择所需的协议::" + +#: ../../library/socket.rst:180 +msgid "Methods" +msgstr "方法" + +#: ../../library/socket.rst:184 +msgid "" +"Mark the socket closed and release all resources. Once that happens, all " +"future operations on the socket object will fail. The remote end will " +"receive EOF indication if supported by protocol." +msgstr "标记套接字关闭并释放所有资源。一旦发生这种情况,套接字对象上的所有未来操作都将失败。如果协议支持,远程端将接收EOF指示。" + +#: ../../library/socket.rst:188 +msgid "" +"Sockets are automatically closed when they are garbage-collected, but it " +"is recommended to `close()` them explicitly as soon you finished working " +"with them." +msgstr "当套接字被垃圾收集时,它们会自动关闭,但建议在完成对它们的操作后明确地 `close()` 它们。" + +#: ../../library/socket.rst:193 +msgid "Bind the socket to *address*. The socket must not already be bound." +msgstr "将套接字绑定到 *sddress*。套接字必须尚未绑定。" + +#: ../../library/socket.rst:197 +msgid "" +"Enable a server to accept connections. If *backlog* is specified, it must" +" be at least 0 (if it's lower, it will be set to 0); and specifies the " +"number of unaccepted connections that the system will allow before " +"refusing new connections. If not specified, a default reasonable value is" +" chosen." +msgstr "启用服务器接受连接。如果指定了 *backlog*,它必须至少为0(如果低于此值,则将设置为0);并指定系统在拒绝新连接之前允许的未接受连接的数量。如果未指定,则选择一个默认合理的值。" + +#: ../../library/socket.rst:204 +msgid "" +"Accept a connection. The socket must be bound to an address and listening" +" for connections. The return value is a pair (conn, address) where conn " +"is a new socket object usable to send and receive data on the connection," +" and address is the address bound to the socket on the other end of the " +"connection." +msgstr "接受连接。套接字必须绑定到地址并侦听连接。返回值是一对(conn,address),其中conn是一个新的套接字对象,可用于在连接上发送和接收数据,而address是与连接的另一端绑定到的套接字的地址。" + +#: ../../library/socket.rst:211 +msgid "Connect to a remote socket at *address*." +msgstr "连接到 *address* 处的远程套接字。" + +#: ../../library/socket.rst:215 +msgid "" +"Send data to the socket. The socket must be connected to a remote socket." +" Returns number of bytes sent, which may be smaller than the length of " +"data (\"short write\")." +msgstr "将数据发送到套接字。套接字必须连接到远程套接字。返回发送的字节数,这可能小于数据的长度(“短写”)。" + +#: ../../library/socket.rst:221 +msgid "" +"Send all data to the socket. The socket must be connected to a remote " +"socket. Unlike `send()`, this method will try to send all of data, by " +"sending data chunk by chunk consecutively." +msgstr "将所有数据发送到套接字。套接字必须连接到远程套接字。与 `send()` 不同,此方法将尝试发送所有数据,通过连续逐块发送数据。" + +#: ../../library/socket.rst:225 +msgid "" +"The behaviour of this method on non-blocking sockets is undefined. Due to" +" this, on MicroPython, it's recommended to use `write()` method instead, " +"which has the same \"no short writes\" policy for blocking sockets, and " +"will return number of bytes sent on non-blocking sockets." +msgstr "" +"非阻塞套接字上此方法的行为未定义。因此,在MicroPython上,建议使用 `write()` " +"方法,该方法对于阻塞套接字具有相同的“无短写”策略,并且在非阻塞套接字上返回发送的字节数。" + +#: ../../library/socket.rst:232 +msgid "" +"Receive data from the socket. The return value is a bytes object " +"representing the data received. The maximum amount of data to be received" +" at once is specified by bufsize." +msgstr "从套接字接收数据。返回一个表示接收到的数据的字节对象。一次要接收的最大数据量由bufsize指定。" + +#: ../../library/socket.rst:235 +msgid "" +"Most ports support the optional *flags* argument. Available *flags* are " +"defined as constants in the socket module and have the same meaning as in" +" CPython. ``MSG_PEEK`` and ``MSG_DONTWAIT`` are supported on all ports " +"which accept the *flags* argument." +msgstr "" +"大多数移植版本支持可选的 *flags* 参数。可用的 *flags* 在 socket 模块中定义为常量," +"与 CPython 中的含义相同。``MSG_PEEK`` 和 ``MSG_DONTWAIT`` 在所有接受 *flags* " +"参数的移植版本上都受支持。" + +#: ../../library/socket.rst:241 +msgid "" +"Send data to the socket. The socket should not be connected to a remote " +"socket, since the destination socket is specified by *address*." +msgstr "将数据发送到套接字。套接字不应该连接到远程套接字,因为目标套接字由 *address* 指定。" + +#: ../../library/socket.rst:246 +msgid "" +"Receive data from the socket. The return value is a pair *(bytes, " +"address)* where *bytes* is a bytes object representing the data received " +"and *address* is the address of the socket sending the data." +msgstr "" +"从套接字接收数据。返回一个 *(bytes, address)* 对,其中 *bytes* 是表示接收到的数据的字节对象,而 *address* " +"是发送数据的套接字的地址。" + +#: ../../library/socket.rst:250 +msgid "" +"See the `recv` function for an explanation of the optional *flags* " +"argument." +msgstr "有关可选 *flags* 参数的说明,请参阅 `recv` 函数。" + +#: ../../library/socket.rst:254 +msgid "" +"Set the value of the given socket option. The needed symbolic constants " +"are defined in the socket module (SO_* etc.). The *value* can be an " +"integer or a bytes-like object representing a buffer." +msgstr "设置给定套接字选项的值。所需的符号常量在套接字模块中定义(SO_*等)。*value* 可以是一个整数或表示缓冲区的类似字节的对象。" + +#: ../../library/socket.rst:260 +msgid "**Note**: Not every port supports this method, see below." +msgstr "**注意**:并非每个移植版本都支持此方法,请参见下文。" + +#: ../../library/socket.rst:262 +msgid "" +"Set a timeout on blocking socket operations. The value argument can be a " +"nonnegative floating point number expressing seconds, or None. If a non-" +"zero value is given, subsequent socket operations will raise an `OSError`" +" exception if the timeout period value has elapsed before the operation " +"has completed. If zero is given, the socket is put in non-blocking mode. " +"If None is given, the socket is put in blocking mode." +msgstr "" +"对阻塞套接字操作设置超时。值参数可以是表示秒数的非负浮点数,也可以为None。如果给出了非零值,则在操作完成之前,如果超时周期值已过去,则后续的套接字操作将引发" +" `OSError` 异常。如果给出了零,则套接字将置于非阻塞模式。如果给出了None,则套接字将置于阻塞模式。" + +#: ../../library/socket.rst:268 +msgid "" +"Not every :term:`MicroPython port` supports this method. A more portable " +"and generic solution is to use `select.poll` object. This allows to wait " +"on multiple objects at the same time (and not just on sockets, but on " +"generic :std:term:`stream` objects which support polling). Example::" +msgstr "" +"并非每个 :term:`MicroPython port` 都支持此方法。更便携和通用的解决方案是使用 `select.poll` " +"对象。这允许在多个对象上同时等待(不仅仅是套接字,还有支持轮询的通 用 :std:term:`stream` 对象)。示例::" + +#: ../../library/socket.rst:287 +msgid "" +"CPython raises a ``socket.timeout`` exception in case of timeout, which " +"is an `OSError` subclass. MicroPython raises an OSError directly instead." +" If you use ``except OSError:`` to catch the exception, your code will " +"work both in MicroPython and CPython." +msgstr "" +"在超时的情况下,CPython会引发一个 ``socket.timeout`` 异常,它是 `OSError` " +"的子类。MicroPython直接引发OSError。如果您使用 ``except OSError:`` " +"捕获异常,则您的代码将在MicroPython和CPython中均可工作。" + +#: ../../library/socket.rst:294 +msgid "" +"Set blocking or non-blocking mode of the socket: if flag is false, the " +"socket is set to non-blocking, else to blocking mode." +msgstr "设置套接字的阻塞或非阻塞模式:如果flag为false,则将套接字设置为非阻塞模式,否则设置为阻塞模式。" + +#: ../../library/socket.rst:297 +msgid "This method is a shorthand for certain `settimeout()` calls:" +msgstr "该方法是某些 `settimeout()` 调用的简写:" + +#: ../../library/socket.rst:299 +msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" +msgstr "``sock.setblocking(True)`` 等同于 ``sock.settimeout(None)``" + +#: ../../library/socket.rst:300 +msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0)``" +msgstr "``sock.setblocking(False)`` 等同于 ``sock.settimeout(0)``" + +#: ../../library/socket.rst:304 +msgid "" +"Return a file object associated with the socket. The exact returned type " +"depends on the arguments given to makefile(). The support is limited to " +"binary modes only ('rb', 'wb', and 'rwb'). CPython's arguments: " +"*encoding*, *errors* and *newline* are not supported." +msgstr "返回与套接字关联的文件对象。返回的确切类型取决于传递给makefile()的参数。支持的仅限于二进制模式('rb'、'wb'和'rwb')。不支持CPython的参数:*encoding*、*errors* 和 *newline*。" + +#: ../../library/socket.rst:311 +msgid "" +"As MicroPython doesn't support buffered streams, values of *buffering* " +"parameter is ignored and treated as if it was 0 (unbuffered)." +msgstr "由于MicroPython不支持缓冲流,因此 *buffering* 参数的值将被忽略,并视为0(无缓冲)。" + +#: ../../library/socket.rst:317 +msgid "" +"Closing the file object returned by makefile() WILL close the original " +"socket as well." +msgstr "关闭由makefile()返回的文件对象将同时关闭原始套接字。" + +#: ../../library/socket.rst:322 +msgid "" +"Read up to size bytes from the socket. Return a bytes object. If *size* " +"is not given, it reads all data available from the socket until EOF; as " +"such the method will not return until the socket is closed. This function" +" tries to read as much data as requested (no \"short reads\"). This may " +"be not possible with non-blocking socket though, and then less data will " +"be returned." +msgstr "从套接字读取最多size字节。返回一个字节对象。如果未给出 *size*,则从套接字中读取所有可用的数据直到EOF;因此该方法在套接字关闭之前不会返回。此函数尝试读取所请求的所有数据(没有“短读取”)。这对于非阻塞套接字可能不可能,然后将返回的数据量较少。" + +#: ../../library/socket.rst:330 +msgid "" +"Read bytes into the *buf*. If *nbytes* is specified then read at most " +"that many bytes. Otherwise, read at most *len(buf)* bytes. Just as " +"`read()`, this method follows \"no short reads\" policy." +msgstr "" +"将字节读入 *buf* 中。如果指定了 *nbytes*,则最多读取 *nbytes* 字节。否则,最多读取 *len(buf)* 字节。就像 " +"`read()` 一样,此方法遵循“无短读取”策略。" + +#: ../../library/socket.rst:334 +msgid "Return value: number of bytes read and stored into *buf*." +msgstr "返回值:读取并存储到 *buf* 中的字节数。" + +#: ../../library/socket.rst:338 +msgid "Read a line, ending in a newline character." +msgstr "读取一行,以换行字符结束。" + +#: ../../library/socket.rst:340 +msgid "Return value: the line read." +msgstr "返回值:读取的行。" + +#: ../../library/socket.rst:344 +msgid "" +"Write the buffer of bytes to the socket. This function will try to write " +"all data to a socket (no \"short writes\"). This may be not possible with" +" a non-blocking socket though, and returned value will be less than the " +"length of *buf*." +msgstr "将字节缓冲区写入套接字。此函数将尝试将所有数据写入套接字(没有“短写”)。这对于非阻塞套接字可能不可能,然后返回的值将小于 *buf* 的长度。" + +#: ../../library/socket.rst:349 +msgid "Return value: number of bytes written." +msgstr "返回值:写入的字节数。" + +#: ../../library/socket.rst:353 +msgid "MicroPython does NOT have this exception." +msgstr "MicroPython没有此异常。" + +#: ../../library/socket.rst:358 +msgid "" +"CPython used to have a ``socket.error`` exception which is now " +"deprecated, and is an alias of `OSError`. In MicroPython, use `OSError` " +"directly." +msgstr "" +"CPython曾经有一个 ``socket.error`` 异常,现已被弃用,并且是 `OSError` " +"的别名。在MicroPython中,直接使用 `OSError`。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/ssl.po b/docs/locale/zh_CN/LC_MESSAGES/library/ssl.po new file mode 100644 index 0000000000000..6a3fe5b4d5d21 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/ssl.po @@ -0,0 +1,334 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/ssl.rst:2 +msgid ":mod:`ssl` -- SSL/TLS module" +msgstr ":mod:`ssl` -- SSL/TLS 模块" + +#: ../../library/ssl.rst:7 +msgid "|see_cpython_module| :mod:`python:ssl`." +msgstr "|see_cpython_module| :mod:`python:ssl`。" + +#: ../../library/ssl.rst:9 +msgid "" +"This module provides access to Transport Layer Security (previously and " +"widely known as “Secure Sockets Layer”) encryption and peer " +"authentication facilities for network sockets, both client-side and " +"server-side." +msgstr "该模块提供了对传输层安全性(以前和广泛称为“安全套接字层”)加密和对等身份验证功能的访问,用于网络套接字,包括客户端和服务器端。" + +#: ../../library/ssl.rst:14 +msgid "Functions" +msgstr "函数" + +#: ../../library/ssl.rst:18 +msgid "" +"Wrap the given *sock* and return a new wrapped-socket object. The " +"implementation of this function is to first create an `SSLContext` and " +"then call the `SSLContext.wrap_socket` method on that context object. " +"The arguments *sock*, *server_side* and *server_hostname* are passed " +"through unchanged to the method call. The argument *do_handshake* is " +"passed through as *do_handshake_on_connect*. The remaining arguments " +"have the following behaviour:" +msgstr "" +"包装给定的 *sock* 并返回一个新的包装套接字对象。此函数的实现是首先创建一个 `SSLContext` ,然后在该上下文对象上调用 " +"`SSLContext.wrap_socket` 方法。参数 *sock* 、 *server_side* 和 *server_hostname*" +" 未经修改地传递给方法调用。参数 *do_handshake* 传递为 *do_handshake_on_connect* " +"。其余参数具有以下行为:" + +#: ../../library/ssl.rst:24 +msgid "" +"*cert_reqs* determines whether the peer (server or client) must present a" +" valid certificate. Note that for mbedtls based ports, ``ssl.CERT_NONE`` " +"and ``ssl.CERT_OPTIONAL`` will not validate any certificate, only " +"``ssl.CERT_REQUIRED`` will." +msgstr "" +"*cert_reqs* 决定对等端(服务器或客户端)是否必须提供有效证书。请注意,对于基于 mbedtls " +"的移植版本,``ssl.CERT_NONE`` 和 ``ssl.CERT_OPTIONAL`` 将不会验证任何证书,只有 " +"``ssl.CERT_REQUIRED`` 会。" + +#: ../../library/ssl.rst:28 +msgid "" +"*cadata* is a bytes object containing the CA certificate chain (in DER " +"format) that will validate the peer's certificate. Currently only a " +"single DER-encoded certificate is supported." +msgstr "*cadata* 是一个包含 CA 证书链(DER 格式)的字节对象,该链将验证对等体的证书。当前仅支持单个 DER 编码的证书。" + +#: ../../library/ssl.rst:31 +msgid "" +"Depending on the underlying module implementation in a particular " +":term:`MicroPython port`, some or all keyword arguments above may be not " +"supported." +msgstr "根据特定 :term:`MicroPython port` 中的底层模块实现,上述一些或全部关键字参数可能不受支持。" + +#: ../../library/ssl.rst:35 +msgid "class SSLContext" +msgstr "类 SSLContext" + +#: ../../library/ssl.rst:39 +msgid "" +"Create a new SSLContext instance. The *protocol* argument must be one of" +" the ``PROTOCOL_*`` constants." +msgstr "创建一个新的 SSLContext 实例。 *protocol* 参数必须是 ``PROTOCOL_*`` 常量之一。" + +#: ../../library/ssl.rst:44 +msgid "" +"Load a private key and the corresponding certificate. The *certfile* is " +"a string with the file path of the certificate. The *keyfile* is a " +"string with the file path of the private key." +msgstr "加载私钥和相应的证书。 *certfile* 是包含证书文件路径的字符串。 *keyfile* 是包含私钥文件路径的字符串。" + +#: ../../library/ssl.rst:48 ../../library/ssl.rst:128 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/ssl.rst:51 +msgid "" +"MicroPython extension: *certfile* and *keyfile* can be bytes objects " +"instead of strings, in which case they are interpreted as the actual " +"certificate/key data." +msgstr "" +"MicroPython扩展:*certfile* 和 *keyfile* " +"可以是字节对象,而不是字符串,这种情况下,它们被解释为实际的证书/密钥数据。" + +#: ../../library/ssl.rst:56 +msgid "" +"Load the CA certificate chain that will validate the peer's certificate. " +"*cafile* is the file path of the CA certificates. *cadata* is a bytes " +"object containing the CA certificates. Only one of these arguments " +"should be provided." +msgstr "" +"加载将验证对等体证书的CA证书链。 *cafile* 是 CA 证书的文件路径。 *cadata* 是一个包含 CA " +"证书的字节对象。应该只提供这些参数中的一个。" + +#: ../../library/ssl.rst:62 +msgid "Get a list of enabled ciphers, returned as a list of strings." +msgstr "获取启用的密码列表,作为字符串列表返回。" + +#: ../../library/ssl.rst:66 +msgid "" +"Set the available ciphers for sockets created with this context. " +"*ciphers* should be a list of strings in the `IANA cipher suite format " +"`_ ." +msgstr "" +"为使用此上下文创建的套接字设置可用密码。 *ciphers* 应该是 `IANA cipher suite format " +"`_ 中的字符串列表。" + +#: ../../library/ssl.rst:71 +msgid "" +"Takes a :std:term:`stream` *sock* (usually socket.socket instance of " +"``SOCK_STREAM`` type), and returns an instance of ssl.SSLSocket, wrapping" +" the underlying stream. The returned object has the usual " +":std:term:`stream` interface methods like ``read()``, ``write()``, etc." +msgstr "" +"接受一个 :std:term:`stream` *sock* (通常是 ``SOCK_STREAM`` 类型的 socket.socket " +"实例),并返回一个 ssl.SSLSocket 的实例,用于包装底层流。返回的对象具有像 ``read()`` 、 ``write()`` 等的常规 " +":std:term:`stream` 接口方法。" + +#: ../../library/ssl.rst:76 +msgid "" +"*server_side* selects whether the wrapped socket is on the server or " +"client side. A server-side SSL socket should be created from a normal " +"socket returned from :meth:`~socket.socket.accept()` on a non-SSL " +"listening server socket." +msgstr "" +"*server_side* 选择包装套接字是服务器端还是客户端。服务器端的SSL套接字应该从非SSL监听服务器套接字的 " +":meth:`~socket.socket.accept()` 返回的普通套接字创建。" + +#: ../../library/ssl.rst:80 +msgid "" +"*do_handshake_on_connect* determines whether the handshake is done as " +"part of the ``wrap_socket`` or whether it is deferred to be done as part " +"of the initial reads or writes For blocking sockets doing the handshake " +"immediately is standard. For non-blocking sockets (i.e. when the *sock* " +"passed into ``wrap_socket`` is in non-blocking mode) the handshake should" +" generally be deferred because otherwise ``wrap_socket`` blocks until it " +"completes. Note that in AXTLS the handshake can be deferred until the " +"first read or write but it then blocks until completion." +msgstr "" +"*do_handshake_on_connect* 确定是否在 ``wrap_socket`` " +"的一部分进行握手,或者是否推迟到作为初始读取或写入的一部分进行。对于立即执行握手的阻塞套接字是标准的。对于非阻塞套接字(即传递给 " +"``wrap_socket`` 的 *sock* 处于非阻塞模式时),握手通常应该推迟,因为否则 ``wrap_socket`` " +"将阻塞,直到完成。请注意,在AXTLS中,握手可以推迟到第一次读取或写入,但然后它会阻塞直到完成。" + +#: ../../library/ssl.rst:88 +msgid "" +"*server_hostname* is for use as a client, and sets the hostname to check " +"against the received server certificate. It also sets the name for " +"Server Name Indication (SNI), allowing the server to present the proper " +"certificate." +msgstr "" +"*server_hostname* 用于作为客户端使用,并设置要与收到的服务器证书进行验证的主机名。它还设置了Server Name " +"Indication(SNI)的名称,允许服务器呈现适当的证书。" + +#: ../../library/ssl.rst:92 +msgid "" +"*client_id* is a MicroPython-specific extension argument used only when " +"implementing a DTLS Server. See :ref:`dtls` for details." +msgstr "*client_id* 是 MicroPython 特有的扩展参数,仅在实现 DTLS 服务器时使用。详情参见 :ref:`dtls`。" + +#: ../../library/ssl.rst:97 +msgid "" +"Some implementations of ``ssl`` module do NOT validate server " +"certificates, which makes an SSL connection established prone to man-in-" +"the-middle attacks." +msgstr "一些 ``ssl`` 模块的实现不验证服务器证书,这使得建立的SSL连接容易受到中间人攻击。" + +#: ../../library/ssl.rst:100 +msgid "" +"CPython's ``wrap_socket`` returns an ``SSLSocket`` object which has " +"methods typical for sockets, such as ``send``, ``recv``, etc. " +"MicroPython's ``wrap_socket`` returns an object more similar to CPython's" +" ``SSLObject`` which does not have these socket methods." +msgstr "" +"CPython 的 ``wrap_socket`` 返回一个 ``SSLSocket`` 对象,该对象具有类似套接字的方法,如 " +"``send``、``recv`` 等。MicroPython 的 ``wrap_socket`` 返回一个更类似于 CPython 的 " +"``SSLObject`` 的对象,该对象没有这些套接字方法。" + +#: ../../library/ssl.rst:107 +msgid "" +"Set or get the behaviour for verification of peer certificates. Must be " +"one of the ``CERT_*`` constants." +msgstr "设置或获取对等证书验证行为。必须是 ``CERT_*`` 常量之一。" + +#: ../../library/ssl.rst:112 +msgid "" +"``ssl.CERT_REQUIRED`` requires the device's date/time to be properly set," +" e.g. using `mpremote rtc --set ` or ``ntptime``, " +"and ``server_hostname`` must be specified when on the client side." +msgstr "" +"``ssl.CERT_REQUIRED`` 要求设备的日期/时间正确设置,例如使用 `mpremote rtc --set " +"` 或 ``ntptime``,并且在客户端时必须指定 ``server_hostname``。" + +#: ../../library/ssl.rst:117 +msgid "Exceptions" +msgstr "异常" + +#: ../../library/ssl.rst:121 +msgid "This exception does NOT exist. Instead its base class, OSError, is used." +msgstr "不存在此异常。相反,使用其基类,OSError。" + +#: ../../library/ssl.rst:126 +msgid "DTLS support" +msgstr "DTLS 支持" + +#: ../../library/ssl.rst:131 +msgid "This is a MicroPython extension." +msgstr "这是 MicroPython 扩展。" + +#: ../../library/ssl.rst:133 +msgid "" +"On most ports, this module supports DTLS in client and server mode via " +"the `PROTOCOL_DTLS_CLIENT` and `PROTOCOL_DTLS_SERVER` constants that can " +"be used as the ``protocol`` argument of `SSLContext`." +msgstr "" +"在大多数端口上,此模块通过 `PROTOCOL_DTLS_CLIENT` 和 `PROTOCOL_DTLS_SERVER` 常量支持客户端和服务器模式的 DTLS," +"这些常量可用作 `SSLContext` 的 ``protocol`` 参数。" + +#: ../../library/ssl.rst:137 +msgid "" +"In this case the underlying socket is expected to behave as a datagram " +"socket (i.e. like the socket opened with ``socket.socket`` with " +"``socket.AF_INET`` as ``af`` and ``socket.SOCK_DGRAM`` as ``type``)." +msgstr "" +"在这种情况下,底层套接字应表现为数据报套接字(即使用 ``socket.socket`` 以 ``socket.AF_INET`` 作为 ``af``、" +"``socket.SOCK_DGRAM`` 作为 ``type`` 打开的套接字)。" + +#: ../../library/ssl.rst:141 +msgid "" +"DTLS is only supported on ports that use mbedTLS, and it is enabled by " +"default in most configurations but can be manually disabled by defining " +"``MICROPY_PY_SSL_DTLS`` to 0." +msgstr "" +"DTLS 仅在使用 mbedTLS 的端口上受支持,在大多数配置中默认启用," +"但可以通过将 ``MICROPY_PY_SSL_DTLS`` 定义为 0 来手动禁用。" + +#: ../../library/ssl.rst:146 +msgid "DTLS server support" +msgstr "DTLS 服务器支持" + +#: ../../library/ssl.rst:148 +msgid "" +"MicroPython's DTLS server support is configured with \"Hello Verify\" as " +"required for DTLS 1.2. This is transparent for DTLS clients, but there " +"are relevant considerations when implementing a DTLS server in " +"MicroPython:" +msgstr "" +"MicroPython 的 DTLS 服务器支持配置了 DTLS 1.2 所需的 \"Hello Verify\"。" +"这对 DTLS 客户端是透明的,但在 MicroPython 中实现 DTLS 服务器时有一些相关注意事项:" + +#: ../../library/ssl.rst:152 +msgid "" +"The server should pass an additional argument *client_id* when calling " +"`SSLContext.wrap_socket()`. This ID must be a `bytes` object (or similar)" +" with a transport-specific identifier representing the client." +msgstr "" +"服务器在调用 `SSLContext.wrap_socket()` 时应传递额外的 *client_id* 参数。" +"此 ID 必须是一个 `bytes` 对象(或类似对象),包含代表客户端的传输层特定标识符。" + +#: ../../library/ssl.rst:156 +msgid "" +"The simplest approach is to convert the tuple of ``(client_ip, " +"client_port)`` returned from ``socket.recv_from()`` into a byte string, " +"i.e.::" +msgstr "" +"最简单的方法是将 ``socket.recv_from()`` 返回的 ``(client_ip, client_port)`` " +"元组转换为字节字符串,即::" + +#: ../../library/ssl.rst:164 +msgid "" +"The first time a client connects, the server call to ``wrap_socket`` will" +" fail with a `OSError` error \"Hello Verify Required\". This is because " +"the DTLS \"Hello Verify\" cookie is not yet known by the client. If the " +"same client connects a second time then ``wrap_socket`` will succeed." +msgstr "" +"客户端首次连接时,服务器调用 ``wrap_socket`` 将因 `OSError` 错误 \"Hello Verify Required\" 而失败。" +"这是因为客户端尚不知道 DTLS \"Hello Verify\" cookie。如果同一客户端第二次连接,``wrap_socket`` 将成功。" + +#: ../../library/ssl.rst:169 +msgid "" +"DTLS cookies for \"Hello Verify\" are associated with the `SSLContext` " +"object, so the same `SSLContext` object should be used to wrap a " +"subsequent connection from the same client. The cookie implementation " +"includes a timeout and has constant memory use regardless of how many " +"clients connect, so it's OK to reuse the same `SSLContext` object for the" +" lifetime of the server." +msgstr "" +"用于 \"Hello Verify\" 的 DTLS cookie 与 `SSLContext` 对象关联,因此应使用相同的 `SSLContext` " +"对象来包装同一客户端的后续连接。cookie 实现包含超时机制,且无论多少客户端连接,内存使用量都是恒定的," +"因此在服务器的整个生命周期内重用同一个 `SSLContext` 对象是可以的。" + +#: ../../library/ssl.rst:176 +msgid "Constants" +msgstr "常量" + +#: ../../library/ssl.rst:183 +msgid "Supported values for the *protocol* parameter." +msgstr "*protocol* 参数支持的值。" + +#: ../../library/ssl.rst:189 +msgid "" +"Supported values for *cert_reqs* parameter, and the " +":attr:`SSLContext.verify_mode` attribute." +msgstr "*cert_reqs* 参数支持的值,以及 :attr:`SSLContext.verify_mode` 属性。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/stm.po b/docs/locale/zh_CN/LC_MESSAGES/library/stm.po new file mode 100644 index 0000000000000..4437c26d59c53 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/stm.po @@ -0,0 +1,222 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-19 02:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/stm.rst:4 +msgid ":mod:`stm` --- functionality specific to STM32 MCUs" +msgstr ":mod:`stm` --- 特定于STM32微控制器的功能" + +#: ../../library/stm.rst:9 +msgid "" +"This module provides functionality specific to STM32 microcontrollers, " +"including direct access to peripheral registers." +msgstr "该模块提供了特定于STM32微控制器的功能,包括直接访问外设寄存器。" + +#: ../../library/stm.rst:13 +msgid "Memory access" +msgstr "内存访问" + +#: ../../library/stm.rst:15 +msgid "The module exposes three objects used for raw memory access." +msgstr "此模块公开了三个用于原始内存访问的对象。" + +#: ../../library/stm.rst:19 +msgid "Read/write 8 bits of memory." +msgstr "读/写内存的8位。" + +#: ../../library/stm.rst:23 +msgid "Read/write 16 bits of memory." +msgstr "读/写内存的16位。" + +#: ../../library/stm.rst:27 +msgid "Read/write 32 bits of memory." +msgstr "读/写内存的32位。" + +#: ../../library/stm.rst:29 +msgid "" +"Use subscript notation ``[...]`` to index these objects with the address " +"of interest." +msgstr "使用下标符号 ``[...]`` 用感兴趣的地址来索引这些对象。" + +#: ../../library/stm.rst:32 +msgid "" +"These memory objects can be used in combination with the peripheral " +"register constants to read and write registers of the MCU hardware " +"peripherals, as well as all other areas of address space." +msgstr "这些内存对象可以与外设寄存器的常量结合使用,以读取和写入MCU硬件外设的寄存器," +"以及地址空间的所有其他区域。" + +#: ../../library/stm.rst:38 +msgid "Peripheral register constants" +msgstr "外设寄存器常量" + +#: ../../library/stm.rst:40 +msgid "" +"The module defines constants for registers which are generated from CMSIS" +" header files, and the constants available depend on the microcontroller " +"series that is being compiled for. Examples of some constants include:" +msgstr "该模块为从CMSIS头文件生成的寄存器定义了常量,并且可用的常量取决于正在编译的微" +"控制系列。一些常量的示例包括:" + +#: ../../library/stm.rst:46 +msgid "Base address of the GPIOA peripheral." +msgstr "GPIOA 外设的基址。" + +#: ../../library/stm.rst:50 +msgid "Base address of the GPIOB peripheral." +msgstr "GPIOB外设的基址。" + +#: ../../library/stm.rst:54 +msgid "Offset of the GPIO bit set/reset register." +msgstr "GPIO位设置/重置寄存器的偏移量。" + +#: ../../library/stm.rst:58 +msgid "Offset of the GPIO input data register." +msgstr "GPIO输入数据寄存器的偏移量。" + +#: ../../library/stm.rst:62 +msgid "Offset of the GPIO output data register." +msgstr "GPIO输出数据寄存器的偏移量。" + +#: ../../library/stm.rst:64 +msgid "" +"Constants that are named after a peripheral, like ``GPIOA``, are the " +"absolute address of that peripheral. Constants that have a prefix which " +"is the name of a peripheral, like ``GPIO_BSRR``, are relative offsets of " +"the register. Accessing peripheral registers requires adding the " +"absolute base address of the peripheral and the relative register offset." +" For example ``GPIOA + GPIO_BSRR`` is the full, absolute address of the " +"``GPIOA->BSRR`` register." +msgstr "" +"以外设命名的常量,如 ``GPIOA`` ,是该外设的绝对地址。以外设名称为前缀的常量," +"如 ``GPIO_BSRR`` ,是寄存器的相对偏移量。访问外设寄存器需要添加外设的绝对基址" +"和相对寄存器偏移量。例如 ``GPIOA + GPIO_BSRR`` 是 ``GPIOA->BSRR`` " +"寄存器的完整、绝对地址。" + +#: ../../library/stm.rst:71 +msgid "Example use:" +msgstr "示例用法:" + +#: ../../library/stm.rst:83 +msgid "Functions specific to STM32WBxx MCUs" +msgstr "特定于STM32WBxx 微控制器的函数" + +#: ../../library/stm.rst:85 +msgid "" +"These functions are available on STM32WBxx microcontrollers, and interact" +" with the second CPU, the RF core." +msgstr "这些函数适用于STM32WBxx 微控制器,并与第二个CPU即RF核心交互。" + +#: ../../library/stm.rst:90 +msgid "" +"Returns the status of the second CPU as an integer (the first word of " +"device info table)." +msgstr "返回第二个CPU的状态,以整数形式(设备信息的第一个字)。" + +#: ../../library/stm.rst:95 +msgid "" +"Get the version of the firmware running on the second CPU. Pass in 0 for" +" *id* to get the FUS version, and 1 to get the WS version." +msgstr "" +"获取运行在第二个CPU上的固件版本。对于 *id*,传入0获取FUS版本,传入1获取WS版本。" + +#: ../../library/stm.rst:98 +msgid "Returns a 5-tuple with the full version number." +msgstr "返回完整版本号的5元组。" + +#: ../../library/stm.rst:102 +msgid "Execute a HCI command on the SYS channel. The execution is synchronous." +msgstr "在SYS通道上执行一个HCI命令。执行是同步的。" + +#: ../../library/stm.rst:104 +msgid "Returns a bytes object with the result of the SYS command." +msgstr "返回一个包含SYS命令结果的字节对象。" + +#: ../../library/stm.rst:107 +msgid "Functions specific to STM32WLxx MCUs" +msgstr "特定于 STM32WLxx 微控制器的函数" + +#: ../../library/stm.rst:109 +msgid "" +"These functions are available on STM32WLxx microcontrollers, and interact" +" with the integrated \"SUBGHZ\" radio modem peripheral." +msgstr "这些函数适用于 STM32WLxx 微控制器,并与集成的 \"SUBGHZ\" " +"无线电调制解调器外设交互。" + +#: ../../library/stm.rst:114 +msgid "" +"Sets the internal SPI CS pin attached to the radio peripheral. The " +"``level`` argument is active-low: a truthy value means \"CS pin high\" " +"and de-asserts the signal, a falsey value means \"CS pin low\" and " +"asserts the signal." +msgstr "" +"设置连接到无线电外设的内部 SPI CS 引脚。 ``level`` 参数是低电平有效的:" +"真值表示 \"CS 引脚高\" 并取消信号,假值表示 \"CS 引脚低\" 并使信号有效。" + +#: ../../library/stm.rst:118 +msgid "" +"The internal-only SPI bus corresponding to this CS signal can be " +"instantiated using :ref:`machine.SPI()` ``id`` value " +"``\"SUBGHZ\"``." +msgstr "" +"使用 :ref:`machine.SPI()` 中 ``id`` 值为 ``\"SUBGHZ\"`` " +"来实例化与此 CS 信号对应的内部 SPI 总线。" + +#: ../../library/stm.rst:123 +msgid "" +"Sets the internal SUBGHZ radio interrupt handler to the provided " +"function. The handler function is called as a \"hard\" interrupt in " +"response to radio peripheral interrupts. See :ref:`isr_rules` for more " +"information about interrupt handlers in MicroPython." +msgstr "" +"将内部 SUBGHZ 无线电中断处理程序设置为提供的函数。处理程序函数作为 \"硬\" " +"中断在无线电外设中断时调用。有关 MicroPython 中断处理程序的更多信息,请参阅 " +":ref:`isr_rules` 。" + +#: ../../library/stm.rst:128 +msgid "" +"Calling this function with the handler argument set to None disables the " +"IRQ." +msgstr "将此函数与设置为None的处理程序参数调用以禁用IRQ。" + +#: ../../library/stm.rst:130 +msgid "" +"Due to a hardware limitation, each time this IRQ fires MicroPython " +"disables it before calling the handler. In order to receive another " +"interrupt, Python code should call ``subghz_irq()`` to set the handler " +"again. This has the side effect of re-enabling the IRQ." +msgstr "" +"由于硬件限制,每次此IRQ触发时,MicroPython在调用处理程序之前将其禁用。为了接" +"收另一个中断,Python代码应调用 ``subghz_irq()`` " +"来重新设置处理程序。这具有重新启用IRQ的副作用。" + +#: ../../library/stm.rst:137 +msgid "" +"Return a ``bool`` corresponding to the internal \"RFBUSYS\" signal from " +"the radio peripheral. Before sending a new command to the radio over SPI " +"then this function should be polled until it returns ``False``, to " +"confirm the busy signal is de-asserted." +msgstr "" +"返回与无线电外设中的内部 \"RFBUSYS\" 信号对用的 ``bool`` " +"值。在将新命令通过SPI发送到无线电之前,应该轮询此函数直到它返回 " +"``False``,以确认忙碌信号已经取消激活。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/struct.po b/docs/locale/zh_CN/LC_MESSAGES/library/struct.po new file mode 100644 index 0000000000000..5e23aca19c665 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/struct.po @@ -0,0 +1,328 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 18:05+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/struct.rst:2 +msgid ":mod:`struct` -- pack and unpack primitive data types" +msgstr ":mod:`struct` -- 打包和解压原始数据类型" + +#: ../../library/struct.rst:7 +msgid "|see_cpython_module| :mod:`python:struct`." +msgstr "|see_cpython_module| :mod:`python:struct`。" + +#: ../../library/struct.rst:9 +msgid "The following byte orders are supported:" +msgstr "支持以下字节顺序:" + +#: ../../library/struct.rst:12 +msgid "Character" +msgstr "字符" + +#: ../../library/struct.rst:12 +msgid "Byte order" +msgstr "字节顺序" + +#: ../../library/struct.rst:12 +msgid "Size" +msgstr "大小" + +#: ../../library/struct.rst:12 +msgid "Alignment" +msgstr "对齐" + +#: ../../library/struct.rst:14 +msgid "@" +msgstr "@" + +#: ../../library/struct.rst:14 +msgid "native" +msgstr "本机" + +#: ../../library/struct.rst:16 +msgid "<" +msgstr "<" + +#: ../../library/struct.rst:16 +msgid "little-endian" +msgstr "小端" + +#: ../../library/struct.rst:16 ../../library/struct.rst:18 +#: ../../library/struct.rst:20 +msgid "standard" +msgstr "标准" + +#: ../../library/struct.rst:16 ../../library/struct.rst:18 +#: ../../library/struct.rst:20 +msgid "none" +msgstr "无" + +#: ../../library/struct.rst:18 +msgid ">" +msgstr ">" + +#: ../../library/struct.rst:18 +msgid "big-endian" +msgstr "大端" + +#: ../../library/struct.rst:20 +msgid "!" +msgstr "!" + +#: ../../library/struct.rst:20 +msgid "network (= big-endian)" +msgstr "网络(=大端)" + +#: ../../library/struct.rst:23 +msgid "The following data types are supported:" +msgstr "支持以下数据类型:" + +#: ../../library/struct.rst:26 +msgid "Format" +msgstr "格式" + +#: ../../library/struct.rst:26 +msgid "C Type" +msgstr "C类型" + +#: ../../library/struct.rst:26 +msgid "Python type" +msgstr "Python 类型" + +#: ../../library/struct.rst:26 +msgid "Standard size" +msgstr "标准大小" + +#: ../../library/struct.rst:28 +msgid "b" +msgstr "b" + +#: ../../library/struct.rst:28 +msgid "signed char" +msgstr "有符号字符" + +#: ../../library/struct.rst:28 ../../library/struct.rst:30 +#: ../../library/struct.rst:32 ../../library/struct.rst:34 +#: ../../library/struct.rst:56 +msgid "integer" +msgstr "整数" + +#: ../../library/struct.rst:28 ../../library/struct.rst:30 +msgid "1" +msgstr "1" + +#: ../../library/struct.rst:30 +msgid "B" +msgstr "B" + +#: ../../library/struct.rst:30 +msgid "unsigned char" +msgstr "无符号字符" + +#: ../../library/struct.rst:32 +msgid "h" +msgstr "h" + +#: ../../library/struct.rst:32 +msgid "short" +msgstr "short" + +#: ../../library/struct.rst:32 ../../library/struct.rst:34 +#: ../../library/struct.rst:48 +msgid "2" +msgstr "2" + +#: ../../library/struct.rst:34 +msgid "H" +msgstr "H" + +#: ../../library/struct.rst:34 +msgid "unsigned short" +msgstr "无符号 short" + +#: ../../library/struct.rst:36 +msgid "i" +msgstr "i" + +#: ../../library/struct.rst:36 +msgid "int" +msgstr "int" + +#: ../../library/struct.rst:36 ../../library/struct.rst:38 +#: ../../library/struct.rst:40 ../../library/struct.rst:42 +#: ../../library/struct.rst:44 ../../library/struct.rst:46 +msgid "integer (`1`)" +msgstr "整数(`1`)" + +#: ../../library/struct.rst:36 ../../library/struct.rst:38 +#: ../../library/struct.rst:40 ../../library/struct.rst:42 +#: ../../library/struct.rst:50 +msgid "4" +msgstr "4" + +#: ../../library/struct.rst:38 +msgid "I" +msgstr "I" + +#: ../../library/struct.rst:38 +msgid "unsigned int" +msgstr "无符号int" + +#: ../../library/struct.rst:40 +msgid "l" +msgstr "l" + +#: ../../library/struct.rst:40 +msgid "long" +msgstr "long" + +#: ../../library/struct.rst:42 +msgid "L" +msgstr "L" + +#: ../../library/struct.rst:42 +msgid "unsigned long" +msgstr "无符号long" + +#: ../../library/struct.rst:44 +msgid "q" +msgstr "q" + +#: ../../library/struct.rst:44 +msgid "long long" +msgstr "long long" + +#: ../../library/struct.rst:44 ../../library/struct.rst:46 +#: ../../library/struct.rst:52 +msgid "8" +msgstr "8" + +#: ../../library/struct.rst:46 +msgid "Q" +msgstr "Q" + +#: ../../library/struct.rst:46 +msgid "unsigned long long" +msgstr "unsigned long long" + +#: ../../library/struct.rst:48 +msgid "e" +msgstr "e" + +#: ../../library/struct.rst:48 +msgid "n/a (half-float)" +msgstr "n/a(半精度浮点)" + +#: ../../library/struct.rst:48 ../../library/struct.rst:50 +#: ../../library/struct.rst:52 +msgid "float (`2`)" +msgstr "float (`2`)" + +#: ../../library/struct.rst:50 +msgid "f" +msgstr "f" + +#: ../../library/struct.rst:50 +msgid "float" +msgstr "float" + +#: ../../library/struct.rst:52 +msgid "d" +msgstr "d" + +#: ../../library/struct.rst:52 +msgid "double" +msgstr "double" + +#: ../../library/struct.rst:54 +msgid "s" +msgstr "s" + +#: ../../library/struct.rst:54 +msgid "char[]" +msgstr "char[]" + +#: ../../library/struct.rst:54 +msgid "bytes" +msgstr "bytes" + +#: ../../library/struct.rst:56 +msgid "P" +msgstr "P" + +#: ../../library/struct.rst:56 +msgid "void *" +msgstr "void *" + +#: ../../library/struct.rst:61 +msgid "Requires long support when used with values larger than 30 bits." +msgstr "当使用大于30位的值时,需要长支持。" + +#: ../../library/struct.rst:62 +msgid "Requires floating point support." +msgstr "需要浮点数支持。" + +#: ../../library/struct.rst:64 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/struct.rst:67 +msgid "Whitespace is not supported in format strings." +msgstr "格式字符串中不支持空格。" + +#: ../../library/struct.rst:70 +msgid "Functions" +msgstr "函数" + +#: ../../library/struct.rst:74 +msgid "Return the number of bytes needed to store the given *fmt*." +msgstr "返回存储给定 *fmt* 所需的字节数。" + +#: ../../library/struct.rst:78 +msgid "" +"Pack the values *v1*, *v2*, ... according to the format string *fmt*. The" +" return value is a bytes object encoding the values." +msgstr "根据格式字符串 *fmt* 打包值 *v1*, *v2*, ...。返回值是编码值的字节对象。" + +#: ../../library/struct.rst:83 +msgid "" +"Pack the values *v1*, *v2*, ... according to the format string *fmt* into" +" a *buffer* starting at *offset*. *offset* may be negative to count from " +"the end of *buffer*." +msgstr "" +"根据格式字符串 *fmt* 将值 *v1*, *v2*, ... 打包到从 *offset* 开始的 *buffer* 中。 *offset* " +"可以为负,表示从 *buffer* 的末尾计数。" + +#: ../../library/struct.rst:89 +msgid "" +"Unpack from the *data* according to the format string *fmt*. The return " +"value is a tuple of the unpacked values." +msgstr "根据格式字符串 *fmt* 从 *data* 中解包。返回值是解包后的值的元组。" + +#: ../../library/struct.rst:94 +msgid "" +"Unpack from the *data* starting at *offset* according to the format " +"string *fmt*. *offset* may be negative to count from the end of *data*. " +"The return value is a tuple of the unpacked values." +msgstr "" +"根据格式字符串 *fmt* 从 *data* 的 *offset* 开始解包。 *offset* 可以为负,表示从 *data* " +"的末尾计数。返回值是解包后的值的元组。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/sys.po b/docs/locale/zh_CN/LC_MESSAGES/library/sys.po new file mode 100644 index 0000000000000..d79e4adb9a4b9 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/sys.po @@ -0,0 +1,312 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/sys.rst:2 +msgid ":mod:`sys` -- system specific functions" +msgstr ":mod:`sys` --- 系统特定函数" + +#: ../../library/sys.rst:7 +msgid "|see_cpython_module| :mod:`python:sys`." +msgstr "|see_cpython_module| :mod:`python:sys`。" + +#: ../../library/sys.rst:10 +msgid "Functions" +msgstr "函数" + +#: ../../library/sys.rst:14 +msgid "" +"Terminate current program with a given exit code. Underlyingly, this " +"function raises a `SystemExit` exception. If an argument is given, its " +"value given as an argument to `SystemExit`." +msgstr "以给定的退出码终止当前程序。底层上,此函数会引发 `SystemExit` 异常。如果给定了参数,则将其值作为 `SystemExit` 的参数传递。" + +#: ../../library/sys.rst:18 +msgid "" +"On embedded ports (i.e. all ports but Windows and Unix), an unhandled " +"`SystemExit` currently causes a :ref:`soft_reset` of MicroPython." +msgstr "在嵌入式端口(即除 Windows 和 Unix 之外的所有端口)上,未处理的 `SystemExit` 目前会导致 MicroPython 的 :ref:`soft_reset`。" + +#: ../../library/sys.rst:23 +msgid "" +"Register *func* to be called upon termination. *func* must be a callable" +" that takes no arguments, or ``None`` to disable the call. The " +"``atexit`` function will return the previous value set by this function, " +"which is initially ``None``." +msgstr "" +"注册 *fun* 在终止时调用。*fun* 必须是一个不带参数的可调对象,或 ``None`` 以禁用调用。``atexit`` " +"函数将返回此函数设置的先前值,最初为 ``None``。" + +#: ../../library/sys.rst:28 ../../library/sys.rst:39 ../../library/sys.rst:108 +#: ../../library/sys.rst:148 ../../library/sys.rst:199 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/sys.rst:31 +msgid "" +"This function is a MicroPython extension intended to provide similar " +"functionality to the :mod:`atexit` module in CPython." +msgstr "此函数是 MicroPython 的扩展,旨在提供类似于 CPython 中的 :mod:`atexit` 模块。" + +#: ../../library/sys.rst:36 +msgid "" +"Print exception with a traceback to a file-like object *file* (or " +"`sys.stdout` by default)." +msgstr "将异常及其回溯打印到文件样对象 *file* (默认为 `sys.stdout` )。" + +#: ../../library/sys.rst:42 +msgid "" +"This is simplified version of a function which appears in the " +"``traceback`` module in CPython. Unlike ``traceback.print_exception()``, " +"this function takes just exception value instead of exception type, " +"exception value, and traceback object; *file* argument should be " +"positional; further arguments are not supported. CPython-compatible " +"``traceback`` module can be found in `micropython-lib`." +msgstr "" +"这是简化版本的函数,类似于 CPython 中的 ``traceback`` 模块中的函数。与 " +"``traceback.print_exception()`` 不同,此函数仅接受异常值,而不是异常类型、异常值和回溯对象; *file* " +"参数应为位置参数;不支持更多的参数。与 CPython 兼容的 ``traceback`` 模块可以在 `micropython-lib` " +"中找到。" + +#: ../../library/sys.rst:51 +msgid "" +"Enable tracing of bytecode execution. For details see the `CPython " +"documentation " +"`_." +msgstr "" +"启用字节码执行的跟踪。有关详细信息,请参阅 `CPython documentation " +"`_。" + +#: ../../library/sys.rst:54 +msgid "" +"This function requires a custom MicroPython build as it is typically not " +"present in pre-built firmware (due to it affecting performance). The " +"relevant configuration option is *MICROPY_PY_SYS_SETTRACE*." +msgstr "" +"此函数需要自定义的 MicroPython 构建,因为它通常不包含在预构建的固件中(因为它会影响性能)。相关的配置选项是 " +"*MICROPY_PY_SYS_SETTRACE*。" + +#: ../../library/sys.rst:59 +msgid "Constants" +msgstr "常量" + +#: ../../library/sys.rst:63 +msgid "A mutable list of arguments the current program was started with." +msgstr "当前程序启动时使用的可变参数列表。" + +#: ../../library/sys.rst:67 +msgid "The byte order of the system (``\"little\"`` or ``\"big\"``)." +msgstr "系统的字节顺序(``\"little\"`` 或 ``\"big\"``)。" + +#: ../../library/sys.rst:71 +msgid "" +"Object with information about the current Python implementation. For " +"MicroPython, it has following attributes:" +msgstr "包含有关当前Python实现的信息的对象。对于MicroPython,它具有以下属性:" + +#: ../../library/sys.rst:74 +msgid "*name* - string \"micropython\"" +msgstr "*name* - 字符串 \"micropython\"" + +#: ../../library/sys.rst:75 +msgid "*version* - tuple (major, minor, micro, releaselevel), e.g. (1, 22, 0, '')" +msgstr "*version* - 元组 (major, minor, micro, releaselevel),例如 (1, 22, 0, '')" + +#: ../../library/sys.rst:76 +msgid "*_machine* - string describing the underlying machine" +msgstr "*_machine* - 描述底层机器的字符串" + +#: ../../library/sys.rst:77 +msgid "*_mpy* - supported mpy file-format version (optional attribute)" +msgstr "*_mpy* - 支持的 mpy 文件格式版本(可选属性)" + +#: ../../library/sys.rst:78 +msgid "" +"*_build* - string that can help identify the configuration that " +"MicroPython was built with" +msgstr "*_build* - 可以帮助识别 MicroPython 构建配置的字符串" + +#: ../../library/sys.rst:80 +msgid "" +"*_thread* - optional string attribute, exists if the target has threading" +" and is either \"GIL\" or \"unsafe\"" +msgstr "*_thread* - 可选的字符串属性,如果目标支持线程则存在,值为 \"GIL\" 或 \"unsafe\"" + +#: ../../library/sys.rst:83 +msgid "" +"This object is the recommended way to distinguish MicroPython from other " +"Python implementations (note that it still may not exist in the very " +"minimal ports)." +msgstr "此对象是推荐的区分 MicroPython 和其他 Python 实现的方式(请注意,它仍然可能不存在于非常小的移植版本中)。" + +#: ../../library/sys.rst:87 +msgid "" +"Starting with version 1.22.0-preview, the fourth node *releaselevel* in " +"*implementation.version* is either an empty string or ``\"preview\"``." +msgstr "" +"从版本 1.22.0-preview 开始,*implementation.version* 中的第四个节点 *releaselevel* " +"要么是空字符串,要么是 ``\"preview\"``。" + +#: ../../library/sys.rst:90 +msgid "" +"The *_build* entry was added in version 1.25.0 and is a hyphen-separated " +"set of elements. New elements may be appended in the future so it's best" +" to access this field using ``sys.implementation._build.split(\"-\")``. " +"The elements that are currently used are:" +msgstr "" +"*_build* 条目在版本 1.25.0 中添加,是一组以连字符分隔的元素。" +"将来可能会追加新元素,因此最好使用 ``sys.implementation._build.split(\"-\")`` 访问此字段。" +"当前使用的元素如下:" + +#: ../../library/sys.rst:95 +msgid "" +"On the unix, webassembly and windows ports the first element is the " +"variant name, for example ``'standard'``." +msgstr "在 unix、webassembly 和 windows 端口上,第一个元素是变体名称,例如 ``'standard'``。" + +#: ../../library/sys.rst:97 +msgid "" +"On microcontroller targets, the first element is the board name and the " +"second element (if present) is the board variant, for example " +"``'RPI_PICO2-RISCV'``" +msgstr "" +"在微控制器目标上,第一个元素是板名称,第二个元素(如果存在)是板变体," +"例如 ``'RPI_PICO2-RISCV'``" + +#: ../../library/sys.rst:100 +msgid "" +"The *_thread* entry was added in version 1.26.0 and if it exists then the" +" target has the ``_thread`` module. If the target enables the GIL " +"(global interpreter lock) then this attribute is ``\"GIL\"``. Otherwise " +"the attribute is ``\"unsafe\"`` and the target has threading but does not" +" enable the GIL, and mutable Python objects (such as `bytearray`, `list` " +"and `dict`) that are shared amongst threads must be protected explicitly " +"by locks such as ``_thread.allocate_lock``." +msgstr "" +"*_thread* 条目在版本 1.26.0 中添加,如果存在则目标具有 ``_thread`` 模块。" +"如果目标启用了 GIL(全局解释器锁),则此属性为 ``\"GIL\"``。否则属性为 ``\"unsafe\"``," +"表示目标支持线程但未启用 GIL,在线程之间共享的可变 Python 对象(如 `bytearray`、`list` " +"和 `dict`)必须通过 ``_thread.allocate_lock`` 等锁显式保护。" + +#: ../../library/sys.rst:111 +msgid "" +"CPython mandates more attributes for this object, but the actual useful " +"bare minimum is implemented in MicroPython." +msgstr "CPython 对此对象规定了更多的属性,但实际有用的最低限度是在 MicroPython中实现的。" + +#: ../../library/sys.rst:116 +msgid "" +"Maximum value which a native integer type can hold on the current " +"platform, or maximum value representable by MicroPython integer type, if " +"it's smaller than platform max value (that is the case for MicroPython " +"ports without long int support)." +msgstr "当前平台的整机整数类型可以容纳的最大值,或者如果MicroPython整数类型的最大值小于平台最大值(这是没有长整型支持的MicroPython移植版本的情况)。" + +#: ../../library/sys.rst:121 +msgid "" +"This attribute is useful for detecting \"bitness\" of a platform (32-bit " +"vs 64-bit, etc.). It's recommended to not compare this attribute to some " +"value directly, but instead count number of bits in it::" +msgstr "这个属性对于检测平台的 \"位数\"(32位还是64位等)非常有用。建议不直接将此属性与某个值进行比较,而是计算其中的位数::" + +#: ../../library/sys.rst:141 +msgid "" +"Dictionary of loaded modules. On some ports, it may not include builtin " +"modules." +msgstr "已加载模块的字典。在某些移植版本上,可能不包括内置模块。" + +#: ../../library/sys.rst:146 +msgid "A mutable list of directories to search for imported modules." +msgstr "用于搜索导入模块的可变目录列表。" + +#: ../../library/sys.rst:151 +msgid "" +"On MicroPython, an entry with the value ``\".frozen\"`` will indicate " +"that import should search :term:`frozen modules ` at that " +"point in the search. If no frozen module is found then search will *not* " +"look for a directory called ``.frozen``, instead it will continue with " +"the next entry in ``sys.path``." +msgstr "" +"在 MicroPython 中,一个带有值为 ``\".frozen\"`` 的条目表示导入应在搜索中的该点搜索 :term:`frozen " +"modules `。如果找不到冻结模块,则搜索不会继续寻找名为 ``.frozen`` " +"的目录,而是会继续下一个条目中 ``sys.path``。" + +#: ../../library/sys.rst:158 +msgid "" +"The platform that MicroPython is running on. For OS/RTOS ports, this is " +"usually an identifier of the OS, e.g. ``\"linux\"``. For baremetal ports " +"it is an identifier of a board, e.g. ``\"pyboard\"`` for the original " +"MicroPython reference board. It thus can be used to distinguish one board" +" from another. If you need to check whether your program runs on " +"MicroPython (vs other Python implementation), use `sys.implementation` " +"instead." +msgstr "" +"MicroPython 运行的平台。对于 OS/RTOS 移植版本,这通常是操作系统的标识符,例如 " +"``\"linux\"``。对于裸机移植版本,它是一个板的标识符,例如原始的 MicroPython 参考板的 " +"``\"pyboard\"``。因此,它可用于区分一个板与另一个板。如果您需要检查您的程序是否在 MicroPython 上运行(与其他 " +"Python 实现相比),请改用 `sys.implementation`。" + +#: ../../library/sys.rst:168 +msgid "" +"Mutable attributes holding strings, which are used for the REPL prompt. " +"The defaults give the standard Python prompt of ``>>>`` and ``...``." +msgstr "包含字符串的可变属性,用于REPL提示符。默认值为标准Python提示符 ``>>>`` 和 ``...``。" + +#: ../../library/sys.rst:173 +msgid "Standard error :std:term:`stream`." +msgstr "标准错误 :std:term:`stream`。" + +#: ../../library/sys.rst:177 +msgid "Standard input :std:term:`stream`." +msgstr "标准输入 :std:term:`stream`。" + +#: ../../library/sys.rst:181 +msgid "Standard output :std:term:`stream`." +msgstr "标准输出 :std:term:`stream`。" + +#: ../../library/sys.rst:185 +msgid "" +"A mutable attribute holding an integer value which is the maximum number " +"of traceback entries to store in an exception. Set to 0 to disable " +"adding tracebacks. Defaults to 1000." +msgstr "这是一个可变属性,包含一个整数值,是异常中存储的最大回溯条目数。设置为0以禁用添加回溯。默认为1000。" + +#: ../../library/sys.rst:189 +msgid "Note: this is not available on all ports." +msgstr "注意:这些功能并非在所有移植版本上都可用。" + +#: ../../library/sys.rst:193 +msgid "Python language version that this implementation conforms to, as a string." +msgstr "该实现符合的 Python 语言版本,以字符串形式表示。" + +#: ../../library/sys.rst:197 +msgid "" +"Python language version that this implementation conforms to, as a tuple " +"of ints." +msgstr "该实现符合的 Python 语言版本,以整数元组的形式表示。" + +#: ../../library/sys.rst:202 +msgid "" +"Only the first three version numbers (major, minor, micro) are supported " +"and they can be referenced only by index, not by name." +msgstr "仅支持前三个版本号(主版本、次版本、微版本),并且只能通过索引引用,而不能通过名称引用。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/time.po b/docs/locale/zh_CN/LC_MESSAGES/library/time.po new file mode 100644 index 0000000000000..3a7cca40b7fa0 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/time.po @@ -0,0 +1,441 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/time.rst:2 +msgid ":mod:`time` -- time related functions" +msgstr ":mod:`time` -- 时间相关函数" + +#: ../../library/time.rst:7 +msgid "|see_cpython_module| :mod:`python:time`." +msgstr "|see_cpython_module| :mod:`python:time`。" + +#: ../../library/time.rst:9 +msgid "" +"The ``time`` module provides functions for getting the current time and " +"date, measuring time intervals, and for delays." +msgstr "``time`` 模块提供了获取当前时间和日期、测量时间间隔以及延迟的函数。" + +#: ../../library/time.rst:12 +msgid "" +"**Time Epoch**: The unix, windows, webassembly, alif, mimxrt and rp2 " +"ports use the standard for POSIX systems epoch of 1970-01-01 00:00:00 " +"UTC. The other embedded ports use an epoch of 2000-01-01 00:00:00 UTC. " +"Epoch year may be determined with ``gmtime(0)[0]``." +msgstr "" +"**时间基准**:unix、windows、webassembly、alif、mimxrt 和 rp2 移植版本使用 POSIX 系统纪元标准,即 " +"1970-01-01 00:00:00 UTC。其他嵌入式移植版本使用 2000-01-01 00:00:00 UTC 的纪元。可以使用 " +"``gmtime(0)[0]`` 确定纪元年份。" + +#: ../../library/time.rst:17 +msgid "" +"**Maintaining actual calendar date/time**: This requires a Real Time " +"Clock (RTC). On systems with underlying OS (including some RTOS), an RTC " +"may be implicit. Setting and maintaining actual calendar time is " +"responsibility of OS/RTOS and is done outside of MicroPython, it just " +"uses OS API to query date/time. On baremetal ports however system time " +"depends on ``machine.RTC()`` object. The current calendar time may be set" +" using ``machine.RTC().datetime(tuple)`` function, and maintained by " +"following means:" +msgstr "" +"**维护实际日历日期/时间**:这需要一个实时时钟(RTC)。在具有底层操作系统的系统上(包括一些实时操作系统),RTC " +"可能是隐式的。设置和维护实际日历时间是操作系统/实时操作系统的责任,并且是在 MicroPython 之外完成的,它只是使用操作系统 API " +"查询日期/时间。然而,在裸机移植版本上,系统时间取决于 ``machine.RTC()`` 对象。可以使用 " +"``machine.RTC().datetime(tuple)`` 函数设置当前日历时间,并通过以下方式进行维护:" + +#: ../../library/time.rst:26 +msgid "" +"By a backup battery (which may be an additional, optional component for a" +" particular board)." +msgstr "通过备用电池(对于特定板卡可能是一个额外的、可选的组件)。" + +#: ../../library/time.rst:28 +msgid "Using networked time protocol (requires setup by a port/user)." +msgstr "使用网络时间协议(需要由移植版本/用户进行设置)。" + +#: ../../library/time.rst:29 +msgid "" +"Set manually by a user on each power-up (many boards then maintain RTC " +"time across hard resets, though some may require setting it again in such" +" case)." +msgstr "每次上电由用户手动设置(许多板卡会在硬件重置时维护RTC时间,但有些可能在这种情况下需要重新设置)。" + +#: ../../library/time.rst:33 +msgid "" +"If actual calendar time is not maintained with a system/MicroPython RTC, " +"functions below which require reference to current absolute time may " +"behave not as expected." +msgstr "如果没有使用系统/MicroPython RTC 维护实际的日历时间,则下面需要参考当前绝对时间的函数可能不会按预期方式工作。" + +#: ../../library/time.rst:38 +msgid "Functions" +msgstr "函数" + +#: ../../library/time.rst:43 +msgid "" +"Convert the time *secs* expressed in seconds since the Epoch (see above) " +"into an 8-tuple which contains: ``(year, month, mday, hour, minute, " +"second, weekday, yearday)`` If *secs* is not provided or None, then the " +"current time from the RTC is used." +msgstr "" +"将自Epoch(见上文)以来以秒为单位表示的时间 *secs* 转换为包含 8 元组的格式,其中包含:``(year, month, mday, " +"hour, minute, second, weekday, yearday)``。如果未提供 *secs* 或为 None,则使用来自 RTC " +"的当前时间。" + +#: ../../library/time.rst:47 +msgid "" +"The `gmtime()` function returns a date-time tuple in UTC, and " +"`localtime()` returns a date-time tuple in local time." +msgstr "`gmtime()` 函数返回 UTC 中的日期时间元组,`localtime()` 返「回本地时间中的日期时间元组。" + +#: ../../library/time.rst:50 +msgid "The format of the entries in the 8-tuple are:" +msgstr "8元组中条目的格式为:" + +#: ../../library/time.rst:52 +msgid "year includes the century (for example 2014)." +msgstr "year包含世纪(例如2014)。" + +#: ../../library/time.rst:53 +msgid "month is 1-12" +msgstr "month 为1-12" + +#: ../../library/time.rst:54 +msgid "mday is 1-31" +msgstr "mday 为 1-31" + +#: ../../library/time.rst:55 +msgid "hour is 0-23" +msgstr "hour 为 0-23" + +#: ../../library/time.rst:56 +msgid "minute is 0-59" +msgstr "minute 为 0-59" + +#: ../../library/time.rst:57 +msgid "second is 0-59" +msgstr "second 为 0-59" + +#: ../../library/time.rst:58 +msgid "weekday is 0-6 for Mon-Sun" +msgstr "weekday 为 0-6,代表周一至周日" + +#: ../../library/time.rst:59 +msgid "yearday is 1-366" +msgstr "yearday 为 1-366" + +#: ../../library/time.rst:63 +msgid "" +"This is inverse function of localtime. It's argument is a full 8-tuple " +"which expresses a time as per localtime. It returns an integer which is " +"the number of seconds since the time epoch." +msgstr "这是 localtime 的逆函数。它的参数是一个完整的 8 元组,表示 localtime 的时间。它返回一个整数,即自时间纪元以来的秒数。" + +#: ../../library/time.rst:69 +msgid "" +"Sleep for the given number of seconds. Some boards may accept *seconds* " +"as a floating-point number to sleep for a fractional number of seconds. " +"Note that other boards may not accept a floating-point argument, for " +"compatibility with them use `sleep_ms()` and `sleep_us()` functions." +msgstr "" +"休眠指定的秒数。某些板卡可以接受 *seconds* 作为浮点数以休眠一定数量的秒数。注意,其他板卡可能不接受浮点参数,为了与它们兼容,请使用 " +"`sleep_ms()` 和 `sleep_us()` 函数。" + +#: ../../library/time.rst:76 +msgid "Delay for given number of milliseconds, should be positive or 0." +msgstr "延迟给定的毫秒数,应为正数或0." + +#: ../../library/time.rst:78 +msgid "" +"This function will delay for at least the given number of milliseconds, " +"but may take longer than that if other processing must take place, for " +"example interrupt handlers or other threads. Passing in 0 for *ms* will " +"still allow this other processing to occur. Use `sleep_us()` for more " +"precise delays." +msgstr "" +"该函数将至少延迟给定的毫秒数,但如果必须进行其他处理,例如中断处理程序或其他线程,则可能需要更长的时间。将 *ms* " +"设置为0将允许进行其他处理。对于更精确的延迟,请使用 `sleep_us()`。" + +#: ../../library/time.rst:85 +msgid "Delay for given number of microseconds, should be positive or 0." +msgstr "延迟给定的微秒数,应为正数或0." + +#: ../../library/time.rst:87 +msgid "" +"This function attempts to provide an accurate delay of at least *us* " +"microseconds, but it may take longer if the system has other higher " +"priority processing to perform." +msgstr "该函数尝试提供至少 *us* 微秒的准确延迟,但如果系统有其他更高优先级的处理要执行,则可能需要更长的时间。" + +#: ../../library/time.rst:93 +msgid "" +"Returns an increasing millisecond counter with an arbitrary reference " +"point, that wraps around after some value." +msgstr "返回一个带有任意参考点的递增毫秒计数器,在某个值之后会环绕。" + +#: ../../library/time.rst:96 +msgid "" +"The wrap-around value is not explicitly exposed, but we will refer to it " +"as *TICKS_MAX* to simplify discussion. Period of the values is " +"*TICKS_PERIOD = TICKS_MAX + 1*. *TICKS_PERIOD* is guaranteed to be a " +"power of two, but otherwise may differ from port to port. The same period" +" value is used for all of `ticks_ms()`, `ticks_us()`, `ticks_cpu()` " +"functions (for simplicity). Thus, these functions will return a value in " +"range [*0* .. *TICKS_MAX*], inclusive, total *TICKS_PERIOD* values. Note " +"that only non-negative values are used. For the most part, you should " +"treat values returned by these functions as opaque. The only operations " +"available for them are `ticks_diff()` and `ticks_add()` functions " +"described below." +msgstr "" +"环绕值没有显式暴露,但我们将其称为 *TICKS_MAX*,以简化讨论。值的周期是 *TICKS_PERIOD = TICKS_MAX + " +"1*。*TICKS_PERIOD* 被保证是 2 的幂,但除此之外可能因移植版本而异。对于所有的 " +"`ticks_ms()`、`ticks_us()`、`ticks_cpu()` 函数都使用相同的周期值(为了简单起见)。因此,这些函数将返回范围为 " +"[*0* ..*TICKS_MAX*] 的值,包括 *TICKS_PERIOD* " +"个值。请注意,仅使用非负值。在大多数情况下,您应该将这些函数返回的值视为不透明的。它们的唯一可用操作是下面描述的 `ticks_diff()` 和 " +"`ticks_add()` 函数。" + +#: ../../library/time.rst:107 +msgid "" +"Note: Performing standard mathematical operations (+, -) or relational " +"operators (<, <=, >, >=) directly on these value will lead to invalid " +"result. Performing mathematical operations and then passing their results" +" as arguments to `ticks_diff()` or `ticks_add()` will also lead to " +"invalid results from the latter functions." +msgstr "" +"注意:对这些值执行标准数学操作(+、-)或关系运算符(<、<=、>、>=)会导致无效结果。对数学操作执行,然后将其结果作为参数传递给 " +"`ticks_diff()` 或 `ticks_add()` 也会导致从后者函数返回的结果无效。" + +#: ../../library/time.rst:115 +msgid "Just like `ticks_ms()` above, but in microseconds." +msgstr "类似于上面的 `ticks_ms()`,但以微秒为单位。" + +#: ../../library/time.rst:119 +msgid "" +"Similar to `ticks_ms()` and `ticks_us()`, but with the highest possible " +"resolution in the system. This is usually CPU clocks, and that's why the " +"function is named that way. But it doesn't have to be a CPU clock, some " +"other timing source available in a system (e.g. high-resolution timer) " +"can be used instead. The exact timing unit (resolution) of this function " +"is not specified on ``time`` module level, but documentation for a " +"specific port may provide more specific information. This function is " +"intended for very fine benchmarking or very tight real-time loops. Avoid " +"using it in portable code." +msgstr "" +"类似于 `ticks_ms()` 和 `ticks_us()`,但在系统中具有最高的可能分辨率。通常是 CPU " +"时钟,这就是该函数被命名的原因。但它不一定是 CPU " +"时钟,系统中可用的其他时序源(例如高分辨率定时器)也可以使用。该函数的确切时间单位(分辨率)未在 ``time`` " +"模块级别指定,但特定移植版本的文档可能提供更具体的信息。该函数用于非常精细的基准测试或非常紧密的实时循环。避免在可移植代码中使用它。" + +#: ../../library/time.rst:128 +msgid "Availability: Not every port implements this function." +msgstr "可用性:并非每个移植版本都实现了此功能。" + +#: ../../library/time.rst:133 +msgid "" +"Offset ticks value by a given number, which can be either positive or " +"negative. Given a *ticks* value, this function allows to calculate ticks " +"value *delta* ticks before or after it, following modular-arithmetic " +"definition of tick values (see `ticks_ms()` above). *ticks* parameter " +"must be a direct result of call to `ticks_ms()`, `ticks_us()`, or " +"`ticks_cpu()` functions (or from previous call to `ticks_add()`). " +"However, *delta* can be an arbitrary integer number or numeric " +"expression. `ticks_add()` is useful for calculating deadlines for " +"events/tasks. (Note: you must use `ticks_diff()` function to work with " +"deadlines.)" +msgstr "" +"将 ticks 值偏移给定的数字,可以是正数也可以是负数。给定一个 *ticks* 值,此函数允许计算在其之前或之后的 *delta* ticks" +" 值,遵循了 tick 值的模运算定义(参见上面的 `ticks_ms()`)。*ticks* 参数必须是对 " +"`ticks_ms()`、`ticks_us()` 或 `ticks_cpu()` 函数的直接调用的结果(或从以前对 `ticks_add()` " +"的调用)。但 *delta* 可以是任意整数或数值表达式。`ticks_add()` 对于计算事件/任务的截止时间很有用。(注意:您必须使用 " +"`ticks_diff()` 函数来处理截止日期。)" + +#: ../../library/time.rst:143 +msgid "Examples::" +msgstr "示例::" + +#: ../../library/time.rst:159 +msgid "" +"Measure ticks difference between values returned from `ticks_ms()`, " +"`ticks_us()`, or `ticks_cpu()` functions, as a signed value which may " +"wrap around." +msgstr "" +"测量从 `ticks_ms()`、`ticks_us()` 或 `ticks_cpu()` 函数返回的值之间的 ticks " +"差异,作为可能会环绕的有符号值。" + +#: ../../library/time.rst:162 +msgid "" +"The argument order is the same as for subtraction operator, " +"``ticks_diff(ticks1, ticks2)`` has the same meaning as ``ticks1 - " +"ticks2``. However, values returned by `ticks_ms()`, etc. functions may " +"wrap around, so directly using subtraction on them will produce incorrect" +" result. That is why `ticks_diff()` is needed, it implements modular (or " +"more specifically, ring) arithmetic to produce correct result even for " +"wrap-around values (as long as they not too distant in between, see " +"below). The function returns **signed** value in the range " +"[*-TICKS_PERIOD/2* .. *TICKS_PERIOD/2-1*] (that's a typical range " +"definition for two's-complement signed binary integers). If the result is" +" negative, it means that *ticks1* occurred earlier in time than *ticks2*." +" Otherwise, it means that *ticks1* occurred after *ticks2*. This holds " +"**only** if *ticks1* and *ticks2* are apart from each other for no more " +"than *TICKS_PERIOD/2-1* ticks. If that does not hold, incorrect result " +"will be returned. Specifically, if two tick values are apart for " +"*TICKS_PERIOD/2-1* ticks, that value will be returned by the function. " +"However, if *TICKS_PERIOD/2* of real-time ticks has passed between them, " +"the function will return *-TICKS_PERIOD/2* instead, i.e. result value " +"will wrap around to the negative range of possible values." +msgstr "" +"参数顺序与减法运算符相同,``ticks_diff(ticks1, ticks2)`` 具有与 ``ticks1 - ticks2`` " +"相同的含义。但是,`ticks_ms()` 等函数返回的值可能会环绕,因此直接在其上执行减法将产生不正确的结果。这就是需要 " +"`ticks_diff()` 的原因,它实现了模(或更具体地说,环)算术,以便即使对于环绕值(只要它们之间的距离不太大,参见下文)也能产生正确的结果" +"。该函数返回范围为 [*-TICKS_PERIOD/2* .. *TICKS_PERIOD/2-1*] 的 **有符号** " +"值(这是二进制补码有符号整数的典型范围定义)。如果结果为负,则表示 *ticks1* 在时间上早于 *ticks2*。否则,表示 *ticks1* " +"在 *ticks2* 之后发生。这仅在 *ticks1* 和 *ticks2* 之间的时间相隔不超过 *TICKS_PERIOD/2-1* " +"ticks 时才有效。如果不满足此条件,将返回不正确的结果。具体来说,如果两个 tick 值相隔 *TICKS_PERIOD/2-1* " +"ticks,那么该值将由函数返回。然而,如果 *TICKS_PERIOD/2* 的实时 ticks 之间已经过去了,那么该函数将返回 " +"*-TICKS_PERIOD/2*,即结果值将环绕到可能的值范围的负值区域。" + +#: ../../library/time.rst:180 +msgid "" +"Informal rationale of the constraints above: Suppose you are locked in a " +"room with no means to monitor passing of time except a standard 12-notch " +"clock. Then if you look at dial-plate now, and don't look again for " +"another 13 hours (e.g., if you fall for a long sleep), then once you " +"finally look again, it may seem to you that only 1 hour has passed. To " +"avoid this mistake, just look at the clock regularly. Your application " +"should do the same. \"Too long sleep\" metaphor also maps directly to " +"application behaviour: don't let your application run any single task for" +" too long. Run tasks in steps, and do time-keeping in between." +msgstr "" +"上述约束的非正式解释:假设您被锁在一个没有其他监视时间流逝手段的房间里,只有一个标准的 12 格钟。如果您现在看一眼表盘,并且再过 13 " +"小时才再次看一眼(例如,如果您长时间睡觉),那么一旦您最终再次看时,您可能会觉得仅经过了 1 " +"小时。为了避免这种错误,只需定期查看时钟。您的应用程序应该做同样的事情。\"太长时间的睡眠\"隐喻也直接映射到应用程序行为:不要让应用程序运行任何单个任务太长时间。在步骤中运行任务,并在其间进行时间记录。" + +#: ../../library/time.rst:189 +msgid "" +"`ticks_diff()` is designed to accommodate various usage patterns, among " +"them:" +msgstr "`ticks_diff()` 设计用于适应各种使用模式,其中包括:" + +#: ../../library/time.rst:191 +msgid "" +"Polling with timeout. In this case, the order of events is known, and you" +" will deal only with positive results of `ticks_diff()`::" +msgstr "带有超时的轮询。在这种情况下,事件顺序已知,并且您将仅处理 `ticks_diff()` 的正结果::" + +#: ../../library/time.rst:200 +msgid "" +"Scheduling events. In this case, `ticks_diff()` result may be negative if" +" an event is overdue::" +msgstr "安排事件。在这种情况下,如果事件已过期,`ticks_diff()` 可能为负值::" + +#: ../../library/time.rst:217 +msgid "" +"Note: Do not pass `time()` values to `ticks_diff()`, you should use " +"normal mathematical operations on them. But note that `time()` may (and " +"will) also overflow. This is known as " +"https://en.wikipedia.org/wiki/Year_2038_problem ." +msgstr "" +"注意:不要将 `time()` 值传递给 `ticks_diff()`,您应该对它们进行正常的数学运算。但请注意,`time()` " +"可能(而且将)溢出。这就是所谓的https://en.wikipedia.org/wiki/Year_2038_problem 。" + +#: ../../library/time.rst:224 +msgid "" +"Returns the number of seconds, as an integer, since the Epoch, assuming " +"that underlying RTC is set and maintained as described above. If an RTC " +"is not set, this function returns number of seconds since a port-specific" +" reference point in time (for embedded boards without a battery-backed " +"RTC, usually since power up or reset). If you want to develop portable " +"MicroPython application, you should not rely on this function to provide " +"higher than second precision. If you need higher precision, absolute " +"timestamps, use `time_ns()`. If relative times are acceptable then use " +"the `ticks_ms()` and `ticks_us()` functions. If you need calendar time, " +"`gmtime()` or `localtime()` without an argument is a better choice." +msgstr "" +"返回自纪元以来的秒数,作为整数,假设底层 RTC 被设置和维护如上所述。如果未设置 " +"RTC,则该函数返回自特定于移植版本的参考时间点以来的秒数(对于没有备电 RTC 的嵌入式板,通常是自上电或复位以来)。如果您希望开发可移植的 " +"MicroPython 应用程序,则不应依赖此函数提供高于秒精度的精度。如果需要更高的精度、绝对时间戳,请使用 " +"`time_ns()`。如果相对时间可接受,则使用 `ticks_ms()` 和 `ticks_us()` " +"函数。如果需要日历时间,则使用没有参数的 `gmtime()` 或 `localtime()` 更好。" + +#: ../../library/time.rst:234 +msgid "Difference to CPython" +msgstr "与CPython的不同之处" + +#: ../../library/time.rst:237 +msgid "" +"In CPython, this function returns number of seconds since Unix epoch, " +"1970-01-01 00:00 UTC, as a floating-point, usually having microsecond " +"precision. With MicroPython, only Unix port uses the same Epoch, and if " +"floating-point precision allows, returns sub-second precision. Embedded " +"hardware usually doesn't have floating-point precision to represent both " +"long time ranges and subsecond precision, so they use integer value with " +"second precision. Some embedded hardware also lacks battery-powered RTC, " +"so returns number of seconds since last power-up or from other relative, " +"hardware-specific point (e.g. reset)." +msgstr "" +"在 CPython 中,此函数返回自 Unix 纪元以来的秒数,即 1970-01-01 00:00 UTC,作为浮点数,通常具有微秒精度。使用 " +"MicroPython 时,只有 Unix " +"移植版本使用相同的纪元,如果浮点精度允许,返回子秒精度。嵌入式硬件通常没有浮点精度来表示长时间范围和子秒精度,因此它们使用具有秒精度的整数值。一些嵌入式硬件也缺少电池供电的" +" RTC,因此返回自上次上电或相对于其他相对、硬件特定点(例如复位)的秒数。" + +#: ../../library/time.rst:250 +msgid "" +"Similar to `time()` but returns nanoseconds since the Epoch, as an " +"integer (usually a big integer, so will allocate on the heap)." +msgstr "类似于 `time()`,但返回自纪元以来的纳秒数,作为整数(通常是大整数,因此将在堆上分配)。" + +#: ../../library/time.rst:254 +msgid "Constructors" +msgstr "构造" + +#: ../../library/time.rst:258 +msgid "Returns a clock object." +msgstr "返回一个时钟对象。" + +#: ../../library/time.rst:261 +msgid "Methods" +msgstr "方法" + +#: ../../library/time.rst:265 +msgid "Starts tracking elapsed time." +msgstr "开始跟踪运行时间。" + +#: ../../library/time.rst:269 +msgid "" +"Stops tracking the elapsed time and returns the current FPS (frames per " +"second)." +msgstr "停止跟踪经过的时间并返回当前FPA(帧/秒)。" + +#: ../../library/time.rst:272 ../../library/time.rst:279 +msgid "Always call ``tick`` first before calling this function." +msgstr "总是在调用此函数之前先调用 ``tick``。" + +#: ../../library/time.rst:276 +msgid "" +"Stops tracking the elapsed time and returns the current average elapsed " +"time in milliseconds." +msgstr "停止跟踪运行时间并返回以微秒为单位的当前平均运行时间。" + +#: ../../library/time.rst:283 +msgid "Resets the clock object." +msgstr "重置时钟对象。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/uctypes.po b/docs/locale/zh_CN/LC_MESSAGES/library/uctypes.po new file mode 100644 index 0000000000000..06fd7b3415ecd --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/uctypes.po @@ -0,0 +1,439 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-08-13 06:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.6.2\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/uctypes.rst:2 +msgid ":mod:`uctypes` -- access binary data in a structured way" +msgstr ":mod:`uctypes` -- 以结构化方式访问二进制数据" + +#: ../../library/uctypes.rst:7 +msgid "" +"This module implements \"foreign data interface\" for MicroPython. The " +"idea behind it is similar to CPython's ``ctypes`` modules, but the actual" +" API is different, streamlined and optimized for small size. The basic " +"idea of the module is to define data structure layout with about the same" +" power as the C language allows, and then access it using familiar dot-" +"syntax to reference sub-fields." +msgstr "" +"该模块为MicroPython实现了“外部数据接口”。其背后的思想类似于CPython的 " +"``ctypes`` 模块,但实际API有所不同,经过简化和优化以适应小型尺寸。该模块的基" +"本思想是使用与C语言允许的大致相同的功能来定义数据结构布局,然后使用熟悉的点语" +"法来访问子字段。" + +#: ../../library/uctypes.rst:16 +msgid "" +"``uctypes`` module allows access to arbitrary memory addresses of the " +"machine (including I/O and control registers). Uncareful usage of it may " +"lead to crashes, data loss, and even hardware malfunction." +msgstr "``uctypes`` 模块允许访问机器的任意内存地址(包括I/" +"O和控制寄存器)。对其的不小心使用可能导致系统崩溃、数据丢失,甚至硬件故障。" + +#: ../../library/uctypes.rst:23 +msgid "Module :mod:`struct`" +msgstr "模块 :mod:`struct`" + +#: ../../library/uctypes.rst:23 +msgid "" +"Standard Python way to access binary data structures (doesn't scale well " +"to large and complex structures)." +msgstr "访问二进制数据结构的标准Python方式(不适用于大型和复杂的结构)。" + +#: ../../library/uctypes.rst:26 +msgid "Usage examples::" +msgstr "使用示例::" + +#: ../../library/uctypes.rst:85 +msgid "Defining structure layout" +msgstr "定义结构布局" + +#: ../../library/uctypes.rst:87 +msgid "" +"Structure layout is defined by a \"descriptor\" - a Python dictionary " +"which encodes field names as keys and other properties required to access" +" them as associated values::" +msgstr "结构布局由“描述符”定义 - " +"一个Python字典,将字段名称编码为键,并将访问它们所需的其他属性为相关值::" + +#: ../../library/uctypes.rst:97 +msgid "" +"Currently, ``uctypes`` requires explicit specification of offsets for " +"each field. Offset are given in bytes from the structure start." +msgstr "目前,``uctypes`` " +"要求对每个字段显式指定偏移量。偏移量以字节为单位,从结构开始计算。" + +#: ../../library/uctypes.rst:100 +msgid "Following are encoding examples for various field types:" +msgstr "以下是各种字段类型的编码示例:" + +#: ../../library/uctypes.rst:102 +msgid "Scalar types::" +msgstr "标量类型::" + +#: ../../library/uctypes.rst:106 +msgid "" +"in other words, the value is a scalar type identifier ORed with a field " +"offset (in bytes) from the start of the structure." +msgstr "换句话说,值是标量类型标识符,与从结构开始的字段偏移量(以字节为单位)进行OR" +"运算。" + +#: ../../library/uctypes.rst:109 +msgid "Recursive structures::" +msgstr "递归结构::" + +#: ../../library/uctypes.rst:116 +msgid "" +"i.e. value is a 2-tuple, first element of which is an offset, and second " +"is a structure descriptor dictionary (note: offsets in recursive " +"descriptors are relative to the structure it defines). Of course, " +"recursive structures can be specified not just by a literal dictionary, " +"but by referring to a structure descriptor dictionary (defined earlier) " +"by name." +msgstr "" +"即,值是一个二元组,其第一个元素是偏移量,第二个是结构描述符字典(注意:递归" +"描述符中的偏移量是相对于其定义的结构的)。当然,递归结构不仅可以通过文字字典" +"指定,还可以通过名称引用早先定义的结构描述符字典。" + +#: ../../library/uctypes.rst:122 +msgid "Arrays of primitive types::" +msgstr "原始类型数组::" + +#: ../../library/uctypes.rst:126 +msgid "" +"i.e. value is a 2-tuple, first element of which is ARRAY flag ORed with " +"offset, and second is scalar element type ORed number of elements in the " +"array." +msgstr "例如,值是一个二元组,其第一个元素是ARRAY标志与偏移量进行OR运算,第二个是标量" +"元素类型和数组中的元素数进行OR运算。" + +#: ../../library/uctypes.rst:130 +msgid "Arrays of aggregate types::" +msgstr "聚合类型数组::" + +#: ../../library/uctypes.rst:134 +msgid "" +"i.e. value is a 3-tuple, first element of which is ARRAY flag ORed with " +"offset, second is a number of elements in the array, and third is a " +"descriptor of element type." +msgstr "即,值是一个三元组,其第一个元素是ARRAY标志与偏移量进行OR运算,第二个是数组中" +"的元素数,第三个是元素类型的描述符。" + +#: ../../library/uctypes.rst:138 +msgid "Pointer to a primitive type::" +msgstr "指向原始类型的指针::" + +#: ../../library/uctypes.rst:142 +msgid "" +"i.e. value is a 2-tuple, first element of which is PTR flag ORed with " +"offset, and second is a scalar element type." +msgstr "即,值是一个二元组,其第一个元素是PTR标志与偏移量进行OR运算,第二个是标量元素" +"类型。" + +#: ../../library/uctypes.rst:145 +msgid "Pointer to an aggregate type::" +msgstr "指向聚合类型的指针::" + +#: ../../library/uctypes.rst:149 +msgid "" +"i.e. value is a 2-tuple, first element of which is PTR flag ORed with " +"offset, second is a descriptor of type pointed to." +msgstr "即,值是一个二元组,其第一个元素是PTR标志与偏移量进行OR运算,第二个是指向类型" +"的描述符。" + +#: ../../library/uctypes.rst:152 +msgid "Bitfields::" +msgstr "位域::" + +#: ../../library/uctypes.rst:156 +msgid "" +"i.e. value is a type of scalar value containing given bitfield (typenames" +" are similar to scalar types, but prefixes with ``BF``), ORed with offset" +" for scalar value containing the bitfield, and further ORed with values " +"for bit position and bit length of the bitfield within the scalar value, " +"shifted by BF_POS and BF_LEN bits, respectively. A bitfield position is " +"counted from the least significant bit of the scalar (having position of " +"0), and is the number of right-most bit of a field (in other words, it's " +"a number of bits a scalar needs to be shifted right to extract the " +"bitfield)." +msgstr "" +"即,值是包含给定位域的标量值的类型(类型名称类似于标量类型,但前缀为 ``BF``)" +",与包含位域的标量值的偏移量进行OR运算,并且进一步与位域在标量值中的位位置和" +"位长度的值进行OR运算,分别按 BF_POS 和 BF_LEN 位移动。位域位置从标量的最低有" +"效位(位置为0)开始计数,并且是标量值中字段的最右位(换句话说,它是标量需要右" +"移的位数以提取位域的位数)。" + +#: ../../library/uctypes.rst:165 +msgid "" +"In the example above, first a UINT16 value will be extracted at offset 0 " +"(this detail may be important when accessing hardware registers, where " +"particular access size and alignment are required), and then bitfield " +"whose rightmost bit is *lsbit* bit of this UINT16, and length is " +"*bitsize* bits, will be extracted. For example, if *lsbit* is 0 and " +"*bitsize* is 8, then effectively it will access least-significant byte of" +" UINT16." +msgstr "" +"在上面的示例中,首先将在偏移量为0的位置提取UINT16值(当访问硬件寄存器时,此细节可能很重要,其中需要特定的访问大小和对齐),然后提取最右位为 " +"*lsbit* 的位域,并且长度为 *bitsize* 位。例如,如果 *lsbit* 为0且 *bitsize* " +"为8,则实际上将访问UINT16的最低有效字节。" + +#: ../../library/uctypes.rst:173 +msgid "" +"Note that bitfield operations are independent of target byte endianness, " +"in particular, example above will access least-significant byte of UINT16" +" in both little- and big-endian structures. But it depends on the least " +"significant bit being numbered 0. Some targets may use different " +"numbering in their native ABI, but ``uctypes`` always uses the normalized" +" numbering described above." +msgstr "" +"请注意,位域操作独立于目标字节顺序,特别是,上面的示例将在小端和大端结构中都" +"访问UINT16的最低有效字节。但它取决于最低有效位编号为0。某些目标可能在其本机AB" +"I中使用不同的编号,但 ``uctypes`` 始终使用上述规范化编号。" + +#: ../../library/uctypes.rst:181 +msgid "Module contents" +msgstr "模块内容" + +#: ../../library/uctypes.rst:185 +msgid "" +"Instantiate a \"foreign data structure\" object based on structure " +"address in memory, descriptor (encoded as a dictionary), and layout type " +"(see below)." +msgstr "基于内存中的结构地址、描述符(编码为字典)和布局类型(见下文)实例化一个“外部" +"数据结构”对象。" + +#: ../../library/uctypes.rst:190 +msgid "" +"Layout type for a little-endian packed structure. (Packed means that " +"every field occupies exactly as many bytes as defined in the descriptor, " +"i.e. the alignment is 1)." +msgstr "小端紧凑结构的布局类型。 " +"(紧凑意味着每个字段占用的字节数与描述符中定义的一样多,即对齐为1)。" + +#: ../../library/uctypes.rst:196 +msgid "Layout type for a big-endian packed structure." +msgstr "大端紧凑结构的布局类型。" + +#: ../../library/uctypes.rst:200 +msgid "" +"Layout type for a native structure - with data endianness and alignment " +"conforming to the ABI of the system on which MicroPython runs." +msgstr "本地结构的布局类型 - 数据字节序和对齐符合MicroPython运行所在系统的ABI。" + +#: ../../library/uctypes.rst:205 +msgid "" +"Return size of data structure in bytes. The *struct* argument can be " +"either a structure class or a specific instantiated structure object (or " +"its aggregate field)." +msgstr "返回数据结构的字节数。 *struct* " +"参数可以是结构类或特定实例化的结构对象(或其聚合字段)。" + +#: ../../library/uctypes.rst:211 +msgid "" +"Return address of an object. Argument should be bytes, bytearray or other" +" object supporting buffer protocol (and address of this buffer is what " +"actually returned)." +msgstr "返回对象的地址。参数应为bytes、bytearray或支持缓冲区协议的其他对象(实际返回" +"的是该缓冲区的地址)。" + +#: ../../library/uctypes.rst:217 +msgid "" +"Capture memory at the given address and size as bytes object. As bytes " +"object is immutable, memory is actually duplicated and copied into bytes " +"object, so if memory contents change later, created object retains " +"original value." +msgstr "" +"将给定地址和大小的内存捕获为字节对象。由于字节对象是不可变的,因此实际上会复" +"制并复制内存到字节对象,因此如果稍后更改了内存内容,则创建的对象保留原始值。" + +#: ../../library/uctypes.rst:224 +msgid "" +"Capture memory at the given address and size as bytearray object. Unlike " +"bytes_at() function above, memory is captured by reference, so it can be " +"both written too, and you will access current value at the given memory " +"address." +msgstr "" +"将给定地址和大小的内存捕获为bytearray对象。不同于上面的bytes_at()函数,内存是" +"通过引用捕获的,因此可以同时写入,并且您将访问给定内存地址的当前值。" + +#: ../../library/uctypes.rst:238 +msgid "" +"Integer types for structure descriptors. Constants for 8, 16, 32, and 64 " +"bit types are provided, both signed and unsigned." +msgstr "结构描述符的整数类型。提供了8、16、32和64位类型的常量,有符号和无符号。" + +#: ../../library/uctypes.rst:244 +msgid "Floating-point types for structure descriptors." +msgstr "结构描述符的浮点类型。" + +#: ../../library/uctypes.rst:248 +msgid "" +"``VOID`` is an alias for ``UINT8``, and is provided to conveniently " +"define C's void pointers: ``(uctypes.PTR, uctypes.VOID)``." +msgstr "" +"``VOID`` 是 ``UINT8`` 的别名,提供了方便地定义C的void指针的方法: ``(" +"uctypes.PTR, uctypes.VOID)``。" + +#: ../../library/uctypes.rst:254 +msgid "" +"Type constants for pointers and arrays. Note that there is no explicit " +"constant for structures, it's implicit: an aggregate type without ``PTR``" +" or ``ARRAY`` flags is a structure." +msgstr "指针和数组的类型常量。请注意,没有显式的结构常量,它是隐式的:没有 ``PTR`` " +"或 ``ARRAY`` 标志的聚合类型是一个结构。" + +#: ../../library/uctypes.rst:259 +msgid "Structure descriptors and instantiating structure objects" +msgstr "结构描述符和实例化结构对象" + +#: ../../library/uctypes.rst:261 +msgid "" +"Given a structure descriptor dictionary and its layout type, you can " +"instantiate a specific structure instance at a given memory address using" +" :class:`uctypes.struct()` constructor. Memory address usually comes from" +" following sources:" +msgstr "" +"给定结构描述符字典及其布局类型,可以使用:class:`uctypes.struct()` " +"构造函数在给定内存地址上实例化特定的结构实例。内存地址通常来自以下来源:" + +#: ../../library/uctypes.rst:266 +msgid "" +"Predefined address, when accessing hardware registers on a baremetal " +"system. Lookup these addresses in datasheet for a particular MCU/SoC." +msgstr "访问裸机系统上的硬件寄存器时的预定义地址。在特定MCU/" +"SoC的数据手册中查找这些地址。" + +#: ../../library/uctypes.rst:268 +msgid "" +"As a return value from a call to some FFI (Foreign Function Interface) " +"function." +msgstr "作为对某些FFI(外部函数接口)函数调用的返回值。" + +#: ../../library/uctypes.rst:270 +msgid "" +"From `uctypes.addressof()`, when you want to pass arguments to an FFI " +"function, or alternatively, to access some data for I/O (for example, " +"data read from a file or network socket)." +msgstr "" +"从 `uctypes.addressof()` ,当您希望向FFI函数传递参数时,或者用于访问一些I/" +"O数据(例如,从文件或网络套接字读取的数据)。" + +#: ../../library/uctypes.rst:275 +msgid "Structure objects" +msgstr "结构对象" + +#: ../../library/uctypes.rst:277 +msgid "" +"Structure objects allow accessing individual fields using standard dot " +"notation: ``my_struct.substruct1.field1``. If a field is of scalar type, " +"getting it will produce a primitive value (Python integer or float) " +"corresponding to the value contained in a field. A scalar field can also " +"be assigned to." +msgstr "" +"结构对象允许使用标准点表示法访问各个字段:``my_struct.substruct1.field1``。如" +"果字段是标量类型,则获取它将产生与字段中包含的值对应的原始值(Python整数或浮" +"点数)。也可以对标量字段进行赋值。" + +#: ../../library/uctypes.rst:283 +msgid "" +"If a field is an array, its individual elements can be accessed with the " +"standard subscript operator ``[]`` - both read and assigned to." +msgstr "如果字段是数组,则可以使用标准下标操作符 ``[]`` 来访问其各个元素 - " +"读取和分配都可以。" + +#: ../../library/uctypes.rst:286 +msgid "" +"If a field is a pointer, it can be dereferenced using ``[0]`` syntax " +"(corresponding to C ``*`` operator, though ``[0]`` works in C too). " +"Subscripting a pointer with other integer values but 0 are also " +"supported, with the same semantics as in C." +msgstr "" +"如果字段是指针,则可以使用 ``[0]`` 语法对其进行解引用(对应于C中的 ``*`` " +"运算符,尽管在C中也可以使用 " +"``[0]``)。还支持使用除0以外的其他整数值对指针进行下标操作,其语义与C中相同。" + +#: ../../library/uctypes.rst:291 +msgid "" +"Summing up, accessing structure fields generally follows the C syntax, " +"except for pointer dereference, when you need to use ``[0]`` operator " +"instead of ``*``." +msgstr "总之,访问结构字段通常遵循C语法,但在解引用指针时,需要使用 ``[0]`` " +"运算符而不是 ``*``。" + +#: ../../library/uctypes.rst:296 +msgid "Limitations" +msgstr "限制" + +#: ../../library/uctypes.rst:298 +msgid "" +"1. Accessing non-scalar fields leads to allocation of intermediate " +"objects to represent them. This means that special care should be taken " +"to layout a structure which needs to be accessed when memory allocation " +"is disabled (e.g. from an interrupt). The recommendations are:" +msgstr "1. 访问非标量字段会导致分配中间对象来表示它们。这意味着在禁用内存分配时(例如" +",中断)需要特别注意布局一个需要访问的结构。建议如下:" + +#: ../../library/uctypes.rst:303 +msgid "" +"Avoid accessing nested structures. For example, instead of " +"``mcu_registers.peripheral_a.register1``, define separate layout " +"descriptors for each peripheral, to be accessed as " +"``peripheral_a.register1``. Or just cache a particular peripheral: " +"``peripheral_a = mcu_registers.peripheral_a``. If a register consists of " +"multiple bitfields, you would need to cache references to a particular " +"register: ``reg_a = mcu_registers.peripheral_a.reg_a``." +msgstr "" +"避免访问嵌套结构。例如,不要使用 ``mcu_registers.peripheral_a." +"register1``,而是定义每个外设的单独布局描述符,以便作为 ``peripheral_a." +"register1`` 进行访问。或者只缓存特定的外设:``peripheral_a = mcu_registers." +"peripheral_a``。如果寄存器由多个位域组成,您将需要缓存对特定寄存器的引用:``" +"reg_a = mcu_registers.peripheral_a.reg_a``。" + +#: ../../library/uctypes.rst:310 +msgid "" +"Avoid other non-scalar data, like arrays. For example, instead of " +"``peripheral_a.register[0]`` use ``peripheral_a.register0``. Again, an " +"alternative is to cache intermediate values, e.g. ``register0 = " +"peripheral_a.register[0]``." +msgstr "" +"避免其他非标量数据,如数组。例如,不要使用 ``peripheral_a.register[0]``," +"而是使用 ``peripheral_a.register0``。同样,一个替代方法是缓存中间值,例如 ``" +"register0 = peripheral_a.register[0]``。" + +#: ../../library/uctypes.rst:315 +msgid "" +"2. Range of offsets supported by the ``uctypes`` module is limited. The " +"exact range supported is considered an implementation detail, and the " +"general suggestion is to split structure definitions to cover from a few " +"kilobytes to a few dozen of kilobytes maximum. In most cases, this is a " +"natural situation anyway, e.g. it doesn't make sense to define all " +"registers of an MCU (spread over 32-bit address space) in one structure, " +"but rather a peripheral block by peripheral block. In some extreme cases," +" you may need to split a structure in several parts artificially (e.g. if" +" accessing native data structure with multi-megabyte array in the middle," +" though that would be a very synthetic case)." +msgstr "" +"2. ``uctypes`` 模块支持的偏移范围有限。支持的确切范围被视为实现细节,一般建议" +"是拆分结构定义以覆盖从几千字节到几十千字节的范围。在大多数情况下,这是一个自" +"然的情况,例如,将 MCU 的所有寄存器(分布在32位地址空间上)定义在一个结构中是" +"没有意义的,而是应该逐个外设块来定义。在一些极端情况下,您可能需要人为地将结" +"构拆分为几个部分(例如,如果访问具有多兆字节数组的本机数据结构,尽管那将是一" +"个非常人为的情况)。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/uping.po b/docs/locale/zh_CN/LC_MESSAGES/library/uping.po new file mode 100644 index 0000000000000..0c6f415eb133a --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/uping.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-19 02:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/uping.rst:2 +msgid ":mod:`uping` --- Ping another computer" +msgstr ":mod:`uping` --- Ping 另一台计算机" + +#: ../../library/uping.rst:9 +msgid "" +"Ping the ``host`` with ``count`` packets each having ``timeout`` at a " +"rate between packets of ``interval``. If ``quiet`` is ``True`` do not " +"print stats on return. Packet sizes are ``size`` bytes each." +msgstr "" +"使用每个具有 ``timeout`` 的 ``count`` 个数据包对 ``host`` 进行 ping," +"每个数据包之间的速率为 ``interval``。如果 ``quiet`` 为 " +"``True``,则不打印返回时的统计信息。每个数据包的大小为 ``size`` 字节。" + +#: ../../library/uping.rst:13 +msgid "" +"Returns a tuple containing the number of transmitted packets and the " +"number received." +msgstr "返回一个包含发送的数据包数和接收的数据包数的元组。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/vfs.po b/docs/locale/zh_CN/LC_MESSAGES/library/vfs.po new file mode 100644 index 0000000000000..929417dfb2a4a --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/vfs.po @@ -0,0 +1,367 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:11+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../library/vfs.rst:2 +msgid ":mod:`vfs` -- virtual filesystem control" +msgstr ":mod:`vfs` -- 虚拟文件系统控制" + +#: ../../library/vfs.rst:7 +msgid "" +"The ``vfs`` module contains functions for creating filesystem objects and" +" mounting/unmounting them in the Virtual Filesystem." +msgstr "``vfs`` 模块包含用于创建文件系统对象以及在虚拟文件系统中挂载/卸载它们的函数。" + +#: ../../library/vfs.rst:11 +msgid "Filesystem mounting" +msgstr "文件系统挂载" + +#: ../../library/vfs.rst:13 +msgid "" +"Some ports provide a Virtual Filesystem (VFS) and the ability to mount " +"multiple \"real\" filesystems within this VFS. Filesystem objects can be" +" mounted at either the root of the VFS, or at a subdirectory that lives " +"in the root. This allows dynamic and flexible configuration of the " +"filesystem that is seen by Python programs. Ports that have this " +"functionality provide the :func:`mount` and :func:`umount` functions, and" +" possibly various filesystem implementations represented by VFS classes." +msgstr "" +"某些端口提供虚拟文件系统(VFS)功能,并能够在该 VFS 中挂载多个“真实”文件系统。文件系统对象可以挂载在 VFS " +"的根目录或根目录下的子目录中。这允许动态和灵活地配置 Python 程序所看到的文件系统。具有此功能的端口提供 :func:`mount` 和 " +":func:`umount` 函数,并可能提供由 VFS 类表示的各种文件系统实现。" + +#: ../../library/vfs.rst:23 +msgid "" +"Mount the filesystem object *fsobj* at the location in the VFS given by " +"the *mount_point* string. *fsobj* can be a a VFS object that has a " +"``mount()`` method, or a block device. If it's a block device then the " +"filesystem type is automatically detected (an exception is raised if no " +"filesystem was recognised). *mount_point* may be ``'/'`` to mount " +"*fsobj* at the root, or ``'/'`` to mount it at a subdirectory under" +" the root." +msgstr "" +"将文件系统对象 *fsobj* 挂载到 VFS 中由 *mount_point* 字符串指定的位置。*fsobj* 可以是具有 " +"``mount()`` 方法的 VFS " +"对象,也可以是块设备。如果是块设备,则会自动检测文件系统类型(如果未识别文件系统,则会引发异常)。*mount_point* 可以是 " +"``'/'``,表示将 *fsobj* 挂载到根目录,也可以是 ``'/'``,表示将其挂载到根目录下的子目录。" + +#: ../../library/vfs.rst:30 +msgid "If *readonly* is ``True`` then the filesystem is mounted read-only." +msgstr "如果 *readonly* 为 ``True``,则文件系统以只读模式挂载。" + +#: ../../library/vfs.rst:32 +msgid "" +"During the mount process the method ``mount()`` is called on the " +"filesystem object." +msgstr "在挂载过程中,会调用文件系统对象的 ``mount()`` 方法。" + +#: ../../library/vfs.rst:35 +msgid "Will raise ``OSError(EPERM)`` if *mount_point* is already mounted." +msgstr "如果 *mount_point* 已经被挂载,将引发 ``OSError(EPERM)``。" + +#: ../../library/vfs.rst:40 +msgid "" +"With no arguments to :func:`mount`, return a list of tuples representing " +"all active mountpoints." +msgstr "不带参数调用 :func:`mount` 时,返回一个表示所有活动挂载点的元组列表。" + +#: ../../library/vfs.rst:43 +msgid "The returned list has the form *[(fsobj, mount_point), ...]*." +msgstr "返回的列表格式为 *[(fsobj, mount_point), ...]*。" + +#: ../../library/vfs.rst:47 +msgid "" +"Unmount a filesystem. *mount_point* can be a string naming the mount " +"location, or a previously-mounted filesystem object. During the unmount " +"process the method ``umount()`` is called on the filesystem object." +msgstr "" +"卸载文件系统。*mount_point* 可以是一个表示挂载位置的字符串,或者是一个之前已挂载的文件系统对象。在卸载过程中,会调用文件系统对象的 " +"``umount()`` 方法。" + +#: ../../library/vfs.rst:51 +msgid "Will raise ``OSError(EINVAL)`` if *mount_point* is not found." +msgstr "如果未找到 *mount_point*,将引发 ``OSError(EINVAL)``。" + +#: ../../library/vfs.rst:55 +msgid "" +"Create a filesystem object that uses the FAT filesystem format. Storage " +"of the FAT filesystem is provided by *block_dev*. Objects created by this" +" constructor can be mounted using :func:`mount`." +msgstr "" +"创建一个使用 FAT 文件系统格式的文件系统对象。FAT 文件系统的存储由 *block_dev* 提供。通过此构造函数创建的对象可以使用 " +":func:`mount` 进行挂载。" + +#: ../../library/vfs.rst:61 +msgid "Build a FAT filesystem on *block_dev*." +msgstr "在 *block_dev* 上构建一个 FAT 文件系统。" + +#: ../../library/vfs.rst:65 +msgid "" +"Create a filesystem object that uses the `littlefs v1 filesystem " +"format`_. Storage of the littlefs filesystem is provided by *block_dev*, " +"which must support the :ref:`extended interface `. Objects created by this constructor can be mounted using " +":func:`mount`." +msgstr "" +"创建一个使用 `littlefs v1 filesystem format`_ 的文件系统对象。littlefs 文件系统的存储由 " +"*block_dev* 提供,*block_dev* 必须支持 :ref:`extended interface " +"`。通过此构造函数创建的对象可以使用 :func:`mount` 进行挂载。" + +#: ../../library/vfs.rst:70 ../../library/vfs.rst:94 +msgid "See :ref:`filesystem` for more information." +msgstr "有关更多信息,请参见 :ref:`filesystem`。" + +#: ../../library/vfs.rst:74 +msgid "Build a Lfs1 filesystem on *block_dev*." +msgstr "在 *block_dev* 上构建一个 Lfs1 文件系统。" + +#: ../../library/vfs.rst:76 +msgid "" +"There are reports of littlefs v1 failing in certain situations, for " +"details see `littlefs issue 347`_." +msgstr "有报告显示 littlefs v1 在某些情况下会失败,详细信息请参见 `littlefs issue 347`_。" + +#: ../../library/vfs.rst:81 +msgid "" +"Create a filesystem object that uses the `littlefs v2 filesystem " +"format`_. Storage of the littlefs filesystem is provided by *block_dev*, " +"which must support the :ref:`extended interface `. Objects created by this constructor can be mounted using " +":func:`mount`." +msgstr "" +"创建一个使用 `littlefs v2 filesystem format`_ 的文件系统对象。littlefs 文件系统的存储由 " +"*block_dev* 提供,*block_dev* 必须支持 :ref:`extended interface " +"`。通过此构造函数创建的对象可以使用 :func:`mount` 进行挂载。" + +#: ../../library/vfs.rst:86 +msgid "" +"The *mtime* argument enables modification timestamps for files, stored " +"using littlefs attributes. This option can be disabled or enabled " +"differently each mount time and timestamps will only be added or updated " +"if *mtime* is enabled, otherwise the timestamps will remain untouched. " +"Littlefs v2 filesystems without timestamps will work without reformatting" +" and timestamps will be added transparently to existing files once they " +"are opened for writing. When *mtime* is enabled `os.stat` on files " +"without timestamps will return 0 for the timestamp." +msgstr "" +"*mtime* 参数启用文件的修改时间戳,这些时间戳使用 littlefs 属性存储。此选项可以在每次挂载时启用或禁用,并且只有在启用 " +"*mtime* 时,时间戳才会被添加或更新,否则时间戳将保持不变。没有时间戳的 Littlefs v2 " +"文件系统可以在不重新格式化的情况下工作,一旦文件被打开进行写入,时间戳将自动添加到现有文件。启用 *mtime* " +"后,针对没有时间戳的文件,`os.stat` 将返回 0 作为时间戳。" + +#: ../../library/vfs.rst:98 +msgid "Build a Lfs2 filesystem on *block_dev*." +msgstr "在 *block_dev* 上构建一个 Lfs2 文件系统。" + +#: ../../library/vfs.rst:100 +msgid "" +"There are reports of littlefs v2 failing in certain situations, for " +"details see `littlefs issue 295`_." +msgstr "有报告显示 littlefs v2 在某些情况下会失败,详细信息请参见 `littlefs issue 295`_。" + +#: ../../library/vfs.rst:105 +msgid "" +"Create a filesystem object that accesses the host POSIX filesystem. If " +"*root* is specified then it should be a path in the host filesystem to " +"use as the root of the ``VfsPosix`` object. Otherwise the current " +"directory of the host filesystem is used." +msgstr "" +"创建一个访问主机 POSIX 文件系统的文件系统对象。如果指定了 *root*,则它应该是主机文件系统中用作 ``VfsPosix`` " +"对象根目录的路径。否则,将使用主机文件系统的当前目录。" + +#: ../../library/vfs.rst:116 +msgid "Block devices" +msgstr "块设备" + +#: ../../library/vfs.rst:118 +msgid "" +"A block device is an object which implements the block protocol. This " +"enables a device to support MicroPython filesystems. The physical " +"hardware is represented by a user defined class. The " +":class:`AbstractBlockDev` class is a template for the design of such a " +"class: MicroPython does not actually provide that class, but an actual " +"block device class must implement the methods described below." +msgstr "" +"块设备是实现块协议的对象。这使得设备能够支持 MicroPython 文件系统。物理硬件由用户定义的类表示。 " +":class:`AbstractBlockDev` 类是这种类设计的模板:MicroPython " +"实际上并没有提供该类,但实际的块设备类必须实现以下所描述的方法。" + +#: ../../library/vfs.rst:124 +msgid "" +"A concrete implementation of this class will usually allow access to the " +"memory-like functionality of a piece of hardware (like flash memory). A " +"block device can be formatted to any supported filesystem and mounted " +"using ``os`` methods." +msgstr "该类的具体实现通常允许访问硬件的一块内存功能(例如闪存)。块设备可以被格式化为任何支持的文件系统,并通过 ``os`` 方法进行挂载。" + +#: ../../library/vfs.rst:129 +msgid "" +"See :ref:`filesystem` for example implementations of block devices using " +"the two variants of the block protocol described below." +msgstr "有关使用下面描述的两种块协议变体实现块设备的示例,请参见 :ref:`filesystem`。" + +#: ../../library/vfs.rst:135 +msgid "Simple and extended interface" +msgstr "简单接口和扩展接口" + +#: ../../library/vfs.rst:137 +msgid "" +"There are two compatible signatures for the ``readblocks`` and " +"``writeblocks`` methods (see below), in order to support a variety of use" +" cases. A given block device may implement one form or the other, or " +"both at the same time. The second form (with the offset parameter) is " +"referred to as the \"extended interface\"." +msgstr "" +"``readblocks`` 和 ``writeblocks`` " +"方法有两种兼容的签名(见下文),以支持多种使用场景。一个给定的块设备可以实现其中一种形式,也可以同时实现两种形式。第二种形式(带有 offset " +"参数)被称为“扩展接口”。" + +#: ../../library/vfs.rst:142 +msgid "" +"Some filesystems (such as littlefs) that require more control over write " +"operations, for example writing to sub-block regions without erasing, may" +" require that the block device supports the extended interface." +msgstr "一些文件系统(如 littlefs),由于需要更精确地控制写操作,例如在不擦除的情况下写入子块区域,可能要求块设备支持扩展接口。" + +#: ../../library/vfs.rst:148 +msgid "" +"Construct a block device object. The parameters to the constructor are " +"dependent on the specific block device." +msgstr "构造一个块设备对象。构造函数的参数依赖于特定的块设备。" + +#: ../../library/vfs.rst:154 +msgid "" +"The first form reads aligned, multiples of blocks. Starting at the block " +"given by the index *block_num*, read blocks from the device into *buf* " +"(an array of bytes). The number of blocks to read is given by the length " +"of *buf*, which will be a multiple of the block size." +msgstr "" +"第一种形式读取对齐的块的倍数。从由 *block_num* 索引指定的块开始,将块从设备读取到 *buf*(一个字节数组)中。要读取的块数由 " +"*buf* 的长度给出,且该长度将是块大小的倍数。" + +#: ../../library/vfs.rst:160 +msgid "" +"The second form allows reading at arbitrary locations within a block, and" +" arbitrary lengths. Starting at block index *block_num*, and byte offset " +"within that block of *offset*, read bytes from the device into *buf* (an " +"array of bytes). The number of bytes to read is given by the length of " +"*buf*." +msgstr "" +"第二种形式允许在块内的任意位置读取,并且支持任意长度。从块索引 *block_num* 开始,及该块内的字节偏移 " +"*offset*,将字节从设备读取到 *buf*(一个字节数组)中。要读取的字节数由 *buf* 的长度给出。" + +#: ../../library/vfs.rst:169 +msgid "" +"The first form writes aligned, multiples of blocks, and requires that the" +" blocks that are written to be first erased (if necessary) by this " +"method. Starting at the block given by the index *block_num*, write " +"blocks from *buf* (an array of bytes) to the device. The number of blocks" +" to write is given by the length of *buf*, which will be a multiple of " +"the block size." +msgstr "" +"第一种形式写入对齐的块的倍数,并要求在写入之前,必须先通过此方法擦除(如果需要)要写入的块。从由 *block_num* 索引指定的块开始,将 " +"*buf*(一个字节数组)中的块写入设备。要写入的块数由 *buf* 的长度给出,且该长度将是块大小的倍数。" + +#: ../../library/vfs.rst:176 +msgid "" +"The second form allows writing at arbitrary locations within a block, and" +" arbitrary lengths. Only the bytes being written should be changed, and " +"the caller of this method must ensure that the relevant blocks are erased" +" via a prior ``ioctl`` call. Starting at block index *block_num*, and " +"byte offset within that block of *offset*, write bytes from *buf* (an " +"array of bytes) to the device. The number of bytes to write is given by " +"the length of *buf*." +msgstr "" +"第二种形式允许在块内的任意位置写入,并且支持任意长度。只有正在写入的字节会被更改,调用此方法的代码必须确保通过之前的 ``ioctl`` " +"调用擦除了相关的块。从块索引 *block_num* 开始,及该块内的字节偏移 *offset*,将字节从 " +"*buf*(一个字节数组)写入设备。要写入的字节数由 *buf* 的长度给出。" + +#: ../../library/vfs.rst:184 +msgid "" +"Note that implementations must never implicitly erase blocks if the " +"offset argument is specified, even if it is zero." +msgstr "请注意,如果指定了偏移量参数(即使是零),实现必须永远不隐式擦除块。" + +#: ../../library/vfs.rst:189 +msgid "" +"Control the block device and query its parameters. The operation to " +"perform is given by *op* which is one of the following integers:" +msgstr "控制块设备并查询其参数。要执行的操作由 *op* 给出,*op* 是以下整数之一:" + +#: ../../library/vfs.rst:192 +msgid "1 -- initialise the device (*arg* is unused)" +msgstr "1 -- 初始化设备(*arg* 未使用)" + +#: ../../library/vfs.rst:193 +msgid "2 -- shutdown the device (*arg* is unused)" +msgstr "2 -- 关闭设备(*arg* 未使用)" + +#: ../../library/vfs.rst:194 +msgid "3 -- sync the device (*arg* is unused)" +msgstr "3 -- 同步设备(*arg* 未使用)" + +#: ../../library/vfs.rst:195 +msgid "" +"4 -- get a count of the number of blocks, should return an integer (*arg*" +" is unused)" +msgstr "4 -- 获取块的数量,应返回一个整数(*arg* 未使用)" + +#: ../../library/vfs.rst:197 +msgid "" +"5 -- get the number of bytes in a block, should return an integer, or " +"``None`` in which case the default value of 512 is used (*arg* is unused)" +msgstr "5 -- 获取块中的字节数,应返回一个整数,或者返回 ``None``,在这种情况下将使用默认值 512(*arg* 未使用)" + +#: ../../library/vfs.rst:200 +msgid "6 -- erase a block, *arg* is the block number to erase" +msgstr "6 -- 擦除一个块,*arg* 是要擦除的块号" + +#: ../../library/vfs.rst:202 +msgid "" +"As a minimum ``ioctl(4, ...)`` must be intercepted; for littlefs " +"``ioctl(6, ...)`` must also be intercepted. The need for others is " +"hardware dependent." +msgstr "最少需要拦截 ``ioctl(4, ...)``;对于 littlefs,还必须拦截 ``ioctl(6, ...)``。其他的需求取决于硬件。" + +#: ../../library/vfs.rst:206 +msgid "" +"Prior to any call to ``writeblocks(block, ...)`` littlefs issues " +"``ioctl(6, block)``. This enables a device driver to erase the block " +"prior to a write if the hardware requires it. Alternatively a driver " +"might intercept ``ioctl(6, block)`` and return 0 (success). In this case " +"the driver assumes responsibility for detecting the need for erasure." +msgstr "" +"在任何调用 ``writeblocks(block, ...)`` 之前,littlefs 会发出 ``ioctl(6, " +"block)``。这使得设备驱动程序在写入之前擦除块(如果硬件要求的话)。或者,驱动程序可以拦截 ``ioctl(6, block)`` 并返回 " +"0(成功)。在这种情况下,驱动程序负责检测是否需要擦除。" + +#: ../../library/vfs.rst:212 +msgid "" +"Unless otherwise stated ``ioctl(op, arg)`` can return ``None``. " +"Consequently an implementation can ignore unused values of ``op``. Where " +"``op`` is intercepted, the return value for operations 4 and 5 are as " +"detailed above. Other operations should return 0 on success and non-zero " +"for failure, with the value returned being an ``OSError`` errno code." +msgstr "" +"除非另有说明,``ioctl(op, arg)`` 可以返回 ``None``。因此,实现可以忽略未使用的 ``op`` 值。当 ``op`` " +"被拦截时,操作 4 和 5 的返回值如上所述。其他操作应返回 0 表示成功,返回非零值表示失败,返回的值应为 ``OSError`` 错误号代码。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/library/zlib.po b/docs/locale/zh_CN/LC_MESSAGES/library/zlib.po new file mode 100644 index 0000000000000..f2eea29886a56 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/library/zlib.po @@ -0,0 +1,188 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-08 19:28+0800\n" +"PO-Revision-Date: 2024-06-19 02:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language-Team: Chinese (Simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5.5\n" +"Generated-By: Babel 2.15.0\n" + +#: ../../library/zlib.rst:2 +msgid ":mod:`zlib` -- zlib compression & decompression" +msgstr ":mod:`zlib` -- zlib 压缩与解压缩" + +#: ../../library/zlib.rst:7 +msgid "|see_cpython_module| :mod:`python:zlib`." +msgstr "|see_cpython_module| :mod:`python:zlib`。" + +#: ../../library/zlib.rst:9 +msgid "" +"This module allows compression and decompression of binary data with the " +"`DEFLATE algorithm `_ (commonly " +"used in the zlib library and gzip archiver)." +msgstr "" +"该模块允许使用 `DEFLATE algorithm `_ " +"(通常用于 zlib 库和 gzip 压缩器)对二进制数据进行压缩和解压缩。" + +#: ../../library/zlib.rst:13 +msgid "" +"Prefer to use :class:`deflate.DeflateIO` instead of the functions in this" +" module as it provides a streaming interface to compression and " +"decompression which is convenient and more memory efficient when working " +"with reading or writing compressed data to a file, socket, or stream." +msgstr "" +"优先使用 :class:`deflate.DeflateIO`,而不是本模块中的函数,因为它提供了对压缩" +"和解压缩的流接口,当处理读取或写入压缩数据到文件、套接字或流时更方便且更节省" +"内存。" + +#: ../../library/zlib.rst:18 +msgid "**Availability:**" +msgstr "**可用性:**" + +#: ../../library/zlib.rst:20 +msgid "" +"From MicroPython v1.21 onwards, this module may not be present by default" +" on all MicroPython firmware as it duplicates functionality available in " +"the :mod:`deflate ` module." +msgstr "" +"从 MicroPython v1.21 起,该模块可能不会默认出现在所有 MicroPython 固件中," +"因为它重复了 :mod:`deflate ` 模块中可用的功能。" + +#: ../../library/zlib.rst:24 +msgid "" +"A copy of this module can be installed (or frozen) from :term" +":`micropython-lib` (`source `_). See :ref:`packages` for " +"more information. This documentation describes that module." +msgstr "" +"该模块的副本可以从 :term:`micropython-lib` (`source " +"`_ )安装(或冻结)。有关更多信息,请参阅 :ref:`packages` 。本文档描述了该模块。" + +#: ../../library/zlib.rst:28 +msgid "" +"Requires the built-in :mod:`deflate ` module (available since " +"MicroPython v1.21)" +msgstr "需要内置的 :mod:`deflate ` 模块(自 MicroPython v1.21 起可用)" + +#: ../../library/zlib.rst:30 +msgid "" +"Compression support will only be available if compression support is " +"enabled in the built-in :mod:`deflate ` module." +msgstr "只有在内置的 :mod:`deflate ` " +"模块中启用了压缩支持时,才能使用压缩支持。" + +#: ../../library/zlib.rst:34 +msgid "Functions" +msgstr "函数" + +#: ../../library/zlib.rst:38 +msgid "Decompresses *data* into a bytes object." +msgstr "将 *data* 解压缩为一个字节对象。" + +#: ../../library/zlib.rst:40 +msgid "" +"The *wbits* parameter works the same way as for :meth:`zlib.compress` " +"with the following additional valid values:" +msgstr "*wbits* 参数的工作方式与 :meth:`zlib.compress` " +"相同,但还支持以下额外的有效值:" + +#: ../../library/zlib.rst:43 +msgid "" +"``0``: Automatically determine the window size from the zlib header " +"(*data* must be in zlib format)." +msgstr "``0``: 从 zlib 头自动确定窗口大小(*data* 必须采用 zlib 格式)。" + +#: ../../library/zlib.rst:45 +msgid "``35`` to ``47``: Auto-detect either the zlib or gzip format." +msgstr "``35`` 到 ``47``: 自动检测 zlib 或 gzip 格式。" + +#: ../../library/zlib.rst:47 +msgid "" +"As for :meth:`zlib.compress`, see the :mod:`CPython documentation for " +"zlib ` for more information about the *wbits* parameter. As " +"for :meth:`zlib.compress`, MicroPython also supports smaller window sizes" +" than CPython. See more :ref:`MicroPython-specific details " +"` in the :mod:`deflate ` module documentation." +msgstr "" +"有关 *wbits* 参数的更多信息,请参阅 :meth:`zlib.compress` 的 :mod:`CPython " +"documentation for zlib `。与 :meth:`zlib.compress` " +"类似,MicroPython 也支持比 CPython 更小的窗口大小。在 :mod:`deflate ` 模块文档中查看更多 " +":ref:`MicroPython-specific details `。" + +#: ../../library/zlib.rst:53 +msgid "" +"If the data to be decompressed requires a larger window size, it will " +"fail during decompression." +msgstr "如果要解压缩的数据需要更大的窗口大小,则在解压期间会失败。" + +#: ../../library/zlib.rst:58 +msgid "Compresses *data* into a bytes object." +msgstr "将 *data* 压缩为一个字节对象。" + +#: ../../library/zlib.rst:60 +msgid "" +"*wbits* allows you to configure the DEFLATE dictionary window size and " +"the output format. The window size allows you to trade-off memory usage " +"for compression level. A larger window size will allow the compressor to " +"reference fragments further back in the input. The output formats are " +"\"raw\" DEFLATE (no header/footer), zlib, and gzip, where the latter two " +"include a header and checksum." +msgstr "" +"*wbits* 允许您配置 DEFLATE 字典窗口大小和输出格式。窗口大小允许您在内存使用和" +"压缩级别之间进行权衡。较大的窗口大小将允许压缩器引用输入中更远处的片段。" +"输出格式包括 \"raw\" DEFLATE(无头/尾),zlib 和 " +"gzip,其中后两者包括头和校验和。" + +#: ../../library/zlib.rst:67 +msgid "" +"The low four bits of the absolute value of *wbits* set the base-2 " +"logarithm of the DEFLATE dictionary window size. So for example, " +"``wbits=10``, ``wbits=-10``, and ``wbits=26`` all set the window size to " +"1024 bytes. Valid window sizes are ``5`` to ``15`` inclusive " +"(corresponding to 32 to 32k bytes)." +msgstr "" +"*wbits* 的绝对值的低四位设置 DEFLATE " +"字典窗口大小的以2为基数的对数。因此,例如, ``wbits=10``、``wbits=-10`` 和 " +"``wbits=26`` 都将窗口大小设置为 1024 字节。有效的窗口大小为 ``5`` 到 ``15`` (" +"对应于 32 到 32k 字节)。" + +#: ../../library/zlib.rst:72 +msgid "" +"Negative values of *wbits* between ``-5`` and ``-15`` correspond to " +"\"raw\" output mode, positive values between ``5`` and ``15`` correspond " +"to zlib output mode, and positive values between ``21`` and ``31`` " +"correspond to gzip output mode." +msgstr "" +"*wbits* 的负值介于 ``-5`` 和 ``-15`` 之间对应于 \"raw\" 输出模式,介于 ``5`` " +"和 ``15`` 之间的正值对应于 zlib 输出模式,介于 ``21`` 和 ``31`` " +"之间的正值对应于 gzip 输出模式。" + +#: ../../library/zlib.rst:77 +msgid "" +"See the :mod:`CPython documentation for zlib ` for more " +"information about the *wbits* parameter. Note that MicroPython allows for" +" smaller window sizes, which is useful when memory is constrained while " +"still achieving a reasonable level of compression. It also speeds up the " +"compressor. See more :ref:`MicroPython-specific details ` " +"in the :mod:`deflate ` module documentation." +msgstr "" +"有关 *wbits* 参数的更多信息,请参阅 :mod:`CPython documentation for zlib " +"`。注意,MicroPython " +"允许更小的窗口大小,这在内存受限的情况下非常有用,同时仍然可以实现合理的压缩水平。这也加速了压缩器。在 :mod:`deflate " +"` 模块文档中查看更多 :ref:`MicroPython-specific details `。" diff --git a/docs/locale/zh_CN/LC_MESSAGES/license.po b/docs/locale/zh_CN/LC_MESSAGES/license.po new file mode 100644 index 0000000000000..d01312535a354 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/license.po @@ -0,0 +1,65 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-06-20 03:59+0000\n" +"Last-Translator: 于文琳 \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../license.rst:2 +msgid "MicroPython license information" +msgstr "MicroPython 许可证信息" + +#: ../../license.rst:4 +msgid "The MIT License (MIT)" +msgstr "MIT许可证(MIT)" + +#: ../../license.rst:6 +msgid "" +"Copyright (c) 2013-2025 Damien P. George, Paul Sokolovsky, OpenMV LLC, " +"and others" +msgstr "版权所有 (c) 2013-2025 Damien P. George, Paul Sokolovsky, OpenMV LLC 及其他贡献者" + +#: ../../license.rst:8 +msgid "" +"Permission is hereby granted, free of charge, to any person obtaining a " +"copy of this software and associated documentation files (the " +"\"Software\"), to deal in the Software without restriction, including " +"without limitation the rights to use, copy, modify, merge, publish, " +"distribute, sublicense, and/or sell copies of the Software, and to permit" +" persons to whom the Software is furnished to do so, subject to the " +"following conditions:" +msgstr "特此免费授予任何人获得本软件和相关文档文件(“软件”)的副本,不受限制地处理本软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售本软件副本的权利,并允许提供本软件的人这样做,但须符合以下条件:" + +#: ../../license.rst:15 +msgid "" +"The above copyright notice and this permission notice shall be included " +"in all copies or substantial portions of the Software." +msgstr "上述版权声明和本许可声明应包含在本软件的所有副本或主要部分中。" + +#: ../../license.rst:18 +msgid "" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS" +" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF " +"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN" +" NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM," +" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR " +"OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE" +" USE OR OTHER DEALINGS IN THE SOFTWARE." +msgstr "本软件“按原样”提供,不提供任何形式的明示或暗示的保证,包括但不限于适销性、适用于特定目的和不侵权的保证。在任何情况下,作者或版权所有人都不承担任何索赔、损害赔偿或其他责任,无论是在合同诉讼、侵权行为或其他诉讼中,由软件、软件的使用或其他交易引起的或与之有关的。" + diff --git a/docs/locale/zh_CN/LC_MESSAGES/openmvcam/general.po b/docs/locale/zh_CN/LC_MESSAGES/openmvcam/general.po new file mode 100644 index 0000000000000..13957942d48a7 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/openmvcam/general.po @@ -0,0 +1,149 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-08-13 10:49+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../openmvcam/general.rst:2 +msgid "General information about the openmvcam" +msgstr "openmvcam的基本信息" + +#: ../../openmvcam/general.rst:4 +msgid "Contents" +msgstr "内容" + +#: ../../openmvcam/general.rst:7 +msgid "Local filesystem and SD card" +msgstr "本地文件系统和SD卡" + +#: ../../openmvcam/general.rst:9 +msgid "" +"There is a small internal filesystem (a drive) on the openmvcam, called " +"``/flash``, which is stored within the microcontroller's flash memory. " +"If a micro SD card is inserted into the slot, it is available as " +"``/sdcard``." +msgstr "" +"openmvcam上有一个小型的内部文件系统(一个驱动器),称为 ``/flash``,存储在微控制器的闪存内存中。" +"如果将micro SD卡插入插槽,则可以通过 ``/sdcard`` 访问。" + +#: ../../openmvcam/general.rst:13 +msgid "" +"When the openmvcam boots up, it needs to choose a filesystem to boot " +"from. If there is no SD card, then it uses the internal filesystem " +"``/flash`` as the boot filesystem, otherwise, it uses the SD card " +"``/sdcard``. After the boot, the current directory is set to one of the " +"directories above." +msgstr "" +"当openmvcam启动时,它需要选择一个文件系统进行引导。如果没有SD卡,那么它将使用内部文件系统" +" ``/flash`` 作为引导文件系统,否则,它将使用SD卡 ``/sdcard``。" +"引导后,当前目录设置为上述目录之一。" + +#: ../../openmvcam/general.rst:18 +msgid "" +"If needed, you can prevent the use of the SD card by creating an empty " +"file called ``/flash/SKIPSD``. If this file exists when the openmvcam " +"boots up then the SD card will be skipped and the openmvcam will always " +"boot from the internal filesystem (in this case the SD card won't be " +"mounted but you can still mount and use it later in your program using " +"``vfs.mount``)." +msgstr "" +"如果需要,您可以通过创建一个名为 ``/flash/SKIPSD`` 的空文件来阻止使用SD卡。如果此文件在openmvcam" +"启动时存在,则将跳过SD卡,openmvcam将始终从内部文件系统启动(在这种情况下,SD卡不会被挂载," +"但您仍然可以在程序中使用 ``vfs.mount`` 稍后挂载和使用它)。" + +#: ../../openmvcam/general.rst:24 +msgid "" +"The boot filesystem is used for 2 things: it is the filesystem from which" +" the ``boot.py`` and ``main.py`` files are searched for, and it is the " +"filesystem which is made available on your PC over the USB cable." +msgstr "" +"引导文件系统用于两个目的:搜索 ``boot.py`` 和 ``main.py`` " +"文件的文件系统,并且作为通过USB电缆在您的PC上提供的文件系统。" + +#: ../../openmvcam/general.rst:28 +msgid "" +"The filesystem will be available as a USB flash drive on your PC. You " +"can save files to the drive, and edit ``boot.py`` and ``main.py``." +msgstr "该文件系统将作为USB闪存驱动器出现在您的PC上。您可以将文件保存到驱动器中,并编辑 ``boot.py`` 和 ``main.py``。" + +#: ../../openmvcam/general.rst:31 +msgid "" +"*Remember to eject (on Linux, unmount) the USB drive before you reset " +"your pyboard.*" +msgstr "*在重置pyboard之前,请记得弹出(在Linux上卸载)USB驱动器。*" + +#: ../../openmvcam/general.rst:36 +msgid "" +"Because modern operating systems mount the OpenMV Cam's internal flash " +"drive or SD card as a block device they treat it as if it cannot create " +"files itself. Because of this if you create a file onboard your OpenMV " +"Cam in code you must remount the OpenMV Cam after a new file is created " +"for the operating system to rescan the OpenMV Cam to detect the change. " +"Additionally, if both the operating system and the OpenMV Cam are " +"changing files on the file system at the same time the operating system " +"will ignore and overwrite the OpenMV Cam's changes." +msgstr "" +"因为现代操作系统将OpenMV " +"Cam的内部闪存驱动器或SD卡挂载为块设备,所以它们将其视为无法自行创建文件。由于这个原因,如果您在代码中在OpenMV " +"Cam上创建一个文件,您必须在创建新文件后重新挂载OpenMV Cam,以便操作系统重新扫描OpenMV " +"Cam以检测更改。此外,如果操作系统和OpenMV Cam同时在文件系统上更改文件,操作系统将忽略并覆盖OpenMV Cam的更改。" + +#: ../../openmvcam/general.rst:45 +msgid "" +"OpenMV reconmends using the internal flash drive or SD card to store " +"assets that will be read by the OpenMV Cam. If you need to saves things " +"to disk make sure you have an SD card (and don't use the internal flash " +"drive for this as it is *quite* small). Additionally, if you need to " +"write files to the disk keep note of the above paragraph about a rescan " +"being required." +msgstr "" +"OpenMV建议使用内部闪存驱动器或SD卡存储将由OpenMV " +"Cam读取的资源。如果需要保存东西到磁盘,请确保有SD卡(不要使用内部闪存驱动器,因为它非常小)。另外,如果需要向磁盘写入文件,请注意上述段落中关于需要重新扫描的内容。" + +#: ../../openmvcam/general.rst:52 +msgid "Boot modes" +msgstr "引导模式" + +#: ../../openmvcam/general.rst:54 +msgid "" +"On powerup, if powered by USB, the OpenMV Cam will run a bootloader " +"program for about 3 seconds which allows OpenMV IDE to update the " +"firmware without using DFU. After 3 seconds then bootloader will exit " +"and then ``boot.py`` will run allowing you to change the USB mode before " +"executing ``main.py``. If not powered by USB then ``boot.py`` followed " +"by ``main.py`` will run immediantly." +msgstr "" +"在上电时,如果通过USB供电,OpenMV Cam将运行一个引导程序约3秒钟,允许OpenMV " +"IDE在不使用DFU的情况下更新固件。3秒后,引导程序将退出,然后将运行 ``boot.py``,允许您在执行 ``main.py`` " +"之前更改USB模式。如果没有通过USB供电,则立即运行 ``boot.py``,然后是 ``main.py``。" + +#: ../../openmvcam/general.rst:61 +msgid "Flashing LED Errors" +msgstr "闪烁LED错误" + +#: ../../openmvcam/general.rst:63 +msgid "" +"If all colors of the RGB LED are flashing quickly there was a hard fault." +" Reflash your OpenMV Cam's firmware to fix this issue. If this does not" +" work your OpenMV Cam may be damaged..." +msgstr "" +"如果RGB LED的所有颜色都快速闪烁,则发生了严重故障。重新刷写OpenMV Cam的固件以解决此问题。如果这样做没有效果,您的OpenMV " +"Cam可能已损坏..." + diff --git a/docs/locale/zh_CN/LC_MESSAGES/openmvcam/quickref.po b/docs/locale/zh_CN/LC_MESSAGES/openmvcam/quickref.po new file mode 100644 index 0000000000000..877dcd5b5ba69 --- /dev/null +++ b/docs/locale/zh_CN/LC_MESSAGES/openmvcam/quickref.po @@ -0,0 +1,591 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) - The MicroPython Documentation is Copyright © 2014-2024, +# Damien P. George, Paul Sokolovsky, and contributors +# This file is distributed under the same license as the MicroPython +# package. +# FIRST AUTHOR , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: MicroPython 1.22\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-03-07 12:34+0800\n" +"PO-Revision-Date: 2024-11-23 07:10+0000\n" +"Last-Translator: Weblate Admin \n" +"Language: zh_CN\n" +"Language-Team: Chinese (Simplified) \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.18.0\n" + +#: ../../openmvcam/quickref.rst:4 +msgid "Quick reference for the openmvcam" +msgstr "openmvcam快速参考" + +#: ../../openmvcam/quickref.rst:6 +msgid "" +"Below is a quick reference for the OpenMV Cam. If it is your first time " +"working with the OpenMV Cam please consider reading the following " +"sections first:" +msgstr "以下是OpenMV Cam的快速参考。如果这是您第一次使用OpenMV Cam,请先阅读以下部分:" + +#: ../../openmvcam/quickref.rst:15 +msgid "OpenMV N6 PAG7936 Pinout" +msgstr "OpenMV N6 PAG7936 引脚" + +#: ../../openmvcam/quickref.rst:19 +msgid "OpenMV AE3 PAG7936 Pinout" +msgstr "OpenMV AE3 PAG7936 引脚" + +#: ../../openmvcam/quickref.rst:23 +msgid "OpenMV Cam RT1062 OV5640 Pinout" +msgstr "OpenMV Cam RT1062 OV5640 引脚" + +#: ../../openmvcam/quickref.rst:27 +msgid "OpenMV Cam H7 Plus OV5640 Pinout" +msgstr "OpenMV Cam H7 Plus OV5640 引脚" + +#: ../../openmvcam/quickref.rst:31 +msgid "OpenMV Cam H7 OV7725 Pinout" +msgstr "OpenMV Cam H7 OV7725 引脚" + +#: ../../openmvcam/quickref.rst:35 +msgid "OpenMV Cam M7 OV7725 Pinout" +msgstr "OpenMV Cam M7 OV7725 引脚" + +#: ../../openmvcam/quickref.rst:39 +msgid "OpenMV Cam M4 OV7725 Pinout" +msgstr "OpenMV Cam M4 OV7725 引脚" + +#: ../../openmvcam/quickref.rst:43 +msgid "OpenMV Cam M4 OV2640 Pinout" +msgstr "OpenMV Cam M4 OV2640 引脚" + +#: ../../openmvcam/quickref.rst:48 +msgid "General OpenMV Cams Board Control" +msgstr "通用OpenMV Cam板控制" + +#: ../../openmvcam/quickref.rst:50 +msgid "" +"All OpenMV Cams can use the `machine` module to control the camera " +"hardware. Please refer to the pinout image for which " +"SPI/I2C/UART/CAN/PWM/TIMER channels are avialable on what I/O pins." +msgstr "" +"所有 OpenMV Cam 都可以使用 `machine` 模块来控制相机硬件。请参考引脚图,以了解哪些 " +"SPI/I2C/UART/CAN/PWM/TIMER 通道可用以及它们对应的 I/O 引脚。" + +#: ../../openmvcam/quickref.rst:54 ../../openmvcam/quickref.rst:314 +msgid "Delay and timing" +msgstr "延时和时间" + +#: ../../openmvcam/quickref.rst:56 +msgid "Use the :mod:`time