diff --git a/ardublockly/CanvasDataStructures.js b/ardublockly/CanvasDataStructures.js
new file mode 100644
index 0000000000..9b6fb40f7f
--- /dev/null
+++ b/ardublockly/CanvasDataStructures.js
@@ -0,0 +1,98 @@
+//*************************************************************************
+//*
+//* GLOBAL VARIBALES FOR COMPONENTS
+//*
+//*************************************************************************
+
+var g_arrayGrid = [];
+var g_Canvas = document.getElementById("canvas"), g_BlankCanvasClone = document.createElement('canvas');
+var g_CanvasContext = null, g_BlankCanvasCloneContext = null;
+var g_DrawSpace = document.getElementById("draw_space");
+var g_pointCanvasScrollPos = new CPoint(0, 0);
+var g_nGridSize = 10;
+
+if (g_Canvas != null)
+{
+ g_CanvasContext = g_Canvas.getContext("2d");
+ if (g_CanvasContext == null)
+ alert("Could not get canvas context object for 'canvas'!");
+}
+else
+ alert("Could not get canvas object for 'canvas'!");
+
+if (g_BlankCanvasClone != null)
+{
+ g_BlankCanvasClone.width = g_Canvas.width;
+ g_BlankCanvasClone.height = g_Canvas.height;
+ g_BlankCanvasCloneContext = g_BlankCanvasClone.getContext("2d");
+ if (g_BlankCanvasCloneContext == null)
+ alert("Could not get canvas context object for 'clone canvas'!");
+}
+else
+ alert("Could not get canvas object for 'canvas'!");
+
+if (g_DrawSpace == null)
+ alert("Could not get div object for 'draw_space'!");
+
+
+
+
+//*************************************************************************
+//*
+//* SCROLL TO MIDDLE OF CANVAS ON START UP
+//*
+//*************************************************************************
+
+function doScrollToMiddle()
+{
+ if (g_DrawSpace)
+ {
+ g_DrawSpace.scrollTop = g_Canvas.height / 2;
+ g_pointCanvasScrollPos = new CPoint(0, g_Canvas.height / 2);
+ }
+}
+
+
+
+
+
+//*************************************************************************
+//*
+//* ERASE THE CANVAS AND CREATE THE GRID
+//*
+//*************************************************************************
+
+function doCreateGrid()
+{
+ var nX = 0, nY = 0;
+
+ if (g_Canvas != null)
+ {
+ for (nY = 0; nY < g_Canvas.offsetHeight; nY += g_nGridSize)
+ {
+ for (nX = 0; nX < g_Canvas.offsetWidth; nX += g_nGridSize)
+ g_arrayGrid.push(new CPoint(nX, nY));
+ }
+ }
+}
+
+function doDrawCanvasGrid(Context, nWidth, nHeight)
+{
+ if (g_arrayGrid.length == 0)
+ doCreateGrid()
+ if (Context != null)
+ {
+ Context.clearRect(0, 0, nWidth, nHeight);
+ Context.fillStyle = "#000000";
+ Context.beginPath();
+ for (let nI = 0; nI < g_arrayGrid.length; nI++)
+ Context.fillRect(g_arrayGrid[nI].m_nX, g_arrayGrid[nI].m_nY, 1, 1);
+ }
+}
+
+function doEraseCanvas()
+{
+ g_CanvasContext.clearRect(0, 0, g_Canvas.offsetWidth, g_Canvas.offsetHeight);
+ g_CanvasContext.drawImage(g_BlankCanvasClone, 0, 0);
+}
+
diff --git a/ardublockly/CodeDataStructures.js b/ardublockly/CodeDataStructures.js
new file mode 100644
index 0000000000..b61ded6db9
--- /dev/null
+++ b/ardublockly/CodeDataStructures.js
@@ -0,0 +1,1234 @@
+//*************************************************************************
+//*
+//* CODE CLASSES
+//*
+//*************************************************************************
+
+var g_strIndent = "    ";
+
+class CLiteral
+{
+ constructor()
+ {
+ this.m_strType = "";
+ this.m_strValue = "";
+ this.m_strKINDOF = "LITERAL";
+ };
+
+ init(strType, strValue)
+ {
+ this.m_strType = strType;
+ this.m_strValue = strValue;
+ };
+
+ evaluate()
+ {
+ var Value = null;
+
+ if (isArduinoConstant(this.m_strValue))
+ Value = this.m_strValue;
+ else if (this.m_strType == "char")
+ Value = this.m_strValue[0];
+ else if ((this.m_strType == "boolean") || (this.m_strType == "bool"))
+ {
+ if ((this.m_strValue == "true") || (this.m_strValue == "1"))
+ Value = true;
+ else if ((this.m_strValue == "false") || (this.m_strValue == "0"))
+ Value = false;
+ }
+ else if (this.m_strType == "float")
+ Value = parseFoat(this.m_strValue);
+ else if (this.m_strType == "String")
+ Value = this.m_strValue;
+ else
+ Value = parseInt(this.m_strValue, 10);
+
+ return Value;
+ }
+
+ setValue(strValue)
+ {
+ this.m_strValue = strValue;
+ }
+
+ getType()
+ {
+ return this.m_strType;
+ }
+
+ getValue()
+ {
+ return this.m_strValue;
+ }
+
+ isEmpty()
+ {
+ return (this.m_strType == "") && (this.m_strValue == "");
+ }
+
+ toString()
+ {
+ return this.m_strValue;
+ }
+
+};
+
+class CVariable
+{
+ constructor()
+ {
+ this.m_strName = "";
+ this.m_strType = "";
+ this.m_strValue = null;
+ this.m_strKINDOF = "VARIABLE";
+ }
+
+ init(strName, strType, strValue)
+ {
+ this.m_strName = strName;
+ this.m_strType = strType;
+ this.m_strValue = strValue;
+ }
+
+ evaluate()
+ {
+ var Value = null;
+
+ if (this.m_strType == "char")
+ Value = this.m_strValue[0];
+ else if (this.m_strType == "boolean")
+ {
+ if ((this.m_strValue == "true") || (this.m_strValue == "1"))
+ Value = true;
+ else if ((this.m_strValue == "false") || (this.m_strValue == "0"))
+ Value = false;
+ }
+ else if (this.m_strType == "float")
+ Value = parseFoat(this.m_strValue);
+ else if (this.m_strType == "String")
+ Value = this.m_strValue;
+ else
+ Value = parseInt(this.m_strType[0], 10);
+
+ return Value;
+ }
+
+ setValue(strValue)
+ {
+ this.m_strValue = strValue;
+ }
+
+ getType()
+ {
+ return this.m_strType;
+ }
+
+ getName()
+ {
+ return this.m_strName;
+ }
+
+ getValue()
+ {
+ return this.m_strValue;
+ }
+
+ isEmpty()
+ {
+ return (this.m_strName == "") && (this.m_strType == "") && (this.m_strValue == "");
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ if (strNewLine == "")
+ strText = this.m_strName;
+ else
+ strText = strIndent + this.m_strType + " " + this.m_strName + " = " + this.m_strValue + ";" + strNewLine;
+
+ return strText;
+ }
+
+ evaluate()
+ {
+ var nI = g_arrayGlobalVariables.indexOf(this.m_strName);
+ var strValue = "";
+
+ if (nI > -1)
+ strValue = g_arrayGlobalVariables.getValue(nI);
+ else
+ strValue = this.m_strValue;
+
+ return strValue;
+ }
+
+};
+
+class CVariableArray
+{
+ constructor()
+ {
+ this.m_arrayVariables = [];
+ this.m_strKINDOF = "VARIABLE ARRAY";
+ }
+
+ add(Variable)
+ {
+ this.m_arrayVariables[this.m_arrayVariables.length] = Variable;
+ }
+
+ getLength()
+ {
+ return this.m_arrayVariables.length;
+ }
+
+ setValue(nI, Value)
+ {
+ if ((nI < 0) ||(nI >= this.m_arrayVariables.length))
+ alert("ERROR: CVariableArray:setValue, nI = " + nI + ", m_arrayVariables.length = " + this.m_arrayVariables.length + "!");
+ else
+ this.m_arrayVariables[nI].setValue(Value);
+ }
+
+ getValue(nI)
+ {
+ var nResult = 0;
+
+ if ((nI < 0) ||(nI >= this.m_arrayVariables.length))
+ alert("ERROR: CVariableArray:getValue, nI = " + nI + ", m_arrayVariables.length = " + this.m_arrayVariables.length + "!");
+ else
+ nResult = this.m_arrayVariables[nI].getValue();
+
+ return nResult;
+ }
+
+ evaluate(nI)
+ {
+ var nResult = 0;
+
+ if ((nI < 0) ||(nI >= this.m_arrayVariables.length))
+ alert("ERROR: CVariableArray:evaluate, nI = " + nI + ", m_arrayVariables.length = " + this.m_arrayVariables.length + "!");
+ else
+ nResult = this.m_arrayVariables[nI].evaluate();
+
+ return nResult;
+ }
+
+ getType(nI)
+ {
+ var nResult = 0;
+
+ if ((nI < 0) ||(nI >= this.m_arrayVariables.length))
+ alert("ERROR: CVariableArray:getType, nI = " + nI + ", m_arrayVariables.length = " + this.m_arrayVariables.length + "!");
+ else
+ nResult = this.m_arrayVariables[nI].getType();
+
+ return nResult;
+ }
+
+ find(strName)
+ {
+ var Variable = null;
+
+ for (let nI = 0; nI < this.m_arrayVariables.length; nI++)
+ {
+ if (strName == this.m_arrayVariables[nI].getName())
+ {
+ Variable = this.m_arrayVariables[nI];
+ break;
+ }
+ }
+ return Variable;
+ }
+
+ indexOf(strName)
+ {
+ var nIndex = -1;
+
+ for (let nI = 0; nI < this.m_arrayVariables.length; nI++)
+ {
+ if (strName == this.m_arrayVariables[nI].getName())
+ {
+ nIndex = nI;
+ break;
+ }
+ }
+ return nIndex;
+ }
+
+ isEmpty()
+ {
+ return this.m_arrayVariables.length == 0;
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strValues = "";
+
+ for (let nI = 0; nI < this.m_arrayVariables.length; nI++)
+ {
+ if (strNewLine.length > 0)
+ strValues += this.m_arrayVariables[nI].toString(strNewLine, strIndent);
+ else
+ {
+ strValues += this.m_arrayVariables[nI].toString("", "");
+ if (nI < (this.m_arrayVariables.length - 1))
+ strValues += ", ";
+ }
+
+ }
+ return strValues;
+ }
+
+};
+
+class CExpression
+{
+ constructor()
+ {
+ this.m_Arg1 = null;
+ this.m_Arg2 = null;
+ this.m_strOperator = "";
+ this.m_strKINDOF = "EXPRESSION";
+ }
+
+ init(Arg1, Arg2, strOperator)
+ {
+ this.m_Arg1 = Arg1;
+ this.m_Arg2 = Arg2;
+ this.m_strOperator = strOperator;
+ }
+
+ setArg1(Arg1)
+ {
+ this.m_Arg1 = Arg1;
+ }
+
+ setArg2(Arg2)
+ {
+ this.m_Arg2 = Arg2;
+ }
+
+ getArg1()
+ {
+ return this.m_Arg1;
+ }
+
+ getArg2()
+ {
+ return this.m_Arg2;
+ }
+
+ setOperator(strOperator)
+ {
+ this.m_strOperator = strOperator;
+ }
+
+ isSimple()
+ {
+ return this.m_strOperator == "";
+ }
+
+ evaluate()
+ {
+ var Result
+
+ if (this.m_strOperator == "!")
+ Result = !this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "+")
+ Result = this.m_Arg1.evaluate();
+ else if (this.m_strOperator == "-")
+ Result = -1 * this.m_Arg1.evaluate();
+ else if (this.m_strOperator == "")
+ Result = this.m_Arg1.evaluate();
+ else if (this.m_strOperator == "==")
+ Result = this.m_Arg1.evaluate() == this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "!=")
+ Result = this.m_Arg1.evaluate() != this.m_Arg2.evaluate();
+ else if (this.m_strOperator == ">")
+ Result = this.m_Arg1.evaluate() > this.m_Arg2.evaluate();
+ else if (this.m_strOperator == ">=")
+ Result = this.m_Arg1.evaluate() >= this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "<")
+ Result = this.m_Arg1.evaluate() < this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "<=")
+ Result = this.m_Arg1.evaluate() <= this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "+")
+ Result = this.m_Arg1.evaluate() + this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "-")
+ Result = this.m_Arg1.evaluate() - this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "*")
+ Result = this.m_Arg1.evaluate() * this.m_Arg2.evaluate();
+ else if (this.m_strOperator == "/")
+ Result = this.m_Arg1.evaluate() / this.m_Arg2.evaluate();
+
+ return Result;
+ }
+
+ isEmpty()
+ {
+ return (this.m_Arg1 == null) && (this.m_strOperator == "") && (this.m_Arg2 == null);
+ }
+
+ hasArg1()
+ {
+ return this.m_Arg1 != null;
+ }
+
+ isComplete()
+ {
+ return (this.m_Arg1 != null) && (this.m_strOperator != "") && (this.m_Arg2 != null);
+ }
+
+ toString()
+ {
+ var strExpression = "";
+
+ if ((this.m_Arg1 == null) && (this.m_Arg2 != null))
+ {
+ if ((this.m_strOperator == "!") || (this.m_strOperator == "-") || (this.m_strOperator == "+"))
+ strExpression = this.m_strOperator + this.m_Arg2.toString("", "");
+ else
+ doErrorMessage("CExpression::toString, unexptected operator for argument 2 '" + this.m_strOperator + "'!");
+ }
+ else if ((this.m_Arg1 != null) && (this.m_Arg2 == null) && (this.m_strOperator == ""))
+ {
+ strExpression = this.m_Arg1.toString("", "");
+ }
+ else if ((this.m_Arg1 != null) && (this.m_Arg2 != null) && (this.m_strOperator != ""))
+ {
+ strExpression = "(" + this.m_Arg1.toString("", "") + " " + this.m_strOperator + " " + this.m_Arg2.toString("", "") + ")";
+ }
+ else
+ doErrorMessage("CExpression::toString!");
+
+ return strExpression;
+ }
+
+};
+
+class CVariableStatement
+{
+ constructor()
+ {
+ this.m_strVariableName = null;
+ this.m_strOperator = "";
+ this.m_Expression = null;
+ this.m_strKINDOF = "VARIABLE STATEMENT";
+ }
+
+ init(strVariableName, strOperator, Expression)
+ {
+ this.m_strVariableName = strVariableName;
+ this.m_strOperator = strOperator;
+ this.m_Expression = Expression;
+ }
+
+ getName()
+ {
+ return this.m_strVariableName;
+ }
+
+ getOperator()
+ {
+ return this.m_strOperator;
+ }
+
+ getName()
+ {
+ return this.m_strVariableName;
+ }
+
+ evaluate()
+ {
+ var NewValue = this.m_Expression.evaluate(),
+ OldValue = g_arrayGlobalVariables.find(this.strVariableName);
+
+ if (this.m_strOperator == "=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, NewValue);
+ else if (this.m_strOperator == "+=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue + NewValue);
+ else if (this.m_strOperator == "-=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue - NewValue);
+ else if (this.m_strOperator == "*=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue * NewValue);
+ else if (this.m_strOperator == "/=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue / NewValue);
+ else if (this.m_strOperator == "&=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue & NewValue);
+ else if (this.m_strOperator == "|=")
+ g_arrayGlobalVariables.setValue(this.strVariableName, OldValue | NewValue);
+ else
+ alert("ERROR: CVariableStatement::evaluate, invalid operator '" + this.m_strOperator + "'!");
+ }
+
+ isEmpty()
+ {
+ return (this.m_strVariableName == "") && (this.m_strOperator == "") && this.m_Expression.isEmpty();
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = strIndent + this.m_strVariableName + " " + this.m_strOperator + " ";
+
+ if (this.m_Expression == null)
+ strText += "null" + ";" + strNewLine;
+ else
+ strText += this.m_Expression.toString("", "") + ";" + strNewLine;
+
+ return strText;
+ }
+
+ evaluate()
+ {
+ var nIndex = g_arrayGlobalVariables.indexOf(this.m_strVariableName);
+ var nCurrentValue = 0;
+ var nNewValue = this.m_Expression.evaluate();
+
+ if (nIndex > -1)
+ {
+ nCurrentValue = g_arrayGlobalVariables.getValue(nIndex);
+
+ if (this.m_strOperator == "=")
+ g_arrayGlobalVariables.setValue(nIndex, nNewValue);
+ else if (this.m_strOperator == "+=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue + nNewValue);
+ else if (this.m_strOperator == "-=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue - nNewValue);
+ else if (this.m_strOperator == "*=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue * nNewValue);
+ else if (this.m_strOperator == "/=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue / nNewValue);
+ else if (this.m_strOperator == "|=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue | nNewValue);
+ else if (this.m_strOperator == "&=")
+ g_arrayGlobalVariables.setValue(nIndex, nCurrentValue & nNewValue);
+ }
+ }
+
+};
+
+class CStatementArray
+{
+ constructor()
+ {
+ this.m_arrayStatements = [];
+ this.m_strKINDOF = "STATEMENT ARRAY";
+ };
+
+ getLength()
+ {
+ return this.m_arrayStatements.length;
+ }
+
+ get(nIndex)
+ {
+ var Statement = null;
+
+ if ((nIndex >= 0) && (nIndex < this.m_arrayStatements.length))
+ Statement = this.m_arrayStatements[nIndex];
+
+ return Statement;
+ }
+
+ add(Statement)
+ {
+ this.m_arrayStatements.push(Statement);
+ };
+
+ isEmpty()
+ {
+ return this.m_arrayStatements.length == 0;
+ }
+ evaluate()
+ {
+ for (let nI = 0; nI < this.m_arrayStatements.length; nI++)
+ m_arrayStatements.evaluate();
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ for (let nI = 0; nI < this.m_arrayStatements.length; nI++)
+ {
+ strText += this.m_arrayStatements[nI].toString(strNewLine, strIndent);
+ }
+ return strText;
+ }
+
+};
+
+class CForStatement
+{
+ constructor()
+ {
+ this.m_strCounterVarName = "";
+ this.m_ExpressionStart = null;
+ this.m_ExpressionEnd = null;
+ this.m_ExpressionContinue = null;
+ this.m_strOperator = "";
+ this.m_arrayStatements = new CStatementArray();
+ this.m_strKINDOF = "FOR";
+ }
+
+ init(strCounterVarName, ExpressionStart, ExpressionEnd, ExpressionContinue, strOperator, arrayStatements)
+ {
+ this.m_strCounterVarName = strCounterVarName;
+ this.m_ExpressionStart = ExpressionStart;
+ this.m_ExpressionEnd = ExpressionEnd;
+ this.m_ExpressionContinue = ExpressionContinue;
+ this.m_strOperator = strOperator;
+ this.m_arrayStatements = arrayStatements;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ evaluate()
+ {
+ var strReturnVal = "";
+
+ for (let nI = this.m_ExpressionStart.evaluate(); nI < this.m_ExpressionContinue.m_ExpressionEnd(); n += this.m_ExpressionContinue.evaluate())
+ {
+ strReturnVal = this.m_arrayStatements.evaluate();
+ if (strReturnVal == null)
+ continue;
+ else if (strReturnVal == "break")
+ break;
+ }
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ strText += strIndent + "for (" + this.m_strCounterVarName + " = " + this.m_ExpressionStart.toString("", "") + "; " +
+ this.m_strCounterVarName + " " + this.m_strOperator + " " + this.m_ExpressionEnd.toString("", "") + "; " +
+ this.m_strCounterVarName + this.m_ExpressionContinue + ")" + strNewLine;
+ strText += strIndent + "{" + strNewLine;
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent);
+ strText += strIndent + "}" + strNewLine;
+
+ return strText;
+ }
+
+}
+
+class CWhileStatement
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayStatements = new CStatementArray();
+ this.m_strKINDOF = "WHILE";
+ }
+
+ init(Expression, arrayStatements)
+ {
+ this.m_Expression = Expression;
+ this.m_arrayStatements = arrayStatements;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ evaluate()
+ {
+ var strReturnVal = "";
+
+ while (this.m_Expression.evaluate())
+ {
+ strReturnVal = this.m_arrayStatements.evaluate();
+ if (strReturnVal == null)
+ continue;
+ else if (strReturnVal == "break")
+ break;
+ }
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ strText += strIndent + "while " + this.m_Expression.toString("", "") + strNewLine;
+ strText += strIndent + "{" + strNewLine;
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent);
+ strText += strIndent + "}" + strNewLine;
+
+ return strText;
+ }
+}
+
+class CRepeatStatement
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayStatements = new CStatementArray();
+ this.m_strKINDOF = "REPEAT";
+ }
+
+ init(Expression, arrayStatements)
+ {
+ this.m_Expression = Expression;
+ this.m_arrayStatements = arrayStatements;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ evaluate()
+ {
+ var strReturnVal = "";
+
+ do
+ {
+ strReturnVal = this.m_arrayStatements.evaluate();
+
+ if (strReturnVal == null)
+ continue;
+ else if (strReturnVal == "break")
+ break;
+ }
+ while (this.m_Expression.evaluate());
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ strText += strIndent + "do" + strNewLine;
+ strText += strIndent + "{" + strNewLine;
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent);
+ strText += strIndent + "}" + strNewLine;
+ strText += strIndent + "while " + this.m_Expression.toString("", "") + ";" + strNewLine;
+
+ return strText;
+ }
+}
+
+class CBreak
+{
+ constructor()
+ {
+ this.m_strKINDOF = "BREAK";
+ }
+
+ evaluate()
+ {
+ return "break";
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ return strIndent + "break" + strNewLine;
+ }
+
+}
+
+class CCaseArray
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayCases = [];
+ this.m_strKINDOF = "CASE ARRAY";
+ }
+
+ getLength()
+ {
+ this.m_arrayCases.length;
+ }
+
+ add(Case)
+ {
+ this.m_arrayCases.push(Case);
+ };
+
+ isEmpty()
+ {
+ return this.m_arrayCases.length == 0;
+ }
+ evaluate()
+ {
+ for (let nI = 0; nI < this.m_arrayCases.length; nI++)
+ m_arrayCases.evaluate();
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ for (let nI = 0; nI < this.m_arrayCases.length; nI++)
+ {
+ strText += this.m_arrayCases[nI].toString(strNewLine, strIndent);
+ }
+ return strText;
+ }
+}
+
+class CSwitchCase
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayStatements = new CStatementArray();
+ this.m_strKINDOF = "CASE";
+ }
+
+ init(Expression, arrayStatements)
+ {
+ this.m_Expression = Expression;
+ this.m_arrayStatements = arrayStatements;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ setExpression(Expression)
+ {
+ this.m_Expression = Expression;
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = strIndent + "case ";
+
+ strText += this.m_Expression.toString("", "");
+ strText += ":" + strNewLine + strIndent + "{" + strNewLine
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent)
+ strText += strIndent + "}" + strNewLine + strNewLine;
+
+ return strText;
+ }
+}
+
+class CSwitchStatement
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayCases = new CCaseArray();
+ this.m_arrayDefaultStatements = null;
+ this.m_strKINDOF = "SWITCH";
+ }
+
+ init(Expression, arrayCases)
+ {
+ this.m_Expression = Expression;
+ this.m_m_arrayCases = arrayCases;
+ this.m_arrayDefaultStatements = null;
+ }
+
+ setDefault(arrayDefaultStatements)
+ {
+ this.m_arrayDefaultStatements = arrayDefaultStatements;
+ }
+
+ setExpression(Expression)
+ {
+ this.m_Expression = Expression;
+ }
+
+ setCases(arrayCases)
+ {
+ this.m_arrayCases = arrayCases;
+ }
+
+ addCase(Case)
+ {
+ this.m_arrayCases.add(Case);
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = strIndent + "switch (";
+
+ strText += this.m_Expression.toString("", "");
+ strText += ")" + strNewLine + strIndent + "{" + strNewLine;
+ strText += this.m_arrayCases.toString(strNewLine, strIndent + g_strIndent);
+ if (this.m_arrayDefaultStatements != null)
+ {
+ strText += strIndent + g_strIndent + "default:" + strNewLine;
+ strText += strIndent + g_strIndent + "{" + strNewLine;
+ strText += this.m_arrayDefaultStatements.toString(strNewLine, strIndent + g_strIndent + g_strIndent);
+ strText += strIndent + g_strIndent + "}" + strNewLine;
+ }
+ strText += strIndent + "}" + strNewLine;
+
+ return strText;
+ }
+}
+
+class CIfStatement
+{
+ constructor()
+ {
+ this.m_Expression = null;
+ this.m_arrayStatements = new CStatementArray();
+ this.m_Next = null;
+ this.m_strKINDOF = "IF";
+ }
+
+ init(Expression, arrayStatements)
+ {
+ this.m_Expression = Expression;
+ this.m_arrayStatements = arrayStatements;
+ this.m_Next = null;
+ }
+
+ setKindOf(strKindOf)
+ {
+ this.m_strKINDOF = strKindOf;
+ }
+
+ getNext()
+ {
+ return this.m_Next;
+ }
+
+ setNext(Next)
+ {
+ this.m_Next = Next;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ if (this.m_Expression != null)
+ {
+ if (this.m_strKINDOF == "IF")
+ {
+ strText = strIndent + "if " + this.m_Expression.toString("", "") + strNewLine;
+ }
+ else if (this.m_strKINDOF == "ELSE IF")
+ {
+ strText = strIndent + "else if " + this.m_Expression.toString("", "") + strNewLine;
+ }
+ }
+ else
+ strText = strIndent + "else" + strNewLine;
+
+ strText += strIndent + "{" + strNewLine;
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent);
+ strText += strIndent + "}" + strNewLine;
+ if (this.m_Next != null)
+ strText += this.m_Next.toString(strNewLine, strIndent);
+
+ return strText;
+ }
+}
+
+class CFunction
+{
+ constructor()
+ {
+ this.m_strFunctionName = "";
+ this.m_strReturnType = "";
+ this.m_arrayParams = new CVariableArray();
+ this.m_arrayStatements = new CStatementArray();
+ this.m_strKINDOF = "FUNCTION";
+ }
+
+ init(strFuncName, strReturnType, arrayParams, arrayStatements)
+ {
+ this.m_strFunctionName = strFuncName;
+ this.m_strReturnType = strReturnType;
+ this.m_arrayParams = arrayParams;
+ this.m_arrayStatements = arrayStatements;
+ }
+
+ addStatement(Statement)
+ {
+ this.m_arrayStatements.add(Statement);
+ }
+
+ setStatementList(arrayStatement)
+ {
+ this.m_arrayStatements = arrayStatement;
+ }
+
+ addParam(Param)
+ {
+ this.m_arrayParams.add(Param);
+ }
+
+ setStatementList(arrayParams)
+ {
+ this.m_arrayStatements = arrayParams;
+ }
+
+ getName()
+ {
+ return this.m_strFunctionName;
+ }
+
+ getParam(nI)
+ {
+ var Param = null;
+
+ if (nI >= this.m_arrayParams.getLength())
+ alert("ERROR: CFunction::getParam, '" + nI + "' is an invalid parameter number (" + this.m_arrayParams.getLength() + ")!");
+ else
+ {
+ Param = this.m_arrayParams[nI];
+ }
+ return Param;
+ }
+
+ evaluate() //(...)
+ {
+ for (let nI = 0; nI < arguments.length; nI++)
+ {
+ if (nI < this.m_arrayParams.getLength())
+ this.m_arrayParams.setValue(nI, arguments[nI]);
+ }
+ for (let nI = 0; nI < this.m_arrayStatements.getLength(); nI++)
+ {
+ this.m_arrayStatements.get(nI).evaluate();
+ }
+ }
+
+ isEmpty()
+ {
+ return (this.m_strFunctionName == "") && (this.m_strReturnType == "") && this.m_arrayParams.isEmpty() && this.m_arrayStatements.isEmpty();
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = this.m_strReturnType + " " + this.m_strFunctionName + "(" + this.m_arrayParams.toString("", "") + ")";
+ strText += strNewLine + "{" + strNewLine;
+ strText += this.m_arrayStatements.toString(strNewLine, strIndent + g_strIndent);
+ strText += "}" + strNewLine;
+
+ return strText;
+ }
+
+};
+
+class CFunctionArray
+{
+ constructor()
+ {
+ this.m_arrayFunctions = [];
+ this.m_strKINDOF = "FUNCTION ARRAY";
+ }
+
+ add(strName, arrayParams, arrayStatements)
+ {
+ var Function = new CFunction()
+ Function.init(strName, arrayParams, arrayStatements);
+ this.add(Function);
+ }
+
+ getLength()
+ {
+ return this.m_arrayFunctions.length;
+ }
+
+ add(Function)
+ {
+ this.m_arrayFunctions.push(Function);
+ }
+
+ find(strName)
+ {
+ var Function = null;
+
+ for (let nI = 0; nI < this.m_arrayFunctions.length; nI++)
+ {
+ if (this.m_arrayFunctions[nI].getName() == strName)
+ {
+ Function = this.m_arrayFunctions[nI];
+ break;
+ }
+ }
+ return Function;
+ }
+
+ indexOf(strName)
+ {
+ var nIndex = -1;
+
+ for (let nI = 0; nI < this.m_arrayFunctions.length; nI++)
+ {
+ if (this.m_arrayFunctions[nI].getName() == strName)
+ {
+ nIndex = nI;
+ break;
+ }
+ }
+ return nIndex;
+ }
+
+ getNameAt(nI)
+ {
+ var strName = "";
+
+ if ((nI >= 0) && (nI < this.m_arrayFunctions.length))
+ strName = this.m_arrayFunctions[nI].getName();
+
+ return strName;
+ }
+
+ isEmpty()
+ {
+ return this.m_arrayFunctions.length == 0;
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strText = "";
+
+ for (let nI = 0; nI < this.m_arrayFunctions.length; nI++)
+ strText += this.m_arrayFunctions[nI].toString(strNewLine, strIndent);
+
+ return strText;
+ }
+
+};
+
+g_arrayArduinoFunctions = ["Serial.print", "Serial.println", "Serial.begin", "digitalRead", "digitalWrite",
+ "analogRead", "analogWrite", "pinMode", "setup", "loop", "delay"];
+
+function isArduinoFunctionCall(strFuncName)
+{
+ var bResult = false;
+
+ for (let nI = 0; nI < g_arrayArduinoFunctions.length; nI++)
+ {
+ bResult = strFuncName == g_arrayArduinoFunctions[nI];
+ if (bResult)
+ break;
+ }
+ return bResult;
+}
+
+class CFunctionCall
+{
+ constructor()
+ {
+ this.m_strFuncName = "";
+ this.m_arrayParams = new CVariableArray();
+ this.m_strKINDOF = "FUNCTION CALL";
+ }
+
+ init(strFuncName)
+ {
+ //var Function = g_arrayFunctions.find(strFuncName);
+
+ if ((Function == null) && !isArduinoFunctionCall(strFuncName))
+ alert("ERROR: CFunctionCall:init, function '" + strFuncName + "' not found!");
+ else
+ this.m_strFuncName = strFuncName;
+ }
+
+ addParameter(Parameter)
+ {
+ this.m_arrayParams.add(Parameter);
+ }
+
+ setParameters(arrayParameters)
+ {
+ this.m_arrayParams = arrayParameters;
+ }
+
+ isEmpty()
+ {
+ return (this.m_strFunctionName == "") && (this.m_arrayParams.length == 0);
+ }
+
+ toString(strNewLine, strIndent)
+ {
+ var strFuncCall = "";
+
+ if (strNewLine == "")
+ {
+ strFuncCall = this.m_strFuncName + "(" + this.m_arrayParams.toString("") + ")";
+ }
+ else
+ {
+ strFuncCall = strIndent + this.m_strFuncName + "(" + this.m_arrayParams.toString("") + ");" + strNewLine;
+ }
+ return strFuncCall;
+ }
+
+ evaluate()
+ {
+ var ReturnValue = null;
+
+ if ((this.m_strFuncName == "Serial.print") || (this.m_strFuncName == "Serial.println"))
+ {
+ if (this.m_arrayParams.getLength() == 1)
+ {
+ if (this.m_arrayParams.getType(0) == "char")
+ g_SerialMonitor.printText("" + this.m_arrayParams.evaluate(0));
+ else if ((this.m_arrayParams.getType(0) == "String") || (this.m_arrayParams.getType(0) == "string"))
+ g_SerialMonitor.printText(this.m_arrayParams.evaluate(0));
+ else if (this.m_arrayParams.getType(0) == "int")
+ g_SerialMonitor.printInt(this.m_arrayParams.evaluate(0), "DEC");
+ }
+ else if (this.m_arrayParams.getLength() == 2)
+ {
+ if (this.m_arrayParams.getType(0) == "int")
+ g_SerialMonitor.printInt(this.m_arrayParams.evaluate(0), this.m_arrayParams.evaluate(1));
+ }
+ if (this.m_strFuncName == "Serial.println")
+ g_SerialMonitor.printlnText("");
+ }
+ else if (this.m_strFuncName == "Serial.begin")
+ {
+ g_SerialMonitor.begin(this.m_arrayParams.evaluate(0));
+ }
+ else if (this.m_strFuncName == "digitalRead")
+ {
+ if (g_mapPlacedComponents.get(g_strMCUName))
+ ReturnValue = g_mapPlacedComponents.get(g_strMCUName).digitalRead(this.m_arrayParams.evaluate(0));
+ }
+ else if (this.m_strFuncName == "digitalWrite")
+ {
+ if (g_mapPlacedComponents.get(g_strMCUName))
+ g_mapPlacedComponents.get(g_strMCUName).digitalWrite(this.m_arrayParams.evaluate(0), this.m_arrayParams.evaluate(1));
+ }
+ else if (this.m_strFuncName == "analogRead")
+ {
+ if (g_mapPlacedComponents.get(g_strMCUName))
+ ReturnValue = g_mapPlacedComponents.get(g_strMCUName).analogRead(this.m_arrayParams.evaluate(0));
+ }
+ else if (this.m_strFuncName == "analogWrite")
+ {
+ if (g_mapPlacedComponents.get(g_strMCUName))
+ g_mapPlacedComponents.get(g_strMCUName).analogWrite(this.m_arrayParams.evaluate(0), this.m_arrayParams.evaluate(1));
+ }
+ else if (this.m_strFuncName == "pinMode")
+ {
+ if (g_mapPlacedComponents.get(g_strMCUName))
+ g_mapPlacedComponents.get(g_strMCUName).pinMode(this.m_arrayParams.evaluate(0), this.m_arrayParams.evaluate(1));
+ }
+ else if (this.m_strFuncName == "delay")
+ {
+ if (g_Delay.isExpired())
+ g_Delay.set(parseInt(this.m_arrayParams.evaluate(0)));
+ }
+ return ReturnValue;
+ }
+
+};
+
+
diff --git a/ardublockly/CodeFormatting.js b/ardublockly/CodeFormatting.js
new file mode 100644
index 0000000000..1d028fcb0c
--- /dev/null
+++ b/ardublockly/CodeFormatting.js
@@ -0,0 +1,177 @@
+//*************************************************************************
+//*
+//* CODE FORMATTING FUNCTIONS
+//*
+//*************************************************************************
+
+function doProcessGetData(strNewLine, strSpace)
+{
+ var strGetData = window.location.search;
+ var arrayASCII = [["%21", "!"], ["%22", "\""], ["%23", "#"], ["%24", "$"], ["%25", "%"], ["%26", "&"], ["%27", "'"], ["%28", "("],
+ ["%29", ")"], ["%2A", "*"], ["%2B", "+"], ["%2C", ","], ["%2D", "-"], ["%2E", "."], ["%2F", "/"], ["%3A", ":"],
+ ["%3B", ";"], ["%3C", "<"], ["%3D", "="], ["%3E", ">"], ["%3F", "?"], ["%40", "@"], ["%5B", "["], ["%5C", "\\"],
+ ["%5D", "]"], ["%5E", "^"], ["%5F", "_"], ["%60", "`"], ["%7B", "{"], ["%7C", "|"], [ "%7D", "}"], ["%7E", "~"]];
+
+ strGetData = strGetData.substring(1);
+
+ // void+setup%28%29%0D%0A%7B%0D%0A%7D%0D%0A%0D%0A%0D%0Avoid+loop%28%29%0D%0A%7B%0D%0A++if+%28false%29%0D%0A++%7B%0D%0A++%7D%0D%0A%7D
+ while (strGetData.includes("%0D%0A"))
+ strGetData = strGetData.replace("%0D%0A", strNewLine);
+
+ while (strGetData.includes("+"))
+ strGetData = strGetData.replace("+", strSpace);
+
+ for (let nI = 0; nI < arrayASCII.length; nI++)
+ {
+ while (strGetData.includes(arrayASCII[nI][0]))
+ strGetData = strGetData.replace(arrayASCII[nI][0], arrayASCII[nI][1]);
+ }
+ return strGetData;
+}
+
+function doGetCode(strGetData)
+{
+ var nIndexCode = strGetData.indexOf("Code"),
+ nIndexBoard = strGetData.indexOf("SelectedBoard");
+ var strCode = "";
+
+ if (nIndexBoard > nIndexCode)
+ strCode = strGetData.substring(nIndexCode + 5, nIndexBoard - 1);
+ else
+ strCode = strGetData.substring(nIndexCode + 5);
+
+ return strCode;
+}
+
+function doGetMCU(strGetData)
+{
+ var nIndexCode = strGetData.indexOf("Code"),
+ nIndexBoard = strGetData.indexOf("SelectedBoard");
+ var strBoard = "";
+
+ if (nIndexCode > nIndexBoard)
+ strBoard = strGetData.substring(nIndexBoard + 14, nIndexCode);
+ else
+ strBoard = strGetData.substring(nIndexBoard + 14);
+
+ return strBoard;
+}
+
+function doRemoveComments(strCode)
+{
+ var nI = 0, nJ = 0;
+
+ while (true)
+ {
+ if (strCode.includes("//"))
+ {
+ nI = strCode.indexOf("//");
+ nJ = strCode.indexOf("\n", nI) + 1;
+ nI--;
+
+ }
+ else if (strCode.includes("/*"))
+ {
+ nI = strCode.indexOf("/*");
+ nJ = strCode.indexOf("*/", nI) + 2;
+ nI--;
+ }
+ else
+ {
+ break;
+ }
+ if (nI == -1)
+ {
+ strCode = strCode.substring(nJ);
+ }
+ else
+ {
+ strCode = strCode.substring(0, nI) + strCode.substring(nJ);
+ }
+ }
+ return strCode;
+}
+
+function doRemoveNewLines(strCode)
+{
+ var strTempCode = "";
+
+ while (strCode.length > 0)
+ {
+ if ((strCode.charCodeAt(0) == 10) || (strCode.charCodeAt(0) == 13))
+ {
+ if (isAlphaNumeric(strTempCode.charCodeAt(strTempCode.length - 1)) && isAlphaNumeric(strCode.charCodeAt(1)))
+ {
+ strTempCode += " ";
+ strCode = strCode.substring(1);
+ }
+ else
+ {
+ strCode = strCode.substring(1);
+ }
+ }
+ else
+ {
+ strTempCode += strCode[0];
+ strCode = strCode.substring(1);
+ }
+ }
+ return strTempCode;
+}
+
+function doRemoveSpaces(strCode)
+{
+ var strCodeTemp = "";
+ var nI = 0;
+
+ while (nI < strCode.length)
+ {
+ if (strCode[nI] != ' ')
+ {
+ strCodeTemp += strCode[nI];
+ nI++;
+ }
+ else if (isAlphaNumeric(strCodeTemp.charCodeAt(strCodeTemp.length - 1)) && isAlphaNumeric(strCode.charCodeAt(nI + 1)))
+ {
+ strCodeTemp += strCode[nI];
+ nI++;
+ }
+ else
+ nI++;
+ }
+ return strCodeTemp;
+}
+
+var g_strGetData = doProcessGetData("\n", " ");
+var g_strRawCode = doGetCode(g_strGetData);
+var g_strNoComments = doRemoveComments(g_strRawCode);
+var g_strNoNewLines = doRemoveNewLines(g_strNoComments);
+var g_strNoSpaces = doRemoveSpaces(g_strNoNewLines);
+g_strCode = g_strNoSpaces;
+var g_strSelectedMCUType = doGetMCU(g_strGetData);
+
+/*
+alert("\n\n============================================\n\nCODE\n\n" + g_strCode +
+ "\n\n============================================\n\nMCU\n\n" + g_strSelectedMCUType + "\n\n");
+*/
+g_strCode = "bool bState=true;" +
+ "int nVal=0;" +
+ "void setup(){" +
+ "Serial.begin(9600);" +
+ "Serial.println(\"In setup()...\");" +
+ "pinMode(10,OUTPUT);" +
+ "pinMode(11,INPUT);" +
+ "}" +
+ "void loop(){" +
+ "Serial.println(\"In loop()...\");" +
+ "digitalWrite(10,bState);" +
+ "bState=!bState;" +
+ "nVal=digitalRead(11);" +
+ //"delay(1000);" +
+ "}";
+g_strSelectedMCUType = "Mega";
+
+g_strSelectedMCUType = g_strSelectedMCUType.toUpperCase();
+doParse(g_strCode);
+
+
diff --git a/ardublockly/CodeParsing.js b/ardublockly/CodeParsing.js
new file mode 100644
index 0000000000..e468a6261e
--- /dev/null
+++ b/ardublockly/CodeParsing.js
@@ -0,0 +1,1184 @@
+//*************************************************************************
+//*
+//* CODE PARSING FUNCTIONS
+//*
+//*************************************************************************
+
+function doInfiniteLoopErrorMessage(strFunctionName, strCode, strLastCode)
+{
+ alert("INIFINITE LOOP: function '" + strFunctionName + "'\n\n" + strCode + "\n\n" + strLastCode);
+ console.log("INIFINITE LOOP: function '" + strFunctionName + "'\n\n" + strCode + "\n\n" + strLastCode);
+ return strCode;
+}
+
+function doErrorMessage(strMsg)
+{
+ alert("ERROR: " + strMsg + "\n\n" + g_strCode);
+ console.log("ERROR: " + strMsg + "\n\n" + g_strCode);
+ //throw new Error("ERROR: " + strMsg);
+}
+
+function doExpectingErrorMessage(strFuncName, stExpected, strFound)
+{
+ var strErrorMsg = strFuncName + ", expecting '" + stExpected + "' but found '" + strFound + "'!";
+
+ doErrorMessage(strErrorMsg);
+}
+
+function doExpectingForErrorMessage(strFuncName, stExpected, strFound, strForFuncName)
+{
+ var strErrorMsg = strFuncName + ", expecting '" + stExpected + "' but found '" + strFound + "' for function '" + strForFuncName + "!";
+
+ doErrorMessage(strErrorMsg);
+}
+
+function doUnexpectedErrorMessage(strFuncName, strSymbol)
+{
+ var strErrorMsg = strFuncName + ", unexpected symbol '" + strSymbol + "' for function '" + strForFuncName + "!";
+
+ doErrorMessage(strErrorMsg);
+}
+
+function isAlpha(nCharCode)
+{
+ return ((nCharCode >= 97/* a */) && (nCharCode <= 122/* z */)) || ((nCharCode >= 65/* A */) && (nCharCode <= 90/* Z */)) || (nCharCode == 95/* _ */);
+}
+
+function isAlphaNumeric(nCharCode)
+{
+ return isAlpha(nCharCode) || ((nCharCode >= 48/* 0 */) && (nCharCode <= 57/* 9 */));
+}
+
+function isQuote(nCharCode)
+{
+ return (nCharCode == 34/* " */) || (nCharCode == 39/* ' */);
+}
+
+function isNumeric(nCharCode)
+{
+ return ((nCharCode >= 97/* a */) && (nCharCode <= 'f')) || ((nCharCode >= 65/* A */) && (nCharCode <= 'F')) || ((nCharCode >= 48/* 0 */) && (nCharCode <= 57/* 9 */));
+}
+
+function isOperator(nCharCode)
+{
+ return (nCharCode == 43/* + */) || (nCharCode == 45/* - */) || (nCharCode == 42/* * */) || (nCharCode == 47/* / */) || (nCharCode == 38/* & */) ||
+ (nCharCode == 124/* | */) || (nCharCode == 61/* = */) || (nCharCode == 62/* > */) || (nCharCode == 60/* < */) || (nCharCode == 37/* % */) ||
+ (nCharCode == 33/* ! */);
+}
+
+function doGetNextToken(strExpecting)
+{
+ var strIdentifier = "", strTemp = "", strOrigCode = g_strCode;
+
+ if ((g_strCode[0] == "\"") || (g_strCode[0] == "'"))
+ {
+ strIdentifier = g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+
+ while ((g_strCode.charCodeAt(0) != 34/* " */) && (g_strCode.charCodeAt(0) != 39/* ' */))
+ {
+ strIdentifier += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ strIdentifier += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ else
+ {
+ while (isAlphaNumeric(g_strCode.charCodeAt(0)) || (g_strCode.charCodeAt(0) == 46/* . */))
+ {
+ strIdentifier += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ g_strCode = g_strCode.trim();
+ if (strIdentifier == "else")
+ {
+ strTemp = g_strCode.substring(0, 2);
+ if (strTemp == "if")
+ {
+ strIdentifier += " " + strTemp;
+ g_strCode = g_strCode.substring(2);
+ }
+ }
+ g_strCode = g_strCode.trim();
+
+ if ((strExpecting != null) && !strIdentifier.includes(strExpecting))
+ {
+ g_strCode = strOrigCode;
+ strIdentifier = "";
+ }
+ }
+ return strIdentifier;
+}
+
+function doGetNextStringOrChar()
+{
+ var strValue = "";
+
+ while (isAlphaNumeric(g_strCode.charCodeAt(0)) || isQuote(g_strCode.charCodeAt(0)))
+ {
+ strValue += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ g_strCode = g_strCode.trim();
+ return strValue;
+}
+
+function doGetNextValue(bFloat)
+{
+ var strIdentifier = "";
+
+ while (isAlphaNumeric(g_strCode.charCodeAt(0)) || (bFloat && (g_strCode.charCodeAt(0) == 46/* . */)))
+ {
+ strIdentifier += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ g_strCode = g_strCode.trim();
+
+ return strIdentifier;
+}
+
+function doGetNextSymbol(strExpecting)
+{
+ var strSymbol = "";
+ var strOrigCode = g_strCode;
+
+ g_strCode = g_strCode.trim();
+ if (!isAlphaNumeric(g_strCode.charCodeAt(0)))
+ {
+ strSymbol = g_strCode[0]
+ g_strCode = g_strCode.substring(1);
+ g_strCode = g_strCode.trim();
+
+ if ((strSymbol == "!") || (strSymbol == ";") || (strSymbol == "(") || (strSymbol == ")") || (strSymbol == "{") || (strSymbol == "}") ||
+ (strSymbol == "[") || (strSymbol == "]") || (strSymbol == "?") || (strSymbol == ".") || (strSymbol == ",") || (strSymbol == ":"))
+ {
+ // Do nothing
+ }
+ else if (strSymbol == "+")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 43/* + */))
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "-")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 45/* - */))
+ strSymbol += g_strCode[0];
+
+ }
+ else if (strSymbol == "*")
+ {
+ if (g_strCode.charCodeAt(0) == 61/* = */)
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "/")
+ {
+ if (g_strCode.charCodeAt(0) == 61/* = */)
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "|")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 124/* | */))
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "&")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 38/* & */))
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "=")
+ {
+ if (g_strCode.charCodeAt(0) == 61/* = */)
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == ">")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 62/* > */))
+ strSymbol += g_strCode[0];
+ }
+ else if (strSymbol == "<")
+ {
+ if ((g_strCode.charCodeAt(0) == 61/* = */) || (g_strCode.charCodeAt(0) == 60/* < */))
+ strSymbol += g_strCode[0];
+ }
+ else
+ {
+ alert("ERROR: doGetNextSymbol, unexpected symbol '" + g_strCode[0] + "'!\n\n\n" + g_strCode);
+ }
+ if (strSymbol.length == 2)
+ {
+ g_strCode = g_strCode.substring(1);
+ g_strCode = g_strCode.trim();
+ }
+ }
+ if ((strExpecting != null) && (strSymbol != strExpecting))
+ {
+ g_strCode = strOrigCode;
+ strSymbol = "";
+ }
+ return strSymbol;
+}
+
+function doParseCases()
+{
+ var strToken = doGetNextToken("case"), strSymbol = "", strLastCode = g_strCode;
+ var arrayCases = new CCaseArray();
+ var Expression = null;
+ var Case = null;
+ var arrayStatements = [];
+
+ while (strToken == "case")
+ {
+ //g_strCode = "(" + g_strCode;
+ //g_strCode = g_strCode.replace(":", "):");
+ Expression = doParseExpression();
+ strSymbol = doGetNextSymbol(":");
+ if (strSymbol == ":")
+ {
+ Case = new CSwitchCase();
+ arrayStatements = doParseStatements();
+ Case.init(Expression, arrayStatements);
+ arrayCases.add(Case);
+ }
+ else
+ {
+ doExpectionErrorMessage("doParseCases", ":", strSymbol);
+ }
+ strToken = doGetNextToken("case");
+
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseFunctionCallParams", g_strCode, strLastCode);
+ }
+ return arrayCases;
+}
+
+function doParseSwitch()
+{
+ var SwitchStatement = new CSwitchStatement();
+ var Expression = doParseExpression();
+ var strSymbol = doGetNextSymbol("{"), strToken = "";
+ var arrayCases = [];
+ var arrayDefaultStatements = [];
+
+ SwitchStatement.setExpression(Expression);
+
+ if (strSymbol == "{")
+ {
+ arrayCases = doParseCases();
+ SwitchStatement.setCases(arrayCases);
+ strToken = doGetNextToken();
+ if (strToken == "default")
+ {
+ strOperator = doGetNextSymbol(":");
+ arrayDefaultStatements = doParseStatements();
+ SwitchStatement.setDefault(arrayDefaultStatements);
+ }
+ strSymbol = doGetNextSymbol();
+ if (strSymbol != "}")
+ doExpectingErrorMessage("doParseSwitch", "}", strSymbol);
+ }
+ else
+ {
+ doExpectingErrorMessage("doParseSwitch", "{", g_strCode[0]);
+ }
+ return SwitchStatement;
+}
+
+function doParseIf()
+{
+ var Expression = doParseExpression();
+ var arrayStatements = doParseStatements();
+ var IfStatement = new CIfStatement(), IfStatementPrev = null;
+ var strToken = "";
+ var arrayIfStack = [];
+
+ IfStatement.init(Expression, arrayStatements);
+ arrayIfStack.push(IfStatement);
+
+ do
+ {
+ strToken = doGetNextToken("else");
+
+ if (strToken == "else if")
+ {
+ IfStatement = new CIfStatement();
+ Expression = doParseExpression();
+ arrayStatements = doParseStatements();
+ IfStatement.init(Expression, arrayStatements);
+ IfStatement.setKindOf("ELSE IF");
+ arrayIfStack.push(IfStatement);
+ }
+ else if (strToken == "else")
+ {
+ IfStatement = new CIfStatement();
+ arrayStatements = doParseStatements();
+ IfStatement.init(null, arrayStatements);
+ IfStatement.setKindOf("ELSE");
+ arrayIfStack.push(IfStatement);
+ }
+ else
+ break;
+ }
+ while ((strToken == "else if") || (strToken == "else"));
+
+ while (arrayIfStack.length > 0)
+ {
+ IfStatement = arrayIfStack.pop();
+ IfStatementPrev = arrayIfStack.pop();
+ if (IfStatementPrev != null)
+ {
+ IfStatementPrev.setNext(IfStatement);
+ arrayIfStack.push(IfStatementPrev);
+ }
+ }
+ return IfStatement;
+}
+
+function doParseWhile()
+{
+ var Expression = doParseExpression();
+ var arrayStatements = []
+ var WhileStatement = new CWhileStatement();
+
+ if (g_strCode.charCodeAt(0) == 123) // {
+ {
+ arrayStatements = doParseStatements();
+ }
+ else
+ {
+ arrayStatements.push(doParseStatement());
+ doGetNextSymbol(); // Consume the terminating ;
+ }
+ WhileStatement.init(Expression, arrayStatements);
+
+ return WhileStatement;
+}
+
+function doParseRepeat()
+{
+ var RepeatStatement = new CRepeatStatement();
+ var arrayStatements = doParseStatements();
+ var strUntil = doGetNextToken();
+ var Expression = null;
+
+ if (strUntil == "until")
+ {
+ Expression = doParseExpression();
+ RepeatStatement.init(Expression, arrayStatements);
+ doGetNextSymbol(); // Consume the terminating ; or }
+ }
+ else
+ {
+ alert("ERROR: doParseRepeat, 'until' expected but found '" + strUntil + "'!");
+ }
+ return RepeatStatement;
+}
+
+function doParseFor()
+{
+ // break
+}
+
+function getInitValue(strType)
+{
+ var strValue = "";
+
+ if (strType == "String")
+ strValue = "";
+ else if (strType == 'float')
+ strValue = "0.0";
+ else if ((strType == "boolean") || (strType == "bool"))
+ strValue = "false";
+ else
+ strValue = "0";
+
+ return strValue;
+}
+
+function doParseFunctionParams(strFuncName)
+{
+ var arrayParams = new CVariableArray();
+ var Variable = new CVariable();
+ var strType = "", strName = "", strLastCode = g_strCode, strSymbol = doGetNextSymbol("(");
+
+ if (strSymbol == "(")
+ {
+ do
+ {
+ strType = doGetNextToken();
+ strName = doGetNextToken();
+
+ if ((strType != "") && (strName != ""))
+ {
+ Variable.init(strName, strType, getInitValue(strType));
+ arrayParams.add(Variable);
+
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseFunctionParams", g_strCode, strLastCode);
+ }
+ }
+ while ((strType != "") && (strName != ""));
+
+ strSymbol = doGetNextSymbol(); // Consume the closing )
+ }
+ else
+ doExpectingForErrorMessage("doParseFunctionParams", "(", strSymbol, strFuncName);
+
+ return arrayParams;
+}
+
+function doGetArduinoFunctionParamType(strFuncName, nParamNum)
+{
+ var strType = "";
+
+ if (strFuncName == "Serial.begin")
+ {
+ if (nParamNum == 0)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else if ((strFuncName == "Serial.print") || (strFuncName == "Serial.println"))
+ {
+ if (nParamNum == 0)
+ strType = "void";
+ else if (nParamNum == 1)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else if ((strFuncName == "digitalWrite") || (strFuncName == "analogWrite"))
+ {
+ if (nParamNum == 0)
+ strType = "int";
+ else if (nParamNum == 1)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else if ((strFuncName == "digitalRead") || (strFuncName == "analogRead"))
+ {
+ if (nParamNum == 0)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else if (strFuncName == "delay")
+ {
+ if (nParamNum == 0)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else if (strFuncName == "pinMode")
+ {
+ if (nParamNum == 0)
+ strType = "int";
+ else if (nParamNum == 1)
+ strType = "int";
+ else
+ doErrorMessage("doGetArduinoFunctionParamType, parameter '" + nParamNum + "' not expected for function '" + strFuncName + "'!");
+ }
+ else
+ {
+ doErrorMessage("doGetArduinoFunctionParamType, no type available for function '" + strFuncName + "', parameter " + nParamNum + "!");
+ }
+ return strType;
+}
+
+function doGetFunctionCallParamType(strFunctionName, nParamNum)
+{
+ var Function = g_arrayFunctions.find(strFunctionName);
+ var Param = null;
+ var strType = "";
+
+ if (Function != null)
+ {
+ Param = Function.getParam(nParamNum);
+ if (Param != null)
+ {
+ strType = Param.getType();
+ }
+ else
+ {
+ doErrorMessage("doGetFunctionCallParamType, function '" + strFunctionName + "' does not have " + nParamNum + " parameters!");
+ }
+ }
+ else if (isArduinoFunctionCall(strFunctionName))
+ {
+ strType = doGetArduinoFunctionParamType(strFunctionName, nParamNum);
+ }
+ else
+ {
+ doErrorMessage("doGetFunctionCallParamType, function '" + strFunctionName + "' was not found!");
+ }
+ return strType;
+}
+
+function doParseFunctionCallParams(strFuncName)
+{
+ var arrayParams = new CVariableArray();
+ var Variable = new CVariable();
+ var strType = "", strName = "", strLastCode = g_strCode, strSymbol = doGetNextSymbol("(");
+ var nParamNum = 0;
+
+ if (strSymbol == "(")
+ {
+ do
+ {
+ strName = doGetNextToken();
+
+ if (strName != "")
+ {
+ strType = doGetFunctionCallParamType(strFuncName, nParamNum);
+ Variable.init(strName, strType, getInitValue(strType));
+ arrayParams.add(Variable);
+
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseFunctionCallParams", g_strCode, strLastCode);
+
+ nParamNum++;
+ }
+ }
+ while (strName != "");
+
+ doGetNextSymbol(); // Consume the closing )
+ }
+ else
+ doExpectingForErrorMessage("doParseFunctionCallParams", "(", strSymbol, strFuncName);
+
+ return arrayParams;
+}
+
+function isGlobalVariable(strName)
+{
+ return g_arrayGlobalVariables.indexOf(strName) > -1;
+}
+
+function isFunctionCall(strName)
+{
+ return isArduinoFunctionCall(strName) || (g_arrayFunctions.indexOf(strName) > -1);
+}
+
+function isArduinoConst(strName)
+{
+ return (strName == "HIGH") || (strName == "LOW") || (strName == "DEC") || (strName == "HEX") || (strName == "BIN");
+}
+
+function isString(strToken)
+{
+ return strToken.includes("\"");
+}
+
+function isCharacter(strToken)
+{
+ return strToken.includes("\'");
+}
+
+function isNumber(strToken)
+{
+ var Number = null;
+
+ if (strToken.includes("."))
+ Number = parseFloat(strToken);
+ else
+ Number = parseInt(strToken);
+
+ return !isNaN(Number);
+}
+
+function getLiteralType(strLiteral)
+{
+ var strType = "";
+
+ if (strLiteral.includes("\""))
+ strType = "String";
+ else if (strLiteral.includes("'"))
+ strType = "char";
+ else if (strLiteral.includes("."))
+ strType = "float";
+ else if (strLiteral.includes("true") || strLiteral.includes("false"))
+ strType = "boolean";
+ else
+ strType = "int";
+
+ return strType;
+}
+
+function doParseArduinoFunctionCall(strFuncName)
+{
+ var FuncCall = new CFunctionCall();
+ var Variable = new CVariable();
+ var nParamNum = 0;
+ var strType = "", strVal = "", strLastCode = g_strCode, strSymbol = doGetNextSymbol();
+ var GlobalVar = null;
+
+ FuncCall.init(strFuncName);
+
+ if (strSymbol == "(")
+ {
+ do
+ {
+ strParam = doGetNextToken();
+ if (strParam != "")
+ {
+ GlobalVar = g_arrayGlobalVariables.find(strParam);
+
+ if (GlobalVar != null)
+ {
+ if (GlobalVar != null)
+ {
+ Variable = new CVariable();
+ Variable.init(GlobalVar.getName(), GlobalVar.getType(), GlobalVar.getValue());
+ }
+ else
+ doErrorMessage("doParseArduinoFunctionCall, cannot find global variable '" + strParam + ",!");
+ }
+ else if (isArduinoConst(strParam))
+ {
+ strType = doGetArduinoFunctionParamType(strFuncName, nParamNum);
+ strVal = strParam;
+ Variable = new CVariable();
+ Variable.init("strParam" + nParamNum.toString(), strType, strVal);
+ }
+ else // Must be a literal value
+ {
+ strType = getLiteralType(strParam);
+ Variable = new CLiteral();
+ Variable.init(strType, strParam);
+ }
+ FuncCall.addParameter(Variable);
+ if (g_strCode[0] == ',')
+ g_strCode = g_strCode.substring(1);
+
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseArduinoFunctionCall", g_strCode, strLastCode);
+ }
+ }
+ while (strParam != "");
+
+ strSymbol = doGetNextSymbol(")"); // Consume the closing )
+ strSymbol = doGetNextSymbol(";"); // Consume any terminating ;
+ }
+ else
+ doExpectingForErrorMessage("doParseArduinoFunctionCall", "(", g_strCode[0], strFuncName);
+
+ return FuncCall;
+}
+
+function doParseFunctionCall(strFuncName)
+{
+ var FuncCall = new CFunctionCall();
+ var arrayParams = new CVariableArray();
+ var nI = 0;
+ var Function = g_arrayFunctions.find(strFuncName);
+ var Variable = null;
+ var Literal = new CLiteral();
+ var strLastCode = g_strCode;
+
+ FuncCall.init(strFuncName);
+
+ if (g_strCode.charCodeAt(0) == 40/*(*/)
+ {
+ g_strCode = g_strCode.substring(1); // Consume the (
+
+ while (g_strCode.charCodeAt(0) != 41/*)*/)
+ {
+ strParam = doGetNextToken();
+ Variable = g_arrayGlobalVariables.find(strParam);
+
+ if (Variable != null)
+ FuncCall.addParam(Variable);
+ else
+ {
+ Variable = Function.findParam(nI);
+ if (Variable != null)
+ Literal.init(Variable.getType(), strParam);
+ else
+ doErrorMessage("doParseFunctionCall, parameter '" + nI + "' for function '" + strFuncName + "' is null!");
+ }
+ if (g_strCode[0] == ',')
+ g_strCode = g_strCode.substring(1);
+ nI++
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseFunctionCall", g_strCode, strLastCode);
+ }
+ }
+ else
+ doExpectingForErrorMessage("doParseFunctionCall", "(", g_strCode[0], strFuncName);
+
+ doGetNextSymbol(); // Consume the terminating ;
+
+ return FuncCall;
+}
+
+function doGetExpressionArg()
+{
+ var strToken = "", strOperator = "";
+ var Arg = null;
+ var arrayParams = null;
+
+ if (g_strCode.length > 0)
+ {
+ if (g_strCode.charCodeAt(0) == 33/*!*/)
+ strOperator = doGetNextSymbol();
+
+ if (isQuote(g_strCode.charCodeAt(0)))
+ strToken = doGetNextStringOrChar();
+ else
+ strToken = doGetNextToken();
+
+ if (isArduinoConst(strToken))
+ {
+ Arg = new CLiteral();
+ Arg.init(getLiteralType(strToken), strToken);
+ }
+ else if (isNumber(strToken))
+ {
+ Arg = new CLiteral()
+ Arg.init("int", strToken);
+ }
+ else if (isString(strToken))
+ {
+ Arg = new CLiteral()
+ Arg.init("string", strToken);
+ }
+ else if (isCharacter(strToken))
+ {
+ Arg = new CLiteral()
+ Arg.init("char", strToken);
+ }
+ else if (isGlobalVariable(strToken))
+ {
+ Arg = g_arrayGlobalVariables.find(strToken);
+ }
+ else if (isArduinoFunctionCall(strToken) || isFunctionCall(strToken))
+ {
+ Arg = new CFunctionCall();
+ Arg.init(strToken);
+ arrayParams = doParseFunctionCallParams(strToken);
+ Arg.setParameters(arrayParams);
+ }
+ else
+ {
+ doErrorMessage("doGetExpressionArg, unknown token '" + strToken + "'!\n\n\n" + g_strCode);
+ }
+ if (strOperator == "!")
+ {
+ var Expression = new CExpression();
+ Expression.init(null, Arg, strOperator);
+ Arg = Expression;
+ }
+ }
+ return Arg;
+}
+
+function doGetExpression()
+{
+ var nI = 0;
+ var strExpression = "";
+
+ while ((g_strCode.charCodeAt(nI) == 40/* ( */) || (g_strCode.charCodeAt(nI) == 41/* ) */)|| (g_strCode.charCodeAt(nI) == 46/* . */) ||
+ (g_strCode.charCodeAt(nI) == 33/* ! */) || (g_strCode.charCodeAt(nI) == 39/* ' */) || (g_strCode.charCodeAt(nI) == 34/* " */) ||
+ isAlphaNumeric(g_strCode.charCodeAt(nI)) || isOperator(g_strCode.charCodeAt(nI)))
+ {
+ if ((g_strCode.charCodeAt(nI - 1) == 41/* ) */) && isAlphaNumeric(g_strCode.charCodeAt(nI)))
+ {
+ break;
+ }
+ nI++;
+ }
+ strExpression = g_strCode.substring(0, nI);
+
+ if (g_strCode.charCodeAt(0) == 41/*)*/)
+ {
+ strExpression += g_strCode[0];
+ g_strCode = g_strCode.substring(1);
+ }
+ return strExpression;
+}
+
+function doAssertNotNull(Value, nLineNumber, strFuncName, strVarName)
+{
+ if (Value === null)
+ doErrorMessage(strFuncName + ", line " + nLineNum + ", '" + strVarName + "' cannot be null!\n\n\n" + g_strCode);
+}
+
+function doAssertNotEmpty(strValue, nLineNumber, strFuncName, strVarName)
+{
+ if (strValue.length == 0)
+ doErrorMessage(strFuncName + ", line " + nLineNum + ", '" + strVarName + "' cannot be empty!\n\n\n" + g_strCode);
+}
+
+function doParseExpression()
+{
+ var Expression = null, Arg = null;
+ var strOperator = "", strExpression = "", strOrigCode = "", strLastCode = "";
+ var arrayExpressionStack = [];
+ var nState = 0, nNone = 0, nArg1 = 1, nArg2 = 2, nOperator = 3;
+
+ strExpression = doGetExpression();
+ g_strCode = g_strCode.substring(strExpression.length);
+
+ // All because javascript does not allow you to return values through function parameters
+ strOrigCode = g_strCode;
+ g_strCode = strExpression;
+ strLastCode = g_strCode;
+ Expression = null;
+
+ while (g_strCode.length > 0)
+ {
+
+ if (g_strCode.charCodeAt(0) == 40) // (
+ {
+ doGetNextSymbol(); // Consume the open (
+ arrayExpressionStack.push(new CExpression());
+ }
+ else if (isAlphaNumeric(g_strCode.charCodeAt(0)) || isQuote(g_strCode.charCodeAt(0)))
+ {
+ Arg = doGetExpressionArg();
+ doAssertNotNull(Arg, 702, "doParseExpression", "Arg");
+ Expression = arrayExpressionStack.pop();
+ if (Expression == null)
+ Expression = new CExpression();
+
+ if (Expression.isEmpty())
+ {
+ nState = nArg1;
+ Expression.setArg1(Arg);
+ }
+ else
+ {
+ nState = nArg2;
+ Expression.setArg2(Arg);
+ }
+ arrayExpressionStack.push(Expression);
+ }
+ else if (((g_strCode.charCodeAt(0) == 45 /* - */) || (g_strCode.charCodeAt(0) == 43 /* + */)) && ((nState == nNone) || (nState == nOperator)))
+ {
+ // E.G. -nSensorValue
+ // E.G. X > -nSensorValue
+ strOperator = doGetNextSymbol();
+ Expression = new CExpression();
+ Arg = doGetExpressionArg();
+ Expression.init(null, Arg, strOperator);
+ Arg = Expression;
+ Expression = arrayExpressionStack.pop();
+ if (Expression== null)
+ Expression = new CExpression();
+ if (Expression.isEmpty())
+ Expression.setArg1(Arg);
+ else
+ Expression.setArg2(Arg);
+ arrayExpressionStack.push(Expression);
+ }
+ else if (g_strCode.charCodeAt(0) == 33 /* ! */)
+ {
+ strOperator = doGetNextSymbol();
+ doAssertNotEmpty(strOperator, 718, "doParseExpression", "strOperator");
+ Arg = doGetExpressionArg();
+ Expression = new CExpression();
+ Expression.setArg2(Arg);
+ Expression.setOperator("!");
+ Arg = Expression;
+
+ Expression = arrayExpressionStack.pop();
+ if (Expression == null)
+ Expression = new CExpression();
+
+ if (Expression.isEmpty())
+ Expression.setArg1(Arg);
+ else
+ Expression.setArg2(Arg);
+ arrayExpressionStack.push(Expression);
+ }
+ else if (isOperator(g_strCode.charCodeAt(0)))
+ {
+ strOperator = doGetNextSymbol();
+ doAssertNotEmpty(strOperator, 718, "doParseExpression", "strOperator");
+
+ Expression = arrayExpressionStack.pop();
+ doAssertNotNull(Expression, 721, "doParseExpression", "Expression");
+
+ if (!Expression.isComplete())
+ {
+ Expression.setOperator(strOperator);
+ arrayExpressionStack.push(Expression);
+ }
+ else
+ {
+ Arg = Expression;
+ Expression = new CExpression();
+ Expression.setArg1(Arg);
+ Expression.setOperator(strOperator);
+ arrayExpressionStack.push(Expression);
+ }
+ nState = nOperator;
+ }
+ else if (g_strCode.charCodeAt(0) == 41) // )
+ {
+ doGetNextSymbol(); // Consume the closing )
+
+ Arg = arrayExpressionStack.pop();
+ doAssertNotNull(Arg, 732, "doParseExpression", "Arg");
+ Expression = arrayExpressionStack.pop();
+ if (Expression == null)
+ Expression = Arg;
+ else
+ {
+ if (Expression.isEmpty())
+ Expression.setArg1(Arg);
+ else
+ Expression.setArg2(Arg);
+ }
+ arrayExpressionStack.push(Expression);
+ }
+ else
+ {
+ doUnexpectedErrorMessage("doParseExpression", g_strCode[0])
+ }
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseExpression", g_strCode, strLastCode);
+ }
+ Expression = arrayExpressionStack.pop();
+
+ // All because javascript does not allow you to return values through function parameters
+ g_strCode = strOrigCode;
+
+ return Expression;
+}
+
+function doParseVariableStatement(strVarName)
+{
+ var Statement = new CVariableStatement();
+ var strOperator = doGetNextSymbol();
+ var Expression = new CExpression();
+ var Const1 = new CLiteral();
+
+ if (strOperator == "--")
+ {
+ Const1.init("int", 1);
+ Expression.init(strVarName, Const1, "-");
+ strOperator = "=";
+ }
+ else if (strOperator == "++")
+ {
+ Const1.init("int", 1);
+ Expression.init(strVarName, Const1, "-");
+ strOperator = "=";
+ }
+ else
+ {
+ Expression = doParseExpression();
+ }
+ Statement.init(strVarName, strOperator, Expression);
+ strOperator = doGetNextSymbol(); // Consume the terminating ;
+
+ return Statement;
+}
+
+function doParseBreak()
+{
+ var Break = new CBreak();
+ var strSymbol = doGetNextSymbol(";");
+
+ if (strSymbol != ";")
+ doExpectingErrorMessage("doParseBreak", ";", strSymbol);
+
+ return Break;
+}
+
+function doParseStatement()
+{
+ var Statement = new CVariableStatement();
+ var strToken = doGetNextToken();
+ var arrayParams = null;
+
+ if (strToken == "Serial")
+ {
+ if (g_strCode.charCodeAt(0) == 46/*.*/)
+ {
+ strToken += g_strCode[0]
+ g_strCode = g_strCode.substring(1);
+ g_strCode = g_strCode.trim();
+ strToken += doGetNextToken();
+ }
+ else
+ doExpectingErrorMessage("doParseStatement", ".", g_strCode[0]);
+ }
+ if (strToken == "switch")
+ {
+ Statement = doParseSwitch();
+ }
+ else if (strToken == "if")
+ {
+ Statement = doParseIf();
+ }
+ else if (strToken == "while")
+ {
+ Statement = doParseWhile();
+ }
+ else if (strToken == "repeat")
+ {
+ Statement = doParseRepeat();
+ }
+ else if (strToken == "for")
+ {
+ Statement = doParseFor();
+ }
+ else if (strToken == "break")
+ {
+ Statement = doParseBreak();
+ }
+ else if (isArduinoFunctionCall(strToken))
+ {
+ Statement = doParseArduinoFunctionCall(strToken);
+ }
+ else if (isFunctionCall(strToken))
+ {
+ Statement = doParseFunctionCall(strToken);
+
+ }
+ else if (isGlobalVariable(strToken))
+ {
+ Statement = doParseVariableStatement(strToken);
+ }
+ else
+ {
+ doErrorMessage("doParseStatement, unknown identifier '" + g_strCode[0] + "'!\n\n\n" + g_strCode);
+ }
+ return Statement;
+}
+
+function doParseStatements()
+{
+ var arrayStatements = new CStatementArray();
+ var Statement = null;
+ var strSymbol = doGetNextSymbol("{"), strLastCode = g_strCode;
+
+ if (strSymbol == "{")
+ {
+ while (strSymbol != "}")
+ {
+ strSymbol = doGetNextSymbol("}");
+ if (strSymbol != "}")
+ {
+ Statement = doParseStatement();
+ arrayStatements.add(Statement);
+ }
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParseStatements", g_strCode, strLastCode);
+ }
+ }
+ else
+ {
+ Statement = doParseStatement();
+ arrayStatements.add(Statement);
+ doGetNextSymbol(); // Consume the closing ;
+ }
+ return arrayStatements;
+}
+
+function doParseFunction(strName, strReturnType)
+{
+ // E.G. char doSomething(char cParam, int nParam) { };
+ var Function = new CFunction();
+ var arrayParams = doParseFunctionParams(strName);
+ var arrayStatements = doParseStatements();
+
+ Function.init(strName, strReturnType, arrayParams, arrayStatements);
+
+ return Function;
+}
+
+function doParseVariable(strName, strType)
+{
+ var strSymbol = doGetNextSymbol();
+ var strValue = doGetNextValue(strType == "float");
+ var Variable = new CVariable();
+
+ strSymbol = doGetNextSymbol(); // Consume the semi colon
+ Variable.init(strName, strType, strValue);
+
+ return Variable;
+}
+
+function isFunction()
+{
+ // E.G. char doSomething(char cParam, int nParam) { };
+ var nI = 0;
+
+ while (isAlphaNumeric(g_strCode.charCodeAt(nI)))
+ {
+ nI++;
+ g_strCode = g_strCode.trim();
+ }
+ return g_strCode.charCodeAt(nI) == '(';
+}
+
+function doParse()
+{
+ var strIdentifier1 = "", strIdentifier2 = "", strLastCode = g_strCode;
+ var nI = 0;
+ var Variable = null, Function = null;
+
+ while (g_strCode.length > 0)
+ {
+ if (isAlphaNumeric(g_strCode.charCodeAt(0)))
+ {
+ strIdentifier1 = doGetNextToken();
+
+ if ((strIdentifier1 == 'char') || (strIdentifier1 == 'float') || (strIdentifier1 == 'int') || (strIdentifier1 == 'long') ||
+ (strIdentifier1 == 'byte') || (strIdentifier1 == 'uint8_t') || (strIdentifier1 == 'int8_t') || (strIdentifier1 == 'uint16_t') ||
+ (strIdentifier1 == 'int16_t') || (strIdentifier1 == 'uint32_t') || (strIdentifier1 == 'int32_t') || (strIdentifier1 == 'void') ||
+ (strIdentifier1 == 'bool') || (strIdentifier1 == 'boolean'))
+ {
+ strIdentifier2 = doGetNextToken();
+
+ if (strIdentifier2 == "setup")
+ g_SetupFunc = doParseFunction("setup", "void");
+ else if (strIdentifier2 == "loop")
+ g_LoopFunc = doParseFunction("loop", "void");
+ else if (isFunction())
+ {
+ Function = doParseFunction(strIdentifier2, strIdentifier1);
+ g_arrayFunctions.add(Function);
+ }
+ else
+ {
+ Variable = doParseVariable(strIdentifier2, strIdentifier1);
+ g_arrayGlobalVariables.add(Variable);
+ }
+ }
+ if (strLastCode == g_strCode)
+ strLastCode = doInfiniteLoopErrorMessage("doParse", g_strCode, strLastCode);
+ }
+
+ }
+}
+
+function doReproduceCode()
+{
+ var strText = "";
+
+ strText += g_arrayGlobalVariables.toString("
", "") + "
";
+ strText += g_arrayFunctions.toString("
", "") + "
";
+ strText += g_SetupFunc.toString("
", "") + "
";
+ strText += g_LoopFunc.toString("
", "") + "
";
+
+ return strText;
+}
+
+
+
+
+//*************************************************************************
+//*
+//* GLOBAL VARIBALES
+//*
+//*************************************************************************
+
+var g_arrayFunctions = new CFunctionArray();
+var g_SetupFunc = null, g_LoopFunc = null;
+var g_arrayGlobalVariables = new CVariableArray();
+
diff --git a/ardublockly/CommonComponentDataStructures.js b/ardublockly/CommonComponentDataStructures.js
new file mode 100644
index 0000000000..a50cac78bb
--- /dev/null
+++ b/ardublockly/CommonComponentDataStructures.js
@@ -0,0 +1,916 @@
+//*************************************************************************
+//*
+//* GLOBAL VARIBALES FOR COMPONENTS
+//*
+//*************************************************************************
+
+var g_mapPlacedComponents = new Map();
+var INPUT = "INPUT", INPUT_HIGH = "INPUT_HIGH", OUTPUT = "OUTPUT", HIGH = "HIGH", LOW = "LOW";
+var g_strErrorMessage = "ERROR: ";
+var g_BUILT_IN_LED = 13;
+var g_nMCUCount = 0;
+var g_strSelectedComponentName = "", g_strMCUName = "";
+
+function isArduinoConstant(strVal)
+{
+ return (strVal == INPUT) || (strVal == INPUT_HIGH) || (strVal == OUTPUT) || (strVal == HIGH) || (strVal == LOW) || (strVal == "true") || (strVal == "false");
+}
+
+function doCreateComponent(strComponentType)
+{
+ var strComponentName = doGetUniqueName(strComponentType);
+ var Component = null;
+
+ if (strComponentType == "UNO")
+ {
+ if (g_nMCUCount == 0)
+ {
+ Component = new CArduinoUno();
+ g_nMCUCount++;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + " only one MCU is permitted!");
+ }
+ else if (strComponentType == "MEGA")
+ {
+ if (g_nMCUCount == 0)
+ {
+ Component = new CArduinoMega();
+ g_nMCUCount++;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + " only one MCU is permitted!");
+ }
+ else if (strComponentType == "MICROBIT")
+ {
+ if (g_nMCUCount == 0)
+ {
+ Component = new CMicrobit();
+ g_nMCUCount++;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + " only one MCU is permitted!");
+ }
+ else if (strComponentType == "MICROBIT_BREAKOUT")
+ {
+ if (g_nMCUCount == 0)
+ {
+ Component = new CMicrobit(true);
+ g_nMCUCount++;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + " only one MCU is permitted!");
+ }
+ else if (strComponentType == "LED")
+ Component = new CLED();
+ else if (strComponentType == "RESISTOR")
+ Component = new CResistor();
+ else
+ alert(strComponentType);
+
+ // *******************************
+ // *******************************
+ // *******************************
+ // TO DO
+ // *******************************
+ // *******************************
+ // *******************************
+
+ if (Component != null)
+ {
+ Component.setDeviceName(strComponentName);
+ Component.doSelect();
+ g_mapPlacedComponents.set(strComponentName, Component);
+ }
+ return Component;
+}
+
+function doGetUniqueName(strName)
+{
+ var strFind = "";
+
+ for (let nI = 1; nI <= 1000; nI++)
+ {
+ strFind = strName + nI;
+ if (!g_mapPlacedComponents.has(strFind))
+ {
+ break;
+ }
+ }
+ return strFind;
+}
+
+function doCreateMCU(strMCUType)
+{
+ if ((strMCUType != "UNO") && (strMCUType != "MEGA"))
+ {
+ alert("'" + strMCUType + "' is not supported at this time!");
+ strMCUType = "UNO";
+ }
+ var Component = doCreateComponent(strMCUType);
+ var strMCUName = Component.getDeviceName();
+ g_mapPlacedComponents.set(strMCUName, Component);
+ doDisplayAllComponents();
+ return strMCUName;
+}
+
+function doShowEditFields(strHTMLEditField)
+{
+ var ComponentEdit = document.getElementById("component_edit");
+
+ if (ComponentEdit != null)
+ {
+ ComponentEdit.innerHTML = strHTMLEditField;
+ }
+}
+
+function doErrorMessage(strErrorMessage)
+{
+ doDisplayInfo(strErrorMessage);
+}
+
+function doDisplayInfo(strMessage)
+{
+ var LargeMessageDiv = document.getElementById("large_message_area");
+
+ if (LargeMessageDiv != null)
+ {
+ LargeMessageDiv.innerHTML = strMessage;
+ }
+}
+
+function doDisplayHint(strHeading, strInfo)
+{
+ var Info = getElement("info");
+ var InfoHeading = getElement("info_heading");
+
+ if (Info && InfoHeading)
+ {
+ InfoHeading.innerText = strHeading;
+ Info.innerText = strInfo;
+ }
+}
+
+
+
+
+//*************************************************************************
+//*
+//* PLACED COMPONENTS MAP FUNCTIONS
+//*
+//*************************************************************************
+
+function doStopRunAllComponents()
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "", strSelectedDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ if (g_mapPlacedComponents.get(arrayDeviceName[nI]))
+ g_mapPlacedComponents.get(arrayDeviceName[nI]).doStopRun();
+ }
+}
+
+function doZoomAllDrawingObjects(strInOut)
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "", strSelectedDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ if (strInOut == "+")
+ g_mapPlacedComponents.get(strDeviceName).doZoomIn();
+ else if (strInOut == "-")
+ g_mapPlacedComponents.get(strDeviceName).doZoomOut();
+ else if (strInOut == "100")
+ g_mapPlacedComponents.get(strDeviceName).doDefaultZoom();
+ g_mapPlacedComponents.get(strDeviceName).doRotate(0);
+ }
+ doDisplayAllComponents();
+}
+
+function doFindSelectedComponent(pointMousePos)
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "", strSelectedDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ if (g_mapPlacedComponents.get(strDeviceName).isMouseIn(pointMousePos))
+ {
+ strSelectedDeviceName = strDeviceName;
+ break;
+ }
+ }
+ return strSelectedDeviceName;
+}
+
+function doFindSelectedComponentNoMouse()
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "", strSelectedDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ if (g_mapPlacedComponents.get(strDeviceName).isSelected())
+ {
+ strSelectedDeviceName = strDeviceName;
+ break;
+ }
+ }
+ return strSelectedDeviceName;
+}
+
+function doUnselectAllComponents()
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ g_mapPlacedComponents.get(strDeviceName).doUnselect();
+ }
+}
+
+function doDisplayAllComponents()
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+
+ doEraseCanvas();
+ for (let nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ g_mapPlacedComponents.get(strDeviceName).doDisplay();
+ }
+}
+
+function doMouseOverAllComponents(pointMousePos)
+{
+ var arrayDeviceName = [];
+ var strDeviceName = "";
+ var nI = 0;
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){arrayDeviceName.push(strKey)});
+ g_Canvas.style.cursor = "default";
+
+ for (nI = 0; nI < arrayDeviceName.length; nI++)
+ {
+ strDeviceName = arrayDeviceName[nI];
+ if (g_mapPlacedComponents.get(strDeviceName).doMouseOver(pointMousePos))
+ break;
+ }
+}
+
+
+
+
+
+//*************************************************************************
+//*
+//* STYLES - BECAUSE HTML CLASS PROPERTIES WON'T WORK
+//*
+//*************************************************************************
+
+var g_strTextStyle = "background-color:white;border-style:solid;border-width:2Px;border-radius:5Px;border-top-color:#799B8A;border-left-color:#79B98A;border-right-color:#B9DBCA;border-bottom-color:#B9DBCA;width:120Px;height:30Px;";
+var g_strButtonStyle = "color:#006468;height:30px;border-radius: 5Px;background-color: #99BBAA;border-left-color:#B9DBCA;border-top-color:#B9DBCA;border-right-color:#799B8A;border-bottom-color:#79B98A;"
+var g_strLabelStyle = "display:inline-block;color:#006468;";
+var g_strSelectStyle = "display:inline;height:30Px;background-color:white;border-style:solid;border-width:2Px;border-radius:5Px;border-top-color:#799B8A;border-left-color:#79B98A;border-right-color:#B9DBCA;border-bottom-color:#B9DBCA;";
+var g_strSecondDivDisplayStyle = "display:inline-block;height:100%;vertical-align:middle;border-style:none;border-thickness:3Px;border-color:blue;";
+
+
+
+
+//*************************************************************************
+//*
+//* INPUT FIELDS
+//*
+//*************************************************************************
+
+//var g_strRename = "
BREAKOUT
";
+ this.doSetImages(bBreakout);
+ this.m_strDeviceName = "MICROBIT1";
+ this.m_fVoltage = 3.3;
+
+ for (var nI = 0, bIsAnalog = false; nI <= 20; nI++)
+ {
+ bIsAnalog = ((nI >= 0) && (nI <= 4)) || (nI == 10);
+ this.doAddPin(new CPin(nI, true, bIsAnalog, "P" + nI.toString(), this.getDeviceName()));
+ }
+ this.m_nMaxPin = 20;
+
+ this.doAddPin(new C3_3VPin(nI++, this.getDeviceName()));
+ this.doAddPin(new C3_3VPin(nI++, this.getDeviceName()));
+ this.doAddPin(new C3_3VPin(nI++, this.getDeviceName()));
+ this.doAddPin(new CGNDPin(nI++, this.getDeviceName()));
+ this.doAddPin(new CGNDPin(nI++, this.getDeviceName()));
+ this.doAddPin(new CGNDPin(nI++, this.getDeviceName()));
+ this.doRotate(0);
+
+ this.m_SPI = new CSPIPort(15, 14, 13, this.getDeviceName());
+ this.m_I2C = new CI2CPort(19, 20, this.getDeviceName());
+ this.setDeviceName(this.m_strDeviceName);
+
+ this.m_nButtonAPin = 5;
+ this.m_nButtonBPin = 11;
+
+ this.m_mapDigitalPinNames = new Map();
+ this.m_mapDigitalPinNames.set("P0", 0);
+ this.m_mapDigitalPinNames.set("P1", 1);
+ this.m_mapDigitalPinNames.set("P2", 2);
+ this.m_mapDigitalPinNames.set("P3", 3);
+ this.m_mapDigitalPinNames.set("P4", 4);
+ this.m_mapDigitalPinNames.set("P5", 5);
+ this.m_mapDigitalPinNames.set("P6", 6);
+ this.m_mapDigitalPinNames.set("P7", 7);
+ this.m_mapDigitalPinNames.set("P8", 8);
+ this.m_mapDigitalPinNames.set("P9", 9);
+ this.m_mapDigitalPinNames.set("P10", 10);
+ this.m_mapDigitalPinNames.set("P11", 11);
+ this.m_mapDigitalPinNames.set("P13", 13);
+ this.m_mapDigitalPinNames.set("P14", 14);
+ this.m_mapDigitalPinNames.set("P15", 15);
+ this.m_mapDigitalPinNames.set("P16", 16);
+ this.m_mapDigitalPinNames.set("P19", 19);
+ this.m_mapDigitalPinNames.set("P20", 20);
+ }
+
+ doRead(strFileContents)
+ {
+ strFileContents = super.doRead(strFileContents);
+ var strTemp = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, strTemp);
+ this.m_bBreakout = strTemp == "true";
+
+ return strFileContents;
+ }
+
+ doWrite(strFileContents)
+ {
+ strFileContents = super.doWrite(strFileContents);
+ strFileContents += this.m_bBreakout + "\r\n";
+ return strFileContents;
+ }
+
+ doSetImages(bBreakout)
+ {
+ if (bBreakout)
+ {
+ this.m_ImageObject0 = CMicrobit.m_ImageObjectBreakout0;
+ this.m_ImageObject90 = CMicrobit.m_ImageObjectBreakout90;
+ this.m_ImageObject180 = CMicrobit.m_ImageObjectBreakout180;
+ this.m_ImageObject270 = CMicrobit.m_ImageObjectBreakout270;
+ }
+ else
+ {
+ this.m_ImageObject0 = CMicrobit.m_ImageObjectNoBreakout0;
+ this.m_ImageObject90 = CMicrobit.m_ImageObjectNoBreakout90;
+ this.m_ImageObject180 = CMicrobit.m_ImageObjectNoBreakout180;
+ this.m_ImageObject270 = CMicrobit.m_ImageObjectNoBreakout270;
+ }
+ }
+
+ doSetBreakout(bBreakout)
+ {
+ this.m_bBreakout = bBreakout;
+ this.doSetImages(bBreakout);
+ this.doRotate(0);
+ }
+
+ doTurnOnLED(nX, nY)
+ {
+ this.m_arrayLEDMatrix.turnOn(nX, nY);
+ }
+
+ doTurnOffLED(nX, nY)
+ {
+ this.m_arrayLEDMatrix.turnOff(nX, nY);
+ }
+
+ doTurnOnRow(nY)
+ {
+ this.m_arrayLEDMatrix.doTurnOnRow(nY);
+ }
+
+ doTurnOffRow(nY)
+ {
+ this.m_arrayLEDMatrix.doTurnOffRow(nY);
+ }
+
+ doTurnOnColumn(nX)
+ {
+ this.m_arrayLEDMatrix.doTurnOnColumn();
+ }
+
+ doTurnOffColumn(nX)
+ {
+ this.m_arrayLEDMatrix.doTurnOffColumn();
+ }
+
+ doTurnOnAll()
+ {
+ this.m_arrayLEDMatrix.doTurnOnAll();
+ }
+
+ doTurnOffAll()
+ {
+ this.m_arrayLEDMatrix.doTurnOffAll();
+ }
+
+ doRotate(nAngleAdd)
+ {
+ super.doRotate(nAngleAdd);
+ this.m_arrayLEDMatrix.doRotate(this.m_nRotationAngle);
+ this.m_arrayLEDMatrix.doTurnOffAll();
+ }
+
+ doSetPinPositions()
+ {
+ var pointCenter = this.m_rectangle.getCenter();
+
+ if (this.m_bBreakout)
+ {
+ if (this.m_nRotationAngle == 0)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(358, 209)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(358, 199)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(358, 190)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(358, 180)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(358, 171)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(358, 161)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(358, 151)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(358, 142)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(358, 132)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(358, 122)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(358, 113)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(358, 103)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(358, 93)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(358, 84)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(358, 74)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(358, 64)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(358, 54)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(358, 45)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(358, 35)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(358, 219)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(358, 229)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(358, 238)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 175, this.m_rectangle.m_pointTL.m_nY + 66));
+
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 174.75, this.m_rectangle.m_pointTL.m_nY + 107.5));
+ }
+ else if (this.m_nRotationAngle == 90)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(65, 358)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(75, 358)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(84, 358)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(94, 358)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(104, 358)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(113, 358)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(123, 358)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(133, 358)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(142, 358)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(152, 358)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(161, 358)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(171, 358)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(181, 358)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(191, 358)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(201, 358)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(210, 358)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(220, 358)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(230, 358)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(239, 358)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(56, 358)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(46, 358)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(36, 358)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX+ 107.5, this.m_rectangle.m_pointTL.m_nY + 175.5));
+ }
+ else if (this.m_nRotationAngle == 180)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(9, 65)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(9, 75)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(9, 84)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(9, 94)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(9, 103)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(9, 113)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(9, 123)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(9, 133)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(9, 142)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(9, 152)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(9, 162)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(9, 171)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(9, 181)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(9, 191)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(9, 201)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(9, 210)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(9, 220)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(9, 230)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(9, 239)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(9, 56)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(9, 46)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(9, 36)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 131.5, this.m_rectangle.m_pointTL.m_nY + 107.5));
+ }
+ else if (this.m_nRotationAngle == 270)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(209, 9)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(200, 9)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(190, 9)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(180, 9)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(171, 9)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(161, 9)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(151, 9)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(142, 9)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(132, 9)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(122, 9)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(112, 9)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(103, 9)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(93, 9)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(83, 9)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(74, 9)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(64, 9)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(55, 9)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(45, 9)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(35, 9)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(219, 9)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(229, 9)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(238, 9)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(-1000000, -1000000)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 107.5, this.m_rectangle.m_pointTL.m_nY + 132));
+ }
+ }
+ else
+ {
+ if (this.m_nRotationAngle == 0)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(268, 178)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(268, 140)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(268, 96)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(268, 190)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(268, 166)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(268, 162)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(268, 156)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(268, 152)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(268, 127)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(268, 122)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(268, 117)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(268, 112)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(268, 107)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(268, 84)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(268, 79)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(268, 74)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(268, 69)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(268, 35)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(268, 30)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(268, 40)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(268, 52)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(268, 64)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(268, 0)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(268, 13)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(268, 25)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 175, this.m_rectangle.m_pointTL.m_nY + 66));
+ }
+ else if (this.m_nRotationAngle == 90)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(13, 268)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(52, 268)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(96, 268)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(2, 268)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(25, 268)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(30, 268)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(35, 268)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(40, 268)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(64, 268)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(69, 268)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(74, 268)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(79, 268)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(84, 268)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(107, 268)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(112, 268)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(117, 268)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(122, 268)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(155, 268)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(160, 268)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(127, 268)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(139, 268)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(150, 268)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(166, 268)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(178, 268)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(190, 268)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 66, this.m_rectangle.m_pointTL.m_nY + 175));
+ }
+ else if (this.m_nRotationAngle == 180)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(15, 14)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(15, 52)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(15, 95)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(15, 2)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(15, 26)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(15, 31)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(15, 36)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(15, 41)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(15, 64)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(15, 69)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(15, 74)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(15, 79)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(15, 84)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(15, 107)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(15, 112)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(15, 117)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(15, 122)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(15, 155)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(15, 160)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(15, 128)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(15, 140)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(15, 151)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(15, 166)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(15, 178)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(15, 189)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 49, this.m_rectangle.m_pointTL.m_nY + 66));
+ }
+ else if (this.m_nRotationAngle == 270)
+ {
+ this.doSetPinPos(0, this.m_rectangle.m_pointTL, new CSize(178, 16)); // P0
+ this.doSetPinPos(1, this.m_rectangle.m_pointTL, new CSize(139, 16)); // P1
+ this.doSetPinPos(2, this.m_rectangle.m_pointTL, new CSize(96, 16)); // P2
+ this.doSetPinPos(3, this.m_rectangle.m_pointTL, new CSize(190, 16)); // P3
+ this.doSetPinPos(4, this.m_rectangle.m_pointTL, new CSize(166, 16)); // P4
+ this.doSetPinPos(5, this.m_rectangle.m_pointTL, new CSize(161, 16)); // P5
+ this.doSetPinPos(6, this.m_rectangle.m_pointTL, new CSize(156, 16)); // P6
+ this.doSetPinPos(7, this.m_rectangle.m_pointTL, new CSize(151, 16)); // P7
+ this.doSetPinPos(8, this.m_rectangle.m_pointTL, new CSize(127, 16)); // P8
+ this.doSetPinPos(9, this.m_rectangle.m_pointTL, new CSize(122, 16)); // P9
+ this.doSetPinPos(10, this.m_rectangle.m_pointTL, new CSize(117, 16)); // P10
+ this.doSetPinPos(11, this.m_rectangle.m_pointTL, new CSize(112, 16)); // P11
+ this.doSetPinPos(12, this.m_rectangle.m_pointTL, new CSize(107, 16)); // P12
+ this.doSetPinPos(13, this.m_rectangle.m_pointTL, new CSize(83, 16)); // P13
+ this.doSetPinPos(14, this.m_rectangle.m_pointTL, new CSize(78, 16)); // P14
+ this.doSetPinPos(15, this.m_rectangle.m_pointTL, new CSize(73, 16)); // P15
+ this.doSetPinPos(16, this.m_rectangle.m_pointTL, new CSize(68, 16)); // P16
+ this.doSetPinPos(19, this.m_rectangle.m_pointTL, new CSize(36, 16)); // P19
+ this.doSetPinPos(20, this.m_rectangle.m_pointTL, new CSize(31, 16)); // P20
+ this.doSetPinPos(21, this.m_rectangle.m_pointTL, new CSize(65, 16)); // 3.3V
+ this.doSetPinPos(22, this.m_rectangle.m_pointTL, new CSize(52, 16)); // 3.3V
+ this.doSetPinPos(23, this.m_rectangle.m_pointTL, new CSize(40, 16)); // 3.3V
+ this.doSetPinPos(24, this.m_rectangle.m_pointTL, new CSize(26, 16)); // GND
+ this.doSetPinPos(25, this.m_rectangle.m_pointTL, new CSize(13, 16)); // GND
+ this.doSetPinPos(26, this.m_rectangle.m_pointTL, new CSize(1, 16)); // GND
+ this.m_arrayLEDMatrix.doMove(new CPoint(this.m_rectangle.m_pointTL.m_nX + 66, this.m_rectangle.m_pointTL.m_nY + 49));
+ }
+ }
+ }
+
+ setDeviceName(strDeviceName)
+ {
+ super.setDeviceName(strDeviceName);
+ this.m_SPI.setDeviceName(strDeviceName);
+ this.m_I2C.setDeviceName(strDeviceName);
+ }
+
+
+ doDisplay()
+ {
+ super.doDisplay();
+ this.m_arrayLEDMatrix.doDisplay();
+ }
+
+ doRun()
+ {
+ for (let nI = 0; nI < this.m_arrayPins.length; nI++)
+ this.m_arrayPins[nI].doRun();
+ }
+
+}
+
diff --git a/ardublockly/PassiveDataStructures.js b/ardublockly/PassiveDataStructures.js
new file mode 100644
index 0000000000..3f36664954
--- /dev/null
+++ b/ardublockly/PassiveDataStructures.js
@@ -0,0 +1,1059 @@
+//*************************************************************************
+//*
+//* 0.25W RESISTOR
+//*
+//*************************************************************************
+
+function doChangeResistance(strDeviceName, fResistance)
+{
+ if ((strDeviceName != null) && (strDeviceName != "") && (g_mapPlacedComponents.get(strDeviceName) != null) &&
+ (g_mapPlacedComponents.get(strDeviceName).getType() == "RESISTOR"))
+ {
+ g_mapPlacedComponents.get(strDeviceName).doSetResistance(fResistance);
+ doDisplayAllComponents();
+ }
+}
+
+function doGetResistance()
+{
+ var ResistenceSel = document.getElementById("resistance");
+ var ResistanceMultSel = document.getElementById("resistance_multiplier");
+ var fResistance = 0;
+
+ if (ResistenceSel && ResistanceMultSel)
+ {
+ fResistance = ResistenceSel.options[ResistenceSel.selectedIndex].value;
+ fResistance *= ResistanceMultSel.options[ResistanceMultSel.selectedIndex].value;
+ }
+ return fResistance;
+}
+
+class CResistor extends CComponentBase
+{
+ static m_ImageObjectBlown_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\RBlown.png");
+ static m_ImageObjectBlown_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\RBlown_90.png");
+ static m_ImageObjectBlown_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\RBlown_180.png");
+ static m_ImageObjectBlown_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\RBlown_270.png");
+
+ static m_ImageObject1_0_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_0.png");
+ static m_ImageObject1_0_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_90.png");
+ static m_ImageObject1_0_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_180.png");
+ static m_ImageObject1_0_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_270.png");
+
+ static m_ImageObject1_2_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2.png");
+ static m_ImageObject1_2_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2_90.png");
+ static m_ImageObject1_2_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2_180.png");
+ static m_ImageObject1_2_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2_270.png");
+
+ static m_ImageObject1_5_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5.png");
+ static m_ImageObject1_5_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5_90.png");
+ static m_ImageObject1_5_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5_180.png");
+ static m_ImageObject1_5_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5_270.png");
+
+ static m_ImageObject1_8_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8.png");
+ static m_ImageObject1_8_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8_90.png");
+ static m_ImageObject1_8_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8_180.png");
+ static m_ImageObject1_8_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8_270.png");
+
+ static m_ImageObject2_2_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2.png");
+ static m_ImageObject2_2_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2_90.png");
+ static m_ImageObject2_2_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2_180.png");
+ static m_ImageObject2_2_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2_270.png");
+
+ static m_ImageObject2_7_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7.png");
+ static m_ImageObject2_7_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7_90.png");
+ static m_ImageObject2_7_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7_180.png");
+ static m_ImageObject2_7_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7_270.png");
+
+ static m_ImageObject3_3_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3.png");
+ static m_ImageObject3_3_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3_90.png");
+ static m_ImageObject3_3_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3_180.png");
+ static m_ImageObject3_3_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3_270.png");
+
+ static m_ImageObject3_9_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9.png");
+ static m_ImageObject3_9_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9_90.png");
+ static m_ImageObject3_9_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9_180.png");
+ static m_ImageObject3_9_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9_270.png");
+
+ static m_ImageObject4_7_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7.png");
+ static m_ImageObject4_7_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7_90.png");
+ static m_ImageObject4_7_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7_180.png");
+ static m_ImageObject4_7_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7_270.png");
+
+ static m_ImageObject5_6_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6.png");
+ static m_ImageObject5_6_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6_90.png");
+ static m_ImageObject5_6_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6_180.png");
+ static m_ImageObject5_6_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6_270.png");
+
+ static m_ImageObject6_8_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8.png");
+ static m_ImageObject6_8_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8_90.png");
+ static m_ImageObject6_8_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8_180.png");
+ static m_ImageObject6_8_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8_270.png");
+
+ static m_ImageObject8_2_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2.png");
+ static m_ImageObject8_2_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2_90.png");
+ static m_ImageObject8_2_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2_180.png");
+ static m_ImageObject8_2_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2_270.png");
+
+ static m_ImageObject10_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10.png");
+ static m_ImageObject10_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10_90.png");
+ static m_ImageObject10_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10_180.png");
+ static m_ImageObject10_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10_270.png");
+
+ static m_ImageObject12_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12.png");
+ static m_ImageObject12_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12_90.png");
+ static m_ImageObject12_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12_180.png");
+ static m_ImageObject12_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12_270.png");
+
+ static m_ImageObject15_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15.png");
+ static m_ImageObject15_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15_90.png");
+ static m_ImageObject15_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15_180.png");
+ static m_ImageObject15_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15_270.png");
+
+ static m_ImageObject18_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R18.png");
+ static m_ImageObject18_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R18_90.png");
+ static m_ImageObject18_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R18_180.png");
+ static m_ImageObject18_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R18_270.png");
+
+ static m_ImageObject22_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22.png");
+ static m_ImageObject22_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22_90.png");
+ static m_ImageObject22_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22_180.png");
+ static m_ImageObject22_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22_270.png");
+
+ static m_ImageObject27_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27.png");
+ static m_ImageObject27_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27_90.png");
+ static m_ImageObject27_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27_180.png");
+ static m_ImageObject27_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27_270.png");
+
+ static m_ImageObject33_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33.png");
+ static m_ImageObject33_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33_90.png");
+ static m_ImageObject33_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33_180.png");
+ static m_ImageObject33_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33_270.png");
+
+ static m_ImageObject39_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39.png");
+ static m_ImageObject39_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39_90.png");
+ static m_ImageObject39_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39_180.png");
+ static m_ImageObject39_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39_270.png");
+
+ static m_ImageObject47_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47.png");
+ static m_ImageObject47_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47_90.png");
+ static m_ImageObject47_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47_180.png");
+ static m_ImageObject47_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47_270.png");
+
+ static m_ImageObject56_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56.png");
+ static m_ImageObject56_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56_90.png");
+ static m_ImageObject56_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56_180.png");
+ static m_ImageObject56_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56_270.png");
+
+ static m_ImageObject68_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68.png");
+ static m_ImageObject68_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68_90.png");
+ static m_ImageObject68_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68_180.png");
+ static m_ImageObject68_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68_270.png");
+
+ static m_ImageObject82_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82.png");
+ static m_ImageObject82_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82_90.png");
+ static m_ImageObject82_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82_180.png");
+ static m_ImageObject82_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82_270.png");
+
+ static m_ImageObject100_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100.png");
+ static m_ImageObject100_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100_90.png");
+ static m_ImageObject100_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100_180.png");
+ static m_ImageObject100_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100_270.png");
+
+ static m_ImageObject120_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120.png");
+ static m_ImageObject120_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120_90.png");
+ static m_ImageObject120_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120_180.png");
+ static m_ImageObject120_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120_270.png");
+
+ static m_ImageObject150_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150.png");
+ static m_ImageObject150_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150_90.png");
+ static m_ImageObject150_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150_180.png");
+ static m_ImageObject150_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150_270.png");
+
+ static m_ImageObject180_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180.png");
+ static m_ImageObject180_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180_90.png");
+ static m_ImageObject180_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180_180.png");
+ static m_ImageObject180_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180_270.png");
+
+ static m_ImageObject220_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220.png");
+ static m_ImageObject220_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220_90.png");
+ static m_ImageObject220_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220_180.png");
+ static m_ImageObject220_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220_270.png");
+
+ static m_ImageObject270_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R270.png");
+ static m_ImageObject270_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R270_90.png");
+ static m_ImageObject270_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R270_180.png");
+ static m_ImageObject270_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R270_270.png");
+
+ static m_ImageObject330_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330.png");
+ static m_ImageObject330_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330_90.png");
+ static m_ImageObject330_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330_180.png");
+ static m_ImageObject330_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330_270.png");
+
+ static m_ImageObject390_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390.png");
+ static m_ImageObject390_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390_90.png");
+ static m_ImageObject390_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390_180.png");
+ static m_ImageObject390_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390_270.png");
+
+ static m_ImageObject470_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470.png");
+ static m_ImageObject470_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470_90.png");
+ static m_ImageObject470_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470_180.png");
+ static m_ImageObject470_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470_270.png");
+
+ static m_ImageObject560_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560.png");
+ static m_ImageObject560_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560_90.png");
+ static m_ImageObject560_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560_180.png");
+ static m_ImageObject560_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560_270.png");
+
+ static m_ImageObject680_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680.png");
+ static m_ImageObject680_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680_90.png");
+ static m_ImageObject680_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680_180.png");
+ static m_ImageObject680_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680_270.png");
+
+ static m_ImageObject820_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820.png");
+ static m_ImageObject820_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820_90.png");
+ static m_ImageObject820_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820_180.png");
+ static m_ImageObject820_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820_270.png");
+
+ static m_ImageObject1k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1k.png");
+ static m_ImageObject1k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1k_90.png");
+ static m_ImageObject1k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1k_180.png");
+ static m_ImageObject1k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1k_270.png");
+
+ static m_ImageObject1_2k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2k.png");
+ static m_ImageObject1_2k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2k_90.png");
+ static m_ImageObject1_2k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2k_180.png");
+ static m_ImageObject1_2k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2k_270.png");
+
+ static m_ImageObject1_5k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5k.png");
+ static m_ImageObject1_5k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5k_90.png");
+ static m_ImageObject1_5k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5k_180.png");
+ static m_ImageObject1_5k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5k_270.png");
+
+ static m_ImageObject1_8_k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8k.png");
+ static m_ImageObject1_8k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8k_90.png");
+ static m_ImageObject1_8k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8k_180.png");
+ static m_ImageObject1_8k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8k_270.png");
+
+ static m_ImageObject2_2k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2k.png");
+ static m_ImageObject2_2k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2k_90.png");
+ static m_ImageObject2_2k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2k_180.png");
+ static m_ImageObject2_2k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2k_270.png");
+
+ static m_ImageObject2_7k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7k.png");
+ static m_ImageObject2_7k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7k_90.png");
+ static m_ImageObject2_7k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7k_180.png");
+ static m_ImageObject2_7k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7k_270.png");
+
+ static m_ImageObject3_3k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3k.png");
+ static m_ImageObject3_3k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3k_90.png");
+ static m_ImageObject3_3k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3k_180.png");
+ static m_ImageObject3_3k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3k_270.png");
+
+ static m_ImageObject3_9k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9k.png");
+ static m_ImageObject3_9k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9k_90.png");
+ static m_ImageObject3_9k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9k_180.png");
+ static m_ImageObject3_9k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9k_270.png");
+
+ static m_ImageObject4_7k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7k.png");
+ static m_ImageObject4_7k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7k_90.png");
+ static m_ImageObject4_7k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7k_180.png");
+ static m_ImageObject4_7k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7k_270.png");
+
+ static m_ImageObject5_6k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6k.png");
+ static m_ImageObject5_6k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6k_90.png");
+ static m_ImageObject5_6k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6k_180.png");
+ static m_ImageObject5_6k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6k_270.png");
+
+ static m_ImageObject6_8k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8k.png");
+ static m_ImageObject6_8k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8k_90.png");
+ static m_ImageObject6_8k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8k_180.png");
+ static m_ImageObject6_8k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8k_270.png");
+
+ static m_ImageObject8_2k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2k.png");
+ static m_ImageObject8_2k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2k_90.png");
+ static m_ImageObject8_2k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2k_180.png");
+ static m_ImageObject8_2k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2k_270.png");
+
+ static m_ImageObject10k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10k.png");
+ static m_ImageObject10k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10k_90.png");
+ static m_ImageObject10k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10k_180.png");
+ static m_ImageObject10k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10k_270.png");
+
+ static m_ImageObject12k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12k.png");
+ static m_ImageObject12k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12k_90.png");
+ static m_ImageObject12k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12k_180.png");
+ static m_ImageObject12k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R12k_270.png");
+
+ static m_ImageObject15k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15k.png");
+ static m_ImageObject15k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15k_90.png");
+ static m_ImageObject15k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15k_180.png");
+ static m_ImageObject15k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R15k_270.png");
+
+ static m_ImageObject22k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22k.png");
+ static m_ImageObject22k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22k_90.png");
+ static m_ImageObject22k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22k_180.png");
+ static m_ImageObject22k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R22k_270.png");
+
+ static m_ImageObject27k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27k.png");
+ static m_ImageObject27k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27k_90.png");
+ static m_ImageObject27k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27k_180.png");
+ static m_ImageObject27k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R27k_270.png");
+
+ static m_ImageObject33k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33k.png");
+ static m_ImageObject33k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33k_90.png");
+ static m_ImageObject33k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33k_180.png");
+ static m_ImageObject33k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R33k_270.png");
+
+ static m_ImageObject39k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39k.png");
+ static m_ImageObject39k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39k_90.png");
+ static m_ImageObject39k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39k_180.png");
+ static m_ImageObject39k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R39k_270.png");
+
+ static m_ImageObject47k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47k.png");
+ static m_ImageObject47k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47k_90.png");
+ static m_ImageObject47k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47k_180.png");
+ static m_ImageObject47k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R47k_270.png");
+
+ static m_ImageObject56k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56k.png");
+ static m_ImageObject56k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56k_90.png");
+ static m_ImageObject56k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56k_180.png");
+ static m_ImageObject56k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R56k_270.png");
+
+ static m_ImageObject68k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68k.png");
+ static m_ImageObject68k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68k_90.png");
+ static m_ImageObject68k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68k_180.png");
+ static m_ImageObject68k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R68k_270.png");
+
+ static m_ImageObject82k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82k.png");
+ static m_ImageObject82k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82k_90.png");
+ static m_ImageObject82k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82k_180.png");
+ static m_ImageObject82k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R82k_270.png");
+
+ static m_ImageObject100k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100k.png");
+ static m_ImageObject100k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100k_90.png");
+ static m_ImageObject100k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100k_180.png");
+ static m_ImageObject100k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R100k_270.png");
+
+ static m_ImageObject120k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120k.png");
+ static m_ImageObject120k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120k_90.png");
+ static m_ImageObject120k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120k_180.png");
+ static m_ImageObject120k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R120k_270.png");
+
+ static m_ImageObject150k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150k.png");
+ static m_ImageObject150k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150k_90.png");
+ static m_ImageObject150k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150k_180.png");
+ static m_ImageObject150k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R150k_270.png");
+
+ static m_ImageObject180k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180k.png");
+ static m_ImageObject180k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180k_90.png");
+ static m_ImageObject180k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180k_180.png");
+ static m_ImageObject180k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R180k_270.png");
+
+ static m_ImageObject220k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220k.png");
+ static m_ImageObject220k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220k_90.png");
+ static m_ImageObject220k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220k_180.png");
+ static m_ImageObject220k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R220k_270.png");
+
+ static m_ImageObject330k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R30k.png");
+ static m_ImageObject330k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330k_90.png");
+ static m_ImageObject330k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330k_180.png");
+ static m_ImageObject330k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R330k_270.png");
+
+ static m_ImageObject390k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390k.png");
+ static m_ImageObject390k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390k_90.png");
+ static m_ImageObject390k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390k_180.png");
+ static m_ImageObject390k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R390k_270.png");
+
+ static m_ImageObject470k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470k.png");
+ static m_ImageObject470k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470k_90.png");
+ static m_ImageObject470k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470k_180.png");
+ static m_ImageObject470k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R470k_270.png");
+
+ static m_ImageObject560k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560k.png");
+ static m_ImageObject560k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560k_90.png");
+ static m_ImageObject560k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560k_180.png");
+ static m_ImageObject560k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R560k_270.png");
+
+ static m_ImageObject680k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680k.png");
+ static m_ImageObject680k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680k_90.png");
+ static m_ImageObject680k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680k_180.png");
+ static m_ImageObject680k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R680k_270.png");
+
+ static m_ImageObject820k_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820k.png");
+ static m_ImageObject820k_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820k_90.png");
+ static m_ImageObject820k_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820k_180.png");
+ static m_ImageObject820k_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R820k_270.png");
+
+ static m_ImageObject1M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1M.png");
+ static m_ImageObject1M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1M_90.png");
+ static m_ImageObject1M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1M_180.png");
+ static m_ImageObject1M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1M_270.png");
+
+ static m_ImageObject1_2M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2M.png");
+ static m_ImageObject1_2M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2M_90.png");
+ static m_ImageObject1_2M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2M_180.png");
+ static m_ImageObject1_2M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_2M_270.png");
+
+ static m_ImageObject1_5M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5M.png");
+ static m_ImageObject1_5M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5M_90.png");
+ static m_ImageObject1_5M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5M_180.png");
+ static m_ImageObject1_5M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_5M_270.png");
+
+ static m_ImageObject1_8M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8M.png");
+ static m_ImageObject1_8M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8M_90.png");
+ static m_ImageObject1_8M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8M_180.png");
+ static m_ImageObject1_8M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R1_8M_270.png");
+
+ static m_ImageObject2_2M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2M.png");
+ static m_ImageObject2_2M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2M_90.png");
+ static m_ImageObject2_2M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2M_180.png");
+ static m_ImageObject2_2M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_2M_270.png");
+
+ static m_ImageObject2_7M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7M.png");
+ static m_ImageObject2_7M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7M_90.png");
+ static m_ImageObject2_7M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7M_180.png");
+ static m_ImageObject2_7M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R2_7M_270.png");
+
+ static m_ImageObject3_3M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3M.png");
+ static m_ImageObject3_3M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3M_90.png");
+ static m_ImageObject3_3M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3M_180.png");
+ static m_ImageObject3_3M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_3M_270.png");
+
+ static m_ImageObject3_9M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9M.png");
+ static m_ImageObject3_9M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9M_90.png");
+ static m_ImageObject3_9M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9M_180.png");
+ static m_ImageObject3_9M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R3_9M_270.png");
+
+ static m_ImageObject4_7M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7M.png");
+ static m_ImageObject4_7M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7M_90.png");
+ static m_ImageObject4_7M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7M_180.png");
+ static m_ImageObject4_7M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R4_7M_270.png");
+
+ static m_ImageObject5_6M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6M.png");
+ static m_ImageObject5_6M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6M_90.png");
+ static m_ImageObject5_6M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6M_180.png");
+ static m_ImageObject5_6M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R5_6M_270.png");
+
+ static m_ImageObject6_8M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8M.png");
+ static m_ImageObject6_8M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8M_90.png");
+ static m_ImageObject6_8M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8M_180.png");
+ static m_ImageObject6_8M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R6_8M_270.png");
+
+ static m_ImageObject8_2M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2M.png");
+ static m_ImageObject8_2M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2M_90.png");
+ static m_ImageObject8_2M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2M_180.png");
+ static m_ImageObject8_2M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R8_2M_270.png");
+
+ static m_ImageObject10M_0 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10M.png");
+ static m_ImageObject10M_90 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10M_90.png");
+ static m_ImageObject10M_180 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10M_180.png");
+ static m_ImageObject10M_270 = CComponentBase.doGetImageObject("img\\Components\\Resistors\\R10M_270.png");
+
+ static m_mapImageObjects = new Map();
+
+ static doCreateImageObjectMap()
+ {
+ if (CResistor.m_mapImageObjects.size == 0)
+ {
+ CResistor.m_mapImageObjects.set("1_0_0", CResistor.m_ImageObject1_0_0);
+ CResistor.m_mapImageObjects.set("1_0_90", CResistor.m_ImageObject1_0_90);
+ CResistor.m_mapImageObjects.set("1_0_180", CResistor.m_ImageObject1_0_180);
+ CResistor.m_mapImageObjects.set("1_0_270", CResistor.m_ImageObject1_0_270);
+
+ CResistor.m_mapImageObjects.set("1_2_0", CResistor.m_ImageObject1_2_0);
+ CResistor.m_mapImageObjects.set("1_2_90", CResistor.m_ImageObject1_2_90);
+ CResistor.m_mapImageObjects.set("1_2_180", CResistor.m_ImageObject1_2_180);
+ CResistor.m_mapImageObjects.set("1_2_270", CResistor.m_ImageObject1_2_270);
+
+ CResistor.m_mapImageObjects.set("1_5_0", CResistor.m_ImageObject1_5_0);
+ CResistor.m_mapImageObjects.set("1_5_90", CResistor.m_ImageObject1_5_90);
+ CResistor.m_mapImageObjects.set("1_5_180", CResistor.m_ImageObject1_5_180);
+ CResistor.m_mapImageObjects.set("1_5_270", CResistor.m_ImageObject1_5_270);
+
+ CResistor.m_mapImageObjects.set("1_8_0", CResistor.m_ImageObject1_8_0);
+ CResistor.m_mapImageObjects.set("1_8_90", CResistor.m_ImageObject1_8_90);
+ CResistor.m_mapImageObjects.set("1_8_180", CResistor.m_ImageObject1_8_180);
+ CResistor.m_mapImageObjects.set("1_8_270", CResistor.m_ImageObject1_8_270);
+
+ CResistor.m_mapImageObjects.set("2_2_0", CResistor.m_ImageObject2_2_0);
+ CResistor.m_mapImageObjects.set("2_2_90", CResistor.m_ImageObject2_2_90);
+ CResistor.m_mapImageObjects.set("2_2_180", CResistor.m_ImageObject2_2_180);
+ CResistor.m_mapImageObjects.set("2_2_270", CResistor.m_ImageObject2_2_270);
+
+ CResistor.m_mapImageObjects.set("2_7_0", CResistor.m_ImageObject2_7_0);
+ CResistor.m_mapImageObjects.set("2_7_90", CResistor.m_ImageObject2_7_90);
+ CResistor.m_mapImageObjects.set("2_7_180", CResistor.m_ImageObject2_7_180);
+ CResistor.m_mapImageObjects.set("2_7_270", CResistor.m_ImageObject2_7_270);
+
+ CResistor.m_mapImageObjects.set("3_3_0", CResistor.m_ImageObject3_3_0);
+ CResistor.m_mapImageObjects.set("3_3_90", CResistor.m_ImageObject3_3_90);
+ CResistor.m_mapImageObjects.set("3_3_180", CResistor.m_ImageObject3_3_180);
+ CResistor.m_mapImageObjects.set("3_3_270", CResistor.m_ImageObject3_3_270);
+
+ CResistor.m_mapImageObjects.set("3_9_0", CResistor.m_ImageObject3_9_0);
+ CResistor.m_mapImageObjects.set("3_9_90", CResistor.m_ImageObject3_9_90);
+ CResistor.m_mapImageObjects.set("3_9_180", CResistor.m_ImageObject3_9_180);
+ CResistor.m_mapImageObjects.set("3_9_270", CResistor.m_ImageObject3_9_270);
+
+ CResistor.m_mapImageObjects.set("4_7_0", CResistor.m_ImageObject4_7_0);
+ CResistor.m_mapImageObjects.set("4_7_90", CResistor.m_ImageObject4_7_90);
+ CResistor.m_mapImageObjects.set("4_7_180", CResistor.m_ImageObject4_7_180);
+ CResistor.m_mapImageObjects.set("4_7_270", CResistor.m_ImageObject4_7_270);
+
+ CResistor.m_mapImageObjects.set("5_6_0", CResistor.m_ImageObject5_6_0);
+ CResistor.m_mapImageObjects.set("5_6_90", CResistor.m_ImageObject5_6_90);
+ CResistor.m_mapImageObjects.set("5_6_180", CResistor.m_ImageObject5_6_180);
+ CResistor.m_mapImageObjects.set("5_6_270", CResistor.m_ImageObject5_6_270);
+
+ CResistor.m_mapImageObjects.set("6_8_0", CResistor.m_ImageObject6_8_0);
+ CResistor.m_mapImageObjects.set("6_8_90", CResistor.m_ImageObject6_8_90);
+ CResistor.m_mapImageObjects.set("6_8_180", CResistor.m_ImageObject6_8_180);
+ CResistor.m_mapImageObjects.set("6_8_270", CResistor.m_ImageObject6_8_270);
+
+ CResistor.m_mapImageObjects.set("8_2_0", CResistor.m_ImageObject8_2_0);
+ CResistor.m_mapImageObjects.set("8_2_90", CResistor.m_ImageObject8_2_90);
+ CResistor.m_mapImageObjects.set("8_2_180", CResistor.m_ImageObject8_2_180);
+ CResistor.m_mapImageObjects.set("8_2_270", CResistor.m_ImageObject8_2_270);
+
+ CResistor.m_mapImageObjects.set("10_0", CResistor.m_ImageObject10_0);
+ CResistor.m_mapImageObjects.set("10_90", CResistor.m_ImageObject10_90);
+ CResistor.m_mapImageObjects.set("10_180", CResistor.m_ImageObject10_180);
+ CResistor.m_mapImageObjects.set("10_270", CResistor.m_ImageObject10_270);
+
+ CResistor.m_mapImageObjects.set("12_0", CResistor.m_ImageObject12_0);
+ CResistor.m_mapImageObjects.set("12_90", CResistor.m_ImageObject12_90);
+ CResistor.m_mapImageObjects.set("12_180", CResistor.m_ImageObject12_180);
+ CResistor.m_mapImageObjects.set("12_270", CResistor.m_ImageObject12_270);
+
+ CResistor.m_mapImageObjects.set("15_0", CResistor.m_ImageObject15_0);
+ CResistor.m_mapImageObjects.set("15_90", CResistor.m_ImageObject15_90);
+ CResistor.m_mapImageObjects.set("15_180", CResistor.m_ImageObject15_180);
+ CResistor.m_mapImageObjects.set("15_270", CResistor.m_ImageObject15_270);
+
+ CResistor.m_mapImageObjects.set("18_0", CResistor.m_ImageObject18_0);
+ CResistor.m_mapImageObjects.set("18_90", CResistor.m_ImageObject18_90);
+ CResistor.m_mapImageObjects.set("18_180", CResistor.m_ImageObject18_180);
+ CResistor.m_mapImageObjects.set("18_270", CResistor.m_ImageObject18_270);
+
+ CResistor.m_mapImageObjects.set("22_0", CResistor.m_ImageObject22_0);
+ CResistor.m_mapImageObjects.set("22_90", CResistor.m_ImageObject22_90);
+ CResistor.m_mapImageObjects.set("22_180", CResistor.m_ImageObject22_180);
+ CResistor.m_mapImageObjects.set("22_270", CResistor.m_ImageObject22_270);
+
+ CResistor.m_mapImageObjects.set("27_0", CResistor.m_ImageObject27_0);
+ CResistor.m_mapImageObjects.set("27_90", CResistor.m_ImageObject27_90);
+ CResistor.m_mapImageObjects.set("27_180", CResistor.m_ImageObject27_180);
+ CResistor.m_mapImageObjects.set("27_270", CResistor.m_ImageObject27_270);
+
+ CResistor.m_mapImageObjects.set("33_0", CResistor.m_ImageObject33_0);
+ CResistor.m_mapImageObjects.set("33_90", CResistor.m_ImageObject33_90);
+ CResistor.m_mapImageObjects.set("33_180", CResistor.m_ImageObject33_180);
+ CResistor.m_mapImageObjects.set("33_270", CResistor.m_ImageObject33_270);
+
+ CResistor.m_mapImageObjects.set("39_0", CResistor.m_ImageObject39_0);
+ CResistor.m_mapImageObjects.set("39_90", CResistor.m_ImageObject39_90);
+ CResistor.m_mapImageObjects.set("39_180", CResistor.m_ImageObject39_180);
+ CResistor.m_mapImageObjects.set("39_270", CResistor.m_ImageObject39_270);
+
+ CResistor.m_mapImageObjects.set("47_0", CResistor.m_ImageObject47_0);
+ CResistor.m_mapImageObjects.set("47_90", CResistor.m_ImageObject47_90);
+ CResistor.m_mapImageObjects.set("47_180", CResistor.m_ImageObject47_180);
+ CResistor.m_mapImageObjects.set("47_270", CResistor.m_ImageObject47_270);
+
+ CResistor.m_mapImageObjects.set("56_0", CResistor.m_ImageObject56_0);
+ CResistor.m_mapImageObjects.set("56_90", CResistor.m_ImageObject56_90);
+ CResistor.m_mapImageObjects.set("56_180", CResistor.m_ImageObject56_180);
+ CResistor.m_mapImageObjects.set("56_270", CResistor.m_ImageObject56_270);
+
+ CResistor.m_mapImageObjects.set("68_0", CResistor.m_ImageObject68_0);
+ CResistor.m_mapImageObjects.set("68_90", CResistor.m_ImageObject68_90);
+ CResistor.m_mapImageObjects.set("68_180", CResistor.m_ImageObject68_180);
+ CResistor.m_mapImageObjects.set("68_270", CResistor.m_ImageObject68_270);
+
+ CResistor.m_mapImageObjects.set("82_0", CResistor.m_ImageObject82_0);
+ CResistor.m_mapImageObjects.set("82_90", CResistor.m_ImageObject82_90);
+ CResistor.m_mapImageObjects.set("82_180", CResistor.m_ImageObject82_180);
+ CResistor.m_mapImageObjects.set("82_270", CResistor.m_ImageObject82_270);
+
+ CResistor.m_mapImageObjects.set("100_0", CResistor.m_ImageObject100_0);
+ CResistor.m_mapImageObjects.set("100_90", CResistor.m_ImageObject100_90);
+ CResistor.m_mapImageObjects.set("100_180", CResistor.m_ImageObject100_180);
+ CResistor.m_mapImageObjects.set("100_270", CResistor.m_ImageObject100_270);
+
+ CResistor.m_mapImageObjects.set("120_0", CResistor.m_ImageObject120_0);
+ CResistor.m_mapImageObjects.set("120_90", CResistor.m_ImageObject120_90);
+ CResistor.m_mapImageObjects.set("120_180", CResistor.m_ImageObject120_180);
+ CResistor.m_mapImageObjects.set("120_270", CResistor.m_ImageObject120_270);
+
+ CResistor.m_mapImageObjects.set("150_0", CResistor.m_ImageObject150_0);
+ CResistor.m_mapImageObjects.set("150_90", CResistor.m_ImageObject150_90);
+ CResistor.m_mapImageObjects.set("150_180", CResistor.m_ImageObject150_180);
+ CResistor.m_mapImageObjects.set("150_270", CResistor.m_ImageObject150_270);
+
+ CResistor.m_mapImageObjects.set("180_0", CResistor.m_ImageObject180_0);
+ CResistor.m_mapImageObjects.set("180_90", CResistor.m_ImageObject180_90);
+ CResistor.m_mapImageObjects.set("180_180", CResistor.m_ImageObject180_180);
+ CResistor.m_mapImageObjects.set("180_270", CResistor.m_ImageObject180_270);
+
+ CResistor.m_mapImageObjects.set("220_0", CResistor.m_ImageObject220_0);
+ CResistor.m_mapImageObjects.set("220_90", CResistor.m_ImageObject220_90);
+ CResistor.m_mapImageObjects.set("220_180", CResistor.m_ImageObject220_180);
+ CResistor.m_mapImageObjects.set("220_270", CResistor.m_ImageObject220_270);
+
+ CResistor.m_mapImageObjects.set("270_0", CResistor.m_ImageObject270_0);
+ CResistor.m_mapImageObjects.set("270_90", CResistor.m_ImageObject270_90);
+ CResistor.m_mapImageObjects.set("270_180", CResistor.m_ImageObject270_180);
+ CResistor.m_mapImageObjects.set("270_270", CResistor.m_ImageObject270_270);
+
+ CResistor.m_mapImageObjects.set("330_0", CResistor.m_ImageObject330_0);
+ CResistor.m_mapImageObjects.set("330_90", CResistor.m_ImageObject330_90);
+ CResistor.m_mapImageObjects.set("330_180", CResistor.m_ImageObject330_180);
+ CResistor.m_mapImageObjects.set("330_270", CResistor.m_ImageObject330_270);
+
+ CResistor.m_mapImageObjects.set("390_0", CResistor.m_ImageObject390_0);
+ CResistor.m_mapImageObjects.set("390_90", CResistor.m_ImageObject390_90);
+ CResistor.m_mapImageObjects.set("390_180", CResistor.m_ImageObject390_180);
+ CResistor.m_mapImageObjects.set("390_270", CResistor.m_ImageObject390_270);
+
+ CResistor.m_mapImageObjects.set("470_0", CResistor.m_ImageObject470_0);
+ CResistor.m_mapImageObjects.set("470_90", CResistor.m_ImageObject470_90);
+ CResistor.m_mapImageObjects.set("470_180", CResistor.m_ImageObject470_180);
+ CResistor.m_mapImageObjects.set("470_270", CResistor.m_ImageObject470_270);
+
+ CResistor.m_mapImageObjects.set("560_0", CResistor.m_ImageObject560_0);
+ CResistor.m_mapImageObjects.set("560_90", CResistor.m_ImageObject560_90);
+ CResistor.m_mapImageObjects.set("560_180", CResistor.m_ImageObject560_180);
+ CResistor.m_mapImageObjects.set("560_270", CResistor.m_ImageObject560_270);
+
+ CResistor.m_mapImageObjects.set("680_0", CResistor.m_ImageObject680_0);
+ CResistor.m_mapImageObjects.set("680_90", CResistor.m_ImageObject680_90);
+ CResistor.m_mapImageObjects.set("680_180", CResistor.m_ImageObject680_180);
+ CResistor.m_mapImageObjects.set("680_270", CResistor.m_ImageObject680_270);
+
+ CResistor.m_mapImageObjects.set("820_0", CResistor.m_ImageObject820_0);
+ CResistor.m_mapImageObjects.set("820_90", CResistor.m_ImageObject820_90);
+ CResistor.m_mapImageObjects.set("820_180", CResistor.m_ImageObject820_180);
+ CResistor.m_mapImageObjects.set("820_270", CResistor.m_ImageObject820_270);
+
+ CResistor.m_mapImageObjects.set("1000_0", CResistor.m_ImageObject1k_0);
+ CResistor.m_mapImageObjects.set("1000_90", CResistor.m_ImageObject1k_90);
+ CResistor.m_mapImageObjects.set("1000_180", CResistor.m_ImageObject1k_180);
+ CResistor.m_mapImageObjects.set("1000_270", CResistor.m_ImageObject1k_270);
+
+ CResistor.m_mapImageObjects.set("1200_0", CResistor.m_ImageObject1_2k_0);
+ CResistor.m_mapImageObjects.set("1200_90", CResistor.m_ImageObject1_2k_90);
+ CResistor.m_mapImageObjects.set("1200_180", CResistor.m_ImageObject1_2k_180);
+ CResistor.m_mapImageObjects.set("1200_270", CResistor.m_ImageObject1_2k_270);
+
+ CResistor.m_mapImageObjects.set("1500_0", CResistor.m_ImageObject1_5k_0);
+ CResistor.m_mapImageObjects.set("1500_90", CResistor.m_ImageObject1_5k_90);
+ CResistor.m_mapImageObjects.set("1500_180", CResistor.m_ImageObject1_5k_180);
+ CResistor.m_mapImageObjects.set("1500_270", CResistor.m_ImageObject1_5k_270);
+
+ CResistor.m_mapImageObjects.set("1800_0", CResistor.m_ImageObject1_8k_0);
+ CResistor.m_mapImageObjects.set("1800_90", CResistor.m_ImageObject1_8k_90);
+ CResistor.m_mapImageObjects.set("1800_180", CResistor.m_ImageObject1_8k_180);
+ CResistor.m_mapImageObjects.set("1800_270", CResistor.m_ImageObject1_8k_270);
+
+ CResistor.m_mapImageObjects.set("2200_0", CResistor.m_ImageObject2_2k_0);
+ CResistor.m_mapImageObjects.set("2200_90", CResistor.m_ImageObject2_2k_90);
+ CResistor.m_mapImageObjects.set("2200_180", CResistor.m_ImageObject2_2k_180);
+ CResistor.m_mapImageObjects.set("2200_270", CResistor.m_ImageObject2_2k_270);
+
+ CResistor.m_mapImageObjects.set("2700_0", CResistor.m_ImageObject2_7k_0);
+ CResistor.m_mapImageObjects.set("2700_90", CResistor.m_ImageObject2_7k_90);
+ CResistor.m_mapImageObjects.set("2700_180", CResistor.m_ImageObject2_7k_180);
+ CResistor.m_mapImageObjects.set("2700_270", CResistor.m_ImageObject2_7k_270);
+
+ CResistor.m_mapImageObjects.set("3300_0", CResistor.m_ImageObject3_3k_0);
+ CResistor.m_mapImageObjects.set("3300_90", CResistor.m_ImageObject3_3k_90);
+ CResistor.m_mapImageObjects.set("3300_180", CResistor.m_ImageObject3_3k_180);
+ CResistor.m_mapImageObjects.set("3300_270", CResistor.m_ImageObject3_3k_270);
+
+ CResistor.m_mapImageObjects.set("3900_0", CResistor.m_ImageObject3_9k_0);
+ CResistor.m_mapImageObjects.set("3900_90", CResistor.m_ImageObject3_9k_90);
+ CResistor.m_mapImageObjects.set("3900_180", CResistor.m_ImageObject3_9k_180);
+ CResistor.m_mapImageObjects.set("3900_270", CResistor.m_ImageObject3_9k_270);
+
+ CResistor.m_mapImageObjects.set("4700_0", CResistor.m_ImageObject4_7k_0);
+ CResistor.m_mapImageObjects.set("4700_90", CResistor.m_ImageObject4_7k_90);
+ CResistor.m_mapImageObjects.set("4700_180", CResistor.m_ImageObject4_7k_180);
+ CResistor.m_mapImageObjects.set("4700_270", CResistor.m_ImageObject4_7k_270);
+
+ CResistor.m_mapImageObjects.set("5600_0", CResistor.m_ImageObject5_6k_0);
+ CResistor.m_mapImageObjects.set("5600_90", CResistor.m_ImageObject5_6k_90);
+ CResistor.m_mapImageObjects.set("5600_180", CResistor.m_ImageObject5_6k_180);
+ CResistor.m_mapImageObjects.set("5600_270", CResistor.m_ImageObject5_6k_270);
+
+ CResistor.m_mapImageObjects.set("6800_0", CResistor.m_ImageObject6_8k_0);
+ CResistor.m_mapImageObjects.set("6800_90", CResistor.m_ImageObject6_8k_90);
+ CResistor.m_mapImageObjects.set("6800_180", CResistor.m_ImageObject6_8k_180);
+ CResistor.m_mapImageObjects.set("6800_270", CResistor.m_ImageObject6_8k_270);
+
+ CResistor.m_mapImageObjects.set("8200_0", CResistor.m_ImageObject8_2k_0);
+ CResistor.m_mapImageObjects.set("8200_90", CResistor.m_ImageObject8_2k_90);
+ CResistor.m_mapImageObjects.set("8200_180", CResistor.m_ImageObject8_2_k180);
+ CResistor.m_mapImageObjects.set("8200_270", CResistor.m_ImageObject8_2k_270);
+
+ CResistor.m_mapImageObjects.set("10000_0", CResistor.m_ImageObject10k_0);
+ CResistor.m_mapImageObjects.set("10000_90", CResistor.m_ImageObject10k_90);
+ CResistor.m_mapImageObjects.set("10000_180", CResistor.m_ImageObject10k_180);
+ CResistor.m_mapImageObjects.set("10000_270", CResistor.m_ImageObject10k_270);
+
+ CResistor.m_mapImageObjects.set("12000_0", CResistor.m_ImageObject12k_0);
+ CResistor.m_mapImageObjects.set("12000_90", CResistor.m_ImageObject12k_90);
+ CResistor.m_mapImageObjects.set("12000_180", CResistor.m_ImageObject12k_180);
+ CResistor.m_mapImageObjects.set("12000_270", CResistor.m_ImageObject12k_270);
+
+ CResistor.m_mapImageObjects.set("15000_0", CResistor.m_ImageObject15k_0);
+ CResistor.m_mapImageObjects.set("15000_90", CResistor.m_ImageObject15k_90);
+ CResistor.m_mapImageObjects.set("15000_180", CResistor.m_ImageObject15k_180);
+ CResistor.m_mapImageObjects.set("15000_270", CResistor.m_ImageObject15k_270);
+
+ CResistor.m_mapImageObjects.set("22000_0", CResistor.m_ImageObject22k_0);
+ CResistor.m_mapImageObjects.set("22000_90", CResistor.m_ImageObject22k_90);
+ CResistor.m_mapImageObjects.set("22000_180", CResistor.m_ImageObject22k_180);
+ CResistor.m_mapImageObjects.set("22000_270", CResistor.m_ImageObject22k_270);
+
+ CResistor.m_mapImageObjects.set("27000_0", CResistor.m_ImageObject27k_0);
+ CResistor.m_mapImageObjects.set("27000_90", CResistor.m_ImageObject27k_90);
+ CResistor.m_mapImageObjects.set("27000_180", CResistor.m_ImageObject27k_180);
+ CResistor.m_mapImageObjects.set("27000_270", CResistor.m_ImageObject27k_270);
+
+ CResistor.m_mapImageObjects.set("33000_0", CResistor.m_ImageObject33k_0);
+ CResistor.m_mapImageObjects.set("33000_90", CResistor.m_ImageObject33k_90);
+ CResistor.m_mapImageObjects.set("33000_180", CResistor.m_ImageObject33k_180);
+ CResistor.m_mapImageObjects.set("33000_270", CResistor.m_ImageObject33k_270);
+
+ CResistor.m_mapImageObjects.set("39000_0", CResistor.m_ImageObject39k_0);
+ CResistor.m_mapImageObjects.set("39000_90", CResistor.m_ImageObject39k_90);
+ CResistor.m_mapImageObjects.set("39000_180", CResistor.m_ImageObject39k_180);
+ CResistor.m_mapImageObjects.set("39000_270", CResistor.m_ImageObject39k_270);
+
+ CResistor.m_mapImageObjects.set("47000_0", CResistor.m_ImageObject47k_0);
+ CResistor.m_mapImageObjects.set("47000_90", CResistor.m_ImageObject47k_90);
+ CResistor.m_mapImageObjects.set("47000_180", CResistor.m_ImageObject47k_180);
+ CResistor.m_mapImageObjects.set("47000_270", CResistor.m_ImageObject47k_270);
+
+ CResistor.m_mapImageObjects.set("56000_0", CResistor.m_ImageObject56k_0);
+ CResistor.m_mapImageObjects.set("56000_90", CResistor.m_ImageObject56k_90);
+ CResistor.m_mapImageObjects.set("56000_180", CResistor.m_ImageObject56k_180);
+ CResistor.m_mapImageObjects.set("56000_270", CResistor.m_ImageObject56k_270);
+
+ CResistor.m_mapImageObjects.set("68000_0", CResistor.m_ImageObject68k_0);
+ CResistor.m_mapImageObjects.set("68000_90", CResistor.m_ImageObject68k_90);
+ CResistor.m_mapImageObjects.set("68000_180", CResistor.m_ImageObject68k_180);
+ CResistor.m_mapImageObjects.set("68000_270", CResistor.m_ImageObject68k_270);
+
+ CResistor.m_mapImageObjects.set("82000_0", CResistor.m_ImageObject82k_0);
+ CResistor.m_mapImageObjects.set("82000_90", CResistor.m_ImageObject82k_90);
+ CResistor.m_mapImageObjects.set("82000_180", CResistor.m_ImageObject82k_180);
+ CResistor.m_mapImageObjects.set("82000_270", CResistor.m_ImageObject82k_270);
+
+ CResistor.m_mapImageObjects.set("100000_0", CResistor.m_ImageObject100k_0);
+ CResistor.m_mapImageObjects.set("100000_90", CResistor.m_ImageObject100k_90);
+ CResistor.m_mapImageObjects.set("100000_180", CResistor.m_ImageObject100k_180);
+ CResistor.m_mapImageObjects.set("100000_270", CResistor.m_ImageObject100k_270);
+
+ CResistor.m_mapImageObjects.set("120000_0", CResistor.m_ImageObject120k_0);
+ CResistor.m_mapImageObjects.set("120000_90", CResistor.m_ImageObject120k_90);
+ CResistor.m_mapImageObjects.set("120000_180", CResistor.m_ImageObject120k_180);
+ CResistor.m_mapImageObjects.set("120000_270", CResistor.m_ImageObject120k_270);
+
+ CResistor.m_mapImageObjects.set("150000_0", CResistor.m_ImageObject150k_0);
+ CResistor.m_mapImageObjects.set("150000_90", CResistor.m_ImageObject150k_90);
+ CResistor.m_mapImageObjects.set("150000_180", CResistor.m_ImageObject150k_180);
+ CResistor.m_mapImageObjects.set("150000_270", CResistor.m_ImageObject150k_270);
+
+ CResistor.m_mapImageObjects.set("180000_0", CResistor.m_ImageObject180k_0);
+ CResistor.m_mapImageObjects.set("180000_90", CResistor.m_ImageObject180k_90);
+ CResistor.m_mapImageObjects.set("180000_180", CResistor.m_ImageObject180k_180);
+ CResistor.m_mapImageObjects.set("180000_270", CResistor.m_ImageObject180k_270);
+
+ CResistor.m_mapImageObjects.set("220000_0", CResistor.m_ImageObject220k_0);
+ CResistor.m_mapImageObjects.set("220000_90", CResistor.m_ImageObject220k_90);
+ CResistor.m_mapImageObjects.set("220000_180", CResistor.m_ImageObject220k_180);
+ CResistor.m_mapImageObjects.set("220000_270", CResistor.m_ImageObject220k_270);
+
+ CResistor.m_mapImageObjects.set("330000_0", CResistor.m_ImageObject330k_0);
+ CResistor.m_mapImageObjects.set("330000_90", CResistor.m_ImageObject330k_90);
+ CResistor.m_mapImageObjects.set("330000_180", CResistor.m_ImageObject330k_180);
+ CResistor.m_mapImageObjects.set("330000_270", CResistor.m_ImageObject330k_270);
+
+ CResistor.m_mapImageObjects.set("390000_0", CResistor.m_ImageObject390k_0);
+ CResistor.m_mapImageObjects.set("390000_90", CResistor.m_ImageObject3990);
+ CResistor.m_mapImageObjects.set("390000_180", CResistor.m_ImageObject390_180);
+ CResistor.m_mapImageObjects.set("390000_270", CResistor.m_ImageObject390_270);
+
+ CResistor.m_mapImageObjects.set("470000_0", CResistor.m_ImageObject470k_0);
+ CResistor.m_mapImageObjects.set("470000_90", CResistor.m_ImageObject470k_90);
+ CResistor.m_mapImageObjects.set("470000_180", CResistor.m_ImageObject470k_180);
+ CResistor.m_mapImageObjects.set("470000_270", CResistor.m_ImageObject470k_270);
+
+ CResistor.m_mapImageObjects.set("560000_0", CResistor.m_ImageObject560k_0);
+ CResistor.m_mapImageObjects.set("560000_90", CResistor.m_ImageObject560k_90);
+ CResistor.m_mapImageObjects.set("560000_180", CResistor.m_ImageObject560k_180);
+ CResistor.m_mapImageObjects.set("560000_270", CResistor.m_ImageObject560k_270);
+
+ CResistor.m_mapImageObjects.set("680000_0", CResistor.m_ImageObject680k_0);
+ CResistor.m_mapImageObjects.set("680000_90", CResistor.m_ImageObject680k_90);
+ CResistor.m_mapImageObjects.set("680000_180", CResistor.m_ImageObject680k_180);
+ CResistor.m_mapImageObjects.set("680000_270", CResistor.m_ImageObject680k_270);
+
+ CResistor.m_mapImageObjects.set("820000_0", CResistor.m_ImageObject820k_0);
+ CResistor.m_mapImageObjects.set("820000_90", CResistor.m_ImageObject820k_90);
+ CResistor.m_mapImageObjects.set("820000_180", CResistor.m_ImageObject820k_180);
+ CResistor.m_mapImageObjects.set("820000_270", CResistor.m_ImageObject820k_270);
+
+ CResistor.m_mapImageObjects.set("1000000_0", CResistor.m_ImageObject1M_0);
+ CResistor.m_mapImageObjects.set("1000000_90", CResistor.m_ImageObject1M_90);
+ CResistor.m_mapImageObjects.set("1000000_180", CResistor.m_ImageObject1M_180);
+ CResistor.m_mapImageObjects.set("1000000_270", CResistor.m_ImageObject1M_270);
+
+ CResistor.m_mapImageObjects.set("1200000_0", CResistor.m_ImageObject1_2M_0);
+ CResistor.m_mapImageObjects.set("1200000_90", CResistor.m_ImageObject1_2M_90);
+ CResistor.m_mapImageObjects.set("1200000_180", CResistor.m_ImageObject1_2M_180);
+ CResistor.m_mapImageObjects.set("1200000_270", CResistor.m_ImageObject1_2M_270);
+
+ CResistor.m_mapImageObjects.set("1500000_0", CResistor.m_ImageObject1_5M_0);
+ CResistor.m_mapImageObjects.set("1500000_90", CResistor.m_ImageObject1_5M_90);
+ CResistor.m_mapImageObjects.set("1500000_180", CResistor.m_ImageObject1_5M_180);
+ CResistor.m_mapImageObjects.set("1500000_270", CResistor.m_ImageObject1_5M_270);
+
+ CResistor.m_mapImageObjects.set("1800000_0", CResistor.m_ImageObject1_8M_0);
+ CResistor.m_mapImageObjects.set("1800000_90", CResistor.m_ImageObject1_8M_90);
+ CResistor.m_mapImageObjects.set("1800000_180", CResistor.m_ImageObject1_8M_180);
+ CResistor.m_mapImageObjects.set("1800000_270", CResistor.m_ImageObject1_8M_270);
+
+ CResistor.m_mapImageObjects.set("2200000_0", CResistor.m_ImageObject2_2M_0);
+ CResistor.m_mapImageObjects.set("2200000_90", CResistor.m_ImageObject2_2M_90);
+ CResistor.m_mapImageObjects.set("2200000_180", CResistor.m_ImageObject2_2M_180);
+ CResistor.m_mapImageObjects.set("2200000_270", CResistor.m_ImageObject2_2M_270);
+
+ CResistor.m_mapImageObjects.set("2700000_0", CResistor.m_ImageObject2_7M_0);
+ CResistor.m_mapImageObjects.set("2700000_90", CResistor.m_ImageObject2_7M_90);
+ CResistor.m_mapImageObjects.set("2700000_180", CResistor.m_ImageObject2_7M_180);
+ CResistor.m_mapImageObjects.set("2700000_270", CResistor.m_ImageObject2_7M_270);
+
+ CResistor.m_mapImageObjects.set("3300000_0", CResistor.m_ImageObject3_3M_0);
+ CResistor.m_mapImageObjects.set("3300000_90", CResistor.m_ImageObject3_3M_90);
+ CResistor.m_mapImageObjects.set("3300000_180", CResistor.m_ImageObject3_3M_180);
+ CResistor.m_mapImageObjects.set("3300000_270", CResistor.m_ImageObject3_3M_270);
+
+ CResistor.m_mapImageObjects.set("3900000_0", CResistor.m_ImageObject3_9M_0);
+ CResistor.m_mapImageObjects.set("3900000_90", CResistor.m_ImageObject3_9M_90);
+ CResistor.m_mapImageObjects.set("3900000_180", CResistor.m_ImageObject3_9M_180);
+ CResistor.m_mapImageObjects.set("3900000_270", CResistor.m_ImageObject3_9M_270);
+
+ CResistor.m_mapImageObjects.set("4700000_0", CResistor.m_ImageObject4_7M_0);
+ CResistor.m_mapImageObjects.set("4700000_90", CResistor.m_ImageObject4_7M_90);
+ CResistor.m_mapImageObjects.set("4700000_180", CResistor.m_ImageObject4_7M_180);
+ CResistor.m_mapImageObjects.set("4700000_270", CResistor.m_ImageObject4_7M_270);
+
+ CResistor.m_mapImageObjects.set("5600000_0", CResistor.m_ImageObject5_6M_0);
+ CResistor.m_mapImageObjects.set("5600000_90", CResistor.m_ImageObject5_6M_90);
+ CResistor.m_mapImageObjects.set("5600000_180", CResistor.m_ImageObject5_6M_180);
+ CResistor.m_mapImageObjects.set("5600000_270", CResistor.m_ImageObject5_6M_270);
+
+ CResistor.m_mapImageObjects.set("6800000_0", CResistor.m_ImageObject6_8M_0);
+ CResistor.m_mapImageObjects.set("6800000_90", CResistor.m_ImageObject6_8M_90);
+ CResistor.m_mapImageObjects.set("6800000_180", CResistor.m_ImageObject6_8M_180);
+ CResistor.m_mapImageObjects.set("6800000_270", CResistor.m_ImageObject6_8M_270);
+
+ CResistor.m_mapImageObjects.set("8200000_0", CResistor.m_ImageObject8_2M_0);
+ CResistor.m_mapImageObjects.set("8200000_90", CResistor.m_ImageObject8_2M_90);
+ CResistor.m_mapImageObjects.set("8200000_180", CResistor.m_ImageObject8_2M_180);
+ CResistor.m_mapImageObjects.set("8200000_270", CResistor.m_ImageObject8_2M_270);
+
+ CResistor.m_mapImageObjects.set("10000000_0", CResistor.m_ImageObject10M_0);
+ CResistor.m_mapImageObjects.set("10000000_90", CResistor.m_ImageObject10M_90);
+ CResistor.m_mapImageObjects.set("10000000_180", CResistor.m_ImageObject10M_180);
+ CResistor.m_mapImageObjects.set("10000000_270", CResistor.m_ImageObject10M_270);
+ }
+ }
+
+ constructor()
+ {
+ super("RESISTOR");
+ CResistor.doCreateImageObjectMap();
+ super.setDeviceName("RESISTOR1");
+ this.m_fScale = this.m_fDefaultScale = 8.2;
+ this.m_bIsBlown = false;
+ this.m_fResistance = 0;
+
+ this.doAddPin(new CPin(0, false, false, "pin 1", this.getDeviceName()));
+ this.doAddPin(new CPin(1, false, false, "pin 2", this.getDeviceName()));
+ this.doSetResistance(10000);
+ this.doRotate(0);
+
+ this.m_strEditHTML += "
" +
+ " " +
+ " " +
+ "
";
+ }
+
+ doStopRun()
+ {
+ }
+
+ doRun()
+ {
+ if (!this.m_bIsBlown)
+ {
+ var fPin1Voltage = this.m_arrayPins[0].getVoltage();
+ var fPin2Voltage = this.m_arrayPins[1].getVoltage();
+ var fTotalVoltage = Math.abs(fPin1Voltage - fPin2Voltage);
+ var fResistance = this.m_arrayPins[0].getResistance() + this.m_arrayPins[0].getResistance() + this.m_fResistance;
+ var fCurrent = fTotalVoltage / fResistance, fPower = 0;
+
+ fCurrent = fTotalVoltage / fResistance;
+ fPower = fCurrent * fTotalVoltage;
+
+ if (fPower > 0.5)
+ this.doBlown();
+ }
+ }
+
+ doRead(strFileContents)
+ {
+ strFileContents = super.doRead(strFileContents);
+
+ var strTemp = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, strTemp);
+ this.m_fResistance = parseFloat(strTemp);
+
+ return strFileContents;
+ }
+
+ doWrite(strFileContents)
+ {
+ strFileContents = super.doWrite(strFileContents);
+
+ strFileContents += this.m_fResistance + "\r\n";
+
+ return strFileContents;
+ }
+
+ getResistance()
+ {
+ return this.m_fResistance;
+ }
+
+ getVoltage(strDeviceNameIn, strPinIDIn)
+ {
+ var strDeviceNameOut = this.getDeviceName(), strPinIDOut = "", strWireName = "";
+ var fVoltage = 0;
+
+ if (this.m_arrayPins[0].getPinID() != strPinIDIn)
+ {
+ strWireName = this.m_arrayPins[0].getWire();
+ strPinIDOut = this.m_arrayPins[0].getPinID();
+ }
+ else if (this.m_arrayPins[1].getPinID() != strPinIDIn)
+ {
+ strWireName = this.m_arrayPins[1].getWire();
+ strPinIDOut = this.m_arrayPins[1].getPinID();
+ }
+ if ((strWireName != "") && g_mapPlacedComponents.get(strWireName))
+ fVoltage = g_mapPlacedComponents.get(strWireName).getVoltage(strDeviceNameOut, strPinIDOut);
+
+ return fVoltage;
+ }
+
+ doSetResistance(fResistance)
+ {
+ var strKey = "";
+
+ if (fResistance == 1)
+ strKey = fResistance.toString() + ".0";
+ else
+ strKey = fResistance.toString();
+
+ strKey = strKey.replace(".", "_");
+ strKey += "_";
+
+ this.m_ImageObject0 = CResistor.m_mapImageObjects.get(strKey + "0");
+ this.m_ImageObject90 = CResistor.m_mapImageObjects.get(strKey + "90");
+ this.m_ImageObject180 = CResistor.m_mapImageObjects.get(strKey + "180");
+ this.m_ImageObject270 = CResistor.m_mapImageObjects.get(strKey + "270");
+
+ this.m_fResistance = fResistance;
+ }
+
+ doSetPinPositions()
+ {
+ if (this.m_nRotationAngle == 0)
+ {
+ this.m_arrayPins[0].set(this.m_rectangle.m_pointTL, new CSize(0, 4));
+ this.m_arrayPins[1].set(this.m_rectangle.m_pointTL, new CSize(48, 4));
+ }
+ else if (this.m_nRotationAngle == 90)
+ {
+ this.m_arrayPins[0].set(this.m_rectangle.m_pointTL, new CSize(4, 0));
+ this.m_arrayPins[1].set(this.m_rectangle.m_pointTL, new CSize(4, 48));
+ }
+ else if (this.m_nRotationAngle == 180)
+ {
+ this.m_arrayPins[0].set(this.m_rectangle.m_pointTL, new CSize(0, 4));
+ this.m_arrayPins[1].set(this.m_rectangle.m_pointTL, new CSize(48, 4));
+ }
+ else if (this.m_nRotationAngle == 270)
+ {
+ this.m_arrayPins[0].set(this.m_rectangle.m_pointTL, new CSize(4, 0));
+ this.m_arrayPins[1].set(this.m_rectangle.m_pointTL, new CSize(4, 48));
+ }
+ }
+
+ doSelect()
+ {
+ this.m_bSelected = true;
+ var strHTML = this.m_strEditHTML;
+ strHTML = strHTML.replace("XXXX", this.m_strDeviceName);
+ strHTML = strHTML.replace("YYYY", this.m_strDeviceName);
+ strHTML = strHTML.replace("ZZZZ", this.m_strDeviceName);
+ doShowEditFields(strHTML);
+ }
+
+ doBlown()
+ {
+ this.m_ImageObject0 = CResistor.m_ImageObjectBlown_0;
+ this.m_ImageObject90 = CResistor.m_ImageObjectBlown_90;
+ this.m_ImageObject180 = CResistor.m_ImageObjectBlown_180;
+ this.m_ImageObject270 = CResistor.m_ImageObjectBlown_270;
+ this.m_bIsBlown = true;
+ }
+
+ doUnblown()
+ {
+ this.doSetResistance(this.m_fResistance);
+ }
+
+ doDisplay()
+ {
+ super.doDisplay();
+ }
+
+}
+
diff --git a/ardublockly/PinDataStructures.js b/ardublockly/PinDataStructures.js
new file mode 100644
index 0000000000..a2f96c5ed3
--- /dev/null
+++ b/ardublockly/PinDataStructures.js
@@ -0,0 +1,431 @@
+//*************************************************************************
+//*
+//* PIN WITH CONNECTED COMPONENT
+//*
+//*************************************************************************
+
+class CPin
+{
+ constructor(nPinNum, bIsPWM, bIsAnalog, strPinID, strParentDeviceName)
+ {
+ this.m_nPinNum = nPinNum;
+ this.m_nState = 0;
+ this.m_nPWM = 0;
+ this.m_strMode = INPUT;
+ this.m_bIsPWM = bIsPWM;
+ this.m_bIsAnalog = bIsAnalog;
+ this.m_sizeOffsetFromTL = new CSize(0, 0);
+ this.m_strParentDeviceName = strParentDeviceName;
+ this.m_strPinID = strPinID;
+ this.m_strWireName = "";
+
+ var point = new CPoint(0, 0);
+ var size = new CSize(4, 4);
+ this.m_rectangle = new CRectangle(point, size);
+ }
+
+ doRead(strFileContents)
+ {
+ this.m_strPinID = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, this.m_strPinID);
+
+ this.m_strWireName = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, this.m_strWireName);
+
+ return strFileContents;
+ }
+
+ doWrite(strFileContents)
+ {
+ strFileContents += this.m_strPinID + "\r\n";
+ strFileContents += this.m_strWireName + "\r\n";
+
+ return strFileContents;
+ }
+
+ canAcceptConection()
+ {
+ return this.m_strWireName == "";
+ }
+
+ doSetDeviceName(strParentDeviceName)
+ {
+ this.m_strParentDeviceName = strParentDeviceName;
+ }
+
+ isDataPin()
+ {
+ return true;
+ }
+
+ getPWM()
+ {
+ return this.m_nPWM;
+ }
+
+ getState()
+ {
+ return this.m_nState;
+ }
+
+ getType()
+ {
+ return "PIN";
+ }
+
+ getPinID()
+ {
+ return this.m_strPinID;
+ }
+
+ getWire()
+ {
+ return this.m_strWireName;
+ }
+
+ setWire(strWireName)
+ {
+ this.m_strWireName = strWireName;
+ }
+
+ doDeleteWire(strWireName)
+ {
+ if (this.m_strWireName == strWireName)
+ this.m_strWireName = "";
+ }
+
+ set(pointParentTL, sizeOffsetFromTL)
+ {
+ this.m_sizeOffsetFromTL = new CSize(sizeOffsetFromTL.m_nWidth, sizeOffsetFromTL.m_nHeight);
+ this.doMove(pointParentTL);
+ }
+
+ getPosition()
+ {
+ return this.m_rectangle.getCenter();
+ }
+
+ doConnectedMove(strParentDeviceName)
+ {
+ if ((this.m_strWireName != "") && (g_mapPlacedComponents.get(this.m_strWireName) != null))
+ g_mapPlacedComponents.get(this.m_strWireName).doConnectedMove(this.m_rectangle.getCenter(), strParentDeviceName, this.m_strPinID);
+ }
+
+ doMove(pointParentTL)
+ {
+ this.m_rectangle.setPosition(new CPoint(pointParentTL.m_nX + this.m_sizeOffsetFromTL.m_nWidth, pointParentTL.m_nY + this.m_sizeOffsetFromTL.m_nHeight));
+ }
+
+ doGetZoomFactor()
+ {
+ var nZoom = g_mapPlacedComponents.get(this.m_strParentDeviceName).getZoom();
+ var nFudge = 1.06;
+
+ if (nZoom == 0)
+ nZoom = 1;
+ else if (nZoom < 0)
+ nZoom = 1 / (Math.abs(nZoom) * nFudge);
+ else if (nZoom > 0)
+ nZoom *= nFudge;
+
+ return nZoom;
+ }
+
+ doDisplay(bFill)
+ {
+ var rect = this.m_rectangle;
+ var nZoomFactor = this.doGetZoomFactor();
+
+ g_CanvasContext.beginPath();
+ g_CanvasContext.strokeStyle = "blue";
+ g_CanvasContext.lineWidth = "1";
+ if (bFill)
+ {
+ g_CanvasContext.fillStyle = "blue";
+ g_CanvasContext.fillRect(rect.m_pointTL.m_nX * nZoomFactor, rect.m_pointTL.m_nY * nZoomFactor, rect.m_size.m_nWidth, rect.m_size.m_nHeight);
+ doDisplayHint("PIN ID", this.m_strPinID);
+ }
+ else
+ {
+ g_CanvasContext.rect(rect.m_pointTL.m_nX * nZoomFactor, rect.m_pointTL.m_nY * nZoomFactor, rect.m_size.m_nWidth, rect.m_size.m_nHeight);
+ }
+ g_CanvasContext.stroke();
+
+ if ((this.m_strWireName != "") && (g_mapPlacedComponents.get(this.m_strWireName) != null))
+ g_mapPlacedComponents.get(this.m_strWireName).doDisplay();
+ }
+
+ isMouseIn(pointMousePos)
+ {
+ return this.m_rectangle.isMouseIn(pointMousePos);
+ }
+
+ doMouseOver(pointMousePos)
+ {
+ var bResult = false;
+ var rect = new CRectangle(this.m_rectangle.m_pointTL, this.m_rectangle.m_size);
+ var pointCenter = rect.getCenter();
+
+
+ if (rect.isMouseIn(pointMousePos))
+ {
+ doDisplayAllComponents();
+
+ this.doDisplay(true);
+ this.m_bImageDrawn = true;
+
+ bResult = true;
+ }
+ else
+ {
+ this.doDisplay(false);
+ doDisplayHint("", "");
+ }
+ return bResult;
+ }
+
+ pinMode(strMode)
+ {
+ if ((strMode != INPUT_HIGH) && (strMode != INPUT) && (strMode != OUTPUT))
+ doErrorMessage(g_strErrorMessage + "unexpected pin mode '" + strMode + "' for pin '" + this.m_nPinNum + "'!");
+ else
+ this.m_strMode = strMode;
+ }
+
+ digitalRead()
+ {
+ var nState = 0;
+
+ if ((this.m_strMode == INPUT) || (this.m_strMode == INPUT_HIGH))
+ nState = this.m_nState;
+ else
+ doErrorMessage(g_strErrorMessage + "attempting to read from pin '" + this.m_nPinNum + "' which is in '" + this.m_strMode + "' mode!");
+
+ return nState;
+ }
+
+ digitalWrite(strState)
+ {
+ if (this.m_strMode == OUTPUT)
+ {
+ this.m_nPWM = -1;
+
+ if ((strState == "true") || (strState == "1") || (strState == HIGH))
+ this.m_nState = 1;
+ else if ((strState == "false") || (strState == "0") || (strState == LOW))
+ this.m_nState = 0;
+ else
+ {
+ let nState = parseInt(strState);
+ if (isNAN(nState))
+ doErrorMessage(g_strErrorMessage + "attempting to write to pin '" + this.m_nPinNum + "' an invalid value '" + strState + "'!");
+ else
+ this.m_nState = 1;
+ }
+//console.log("Pin " + this.m_strPinID + ": " + this.m_nState);
+ }
+ else
+ doErrorMessage(g_strErrorMessage + "attempting to write to pin '" + this.m_nPinNum + "' which is in '" + this.m_strMode + "' mode!");
+ }
+
+ analogWrite(strPWMVal)
+ {
+ var nPWM = parseInt(strPWMVal);
+
+ if (this.m_strMode != OUTPUT)
+ doErrorMessage(g_strErrorMessage + "attempting to analog write to pin '" + this.m_nPinNum + "' which is in '" + this.m_strMode + "' mode!");
+ else if (!this.m_bIsPWM)
+ doErrorMessage(g_strErrorMessage + "attempting to analog write to pin '" + this.m_nPinNum + "' which is not a PWM pin!");
+ else if (isNaN(nPWM))
+ doErrorMessage(g_strErrorMessage + "attempting to analog write an invalid value '" + strPWMVal + "'!");
+ else
+ {
+ this.m_nState = -1;
+ this.m_nPWM = nPWM;
+ }
+ }
+
+ analogRead()
+ {
+ var nVal = 0;
+
+ if (this.m_strMode == OUTPUT)
+ doErrorMessage(g_strErrorMessage + "attempting to analog read from pin '" + this.m_nPinNum + "' which is in '" + this.m_strMode + "' mode!");
+ else
+ nVal = this.m_nState;
+
+ return nVal;
+ }
+
+ doUpdate()
+ {
+ var strName = "";
+ var Wire = g_mapPlacedComponents.get(this.m_strWireName);
+
+ if (Wire != null)
+ {
+ for (let nI = 0; nI < Wire.doGetNumConnections(); nI++)
+ {
+ strName = Wire.doGetConnectionName(nI);
+ if ((strName != "") && (g_mapPlacedComponents.get(strName) != null))
+ {
+ g_mapPlacedComponents.get(strName).doUpdate(this.m_nState);
+ }
+ }
+ }
+ }
+
+ doRun()
+ {
+ }
+
+ doDeleteWire(strWireName)
+ {
+ if (this.m_strWireName == strWireName)
+ this.m_strWireName = "";
+ }
+
+ getVoltage()
+ {
+ var fVoltage = 0;
+
+ fVoltage = g_mapPlacedComponents.get(this.m_strWireName).getVoltage(this.m_strParentDeviceName, this.m_strPinID);
+
+ return fVoltage;
+ }
+
+ getResistance()
+ {
+ var fResistance = 0;
+
+ fResistance += g_mapPlacedComponents.get(this.m_strWireName).getResistance(this.m_strParentDeviceName, this.m_strPinID);
+
+ return fResistance;
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* 5V PIN WITH CONNECTED COMPONENTS
+//*
+//*************************************************************************
+
+class C5VPin extends CPin
+{
+ static m_nPinIDCounter = 1;
+
+ constructor(nPinNum, strParentDeviceName)
+ {
+ super(nPinNum, false, false, "5V_" + C5VPin.m_nPinIDCounter, strParentDeviceName);
+ C5VPin.m_nPinIDCounter++;
+ this.m_nState = 1;
+ this.m_strMode = OUTPUT;
+ }
+
+ isDataPin()
+ {
+ return false;
+ }
+
+ getState()
+ {
+ return 1;
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* 3.3V PIN WITH CONNECTED COMPONENTS
+//*
+//*************************************************************************
+
+class C3_3VPin extends CPin
+{
+ static m_nPinIDCounter = 1;
+
+ constructor(nPinNum, strParentDeviceName)
+ {
+ super(nPinNum, false, false, "3.3V_" + C3_3VPin.m_nPinIDCounter, strParentDeviceName);
+ C3_3VPin.m_nPinIDCounter++;
+ this.m_nState = 1;
+ this.m_strMode = OUTPUT;
+ }
+
+ isDataPin()
+ {
+ return false;
+ }
+
+ getState()
+ {
+ return 1;
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* GND PIN WITH CONNECTED COMPONENTS
+//*
+//*************************************************************************
+
+class CGNDPin extends CPin
+{
+ static m_nPinIDCounter = 1;
+
+ constructor(nPinNum, strParentDeviceName)
+ {
+ super(nPinNum, false, false, "GND_" + CGNDPin.m_nPinIDCounter, strParentDeviceName);
+ CGNDPin.m_nPinIDCounter++;
+ this.m_nState = 0;
+ this.m_strMode = OUTPUT;
+ }
+
+ isDataPin()
+ {
+ return false;
+ }
+
+ getState()
+ {
+ return 0;
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* RESET PIN WITH CONNECTED COMPONENT
+//*
+//*************************************************************************
+
+class CResetPin extends CPin
+{
+ constructor(nPinNum, strParentDeviceName)
+ {
+ super(nPinNum, false, false, "RESET", strParentDeviceName);
+ this.m_nState = 0;
+ this.m_strMode = INPUT;
+ }
+
+ isDataPin()
+ {
+ return false;
+ }
+
+}
+
diff --git a/ardublockly/PortDataStructures.js b/ardublockly/PortDataStructures.js
new file mode 100644
index 0000000000..4d19feaf94
--- /dev/null
+++ b/ardublockly/PortDataStructures.js
@@ -0,0 +1,267 @@
+//*************************************************************************
+//*
+//* BASE PORT
+//*
+//*************************************************************************
+
+class CBasePort
+{
+ constructor(strDeviceName)
+ {
+ this.m_mapConnectedDevices = new Map();
+ this.m_strDeviceName = strDeviceName;
+ }
+
+ addDevice(strHexAddress, strComponentName)
+ {
+ this.m_mapConnectedDevices.set(strHexAddress, strComponentName);
+ }
+
+ removeDevice(strComponentName)
+ {
+ var mapDeviceNames = new Map();
+ var strDeviceName = "", strSelectedDeviceName = "";
+
+ g_mapPlacedComponents.forEach(function(strValue, strKey, map){mapDeviceNames.set([strValue, strKey])});
+ this.m_mapConnectedDevices.delete(mapDeviceNames.get(strComponentName));
+ }
+
+ doDeleteAllDevices()
+ {
+ this.m_mapConnectedDevices.clear();
+ }
+
+ setDeviceName(strNewDeviceName)
+ {
+ this.m_strDeviceName = strNewDeviceName;
+ }
+
+ getDeviceName()
+ {
+ return this.m_strDeviceName;
+ }
+}
+
+
+
+
+//*************************************************************************
+//*
+//* I2C PORT
+//*
+//*************************************************************************
+
+class CI2CPort extends CBasePort
+{
+ constructor(nClockPin, nDataPin, strDeviceName)
+ {
+ super(strDeviceName);
+ this.m_nClockPin = nClockPin;
+ this.m_nDataPin = nDataPin;
+ }
+
+ send(strHexAddress, Data)
+ {
+ var strComponentName = m_mapConnectedDevices.get(strHexAddress);
+ var Component = g_mapPlacedComponents[strComponentName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "I2C device with hex address '" + strHexAddress + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.send(Data);
+
+ return Data;
+ }
+
+ receive(strHexAddress)
+ {
+ var Data = null;
+ var strComponentName = m_mapConnectedDevices.get(strHexAddress);
+ var Component = g_mapPlacedComponents[strComponentName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "I2C device with hex address '" + strHexAddress + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.receive();
+
+ return Data;
+ }
+
+ checkConnection(Component)
+ {
+ var bIsCorrect = false;
+ var strDeviceName = this.m_mapConnectedDevices[strHexAddress];
+ var Component = g_mapPlacedComponents[strDeviceName];
+
+ if (Component.isI2CDevice())
+ {
+ if (Component.getI2CDataPin() != this.m_nDataPin)
+ doErrorMessage(g_strErrorMessage + "I2C data pin mismatch, '" + strDeviceName + "': " + Component.getI2CDataPin() + ", '" +
+ this.m_strDeviceName + "', " + this.m_nDataPin + "!");
+ else if (Component.getI2CDataPin() != this.m_nDataPin)
+ doErrorMessage(g_strErrorMessage + "I2C clock pin mismatch, '" + strDeviceName + "': " + Component.getI2CClockPin() + ", '" +
+ this.m_strDeviceName + "', " + this.m_nClockPin + "!");
+ else
+ bIsCorrect = true;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + "device '" + strDeviceName + "', is not an I2C device!");
+
+ return bIsCorrect;
+ }
+}
+
+
+
+
+//*************************************************************************
+//*
+//* SPI PORT
+//*
+//*************************************************************************
+
+class CSPIPort extends CBasePort
+{
+ constructor(nMOSIPin, nMISOPin, nCLKPin, strDeviceName)
+ {
+ super(strDeviceName);
+ this.m_nMOSIPin = nMOSIPin;
+ this.m_nMISOPin = nMISOPin;
+ this.m_nCLKPin = nCLKPin;
+ }
+
+ send(nCSPin, Data)
+ {
+ var strComponentName = m_mapConnectedDevices.get(nCSPin);
+ var Component = g_mapPlacedComponents[strComponentName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "SPI device using CS pin '" + nCSPin + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.send(Data);
+
+ return Data;
+ }
+
+ receive(nCSPin)
+ {
+ var Data = null;
+ var strComponentName = m_mapConnectedDevices.get(nCSPin);
+ var Component = g_mapPlacedComponents[strComponentName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "SPI device using CS pin '" + nCSPin + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.receive();
+
+ return Data;
+ }
+
+ checkConnection(Component)
+ {
+ var bIsCorrect = false;
+ var strDeviceName = this.m_mapConnectedDevices[Component.getCSPin()];
+ var Component = g_mapPlacedComponents[strDeviceName];
+
+ if (Component.isSPIDevice())
+ {
+ if (Component.getMOSIPin() != this.m_nMOSIPin)
+ doErrorMessage(g_strErrorMessage + "SPI MOSI mismatch, '" + strDeviceName + "': " + Component.getMOSIPin() + ", '" +
+ this.m_strDeviceName + "', " + this.m_nMOSIPin + "!");
+ else if (Component.getMISOPin() != this.m_nMISOPin)
+ doErrorMessage(g_strErrorMessage + "SPI MISO mismatch, '" + strDeviceName + "': " + Component.getMISOPin() + ", '" +
+ this.m_strDeviceName + "', " + this.m_nMISOPin + "!");
+ else if (Component.getCLKPin() != this.m_nCLKPin)
+ doErrorMessage(g_strErrorMessage + "SPI CLK mismatch, '" + strDeviceName + "': " + Component.getCLKPin() + ", '" +
+ this.m_strDeviceName + "', " + this.m_nCLKPin + "!");
+ else
+ bIsCorrect = true;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + "device '" + strDeviceName + "', is not an SPI device!");
+
+ return bIsCorrect;
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* SERIAL PORT
+//*
+//*************************************************************************
+
+class CSerialPort extends CBasePort
+{
+ constructor(nTxPin, nRxPin, strDeviceName)
+ {
+ super(strDeviceName);
+ this.m_nTxPin = nTxPin;
+ this.m_nRxPin = nRxPin;
+ }
+
+ send(Data)
+ {
+ var Component = g_mapPlacedComponents[this.m_strConnectedDeviceName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "serial device '" + this.m_strConnectedDeviceName + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.send(Data);
+
+ return Data;
+ }
+
+ receive()
+ {
+ var Data = null;
+ var Component = g_mapPlacedComponents[this.m_strConnectedDeviceName];
+
+ if (Component == null)
+ Data = g_strErrorMessage + "serial device with name '" + this.m_strConnectedDeviceName + "' not found!";
+ else if (!checkConnection(Component))
+ Data = this.m_strErrorMessage;
+ else
+ Data = Component.receive();
+
+ return Data;
+ }
+
+ checkConnection(Component)
+ {
+ var bIsCorrect = false;
+ var Component = g_mapPlacedComponents[this.m_strConnectedDeviceName];
+
+ if (Component.isSerialDevice())
+ {
+ if (Component.getSerialTxPin() == this.m_nTxPin)
+ doErrorMessage(g_strErrorMessage + "'" + strDeviceName + "' Tx pin should be connected to Rx pin of '" + this.m_strDeviceName + "'!");
+ else if (Component.getSerialRxPin() == this.m_nRxPin)
+ doErrorMessage(g_strErrorMessage + "'" + strDeviceName + "' Rx pin should be connected to Tx pin of '" + this.m_strDeviceName +
+ "' (" + this.m_strTxPin + ")!");
+ else
+ bIsCorrect = true;
+ }
+ else
+ doErrorMessage(g_strErrorMessage + "device '" + this.m_strConnectedDeviceName + "', is not an serial device!");
+
+ return bIsCorrect;
+ }
+}
+
+
+
+
diff --git a/ardublockly/SerialMonitorDataStructures.js b/ardublockly/SerialMonitorDataStructures.js
new file mode 100644
index 0000000000..594463de1a
--- /dev/null
+++ b/ardublockly/SerialMonitorDataStructures.js
@@ -0,0 +1,154 @@
+//*************************************************************************
+//*
+//* SERIAL MONITOR
+//*
+//*************************************************************************
+
+class CSerialMonitor
+{
+ constructor()
+ {
+ this.m_nSelectedBaudRate = 0;
+ this.m_nBeginBaudRate = 0;
+ this.m_strTextWaiting = "";
+ this.m_bAutoScroll = true;
+ this.m_bIsOpen = false;
+ }
+
+ begin(nBaudRate)
+ {
+ this.m_nBeginBaudRate = nBaudRate;
+ }
+
+ setOpen()
+ {
+ this.m_bIsOpen = true;
+ }
+
+ setClose()
+ {
+ this.m_bIsOpen = false;
+ }
+
+ select(nBaudRate)
+ {
+ this.m_nSelectedBaudRate = nBaudRate;
+ }
+
+ doBaudRatesMatch()
+ {
+ var bMatch = false;
+
+ if (this.m_nSelectedBaudRate != this.m_nBeginBaudRate)
+ doErrorMessage("Selected baud rate (" + this.m_nSelectedBaudRate + ") and programatic baud rate (" + this.m_nBeginBaudRate + ") do not match!")
+ else
+ bMatch = true;
+
+ return bMatch;
+ }
+
+ setTextWaiting(strTextWaiting)
+ {
+ var bResult = false;
+
+ if (this.doBaudRatesMatch())
+ {
+ this.m_strTextWaiting = strTextWaiting;
+ bResult = true;
+ }
+ return bResult;
+ }
+
+ printText(strText)
+ {
+ var bResult = false;
+ var SerialMonitorDiv = getElement("content_serial_monitor");
+
+ if ((SerialMonitorDiv != null) && this.m_bIsOpen)
+ {
+ if (this.doBaudRatesMatch())
+ {
+ if ((strText[0] == "\"") || (strText[0] == "'"))
+ strText = strText.substring(1, strText.length - 1);
+
+ if (SerialMonitorDiv.innerText.length > 10000)
+ SerialMonitorDiv.innerText = strText;
+ else
+ SerialMonitorDiv.innerText += strText;
+
+ if (!this.m_bAutoScroll)
+ SerialMonitorDiv.scrollTop = 0;
+ else
+ SerialMonitorDiv.scrollTop = SerialMonitorDiv.scrollHeight;
+
+ bResult = true;
+ }
+ }
+ return bResult;
+ }
+
+ printlnText(strText)
+ {
+ var bResult = this.printText(strText);
+
+ if (bResult)
+ this.printText("\n");
+
+ return bResult;
+ }
+
+ printInt(nVal, strBase)
+ {
+ var strText = "";
+
+ if ((strBase == null) || (strBase == "DEC"))
+ strText = nVal.toString(10);
+ else if (strBase == "HEX")
+ strText = nVal.toString(16);
+ else if (strBase == "OCT")
+ strText = nVal.toString(8);
+ else if (strBase == "BIN")
+ strText = nVal.toString(2);
+
+ return this.print(strText);
+ }
+
+ printlnInt(nVal, strBase)
+ {
+ var bResult = printInt(nVal, strBase);
+
+ if (bResult)
+ printText("\n");
+
+ return bResult;
+ }
+
+ setAutoScroll(bAutoScroll)
+ {
+ this.m_bAutoScroll = bAutoScroll;
+ }
+
+}
+
+//*************************************************************************
+//*
+//* GLOBAL VARIBALES
+//*
+//*************************************************************************
+
+var g_SerialMonitor = new CSerialMonitor();
+
+function setSerialMonitorBaudRate()
+{
+ var SelectBaudRate = document.getElementById("Baud");
+ SelectBaudRate.selectedIndex = 12;
+ var nBaud = SelectBaudRate.options[SelectBaudRate.selectedIndex].value;
+
+ g_SerialMonitor.select(nBaud);
+}
+
+setSerialMonitorBaudRate();
+
+
+
+
diff --git a/ardublockly/Simulation.htm b/ardublockly/Simulation.htm
new file mode 100644
index 0000000000..5233586229
--- /dev/null
+++ b/ardublockly/Simulation.htm
@@ -0,0 +1,1546 @@
+
+
+
+
+
+
+
+
+
+
Ardublockly Simulator
+
+
+
+
+
+
+
+
+
+
+
+
+ LOADING...
+
+
+
+
+
+
+
+
diff --git a/ardublockly/WireDataStructures.js b/ardublockly/WireDataStructures.js
new file mode 100644
index 0000000000..340ae98798
--- /dev/null
+++ b/ardublockly/WireDataStructures.js
@@ -0,0 +1,666 @@
+//*************************************************************************
+//*
+//* CONNECTED COMPONENT DETAILS
+//*
+//*************************************************************************
+
+class CConnectedDevice
+{
+ constructor(strDeviceName, strPinID, strType, nNodeIndex)
+ {
+ this.m_strDeviceName = strDeviceName;
+ this.m_strPinID = strPinID;
+ this.m_strType = strType;
+ this.m_nNodeIndex = nNodeIndex;
+ }
+
+ doRead(strFileContents)
+ {
+ this.m_strDeviceName = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, this.m_strDeviceName);
+
+ this.m_strPinID = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, this.m_strPinID);
+
+ this.m_strType = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, this.m_strType);
+
+ var strTemp = doReadNextToken(strFileContents);
+ strFileContents = doDeleteToken(strFileContents, strTemp);
+ this.m_nNodeIndex = parseInt(strTemp);
+
+ return strFileContents;
+ }
+
+ doWrite(strFileContents)
+ {
+ strFileContents += this.m_strDeviceName + "\r\n";
+ strFileContents += this.m_strPinID + "\r\n";
+ strFileContents += this.m_strType + "\r\n";
+ strFileContents += this.m_nNodeIndex + "\r\n";
+
+ return strFileContents;
+ }
+
+ getDeviceName()
+ {
+ return this.m_strDeviceName;
+ }
+
+ getPinID()
+ {
+ return this.m_strPinID;
+ }
+
+ getType()
+ {
+ return this.m_strType;
+ }
+
+ getNodeIndex()
+ {
+ return this.m_nNodeIndex;
+ }
+
+ setDeviceName(strDeviceName)
+ {
+ this.m_strDeviceName = strDeviceName;
+ }
+
+ setPinID(strPinID)
+ {
+ this.m_strPinID = strPinID;
+ }
+
+ setType(strType)
+ {
+ this.m_strType = strType;
+ }
+
+ setNodeIndex(nNodeIndex)
+ {
+ this.m_nNodeIndex = nNodeIndex;
+ }
+
+ isEmpty()
+ {
+ return (this.m_strDeviceName == "") && (this.m_strPinID == "");
+ }
+
+}
+
+
+
+
+//*************************************************************************
+//*
+//* WIRE
+//*
+//*************************************************************************
+
+function doChangeWireColor(strNewColor)
+{
+ var strName = doFindSelectedComponentNoMouse();
+
+ if ((strName != "") && (g_mapPlacedComponents.get(strName) != null) && (g_mapPlacedComponents.get(strName).getType() == "WIRE"))
+ {
+ g_mapPlacedComponents.get(strName).doSetColor(strNewColor);
+ doDisplayAllComponents();
+ }
+}
+
+class CWire
+{
+ static m_nWireCount = 1;
+ static m_nNodeRadius = 4;
+
+ constructor(strColor)
+ {
+ CWire.m_nWireCount++;
+ this.m_arrayPoints = [];
+ this.m_strColor = strColor;
+ this.m_strType = "WIRE";
+ this.m_strDeviceName = this.m_strType + CWire.m_nWireCount;
+ this.m_nWidth = 3;
+ this.m_bSelected = false;
+ this.m_pointTemp = new CPoint(0, 0);
+ this.m_nIndexGrabbedPoint = -1;
+ this.m_arrayConnectedDevices = [];
+ this.m_bHighlight = false;
+ this.m_pointLastMousePos = new CPoint(0, 0);
+ this.m_TempConnectedDevice = new CConnectedDevice("", "", "", -1);
+ this.m_nZoom = 0;
+
+ this.m_strHTML = "
WIRE COLORS:
" +
+
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+
+ "
";
+ }
+
+ doWrite(strFileContents)
+ {
+ strFileContents += this.m_strDeviceName + "\r\n";
+ for (let nI = 0; nI < this.m_arrayConnectedDevices.length; nI++)
+ strFileContents += this.m_arrayConnectedDevices.doWrite(strFileContents);
+ return strFileContents;
+ }
+
+ doRun()
+ {
+ }
+
+ doStopRun()
+ {
+ }
+
+ getVoltage(strDeviceNameIn, strPinIDIn)
+ {
+ var strDeviceNameOut = "", strPinIDOut = "";
+ var fVoltage = 0;
+
+ if ((this.m_arrayConnectedDevices.length > 0) && (this.m_arrayConnectedDevices[0].getDeviceName() != strDeviceNameIn) && (this.m_arrayConnectedDevices[0].getPinID() != strPinIDIn))
+ {
+ strDeviceNameOut = this.m_arrayConnectedDevices[0].getDeviceName();
+ strPinIDOut = this.m_arrayConnectedDevices[0].getPinID();
+ }
+ else if ((this.m_arrayConnectedDevices.length > 1) && (this.m_arrayConnectedDevices[1].getDeviceName() != strDeviceNameIn) && (this.m_arrayConnectedDevices[1].getPinID() != strPinIDIn))
+ {
+ strDeviceNameOut = this.m_arrayConnectedDevices[1].getDeviceName();
+ strPinIDOut = this.m_arrayConnectedDevices[1].getPinID();
+ }
+ if ((strDeviceNameOut != "") && g_mapPlacedComponents.get(strDeviceNameOut))
+ fVoltage = g_mapPlacedComponents.get(strDeviceNameOut).getVoltage(strDeviceNameOut, strPinIDOut);
+
+ return fVoltage;
+ }
+
+ getResistance(strDeviceNameIn, strPinIDIn)
+ {
+ var strDeviceNameOut = "", strPinIDOut = "";
+ var fResistance = 0;
+
+ if ((this.m_arrayConnectedDevices.length > 0) && (this.m_arrayConnectedDevices[0].getDeviceName() != strDeviceNameIn) && (this.m_arrayConnectedDevices[0].getPinID() != strPinIDIn))
+ {
+ strDeviceNameOut = this.m_arrayConnectedDevices[0].getDeviceName();
+ strPinIDOut = this.m_arrayConnectedDevices[0].getPinID();
+ }
+ else if ((this.m_arrayConnectedDevices.length > 1) && (this.m_arrayConnectedDevices[1].getDeviceName() != strDeviceNameIn) && (this.m_arrayConnectedDevices[1].getPinID() != strPinIDIn))
+ {
+ strDeviceNameOut = this.m_arrayConnectedDevices[1].getDeviceName();
+ strPinIDOut = this.m_arrayConnectedDevices[1].getPinID();
+ }
+ if ((strDeviceNameOut != "") && g_mapPlacedComponents.get(strDeviceNameOut))
+ fResistance += g_mapPlacedComponents.get(strDeviceNameOut).getResistance(strDeviceNameOut, strPinIDOut);
+
+ return fResistance;
+ }
+
+ isConnected()
+ {
+ return this.m_arrayConnectedDevices.length > 0;
+ }
+
+ getNumConnections()
+ {
+ return this.m_arrayConnectedDevices.length;
+ }
+
+ getConnectionName(nIndex)
+ {
+ var strName = "";
+
+ if ((nIndex >= 0) && (nIndex < this.m_arrayConnectedDevices.length))
+ strName = this.m_arrayConnectedDevices[nIndex].getDeviceName();
+
+ return strName;
+ }
+
+ getType()
+ {
+ return "WIRE";
+ }
+
+ getColor()
+ {
+ return this.m_strColor;
+ }
+
+ setColor(strNewColor)
+ {
+ this.m_strColor = strNewColor;
+ }
+
+ getDeviceName()
+ {
+ return this.m_strDeviceName;
+ }
+
+ doAppendNode(pointNew)
+ {
+ pointNew.m_nX -= (pointNew.m_nX % g_nGridSize);
+ pointNew.m_nY -= (pointNew.m_nY % g_nGridSize);
+ this.m_arrayPoints[this.m_arrayPoints.length] = pointNew;
+ this.m_arrayPoints[this.m_arrayPoints.length] = new CPoint(pointNew.m_nX + 10, pointNew.m_nY + 10);
+ this.m_nIndexGrabbedPoint = this.m_arrayPoints.length - 1;
+ }
+
+ doDeleteNode(nIndex)
+ {
+ var arrayNew = [];
+
+ for (let nI = 0; nI < nIndex; nI++)
+ arrayNew[arrayNew.length] = this.m_arrayPoints[nI];
+
+ for (let nI = nIndex + 1; nI < this.m_arrayPoints.length; nI++)
+ arrayNew[arrayNew.length] = this.m_arrayPoints[nI];
+
+ this.m_arrayPoints = arrayNew;
+ }
+
+ doInsertNode(pointNew)
+ {
+ var arrayNew = [];
+
+ pointNew.m_nX -= (pointNew.m_nX % g_nGridSize);
+ pointNew.m_nY -= (pointNew.m_nY % g_nGridSize);
+
+ if (this.m_arrayPoints.length == 2)
+ {
+ if (this.doesLineContain(this.m_arrayPoints[0], this.m_arrayPoints[1], pointNew, this.m_nWidth))
+ {
+ arrayNew[arrayNew.length] = this.m_arrayPoints[0];
+ arrayNew[arrayNew.length] = pointNew;
+ arrayNew[arrayNew.length] = this.m_arrayPoints[1];
+ this.m_arrayPoints = arrayNew;
+ this.doDisplay();
+ }
+ }
+ else
+ {
+ for (var nI = 1; nI < this.m_arrayPoints.length; nI++)
+ {
+ if (this.doesLineContain(this.m_arrayPoints[nI - 1], this.m_arrayPoints[nI], pointNew, this.m_nWidth))
+ {
+ for (let nJ = 0; nJ < nI; nJ++)
+ arrayNew[arrayNew.length] = this.m_arrayPoints[nJ];
+
+ arrayNew[arrayNew.length] = pointNew;
+
+ for (let nJ = nI; nJ < this.m_arrayPoints.length; nJ++)
+ arrayNew[arrayNew.length] = this.m_arrayPoints[nJ];
+ this.m_arrayPoints = arrayNew;
+ this.doDisplay();
+ break;
+ }
+ }
+ }
+ }
+
+ doesNodeContain(pointMouse, pointNode, nRadius)
+ {
+ var nDistancePoints = (pointMouse.m_nX - pointNode.m_nX) * (pointMouse.m_nX - pointNode.m_nX) +
+ (pointMouse.m_nY - pointNode.m_nY) * (pointMouse.m_nY - pointNode.m_nY);
+ var bContains = false;
+
+ nRadius *= nRadius;
+ if (nDistancePoints < nRadius)
+ bContains = true;
+
+ return bContains;
+ }
+
+ doesLineContain(pointStart, pointEnd, pointMouse, nLineWidth)
+ {
+ var pointTemp = new CPoint(0, 0);
+ var bContains = false;
+ var nTolerance = nLineWidth * 2;
+
+ // Normalize start/end to left right to make the nOffset calc simpler.
+ if (pointStart.m_nX > pointEnd.m_nX)
+ {
+ pointTemp = pointStart;
+ pointStart = pointEnd;
+ pointEnd = pointTemp;
+ }
+
+ // If pointMouse is out of bounds, no need to do further checks.
+ if (pointMouse.m_nX + nLineWidth < pointStart.m_nX || pointEnd.m_nX < pointMouse.m_nX - nLineWidth)
+ bContains = false;
+ else if (pointMouse.m_nY + nLineWidth < Math.min(pointStart.m_nY, pointEnd.m_nY) || Math.max(pointStart.m_nY, pointEnd.m_nY) < pointMouse.m_nY - nLineWidth)
+ bContains = false;
+ else
+ {
+ var nDeltaX = pointEnd.m_nX - pointStart.m_nX;
+ var nDeltaY = pointEnd.m_nY - pointStart.m_nY;
+
+ // If the line is straight, the earlier boundary check is enough to determine that the pointMouse is on the line.
+ // Also prevents division by zero exceptions.
+ if ((nDeltaX == 0) || (nDeltaY == 0))
+ bContains = true;
+ else
+ {
+ var nSlope = nDeltaY / nDeltaX;
+ var nOffset = pointStart.m_nY - pointStart.m_nX * nSlope;
+ var nCalculatedY = pointMouse.m_nX * nSlope + nOffset;
+
+ // Check calculated Y matches the points Y coord with some easing.
+ bContains = ((pointMouse.m_nY - nTolerance) <= nCalculatedY) && (nCalculatedY <= (pointMouse.m_nY + nTolerance));
+ }
+ }
+ return bContains;
+ }
+
+ isMouseInNode(pointMousePos)
+ {
+ for (var nI = 0; nI < this.m_arrayPoints.length; nI++)
+ {
+ if (this.doesNodeContain(pointMousePos, this.m_arrayPoints[nI], CWire.m_nNodeRadius))
+ break;
+ }
+ if (nI >= this.m_arrayPoints.length)
+ nI = -1;
+
+ return nI;
+ }
+
+ isMouseIn(pointMousePos)
+ {
+ var bResult = false;
+
+ if (this.m_arrayPoints.length == 2)
+ {
+ bResult = this.doesLineContain(this.m_arrayPoints[0], this.m_arrayPoints[1], pointMousePos, this.m_nWidth);
+ }
+ else
+ {
+ for (let nI = 1; nI < this.m_arrayPoints.length; nI++)
+ {
+ bResult = this.doesLineContain(this.m_arrayPoints[nI - 1], this.m_arrayPoints[nI], pointMousePos, this.m_nWidth);
+ if (bResult)
+ break;
+ }
+ }
+ return bResult;
+ }
+
+ isMouseInPin(pointMousePos)
+ {
+ return false;
+ }
+
+ isEmpty()
+ {
+ return this.m_arrayPoints.length < 2;
+ }
+
+ isSelected()
+ {
+ return this.m_bSelected;
+ }
+
+ doSelect()
+ {
+ this.m_bSelected = true;
+ doDisplayInfo("Click the right mouse button on the wire to add or remove nodes & hold the left mouse button on a node or the wire to drag them...");
+ doShowEditFields(this.m_strHTML);
+ }
+
+ doUnselect()
+ {
+ this.m_bSelected = false;
+ }
+
+ doConnectedMove(pointMousePos, strConnectedDeviceName, strPinID)
+ {
+ for (let nI = 0; nI < this.m_arrayConnectedDevices.length; nI++)
+ {
+ if (this.m_arrayConnectedDevices[nI].getDeviceName() == strConnectedDeviceName)
+ {
+ this.m_arrayPoints[this.m_arrayConnectedDevices[nI].getNodeIndex()] = new CPoint(pointMousePos.m_nX, pointMousePos.m_nY);
+ }
+ }
+ }
+
+ findConnectedDevice(strDeviceName)
+ {
+ var nIndex = -1;
+
+ for (let nI = 0; nI < this.m_arrayConnectedDevices.length; nI++)
+ {
+ if (this.m_arrayConnectedDevices[nI].getDeviceName() == strDeviceName)
+ {
+ nIndex = nI;
+ break;
+ }
+ }
+ return nIndex;
+ }
+
+ doDrop(pointMousePos)
+ {
+ if (this.m_arrayPoints.length < 1)
+ this.m_pointTemp = new CPoint(pointMousePos.m_nX - (pointMousePos.m_nX % 10), pointMousePos.m_nY - (pointMousePos.m_nY % 10));
+ else if (this.m_nIndexGrabbedPoint > -1)
+ this.m_arrayPoints[this.m_nIndexGrabbedPoint] = new CPoint(pointMousePos.m_nX - (pointMousePos.m_nX % 10), pointMousePos.m_nY - (pointMousePos.m_nY % 10));
+
+ if (!this.m_TempConnectedDevice.isEmpty())
+ {
+ var nI = this.findConnectedDevice(this.m_TempConnectedDevice.getDeviceName());
+ if (nI == -1)
+ this.m_arrayConnectedDevices[this.m_arrayConnectedDevices.length] =
+ new CConnectedDevice(this.m_TempConnectedDevice.getDeviceName(), this.m_TempConnectedDevice.getPinID(), this.m_TempConnectedDevice.getType(), this.m_TempConnectedDevice.getNodeIndex());
+ else
+ this.m_arrayConnectedDevices[nI] =
+ new CConnectedDevice(this.m_TempConnectedDevice.getDeviceName(), this.m_TempConnectedDevice.getPinID(), this.m_TempConnectedDevice.getType(), this.m_TempConnectedDevice.getNodeIndex());
+
+ let point = g_mapPlacedComponents.get(this.m_TempConnectedDevice.m_strDeviceName).getPinPos(this.m_TempConnectedDevice.m_strPinID);
+ g_mapPlacedComponents.get(this.m_TempConnectedDevice.m_strDeviceName).setWire(this.m_TempConnectedDevice.m_strPinID, this.m_strDeviceName);
+ if ((this.m_nIndexGrabbedPoint >= 0) && (this.m_nIndexGrabbedPoint < this.m_arrayPoints.length))
+ this.m_arrayPoints[this.m_TempConnectedDevice.getNodeIndex()] = new CPoint(point.m_nX, point.m_nY);
+
+ }
+ this.m_nIndexGrabbedPoint = -1;
+ }
+
+ doGrab(pointMousePos)
+ {
+ this.doSelect();
+ this.m_nIndexGrabbedPoint = this.isMouseInNode(pointMousePos);
+
+ if (!this.isConnected() || (this.m_nIndexGrabbedPoint > -1))
+ g_Canvas.style.cursor = "grabbing";
+ else
+ g_Canvas.style.cursor = "pointer";
+ }
+
+ doMove(pointMousePos)
+ {
+ if ((this.m_nIndexGrabbedPoint != -1) || (this.m_arrayPoints.length == 0))
+ {
+ if (this.m_arrayPoints.length < 1)
+ this.m_pointTemp = new CPoint(pointMousePos.m_nX, pointMousePos.m_nY);
+ else if (this.m_nIndexGrabbedPoint > -1)
+ this.m_arrayPoints[this.m_nIndexGrabbedPoint] = new CPoint(pointMousePos.m_nX, pointMousePos.m_nY);
+
+ var strDeviceName = doFindSelectedComponent(pointMousePos), strPinID = "";
+ var Component = g_mapPlacedComponents.get(strDeviceName);
+ var nPinNum = 0;
+
+ this.m_bHighlight = false;
+ this.m_TempConnectedDevice.setDeviceName("");
+ this.m_TempConnectedDevice.setPinID("");
+ this.m_TempConnectedDevice.setType("");
+ this.m_TempConnectedDevice.setNodeIndex(-1);
+ if (Component != null)
+ {
+ nPinNum = g_mapPlacedComponents.get(strDeviceName).isMouseInPin(pointMousePos);
+ if (nPinNum > -1)
+ {
+ if (g_mapPlacedComponents.get(strDeviceName).getType() != "WIRE")
+ {
+ if (this.isFirstOrLastPoint(this.m_nIndexGrabbedPoint))
+ {
+ strPinID = g_mapPlacedComponents.get(strDeviceName).getPinID(nPinNum);
+ this.m_bHighlight = true;
+ this.m_TempConnectedDevice.setDeviceName(strDeviceName);
+ this.m_TempConnectedDevice.setPinID(strPinID);
+ this.m_TempConnectedDevice.setType(g_mapPlacedComponents.get(strDeviceName).getType());
+ this.m_TempConnectedDevice.setNodeIndex(this.m_nIndexGrabbedPoint);
+ }
+ }
+ }
+ }
+ }
+ else if (!this.isConnected())
+ {
+ if (!this.m_pointLastMousePos.isEmpty())
+ {
+ let nDeltaX = pointMousePos.m_nX - this.m_pointLastMousePos.m_nX,
+ nDeltaY = pointMousePos.m_nY - this.m_pointLastMousePos.m_nY,
+ pointCurrent = null;
+
+ for (let nI = 0; nI < this.m_arrayPoints.length; nI++)
+ {
+ pointCurrent = this.m_arrayPoints[nI];
+ pointCurrent.m_nX += nDeltaX;
+ pointCurrent.m_nY += nDeltaY;
+ this.m_arrayPoints[nI] = pointCurrent;
+ }
+ }
+ this.m_pointLastMousePos = pointMousePos;
+ }
+ this.doDisplay();
+ }
+
+ doMouseOver(pointMousePos)
+ {
+ var OldCursor = g_Canvas.style.cursor;
+
+ if (this.isMouseInNode(pointMousePos) > -1)
+ g_Canvas.style.cursor = "grab";
+ else if (this.isMouseIn(pointMousePos))
+ {
+ if (!this.isConnected())
+ g_Canvas.style.cursor = "grab";
+ else
+ g_Canvas.style.cursor = "pointer";
+ }
+ else
+ g_Canvas.style.cursor = "default";
+
+ return g_Canvas.style.cursor != OldCursor;
+ }
+
+ doDefaultZoom()
+ {
+ this.m_nZoom = 0;
+ }
+
+ doZoomIn()
+ {
+ if (this.m_nZoom < 10)
+ {
+ this.m_nZoom++;
+ }
+ }
+
+ doZoomOut()
+ {
+ if (this.m_nZoom > -10)
+ {
+ this.m_nZoom--;
+ }
+ }
+
+ getZoomedValue(nValue)
+ {
+ var nValueNew = nValue;
+ var nFudge = 0.2;
+
+ nValueNew += nFudge * this.m_nZoom;
+
+ return nValueNew;
+ }
+
+ doRotate(nAngleAdd)
+ {
+ }
+
+ doDelete()
+ {
+ var strName = "";
+
+ for (let nI = 0; nI < this.m_arrayConnectedDevices.length; nI++)
+ {
+ strName = this.m_arrayConnectedDevices[nI].getDeviceName();
+ g_mapPlacedComponents.get(strName).doDeleteWire(this.m_strDeviceName);
+ }
+ }
+
+ doDisplayNode(pointMouse, strColor, bHighlight)
+ {
+ if (bHighlight)
+ {
+ g_CanvasContext.arc(pointMouse.m_nX, pointMouse.m_nY, this.getZoomedValue(CWire.m_nNodeRadius) * 2, 0, 2 * Math.PI);
+ doDisplayHint("PIN ID", this.m_TempConnectedDevice.getPinID());
+ }
+ else
+ g_CanvasContext.arc(pointMouse.m_nX, pointMouse.m_nY, this.getZoomedValue(CWire.m_nNodeRadius), 0, 2 * Math.PI);
+ }
+
+ isFirstOrLastPoint(nIndex)
+ {
+ return (nIndex == 0) || (nIndex == (this.m_arrayPoints.length - 1));
+ }
+
+ doDisplay()
+ {
+ var nX = 0, nY = 0;
+
+ g_CanvasContext.strokeStyle = this.m_strColor;
+ g_CanvasContext.lineWidth = this.getZoomedValue(this.m_nWidth);
+ g_CanvasContext.fillStyle = this.m_strColor;
+
+ if (this.m_arrayPoints.length < 1)
+ {
+ g_CanvasContext.beginPath();
+ this.doDisplayNode(this.m_pointTemp, this.m_strColor, this.m_bHighlight);
+ g_CanvasContext.stroke();
+ g_CanvasContext.fill();
+ }
+ else
+ {
+ g_CanvasContext.beginPath();
+ g_CanvasContext.moveTo(this.m_arrayPoints[0].m_nX, this.m_arrayPoints[0].m_nY);
+ for (let nI = 1; nI < this.m_arrayPoints.length; nI++)
+ {
+ nX = this.m_arrayPoints[nI].m_nX;
+ nY = this.m_arrayPoints[nI].m_nY;
+ g_CanvasContext.lineTo(nX, nY);
+ }
+ g_CanvasContext.stroke();
+
+ if (this.m_bSelected)
+ {
+ for (let nI = 0; nI < this.m_arrayPoints.length; nI++)
+ {
+ g_CanvasContext.beginPath();
+ this.doDisplayNode(this.m_arrayPoints[nI], this.m_strColor,
+ this.m_bHighlight && (nI == this.m_nIndexGrabbedPoint) && this.isFirstOrLastPoint(this.m_nIndexGrabbedPoint));
+ g_CanvasContext.stroke();
+ g_CanvasContext.fill();
+ }
+ }
+ }
+ }
+
+}
diff --git a/ardublockly/img/Components/LEDs/LED_BLOWN.png b/ardublockly/img/Components/LEDs/LED_BLOWN.png
new file mode 100644
index 0000000000..29f6b223b1
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_BLOWN.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_BLOWN180.png b/ardublockly/img/Components/LEDs/LED_BLOWN180.png
new file mode 100644
index 0000000000..0d1bdd84ff
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_BLOWN180.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_BLOWN270.png b/ardublockly/img/Components/LEDs/LED_BLOWN270.png
new file mode 100644
index 0000000000..efc403a40e
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_BLOWN270.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_BLOWN90.png b/ardublockly/img/Components/LEDs/LED_BLOWN90.png
new file mode 100644
index 0000000000..96adda066d
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_BLOWN90.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_OFF.png b/ardublockly/img/Components/LEDs/LED_OFF.png
new file mode 100644
index 0000000000..59b20e3372
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_OFF.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_OFF180.png b/ardublockly/img/Components/LEDs/LED_OFF180.png
new file mode 100644
index 0000000000..acf674ec8a
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_OFF180.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_OFF270.png b/ardublockly/img/Components/LEDs/LED_OFF270.png
new file mode 100644
index 0000000000..75b647fb8e
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_OFF270.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_OFF90.png b/ardublockly/img/Components/LEDs/LED_OFF90.png
new file mode 100644
index 0000000000..3b514412a4
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_OFF90.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_ON.png b/ardublockly/img/Components/LEDs/LED_ON.png
new file mode 100644
index 0000000000..d3b5117a9a
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_ON.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_ON180.png b/ardublockly/img/Components/LEDs/LED_ON180.png
new file mode 100644
index 0000000000..9c248465d4
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_ON180.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_ON270.png b/ardublockly/img/Components/LEDs/LED_ON270.png
new file mode 100644
index 0000000000..179444c687
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_ON270.png differ
diff --git a/ardublockly/img/Components/LEDs/LED_ON90.png b/ardublockly/img/Components/LEDs/LED_ON90.png
new file mode 100644
index 0000000000..07e945ee57
Binary files /dev/null and b/ardublockly/img/Components/LEDs/LED_ON90.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoMega.png b/ardublockly/img/Components/MCUs/ArduinoMega.png
new file mode 100644
index 0000000000..6f872c0601
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoMega.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoMega180.png b/ardublockly/img/Components/MCUs/ArduinoMega180.png
new file mode 100644
index 0000000000..f901c0b877
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoMega180.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoMega270.png b/ardublockly/img/Components/MCUs/ArduinoMega270.png
new file mode 100644
index 0000000000..b22661d901
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoMega270.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoMega90.png b/ardublockly/img/Components/MCUs/ArduinoMega90.png
new file mode 100644
index 0000000000..614137df14
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoMega90.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoUno.png b/ardublockly/img/Components/MCUs/ArduinoUno.png
new file mode 100644
index 0000000000..7d3f0b253a
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoUno.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoUno180.png b/ardublockly/img/Components/MCUs/ArduinoUno180.png
new file mode 100644
index 0000000000..3a45a7b301
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoUno180.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoUno270.png b/ardublockly/img/Components/MCUs/ArduinoUno270.png
new file mode 100644
index 0000000000..cacd2a1e57
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoUno270.png differ
diff --git a/ardublockly/img/Components/MCUs/ArduinoUno90.png b/ardublockly/img/Components/MCUs/ArduinoUno90.png
new file mode 100644
index 0000000000..9028e62d41
Binary files /dev/null and b/ardublockly/img/Components/MCUs/ArduinoUno90.png differ
diff --git a/ardublockly/img/Components/MCUs/Microbit.png b/ardublockly/img/Components/MCUs/Microbit.png
new file mode 100644
index 0000000000..23ec8d1639
Binary files /dev/null and b/ardublockly/img/Components/MCUs/Microbit.png differ
diff --git a/ardublockly/img/Components/MCUs/Microbit180.png b/ardublockly/img/Components/MCUs/Microbit180.png
new file mode 100644
index 0000000000..f3ecd23a11
Binary files /dev/null and b/ardublockly/img/Components/MCUs/Microbit180.png differ
diff --git a/ardublockly/img/Components/MCUs/Microbit270.png b/ardublockly/img/Components/MCUs/Microbit270.png
new file mode 100644
index 0000000000..2301dba775
Binary files /dev/null and b/ardublockly/img/Components/MCUs/Microbit270.png differ
diff --git a/ardublockly/img/Components/MCUs/Microbit90.png b/ardublockly/img/Components/MCUs/Microbit90.png
new file mode 100644
index 0000000000..25536d09ff
Binary files /dev/null and b/ardublockly/img/Components/MCUs/Microbit90.png differ
diff --git a/ardublockly/img/Components/MCUs/MicrobitBreakout.png b/ardublockly/img/Components/MCUs/MicrobitBreakout.png
new file mode 100644
index 0000000000..e59678429e
Binary files /dev/null and b/ardublockly/img/Components/MCUs/MicrobitBreakout.png differ
diff --git a/ardublockly/img/Components/MCUs/MicrobitBreakout180.png b/ardublockly/img/Components/MCUs/MicrobitBreakout180.png
new file mode 100644
index 0000000000..ceb341424c
Binary files /dev/null and b/ardublockly/img/Components/MCUs/MicrobitBreakout180.png differ
diff --git a/ardublockly/img/Components/MCUs/MicrobitBreakout270.png b/ardublockly/img/Components/MCUs/MicrobitBreakout270.png
new file mode 100644
index 0000000000..a955404662
Binary files /dev/null and b/ardublockly/img/Components/MCUs/MicrobitBreakout270.png differ
diff --git a/ardublockly/img/Components/MCUs/MicrobitBreakout90.png b/ardublockly/img/Components/MCUs/MicrobitBreakout90.png
new file mode 100644
index 0000000000..136ec8bbf8
Binary files /dev/null and b/ardublockly/img/Components/MCUs/MicrobitBreakout90.png differ
diff --git a/ardublockly/img/Components/Resistors/LDR.png b/ardublockly/img/Components/Resistors/LDR.png
new file mode 100644
index 0000000000..82c8c766d1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/LDR.png differ
diff --git a/ardublockly/img/Components/Resistors/LDR180.png b/ardublockly/img/Components/Resistors/LDR180.png
new file mode 100644
index 0000000000..b9436c7113
Binary files /dev/null and b/ardublockly/img/Components/Resistors/LDR180.png differ
diff --git a/ardublockly/img/Components/Resistors/LDR270.png b/ardublockly/img/Components/Resistors/LDR270.png
new file mode 100644
index 0000000000..2bf06f1b11
Binary files /dev/null and b/ardublockly/img/Components/Resistors/LDR270.png differ
diff --git a/ardublockly/img/Components/Resistors/LDR90.png b/ardublockly/img/Components/Resistors/LDR90.png
new file mode 100644
index 0000000000..c8d3f11ad1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/LDR90.png differ
diff --git a/ardublockly/img/Components/Resistors/Potentiometer.png b/ardublockly/img/Components/Resistors/Potentiometer.png
new file mode 100644
index 0000000000..44ed56264b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/Potentiometer.png differ
diff --git a/ardublockly/img/Components/Resistors/Potentiometer180.png b/ardublockly/img/Components/Resistors/Potentiometer180.png
new file mode 100644
index 0000000000..ab66f4f591
Binary files /dev/null and b/ardublockly/img/Components/Resistors/Potentiometer180.png differ
diff --git a/ardublockly/img/Components/Resistors/Potentiometer270.png b/ardublockly/img/Components/Resistors/Potentiometer270.png
new file mode 100644
index 0000000000..dee7cbdc1a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/Potentiometer270.png differ
diff --git a/ardublockly/img/Components/Resistors/Potentiometer90.png b/ardublockly/img/Components/Resistors/Potentiometer90.png
new file mode 100644
index 0000000000..fa91d0c95a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/Potentiometer90.png differ
diff --git a/ardublockly/img/Components/Resistors/R10.png b/ardublockly/img/Components/Resistors/R10.png
new file mode 100644
index 0000000000..2dc3d6e407
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10.png differ
diff --git a/ardublockly/img/Components/Resistors/R100.png b/ardublockly/img/Components/Resistors/R100.png
new file mode 100644
index 0000000000..68afd33512
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100.png differ
diff --git a/ardublockly/img/Components/Resistors/R100_180.png b/ardublockly/img/Components/Resistors/R100_180.png
new file mode 100644
index 0000000000..5e3b5073ce
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R100_270.png b/ardublockly/img/Components/Resistors/R100_270.png
new file mode 100644
index 0000000000..b19f400066
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R100_90.png b/ardublockly/img/Components/Resistors/R100_90.png
new file mode 100644
index 0000000000..7f3adf3e7a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R100k.png b/ardublockly/img/Components/Resistors/R100k.png
new file mode 100644
index 0000000000..cc912fae3a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100k.png differ
diff --git a/ardublockly/img/Components/Resistors/R100k_180.png b/ardublockly/img/Components/Resistors/R100k_180.png
new file mode 100644
index 0000000000..c3992736c8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R100k_270.png b/ardublockly/img/Components/Resistors/R100k_270.png
new file mode 100644
index 0000000000..6f0668feb1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R100k_90.png b/ardublockly/img/Components/Resistors/R100k_90.png
new file mode 100644
index 0000000000..9f8eebcc9c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R100k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R10M.png b/ardublockly/img/Components/Resistors/R10M.png
new file mode 100644
index 0000000000..8156d60e9a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10M.png differ
diff --git a/ardublockly/img/Components/Resistors/R10M_180.png b/ardublockly/img/Components/Resistors/R10M_180.png
new file mode 100644
index 0000000000..0e17e5e8d6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R10M_270.png b/ardublockly/img/Components/Resistors/R10M_270.png
new file mode 100644
index 0000000000..661e5ae0fd
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R10M_90.png b/ardublockly/img/Components/Resistors/R10M_90.png
new file mode 100644
index 0000000000..b98ccea9d3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R10_180.png b/ardublockly/img/Components/Resistors/R10_180.png
new file mode 100644
index 0000000000..3ca40d126a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R10_270.png b/ardublockly/img/Components/Resistors/R10_270.png
new file mode 100644
index 0000000000..de23343b98
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R10_90.png b/ardublockly/img/Components/Resistors/R10_90.png
new file mode 100644
index 0000000000..bebf6f74da
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R10k.png b/ardublockly/img/Components/Resistors/R10k.png
new file mode 100644
index 0000000000..1f7594ea18
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10k.png differ
diff --git a/ardublockly/img/Components/Resistors/R10k_180.png b/ardublockly/img/Components/Resistors/R10k_180.png
new file mode 100644
index 0000000000..24093682c5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R10k_270.png b/ardublockly/img/Components/Resistors/R10k_270.png
new file mode 100644
index 0000000000..3ceac0c407
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R10k_90.png b/ardublockly/img/Components/Resistors/R10k_90.png
new file mode 100644
index 0000000000..31cec87f60
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R10k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R12.png b/ardublockly/img/Components/Resistors/R12.png
new file mode 100644
index 0000000000..95827799be
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12.png differ
diff --git a/ardublockly/img/Components/Resistors/R120.png b/ardublockly/img/Components/Resistors/R120.png
new file mode 100644
index 0000000000..a93013df1a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120.png differ
diff --git a/ardublockly/img/Components/Resistors/R120_180.png b/ardublockly/img/Components/Resistors/R120_180.png
new file mode 100644
index 0000000000..1bc15029f1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R120_270.png b/ardublockly/img/Components/Resistors/R120_270.png
new file mode 100644
index 0000000000..cdde102513
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R120_90.png b/ardublockly/img/Components/Resistors/R120_90.png
new file mode 100644
index 0000000000..3144be917f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R120k.png b/ardublockly/img/Components/Resistors/R120k.png
new file mode 100644
index 0000000000..2779dc8191
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120k.png differ
diff --git a/ardublockly/img/Components/Resistors/R120k_180.png b/ardublockly/img/Components/Resistors/R120k_180.png
new file mode 100644
index 0000000000..139a190bb4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R120k_270.png b/ardublockly/img/Components/Resistors/R120k_270.png
new file mode 100644
index 0000000000..dbdf10085d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R120k_90.png b/ardublockly/img/Components/Resistors/R120k_90.png
new file mode 100644
index 0000000000..cf1861ac49
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R120k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R12_180.png b/ardublockly/img/Components/Resistors/R12_180.png
new file mode 100644
index 0000000000..9b143b428c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R12_270.png b/ardublockly/img/Components/Resistors/R12_270.png
new file mode 100644
index 0000000000..d169073941
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R12_90.png b/ardublockly/img/Components/Resistors/R12_90.png
new file mode 100644
index 0000000000..0a64c81678
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R12k.png b/ardublockly/img/Components/Resistors/R12k.png
new file mode 100644
index 0000000000..65864e0867
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12k.png differ
diff --git a/ardublockly/img/Components/Resistors/R12k_180.png b/ardublockly/img/Components/Resistors/R12k_180.png
new file mode 100644
index 0000000000..97a42cc10e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R12k_270.png b/ardublockly/img/Components/Resistors/R12k_270.png
new file mode 100644
index 0000000000..b3c15c819f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R12k_90.png b/ardublockly/img/Components/Resistors/R12k_90.png
new file mode 100644
index 0000000000..e713035092
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R12k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R15.png b/ardublockly/img/Components/Resistors/R15.png
new file mode 100644
index 0000000000..cd22f4530f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15.png differ
diff --git a/ardublockly/img/Components/Resistors/R150.png b/ardublockly/img/Components/Resistors/R150.png
new file mode 100644
index 0000000000..d0d64cb60b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150.png differ
diff --git a/ardublockly/img/Components/Resistors/R150_180.png b/ardublockly/img/Components/Resistors/R150_180.png
new file mode 100644
index 0000000000..82be28b986
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R150_270.png b/ardublockly/img/Components/Resistors/R150_270.png
new file mode 100644
index 0000000000..d834e11cad
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R150_90.png b/ardublockly/img/Components/Resistors/R150_90.png
new file mode 100644
index 0000000000..01e391537d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R150k.png b/ardublockly/img/Components/Resistors/R150k.png
new file mode 100644
index 0000000000..9ec72c1cb6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150k.png differ
diff --git a/ardublockly/img/Components/Resistors/R150k_180.png b/ardublockly/img/Components/Resistors/R150k_180.png
new file mode 100644
index 0000000000..67584f2c91
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R150k_270.png b/ardublockly/img/Components/Resistors/R150k_270.png
new file mode 100644
index 0000000000..70b1b68a8e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R150k_90.png b/ardublockly/img/Components/Resistors/R150k_90.png
new file mode 100644
index 0000000000..6e43a5474b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R150k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R15_180.png b/ardublockly/img/Components/Resistors/R15_180.png
new file mode 100644
index 0000000000..6414d7b55d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R15_270.png b/ardublockly/img/Components/Resistors/R15_270.png
new file mode 100644
index 0000000000..6f20983b5e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R15_90.png b/ardublockly/img/Components/Resistors/R15_90.png
new file mode 100644
index 0000000000..cd5b8c024e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R15k.png b/ardublockly/img/Components/Resistors/R15k.png
new file mode 100644
index 0000000000..8b2b10a117
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15k.png differ
diff --git a/ardublockly/img/Components/Resistors/R15k_180.png b/ardublockly/img/Components/Resistors/R15k_180.png
new file mode 100644
index 0000000000..8130bca446
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R15k_270.png b/ardublockly/img/Components/Resistors/R15k_270.png
new file mode 100644
index 0000000000..561d9f9c61
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R15k_90.png b/ardublockly/img/Components/Resistors/R15k_90.png
new file mode 100644
index 0000000000..4a4b7a2a5f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R15k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R18.png b/ardublockly/img/Components/Resistors/R18.png
new file mode 100644
index 0000000000..65ad5d80bb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18.png differ
diff --git a/ardublockly/img/Components/Resistors/R180.png b/ardublockly/img/Components/Resistors/R180.png
new file mode 100644
index 0000000000..90629859ed
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180.png differ
diff --git a/ardublockly/img/Components/Resistors/R180_180.png b/ardublockly/img/Components/Resistors/R180_180.png
new file mode 100644
index 0000000000..c3111f5cc6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R180_270.png b/ardublockly/img/Components/Resistors/R180_270.png
new file mode 100644
index 0000000000..3761837b1e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R180_90.png b/ardublockly/img/Components/Resistors/R180_90.png
new file mode 100644
index 0000000000..1e5cdb2c56
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R180k.png b/ardublockly/img/Components/Resistors/R180k.png
new file mode 100644
index 0000000000..16fa5d08f1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180k.png differ
diff --git a/ardublockly/img/Components/Resistors/R180k_180.png b/ardublockly/img/Components/Resistors/R180k_180.png
new file mode 100644
index 0000000000..b785963912
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R180k_270.png b/ardublockly/img/Components/Resistors/R180k_270.png
new file mode 100644
index 0000000000..3c77c9edc9
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R180k_90.png b/ardublockly/img/Components/Resistors/R180k_90.png
new file mode 100644
index 0000000000..76a9ddef9f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R180k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R18_180.png b/ardublockly/img/Components/Resistors/R18_180.png
new file mode 100644
index 0000000000..b465792919
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R18_270.png b/ardublockly/img/Components/Resistors/R18_270.png
new file mode 100644
index 0000000000..deb3933010
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R18_90.png b/ardublockly/img/Components/Resistors/R18_90.png
new file mode 100644
index 0000000000..80b6cb1101
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R18k.png b/ardublockly/img/Components/Resistors/R18k.png
new file mode 100644
index 0000000000..578d8a7083
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18k.png differ
diff --git a/ardublockly/img/Components/Resistors/R18k_180.png b/ardublockly/img/Components/Resistors/R18k_180.png
new file mode 100644
index 0000000000..e4713edae6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R18k_270.png b/ardublockly/img/Components/Resistors/R18k_270.png
new file mode 100644
index 0000000000..929c7cb19a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R18k_90.png b/ardublockly/img/Components/Resistors/R18k_90.png
new file mode 100644
index 0000000000..ca38ef6b75
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R18k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1M.png b/ardublockly/img/Components/Resistors/R1M.png
new file mode 100644
index 0000000000..6a377f0bc3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1M.png differ
diff --git a/ardublockly/img/Components/Resistors/R1M_180.png b/ardublockly/img/Components/Resistors/R1M_180.png
new file mode 100644
index 0000000000..1bf6e7971e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1M_270.png b/ardublockly/img/Components/Resistors/R1M_270.png
new file mode 100644
index 0000000000..0f139be728
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1M_90.png b/ardublockly/img/Components/Resistors/R1M_90.png
new file mode 100644
index 0000000000..d73613fccb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_0.png b/ardublockly/img/Components/Resistors/R1_0.png
new file mode 100644
index 0000000000..49f96c4f73
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_0.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_0_180.png b/ardublockly/img/Components/Resistors/R1_0_180.png
new file mode 100644
index 0000000000..96736be8c6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_0_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_0_270.png b/ardublockly/img/Components/Resistors/R1_0_270.png
new file mode 100644
index 0000000000..6f8e60fd37
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_0_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_0_90.png b/ardublockly/img/Components/Resistors/R1_0_90.png
new file mode 100644
index 0000000000..ee59ed1077
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_0_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2.png b/ardublockly/img/Components/Resistors/R1_2.png
new file mode 100644
index 0000000000..f81282389e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2M.png b/ardublockly/img/Components/Resistors/R1_2M.png
new file mode 100644
index 0000000000..bfc88d1147
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2M.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2M_180.png b/ardublockly/img/Components/Resistors/R1_2M_180.png
new file mode 100644
index 0000000000..d80c6c1431
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2M_270.png b/ardublockly/img/Components/Resistors/R1_2M_270.png
new file mode 100644
index 0000000000..251548c3a9
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2M_90.png b/ardublockly/img/Components/Resistors/R1_2M_90.png
new file mode 100644
index 0000000000..d5eabe7249
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2_180.png b/ardublockly/img/Components/Resistors/R1_2_180.png
new file mode 100644
index 0000000000..d2fe0713e4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2_270.png b/ardublockly/img/Components/Resistors/R1_2_270.png
new file mode 100644
index 0000000000..3f13e87e43
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2_90.png b/ardublockly/img/Components/Resistors/R1_2_90.png
new file mode 100644
index 0000000000..62e438004c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2k.png b/ardublockly/img/Components/Resistors/R1_2k.png
new file mode 100644
index 0000000000..e9f9fe5ad5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2k.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2k_180.png b/ardublockly/img/Components/Resistors/R1_2k_180.png
new file mode 100644
index 0000000000..dba7875c99
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2k_270.png b/ardublockly/img/Components/Resistors/R1_2k_270.png
new file mode 100644
index 0000000000..c4fdeec4d3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_2k_90.png b/ardublockly/img/Components/Resistors/R1_2k_90.png
new file mode 100644
index 0000000000..a48e60039e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_2k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5.png b/ardublockly/img/Components/Resistors/R1_5.png
new file mode 100644
index 0000000000..d6b0a862de
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5M.png b/ardublockly/img/Components/Resistors/R1_5M.png
new file mode 100644
index 0000000000..ba8b680f41
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5M.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5M_180.png b/ardublockly/img/Components/Resistors/R1_5M_180.png
new file mode 100644
index 0000000000..2fdbd4a45e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5M_270.png b/ardublockly/img/Components/Resistors/R1_5M_270.png
new file mode 100644
index 0000000000..fa3e0bf2a6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5M_90.png b/ardublockly/img/Components/Resistors/R1_5M_90.png
new file mode 100644
index 0000000000..d928c6320f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5_180.png b/ardublockly/img/Components/Resistors/R1_5_180.png
new file mode 100644
index 0000000000..d0eb9da69d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5_270.png b/ardublockly/img/Components/Resistors/R1_5_270.png
new file mode 100644
index 0000000000..62ca8143c4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5_90.png b/ardublockly/img/Components/Resistors/R1_5_90.png
new file mode 100644
index 0000000000..bcc49300eb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5k.png b/ardublockly/img/Components/Resistors/R1_5k.png
new file mode 100644
index 0000000000..0ec12c4560
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5k.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5k_180.png b/ardublockly/img/Components/Resistors/R1_5k_180.png
new file mode 100644
index 0000000000..cdd537bd34
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5k_270.png b/ardublockly/img/Components/Resistors/R1_5k_270.png
new file mode 100644
index 0000000000..426ed8d891
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_5k_90.png b/ardublockly/img/Components/Resistors/R1_5k_90.png
new file mode 100644
index 0000000000..61dd20914c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_5k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8.png b/ardublockly/img/Components/Resistors/R1_8.png
new file mode 100644
index 0000000000..65b797c1f1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8M.png b/ardublockly/img/Components/Resistors/R1_8M.png
new file mode 100644
index 0000000000..1e58114a1e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8M.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8M_180.png b/ardublockly/img/Components/Resistors/R1_8M_180.png
new file mode 100644
index 0000000000..6ea21d00d0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8M_270.png b/ardublockly/img/Components/Resistors/R1_8M_270.png
new file mode 100644
index 0000000000..0090eed1cb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8M_90.png b/ardublockly/img/Components/Resistors/R1_8M_90.png
new file mode 100644
index 0000000000..83c4b61e84
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8_180.png b/ardublockly/img/Components/Resistors/R1_8_180.png
new file mode 100644
index 0000000000..4414a27f84
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8_270.png b/ardublockly/img/Components/Resistors/R1_8_270.png
new file mode 100644
index 0000000000..5f0b502206
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8_90.png b/ardublockly/img/Components/Resistors/R1_8_90.png
new file mode 100644
index 0000000000..8086de2a27
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8k.png b/ardublockly/img/Components/Resistors/R1_8k.png
new file mode 100644
index 0000000000..2e48fc0dd1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8k.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8k_180.png b/ardublockly/img/Components/Resistors/R1_8k_180.png
new file mode 100644
index 0000000000..0b16899413
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8k_270.png b/ardublockly/img/Components/Resistors/R1_8k_270.png
new file mode 100644
index 0000000000..4d9f833184
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1_8k_90.png b/ardublockly/img/Components/Resistors/R1_8k_90.png
new file mode 100644
index 0000000000..20d9073915
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1_8k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R1k.png b/ardublockly/img/Components/Resistors/R1k.png
new file mode 100644
index 0000000000..10c512b8cb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1k.png differ
diff --git a/ardublockly/img/Components/Resistors/R1k_180.png b/ardublockly/img/Components/Resistors/R1k_180.png
new file mode 100644
index 0000000000..ef2c849448
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R1k_270.png b/ardublockly/img/Components/Resistors/R1k_270.png
new file mode 100644
index 0000000000..9ea374d897
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R1k_90.png b/ardublockly/img/Components/Resistors/R1k_90.png
new file mode 100644
index 0000000000..92941717e5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R1k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R22.png b/ardublockly/img/Components/Resistors/R22.png
new file mode 100644
index 0000000000..7bdc4a6cb8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22.png differ
diff --git a/ardublockly/img/Components/Resistors/R220.png b/ardublockly/img/Components/Resistors/R220.png
new file mode 100644
index 0000000000..ab9f7877af
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220.png differ
diff --git a/ardublockly/img/Components/Resistors/R220_180.png b/ardublockly/img/Components/Resistors/R220_180.png
new file mode 100644
index 0000000000..ba67f1f186
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R220_270.png b/ardublockly/img/Components/Resistors/R220_270.png
new file mode 100644
index 0000000000..cc54c09f86
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R220_90.png b/ardublockly/img/Components/Resistors/R220_90.png
new file mode 100644
index 0000000000..b43ff8114c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R220k.png b/ardublockly/img/Components/Resistors/R220k.png
new file mode 100644
index 0000000000..5cee9a7276
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220k.png differ
diff --git a/ardublockly/img/Components/Resistors/R220k_180.png b/ardublockly/img/Components/Resistors/R220k_180.png
new file mode 100644
index 0000000000..725a5c8b57
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R220k_270.png b/ardublockly/img/Components/Resistors/R220k_270.png
new file mode 100644
index 0000000000..d974dc6a06
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R220k_90.png b/ardublockly/img/Components/Resistors/R220k_90.png
new file mode 100644
index 0000000000..07b284f320
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R220k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R22_180.png b/ardublockly/img/Components/Resistors/R22_180.png
new file mode 100644
index 0000000000..5fa3f12025
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R22_270.png b/ardublockly/img/Components/Resistors/R22_270.png
new file mode 100644
index 0000000000..8e2be57601
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R22_90.png b/ardublockly/img/Components/Resistors/R22_90.png
new file mode 100644
index 0000000000..3666e9694e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R22k.png b/ardublockly/img/Components/Resistors/R22k.png
new file mode 100644
index 0000000000..1402890df2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22k.png differ
diff --git a/ardublockly/img/Components/Resistors/R22k_180.png b/ardublockly/img/Components/Resistors/R22k_180.png
new file mode 100644
index 0000000000..a885c000eb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R22k_270.png b/ardublockly/img/Components/Resistors/R22k_270.png
new file mode 100644
index 0000000000..7c35e8a586
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R22k_90.png b/ardublockly/img/Components/Resistors/R22k_90.png
new file mode 100644
index 0000000000..dc51c1a93c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R22k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R27.png b/ardublockly/img/Components/Resistors/R27.png
new file mode 100644
index 0000000000..f9aa1193cc
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27.png differ
diff --git a/ardublockly/img/Components/Resistors/R270k.png b/ardublockly/img/Components/Resistors/R270k.png
new file mode 100644
index 0000000000..b284a8a1fc
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R270k.png differ
diff --git a/ardublockly/img/Components/Resistors/R270k_180.png b/ardublockly/img/Components/Resistors/R270k_180.png
new file mode 100644
index 0000000000..2b77ebb21d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R270k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R270k_270.png b/ardublockly/img/Components/Resistors/R270k_270.png
new file mode 100644
index 0000000000..3ffe50141d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R270k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R270k_90.png b/ardublockly/img/Components/Resistors/R270k_90.png
new file mode 100644
index 0000000000..5b1d615dc1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R270k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R27_180.png b/ardublockly/img/Components/Resistors/R27_180.png
new file mode 100644
index 0000000000..a218c13b7d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R27_270.png b/ardublockly/img/Components/Resistors/R27_270.png
new file mode 100644
index 0000000000..e44b2a065c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R27_90.png b/ardublockly/img/Components/Resistors/R27_90.png
new file mode 100644
index 0000000000..97e2af214d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R27k.png b/ardublockly/img/Components/Resistors/R27k.png
new file mode 100644
index 0000000000..d7e0054cee
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27k.png differ
diff --git a/ardublockly/img/Components/Resistors/R27k_180.png b/ardublockly/img/Components/Resistors/R27k_180.png
new file mode 100644
index 0000000000..0db83cd2ff
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R27k_270.png b/ardublockly/img/Components/Resistors/R27k_270.png
new file mode 100644
index 0000000000..a02f641da1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R27k_90.png b/ardublockly/img/Components/Resistors/R27k_90.png
new file mode 100644
index 0000000000..b9b1840e6e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R27k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2.png b/ardublockly/img/Components/Resistors/R2_2.png
new file mode 100644
index 0000000000..a0c253eff8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2M.png b/ardublockly/img/Components/Resistors/R2_2M.png
new file mode 100644
index 0000000000..8a462ce564
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2M.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2M_180.png b/ardublockly/img/Components/Resistors/R2_2M_180.png
new file mode 100644
index 0000000000..e007eeaf79
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2M_270.png b/ardublockly/img/Components/Resistors/R2_2M_270.png
new file mode 100644
index 0000000000..ea330021b2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2M_90.png b/ardublockly/img/Components/Resistors/R2_2M_90.png
new file mode 100644
index 0000000000..76fb8bb303
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2_180.png b/ardublockly/img/Components/Resistors/R2_2_180.png
new file mode 100644
index 0000000000..a414c2512e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2_270.png b/ardublockly/img/Components/Resistors/R2_2_270.png
new file mode 100644
index 0000000000..27b45fda68
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2_90.png b/ardublockly/img/Components/Resistors/R2_2_90.png
new file mode 100644
index 0000000000..6f807bd1ba
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2k.png b/ardublockly/img/Components/Resistors/R2_2k.png
new file mode 100644
index 0000000000..97b3dc4168
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2k.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2k_180.png b/ardublockly/img/Components/Resistors/R2_2k_180.png
new file mode 100644
index 0000000000..8c5ed908b4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2k_270.png b/ardublockly/img/Components/Resistors/R2_2k_270.png
new file mode 100644
index 0000000000..c3c6217761
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_2k_90.png b/ardublockly/img/Components/Resistors/R2_2k_90.png
new file mode 100644
index 0000000000..b9b5f76aac
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_2k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_7M.png b/ardublockly/img/Components/Resistors/R2_7M.png
new file mode 100644
index 0000000000..885df25d22
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_7M.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_7M_180.png b/ardublockly/img/Components/Resistors/R2_7M_180.png
new file mode 100644
index 0000000000..5bd726b461
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_7M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_7M_270.png b/ardublockly/img/Components/Resistors/R2_7M_270.png
new file mode 100644
index 0000000000..6f0a4d2c40
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_7M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R2_7M_90.png b/ardublockly/img/Components/Resistors/R2_7M_90.png
new file mode 100644
index 0000000000..c6abf74695
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R2_7M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R33.png b/ardublockly/img/Components/Resistors/R33.png
new file mode 100644
index 0000000000..f0f20f0e07
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33.png differ
diff --git a/ardublockly/img/Components/Resistors/R330.png b/ardublockly/img/Components/Resistors/R330.png
new file mode 100644
index 0000000000..aa32e42d64
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330.png differ
diff --git a/ardublockly/img/Components/Resistors/R330_180.png b/ardublockly/img/Components/Resistors/R330_180.png
new file mode 100644
index 0000000000..e09244fca4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R330_270.png b/ardublockly/img/Components/Resistors/R330_270.png
new file mode 100644
index 0000000000..7a9f370dd3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R330_90.png b/ardublockly/img/Components/Resistors/R330_90.png
new file mode 100644
index 0000000000..86f6826563
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R330k.png b/ardublockly/img/Components/Resistors/R330k.png
new file mode 100644
index 0000000000..b47c4204d4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330k.png differ
diff --git a/ardublockly/img/Components/Resistors/R330k_180.png b/ardublockly/img/Components/Resistors/R330k_180.png
new file mode 100644
index 0000000000..679c24c8ef
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R330k_270.png b/ardublockly/img/Components/Resistors/R330k_270.png
new file mode 100644
index 0000000000..050e15d28b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R330k_90.png b/ardublockly/img/Components/Resistors/R330k_90.png
new file mode 100644
index 0000000000..e329419ed3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R330k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R33_180.png b/ardublockly/img/Components/Resistors/R33_180.png
new file mode 100644
index 0000000000..470834a96c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R33_270.png b/ardublockly/img/Components/Resistors/R33_270.png
new file mode 100644
index 0000000000..45ee82a4b5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R33_90.png b/ardublockly/img/Components/Resistors/R33_90.png
new file mode 100644
index 0000000000..6c43eccf46
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R33k.png b/ardublockly/img/Components/Resistors/R33k.png
new file mode 100644
index 0000000000..aca14f5027
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33k.png differ
diff --git a/ardublockly/img/Components/Resistors/R33k_180.png b/ardublockly/img/Components/Resistors/R33k_180.png
new file mode 100644
index 0000000000..e0201b81b1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R33k_270.png b/ardublockly/img/Components/Resistors/R33k_270.png
new file mode 100644
index 0000000000..7499c2024a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R33k_90.png b/ardublockly/img/Components/Resistors/R33k_90.png
new file mode 100644
index 0000000000..d78759d305
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R33k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R39.png b/ardublockly/img/Components/Resistors/R39.png
new file mode 100644
index 0000000000..a3dd6161ab
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39.png differ
diff --git a/ardublockly/img/Components/Resistors/R390k._180png.png b/ardublockly/img/Components/Resistors/R390k._180png.png
new file mode 100644
index 0000000000..aca3602394
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R390k._180png.png differ
diff --git a/ardublockly/img/Components/Resistors/R390k._270png.png b/ardublockly/img/Components/Resistors/R390k._270png.png
new file mode 100644
index 0000000000..9f77f59f81
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R390k._270png.png differ
diff --git a/ardublockly/img/Components/Resistors/R390k._90png.png b/ardublockly/img/Components/Resistors/R390k._90png.png
new file mode 100644
index 0000000000..33983a826b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R390k._90png.png differ
diff --git a/ardublockly/img/Components/Resistors/R390k.png b/ardublockly/img/Components/Resistors/R390k.png
new file mode 100644
index 0000000000..266dd6b7c9
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R390k.png differ
diff --git a/ardublockly/img/Components/Resistors/R39_180.png b/ardublockly/img/Components/Resistors/R39_180.png
new file mode 100644
index 0000000000..555f306387
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R39_270.png b/ardublockly/img/Components/Resistors/R39_270.png
new file mode 100644
index 0000000000..d908aa6db3
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R39_90.png b/ardublockly/img/Components/Resistors/R39_90.png
new file mode 100644
index 0000000000..5d5abaa6a4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R39k.png b/ardublockly/img/Components/Resistors/R39k.png
new file mode 100644
index 0000000000..15358ca9b0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39k.png differ
diff --git a/ardublockly/img/Components/Resistors/R39k_180.png b/ardublockly/img/Components/Resistors/R39k_180.png
new file mode 100644
index 0000000000..76771ef797
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R39k_270.png b/ardublockly/img/Components/Resistors/R39k_270.png
new file mode 100644
index 0000000000..87ac79e3c0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R39k_90.png b/ardublockly/img/Components/Resistors/R39k_90.png
new file mode 100644
index 0000000000..2d38244c73
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R39k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3.png b/ardublockly/img/Components/Resistors/R3_3.png
new file mode 100644
index 0000000000..ead2716a4b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3M.png b/ardublockly/img/Components/Resistors/R3_3M.png
new file mode 100644
index 0000000000..fce68444f8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3M.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3M_180.png b/ardublockly/img/Components/Resistors/R3_3M_180.png
new file mode 100644
index 0000000000..577192447c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3M_270.png b/ardublockly/img/Components/Resistors/R3_3M_270.png
new file mode 100644
index 0000000000..add00271c2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3M_90.png b/ardublockly/img/Components/Resistors/R3_3M_90.png
new file mode 100644
index 0000000000..c8edbac56e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3_180.png b/ardublockly/img/Components/Resistors/R3_3_180.png
new file mode 100644
index 0000000000..7671f134ac
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3_270.png b/ardublockly/img/Components/Resistors/R3_3_270.png
new file mode 100644
index 0000000000..1095be2537
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3_90.png b/ardublockly/img/Components/Resistors/R3_3_90.png
new file mode 100644
index 0000000000..cb6c217247
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3k.png b/ardublockly/img/Components/Resistors/R3_3k.png
new file mode 100644
index 0000000000..d476c7d6b0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3k.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3k_180.png b/ardublockly/img/Components/Resistors/R3_3k_180.png
new file mode 100644
index 0000000000..b6e18ff431
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3k_270.png b/ardublockly/img/Components/Resistors/R3_3k_270.png
new file mode 100644
index 0000000000..fd887b8cf6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_3k_90.png b/ardublockly/img/Components/Resistors/R3_3k_90.png
new file mode 100644
index 0000000000..29d59f9934
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_3k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9.png b/ardublockly/img/Components/Resistors/R3_9.png
new file mode 100644
index 0000000000..7a4aee2222
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9M.png b/ardublockly/img/Components/Resistors/R3_9M.png
new file mode 100644
index 0000000000..24f714dbaf
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9M.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9M_180.png b/ardublockly/img/Components/Resistors/R3_9M_180.png
new file mode 100644
index 0000000000..2b96178fa1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9M_270.png b/ardublockly/img/Components/Resistors/R3_9M_270.png
new file mode 100644
index 0000000000..2806b175ca
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9M_90.png b/ardublockly/img/Components/Resistors/R3_9M_90.png
new file mode 100644
index 0000000000..13d222c972
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9_180.png b/ardublockly/img/Components/Resistors/R3_9_180.png
new file mode 100644
index 0000000000..89d5bb201f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9_270.png b/ardublockly/img/Components/Resistors/R3_9_270.png
new file mode 100644
index 0000000000..b0786c7339
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9_90.png b/ardublockly/img/Components/Resistors/R3_9_90.png
new file mode 100644
index 0000000000..e5353e9e8a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9k.png b/ardublockly/img/Components/Resistors/R3_9k.png
new file mode 100644
index 0000000000..97d5ca9918
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9k.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9k_180.png b/ardublockly/img/Components/Resistors/R3_9k_180.png
new file mode 100644
index 0000000000..925810b843
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9k_270.png b/ardublockly/img/Components/Resistors/R3_9k_270.png
new file mode 100644
index 0000000000..d8728e7109
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R3_9k_90.png b/ardublockly/img/Components/Resistors/R3_9k_90.png
new file mode 100644
index 0000000000..48b4cfc0d2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R3_9k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R47.png b/ardublockly/img/Components/Resistors/R47.png
new file mode 100644
index 0000000000..b7b5e47735
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47.png differ
diff --git a/ardublockly/img/Components/Resistors/R470.png b/ardublockly/img/Components/Resistors/R470.png
new file mode 100644
index 0000000000..abbac7be6c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470.png differ
diff --git a/ardublockly/img/Components/Resistors/R470_180.png b/ardublockly/img/Components/Resistors/R470_180.png
new file mode 100644
index 0000000000..de0c25b922
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R470_270.png b/ardublockly/img/Components/Resistors/R470_270.png
new file mode 100644
index 0000000000..54b0227dc4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R470_90.png b/ardublockly/img/Components/Resistors/R470_90.png
new file mode 100644
index 0000000000..47bb660708
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R470k.png b/ardublockly/img/Components/Resistors/R470k.png
new file mode 100644
index 0000000000..d16d855a10
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470k.png differ
diff --git a/ardublockly/img/Components/Resistors/R470k_180.png b/ardublockly/img/Components/Resistors/R470k_180.png
new file mode 100644
index 0000000000..5b55139455
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R470k_270.png b/ardublockly/img/Components/Resistors/R470k_270.png
new file mode 100644
index 0000000000..8ca998ac2a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R470k_90.png b/ardublockly/img/Components/Resistors/R470k_90.png
new file mode 100644
index 0000000000..a90ae12c1b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R470k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R47_180.png b/ardublockly/img/Components/Resistors/R47_180.png
new file mode 100644
index 0000000000..7a32f0bdd6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R47_270.png b/ardublockly/img/Components/Resistors/R47_270.png
new file mode 100644
index 0000000000..0ba97f52dd
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R47_90.png b/ardublockly/img/Components/Resistors/R47_90.png
new file mode 100644
index 0000000000..6fcd613d5a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R47k.png b/ardublockly/img/Components/Resistors/R47k.png
new file mode 100644
index 0000000000..766526577b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47k.png differ
diff --git a/ardublockly/img/Components/Resistors/R47k_180.png b/ardublockly/img/Components/Resistors/R47k_180.png
new file mode 100644
index 0000000000..f10f82f2e8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R47k_270.png b/ardublockly/img/Components/Resistors/R47k_270.png
new file mode 100644
index 0000000000..c57ef74265
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R47k_90.png b/ardublockly/img/Components/Resistors/R47k_90.png
new file mode 100644
index 0000000000..1c6d05d446
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R47k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7.png b/ardublockly/img/Components/Resistors/R4_7.png
new file mode 100644
index 0000000000..9927b86cc9
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7M.png b/ardublockly/img/Components/Resistors/R4_7M.png
new file mode 100644
index 0000000000..b401d4af6d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7M.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7M_180.png b/ardublockly/img/Components/Resistors/R4_7M_180.png
new file mode 100644
index 0000000000..79148376bf
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7M_270.png b/ardublockly/img/Components/Resistors/R4_7M_270.png
new file mode 100644
index 0000000000..70d3216b47
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7M_90.png b/ardublockly/img/Components/Resistors/R4_7M_90.png
new file mode 100644
index 0000000000..038b4f9c19
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7_180.png b/ardublockly/img/Components/Resistors/R4_7_180.png
new file mode 100644
index 0000000000..5bd16f3b56
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7_270.png b/ardublockly/img/Components/Resistors/R4_7_270.png
new file mode 100644
index 0000000000..1d1cbd561f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7_90.png b/ardublockly/img/Components/Resistors/R4_7_90.png
new file mode 100644
index 0000000000..13f01600c5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7k.png b/ardublockly/img/Components/Resistors/R4_7k.png
new file mode 100644
index 0000000000..1ddfb87f40
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7k.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7k_180.png b/ardublockly/img/Components/Resistors/R4_7k_180.png
new file mode 100644
index 0000000000..b158400e3a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7k_270.png b/ardublockly/img/Components/Resistors/R4_7k_270.png
new file mode 100644
index 0000000000..457e4f6a19
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R4_7k_90.png b/ardublockly/img/Components/Resistors/R4_7k_90.png
new file mode 100644
index 0000000000..5d05e969ca
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R4_7k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R56.png b/ardublockly/img/Components/Resistors/R56.png
new file mode 100644
index 0000000000..acbb8b562d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56.png differ
diff --git a/ardublockly/img/Components/Resistors/R560.png b/ardublockly/img/Components/Resistors/R560.png
new file mode 100644
index 0000000000..a23cce4e4e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560.png differ
diff --git a/ardublockly/img/Components/Resistors/R560_180.png b/ardublockly/img/Components/Resistors/R560_180.png
new file mode 100644
index 0000000000..80f5d6ef51
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R560_270.png b/ardublockly/img/Components/Resistors/R560_270.png
new file mode 100644
index 0000000000..c080929b2e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R560_90.png b/ardublockly/img/Components/Resistors/R560_90.png
new file mode 100644
index 0000000000..013ccc3150
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R560k.png b/ardublockly/img/Components/Resistors/R560k.png
new file mode 100644
index 0000000000..7c1c4d96a1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560k.png differ
diff --git a/ardublockly/img/Components/Resistors/R560k_180.png b/ardublockly/img/Components/Resistors/R560k_180.png
new file mode 100644
index 0000000000..e13e3b7b90
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R560k_270.png b/ardublockly/img/Components/Resistors/R560k_270.png
new file mode 100644
index 0000000000..42f27f0f26
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R560k_90.png b/ardublockly/img/Components/Resistors/R560k_90.png
new file mode 100644
index 0000000000..74f801811d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R560k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R56_180.png b/ardublockly/img/Components/Resistors/R56_180.png
new file mode 100644
index 0000000000..ffb6d2b041
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R56_270.png b/ardublockly/img/Components/Resistors/R56_270.png
new file mode 100644
index 0000000000..fc164db95e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R56_90.png b/ardublockly/img/Components/Resistors/R56_90.png
new file mode 100644
index 0000000000..f44735a10b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R56k.png b/ardublockly/img/Components/Resistors/R56k.png
new file mode 100644
index 0000000000..035ff52dd7
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56k.png differ
diff --git a/ardublockly/img/Components/Resistors/R56k_180.png b/ardublockly/img/Components/Resistors/R56k_180.png
new file mode 100644
index 0000000000..05d33cc878
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R56k_270.png b/ardublockly/img/Components/Resistors/R56k_270.png
new file mode 100644
index 0000000000..4d1d3a050c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R56k_90.png b/ardublockly/img/Components/Resistors/R56k_90.png
new file mode 100644
index 0000000000..1512368d1c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R56k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6.png b/ardublockly/img/Components/Resistors/R5_6.png
new file mode 100644
index 0000000000..d08519a313
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6M.png b/ardublockly/img/Components/Resistors/R5_6M.png
new file mode 100644
index 0000000000..c07fe90d78
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6M.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6M_180.png b/ardublockly/img/Components/Resistors/R5_6M_180.png
new file mode 100644
index 0000000000..67158a1e4c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6M_270.png b/ardublockly/img/Components/Resistors/R5_6M_270.png
new file mode 100644
index 0000000000..1dc48fd006
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6M_90.png b/ardublockly/img/Components/Resistors/R5_6M_90.png
new file mode 100644
index 0000000000..8da3a81d24
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6_180.png b/ardublockly/img/Components/Resistors/R5_6_180.png
new file mode 100644
index 0000000000..9428bf785d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6_270.png b/ardublockly/img/Components/Resistors/R5_6_270.png
new file mode 100644
index 0000000000..6ce22ccffa
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6_90.png b/ardublockly/img/Components/Resistors/R5_6_90.png
new file mode 100644
index 0000000000..c0bd329ef4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6k.png b/ardublockly/img/Components/Resistors/R5_6k.png
new file mode 100644
index 0000000000..09afae70b4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6k.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6k_180.png b/ardublockly/img/Components/Resistors/R5_6k_180.png
new file mode 100644
index 0000000000..9bbed2b10e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6k_270.png b/ardublockly/img/Components/Resistors/R5_6k_270.png
new file mode 100644
index 0000000000..20d93d34ef
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R5_6k_90.png b/ardublockly/img/Components/Resistors/R5_6k_90.png
new file mode 100644
index 0000000000..fe61fe72a6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R5_6k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R68.png b/ardublockly/img/Components/Resistors/R68.png
new file mode 100644
index 0000000000..059637701e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68.png differ
diff --git a/ardublockly/img/Components/Resistors/R680.png b/ardublockly/img/Components/Resistors/R680.png
new file mode 100644
index 0000000000..c41bbe7975
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680.png differ
diff --git a/ardublockly/img/Components/Resistors/R680_180.png b/ardublockly/img/Components/Resistors/R680_180.png
new file mode 100644
index 0000000000..79f729f582
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R680_270.png b/ardublockly/img/Components/Resistors/R680_270.png
new file mode 100644
index 0000000000..6511f5c0c5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R680_90.png b/ardublockly/img/Components/Resistors/R680_90.png
new file mode 100644
index 0000000000..51b25c89a1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R680k.png b/ardublockly/img/Components/Resistors/R680k.png
new file mode 100644
index 0000000000..89df096f02
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680k.png differ
diff --git a/ardublockly/img/Components/Resistors/R680k_180.png b/ardublockly/img/Components/Resistors/R680k_180.png
new file mode 100644
index 0000000000..b1e5ca991e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R680k_270.png b/ardublockly/img/Components/Resistors/R680k_270.png
new file mode 100644
index 0000000000..e9391df092
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R680k_90.png b/ardublockly/img/Components/Resistors/R680k_90.png
new file mode 100644
index 0000000000..be82d79b73
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R680k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R68_180.png b/ardublockly/img/Components/Resistors/R68_180.png
new file mode 100644
index 0000000000..cec8d15eb0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R68_270.png b/ardublockly/img/Components/Resistors/R68_270.png
new file mode 100644
index 0000000000..7f552967da
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R68_90.png b/ardublockly/img/Components/Resistors/R68_90.png
new file mode 100644
index 0000000000..1dd723e6fa
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R68k.png b/ardublockly/img/Components/Resistors/R68k.png
new file mode 100644
index 0000000000..2f0da36cd7
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68k.png differ
diff --git a/ardublockly/img/Components/Resistors/R68k_180.png b/ardublockly/img/Components/Resistors/R68k_180.png
new file mode 100644
index 0000000000..55bc7e3eef
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R68k_270.png b/ardublockly/img/Components/Resistors/R68k_270.png
new file mode 100644
index 0000000000..3bc9f180af
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R68k_90.png b/ardublockly/img/Components/Resistors/R68k_90.png
new file mode 100644
index 0000000000..5719f4905c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R68k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8.png b/ardublockly/img/Components/Resistors/R6_8.png
new file mode 100644
index 0000000000..b2486928b6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8M.png b/ardublockly/img/Components/Resistors/R6_8M.png
new file mode 100644
index 0000000000..76d67091a0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8M.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8M_180.png b/ardublockly/img/Components/Resistors/R6_8M_180.png
new file mode 100644
index 0000000000..6ed50cffac
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8M_270.png b/ardublockly/img/Components/Resistors/R6_8M_270.png
new file mode 100644
index 0000000000..6d29d2b0d0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8M_90.png b/ardublockly/img/Components/Resistors/R6_8M_90.png
new file mode 100644
index 0000000000..8f17ddd27d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8_180.png b/ardublockly/img/Components/Resistors/R6_8_180.png
new file mode 100644
index 0000000000..13b9ec218c
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8_270.png b/ardublockly/img/Components/Resistors/R6_8_270.png
new file mode 100644
index 0000000000..505d25e9e9
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8_90.png b/ardublockly/img/Components/Resistors/R6_8_90.png
new file mode 100644
index 0000000000..1e6ffa8bb6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8k.png b/ardublockly/img/Components/Resistors/R6_8k.png
new file mode 100644
index 0000000000..82e2660a38
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8k.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8k_180.png b/ardublockly/img/Components/Resistors/R6_8k_180.png
new file mode 100644
index 0000000000..a56836e3b0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8k_270.png b/ardublockly/img/Components/Resistors/R6_8k_270.png
new file mode 100644
index 0000000000..1f5f87c4ea
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R6_8k_90.png b/ardublockly/img/Components/Resistors/R6_8k_90.png
new file mode 100644
index 0000000000..559482b0eb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R6_8k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R82.png b/ardublockly/img/Components/Resistors/R82.png
new file mode 100644
index 0000000000..07b4a58c6f
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82.png differ
diff --git a/ardublockly/img/Components/Resistors/R820.png b/ardublockly/img/Components/Resistors/R820.png
new file mode 100644
index 0000000000..38c33d1a6b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820.png differ
diff --git a/ardublockly/img/Components/Resistors/R820_180.png b/ardublockly/img/Components/Resistors/R820_180.png
new file mode 100644
index 0000000000..e26c8fa290
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R820_270.png b/ardublockly/img/Components/Resistors/R820_270.png
new file mode 100644
index 0000000000..ca3749a365
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R820_90.png b/ardublockly/img/Components/Resistors/R820_90.png
new file mode 100644
index 0000000000..1fb42cdade
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R820k.png b/ardublockly/img/Components/Resistors/R820k.png
new file mode 100644
index 0000000000..74c11d353b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820k.png differ
diff --git a/ardublockly/img/Components/Resistors/R820k_180.png b/ardublockly/img/Components/Resistors/R820k_180.png
new file mode 100644
index 0000000000..87f821c2fd
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R820k_270.png b/ardublockly/img/Components/Resistors/R820k_270.png
new file mode 100644
index 0000000000..3713a0ecc2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R820k_90.png b/ardublockly/img/Components/Resistors/R820k_90.png
new file mode 100644
index 0000000000..2157b302b6
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R820k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R82_180.png b/ardublockly/img/Components/Resistors/R82_180.png
new file mode 100644
index 0000000000..f816947655
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R82_270.png b/ardublockly/img/Components/Resistors/R82_270.png
new file mode 100644
index 0000000000..1c1454b5e4
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R82_90.png b/ardublockly/img/Components/Resistors/R82_90.png
new file mode 100644
index 0000000000..c77fdcd490
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R82k.png b/ardublockly/img/Components/Resistors/R82k.png
new file mode 100644
index 0000000000..d97df4bcbc
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82k.png differ
diff --git a/ardublockly/img/Components/Resistors/R82k_180.png b/ardublockly/img/Components/Resistors/R82k_180.png
new file mode 100644
index 0000000000..c8cdf3358b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R82k_270.png b/ardublockly/img/Components/Resistors/R82k_270.png
new file mode 100644
index 0000000000..54310f7413
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R82k_90.png b/ardublockly/img/Components/Resistors/R82k_90.png
new file mode 100644
index 0000000000..d9a7aa7423
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R82k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2.png b/ardublockly/img/Components/Resistors/R8_2.png
new file mode 100644
index 0000000000..8e56b57dc0
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2M.png b/ardublockly/img/Components/Resistors/R8_2M.png
new file mode 100644
index 0000000000..0218848cc8
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2M.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2M_180.png b/ardublockly/img/Components/Resistors/R8_2M_180.png
new file mode 100644
index 0000000000..c0ffdac2c2
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2M_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2M_270.png b/ardublockly/img/Components/Resistors/R8_2M_270.png
new file mode 100644
index 0000000000..6f76ac473d
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2M_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2M_90.png b/ardublockly/img/Components/Resistors/R8_2M_90.png
new file mode 100644
index 0000000000..0617ddd159
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2M_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2_180.png b/ardublockly/img/Components/Resistors/R8_2_180.png
new file mode 100644
index 0000000000..55c7e8c4ef
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2_270.png b/ardublockly/img/Components/Resistors/R8_2_270.png
new file mode 100644
index 0000000000..045dbbf71e
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2_90.png b/ardublockly/img/Components/Resistors/R8_2_90.png
new file mode 100644
index 0000000000..7ed10106d1
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2_90.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2k.png b/ardublockly/img/Components/Resistors/R8_2k.png
new file mode 100644
index 0000000000..8febde960a
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2k.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2k_180.png b/ardublockly/img/Components/Resistors/R8_2k_180.png
new file mode 100644
index 0000000000..aa8f82fd47
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2k_180.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2k_270.png b/ardublockly/img/Components/Resistors/R8_2k_270.png
new file mode 100644
index 0000000000..1aff9f3c9b
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2k_270.png differ
diff --git a/ardublockly/img/Components/Resistors/R8_2k_90.png b/ardublockly/img/Components/Resistors/R8_2k_90.png
new file mode 100644
index 0000000000..f327eee856
Binary files /dev/null and b/ardublockly/img/Components/Resistors/R8_2k_90.png differ
diff --git a/ardublockly/img/Components/Resistors/RBlown.png b/ardublockly/img/Components/Resistors/RBlown.png
new file mode 100644
index 0000000000..f3f41ea467
Binary files /dev/null and b/ardublockly/img/Components/Resistors/RBlown.png differ
diff --git a/ardublockly/img/Components/Resistors/RBlown_180.png b/ardublockly/img/Components/Resistors/RBlown_180.png
new file mode 100644
index 0000000000..e1efab17d5
Binary files /dev/null and b/ardublockly/img/Components/Resistors/RBlown_180.png differ
diff --git a/ardublockly/img/Components/Resistors/RBlown_270.png b/ardublockly/img/Components/Resistors/RBlown_270.png
new file mode 100644
index 0000000000..3c5e2013eb
Binary files /dev/null and b/ardublockly/img/Components/Resistors/RBlown_270.png differ
diff --git a/ardublockly/img/Components/Resistors/RBlown_90.png b/ardublockly/img/Components/Resistors/RBlown_90.png
new file mode 100644
index 0000000000..55b92d7fea
Binary files /dev/null and b/ardublockly/img/Components/Resistors/RBlown_90.png differ
diff --git a/ardublockly/index.html b/ardublockly/index.html
index 75fa9a3538..dadc09e4e3 100644
--- a/ardublockly/index.html
+++ b/ardublockly/index.html
@@ -16,6 +16,7 @@
+
-
+
+
+
@@ -74,6 +89,15 @@
-
-
-
+