diff --git a/src/App.tsx b/src/App.tsx index a484174b..484e9b61 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -44,7 +44,7 @@ import * as commonStorage from './storage/common_storage'; import * as clientSideStorage from './storage/client_side_storage'; import * as CustomBlocks from './blocks/setup_custom_blocks'; -import { initialize as initializeRobotPyBlocks } from './blocks/utils/robotpy_initialize'; +import { initialize as initializePythonBlocks } from './blocks/utils/python'; import * as ChangeFramework from './blocks/utils/change_framework' import { mutatorOpenListener } from './blocks/mrc_class_method_def' @@ -66,7 +66,6 @@ const App: React.FC = () => { React.useEffect(() => { openStorage(); initializeBlocks(); - //testAllBlocksInToolbox(toolbox.getToolboxJSON([], []).contents); }, []); React.useEffect(() => { @@ -133,7 +132,7 @@ const App: React.FC = () => { CustomBlocks.setup(forBlock); Object.assign(pythonGenerator.forBlock, forBlock); Object.assign(extendedPythonGenerator.forBlock, pythonGenerator.forBlock); - initializeRobotPyBlocks(); + initializePythonBlocks(); }; const initializeShownPythonToolboxCategories = async () => { diff --git a/src/blocks/mrc_call_python_function.ts b/src/blocks/mrc_call_python_function.ts index 67bf0a86..d28977fa 100644 --- a/src/blocks/mrc_call_python_function.ts +++ b/src/blocks/mrc_call_python_function.ts @@ -25,7 +25,7 @@ import { Order } from 'blockly/python'; import { ClassMethodDefExtraState } from './mrc_class_method_def' import { getAllowedTypesForSetCheck, getOutputCheck } from './utils/python'; -import { FunctionData } from './utils/robotpy_data'; +import { FunctionData } from './utils/python_json_types'; import * as value from './utils/value'; import * as variable from './utils/variable'; import { Editor } from '../editor/editor'; diff --git a/src/blocks/mrc_get_python_enum_value.ts b/src/blocks/mrc_get_python_enum_value.ts index d2650c2a..4b4c41dc 100644 --- a/src/blocks/mrc_get_python_enum_value.ts +++ b/src/blocks/mrc_get_python_enum_value.ts @@ -24,7 +24,7 @@ import * as Blockly from 'blockly'; import { Order } from 'blockly/python'; import { getOutputCheck } from './utils/python'; -import { EnumData } from './utils/robotpy_data'; +import { EnumData } from './utils/python_json_types'; import { ExtendedPythonGenerator } from '../editor/extended_python_generator'; import { createFieldDropdown } from '../fields/FieldDropdown'; import { createFieldNonEditableText } from '../fields/FieldNonEditableText'; diff --git a/src/blocks/mrc_get_python_variable.ts b/src/blocks/mrc_get_python_variable.ts index 73116f7c..5539b7c7 100644 --- a/src/blocks/mrc_get_python_variable.ts +++ b/src/blocks/mrc_get_python_variable.ts @@ -27,7 +27,7 @@ import { createModuleOrClassVariableSetterBlock, createInstanceVariableSetterBlock } from '../blocks/mrc_set_python_variable'; import { getAllowedTypesForSetCheck, getOutputCheck } from './utils/python'; -import { VariableGettersAndSetters } from './utils/robotpy_data'; +import { VariableGettersAndSetters } from './utils/python_json_types'; import * as variable from './utils/variable'; import { ExtendedPythonGenerator } from '../editor/extended_python_generator'; import { createFieldDropdown } from '../fields/FieldDropdown'; diff --git a/src/blocks/utils/external_samples_data.ts b/src/blocks/utils/external_samples_data.ts new file mode 100644 index 00000000..66f7cfd7 --- /dev/null +++ b/src/blocks/utils/external_samples_data.ts @@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author lizlooney@google.com (Liz Looney) + */ + +import { PythonData } from './python_json_types'; +import generatedExternalSamplesData from './generated/external_samples_data.json'; + +export const externalSamplesData = generatedExternalSamplesData as PythonData; diff --git a/src/blocks/utils/generated/external_samples_data.json b/src/blocks/utils/generated/external_samples_data.json new file mode 100644 index 00000000..32fa8d67 --- /dev/null +++ b/src/blocks/utils/generated/external_samples_data.json @@ -0,0 +1,1355 @@ +{ + "aliases": {}, + "classes": [ + { + "className": "color_range_sensor.ColorCallable", + "classVariables": [], + "constructors": [], + "enums": [], + "instanceMethods": [], + "instanceVariables": [], + "moduleName": "color_range_sensor", + "staticMethods": [] + }, + { + "className": "color_range_sensor.ColorRangeSensor", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "__init__", + "returnType": "color_range_sensor.ColorRangeSensor", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_color_hsv", + "returnType": "tuple[int, int, int]", + "tooltip": "gets the color in hsv (hue, saturation, value)" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_color_rgb", + "returnType": "tuple[int, int, int]", + "tooltip": "gets the color in rgb (red, green, blue)" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_distance_mm", + "returnType": "", + "tooltip": "gets the distance of the object seen" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + }, + { + "defaultValue": null, + "name": "min_hue", + "type": "int" + }, + { + "defaultValue": null, + "name": "max_hue", + "type": "int" + }, + { + "defaultValue": null, + "name": "callback", + "type": "color_range_sensor.ColorCallable" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "register_when_hue_in_range", + "returnType": "None", + "tooltip": "Event when hue is in range" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + }, + { + "defaultValue": null, + "name": "distance", + "type": "float" + }, + { + "defaultValue": null, + "name": "callback", + "type": "color_range_sensor.DistanceCallable" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "register_when_less_than_distance", + "returnType": "None", + "tooltip": "Event when item is seen closer than a distance" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + }, + { + "defaultValue": null, + "name": "min_saturation", + "type": "int" + }, + { + "defaultValue": null, + "name": "max_saturation", + "type": "int" + }, + { + "defaultValue": null, + "name": "callback", + "type": "color_range_sensor.ColorCallable" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "register_when_saturation_in_range", + "returnType": "None", + "tooltip": "Event when saturation is in range" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "color_range_sensor.ColorRangeSensor" + } + ], + "declaringClassName": "color_range_sensor.ColorRangeSensor", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "color_range_sensor", + "staticMethods": [] + }, + { + "className": "color_range_sensor.DistanceCallable", + "classVariables": [], + "constructors": [], + "enums": [], + "instanceMethods": [], + "instanceVariables": [], + "moduleName": "color_range_sensor", + "staticMethods": [] + }, + { + "className": "component.Component", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "component.Component", + "functionName": "__init__", + "returnType": "component.Component", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "component.Component" + } + ], + "declaringClassName": "component.Component", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "component", + "staticMethods": [] + }, + { + "className": "component.EmptyCallable", + "classVariables": [], + "constructors": [], + "enums": [], + "instanceMethods": [], + "instanceVariables": [], + "moduleName": "component", + "staticMethods": [] + }, + { + "className": "component.InvalidPortException", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "component.InvalidPortException", + "functionName": "__init__", + "returnType": "component.InvalidPortException", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], + "enums": [], + "instanceMethods": [], + "instanceVariables": [], + "moduleName": "component", + "staticMethods": [] + }, + { + "className": "component.PortType", + "classVariables": [ + { + "name": "CAN_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + }, + { + "name": "I2C_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + }, + { + "name": "SERVO_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + }, + { + "name": "SMART_IO_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + }, + { + "name": "SMART_MOTOR_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + }, + { + "name": "USB_PORT", + "tooltip": "", + "type": "component.PortType", + "writable": false + } + ], + "constructors": [], + "enums": [], + "instanceMethods": [], + "instanceVariables": [], + "moduleName": "component", + "staticMethods": [] + }, + { + "className": "rev_touch_sensor.RevTouchSensor", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "__init__", + "returnType": "rev_touch_sensor.RevTouchSensor", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "is_pressed", + "returnType": "", + "tooltip": "Returns if the touch sensor is pressed or not" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + }, + { + "defaultValue": null, + "name": "callback", + "type": "component.EmptyCallable" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "register_when_pressed", + "returnType": "None", + "tooltip": "Event when touch sensor is pressed (after being not pressed)" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + }, + { + "defaultValue": null, + "name": "callback", + "type": "component.EmptyCallable" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "register_when_released", + "returnType": "None", + "tooltip": "Event when touch sensor is released (after being pressed)" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "rev_touch_sensor.RevTouchSensor" + } + ], + "declaringClassName": "rev_touch_sensor.RevTouchSensor", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "rev_touch_sensor", + "staticMethods": [] + }, + { + "className": "servo.Servo", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "__init__", + "returnType": "servo.Servo", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + }, + { + "defaultValue": null, + "name": "angle", + "type": "float" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "set_angle_degrees", + "returnType": "None", + "tooltip": "Set the servo to an angle between 0 and 270" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + }, + { + "defaultValue": null, + "name": "pos", + "type": "float" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "set_position", + "returnType": "None", + "tooltip": "Set the servo to a position between 0 and 1" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "servo.Servo" + } + ], + "declaringClassName": "servo.Servo", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "servo", + "staticMethods": [] + }, + { + "className": "smart_motor.SmartMotor", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "__init__", + "returnType": "smart_motor.SmartMotor", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_angle_degrees", + "returnType": "", + "tooltip": "Get the angle position of the motor" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_num_relative_encoder_ticks", + "returnType": "", + "tooltip": "Get the number of relative motor ticks since reset of encoder" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "reset_relative_encoder", + "returnType": "None", + "tooltip": "Reset the relative encoder value to 0" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + }, + { + "defaultValue": null, + "name": "angle", + "type": "float" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "set_angle_degrees", + "returnType": "None", + "tooltip": "Set the motor to an angle between 0 and 360" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + }, + { + "defaultValue": null, + "name": "speed", + "type": "float" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "set_speed", + "returnType": "None", + "tooltip": "Set the motor to a speed between -1 and 1" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "smart_motor.SmartMotor" + } + ], + "declaringClassName": "smart_motor.SmartMotor", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + } + ], + "instanceVariables": [], + "moduleName": "smart_motor", + "staticMethods": [] + }, + { + "className": "sparkfun_led_stick.SparkFunLEDStick", + "classVariables": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "ports", + "type": "list[tuple[component.PortType, int]]" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "__init__", + "returnType": "sparkfun_led_stick.SparkFunLEDStick", + "tooltip": "" + } + ], + "enums": [], + "instanceMethods": [ + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_connection_port_type", + "returnType": "list[component.PortType]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_manufacturer", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_name", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_part_number", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_url", + "returnType": "", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "get_version", + "returnType": "tuple[int, int, int]", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "periodic", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "reset", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + }, + { + "defaultValue": null, + "name": "brightness", + "type": "int" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "set_brightness", + "returnType": "None", + "tooltip": "Set the brightness of all LEDs." + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + }, + { + "defaultValue": null, + "name": "color", + "type": "wpilib.Color" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "set_color", + "returnType": "None", + "tooltip": "Change the color of all LEDs to a single color." + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + }, + { + "defaultValue": null, + "name": "colors", + "type": "list[int]" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "set_colors", + "returnType": "None", + "tooltip": "Change the color of all LEDs using a list." + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "stop", + "returnType": "None", + "tooltip": "" + }, + { + "args": [ + { + "defaultValue": null, + "name": "self", + "type": "sparkfun_led_stick.SparkFunLEDStick" + } + ], + "declaringClassName": "sparkfun_led_stick.SparkFunLEDStick", + "functionName": "turn_all_off", + "returnType": "None", + "tooltip": "Turn all LEDs off." + } + ], + "instanceVariables": [], + "moduleName": "sparkfun_led_stick", + "staticMethods": [] + } + ], + "modules": [ + { + "enums": [], + "functions": [], + "moduleName": "color_range_sensor", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "component", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "rev_touch_sensor", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "servo", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "smart_motor", + "moduleVariables": [] + }, + { + "enums": [], + "functions": [], + "moduleName": "sparkfun_led_stick", + "moduleVariables": [] + } + ], + "subclasses": { + "component.Component": [ + "color_range_sensor.ColorRangeSensor", + "rev_touch_sensor.RevTouchSensor", + "servo.Servo", + "smart_motor.SmartMotor", + "sparkfun_led_stick.SparkFunLEDStick" + ] + } +} \ No newline at end of file diff --git a/src/blocks/utils/generated/robotpy_data.json b/src/blocks/utils/generated/robotpy_data.json index be63f5da..ee83de5b 100644 --- a/src/blocks/utils/generated/robotpy_data.json +++ b/src/blocks/utils/generated/robotpy_data.json @@ -2120,7 +2120,26 @@ { "className": "hal.Value", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "hal.Value", + "functionName": "__init__", + "returnType": "hal.Value", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [ @@ -2143,7 +2162,26 @@ { "className": "hal.exceptions.HALError", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "hal.exceptions.HALError", + "functionName": "__init__", + "returnType": "hal.exceptions.HALError", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -2196,7 +2234,26 @@ { "className": "hal.simulation.SimCB", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "hal.simulation.SimCB", + "functionName": "__init__", + "returnType": "hal.simulation.SimCB", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -2220,7 +2277,26 @@ { "className": "hal.simulation.SimValueCB", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "hal.simulation.SimValueCB", + "functionName": "__init__", + "returnType": "hal.simulation.SimValueCB", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -8762,7 +8838,26 @@ { "className": "wpilib.DataLogManager", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.DataLogManager", + "functionName": "__init__", + "returnType": "wpilib.DataLogManager", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -9715,7 +9810,26 @@ "writable": false } ], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.DriverStation", + "functionName": "__init__", + "returnType": "wpilib.DriverStation", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [ { "enumClassName": "wpilib.DriverStation.Alliance", @@ -11120,7 +11234,26 @@ { "className": "wpilib.FieldObject2d", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.FieldObject2d", + "functionName": "__init__", + "returnType": "wpilib.FieldObject2d", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -13722,7 +13855,26 @@ { "className": "wpilib.LiveWindow", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.LiveWindow", + "functionName": "__init__", + "returnType": "wpilib.LiveWindow", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -13925,7 +14077,26 @@ { "className": "wpilib.MechanismLigament2d", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.MechanismLigament2d", + "functionName": "__init__", + "returnType": "wpilib.MechanismLigament2d", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -14111,7 +14282,26 @@ { "className": "wpilib.MechanismObject2d", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.MechanismObject2d", + "functionName": "__init__", + "returnType": "wpilib.MechanismObject2d", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -14173,7 +14363,26 @@ { "className": "wpilib.MechanismRoot2d", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.MechanismRoot2d", + "functionName": "__init__", + "returnType": "wpilib.MechanismRoot2d", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -23651,7 +23860,26 @@ { "className": "wpilib.Preferences", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.Preferences", + "functionName": "__init__", + "returnType": "wpilib.Preferences", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -24472,7 +24700,26 @@ { "className": "wpilib.RobotController", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.RobotController", + "functionName": "__init__", + "returnType": "wpilib.RobotController", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -24792,7 +25039,26 @@ { "className": "wpilib.RobotState", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.RobotState", + "functionName": "__init__", + "returnType": "wpilib.RobotState", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -26933,7 +27199,26 @@ { "className": "wpilib.SendableChooserBase", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.SendableChooserBase", + "functionName": "__init__", + "returnType": "wpilib.SendableChooserBase", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -26962,7 +27247,26 @@ { "className": "wpilib.SensorUtil", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.SensorUtil", + "functionName": "__init__", + "returnType": "wpilib.SensorUtil", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -27964,7 +28268,26 @@ { "className": "wpilib.SmartDashboard", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.SmartDashboard", + "functionName": "__init__", + "returnType": "wpilib.SmartDashboard", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -35156,12 +35479,52 @@ { "className": "wpilib.cameraserver.CameraServer", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.cameraserver.CameraServer", + "functionName": "__init__", + "returnType": "wpilib.cameraserver.CameraServer", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], "moduleName": "wpilib.cameraserver", - "staticMethods": [] + "staticMethods": [ + { + "args": [], + "declaringClassName": "wpilib.cameraserver.CameraServer", + "functionName": "is_alive", + "returnType": "", + "tooltip": ":returns: True if the CameraServer is still alive" + }, + { + "args": [ + { + "defaultValue": null, + "name": "vision_py", + "type": "typing.Optional[str]" + } + ], + "declaringClassName": "wpilib.cameraserver.CameraServer", + "functionName": "launch", + "returnType": "None", + "tooltip": "\n Launches the CameraServer process in autocapture mode or\n using a user-specified python script\n\n :param vision_py: If specified, this is the relative path to\n a filename with a function in it\n\n Example usage::\n\n wpilib.CameraServer.launch(\"vision.py:main\")\n\n .. warning:: You must have robotpy-cscore installed, or this\n function will fail without returning an error\n (you will see an error in the console).\n\n " + } + ] }, { "className": "wpilib.counter.ExternalDirectionCounter", @@ -38299,7 +38662,26 @@ "writable": false } ], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.Shuffleboard", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.Shuffleboard", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -38445,7 +38827,26 @@ { "className": "wpilib.shuffleboard.ShuffleboardComponentBase", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.ShuffleboardComponentBase", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.ShuffleboardComponentBase", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -38580,7 +38981,26 @@ { "className": "wpilib.shuffleboard.ShuffleboardContainer", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.ShuffleboardContainer", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.ShuffleboardContainer", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -41903,7 +42323,26 @@ { "className": "wpilib.shuffleboard.ShuffleboardValue", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.ShuffleboardValue", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.ShuffleboardValue", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -42279,7 +42718,26 @@ { "className": "wpilib.shuffleboard.SuppliedBoolListValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedBoolListValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedBoolListValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -42532,7 +42990,26 @@ { "className": "wpilib.shuffleboard.SuppliedBoolValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedBoolValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedBoolValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -42785,7 +43262,26 @@ { "className": "wpilib.shuffleboard.SuppliedDoubleListValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedDoubleListValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedDoubleListValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -43038,7 +43534,26 @@ { "className": "wpilib.shuffleboard.SuppliedDoubleValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedDoubleValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedDoubleValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -43291,7 +43806,26 @@ { "className": "wpilib.shuffleboard.SuppliedFloatListValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedFloatListValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedFloatListValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -43544,7 +44078,26 @@ { "className": "wpilib.shuffleboard.SuppliedFloatValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedFloatValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedFloatValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -43797,7 +44350,26 @@ { "className": "wpilib.shuffleboard.SuppliedIntListValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedIntListValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedIntListValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -44050,7 +44622,26 @@ { "className": "wpilib.shuffleboard.SuppliedIntegerValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedIntegerValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedIntegerValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -44303,7 +44894,26 @@ { "className": "wpilib.shuffleboard.SuppliedRawValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedRawValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedRawValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -44556,7 +45166,26 @@ { "className": "wpilib.shuffleboard.SuppliedStringListValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedStringListValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedStringListValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -44809,7 +45438,26 @@ { "className": "wpilib.shuffleboard.SuppliedStringValueWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard.SuppliedStringValueWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard.SuppliedStringValueWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -45100,7 +45748,26 @@ { "className": "wpilib.shuffleboard._ComplexComponent", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._ComplexComponent", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._ComplexComponent", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -45299,7 +45966,26 @@ { "className": "wpilib.shuffleboard._ComplexWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._ComplexWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._ComplexWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -45552,7 +46238,26 @@ { "className": "wpilib.shuffleboard._LayoutComponent", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._LayoutComponent", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._LayoutComponent", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -45751,7 +46456,26 @@ { "className": "wpilib.shuffleboard._SimpleComponent", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SimpleComponent", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SimpleComponent", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -45950,7 +46674,26 @@ { "className": "wpilib.shuffleboard._SimpleWidget", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SimpleWidget", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SimpleWidget", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -46203,7 +46946,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_bool", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_bool", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_bool", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -46402,7 +47164,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_double", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_double", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_double", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -46601,7 +47382,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_float", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_float", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_float", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -46800,7 +47600,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_integer", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_integer", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_integer", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -46999,7 +47818,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_string", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_string", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_string", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -47198,7 +48036,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -47397,7 +48254,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_double", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_double", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_double", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -47596,7 +48472,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_float", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_float", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_float", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -47795,7 +48690,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_int", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_int", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_int", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -47994,7 +48908,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_raw", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_raw", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_raw", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -48193,7 +49126,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueComponent_vector_string", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueComponent_vector_string", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueComponent_vector_string", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -48392,7 +49344,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_bool", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_bool", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_bool", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -48645,7 +49616,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_double", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_double", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_double", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -48898,7 +49888,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_float", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_float", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_float", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -49151,7 +50160,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_integer", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_integer", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_integer", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -49404,7 +50432,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_string", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_string", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_string", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -49657,7 +50704,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_bool", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_bool", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_bool", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -49910,7 +50976,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_double", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_double", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_double", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -50163,7 +51248,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_float", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_float", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_float", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -50416,7 +51520,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_int", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_int", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_int", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -50669,7 +51792,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_raw", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_raw", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_raw", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -50922,7 +52064,26 @@ { "className": "wpilib.shuffleboard._SuppliedValueWidget_vector_string", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.shuffleboard._SuppliedValueWidget_vector_string", + "functionName": "__init__", + "returnType": "wpilib.shuffleboard._SuppliedValueWidget_vector_string", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -54129,7 +55290,26 @@ { "className": "wpilib.simulation.CallbackStore", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.simulation.CallbackStore", + "functionName": "__init__", + "returnType": "wpilib.simulation.CallbackStore", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -66532,7 +67712,26 @@ { "className": "wpilib.sysid.SysIdRoutineLog.MotorLog", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "functionName": "__init__", + "returnType": "wpilib.sysid.SysIdRoutineLog.MotorLog", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -94650,7 +95849,26 @@ { "className": "wpimath.spline.SplineParameterizer", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpimath.spline.SplineParameterizer", + "functionName": "__init__", + "returnType": "wpimath.spline.SplineParameterizer", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -99887,7 +101105,26 @@ { "className": "wpimath.trajectory.ExponentialProfileMeterVolts.Constraints", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpimath.trajectory.ExponentialProfileMeterVolts.Constraints", + "functionName": "__init__", + "returnType": "wpimath.trajectory.ExponentialProfileMeterVolts.Constraints", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [ { @@ -100811,7 +102048,26 @@ { "className": "wpimath.trajectory.TrajectoryUtil", "classVariables": [], - "constructors": [], + "constructors": [ + { + "args": [ + { + "defaultValue": null, + "name": "args", + "type": "tuple" + }, + { + "defaultValue": null, + "name": "kwargs", + "type": "dict" + } + ], + "declaringClassName": "wpimath.trajectory.TrajectoryUtil", + "functionName": "__init__", + "returnType": "wpimath.trajectory.TrajectoryUtil", + "tooltip": "Initialize self. See help(type(self)) for accurate signature." + } + ], "enums": [], "instanceMethods": [], "instanceVariables": [], @@ -114882,6 +116138,40 @@ "returnType": "wpimath.units.seconds", "tooltip": "Gives real-time clock system time with nanosecond resolution\n\n:returns: The time, just in case you want the robot to start autonomous at 8pm\n on Saturday." }, + { + "args": [ + { + "defaultValue": null, + "name": "error", + "type": "str" + }, + { + "defaultValue": null, + "name": "printTrace", + "type": "bool" + } + ], + "functionName": "reportError", + "returnType": "None", + "tooltip": "\n Report error to Driver Station, and also prints error to ``sys.stderr``.\n Optionally appends stack trace to error message.\n\n :param error: message to show\n :param printTrace: If True, appends stack trace to error string\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "error", + "type": "str" + }, + { + "defaultValue": null, + "name": "printTrace", + "type": "bool" + } + ], + "functionName": "reportWarning", + "returnType": "None", + "tooltip": "\n Report warning to Driver Station, and also prints error to ``sys.stderr``.\n Optionally appends stack trace to error message.\n\n :param error: message to show\n :param printTrace: If True, appends stack trace to error string\n " + }, { "args": [ { @@ -115346,7 +116636,176 @@ }, { "enums": [], - "functions": [], + "functions": [ + { + "args": [ + { + "defaultValue": null, + "name": "deg", + "type": "degrees" + } + ], + "functionName": "degreesToRotations", + "returnType": "float", + "tooltip": "Converts given degrees to rotations.\n\n :param deg: The degrees to convert.\n\n :returns: rotations Converted from degrees.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "ft", + "type": "feet" + } + ], + "functionName": "feetToMeters", + "returnType": "meters", + "tooltip": "Converts given feet to meters.\n\n :param ft: The feet to convert to meters.\n\n :returns: Meters converted from feet.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "i", + "type": "inches" + } + ], + "functionName": "inchesToMeters", + "returnType": "meters", + "tooltip": "Converts given inches to meters.\n\n :param i: The inches to convert to meters.\n\n :returns: Meters converted from inches.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "kg", + "type": "kilograms" + } + ], + "functionName": "kilogramsToLbs", + "returnType": "pounds", + "tooltip": "Converts kilograms into lbs (pound-mass).\n\n :param kg: The kilograms to convert to lbs (pound-mass).\n\n :returns: Lbs (pound-mass) converted from kilograms.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "lbs", + "type": "pounds" + } + ], + "functionName": "lbsToKilograms", + "returnType": "kilograms", + "tooltip": "Converts lbs (pound-mass) into kilograms.\n\n :param lbs: The lbs (pound-mass) to convert to kilograms.\n\n :returns: Kilograms converted from lbs (pound-mass).\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "m", + "type": "meters" + } + ], + "functionName": "metersToFeet", + "returnType": "feet", + "tooltip": "Converts given meters to feet.\n\n :param m: The meters to convert to feet.\n\n :returns: Feet converted from meters.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "m", + "type": "meters" + } + ], + "functionName": "metersToInches", + "returnType": "inches", + "tooltip": "Converts given meters to inches.\n\n :param m: The meters to convert to inches.\n\n :returns: Inches converted from meters.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "ms", + "type": "milliseconds" + } + ], + "functionName": "millisecondsToSeconds", + "returnType": "seconds", + "tooltip": "Converts given milliseconds to seconds.\n\n :param ms: The milliseconds to convert to seconds.\n\n :returns: Seconds converted from milliseconds.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "rps", + "type": "radians_per_second" + } + ], + "functionName": "radiansPerSecondToRotationsPerMinute", + "returnType": "revolutions_per_minute", + "tooltip": "Converts radians per second to rotations per minute.\n\n :param rps: The radians per second to convert to from rotations per minute.\n\n :returns: Rotations per minute converted from radians per second.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "rad", + "type": "radians" + } + ], + "functionName": "radiansToRotations", + "returnType": "float", + "tooltip": "Converts given radians to rotations.\n\n :param rad: The radians to convert.\n\n :returns: rotations Converted from radians.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "rpm", + "type": "revolutions_per_minute" + } + ], + "functionName": "rotationsPerMinuteToRadiansPerSecond", + "returnType": "radians_per_second", + "tooltip": "Converts rotations per minute to radians per second.\n\n :param rpm: The rotations per minute to convert to radians per second.\n\n :returns: Radians per second converted from rotations per minute.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "rotations", + "type": "float" + } + ], + "functionName": "rotationsToDegrees", + "returnType": "degrees", + "tooltip": "Converts given rotations to degrees.\n\n :param rotations: The rotations to convert.\n\n :returns: degrees Converted from rotations.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "rotations", + "type": "float" + } + ], + "functionName": "rotationsToRadians", + "returnType": "float", + "tooltip": "Converts given rotations to radians.\n\n :param rotations: The rotations to convert.\n\n :returns: radians Converted from rotations.\n " + }, + { + "args": [ + { + "defaultValue": null, + "name": "s", + "type": "seconds" + } + ], + "functionName": "secondsToMilliseconds", + "returnType": "milliseconds", + "tooltip": "Converts given seconds to milliseconds.\n\n :param s: The seconds to convert to milliseconds.\n\n :returns: Milliseconds converted from seconds.\n " + } + ], "moduleName": "wpimath.units", "moduleVariables": [ { @@ -115384,11 +116843,9 @@ ], "subclasses": { "hal.AddressableLEDData": [ - "hal.AddressableLEDData", "wpilib.AddressableLED.LEDData" ], "hal.SimValue": [ - "hal.SimValue", "hal.SimBoolean", "hal.SimDouble", "hal.SimEnum", @@ -115396,79 +116853,60 @@ "hal.SimLong" ], "ntcore.BooleanArrayPublisher": [ - "ntcore.BooleanArrayPublisher", - "ntcore.Subscriber" + "ntcore.BooleanArrayEntry" ], "ntcore.BooleanArraySubscriber": [ - "ntcore.BooleanArraySubscriber", "ntcore.BooleanArrayEntry" ], "ntcore.BooleanPublisher": [ - "ntcore.BooleanPublisher", - "ntcore.Subscriber" + "ntcore.BooleanEntry" ], "ntcore.BooleanSubscriber": [ - "ntcore.BooleanSubscriber", "ntcore.BooleanEntry" ], "ntcore.DoubleArrayPublisher": [ - "ntcore.DoubleArrayPublisher", - "ntcore.Subscriber" + "ntcore.DoubleArrayEntry" ], "ntcore.DoubleArraySubscriber": [ - "ntcore.DoubleArraySubscriber", "ntcore.DoubleArrayEntry" ], "ntcore.DoublePublisher": [ - "ntcore.DoublePublisher", - "ntcore.Subscriber" + "ntcore.DoubleEntry" ], "ntcore.DoubleSubscriber": [ - "ntcore.DoubleSubscriber", "ntcore.DoubleEntry" ], "ntcore.FloatArrayPublisher": [ - "ntcore.FloatArrayPublisher", - "ntcore.Subscriber" + "ntcore.FloatArrayEntry" ], "ntcore.FloatArraySubscriber": [ - "ntcore.FloatArraySubscriber", "ntcore.FloatArrayEntry" ], "ntcore.FloatPublisher": [ - "ntcore.FloatPublisher", - "ntcore.Subscriber" + "ntcore.FloatEntry" ], "ntcore.FloatSubscriber": [ - "ntcore.FloatSubscriber", "ntcore.FloatEntry" ], "ntcore.GenericPublisher": [ - "ntcore.GenericPublisher", - "ntcore.Subscriber" + "ntcore.GenericEntry" ], "ntcore.GenericSubscriber": [ - "ntcore.GenericSubscriber", "ntcore.GenericEntry" ], "ntcore.IntegerArrayPublisher": [ - "ntcore.IntegerArrayPublisher", - "ntcore.Subscriber" + "ntcore.IntegerArrayEntry" ], "ntcore.IntegerArraySubscriber": [ - "ntcore.IntegerArraySubscriber", "ntcore.IntegerArrayEntry" ], "ntcore.IntegerPublisher": [ - "ntcore.IntegerPublisher", - "ntcore.Subscriber" + "ntcore.IntegerEntry" ], "ntcore.IntegerSubscriber": [ - "ntcore.IntegerSubscriber", "ntcore.IntegerEntry" ], "ntcore.NTSendable": [ - "ntcore.NTSendable", "wpilib.ADXL345_I2C", "wpilib.ADXL345_SPI", "wpilib.ADXL362", @@ -115476,11 +116914,9 @@ "wpilib.Mechanism2d" ], "ntcore.NTSendableBuilder": [ - "ntcore.NTSendableBuilder", "wpilib.SendableBuilderImpl" ], "ntcore.Publisher": [ - "ntcore.Publisher", "ntcore.BooleanArrayPublisher", "ntcore.BooleanPublisher", "ntcore.DoubleArrayPublisher", @@ -115497,47 +116933,36 @@ "ntcore.StructPublisher" ], "ntcore.RawPublisher": [ - "ntcore.RawPublisher", - "ntcore.Subscriber" + "ntcore.RawEntry" ], "ntcore.RawSubscriber": [ - "ntcore.RawSubscriber", "ntcore.RawEntry" ], "ntcore.StringArrayPublisher": [ - "ntcore.StringArrayPublisher", - "ntcore.Subscriber" + "ntcore.StringArrayEntry" ], "ntcore.StringArraySubscriber": [ - "ntcore.StringArraySubscriber", "ntcore.StringArrayEntry" ], "ntcore.StringPublisher": [ - "ntcore.StringPublisher", - "ntcore.Subscriber" + "ntcore.StringEntry" ], "ntcore.StringSubscriber": [ - "ntcore.StringSubscriber", "ntcore.StringEntry" ], "ntcore.StructArrayPublisher": [ - "ntcore.StructArrayPublisher", - "ntcore.Subscriber" + "ntcore.StructArrayEntry" ], "ntcore.StructArraySubscriber": [ - "ntcore.StructArraySubscriber", "ntcore.StructArrayEntry" ], "ntcore.StructPublisher": [ - "ntcore.StructPublisher", - "ntcore.Subscriber" + "ntcore.StructEntry" ], "ntcore.StructSubscriber": [ - "ntcore.StructSubscriber", "ntcore.StructEntry" ], "ntcore.Subscriber": [ - "ntcore.Subscriber", "ntcore.BooleanArraySubscriber", "ntcore.BooleanSubscriber", "ntcore.DoubleArraySubscriber", @@ -115554,7 +116979,6 @@ "ntcore.StructSubscriber" ], "ntcore.Topic": [ - "ntcore.Topic", "ntcore.BooleanArrayTopic", "ntcore.BooleanTopic", "ntcore.DoubleArrayTopic", @@ -115570,31 +116994,26 @@ "ntcore.StructTopic" ], "wpilib.DigitalSource": [ - "wpilib.DigitalSource", "wpilib.AnalogTriggerOutput", "wpilib.DigitalInput", "wpilib.DigitalOutput" ], "wpilib.IterativeRobotBase": [ - "wpilib.IterativeRobotBase", "wpilib.TimedRobot" ], "wpilib.MechanismObject2d": [ - "wpilib.MechanismObject2d", "wpilib.MechanismLigament2d" ], "wpilib.MotorSafety": [ - "wpilib.MotorSafety", - "wpilib.interfaces.MotorController", + "wpilib.NidecBrushless", + "wpilib.PWMMotorController", "wpilib.Relay", "wpilib.drive.RobotDriveBase" ], "wpilib.PWM": [ - "wpilib.PWM", "wpilib.Servo" ], "wpilib.PWMMotorController": [ - "wpilib.PWMMotorController", "wpilib.DMC60", "wpilib.Jaguar", "wpilib.PWMSparkFlex", @@ -115610,38 +117029,30 @@ "wpilib.VictorSP" ], "wpilib.PneumaticsBase": [ - "wpilib.PneumaticsBase", "wpilib.PneumaticHub", "wpilib.PneumaticsControlModule" ], "wpilib.RobotBase": [ - "wpilib.RobotBase", "wpilib.IterativeRobotBase" ], "wpilib.SendableChooserBase": [ - "wpilib.SendableChooserBase", "wpilib.SendableChooser" ], "wpilib.TimedRobot": [ - "wpilib.TimedRobot", "wpilib.TimesliceRobot" ], "wpilib.drive.RobotDriveBase": [ - "wpilib.drive.RobotDriveBase", "wpilib.drive.DifferentialDrive", "wpilib.drive.MecanumDrive" ], "wpilib.event.BooleanEvent": [ - "wpilib.event.BooleanEvent", "wpilib.event.NetworkBooleanEvent" ], "wpilib.interfaces.CounterBase": [ - "wpilib.interfaces.CounterBase", "wpilib.Counter", "wpilib.Encoder" ], "wpilib.interfaces.GenericHID": [ - "wpilib.interfaces.GenericHID", "wpilib.Joystick", "wpilib.PS4Controller", "wpilib.PS5Controller", @@ -115649,148 +117060,116 @@ "wpilib.XboxController" ], "wpilib.interfaces.MotorController": [ - "wpilib.interfaces.MotorController", - "wpilib.PWMMotorController", - "wpiutil.Sendable", - "wpilib.NidecBrushless" + "wpilib.MotorControllerGroup", + "wpilib.NidecBrushless", + "wpilib.PWMMotorController" ], "wpilib.shuffleboard.ShuffleboardComponentBase": [ - "wpilib.shuffleboard.ShuffleboardComponentBase", "wpilib.shuffleboard._ComplexComponent", "wpilib.shuffleboard._LayoutComponent", "wpilib.shuffleboard._SimpleComponent", - "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", "wpilib.shuffleboard._SuppliedValueComponent_bool", - "wpilib.shuffleboard._SuppliedValueComponent_vector_double", "wpilib.shuffleboard._SuppliedValueComponent_double", - "wpilib.shuffleboard._SuppliedValueComponent_vector_float", "wpilib.shuffleboard._SuppliedValueComponent_float", - "wpilib.shuffleboard._SuppliedValueComponent_vector_int", "wpilib.shuffleboard._SuppliedValueComponent_integer", + "wpilib.shuffleboard._SuppliedValueComponent_string", + "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", + "wpilib.shuffleboard._SuppliedValueComponent_vector_double", + "wpilib.shuffleboard._SuppliedValueComponent_vector_float", + "wpilib.shuffleboard._SuppliedValueComponent_vector_int", "wpilib.shuffleboard._SuppliedValueComponent_vector_raw", - "wpilib.shuffleboard._SuppliedValueComponent_vector_string", - "wpilib.shuffleboard._SuppliedValueComponent_string" + "wpilib.shuffleboard._SuppliedValueComponent_vector_string" ], "wpilib.shuffleboard.ShuffleboardContainer": [ - "wpilib.shuffleboard.ShuffleboardContainer", - "wpilib.shuffleboard.ShuffleboardComponentBase", + "wpilib.shuffleboard.ShuffleboardLayout", "wpilib.shuffleboard.ShuffleboardTab" ], "wpilib.shuffleboard.ShuffleboardValue": [ - "wpilib.shuffleboard.ShuffleboardValue", "wpilib.shuffleboard.ShuffleboardComponentBase", "wpilib.shuffleboard.ShuffleboardContainer" ], "wpilib.shuffleboard._ComplexComponent": [ - "wpilib.shuffleboard._ComplexComponent", "wpilib.shuffleboard._ComplexWidget" ], "wpilib.shuffleboard._ComplexWidget": [ - "wpilib.shuffleboard._ComplexWidget", "wpilib.shuffleboard.ComplexWidget" ], "wpilib.shuffleboard._LayoutComponent": [ - "wpilib.shuffleboard._LayoutComponent", "wpilib.shuffleboard.ShuffleboardLayout" ], "wpilib.shuffleboard._SimpleComponent": [ - "wpilib.shuffleboard._SimpleComponent", "wpilib.shuffleboard._SimpleWidget" ], "wpilib.shuffleboard._SimpleWidget": [ - "wpilib.shuffleboard._SimpleWidget", "wpilib.shuffleboard.SimpleWidget" ], "wpilib.shuffleboard._SuppliedValueComponent_bool": [ - "wpilib.shuffleboard._SuppliedValueComponent_bool", "wpilib.shuffleboard._SuppliedValueWidget_bool" ], "wpilib.shuffleboard._SuppliedValueComponent_double": [ - "wpilib.shuffleboard._SuppliedValueComponent_double", "wpilib.shuffleboard._SuppliedValueWidget_double" ], "wpilib.shuffleboard._SuppliedValueComponent_float": [ - "wpilib.shuffleboard._SuppliedValueComponent_float", "wpilib.shuffleboard._SuppliedValueWidget_float" ], "wpilib.shuffleboard._SuppliedValueComponent_integer": [ - "wpilib.shuffleboard._SuppliedValueComponent_integer", "wpilib.shuffleboard._SuppliedValueWidget_integer" ], "wpilib.shuffleboard._SuppliedValueComponent_string": [ - "wpilib.shuffleboard._SuppliedValueComponent_string", "wpilib.shuffleboard._SuppliedValueWidget_string" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_bool": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_bool", "wpilib.shuffleboard._SuppliedValueWidget_vector_bool" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_double": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_double", "wpilib.shuffleboard._SuppliedValueWidget_vector_double" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_float": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_float", "wpilib.shuffleboard._SuppliedValueWidget_vector_float" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_int": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_int", "wpilib.shuffleboard._SuppliedValueWidget_vector_int" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_raw": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_raw", "wpilib.shuffleboard._SuppliedValueWidget_vector_raw" ], "wpilib.shuffleboard._SuppliedValueComponent_vector_string": [ - "wpilib.shuffleboard._SuppliedValueComponent_vector_string", "wpilib.shuffleboard._SuppliedValueWidget_vector_string" ], "wpilib.shuffleboard._SuppliedValueWidget_bool": [ - "wpilib.shuffleboard._SuppliedValueWidget_bool", "wpilib.shuffleboard.SuppliedBoolValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_double": [ - "wpilib.shuffleboard._SuppliedValueWidget_double", "wpilib.shuffleboard.SuppliedDoubleValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_float": [ - "wpilib.shuffleboard._SuppliedValueWidget_float", "wpilib.shuffleboard.SuppliedFloatValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_integer": [ - "wpilib.shuffleboard._SuppliedValueWidget_integer", "wpilib.shuffleboard.SuppliedIntegerValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_string": [ - "wpilib.shuffleboard._SuppliedValueWidget_string", "wpilib.shuffleboard.SuppliedStringValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_bool": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_bool", "wpilib.shuffleboard.SuppliedBoolListValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_double": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_double", "wpilib.shuffleboard.SuppliedDoubleListValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_float": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_float", "wpilib.shuffleboard.SuppliedFloatListValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_int": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_int", "wpilib.shuffleboard.SuppliedIntListValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_raw": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_raw", "wpilib.shuffleboard.SuppliedRawValueWidget" ], "wpilib.shuffleboard._SuppliedValueWidget_vector_string": [ - "wpilib.shuffleboard._SuppliedValueWidget_vector_string", "wpilib.shuffleboard.SuppliedStringListValueWidget" ], "wpilib.simulation.GenericHIDSim": [ - "wpilib.simulation.GenericHIDSim", "wpilib.simulation.JoystickSim", "wpilib.simulation.PS4ControllerSim", "wpilib.simulation.PS5ControllerSim", @@ -115798,150 +117177,114 @@ "wpilib.simulation.XboxControllerSim" ], "wpilib.simulation.LinearSystemSim_1_1_1": [ - "wpilib.simulation.LinearSystemSim_1_1_1", "wpilib.simulation.FlywheelSim" ], "wpilib.simulation.LinearSystemSim_2_1_2": [ - "wpilib.simulation.LinearSystemSim_2_1_2", "wpilib.simulation.DCMotorSim", "wpilib.simulation.ElevatorSim", "wpilib.simulation.SingleJointedArmSim" ], "wpilib.simulation.PneumaticsBaseSim": [ - "wpilib.simulation.PneumaticsBaseSim", "wpilib.simulation.CTREPCMSim", "wpilib.simulation.REVPHSim" ], "wpimath.estimator.DifferentialDrivePoseEstimator3dBase": [ - "wpimath.estimator.DifferentialDrivePoseEstimator3dBase", "wpimath.estimator.DifferentialDrivePoseEstimator3d" ], "wpimath.estimator.DifferentialDrivePoseEstimatorBase": [ - "wpimath.estimator.DifferentialDrivePoseEstimatorBase", "wpimath.estimator.DifferentialDrivePoseEstimator" ], "wpimath.estimator.MecanumDrivePoseEstimator3dBase": [ - "wpimath.estimator.MecanumDrivePoseEstimator3dBase", "wpimath.estimator.MecanumDrivePoseEstimator3d" ], "wpimath.estimator.MecanumDrivePoseEstimatorBase": [ - "wpimath.estimator.MecanumDrivePoseEstimatorBase", "wpimath.estimator.MecanumDrivePoseEstimator" ], "wpimath.estimator.SwerveDrive2PoseEstimator3dBase": [ - "wpimath.estimator.SwerveDrive2PoseEstimator3dBase", "wpimath.estimator.SwerveDrive2PoseEstimator3d" ], "wpimath.estimator.SwerveDrive2PoseEstimatorBase": [ - "wpimath.estimator.SwerveDrive2PoseEstimatorBase", "wpimath.estimator.SwerveDrive2PoseEstimator" ], "wpimath.estimator.SwerveDrive3PoseEstimator3dBase": [ - "wpimath.estimator.SwerveDrive3PoseEstimator3dBase", "wpimath.estimator.SwerveDrive3PoseEstimator3d" ], "wpimath.estimator.SwerveDrive3PoseEstimatorBase": [ - "wpimath.estimator.SwerveDrive3PoseEstimatorBase", "wpimath.estimator.SwerveDrive3PoseEstimator" ], "wpimath.estimator.SwerveDrive4PoseEstimator3dBase": [ - "wpimath.estimator.SwerveDrive4PoseEstimator3dBase", "wpimath.estimator.SwerveDrive4PoseEstimator3d" ], "wpimath.estimator.SwerveDrive4PoseEstimatorBase": [ - "wpimath.estimator.SwerveDrive4PoseEstimatorBase", "wpimath.estimator.SwerveDrive4PoseEstimator" ], "wpimath.estimator.SwerveDrive6PoseEstimator3dBase": [ - "wpimath.estimator.SwerveDrive6PoseEstimator3dBase", "wpimath.estimator.SwerveDrive6PoseEstimator3d" ], "wpimath.estimator.SwerveDrive6PoseEstimatorBase": [ - "wpimath.estimator.SwerveDrive6PoseEstimatorBase", "wpimath.estimator.SwerveDrive6PoseEstimator" ], "wpimath.kinematics.DifferentialDriveKinematicsBase": [ - "wpimath.kinematics.DifferentialDriveKinematicsBase", "wpimath.kinematics.DifferentialDriveKinematics" ], "wpimath.kinematics.DifferentialDriveOdometry3dBase": [ - "wpimath.kinematics.DifferentialDriveOdometry3dBase", "wpimath.kinematics.DifferentialDriveOdometry3d" ], "wpimath.kinematics.DifferentialDriveOdometryBase": [ - "wpimath.kinematics.DifferentialDriveOdometryBase", "wpimath.kinematics.DifferentialDriveOdometry" ], "wpimath.kinematics.MecanumDriveKinematicsBase": [ - "wpimath.kinematics.MecanumDriveKinematicsBase", "wpimath.kinematics.MecanumDriveKinematics" ], "wpimath.kinematics.MecanumDriveOdometry3dBase": [ - "wpimath.kinematics.MecanumDriveOdometry3dBase", "wpimath.kinematics.MecanumDriveOdometry3d" ], "wpimath.kinematics.MecanumDriveOdometryBase": [ - "wpimath.kinematics.MecanumDriveOdometryBase", "wpimath.kinematics.MecanumDriveOdometry" ], "wpimath.kinematics.SwerveDrive2KinematicsBase": [ - "wpimath.kinematics.SwerveDrive2KinematicsBase", "wpimath.kinematics.SwerveDrive2Kinematics" ], "wpimath.kinematics.SwerveDrive2Odometry3dBase": [ - "wpimath.kinematics.SwerveDrive2Odometry3dBase", "wpimath.kinematics.SwerveDrive2Odometry3d" ], "wpimath.kinematics.SwerveDrive2OdometryBase": [ - "wpimath.kinematics.SwerveDrive2OdometryBase", "wpimath.kinematics.SwerveDrive2Odometry" ], "wpimath.kinematics.SwerveDrive3KinematicsBase": [ - "wpimath.kinematics.SwerveDrive3KinematicsBase", "wpimath.kinematics.SwerveDrive3Kinematics" ], "wpimath.kinematics.SwerveDrive3Odometry3dBase": [ - "wpimath.kinematics.SwerveDrive3Odometry3dBase", "wpimath.kinematics.SwerveDrive3Odometry3d" ], "wpimath.kinematics.SwerveDrive3OdometryBase": [ - "wpimath.kinematics.SwerveDrive3OdometryBase", "wpimath.kinematics.SwerveDrive3Odometry" ], "wpimath.kinematics.SwerveDrive4KinematicsBase": [ - "wpimath.kinematics.SwerveDrive4KinematicsBase", "wpimath.kinematics.SwerveDrive4Kinematics" ], "wpimath.kinematics.SwerveDrive4Odometry3dBase": [ - "wpimath.kinematics.SwerveDrive4Odometry3dBase", "wpimath.kinematics.SwerveDrive4Odometry3d" ], "wpimath.kinematics.SwerveDrive4OdometryBase": [ - "wpimath.kinematics.SwerveDrive4OdometryBase", "wpimath.kinematics.SwerveDrive4Odometry" ], "wpimath.kinematics.SwerveDrive6KinematicsBase": [ - "wpimath.kinematics.SwerveDrive6KinematicsBase", "wpimath.kinematics.SwerveDrive6Kinematics" ], "wpimath.kinematics.SwerveDrive6Odometry3dBase": [ - "wpimath.kinematics.SwerveDrive6Odometry3dBase", "wpimath.kinematics.SwerveDrive6Odometry3d" ], "wpimath.kinematics.SwerveDrive6OdometryBase": [ - "wpimath.kinematics.SwerveDrive6OdometryBase", "wpimath.kinematics.SwerveDrive6Odometry" ], "wpimath.spline.Spline3": [ - "wpimath.spline.Spline3", "wpimath.spline.CubicHermiteSpline" ], "wpimath.spline.Spline5": [ - "wpimath.spline.Spline5", "wpimath.spline.QuinticHermiteSpline" ], "wpimath.trajectory.constraint.TrajectoryConstraint": [ - "wpimath.trajectory.constraint.TrajectoryConstraint", "wpimath.trajectory.constraint.CentripetalAccelerationConstraint", "wpimath.trajectory.constraint.DifferentialDriveKinematicsConstraint", "wpimath.trajectory.constraint.DifferentialDriveVoltageConstraint", @@ -115955,7 +117298,6 @@ "wpimath.trajectory.constraint.SwerveDrive6KinematicsConstraint" ], "wpiutil.Sendable": [ - "wpiutil.Sendable", "ntcore.NTSendable", "wpilib.ADIS16448_IMU", "wpilib.ADIS16470_IMU", @@ -115967,42 +117309,51 @@ "wpilib.AnalogOutput", "wpilib.AnalogPotentiometer", "wpilib.AnalogTrigger", - "wpilib.DigitalSource", + "wpilib.AnalogTriggerOutput", "wpilib.BuiltInAccelerometer", "wpilib.Compressor", - "wpilib.interfaces.CounterBase", - "wpilib.MotorSafety", + "wpilib.Counter", "wpilib.DigitalGlitchFilter", + "wpilib.DigitalInput", + "wpilib.DigitalOutput", "wpilib.DoubleSolenoid", "wpilib.DutyCycle", "wpilib.DutyCycleEncoder", + "wpilib.Encoder", "wpilib.MotorControllerGroup", - "wpilib.interfaces.GenericHID", + "wpilib.NidecBrushless", + "wpilib.PS4Controller", + "wpilib.PS5Controller", "wpilib.PWM", + "wpilib.PWMMotorController", "wpilib.PowerDistribution", + "wpilib.Relay", "wpilib.SendableChooserBase", "wpilib.SharpIR", "wpilib.Solenoid", + "wpilib.StadiaController", "wpilib.Ultrasonic", + "wpilib.XboxController", "wpilib.counter.ExternalDirectionCounter", "wpilib.counter.Tachometer", "wpilib.counter.UpDownCounter", + "wpilib.drive.DifferentialDrive", + "wpilib.drive.MecanumDrive", "wpimath.controller.BangBangController", "wpimath.controller.PIDController", "wpimath.controller.ProfiledPIDController", "wpimath.controller.ProfiledPIDControllerRadians" ], "wpiutil.SendableBuilder": [ - "wpiutil.SendableBuilder", "ntcore.NTSendableBuilder" ], "wpiutil.log.DataLog": [ - "wpiutil.log.DataLog", "wpiutil.DataLogBackgroundWriter", "wpiutil.DataLogWriter" ], "wpiutil.log.DataLogEntry": [ - "wpiutil.log.DataLogEntry", + "wpiutil.log.StructArrayLogEntry", + "wpiutil.log.StructLogEntry", "wpiutil.log._BooleanArrayLogEntryImpl", "wpiutil.log._BooleanLogEntryImpl", "wpiutil.log._DoubleArrayLogEntryImpl", @@ -116013,52 +117364,39 @@ "wpiutil.log._IntegerLogEntryImpl", "wpiutil.log._RawLogEntryImpl", "wpiutil.log._StringArrayLogEntryImpl", - "wpiutil.log._StringLogEntryImpl", - "wpiutil.log.StructArrayLogEntry", - "wpiutil.log.StructLogEntry" + "wpiutil.log._StringLogEntryImpl" ], "wpiutil.log._BooleanArrayLogEntryImpl": [ - "wpiutil.log._BooleanArrayLogEntryImpl", "wpiutil.log.BooleanArrayLogEntry" ], "wpiutil.log._BooleanLogEntryImpl": [ - "wpiutil.log._BooleanLogEntryImpl", "wpiutil.log.BooleanLogEntry" ], "wpiutil.log._DoubleArrayLogEntryImpl": [ - "wpiutil.log._DoubleArrayLogEntryImpl", "wpiutil.log.DoubleArrayLogEntry" ], "wpiutil.log._DoubleLogEntryImpl": [ - "wpiutil.log._DoubleLogEntryImpl", "wpiutil.log.DoubleLogEntry" ], "wpiutil.log._FloatArrayLogEntryImpl": [ - "wpiutil.log._FloatArrayLogEntryImpl", "wpiutil.log.FloatArrayLogEntry" ], "wpiutil.log._FloatLogEntryImpl": [ - "wpiutil.log._FloatLogEntryImpl", "wpiutil.log.FloatLogEntry" ], "wpiutil.log._IntegerArrayLogEntryImpl": [ - "wpiutil.log._IntegerArrayLogEntryImpl", "wpiutil.log.IntegerArrayLogEntry" ], "wpiutil.log._IntegerLogEntryImpl": [ - "wpiutil.log._IntegerLogEntryImpl", "wpiutil.log.IntegerLogEntry" ], "wpiutil.log._RawLogEntryImpl": [ - "wpiutil.log._RawLogEntryImpl", "wpiutil.log.RawLogEntry" ], "wpiutil.log._StringArrayLogEntryImpl": [ - "wpiutil.log._StringArrayLogEntryImpl", "wpiutil.log.StringArrayLogEntry" ], "wpiutil.log._StringLogEntryImpl": [ - "wpiutil.log._StringLogEntryImpl", "wpiutil.log.StringLogEntry" ] } diff --git a/src/blocks/utils/python.ts b/src/blocks/utils/python.ts index 747f8474..5772d4b0 100644 --- a/src/blocks/utils/python.ts +++ b/src/blocks/utils/python.ts @@ -19,57 +19,170 @@ * @author lizlooney@google.com (Liz Looney) */ +import { PythonData, organizeVarDataByType, VariableGettersAndSetters } from './python_json_types'; import { robotPyData } from './robotpy_data'; +import { externalSamplesData } from './external_samples_data'; -// Utilities related to RobotPy modules and classes. +import * as pythonEnum from "../mrc_get_python_enum_value"; +import * as getPythonVariable from "../mrc_get_python_variable"; +import * as setPythonVariable from "../mrc_set_python_variable"; +// Utilities related to blocks for python modules and classes, including those from RobotPy, external samples, etc. + +const allPythonData: PythonData[] = []; +allPythonData.push(robotPyData); +allPythonData.push(externalSamplesData); + + +// Initializes enum and variable blocks for python modules and classes. +export function initialize() { + for (const pythonData of allPythonData) { + // Process modules. + for (const moduleData of pythonData.modules) { + // Initialize enums. + for (const enumData of moduleData.enums) { + pythonEnum.initializeEnum(enumData.enumClassName, enumData.enumValues, enumData.tooltip); + } + + // Initialize module variables. + const varsByType: {[key: string]: VariableGettersAndSetters} = + organizeVarDataByType(moduleData.moduleVariables); + for (const varType in varsByType) { + const variableGettersAndSetters = varsByType[varType]; + getPythonVariable.initializeModuleVariableGetter( + moduleData.moduleName, + varType, + variableGettersAndSetters.varNamesForGetter, + variableGettersAndSetters.tooltipsForGetter); + if (variableGettersAndSetters.varNamesForSetter.length) { + setPythonVariable.initializeModuleVariableSetter( + moduleData.moduleName, + varType, + variableGettersAndSetters.varNamesForSetter, + variableGettersAndSetters.tooltipsForSetter); + } + } + } + + // Process classes. + for (const classData of pythonData.classes) { + // Initialize enums. + for (const enumData of classData.enums) { + pythonEnum.initializeEnum(enumData.enumClassName, enumData.enumValues, enumData.tooltip); + } + + // Initialize instance variables. + if (classData.instanceVariables.length) { + const varsByType: {[key: string]: VariableGettersAndSetters} = + organizeVarDataByType(classData.instanceVariables); + for (const varType in varsByType) { + const variableGettersAndSetters = varsByType[varType]; + getPythonVariable.initializeInstanceVariableGetter( + classData.className, + varType, + variableGettersAndSetters.varNamesForGetter, + variableGettersAndSetters.tooltipsForGetter); + if (variableGettersAndSetters.varNamesForSetter.length) { + setPythonVariable.initializeInstanceVariableSetter( + classData.className, + varType, + variableGettersAndSetters.varNamesForSetter, + variableGettersAndSetters.tooltipsForSetter); + } + } + } + + // Initialize class variables. + if (classData.classVariables.length) { + const varsByType: {[key: string]: VariableGettersAndSetters} = + organizeVarDataByType(classData.classVariables); + for (const varType in varsByType) { + const variableGettersAndSetters = varsByType[varType]; + getPythonVariable.initializeClassVariableGetter( + classData.className, + varType, + variableGettersAndSetters.varNamesForGetter, + variableGettersAndSetters.tooltipsForGetter); + if (variableGettersAndSetters.varNamesForSetter.length) { + setPythonVariable.initializeClassVariableSetter( + classData.className, + varType, + variableGettersAndSetters.varNamesForSetter, + variableGettersAndSetters.tooltipsForSetter); + } + } + } + } + } +} + + +// If the given type is a type alias, returns the value of the type alias. +// For example, if type is 'wpimath.units.nanoseconds', this function will return 'float' export function getAlias(type: string): string | null { - const aliases: {[key: string]: string} = robotPyData.aliases; - for (const className in aliases) { - if (type === className) { - return aliases[className]; + for (const pythonData of allPythonData) { + const aliases: {[key: string]: string} = pythonData.aliases; + for (const className in aliases) { + if (type === className) { + return aliases[className]; + } } } return null; } +// Returns the list of subclass names for the given type. +// For example, if type is 'wpilib.drive.RobotDriveBase', this function will +// return ['wpilib.drive.DifferentialDrive', 'wpilib.drive.MecanumDrive']. function getSubclassNames(type: string): string[] | null { - const subclasses: {[key: string]: string[]} = robotPyData.subclasses; - for (const className in subclasses) { - if (type === className) { - return subclasses[className]; + for (const pythonData of allPythonData) { + for (const className in pythonData.subclasses) { + if (type === className) { + return pythonData.subclasses[className]; + } } } return null; } -// Functions used in multiple python block definitions. - +// Returns the array of allowed types for the given string. +// This function is used by multiple blocks to set the check for an input socket. export function getAllowedTypesForSetCheck(type: string): string[] { // For the given python type, returns an array of compatible input types. - // Type Aliases - const alias = getAlias(type); - if (alias) { - return [type].concat(getAllowedTypesForSetCheck(alias)); - } + const allowedTypes: string[] = []; + collectAllowedTypesForSetCheck(type, allowedTypes); + return allowedTypes; +} - // Builtin python types. +function collectAllowedTypesForSetCheck(type: string, allowedTypes: string[]) { + // Built-in python types. const check = getCheckForBuiltInType(type); if (check) { - return [check]; + allowedTypes.push(check); + return; } + // Not a built-in python type. + allowedTypes.push(type); + + // Type Aliases + const alias = getAlias(type); + if (alias) { + collectAllowedTypesForSetCheck(alias, allowedTypes); + } + + // Subclasses const subclassNames = getSubclassNames(type); if (subclassNames) { - return subclassNames; + for (const subclassName of subclassNames) { + collectAllowedTypesForSetCheck(subclassName, allowedTypes); + } } - - return [type]; } -export function getCheckForBuiltInType(type: string): string { - // If type is a built-in python type, return the blockly check for it. +// If type is a built-in python type, this function returns the blockly check for it. +function getCheckForBuiltInType(type: string): string { if (type === 'bool') { return 'Boolean'; } @@ -92,6 +205,7 @@ export function getCheckForBuiltInType(type: string): string { return ''; } +// Returns the output check for the given type. export function getOutputCheck(type: string): string { // For the given python type, returns the output type. if (type === 'None') { @@ -104,7 +218,7 @@ export function getOutputCheck(type: string): string { return getOutputCheck(alias); } - // Builtin python types. + // Built-in python types. const check = getCheckForBuiltInType(type); if (check) { return check; @@ -133,4 +247,4 @@ export function getLegalName(proposedName: string, existingNames: string[]){ } } return newName; -} \ No newline at end of file +} diff --git a/src/blocks/utils/python_json_types.ts b/src/blocks/utils/python_json_types.ts new file mode 100644 index 00000000..2232a3b8 --- /dev/null +++ b/src/blocks/utils/python_json_types.ts @@ -0,0 +1,102 @@ +/** + * @license + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author lizlooney@google.com (Liz Looney) + */ + +// Types and functions used when reading generated/*.json + +export class PythonData { + modules: ModuleData[] = []; + classes: ClassData[] = []; + aliases: {[key: string]: string} = {}; + subclasses: {[key: string]: string[]} = {}; +} + +export class ModuleData { + moduleName: string = ''; + moduleVariables: VarData[] = []; + functions: FunctionData[] = []; + enums: EnumData[] = []; +} + +export class ClassData { + className: string = ''; + moduleName: string = ''; + classVariables: VarData[] = []; + instanceVariables: VarData[] = []; + constructors: FunctionData[] = []; + instanceMethods: FunctionData[] = []; + staticMethods: FunctionData[] = []; + enums: EnumData[] = []; +} + +export class VarData { + name: string = ''; + type: string = ''; + writable: boolean = false; + tooltip: string = ''; +} + +export class FunctionData { + functionName: string = ''; + tooltip: string = ''; + returnType: string = ''; + args: ArgData[] = []; + declaringClassName?: string = ''; +} + +export class ArgData { + name: string = ''; + type: string = ''; + defaultValue: string = ''; +} + +export class EnumData { + enumClassName: string = ''; + moduleName: string = ''; + enumValues: string[] = []; + tooltip: string = ''; +} + +export class VariableGettersAndSetters { + varNamesForGetter: string[] = []; + tooltipsForGetter: string[] = []; + varNamesForSetter: string[] = []; + tooltipsForSetter: string[] = []; +} + +export function organizeVarDataByType(vars: VarData[]): {[key: string]: VariableGettersAndSetters} { + const varsByType: {[key: string]: VariableGettersAndSetters} = {} + for (const varData of vars) { + let variableGettersAndSetters: VariableGettersAndSetters; + if (varData.type in varsByType) { + variableGettersAndSetters = varsByType[varData.type]; + } else { + variableGettersAndSetters = new VariableGettersAndSetters(); + varsByType[varData.type] = variableGettersAndSetters; + } + variableGettersAndSetters.varNamesForGetter.push(varData.name); + variableGettersAndSetters.tooltipsForGetter.push(varData.tooltip); + if (varData.writable) { + variableGettersAndSetters.varNamesForSetter.push(varData.name); + variableGettersAndSetters.tooltipsForSetter.push(varData.tooltip); + } + } + return varsByType; +} diff --git a/src/blocks/utils/robotpy_data.ts b/src/blocks/utils/robotpy_data.ts index 6556151c..aba9d152 100644 --- a/src/blocks/utils/robotpy_data.ts +++ b/src/blocks/utils/robotpy_data.ts @@ -19,86 +19,7 @@ * @author lizlooney@google.com (Liz Looney) */ +import { PythonData } from './python_json_types'; import generatedRobotPyData from './generated/robotpy_data.json'; -export const robotPyData = generatedRobotPyData as RobotPyData; - -export class RobotPyData { - modules: ModuleData[] = []; - classes: ClassData[] = []; - aliases: {[key: string]: string} = {}; - subclasses: {[key: string]: string[]} = {}; -} - -export class ModuleData { - moduleName: string = ''; - moduleVariables: VarData[] = []; - functions: FunctionData[] = []; - enums: EnumData[] = []; -} - -export class ClassData { - className: string = ''; - moduleName: string = ''; - classVariables: VarData[] = []; - instanceVariables: VarData[] = []; - constructors: FunctionData[] = []; - instanceMethods: FunctionData[] = []; - staticMethods: FunctionData[] = []; - enums: EnumData[] = []; -} - -export class VarData { - name: string = ''; - type: string = ''; - writable: boolean = false; - tooltip: string = ''; -} - -export class FunctionData { - functionName: string = ''; - tooltip: string = ''; - returnType: string = ''; - args: ArgData[] = []; - declaringClassName?: string = ''; -} - -export class ArgData { - name: string = ''; - type: string = ''; - defaultValue: string = ''; -} - -export class EnumData { - enumClassName: string = ''; - moduleName: string = ''; - enumValues: string[] = []; - tooltip: string = ''; -} - -export class VariableGettersAndSetters { - varNamesForGetter: string[] = []; - tooltipsForGetter: string[] = []; - varNamesForSetter: string[] = []; - tooltipsForSetter: string[] = []; -} - -export function organizeVarDataByType(vars: VarData[]): {[key: string]: VariableGettersAndSetters} { - const varsByType: {[key: string]: VariableGettersAndSetters} = {} - for (const varData of vars) { - let variableGettersAndSetters: VariableGettersAndSetters; - if (varData.type in varsByType) { - variableGettersAndSetters = varsByType[varData.type]; - } else { - variableGettersAndSetters = new VariableGettersAndSetters(); - varsByType[varData.type] = variableGettersAndSetters; - } - variableGettersAndSetters.varNamesForGetter.push(varData.name); - variableGettersAndSetters.tooltipsForGetter.push(varData.tooltip); - if (varData.writable) { - variableGettersAndSetters.varNamesForSetter.push(varData.name); - variableGettersAndSetters.tooltipsForSetter.push(varData.tooltip); - } - } - return varsByType; -} +export const robotPyData = generatedRobotPyData as PythonData; diff --git a/src/blocks/utils/robotpy_initialize.ts b/src/blocks/utils/robotpy_initialize.ts deleted file mode 100644 index 630b7599..00000000 --- a/src/blocks/utils/robotpy_initialize.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @author lizlooney@google.com (Liz Looney) - */ - -import { robotPyData, organizeVarDataByType, VariableGettersAndSetters } from './robotpy_data'; - -import * as pythonEnum from "../mrc_get_python_enum_value"; -import * as getPythonVariable from "../mrc_get_python_variable"; -import * as setPythonVariable from "../mrc_set_python_variable"; - -export function initialize() { - // Process RobotPy modules. - for (const moduleData of robotPyData.modules) { - // Initialize enums. - for (const enumData of moduleData.enums) { - pythonEnum.initializeEnum(enumData.enumClassName, enumData.enumValues, enumData.tooltip); - } - - // Initialize module variables. - const varsByType: {[key: string]: VariableGettersAndSetters} = - organizeVarDataByType(moduleData.moduleVariables); - for (const varType in varsByType) { - const variableGettersAndSetters = varsByType[varType]; - getPythonVariable.initializeModuleVariableGetter( - moduleData.moduleName, - varType, - variableGettersAndSetters.varNamesForGetter, - variableGettersAndSetters.tooltipsForGetter); - if (variableGettersAndSetters.varNamesForSetter.length) { - setPythonVariable.initializeModuleVariableSetter( - moduleData.moduleName, - varType, - variableGettersAndSetters.varNamesForSetter, - variableGettersAndSetters.tooltipsForSetter); - } - } - } - - // Process RobotPy classes. - for (const classData of robotPyData.classes) { - // Initialize enums. - for (const enumData of classData.enums) { - pythonEnum.initializeEnum(enumData.enumClassName, enumData.enumValues, enumData.tooltip); - } - - // Initialize instance variables. - if (classData.instanceVariables.length) { - const varsByType: {[key: string]: VariableGettersAndSetters} = - organizeVarDataByType(classData.instanceVariables); - for (const varType in varsByType) { - const variableGettersAndSetters = varsByType[varType]; - getPythonVariable.initializeInstanceVariableGetter( - classData.className, - varType, - variableGettersAndSetters.varNamesForGetter, - variableGettersAndSetters.tooltipsForGetter); - if (variableGettersAndSetters.varNamesForSetter.length) { - setPythonVariable.initializeInstanceVariableSetter( - classData.className, - varType, - variableGettersAndSetters.varNamesForSetter, - variableGettersAndSetters.tooltipsForSetter); - } - } - } - - // Initialize class variables. - if (classData.classVariables.length) { - const varsByType: {[key: string]: VariableGettersAndSetters} = - organizeVarDataByType(classData.classVariables); - for (const varType in varsByType) { - const variableGettersAndSetters = varsByType[varType]; - getPythonVariable.initializeClassVariableGetter( - classData.className, - varType, - variableGettersAndSetters.varNamesForGetter, - variableGettersAndSetters.tooltipsForGetter); - if (variableGettersAndSetters.varNamesForSetter.length) { - setPythonVariable.initializeClassVariableSetter( - classData.className, - varType, - variableGettersAndSetters.varNamesForSetter, - variableGettersAndSetters.tooltipsForSetter); - } - } - } - } -} diff --git a/src/editor/editor.ts b/src/editor/editor.ts index b9e9c728..3f4b5ac7 100644 --- a/src/editor/editor.ts +++ b/src/editor/editor.ts @@ -25,6 +25,7 @@ import { extendedPythonGenerator } from './extended_python_generator'; import { GeneratorContext } from './generator_context'; import * as commonStorage from '../storage/common_storage'; import { getToolboxJSON } from '../toolbox/toolbox'; +//import { testAllBlocksInToolbox } from '../toolbox/toolbox_tests'; import { MethodsCategory} from '../toolbox/methods_category'; @@ -165,6 +166,7 @@ export class Editor { if (toolbox != this.toolbox) { this.toolbox = toolbox; this.blocklyWorkspace.updateToolbox(toolbox); + //testAllBlocksInToolbox(); } } @@ -194,9 +196,9 @@ export class Editor { }, 50); return; } - const exportedBlocks = commonStorage.extractExportedBlocks( + const robotBlocks = commonStorage.extractExportedBlocks( this.currentModule.projectName, this.projectContent); - this.setToolbox(getToolboxJSON(exportedBlocks, shownPythonToolboxCategories)); + this.setToolbox(getToolboxJSON(robotBlocks, shownPythonToolboxCategories)); } } diff --git a/src/toolbox/robotpy_toolbox.ts b/src/toolbox/robotpy_toolbox.ts index 8f75f09a..e07de0ce 100644 --- a/src/toolbox/robotpy_toolbox.ts +++ b/src/toolbox/robotpy_toolbox.ts @@ -29,19 +29,21 @@ import { addInstanceMethodBlocks, addModuleFunctionBlocks, addStaticMethodBlocks } from '../blocks/mrc_call_python_function'; +import { robotPyData } from '../blocks/utils/robotpy_data'; import { - robotPyData, ClassData, ModuleData, organizeVarDataByType, - VariableGettersAndSetters } from '../blocks/utils/robotpy_data'; + VariableGettersAndSetters } from '../blocks/utils/python_json_types'; import * as toolboxItems from './items'; export function getToolboxCategories(): toolboxItems.Category[] { const contents: toolboxItems.Category[] = []; - const mapPathToCategory: {[key: string]: toolboxItems.Category} = {}; + const allCategories: {[key: string]: toolboxItems.Category} = {}; + const moduleCategories: {[key: string]: toolboxItems.Category} = {}; + const classCategories: {[key: string]: toolboxItems.Category} = {}; // Process RobotPy modules. for (const moduleData of robotPyData.modules) { @@ -56,14 +58,14 @@ export function getToolboxCategories(): toolboxItems.Category[] { }; moduleCategory.contents = []; addModuleBlocks(moduleData, moduleCategory.contents); - mapPathToCategory[path] = moduleCategory; + allCategories[path] = moduleCategory; + moduleCategories[path] = moduleCategory; } // Process RobotPy classes. for (const classData of robotPyData.classes) { const path = classData.className; const lastDot = path.lastIndexOf('.'); - const parentPath = (lastDot != -1) ? path.substring(0, lastDot) : ''; const name = (lastDot != -1) ? path.substring(lastDot + 1) : path; const classCategory: toolboxItems.PythonClassCategory = { @@ -73,33 +75,17 @@ export function getToolboxCategories(): toolboxItems.Category[] { }; classCategory.contents = []; addClassBlocks(classData, classCategory.contents); - mapPathToCategory[path] = classCategory; - if (parentPath) { - const parentCategory = mapPathToCategory[parentPath]; - if (parentCategory.contents) { - parentCategory.contents.push(classCategory); - } - } else { - contents.push(classCategory); - } + allCategories[path] = classCategory; + classCategories[path] = classCategory; } - for (const path in mapPathToCategory) { - const category = mapPathToCategory[path]; - if ('className' in category) { - continue; - } - const lastDot = path.lastIndexOf('.'); - const parentPath = (lastDot != -1) ? path.substring(0, lastDot) : ''; - if (parentPath) { - const parentCategory = mapPathToCategory[parentPath]; - if (parentCategory.contents) { - parentCategory.contents.push(category); - } - } else { - contents.push(category); - } - } + // Build the tree. + // First add each class category to its parent. + addCategoriesToParents(classCategories, allCategories, contents); + // Then add module categories. + addCategoriesToParents(moduleCategories, allCategories, contents); + + recursivelyRemoveEmptyCategories(contents); return contents; } @@ -154,3 +140,38 @@ function addClassBlocks(classData: ClassData, contents: toolboxItems.ContentsTyp addEnumBlocks(classData.enums, contents); } } + +function addCategoriesToParents( + categoriesToProcess: {[key: string]: toolboxItems.Category}, + allCategories: {[key: string]: toolboxItems.Category}, + contents: toolboxItems.Category[]) { + for (const path in categoriesToProcess) { + const category = categoriesToProcess[path]; + const lastDot = path.lastIndexOf('.'); + const parentPath = (lastDot != -1) ? path.substring(0, lastDot) : ''; + if (parentPath) { + const parentCategory = allCategories[parentPath]; + if (parentCategory.contents) { + parentCategory.contents.push(category); + } + } else { + contents.push(category); + } + } +} + +function recursivelyRemoveEmptyCategories(contents: toolboxItems.ContentsType[]) { + for (let i = contents.length - 1; i >= 0; i--) { + if (contents[i].kind === 'category') { + const category = contents[i] as toolboxItems.Category; + if (category.contents) { + if (category.contents.length) { + recursivelyRemoveEmptyCategories(category.contents); + } + if (category.contents.length == 0) { + contents.splice(i, 1); + } + } + } + } +} diff --git a/src/toolbox/toolbox.ts b/src/toolbox/toolbox.ts index a456ed45..218505d5 100644 --- a/src/toolbox/toolbox.ts +++ b/src/toolbox/toolbox.ts @@ -31,15 +31,15 @@ import {category as methodsCategory} from './methods_category'; import {category as componentSampleCategory} from './component_samples_category'; export function getToolboxJSON( - opt_includeExportedBlocksFromProject: toolboxItems.ContentsType[], + opt_robotBlocks: toolboxItems.ContentsType[], shownPythonToolboxCategories: Set | null) { const contents: toolboxItems.ContentsType[] = []; const robotPyCategories: toolboxItems.ContentsType[] = robotPyToolbox.getToolboxCategories(); - filterGeneratedCategories(robotPyCategories, shownPythonToolboxCategories); + filterRobotPyCategories(robotPyCategories, shownPythonToolboxCategories); contents.push.apply(contents, robotPyCategories); - if (opt_includeExportedBlocksFromProject.length) { + if (opt_robotBlocks.length) { contents.push.apply( contents, [ @@ -49,7 +49,7 @@ export function getToolboxJSON( { kind: 'category', name: 'Project', - contents: opt_includeExportedBlocksFromProject, + contents: opt_robotBlocks, }, ]); } @@ -85,14 +85,14 @@ export function getToolboxJSON( }; } -function filterGeneratedCategories( +function filterRobotPyCategories( contents: toolboxItems.ContentsType[], shownPythonToolboxCategories: Set | null) { contents.forEach((item) => { if (item.kind === 'category') { const category = item as toolboxItems.Category; // Traverse the tree depth-first so we can easily identify and remove empty categories. if (category.contents) { - filterGeneratedCategories(category.contents, shownPythonToolboxCategories); + filterRobotPyCategories(category.contents, shownPythonToolboxCategories); } if ((category as toolboxItems.PythonModuleCategory).moduleName) { const moduleName = (item as toolboxItems.PythonModuleCategory).moduleName;