123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- const CateoryObj = {
- 'Common': 'Common',
- 'System': 'System',
- 'Event': 'Event',
- 'Show': 'Show',
- 'Wifi': 'Wi-Fi',
- 'IoT': 'IoT',
- 'IoT_OneNet_WeChat': 'WeChat App',
- 'IoT_OneNet': 'OneNet',
- 'IoT_Blynk': 'Blynk',
- 'IoT_TinyWebIO': 'TinyWebIO',
- 'IoT_MQTT': 'MQTT',
- 'Music': 'Music',
- 'Pin': 'Pin',
- 'Extend': 'Extend',
- 'Neopixel': 'Neopixel',
- 'Bluebit': 'Bluebit',
- 'Sensor': 'Sensor',
- 'Weather': 'Weather',
- 'Logic': 'Logic',
- 'Loop': 'Loop',
- 'Math': 'Math',
- 'Text': 'Text',
- 'Tuple': 'Tuple',
- 'Dictionary': 'Dictionary',
- 'List': 'List',
- 'Variables': 'Variables',
- 'Functions': 'Functions',
- 'Advanced': 'Advanced',
- 'Set': 'Set',
- 'File': 'File',
- 'IoTMessage': 'open',
- 'Network': 'Network',
- 'UART': 'UART',
- 'Audio': 'Audio',
- 'Radio': 'Radio',
- 'Bluetooth': 'Bluetooth',
- 'Box': 'cocorobo AI Box',
- 'Accelerometer': 'Accelerometer',
- 'Button': 'Button',
- 'Compass': 'Compass',
- 'Image': 'Image',
- 'Light': 'Neopixel',
- 'LCD': 'LCD',
- 'AI_camera': 'Camera',
- 'AI_LCD': 'LCD',
- 'AI': 'AI',
- 'AI_face': 'Face ID',
- 'AI_20classid': '20 Class ID',
- 'AI_number': 'Number ID',
- 'AI_color': 'Color ID'
- };
- const LanguageObj = {
- 'new': 'New',
- 'save': 'Save',
- 'open': 'Open'
- };
- const TOOLBOX = {
- 'new': {
- 'title': 'New',
- 'description': 'New project'
- },
- 'savePyCode': {
- 'title': 'Save<br/>Code',
- 'description': 'Save your Python code to your computer'
- },
- 'save': {
- 'title': 'Save<br/>Blockly',
- 'description': 'Save your Blockly code to your computer'
- },
- 'load': {
- 'title': 'Load<br/>Project',
- 'description': 'Load Blockly or Python code into the editor'
- },
- 'example': {
- 'title': 'Program</br/>Example',
- 'description': 'Load programming example into the editor'
- },
- 'blockly': {
- 'title': 'To Code',
- 'description': 'Switch between blockly mode and code mode'
- },
- 'restore': {
- 'title': 'Burning<br/>Firmware',
- 'description': 'Clear all data and burn new firmware'
- },
- 'updateMicrobit': {
- 'title': 'Update<br/>Firmware',
- 'description': 'Updating your micro:bit firmware'
- },
- 'read': {
- 'title': 'Read fr.<br/>Board',
- 'description': 'Read the last code from the cocorobo board'
- },
- 'run': {
- 'title': 'Debug',
- 'description': 'Debug code in real time without writing anything to the board'
- },
- 'flash': {
- 'title': 'Flash &<br/>Run',
- 'description': 'Flash Python & Blockly code to the board and trigger the board to restart'
- },
- 'flashOnlyCode': {
- 'title': 'Flash Only Code',
- 'description': 'Flash only Python code, without Blockly code'
- },
- 'flashCustom': {
- 'title': 'Flash & Rename',
- 'description': 'Flash only Python code and named with a custom filename'
- },
- 'chart': {
- 'title': 'Chart',
- 'description': 'Open chart form'
- },
- 'filemanager': {
- 'title': 'File</br/>Manager',
- 'description': 'Open board file manager'
- },
- 'extend': {
- 'title': 'Plugin</br/>Manage',
- 'description': 'Add a custom plugin'
- },
- 'login': {
- 'login': 'Login',
- 'logout': 'Logout'
- },
- 'help': {
- 'title': 'Help'
- },
- 'update': {
- 'title': 'Check Update',
- 'description': 'Check for new software versions'
- },
- 'helpDoc': {
- 'title': 'Help Document',
- 'description': 'Open the software help in a new window',
- 'lib': 'View Library',
- 'libdesc': 'View \'CocoRobo.py\' source code description'
- },
- 'downloadHex': {
- 'title': 'Download<br/>Hex',
- 'description': 'Download a hex file to flash onto your micro:bit'
- },
- 'sim': {
- 'title': 'Sim',
- 'description': 'Run the program on the micro:bit emulation interface'
- },
- 'microbitDriver': {
- 'title': 'Micro:bit USB Driver'
- },
- 'connect': 'Connect',
- 'connect-span': 'Auto Detect',
- 'term-break': 'BRK',
- 'term-reboot': 'RBT',
- 'term-reset': 'RST',
- 'CocoRobo': 'cocorobo',
- 'CocoRobobox': 'cocorobo AI Box',
- 'microbit': 'Micro:bit'
- };
- const CONFIG = {
- 'translate': {
- 'code_snippets': {
- 'title': 'Code Snippets',
- 'description': "Code snippets are short blocks of code to re-use in your own programs. There are snippets for most common things you'll want to do using MicroPython.",
- 'instructions': "Select one of the snippets below, or type the snippet's trigger then tap the TAB key.",
- 'trigger_heading': 'Trigger',
- 'description_heading': 'Description',
- 'docs': 'Create a comment to describe your code',
- 'wh': 'While some condition is True, keep looping over some code',
- 'with': 'Do some stuff with something assigned to a name',
- 'cl': 'Create a new class that defines the behaviour of a new type of object',
- 'def': 'Define a named function that takes some arguments and optionally add a description',
- 'if': 'If some condition is True, do something',
- 'ei': 'Else if some other condition is True, do something',
- 'el': 'Else do some other thing',
- 'for': 'For each item in a collection of items do something with each item',
- 'try': 'Try doing something and handle exceptions (errors)'
- },
- 'share': {
- 'title': 'Share Code',
- 'instructions': 'Use a password and optional hint (to help you remember the password) to securely create a link to share your code with others.',
- 'passphrase': 'Password: ',
- 'hint': 'Password hint: ',
- 'button': 'Create Link',
- 'description': 'This URL points to your code:',
- 'shortener': 'This is a short version of the link:'
- },
- 'decrypt': {
- 'title': 'Decrypt Source Code',
- 'instructions': 'Enter a password to decrypt the source code.',
- 'passphrase': 'Password: ',
- 'button': 'Decrypt'
- },
- 'alerts': {
- 'download': 'Safari has a bug that means your work will be downloaded as an un-named file. Please rename it to something ending in .hex. Alternatively, use a browser such as Firefox or Chrome. They do not suffer from this bug.',
- 'save': 'Safari has a bug that means your work will be downloaded as an un-named file. Please rename it to something ending in .py. Alternatively, use a browser such as Firefox or Chrome. They do not suffer from this bug.',
- 'length': 'Oops! Your script is to long given the limited memory on the device.',
- 'snippets': 'Snippets are disabled when blockly is enabled.',
- 'loopsleep': 'When your code includes an infinite loop without a sleep() function call. Your code will run much more slowly in this mode.',
- 'nomicrobit': 'Microbit related blocks are not available and cannot be simulated.',
- 'codemode': 'Cannot save blockly in code mode.',
- 'cloud': 'Need login to operate the cloud project.'
- },
- 'confirms': {
- 'quit': "Some of your changes have not been saved. Quit anyway?",
- 'blocks': "You have unsaved code. Using blocks will change your code. You may lose your changes. Do you want to continue?",
- 'newfile': 'This operation will clear all blocks in the programming area. Do you want to continue?'
- },
- 'code': {
- 'start': "",
- 'description': "The code editor is read-only in blockly mode."
- },
- 'drop': {
- 'python': 'Extracted from a Python file',
- 'hex': 'Extracted from a hex file',
- 'cloud': 'Extracted from cloud',
- 'xml': 'Extracted from a xml file'
- },
- 'messagebar': {
- 'title': 'This editor is out of date!',
- 'link': 'Click here',
- 'instructions': 'To open the latest version.',
- 'close': 'Hide'
- },
- 'load': {
- 'title': 'Load Script',
- 'titleXml': 'Load Script or XML file',
- 'titleblockXml': 'Load: Blockly(*.xml) / Python(*.py)',
- 'instructions': 'Drag and drop a .xml or .py file in here to open it.',
- 'blockXml': 'Open a xml file',
- 'submit': 'Load',
- 'toggle-drop': 'Or drag and drop a file',
- 'toggle-file': 'Or pick a file'
- },
- 'restore': {
- 'title': 'Burning firmware: select a firmware file(*.bin)',
- 'firmware_1': 'cocorobo firmware(' + OFFICE_HARDWARD_DATE + ', ' + OFFICE_HARDWARD_VERSION + ')',
- 'firmware_box': 'cocorobo AI Box firmware(' + CocoRoboBOX_HARDWARD_DATE + ', ' + CocoRoboBOX_HARDWARD_VERSION + ')',
- 'firmware_m4s': 'Simulate micro:bit for Scratch 3 firmware (Beta)',
- 'firmware_2': 'Simulate PicoBoard for Scratch firmware',
- 'firmware_3': 'Custom firmware',
- 'button': 'Start burning',
- 'erase': 'Erase flash',
- 'erase_title': 'If the burning is not successful, you can try to erase the firmware before burning.',
- 'suggest_restore': 'It is detected that the on-board firmware version is too low. It is recommended to update to the latest official firmware. Is it updated immediately?',
- 'suggest_esp32': 'MicroPython runtime environment not detected. It is recommended to update to the latest official firmware. Is it updated immediately?'
- },
- 'update_microbit': {
- 'title': 'Update Micro:bit Firmware',
- 'step_1': 'Download the hex file from this page to your computer',
- 'step_2': 'Then with the battery pack removed and a USB lead connected to your computer, hold the reset button at the back of the micro:bit and plug the USB lead into the device. You should see a drive appear in your file manager called MAINTENANCE.',
- 'step_3': 'Drag and drop the .HEX you downloaded from this page onto the micro:bit and wait for the yellow system LED on the back of the device to stop flashing. When the upgrade is completed, the micro:bit will reset, ejecting itself from the computer and re-appear in normal MICROBIT drive mode.',
- 'download': 'Download the latest micro:bit firmware'
- },
- 'chart': {
- 'title': 'Chart',
- 'viewFullscreen': 'View in full screen',
- 'printChart': 'Exit from full screen',
- 'downloadPNG': 'Download PNG image',
- 'downloadJPEG': 'Download JPEG image',
- 'downloadPDF': 'Download PDF document',
- 'downloadSVG': 'Download SVG vector image',
- 'downloadCSV': 'Download CSV',
- 'downloadXLS': 'Download XLS',
- 'viewData': '',
- 'openInCloud': ''
- },
- 'filemanager': {
- 'title': 'Onboard File Manager',
- 'download-file': 'Download file',
- 'rename-file': 'Rename file',
- 'delete-file': 'Delete file',
- 'upload-file': 'Upload file',
- 'load-file': 'Open file',
- 'run-file': 'Run file',
- 'run_file_limit': 'Can only run *.py file',
- 'new-folder': 'New folder',
- 'delete-folder': 'Delete folder'
- },
- 'example': {
- 'title': 'Program Example'
- },
- 'extend': {
- 'title': 'Plugin Manage'
- },
- 'update': {
- 'message': 'Found New Version {}',
- 'download': 'Download the latest version'
- },
- 'interface': {
- 'clear_all': 'This operation will clear all blocks in the programming area. Do you want to continue?',
- 'code_mode': 'To Code',
- 'block_mode': 'To Block',
- 'on_code_mode': 'Cannot save blockly in code mode.',
- 'on_block_mode': 'The code editor is read-only in blockly mode.',
- 'custom_bin': 'Please choose custom firmware',
- 'no_board': 'Serial connection not detected',
- 'empty_code': 'Download the empty code to replace the original code?',
- 'xml_too_big': 'The Blockly code size has exceeded 100KB and cannot be written, only the Python code part can be written, Do you want to continue?',
- 'no_connect': 'Not connected to the internet!',
- 'no_update': 'The current software is the latest version!',
- 'enter_filename': 'Please enter a file name :',
- 'filename_err': 'The file name is illegal, please re-enter'
- },
- 'serial': {
- 'start_debug': 'Debugging',
- 'start_flash': 'Start downloading',
- 'programmer_success': 'Burning firmware successed',
- 'programmer_failure': 'Burning firmware failed',
- 'programmer_prepare': 'To prepare to program the {}',//, press the A button for one second, then release',
- 'erase_success': 'Erasing firmware successed',
- 'erase_failure': 'Erasing firmware failed',
- 'erase_prepare': 'To prepare to erase the firmware, hold down the A key, then press the \'rst\' key on the back of the board, then release the \'rst\' and A keys in sequence.',
- 'antivirus_blocking': 'The burning program may be blocked by anti-virus software, please turn off the anti-virus software and try again.',
- 'alert_select_file': 'Please select a file.',
- 'prompt_rename': 'Rename [{}] to:',
- 'alert_extname': 'The new file name must have an extension.',
- 'confirm_delete': 'Can\'t recover after deleting, are you sure you want to delete the file [{}]?',
- 'alert_upload_limit': 'A maximum of 100KB files can only be uploaded.',
- 'confirm_upload': 'Prepare to upload the file [{1}] to the [{2}] directory on the board',
- 'prompt_new_folder': 'Create a folder under the selected path, please enter a new folder name:',
- 'alert_invalid_folder': 'The folder name is illegal.',
- 'alert_root': 'The root folder cannot be deleted.',
- 'confirm_delete_folder': 'Are you sure you want to delete the folder [{}]? Note: Non-empty folder cannot be deleted.',
- 'alert_load_file': 'Can only open *.py or *.xml file',
- 'file_onboard': 'code_in_board',
- 'file_onboard_block': 'Blockly code read from the board',
- 'file_onboard_code': 'Python code read from the board',
- 'alert_try_again': 'The onboard program has not been successfully extracted. Try again?',
- 'oserror_261': 'For timer conflicts, press the \'rst\' button on the back of the board and try again.',
- 'disconnect': 'Disconnect',
- 'connect': 'Connect',
- 'no_port': 'Serial connection not detected',
- 'flash_success': 'Flash Success',
- 'flash_failure': 'There is an error in the flash process, please check the program or try again.',
- 'debug_failure': 'There is an error in the debug process, please check the program or try again.',
- 'read_file_error': 'Failed to download the file, the possible cause is insufficient memory at runtime, press the \'rst\' button on the back of the board and try again. If it is still unsuccessful, it is recommended to temporarily rename \'main.py\' and restart board to get maximum available memory, before attempting to download.',
- 'MemoryError': 'For memory error, press the \'rst\' button on the back of the board and try again.',
- 'serial_error': 'Unable to receive serial port data, please press the \'rst\' button on the back of the board.',
- 'serial_occupied': 'The serial port may be occupied by other programs.',
- 'NoMuVisionSensor': 'The MU library is not referenced correctly, please try the "Download Hex" function.'
- },
- 'oserror': {
- '1': 'Operation not permitted',
- '2': 'No such file or directory',
- '3': 'No such process',
- '4': 'Interrupted system call',
- '5': 'I/O error',
- '6': 'No such device or address',
- '7': 'Argument list too long',
- '8': 'Exec format error',
- '9': 'Bad file number',
- '10': 'No child processes',
- '11': 'Try again',
- '12': 'Out of memory',
- '13': 'Permission denied',
- '14': 'Bad address',
- '15': 'Block device required',
- '16': 'Device or resource busy',
- '17': 'File exists',
- '18': 'Cross-device link',
- '19': 'No such device',
- '20': 'Not a directory',
- '21': 'Is a directory',
- '22': 'Invalid argument',
- '23': 'File table overflow',
- '24': 'Too many open files',
- '25': 'Not a typewriter',
- '26': 'Text file busy',
- '27': 'File too large',
- '28': 'No space left on device',
- '29': 'Illegal seek',
- '30': 'Read-only file system',
- '31': 'Too many links',
- '32': 'Broken pipe',
- '33': 'Math argument out of domain of func',
- '34': 'Math result not representable',
- '97': 'Address family not supported by protocol',
- '104': 'Connection timed out',
- '110': 'Connection timed out',
- '115': 'Operation now in progress',
- '261': 'For timer conflicts, press the \'rst\' button on the back of the board and try again.'
- }
- },
- 'flags': {
- 'blocks': true,
- 'snippets': true,
- 'share': true
- }
- };
|