Commit Graph

598 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
d937bc692b [apps/code] Fix crashes on full buffer
Change-Id: If9297f1ca29015cad0cc1cdda3ad610fd1493392
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
aba135bc8b [escher] Add textArea line number limit
Change-Id: Ia0d9a9136282efc87c0996c141c0852ed75892f9
2020-11-04 15:11:45 +01:00
Hugo Saint-Vignes
1f9d0b5810 [apps/code] Reorder rows due to color name change
Change-Id: I1c8f3e9d015cf55ec8fc38082f60e957b19b196d
2020-11-04 15:07:20 +01:00
Hugo Saint-Vignes
e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00
Gabriel Ozouf
b7c7695707 [apps/code] Remove interruption check
A check for interruption in ConsoleController::printText caused script
to immediately stop when launched after an interrupted script.
This check was used to break out of infinite print loop, but now
becomes redundant with how micropython_port_vm_hook_loop was changed.

Change-Id: Ifa8d415e1b2c2406ad67300eb14ce46889af296f
2020-08-31 15:32:02 +02:00
Léa Saviot
b4dd4b5e7e [apps/code/i18n] Make italian wording fit 2020-07-16 11:53:12 +02:00
Émilie Feral
db331e054a [apps/code] variable_box_controller: avoid unused variable warning when DEBUG=0 2020-06-26 10:47:14 +02:00
Émilie Feral
bac2949a5e [escher][apps] SelectableTableViewDelegate: add
tableViewDidChangeSelectionAndDidScroll method and implement it for
Calculation::HistoryController

This fixes the following bug: In the calculation application, input 1,
OK, 1/2/3/4/5/6/7/8, OK, up, up, left, down, up. The selection failed.
2020-06-25 13:48:47 +02:00
Léa Saviot
2d1d3ca944 [apps/code] Fix variables loading in the console
The two following scenari display empty variable boxes, when there
should be loaded variables.
1) Open the console, go back to the scripts menu, go back to the
console, open the variable box
2) Open the console, execute mandelbrot, open the variable box
2020-06-25 11:31:01 +02:00
Léa Saviot
1045f54633 [apps/code] Fix variables loading in the console
Scenario: execute a script, open the variable box, select a leaf, reopen
the variable box -> it shows empty
2020-06-19 12:10:24 +02:00
Léa Saviot
1f0b3770e3 [apps/code] Fix syntaxic coloration
Scenario: +, -, / operators where no longer properly colored during
script edition.
This was due to the MicroPython update, which changed the lexer tokens
order.
2020-06-15 13:26:32 +02:00
Léa Saviot
ff3b756080 [apps/console] Fix the script console fetch status cleaning
unloadPythonEnvironment is not called when leaving the app, only after
editing a script, so it did not do what we wanted.
2020-06-11 14:12:50 +02:00
Émilie Feral
555db32670 [apps/code] Fix test on variable_box_controller 2020-06-11 11:36:45 +02:00
Léa Saviot
bee7441444 [apps/code] Fix an assertion break
Scenario: write a script, execute it in the console and open the
variable box, go back to edition and trigger autocompletion.
2020-06-10 10:49:22 +02:00
Léa Saviot
1ccb55a16e [apps/code] Fix script importation status
Scenario: Execute the script parabola.py, open the variable box, select
any leaf, enter, open the variable box again -> no variables are loaded
anymore
2020-06-09 15:12:13 +02:00
Léa Saviot
9a1ff2bd33 [apps/code] Status at the beginning of a script is one byte long
This saves space + avoids clashes with the NumWorks Workshop when
exchanging scripts
2020-06-05 11:28:12 +02:00
Émilie Feral
2ebad3062c [apps/code] Test: strcpy isn't available on the device 2020-06-04 14:50:10 +02:00
Émilie Feral
66ba985108 [apps/code] In toolbox: plot(x,y) --> plot(x,y,color) 2020-06-04 14:50:10 +02:00
Émilie Feral
6c54fb4ebc [apps/code] Add 'write' to the toolbox (in Turtle module and catalog) 2020-06-04 14:50:10 +02:00
Léa Saviot
1635f6132b [apps/code] Fix circular importation in the variable box
Scenario (crashed only on the calculator):

script1.py
from script2 import *
a=1

script2.py
from script1 import *
b=2
2020-06-04 14:50:10 +02:00
Léa Saviot
6819041c1d [apps/code] Remove TODOs 2020-06-04 14:50:10 +02:00
Léa Saviot
622cbe2e03 [apps/code] Fix auticompletion of color from Turtle
It added color(|)/color(,,) instead of just color(|)
2020-06-04 14:50:10 +02:00
Léa Saviot
e6b87be75e [apps/i18n] Fix some i18n
Did not fit or missed a space
2020-06-04 14:50:10 +02:00
Émilie Feral
2f4c59b881 [apps/code] VariableBoxController::addNodeIfMatches: factorize the checking
for node unicity and the insertion index computation
2020-06-04 14:50:10 +02:00
Émilie Feral
555617aff3 [apps/code] Factorize VariableBoxController::addNode 2020-06-04 14:50:09 +02:00
Émilie Feral
705b1812f1 [apps/code] VariableBoxController: fix NodeNameCompare when nameLength >
nodeNameLength (step 2)
2020-06-04 14:50:09 +02:00
Émilie Feral
41bb169edd [apps/variable_box_controller] Auto-import: ignore variable when it is
the autocompleted one
2020-06-04 14:50:09 +02:00
Émilie Feral
d82e6de6e8 [apps/code] VariableBoxController: fix NodeNameCompare when nameLength >
nodeNameLength
2020-06-04 14:50:09 +02:00
Émilie Feral
2b53ea748d [apps/code] Typo 2020-06-04 14:50:09 +02:00
Léa Saviot
34a4a3311a [apps/code] Add test on variable_box_controller 2020-06-04 14:50:09 +02:00
Léa Saviot
5412410723 [apps/code] Remove duplicates in the variable box
Example script:
from turtle import *
hideturtle()

We had "hideturtle" in the local variables, and "hideturtle()" in the
imported. Now we should only have the latter.
2020-06-04 14:50:09 +02:00
Léa Saviot
40d98389d4 [apps/code] Cleaner code in VariableBoxController::loadCurrentVariablesInScript 2020-06-04 14:50:09 +02:00
Léa Saviot
6b558c3328 [apps/code] Replace if with assertion 2020-06-04 14:50:09 +02:00
Léa Saviot
b466a8711b [apps/code] Remove dead code 2020-06-04 14:50:09 +02:00
Léa Saviot
38443c0e83 [apps/code] Fix VariableBoxController::empty
No scenario, but it seems right to reset m_shortenResultCharCount
2020-06-04 14:50:09 +02:00
Léa Saviot
c102bf2e4e [apps/code] Fix again variable_box_controller
Scenario: add the script
from matplotlib.pyplot import *\nfrom math import *\n\ng=9.81\n\ndef x(t,v_0,alpha):\n  return v_0*cos(alpha)*t\ndef y(t,v_0,alpha,h_0):\n  return -0.5*g*t**2+v_0*sin(alpha)*t+h_0\n\ndef vx(v_0,alpha):\n  return v_0*cos(alpha)\ndef vy(t,v_0,alpha):\n  return -g*t+v_0*sin(alpha)\n\ndef t_max(v_0,alpha,h_0):\n  return (v_0*sin(alpha)+sqrt((v_0**2)*(sin(alpha)**2)+2*g*h_0))/g\n\ndef simulation(v_0=15,alpha=pi/4,h_0=2):\n  tMax=t_max(v_0,alpha,h_0)\n  accuracy=1/10**(floor(log10(tMax))-1)\n  T_MAX=floor(tMax*accuracy)+1\n  X=[x(t/accuracy,v_0,alpha) for t in range(T_MAX)]\n  Y=[y(t/accuracy,v_0,alpha,h_0) for t in range(T_MAX)]\n  VX=[vx(v_0,alpha) for t in range(T_MAX)]\n  VY=[vy(t/accuracy,v_0,alpha) for t in range(T_MAX)]\n  for i in range(T_MAX):\n    arrow(X[i],Y[i],VX[i]/accuracy,VY[i]/accuracy)\n  grid()\n  show()tan(if :\n    \n  celse:\n  )c
then autocomplete after the last c.
2020-06-04 14:50:09 +02:00
Léa Saviot
5d49f5dca2 [apps/code] Fix VariableBoxController::addNodesFromImportMaybe
Scenario: write a ascrip "from matplotlib.pyplot0 import *" than open
the variable box
2020-06-04 14:50:09 +02:00
Léa Saviot
9d8eb1dbb6 [apps/code] Fix misnamed i18n 2020-06-04 14:50:09 +02:00
Léa Saviot
2bea3f3d47 [apps/code] Fix again VariableBoxController::loadCurrentVariablesInScript 2020-06-04 14:50:09 +02:00
Léa Saviot
00291c8974 [apps/code] Fix var initialisation in variable_box_controller 2020-06-04 14:50:09 +02:00
Arthur
472cfc012c [matplotlib] Added colors to the toolbox in python
Change-Id: I3ff3d4fb3552bcb8c375c77651db3b7c44991646
2020-06-04 14:50:09 +02:00
Léa Saviot
691c6739af [apps/variable_box_controller] Fix loadCurrentVariablesInScript
Scenario: write the script:

def squares():
  for i in range(660):
    forward(L)lo)

Put the cursor right of "lo" and press backspace.
2020-06-04 14:50:08 +02:00
Émilie Feral
f2a1c635ef [apps/code] I18n: Missing translations 2020-06-04 14:50:08 +02:00
Léa Saviot
d41b93c711 [apps/code] Put back the squares script template 2020-06-04 14:50:07 +02:00
Léa Saviot
6dfccc6edf Revert "[apps/code] EXE event accepts autocompletion"
This reverts commit 5a96fd0e5de4a9bda30900e0c81a0b15f3fe081a.
2020-06-04 14:50:07 +02:00
Léa Saviot
0b88bb0767 [apps/code] Reset m_autocompletionResultIndex when addingAutocompletion 2020-06-04 14:50:07 +02:00
Léa Saviot
a53edf5202 [apps/code] Remove TODOs 2020-06-04 14:50:07 +02:00
Léa Saviot
f763bb50ac [apps/code] Do not display subtitles in var box from console 2020-06-04 14:50:07 +02:00
Léa Saviot
780c593c26 [apps/code] Autocompletion for "abs" proposes parentheses 2020-06-04 14:50:06 +02:00
Léa Saviot
b070eaad45 [apps/code] Remove double call to addAutocompletion 2020-06-04 14:50:06 +02:00