diff --git a/cdn/ServiceDock_scaled.js b/cdn/ServiceDock_scaled.js new file mode 100644 index 0000000..597884f --- /dev/null +++ b/cdn/ServiceDock_scaled.js @@ -0,0 +1,5996 @@ +/* +Project Name: SPIKE Prime Web Interface +File name: ServiceDock_SystemLink.js +Author: Jeremy Jung +Last update: 7/19/20 +Description: HTML Element definition for to be used in ServiceDocks +Credits/inspirations: +History: + Created by Jeremy on 7/16/20 +LICENSE: MIT +(C) Tufts Center for Engineering Education and Outreach (CEEO) +*/ + +// import { Service_SystemLink } from "./Service_SystemLink.js"; + +class servicesystemlink extends HTMLElement { + + constructor () { + + super(); + + this.active = false; // whether the service was activated + this.service = new Service_SystemLink(); // instantiate a service object ( one object per button ) + this.proceed = false; // if there are credentials input + + // Create a shadow root + var shadow = this.attachShadow({ mode: 'open' }); + + /* wrapper definition and CSS */ + var wrapper = document.createElement('div'); + wrapper.setAttribute('class', 'wrapper'); + wrapper.setAttribute("style", "width: 50px; height: 50px; position: relative; margin-top: 10px;") + + /* ServiceDock button definition and CSS */ + + var button = document.createElement("button"); + button.setAttribute("id", "sl_button"); + button.setAttribute("class", "SD_button"); + + /* CSS */ + //var imageRelPath = "./modules/views/systemlinkIcon.png" // relative to the document in which a servicesystemlink is created ( NOT this file ) + var length = 50; // for width and height of button + var backgroundColor = "#A2E1EF" // background color of the button + var buttonStyle = "width:" + length + "px; height:" + length + "px; background:" + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN4AAADiCAYAAAAh33lhAAAgAElEQVR4Xu29CZglR30n+I/MfO9V1au7q6q7pb67EboFuoUQqJGA+WwzXq/tXY+ZWZudnQEkcVhgZtccQh4DAmyMx8yxXpsZG2yQQGAECCSEJIRAQrC6r767uo7uOrru4x2ZEfNFZGZkZOTLiMz3XlVXVWd+nz71q4yMjIiMX/x//yP+gSC7shHIRmDVRwCt+huzF2YjkI0AKIFHCDEB3DKHDx82N22abUFonv1eXl6wCoVKC5RMRAomrlYXchY2C/QeweCQvFVEVR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uqgBUr6jSCjFC1NCcJwhVGC+n9xA4gBCrF9F7BFU9nZQylBwhUAUDESDERFS3oM9iyl4wq9fTMRDCbO+WS4sIaxPVQ1j7EW0T0zdc/RURcMt6fWV6B3EpFaL6ChC3b4hqd6wNbr2ADQJA+1pmmh9BOWKAzTRor15EqRlhGjJttYW8ZwlibRDKohyidNLTrwhCOQSkzN5C/41JmdXLvi0dCrxE9T6qsDmAHATElUyIIIMYrp6GCfL+v+SaFhANAKkiREpAaNOpguYsArIwOBiZyHBsvx46txyj6hCHtYFeVTNfsjC1L9AXW46RNzi1LJUr1da2IqfDp2cXq+P97vy4ceJCAr/7u9ydsOJUs/ayvDH+GqLRAHDnnXfyReWOO/iBSn5nQ26YRx99lP/u6OgI3WttpfgPrgsv5Bv+4fDhw6F7+/btCw3m8ePHVSnUYgd+165dIVl5+PDhUNl9+/bx+y+/zK3grMzy8nLo2fn5+dDvG2+8MWSrFCu+8847Q++54447eNl6JufGmFm1e1HXh92IA5IBz/2qGfBWZ3b/TyGfC2ZAxZClAAAAAElFTkSuQmCC')" + "no-repeat; background-size: 50px 50px; background-color:" + backgroundColor + + "; border: none; background-position: center; cursor: pointer; border-radius: 10px; position: relative; margin: 4px 0px; " + button.setAttribute("style", buttonStyle); + + /* status circle definition and CSS */ + + this.status = document.createElement("div"); + this.status.setAttribute("class", "status"); + + /* CSS */ + var length = 20; // for width and height of circle + var statusBackgroundColor = "red" // default background color of service (inactive color) + var posLeft = 30; + var posTop = 20; + var statusStyle = "border-radius: 50%; height:" + length + "px; width:" + length + "px; background-color:" + statusBackgroundColor + + "; position: relative; left:" + posLeft + "px; top:" + posTop + "px;"; + this.status.setAttribute("style", statusStyle); + + /* event listeners */ + + button.addEventListener("mouseleave", function (event) { + button.style.backgroundColor = "#A2E1EF"; + button.style.color = "#000000"; + }); + + button.addEventListener("mouseenter", function(event){ + button.style.backgroundColor = "#FFFFFF"; + button.style.color = "#000000"; + }) + + this.addEventListener("click", async function() { + + if ( !this.active ) { + this.popUpBox(); + } + + // check active flag so once activated, the service doesnt reinit + if ( !this.active && this.proceed) { + + console.log("%cTuftsCEEO ", "color: #3ba336;", "Activating SystemLink Service"); + + var initSuccessful = await this.service.init(this.APIKey); + + if (initSuccessful) { + this.active = true; + this.status.style.backgroundColor = "green"; + } + + } + + }); + + shadow.appendChild(wrapper); + button.appendChild(this.status); + wrapper.appendChild(button); + } + + /* Ask user for API credentials */ + popUpBox() { + var APIKeyExists = true; + // if apikey was not given in attributes + if (this.getAttribute("apikey") == undefined || this.getAttribute("apikey") == "") { + var APIKeyResult = prompt("Please enter your System Link Cloud API Key:"); + + // APIkey + if (APIKeyResult == null || APIKeyResult == "") { + console.log("%cTuftsCEEO ", "color: #3ba336;", "You inserted no API key"); + APIKeyExists = false; + } + else { + this.APIKey = APIKeyResult; + } + } + else { + var APIKeyResult = this.getAttribute("apikey"); + this.APIKey = APIKeyResult; + } + + + if ( APIKeyExists ) { + this.proceed = true; + } + } + + /* for Service's API credentials */ + + static get observedAttributes() { + return ["apikey"]; + } + + get apikey() { + return this.getAttribute("apikey"); + } + + set apikey(val) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", val); + if ( val ) { + this.setAttribute("apikey", val); + } + else { + this.removeAttribute("apikey"); + } + } + + attributeChangedCallback (name, oldValue, newValue) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "new value of apikey: ", newValue); + this.APIKey = newValue; + } + + /* get the Service_SystemLink object */ + getService() { + return this.service; + } + + /* get whether the ServiceDock button was clicked */ + getClicked() { + return this.active; + } + + // initialize the service (is not used in this class but available for use publicly) + async init() { + var initSuccess = await this.service.init(this.APIKey); + if (initSuccess) { + this.status.style.backgroundColor = "green"; + this.active = true; + return true; + } + else { + return false; + } + } + +} + +// when defining custom element, the name must have at least one - dash +window.customElements.define('service-systemlink', servicesystemlink); + +/* +Project Name: SPIKE Prime Web Interface +File name: Service_SystemLink.js +Author: Jeremy Jung +Last update: 8/04/20 +Description: SystemLink Service Library (OOP) +History: + Created by Jeremy on 7/15/20 +LICENSE: MIT +(C) Tufts Center for Engineering Education and Outreach (CEEO) +*/ + +/** + * + * @class Service_SystemLink + * @example + * // assuming you declared with the id, "service_systemlink" + * var mySL = document.getElemenyById("service_systemlink").getService(); + * mySL.setAttribute("apikey", "YOUR API KEY"); + * mySL.init(); + */ +function Service_SystemLink() { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + /* private members */ + + let tagsInfo = {}; // contains real-time information of the tags in the cloud + + let APIKey = "API KEY"; + + let serviceActive = false; // set to true when service goes through init + + let pollInterval = 1000; + + var funcAtInit = undefined; // function to call after init + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + + /** initialize SystemLink_Service + *

Starts polling the System Link cloud

+ *

this function needs to be executed after executeAfterInit but before all other public functions

+ * + * @public + * @param {string} APIKeyInput SYstemlink APIkey + * @param {integer} pollIntervalInput interval at which to get tags from the cloud in MILISECONDS. Default value is 1000 ms. + * @returns {boolean} True if service was successsfully initialized, false otherwise + * @example + * var SystemLinkElement = document.getElemenyById("service_systemlink"); + * var mySL = SystemLinkElement.getService(); + * mySL.init("APIKEY", 1000); // initialize SystemLink Service with a poll interval of 10 ms + * + */ + async function init(APIKeyInput, pollIntervalInput) { + + // if an APIKey was specified + if (APIKeyInput !== undefined) { + APIKey = APIKeyInput; + } + + var response = await checkAPIKey(APIKey); + + // if response from checkAPIKey is valid + if (response) { + + if (pollIntervalInput !== undefined) { + pollInterval = await pollIntervalInput; + } + + // initialize the tagsInfo global variable + updateTagsInfo(function () { + + serviceActive = true; + + // call funcAtInit if defined + if (funcAtInit !== undefined) { + + funcAtInit(); + } + }); + + return true; + } + else { + return false; + } + } + + /** Get the callback function to execute after service is initialized + *

This function needs to be executed before calling init()

+ * + * @public + * @param {function} callback function to execute after initialization + * @example + * mySL.executeAfterInit( function () { + * var tagsInfo = mySL.getTagsInfo(); + * }) + */ + function executeAfterInit(callback) { + // Assigns global variable funcAtInit a pointer to callback function + funcAtInit = callback; + } + + /** Return the tagsInfo global variable + * + * @public + * @returns basic information about currently existing tags in the cloud + * @example + * var tagsInfo = mySL.getTagsInfo(); + * var astringValue = tagsInfo["astring"]["value"]; + * var astringType = tagsInfo["astring"]["type"]; + */ + function getTagsInfo() { + return tagsInfo; + } + + /** Change the current value of a tag on SystemLink cloud. + * + * @private + * @param {string} name name of tag to update + * @param {any} value new value's data type must match the Tag's data type. + * @param {function} callback function to execute after tag is updated + * @example + * // set a string type Value of a Tag and display + * mySL.setTagValue("message", "hello there", function () { + * let messageValue = mySL.getTagValue("message"); + * console.log("message: ", messageValue); // display the updated value + * }) + * // set value of a boolean Tag + * mySL.setTagValue("aBoolean", true); + * + * // set value of an integer Tag + * mySL.setTagValue("anInteger", 10); + * + * // set value of a double Tag + * mySL.setTagValue("aDouble", 5.2); + */ + function setTagValue(tagName, newValue, callback) { + // changes the value of a tag on the cloud + setTagValueStrict(tagName, newValue, callback); + } + + /** Change the current value of a tag on SystemLink cloud with strict data types. Values will be implicitly converted + *
+ * NotStrict property indicates that the data type of the Value supplied will be implicitly converted. For example, allowing for setting an INT tag's value with a string, "123" or a STRING tag's value with + * a number. This method exists for convenience but please avoid using it extensively as it can lead to unpredictable outcomes. + * @public + * @param {any} tagName + * @param {any} newValue + * @param {any} callback + * @example + * // set a string type Value of a Tag and display + * mySL.setTagValueNotStrict("message", 123, function () { + * let messageValue = mySL.getTagValue("message"); + * console.log("message: ", messageValue); // display the updated value, which will be 123. + * }) + * // set value of a boolean Tag + * mySL.setTagValueNotStrict("aBoolean", true); + * + * // set value of an integer Tag + * mySL.setTagValueNotStrict("anInteger", 10); + * mySL.setTagValueNotStrict("anInteger", "10"); + * + * // set value of a double Tag + * mySL.setTagValueNotStrict("aDouble", 5.2); + * mySL.setTagValueNotStrict("aDouble", "5.2"); + */ + function setTagValueNotStrict(tagName, newValue, callback) { + // changes the value of a tag on the cloud + changeValue(tagName, newValue, false, function (valueChanged) { + if (valueChanged) { + // wait for changed value to be retrieved + setTimeout(function () { + if (typeof callback === 'function') { + callback(); + } + }, 1000) + } + }); + } + + /** Change the current value of a tag on SystemLink cloud with strict data types. There will be no implicit data type conversions. E.g. Updating tags of INT type will only work with javascript number. + * + * @public + * @param {any} name name of tag to update + * @param {any} value value to update tag to + * @param {any} callback function to execute after tag is updated + * @example + * // set a string type Value of a Tag and display + * mySL.setTagValueStrict("message", "hello there", function () { + * let messageValue = mySL.getTagValue("message"); + * console.log("message: ", messageValue); // display the updated value + * }) + * // set value of a boolean Tag + * mySL.setTagValueStrict("aBoolean", true); + * + * // set value of an integer Tag + * mySL.setTagValueStrict("anInteger", 10); + * + * // set value of a double Tag + * mySL.setTagValueStrict("aDouble", 5.2); + */ + function setTagValueStrict(tagName, newValue, callback) { + // changes the value of a tag on the cloud + changeValue(tagName, newValue, true, function (valueChanged) { + if (valueChanged) { + // wait for changed value to be retrieved + setTimeout(function () { + if (typeof callback === 'function') { + callback(); + } + }, 1000) + } + }); + } + + + /** Get the current value of a tag on SystemLink cloud + * + * @public + * @param {string} tagName + * @returns {any} current value of tag + * @example + * messageValue = mySL.getTagValue("message"); + * console.log("message: ", messageValue); + */ + function getTagValue(tagName) { + + var currentValue = tagsInfo[tagName].value; + + return currentValue; + } + + /** Get whether the Service was initialized or not + * + * @public + * @returns {boolean} whether Service was initialized or not + * @example + * if (mySL.isActive() === true) + * // do something if SystemLink Service is active + */ + function isActive() { + return serviceActive; + } + + /** Change the APIKey + * @ignore + * @param {string} APIKeyInput + */ + function setAPIKey(APIKeyInput) { + // changes the global variable APIKey + APIKey = APIKeyInput; + } + + /** Create a new tag. The type of new tag is determined by the javascript data type of tagValue. + * @public + * @param {string} tagName name of tag to create + * @param {any} tagValue value to assign the tag after creation + * @param {function} callback optional callback + * @example + * mySL.createTag("message", "hi", function () { + * mySL.setTagValueStrict("message", "bye"); // change the value of 'message' from "hi" to "bye" + * }) + */ + function createTag(tagName, tagValue, callback) { + + // get the SystemLink formatted data type of tag + var valueType = getValueType(tagValue); + + // create a tag with the name and data type. If tag exists, it still returns successful response + createNewTagHelper(tagName, valueType, function (newTagCreated) { + + // after tag is created, assign a value to it + changeValue(tagName, tagValue, false, function (newTagValueAssigned) { + + // execute callback if successful + if (newTagCreated) { + if (newTagValueAssigned) { + // wait for changed value to be retrieved + setTimeout( function() { + if (typeof callback == 'function') { + callback(); + } + }, 1000) + } + } + }) + }) + } + + /** Delete tag + * + * @public + * @param {string} tagName name of tag to delete + * @param {function} callback optional callback + * @example + * mySL.deleteTag("message", function () { + * let tagsInfo = mySL.getTagsInfo(); + * console.log("tagsInfo: ", tagsInfo); // tags information will now not contain the 'message' tag + * }) + */ + function deleteTag(tagName, callback) { + // delete the tag on System Link cloud + deleteTagHelper(tagName, function (tagDeleted) { + if ( tagDeleted ) { + typeof callback === 'function' && callback(); + } + }); + } + + ////////////////////////////////////////// + // // + // Private Functions // + // // + ////////////////////////////////////////// + + /** sleep function + * + * @private + * @param {integer} ms + * @returns {Promise} + */ + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + /** Check if Systemlink API key is valid for use + * + * @private + * @param {string} APIKeyInput + * @returns {Promise} resolve(true) or reject(error) + */ + async function checkAPIKey(APIKeyInput) { + return new Promise(async function (resolve, reject) { + var apiKeyAuthURL = "https://api.systemlinkcloud.com/niauth/v1/auth"; + + var request = await sendXMLHTTPRequest("GET", apiKeyAuthURL, APIKeyInput) + + request.onload = function () { + + var response = JSON.parse(request.response); + + if (response.error) { + reject(new Error("Error at apikey auth:", response)); + } + else { + console.log("%cTuftsCEEO ", "color: #3ba336;", "APIkey is valid") + resolve(true) + } + + } + + request.onerror = function () { + var response = JSON.parse(request.response); + // console.log("Error at apikey auth:", request.response); + reject(new Error("Error at apikey auth:", response)); + } + }) + } + + /** Assign list of tags existing in the cloud to {tagPaths} global variable + * + * @private + * @param {function} callback + */ + async function updateTagsInfo(callback) { + + // get the tags the first time before running callback + getTagsInfoFromCloud(function (collectedTagsInfo) { + + // if the collectedTagsInfo is defined and not boolean false + if (collectedTagsInfo) { + tagsInfo = collectedTagsInfo; + } + + // after tagsInfo is initialized, begin the interval to update it + setInterval(async function () { + + getTagsInfoFromCloud(function (collectedTagsInfo) { + + // if the object is defined and not boolean false + if (collectedTagsInfo) { + tagsInfo = collectedTagsInfo; + } + }); + + }, pollInterval) + + // run the callback of updateTagsInfo inside init() + callback(); + + }); + + } + + /** Get the info of a tag in the cloud + * + * @private + * @param {function} callback + */ + async function getTagsInfoFromCloud(callback) { + + // make a new promise + new Promise(async function (resolve, reject) { + + var collectedTagsInfo = {}; // to return + + var getMultipleTagsURL = "https://api.systemlinkcloud.com/nitag/v2/tags-with-values"; + + // send request to SystemLink API + var request = await sendXMLHTTPRequest("GET", getMultipleTagsURL, APIKey); + + // when transaction is complete, parse response and update return value (collectedTagsInfo) + request.onload = async function () { + + // parse response (string) into JSON object + var responseJSON = JSON.parse(this.response) + + var tagsInfoArray = responseJSON.tagsWithValues; + + // get total number of tags + var tagsAmount = responseJSON.totalCount; + + for (var i = 0; i < tagsAmount; i++) { + // parse information of the tags + + try { + var value = tagsInfoArray[i].current.value.value; + var valueType = tagsInfoArray[i].current.value.type; + var tagName = tagsInfoArray[i].tag.path; + + var valueToAdd = await getValueFromType(valueType, value); + + // store tag information + var pathInfo = {}; + pathInfo["value"] = valueToAdd; + pathInfo["type"] = valueType; + + // add a tag info to the return object + collectedTagsInfo[tagName] = pathInfo; + + } + // when value is not yet assigned to tag + catch (e) { + var value = null + var valueType = tagsInfoArray[i].tag.type; + var tagName = tagsInfoArray[i].tag.path; + + // store tag information + var pathInfo = {}; + pathInfo["value"] = value; + pathInfo["type"] = valueType; + + // add a tag info to the return object + collectedTagsInfo[tagName] = pathInfo; + } + } + + resolve(collectedTagsInfo) + + } + request.onerror = function () { + + console.log("%cTuftsCEEO ", "color: #3ba336;", this.response); + + reject(false); + + } + }).then( + // success handler + function (resolve) { + //run callback with resolve object + callback(resolve); + }, + // failure handler + function (reject) { + // run calllback with reject object + callback(reject); + } + ) + } + + /** Send PUT request to SL cloud API and change the value of a tag + * This function will receive a newValue of any kind of type. Before the POST request is sent, + * the SL data type of the tag to convert must be found, and newValue must be in string format + * @private + * @param {string} tagPath string of the name of the tag + * @param {any} newValue value to assign tag + * @param {function} callback + */ + async function changeValue(tagPath, newValue, strict, callback) { + new Promise(async function (resolve, reject) { + + var URL = "https://api.systemlinkcloud.com/nitag/v2/tags/" + tagPath + "/values/current"; + + // assume newValue is already in correct datatype and just give the data type in SystemLink format + //var valueType = getValueType(newValue); + var valueType; + var newValueStringified; + + // if Tag to change does not yet exist (possibly due to it being created very recently) + if (tagsInfo[tagPath] === undefined) { + // refer to newValue's JS type to deduce Tag's data type + valueType = getValueTypeStrict(newValue); + } + // Tag to change exists; find the SL data type of tag from locally stored tagsInfo + else { + if (strict === true) { + /* strict changeValue. So no implicit data type conversions. All newValue's types need to match the tag's type */ + + expectedValueType = tagsInfo[tagPath].type; + inputValueType = getValueTypeStrict(newValue); + // console.log("%cTuftsCEEO ", "color: #3ba336;", expectedValueType, " vs ", inputValueType); + if (inputValueType !== expectedValueType) { + console.error("%cTuftsCEEO ", "color: #3ba336;", "Could not update value of tag on SystemLink Cloud. The given value is not of the data type defined for the tag in the database"); + throw new Error("Could not update value of tag on SystemLink Cloud.The given value is not of the data type defined for the tag in the database"); + } + else { + valueType = tagsInfo[tagPath].type; + } + } + else { + valueType = tagsInfo[tagPath].type; + } + } + + newValueStringified = changeToString(newValue); + + var data = { "value": { "type": valueType, "value": newValueStringified } }; + var requestBody = data; + + var request = await sendXMLHTTPRequest("PUT", URL, APIKey, requestBody); + + request.onload = function () { + resolve(true); + } + + request.onerror = function () { + reject(false); + } + + // catch error + request.onreadystatechange = function () { + if (this.readyState === XMLHttpRequest.DONE && (this.status != 200) ) { + console.log("%cTuftsCEEO ", "color: #3ba336;", this.status + " Error at changeValue: ", this.response) + } + } + + + }).then( + // success handler + function (resolve) { + callback(resolve); + }, + function (reject) { + callback(reject); + } + ) + } + + /** Send PUT request to SL cloud API and change the value of a tag + * + * @private + * @param {string} tagPath name of the tag + * @param {string} tagType SystemLink format data type of tag + * @param {function} callback + */ + async function createNewTagHelper(tagPath, tagType, callback) { + new Promise(async function (resolve, reject) { + + var URL = "https://api.systemlinkcloud.com/nitag/v2/tags/"; + + var data = { "type": tagType, "properties": {}, "path": tagPath, "keywords": [], "collectAggregates": false }; + + var requestBody = data; + + var request = await sendXMLHTTPRequest("POST", URL, APIKey, requestBody); + + request.onload = function () { + resolve(true); + } + + request.onerror = function () { + console.log("%cTuftsCEEO ", "color: #3ba336;", "Error at createNewTagHelper", request.response); + reject(false); + } + + // catch error + request.onreadystatechange = function () { + if (this.readyState === XMLHttpRequest.DONE && (this.status != 200 && this.status != 201)) { + console.log("%cTuftsCEEO ", "color: #3ba336;", this.status + " Error at createNewTagHelper: ", this.response) + } + } + + }).then( + // success handler + function (resolve) { + callback(resolve) + }, + // error handler + function (reject) { + callback(reject) + } + ) + } + + /** Delete the tag on the System Link cloud + * + * @private + * @param {string} tagName + * @param {function} callback + */ + async function deleteTagHelper ( tagName, callback ) { + new Promise(async function (resolve, reject) { + + var URL = "https://api.systemlinkcloud.com/nitag/v2/tags/" + tagName; + + var request = await sendXMLHTTPRequest("DELETE", URL, APIKey); + + request.onload = function () { + resolve(true); + } + + request.onerror = function () { + console.log("%cTuftsCEEO ", "color: #3ba336;", "Error at deleteTagHelper", request.response); + reject(false); + } + + // catch error + request.onreadystatechange = function () { + if (this.readyState === XMLHttpRequest.DONE && this.status != 200) { + console.log("%cTuftsCEEO ", "color: #3ba336;", this.status + " Error at deleteTagHelper: ", this.response) + } + } + + }).then( + // success handler + function (resolve) { + callback(resolve) + }, + // error handler + function (reject) { + callback(reject) + } + ) + } + + /** Helper function for sending XMLHTTPRequests + * + * @private + * @param {string} method + * @param {string} URL + * @param {string} APIKeyInput + * @param {object} body + * @returns {object} XMLHttpRequest + */ + async function sendXMLHTTPRequest(method, URL, APIKeyInput, body) { + var request = new XMLHttpRequest(); + request.open(method, URL, true); + + //Send the proper header information along with the request + request.setRequestHeader("x-ni-api-key", APIKeyInput); + + if (body === undefined) { + request.setRequestHeader("Accept", "application/json"); + + request.send(); + } + else { + request.setRequestHeader("Content-type", "application/json"); + var requestBody = JSON.stringify(body); + try { + request.send(requestBody); + } catch (e) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "error sending request:", request.response); + } + } + + return request; + } + + /** Helper function for getting data types in systemlink format + * + * @private + * @param {any} new_value the variable containing the new value of a tag + * @returns {any} data type of tag + */ + function getValueType(new_value) { + + //if the value is not a number + if (isNaN(new_value)) { + //if the value is a boolean + if (new_value === "true" || new_value === "false") { + return "BOOLEAN"; + } + //if the value is a string + return "STRING"; + } + //value is a number + else { + //if value is an integer + if (Number.isInteger(parseFloat(new_value))) { + return "INT" + } + //if value is a double + else { + return "DOUBLE" + } + } + } + + /** + * @private + * @param {any} new_value + * @returns {string} data type of tag + */ + function getValueTypeStrict(new_value) { + //if the value is a boolean + if (typeof new_value === "boolean") { + return "BOOLEAN"; + } + else if (typeof new_value === "string") { + return "STRING"; + } + else if (typeof new_value === "number") { + if (Number.isInteger(parseFloat(new_value))) { + return "INT" + } + //if value is a double + else { + return "DOUBLE" + } + } + } + + + /** stringify newValue + * Note: for POST request + * @private + * @param {any} newValue + * @returns {string} newValue stringified + */ + function changeToString(newValue) { + var newValueConverted; + + // already a string + if (typeof newValue == "string") { + newValueConverted = newValue; + } + else { + newValueConverted = JSON.stringify(newValue); + } + + return newValueConverted; + } + + /** Helper function for converting values to correct type based on data type + * + * @private + * @param {string} valueType data type of value in systemlink format + * @param {string} value value to convert + * @returns {any} converted value + */ + function getValueFromType(valueType, value) { + if (valueType == "BOOLEAN") { + if (value == "true") { + return true; + } + else { + return false; + } + } + else if (valueType == "STRING") { + return value; + } + else if (valueType == "INT" || valueType == "DOUBLE") { + return parseFloat(value); + } + return value; + } + + /* public members */ + return { + init: init, + getTagsInfo: getTagsInfo, + setTagValueNotStrict: setTagValueNotStrict, + setTagValueStrict: setTagValueStrict, + getTagValue: getTagValue, + executeAfterInit: executeAfterInit, + setAPIKey: setAPIKey, + isActive: isActive, + createTag: createTag, + deleteTag: deleteTag + } +} +/* +Project Name: SPIKE Prime Web Interface +File name: ServiceDock_Airtable.js +Author: Grace Kayode +Last update: 11/5/20 +Description: HTML Element definition for to be used in ServiceDocks +Credits/inspirations: + Airtable browser API (https://github.com/Airtable/airtable.js) +History: + Created by Jeremy on 7/20/20, Edited by Grace 11/1/20 +LICENSE: MIT +(C) Tufts Center for Engineering Education and Outreach (CEEO) +*/ + +/* ServiceDock HTML Element Definition */ +// document.writeln(""); + +class serviceairtable extends HTMLElement { + + constructor() { + super(); + + this.active = false; // whether the service was activated + this.service = new Service_Airtable(); // instantiate a service object ( one object per button ) + this.proceed = false; // if there are credentials input + this.APIKey = ""; + this.BaseID = ""; + this.TableName = ""; + + // Create a shadow root + var shadow = this.attachShadow({ mode: 'open' }); + + /* wrapper definition and CSS */ + var wrapper = document.createElement('div'); + wrapper.setAttribute('class', 'wrapper'); + wrapper.setAttribute("style", "width: 50px; height: 50px; position: relative; margin-top: 10px;") + + /* ServiceDock button definition and CSS */ + + var button = document.createElement("button"); + button.setAttribute("id", "airtableid_button"); + button.setAttribute("class", "airtablecl_button"); + /* CSS */ + //var imageRelPath = "./modules/views/airtable-logo.png" // relative to the document in which a servicesystemlink is created ( NOT this file ) + var length = 50; // for width and height of button + var backgroundColor = "#A2E1EF" // background color of the button + + // the icon is base64 encoded + var buttonStyle = "width:" + length + "px; height:" + length + "px; background:" + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB/HSuDAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABYlAAAWJQFJUiTwAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZ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QIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIDA0wT+f7QY7l64VTJRAAAAAElFTkSuQmCC')" + " no-repeat; background-size: 40px 40px; background-color:" + backgroundColor + + "; border: none; background-position: center; cursor: pointer; border-radius: 10px; position: relative; margin: 4px 0px; " + button.setAttribute("style", buttonStyle); + + /* status circle definition and CSS */ + + this.status = document.createElement("div"); + this.status.setAttribute("class", "status"); + + /* CSS */ + var length = 20; // for width and height of circle + var statusBackgroundColor = "red" // default background color of service (inactive color) + var posLeft = 30; + var posTop = 20; + var statusStyle = "border-radius: 50%; height:" + length + "px; width:" + length + "px; background-color:" + statusBackgroundColor + + "; position: relative; left:" + posLeft + "px; top:" + posTop + "px;"; + this.status.setAttribute("style", statusStyle); + + /* event listeners */ + + button.addEventListener("mouseleave", function (event) { + button.style.backgroundColor = "#A2E1EF"; + button.style.color = "#000000"; + }); + + button.addEventListener("mouseenter", function (event) { + button.style.backgroundColor = "#FFFFFF"; + button.style.color = "#000000"; + }) + + + this.addEventListener("click", async function () { + + if (!this.active) { + if (this.APIKey != "" && this.BaseID != "" && this.TableName != "") { + // check active flag so once activated, the service doesnt reinit + + console.log("%cTuftsCEEO ", "color: #3ba336;", "Activating Airtable Service"); + + var initSuccessful = await this.service.init(this.APIKey, this.BaseID, this.TableName); + + if (initSuccessful) { + + this.active = true; + this.status.style.backgroundColor = "green"; + } + + } + else { + this.popUpBox(); + } + } + + }); + + + shadow.appendChild(wrapper); + button.appendChild(this.status); + wrapper.appendChild(button); + } + + /* Ask user for API credentials with an alert */ + // DEV: credentials will differ by service + + popUpBox() { + // flags to check if users' input exists + // DEV: add as many as needed + var APIKeyExists = true; + var BaseIDKeyExists = true; + var TableNameExists = true; + + // prompt user for input + // DEV: add as many as needed + var APIKeyResult = prompt("Please enter your API Key:"); + var BaseIDKeyResult = prompt("Please enter your BaseID Key:"); + var TableNameResult = prompt("Please enter your Base Table Name:"); + + // if the user did not input any field, flag nonexistant field + if (APIKeyResult == null || APIKeyResult == "") { + console.log("%cTuftsCEEO ", "color: #3ba336;", "You inserted no API key"); + APIKeyExists = false; + } + // if user did input field, flag existing field and store data + else { + APIKeyExists = true; + this.APIKey = APIKeyResult; + } + + // if the user did not input any field, flag nonexistant field + if (BaseIDKeyResult == null || BaseIDKeyResult == "") { + console.log("%cTuftsCEEO ", "color: #3ba336;", "You inserted no Base key"); + BaseIDKeyExists = false; + } + // if user did input field, flag existing field and store data + else { + BaseIDKeyExists = true; + this.BaseID = BaseIDKeyResult; + } + + // if the user did not input any field, flag nonexistant field + if (TableNameResult == null || TableNameResult == "") { + console.log("%cTuftsCEEO ", "color: #3ba336;", "You inserted no Base Table Name"); + TableNameExists = false; + } + // if user did input field, flag existing field and store data + else { + TableNameExists = true; + this.TableName = TableNameResult; + } + + // proceed if user input an API Key & Base ID field + if (APIKeyExists && BaseIDKeyExists && TableNameExists) { + this.proceed = true; + } + } + + /* allow credentials input through HTML attributes */ + // DEV: add more fields as needed + + // observe the attributes listed + static get observedAttributes() { + return ["apikey", "baseid", "tablename"]; + } + + /* getter and setter methods for credentials.*/ + get apikey() { + return this.getAttribute("apikey"); + } + get baseid() { + return this.getAttribute("baseid"); + } + get tablename() { + return this.getAttribute("tablename"); + } + + + set apikey(val) { + // console.log(val); + if (val) { + this.setAttribute("apikey", val); + } + else { + this.removeAttribute("apikey"); + } + } + + set baseid(val) { + // console.log(val); + if (val) { + this.setAttribute("baseid", val); + } + else { + this.removeAttribute("baseid"); + } + } + + set tablename(val) { + // console.log(val); + if (val) { + this.setAttribute("tablename", val); + } + else { + this.removeAttribute("tablename"); + } + } + + // change the API key + attributeChangedCallback(name, oldValue, newValue) { + // console.log("changing attribute: ", name); + if (name == "apikey") { + console.log("%cTuftsCEEO ", "color: #3ba336;", "new value of apikey:", newValue); + this.APIKey = newValue; + } + else if (name == "baseid") { + console.log("%cTuftsCEEO ", "color: #3ba336;","new value of baseid:", newValue); + this.BaseID = newValue + } + else if (name == "tablename") { + console.log("%cTuftsCEEO ", "color: #3ba336;","new value of tablename:", newValue); + this.TableName = newValue + } + + } + + /* functions on the HTML element */ + + /* get the Service object */ + getService() { + return this.service; + } + + /* get whether the ServiceDock button was clicked */ + getClicked() { + return this.active; + } + + // initialize the service (is not used in this class but available for use publicly) + async init() { + console.log("%cTuftsCEEO ", "color: #3ba336;","apikey attribute value: ", this.APIKey); + console.log("%cTuftsCEEO ", "color: #3ba336;","baseid attribute value: ", this.BaseID); + console.log("%cTuftsCEEO ", "color: #3ba336;","tablename attribute value: ", this.TableName); + var initSuccess = await this.service.init(this.APIKey, this.BaseID, this.TableName); + if (initSuccess) { + this.status.style.backgroundColor = "green"; + return true; + } + else { + return false; + } + } + +} + +// when defining custom element, the name must have at least one - dash +window.customElements.define('service-airtable', serviceairtable); + +/* ServiceDock class Definition */ + +/** Assumes your workspace only consists of two columns of records + * that are "Name" and "Value", each of a single line text type + * @class Service_Airtable + * @example + * var AirtableElement = document.getElementById("service_airtable"); + * AirtableElement.setAttribute("apikey", "APIKEY"); + * AirtableElement.setAttribute("baseid", "BASEID"); + * AirtableElement.setAttribute("tablename", "TABLENAME"); + * AirtableElement.init(); + */ +function Service_Airtable() { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + /* private members */ + + /* + currentData = { + Name_field: {value: Value_field, type: dataTYPE } + }; + */ + let currentData= {}; // contains real-time information of the entries in the cloud + + let recordIDNameMap = {}; // map Name fields to its record ID + + /* DEV: API credentials, add or remove as needed for your API */ + let APIKey = "API KEY"; // default APIKey in case no APIKey is given on init + + let serviceActive = false; // set to true when service goes through init + + let BaseID = "BASE ID"; + let TableName = "Table Name"; + let pollInterval = 1000; // interval at which to continuously poll the external API + + var base = undefined; + var table = undefined; + + var funcAtInit = undefined; // function to call after init + var funcAfterChangeEntryValue = []; // callback function and entry name pairs to call after setEntryValue [[entryName, callback]...] + var funcAfterCreateEntry = []; + var funcAfterDeleteEntry = []; + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + + /** initialize Service_Template + * Starts polling the external API + * this function needs to be executed after executeAfterInit but before all other public functions + * + * @public + * @param {string} APIKey API Key + * @param {string} BaseID Base ID for Table in which data is stored + * @param {string} TableName Table Name of Base + * @param {integer} pollIntervalInput interval at which to get entries from the cloud in MILISECONDS. Default value is 1000 ms. + * @returns {boolean} True if service was successsfully initialized, false otherwise + * @example + * var AirtableElement = document.getElementById("service_airtable"); + * var myAirtable = AirtableElement.getService(); + * myAirtable.init("APIKEY", "BASEID", "TABLENAME") + */ + async function init(APIKeyInput, BaseIDInput, TableNameInput, pollIntervalInput) { + + var credentialsValid = false; + + // if an APIKey was specified, use the specified key + if (APIKeyInput !== undefined) { + APIKey = APIKeyInput; + } + + // if an BaseIDKey was specified, use the specified key + if (BaseIDInput !== undefined) { + BaseID = BaseIDInput; + } + + // if an TableName was specified, use the specified key + if (TableNameInput !== undefined) { + TableName = TableNameInput; + + } + + // console.log(BaseID); + + const Airtable = require('airtable'); + + try { + base = new Airtable({ apiKey: APIKey }).base(BaseID); + table = base(TableName); + credentialsValid = true; + } + catch (e) { + return false; + } + + // console.log(base); + // console.log(apiKey); + + + // if the credentials are valid authorization + if (credentialsValid) { + + if (pollIntervalInput !== undefined) { + pollInterval = await pollIntervalInput; + } + + beginDataStream(function () { + // console.log(funcAtInit) + serviceActive = true; + // call funcAtInit if defined from executeAfterInit + if (funcAtInit !== undefined) { + funcAtInit(); + } + }); + + return true; + } + else { + return false; + } + } + + /** Get the callback function to execute after service is initialized + * This function needs to be executed before calling init() + * + * @public + * @param {function} callback function to execute after initialization + * @example + * myAirtable.executeAfterInit( function () { + * // your API code + * }) + */ + function executeAfterInit(callback) { + // Assigns global variable funcAtInit a pointer to callback function + funcAtInit = callback; + } + + /** Get whether the Service was initialized or not + * @public + * @returns {boolean} whether Service was initialized or not + * @example + * if (myAirtable.isActive() == true) + * // do something if Airtable service is active + */ + function isActive() { + return serviceActive; + } + + /** Get all entries on the cloud. + * @public + * @returns {object} all entries on the cloud, an object with Name fields as keys and Value fields as values + * @example + * let entriesInfo = myAirtable.getEntriesInfo(); + * console.log(entriesInfo); // display all entries information + * + * // display message entry info + * let messageEntryType = entriesInfo["message"].type; + * let messageEntryValue = entriesInfo["message"].value; + * console.log("message has value of ", messageEntryValue, "that is of type ", messageEntryType); + */ + function getEntriesInfo () { + return currentData; + } + + /** Update Value of a entry on Airtable by entry Name. If the entry does not exist, create a new entry and assign given properties. + *
+ * NotStrict property indicates that the data type of the Value supplied will be implicitly converted. For example, allowing for setting an INT entry's value with a string, "123" or a STRING entry's value with * a number. This method exists for convenience but please avoid using it extensively as it can lead to unpredictable outcomes. + * @public + * @param {any} name Name of entry + * @param {any} value new Value to update entry to. + * @param {any} callback function to run after new entry value or new entry creation + * @example + * // set a string type Value of a Entry and display + * myAirtable.setEntryValueNotStrict("message", 123, function () { + * let messageValue = myAirtable.getEntryValue("message"); + * console.log("message: ", messageValue); // display the updated value, which will be 123. + * }) + * // set value of a boolean Entry + * myAirtable.setEntryValueNotStrict("aBoolean", true); + * + * // set value of an integer Entry + * myAirtable.setEntryValueNotStrict("anInteger", 10); + * myAirtable.setEntryValueNotStrict("anInteger", "10"); + * + * // set value of a double Entry + * myAirtable.setEntryValueNotStrict("aDouble", 5.2); + * myAirtable.setEntryValueNotStrict("aDouble", "5.2"); + */ + async function setEntryValueNotStrict(name, value, callback) { + if (currentData[name] == undefined) { + /* no entries exist in the database with the given name */ + + // throw new Error("Entry with given name does not exist in the database. Please supply a Name of a Entry that exists on Airtable.") + createEntry(name, value, callback); + } + else { + /* the entry exists in the database */ + + + // append callback function + // if (callback != undefined) { + + // let index = getEmptyIndex(funcAfterChangeEntryValue); + + // if (index === -1) + // funcAfterChangeEntryValue.push([name, callback]) + // else + // funcAfterChangeEntryValue[index] = [name, callback] + // } + setTimeout(callback, 1500); + + updateValue(name, value); // update entry in database + } + } + + /** Update Value of a entry on Airtable by entry Name. If the entry does not exist, create a new entry and assign given properties. + *
+ * The value of the Entry is not implicitly converted. E.g. setting a string Entry's value with a number will no longer work + * @public + * @param {string} name Name of entry + * @param {any} value new Value to update entry to + * @param {any} callback function to run after new entry value or new entry creation + * @example + * // set a string type Value of a Entry and display + * myAirtable.setEntryValueNotStrict("message", 123, function () { + * let messageValue = myAirtable.getEntryValue("message"); + * console.log("message: ", messageValue); // display the updated value, which will be 123. + * }) + * // set value of a boolean Entry + * myAirtable.setEntryValueNotStrict("aBoolean", true); + * + * // set value of an integer Entry + * myAirtable.setEntryValueNotStrict("anInteger", 10); + * + * // set value of a double Entry + * myAirtable.setEntryValueNotStrict("aDouble", 5.2); + */ + async function setEntryValueStrict(name, value, callback) { + if (currentData[name] == undefined) { + /* no entries exist in the database with the given name */ + + // throw new Error("Entry with given name does not exist in the database. Please supply a Name of a Entry that exists on Airtable."); + createEntry(name, value, callback); + } + else { + /* the entry exists in the database */ + + let dataType = getValueTypeStrict(value); + + if (dataType === "INT" && typeof value === "string") + throw new TypeError("A new Value of string data type was given, but the string does not at least contain one chracter that is not a number. E.g. '123'. Please supply a string that contains at least one character that is not a number, or use the less strict alternative method, setEntryValueNotStrict(). NOTE: getEntryValue() of a Entry set to '123' with " + + "setEntryValueNotStrict() will still return a javascript number type"); + + let expectedDataType = currentData[name].type; + console.log("%cTuftsCEEO ", "color: #3ba336;", dataType, " vs ", expectedDataType); + if (dataType === expectedDataType) { + /* the data type of given value is the same as one stored */ + + // append callback function + // if (callback != undefined) { + // let index = getEmptyIndex(funcAfterChangeEntryValue); + // if (index === -1) + // funcAfterChangeEntryValue.push([name, callback]) + // else + // funcAfterChangeEntryValue[index] = [name, callback] + // } + setTimeout(callback, 1500); + + updateValue(name, value); // update entry in database + } + else { + // expected a STRING but got an INT + if (dataType === "INT" && expectedDataType === "STRING") { + console.error("%cTuftsCEEO ", "color: #3ba336;", "Expected a Value of type STRING but got an INT. This could happen if a string value you supplied is entirely of a number. E.g. '123'. " + + "Please supply a string that contains at least one character that is not a number, or setuse the less strict alternative method, setEntryValueNotStrict(). NOTE: getEntryValue() of a Entry set to '123' with " + + "setEntryValueNotStrict() will still return a javascript number type"); + } + else if (dataType === "STRING" && expectedDataType === "INT") { + console.error("%cTuftsCEEO ", "color: #3ba336;", "Expected a Value of type INT but got a STRING. Please supply a number."); + } + + throw new TypeError("Could not update value of entry on Airtable. The given value is not of the data type defined for the entry in the database"); + } + } + } + + + /** Get the Value field associated with a entry by its Name + * @public + * @param {string} name Name of entry + * @returns {any} the Value field in any JS data type. data type conversion is implicit. + * @example + * let value = myAirtable.getEntryValue("message"); + * console.log("message: ", value); + */ + function getEntryValue(name) { + return currentData[name].value; + } + + /** Delete entry from the Airtable database given its Name field. + * @public + * @param {any} name the Name of entry to delete + * @param {any} callback callback function to run after entry deletion + * @example + * myAirtable.deleteEntry("message", function () { + * let entriesInfo = myAirtable.getEntriesInfo(); + * console.log("entriesInfo: ", entriesInfo); // entriesInfo will no longer contain the entry that was deleted + * }) + */ + const deleteEntry = async (entryName, callback) => { + try { + + // delete all entries in Airtable database with given entryName for Name + let ids = getAllRecordsIDsForName(entryName); + + if (ids.length == 0) + throw new Error("Could not delete entry with name, " + entryName.toString()+ ", as it does not exist"); + + for (let i = 0; i < ids.length; i++) { + let id = ids[i]; + let deletedRecord = await table.destroy(id); + } + + // append callback function + // if (callback != undefined) { + // let index = getEmptyIndex(funcAfterDeleteEntry); + // if (index === -1) + // funcAfterDeleteEntry.push([entryName, callback]) + // else + // funcAfterDeleteEntry[index] = [entryName, callback] + // } + setTimeout( callback, 2000); + + } catch (err) { + throw new Error(err); + } + }; + + /** Create a new entry given its Name field and Value field. If a entry with given name already exists, the method will throw an Error. + * @public + * @param {string} name name of entry to create + * @param {any} value value to give entry (can be of any JS data type) + * @param {function} callback function to run after entry creation + * @example + * myAirtable.createEntry("aBoolean", false, function () { + * let aBoolean = myAirtable.getEntryValue("aBoolean"); + * if (aBoolean == false) + * console.log ("aBoolean is false"); + * }) + * + */ + const createEntry = async (entryName, entryValue, callback) => { + try { + + if (currentData[entryName] == undefined) { + /* entry with the given name does not yet exist */ + + let convertedValue = convertToString(entryValue); + createName({ Name: entryName, Value: convertedValue }); // create Entry in database + + // append callback function + // if (callback != undefined) { + // let index = getEmptyIndex(funcAfterCreateEntry); + // if (index === -1) + // funcAfterCreateEntry.push([entryName, callback]) + // else + // funcAfterCreateEntry[index] = [entryName, callback] + // } + setTimeout(callback, 1500); + } + else { + throw new Error("A entry with the name, " + entryName.toString() + ", already exists"); + } + } + catch (err) { + console.error(err); + } + } + + ////////////////////////////////////////// + // // + // Private Functions // + // // + ////////////////////////////////////////// + + /** Update the Value field associated with a Name + * @private + * @param {string} name + * @param {string} newValue + */ + function updateValue(name, newValue) { + var recordIDs = recordIDNameMap[name]; + var convertedValue = convertToString(newValue); + + if (currentData[name].value == convertedValue) { + /* value to update to is the same as value already in currentData */ + + // execute funcAfterChangeEntryValue since value won't change + for (let j = 0; j < funcAfterChangeEntryValue.length; j++) { + if (funcAfterChangeEntryValue[j] !== undefined) { + console.log("%cTuftsCEEO ", "color: #3ba336;", funcAfterChangeEntryValue) + let changedEntry = name; + let expectedEntry = funcAfterChangeEntryValue[j][0]; + + if (expectedEntry === changedEntry) { + funcAfterChangeEntryValue[j][1](); + funcAfterChangeEntryValue[j] = undefined; + // console.log("After execution, funcAfterChangeEntryValue: ", funcAfterChangeEntryValue); + } + } + } + } + else { + for (let i = 0; i < recordIDs.length; i++) { + let recordID = recordIDs[i]; + var requestBody = { Name: name, Value: convertedValue }; + updateRecord(recordID, requestBody); + } + } + } + + /** get an initial reading of the table, and then initialize global variable currentData + * @private + * + */ + async function beginDataStream(callback) { + var records = await base(TableName).select().firstPage(function(err, records) { + if (err) { + console.error("%cTuftsCEEO ", "color: #3ba336;", err); + return false; + } + // initialize recordIDNameMap + populateRecordIDNameMap(records); + + // initialize currentData global variable + populateCurrentData(records); + + // console.log("currentData: ", currentData); + setTimeout( function () { + + setInterval(async function () { + + // get all records in Airtable + var records = await base(TableName).select().firstPage(); + + // if the object is defined and not boolean false + if (records) { + + let changedEntries = []; + let createdEntries = []; + let deletedEntries = []; + + // get entries from the database + let newEntries = {}; + for (var key in records) { + var name = records[key].fields.Name; + var value = records[key].fields.Value; + if (name != undefined) { + newEntries[name] = convertToDataType(value); + } + } + + // populate recordIDNameMap + populateRecordIDNameMap(records); + + // look for discrepancies between newEntries and currentData + + let changeExists = false; + // go through newEntries and check if all entries in records exists correspondingly to currentData + for (var key in newEntries) { + if (key != undefined) { + if (currentData[key] !== undefined && newEntries[key] !== undefined) { + /* values are defined for the key */ + if (currentData[key].value !== newEntries[key].value) { + /* values are different */ + // console.log("Different values detected in: ", key); + changedEntries.push(key); + changeExists = true; + } + + } + else { + /* a entry was created in records and does not yet show in currentData*/ + // console.log("A entry was created: ", key); + // console.log("newEntries: ", newEntries); + // console.log("currentData: ", currentData); + createdEntries.push(key); + // console.log(createdEntries); + changeExists = true; + } + } + } + + // go through currentData and check if all entries in newEntries exists correspondingly to records + for (let key in currentData) { + if (key != undefined) { + if (currentData[key] === undefined || newEntries[key] === undefined) { + /* a entry was destroyed in newEntries and does not yet show in currentData*/ + // console.log("A entry was destroyed: ", key); + deletedEntries.push(key); + changeExists = true; + } + } + } + + // if change exists, update currentData + if (changeExists === true) { + populateCurrentData(records); + + // console.log("NEW CURRENTDAAT: ", currentData); + + /* execute any needed callback functions */ + + for (let i = 0; i < changedEntries.length; i++ ) { + for (let j = 0 ; j < funcAfterChangeEntryValue.length; j++) { + if (funcAfterChangeEntryValue[j] !== undefined) { + let changedEntry = changedEntries[i]; + let expectedEntry = funcAfterChangeEntryValue[j][0]; + if (expectedEntry === changedEntry) { + funcAfterChangeEntryValue[j][1](); + funcAfterChangeEntryValue[j] = undefined; + } + } + } + } + + for (let i = 0; i < createdEntries.length; i++) { + for (let j = 0; j < funcAfterCreateEntry.length; j++) { + if (funcAfterCreateEntry[j] !== undefined) { + let createdEntry = createdEntries[i]; + let expectedEntry = funcAfterCreateEntry[j][0]; + // console.log(expectedEntry, " vs ", createdEntry); + if (expectedEntry === createdEntry) { + funcAfterCreateEntry[j][1](); + funcAfterCreateEntry[j] = undefined; + } + } + } + } + + for (let i = 0; i < deletedEntries.length; i++) { + for (let j = 0; j < funcAfterDeleteEntry.length; j++) { + if (funcAfterDeleteEntry[j] !== undefined) { + let deletedEntry = deletedEntries[i]; + let expectedEntry = funcAfterDeleteEntry[j][0]; + if (expectedEntry === deletedEntry) { + funcAfterDeleteEntry[j][1](); + funcAfterDeleteEntry[j] = undefined; + } + } + } + } + + } + + } + }, pollInterval) + + callback(); + }, 2000); + + }); + } + + /** Update the record(row) with given fields + * @private + * @param {integer} rowNumber row number to update + * @param {object} fields an object with given fields to update row with + */ + async function updateRecord(recordID, fields) { + const updatedRecord = await table.update(recordID, fields); + // console.log(minifyRecord(updatedRecord)); + } + + /** Creates a new entry of specified data fields that gets pushed to Airtable + * @private + * @param {string} fields passed in data fields + */ + const createName = async (fields) => { + const createdName = await table.create(fields); + // console.log(minifyRecord(createdName)); + }; + + /** Get the content of a record/row in minified format + * @private + * @param {any} record + * @returns {object} + */ + const minifyRecord = (record) => { + return { + id: record.id, + fields: record.fields, + }; + }; + + /** Display a record by its recordID + * @private + * @param {any} id + */ + const getRecordById = async (id) => { + const record = await table.find(id); + // console.log(record); + }; + + + /** Get 50 pieces of "row" information + * @private + * @returns records + */ + const getRecords = async () => { + const records = await table.select({ + maxRecords: 50, view: 'Main View' + }).firstPage(); + + return records; + } + + + /** convert a string variable to a JS variable of its presumed data type + * @private + * @param {string} input + * @returns {any} type converted variable + */ + function convertToDataType(input) { + //input = input.trim(); + var convertedInput; + // string is not a pure number + if (isNaN(input)) { + // string is a boolean + if (input == "True" || input == "true") { + convertedInput = true; + } + else if (input == "False" || input == "false") { + convertedInput = false; + } + else if (input == undefined) { + convertedInput = ""; + } + // string is just a string + else { + convertedInput = input; + } + } + // string is a pure number or spaces + else { + // string is of spaces + if(checkCompletelySpace(input)){ + convertedInput = input + } + // string is a number + else { + convertedInput = Number(input); + } + } + return convertedInput + } + + /** checks if a given string is completely spaces + * @private + * @param {string} stringInput + */ + function checkCompletelySpace(stringInput) { + if (stringInput.length == 1) { + if (stringInput == " ") { + return true + } + else { + return false + } + } + else { + if (stringInput[stringInput.length - 1] != " ") { + return false + } + else { + // console.log("%cTuftsCEEO ", "color: #3ba336;", stringInput.slice(0, stringInput.length - 1)) + return checkCompletelySpace(stringInput.slice(0, stringInput.length - 1)) + } + } + } + + /** Convert any variable to its string format for Airtable + * @private + * @param {any} input + * @returns {string} input converted to string + */ + function convertToString(input) { + var convertedInput = input; + // input is not a pure number + if (typeof input == "boolean") { + if (input) { + convertedInput = "true"; + } + else { + convertedInput = "false"; + } + } + else if (typeof input == "number") { + convertedInput = input.toString(); + } + + return convertedInput + } + + /** Get all the entries only in 'Name' column, which are keys + * @private + * @returns {array} + */ + function getNames() { + var names = []; + + for (var key in currentData) { + names.push(key); + } + + return names; + } + + /** + * + * @private + * @param {any} array + * @returns {number} + */ + function getEmptyIndex (array) { + if (array.length === 0 ) + return -1; + else { + + for (let i = 0; i < array.length; i++) { + if (array[i] == undefined) + return i; + } + + return -1; + } + + } + + /** + * @private + * @param {any} records + */ + function populateRecordIDNameMap (records) { + + recordIDNameMap = {}; // re initialize recordIDNameMap + + for (let key in records) { + var name = records[key].fields.Name; + var recordID = records[key].id; + + if (recordIDNameMap[name] !== undefined) { + /* a record of a entry with the name already exists in recordIDNameMap */ + + recordIDNameMap[name].push(recordID); + } + else { + /* recordIDNameMap does not contain a entry with the name */ + + recordIDNameMap[name] = []; // make new array + recordIDNameMap[name].push(recordID); + } + + } + + } + + /** + * + * @private + * @param {any} records + */ + function populateCurrentData (records) { + currentData = {}; // reinitialize currentData in case some info was deleted outside + for (let key in records) { + var name = records[key].fields.Name; + var value = records[key].fields.Value; + + if (name != undefined) { + currentData[name] = { + "value": undefined, + "type": undefined + }; + + let convertedValue = convertToDataType(value); + let dataType = getValueTypeStrict(convertedValue); + + currentData[name].value = convertedValue; + currentData[name].type = dataType; + } + } + } + + /** + * @private + * @param {any} name + * @returns {array} array of Airtable record ids + */ + function getAllRecordsIDsForName(name) { + let arrayIds = []; + + let recordIds = recordIDNameMap[name]; + + if (recordIds !== undefined) + for ( let i = 0; i < recordIds.length; i++ ) { + let recordId = recordIds[i]; + + arrayIds.push(recordId); + } + + return arrayIds; + } + + /** Helper function for getting data types in a format + * + * @private + * @param {any} new_value the variable containing the new value of a entry + * @returns {any} data type of entry + */ + function getValueType(new_value) { + //if the value is not a number + if (isNaN(new_value)) { + //if the value is a boolean + if (new_value == "true" || new_value == "false" || new_value == "True" || new_value == "False") { + return "BOOLEAN"; + } + //if the value is a string + return "STRING"; + } + //value is a number + else { + //if value is an integer + if (Number.isInteger(parseFloat(new_value))) { + return "INT" + } + //if value is a double + else { + return "DOUBLE" + } + } + } + + /** + * @private + * @param {any} new_value + * @returns {string} data type of entry + */ + function getValueTypeStrict(new_value) { + //if the value is a boolean + if (typeof new_value === "boolean") { + return "BOOLEAN"; + } + else { + if (isNaN(new_value) === false) { + if (Number.isInteger(parseFloat(new_value))) { + return "INT" + } + //if value is a double + else { + return "DOUBLE" + } + } + else { + return "STRING"; + } + } + } + + /** Helper function for converting values to correct type based on data type + * + * @private + * @param {string} valueType data type of value in systemlink format + * @param {string} value value to convert + * @returns {any} converted value + */ + function getValueFromType(valueType, value) { + if (valueType == "BOOLEAN") { + if (value == "true") { + return true; + } + else { + return false; + } + } + else if (valueType == "STRING") { + return value; + } + else if (valueType == "INT" || valueType == "DOUBLE") { + return parseFloat(value); + } + return value; + } + + + /* public members */ + return { + init: init, + executeAfterInit, executeAfterInit, + isActive: isActive, + setEntryValueNotStrict: setEntryValueNotStrict, + setEntryValueStrict: setEntryValueStrict, + getEntriesInfo: getEntriesInfo, + getEntryValue: getEntryValue, + createEntry: createEntry, + deleteEntry: deleteEntry + } +} + +require=function(){return function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=r[a]={exports:{}};e[a][0].call(f.exports,function(t){return o(e[a][1][t]||t)},f,f.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a=400?function(){var r=e&&e.error&&e.error.type?e.error.type:"UNEXPECTED_ERROR",n=e&&e.error&&e.error.message?e.error.message:"An unexpected error occurred";return new c(r,n,t)}():null;var r},d.prototype.doCall=function(t){return this.table(t)},d.prototype.getId=function(){return this._id},d.createFunctor=function(t,e){var r=new d(t,e),o=function(){return r.doCall.apply(r,arguments)};return n(["table","makeRequest","runAction","getId"],function(t){o[t]=r[t].bind(r)}),o._base=r,o.tables=r.tables,o},e.exports=d},{"./airtable_error":1,"./exponential_backoff_with_jitter":5,"./http_headers":7,"./package_version":10,"./promise":11,"./run_action":14,"./table":15,"lodash/assign":164,"lodash/forEach":168,"lodash/get":169,"lodash/isPlainObject":184,request:203}],3:[function(t,e,r){"use strict";var n=t("./promise");e.exports=function(t,e,r){return function(){var o;if("function"!=typeof arguments[o=void 0===r?arguments.length>0?arguments.length-1:0:r]){for(var i=[],a=Math.max(arguments.length,o),s=0;s1&&console.warn("Airtable: `select` takes only one parameter, but it was given "+arguments.length+" parameters. Use `eachPage` or `firstPage` to fetch records."),o(t)){var e=u.validateParams(t);if(e.errors.length){var r=s(e.errors,function(t){return" * "+t});throw new Error("Airtable: invalid parameters for `select`:\n"+r.join("\n"))}return e.ignoredKeys.length&&console.warn("Airtable: the following parameters to `select` will be ignored: "+e.ignoredKeys.join(", ")),new u(this,e.validParams)}throw new Error("Airtable: the parameter for `select` should be a plain object or undefined.")},p.prototype._urlEncodedNameOrId=function(){return this.id||encodeURIComponent(this.name)},p.prototype._createRecords=function(t,e,r){var o,a=this,s=n(t);r||(r=e,e={}),i(o=s?{records:t}:{fields:t},e),this._base.runAction("post","/"+a._urlEncodedNameOrId()+"/",{},o,function(t,e,n){var o;t?r(t):(o=s?n.records.map(function(t){return new f(a,t.id,t)}):new f(a,n.id,n),r(null,o))})},p.prototype._updateRecords=function(t,e,r,a,s){var c;if(n(e)){var u=this,l=e;c=o(r)?r:{},s=a||r;var p=t?"put":"patch",_=i({records:l},c);this._base.runAction(p,"/"+this._urlEncodedNameOrId()+"/",{},_,function(t,e,r){if(t)s(t);else{var n=r.records.map(function(t){return new f(u,t.id,t)});s(null,n)}})}else{var h=e,y=r;c=o(a)?a:{},s=s||a;var d=new f(this,h);t?d.putUpdate(y,c,s):d.patchUpdate(y,c,s)}},p.prototype._destroyRecord=function(t,e){if(n(t)){var r=this,o={records:t};this._base.runAction("delete","/"+this._urlEncodedNameOrId(),o,null,function(t,n,o){if(t)e(t);else{var i=s(o.records,function(t){return new f(r,t.id,null)});e(null,i)}})}else{new f(this,t).destroy(e)}},p.prototype._listRecords=function(t,e,r,n){var o=this;n||(n=r,r={});var a=i({limit:t,offset:e},r);this._base.runAction("get","/"+this._urlEncodedNameOrId()+"/",a,null,function(t,e,r){if(t)n(t);else{var i=s(r.records,function(t){return new f(o,null,t)});n(null,i,r.offset)}})},p.prototype._forEachRecord=function(t,e,r){2===arguments.length&&(r=e,e=t,t={});var n=this,o=p.__recordsPerPageForIteration||100,i=null,s=function(){n._listRecords(o,i,t,function(t,n,o){t?r(t):(a(n,e),o?(i=o,s()):r())})};s()},e.exports=p},{"./callback_to_promise":3,"./deprecate":4,"./query":12,"./record":13,"lodash/assign":164,"lodash/forEach":168,"lodash/isArray":174,"lodash/isPlainObject":184,"lodash/map":191}],16:[function(t,e,r){"use strict";var n=t("lodash/includes"),o=t("lodash/isArray");function i(t,e){return function(r){return t(r)?{pass:!0}:{pass:!1,error:e}}}i.isOneOf=function(t){return n.bind(this,t)},i.isArrayOf=function(t){return function(e){return o(e)&&e.every(t)}},e.exports=i},{"lodash/includes":172,"lodash/isArray":174}],17:[function(t,e,r){var n,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var u,f=[],l=!1,p=-1;function _(){l&&u&&(l=!1,u.length?f=u.concat(f):p=-1,f.length&&h())}function h(){if(!l){var t=c(_);l=!0;for(var e=f.length;e;){for(u=f,f=[];++p1)for(var r=1;r1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++np))return!1;var h=f.get(t);if(h&&f.get(e))return h==e;var y=-1,d=!0,b=r&s?new n:void 0;for(f.set(t,e),f.set(e,t);++y-1&&t%1==0&&t-1}},{"./_assocIndexOf":42}],133:[function(t,e,r){var n=t("./_assocIndexOf");e.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},{"./_assocIndexOf":42}],134:[function(t,e,r){var n=t("./_Hash"),o=t("./_ListCache"),i=t("./_Map");e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},{"./_Hash":23,"./_ListCache":24,"./_Map":25}],135:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},{"./_getMapData":104}],136:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){return n(this,t).get(t)}},{"./_getMapData":104}],137:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){return n(this,t).has(t)}},{"./_getMapData":104}],138:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},{"./_getMapData":104}],139:[function(t,e,r){e.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},{}],140:[function(t,e,r){e.exports=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}},{}],141:[function(t,e,r){var n=t("./memoize"),o=500;e.exports=function(t){var e=n(t,function(t){return r.size===o&&r.clear(),t}),r=e.cache;return e}},{"./memoize":192}],142:[function(t,e,r){var n=t("./_getNative")(Object,"create");e.exports=n},{"./_getNative":106}],143:[function(t,e,r){var n=t("./_overArg")(Object.keys,Object);e.exports=n},{"./_overArg":147}],144:[function(t,e,r){e.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},{}],145:[function(t,e,r){var n=t("./_freeGlobal"),o="object"==typeof r&&r&&!r.nodeType&&r,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},{"./_freeGlobal":101}],146:[function(t,e,r){var n=Object.prototype.toString;e.exports=function(t){return n.call(t)}},{}],147:[function(t,e,r){e.exports=function(t,e){return function(r){return t(e(r))}}},{}],148:[function(t,e,r){var n=t("./_apply"),o=Math.max;e.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),c=Array(s);++a0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},{}],155:[function(t,e,r){var n=t("./_ListCache");e.exports=function(){this.__data__=new n,this.size=0}},{"./_ListCache":24}],156:[function(t,e,r){e.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},{}],157:[function(t,e,r){e.exports=function(t){return this.__data__.get(t)}},{}],158:[function(t,e,r){e.exports=function(t){return this.__data__.has(t)}},{}],159:[function(t,e,r){var n=t("./_ListCache"),o=t("./_Map"),i=t("./_MapCache"),a=200;e.exports=function(t,e){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!o||s.length-1:!!f&&n(t,e,r)>-1}},{"./_baseIndexOf":56,"./isArrayLike":175,"./isString":186,"./toInteger":197,"./values":200}],173:[function(t,e,r){var n=t("./_baseIsArguments"),o=t("./isObjectLike"),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};e.exports=c},{"./_baseIsArguments":57,"./isObjectLike":183}],174:[function(t,e,r){var n=Array.isArray;e.exports=n},{}],175:[function(t,e,r){var n=t("./isFunction"),o=t("./isLength");e.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},{"./isFunction":177,"./isLength":178}],176:[function(t,e,r){var n=t("./_root"),o=t("./stubFalse"),i="object"==typeof r&&r&&!r.nodeType&&r,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},{"./_root":149,"./stubFalse":195}],177:[function(t,e,r){var n=t("./_baseGetTag"),o=t("./isObject"),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",c="[object Proxy]";e.exports=function(t){if(!o(t))return!1;var e=n(t);return e==a||e==s||e==i||e==c}},{"./_baseGetTag":54,"./isObject":182}],178:[function(t,e,r){var n=9007199254740991;e.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},{}],179:[function(t,e,r){var n=t("./_baseIsMap"),o=t("./_baseUnary"),i=t("./_nodeUtil"),a=i&&i.isMap,s=a?o(a):n;e.exports=s},{"./_baseIsMap":60,"./_baseUnary":78,"./_nodeUtil":145}],180:[function(t,e,r){e.exports=function(t){return null==t}},{}],181:[function(t,e,r){var n=t("./_baseGetTag"),o=t("./isObjectLike"),i="[object Number]";e.exports=function(t){return"number"==typeof t||o(t)&&n(t)==i}},{"./_baseGetTag":54,"./isObjectLike":183}],182:[function(t,e,r){e.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},{}],183:[function(t,e,r){e.exports=function(t){return null!=t&&"object"==typeof t}},{}],184:[function(t,e,r){var n=t("./_baseGetTag"),o=t("./_getPrototype"),i=t("./isObjectLike"),a="[object Object]",s=Function.prototype,c=Object.prototype,u=s.toString,f=c.hasOwnProperty,l=u.call(Object);e.exports=function(t){if(!i(t)||n(t)!=a)return!1;var e=o(t);if(null===e)return!0;var r=f.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},{"./_baseGetTag":54,"./_getPrototype":107,"./isObjectLike":183}],185:[function(t,e,r){var n=t("./_baseIsSet"),o=t("./_baseUnary"),i=t("./_nodeUtil"),a=i&&i.isSet,s=a?o(a):n;e.exports=s},{"./_baseIsSet":64,"./_baseUnary":78,"./_nodeUtil":145}],186:[function(t,e,r){var n=t("./_baseGetTag"),o=t("./isArray"),i=t("./isObjectLike"),a="[object String]";e.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&n(t)==a}},{"./_baseGetTag":54,"./isArray":174,"./isObjectLike":183}],187:[function(t,e,r){var n=t("./_baseGetTag"),o=t("./isObjectLike"),i="[object Symbol]";e.exports=function(t){return"symbol"==typeof t||o(t)&&n(t)==i}},{"./_baseGetTag":54,"./isObjectLike":183}],188:[function(t,e,r){var n=t("./_baseIsTypedArray"),o=t("./_baseUnary"),i=t("./_nodeUtil"),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},{"./_baseIsTypedArray":65,"./_baseUnary":78,"./_nodeUtil":145}],189:[function(t,e,r){var n=t("./_arrayLikeKeys"),o=t("./_baseKeys"),i=t("./isArrayLike");e.exports=function(t){return i(t)?n(t):o(t)}},{"./_arrayLikeKeys":37,"./_baseKeys":67,"./isArrayLike":175}],190:[function(t,e,r){var n=t("./_arrayLikeKeys"),o=t("./_baseKeysIn"),i=t("./isArrayLike");e.exports=function(t){return i(t)?n(t,!0):o(t)}},{"./_arrayLikeKeys":37,"./_baseKeysIn":68,"./isArrayLike":175}],191:[function(t,e,r){var n=t("./_arrayMap"),o=t("./_baseIteratee"),i=t("./_baseMap"),a=t("./isArray");e.exports=function(t,e){return(a(t)?n:i)(t,o(e,3))}},{"./_arrayMap":38,"./_baseIteratee":66,"./_baseMap":69,"./isArray":174}],192:[function(t,e,r){var n=t("./_MapCache"),o="Expected a function";function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(o);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},{"./_MapCache":26}],193:[function(t,e,r){var n=t("./_baseProperty"),o=t("./_basePropertyDeep"),i=t("./_isKey"),a=t("./_toKey");e.exports=function(t){return i(t)?n(a(t)):o(t)}},{"./_baseProperty":72,"./_basePropertyDeep":73,"./_isKey":124,"./_toKey":162}],194:[function(t,e,r){e.exports=function(){return[]}},{}],195:[function(t,e,r){e.exports=function(){return!1}},{}],196:[function(t,e,r){var n=t("./toNumber"),o=1/0,i=1.7976931348623157e308;e.exports=function(t){return t?(t=n(t))===o||t===-o?(t<0?-1:1)*i:t==t?t:0:0===t?t:0}},{"./toNumber":198}],197:[function(t,e,r){var n=t("./toFinite");e.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},{"./toFinite":196}],198:[function(t,e,r){var n=t("./isObject"),o=t("./isSymbol"),i=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,f=parseInt;e.exports=function(t){if("number"==typeof t)return t;if(o(t))return i;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var r=c.test(t);return r||u.test(t)?f(t.slice(2),r?2:8):s.test(t)?i:+t}},{"./isObject":182,"./isSymbol":187}],199:[function(t,e,r){var n=t("./_baseToString");e.exports=function(t){return null==t?"":n(t)}},{"./_baseToString":77}],200:[function(t,e,r){var n=t("./_baseValues"),o=t("./keys");e.exports=function(t){return null==t?[]:n(t,o(t))}},{"./_baseValues":79,"./keys":189}],201:[function(t,e,r){var n=t("trim"),o=t("for-each");e.exports=function(t){if(!t)return{};var e={};return o(n(t).split("\n"),function(t){var r,o=t.indexOf(":"),i=n(t.slice(0,o)).toLowerCase(),a=n(t.slice(o+1));void 0===e[i]?e[i]=a:(r=e[i],"[object Array]"===Object.prototype.toString.call(r)?e[i].push(a):e[i]=[e[i],a])}),e}},{"for-each":19,trim:202}],202:[function(t,e,r){(r=e.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},r.right=function(t){return t.replace(/\s*$/,"")}},{}],203:[function(t,e,r){"use strict";var n=t("global/window"),o=t("is-function"),i=t("parse-headers"),a=t("xtend");function s(t,e,r){var n=t;return o(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=a(e,{uri:t}),n.callback=r,n}function c(t,e,r){return u(e=s(t,e,r))}function u(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,o){e||(e=!0,t.callback(r,n,o))};function n(){var t=void 0;if(t=f.response?f.response:f.responseText||function(t){if("document"===t.responseType)return t.responseXML;var e=204===t.status&&t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML;return null}(f),b)try{t=JSON.parse(t)}catch(t){}return t}function o(t){return clearTimeout(l),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,v)}function a(){if(!u){var e;clearTimeout(l),e=t.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var o=v,a=null;return 0!==e?(o={body:n(),statusCode:e,method:_,headers:{},url:p,rawRequest:f},f.getAllResponseHeaders&&(o.headers=i(f.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),r(a,o,o.body)}}var s,u,f=t.xhr||null;f||(f=t.cors||t.useXDR?new c.XDomainRequest:new c.XMLHttpRequest);var l,p=f.url=t.uri||t.url,_=f.method=t.method||"GET",h=t.body||t.data,y=f.headers=t.headers||{},d=!!t.sync,b=!1,v={body:void 0,headers:{},statusCode:0,method:_,url:p,rawRequest:f};if("json"in t&&!1!==t.json&&(b=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==_&&"HEAD"!==_&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),h=JSON.stringify(!0===t.json?h:t.json))),f.onreadystatechange=function(){4===f.readyState&&a()},f.onload=a,f.onerror=o,f.onprogress=function(){},f.onabort=function(){u=!0},f.ontimeout=o,f.open(_,p,!d,t.username,t.password),d||(f.withCredentials=!!t.withCredentials),!d&&t.timeout>0&&(l=setTimeout(function(){if(!u){u=!0,f.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)}},t.timeout)),f.setRequestHeader)for(s in y)y.hasOwnProperty(s)&&f.setRequestHeader(s,y[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(f),f.send(h||null),f}e.exports=c,c.XMLHttpRequest=n.XMLHttpRequest||function(){},c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r {/* placeholder*/ } + let funcAfterDisconnect = () => {} + let funcAfterConnect = () => {} + + /** Initialize the WebSerial object + * (Prompt user to connect to the wsPort) + * @param {boolean} isDev true if running for SD development/testing, false otherwise + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + let connected = await connect(isDev); + + if (connected === true) + funcAfterConnect(); + + return connected + } + catch (e) { + throw e; + } + } + + /** Prompt user to connect to the wsPort + * Error Code: 1000X + * @returns {boolean} success(true)/failure(false) + * @private + */ + const connect = async function (isDev) { + try { + let success = false; + + wsPort = await navigator.serial.getPorts(); + + console.log("%cTuftsCEEO ", "color: #3ba336;", "wsPorts:", wsPort); + + // select device + wsPort = await navigator.serial.requestPort({ + // filters:[filter] + }); + + // wait for the wsPort to open. + try { + await wsPort.open({ baudRate: 115200 }); + } + catch (er) { + + if (er.message.indexOf("baudrate") > -1) { + // requires different baudRate syntax + //console.log("%cTuftsCEEO ", "color: #3ba336;", "baudRate needs to be baudrate"); + + await wsPort.open({ baudrate: 115200 }); + } + else if (er.message.indexOf("close") > -1) { + // error is due to unsuccessful closing of previous wsPort + await wsPort.close(); + + consoleError("Unsuccessful closing of previous wsPort"); + + throw {code: 10001, message: er.message}; + } + else if (er.message.indexOf("open") > -1) { + // error in wsPort.open was because it was already open + /* "failed to open serial wsPort" */ + try { + await wsPort.close(); + } + catch (err) { + consoleError("wsPort could not be opened was because it was already open"); + throw { code: 10002, message: err.message }; + } + } + else { + throw { code: 10003, message: er.message }; + } + + await wsPort.close(); + } + + if (wsPort.readable) { + success = true; + } + else { + success = false; + } + + return success; + + } catch (e) { + if (e.message.indexOf("close") > -1) { + await wsPort.close(); + throw { code: 10004, message: e.message } + } + else { + consoleError("Cannot read wsPort: ", e); + throw { code: 10005, message: e.message } + } + } + } + + /** Stream incoming data from hardware through web serial + * Error Code: 101XX + * @public + */ + /** Stream incoming data from hardware through web serial + * and take parser interface and continuously feed it raw data + * @param {function} parser parser function + */ + const streamData = async function (parser) { + try { + + var firstReading = true; + // read when port is set up + while (wsPort.readable) { + + // initialize readers + const decoder = new TextDecoderStream(); + const readableStreamClosed = wsPort.readable.pipeTo(decoder.writable); + reader = decoder.readable.getReader(); + + // continuously get + while (true) { + try { + // read UJSON RPC stream ( actual data in {value} ) + ({ value, done } = await reader.read()); + + // console.log("%cTuftsCEEO ", "color: #3ba336;", value); + + //concatenate UJSONRPC packets into complete JSON objects + if (value) { + await parser(value); + } + if (done) { + serviceActive = false; + // reader has been canceled. + console.log("%cTuftsCEEO ", "color: #3ba336;", "[readLoop] DONE", done); + } + } + // error handler + catch (error) { + console.log("%cTuftsCEEO ", "color: #3ba336;", '[readLoop] ERROR', error); + + serviceActive = false; + + funcAfterDisconnect(); + + funcAfterError("SPIKE Prime hub has been disconnected"); + + writer.close(); + //await writer.releaseLock(); + await writableStreamClosed; + + reader.cancel(); + //await reader.releaseLock(); + await readableStreamClosed.catch(reason => { }); + + await wsPort.close(); + + writer = undefined; + reader = undefined; + streamParser = undefined; + + break; // stop trying to read + } + } // end of: while (true) [reader loop] + + // release the lock + reader.releaseLock(); + + } // end of: while (wsPort.readable) [checking if readable loop] + console.log("%cTuftsCEEO ", "color: #3ba336;", "- wsPort.readable is FALSE") + } // end of: trying to open wsPort + catch (e) { + serviceActive = false; + // Permission to access a device was denied implicitly or explicitly by the user. + console.log("%cTuftsCEEO ", "color: #3ba336;", 'ERROR trying to open:', e); + } + } + /** + * + * @param {any} command + */ + const write = function (command) { + setupWriter(); + writer.write(command); + } + + const executeAfterConnect = (f) => { (typeof f === "function") ? funcAfterConnect = f : {}}; + const executeAfterDisconnect = (f) => { (typeof f === "function") ? funcAfterDisconnect = f : {}}; + const executeAfterError = (f) => { (typeof f === "function") ? funcAfterError = f : {}}; + + /** Set up writer object for sending data + * @private + */ + const setupWriter = function () { + // if writer not yet defined: + if (typeof writer === 'undefined') { + // set up writer for the first time + const encoder = new TextEncoderStream(); + writableStreamClosed = encoder.readable.pipeTo(wsPort.writable); + writer = encoder.writable.getWriter(); + } + } + + /** console log + * @private + * @param {string} m + */ + const CONSOLELOG = function (m) { + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + + return { + init: init, + streamData: streamData, + write: write, + // key event callback receivers + executeAfterDisconnect: executeAfterDisconnect, + executeAfterConnect: executeAfterConnect, + executeAfterError: executeAfterError + } +} +function _SpikeRPC(_virtualSpike) { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // flag for development + let dev = undefined; + // ServiceDock objects + let webSerial = new _WebSerial(); + + // flag for when RPC is pure micropython + let micropython_interpreter = false; + + //define for json concatenation + let jsonline = ""; + // contains latest full json object from SPIKE readings + let lastUJSONRPC = undefined; + + const VENDOR_ID = 0x0694; // LEGO SPIKE Prime Hub + // common characters to send (for REPL/uPython on the Hub) + const CONTROL_C = '\x03'; // CTRL-C character (ETX character) + const CONTROL_D = '\x04'; // CTRL-D character (EOT character) + const RETURN = '\x0D'; // RETURN key (enter, new line) + + // servicedock functions passed down from main Service + var funcAfterPrint = (m) => { }; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => { }; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => {}; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => {}; // function to call after SPIKE Prime is connected + var funcWithStream = () => {} // function to call during SPIKE Prime data stream + + + let updateHubPortsInfo = undefined; + let PrimeHubEventHandler = undefined; + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + const init = async function (isDev, portsUpdater, hubEventsUpdater) { + try { + dev = isDev; + updateHubPortsInfo = portsUpdater; + PrimeHubEventHandler = hubEventsUpdater; + + let connected = await webSerial.init(isDev); + if (connected === true) + webSerial.streamData(parsePacket); + + return connected + + } + catch (e) { + /* Catch and display errors */ + if (e.code == 10001) { + funcAfterError("Please reconnect your hub. If error persists, refresh this web environment."); + } + else if (e.code == 10002) { + funcAfterError("Please check if you have any other window or app currently connected to your hub."); + } + else if (e.code == 10003) { + if (isDev) + consoleError("Please try again. If error persists, refresh this environment." + e.message); + else + consoleError("Please try again. If error persists, refresh this environment."); + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else if (e.code == 10004) { + if (isDev) + consoleError("Please try again. If error persists, refresh this environment." + e.message); + else + consoleError("Please try again. If error persists, refresh this environment."); + consoleError(e.message); + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else if (e.code == 10005) { + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else { + consoleError(e); + } + return false; + } + } + + const sendDATA = async function (command) { + // look up the command to send + var commands = command.split("\n"); // split on new line + + // ignore console logging trigger_current_state (to avoid it spamming) + if (command.indexOf("trigger_current_state") === -1) + devConsoleLog("sendDATA: " + commands); + + // send it in micropy if micropy reached + if (micropython_interpreter) { + + for (var i = 0; i < commands.length; i++) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) + + // trim trailing, leading whitespaces + var current = commands[i].trim(); + + webSerial.write(current); + webSerial.write(RETURN); // extra return at the end + } + } + // expect json scripts if micropy not reached + else { + // go through each line of the command + // trim it, send it, and send a return... + for (var i = 0; i < commands.length; i++) { + + //console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) + + current = commands[i].trim(); + //console.log("%cTuftsCEEO ", "color: #3ba336;", "current", current); + // turn string into JSON + + //string_current = (JSON.stringify(current)); + //myobj = JSON.parse(string_current); + var myobj = await JSON.parse(current); + + // turn JSON back into string and write it out + webSerial.write(JSON.stringify(myobj)); + webSerial.write(RETURN) // extra return at the end + } + } + } + + /** Process a raw packet from data stream + * @public + * @param {any} value + * @param {boolean} [testing=false] + * @param {any} callback + */ + const parsePacket = async function (value) { + + // console.log("%cTuftsCEEO ", "color: #3ba336;", value); + + // stringify the packet to look for carriage return + var json_string = await JSON.stringify(value); + + // remove quotation marks from json_string + var cleanedJsonString = cleanJsonString(json_string); + + jsonline = jsonline + cleanedJsonString; // concatenate packet to data + jsonline = jsonline.trim(); + + // regex search for carriage return + let pattern = /\\r/g; + var carriageReIndex = jsonline.search(pattern); + + // there is at least one carriage return in this packet + if (carriageReIndex > -1) { + //////////////////////////////// NEW parsePacket implementation ongoing since (29/12/20) + + let jsonlineSplitByCR = jsonline.split(/\\r/); // array of jsonline split by \r + + jsonline = ""; //reset jsonline + /* + each element in this array will be assessed for processing, + and the last element, if unable to be processed, will be concatenated to jsonline + */ + + for (let i = 0; i < jsonlineSplitByCR.length; i++) { + + // set lastUJSONRPC to an element in split array + lastUJSONRPC = jsonlineSplitByCR[i]; + // remove any newline character in the beginning of lastUJSONRPC + if (lastUJSONRPC.search(/\\n/g) == 0) + lastUJSONRPC = lastUJSONRPC.substring(2, lastUJSONRPC.length); + + /* Case 1: lastUJSONRPC is a valid, complete, and standard UJSONRPC packet */ + if (lastUJSONRPC[0] == "{" && lastUJSONRPC[lastUJSONRPC.length - 1] == "}") { + + let arrayLeftCurly = lastUJSONRPC.match(/{/g); + let arrayRightCurly = lastUJSONRPC.match(/}/g); + if (arrayLeftCurly.length === arrayRightCurly.length) { + /* Case 1A: complete packet*/ + + await processFullUJSONRPC(lastUJSONRPC, cleanedJsonString, json_string); + } + else { + /* Case 1B: {"i": 1234, "r": {} */ + jsonline = lastUJSONRPC; + } + } + /* Case 3: lastUJSONRPC is a micropy print result */ + else if (lastUJSONRPC != "" && lastUJSONRPC.indexOf('"p":') == -1 && lastUJSONRPC.indexOf('],') == -1 && lastUJSONRPC.indexOf('"m":') == -1 && + lastUJSONRPC.indexOf('}') == -1 && lastUJSONRPC.indexOf('{"i":') == -1 && lastUJSONRPC.indexOf('{') == -1) { + /* filter reboot message */ + var rebootMessage = + 'Traceback (most recent call last): File "main.py", line 8, in File "hub_runtime.py", line 1, in start File "event_loop/event_loop.py", line 1, in run_forever File "event_loop/event_loop.py", line 1, in step KeyboardInterrupt: MicroPython v1.12-1033-g97d7f7dd4 on 2020-09-18; LEGO Technic Large Hub with STM32F413xx Type "help()" for more in formation. >>> HUB: sync filesystems HUB: soft reboot' + let rebootMessageRemovedWS = rebootMessage.replace(/[' ']/g, ""); + let lastUJSONRPCRemovedWS = lastUJSONRPC.replace(/[' ']/g, ""); + if (rebootMessageRemovedWS.indexOf(lastUJSONRPCRemovedWS) == -1) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "micropy print: ", lastUJSONRPC); + if (funcAfterPrint != undefined) + funcAfterPrint(lastUJSONRPC); + } + } + /* Case 3: lastUJSONRPC is only a portion of a standard UJSONRPC packet + Then lastUJSONRPC must be EITHER THE FIRST OR THE LAST ELEMENT in jsonlineSplitByCR + because + an incomplete UJSONRPC can either be + Case 3A: the beginning portion of a UJSONRPC packet with no \r in the end (LAST) + Case 3B: the last portion of a UJSONRPC packet with \r in the end (FIRST) + */ + else { + /* Case 3A: */ + if (lastUJSONRPC[0] == "{") { + jsonline = lastUJSONRPC; + // console.log("TEST (last elemnt in split array): ", i == jsonlineSplitByCR.length-1); + // console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline was reset to:" + jsonline); + } + /* Case 3B: */ + else { + /* the last portion of UJSONRPC cannot be concatenated to form a full packet + -> purge lastUJSONRPC + */ + } + } + } + } + } + + /** Process a UJSONRPC packet stringified + * + * @private + * @param {any} lastUJSONRPC + * @param {string} [json_string="undefined"] + * @param {boolean} [testing=false] + * @param {any} callback + */ + const processFullUJSONRPC = async function (lastUJSONRPC, cleanedJsonString = undefined, json_string = undefined) { + try { + + // check that the data is JSON parsable + var parsedLastURPC = await JSON.parse(lastUJSONRPC); + + // devConsoleLog(lastUJSONRPC); + + // update hub information using lastUJSONRPC + if (parsedLastURPC["m"] == 0) { + await updateHubPortsInfo(parsedLastURPC.p); + } + + PrimeHubEventHandler(parsedLastURPC, lastUJSONRPC); + + if (funcWithStream !== undefined) { + await funcWithStream(); + } + + } + catch (e) { + // don't throw error when failure of processing UJSONRPC is due to micropython + if (lastUJSONRPC.indexOf("Traceback") == -1 && lastUJSONRPC.indexOf(">>>") == -1 && json_string.indexOf("Traceback") == -1 && json_string.indexOf(">>>") == -1) { + if (funcAfterError !== undefined) { + funcAfterError("Fatal Error: Please close any other window or program that is connected to your SPIKE Prime"); + } + } + consoleError(e); + consoleError("error parsing lastUJSONRPC: "); + consoleError(lastUJSONRPC); + consoleError("current jsonline: "); + consoleError(jsonline); + consoleError("current cleaned json_string: "); + consoleError(cleanedJsonString); + consoleError("current json_string: "); + consoleError(json_string); + consoleError("current value: "); + consoleError(value); + } + } + + /** Clean the json_string for concatenation into jsonline + * @private + * + * @param {any} json_string + * @returns {string} + */ + const cleanJsonString = function (json_string) { + var cleanedJsonString = ""; + json_string = json_string.trim(); + + let findEscapedQuotes = /\\"/g; + + cleanedJsonString = json_string.replace(findEscapedQuotes, '"'); + cleanedJsonString = cleanedJsonString.substring(1, cleanedJsonString.length - 1); + // cleanedJsonString = cleanedJsonString.replace(findNewLines,''); + + return cleanedJsonString; + } + + const executeWithStream = function (f) { + funcWithStream = f; + } + + /** assign event callback and pass callback down + * @param {function} f + */ + const passConnectCallback = function (f) { + funcAfterConnect = f; + webSerial.executeAfterConnect(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passDisconnectCallback = function (f) { + funcAfterDisconnect = f; + webSerial.executeAfterDisconnect(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passErrorCallback = function (f) { + funcAfterError = f; + webSerial.executeAfterError(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passPrintCallback = function (f) { + funcAfterPrint = f; + webSerial.executeAfterPrint(f); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + return { + init: init, + parsePacket: parsePacket, + executeWithStream: executeWithStream, + sendDATA: sendDATA, + // callback passing continuations + passConnectCallback: passConnectCallback, + passDisconnectCallback: passDisconnectCallback, + passErrorCallback: passErrorCallback, + passPrintCallback: passPrintCallback + } +} +_SpikeUjsonLib = {}; + +/** +* +* @memberof! UJSONRPC +* @param {string} text +* @param {function} immediateCB +*/ +_SpikeUjsonLib.displayText = async function displayText(text, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_text", "p": {"text":' + '"' + text + '"' + '} }' + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {integer} x [0 to 4] + * @param {integer} y [0 to 4] + * @param {integer} brightness [1 to 100] + * @param {function} immediateCB + */ +_SpikeUjsonLib.displaySetPixel = async function displaySetPixel(x, y, brightness, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_set_pixel", "p": {"x":' + x + + ', "y":' + y + ', "brightness":' + brightness + '} }'; + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {function} immediateCB + */ +_SpikeUjsonLib.displayClear = async function displayClear(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_clear" }'; + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {string} port + * @param {array} array [1-100,1-100,1-100,1-100] array of size 4 + * @param {function} immediateCB + */ +_SpikeUjsonLib.ultrasonicLightUp = async function ultrasonicLightUp(port, array, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.ultrasonic_light_up", "p": {' + + '"port": ' + '"' + port + '"' + + ', "lights": ' + '[' + array + ']' + + '} }'; + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {string} port + * @param {integer} speed + * @param {integer} stall + * @param {function} immediateCB + */ +_SpikeUjsonLib.motorStart = async function motorStart(port, speed, stall, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_start", "p": {"port":' + + '"' + port + '"' + + ', "speed":' + speed + + ', "stall":' + stall + + '} }'; + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** moves motor to a position + * + * @memberof! UJSONRPC + * @param {string} port + * @param {integer} position + * @param {integer} speed + * @param {boolean} stall + * @param {boolean} stop + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.motorGoRelPos = async function motorGoRelPos(port, position, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.motor_go_to_relative_position"' + + ', "p": {' + + '"port":' + '"' + port + '"' + + ', "position":' + position + + ', "speed":' + speed + + ', "stall":' + stall + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +_SpikeUjsonLib.motorGoDirToPosition = async function motorGoDirToPosition(port, position, direction, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.motor_go_direction_to_position"' + + ', "p": {' + + '"port":' + '"' + port + '"' + + ', "position":' + position + + ', "direction":' + direction + + ', "speed":' + speed + + ', "stall":' + stall + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + +} + +/** + * + * @memberof! UJSONRPC + * @param {string} port + * @param {integer} time + * @param {integer} speed + * @param {integer} stall + * @param {boolean} stop + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.motorRunTimed = async function motorRunTimed(port, time, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.motor_run_timed"' + + ', "p": {' + + '"port":' + '"' + port + '"' + + ', "time":' + time + + ', "speed":' + speed + + ', "stall":' + stall + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {string} port + * @param {integer} degrees + * @param {integer} speed + * @param {integer} stall + * @param {boolean} stop + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.motorRunDegrees = async function motorRunDegrees(port, degrees, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.motor_run_for_degrees"' + + ', "p": {' + + '"port":' + '"' + port + '"' + + ', "degrees":' + degrees + + ', "speed":' + speed + + ', "stall":' + stall + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {integer} time + * @param {integer} lspeed + * @param {integer} rspeed + * @param {string} lmotor + * @param {string} rmotor + * @param {boolean} stop + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.moveTankTime = async function moveTankTime(time, lspeed, rspeed, lmotor, rmotor, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.move_tank_time"' + + ', "p": {' + + '"time":' + time + + ', "lspeed":' + lspeed + + ', "rspeed":' + rspeed + + ', "lmotor":' + '"' + lmotor + '"' + + ', "rmotor":' + '"' + rmotor + '"' + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {integer} degrees + * @param {integer} lspeed + * @param {integer} rspeed + * @param {string} lmotor + * @param {string} rmotor + * @param {boolean} stop + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.moveTankDegrees = async function moveTankDegrees(degrees, lspeed, rspeed, lmotor, rmotor, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.move_tank_degrees"' + + ', "p": {' + + '"degrees":' + degrees + + ', "lspeed":' + lspeed + + ', "rspeed":' + rspeed + + ', "lmotor":' + '"' + lmotor + '"' + + ', "rmotor":' + '"' + rmotor + '"' + + ', "stop":' + stop + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {integer} lspeed + * @param {integer} rspeed + * @param {string} lmotor + * @param {string} rmotor + * @param {function} immediateCB + * @param {function} callback + */ +_SpikeUjsonLib.moveTankSpeeds = async function moveTankSpeeds(lspeed, rspeed, lmotor, rmotor, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.move_start_speeds"' + + ', "p": {' + + '"lspeed":' + lspeed + + ', "rspeed":' + rspeed + + ', "lmotor":' + '"' + lmotor + '"' + + ', "rmotor":' + '"' + rmotor + '"' + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {integer} lpower + * @param {integer} rpower + * @param {string} lmotor + * @param {string} rmotor + * @param {function} callback + */ +_SpikeUjsonLib.moveTankPowers = async function moveTankPowers(lpower, rpower, lmotor, rmotor, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.move_start_powers"' + + ', "p": {' + + '"lpower":' + lpower + + ', "rpower":' + rpower + + ', "lmotor":' + '"' + lmotor + '"' + + ', "rmotor":' + '"' + rmotor + '"' + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {integer} volume + * @param {integer} note + */ +_SpikeUjsonLib.soundBeep = async function soundBeep(volume, note, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.sound_beep"' + + ', "p": {' + + '"volume":' + volume + + ', "note":' + note + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + */ +_SpikeUjsonLib.soundStop = async function soundStop(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.sound_off"' + + '}'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {string} port + * @param {integer} power + * @param {integer} stall + */ +_SpikeUjsonLib.motorPwm = async function motorPwm(port, power, stall, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_pwm", "p": {"port":' + '"' + port + '"' + + ', "power":' + power + ', "stall":' + stall + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {function} callback + */ +_SpikeUjsonLib.getFirmwareInfo = async function getFirmwareInfo(callback, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + + var command = '{"i":' + '"' + randomId + '"' + ', "m": "get_hub_info" ' + '}'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + + // sendDATA(command); + // if (callback != undefined) { + // getFirmwareInfoCallback = [randomId, callback]; + // } +} + +/** + * @memberof! UJSONRPC + * @param {function} immediateCB + */ +_SpikeUjsonLib.triggerCurrentState = async function triggerCurrentState(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + + var command = '{"i":' + '"' + randomId + '"' + ', "m": "trigger_current_state" ' + '}'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + + // sendDATA(command); + // if (callback != undefined) { + // triggerCurrentStateCallback = callback; + // } +} + +/** + * + * @memberof! UJSONRPC + * @param {integer} slotid + */ +_SpikeUjsonLib.programExecute = async function programExecute(slotid, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "program_execute", "p": {"slotid":' + slotid + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + */ +_SpikeUjsonLib.programTerminate = function programTerminate(immediateCB) { + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "program_terminate"' + + '}'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {string} projectName name of the project + * @param {integer} type type of data (micropy or scratch) + * @param {string} data entire data to send in ASCII + * @param {integer} slotid slot to which to assign the program + */ +_SpikeUjsonLib.startWriteProgram = async function startWriteProgram(projectName, type, data, slotid, immediateCB) { + + console.log("%cTuftsCEEO ", "color: #3ba336;", "in startWriteProgram..."); + console.log("%cTuftsCEEO ", "color: #3ba336;", "constructing start_write_program script..."); + + if (type == "python") { + var typeInt = 0; + } + + // construct the UJSONRPC packet to start writing program + + var dataSize = (new TextEncoder().encode(data)).length; + + var randomId = _SpikeUjsonLib.generateId(); + + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "start_write_program", "p": {' + + '"meta": {' + + '"created": ' + parseInt(Date.now()) + + ', "modified": ' + parseInt(Date.now()) + + ', "name": ' + '"' + btoa(projectName) + '"' + + ', "type": ' + typeInt + + ', "project_id":' + Math.floor(Math.random() * 1000) + + '}' + + ', "fname": ' + '"' + projectName + '"' + + ', "size": ' + dataSize + + ', "slotid": ' + slotid + + '} }'; + + console.log("%cTuftsCEEO ", "color: #3ba336;", "constructed start_write_program script..."); + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {string} base64data base64 encoded data to send + * @param {string} transferid transferid of this program write process + * @returns {string} the randomly generated message id used to send this UJSONRPC script + */ +_SpikeUjsonLib.writePackage = function writePackage(base64data, transferid, immediateCB) { + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "write_package", "p": {' + + '"data": ' + '"' + base64data + '"' + + ', "transferid": ' + '"' + transferid + '"' + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + +} + +/** + * @memberof! UJSONRPC + */ +_SpikeUjsonLib.getStorageStatus = function getStorageStatus(immediateCB) { + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "get_storage_status"' + + '}'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * @memberof! UJSONRPC + * @param {string} slotid + */ +_SpikeUjsonLib.removeProject = function removeProject(slotid, immediateCB) { + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "remove_project", "p": {' + + '"slotid": ' + slotid + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** + * + * @memberof! UJSONRPC + * @param {string} oldslotid + * @param {string} newslotid + */ +_SpikeUjsonLib.moveProject = function moveProject(oldslotid, newslotid, immediateCB) { + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "move_project", "p": {' + + '"old_slotid": ' + oldslotid + + ', "new_slotid: ' + newslotid + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +_SpikeUjsonLib.centerButtonLightUp = function centerButtonLightUp(color, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + + ', "m": "scratch.center_button_lights", "p": {' + + '"color": ' + color + + '} }'; + + if (typeof immediateCB === "function") + immediateCB(command, randomId); +} + +/** generate random id for UJSONRPC messages +* @private +* @returns {string} +*/ +_SpikeUjsonLib.generateId = function () { + var generatedID = "" + var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + + for (var i = 0; i < 4; i++) { + var randomIndex = Math.floor(Math.random() * characters.length); + generatedID = generatedID + characters[randomIndex]; + } + + return generatedID; +} +function _virtualSpike () { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // Service Dock variables + let spikeRPC = new _SpikeRPC(); // Spike communication interface + let ujsonLib = _SpikeUjsonLib; + + // flag for development + let dev = false; + + var colorDictionary = { + 0: "BLACK", + 1: "VIOLET", + 3: "BLUE", + 4: "AZURE", + 5: "GREEN", + 7: "YELLOW", + 9: "RED", + 1: "WHITE", + }; + + // object containing real-time info on devices connected to each port of SPIKE Prime + let ports = + { + "A": { "device": "none", "data": {}}, + "B": { "device": "none", "data": {}}, + "C": { "device": "none", "data": {}}, + "D": { "device": "none", "data": {}}, + "E": { "device": "none", "data": {}}, + "F": { "device": "none", "data": {}} + }; + + // object containing real-time info on hub sensor values + /* + !say the usb wire is the nose of the spike prime + + ( looks at which side of the hub is facing up) + gyro[0] - up/down detector ( down: 1000, up: -1000, neutral: 0) + gyro[1] - rightside/leftside detector ( leftside : 1000 , rightside: -1000, neutal: 0 ) + gyro[2] - front/back detector ( front: 1000, back: -1000, neutral: 0 ) + + ( assume the usb wire port is the nose of the spike prime ) + accel[0] - roll acceleration (roll to right: -, roll to left: +) + accel[1] - pitch acceleration (up: +, down: -) + accel[2] - yaw acceleration (counterclockwise: +. clockwise: -) + + () + pos[0] - yaw angle + pos[1] - pitch angle + pos[2] - roll angle + + */ + let hub = + { + "gyro" : [0, 0, 0], + "accel" : [0, 0, 0], + "pos" : [0, 0, 0], + "gesture" : undefined, // shake, freefall, tapped, doubletapped + "name" : undefined, + "frontEvent" : undefined, // string of real-time info on hub events + "batteryAmount" : 0, // battery [0-100] + "mainButton" : { "pressed": false, "duration": 0 }, + "bluetoothButton" : { "pressed": false, "duration": 0 }, + "leftButton" : { "pressed": false, "duration": 0 }, + "rightButton" : { "pressed": false, "duration": 0 } + } + + // Button states + let hubMainButton = { "pressed": false, "duration": 0 }; + let hubBluetoothButton = { "pressed": false, "duration": 0 }; + let hubLeftButton = { "pressed": false, "duration": 0 }; + let hubRightButton = { "pressed": false, "duration": 0 }; + + // Hub states + let hubProjects = { + "0": "None", + "1": "None", + "2": "None", + "3": "None", + "4": "None", + "5": "None", + "6": "None", + "7": "None", + "8": "None", + "9": "None", + "10": "None", + "11": "None", + "12": "None", + "13": "None", + "14": "None", + "15": "None", + "16": "None", + "17": "None", + "18": "None", + "19": "None" + }; + + let spikeMemory = { + /* States memory */ + ForceSensorWasPressed: false, + waitForNewOriFirst: true, + hubGestures: [], // hubGestures detected since program started or since was_gesture() + hubButtonPresses: [], + lastDetectedColor: undefined, + /* + up: hub is upright/standing, with the display looking horizontally + down: hub is upsidedown with the display, with the display looking horizontally + front: hub's display facing towards the sky + back: hub's display facing towards the earth + leftside: hub rotated so that the side to the left of the display is facing the earth + rightside: hub rotated so that the side to the right of the display is facing the earth + */ + lastHubOrientation: undefined, //PrimeHub orientation read from caught UJSONRPC + /* Spike callbacks */ + funcAfterNewGesture: undefined, + funcAfterNewOrientation: undefined, + funcAfterLeftButtonPress: undefined, + funcAfterLeftButtonRelease: undefined, + funcAfterRightButtonPress: undefined, + funcAfterRightButtonRelease: undefined, + funcAfterNewColor: undefined, + waitUntilColorCallback: undefined, // [colorToDetect, function to execute] + waitForDistanceFartherThanCallback: undefined, // [distance, function to execute] + waitForDistanceCloserThanCallback: undefined, // [distance, function to execute] + funcAfterForceSensorPress: undefined, + funcAfterForceSensorRelease: undefined, + /* array that holds the pointers to callback functions to be executed after a UJSONRPC response */ + responseCallbacks: [], + // Spike write program memory + startWriteProgramCallback: undefined, // [message_id, function to execute ] + writePackageInformation: undefined, // [ message_id, remaining_data, transfer_id, blocksize] + writeProgramCallback: undefined, // callback function to run after a program was successfully written + writeProgramSetTimeout: undefined, // setTimeout object for looking for response to start_write_program + /* callback functions added for Coding Rooms */ + getFirmwareInfoCallback: undefined, + triggerCurrentStateCallback: undefined + } + + var funcAfterPrint = (m) => { }; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => { }; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => { }; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => { }; // function to call after SPIKE Prime is connected + var funcWithStream = () => { } // function to call during SPIKE Prime data stream + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + /** Connect to a webserial port and begin data stream with hub + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + let connected = await spikeRPC.init(isDev, updateHubPortsInfo, PrimeHubEventHandler); + + devConsoleLog("connected: " + connected); + + await sleep(1000); // wait for at least one UJSONRPC to be parsed + + ujsonLib.triggerCurrentState((c, rid) => sendDATA(c)); + ujsonLib.getFirmwareInfo( (c, rid) => { + sendDATA(c); + spikeMemory.getFirmwareInfoCallback = + [rid, (version) => devConsoleLog("This SPIKE Prime is using Hub OS " + version)]; + }); + + await sleep(2000); // wait for service to init + + return connected; + } + catch (e) { + consoleError(e); + } + // reinit variables in the case of hardware disconnection and Service reactivation + // reader = undefined; + // writer = undefined; + + // initialize web serial connection + // var webSerialConnected = await initWebSerial(); + + // if (webSerialConnected) { + + // start streaming UJSONRPC + // streamUJSONRPC(); + + // await sleep(1000); + + // triggerCurrentState(); + // getFirmwareInfo(function (version) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "This SPIKE Prime is using Hub OS ", version); + // }); + // serviceActive = true; + + // await sleep(2000); // wait for service to init + + // // call funcAtInit if defined + // if (funcAtInit !== undefined) { + // funcAtInit(); + // } + // return true; + // } + // else { + // return false; + // } + } + + /** Write a micropy program into a slot of the SPIKE Prime + * + * @param {string} projectName name of the program + * @param {string} data the micropython source code (expecting an input tag's value). All characters must be ASCII + * @param {integer} slotid slot number to assign the program + * @param {function} callback function to run after program is written + */ + const writeProgram = async function (projectName, data, slotid, callback) { + // check for non-ascii characters + let ascii = /[^\x00-\x7F]/; + if (ascii.test(data)) { + funcAfterError("non-ASCII characters detected in micropy program. Only ASCII characters are supported. Please check your micropy input.") + throw new Error("non-ASCII characters detected in micropy program. Only ASCII characters are supported. Please check your micropy input.") + } + else { + // reinit witeProgramTimeout + if (spikeMemory.writeProgramSetTimeout != undefined) { + clearTimeout(spikeMemory.writeProgramSetTimeout); + spikeMemory.writeProgramSetTimeout = undefined; + } + + // template of python file that needs to be concatenated + var firstPart = "from runtime import VirtualMachine\n\n# Stack for execution:\nasync def stack_1(vm, stack):\n" + var secondPart = "# Setup for execution:\ndef setup(rpc, system, stop):\n\n # Initialize VM:\n vm = VirtualMachine(rpc, system, stop, \"Target__1\")\n\n # Register stack on VM:\n vm.register_on_start(\"stack_1\", stack_1)\n\n return vm" + + // stringify data and strip trailing and leading quotation marks + var stringifiedData = JSON.stringify(data); + stringifiedData = stringifiedData.substring(1, stringifiedData.length - 1); + + var result = ""; // string to which the final code will be appended + + var splitData = stringifiedData.split(/\\n/); // split the code by every newline + + // add a tab before every newline (this is syntactically needed for concatenating with the template) + for (var index in splitData) { + + var addedTab = " " + splitData[index] + "\n"; + + result = result + addedTab; + } + + // replace tab characters + result = result.replace(/\\t/g, " "); + + stringifiedData = firstPart + result + secondPart; + + spikeMemory.writeProgramCallback = callback; + + // begin the write program process + ujsonLib.startWriteProgram(projectName, "python", stringifiedData, slotid, (command, randomId) => { + + spikeMemory.startWriteProgramCallback = [randomId, (blocksize, transferid) => { + + devConsoleLog("in writePackageFunc..."); + + devConsoleLog("stringified the entire data to send: " + stringifiedData); + + // when data's length is less than the blocksize limit of sending data + if (stringifiedData.length <= blocksize) { + devConsoleLog("data's length is less than the blocksize of " + blocksize); + + // if the data's length is not zero (not empty) + if (stringifiedData.length != 0) { + + var dataToSend = stringifiedData.substring(0, stringifiedData.length); // get the entirety of data + devConsoleLog("data's length is not zero, sending the entire data: " + dataToSend); + + var base64data = btoa(dataToSend); // encode the packet to base64 + + ujsonLib.writePackage(base64data, transferid, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); // send the packet + + // writeProgram's callback defined by the user + if (spikeMemory.writeProgramCallback != undefined) { + spikeMemory.writeProgramCallback(); + } + }); + + } + // the package to send is empty, so throw error + else { + throw new Error("package to send is initially empty"); + } + + } + // if the length of data to send is larger than the blocksize, send only a blocksize amount + // and save the remaining data to send packet by packet + else if (stringifiedData.length > blocksize) { + devConsoleLog("data's length is more than the blocksize of " + blocksize); + + var dataToSend = stringifiedData.substring(0, blocksize); // get the first block of packet + devConsoleLog("sending the blocksize amount of data: " + dataToSend) + + var base64data = btoa(dataToSend); // encode the packet to base64 + + ujsonLib.writePackage(base64data, transferid, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); // send the packet + + var remainingData = stringifiedData.substring(blocksize, stringifiedData.length); // remove the portion just sent from data + devConsoleLog("reassigning writePackageInformation with message ID: " + wpRandomId); + devConsoleLog("reassigning writePackageInformation with remainingData: " + remainingData); + + // update package information to be used for sending remaining packets + spikeMemory.writePackageInformation = [wpRandomId, remainingData, transferid, blocksize]; + }); + } + }]; + + sendDATA(command); + + // check if start_write_program received a response after 5 seconds + spikeMemory.writeProgramSetTimeout = setTimeout(function () { + if (spikeMemory.startWriteProgramCallback != undefined) { + funcAfterError("5 seconds have passed without response... Please reboot the hub and try again."); + consoleError("5 seconds have passed without response... Please reboot the hub and try again."); + } + }, 5000) + + }); + } + } + + /** Parse information on devices connected to SPIKE Prime ports + * Effect: Modifies {ports}, {hub} + * @param {object} data_stream portion of prased lastUJSONRPC containing port devices info + * @private + */ + const updateHubPortsInfo = async function (data_stream) { + + var index_to_port = ["A", "B", "C", "D", "E", "F"]; + + // iterate through each port and assign a device_type to {ports} + for (var key = 0; key < 6; key++) { + + let device_value = { "device": "none", "data": {} }; // value to go in ports associated with the port letter keys + + try { + var letter = index_to_port[key]; + + // get SMALL MOTOR information + if (data_stream[key][0] == 48) { + + // parse motor information + var Mspeed = await data_stream[key][1][0]; + var Mangle = await data_stream[key][1][1]; + var Muangle = await data_stream[key][1][2]; + var Mpower = await data_stream[key][1][3]; + + // populate value object + device_value.device = "smallMotor"; + device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; + ports[letter] = device_value; + + } + // get BIG MOTOR information + else if (data_stream[key][0] == 49) { + + // parse motor information + var Mspeed = await data_stream[key][1][0]; + var Mangle = await data_stream[key][1][1]; + var Muangle = await data_stream[key][1][2]; + var Mpower = await data_stream[key][1][3]; + + // populate value object + device_value.device = "bigMotor"; + device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; + ports[letter] = device_value; + } + // get ULTRASONIC sensor information + else if (data_stream[key][0] == 62) { + + // parse ultrasonic sensor information + var Udist = await data_stream[key][1][0]; + + // populate value object + device_value.device = "ultrasonic"; + device_value.data = { "distance": Udist }; + ports[letter] = device_value; + + /* check if callback from wait_for_distance_farther_than() can be executed */ + if (spikeMemory.waitForDistanceFartherThanCallback != undefined) { + let thresholdDistance = spikeMemory.waitForDistanceFartherThanCallback[0]; + + if (Udist > thresholdDistance) { + // current distance is farther than threshold, so execute callback + spikeMemory.waitForDistanceFartherThanCallback[1](); + spikeMemory.waitForDistanceFartherThanCallback = undefined; // reset callback + } + } + + /* check if callback from wait_for_distance_closer_than() can be executed */ + if (spikeMemory.waitForDistanceCloserThanCallback != undefined) { + let thresholdDistance = spikeMemory.waitForDistanceCloserThanCallback[0]; + + if (Udist < thresholdDistance) { + + // current distance is closer than threshold, so execute callback + spikeMemory.waitForDistanceCloserThanCallback[1](); + spikeMemory.waitForDistanceCloserThanCallback = undefined; // reset callback + } + } + } + // get FORCE sensor information + else if (data_stream[key][0] == 63) { + + // parse force sensor information + var Famount = await data_stream[key][1][0]; + var Fbinary = await data_stream[key][1][1]; + var Fbigamount = await data_stream[key][1][2]; + + // convert the binary output to boolean for "pressed" key + if (Fbinary == 1) { + var Fboolean = true; + } else { + var Fboolean = false; + } + // execute callback from ForceSensor.wait_until_pressed() + if (Fboolean) { + // execute call back from wait_until_pressed() if it is defined + if (spikeMemory.funcAfterForceSensorPress !== undefined) + spikeMemory.funcAfterForceSensorPress(); + + // destruct callback function + spikeMemory.funcAfterForceSensorPress = undefined; + + // indicate that the ForceSensor was pressed + spikeMemory.ForceSensorWasPressed = true; + } + // execute callback from ForceSensor.wait_until_released() + else { + // check if the Force Sensor was just released + if (spikeMemory.ForceSensorWasPressed) { + spikeMemory.ForceSensorWasPressed = false; + if (spikeMemory.funcAfterForceSensorRelease !== undefined) + spikeMemory.funcAfterForceSensorRelease(); + spikeMemory.funcAfterForceSensorRelease = undefined; + } + } + + // populate value object + device_value.device = "force"; + device_value.data = { "force": Famount, "pressed": Fboolean, "forceSensitive": Fbigamount } + ports[letter] = device_value; + } + // get COLOR sensor information + else if (data_stream[key][0] == 61) { + + // parse color sensor information + var Creflected = await data_stream[key][1][0]; + var CcolorID = await data_stream[key][1][1]; + var Ccolor = colorDictionary[CcolorID]; + var Cr = await data_stream[key][1][2]; + var Cg = await data_stream[key][1][3]; + var Cb = await data_stream[key][1][4]; + var rgb_array = [Cr, Cg, Cb]; + + // populate value object + device_value.device = "color"; + + // convert Ccolor to lower case because in the SPIKE APP the color is lower case + if (Ccolor !== undefined) + Ccolor = Ccolor.toLowerCase(); + else + Ccolor = "null"; + device_value.data = { "reflected": Creflected, "color": Ccolor, "RGB": rgb_array }; + + // execute wait_until_color callback when color matches its argument + if (spikeMemory.waitUntilColorCallback != undefined) + if (Ccolor == spikeMemory.waitUntilColorCallback[0]) { + spikeMemory.waitUntilColorCallback[1](); + + spikeMemory.waitUntilColorCallback = undefined; + } + + if (spikeMemory.lastDetectedColor != Ccolor) { + + if (spikeMemory.funcAfterNewColor != undefined) { + spikeMemory.funcAfterNewColor(Ccolor); + spikeMemory.funcAfterNewColor = undefined; + } + + spikeMemory.lastDetectedColor = Ccolor; + } + ports[letter] = device_value; + } + /// NOTHING is connected + else if (data_stream[key][0] == 0) { + // populate value object + device_value.device = "none"; + device_value.data = {}; + ports[letter] = device_value; + } + + ports.time = Date.now(); + + //parse hub information + var gyro_x = data_stream[6][0]; + var gyro_y = data_stream[6][1]; + var gyro_z = data_stream[6][2]; + var gyro = [gyro_x, gyro_y, gyro_z]; + hub["gyro"] = gyro; + + var newOri = setHubOrientation(gyro); + // see if currently detected orientation is different from the last detected orientation + if (newOri !== spikeMemory.lastHubOrientation) { + spikeMemory.lastHubOrientation = newOri; + + if (typeof spikeMemory.funcAfterNewOrientation == "function") + spikeMemory.funcAfterNewOrientation(newOri); + spikeMemory.funcAfterNewOrientation = undefined; + } + + var accel_x = data_stream[7][0]; + var accel_y = data_stream[7][1]; + var accel_z = data_stream[7][2]; + var accel = [accel_x, accel_y, accel_z]; + hub["accel"] = accel; + + var posi_x = data_stream[8][0]; + var posi_y = data_stream[8][1]; + var posi_z = data_stream[8][2]; + var pos = [posi_x, posi_y, posi_z]; + hub["pos"] = pos; + + } catch (e) { + console.log(e); + } //ignore errors + } + } + + /** Catch hub events in UJSONRPC + *

Effect:

+ *

Logs in the console when some particular messages are caught

+ *

Assigns the hub events global variables

+ * @private + */ + const PrimeHubEventHandler = async function (parsedUJSON, lastUJSONRPC) { + var messageType = parsedUJSON["m"]; + + //catch runtime_error made at ujsonrpc level + if (messageType == "runtime_error") { + var decodedResponse = atob(parsedUJSON["p"][3]); + + decodedResponse = JSON.stringify(decodedResponse); + consoleError("spike runtime error: " + decodedResponse); + + var splitData = decodedResponse.split(/\\n/); // split the code by every newline + + // execute function after print if defined (only print the last line of error message) + var errorType = splitData[splitData.length - 2]; + + // error is a syntax error + if (errorType.indexOf("SyntaxError") > -1) { + /* get the error line number*/ + var lineNumberLine = splitData[splitData.length - 3]; + devConsoleLog("lineNumberLine: " + lineNumberLine); + var indexLine = lineNumberLine.indexOf("line"); + var lineNumberSubstring = lineNumberLine.substring(indexLine, lineNumberLine.length); + var numberPattern = /\d+/g; + var lineNumber = lineNumberSubstring.match(numberPattern)[0]; + devConsoleLog(lineNumberSubstring.match(numberPattern)); + devConsoleLog("lineNumber: " + lineNumber); + devConsoleLog("typeof lineNumber: " + typeof lineNumber); + var lineNumberInNumber = parseInt(lineNumber) - 5; + devConsoleLog("typeof lineNumberInNumber: " + typeof lineNumberInNumber); + + funcAfterError("line " + lineNumberInNumber + ": " + errorType); + } + else { + funcAfterError(errorType); + } + } + else if (messageType == 0) { + /* + DEV NOTE (26/12/2020): + messageType = 0 is regular UJSONRPC stream. + Pixel matrix SOMETIMES shows in this message, but exactly when is not clear. + */ + // console.log("%cTuftsCEEO ", "color: #3ba336;", lastUJSONRPC); + } + // storage information + else if (messageType == 1) { + + var storageInfo = parsedUJSON["p"]["slots"]; // get info of all the slots + + for (var slotid in storageInfo) { + hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable + } + + } + // battery status + else if (messageType == 2) { + hub.batteryAmount = parsedUJSON["p"][1]; + } + // give center button click, left, right (?) + else if (messageType == 3) { + devConsoleLog(lastUJSONRPC); + if (parsedUJSON.p[0] == "center") { + hub.mainButton.pressed = true; + + if (parsedUJSON.p[1] > 0) { + hub.mainButton.pressed = false; + hub.mainButton.duration = parsedUJSON.p[1]; + } + } + else if (parsedUJSON.p[0] == "connect") { + hub.bluetoothButton.pressed = true; + + if (parsedUJSON.p[1] > 0) { + hub.bluetoothButton.pressed = false; + hub.bluetoothButton.duration = parsedUJSON.p[1]; + } + } + else if (parsedUJSON.p[0] == "left") { + hub.leftButton.pressed = true; + + // execute callback for wait_until_pressed() if defined + if (spikeMemory.funcAfterLeftButtonPress != undefined) { + spikeMemory.funcAfterLeftButtonPress(); + } + spikeMemory.funcAfterLeftButtonPress = undefined; + + if (parsedUJSON.p[1] > 0) { + hub.leftButton.pressed = false; + hub.leftButton.duration = parsedUJSON.p[1]; + + // execute callback for wait_until_released() if defined + if (spikeMemory.funcAfterLeftButtonRelease != undefined) { + spikeMemory.funcAfterLeftButtonRelease(); + } + + spikeMemory.funcAfterLeftButtonRelease = undefined; + } + + } + else if (parsedUJSON.p[0] == "right") { + hub.rightButton.pressed = true; + + // execute callback for wait_until_pressed() if defined + if (spikeMemory.funcAfterRightButtonPress != undefined) { + spikeMemory.funcAfterRightButtonPress(); + } + + spikeMemory.funcAfterRightButtonPress = undefined; + + if (parsedUJSON.p[1] > 0) { + hub.rightButton.pressed = false; + hub.rightButton.duration = parsedUJSON.p[1]; + + // execute callback for wait_until_released() if defined + if (spikeMemory.funcAfterRightButtonRelease != undefined) { + spikeMemory.funcAfterRightButtonRelease(); + } + + spikeMemory.funcAfterRightButtonRelease = undefined; + } + } + + } + else if (messageType == 4) { + var newGesture = parsedUJSON.p; + + if (newGesture == "3") { + hub.gesture = "freefall"; + spikeMemory.hubGestures.push(hub.gesture); + } + else if (newGesture == "2") { + hub.gesture = "shaken"; + spikeMemory.hubGestures.push(hub.gesture); // the string is different at higher level + } + else if (newGesture == "1") { + hub.frontEvent = "doubletapped"; + hub.gesture = "doubletapped"; + spikeMemory.hubGestures.push(hub.gesture); + } + else if (newGesture == "0") { + hub.frontEvent = "tapped"; + hub.gesture = "tapped"; + spikeMemory.hubGestures.push(hub.gesture); + } + devConsoleLog("hubGesture in virtualSpike: " + hub.gesture); + // execute funcAfterNewGesture callback that was taken at wait_for_new_gesture() + if (typeof spikeMemory.funcAfterNewGesture === "function") { + spikeMemory.funcAfterNewGesture(hub.gesture); + spikeMemory.funcAfterNewGesture = undefined; + } + + devConsoleLog(lastUJSONRPC); + + } + else if (messageType == 7) { + funcAfterPrint(">>> Program started!"); + } + else if (messageType == 8) { + funcAfterPrint(">>> Program finished!"); + } + else if (messageType == 9) { + var encodedName = parsedUJSON["p"]; + var decodedName = atob(encodedName); + hub.name = decodedName; + + if (spikeMemory.triggerCurrentStateCallback != undefined) { + spikeMemory.triggerCurrentStateCallback(); + } + } + else if (messageType == 11) { + devConsoleLog(lastUJSONRPC); + } + else if (messageType == 12) { + // this is usually the response from trigger_current_state, don't console log to avoid spam + } + // gives orientation of the hub (leftside, up,..) + else if (messageType == 14) { + /* this data stream is about hub orientation */ + + var newOrientation = parsedUJSON.p; + // console.log(newOrientation); + if (newOrientation == "1") { + spikeMemory.lastHubOrientation = "up"; + } + else if (newOrientation == "4") { + spikeMemory.lastHubOrientation = "down"; + } + else if (newOrientation == "0") { + spikeMemory.lastHubOrientation = "front"; + } + else if (newOrientation == "3") { + spikeMemory.lastHubOrientation = "back"; + } + else if (newOrientation == "2") { + spikeMemory.lastHubOrientation = "rightside"; + } + else if (newOrientation == "5") { + spikeMemory.lastHubOrientation = "leftside"; + } + + devConsoleLog(lastUJSONRPC); + } + else { + devConsoleLog("received response: " + lastUJSONRPC); + + // general parameters check + if (parsedUJSON["r"]) { + if (parsedUJSON["r"]["slots"]) { + + var storageInfo = parsedUJSON["r"]["slots"]; // get info of all the slots + + for (var slotid in storageInfo) { + hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable + } + + } + } + + // getFirmwareInfo callback check + if (spikeMemory.getFirmwareInfoCallback != undefined) { + if (spikeMemory.getFirmwareInfoCallback[0] == parsedUJSON["i"]) { + var version = parsedUJSON["r"]["runtime"]["version"]; + var stringVersion = "" + for (var index in version) { + if (index < version.length - 1) { + stringVersion = stringVersion + version[index] + "."; + } + else { + stringVersion = stringVersion + version[index]; + } + } + // console.log("%cTuftsCEEO ", "color: #3ba336;", "firmware version: ", stringVersion); + spikeMemory.getFirmwareInfoCallback[1](stringVersion); + } + } + + /* See if any of the stored responseCallbacks need to be executed due to this UJSONRPC response */ + for (var index = 0; index < spikeMemory.responseCallbacks.length; index++) { + + var currCallbackInfo = spikeMemory.responseCallbacks[index]; + + if (currCallbackInfo != undefined) { + + if (currCallbackInfo[0] == parsedUJSON["i"]) { + /* the message id of UJSONRPC corresponds to that of a response callback */ + + var response = "null"; + + // parse motor stoppage reason responses + if (parsedUJSON["r"] == 0) { + response = "done"; + } + else if (parsedUJSON["r"] == 2) { + response = "stalled"; + } + + // execute callback with the response + currCallbackInfo[1](response); + + // empty the index of which callback that was just executed + spikeMemory.responseCallbacks[index] = undefined; + } + } + } + + // execute the callback function after sending start_write_program UJSONRPC + if (spikeMemory.startWriteProgramCallback != undefined) { + + devConsoleLog("startWriteProgramCallback is defined. Looking for matching mesasage id: " + spikeMemory.startWriteProgramCallback[0]); + // check if the message id of UJSONRPC corresponds to that of a response callback + if (spikeMemory.startWriteProgramCallback[0] == parsedUJSON["i"]) { + + devConsoleLog("matching message id detected with startWriteProgramCallback[0]: " + spikeMemory.startWriteProgramCallback[0]); + + // get the information for the packet sending + var blocksize = parsedUJSON["r"]["blocksize"]; // maximum size of each packet to be sent in bytes + var transferid = parsedUJSON["r"]["transferid"]; // id to use for transferring this program + + devConsoleLog("executing writePackageFunc expecting transferID of " + transferid); + + // execute callback + await spikeMemory.startWriteProgramCallback[1](blocksize, transferid); + + devConsoleLog("deallocating startWriteProgramCallback"); + + // deallocate callback + spikeMemory.startWriteProgramCallback = undefined; + } + + } + + // check if the program should write packages for a program + if (spikeMemory.writePackageInformation != undefined) { + + devConsoleLog("writePackageInformation is defined. Looking for matching mesasage id: " + spikeMemory.writePackageInformation[0]); + + // check if the message id of UJSONRPC corresponds to that of the first write_package script that was sent + if (spikeMemory.writePackageInformation[0] == parsedUJSON["i"]) { + + devConsoleLog("matching message id detected with writePackageInformation[0]: " + spikeMemory.writePackageInformation[0]); + + // get the information for the package sending process + var remainingData = spikeMemory.writePackageInformation[1]; + var transferID = spikeMemory.writePackageInformation[2]; + var blocksize = spikeMemory.writePackageInformation[3]; + + // the size of the remaining data to send is less than or equal to blocksize + if (remainingData.length <= blocksize) { + devConsoleLog("remaining data's length is less than or equal to blocksize"); + + // the size of remaining data is not zero + if (remainingData.length != 0) { + + var dataToSend = remainingData.substring(0, remainingData.length); + + devConsoleLog("remaining data's length is not zero, sending entire remaining data: " + dataToSend); + + var base64data = btoa(dataToSend); + + ujsonLib.writePackage(base64data, transferID, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); + + devConsoleLog("deallocating writePackageInforamtion"); + + if (spikeMemory.writeProgramCallback != undefined) { + spikeMemory.writeProgramCallback(); + } + + spikeMemory.writePackageInformation = undefined; + }); + } + } + // the size of remaining data is more than the blocksize + else if (remainingData.length > blocksize) { + devConsoleLog("remaining data's length is more than blocksize"); + + var dataToSend = remainingData.substring(0, blocksize); + + devConsoleLog("sending blocksize amount of data: " + dataToSend); + + var base64data = btoa(dataToSend); + + ujsonLib.writePackage(base64data, transferID, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); + + devConsoleLog("expected response with message id of " + wpRandomId) + + var remainingData = remainingData.substring(blocksize, remainingData.length); + + spikeMemory.writePackageInformation = [wpRandomId, remainingData, transferID, blocksize]; + }); + } + } + } + } + } + + /** Get the orientation of the hub based on gyroscope values + * + * @private + * @param {(number|Array)} gyro + */ + const setHubOrientation = function (gyro) { + var newOrientation; + if (gyro[0] < 500 && gyro[0] > -500) { + if (gyro[1] < 500 && gyro[1] > -500) { + + if (gyro[2] > 500) { + newOrientation = "front"; + } + else if (gyro[2] < -500) { + newOrientation = "back"; + } + } + else if (gyro[1] > 500) { + newOrientation = "up"; + } + else if (gyro[1] < -500) { + newOrientation = "down"; + } + } else if (gyro[0] > 500) { + newOrientation = "rightside"; + } + else if (gyro[0] < -500) { + newOrientation = "leftside"; + } + + return newOrientation; + } + + /** + * + * @private + * @param {string} id + * @param {function} cb + */ + const pushResponseCallback = function (id, cb) { + var toPush = []; // [ ujson string id, function pointer ] + + toPush.push(id); + toPush.push(cb); + + // responseCallbacks has elements in it + if (spikeMemory.responseCallbacks.length > 0) { + + var emptyFound = false; // empty index was found flag + + // insert the pointer to the function where index is empty + for (var index in spikeMemory.responseCallbacks) { + if (spikeMemory.responseCallbacks[index] == undefined) { + spikeMemory.responseCallbacks[index] = toPush; + emptyFound = true; + } + } + + // if all indices were full, push to the back + if (!emptyFound) { + spikeMemory.responseCallbacks.push(toPush); + } + + } + // responseCallbacks current has no elements in it + else { + spikeMemory.responseCallbacks.push(toPush); + } + } + + const sendDATA = function (command) { + spikeRPC.sendDATA(command); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passConnectCallback = function (f) { + funcAfterConnect = f; + spikeRPC.passConnectCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passDisconnectCallback = function (f) { + funcAfterDisconnect = f; + spikeRPC.passDisconnectCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passErrorCallback = function (f) { + funcAfterError = f; + spikeRPC.passErrorCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passPrintCallback = function (f) { + funcAfterPrint = f; + spikeRPC.passPrintCallback(f); + } + + const passStreamCallback = function (f) { + spikeRPC.executeWithStream(f); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** Sleep function + * @private + * @param {number} ms Miliseconds to sleep + * @returns {Promise} + */ + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + + + return { + init: init, + spikeMemory: spikeMemory, + ports, + hub: hub, + writeProgram: writeProgram, + sendDATA: sendDATA, + pushResponseCallback: pushResponseCallback, + // key event callback setters + passConnectCallback: passConnectCallback, + passDisconnectCallback: passDisconnectCallback, + passErrorCallback: passErrorCallback, + passPrintCallback: passPrintCallback, + passStreamCallback: passStreamCallback + } + +} +/* +Project Name: SPIKE Prime Web Interface +File name: ServiceDock_SPIKE_HTML.js +Author: Jeremy Jung +Last update: 3/14/2021 +Description: HTML Element definition for to be used in ServiceDocks +Credits/inspirations: +History: + Created by Jeremy on 7/16/20 + Fixed baudRate by Teddy on 10/11/20 +(C) Tufts Center for Engineering Education and Outreach (CEEO) +TODO: +uncomment executeAfterDisconnect +*/ + +class servicespike extends HTMLElement { + + constructor() { + super(); + + var active = false; // whether the service was activated + this.service = new Service_SPIKE(); // instantiate a service object ( one object per button ) + + this.service.executeAfterDisconnect(function () { + active = false; + status.style.backgroundColor = "red"; + }) + + // Create a shadow root + var shadow = this.attachShadow({ mode: 'open' }); + + /* wrapper definition and CSS */ + + var wrapper = document.createElement('div'); + wrapper.setAttribute('class', 'wrapper'); + wrapper.setAttribute("style", "width: 50px; height: 50px; position: relative; margin-top: 10px;") + + /* ServiceDock button definition and CSS */ + + var button = document.createElement("button"); + button.setAttribute("id", "sl_button"); + button.setAttribute("class", "SD_button"); + + //var imageRelPath = "./modules/views/SPIKE_button.png" // relative to the document in which a servicespike is created ( NOT this file ) + var length = 50; // for width and height of button + var buttonBackgroundColor = "#A2E1EF" // background color of the button + var buttonStyle = "width:" + length + "px; height:" + length + "px; background:" + "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAACXBIWXM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jd0f915fBHncnr8PtEFBV4Oqfdgz67TJoI7VAgQgyBRDcmb4TF6JDkT1AxchH7SPWT9KaEmcIV6STnQlPRVamU7oFbgHJQ4Vdics3KAuTjM/pEvc80l0UQDQMdwS691iIBNaAp8tgXhsAtHyRTsV1aYCcRcLg0iyijEPQANdFOM3ezWysCAwH+VCzk+ArCYCJIHucN5CAP4AP8DPgAdOWPuMjSoAAAAvBf8uTzcKfBDf448IB+ee2Q7CYg3H3wted+8esnvvvuvrb6Y3QuAQCl+7dff6kr8U+68v+oM34DvkwUPK079nbtE7znAfaUMoATYoA8KfFXqxbOKTRIdDTfQAMaFdKZuiXwC3UWa16+68H1UDknqK7ysaacJlHW7iXlCupUFYHIejKUA3yTvyhl5Hgy5LVdPgBI74Rg8jLtAzD/Mc0Lsn8Tiwt4MwETpt2byr2dgJeDOfrBAYAUEKTAP8yTnjGQ0x2g+AriyItwjG51r9sZ+GDrrt558V/+/QguiM49AKA0vD1w2O8O3Oh3Bro6e6FL7tLwWgce1+HcSTEFa1b0rVeZrUjG74DE1SkMILas8kOAc4KZ3TUSXfuOcTwEamAs1iUwz7iEPxCkU5H8dnbGPygETFFXnsRyCWVQB37iaponRsql8pkBKgsAXMiRVqPNKGmGBEhKQVZsrPo6HJi2+aNdaMjk7U8DES+N5Ml+RSiVNQM7AWwUVvheQCAFBzLog6dHC/5sV2DXOK4D+f4Hx935UReofNQx3Dvbwr0Xf/b+Xu/rW+h3mmpbrGQmFkMAAAAASUVORK5CYII=')" + " no-repeat; background-size: 50px 50px; background-color:" + buttonBackgroundColor + + "; border: none; background-position: center; cursor: pointer; border-radius: 10px; position: relative; margin: 4px 0px; " + button.setAttribute("style", buttonStyle); + + /* status circle definition and CSS */ + + var status = document.createElement("div"); + status.setAttribute("class", "status"); + var length = 20; // for width and height of circle + var statusBackgroundColor = "red" // default background color of service (inactive color) + var posLeft = 30; + var posTop = 20; + var statusStyle = "border-radius: 50%; height:" + length + "px; width:" + length + "px; background-color:" + statusBackgroundColor + + "; position: relative; left:" + posLeft + "px; top:" + posTop + "px;"; + status.setAttribute("style", statusStyle); + + /* event listeners */ + + button.addEventListener("mouseleave", function (event) { + button.style.backgroundColor = "#A2E1EF"; + button.style.color = "#000000"; + }); + + button.addEventListener("mouseenter", function (event) { + button.style.backgroundColor = "#FFFFFF"; + button.style.color = "#000000"; + }) + + // when ServiceDock button is double clicked + this.addEventListener("click", async function () { + // check active flag so once activated, the service doesnt reinit + if (!active) { + if ('serial' in navigator) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "Activating SPIKE Service"); + + // Determine if Service is for testing + if (this.isDev == "true" || this.isDev == "t" + || this.isDev == "T" || this.isDev == "True") + this.isDev = true; + else + this.isDev = false; + + var initSuccessful = await this.service.init(this.isDev); + if (initSuccessful) { + active = true; + status.style.backgroundColor = "green"; + } + } + else { + var bodyTags = document.getElementsByTagName("body"); + if (bodyTags != undefined) { + var bodyTag = document.getElementsByTagName("body")[0]; + bodyTag.innerHTML = ` +
+

+ To use the ServiceDock's LEGO SPIKE Prime Service, you must enable the WebSerial API in your + browser. To do so, please + make sure: +

+

+
    +
  1. You are using the + + Google Chrome browser.
  2. +
    +
  3. The following chrome flags are enabled on chrome://flags.
  4. +
+
    +
  • Mac OSX user? #enable-experimental-web-platform-features
  • +
  • Windows user? #enable-experimental-web-platform-features AND #new-usb-backend
  • +
+

+

+ To enable these flags: +

+

+
    +
  1. In your Browser URL, visit + chrome://flags
  2. +
    +
  3. Set the your required flags to "Enabled" via dropdown
  4. +
    +
  5. Relaunch the browser to have changes take effect
  6. +
    +
  7. Revisit your Coding Rooms classroom (this website)
  8. +
    +
+

+ `; + } + else { + alert("Error: Please make sure you are using GOOGLE CHROME with the #enable-experimental-web-platform-features flag ENABLED") + } + } + } else { + this.service.rebootHub(); + } + }); + + + shadow.appendChild(wrapper); + button.appendChild(status); + wrapper.appendChild(button); + + } + + static get observedAttributes() { + return ["dev"]; + } + + get dev() { + return this.getAttribute("dev"); + } + + set dev(val) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", val); + if (val) { + this.setAttribute("dev", val); + } + else { + this.removeAttribute("dev"); + } + } + + attributeChangedCallback(name, oldValue, newValue) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "new value of dev: ", newValue); + this.isDev = newValue; + } + + /* get the Service_SPIKE object */ + getService() { + return this.service; + } + + /* get whether the ServiceDock button was clicked */ + getClicked() { + return this.active; + } + +} + +// when defining custom element, the name must have at least one - dash +window.customElements.define('service-spike', servicespike); + +/* +Project Name: SPIKE Prime Web Interface +File name: Service_SPIKE.js +Author: Jeremy Jung +Last update: 3/14/21 +Description: Main interface for users to interact with their SPIKE Primes. +Credits/inspirations: + Based on code wrriten by Ethan Danahy, Chris Rogers +History: + Created by Jeremy on 7/15/20 +LICENSE: MIT +(C) Tufts Center for Engineering Education and Outreach (CEEO) +*/ + + + +/** + * @class Service_SPIKE + * @classdesc + * ServiceDock library for interfacing with LEGO® SPIKE™ Prime + * @example + * // assuming you declared with the id, "service_spike" + * var serviceSPIKE = document.getElemenyById("service_spike").getService(); + * serviceSPIKE.executeAfterInit(async function() { + * // write code here + * }) + * + * serviceSPIKE.init(); + */ +function Service_SPIKE () { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // Service Dock variables + let virtualSpike = new _virtualSpike(); + let ujsonLib = _SpikeUjsonLib; + let serviceActive = false; // flag for service initialization state + + // flag for development + let dev = false; + + var funcAtInit = () => {} + var funcAfterPrint = (m) => {}; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => {}; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => {}; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => {}; // function to call after SPIKE Prime is connected + var funcWithStream = () => {} // function to call during SPIKE Prime data stream + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + /** Connect to a webserial port and begin data stream with hub + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + console.log(dev); + let serviceActive = await virtualSpike.init(isDev); + + if (serviceActive === true) { + await sleep(1000); + } + + devConsoleLog("serviceActive: " + serviceActive); + return serviceActive; + } + catch (e) { + consoleError(e); + } + + + // initialize web serial connection + // var webSerialConnected = await initWebSerial(); + + // if (webSerialConnected) { + + // start streaming UJSONRPC + // streamUJSONRPC(); + + // await sleep(1000); + + // triggerCurrentState(); + // getFirmwareInfo(function (version) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "This SPIKE Prime is using Hub OS ", version); + // }); + // serviceActive = true; + + // await sleep(2000); // wait for service to init + + // // call funcAtInit if defined + // if (funcAtInit !== undefined) { + // funcAtInit(); + // } + // return true; + // } + // else { + // return false; + // } + } + + const isActive = function () { + return serviceActive; + } + + /** The PrimeHub object includes controllable interfaces ("constants") for your SPIKE Prime, such as left_button, right_button, motion_sensor, and light_matrix. + * @namespace + * @memberof Service_SPIKE + * @example + * // Initialize the Hub + * var hub = new serviceSPIKE.PrimeHub() + */ + const PrimeHub = function () { + var newOrigin = 0; + + /** The left button on the hub + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.left_button + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * // do something with left_button + */ + var left_button = {}; + + /** execute callback after this button is pressed + * @param {function} callback function to run when button is pressed + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * left_button.wait_until_pressed ( function () { + * console.log("left_button was pressed"); + * }) + * + */ + left_button.wait_until_pressed = function (callback) { + virtualSpike.spikeMemory.funcAfterLeftButtonPress = callback; + } + /** execute callback after this button is released + * + * @param {function} callback function to run when button is released + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * left_button.wait_until_released ( function () { + * console.log("left_button was released"); + * }) + */ + left_button.wait_until_released = function (callback) { + virtualSpike.spikeMemory.funcAfterLeftButtonRelease = callback; + } + /** Tests to see whether the button has been pressed since the last time this method called. + * + * @returns {boolean} - True if was pressed, false otherwise + * @example + * if (left_button.was_pressed()) { + * console.log("left_button was pressed") + * } + */ + left_button.was_pressed = function () { + if (virtualSpike.hub.leftButton.duration > 0) { + virtualSpike.hub.leftButton.duration = 0; + return true; + } else { + return false; + } + } + + /** Tests to see whether the button is pressed + * + * @returns {boolean} True if pressed, false otherwise + * @example + * if (left_button.is_pressed()) { + * console.log("left_button is pressed") + * } + */ + left_button.is_pressed = function () { + if (virtualSpike.hub.leftButton.pressed) { + return true; + } + else { + return false; + } + } + + /** The right button on the hub + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from PrimeHub.right_button + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * // do something with right_button + */ + var right_button = {}; + + /** execute callback after this button is pressed + * + * @param {function} callback function to run when button is pressed + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * right_button.wait_until_pressed ( function () { + * console.log("right_button was pressed"); + * }) + */ + right_button.wait_until_pressed = function (callback) { + + virtualSpike.spikeMemory.funcAfterRightButtonPress = callback; + } + + /** execute callback after this button is released + * + * @param {function} callback function to run when button is released + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * right_button.wait_until_released ( function () { + * console.log("right_button was released"); + * }) + */ + right_button.wait_until_released = function (callback) { + + virtualSpike.spikeMemory.funcAfterRightButtonRelease = callback; + } + + /** Tests to see whether the button has been pressed since the last time this method called. + * + * @returns {boolean} - True if was pressed, false otherwise + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * if ( hub.right_button.was_pressed() ) { + * console.log("right_button was pressed"); + * } + */ + right_button.was_pressed = function () { + if (virtualSpike.hub.rightButton.duration > 0) { + virtualSpike.hub.rightButton.duration = 0; + return true; + } else { + return false; + } + } + + /** Tests to see whether the button is pressed + * + * @returns {boolean} True if pressed, false otherwise + * @example + * if (right_button.is_pressed()) { + * console.log("right_button is pressed") + * } + */ + right_button.is_pressed = function () { + if (virtualSpike.hub.rightButton.pressed) { + return true; + } + else { + return false; + } + } + /** Following are all of the functions that are linked to the Hub’s programmable Brick Status Light. + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.light_matrix + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var status_light = hub.status_light; + * // do something with status_light + */ + var status_light = {}; + + /** Sets the color of the light. + * @param {string} color ["azure","black","blue","cyan","green","orange","pink","red","violet","yellow","white"] + * @example + * var hub = new Primehub() + * hub.status_light.on("blue") + * + */ + status_light.on = function (color) { + let dictColor = { + "azure": 4, + "black": 12, + "blue": 3, + "cyan": 5, + "green": 6, + "orange": 8, + "pink": 1, + "red": 9, + "violet": 2, + "yellow": 7, + "white": 10 + } + + let intColor = dictColor[color]; + ujsonLib.centerButtonLightUp(intColor, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Turns off the light. + * @example + * var hub = new Primehub() + * hub.status_light.off() + */ + status_light.off = function () { + ujsonLib.centerButtonLightUp(0, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Hub's light matrix + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.light_matrix + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var light_matrix = hub.light_matrix; + * // do something with light_matrix + */ + var light_matrix = {}; + + /** + * @todo Implement this function + * @ignore + * @param {string} + */ + light_matrix.show_image = function (image) { + + } + /** Sets the brightness of one pixel (one of the 25 LED) on the Light Matrix. + * + * @param {integer} x [0 to 4] + * @param {integer} y [0 to 4] + * @param {integer} brightness [0 to 100] + */ + light_matrix.set_pixel = function (x, y, brightness = 100) { + ujsonLib.displaySetPixel(x, y, brightness, (c, rid) => virtualSpike.sendDATA(c)); + + } + /** Writes text on the Light Matrix, one letter at a time, scrolling from right to left. + * + * @param {string} message + */ + light_matrix.write = function (message) { + ujsonLib.displayText(message, (c, rid) => virtualSpike.sendDATA(c)); + } + /** Turns off all the pixels on the Light Matrix. + * + */ + light_matrix.off = function () { + ujsonLib.displayClear((c, rid) => virtualSpike.sendDATA(c)); + } + + /** Hub's speaker + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from Primehub.speaker + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var speaker = hub.speaker; + * // do something with speaker + */ + var speaker = {}; + + speaker.volume = 100; + + /** Plays a beep on the Hub. + * + * @param {integer} note The MIDI note number [44 to 123 (60 is middle C note)] + * @param {number} seconds The duration of the beep in seconds + */ + speaker.beep = function (note, seconds) { + ujsonLib.soundBeep(speaker.volume, note, (c, rid) => virtualSpike.sendDATA(c)); + setTimeout(function () { ujsonLib.soundStop((c, rid) => virtualSpike.sendDATA(c)) }, seconds * 1000); + } + + /** Starts playing a beep. + * + * @param {integer} note The MIDI note number [44 to 123 (60 is middle C note)] + */ + speaker.start_beep = function (note) { + ujsonLib.soundBeep(speaker.volume, note, (c, rid) => virtualSpike.sendDATA(c)) + } + + /** Stops any sound that is playing. + * + */ + speaker.stop = function () { + ujsonLib.soundStop((c, rid) => virtualSpike.sendDATA(c)); + } + + /** Retrieves the value of the speaker volume. + * @returns {number} The current volume [0 to 100] + */ + speaker.get_volume = function () { + return speaker.volume; + } + + /** Sets the speaker volume. + * + * @param {integer} newVolume + */ + speaker.set_volume = function (newVolume) { + speaker.volume = newVolume + } + + /** Hub's motion sensor + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from PrimeHub.motion_sensor + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var motion_sensor = hub.motion_sensor; + * // do something with motion_sensor + */ + var motion_sensor = {}; + + /** Sees whether a gesture has occurred since the last time was_gesture() + * was used or since the beginning of the program (for the first use). + * + * @param {string} gesture + * @returns {boolean} true if the gesture was made, false otherwise + */ + motion_sensor.was_gesture = function (gesture) { + + var gestureWasMade = false; + + // iterate over the hubGestures array + for (let index in virtualSpike.spikeMemory.hubGestures) { + + // pick a gesture from the array + var oneGesture = virtualSpike.spikeMemory.hubGestures[index]; + + // switch the flag that gesture existed + if (oneGesture == gesture) { + gestureWasMade = true; + break; + } + } + // reinitialize hubGestures so it only holds gestures that occurred after this was_gesture() execution + virtualSpike.spikeMemory.hubGestures = []; + + return gestureWasMade; + + } + + /** Executes callback when a new gesture happens + * + * @param {function(string)} callback - A callback of which argument is name of the gesture + * @example + * motion_sensor.wait_for_new_gesture( function ( newGesture ) { + * if ( newGesture == 'tapped') { + * console.log("SPIKE was tapped") + * } + * else if ( newGesture == 'doubletapped') { + * console.log("SPIKE was doubletapped") + * } + * else if ( newGesture == 'shaken') { + * console.log("SPIKE was shaken") + * } + * else if ( newGesture == 'freefall') { + * console.log("SPIKE was freefall") + * } + * }) + */ + motion_sensor.wait_for_new_gesture = function (callback) { + + virtualSpike.spikeMemory.funcAfterNewGesture = callback; + + } + + /** Executes callback when the orientation of the Hub changes or when function was first called + * + * @param {function(string)} callback - A callback whose signature is name of the orientation + * @example + * motion_sensor.wait_for_new_orientation( function ( newOrientation ) { + * if (newOrientation == "up") { + * console.log("orientation is up"); + * } + * else if (newOrientation == "down") { + * console.log("orientation is down"); + * } + * else if (newOrientation == "front") { + * console.log("orientation is front"); + * } + * else if (newOrientation == "back") { + * console.log("orientation is back"); + * } + * else if (newOrientation == "leftSide") { + * console.log("orientation is leftSide"); + * } + * else if (newOrientation == "rightSide") { + * console.log("orientation is rightSide"); + * } + * }) + */ + motion_sensor.wait_for_new_orientation = function (callback) { + // immediately return current orientation if the method was called for the first time + if (virtualSpike.spikeMemory.waitForNewOriFirst) { + virtualSpike.spikeMemory.waitForNewOriFirst = false; + callback(virtualSpike.spikeMemory.lastHubOrientation); + } + // for future executions, wait until new orientation + else { + virtualSpike.spikeMemory.funcAfterNewOrientation = callback; + } + + } + + /** “Yaw” is the rotation around the front-back (vertical) axis. + * + * @returns {integer} yaw angle + */ + motion_sensor.get_yaw_angle = function get_yaw_angle() { + var currPos = virtualSpike.hub.pos[0]; + + return currPos; + } + + /** “Pitch” the is rotation around the left-right (transverse) axis. + * + * @returns {integer} pitch angle + */ + motion_sensor.get_pitch_angle = function get_pitch_angle() { + return virtualSpike.hub.pos[1]; + } + + /** “Roll” the is rotation around the front-back (longitudinal) axis. + * + * @returns {integer} roll angle + */ + motion_sensor.get_roll_angle = function get_roll_angle() { + return virtualSpike.hub.pos[2]; + } + + /** Gets the acceleration of the SPIKE's yaw axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_yaw_acceleration = function get_yaw_acceleration() { + return virtualSpike.hub.pos[2]; + } + + /** Gets the acceleration of the SPIKE's pitch axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_pitch_acceleration = function get_pitch_acceleration() { + return virtualSpike.hub.pos[1]; + } + + /** Gets the acceleration of the SPIKE's roll axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_roll_acceleration = function get_roll_acceleration() { + return virtualSpike.hub.pos[0]; + } + + /** Retrieves the most recently detected gesture. + * + * @returns {string} the name of gesture + */ + motion_sensor.get_gesture = function get_gesture() { + devConsoleLog("hubGesture in Service: " + virtualSpike.hub.gesture); + return virtualSpike.hub.gesture; + } + + /** Retrieves the most recently detected orientation + * Note: Hub does not detect orientation of when it was connected + * + * @returns {string} the name of orientation + */ + motion_sensor.get_orientation = function get_orientation() { + return virtualSpike.spikeMemory.lastHubOrientation; + } + + return { + motion_sensor: motion_sensor, + light_matrix: light_matrix, + left_button: left_button, + right_button: right_button, + speaker: speaker + } + } + + /** Motor + * @namespace + * @memberof! Service_SPIKE + * @param {string} Port + * @returns {functions} + * @example + * // Initialize the Motor + * var motor = new serviceSPIKE.Motor("A") + */ + const Motor = function (port) { + + var motor = virtualSpike.ports[port]; // get the motor info by port + + // default settings + var defaultSpeed = 100; + var stopMethod = 1; // stop method doesnt seem to work in this current ujsonrpc config + var stallSetting = true; + + var direction = { + COUNTERCLOCKWISE: 'counterClockwise', + CLOCKWISE: 'clockwise' + } + + // check if device is a motor + if (motor.device != "smallMotor" && motor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + + /** Get current speed of the motor + * + * @returns {number} speed of motor [-100 to 100] + */ + function get_speed() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.speed; + + } + + /** Get current position of the motor. The position may differ by a little margin from + * the position to which a motor ran with run_to_position() + * @returns {number} position of motor [0 to 359] + */ + function get_position() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + let position = motorInfo.uAngle; + if (position < 0) + position = 360 + position; + return position; + } + + /** Get current degrees counted of the motor + * + * @returns {number} counted degrees of the motor [any number] + */ + function get_degrees_counted() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.angle; + } + + /** Get the power of the motor + * + * @returns {number} motor power + */ + function get_power() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.power; + } + + /** Get the default speed of this motor + * + * @returns {number} motor default speed [-100 to 100] + */ + function get_default_speed() { + return defaultSpeed; + } + + /** Set the default speed for this motor + * + * @param {number} speed [-100 to 100] + */ + function set_default_speed(speed) { + if (typeof speed == "number") { + defaultSpeed = speed; + } + } + + /** Turns stall detection on or off. + * Stall detection senses when a motor has been blocked and can’t move. + * If stall detection has been enabled and a motor is blocked, the motor will be powered off + * after two seconds and the current motor command will be interrupted. If stall detection has been + * disabled, the motor will keep trying to run and programs will “get stuck” until the motor is no + * longer blocked. + * @param {boolean} boolean - true if to detect stall, false otherwise + */ + function set_stall_detection(boolean) { + if (boolean === true) + stallSetting = 1; + else if (boolean === false) + stallSetting = 0; + else + throw new Error("argument of set_stall_detection must be a boolean type") + } + + + /** Runs the motor to an absolute position. + * The sign of the speed will be ignored (i.e., absolute value), and the motor will always travel in the direction that’s been specified by the "direction" parameter. + * If the speed is greater than "100," it will be limited to "100." + + * @param {integer} degrees [0 to 359] + * @param {string} direction "Clockwise" or "Counterclockwise" + * @param {integer} speed [-100 to 100] + * @param {function} callback Params: "stalled" or "done" + * @ignore + * @example + * motor.run_to_position(180, 100, function() { + * console.log("motor finished moving"); + * }) + */ + function run_to_position(degrees, direction, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Runs the motor until the number of degrees counted is equal to the value that has been specified by the "degrees" parameter. + * + * @param {integer} degrees any number + * @param {integer} speed [0 to 100] + * @param {any} [callback] (optional callback) callback param: "stalled" or "done" + */ + function run_to_degrees_counted(degrees, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Start the motor at some power + * + * @param {integer} power [-100 to 100] + */ + function start_at_power(power) { + ujsonLib.motorPwm(port, power, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + + /** Start the motor at some speed + * + * @param {integer} speed [-100 to 100] + */ + function start(speed = defaultSpeed) { + // if (speed !== undefined && typeof speed == "number") { + // ujsonLib.motorStart (port, speed, stallSetting); + // } + // else { + // ujsonLib.motorStart(port, defaultSpeed, stallSetting); + // } + + ujsonLib.motorStart(port, speed, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Run the motor for some seconds + * + * @param {integer} seconds + * @param {integer} speed [-100 to 100] + * @param {function} [callback==undefined] Parameters:"stalled" or "done" + * @example + * motor.run_for_seconds(10, 100, function() { + * console.log("motor just ran for 10 seconds"); + * }) + */ + function run_for_seconds(seconds, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorRunTimed(port, seconds, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Run the motor for some degrees + * + * @param {integer} degrees + * @param {integer} speed [-100 to 100] + * @param {function} [callback==undefined] Parameters:"stalled" or "done" + * motor.run_for_degrees(720, 100, function () { + * console.log("motor just ran for 720 degrees"); + * }) + */ + function run_for_degrees(degrees, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorRunDegrees(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }) + } + + /** Stop the motor + * + */ + function stop() { + ujsonLib.motorPwm(port, 0, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + run_to_position: run_to_position, + run_to_degrees_counted: run_to_degrees_counted, + start_at_power: start_at_power, + start: start, + stop: stop, + run_for_degrees: run_for_degrees, + run_for_seconds: run_for_seconds, + set_default_speed: set_default_speed, + set_stall_detection: set_stall_detection, + get_power: get_power, + get_degrees_counted: get_degrees_counted, + get_position: get_position, + get_speed: get_speed, + get_default_speed: get_default_speed + } + } + + + /** ColorSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the Color Sensor + * var color = new serviceSPIKE.ColorSensor("E") + */ + const ColorSensor = function (port) { + var waitForNewColorFirst = false; + + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + // check if device is a color sensor + if (colorsensor.device != "color") { + throw new Error("No Color Sensor detected at port " + port); + } + + /** Get the name of the detected color + * @returns {string} 'black','violet','blue','cyan','green','yellow','red','white' + */ + function get_color() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + var color = colorsensorData.color; + + return color; + } + + /** Retrieves the intensity of the ambient light. + * @ignore + * @returns {number} The ambient light intensity. [0 to 100] + */ + function get_ambient_light() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.Cambient; + } + + /** Retrieves the intensity of the reflected light. + * + * @returns {number} The reflected light intensity. [0 to 100] + */ + function get_reflected_light() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.Creflected; + } + + /** Retrieves the red, green, blue, and overall color intensity. + * @todo Implement overall intensity + * @ignore + * @returns {(number|Array)} Red, green, blue, and overall intensity (0-1024) + */ + function get_rgb_intensity() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + var toReturn = []; + toReturn.push(colorsensorData.Cr); + toReturn.push(colorsensorData.Cg); + toReturn.push(colorsensorData.Cb) + toReturn.push("TODO: unimplemented");; + } + + /** Retrieves the red color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_red() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[0]; + } + + /** Retrieves the green color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_green() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[1]; + } + + /** Retrieves the blue color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_blue() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[2]; + } + + /** Waits until the Color Sensor detects the specified color. + * + * @param {string} colorInput 'black','violet','blue','cyan','green','yellow','red','white' + * @param {function} callback callback function + */ + function wait_until_color(colorInput, callback) { + virtualSpike.spikeMemory.waitUntilColorCallback = [colorInput, callback]; + } + + + /** Execute callback when Color Sensor detects a new color. + * The first time this method is called, it returns immediately the detected color. + * After that, it waits until the Color Sensor detects a color that is different from the color that + * was detected the last time this method was used. + * @param {function(string)} callback params: detected new color + */ + function wait_for_new_color(callback) { + + // check if this method has been executed after start of program + if (virtualSpike.spikeMemory.waitForNewColorFirst) { + virtualSpike.spikeMemory.waitForNewColorFirst = false; + + var currentColor = get_color(); + callback(currentColor) + } + virtualSpike.spikeMemory.funcAfterNewColor = callback; + } + + return { + get_color: get_color, + wait_until_color: wait_until_color, + wait_for_new_color: wait_for_new_color, + get_ambient_light: get_ambient_light, + get_reflected_light: get_reflected_light, + get_rgb_intensity: get_rgb_intensity, + get_red: get_red, + get_green: get_green, + get_blue: get_blue + } + + } + + /** DistanceSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the DistanceSensor + * var distance_sensor = new serviceSPIKE.DistanceSensor("A"); + */ + const DistanceSensor = function (port) { + var distanceSensor = virtualSpike.ports[port]; // get the distance sensor info by port + + // check if device is a distance sensor + if (distanceSensor.device != "ultrasonic") { + console.error("Ports Info: ", ports); + throw new Error("No DistanceSensor detected at port " + port); + } + + /** Retrieves the measured distance in centimeters. + * @returns {number} [0 to 200] + * @todo find the short_range handling ujsonrpc script + * @example + * var distance_cm = distance_sensor.get_distance_cm(); + */ + function get_distance_cm() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + return distanceSensorData.distance; + } + + /** Retrieves the measured distance in inches. + * + * @returns {number} [0 to 79] + * @todo find the short_range handling ujsonrpc script + * @example + * var distance_inches = distance_sensor.get_distance_inches(); + */ + function get_distance_inches() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + var inches = distanceSensorData.distance * 0.393701; // convert to inches + + if (inches % 1 < 0.5) + inches = Math.floor(inches); + else + inches = Math.ceil(inches); + + return inches; + } + + /** Retrieves the measured distance in percent. + * + * @returns {number/string} [0 to 100] or 'none' if no distance is read + * var distance_percentage = distance_sensor.get_distance_percentage(); + */ + function get_distance_percentage() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + if (distanceSensorData.distance == null) { + return "none" + } + var percentage = distanceSensorData.distance / 200; + return percentage; + } + + /** Waits until the measured distance is greater than distance. + * @param {integer} threshold + * @param {string} unit 'cm','in','%' + * @param {function} callback function to execute when distance is farther than threshold + * @example + * distance_sensor.wait_for_distance_farther_than(10, 'cm', function () { + * console.log("distance is farther than 10 CM"); + * }) + */ + function wait_for_distance_farther_than(threshold, unit, callback) { + + // set callbacks to be executed in updateHubPortsInfo() + if (unit == 'cm') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [threshold, callback]; + } + else if (unit == 'in') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [threshold / 0.393701, callback]; + } + else if (unit == '%') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [(threshold * 0.01) * 200, callback]; + } + else { + throw new Error("The 'unit' argument in wait_for_distance_farther_than(threshold, unit, callback) must be either 'cm', 'in', or '%'.") + } + } + + /** Waits until the measured distance is less than distance. + * @param {integer} threshold + * @param {string} unit 'cm','in','%' + * @param {function} callback function to execute when distance is closer than threshold + * @example + * distance_sensor.wait_for_distance_closer_than(10, 'cm', function () { + * console.log("distance is closer than 10 CM"); + * }) + */ + function wait_for_distance_closer_than(threshold, unit, callback) { + // set callbacks to be executed in updateHubPortsInfo() + if (unit == 'cm') { + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [threshold, callback]; + } + else if (unit == 'in') { + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [threshold / 0.393701, callback]; + } + else if (unit == '%') { + + /* floor or ceil thresholds larger or smaller than what's possible */ + if (threshold > 100) { + threshold = 100; + } + else if (threshold < 0) { + threshold = 0; + } + + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [(threshold * 0.01) * 200, callback]; + } + else { + throw new Error("The 'unit' argument in wait_for_distance_closer_than(threshold, unit, callback) must be either 'cm', 'in', or '%'.") + } + } + + /** Sets the brightness of the individual lights on the Distance Sensor. + * + * @param {integer} right_top Brightness [1-100] + * @param {integer} left_top Brightness [1-100] + * @param {integer} right_bottom Brightness [1-100] + * @param {integer} left_bottom Brightness [1-100] + * @example + * distance_sensor.light_up(100,100,100,100); + */ + function light_up(right_top, left_top, right_bottom, left_bottom) { + let lightArray = [0, 0, 0, 0]; + lightArray[0] = right_top; + lightArray[1] = left_top; + lightArray[2] = right_bottom; + lightArray[3] = left_bottom; + + ujsonLib.ultrasonicLightUp(port, lightArray, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Lights up all of the lights on the Distance Sensor at the specified brightness. + * + * @param {number} [brightness=100] The specified brightness of all of the lights + * @example + * distance_sensor.light_up_all(50) + */ + function light_up_all(brightness = 100) { + + let lightArray = [brightness, brightness, brightness, brightness]; + + ujsonLib.ultrasonicLightUp(port, lightArray, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + get_distance_cm: get_distance_cm, + get_distance_inches: get_distance_inches, + get_distance_percentage: get_distance_percentage, + light_up: light_up, + light_up_all: light_up_all, + wait_for_distance_closer_than: wait_for_distance_closer_than, + wait_for_distance_farther_than: wait_for_distance_farther_than + } + + } + + /** ForceSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the ForceSensor + * var force_sensor = new serviceSPIKE.ForceSensor("E") + */ + const ForceSensor = function (port) { + + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + + if (sensor.device != "force") { + throw new Error("No Force Sensor detected at port " + port); + } + + /** Tests whether the button on the sensor is pressed. + * + * @returns {boolean} true if force sensor is pressed, false otherwise + * @example + * if (force_sensor.is_pressed() === true) { + * console.log("force sensor is pressed"); + * } + */ + function is_pressed() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + return ForceSensorData.pressed; + } + + /** Retrieves the measured force, in newtons. + * + * @returns {number} Force in newtons [0 to 10] + * @example + * var newtons = force_sensor.get_force_newtons(); + */ + function get_force_newton() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + return ForceSensorData.force; + } + + /** Retrieves the measured force as a percentage of the maximum force. + * + * @returns {number} percentage [0 to 100] + * var percentage = force_sensor.get_force_percentage(); + */ + function get_force_percentage() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + var denominator = 704 - 384 // highest detected - lowest detected forceSensitive values + var numerator = ForceSensorData.forceSensitive - 384 // 384 is the forceSensitive value when not pressed + var percentage = Math.round((numerator / denominator) * 100); + return percentage; + } + + /** Executes callback when Force Sensor is pressed + * The function is executed in updateHubPortsInfo()'s Force Sensor part + * @param {function} callback + * @example + * force_sensor.wait_until_pressed( function () { + * console.log("force sensor is pressed!"); + * }) + */ + function wait_until_pressed(callback) { + virtualSpike.spikeMemory.funcAfterForceSensorPress = callback; + } + + /** Executes callback when Force Sensor is released + * The function is executed in updateHubPortsInfo()'s Force Sensor part + * @param {function} callback + * @example + * force_sensor.wait_until_released ( function () { + * console.log("force sensor is released!"); + * }) + */ + function wait_until_released(callback) { + virtualSpike.spikeMemory.funcAfterForceSensorRelease = callback; + } + + return { + is_pressed: is_pressed, + get_force_newton: get_force_newton, + get_force_percentage: get_force_percentage, + wait_until_pressed: wait_until_pressed, + wait_until_released: wait_until_released + } + + } + + /** MotorPair + * @namespace + * @param {string} leftPort + * @param {string} rightPort + * @memberof Service_SPIKE + * @example + * var pair = new serviceSPIKE.MotorPair("A", "B") + */ + const MotorPair = function (leftPort, rightPort) { + // settings + var defaultSpeed = 100; + var stopMethod = 1; // stop method doesnt seem to work in this current ujsonrpc config + + var leftMotor = virtualSpike.ports[leftPort]; + var rightMotor = virtualSpike.ports[rightPort]; + + var DistanceTravelToRevolutionRatio = 17.6; + + // check if device is a motor + if (leftMotor.device != "smallMotor" && leftMotor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + if (rightMotor.device != "smallMotor" && rightMotor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + + /** Sets the ratio of one motor rotation to the distance traveled. + * + * If there are no gears used between the motors and the wheels of the Driving Base, + * then amount is the circumference of one wheel. + * + * Calling this method does not affect the Driving Base if it is already currently running. + * It will only have an effect the next time one of the move or start methods is used. + * + * @param {number} amount + * @param {string} unit 'cm','in' + */ + function set_motor_rotation(amount, unit) { + + // assume unit is 'cm' when undefined + if (unit == "cm" || unit !== undefined) { + DistanceTravelToRevolutionRatio = amount; + } + else if (unit == "in") { + // convert to cm + DistanceTravelToRevolutionRatio = amount * 2.54; + } + } + + function set_stop_action (action) { + + } + + /** Moves the Driving Base using differential (tank) steering. + * + * @param {number} amount + * @param {string} unit 'rotations', 'degrees', 'seconds' + * @param {number} left_spped [-100,100] + * @param {number} right_speed [-100,100] + */ + function move_tank (amount, unit, left_spped, right_speed) { + /* this function is not implemented because "rotation" depends on a set rotatation measured by 'cm' + */ + if (unit === 'rotations') { + ujsonLib.moveTankDegrees(360*amount, left_speed, right_speed, leftPort, rightPort, ) + } + } + + /** Starts moving the Driving Base + * + * @param {integer} left_speed [-100 to 100] + * @param {integer} right_speed [-100 to 100] + * @example + * pair.start_tank(100,100); + */ + function start_tank(left_speed, right_speed) { + ujsonLib.moveTankSpeeds(left_speed, right_speed, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Starts moving the Driving Base + * + * @param {integer} leftPower [-100 to 100] + * @param {integer} rightPower [-100 to 100] + * @example + * pair.start_tank_at_power(10, 10); + */ + function start_tank_at_power(leftPower, rightPower) { + ujsonLib.moveTankPowers(leftPower, rightPower, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Stops the 2 motors simultaneously, which will stop a Driving Base. + * @example + * pair.stop(); + */ + function stop() { + ujsonLib.moveTankPowers(0, 0, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + stop: stop, + set_motor_rotation: set_motor_rotation, + start_tank: start_tank, + start_tank_at_power: start_tank_at_power + } + + } + + const writeProgram = function (projectName, data, slotid, callback) { + virtualSpike.writeProgram(projectName, data, slotid, callback); + } + + const executeAfterInit = function (f) { + if (typeof f === "function") { + funcAtInit = f; + } + else { + throw new Error("Argument to executeAfterInit must be a function") + } + } + const executeAfterConnect = function (f) { + if (typeof f === "function") { + virtualSpike.passConnectCallback(f); + } + else { + throw new Error("Argument to executeAfterConnect must be a function") + } + } + const executeAfterDisconnect = function (f) { + if (typeof f === "function") { + virtualSpike.passDisconnectCallback(f); + } + else { + throw new Error("Argument to executeAfterDisconnect must be a function") + } + } + const executeAfterError = function (f) { + if (typeof f === "function") { + funcAfterError = f; + virtualSpike.passErrorCallback(f); + } + else { + throw new Error("Argument to executeAfterError must be a function") + } + } + const executeAfterPrint = function (f) { + if (typeof f === "function") { + virtualSpike.passPrintCallback(f); + } + else { + throw new Error("Argument to executeAfterPrint must be a function") + } + } + const executeWithStream = function (f) { + if (typeof f === "function") { + virtualSpike.passStreamCallback(f); + } + else { + throw new Error("Argument to executeWithStream must be a function") + } + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** Sleep function + * @private + * @param {number} ms Miliseconds to sleep + * @returns {Promise} + */ + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + + return { + init: init, + isActive: isActive, + writeProgram: writeProgram, + // SPIKE devices + Motor: Motor, + PrimeHub: PrimeHub, + ForceSensor: ForceSensor, + DistanceSensor: DistanceSensor, + ColorSensor: ColorSensor, + MotorPair: MotorPair, + // key event callback setters + executeAfterConnect: executeAfterConnect, + executeAfterDisconnect: executeAfterDisconnect, + executeAfterError: executeAfterError, + executeAfterPrint: executeAfterPrint, + executeWithStream: executeWithStream, + executeAfterInit: executeAfterInit, + } +} \ No newline at end of file diff --git a/package.json b/package.json index 161992a..499db76 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "echo \"Error: no test specified\" && exit 1", "docs": "./node_modules/.bin/jsdoc ./server/examples/modules/ServiceDock_SystemLink.js ./server/examples/modules/ServiceDock_SPIKE.js --readme ./server/docsHome.html -c jsdoc.json", "builddocs": "./node_modules/.bin/jsdoc ./server/examples/modules/ServiceDock_SystemLink.js ./server/examples/modules/ServiceDock_Airtable.js ./server/examples/modules/ServiceDock_SPIKE.js --readme ./jsdocTemplate/docsHome.md -c jsdoc.json -u ./server/examples/tutorials", - "combine": "./node_modules/.bin/concat -o ./cdn/ServiceDock.js ./server/examples/modules/ServiceDock_SystemLink.js ./server/examples/modules/ServiceDock_Airtable.js ./server/examples/modules/ServiceDock_SPIKE.js" + "combine": "./node_modules/.bin/concat -o ./cdn/ServiceDock.js ./server/examples/modules/ServiceDock_SystemLink.js ./server/examples/modules/ServiceDock_Airtable.js ./server/examples/modules/ServiceDock_SPIKE.js", + "combineScaled": "./node_modules/.bin/concat -o ./cdn/ServiceDock_scaled.js ./server/examples/modules/ServiceDock_SystemLink.js ./server/examples/modules/ServiceDock_Airtable.js ./server/examples/modules/scaledSPIKE/webserial/WebSerial.js ./server/examples/modules/scaledSPIKE/spikeRPC/SpikeRPC.js ./server/examples/modules/scaledSPIKE/spikeRPC/SpikeUjsonLib.js ./server/examples/modules/scaledSPIKE/virtualSpike.js ./server/examples/modules/scaledSPIKE/Service_SPIKE_HTML.js ./server/examples/modules/scaledSPIKE/Service_SPIKE.js" }, "repository": { "type": "git", diff --git a/server/examples/modules/SPIKE/classSPIKE.js b/server/examples/modules/SPIKE/classSPIKE.js deleted file mode 100644 index a6d2759..0000000 --- a/server/examples/modules/SPIKE/classSPIKE.js +++ /dev/null @@ -1,201 +0,0 @@ -Service_SPIKE = function () { - - ////////////////////////////////////////// - // // - // Global Variables // - // // - ////////////////////////////////////////// - - /* private members */ - - this.VENDOR_ID = 0x0694; // LEGO SPIKE Prime Hub - - // common characters to send (for REPL/uPython on the Hub) - this.CONTROL_C = '\x03'; // CTRL-C character (ETX character) - this.CONTROL_D = '\x04'; // CTRL-D character (EOT character) - this.RETURN = '\x0D'; // RETURN key (enter, new line) - - /* using this filter in webserial setup will only take serial ports*/ - this.filter = { - usbVendorId: this.VENDOR_ID - }; - - // define for communication - this.port; - this.reader; - this.writer; - this.value; - this.done; - this.writableStreamClosed; - - //define for json concatenation - this.jsonline = ""; - - // contains latest full json object from SPIKE readings - this.lastUJSONRPC; - - // object containing real-time info on devices connected to each port of SPIKE Prime - this.ports = - { - "A": { "device": "none", "data": {} }, - "B": { "device": "none", "data": {} }, - "C": { "device": "none", "data": {} }, - "D": { "device": "none", "data": {} }, - "E": { "device": "none", "data": {} }, - "F": { "device": "none", "data": {} } - }; - - // object containing real-time info on hub sensor values - /* - !say the usb wire is the nose of the spike prime - - ( looks at which side of the hub is facing up) - gyro[0] - up/down detector ( down: 1000, up: -1000, neutral: 0) - gyro[1] - rightside/leftside detector ( leftside : 1000 , rightside: -1000, neutal: 0 ) - gyro[2] - front/back detector ( front: 1000, back: -1000, neutral: 0 ) - - ( assume the usb wire port is the nose of the spike prime ) - accel[0] - roll acceleration (roll to right: -, roll to left: +) - accel[1] - pitch acceleration (up: +, down: -) - accel[2] - yaw acceleration (counterclockwise: +. clockwise: -) - - () - pos[0] - yaw angle - pos[1] - pitch angle - pos[2] - roll angle - - */ - this.hub = - { - "gyro": [0, 0, 0], - "accel": [0, 0, 0], - "pos": [0, 0, 0] - } - - this.batteryAmount = 0; // battery [0-100] - - // string containing real-time info on hub events - this.hubFrontEvent; - - /* - up: hub is upright/standing, with the display looking horizontally - down: hub is upsidedown with the display, with the display looking horizontally - front: hub's display facing towards the sky - back: hub's display facing towards the earth - leftside: hub rotated so that the side to the left of the display is facing the earth - rightside: hub rotated so that the side to the right of the display is facing the earth - */ - this.lastHubOrientation; //PrimeHub orientation read from caught UJSONRPC - - /* - shake - freefall - */ - this.hubGesture; - - // - this.hubMainButton = { "pressed": false, "duration": 0 }; - - this.hubBluetoothButton = { "pressed": false, "duration": 0 }; - - this.hubLeftButton = { "pressed": false, "duration": 0 }; - - this.hubRightButton = { "pressed": false, "duration": 0 }; - - /* PrimeHub data storage arrays for was_***() functions */ - this.hubGestures = []; // array of hubGestures run since program started or since was_gesture() ran - this.hubButtonPresses = []; - this.hubName = undefined; - this.lastDetectedColor = undefined; - - /* SPIKE Prime Projects */ - - this.hubProjects = { - "0": "None", - "1": "None", - "2": "None", - "3": "None", - "4": "None", - "5": "None", - "6": "None", - "7": "None", - "8": "None", - "9": "None", - "10": "None", - "11": "None", - "12": "None", - "13": "None", - "14": "None", - "15": "None", - "16": "None", - "17": "None", - "18": "None", - "19": "None" - }; - - this.colorDictionary = { - 0: "BLACK", - 1: "VIOLET", - 3: "BLUE", - 4: "AZURE", - 5: "GREEN", - 7: "YELLOW", - 9: "RED", - 1: "WHITE", - }; - - // true after Force Sensor is pressed, turned to false after reading it for the first time that it is released - this.ForceSensorWasPressed = false; - - this.micropython_interpreter = false; // whether micropython was reached or not - - this.serviceActive = false; //serviceActive flag - - this.waitForNewOriFirst = true; //whether the wait_for_new_orientation method would be the first time called - - /* stored callback functions from wait_until functions and etc. */ - - this.funcAtInit = undefined; // function to call after init of SPIKE Service - - this.funcAfterNewGesture = undefined; - this.funcAfterNewOrientation = undefined; - - this.funcAfterLeftButtonPress = undefined; - this.funcAfterLeftButtonRelease = undefined; - this.funcAfterRightButtonPress = undefined; - this.funcAfterRightButtonRelease = undefined; - - this.funcAfterNewColor = undefined; - - this.waitUntilColorCallback = undefined; // [colorToDetect, function to execute] - this.waitForDistanceFartherThanCallback = undefined; // [distance, function to execute] - this.waitForDistanceCloserThanCallback = undefined; // [distance, function to execute] - - this.funcAfterForceSensorPress = undefined; - this.funcAfterForceSensorRelease = undefined; - - /* array that holds the pointers to callback functions to be executed after a UJSONRPC response */ - this.responseCallbacks = []; - - // array of information needed for writing program - this.startWriteProgramCallback = undefined; // [message_id, function to execute ] - this.writePackageInformation = undefined; // [ message_id, remaining_data, transfer_id, blocksize] - this.writeProgramCallback = undefined; // callback function to run after a program was successfully written - this.writeProgramSetTimeout = undefined; // setTimeout object for looking for response to start_write_program - - /* callback functions added for Coding Rooms */ - - this.getFirmwareInfoCallback = undefined; - - this.funcAfterPrint = undefined; // function to call for SPIKE python program print statements or errors - this.funcAfterError = undefined; // function to call for errors in ServiceDock - - this.funcAfterDisconnect = undefined; // function to call after SPIKE Prime is disconnected - - this.funcWithStream = undefined; // function to call after every parsed UJSONRPC package - - this.triggerCurrentStateCallback = undefined; - - // namespace for all UJSONRPC scripts - // this.UJSONRPC = this.UJSONRPC.bind(this); -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/general/initUtils.js b/server/examples/modules/SPIKE/general/initUtils.js deleted file mode 100644 index cee1395..0000000 --- a/server/examples/modules/SPIKE/general/initUtils.js +++ /dev/null @@ -1,98 +0,0 @@ - -/** initialize SPIKE_service - *

Makes prompt in Google Chrome ( Google Chrome Browser needs "Experimental Web Interface" enabled)

- *

Starts streaming UJSONRPC

- *

this function needs to be executed after executeAfterInit but before all other public functions

- * @public - * @returns {boolean} True if service was successsfully initialized, false otherwise - */ -Service_SPIKE.prototype.init = async function () { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "navigator.product is ", navigator.product); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "navigator.appName is ", navigator.appName); - // reinit variables in the case of hardware disconnection and Service reactivation - this.reader = undefined; - this.writer = undefined; - - // initialize web serial connection - var webSerialConnected = await this.initWebSerial(); - - if (webSerialConnected) { - - // start streaming UJSONRPC - this.streamUJSONRPC(); - - await this.sleep(1000); - - // this.triggerCurrentState(); - this.serviceActive = true; - - await this.sleep(2000); // wait for service to init - - // call funcAtInit if defined - if (this.funcAtInit !== undefined) { - this.funcAtInit(); - } - return true; - } - else { - return false; - } -} - - -/** Get the callback function to execute after service is initialized. - *

This function needs to be executed before calling init()

- * @public - * @param {function} callback Function to execute after initialization ( during init() ) - * @example - * mySPIKE.executeAfterInit( function () { - * var motor = mySPIKE.Motor("A"); - * var speed = motor.get_speed(); - * // do something with speed - * }) - */ -Service_SPIKE.prototype.executeAfterInit = function (callback) { - // Assigns global variable funcAtInit a pointer to callback function - this.funcAtInit = callback; -} - -/** Get the callback function to execute after a print or error from SPIKE python program - * @ignore - * @param {function} callback - */ -Service_SPIKE.prototype.executeAfterPrint = function (callback) { - this.funcAfterPrint = callback; -} - -/** Get the callback function to execute after Service Dock encounters an error - * @ignore - * @param {any} callback - */ -Service_SPIKE.prototype.executeAfterError = function (callback) { - this.funcAfterError = callback; -} - -/** Execute a stack of functions continuously with SPIKE sensor feed - * - * @public - * @param {any} callback - * @example - * var motor = new mySPIKE.Motor('A') - * mySPIKE.executeWithStream( async function() { - * var speed = await motor.get_speed(); - * // do something with motor speed - * }) - */ -Service_SPIKE.prototype.executeWithStream = function (callback) { - this.funcWithStream = callback; -} - -/** Get the callback function to execute after service is disconnected - * @ignore - * @param {any} callback - */ -Service_SPIKE.prototype.executeAfterDisconnect = function (callback) { - this.funcAfterDisconnect = callback; -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/misc/misc.js b/server/examples/modules/SPIKE/misc/misc.js deleted file mode 100644 index 1a9debb..0000000 --- a/server/examples/modules/SPIKE/misc/misc.js +++ /dev/null @@ -1,8 +0,0 @@ -/** Sleep function - * @private - * @param {number} ms Miliseconds to sleep - * @returns {Promise} - */ -Service_SPIKE.prototype.sleep = function (ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} diff --git a/server/examples/modules/SPIKE/spike/forcesensor.js b/server/examples/modules/SPIKE/spike/forcesensor.js deleted file mode 100644 index fdcf57b..0000000 --- a/server/examples/modules/SPIKE/spike/forcesensor.js +++ /dev/null @@ -1,79 +0,0 @@ - -/** ForceSensor - * @namespace - * @param {string} Port - * @memberof Service_SPIKE - * @example - * // Initialize the ForceSensor - * var force = new mySPIKE.ForceSensor("E") - */ -Service_SPIKE.prototype.ForceSensor = function (port) { - - var sensor = this.ports[port]; // get the force sensor info by port - - if (sensor.device != "force") { - throw new Error("No Force Sensor detected at port " + port); - } - - /** Tests whether the button on the sensor is pressed. - * - * @returns {boolean} true if force sensor is pressed, false otherwise - */ - function is_pressed() { - var sensor = this.ports[port]; // get the force sensor info by port - var ForceSensorData = sensor.data; - - return ForceSensorData.pressed; - } - - /** Retrieves the measured force, in newtons. - * - * @returns {number} Force in newtons [0 to 10] - */ - function get_force_newton() { - var sensor = this.ports[port]; // get the force sensor info by port - var ForceSensorData = sensor.data; - - return ForceSensorData.force; - } - - /** Retrieves the measured force as a percentage of the maximum force. - * - * @returns {number} percentage [0 to 100] - */ - function get_force_percentage() { - var sensor = this.ports[port]; // get the force sensor info by port - var ForceSensorData = sensor.data; - - var denominator = 704 - 384 // highest detected - lowest detected forceSensitive values - var numerator = ForceSensorData.forceSensitive - 384 // 384 is the forceSensitive value when not pressed - var percentage = Math.round((numerator / denominator) * 100); - return percentage; - } - - /** Executes callback when Force Sensor is pressed - * The function is executed in updateHubPortsInfo()'s Force Sensor part - * - * @param {function} callback - */ - function wait_until_pressed(callback) { - this.funcAfterForceSensorPress = callback; - } - - /** Executes callback when Force Sensor is released - * The function is executed in updateHubPortsInfo()'s Force Sensor part - * @param {function} callback - */ - function wait_until_released(callback) { - this.funcAfterForceSensorRelease = callback; - } - - return { - is_pressed: is_pressed, - get_force_newton: get_force_newton, - get_force_percentage: get_force_percentage, - wait_until_pressed: wait_until_pressed, - wait_until_released: wait_until_released - } - -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/spike/getters.js b/server/examples/modules/SPIKE/spike/getters.js deleted file mode 100644 index dfb73e1..0000000 --- a/server/examples/modules/SPIKE/spike/getters.js +++ /dev/null @@ -1,82 +0,0 @@ -/** Get the information of all the ports and devices connected to them - * @ignore - * @returns {object}

An object with keys as port letters and values as objects of device type and info

- * @example - * // USAGE - * - * var portsInfo = await mySPIKE.getPortsInfo(); - * // ports.{yourPortLetter}.device --returns--> device type (ex. "smallMotor" or "ultrasonic")

- * // ports.{yourPortLetter}.data --returns--> device info (ex. {"speed": 0, "angle":0, "uAngle": 0, "power":0} )

- * - * // Motor on port A - * var motorSpeed = portsInfo["A"]["speed"]; // motor speed - * var motorDegreesCounted = portsInfo["A"]["angle"]; // motor angle - * var motorPosition = portsInfo["A"]["uAngle"]; // motor angle in unit circle ( -180 ~ 180 ) - * var motorPower = portsInfo["A"]["power"]; // motor power - * - * // Ultrasonic Sensor on port A - * var distance = portsInfo["A"]["distance"] // distance value from ultrasonic sensor - * - * // Color Sensor on port A - * var reflectedLight = portsInfo["A"]["reflected"]; // reflected light - * var color = portsInfo["A"]["color"]; // name of detected color - * var RGB = portsInfo["A"]["RGB"]; // [R, G, B] - * - * // Force Sensor on port A - * var forceNewtons = portsInfo["A"]["force"]; // Force in Newtons ( 1 ~ 10 ) - * var pressedBool = portsInfo["A"]["pressed"] // whether pressed or not ( true or false ) - * var forceSensitive = portsInfo["A"]["forceSensitive"] // More sensitive force output( 0 ~ 900 ) - */ -Service_SPIKE.prototype.getPortsInfo = function () { - return this.ports; -} - -/** get the info of a single port - * @ignore - * @param {string} letter Port on the SPIKE hub - * @returns {object} Keys as device and info as value - */ -Service_SPIKE.prototype.getPortInfo = function (letter) { - return this.ports[letter]; -} - -/** Get battery status - * @ignore - * @returns {integer} battery percentage - */ -Service_SPIKE.prototype.getBatteryStatus = function () { - return this.batteryAmount; -} - -/** Get info of the hub - * @ignore - * @returns {object} Info of the hub - * @example - * var hubInfo = await mySPIKE.getHubInfo(); - * - * var upDownDetector = hubInfo["gyro"][0]; - * var rightSideLeftSideDetector = hubInfo["gyro"][1]; - * var frontBackDetector = hubInfo["gyro"][2]; - * - * var rollAcceleration = hubInfo["pos"][0]; - * var pitchAcceleration = hubInfo["pos"][1]; - * var yawAcceleration = hubInfo["pos"][2]; - * - * var yawAngle = hubInfo["pos"][0]; - * var pitchAngle = hubInfo["pos"][1]; - * var rollAngle = hubInfo["pos"][2]; - * - * - */ -Service_SPIKE.prototype.getHubInfo = function () { - return this.hub; -} - -/** Get the name of the hub - * - * @public - * @returns name of hub - */ -Service_SPIKE.prototype.getHubName = function () { - return this.hubName; -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/spike/interfaces.js b/server/examples/modules/SPIKE/spike/interfaces.js deleted file mode 100644 index 519f5c0..0000000 --- a/server/examples/modules/SPIKE/spike/interfaces.js +++ /dev/null @@ -1,335 +0,0 @@ -/** Get the most recently detected event on the display of the hub - * @public - * @returns {string} ['tapped','doubletapped'] - * var event = await mySPIKE.getHubEvent(); - * if (event == "tapped" ) { - * console.log("SPIKE is tapped"); - * } - */ -Service_SPIKE.prototype.getHubEvent = function () { - return hubFrontEvent; -} - -/** Get the most recently detected gesture of the hub ( Gesture names differ from SPIKE app ) - * @public - * @returns {string} ['shaken', 'freefall', 'tapped', 'doubletapped'] - * @example - * var gesture = await mySPIKE.getHubGesture(); - * if (gesture == "shaken") { - * console.log("SPIKE is being shaked"); - * } - */ -Service_SPIKE.prototype.getHubGesture = function () { - return hubGesture; -} - -/** Get the most recently detected orientation of the hub - * @public - * @returns {string} ['up','down','front','back','leftside','rightside'] - * @example - * var orientation = await mySPIKE.getHubOrientation(); - * if (orientation == "front") { - * console.log("SPIKE is facing up"); - * } - */ -Service_SPIKE.prototype.getHubOrientation = function () { - return lastHubOrientation; -} - - -/** Get the latest press event information on the "connect" button - * @ignore - * @returns {object} { "pressed": BOOLEAN, "duration": NUMBER } - * @example - * var bluetoothButtonInfo = await mySPIKE.getBluetoothButton(); - * var pressedBool = bluetoothButtonInfo["pressed"]; - * var pressedDuration = bluetoothButtonInfo["duration"]; // duration is miliseconds the button was pressed until release - */ -Service_SPIKE.prototype.getBluetoothButton = function () { - return hubBluetoothButton; -} - -/** Get the latest press event information on the "center" button - * @ignore - * @returns {object} { "pressed": BOOLEAN, "duration": NUMBER } - * @example - * var mainButtonInfo = await mySPIKE.getMainButton(); - * var pressedBool = mainButtonInfo["pressed"]; - * var pressedDuration = mainButtonInfo["duration"]; // duration is miliseconds the button was pressed until release - * - */ -Service_SPIKE.prototype.getMainButton = function () { - return hubMainButton; -} - -/** Get the latest press event information on the "left" button - * @ignore - * @returns {object} { "pressed": BOOLEAN, "duration": NUMBER } - * @example - * var leftButtonInfo = await mySPIKE.getLeftButton(); - * var pressedBool = leftButtonInfo["pressed"]; - * var pressedDuration = leftButtonInfo["duration"]; // duration is miliseconds the button was pressed until release - * - */ -Service_SPIKE.prototype.getLeftButton = function () { - return hubLeftButton; -} - -/** Get the latest press event information on the "right" button - * @ignore - * @returns {object} { "pressed": BOOLEAN, "duration": NUMBER } - * @example - * var rightButtonInfo = await mySPIKE.getRightButton(); - * var pressedBool = rightButtonInfo["pressed"]; - * var pressedDuration = rightButtonInfo["duration"]; // duration is miliseconds the button was pressed until release - */ -Service_SPIKE.prototype.getRightButton = function () { - return hubRightButton; -} - -/** Get the letters of ports connected to any kind of Motors - * @public - * @returns {(string|Array)} Ports that are connected to Motors - * @example - * var motorPorts = mySPIKE.getMotorPorts(); - * - * // get the alphabetically earliest port connected to a motor - * var randomPort = motorPorts[0]; - * - * // get Motor object connected to the port - * var mySensor = new Motor(randomPort); - */ -Service_SPIKE.prototype.getMotorPorts = function () { - - var portsInfo = this.getPortsInfo(); - var motorPorts = []; - for (var key in portsInfo) { - if (portsInfo[key].device == "smallMotor" || portsInfo[key].device == "bigMotor") { - motorPorts.push(key); - } - } - return motorPorts; - -} - -/** Get the letters of ports connected to Small Motors - * @public - * @returns {(string|Array)} Ports that are connected to Small Motors - * @example - * var smallMotorPorts = mySPIKE.getSmallMotorPorts(); - * - * // get the alphabetically earliest port connected to a small motor - * var randomPort = smallMotorPorts[0]; - * - * // get Motor object connected to the port - * var mySensor = new Motor(randomPort); - */ -Service_SPIKE.prototype.getSmallMotorPorts = function () { - - var portsInfo = this.getPortsInfo(); - var motorPorts = []; - for (var key in portsInfo) { - if (portsInfo[key].device == "smallMotor") { - motorPorts.push(key); - } - } - return motorPorts; - -} - -/** Get the letters of ports connected to Big Motors - * @public - * @returns {(string|Array)} Ports that are connected to Big Motors - * @example - * var bigMotorPorts = mySPIKE.getBigMotorPorts(); - * - * // get the alphabetically earliest port connected to a big motor - * var randomPort = bigMotorPorts[0]; - * - * // get Motor object connected to the port - * var mySensor = new Motor(randomPort); - */ -Service_SPIKE.prototype.getBigMotorPorts = function () { - var portsInfo = this.getPortsInfo(); - var motorPorts = []; - for (var key in portsInfo) { - if (portsInfo[key].device == "bigMotor") { - motorPorts.push(key); - } - } - return motorPorts; -} - -/** Get the letters of ports connected to Distance Sensors - * @public - * @returns {(string|Array)} Ports that are connected to Distance Sensors - * @example - * var distanceSensorPorts = mySPIKE.getDistancePorts(); - * - * // get the alphabetically earliest port connected to a DistanceSensor - * var randomPort = distanceSensorPorts[0]; - * - * // get DistanceSensor object connected to the port - * var mySensor = new DistanceSensor(randomPort); - */ -Service_SPIKE.prototype.getUltrasonicPorts = function () { - - var portsInfo = this.getPortsInfo(); - var ultrasonicPorts = []; - - for (var key in portsInfo) { - if (portsInfo[key].device == "ultrasonic") { - ultrasonicPorts.push(key); - } - } - - return ultrasonicPorts; - -} - -/** Get the letters of ports connected to Color Sensors - * @public - * @returns {(string|Array)} Ports that are connected to Color Sensors - * @example - * var colorSensorPorts = mySPIKE.getColorPorts(); - * - * // get the alphabetically earliest port connected to a ColorSensor - * var randomPort = colorSensorPorts[0]; - * - * // get ColorSensor object connected to the port - * var mySensor = new ColorSensor(randomPort); - */ -Service_SPIKE.prototype.getColorPorts = function () { - - var portsInfo = this.getPortsInfo(); - var colorPorts = []; - - for (var key in portsInfo) { - if (portsInfo[key].device == "color") { - colorPorts.push(key); - } - } - - return colorPorts; - -} - -/** Get the letters of ports connected to Force Sensors - * @public - * @returns {(string|Array)} Ports that are connected to Force Sensors - * @example - * var forceSensorPorts = mySPIKE.getForcePorts(); - * - * // get the alphabetically earliest port connected to a ForceSensor - * var randomPort = forceSensorPorts[0]; - * - * // get ForceSensor object connected to the port - * var mySensor = new ForceSensor(randomPort); - */ -Service_SPIKE.prototype.getForcePorts = function () { - - var portsInfo = this.getPortsInfo(); - var forcePorts = []; - - for (var key in portsInfo) { - if (portsInfo[key].device == "force") { - forcePorts.push(key); - } - } - - return forcePorts; - -} - -/** Get all motor objects currently connected to SPIKE - * - * @public - * @returns {object} All connected Motor objects - * @example - * var motors = await mySPIKE.getMotors(); - * - * // get Motor object connected to Port A - * var myMotor = motors["A"] - * - * // run motor for 10 seconds at 100 speed - * myMotor.run_for_seconds(10,100); - */ -Service_SPIKE.prototype.getMotors = function () { - var portsInfo = this.getPortsInfo(); - var motors = {}; - for (var key in portsInfo) { - if (portsInfo[key].device == "smallMotor" || portsInfo[key].device == "bigMotor") { - motors[key] = new Motor(key); - } - } - return motors; -} - -/** Get all distance sensor objects currently connected to SPIKE - * - * @public - * @returns {object} All connected DistanceSensor objects - * @example - * var distanceSensors = await mySPIKE.getDistanceSensors(); - * - * // get DistanceSensor object connected to Port A - * var mySensor = distanceSensors["A"]; - * - * // get distance in centimeters - * console.log("distance in CM: ", mySensor.get_distance_cm()) - */ -Service_SPIKE.prototype.getDistanceSensors = function () { - var portsInfo = this.getPortsInfo(); - var distanceSensors = {}; - for (var key in portsInfo) { - if (portsInfo[key].device == "ultrasonic") { - distanceSensors[key] = new DistanceSensor(key); - } - } - return distanceSensors; -} - -/** Get all color sensor objects currently connected to SPIKE - * - * @public - * @returns {object} All connected ColorSensor objects - * @example - * var colorSensors = await mySPIKE.getColorSensors(); - * var mySensor = colorSensors["A"]; - */ -Service_SPIKE.prototype.getColorSensors = function () { - var portsInfo = this.getPortsInfo(); - var colorSensors = {}; - for (var key in portsInfo) { - if (portsInfo[key].device == "color") { - colorSensors[key] = new ColorSensor(key); - } - } - return colorSensors; -} - -/** Get all force sensor objects currently connected to SPIKE - * - * @public - * @returns {object} All connected ForceSensor objects - * @example - * var forceSensors = mySPIKE.getForceSensors(); - * - * // get ForceSensor object connected to port A - * var mySensor = forceSensors["A"]; - * - * // when ForceSensor is pressed, indicate button state on console - * mySensor.wait_until_pressed( function() { - * console.log("ForceSensor at port A was pressed"); - * }) - */ -Service_SPIKE.prototype.getForceSensors = function () { - var portsInfo = this.getPortsInfo(); - var forceSensors = {}; - for (var key in portsInfo) { - if (portsInfo[key].device == "force") { - forceSensors[key] = new ForceSensor(key); - } - } - return forceSensors; -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/spike/motor.js b/server/examples/modules/SPIKE/spike/motor.js deleted file mode 100644 index dc6bbad..0000000 --- a/server/examples/modules/SPIKE/spike/motor.js +++ /dev/null @@ -1,221 +0,0 @@ -/** Motor - * @namespace - * @memberof! Service_SPIKE - * @param {string} Port - * @returns {functions} - * @example - * // Initialize the Motor - * var motor = new mySPIKE.Motor("A") - */ -Service_SPIKE.prototype.Motor = function (port) { - - var motor = this.ports[port]; // get the motor info by port - - // default settings - var defaultSpeed = 100; - var stopMethod = 1; // stop method doesnt seem to work in this current ujsonrpc config - var stallSetting = true; - - var direction = { - COUNTERCLOCKWISE: 'counterClockwise', - CLOCKWISE: 'clockwise' - } - - // check if device is a motor - if (motor.device != "smallMotor" && motor.device != "bigMotor") { - throw new Error("No motor detected at port " + port); - } - - /** Get current speed of the motor - * - * @returns {number} speed of motor [-100 to 100] - */ - function get_speed() { - var motor = this.ports[port]; // get the motor info by port - var motorInfo = motor.data; - return motorInfo.speed; - - } - - /** Get current position of the motor. The position may differ by a little margin from - * the position to which a motor ran with run_to_position() - * @returns {number} position of motor [0 to 359] - */ - function get_position() { - var motor = this.ports[port]; // get the motor info by port - var motorInfo = motor.data; - let position = motorInfo.uAngle; - if (position < 0) - position = 360 + position; - return position; - } - - /** Get current degrees counted of the motor - * - * @returns {number} counted degrees of the motor [any number] - */ - function get_degrees_counted() { - var motor = this.ports[port]; // get the motor info by port - var motorInfo = motor.data; - return motorInfo.angle; - } - - /** Get the power of the motor - * - * @returns {number} motor power - */ - function get_power() { - var motor = this.ports[port]; // get the motor info by port - var motorInfo = motor.data; - return motorInfo.power; - } - - /** Get the default speed of this motor - * - * @returns {number} motor default speed [-100 to 100] - */ - function get_default_speed() { - return defaultSpeed; - } - - /** Set the default speed for this motor - * - * @param {number} speed [-100 to 100] - */ - function set_default_speed(speed) { - if (typeof speed == "number") { - defaultSpeed = speed; - } - } - - /** Turns stall detection on or off. - * Stall detection senses when a motor has been blocked and can’t move. - * If stall detection has been enabled and a motor is blocked, the motor will be powered off - * after two seconds and the current motor command will be interrupted. If stall detection has been - * disabled, the motor will keep trying to run and programs will “get stuck” until the motor is no - * longer blocked. - * @param {boolean} boolean - true if to detect stall, false otherwise - */ - function set_stall_detection(boolean) { - if (typeof boolean == "boolean") { - stallSetting = boolean; - } - } - - - /** Runs the motor to an absolute position. - * The sign of the speed will be ignored (i.e., absolute value), and the motor will always travel in the direction that’s been specified by the "direction" parameter. - * If the speed is greater than "100," it will be limited to "100." - - * @param {integer} degrees [0 to 359] - * @param {string} direction "Clockwise" or "Counterclockwise" - * @param {integer} speed [-100 to 100] - * @param {function} callback Params: "stalled" or "done" - * @ignore - * @example - * mySPIKE.run_to_position(180, 100, function() { - * console.log("motor finished moving"); - * }) - */ - function run_to_position(degrees, direction, speed, callback = undefined) { - if (speed !== undefined && typeof speed == "number") - this.UJSONRPC.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback); - else - this.UJSONRPC.motorGoRelPos(port, degrees, defaultSpeed, stallSetting, stopMethod, callback); - } - - /** Runs the motor until the number of degrees counted is equal to the value that has been specified by the "degrees" parameter. - * - * @param {integer} degrees any number - * @param {integer} speed [0 to 100] - * @param {any} [callback] (optional callback) callback param: "stalled" or "done" - */ - this.run_to_degrees_counted = function (degrees, speed, callback = undefined) { - console.log("this in runtodeg: ", this); - if (speed !== undefined && typeof speed == "number") - this.UJSONRPC.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback); - else - this.UJSONRPC.motorGoRelPos(port, degrees, defaultSpeed, stallSetting, stopMethod, callback); - - - }.bind(this); - - /** Start the motor at some power - * - * @param {integer} power [-100 to 100] - */ - function start_at_power(power) { - this.UJSONRPC.motorPwm(port, power, stallSetting); - } - - - /** Start the motor at some speed - * - * @param {integer} speed [-100 to 100] - */ - function start(speed = defaultSpeed) { - - this.UJSONRPC.motorStart(port, speed, stallSetting); - } - - /** Run the motor for some seconds - * - * @param {integer} seconds - * @param {integer} speed [-100 to 100] - * @param {function} [callback==undefined] Parameters:"stalled" or "done" - * @example - * mySPIKE.run_for_seconds(10, 100, function() { - * console.log("motor just ran for 10 seconds"); - * }) - */ - function run_for_seconds(seconds, speed, callback = undefined) { - if (speed !== undefined && typeof speed == "number") { - this.UJSONRPC.motorRunTimed(port, seconds, speed, stallSetting, stopMethod, callback) - } - else { - this.UJSONRPC.motorRunTimed(port, seconds, defaultSpeed, stallSetting, stopMethod, callback) - } - } - - /** Run the motor for some degrees - * - * @param {integer} degrees - * @param {integer} speed [-100 to 100] - * @param {function} [callback==undefined] Parameters:"stalled" or "done" - * mySPIKE.run_for_degrees(720, 100, function () { - * console.log("motor just ran for 720 degrees"); - * }) - */ - function run_for_degrees(degrees, speed, callback = undefined) { - if (speed !== undefined && typeof speed == "number") { - this.UJSONRPC.motorRunDegrees(port, degrees, speed, stallSetting, stopMethod, callback); - } - else { - this.UJSONRPC.motorRunDegrees(port, degrees, defaultSpeed, stallSetting, stopMethod, callback); - } - } - - /** Stop the motor - * - */ - function stop() { - this.UJSONRPC.motorPwm(port, 0, stallSetting); - } - - return { - run_to_position: run_to_position, - run_to_degrees_counted: this.run_to_degrees_counted, - start_at_power: start_at_power, - start: start, - stop: stop, - run_for_degrees: run_for_degrees, - run_for_seconds: run_for_seconds, - set_default_speed: set_default_speed, - set_stall_detection: set_stall_detection, - get_power: get_power, - get_degrees_counted: get_degrees_counted, - get_position: get_position, - get_speed: get_speed, - get_default_speed: get_default_speed - } -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/spike/motorpair.js b/server/examples/modules/SPIKE/spike/motorpair.js deleted file mode 100644 index 67d51e4..0000000 --- a/server/examples/modules/SPIKE/spike/motorpair.js +++ /dev/null @@ -1,92 +0,0 @@ - -/** MotorPair - * @namespace - * @param {string} leftPort - * @param {string} rightPort - * @memberof Service_SPIKE - * @example - * var pair = new mySPIKE.MotorPair("A", "B") - */ -Service_SPIKE.prototype.MotorPair = function (leftPort, rightPort) { - // settings - var defaultSpeed = 100; - - var leftMotor = this.ports[leftPort]; - var rightMotor = this.ports[rightPort]; - - var DistanceTravelToRevolutionRatio = 17.6; - - // check if device is a motor - if (leftMotor.device != "smallMotor" && leftMotor.device != "bigMotor") { - throw new Error("No motor detected at port " + this.port); - } - if (rightMotor.device != "smallMotor" && rightMotor.device != "bigMotor") { - throw new Error("No motor detected at port " + this.port); - } - - /** Sets the ratio of one motor rotation to the distance traveled. - * - * If there are no gears used between the motors and the wheels of the Driving Base, - * then amount is the circumference of one wheel. - * - * Calling this method does not affect the Driving Base if it is already currently running. - * It will only have an effect the next time one of the move or start methods is used. - * - * @param {number} amount - * @param {string} unit 'cm','in' - */ - function set_motor_rotation(amount, unit) { - - // assume unit is 'cm' when undefined - if (unit == "cm" || unit !== undefined) { - DistanceTravelToRevolutionRatio = amount; - } - else if (unit == "in") { - // convert to cm - DistanceTravelToRevolutionRatio = amount * 2.54; - } - } - - /** Starts moving the Driving Base - * - * @param {integer} left_speed [-100 to 100] - * @param {integer} right_speed [-100 to 100] - */ - function start_tank(left_speed, right_speed) { - UJSONRPC.moveTankSpeeds(left_speed, right_speed, leftPort, rightPort); - } - - // /** Starts moving the Driving Base without speed control. - // * - // * @param {any} power - // * @param {any} steering - // * @todo Implement this function - // */ - // function start_at_power (power, steering) { - - // } - - /** Starts moving the Driving Base - * - * @param {integer} leftPower - * @param {integer} rightPower - */ - function start_tank_at_power(leftPower, rightPower) { - UJSONRPC.moveTankPowers(leftPower, rightPower, leftPort, rightPort); - } - - /** Stops the 2 motors simultaneously, which will stop a Driving Base. - * - */ - function stop() { - UJSONRPC.moveTankPowers(0, 0, leftPort, rightPort); - } - - return { - stop: stop, - set_motor_rotation: set_motor_rotation, - start_tank: start_tank, - start_tank_at_power: start_tank_at_power - } - -} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/webserial/parsing.js b/server/examples/modules/SPIKE/webserial/parsing.js deleted file mode 100644 index 9ee47af..0000000 --- a/server/examples/modules/SPIKE/webserial/parsing.js +++ /dev/null @@ -1,798 +0,0 @@ - -/** clean the json_string for concatenation into jsonline - * @private - * - * @param {any} json_string - * @returns {string} - */ -Service_SPIKE.prototype.cleanJsonString = function (json_string) { - var cleanedJsonString = ""; - json_string = json_string.trim(); - - let findEscapedQuotes = /\\"/g; - - cleanedJsonString = json_string.replace(findEscapedQuotes, '"'); - cleanedJsonString = cleanedJsonString.substring(1, cleanedJsonString.length - 1); - // cleanedJsonString = cleanedJsonString.replace(findNewLines,''); - - return cleanedJsonString; -} - -/** Process the UJSON RPC script - * - * @private - * @param {any} lastUJSONRPC - * @param {string} [json_string="undefined"] - * @param {boolean} [testing=false] - * @param {any} callback - */ -Service_SPIKE.prototype.processFullUJSONRPC = async function (lastUJSONRPCToProcess, cleanedJsonString = "undefined", json_string = "undefined", testing = false, callback) { - - try { - - var parseTest = await JSON.parse(lastUJSONRPCToProcess); - - if (testing) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "processing FullUJSONRPC line: ", lastUJSONRPCToProcess); - } - - // update hub information using lastUJSONRPCToProcess - if (parseTest["m"] == 0) { - this.updateHubPortsInfo(); - } - this.PrimeHubEventHandler(); - - if (this.funcWithStream) { - await this.funcWithStream(); - } - - } - catch (e) { - // don't throw error when failure of processing UJSONRPC is due to micropython - if (lastUJSONRPCToProcess.indexOf("Traceback") == -1 && lastUJSONRPCToProcess.indexOf(">>>") == -1 && json_string.indexOf("Traceback") == -1 && json_string.indexOf(">>>") == -1) { - if (this.funcAfterError != undefined) { - this.funcAfterError("Fatal Error: Please close any other window or program that is connected to your SPIKE Prime"); - } - } - console.log(e); - console.log("%cTuftsCEEO ", "color: #3ba336;", "error parsing lastUJSONRPCToProcess: ", lastUJSONRPCToProcess); - console.log("%cTuftsCEEO ", "color: #3ba336;", "current jsonline: ", jsonline); - console.log("%cTuftsCEEO ", "color: #3ba336;", "current cleaned json_string: ", cleanedJsonString) - console.log("%cTuftsCEEO ", "color: #3ba336;", "current json_string: ", json_string); - console.log("%cTuftsCEEO ", "color: #3ba336;", "current value: ", value); - - if (callback != undefined) { - callback(); - } - - } -} - -/** Process a packet in UJSONRPC -* @private -* -*/ -Service_SPIKE.prototype.parsePacket = async function (value, testing = false, callback) { - // console.log("%cTuftsCEEO ", "color: #3ba336;", value); - - // stringify the packet to look for carriage return - var json_string = await JSON.stringify(value); - - // remove quotation marks from json_string - var cleanedJsonString = this.cleanJsonString(json_string); - // cleanedJsonString = cleanedJsonString.replace(findNewLines,''); - - // console.log(cleanedJsonString); - - this.jsonline = this.jsonline + cleanedJsonString; // concatenate packet to data - this.jsonline = this.jsonline.trim(); - - // regex search for carriage return - let pattern = /\\r/g; - var carriageReIndex = this.jsonline.search(pattern); - - // there is at least one carriage return in this packet - if (carriageReIndex > -1) { - //////////////////////////////// NEW parsePacket implementation ongoing since (29/12/20) - - let jsonlineSplitByCR = this.jsonline.split(/\\r/); // array of jsonline split by \r - - this.jsonline = ""; //reset jsonline - /* - each element in this array will be assessed for processing, - and the last element, if unable to be processed, will be concatenated to jsonline - */ - - for (let i = 0; i < jsonlineSplitByCR.length; i++) { - - // set lastUJSONRPC to an element in split array - this.lastUJSONRPC = jsonlineSplitByCR[i]; - // remove any newline character in the beginning of this.lastUJSONRPC - if (this.lastUJSONRPC.search(/\\n/g) == 0) - this.lastUJSONRPC = this.lastUJSONRPC.substring(2, this.lastUJSONRPC.length); - - /* Case 1: this.lastUJSONRPC is a valid, complete, and standard UJSONRPC packet */ - if (this.lastUJSONRPC[0] == "{" && this.lastUJSONRPC[this.lastUJSONRPC.length - 1] == "}") { - await this.processFullUJSONRPC(this.lastUJSONRPC, cleanedJsonString, json_string, testing, callback); - } - /* Case 3: this.lastUJSONRPC is a micropy print result */ - else if (this.lastUJSONRPC != "" && this.lastUJSONRPC.indexOf('"p":') == -1 && this.lastUJSONRPC.indexOf('],') == -1 && this.lastUJSONRPC.indexOf('"m":') == -1 && - this.lastUJSONRPC.indexOf('}') == -1 && this.lastUJSONRPC.indexOf('{"i":') == -1 && this.lastUJSONRPC.indexOf('{') == -1) { - /* filter reboot message */ - var rebootMessage = - 'Traceback (most recent call last): File "main.py", line 8, in File "hub_runtime.py", line 1, in start File "event_loop/event_loop.py", line 1, in run_forever File "event_loop/event_loop.py", line 1, in step KeyboardInterrupt: MicroPython v1.12-1033-g97d7f7dd4 on 2020-09-18; LEGO Technic Large Hub with STM32F413xx Type "help()" for more in formation. >>> HUB: sync filesystems HUB: soft reboot' - let rebootMessageRemovedWS = rebootMessage.replace(/[' ']/g, ""); - let lastUJSONRPCRemovedWS = this.lastUJSONRPC.replace(/[' ']/g, ""); - if (rebootMessageRemovedWS.indexOf(lastUJSONRPCRemovedWS) == -1) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "micropy print: ", this.lastUJSONRPC); - if (this.funcAfterPrint != undefined) - this.funcAfterPrint(this.lastUJSONRPC); - } - } - /* Case 3: lastUJSONRPC is only a portion of a standard UJSONRPC packet - Then lastUJSONRPC must be EITHER THE FIRST OR THE LAST ELEMENT in jsonlineSplitByCR - because - an incomplete UJSONRPC can either be - Case 3A: the beginning portion of a UJSONRPC packet with no \r in the end (LAST) - Case 3B: the last portion of a UJSONRPC packet with \r in the end (FIRST) - */ - else { - /* Case 3A: */ - if (this.lastUJSONRPC[0] == "{") { - this.jsonline = this.lastUJSONRPC; - // console.log("TEST (last elemnt in split array): ", i == jsonlineSplitByCR.length-1); - // console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline was reset to:" + jsonline); - } - /* Case 3B: */ - else { - /* the last portion of UJSONRPC cannot be concatenated to form a full packet - -> need to purge lastUJSONRPC - */ - } - } - } - } - -} - - -/** Get the devices that are connected to each port on the SPIKE Prime - *

Effect:

- *

Modifies {ports} global variable

- *

Modifies {hub} global variable

- * @private - */ -Service_SPIKE.prototype.updateHubPortsInfo = async function () { - // if a complete ujson rpc line was read - if (this.lastUJSONRPC) { - var data_stream; //UJSON RPC info to be parsed - - //get a line from the latest JSON RPC stream and parse to devices info - try { - data_stream = await JSON.parse(this.lastUJSONRPC); - data_stream = data_stream.p; - } - catch (e) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "error parsing lastUJSONRPC at updateHubPortsInfo", this.lastUJSONRPC); - console.log("%cTuftsCEEO ", "color: #3ba336;", typeof this.lastUJSONRPC); - console.log("%cTuftsCEEO ", "color: #3ba336;", this.lastUJSONRPC.p); - - if (this.funcAfterError != undefined) { - this.funcAfterError("Fatal Error: Please reboot the Hub and refresh this environment"); - } - - } - - var index_to_port = ["A", "B", "C", "D", "E", "F"] - - // iterate through each port and assign a device_type to {ports} - for (var key = 0; key < 6; key++) { - - let device_value = { "device": "none", "data": {} }; // value to go in ports associated with the port letter keys - - try { - var letter = index_to_port[key] - - // get SMALL MOTOR information - if (data_stream[key][0] == 48) { - - // parse motor information - var Mspeed = await data_stream[key][1][0]; - var Mangle = await data_stream[key][1][1]; - var Muangle = await data_stream[key][1][2]; - var Mpower = await data_stream[key][1][3]; - - // populate value object - device_value.device = "smallMotor"; - device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; - this.ports[letter] = device_value; - - } - // get BIG MOTOR information - else if (data_stream[key][0] == 49) { - - // parse motor information - var Mspeed = await data_stream[key][1][0]; - var Mangle = await data_stream[key][1][1]; - var Muangle = await data_stream[key][1][2]; - var Mpower = await data_stream[key][1][3]; - - // populate value object - device_value.device = "bigMotor"; - device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; - this.ports[letter] = device_value; - - } - // get ULTRASONIC sensor information - else if (data_stream[key][0] == 62) { - - // parse ultrasonic sensor information - var Udist = await data_stream[key][1][0]; - - // populate value object - device_value.device = "ultrasonic"; - device_value.data = { "distance": Udist }; - this.ports[letter] = device_value; - - /* check if callback from wait_for_distance_farther_than() can be executed */ - if (this.waitForDistanceFartherThanCallback != undefined) { - let thresholdDistance = this.waitForDistanceFartherThanCallback[0]; - - if (Udist > thresholdDistance) { - - // current distance is farther than threshold, so execute callback - this.waitForDistanceFartherThanCallback[1](); - this.waitForDistanceFartherThanCallback = undefined; // reset callback - } - } - - /* check if callback from wait_for_distance_closer_than() can be executed */ - if (this.waitForDistanceCloserThanCallback != undefined) { - let thresholdDistance = this.waitForDistanceCloserThanCallback[0]; - - if (Udist < thresholdDistance) { - - // current distance is closer than threshold, so execute callback - this.waitForDistanceCloserThanCallback[1](); - this.waitForDistanceCloserThanCallback = undefined; // reset callback - } - } - - - } - // get FORCE sensor information - else if (data_stream[key][0] == 63) { - - // parse force sensor information - var Famount = await data_stream[key][1][0]; - var Fbinary = await data_stream[key][1][1]; - var Fbigamount = await data_stream[key][1][2]; - - // convert the binary output to boolean for "pressed" key - if (Fbinary == 1) { - var Fboolean = true; - } else { - var Fboolean = false; - } - // execute callback from ForceSensor.wait_until_pressed() - if (Fboolean) { - // execute call back from wait_until_pressed() if it is defined - this.funcAfterForceSensorPress !== undefined && this.funcAfterForceSensorPress(); - - // destruct callback function - this.funcAfterForceSensorPress = undefined; - - // indicate that the ForceSensor was pressed - this.ForceSensorWasPressed = true; - } - // execute callback from ForceSensor.wait_until_released() - else { - // check if the Force Sensor was just released - if (this.ForceSensorWasPressed) { - this.ForceSensorWasPressed = false; - this.funcAfterForceSensorRelease !== undefined && this.funcAfterForceSensorRelease(); - this.funcAfterForceSensorRelease = undefined; - } - } - - // populate value object - device_value.device = "force"; - device_value.data = { "force": Famount, "pressed": Fboolean, "forceSensitive": Fbigamount } - this.ports[letter] = device_value; - } - // get COLOR sensor information - else if (data_stream[key][0] == 61) { - - // parse color sensor information - var Creflected = await data_stream[key][1][0]; - var CcolorID = await data_stream[key][1][1]; - var Ccolor = colorDictionary[CcolorID]; - var Cr = await data_stream[key][1][2]; - var Cg = await data_stream[key][1][3]; - var Cb = await data_stream[key][1][4]; - var rgb_array = [Cr, Cg, Cb]; - - // populate value object - device_value.device = "color"; - - // convert Ccolor to lower case because in the SPIKE APP the color is lower case - Ccolor = Ccolor.toLowerCase(); - device_value.data = { "reflected": Creflected, "color": Ccolor, "RGB": rgb_array }; - - // execute wait_until_color callback when color matches its argument - if (this.waitUntilColorCallback != undefined) - if (Ccolor == this.waitUntilColorCallback[0]) { - this.waitUntilColorCallback[1](); - - this.waitUntilColorCallback = undefined; - } - - if (this.lastDetectedColor != Ccolor) { - - if (this.funcAfterNewColor != undefined) { - this.funcAfterNewColor(Ccolor); - this.funcAfterNewColor = undefined; - } - - this.lastDetectedColor = Ccolor; - } - - this.ports[letter] = device_value; - } - /// NOTHING is connected - else if (data_stream[key][0] == 0) { - // populate value object - device_value.device = "none"; - device_value.data = {}; - this.ports[letter] = device_value; - } - - //parse hub information - var gyro_x = data_stream[6][0]; - var gyro_y = data_stream[6][1]; - var gyro_z = data_stream[6][2]; - var gyro = [gyro_x, gyro_y, gyro_z]; - this.hub["gyro"] = gyro; - - var newOri = this.setHubOrientation(gyro); - // see if currently detected orientation is different from the last detected orientation - if (newOri !== this.lastHubOrientation) { - this.lastHubOrientation = newOri; - - if (typeof this.funcAfterNewOrientation == "function") { - this.funcAfterNewOrientation(newOri); - this.funcAfterNewOrientation = undefined; - } - } - - var accel_x = data_stream[7][0]; - var accel_y = data_stream[7][1]; - var accel_z = data_stream[7][2]; - var accel = [accel_x, accel_y, accel_z]; - this.hub["accel"] = accel; - - var posi_x = data_stream[8][0]; - var posi_y = data_stream[8][1]; - var posi_z = data_stream[8][2]; - var pos = [posi_x, posi_y, posi_z]; - this.hub["pos"] = pos; - - } catch (e) { } //ignore errors - } - } -} - -/** Catch hub events in UJSONRPC - *

Effect:

- *

Logs in the console when some particular messages are caught

- *

Assigns the hub events global variables

- * @private - */ -Service_SPIKE.prototype.PrimeHubEventHandler = async function () { - - var parsedUJSON = await JSON.parse(this.lastUJSONRPC); - - var messageType = parsedUJSON["m"]; - - //catch runtime_error made at ujsonrpc level - if (messageType == "runtime_error") { - var decodedResponse = atob(parsedUJSON["p"][3]); - - decodedResponse = JSON.stringify(decodedResponse); - - console.log("%cTuftsCEEO ", "color: #3ba336;", decodedResponse); - - var splitData = decodedResponse.split(/\\n/); // split the code by every newline - - // execute function after print if defined (only print the last line of error message) - if (funcAfterError != undefined) { - var errorType = splitData[splitData.length - 2]; - - // error is a syntax error - if (errorType.indexOf("SyntaxError") > -1) { - /* get the error line number*/ - var lineNumberLine = splitData[splitData.length - 3]; - console.log("%cTuftsCEEO ", "color: #3ba336;", "lineNumberLine: ", lineNumberLine); - var indexLine = lineNumberLine.indexOf("line"); - var lineNumberSubstring = lineNumberLine.substring(indexLine, lineNumberLine.length); - var numberPattern = /\d+/g; - var lineNumber = lineNumberSubstring.match(numberPattern)[0]; - console.log("%cTuftsCEEO ", "color: #3ba336;", lineNumberSubstring.match(numberPattern)); - console.log("%cTuftsCEEO ", "color: #3ba336;", "lineNumber:", lineNumber); - console.log("%cTuftsCEEO ", "color: #3ba336;", "typeof lineNumber:", typeof lineNumber); - var lineNumberInNumber = parseInt(lineNumber) - 5; - console.log("%cTuftsCEEO ", "color: #3ba336;", "typeof lineNumberInNumber:", typeof lineNumberInNumber); - - this.funcAfterError("line " + lineNumberInNumber + ": " + errorType); - } - else { - this.funcAfterError(errorType); - } - } - } - else if (messageType == 0) { - /* - DEV NOTE (26/12/2020): - messageType = 0 is regular UJSONRPC stream. - Pixel matrix SOMETIMES shows in this message, but exactly when is not clear. - */ - // console.log("%cTuftsCEEO ", "color: #3ba336;", lastUJSONRPC); - } - // storage information - else if (messageType == 1) { - - var storageInfo = parsedUJSON["p"]["slots"]; // get info of all the slots - - for (var slotid in storageInfo) { - this.hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable - } - - } - // battery status - else if (messageType == 2) { - this.batteryAmount = parsedUJSON["p"][1]; - } - // give center button click, left, right (?) - else if (messageType == 3) { - console.log("%cTuftsCEEO ", "color: #3ba336;", this.lastUJSONRPC); - if (parsedUJSON.p[0] == "center") { - this.hubMainButton.pressed = true; - - if (parsedUJSON.p[1] > 0) { - this.hubMainButton.pressed = false; - this.hubMainButton.duration = parsedUJSON.p[1]; - } - } - else if (parsedUJSON.p[0] == "connect") { - this.hubBluetoothButton.pressed = true; - - if (parsedUJSON.p[1] > 0) { - this.hubBluetoothButton.pressed = false; - this.hubBluetoothButton.duration = parsedUJSON.p[1]; - } - } - else if (parsedUJSON.p[0] == "left") { - this.hubLeftButton.pressed = true; - - // execute callback for wait_until_pressed() if defined - if (this.funcAfterLeftButtonPress != undefined) { - this.funcAfterLeftButtonPress(); - } - this.funcAfterLeftButtonPress = undefined; - - if (parsedUJSON.p[1] > 0) { - this.hubLeftButton.pressed = false; - this.hubLeftButton.duration = parsedUJSON.p[1]; - - // execute callback for wait_until_released() if defined - if (this.funcAfterLeftButtonRelease != undefined) { - this.funcAfterLeftButtonRelease(); - } - - this.funcAfterLeftButtonRelease = undefined; - } - - } - else if (parsedUJSON.p[0] == "right") { - this.hubRightButton.pressed = true; - - // execute callback for wait_until_pressed() if defined - if (this.funcAfterRightButtonPress != undefined) { - this.funcAfterRightButtonPress(); - } - - this.funcAfterRightButtonPress = undefined; - - if (parsedUJSON.p[1] > 0) { - this.hubRightButton.pressed = false; - this.hubRightButton.duration = parsedUJSON.p[1]; - - // execute callback for wait_until_released() if defined - if (this.funcAfterRightButtonRelease != undefined) { - this.funcAfterRightButtonRelease(); - } - - this.funcAfterRightButtonRelease = undefined; - } - } - - } - // gives orientation of the hub (leftside, up,..) - else if (messageType == 14) { - /* this data stream is about hub orientation */ - - var newOrientation = parsedUJSON.p; - // console.log(newOrientation); - if (newOrientation == "1") { - this.lastHubOrientation = "up"; - } - else if (newOrientation == "4") { - this.lastHubOrientation = "down"; - } - else if (newOrientation == "0") { - this.lastHubOrientation = "front"; - } - else if (newOrientation == "3") { - this.lastHubOrientation = "back"; - } - else if (newOrientation == "2") { - this.lastHubOrientation = "rightside"; - } - else if (newOrientation == "5") { - this.lastHubOrientation = "leftside"; - } - - console.log("%cTuftsCEEO ", "color: #3ba336;", this.lastUJSONRPC); - } - else if (messageType == 7) { - if (this.funcAfterPrint != undefined) { - this.funcAfterPrint(">>> Program started!"); - } - } - else if (messageType == 8) { - if (this.funcAfterPrint != undefined) { - this.funcAfterPrint(">>> Program finished!"); - } - } - else if (messageType == 9) { - var encodedName = parsedUJSON["p"]; - var decodedName = atob(encodedName); - this.hubName = decodedName; - - if (this.triggerCurrentStateCallback != undefined) { - this.triggerCurrentStateCallback(); - } - } - else if (messageType == 11) { - console.log("%cTuftsCEEO ", "color: #3ba336;", this.lastUJSONRPC); - } - else if (messageType == 12) { - // this is usually the response from trigger_current_state, don't console log to avoid spam - } - else if (messageType == 4) { - var newGesture = parsedUJSON.p; - - if (newGesture == "3") { - this.hubGesture = "freefall"; - this.hubGestures.push(this.hubGesture); - } - else if (newGesture == "2") { - this.hubGesture = "shaken"; - this.hubGestures.push("shaken"); // the string is different at higher level - } - else if (newGesture == "1") { - this.hubFrontEvent = "doubletapped"; - this.hubGesture = "doubletapped"; - this.hubGestures.push(this.hubGesture); - } - else if (newGesture == "0") { - this.hubFrontEvent = "tapped"; - this.hubGesture = "tapped"; - this.hubGestures.push(this.hubGesture); - } - - // execute funcAfterNewGesture callback that was taken at wait_for_new_gesture() - if (typeof funcAfterNewGesture === "function") { - this.funcAfterNewGesture(hubGesture); - this.funcAfterNewGesture = undefined; - } - - console.log("%cTuftsCEEO ", "color: #3ba336;", this.lastUJSONRPC); - - } - else { - - // general parameters check - if (parsedUJSON["r"]) { - if (parsedUJSON["r"]["slots"]) { - - var storageInfo = parsedUJSON["r"]["slots"]; // get info of all the slots - - for (var slotid in storageInfo) { - this.hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable - } - - } - } - - // getFirmwareInfo callback check - if (this.getFirmwareInfoCallback != undefined) { - if (this.getFirmwareInfoCallback[0] == parsedUJSON["i"]) { - var version = parsedUJSON["r"]["runtime"]["version"]; - var stringVersion = "" - for (var index in version) { - if (index < version.length - 1) { - stringVersion = stringVersion + version[index] + "."; - } - else { - stringVersion = stringVersion + version[index]; - } - } - console.log("%cTuftsCEEO ", "color: #3ba336;", "firmware version: ", stringVersion); - this.getFirmwareInfoCallback[1](stringVersion); - } - } - // COMMENTED BY JEREMY JUNG ON DECEMBER 10TH AFTER REMOVING TRIGGER_CURRENT_STATE INTERVAL - // if (parsedUJSON.r !== undefined && parsedUJSON.r !== null) { - // if (Object.keys(parsedUJSON.r).length !== 0 && parsedUJSON.r.constructor === Object) { - // console.log("%cTuftsCEEO ", "color: #3ba336;", "received response: ", lastUJSONRPC); - // } - // } - // else { - // console.log("%cTuftsCEEO ", "color: #3ba336;", "received response: ", lastUJSONRPC); - // } - - console.log("%cTuftsCEEO ", "color: #3ba336;", "received response: ", this.lastUJSONRPC); - /* See if any of the stored responseCallbacks need to be executed due to this UJSONRPC response */ - for (var index = 0; index < this.responseCallbacks.length; index++) { - - var currCallbackInfo = this.responseCallbacks[index]; - - if (currCallbackInfo != undefined) { - - if (currCallbackInfo[0] == parsedUJSON["i"]) { - /* the message id of UJSONRPC corresponds to that of a response callback */ - - var response = "null"; - - // parse motor stoppage reason responses - if (parsedUJSON["r"] == 0) { - response = "done"; - } - else if (parsedUJSON["r"] == 2) { - response = "stalled"; - } - - // execute callback with the response - currCallbackInfo[1](response); - - // empty the index of which callback that was just executed - this.responseCallbacks[index] = undefined; - } - } - } - - // execute the callback function after sending start_write_program UJSONRPC - if (this.startWriteProgramCallback != undefined) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "startWriteProgramCallback is defined. Looking for matching mesasage id: ", this.startWriteProgramCallback[0]); - - // check if the message id of UJSONRPC corresponds to that of a response callback - if (this.startWriteProgramCallback[0] == parsedUJSON["i"]) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "matching message id detected with startWriteProgramCallback[0]: ", this.startWriteProgramCallback[0]) - - // get the information for the packet sending - var blocksize = parsedUJSON["r"]["blocksize"]; // maximum size of each packet to be sent in bytes - var transferid = parsedUJSON["r"]["transferid"]; // id to use for transferring this program - - console.log("%cTuftsCEEO ", "color: #3ba336;", "executing writePackageFunc expecting transferID of ", transferid); - - // execute callback - await this.startWriteProgramCallback[1](blocksize, transferid); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "deallocating startWriteProgramCallback"); - - // deallocate callback - this.startWriteProgramCallback = undefined; - } - - } - - // check if the program should write packages for a program - if (this.writePackageInformation != undefined) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "writePackageInformation is defined. Looking for matching mesasage id: ", this.writePackageInformation[0]); - - // check if the message id of UJSONRPC corresponds to that of the first write_package script that was sent - if (this.writePackageInformation[0] == parsedUJSON["i"]) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "matching message id detected with writePackageInformation[0]: ", this.writePackageInformation[0]); - - // get the information for the package sending process - var remainingData = this.writePackageInformation[1]; - var transferID = this.writePackageInformation[2]; - var blocksize = this.writePackageInformation[3]; - - // the size of the remaining data to send is less than or equal to blocksize - if (remainingData.length <= blocksize) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "remaining data's length is less than or equal to blocksize"); - - // the size of remaining data is not zero - if (remainingData.length != 0) { - - var dataToSend = remainingData.substring(0, remainingData.length); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "reminaing data's length is not zero, sending entire remaining data: ", dataToSend); - - var base64data = btoa(dataToSend); - - this.UJSONRPC.writePackage(base64data, transferID); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "deallocating writePackageInforamtion") - - if (this.writeProgramCallback != undefined) { - - this.writeProgramCallback(); - } - - - this.writePackageInformation = undefined; - } - } - // the size of remaining data is more than the blocksize - else if (remainingData.length > blocksize) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "remaining data's length is more than blocksize"); - - var dataToSend = remainingData.substring(0, blocksize); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "sending blocksize amount of data: ", dataToSend) - - var base64data = btoa(dataToSend); - - var messageid = UJSONRPC.writePackage(base64data, transferID); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "expected response with message id of ", messageid); - - var remainingData = remainingData.substring(blocksize, remainingData.length); - - this.writePackageInformation = [messageid, remainingData, transferID, blocksize]; - } - } - } - } -} - -/** Get the orientation of the hub based on gyroscope values - * - * @private - * @param {(number|Array)} gyro - */ -Service_SPIKE.prototype.setHubOrientation = function (gyro) { - var newOrientation; - if (gyro[0] < 500 && gyro[0] > -500) { - if (gyro[1] < 500 && gyro[1] > -500) { - - if (gyro[2] > 500) { - newOrientation = "front"; - } - else if (gyro[2] < -500) { - newOrientation = "back"; - } - } - else if (gyro[1] > 500) { - newOrientation = "up"; - } - else if (gyro[1] < -500) { - newOrientation = "down"; - } - } else if (gyro[0] > 500) { - newOrientation = "rightside"; - } - else if (gyro[0] < -500) { - newOrientation = "leftside"; - } - - return newOrientation; -} diff --git a/server/examples/modules/SPIKE/webserial/webserial.js b/server/examples/modules/SPIKE/webserial/webserial.js deleted file mode 100644 index 6dbcefb..0000000 --- a/server/examples/modules/SPIKE/webserial/webserial.js +++ /dev/null @@ -1,227 +0,0 @@ - -/** Prompt user to select web serial port and make connection to SPIKE Prime - *

Effect Makes prompt in Google Chrome ( Google Chrome Browser needs "Experimental Web Interface" enabled)

- *

Note:

- *

This function is to be executed before reading in JSON RPC streams from the hub

- *

This function needs to be called when system is handling a user gesture (like button click)

- * @private - * @returns {boolean} True if web serial initialization is successful, false otherwise - */ -Service_SPIKE.prototype.initWebSerial = async function () { - try { - var success = false; - - this.port = await navigator.serial.getPorts(); - console.log("%cTuftsCEEO ", "color: #3ba336;", "ports:", this.port); - // select device - this.port = await navigator.serial.requestPort({ - // filters:[filter] - }); - // wait for the port to open. - try { - await this.port.open({ baudRate: 115200 }); - } - catch (er) { - console.log("%cTuftsCEEO ", "color: #3ba336;", er); - // check if system requires baudRate syntax - if (er.message.indexOf("baudrate") > -1) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "baudRate needs to be baudrate"); - await this.port.open({ baudrate: 115200 }); - } - // check if error is due to unsuccessful closing of previous port - else if (er.message.indexOf("close") > -1) { - if (this.funcAfterError != undefined) { - this.funcAfterError(er + "\nPlease try again. If error persists, refresh this environment."); - } - await this.port.close(); - } else { - if (this.funcAfterError != undefined) { - this.funcAfterError(er + "\nPlease try again. If error persists, refresh this environment."); - } - } - await this.port.close(); - } - - if (this.port.readable) { - success = true; - } - else { - success = false; - } - - return success; - - - } catch (e) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "Cannot read port:", e); - if (this.funcAfterError != undefined) { - this.funcAfterError(e); - } - return false; - } -} - - -/** Send command to the SPIKE Prime (UJSON RPC or Micropy depending on current interpreter) - *

May make the SPIKE Prime do something

- * @ignore - * @param {string} command Command to send (or sequence of commands, separated by new lines) - */ -Service_SPIKE.prototype.sendDATA = async function (command) { - // look up the command to send - var commands = command.split("\n"); // split on new line - - // ignore console logging trigger_current_state (to avoid it spamming) - if (command.indexOf("trigger_current_state") == -1) - console.log("%cTuftsCEEO ", "color: #3ba336;", "sendDATA: " + commands); - - // make sure ready to write to device - setupWriter(); - - // send it in micropy if micropy reached - if (this.micropython_interpreter) { - - for (var i = 0; i < commands.length; i++) { - // console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) - - // trim trailing, leading whitespaces - var current = commands[i].trim(); - - this.writer.write(current); - this.writer.write(RETURN); // extra return at the end - } - } - // expect json scripts if micropy not reached - else { - // go through each line of the command - // trim it, send it, and send a return... - for (var i = 0; i < commands.length; i++) { - - //console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) - - current = commands[i].trim(); - //console.log("%cTuftsCEEO ", "color: #3ba336;", "current", current); - // turn string into JSON - - //string_current = (JSON.stringify(current)); - //myobj = JSON.parse(string_current); - var myobj = await JSON.parse(current); - - // turn JSON back into string and write it out - this.writer.write(JSON.stringify(myobj)); - this.writer.write(RETURN); // extra return at the end - } - } -} - - -/** Continuously take UJSON RPC input from SPIKE Prime - * @private - */ -Service_SPIKE.prototype.streamUJSONRPC = async function () { - try { - // COMMENTED BY JEREMY JUNG (DECEMBER/10/2020) - // var triggerCurrentStateInterval = setInterval(function() { - // UJSONRPC.triggerCurrentState(); - // }, 500); - - var firstReading = true; - // read when port is set up - while (this.port.readable) { - - // initialize readers - const decoder = new TextDecoderStream(); - const readableStreamClosed = this.port.readable.pipeTo(decoder.writable); - this.reader = decoder.readable.getReader(); - - // continuously get - while (true) { - try { - - if (firstReading) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "##### READING FIRST UJSONRPC LINE ##### CHECKING VARIABLES"); - console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline: ", this.jsonline); - console.log("%cTuftsCEEO ", "color: #3ba336;", "lastUJSONRPC: ", this.lastUJSONRPC); - firstReading = false; - } - // read UJSON RPC stream ( actual data in {value} ) - ({ value, done } = await this.reader.read()); - - // log value - if (this.micropython_interpreter) { - console.log("%cTuftsCEEO ", "color: #3ba336;", value); - } - - // console.log("%cTuftsCEEO ", "color: #3ba336;", value); - - //concatenate UJSONRPC packets into complete JSON objects - if (value) { - await this.parsePacket(value); - } - if (done) { - this.serviceActive = false; - // reader has been canceled. - console.log("%cTuftsCEEO ", "color: #3ba336;", "[readLoop] DONE", done); - } - } - // error handler - catch (error) { - console.log("%cTuftsCEEO ", "color: #3ba336;", '[readLoop] ERROR', error); - - this.serviceActive = false; - - if (this.funcAfterDisconnect != undefined) { - this.funcAfterDisconnect(); - } - - if (this.funcAfterError != undefined) { - this.funcAfterError("SPIKE Prime hub has been disconnected"); - } - - this.writer.close(); - //await writer.releaseLock(); - await this.writableStreamClosed; - - this.reader.cancel(); - //await reader.releaseLock(); - await this.readableStreamClosed.catch(reason => { }); - - await this.port.close(); - - this.writer = undefined; - this.reader = undefined; - this.jsonline = ""; - this.lastUJSONRPC = undefined; - json_string = undefined; - cleanedJsonString = undefined; - - break; // stop trying to read - } - } // end of: while (true) [reader loop] - - // release the lock - this.reader.releaseLock(); - - } // end of: while (port.readable) [checking if readable loop] - console.log("%cTuftsCEEO ", "color: #3ba336;", "- port.readable is FALSE") - } // end of: trying to open port - catch (e) { - this.serviceActive = false; - // Permission to access a device was denied implicitly or explicitly by the user. - console.log("%cTuftsCEEO ", "color: #3ba336;", 'ERROR trying to open:', e); - } -} - -/** Initialize writer object before sending commands - * @private - * - */ -Service_SPIKE.prototype.setupWriter = function () { - // if writer not yet defined: - if (typeof this.writer === 'undefined') { - // set up writer for the first time - const encoder = new TextEncoderStream(); - this.writableStreamClosed = encoder.readable.pipeTo(port.writable); - this.writer = encoder.writable.getWriter(); - } -} \ No newline at end of file diff --git a/server/examples/modules/ServiceDock_SPIKE.js b/server/examples/modules/ServiceDock_SPIKE.js index bd1971a..3e528a1 100644 --- a/server/examples/modules/ServiceDock_SPIKE.js +++ b/server/examples/modules/ServiceDock_SPIKE.js @@ -2821,7 +2821,7 @@ function Service_SPIKE() { * @param {string} data entire data to send in ASCII * @param {integer} slotid slot to which to assign the program */ - UJSONRPC.startWriteProgram = async function startWriteProgram(projectName, type, data, slotid) { + UJSONRPC.startWriteProgram = async function startWriteProgram (projectName, type, data, slotid) { console.log("%cTuftsCEEO ", "color: #3ba336;", "in startWriteProgram..."); console.log("%cTuftsCEEO ", "color: #3ba336;", "constructing start_write_program script..."); diff --git a/server/examples/modules/scaledSPIKE/Service_SPIKE.js b/server/examples/modules/scaledSPIKE/Service_SPIKE.js new file mode 100644 index 0000000..87f7b95 --- /dev/null +++ b/server/examples/modules/scaledSPIKE/Service_SPIKE.js @@ -0,0 +1,1438 @@ +/* +Project Name: SPIKE Prime Web Interface +File name: Service_SPIKE.js +Author: Jeremy Jung +Last update: 3/14/21 +Description: Main interface for users to interact with their SPIKE Primes. +Credits/inspirations: + Based on code wrriten by Ethan Danahy, Chris Rogers +History: + Created by Jeremy on 7/15/20 +LICENSE: MIT +(C) Tufts Center for Engineering Education and Outreach (CEEO) +*/ + + + +/** + * @class Service_SPIKE + * @classdesc + * ServiceDock library for interfacing with LEGO® SPIKE™ Prime + * @example + * // assuming you declared with the id, "service_spike" + * var serviceSPIKE = document.getElemenyById("service_spike").getService(); + * serviceSPIKE.executeAfterInit(async function() { + * // write code here + * }) + * + * serviceSPIKE.init(); + */ +function Service_SPIKE () { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // Service Dock variables + let virtualSpike = new _virtualSpike(); + let ujsonLib = _SpikeUjsonLib; + let serviceActive = false; // flag for service initialization state + + // flag for development + let dev = false; + + var funcAtInit = () => {} + var funcAfterPrint = (m) => {}; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => {}; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => {}; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => {}; // function to call after SPIKE Prime is connected + var funcWithStream = () => {} // function to call during SPIKE Prime data stream + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + /** Connect to a webserial port and begin data stream with hub + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + console.log(dev); + let serviceActive = await virtualSpike.init(isDev); + + if (serviceActive === true) { + await sleep(1000); + } + + devConsoleLog("serviceActive: " + serviceActive); + return serviceActive; + } + catch (e) { + consoleError(e); + } + + + // initialize web serial connection + // var webSerialConnected = await initWebSerial(); + + // if (webSerialConnected) { + + // start streaming UJSONRPC + // streamUJSONRPC(); + + // await sleep(1000); + + // triggerCurrentState(); + // getFirmwareInfo(function (version) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "This SPIKE Prime is using Hub OS ", version); + // }); + // serviceActive = true; + + // await sleep(2000); // wait for service to init + + // // call funcAtInit if defined + // if (funcAtInit !== undefined) { + // funcAtInit(); + // } + // return true; + // } + // else { + // return false; + // } + } + + const isActive = function () { + return serviceActive; + } + + /** The PrimeHub object includes controllable interfaces ("constants") for your SPIKE Prime, such as left_button, right_button, motion_sensor, and light_matrix. + * @namespace + * @memberof Service_SPIKE + * @example + * // Initialize the Hub + * var hub = new serviceSPIKE.PrimeHub() + */ + const PrimeHub = function () { + var newOrigin = 0; + + /** The left button on the hub + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.left_button + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * // do something with left_button + */ + var left_button = {}; + + /** execute callback after this button is pressed + * @param {function} callback function to run when button is pressed + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * left_button.wait_until_pressed ( function () { + * console.log("left_button was pressed"); + * }) + * + */ + left_button.wait_until_pressed = function (callback) { + virtualSpike.spikeMemory.funcAfterLeftButtonPress = callback; + } + /** execute callback after this button is released + * + * @param {function} callback function to run when button is released + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var left_button = hub.left_button; + * left_button.wait_until_released ( function () { + * console.log("left_button was released"); + * }) + */ + left_button.wait_until_released = function (callback) { + virtualSpike.spikeMemory.funcAfterLeftButtonRelease = callback; + } + /** Tests to see whether the button has been pressed since the last time this method called. + * + * @returns {boolean} - True if was pressed, false otherwise + * @example + * if (left_button.was_pressed()) { + * console.log("left_button was pressed") + * } + */ + left_button.was_pressed = function () { + if (virtualSpike.hub.leftButton.duration > 0) { + virtualSpike.hub.leftButton.duration = 0; + return true; + } else { + return false; + } + } + + /** Tests to see whether the button is pressed + * + * @returns {boolean} True if pressed, false otherwise + * @example + * if (left_button.is_pressed()) { + * console.log("left_button is pressed") + * } + */ + left_button.is_pressed = function () { + if (virtualSpike.hub.leftButton.pressed) { + return true; + } + else { + return false; + } + } + + /** The right button on the hub + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from PrimeHub.right_button + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * // do something with right_button + */ + var right_button = {}; + + /** execute callback after this button is pressed + * + * @param {function} callback function to run when button is pressed + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * right_button.wait_until_pressed ( function () { + * console.log("right_button was pressed"); + * }) + */ + right_button.wait_until_pressed = function (callback) { + + virtualSpike.spikeMemory.funcAfterRightButtonPress = callback; + } + + /** execute callback after this button is released + * + * @param {function} callback function to run when button is released + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * var right_button = hub.right_button; + * right_button.wait_until_released ( function () { + * console.log("right_button was released"); + * }) + */ + right_button.wait_until_released = function (callback) { + + virtualSpike.spikeMemory.funcAfterRightButtonRelease = callback; + } + + /** Tests to see whether the button has been pressed since the last time this method called. + * + * @returns {boolean} - True if was pressed, false otherwise + * @example + * var hub = new serviceSPIKE.PrimeHub(); + * if ( hub.right_button.was_pressed() ) { + * console.log("right_button was pressed"); + * } + */ + right_button.was_pressed = function () { + if (virtualSpike.hub.rightButton.duration > 0) { + virtualSpike.hub.rightButton.duration = 0; + return true; + } else { + return false; + } + } + + /** Tests to see whether the button is pressed + * + * @returns {boolean} True if pressed, false otherwise + * @example + * if (right_button.is_pressed()) { + * console.log("right_button is pressed") + * } + */ + right_button.is_pressed = function () { + if (virtualSpike.hub.rightButton.pressed) { + return true; + } + else { + return false; + } + } + /** Following are all of the functions that are linked to the Hub’s programmable Brick Status Light. + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.light_matrix + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var status_light = hub.status_light; + * // do something with status_light + */ + var status_light = {}; + + /** Sets the color of the light. + * @param {string} color ["azure","black","blue","cyan","green","orange","pink","red","violet","yellow","white"] + * @example + * var hub = new Primehub() + * hub.status_light.on("blue") + * + */ + status_light.on = function (color) { + let dictColor = { + "azure": 4, + "black": 12, + "blue": 3, + "cyan": 5, + "green": 6, + "orange": 8, + "pink": 1, + "red": 9, + "violet": 2, + "yellow": 7, + "white": 10 + } + + let intColor = dictColor[color]; + ujsonLib.centerButtonLightUp(intColor, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Turns off the light. + * @example + * var hub = new Primehub() + * hub.status_light.off() + */ + status_light.off = function () { + ujsonLib.centerButtonLightUp(0, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Hub's light matrix + * @namespace + * @memberof! PrimeHub + * @returns {functions} - functions from PrimeHub.light_matrix + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var light_matrix = hub.light_matrix; + * // do something with light_matrix + */ + var light_matrix = {}; + + /** + * @todo Implement this function + * @ignore + * @param {string} + */ + light_matrix.show_image = function (image) { + + } + /** Sets the brightness of one pixel (one of the 25 LED) on the Light Matrix. + * + * @param {integer} x [0 to 4] + * @param {integer} y [0 to 4] + * @param {integer} brightness [0 to 100] + */ + light_matrix.set_pixel = function (x, y, brightness = 100) { + ujsonLib.displaySetPixel(x, y, brightness, (c, rid) => virtualSpike.sendDATA(c)); + + } + /** Writes text on the Light Matrix, one letter at a time, scrolling from right to left. + * + * @param {string} message + */ + light_matrix.write = function (message) { + ujsonLib.displayText(message, (c, rid) => virtualSpike.sendDATA(c)); + } + /** Turns off all the pixels on the Light Matrix. + * + */ + light_matrix.off = function () { + ujsonLib.displayClear((c, rid) => virtualSpike.sendDATA(c)); + } + + /** Hub's speaker + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from Primehub.speaker + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var speaker = hub.speaker; + * // do something with speaker + */ + var speaker = {}; + + speaker.volume = 100; + + /** Plays a beep on the Hub. + * + * @param {integer} note The MIDI note number [44 to 123 (60 is middle C note)] + * @param {number} seconds The duration of the beep in seconds + */ + speaker.beep = function (note, seconds) { + ujsonLib.soundBeep(speaker.volume, note, (c, rid) => virtualSpike.sendDATA(c)); + setTimeout(function () { ujsonLib.soundStop((c, rid) => virtualSpike.sendDATA(c)) }, seconds * 1000); + } + + /** Starts playing a beep. + * + * @param {integer} note The MIDI note number [44 to 123 (60 is middle C note)] + */ + speaker.start_beep = function (note) { + ujsonLib.soundBeep(speaker.volume, note, (c, rid) => virtualSpike.sendDATA(c)) + } + + /** Stops any sound that is playing. + * + */ + speaker.stop = function () { + ujsonLib.soundStop((c, rid) => virtualSpike.sendDATA(c)); + } + + /** Retrieves the value of the speaker volume. + * @returns {number} The current volume [0 to 100] + */ + speaker.get_volume = function () { + return speaker.volume; + } + + /** Sets the speaker volume. + * + * @param {integer} newVolume + */ + speaker.set_volume = function (newVolume) { + speaker.volume = newVolume + } + + /** Hub's motion sensor + * @namespace + * @memberof! PrimeHub + * @returns {functions} functions from PrimeHub.motion_sensor + * @example + * var hub = serviceSPIKE.PrimeHub(); + * var motion_sensor = hub.motion_sensor; + * // do something with motion_sensor + */ + var motion_sensor = {}; + + /** Sees whether a gesture has occurred since the last time was_gesture() + * was used or since the beginning of the program (for the first use). + * + * @param {string} gesture + * @returns {boolean} true if the gesture was made, false otherwise + */ + motion_sensor.was_gesture = function (gesture) { + + var gestureWasMade = false; + + // iterate over the hubGestures array + for (let index in virtualSpike.spikeMemory.hubGestures) { + + // pick a gesture from the array + var oneGesture = virtualSpike.spikeMemory.hubGestures[index]; + + // switch the flag that gesture existed + if (oneGesture == gesture) { + gestureWasMade = true; + break; + } + } + // reinitialize hubGestures so it only holds gestures that occurred after this was_gesture() execution + virtualSpike.spikeMemory.hubGestures = []; + + return gestureWasMade; + + } + + /** Executes callback when a new gesture happens + * + * @param {function(string)} callback - A callback of which argument is name of the gesture + * @example + * motion_sensor.wait_for_new_gesture( function ( newGesture ) { + * if ( newGesture == 'tapped') { + * console.log("SPIKE was tapped") + * } + * else if ( newGesture == 'doubletapped') { + * console.log("SPIKE was doubletapped") + * } + * else if ( newGesture == 'shaken') { + * console.log("SPIKE was shaken") + * } + * else if ( newGesture == 'freefall') { + * console.log("SPIKE was freefall") + * } + * }) + */ + motion_sensor.wait_for_new_gesture = function (callback) { + + virtualSpike.spikeMemory.funcAfterNewGesture = callback; + + } + + /** Executes callback when the orientation of the Hub changes or when function was first called + * + * @param {function(string)} callback - A callback whose signature is name of the orientation + * @example + * motion_sensor.wait_for_new_orientation( function ( newOrientation ) { + * if (newOrientation == "up") { + * console.log("orientation is up"); + * } + * else if (newOrientation == "down") { + * console.log("orientation is down"); + * } + * else if (newOrientation == "front") { + * console.log("orientation is front"); + * } + * else if (newOrientation == "back") { + * console.log("orientation is back"); + * } + * else if (newOrientation == "leftSide") { + * console.log("orientation is leftSide"); + * } + * else if (newOrientation == "rightSide") { + * console.log("orientation is rightSide"); + * } + * }) + */ + motion_sensor.wait_for_new_orientation = function (callback) { + // immediately return current orientation if the method was called for the first time + if (virtualSpike.spikeMemory.waitForNewOriFirst) { + virtualSpike.spikeMemory.waitForNewOriFirst = false; + callback(virtualSpike.spikeMemory.lastHubOrientation); + } + // for future executions, wait until new orientation + else { + virtualSpike.spikeMemory.funcAfterNewOrientation = callback; + } + + } + + /** “Yaw” is the rotation around the front-back (vertical) axis. + * + * @returns {integer} yaw angle + */ + motion_sensor.get_yaw_angle = function get_yaw_angle() { + var currPos = virtualSpike.hub.pos[0]; + + return currPos; + } + + /** “Pitch” the is rotation around the left-right (transverse) axis. + * + * @returns {integer} pitch angle + */ + motion_sensor.get_pitch_angle = function get_pitch_angle() { + return virtualSpike.hub.pos[1]; + } + + /** “Roll” the is rotation around the front-back (longitudinal) axis. + * + * @returns {integer} roll angle + */ + motion_sensor.get_roll_angle = function get_roll_angle() { + return virtualSpike.hub.pos[2]; + } + + /** Gets the acceleration of the SPIKE's yaw axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_yaw_acceleration = function get_yaw_acceleration() { + return virtualSpike.hub.pos[2]; + } + + /** Gets the acceleration of the SPIKE's pitch axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_pitch_acceleration = function get_pitch_acceleration() { + return virtualSpike.hub.pos[1]; + } + + /** Gets the acceleration of the SPIKE's roll axis + * + * @returns {integer} acceleration + */ + motion_sensor.get_roll_acceleration = function get_roll_acceleration() { + return virtualSpike.hub.pos[0]; + } + + /** Retrieves the most recently detected gesture. + * + * @returns {string} the name of gesture + */ + motion_sensor.get_gesture = function get_gesture() { + devConsoleLog("hubGesture in Service: " + virtualSpike.hub.gesture); + return virtualSpike.hub.gesture; + } + + /** Retrieves the most recently detected orientation + * Note: Hub does not detect orientation of when it was connected + * + * @returns {string} the name of orientation + */ + motion_sensor.get_orientation = function get_orientation() { + return virtualSpike.spikeMemory.lastHubOrientation; + } + + return { + motion_sensor: motion_sensor, + light_matrix: light_matrix, + left_button: left_button, + right_button: right_button, + speaker: speaker + } + } + + /** Motor + * @namespace + * @memberof! Service_SPIKE + * @param {string} Port + * @returns {functions} + * @example + * // Initialize the Motor + * var motor = new serviceSPIKE.Motor("A") + */ + const Motor = function (port) { + + var motor = virtualSpike.ports[port]; // get the motor info by port + + // default settings + var defaultSpeed = 100; + var stopMethod = 1; // stop method doesnt seem to work in this current ujsonrpc config + var stallSetting = true; + + var direction = { + COUNTERCLOCKWISE: 'counterClockwise', + CLOCKWISE: 'clockwise' + } + + // check if device is a motor + if (motor.device != "smallMotor" && motor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + + /** Get current speed of the motor + * + * @returns {number} speed of motor [-100 to 100] + */ + function get_speed() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.speed; + + } + + /** Get current position of the motor. The position may differ by a little margin from + * the position to which a motor ran with run_to_position() + * @returns {number} position of motor [0 to 359] + */ + function get_position() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + let position = motorInfo.uAngle; + if (position < 0) + position = 360 + position; + return position; + } + + /** Get current degrees counted of the motor + * + * @returns {number} counted degrees of the motor [any number] + */ + function get_degrees_counted() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.angle; + } + + /** Get the power of the motor + * + * @returns {number} motor power + */ + function get_power() { + var motor = virtualSpike.ports[port]; // get the motor info by port + var motorInfo = motor.data; + return motorInfo.power; + } + + /** Get the default speed of this motor + * + * @returns {number} motor default speed [-100 to 100] + */ + function get_default_speed() { + return defaultSpeed; + } + + /** Set the default speed for this motor + * + * @param {number} speed [-100 to 100] + */ + function set_default_speed(speed) { + if (typeof speed == "number") { + defaultSpeed = speed; + } + } + + /** Turns stall detection on or off. + * Stall detection senses when a motor has been blocked and can’t move. + * If stall detection has been enabled and a motor is blocked, the motor will be powered off + * after two seconds and the current motor command will be interrupted. If stall detection has been + * disabled, the motor will keep trying to run and programs will “get stuck” until the motor is no + * longer blocked. + * @param {boolean} boolean - true if to detect stall, false otherwise + */ + function set_stall_detection(boolean) { + if (boolean === true) + stallSetting = 1; + else if (boolean === false) + stallSetting = 0; + else + throw new Error("argument of set_stall_detection must be a boolean type") + } + + + /** Runs the motor to an absolute position. + * The sign of the speed will be ignored (i.e., absolute value), and the motor will always travel in the direction that’s been specified by the "direction" parameter. + * If the speed is greater than "100," it will be limited to "100." + + * @param {integer} degrees [0 to 359] + * @param {string} direction "Clockwise" or "Counterclockwise" + * @param {integer} speed [-100 to 100] + * @param {function} callback Params: "stalled" or "done" + * @ignore + * @example + * motor.run_to_position(180, 100, function() { + * console.log("motor finished moving"); + * }) + */ + function run_to_position(degrees, direction, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Runs the motor until the number of degrees counted is equal to the value that has been specified by the "degrees" parameter. + * + * @param {integer} degrees any number + * @param {integer} speed [0 to 100] + * @param {any} [callback] (optional callback) callback param: "stalled" or "done" + */ + function run_to_degrees_counted(degrees, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorGoRelPos(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Start the motor at some power + * + * @param {integer} power [-100 to 100] + */ + function start_at_power(power) { + ujsonLib.motorPwm(port, power, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + + /** Start the motor at some speed + * + * @param {integer} speed [-100 to 100] + */ + function start(speed = defaultSpeed) { + // if (speed !== undefined && typeof speed == "number") { + // ujsonLib.motorStart (port, speed, stallSetting); + // } + // else { + // ujsonLib.motorStart(port, defaultSpeed, stallSetting); + // } + + ujsonLib.motorStart(port, speed, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Run the motor for some seconds + * + * @param {integer} seconds + * @param {integer} speed [-100 to 100] + * @param {function} [callback==undefined] Parameters:"stalled" or "done" + * @example + * motor.run_for_seconds(10, 100, function() { + * console.log("motor just ran for 10 seconds"); + * }) + */ + function run_for_seconds(seconds, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorRunTimed(port, seconds, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }); + } + + /** Run the motor for some degrees + * + * @param {integer} degrees + * @param {integer} speed [-100 to 100] + * @param {function} [callback==undefined] Parameters:"stalled" or "done" + * motor.run_for_degrees(720, 100, function () { + * console.log("motor just ran for 720 degrees"); + * }) + */ + function run_for_degrees(degrees, speed = defaultSpeed, callback = undefined) { + ujsonLib.motorRunDegrees(port, degrees, speed, stallSetting, stopMethod, callback, + (c, rid) => { + virtualSpike.sendDATA(c); + if (callback != undefined) + virtualSpike.pushResponseCallback(rid, callback); + }) + } + + /** Stop the motor + * + */ + function stop() { + ujsonLib.motorPwm(port, 0, stallSetting, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + run_to_position: run_to_position, + run_to_degrees_counted: run_to_degrees_counted, + start_at_power: start_at_power, + start: start, + stop: stop, + run_for_degrees: run_for_degrees, + run_for_seconds: run_for_seconds, + set_default_speed: set_default_speed, + set_stall_detection: set_stall_detection, + get_power: get_power, + get_degrees_counted: get_degrees_counted, + get_position: get_position, + get_speed: get_speed, + get_default_speed: get_default_speed + } + } + + + /** ColorSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the Color Sensor + * var color = new serviceSPIKE.ColorSensor("E") + */ + const ColorSensor = function (port) { + var waitForNewColorFirst = false; + + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + // check if device is a color sensor + if (colorsensor.device != "color") { + throw new Error("No Color Sensor detected at port " + port); + } + + /** Get the name of the detected color + * @returns {string} 'black','violet','blue','cyan','green','yellow','red','white' + */ + function get_color() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + var color = colorsensorData.color; + + return color; + } + + /** Retrieves the intensity of the ambient light. + * @ignore + * @returns {number} The ambient light intensity. [0 to 100] + */ + function get_ambient_light() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.Cambient; + } + + /** Retrieves the intensity of the reflected light. + * + * @returns {number} The reflected light intensity. [0 to 100] + */ + function get_reflected_light() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.Creflected; + } + + /** Retrieves the red, green, blue, and overall color intensity. + * @todo Implement overall intensity + * @ignore + * @returns {(number|Array)} Red, green, blue, and overall intensity (0-1024) + */ + function get_rgb_intensity() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + var toReturn = []; + toReturn.push(colorsensorData.Cr); + toReturn.push(colorsensorData.Cg); + toReturn.push(colorsensorData.Cb) + toReturn.push("TODO: unimplemented");; + } + + /** Retrieves the red color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_red() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[0]; + } + + /** Retrieves the green color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_green() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[1]; + } + + /** Retrieves the blue color intensity. + * + * @returns {number} [0 to 1024] + */ + function get_blue() { + var colorsensor = virtualSpike.ports[port]; // get the color sensor info by port + var colorsensorData = colorsensor.data; + + return colorsensorData.RGB[2]; + } + + /** Waits until the Color Sensor detects the specified color. + * + * @param {string} colorInput 'black','violet','blue','cyan','green','yellow','red','white' + * @param {function} callback callback function + */ + function wait_until_color(colorInput, callback) { + virtualSpike.spikeMemory.waitUntilColorCallback = [colorInput, callback]; + } + + + /** Execute callback when Color Sensor detects a new color. + * The first time this method is called, it returns immediately the detected color. + * After that, it waits until the Color Sensor detects a color that is different from the color that + * was detected the last time this method was used. + * @param {function(string)} callback params: detected new color + */ + function wait_for_new_color(callback) { + + // check if this method has been executed after start of program + if (virtualSpike.spikeMemory.waitForNewColorFirst) { + virtualSpike.spikeMemory.waitForNewColorFirst = false; + + var currentColor = get_color(); + callback(currentColor) + } + virtualSpike.spikeMemory.funcAfterNewColor = callback; + } + + return { + get_color: get_color, + wait_until_color: wait_until_color, + wait_for_new_color: wait_for_new_color, + get_ambient_light: get_ambient_light, + get_reflected_light: get_reflected_light, + get_rgb_intensity: get_rgb_intensity, + get_red: get_red, + get_green: get_green, + get_blue: get_blue + } + + } + + /** DistanceSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the DistanceSensor + * var distance_sensor = new serviceSPIKE.DistanceSensor("A"); + */ + const DistanceSensor = function (port) { + var distanceSensor = virtualSpike.ports[port]; // get the distance sensor info by port + + // check if device is a distance sensor + if (distanceSensor.device != "ultrasonic") { + console.error("Ports Info: ", ports); + throw new Error("No DistanceSensor detected at port " + port); + } + + /** Retrieves the measured distance in centimeters. + * @returns {number} [0 to 200] + * @todo find the short_range handling ujsonrpc script + * @example + * var distance_cm = distance_sensor.get_distance_cm(); + */ + function get_distance_cm() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + return distanceSensorData.distance; + } + + /** Retrieves the measured distance in inches. + * + * @returns {number} [0 to 79] + * @todo find the short_range handling ujsonrpc script + * @example + * var distance_inches = distance_sensor.get_distance_inches(); + */ + function get_distance_inches() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + var inches = distanceSensorData.distance * 0.393701; // convert to inches + + if (inches % 1 < 0.5) + inches = Math.floor(inches); + else + inches = Math.ceil(inches); + + return inches; + } + + /** Retrieves the measured distance in percent. + * + * @returns {number/string} [0 to 100] or 'none' if no distance is read + * var distance_percentage = distance_sensor.get_distance_percentage(); + */ + function get_distance_percentage() { + var distanceSensor = virtualSpike.ports[port] // get the distance sensor info by port + var distanceSensorData = distanceSensor.data; + + if (distanceSensorData.distance == null) { + return "none" + } + var percentage = distanceSensorData.distance / 200; + return percentage; + } + + /** Waits until the measured distance is greater than distance. + * @param {integer} threshold + * @param {string} unit 'cm','in','%' + * @param {function} callback function to execute when distance is farther than threshold + * @example + * distance_sensor.wait_for_distance_farther_than(10, 'cm', function () { + * console.log("distance is farther than 10 CM"); + * }) + */ + function wait_for_distance_farther_than(threshold, unit, callback) { + + // set callbacks to be executed in updateHubPortsInfo() + if (unit == 'cm') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [threshold, callback]; + } + else if (unit == 'in') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [threshold / 0.393701, callback]; + } + else if (unit == '%') { + virtualSpike.spikeMemory.waitForDistanceFartherThanCallback = [(threshold * 0.01) * 200, callback]; + } + else { + throw new Error("The 'unit' argument in wait_for_distance_farther_than(threshold, unit, callback) must be either 'cm', 'in', or '%'.") + } + } + + /** Waits until the measured distance is less than distance. + * @param {integer} threshold + * @param {string} unit 'cm','in','%' + * @param {function} callback function to execute when distance is closer than threshold + * @example + * distance_sensor.wait_for_distance_closer_than(10, 'cm', function () { + * console.log("distance is closer than 10 CM"); + * }) + */ + function wait_for_distance_closer_than(threshold, unit, callback) { + // set callbacks to be executed in updateHubPortsInfo() + if (unit == 'cm') { + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [threshold, callback]; + } + else if (unit == 'in') { + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [threshold / 0.393701, callback]; + } + else if (unit == '%') { + + /* floor or ceil thresholds larger or smaller than what's possible */ + if (threshold > 100) { + threshold = 100; + } + else if (threshold < 0) { + threshold = 0; + } + + virtualSpike.spikeMemory.waitForDistanceCloserThanCallback = [(threshold * 0.01) * 200, callback]; + } + else { + throw new Error("The 'unit' argument in wait_for_distance_closer_than(threshold, unit, callback) must be either 'cm', 'in', or '%'.") + } + } + + /** Sets the brightness of the individual lights on the Distance Sensor. + * + * @param {integer} right_top Brightness [1-100] + * @param {integer} left_top Brightness [1-100] + * @param {integer} right_bottom Brightness [1-100] + * @param {integer} left_bottom Brightness [1-100] + * @example + * distance_sensor.light_up(100,100,100,100); + */ + function light_up(right_top, left_top, right_bottom, left_bottom) { + let lightArray = [0, 0, 0, 0]; + lightArray[0] = right_top; + lightArray[1] = left_top; + lightArray[2] = right_bottom; + lightArray[3] = left_bottom; + + ujsonLib.ultrasonicLightUp(port, lightArray, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Lights up all of the lights on the Distance Sensor at the specified brightness. + * + * @param {number} [brightness=100] The specified brightness of all of the lights + * @example + * distance_sensor.light_up_all(50) + */ + function light_up_all(brightness = 100) { + + let lightArray = [brightness, brightness, brightness, brightness]; + + ujsonLib.ultrasonicLightUp(port, lightArray, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + get_distance_cm: get_distance_cm, + get_distance_inches: get_distance_inches, + get_distance_percentage: get_distance_percentage, + light_up: light_up, + light_up_all: light_up_all, + wait_for_distance_closer_than: wait_for_distance_closer_than, + wait_for_distance_farther_than: wait_for_distance_farther_than + } + + } + + /** ForceSensor + * @namespace + * @param {string} Port + * @memberof Service_SPIKE + * @example + * // Initialize the ForceSensor + * var force_sensor = new serviceSPIKE.ForceSensor("E") + */ + const ForceSensor = function (port) { + + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + + if (sensor.device != "force") { + throw new Error("No Force Sensor detected at port " + port); + } + + /** Tests whether the button on the sensor is pressed. + * + * @returns {boolean} true if force sensor is pressed, false otherwise + * @example + * if (force_sensor.is_pressed() === true) { + * console.log("force sensor is pressed"); + * } + */ + function is_pressed() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + return ForceSensorData.pressed; + } + + /** Retrieves the measured force, in newtons. + * + * @returns {number} Force in newtons [0 to 10] + * @example + * var newtons = force_sensor.get_force_newtons(); + */ + function get_force_newton() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + return ForceSensorData.force; + } + + /** Retrieves the measured force as a percentage of the maximum force. + * + * @returns {number} percentage [0 to 100] + * var percentage = force_sensor.get_force_percentage(); + */ + function get_force_percentage() { + var sensor = virtualSpike.ports[port]; // get the force sensor info by port + var ForceSensorData = sensor.data; + + var denominator = 704 - 384 // highest detected - lowest detected forceSensitive values + var numerator = ForceSensorData.forceSensitive - 384 // 384 is the forceSensitive value when not pressed + var percentage = Math.round((numerator / denominator) * 100); + return percentage; + } + + /** Executes callback when Force Sensor is pressed + * The function is executed in updateHubPortsInfo()'s Force Sensor part + * @param {function} callback + * @example + * force_sensor.wait_until_pressed( function () { + * console.log("force sensor is pressed!"); + * }) + */ + function wait_until_pressed(callback) { + virtualSpike.spikeMemory.funcAfterForceSensorPress = callback; + } + + /** Executes callback when Force Sensor is released + * The function is executed in updateHubPortsInfo()'s Force Sensor part + * @param {function} callback + * @example + * force_sensor.wait_until_released ( function () { + * console.log("force sensor is released!"); + * }) + */ + function wait_until_released(callback) { + virtualSpike.spikeMemory.funcAfterForceSensorRelease = callback; + } + + return { + is_pressed: is_pressed, + get_force_newton: get_force_newton, + get_force_percentage: get_force_percentage, + wait_until_pressed: wait_until_pressed, + wait_until_released: wait_until_released + } + + } + + /** MotorPair + * @namespace + * @param {string} leftPort + * @param {string} rightPort + * @memberof Service_SPIKE + * @example + * var pair = new serviceSPIKE.MotorPair("A", "B") + */ + const MotorPair = function (leftPort, rightPort) { + // settings + var defaultSpeed = 100; + var stopMethod = 1; // stop method doesnt seem to work in this current ujsonrpc config + + var leftMotor = virtualSpike.ports[leftPort]; + var rightMotor = virtualSpike.ports[rightPort]; + + var DistanceTravelToRevolutionRatio = 17.6; + + // check if device is a motor + if (leftMotor.device != "smallMotor" && leftMotor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + if (rightMotor.device != "smallMotor" && rightMotor.device != "bigMotor") { + throw new Error("No motor detected at port " + port); + } + + /** Sets the ratio of one motor rotation to the distance traveled. + * + * If there are no gears used between the motors and the wheels of the Driving Base, + * then amount is the circumference of one wheel. + * + * Calling this method does not affect the Driving Base if it is already currently running. + * It will only have an effect the next time one of the move or start methods is used. + * + * @param {number} amount + * @param {string} unit 'cm','in' + */ + function set_motor_rotation(amount, unit) { + + // assume unit is 'cm' when undefined + if (unit == "cm" || unit !== undefined) { + DistanceTravelToRevolutionRatio = amount; + } + else if (unit == "in") { + // convert to cm + DistanceTravelToRevolutionRatio = amount * 2.54; + } + } + + function set_stop_action (action) { + + } + + /** Moves the Driving Base using differential (tank) steering. + * + * @param {number} amount + * @param {string} unit 'rotations', 'degrees', 'seconds' + * @param {number} left_spped [-100,100] + * @param {number} right_speed [-100,100] + */ + function move_tank (amount, unit, left_spped, right_speed) { + /* this function is not implemented because "rotation" depends on a set rotatation measured by 'cm' + */ + if (unit === 'rotations') { + ujsonLib.moveTankDegrees(360*amount, left_speed, right_speed, leftPort, rightPort, ) + } + } + + /** Starts moving the Driving Base + * + * @param {integer} left_speed [-100 to 100] + * @param {integer} right_speed [-100 to 100] + * @example + * pair.start_tank(100,100); + */ + function start_tank(left_speed, right_speed) { + ujsonLib.moveTankSpeeds(left_speed, right_speed, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Starts moving the Driving Base + * + * @param {integer} leftPower [-100 to 100] + * @param {integer} rightPower [-100 to 100] + * @example + * pair.start_tank_at_power(10, 10); + */ + function start_tank_at_power(leftPower, rightPower) { + ujsonLib.moveTankPowers(leftPower, rightPower, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + /** Stops the 2 motors simultaneously, which will stop a Driving Base. + * @example + * pair.stop(); + */ + function stop() { + ujsonLib.moveTankPowers(0, 0, leftPort, rightPort, (c, rid) => virtualSpike.sendDATA(c)); + } + + return { + stop: stop, + set_motor_rotation: set_motor_rotation, + start_tank: start_tank, + start_tank_at_power: start_tank_at_power + } + + } + + const writeProgram = function (projectName, data, slotid, callback) { + virtualSpike.writeProgram(projectName, data, slotid, callback); + } + + const executeAfterInit = function (f) { + if (typeof f === "function") { + funcAtInit = f; + } + else { + throw new Error("Argument to executeAfterInit must be a function") + } + } + const executeAfterConnect = function (f) { + if (typeof f === "function") { + virtualSpike.passConnectCallback(f); + } + else { + throw new Error("Argument to executeAfterConnect must be a function") + } + } + const executeAfterDisconnect = function (f) { + if (typeof f === "function") { + virtualSpike.passDisconnectCallback(f); + } + else { + throw new Error("Argument to executeAfterDisconnect must be a function") + } + } + const executeAfterError = function (f) { + if (typeof f === "function") { + funcAfterError = f; + virtualSpike.passErrorCallback(f); + } + else { + throw new Error("Argument to executeAfterError must be a function") + } + } + const executeAfterPrint = function (f) { + if (typeof f === "function") { + virtualSpike.passPrintCallback(f); + } + else { + throw new Error("Argument to executeAfterPrint must be a function") + } + } + const executeWithStream = function (f) { + if (typeof f === "function") { + virtualSpike.passStreamCallback(f); + } + else { + throw new Error("Argument to executeWithStream must be a function") + } + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** Sleep function + * @private + * @param {number} ms Miliseconds to sleep + * @returns {Promise} + */ + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + + return { + init: init, + isActive: isActive, + writeProgram: writeProgram, + // SPIKE devices + Motor: Motor, + PrimeHub: PrimeHub, + ForceSensor: ForceSensor, + DistanceSensor: DistanceSensor, + ColorSensor: ColorSensor, + MotorPair: MotorPair, + // key event callback setters + executeAfterConnect: executeAfterConnect, + executeAfterDisconnect: executeAfterDisconnect, + executeAfterError: executeAfterError, + executeAfterPrint: executeAfterPrint, + executeWithStream: executeWithStream, + executeAfterInit: executeAfterInit, + } +} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/HTML_SPIKE.js b/server/examples/modules/scaledSPIKE/Service_SPIKE_HTML.js similarity index 98% rename from server/examples/modules/SPIKE/HTML_SPIKE.js rename to server/examples/modules/scaledSPIKE/Service_SPIKE_HTML.js index 4c4ee4c..97ec1f3 100644 --- a/server/examples/modules/SPIKE/HTML_SPIKE.js +++ b/server/examples/modules/scaledSPIKE/Service_SPIKE_HTML.js @@ -1,14 +1,18 @@ /* Project Name: SPIKE Prime Web Interface -File name: ServiceDock_SPIKE.js +File name: ServiceDock_SPIKE_HTML.js Author: Jeremy Jung -Last update: 11/5/2020 +Last update: 3/14/2021 Description: HTML Element definition for to be used in ServiceDocks Credits/inspirations: History: Created by Jeremy on 7/16/20 + Fixed baudRate by Teddy on 10/11/20 (C) Tufts Center for Engineering Education and Outreach (CEEO) +TODO: +uncomment executeAfterDisconnect */ + class servicespike extends HTMLElement { constructor() { @@ -73,8 +77,16 @@ class servicespike extends HTMLElement { // check active flag so once activated, the service doesnt reinit if (!active) { if ('serial' in navigator) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "activating service"); - var initSuccessful = await this.service.init(); + console.log("%cTuftsCEEO ", "color: #3ba336;", "Activating SPIKE Service"); + + // Determine if Service is for testing + if (this.isDev == "true" || this.isDev == "t" + || this.isDev == "T" || this.isDev == "True") + this.isDev = true; + else + this.isDev = false; + + var initSuccessful = await this.service.init(this.isDev); if (initSuccessful) { active = true; status.style.backgroundColor = "green"; @@ -138,6 +150,29 @@ class servicespike extends HTMLElement { } + static get observedAttributes() { + return ["dev"]; + } + + get dev() { + return this.getAttribute("dev"); + } + + set dev(val) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", val); + if (val) { + this.setAttribute("dev", val); + } + else { + this.removeAttribute("dev"); + } + } + + attributeChangedCallback(name, oldValue, newValue) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "new value of dev: ", newValue); + this.isDev = newValue; + } + /* get the Service_SPIKE object */ getService() { return this.service; diff --git a/server/examples/modules/scaledSPIKE/spikeRPC/SpikeRPC.js b/server/examples/modules/scaledSPIKE/spikeRPC/SpikeRPC.js new file mode 100644 index 0000000..8245857 --- /dev/null +++ b/server/examples/modules/scaledSPIKE/spikeRPC/SpikeRPC.js @@ -0,0 +1,360 @@ +function _SpikeRPC(_virtualSpike) { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // flag for development + let dev = undefined; + // ServiceDock objects + let webSerial = new _WebSerial(); + + // flag for when RPC is pure micropython + let micropython_interpreter = false; + + //define for json concatenation + let jsonline = ""; + // contains latest full json object from SPIKE readings + let lastUJSONRPC = undefined; + + const VENDOR_ID = 0x0694; // LEGO SPIKE Prime Hub + // common characters to send (for REPL/uPython on the Hub) + const CONTROL_C = '\x03'; // CTRL-C character (ETX character) + const CONTROL_D = '\x04'; // CTRL-D character (EOT character) + const RETURN = '\x0D'; // RETURN key (enter, new line) + + // servicedock functions passed down from main Service + var funcAfterPrint = (m) => { }; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => { }; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => {}; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => {}; // function to call after SPIKE Prime is connected + var funcWithStream = () => {} // function to call during SPIKE Prime data stream + + + let updateHubPortsInfo = undefined; + let PrimeHubEventHandler = undefined; + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + const init = async function (isDev, portsUpdater, hubEventsUpdater) { + try { + dev = isDev; + updateHubPortsInfo = portsUpdater; + PrimeHubEventHandler = hubEventsUpdater; + + let connected = await webSerial.init(isDev); + if (connected === true) + webSerial.streamData(parsePacket); + + return connected + + } + catch (e) { + /* Catch and display errors */ + if (e.code == 10001) { + funcAfterError("Please reconnect your hub. If error persists, refresh this web environment."); + } + else if (e.code == 10002) { + funcAfterError("Please check if you have any other window or app currently connected to your hub."); + } + else if (e.code == 10003) { + if (isDev) + consoleError("Please try again. If error persists, refresh this environment." + e.message); + else + consoleError("Please try again. If error persists, refresh this environment."); + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else if (e.code == 10004) { + if (isDev) + consoleError("Please try again. If error persists, refresh this environment." + e.message); + else + consoleError("Please try again. If error persists, refresh this environment."); + consoleError(e.message); + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else if (e.code == 10005) { + funcAfterError("Please try again. If error persists, refresh this environment."); + } + else { + consoleError(e); + } + return false; + } + } + + const sendDATA = async function (command) { + // look up the command to send + var commands = command.split("\n"); // split on new line + + // ignore console logging trigger_current_state (to avoid it spamming) + if (command.indexOf("trigger_current_state") === -1) + devConsoleLog("sendDATA: " + commands); + + // send it in micropy if micropy reached + if (micropython_interpreter) { + + for (var i = 0; i < commands.length; i++) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) + + // trim trailing, leading whitespaces + var current = commands[i].trim(); + + webSerial.write(current); + webSerial.write(RETURN); // extra return at the end + } + } + // expect json scripts if micropy not reached + else { + // go through each line of the command + // trim it, send it, and send a return... + for (var i = 0; i < commands.length; i++) { + + //console.log("%cTuftsCEEO ", "color: #3ba336;", "commands.length", commands.length) + + current = commands[i].trim(); + //console.log("%cTuftsCEEO ", "color: #3ba336;", "current", current); + // turn string into JSON + + //string_current = (JSON.stringify(current)); + //myobj = JSON.parse(string_current); + var myobj = await JSON.parse(current); + + // turn JSON back into string and write it out + webSerial.write(JSON.stringify(myobj)); + webSerial.write(RETURN) // extra return at the end + } + } + } + + /** Process a raw packet from data stream + * @public + * @param {any} value + * @param {boolean} [testing=false] + * @param {any} callback + */ + const parsePacket = async function (value) { + + // console.log("%cTuftsCEEO ", "color: #3ba336;", value); + + // stringify the packet to look for carriage return + var json_string = await JSON.stringify(value); + + // remove quotation marks from json_string + var cleanedJsonString = cleanJsonString(json_string); + + jsonline = jsonline + cleanedJsonString; // concatenate packet to data + jsonline = jsonline.trim(); + + // regex search for carriage return + let pattern = /\\r/g; + var carriageReIndex = jsonline.search(pattern); + + // there is at least one carriage return in this packet + if (carriageReIndex > -1) { + //////////////////////////////// NEW parsePacket implementation ongoing since (29/12/20) + + let jsonlineSplitByCR = jsonline.split(/\\r/); // array of jsonline split by \r + + jsonline = ""; //reset jsonline + /* + each element in this array will be assessed for processing, + and the last element, if unable to be processed, will be concatenated to jsonline + */ + + for (let i = 0; i < jsonlineSplitByCR.length; i++) { + + // set lastUJSONRPC to an element in split array + lastUJSONRPC = jsonlineSplitByCR[i]; + // remove any newline character in the beginning of lastUJSONRPC + if (lastUJSONRPC.search(/\\n/g) == 0) + lastUJSONRPC = lastUJSONRPC.substring(2, lastUJSONRPC.length); + + /* Case 1: lastUJSONRPC is a valid, complete, and standard UJSONRPC packet */ + if (lastUJSONRPC[0] == "{" && lastUJSONRPC[lastUJSONRPC.length - 1] == "}") { + + let arrayLeftCurly = lastUJSONRPC.match(/{/g); + let arrayRightCurly = lastUJSONRPC.match(/}/g); + if (arrayLeftCurly.length === arrayRightCurly.length) { + /* Case 1A: complete packet*/ + + await processFullUJSONRPC(lastUJSONRPC, cleanedJsonString, json_string); + } + else { + /* Case 1B: {"i": 1234, "r": {} */ + jsonline = lastUJSONRPC; + } + } + /* Case 3: lastUJSONRPC is a micropy print result */ + else if (lastUJSONRPC != "" && lastUJSONRPC.indexOf('"p":') == -1 && lastUJSONRPC.indexOf('],') == -1 && lastUJSONRPC.indexOf('"m":') == -1 && + lastUJSONRPC.indexOf('}') == -1 && lastUJSONRPC.indexOf('{"i":') == -1 && lastUJSONRPC.indexOf('{') == -1) { + /* filter reboot message */ + var rebootMessage = + 'Traceback (most recent call last): File "main.py", line 8, in File "hub_runtime.py", line 1, in start File "event_loop/event_loop.py", line 1, in run_forever File "event_loop/event_loop.py", line 1, in step KeyboardInterrupt: MicroPython v1.12-1033-g97d7f7dd4 on 2020-09-18; LEGO Technic Large Hub with STM32F413xx Type "help()" for more in formation. >>> HUB: sync filesystems HUB: soft reboot' + let rebootMessageRemovedWS = rebootMessage.replace(/[' ']/g, ""); + let lastUJSONRPCRemovedWS = lastUJSONRPC.replace(/[' ']/g, ""); + if (rebootMessageRemovedWS.indexOf(lastUJSONRPCRemovedWS) == -1) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "micropy print: ", lastUJSONRPC); + if (funcAfterPrint != undefined) + funcAfterPrint(lastUJSONRPC); + } + } + /* Case 3: lastUJSONRPC is only a portion of a standard UJSONRPC packet + Then lastUJSONRPC must be EITHER THE FIRST OR THE LAST ELEMENT in jsonlineSplitByCR + because + an incomplete UJSONRPC can either be + Case 3A: the beginning portion of a UJSONRPC packet with no \r in the end (LAST) + Case 3B: the last portion of a UJSONRPC packet with \r in the end (FIRST) + */ + else { + /* Case 3A: */ + if (lastUJSONRPC[0] == "{") { + jsonline = lastUJSONRPC; + // console.log("TEST (last elemnt in split array): ", i == jsonlineSplitByCR.length-1); + // console.log("%cTuftsCEEO ", "color: #3ba336;", "jsonline was reset to:" + jsonline); + } + /* Case 3B: */ + else { + /* the last portion of UJSONRPC cannot be concatenated to form a full packet + -> purge lastUJSONRPC + */ + } + } + } + } + } + + /** Process a UJSONRPC packet stringified + * + * @private + * @param {any} lastUJSONRPC + * @param {string} [json_string="undefined"] + * @param {boolean} [testing=false] + * @param {any} callback + */ + const processFullUJSONRPC = async function (lastUJSONRPC, cleanedJsonString = undefined, json_string = undefined) { + try { + + // check that the data is JSON parsable + var parsedLastURPC = await JSON.parse(lastUJSONRPC); + + // devConsoleLog(lastUJSONRPC); + + // update hub information using lastUJSONRPC + if (parsedLastURPC["m"] == 0) { + await updateHubPortsInfo(parsedLastURPC.p); + } + + PrimeHubEventHandler(parsedLastURPC, lastUJSONRPC); + + if (funcWithStream !== undefined) { + await funcWithStream(); + } + + } + catch (e) { + // don't throw error when failure of processing UJSONRPC is due to micropython + if (lastUJSONRPC.indexOf("Traceback") == -1 && lastUJSONRPC.indexOf(">>>") == -1 && json_string.indexOf("Traceback") == -1 && json_string.indexOf(">>>") == -1) { + if (funcAfterError !== undefined) { + funcAfterError("Fatal Error: Please close any other window or program that is connected to your SPIKE Prime"); + } + } + consoleError(e); + consoleError("error parsing lastUJSONRPC: "); + consoleError(lastUJSONRPC); + consoleError("current jsonline: "); + consoleError(jsonline); + consoleError("current cleaned json_string: "); + consoleError(cleanedJsonString); + consoleError("current json_string: "); + consoleError(json_string); + consoleError("current value: "); + consoleError(value); + } + } + + /** Clean the json_string for concatenation into jsonline + * @private + * + * @param {any} json_string + * @returns {string} + */ + const cleanJsonString = function (json_string) { + var cleanedJsonString = ""; + json_string = json_string.trim(); + + let findEscapedQuotes = /\\"/g; + + cleanedJsonString = json_string.replace(findEscapedQuotes, '"'); + cleanedJsonString = cleanedJsonString.substring(1, cleanedJsonString.length - 1); + // cleanedJsonString = cleanedJsonString.replace(findNewLines,''); + + return cleanedJsonString; + } + + const executeWithStream = function (f) { + funcWithStream = f; + } + + /** assign event callback and pass callback down + * @param {function} f + */ + const passConnectCallback = function (f) { + funcAfterConnect = f; + webSerial.executeAfterConnect(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passDisconnectCallback = function (f) { + funcAfterDisconnect = f; + webSerial.executeAfterDisconnect(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passErrorCallback = function (f) { + funcAfterError = f; + webSerial.executeAfterError(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passPrintCallback = function (f) { + funcAfterPrint = f; + webSerial.executeAfterPrint(f); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + return { + init: init, + parsePacket: parsePacket, + executeWithStream: executeWithStream, + sendDATA: sendDATA, + // callback passing continuations + passConnectCallback: passConnectCallback, + passDisconnectCallback: passDisconnectCallback, + passErrorCallback: passErrorCallback, + passPrintCallback: passPrintCallback + } +} \ No newline at end of file diff --git a/server/examples/modules/SPIKE/spike/ujsonrpc.js b/server/examples/modules/scaledSPIKE/spikeRPC/SpikeUjsonLib.js similarity index 50% rename from server/examples/modules/SPIKE/spike/ujsonrpc.js rename to server/examples/modules/scaledSPIKE/spikeRPC/SpikeUjsonLib.js index 4b5dedb..9d04817 100644 --- a/server/examples/modules/SPIKE/spike/ujsonrpc.js +++ b/server/examples/modules/scaledSPIKE/spikeRPC/SpikeUjsonLib.js @@ -1,14 +1,16 @@ -Service_SPIKE.UJSONRPC = {}; - +_SpikeUjsonLib = {}; + /** - * - * @memberof! UJSONRPC - * @param {string} text - */ -Service_SPIKE.UJSONRPC.prototype.displayText = async function displayText(text) { - var randomId = this.generateId(); +* +* @memberof! UJSONRPC +* @param {string} text +* @param {function} immediateCB +*/ +_SpikeUjsonLib.displayText = async function displayText(text, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_text", "p": {"text":' + '"' + text + '"' + '} }' - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -16,35 +18,41 @@ Service_SPIKE.UJSONRPC.prototype.displayText = async function displayText(text) * @param {integer} x [0 to 4] * @param {integer} y [0 to 4] * @param {integer} brightness [1 to 100] + * @param {function} immediateCB */ -Service_SPIKE.UJSONRPC.prototype.displaySetPixel = async function displaySetPixel(x, y, brightness) { - var randomId = this.generateId(); +_SpikeUjsonLib.displaySetPixel = async function displaySetPixel(x, y, brightness, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_set_pixel", "p": {"x":' + x + ', "y":' + y + ', "brightness":' + brightness + '} }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC + * @param {function} immediateCB */ -Service_SPIKE.UJSONRPC.prototype.displayClear = async function displayClear() { - var randomId = this.generateId(); +_SpikeUjsonLib.displayClear = async function displayClear(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.display_clear" }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC * @param {string} port * @param {array} array [1-100,1-100,1-100,1-100] array of size 4 + * @param {function} immediateCB */ -Service_SPIKE.UJSONRPC.prototype.ultrasonicLightUp = async function ultrasonicLightUp(port, array) { - var randomId = this.generateId(); +_SpikeUjsonLib.ultrasonicLightUp = async function ultrasonicLightUp(port, array, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.ultrasonic_light_up", "p": {' + '"port": ' + '"' + port + '"' + ', "lights": ' + '[' + array + ']' + '} }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -52,15 +60,17 @@ Service_SPIKE.UJSONRPC.prototype.ultrasonicLightUp = async function ultrasonicLi * @param {string} port * @param {integer} speed * @param {integer} stall + * @param {function} immediateCB */ -Service_SPIKE.UJSONRPC.prototype.motorStart = async function motorStart(port, speed, stall) { - var randomId = this.generateId(); +_SpikeUjsonLib.motorStart = async function motorStart(port, speed, stall, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_start", "p": {"port":' + '"' + port + '"' + ', "speed":' + speed + ', "stall":' + stall + '} }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** moves motor to a position @@ -71,11 +81,11 @@ Service_SPIKE.UJSONRPC.prototype.motorStart = async function motorStart(port, sp * @param {integer} speed * @param {boolean} stall * @param {boolean} stop + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.motorGoRelPos = async function motorGoRelPos(port, position, speed, stall, stop, callback) { - console.log("this in motorGoRelPos: ", this); - var randomId = this.generateId(); +_SpikeUjsonLib.motorGoRelPos = async function motorGoRelPos(port, position, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_go_to_relative_position"' + ', "p": {' + @@ -86,14 +96,12 @@ Service_SPIKE.UJSONRPC.prototype.motorGoRelPos = async function motorGoRelPos(po ', "stop":' + stop + '} }'; - if (callback != undefined) { - this.pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } -Service_SPIKE.UJSONRPC.prototype.motorGoDirToPosition = async function motorGoDirToPosition(port, position, direction, speed, stall, stop, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.motorGoDirToPosition = async function motorGoDirToPosition(port, position, direction, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_go_direction_to_position"' + ', "p": {' + @@ -105,10 +113,8 @@ Service_SPIKE.UJSONRPC.prototype.motorGoDirToPosition = async function motorGoDi ', "stop":' + stop + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } @@ -120,10 +126,11 @@ Service_SPIKE.UJSONRPC.prototype.motorGoDirToPosition = async function motorGoDi * @param {integer} speed * @param {integer} stall * @param {boolean} stop + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.motorRunTimed = async function motorRunTimed(port, time, speed, stall, stop, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.motorRunTimed = async function motorRunTimed(port, time, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_run_timed"' + ', "p": {' + @@ -133,10 +140,9 @@ Service_SPIKE.UJSONRPC.prototype.motorRunTimed = async function motorRunTimed(po ', "stall":' + stall + ', "stop":' + stop + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -147,10 +153,11 @@ Service_SPIKE.UJSONRPC.prototype.motorRunTimed = async function motorRunTimed(po * @param {integer} speed * @param {integer} stall * @param {boolean} stop + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.motorRunDegrees = async function motorRunDegrees(port, degrees, speed, stall, stop, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.motorRunDegrees = async function motorRunDegrees(port, degrees, speed, stall, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_run_for_degrees"' + ', "p": {' + @@ -160,10 +167,9 @@ Service_SPIKE.UJSONRPC.prototype.motorRunDegrees = async function motorRunDegree ', "stall":' + stall + ', "stop":' + stop + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -174,10 +180,11 @@ Service_SPIKE.UJSONRPC.prototype.motorRunDegrees = async function motorRunDegree * @param {string} lmotor * @param {string} rmotor * @param {boolean} stop + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.moveTankTime = async function moveTankTime(time, lspeed, rspeed, lmotor, rmotor, stop, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.moveTankTime = async function moveTankTime(time, lspeed, rspeed, lmotor, rmotor, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.move_tank_time"' + ', "p": {' + @@ -188,10 +195,9 @@ Service_SPIKE.UJSONRPC.prototype.moveTankTime = async function moveTankTime(time ', "rmotor":' + '"' + rmotor + '"' + ', "stop":' + stop + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -203,10 +209,11 @@ Service_SPIKE.UJSONRPC.prototype.moveTankTime = async function moveTankTime(time * @param {string} lmotor * @param {string} rmotor * @param {boolean} stop + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.moveTankDegrees = async function moveTankDegrees(degrees, lspeed, rspeed, lmotor, rmotor, stop, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.moveTankDegrees = async function moveTankDegrees(degrees, lspeed, rspeed, lmotor, rmotor, stop, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.move_tank_degrees"' + ', "p": {' + @@ -217,10 +224,9 @@ Service_SPIKE.UJSONRPC.prototype.moveTankDegrees = async function moveTankDegree ', "rmotor":' + '"' + rmotor + '"' + ', "stop":' + stop + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -229,11 +235,12 @@ Service_SPIKE.UJSONRPC.prototype.moveTankDegrees = async function moveTankDegree * @param {integer} lspeed * @param {integer} rspeed * @param {string} lmotor - * @param {string} rmotor + * @param {string} rmotor + * @param {function} immediateCB * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.moveTankSpeeds = async function moveTankSpeeds(lspeed, rspeed, lmotor, rmotor, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.moveTankSpeeds = async function moveTankSpeeds(lspeed, rspeed, lmotor, rmotor, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.move_start_speeds"' + ', "p": {' + @@ -242,10 +249,9 @@ Service_SPIKE.UJSONRPC.prototype.moveTankSpeeds = async function moveTankSpeeds( ', "lmotor":' + '"' + lmotor + '"' + ', "rmotor":' + '"' + rmotor + '"' + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -257,8 +263,8 @@ Service_SPIKE.UJSONRPC.prototype.moveTankSpeeds = async function moveTankSpeeds( * @param {string} rmotor * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.moveTankPowers = async function moveTankPowers(lpower, rpower, lmotor, rmotor, callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.moveTankPowers = async function moveTankPowers(lpower, rpower, lmotor, rmotor, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.move_start_powers"' + ', "p": {' + @@ -267,10 +273,9 @@ Service_SPIKE.UJSONRPC.prototype.moveTankPowers = async function moveTankPowers( ', "lmotor":' + '"' + lmotor + '"' + ', "rmotor":' + '"' + rmotor + '"' + '} }'; - if (callback != undefined) { - pushResponseCallback(randomId, callback); - } - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -279,26 +284,30 @@ Service_SPIKE.UJSONRPC.prototype.moveTankPowers = async function moveTankPowers( * @param {integer} volume * @param {integer} note */ -Service_SPIKE.UJSONRPC.prototype.soundBeep = async function soundBeep(volume, note) { - var randomId = this.generateId(); +_SpikeUjsonLib.soundBeep = async function soundBeep(volume, note, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.sound_beep"' + ', "p": {' + '"volume":' + volume + ', "note":' + note + '} }'; - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC */ -Service_SPIKE.UJSONRPC.prototype.soundStop = async function soundStop() { - var randomId = this.generateId(); +_SpikeUjsonLib.soundStop = async function soundStop(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.sound_off"' + '}'; - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -308,11 +317,13 @@ Service_SPIKE.UJSONRPC.prototype.soundStop = async function soundStop() { * @param {integer} power * @param {integer} stall */ -Service_SPIKE.UJSONRPC.prototype.motorPwm = async function motorPwm(port, power, stall) { - var randomId = this.generateId(); +_SpikeUjsonLib.motorPwm = async function motorPwm(port, power, stall, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.motor_pwm", "p": {"port":' + '"' + port + '"' + ', "power":' + power + ', "stall":' + stall + '} }'; - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -320,28 +331,36 @@ Service_SPIKE.UJSONRPC.prototype.motorPwm = async function motorPwm(port, power, * @memberof! UJSONRPC * @param {function} callback */ -Service_SPIKE.UJSONRPC.prototype.getFirmwareInfo = async function getFirmwareInfo(callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.getFirmwareInfo = async function getFirmwareInfo(callback, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "get_hub_info" ' + '}'; - this.sendDATA(command); - if (callback != undefined) { - getFirmwareInfoCallback = [randomId, callback]; - } + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + + // sendDATA(command); + // if (callback != undefined) { + // getFirmwareInfoCallback = [randomId, callback]; + // } } /** * @memberof! UJSONRPC - * @param {function} callback + * @param {function} immediateCB */ -Service_SPIKE.UJSONRPC.prototype.triggerCurrentState = async function triggerCurrentState(callback) { - var randomId = this.generateId(); +_SpikeUjsonLib.triggerCurrentState = async function triggerCurrentState(immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "trigger_current_state" ' + '}'; - this.sendDATA(command); - if (callback != undefined) { - triggerCurrentStateCallback = callback; - } + + if (typeof immediateCB === "function") + immediateCB(command, randomId); + + // sendDATA(command); + // if (callback != undefined) { + // triggerCurrentStateCallback = callback; + // } } /** @@ -349,23 +368,26 @@ Service_SPIKE.UJSONRPC.prototype.triggerCurrentState = async function triggerCur * @memberof! UJSONRPC * @param {integer} slotid */ -Service_SPIKE.UJSONRPC.prototype.programExecute = async function programExecute(slotid) { - var randomId = this.generateId(); +_SpikeUjsonLib.programExecute = async function programExecute(slotid, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "program_execute", "p": {"slotid":' + slotid + '} }'; - this.sendDATA(command); + + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC */ -Service_SPIKE.UJSONRPC.prototype.programTerminate = function programTerminate() { +_SpikeUjsonLib.programTerminate = function programTerminate(immediateCB) { - var randomId = this.generateId(); + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "program_terminate"' + '}'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -375,8 +397,8 @@ Service_SPIKE.UJSONRPC.prototype.programTerminate = function programTerminate() * @param {string} data entire data to send in ASCII * @param {integer} slotid slot to which to assign the program */ -Service_SPIKE.UJSONRPC.prototype.startWriteProgram = async function startWriteProgram(projectName, type, data, slotid) { - +_SpikeUjsonLib.startWriteProgram = async function startWriteProgram(projectName, type, data, slotid, immediateCB) { + console.log("%cTuftsCEEO ", "color: #3ba336;", "in startWriteProgram..."); console.log("%cTuftsCEEO ", "color: #3ba336;", "constructing start_write_program script..."); @@ -388,7 +410,7 @@ Service_SPIKE.UJSONRPC.prototype.startWriteProgram = async function startWritePr var dataSize = (new TextEncoder().encode(data)).length; - var randomId = this.generateId(); + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "start_write_program", "p": {' + @@ -405,87 +427,10 @@ Service_SPIKE.UJSONRPC.prototype.startWriteProgram = async function startWritePr '} }'; console.log("%cTuftsCEEO ", "color: #3ba336;", "constructed start_write_program script..."); - - // assign function to start sending packets after confirming blocksize and transferid - startWriteProgramCallback = [randomId, writePackageFunc]; - - console.log("%cTuftsCEEO ", "color: #3ba336;", "sending start_write_program script"); - - this.sendDATA(command); - - // check if start_write_program received a response after 5 seconds - writeProgramSetTimeout = setTimeout(function () { - if (startWriteProgramCallback != undefined) { - if (funcAfterError != undefined) { - funcAfterError("5 seconds have passed without response... Please reboot the hub and try again.") - } - } - }, 5000) - - // function to write the first packet of data - function writePackageFunc(blocksize, transferid) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "in writePackageFunc..."); - - console.log("%cTuftsCEEO ", "color: #3ba336;", "stringified the entire data to send: ", data); - - // when data's length is less than the blocksize limit of sending data - if (data.length <= blocksize) { - console.log("%cTuftsCEEO ", "color: #3ba336;", "data's length is less than the blocksize of ", blocksize); - - // if the data's length is not zero (not empty) - if (data.length != 0) { - - var dataToSend = data.substring(0, data.length); // get the entirety of data - - console.log("%cTuftsCEEO ", "color: #3ba336;", "data's length is not zero, sending the entire data: ", dataToSend); - - var base64data = btoa(dataToSend); // encode the packet to base64 - - Service_SPIKE.UJSONRPC.prototype.writePackage(base64data, transferid); // send the packet - - // writeProgram's callback defined by the user - if (writeProgramCallback != undefined) { - writeProgramCallback(); - } - - } - // the package to send is empty, so throw error - else { - throw new Error("package to send is initially empty"); - } - - } - // if the length of data to send is larger than the blocksize, send only a blocksize amount - // and save the remaining data to send packet by packet - else if (data.length > blocksize) { - - console.log("%cTuftsCEEO ", "color: #3ba336;", "data's length is more than the blocksize of ", blocksize); - - var dataToSend = data.substring(0, blocksize); // get the first block of packet - - console.log("%cTuftsCEEO ", "color: #3ba336;", "sending the blocksize amount of data: ", dataToSend); - - var base64data = btoa(dataToSend); // encode the packet to base64 - - var msgID = Service_SPIKE.UJSONRPC.prototype.writePackage(base64data, transferid); // send the packet - - var remainingData = data.substring(blocksize, data.length); // remove the portion just sent from data - - console.log("%cTuftsCEEO ", "color: #3ba336;", "reassigning writePackageInformation with message ID: ", msgID); - console.log("%cTuftsCEEO ", "color: #3ba336;", "reassigning writePackageInformation with remainingData: ", remainingData); - - // update package information to be used for sending remaining packets - writePackageInformation = [msgID, remainingData, transferid, blocksize]; - - } - - } - + if (typeof immediateCB === "function") + immediateCB(command, randomId); } - - /** * * @memberof! UJSONRPC @@ -493,48 +438,48 @@ Service_SPIKE.UJSONRPC.prototype.startWriteProgram = async function startWritePr * @param {string} transferid transferid of this program write process * @returns {string} the randomly generated message id used to send this UJSONRPC script */ -Service_SPIKE.UJSONRPC.prototype.writePackage = function writePackage(base64data, transferid) { +_SpikeUjsonLib.writePackage = function writePackage(base64data, transferid, immediateCB) { - var randomId = this.generateId(); - var writePackageCommand = '{"i":' + '"' + randomId + '"' + + var randomId = _SpikeUjsonLib.generateId(); + var command = '{"i":' + '"' + randomId + '"' + ', "m": "write_package", "p": {' + '"data": ' + '"' + base64data + '"' + ', "transferid": ' + '"' + transferid + '"' + '} }'; - sendDATA(writePackageCommand); - - return randomId; + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC */ -Service_SPIKE.UJSONRPC.prototype.getStorageStatus = function getStorageStatus() { +_SpikeUjsonLib.getStorageStatus = function getStorageStatus(immediateCB) { - var randomId = this.generateId(); + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "get_storage_status"' + '}'; - this.sendDATA(command); - + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** * @memberof! UJSONRPC * @param {string} slotid */ -Service_SPIKE.UJSONRPC.prototype.removeProject = function removeProject(slotid) { +_SpikeUjsonLib.removeProject = function removeProject(slotid, immediateCB) { - var randomId = this.generateId(); + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "remove_project", "p": {' + '"slotid": ' + slotid + '} }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** @@ -543,34 +488,35 @@ Service_SPIKE.UJSONRPC.prototype.removeProject = function removeProject(slotid) * @param {string} oldslotid * @param {string} newslotid */ -Service_SPIKE.UJSONRPC.prototype.moveProject = function moveProject(oldslotid, newslotid) { +_SpikeUjsonLib.moveProject = function moveProject(oldslotid, newslotid, immediateCB) { - var randomId = this.generateId(); + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "move_project", "p": {' + '"old_slotid": ' + oldslotid + ', "new_slotid: ' + newslotid + '} }'; - this.sendDATA(command); - + if (typeof immediateCB === "function") + immediateCB(command, randomId); } -Service_SPIKE.UJSONRPC.prototype.centerButtonLightUp = function centerButtonLightUp(color) { - var randomId = this.generateId(); +_SpikeUjsonLib.centerButtonLightUp = function centerButtonLightUp(color, immediateCB) { + var randomId = _SpikeUjsonLib.generateId(); var command = '{"i":' + '"' + randomId + '"' + ', "m": "scratch.center_button_lights", "p": {' + '"color": ' + color + '} }'; - this.sendDATA(command); + if (typeof immediateCB === "function") + immediateCB(command, randomId); } /** generate random id for UJSONRPC messages - * @private - * @returns {string} - */ -Service_SPIKE.prototype.generateId = function () { +* @private +* @returns {string} +*/ +_SpikeUjsonLib.generateId = function () { var generatedID = "" var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; diff --git a/server/examples/modules/scaledSPIKE/virtualSpike.js b/server/examples/modules/scaledSPIKE/virtualSpike.js new file mode 100644 index 0000000..9db8ce7 --- /dev/null +++ b/server/examples/modules/scaledSPIKE/virtualSpike.js @@ -0,0 +1,1057 @@ +function _virtualSpike () { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + // Service Dock variables + let spikeRPC = new _SpikeRPC(); // Spike communication interface + let ujsonLib = _SpikeUjsonLib; + + // flag for development + let dev = false; + + var colorDictionary = { + 0: "BLACK", + 1: "VIOLET", + 3: "BLUE", + 4: "AZURE", + 5: "GREEN", + 7: "YELLOW", + 9: "RED", + 1: "WHITE", + }; + + // object containing real-time info on devices connected to each port of SPIKE Prime + let ports = + { + "A": { "device": "none", "data": {}}, + "B": { "device": "none", "data": {}}, + "C": { "device": "none", "data": {}}, + "D": { "device": "none", "data": {}}, + "E": { "device": "none", "data": {}}, + "F": { "device": "none", "data": {}} + }; + + // object containing real-time info on hub sensor values + /* + !say the usb wire is the nose of the spike prime + + ( looks at which side of the hub is facing up) + gyro[0] - up/down detector ( down: 1000, up: -1000, neutral: 0) + gyro[1] - rightside/leftside detector ( leftside : 1000 , rightside: -1000, neutal: 0 ) + gyro[2] - front/back detector ( front: 1000, back: -1000, neutral: 0 ) + + ( assume the usb wire port is the nose of the spike prime ) + accel[0] - roll acceleration (roll to right: -, roll to left: +) + accel[1] - pitch acceleration (up: +, down: -) + accel[2] - yaw acceleration (counterclockwise: +. clockwise: -) + + () + pos[0] - yaw angle + pos[1] - pitch angle + pos[2] - roll angle + + */ + let hub = + { + "gyro" : [0, 0, 0], + "accel" : [0, 0, 0], + "pos" : [0, 0, 0], + "gesture" : undefined, // shake, freefall, tapped, doubletapped + "name" : undefined, + "frontEvent" : undefined, // string of real-time info on hub events + "batteryAmount" : 0, // battery [0-100] + "mainButton" : { "pressed": false, "duration": 0 }, + "bluetoothButton" : { "pressed": false, "duration": 0 }, + "leftButton" : { "pressed": false, "duration": 0 }, + "rightButton" : { "pressed": false, "duration": 0 } + } + + // Button states + let hubMainButton = { "pressed": false, "duration": 0 }; + let hubBluetoothButton = { "pressed": false, "duration": 0 }; + let hubLeftButton = { "pressed": false, "duration": 0 }; + let hubRightButton = { "pressed": false, "duration": 0 }; + + // Hub states + let hubProjects = { + "0": "None", + "1": "None", + "2": "None", + "3": "None", + "4": "None", + "5": "None", + "6": "None", + "7": "None", + "8": "None", + "9": "None", + "10": "None", + "11": "None", + "12": "None", + "13": "None", + "14": "None", + "15": "None", + "16": "None", + "17": "None", + "18": "None", + "19": "None" + }; + + let spikeMemory = { + /* States memory */ + ForceSensorWasPressed: false, + waitForNewOriFirst: true, + hubGestures: [], // hubGestures detected since program started or since was_gesture() + hubButtonPresses: [], + lastDetectedColor: undefined, + /* + up: hub is upright/standing, with the display looking horizontally + down: hub is upsidedown with the display, with the display looking horizontally + front: hub's display facing towards the sky + back: hub's display facing towards the earth + leftside: hub rotated so that the side to the left of the display is facing the earth + rightside: hub rotated so that the side to the right of the display is facing the earth + */ + lastHubOrientation: undefined, //PrimeHub orientation read from caught UJSONRPC + /* Spike callbacks */ + funcAfterNewGesture: undefined, + funcAfterNewOrientation: undefined, + funcAfterLeftButtonPress: undefined, + funcAfterLeftButtonRelease: undefined, + funcAfterRightButtonPress: undefined, + funcAfterRightButtonRelease: undefined, + funcAfterNewColor: undefined, + waitUntilColorCallback: undefined, // [colorToDetect, function to execute] + waitForDistanceFartherThanCallback: undefined, // [distance, function to execute] + waitForDistanceCloserThanCallback: undefined, // [distance, function to execute] + funcAfterForceSensorPress: undefined, + funcAfterForceSensorRelease: undefined, + /* array that holds the pointers to callback functions to be executed after a UJSONRPC response */ + responseCallbacks: [], + // Spike write program memory + startWriteProgramCallback: undefined, // [message_id, function to execute ] + writePackageInformation: undefined, // [ message_id, remaining_data, transfer_id, blocksize] + writeProgramCallback: undefined, // callback function to run after a program was successfully written + writeProgramSetTimeout: undefined, // setTimeout object for looking for response to start_write_program + /* callback functions added for Coding Rooms */ + getFirmwareInfoCallback: undefined, + triggerCurrentStateCallback: undefined + } + + var funcAfterPrint = (m) => { }; // function to call for SPIKE python program print statements or errors + var funcAfterError = (er) => { }; // function to call for errors in ServiceDock + var funcAfterDisconnect = () => { }; // function to call after SPIKE Prime is disconnected + var funcAfterConnect = () => { }; // function to call after SPIKE Prime is connected + var funcWithStream = () => { } // function to call during SPIKE Prime data stream + + ////////////////////////////////////////// + // // + // Public Functions // + // // + ////////////////////////////////////////// + /** Connect to a webserial port and begin data stream with hub + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + let connected = await spikeRPC.init(isDev, updateHubPortsInfo, PrimeHubEventHandler); + + devConsoleLog("connected: " + connected); + + await sleep(1000); // wait for at least one UJSONRPC to be parsed + + ujsonLib.triggerCurrentState((c, rid) => sendDATA(c)); + ujsonLib.getFirmwareInfo( (c, rid) => { + sendDATA(c); + spikeMemory.getFirmwareInfoCallback = + [rid, (version) => devConsoleLog("This SPIKE Prime is using Hub OS " + version)]; + }); + + await sleep(2000); // wait for service to init + + return connected; + } + catch (e) { + consoleError(e); + } + // reinit variables in the case of hardware disconnection and Service reactivation + // reader = undefined; + // writer = undefined; + + // initialize web serial connection + // var webSerialConnected = await initWebSerial(); + + // if (webSerialConnected) { + + // start streaming UJSONRPC + // streamUJSONRPC(); + + // await sleep(1000); + + // triggerCurrentState(); + // getFirmwareInfo(function (version) { + // console.log("%cTuftsCEEO ", "color: #3ba336;", "This SPIKE Prime is using Hub OS ", version); + // }); + // serviceActive = true; + + // await sleep(2000); // wait for service to init + + // // call funcAtInit if defined + // if (funcAtInit !== undefined) { + // funcAtInit(); + // } + // return true; + // } + // else { + // return false; + // } + } + + /** Write a micropy program into a slot of the SPIKE Prime + * + * @param {string} projectName name of the program + * @param {string} data the micropython source code (expecting an input tag's value). All characters must be ASCII + * @param {integer} slotid slot number to assign the program + * @param {function} callback function to run after program is written + */ + const writeProgram = async function (projectName, data, slotid, callback) { + // check for non-ascii characters + let ascii = /[^\x00-\x7F]/; + if (ascii.test(data)) { + funcAfterError("non-ASCII characters detected in micropy program. Only ASCII characters are supported. Please check your micropy input.") + throw new Error("non-ASCII characters detected in micropy program. Only ASCII characters are supported. Please check your micropy input.") + } + else { + // reinit witeProgramTimeout + if (spikeMemory.writeProgramSetTimeout != undefined) { + clearTimeout(spikeMemory.writeProgramSetTimeout); + spikeMemory.writeProgramSetTimeout = undefined; + } + + // template of python file that needs to be concatenated + var firstPart = "from runtime import VirtualMachine\n\n# Stack for execution:\nasync def stack_1(vm, stack):\n" + var secondPart = "# Setup for execution:\ndef setup(rpc, system, stop):\n\n # Initialize VM:\n vm = VirtualMachine(rpc, system, stop, \"Target__1\")\n\n # Register stack on VM:\n vm.register_on_start(\"stack_1\", stack_1)\n\n return vm" + + // stringify data and strip trailing and leading quotation marks + var stringifiedData = JSON.stringify(data); + stringifiedData = stringifiedData.substring(1, stringifiedData.length - 1); + + var result = ""; // string to which the final code will be appended + + var splitData = stringifiedData.split(/\\n/); // split the code by every newline + + // add a tab before every newline (this is syntactically needed for concatenating with the template) + for (var index in splitData) { + + var addedTab = " " + splitData[index] + "\n"; + + result = result + addedTab; + } + + // replace tab characters + result = result.replace(/\\t/g, " "); + + stringifiedData = firstPart + result + secondPart; + + spikeMemory.writeProgramCallback = callback; + + // begin the write program process + ujsonLib.startWriteProgram(projectName, "python", stringifiedData, slotid, (command, randomId) => { + + spikeMemory.startWriteProgramCallback = [randomId, (blocksize, transferid) => { + + devConsoleLog("in writePackageFunc..."); + + devConsoleLog("stringified the entire data to send: " + stringifiedData); + + // when data's length is less than the blocksize limit of sending data + if (stringifiedData.length <= blocksize) { + devConsoleLog("data's length is less than the blocksize of " + blocksize); + + // if the data's length is not zero (not empty) + if (stringifiedData.length != 0) { + + var dataToSend = stringifiedData.substring(0, stringifiedData.length); // get the entirety of data + devConsoleLog("data's length is not zero, sending the entire data: " + dataToSend); + + var base64data = btoa(dataToSend); // encode the packet to base64 + + ujsonLib.writePackage(base64data, transferid, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); // send the packet + + // writeProgram's callback defined by the user + if (spikeMemory.writeProgramCallback != undefined) { + spikeMemory.writeProgramCallback(); + } + }); + + } + // the package to send is empty, so throw error + else { + throw new Error("package to send is initially empty"); + } + + } + // if the length of data to send is larger than the blocksize, send only a blocksize amount + // and save the remaining data to send packet by packet + else if (stringifiedData.length > blocksize) { + devConsoleLog("data's length is more than the blocksize of " + blocksize); + + var dataToSend = stringifiedData.substring(0, blocksize); // get the first block of packet + devConsoleLog("sending the blocksize amount of data: " + dataToSend) + + var base64data = btoa(dataToSend); // encode the packet to base64 + + ujsonLib.writePackage(base64data, transferid, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); // send the packet + + var remainingData = stringifiedData.substring(blocksize, stringifiedData.length); // remove the portion just sent from data + devConsoleLog("reassigning writePackageInformation with message ID: " + wpRandomId); + devConsoleLog("reassigning writePackageInformation with remainingData: " + remainingData); + + // update package information to be used for sending remaining packets + spikeMemory.writePackageInformation = [wpRandomId, remainingData, transferid, blocksize]; + }); + } + }]; + + sendDATA(command); + + // check if start_write_program received a response after 5 seconds + spikeMemory.writeProgramSetTimeout = setTimeout(function () { + if (spikeMemory.startWriteProgramCallback != undefined) { + funcAfterError("5 seconds have passed without response... Please reboot the hub and try again."); + consoleError("5 seconds have passed without response... Please reboot the hub and try again."); + } + }, 5000) + + }); + } + } + + /** Parse information on devices connected to SPIKE Prime ports + * Effect: Modifies {ports}, {hub} + * @param {object} data_stream portion of prased lastUJSONRPC containing port devices info + * @private + */ + const updateHubPortsInfo = async function (data_stream) { + + var index_to_port = ["A", "B", "C", "D", "E", "F"]; + + // iterate through each port and assign a device_type to {ports} + for (var key = 0; key < 6; key++) { + + let device_value = { "device": "none", "data": {} }; // value to go in ports associated with the port letter keys + + try { + var letter = index_to_port[key]; + + // get SMALL MOTOR information + if (data_stream[key][0] == 48) { + + // parse motor information + var Mspeed = await data_stream[key][1][0]; + var Mangle = await data_stream[key][1][1]; + var Muangle = await data_stream[key][1][2]; + var Mpower = await data_stream[key][1][3]; + + // populate value object + device_value.device = "smallMotor"; + device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; + ports[letter] = device_value; + + } + // get BIG MOTOR information + else if (data_stream[key][0] == 49) { + + // parse motor information + var Mspeed = await data_stream[key][1][0]; + var Mangle = await data_stream[key][1][1]; + var Muangle = await data_stream[key][1][2]; + var Mpower = await data_stream[key][1][3]; + + // populate value object + device_value.device = "bigMotor"; + device_value.data = { "speed": Mspeed, "angle": Mangle, "uAngle": Muangle, "power": Mpower }; + ports[letter] = device_value; + } + // get ULTRASONIC sensor information + else if (data_stream[key][0] == 62) { + + // parse ultrasonic sensor information + var Udist = await data_stream[key][1][0]; + + // populate value object + device_value.device = "ultrasonic"; + device_value.data = { "distance": Udist }; + ports[letter] = device_value; + + /* check if callback from wait_for_distance_farther_than() can be executed */ + if (spikeMemory.waitForDistanceFartherThanCallback != undefined) { + let thresholdDistance = spikeMemory.waitForDistanceFartherThanCallback[0]; + + if (Udist > thresholdDistance) { + // current distance is farther than threshold, so execute callback + spikeMemory.waitForDistanceFartherThanCallback[1](); + spikeMemory.waitForDistanceFartherThanCallback = undefined; // reset callback + } + } + + /* check if callback from wait_for_distance_closer_than() can be executed */ + if (spikeMemory.waitForDistanceCloserThanCallback != undefined) { + let thresholdDistance = spikeMemory.waitForDistanceCloserThanCallback[0]; + + if (Udist < thresholdDistance) { + + // current distance is closer than threshold, so execute callback + spikeMemory.waitForDistanceCloserThanCallback[1](); + spikeMemory.waitForDistanceCloserThanCallback = undefined; // reset callback + } + } + } + // get FORCE sensor information + else if (data_stream[key][0] == 63) { + + // parse force sensor information + var Famount = await data_stream[key][1][0]; + var Fbinary = await data_stream[key][1][1]; + var Fbigamount = await data_stream[key][1][2]; + + // convert the binary output to boolean for "pressed" key + if (Fbinary == 1) { + var Fboolean = true; + } else { + var Fboolean = false; + } + // execute callback from ForceSensor.wait_until_pressed() + if (Fboolean) { + // execute call back from wait_until_pressed() if it is defined + if (spikeMemory.funcAfterForceSensorPress !== undefined) + spikeMemory.funcAfterForceSensorPress(); + + // destruct callback function + spikeMemory.funcAfterForceSensorPress = undefined; + + // indicate that the ForceSensor was pressed + spikeMemory.ForceSensorWasPressed = true; + } + // execute callback from ForceSensor.wait_until_released() + else { + // check if the Force Sensor was just released + if (spikeMemory.ForceSensorWasPressed) { + spikeMemory.ForceSensorWasPressed = false; + if (spikeMemory.funcAfterForceSensorRelease !== undefined) + spikeMemory.funcAfterForceSensorRelease(); + spikeMemory.funcAfterForceSensorRelease = undefined; + } + } + + // populate value object + device_value.device = "force"; + device_value.data = { "force": Famount, "pressed": Fboolean, "forceSensitive": Fbigamount } + ports[letter] = device_value; + } + // get COLOR sensor information + else if (data_stream[key][0] == 61) { + + // parse color sensor information + var Creflected = await data_stream[key][1][0]; + var CcolorID = await data_stream[key][1][1]; + var Ccolor = colorDictionary[CcolorID]; + var Cr = await data_stream[key][1][2]; + var Cg = await data_stream[key][1][3]; + var Cb = await data_stream[key][1][4]; + var rgb_array = [Cr, Cg, Cb]; + + // populate value object + device_value.device = "color"; + + // convert Ccolor to lower case because in the SPIKE APP the color is lower case + if (Ccolor !== undefined) + Ccolor = Ccolor.toLowerCase(); + else + Ccolor = "null"; + device_value.data = { "reflected": Creflected, "color": Ccolor, "RGB": rgb_array }; + + // execute wait_until_color callback when color matches its argument + if (spikeMemory.waitUntilColorCallback != undefined) + if (Ccolor == spikeMemory.waitUntilColorCallback[0]) { + spikeMemory.waitUntilColorCallback[1](); + + spikeMemory.waitUntilColorCallback = undefined; + } + + if (spikeMemory.lastDetectedColor != Ccolor) { + + if (spikeMemory.funcAfterNewColor != undefined) { + spikeMemory.funcAfterNewColor(Ccolor); + spikeMemory.funcAfterNewColor = undefined; + } + + spikeMemory.lastDetectedColor = Ccolor; + } + ports[letter] = device_value; + } + /// NOTHING is connected + else if (data_stream[key][0] == 0) { + // populate value object + device_value.device = "none"; + device_value.data = {}; + ports[letter] = device_value; + } + + ports.time = Date.now(); + + //parse hub information + var gyro_x = data_stream[6][0]; + var gyro_y = data_stream[6][1]; + var gyro_z = data_stream[6][2]; + var gyro = [gyro_x, gyro_y, gyro_z]; + hub["gyro"] = gyro; + + var newOri = setHubOrientation(gyro); + // see if currently detected orientation is different from the last detected orientation + if (newOri !== spikeMemory.lastHubOrientation) { + spikeMemory.lastHubOrientation = newOri; + + if (typeof spikeMemory.funcAfterNewOrientation == "function") + spikeMemory.funcAfterNewOrientation(newOri); + spikeMemory.funcAfterNewOrientation = undefined; + } + + var accel_x = data_stream[7][0]; + var accel_y = data_stream[7][1]; + var accel_z = data_stream[7][2]; + var accel = [accel_x, accel_y, accel_z]; + hub["accel"] = accel; + + var posi_x = data_stream[8][0]; + var posi_y = data_stream[8][1]; + var posi_z = data_stream[8][2]; + var pos = [posi_x, posi_y, posi_z]; + hub["pos"] = pos; + + } catch (e) { + console.log(e); + } //ignore errors + } + } + + /** Catch hub events in UJSONRPC + *

Effect:

+ *

Logs in the console when some particular messages are caught

+ *

Assigns the hub events global variables

+ * @private + */ + const PrimeHubEventHandler = async function (parsedUJSON, lastUJSONRPC) { + var messageType = parsedUJSON["m"]; + + //catch runtime_error made at ujsonrpc level + if (messageType == "runtime_error") { + var decodedResponse = atob(parsedUJSON["p"][3]); + + decodedResponse = JSON.stringify(decodedResponse); + consoleError("spike runtime error: " + decodedResponse); + + var splitData = decodedResponse.split(/\\n/); // split the code by every newline + + // execute function after print if defined (only print the last line of error message) + var errorType = splitData[splitData.length - 2]; + + // error is a syntax error + if (errorType.indexOf("SyntaxError") > -1) { + /* get the error line number*/ + var lineNumberLine = splitData[splitData.length - 3]; + devConsoleLog("lineNumberLine: " + lineNumberLine); + var indexLine = lineNumberLine.indexOf("line"); + var lineNumberSubstring = lineNumberLine.substring(indexLine, lineNumberLine.length); + var numberPattern = /\d+/g; + var lineNumber = lineNumberSubstring.match(numberPattern)[0]; + devConsoleLog(lineNumberSubstring.match(numberPattern)); + devConsoleLog("lineNumber: " + lineNumber); + devConsoleLog("typeof lineNumber: " + typeof lineNumber); + var lineNumberInNumber = parseInt(lineNumber) - 5; + devConsoleLog("typeof lineNumberInNumber: " + typeof lineNumberInNumber); + + funcAfterError("line " + lineNumberInNumber + ": " + errorType); + } + else { + funcAfterError(errorType); + } + } + else if (messageType == 0) { + /* + DEV NOTE (26/12/2020): + messageType = 0 is regular UJSONRPC stream. + Pixel matrix SOMETIMES shows in this message, but exactly when is not clear. + */ + // console.log("%cTuftsCEEO ", "color: #3ba336;", lastUJSONRPC); + } + // storage information + else if (messageType == 1) { + + var storageInfo = parsedUJSON["p"]["slots"]; // get info of all the slots + + for (var slotid in storageInfo) { + hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable + } + + } + // battery status + else if (messageType == 2) { + hub.batteryAmount = parsedUJSON["p"][1]; + } + // give center button click, left, right (?) + else if (messageType == 3) { + devConsoleLog(lastUJSONRPC); + if (parsedUJSON.p[0] == "center") { + hub.mainButton.pressed = true; + + if (parsedUJSON.p[1] > 0) { + hub.mainButton.pressed = false; + hub.mainButton.duration = parsedUJSON.p[1]; + } + } + else if (parsedUJSON.p[0] == "connect") { + hub.bluetoothButton.pressed = true; + + if (parsedUJSON.p[1] > 0) { + hub.bluetoothButton.pressed = false; + hub.bluetoothButton.duration = parsedUJSON.p[1]; + } + } + else if (parsedUJSON.p[0] == "left") { + hub.leftButton.pressed = true; + + // execute callback for wait_until_pressed() if defined + if (spikeMemory.funcAfterLeftButtonPress != undefined) { + spikeMemory.funcAfterLeftButtonPress(); + } + spikeMemory.funcAfterLeftButtonPress = undefined; + + if (parsedUJSON.p[1] > 0) { + hub.leftButton.pressed = false; + hub.leftButton.duration = parsedUJSON.p[1]; + + // execute callback for wait_until_released() if defined + if (spikeMemory.funcAfterLeftButtonRelease != undefined) { + spikeMemory.funcAfterLeftButtonRelease(); + } + + spikeMemory.funcAfterLeftButtonRelease = undefined; + } + + } + else if (parsedUJSON.p[0] == "right") { + hub.rightButton.pressed = true; + + // execute callback for wait_until_pressed() if defined + if (spikeMemory.funcAfterRightButtonPress != undefined) { + spikeMemory.funcAfterRightButtonPress(); + } + + spikeMemory.funcAfterRightButtonPress = undefined; + + if (parsedUJSON.p[1] > 0) { + hub.rightButton.pressed = false; + hub.rightButton.duration = parsedUJSON.p[1]; + + // execute callback for wait_until_released() if defined + if (spikeMemory.funcAfterRightButtonRelease != undefined) { + spikeMemory.funcAfterRightButtonRelease(); + } + + spikeMemory.funcAfterRightButtonRelease = undefined; + } + } + + } + else if (messageType == 4) { + var newGesture = parsedUJSON.p; + + if (newGesture == "3") { + hub.gesture = "freefall"; + spikeMemory.hubGestures.push(hub.gesture); + } + else if (newGesture == "2") { + hub.gesture = "shaken"; + spikeMemory.hubGestures.push(hub.gesture); // the string is different at higher level + } + else if (newGesture == "1") { + hub.frontEvent = "doubletapped"; + hub.gesture = "doubletapped"; + spikeMemory.hubGestures.push(hub.gesture); + } + else if (newGesture == "0") { + hub.frontEvent = "tapped"; + hub.gesture = "tapped"; + spikeMemory.hubGestures.push(hub.gesture); + } + devConsoleLog("hubGesture in virtualSpike: " + hub.gesture); + // execute funcAfterNewGesture callback that was taken at wait_for_new_gesture() + if (typeof spikeMemory.funcAfterNewGesture === "function") { + spikeMemory.funcAfterNewGesture(hub.gesture); + spikeMemory.funcAfterNewGesture = undefined; + } + + devConsoleLog(lastUJSONRPC); + + } + else if (messageType == 7) { + funcAfterPrint(">>> Program started!"); + } + else if (messageType == 8) { + funcAfterPrint(">>> Program finished!"); + } + else if (messageType == 9) { + var encodedName = parsedUJSON["p"]; + var decodedName = atob(encodedName); + hub.name = decodedName; + + if (spikeMemory.triggerCurrentStateCallback != undefined) { + spikeMemory.triggerCurrentStateCallback(); + } + } + else if (messageType == 11) { + devConsoleLog(lastUJSONRPC); + } + else if (messageType == 12) { + // this is usually the response from trigger_current_state, don't console log to avoid spam + } + // gives orientation of the hub (leftside, up,..) + else if (messageType == 14) { + /* this data stream is about hub orientation */ + + var newOrientation = parsedUJSON.p; + // console.log(newOrientation); + if (newOrientation == "1") { + spikeMemory.lastHubOrientation = "up"; + } + else if (newOrientation == "4") { + spikeMemory.lastHubOrientation = "down"; + } + else if (newOrientation == "0") { + spikeMemory.lastHubOrientation = "front"; + } + else if (newOrientation == "3") { + spikeMemory.lastHubOrientation = "back"; + } + else if (newOrientation == "2") { + spikeMemory.lastHubOrientation = "rightside"; + } + else if (newOrientation == "5") { + spikeMemory.lastHubOrientation = "leftside"; + } + + devConsoleLog(lastUJSONRPC); + } + else { + devConsoleLog("received response: " + lastUJSONRPC); + + // general parameters check + if (parsedUJSON["r"]) { + if (parsedUJSON["r"]["slots"]) { + + var storageInfo = parsedUJSON["r"]["slots"]; // get info of all the slots + + for (var slotid in storageInfo) { + hubProjects[slotid] = storageInfo[slotid]; // reassign hubProjects global variable + } + + } + } + + // getFirmwareInfo callback check + if (spikeMemory.getFirmwareInfoCallback != undefined) { + if (spikeMemory.getFirmwareInfoCallback[0] == parsedUJSON["i"]) { + var version = parsedUJSON["r"]["runtime"]["version"]; + var stringVersion = "" + for (var index in version) { + if (index < version.length - 1) { + stringVersion = stringVersion + version[index] + "."; + } + else { + stringVersion = stringVersion + version[index]; + } + } + // console.log("%cTuftsCEEO ", "color: #3ba336;", "firmware version: ", stringVersion); + spikeMemory.getFirmwareInfoCallback[1](stringVersion); + } + } + + /* See if any of the stored responseCallbacks need to be executed due to this UJSONRPC response */ + for (var index = 0; index < spikeMemory.responseCallbacks.length; index++) { + + var currCallbackInfo = spikeMemory.responseCallbacks[index]; + + if (currCallbackInfo != undefined) { + + if (currCallbackInfo[0] == parsedUJSON["i"]) { + /* the message id of UJSONRPC corresponds to that of a response callback */ + + var response = "null"; + + // parse motor stoppage reason responses + if (parsedUJSON["r"] == 0) { + response = "done"; + } + else if (parsedUJSON["r"] == 2) { + response = "stalled"; + } + + // execute callback with the response + currCallbackInfo[1](response); + + // empty the index of which callback that was just executed + spikeMemory.responseCallbacks[index] = undefined; + } + } + } + + // execute the callback function after sending start_write_program UJSONRPC + if (spikeMemory.startWriteProgramCallback != undefined) { + + devConsoleLog("startWriteProgramCallback is defined. Looking for matching mesasage id: " + spikeMemory.startWriteProgramCallback[0]); + // check if the message id of UJSONRPC corresponds to that of a response callback + if (spikeMemory.startWriteProgramCallback[0] == parsedUJSON["i"]) { + + devConsoleLog("matching message id detected with startWriteProgramCallback[0]: " + spikeMemory.startWriteProgramCallback[0]); + + // get the information for the packet sending + var blocksize = parsedUJSON["r"]["blocksize"]; // maximum size of each packet to be sent in bytes + var transferid = parsedUJSON["r"]["transferid"]; // id to use for transferring this program + + devConsoleLog("executing writePackageFunc expecting transferID of " + transferid); + + // execute callback + await spikeMemory.startWriteProgramCallback[1](blocksize, transferid); + + devConsoleLog("deallocating startWriteProgramCallback"); + + // deallocate callback + spikeMemory.startWriteProgramCallback = undefined; + } + + } + + // check if the program should write packages for a program + if (spikeMemory.writePackageInformation != undefined) { + + devConsoleLog("writePackageInformation is defined. Looking for matching mesasage id: " + spikeMemory.writePackageInformation[0]); + + // check if the message id of UJSONRPC corresponds to that of the first write_package script that was sent + if (spikeMemory.writePackageInformation[0] == parsedUJSON["i"]) { + + devConsoleLog("matching message id detected with writePackageInformation[0]: " + spikeMemory.writePackageInformation[0]); + + // get the information for the package sending process + var remainingData = spikeMemory.writePackageInformation[1]; + var transferID = spikeMemory.writePackageInformation[2]; + var blocksize = spikeMemory.writePackageInformation[3]; + + // the size of the remaining data to send is less than or equal to blocksize + if (remainingData.length <= blocksize) { + devConsoleLog("remaining data's length is less than or equal to blocksize"); + + // the size of remaining data is not zero + if (remainingData.length != 0) { + + var dataToSend = remainingData.substring(0, remainingData.length); + + devConsoleLog("remaining data's length is not zero, sending entire remaining data: " + dataToSend); + + var base64data = btoa(dataToSend); + + ujsonLib.writePackage(base64data, transferID, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); + + devConsoleLog("deallocating writePackageInforamtion"); + + if (spikeMemory.writeProgramCallback != undefined) { + spikeMemory.writeProgramCallback(); + } + + spikeMemory.writePackageInformation = undefined; + }); + } + } + // the size of remaining data is more than the blocksize + else if (remainingData.length > blocksize) { + devConsoleLog("remaining data's length is more than blocksize"); + + var dataToSend = remainingData.substring(0, blocksize); + + devConsoleLog("sending blocksize amount of data: " + dataToSend); + + var base64data = btoa(dataToSend); + + ujsonLib.writePackage(base64data, transferID, (wpCommand, wpRandomId) => { + sendDATA(wpCommand); + + devConsoleLog("expected response with message id of " + wpRandomId) + + var remainingData = remainingData.substring(blocksize, remainingData.length); + + spikeMemory.writePackageInformation = [wpRandomId, remainingData, transferID, blocksize]; + }); + } + } + } + } + } + + /** Get the orientation of the hub based on gyroscope values + * + * @private + * @param {(number|Array)} gyro + */ + const setHubOrientation = function (gyro) { + var newOrientation; + if (gyro[0] < 500 && gyro[0] > -500) { + if (gyro[1] < 500 && gyro[1] > -500) { + + if (gyro[2] > 500) { + newOrientation = "front"; + } + else if (gyro[2] < -500) { + newOrientation = "back"; + } + } + else if (gyro[1] > 500) { + newOrientation = "up"; + } + else if (gyro[1] < -500) { + newOrientation = "down"; + } + } else if (gyro[0] > 500) { + newOrientation = "rightside"; + } + else if (gyro[0] < -500) { + newOrientation = "leftside"; + } + + return newOrientation; + } + + /** + * + * @private + * @param {string} id + * @param {function} cb + */ + const pushResponseCallback = function (id, cb) { + var toPush = []; // [ ujson string id, function pointer ] + + toPush.push(id); + toPush.push(cb); + + // responseCallbacks has elements in it + if (spikeMemory.responseCallbacks.length > 0) { + + var emptyFound = false; // empty index was found flag + + // insert the pointer to the function where index is empty + for (var index in spikeMemory.responseCallbacks) { + if (spikeMemory.responseCallbacks[index] == undefined) { + spikeMemory.responseCallbacks[index] = toPush; + emptyFound = true; + } + } + + // if all indices were full, push to the back + if (!emptyFound) { + spikeMemory.responseCallbacks.push(toPush); + } + + } + // responseCallbacks current has no elements in it + else { + spikeMemory.responseCallbacks.push(toPush); + } + } + + const sendDATA = function (command) { + spikeRPC.sendDATA(command); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passConnectCallback = function (f) { + funcAfterConnect = f; + spikeRPC.passConnectCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passDisconnectCallback = function (f) { + funcAfterDisconnect = f; + spikeRPC.passDisconnectCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passErrorCallback = function (f) { + funcAfterError = f; + spikeRPC.passErrorCallback(f); + } + /** assign event callback and pass callback down + * @param {function} f + */ + const passPrintCallback = function (f) { + funcAfterPrint = f; + spikeRPC.passPrintCallback(f); + } + + const passStreamCallback = function (f) { + spikeRPC.executeWithStream(f); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** Sleep function + * @private + * @param {number} ms Miliseconds to sleep + * @returns {Promise} + */ + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + + + return { + init: init, + spikeMemory: spikeMemory, + ports, + hub: hub, + writeProgram: writeProgram, + sendDATA: sendDATA, + pushResponseCallback: pushResponseCallback, + // key event callback setters + passConnectCallback: passConnectCallback, + passDisconnectCallback: passDisconnectCallback, + passErrorCallback: passErrorCallback, + passPrintCallback: passPrintCallback, + passStreamCallback: passStreamCallback + } + +} \ No newline at end of file diff --git a/server/examples/modules/scaledSPIKE/webserial/WebSerial.js b/server/examples/modules/scaledSPIKE/webserial/WebSerial.js new file mode 100644 index 0000000..e84c8a4 --- /dev/null +++ b/server/examples/modules/scaledSPIKE/webserial/WebSerial.js @@ -0,0 +1,259 @@ +function _WebSerial() { + + ////////////////////////////////////////// + // // + // Global Variables // + // // + ////////////////////////////////////////// + + let wsPort; + let reader; + let writer; + let writableStreamClosed; + let value; + let done; + + // development flag + let dev; + + // callback functions after key events + let funcAfterError = (er) => {/* placeholder*/ } + let funcAfterDisconnect = () => {} + let funcAfterConnect = () => {} + + /** Initialize the WebSerial object + * (Prompt user to connect to the wsPort) + * @param {boolean} isDev true if running for SD development/testing, false otherwise + * @public + */ + const init = async function (isDev) { + try { + dev = isDev; + let connected = await connect(isDev); + + if (connected === true) + funcAfterConnect(); + + return connected + } + catch (e) { + throw e; + } + } + + /** Prompt user to connect to the wsPort + * Error Code: 1000X + * @returns {boolean} success(true)/failure(false) + * @private + */ + const connect = async function (isDev) { + try { + let success = false; + + wsPort = await navigator.serial.getPorts(); + + console.log("%cTuftsCEEO ", "color: #3ba336;", "wsPorts:", wsPort); + + // select device + wsPort = await navigator.serial.requestPort({ + // filters:[filter] + }); + + // wait for the wsPort to open. + try { + await wsPort.open({ baudRate: 115200 }); + } + catch (er) { + + if (er.message.indexOf("baudrate") > -1) { + // requires different baudRate syntax + //console.log("%cTuftsCEEO ", "color: #3ba336;", "baudRate needs to be baudrate"); + + await wsPort.open({ baudrate: 115200 }); + } + else if (er.message.indexOf("close") > -1) { + // error is due to unsuccessful closing of previous wsPort + await wsPort.close(); + + consoleError("Unsuccessful closing of previous wsPort"); + + throw {code: 10001, message: er.message}; + } + else if (er.message.indexOf("open") > -1) { + // error in wsPort.open was because it was already open + /* "failed to open serial wsPort" */ + try { + await wsPort.close(); + } + catch (err) { + consoleError("wsPort could not be opened was because it was already open"); + throw { code: 10002, message: err.message }; + } + } + else { + throw { code: 10003, message: er.message }; + } + + await wsPort.close(); + } + + if (wsPort.readable) { + success = true; + } + else { + success = false; + } + + return success; + + } catch (e) { + if (e.message.indexOf("close") > -1) { + await wsPort.close(); + throw { code: 10004, message: e.message } + } + else { + consoleError("Cannot read wsPort: ", e); + throw { code: 10005, message: e.message } + } + } + } + + /** Stream incoming data from hardware through web serial + * Error Code: 101XX + * @public + */ + /** Stream incoming data from hardware through web serial + * and take parser interface and continuously feed it raw data + * @param {function} parser parser function + */ + const streamData = async function (parser) { + try { + + var firstReading = true; + // read when port is set up + while (wsPort.readable) { + + // initialize readers + const decoder = new TextDecoderStream(); + const readableStreamClosed = wsPort.readable.pipeTo(decoder.writable); + reader = decoder.readable.getReader(); + + // continuously get + while (true) { + try { + // read UJSON RPC stream ( actual data in {value} ) + ({ value, done } = await reader.read()); + + // console.log("%cTuftsCEEO ", "color: #3ba336;", value); + + //concatenate UJSONRPC packets into complete JSON objects + if (value) { + await parser(value); + } + if (done) { + serviceActive = false; + // reader has been canceled. + console.log("%cTuftsCEEO ", "color: #3ba336;", "[readLoop] DONE", done); + } + } + // error handler + catch (error) { + console.log("%cTuftsCEEO ", "color: #3ba336;", '[readLoop] ERROR', error); + + serviceActive = false; + + funcAfterDisconnect(); + + funcAfterError("SPIKE Prime hub has been disconnected"); + + writer.close(); + //await writer.releaseLock(); + await writableStreamClosed; + + reader.cancel(); + //await reader.releaseLock(); + await readableStreamClosed.catch(reason => { }); + + await wsPort.close(); + + writer = undefined; + reader = undefined; + streamParser = undefined; + + break; // stop trying to read + } + } // end of: while (true) [reader loop] + + // release the lock + reader.releaseLock(); + + } // end of: while (wsPort.readable) [checking if readable loop] + console.log("%cTuftsCEEO ", "color: #3ba336;", "- wsPort.readable is FALSE") + } // end of: trying to open wsPort + catch (e) { + serviceActive = false; + // Permission to access a device was denied implicitly or explicitly by the user. + console.log("%cTuftsCEEO ", "color: #3ba336;", 'ERROR trying to open:', e); + } + } + /** + * + * @param {any} command + */ + const write = function (command) { + setupWriter(); + writer.write(command); + } + + const executeAfterConnect = (f) => { (typeof f === "function") ? funcAfterConnect = f : {}}; + const executeAfterDisconnect = (f) => { (typeof f === "function") ? funcAfterDisconnect = f : {}}; + const executeAfterError = (f) => { (typeof f === "function") ? funcAfterError = f : {}}; + + /** Set up writer object for sending data + * @private + */ + const setupWriter = function () { + // if writer not yet defined: + if (typeof writer === 'undefined') { + // set up writer for the first time + const encoder = new TextEncoderStream(); + writableStreamClosed = encoder.readable.pipeTo(wsPort.writable); + writer = encoder.writable.getWriter(); + } + } + + /** console log + * @private + * @param {string} m + */ + const CONSOLELOG = function (m) { + console.log("%cTuftsCEEO ", "color: #3ba336;", m); + } + + /** console log only in development + * @private + * @param {string} m + */ + const devConsoleLog = function (m) { + if (dev === true) + console.log("%cTuftsCEEO ", "color: #3ba336;", m); } + + /** console.error a message + * @param {string} m + * @private + */ + const consoleError = function (m) { + console.error("%cTuftsCEEO ", "color: #3ba336;", m); + } + + + return { + init: init, + streamData: streamData, + write: write, + // key event callback receivers + executeAfterDisconnect: executeAfterDisconnect, + executeAfterConnect: executeAfterConnect, + executeAfterError: executeAfterError + } +} \ No newline at end of file diff --git a/server/examples/servicedock_unitTesting.html b/server/examples/servicedock_unitTesting.html index 1f836e3..90d9cd1 100644 --- a/server/examples/servicedock_unitTesting.html +++ b/server/examples/servicedock_unitTesting.html @@ -6,22 +6,12 @@ --> - - - - - + @@ -30,7 +20,7 @@
- + @@ -80,9 +70,10 @@ value="motor.run_to_degrees_counted() with CALLBACK ( NO stall detection )"> - - + + + @@ -93,6 +84,7 @@ + @@ -298,12 +290,11 @@ }) }) }) - - // var hub = new mySPIKE.PrimeHub(); (commented by jeremy 1/19/21) + @@ -331,10 +322,9 @@ displayTests(); // display the tests of Service picked during window load selectService.addEventListener("change", () => { displayTests(); - }) + }); function displayTests () { - let testsSPIKE = document.getElementById("SPIKEbox"); let testsSL = document.getElementById("SLbox"); let testsAT = document.getElementById("ATbox"); @@ -399,13 +389,23 @@ testDegreesCounted.style.backgroundColor = "lightgreen"; testMotorStartAtPower.style.backgroundColor = "lightgreen"; testMotorPosition.style.backgroundColor = "lightgreen"; + testMotorStop.style.backgroundColor = "lightgreen"; + testMotorGetSpeed.style.backgroundColor = "lightgreen"; + testMotorGetPower.style.backgroundColor = "lightgreen"; + //testMotorPairStart + testMotorPairMove.style.backgroundColor = "red"; + testMotorPairMoveLeft.style.backgroundColor = "red"; + testMotorPairMoveRight.style.backgroundColor = "red"; + testMotorPairMoveLeftSlightly.style.backgroundColor = "red"; + testMotorPairMoveRightSlightly.style.backgroundColor = "red"; + testMotorPairStartTank.style.backgroundColor = "lightgreen" + testMotorPairStop.style.backgroundColor = "lightgreen"; // TEST motion sensor functions testGetAngles.style.backgroundColor = "lightgreen"; testWasGesture.style.backgroundColor = "lightgreen"; testWaitForNewGesture.style.backgroundColor = "lightgreen"; testWaitForNewOri.style.backgroundColor = "lightgreen"; - testSetHubOrientation.style.backgroundColor = "lightgreen"; testResetYaw.style.backgroundColor = "red"; testResetYawSource.style.backgroundColor = "red"; testGetGesture.style.backgroundColor = "lightgreen"; @@ -419,56 +419,60 @@ testGetForcePercentage.style.backgroundColor = "lightgreen"; // TEST Primehub.speaker functions - testBeep.style.backgroundColor = "lightgreen"; - testStartBeep.style.backgroundColor = "lightgreen"; - testStopBeep.style.backgroundColor = "lightgreen"; + testBeep.style.backgroundColor = "orange"; + testStartBeep.style.backgroundColor = "orange"; + testStopBeep.style.backgroundColor = "orange"; // TEST Primehub.button functions testButtonIsPressed.style.backgroundColor = "lightgreen"; testButtonWaitPressed.style.backgroundColor = "lightgreen"; testButtonWaitRelease.style.backgroundColor = "lightgreen"; testButtonWasPressed.style.backgroundColor = "lightgreen"; - - //testMotorPairStart - testMotorPairStop.style.backgroundColor = "lightgreen"; - testMotorPairMove.style.backgroundColor = "red"; - testMotorPairMoveLeft.style.backgroundColor = "red"; - testMotorPairMoveRight.style.backgroundColor = "red"; - testMotorPairMoveLeftSlightly.style.backgroundColor = "red"; - testMotorPairMoveRightSlightly.style.backgroundColor = "red"; + + // TEST ColorSensor + testGetColor.style.backgroundColor = "lightgreen"; + testWaitUntilColor.style.backgroundColor = "lightgreen"; + testWaitForNewColor.style.backgroundColor = "lightgreen"; + + // TEST Distance Sensor + testLightUp.style.backgroundColor = "lightgreen"; + testGetDistanceCM.style.backgroundColor = "lightgreen"; + testGetDistanceIN.style.backgroundColor = "lightgreen"; + testWaitForDistanceFartherThan.style.backgroundColor = "lightgreen"; + testWaitForDistanceCloserThan.style.backgroundColor = "lightgreen"; // test MISC buttons - test_getMotorPorts.style.backgroundColor = "lightgreen"; + test_getMotorPorts.style.backgroundColor = "red"; // test MISC buttons: UJSONRPC - testUJSONRPC.style.backgroundColor = "lightgreen"; - testUJSONRPCdisplayClear.style.backgroundColor = "lightgreen"; - testUJSONRPCdisplaySetPixel.style.backgroundColor = "lightgreen"; - testUJSONRPCdisplayText.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorGoRelPos.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorGoRelPos1.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorGoRelPos2.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorGoRelPos3.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorPwm.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorPwm1.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunDegrees.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunDegrees1.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunDegrees2.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunDegrees3.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunTimed.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunTimed1.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunTimed2.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorRunTimed3.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorStart.style.backgroundColor = "lightgreen"; - testUJSONRPCmotorStart1.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankDegrees.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankDegrees1.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankPowers.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankSpeeds.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankTime.style.backgroundColor = "lightgreen"; - testUJSONRPCmoveTankTime1.style.backgroundColor = "lightgreen"; - testUJSONRPCsoundBeep.style.backgroundColor = "lightgreen"; - testUJSONRPCsoundStop.style.backgroundColor = "lightgreen"; + testUJSONRPC.style.backgroundColor = "red"; + testUJSONRPCdisplayClear.style.backgroundColor = "red"; + testUJSONRPCdisplaySetPixel.style.backgroundColor = "red"; + testUJSONRPCdisplayText.style.backgroundColor = "red"; + testUJSONRPCmotorGoRelPos.style.backgroundColor = "red"; + testUJSONRPCmotorGoRelPos1.style.backgroundColor = "red"; + testUJSONRPCmotorGoRelPos2.style.backgroundColor = "red"; + testUJSONRPCmotorGoRelPos3.style.backgroundColor = "red"; + testUJSONRPCmotorPwm.style.backgroundColor = "red"; + testUJSONRPCmotorPwm1.style.backgroundColor = "red"; + testUJSONRPCmotorRunDegrees.style.backgroundColor = "red"; + testUJSONRPCmotorRunDegrees1.style.backgroundColor = "red"; + testUJSONRPCmotorRunDegrees2.style.backgroundColor = "red"; + testUJSONRPCmotorRunDegrees3.style.backgroundColor = "red"; + testUJSONRPCmotorRunTimed.style.backgroundColor = "red"; + testUJSONRPCmotorRunTimed1.style.backgroundColor = "red"; + testUJSONRPCmotorRunTimed2.style.backgroundColor = "red"; + testUJSONRPCmotorRunTimed3.style.backgroundColor = "red"; + testUJSONRPCmotorStart.style.backgroundColor = "red"; + testUJSONRPCmotorStart1.style.backgroundColor = "red"; + testUJSONRPCmoveTankDegrees.style.backgroundColor = "red"; + testUJSONRPCmoveTankDegrees1.style.backgroundColor = "red"; + testUJSONRPCmoveTankPowers.style.backgroundColor = "red"; + testUJSONRPCmoveTankSpeeds.style.backgroundColor = "red"; + testUJSONRPCmoveTankTime.style.backgroundColor = "red"; + testUJSONRPCmoveTankTime1.style.backgroundColor = "red"; + testUJSONRPCsoundBeep.style.backgroundColor = "red"; + testUJSONRPCsoundStop.style.backgroundColor = "red"; getTagsInfo.style.backgroundColor = "lightgreen"; createNewTag.style.backgroundColor = "lightgreen"; @@ -726,7 +730,7 @@ #SLbox, #SPIKEbox, #ATbox { position: absolute; top: 200px; - left: 500px; + left: 100px; height: 400px; width: 400px; background-color: #4CE0D2; diff --git a/server/examples/tests/SPIKE/buttons.js b/server/examples/tests/SPIKE/buttons.js index 9fbf598..d52e455 100644 --- a/server/examples/tests/SPIKE/buttons.js +++ b/server/examples/tests/SPIKE/buttons.js @@ -9,7 +9,7 @@ testButtonIsPressed.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON button.is_pressed() #######"); console.log("Test: start the test pressing either the left button or the right button"); - + var hub = new mySPIKE.PrimeHub(); var left_button = hub.left_button; var right_button = hub.right_button; @@ -29,7 +29,7 @@ testButtonWasPressed.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON button.was_pressed() #######"); console.log("Test: press either the left button or the right button. Then, after some time start the test."); - + var hub = new mySPIKE.PrimeHub(); var left_button = hub.left_button; var right_button = hub.right_button; @@ -49,7 +49,7 @@ testButtonWaitPressed.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON button.wait_until_pressed() #######"); console.log("Test: Start the test. Then, after some time press either left button or right button"); - + var hub = new mySPIKE.PrimeHub(); var left_button = hub.left_button; var right_button = hub.right_button; @@ -74,7 +74,7 @@ testButtonWaitRelease.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON button.wait_until_released() #######"); console.log("Test: Start the test. Then, after some time press either left button or right button and release them"); - + var hub = new mySPIKE.PrimeHub(); var left_button = hub.left_button; var right_button = hub.right_button; diff --git a/server/examples/tests/SPIKE/motionsensor.js b/server/examples/tests/SPIKE/motionsensor.js index 9c3c629..566ff41 100644 --- a/server/examples/tests/SPIKE/motionsensor.js +++ b/server/examples/tests/SPIKE/motionsensor.js @@ -14,10 +14,10 @@ var testResetYaw = document.getElementById("resetYaw"); /* wait for new gesture */ testWaitForNewGesture.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motionSensor.wait_for_new_gesture(callback) #######") - console.log("Test: Program will detect either 'tapped' or 'doubletapped' gestures. Tap the hub display"); + console.log("Test: Program will detect any gesture. "); - - hub.motion_sensor.wait_for_new_gesture(function (gesture) { + var hub = new mySPIKE.PrimeHub(); + hub.motion_sensor.wait_for_new_gesture( function (gesture) { console.log(">>> in callback") @@ -31,24 +31,32 @@ testWaitForNewGesture.addEventListener("click", async function () { console.log(">>> doubletapped event handler"); console.log("###### ENDING UNIT TEST ON motionSensor.wait_for_new_gesture(callback) #######") } + else if (gesture == "freefall") { + console.log(">>> freefall event handler"); + console.log("###### ENDING UNIT TEST ON motionSensor.wait_for_new_gesture(callback) #######") + } + else if (gesture == "shaken") { + console.log(">>> shaken event handler"); + console.log("###### ENDING UNIT TEST ON motionSensor.wait_for_new_gesture(callback) #######") + } else { + console.error("DID NOT PASS wait_for_new_gesture(callback) TEST") console.log("###### ENDING UNIT TEST ON motionSensor.wait_for_new_gesture(callback) #######") } }) - }) /* was gesture */ testWasGesture.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor.was_gesture('doubletapped') #######") - console.log("Test (First Time): Sees if 'doubletapped' gesture has occurred since the beginning of the program (for the first use)."); - console.log("Test (Second Time): Sees if 'doubletapped' gesture has occurred since the last execution of was_gesture()."); - - if (hub.motion_sensor.was_gesture("doubletapped")) { - console.log(">>> doubletapped did occur"); + console.log("Test (First Time): Sees if 'tapped' gesture has occurred since the beginning of the program (for the first use)."); + console.log("Test (Second Time): Sees if 'tapped' gesture has occurred since the last execution of was_gesture()."); + var hub = new mySPIKE.PrimeHub(); + if (hub.motion_sensor.was_gesture("tapped")) { + console.log(">>> tapped did occur"); } else { - console.log(">>> doubletapped did NOT occur "); + console.log(">>> tapped did NOT occur "); } console.log("###### ENDING UNIT TEST ON motion_sensor.was_gesture('doubletapped') #######") @@ -59,7 +67,7 @@ testWaitForNewOri.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor.wait_for_new_orientation(callback) #######") console.log("Test (First Time): the returned orientation will be the current orientation."); console.log("Test (Second Time): Sees if there's a new orientation different from the previously detected"); - + var hub = new mySPIKE.PrimeHub(); console.log(">>> change the orientation of the hub"); hub.motion_sensor.wait_for_new_orientation(function (orientation) { @@ -73,7 +81,7 @@ testWaitForNewOri.addEventListener("click", async function () { testGetAngles.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor get_***_angle() functions #######"); - + var hub = new mySPIKE.PrimeHub(); console.log("yaw angle: ", hub.motion_sensor.get_yaw_angle()); console.log("pitch angle: ", hub.motion_sensor.get_pitch_angle()); console.log("roll angle: ", hub.motion_sensor.get_roll_angle()); @@ -83,7 +91,7 @@ testGetAngles.addEventListener("click", async function () { testGetGesture.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor.get_gesture() #######"); - + var hub = new mySPIKE.PrimeHub(); var gesture = hub.motion_sensor.get_gesture(); console.log("gesture: ", gesture); @@ -94,7 +102,7 @@ testGetGesture.addEventListener("click", function () { testGetOrientation.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor.get_orientation() #######"); - + var hub = new mySPIKE.PrimeHub(); var orientation = hub.motion_sensor.get_orientation(); console.log("orientation: ", orientation); @@ -106,7 +114,7 @@ testResetYaw.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON motion_sensor.reset_yaw_angle() #######"); console.log("Test: reset yaw angle and get yaw angle after 3 seconds"); - + var hub = new mySPIKE.PrimeHub(); hub.motion_sensor.reset_yaw_angle(); setTimeout(function () { diff --git a/server/examples/tests/SPIKE/motor.js b/server/examples/tests/SPIKE/motor.js index ae1cfcd..50bd335 100644 --- a/server/examples/tests/SPIKE/motor.js +++ b/server/examples/tests/SPIKE/motor.js @@ -9,11 +9,13 @@ var testMotorDegreesCounted1CB = document.getElementById("motordeg1cb"); var testDegreesCounted = document.getElementById("degreesCounted"); var testMotorStartAtPower = document.getElementById("motorStartAtPower"); var testMotorPosition = document.getElementById("motorPosition"); +var testMotorStop = document.getElementById("motorStop"); +var testMotorGetSpeed = document.getElementById("motorGetSpeed"); +var testMotorGetPower = document.getElementById("motorGetPower"); testMotorDegreesCounted.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motor.run_to_degrees_counted(200, 50) WITH STALL DETECTION #######"); var motor = new mySPIKE.Motor("A"); - motor.set_stall_detection(true); motor.run_to_degrees_counted(200, 50); @@ -25,7 +27,6 @@ testMotorDegreesCounted1.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motor.run_to_degrees_counted(200, 50) NO STALL DETECTION #######"); var motor = new mySPIKE.Motor("A"); - motor.set_stall_detection(false); motor.run_to_degrees_counted(200, 50); @@ -36,7 +37,6 @@ testMotorDegreesCounted1.addEventListener("click", async function () { testMotorDegreesCountedCB.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motor.run_to_degrees_counted(200, 50, cb) WITH STALL DETECTION #######"); var motor = new mySPIKE.Motor("A"); - motor.set_stall_detection(true); motor.run_to_degrees_counted(200, 50, function (result) { @@ -49,7 +49,6 @@ testMotorDegreesCounted1CB.addEventListener("click", async function () { console.log("###### BEGINNING UNIT TEST ON motor.run_to_degrees_counted(200, 50, cb) NO STALL DETECTION #######"); var motor = new mySPIKE.Motor("A"); - motor.set_stall_detection(false); motor.run_to_degrees_counted(200, 50, function (result) { @@ -62,9 +61,8 @@ testMotorDegreesCounted1CB.addEventListener("click", async function () { /* go to rel pos without stall detection */ testMotorStartAtPower.addEventListener("click", async function () { - var motor = new mySPIKE.Motor("A"); - motor.run_for_degrees(30, 100); + motor.start_at_power(100); }) @@ -80,4 +78,25 @@ testMotorPosition.addEventListener("click", async function () { var motor = new mySPIKE.Motor("A"); console.log(motor.get_position()) console.log("###### ENDING UNIT TEST ON motor.get_position() #######"); +}) + +testMotorStop.addEventListener("click", async function () { + console.log("###### BEGINNING UNIT TEST ON motor.stop() #######"); + var motor = new mySPIKE.Motor("A"); + motor.stop(); + console.log("###### ENDING UNIT TEST ON motor.stop() #######"); +}) + +testMotorGetSpeed.addEventListener("click", async function () { + console.log("###### BEGINNING UNIT TEST ON motor.get_speed() #######"); + var motor = new mySPIKE.Motor("A"); + console.log("motor speed: ", motor.get_speed()); + console.log("###### ENDING UNIT TEST ON motor.get_speed() #######"); +}) + +testMotorGetPower.addEventListener("click", async function () { + console.log("###### BEGINNING UNIT TEST ON motor.get_power() #######"); + var motor = new mySPIKE.Motor("A"); + console.log("motor power: ", motor.get_power()); + console.log("###### ENDING UNIT TEST ON motor.get_power() #######"); }) \ No newline at end of file diff --git a/server/examples/tests/SPIKE/motorpair.js b/server/examples/tests/SPIKE/motorpair.js index 0becb52..4a798aa 100644 --- a/server/examples/tests/SPIKE/motorpair.js +++ b/server/examples/tests/SPIKE/motorpair.js @@ -9,6 +9,8 @@ var testMotorPairMoveLeft = document.getElementById("motorPairMoveLeft"); var testMotorPairMoveRight = document.getElementById("motorPairMoveRight"); var testMotorPairMoveLeftSlightly = document.getElementById("motorPairMoveLeftSlightly"); var testMotorPairMoveRightSlightly = document.getElementById("motorPairMoveRightSlightly"); +var testMotorPairStartTank = document.getElementById("motorPairStartTank"); +var testMotorPairStop = document.getElementById("motorPairStop"); testMotorPairStop.addEventListener("click", function () { console.log("###### BEGINNING UNIT TEST ON motorPair.stop() #######"); @@ -92,4 +94,12 @@ testMotorPairMoveRightSlightly.addEventListener("click", function () { console.log("Expected result: driving base moving right SLIGHTLY and stopping") console.log("###### ENDING UNIT TEST ON motorPair.move(100, 'cm', 50, 100) #######"); +}) + +testMotorPairStartTank.addEventListener("click", function () { + console.log("###### BEGINNING UNIT TEST ON motorPair.start_tank(10,10) #######"); + var motorPair = new mySPIKE.MotorPair("A", "B"); + + motorPair.start_tank(50,50); + console.log("###### ENDING UNIT TEST ON motorPair.start_tank(10,10) #######"); }) \ No newline at end of file