public void updatePoint(string ptName, Vector3 newLoc, bool fixedPlane) { CalcOutput originalExpression = ptInput.currExpression; eqnInput = false; //inputReceived = true; SetOutput(ptSet.ptCoords[ptName].X); ptInput.RewriteInput(newLoc.x); SetOutput(ptSet.ptCoords[ptName].Y); ptInput.RewriteInput(newLoc.y); SetOutput(ptSet.ptCoords[ptName].Z); ptInput.RewriteInput(newLoc.z); SetOutput(originalExpression); if (fixedPlane) { manageText(); ManageFeedback(); ptSet.CompileAll(); } else { manageText(); bool isValid = ptSet.CompileAll(); ManageFeedback(); if (isValid) { if (presentPlane.CalculatePlane()) { presentPlane.ApplyUnroundCenter(ptName, newLoc); presentPlane.GetPlaneDirection(); } } } }
public void initialize() { es = new ExpressionSet(); es.expressions[ExpressionSet.ExpOptions.X].tokens = new List <string> { "y" }; es.expressions[ExpressionSet.ExpOptions.Y].tokens = new List <string> { "-x" }; es.expressions[ExpressionSet.ExpOptions.Z].tokens = new List <string> { "0" }; es.ranges["t"].Min.tokens = new List <string> { "-", "5", "0" }; es.ranges["t"].Max.tokens = new List <string> { "5", "0" }; currExpression = es.expressions[ExpressionSet.ExpOptions.X]; currText = xText; index = currExpression.tokens.Count; isReady = true; xText.text = displayText(es.expressions[ExpressionSet.ExpOptions.X].tokens, es.expressions[ExpressionSet.ExpOptions.X].tokens.Count, false); yText.text = displayText(es.expressions[ExpressionSet.ExpOptions.Y].tokens, es.expressions[ExpressionSet.ExpOptions.Y].tokens.Count, false); zText.text = displayText(es.expressions[ExpressionSet.ExpOptions.Z].tokens, es.expressions[ExpressionSet.ExpOptions.Z].tokens.Count, false); tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false); tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false); currText.text = displayText(currExpression.tokens, index, true); }
public void eqnUpdatePoint(Vector3 pt1NewLoc, Vector3 pt2NewLoc, Vector3 pt3NewLoc) { CalcOutput originalExpression = ptInput.currExpression; SetOutput(ptSet.ptCoords["pt1"].X); ptInput.RewriteInput(pt1NewLoc.x); SetOutput(ptSet.ptCoords["pt1"].Y); ptInput.RewriteInput(pt1NewLoc.y); SetOutput(ptSet.ptCoords["pt1"].Z); ptInput.RewriteInput(pt1NewLoc.z); SetOutput(ptSet.ptCoords["pt2"].X); ptInput.RewriteInput(pt2NewLoc.x); SetOutput(ptSet.ptCoords["pt2"].Y); ptInput.RewriteInput(pt2NewLoc.y); SetOutput(ptSet.ptCoords["pt2"].Z); ptInput.RewriteInput(pt2NewLoc.z); SetOutput(ptSet.ptCoords["pt3"].X); ptInput.RewriteInput(pt3NewLoc.x); SetOutput(ptSet.ptCoords["pt3"].Y); ptInput.RewriteInput(pt3NewLoc.y); SetOutput(ptSet.ptCoords["pt3"].Z); ptInput.RewriteInput(pt3NewLoc.z); SetOutput(originalExpression); manageText(); ManageFeedback(); ptSet.CompileAll(); presentline.GetLocalPoint(); presentline.GetPlaneDirection(); presentline.forwardPlane.GetComponent <MeshRenderer>().enabled = true; presentline.backwardPlane.GetComponent <MeshRenderer>().enabled = true; }
public void updateDet(float newDet) { CalcOutput originalExpression = ptInput.currExpression; SetOutput(eqnSet.eqnCoefs["a"]); ptInput.RewriteInput(newDet); SetOutput(originalExpression); manageText(); eqnSet.CompileAll(); }
public void UpdateText() { xText.text = displayText(es.expressions["X"].tokens, es.expressions["X"].tokens.Count, false); yText.text = displayText(es.expressions["Y"].tokens, es.expressions["Y"].tokens.Count, false); zText.text = displayText(es.expressions["Z"].tokens, es.expressions["Z"].tokens.Count, false); tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false); tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false); currExpression = es.expressions["X"]; index = currExpression.tokens.Count; currText.text = displayText(currExpression.tokens, index, true); }
public void SetOutput(CalcOutput output) { ptInput.ChangeOutput(output); if (output != eqnSet.eqnCoefs["a"] && output != eqnSet.eqnCoefs["b"] && output != eqnSet.eqnCoefs["c"] && output != eqnSet.eqnCoefs["d"]) { eqnInput = false; } else { eqnInput = true; } }
//public GeneratePlanePts generatePlanePts_col; //public GeneratePlanePts generatePlanePts_null; public void SetOutput(CalcOutput output) { ptInput.ChangeOutput(output); //if (output != eqnSet.eqnCoefs["a"] && output != eqnSet.eqnCoefs["b"] && output != eqnSet.eqnCoefs["c"] && output != eqnSet.eqnCoefs["d"]) //{ eqnInput = false; //} //else //{ // eqnInput = true; //} }
internal DensityKeyboardInputResponder(TextMesh x, TextMesh y, TextMesh z, TextMesh tmin, TextMesh tmax) { es = new ExpressionSet(); // xText = x; // yText = y; // zText = z; // tminText = tmin; // tmaxText = tmax; dens = CustomDensityPlot.SampleDensity.HIGH; currExpression = es.expressions["X"]; // currText = xText; }
internal VectorKeyboardInputResponder(TextMesh x, TextMesh y, TextMesh z, TextMesh tmin, TextMesh tmax) { es = new ExpressionSet(); xText = x; yText = y; zText = z; tminText = tmin; tmaxText = tmax; dens = CustomVectorField.SampleDensity.LOW; currExpression = es.expressions["X"]; currText = xText; }
public void updateEqn(float newA, float newB, float newC, float newD) { CalcOutput originalExpression = ptInput.currExpression; SetOutput(eqnSet.eqnCoefs["a"]); ptInput.RewriteInput(newA); SetOutput(eqnSet.eqnCoefs["b"]); ptInput.RewriteInput(newB); SetOutput(eqnSet.eqnCoefs["c"]); ptInput.RewriteInput(newC); SetOutput(eqnSet.eqnCoefs["d"]); ptInput.RewriteInput(newD); SetOutput(originalExpression); manageText(); eqnSet.CompileAll(); ManageFeedback(); }
public void updateEqn() { CalcOutput originalExpression = ptInput.currExpression; SetOutput(eqnSet.eqnCoefs["a"]); ptInput.RewriteInput(); SetOutput(eqnSet.eqnCoefs["b"]); ptInput.RewriteInput(); SetOutput(eqnSet.eqnCoefs["c"]); ptInput.RewriteInput(); SetOutput(eqnSet.eqnCoefs["d"]); ptInput.RewriteInput(); SetOutput(originalExpression); manageText(); eqnSet.CompileAll(); feedbacks.eqnFeedback.material.color = negativeFeedback; }
public void initialize() { es = new ExpressionSet(); es.expressions["X"].tokens = new List <string> { //2Pz //"(","1","/","4","*","1","/","2","^","(","1","/","2",")","*","1","/","pi","^","(","1","/","2",")", //"*","z","*","e","^","(","-","1","*","(","x","^","2","+","y","^","2","+","z","^","2",")","/","2",")",")","^","2" //3Pz "(", "2", "^", "(", "1", "/", "2", ")", "*", "1", "/", "8", "1", "*", "1", "/", "pi", "^", "(", "1", "/", "2", ")", "*", "(", "6", "-", "(", "x", "^", "2", "+", "y", "^", "2", "+", "z", "^", "2", ")", "^", "(", "1", "/", "2", ")", ")", "*", "z", "*", "e", "^", "(", "-", "1", "*", "(", "x", "^", "2", "+", "y", "^", "2", "+", "z", "^", "2", ")", "^", "(", "1", "/", "2", ")", "/", "3", ")", ")", "^", "2" //3Dz2 //"(","1","/","81","*","1","/","6","^","(","1","/","2",")","*","1","/","pi","^","(","1","/","2",")", //"*","(","3","*","z","^","2","-","x","^","2","+","y","^","2","+","z","^","2",")", //"*","e","^","(","-","1","*","(","x","^","2","+","y","^","2","+","z","^","2",")","/","3",")",")","^","2" }; es.expressions["Y"].tokens = new List <string> { "0" }; es.expressions["Z"].tokens = new List <string> { "0" }; es.ranges["t"].Min.tokens = new List <string> { "-", "5", "0" }; es.ranges["t"].Max.tokens = new List <string> { "5", "0" }; currExpression = es.expressions["X"]; // currText = xText; index = currExpression.tokens.Count; isReady = true; // xText.text = displayText(es.expressions[ExpressionSet.ExpOptions.X].tokens, es.expressions[ExpressionSet.ExpOptions.X].tokens.Count, false); // yText.text = displayText(es.expressions[ExpressionSet.ExpOptions.Y].tokens, es.expressions[ExpressionSet.ExpOptions.Y].tokens.Count, false); // zText.text = displayText(es.expressions[ExpressionSet.ExpOptions.Z].tokens, es.expressions[ExpressionSet.ExpOptions.Z].tokens.Count, false); // tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false); // tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false); // currText.text = displayText(currExpression.tokens, index, true); }
public void updatePoint(string ptName, Vector3 newLoc, bool fixedPlane) { CalcOutput originalExpression = ptInput.currExpression; eqnInput = false; //inputReceived = true; SetOutput(ptSet.ptCoords[ptName].X); ptInput.RewriteInput(newLoc.y); SetOutput(ptSet.ptCoords[ptName].Y); ptInput.RewriteInput(newLoc.x); SetOutput(ptSet.ptCoords[ptName].Z); ptInput.RewriteInput(newLoc.z); SetOutput(originalExpression); manageText(); bool isValid = ptSet.CompileAll(); Debug.Log("is it valid? " + isValid); ManageFeedback(); }
public CalcOutput CalcModemSettings(ModemSettingsForCalc a_Settings) { try { InputData dat = new InputData { input_afc_en = a_Settings.AFCEnabled, input_modulation_type = (byte) a_Settings.ModulationType, input_ook_rxbw_khz = (short) a_Settings.OOKRXBandwidth, input_manchester_en = a_Settings.MancEnabled, input_xtal_khz = a_Settings.XtalFreqkHz, input_tx_xtal_ppm = (byte) a_Settings.TxXtalPpm, input_rx_xtal_ppm = (byte) a_Settings.RxXtalPpm, input_rb_kbps = a_Settings.DataRateKbps, input_fd_khz = a_Settings.Deviation, input_carrier_freq_mhz = a_Settings.CarrierFreqMHz, input_max_rb_err_percent = a_Settings.BigDRerror, input_manch_pream_pol = a_Settings.ManchPreambPol, input_manch_data_inv = a_Settings.ManInvEnabled, input_data_whiten = a_Settings.DataWhiteningEnabled, input_data_inversion = a_Settings.DataInvEnabled, input_tx_clk_config = a_Settings.TxClkConfig }; PassInputData(ref dat); calculator(); overflow_checks(); update_output_addr_regs(); log_results(); CalcOutput output = new CalcOutput(); GetOutputData(ref output.modemRegs, ref output.hiddenCalc, ref output.outputRegisters, ref output.overflowIndocators); return output; } catch { return null; } }
public void updatePoint(string ptName, Vector3 newLoc, bool fixedPlane) { CalcOutput originalExpression = ptInput.currExpression; SetOutput(ptSet.ptCoords[ptName].X); ptInput.RewriteInput(newLoc.y); SetOutput(ptSet.ptCoords[ptName].Y); ptInput.RewriteInput(newLoc.x); SetOutput(ptSet.ptCoords[ptName].Z); ptInput.RewriteInput(newLoc.z); SetOutput(originalExpression); if (fixedPlane) { manageText(); ManageFeedback(); ptSet.CompileAll(); } else { manageText(); bool isValid = ptSet.CompileAll(); ManageFeedback(); } }
public void ChangeOutput(CalcOutput calcOutput) { currExpression = calcOutput; index = currExpression.tokens.Count; }
public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider) { switch (sender.name) { case "Button_del": if (index > 0) { currExpression.tokens.RemoveAt(index - 1); index--; } break; case "Button_Clear": index = 0; currExpression.tokens.Clear(); break; case "Button_Enter": isReady = true; break; default: currExpression.tokens.Insert(index, sender.name); isReady = true; index++; break; case "Button_left": index--; if (index < 0) { index = 0; } break; case "Button_right": index++; if (index > currExpression.tokens.Count) { index = currExpression.tokens.Count; } break; case "Button_start": index = 0; break; case "Button_end": index = currExpression.tokens.Count; break; case "Button_Xinput": currExpression = es.expressions["X"]; currText = xText; index = currExpression.tokens.Count; break; case "Button_Yinput": currExpression = es.expressions["Y"]; currText = yText; index = currExpression.tokens.Count; break; case "Button_Zinput": currExpression = es.expressions["Z"]; currText = zText; index = currExpression.tokens.Count; break; case "tmin": currExpression = es.ranges["t"].Min; currText = tminText; index = currExpression.tokens.Count; break; case "tmax": currExpression = es.ranges["t"].Max; currText = tmaxText; index = currExpression.tokens.Count; break; case "high": dens = CustomVectorField.SampleDensity.HIGH; isReady = true; break; case "medium": dens = CustomVectorField.SampleDensity.MEDIUM; isReady = true; break; case "low": dens = CustomVectorField.SampleDensity.LOW; isReady = true; break; } //index++; xText.text = displayText(es.expressions["X"].tokens, es.expressions["X"].tokens.Count, false); yText.text = displayText(es.expressions["Y"].tokens, es.expressions["Y"].tokens.Count, false); zText.text = displayText(es.expressions["Z"].tokens, es.expressions["Z"].tokens.Count, false); tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false); tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false); currText.text = displayText(currExpression.tokens, index, true); sender.SetState(1); }
public void SetOutput(CalcOutput output) { calcInput.ChangeOutput(output); }
public void SetOutput(CalcOutput output) { ptInput2D.ChangeOutput(output); }