Post Reply 
Editor/converter/program manager for the Prime Calculator (PrimeComm)
12-12-2013, 03:13 AM (This post was last modified: 03-18-2015 01:34 PM by eried.)
Post: #1
Editor/converter/program manager for the Prime Calculator (PrimeComm)
Warning: Transfers aren't working with the last 6330 firmware. Other functions may not work with firmware 6330 or latest, please use the official Connectivity Kit.

[Image: Image%202014-03-31%20at%202.58.49%20PM.png]

Version 0.9 b22 (Updated 2014-05-24)
Download: http://servicios.ried.cl/primecomm/Prime...9.22.0.exe
Source: https://github.com/eried/PrimeComm
How it was made: http://ried.cl/en/franqueando-los-secret...a-inversa/
Requires the .Net Framework 4.0 (this is probably already installed in your machine)

The main purpose of this application is to allow the user to send and receive programs from the HP Prime Calculator. Besides this purpose, the application has few handy extra features:
  • Can convert from images1, plain txt, chip8 ROMs, other kinds of hpprgm to a valid (unnamed) hpprgm file (that can be saved, sent to the emulator, device, etc)
  • Includes a code editor (PrimePad), that has line numbers, syntax highlighting and all the features included in PrimeComm, including the conversion from/to differents formats. This editor includes printing and printing preview of the source code for the people who still love using the real-world™ paper.
  • The application can do some refactoring over the programs, as an example: it can remove the comments when you are sending the file to the calculator to save precious flash memory space, rename long variables into an obfuscated one (pattern you can set in the advanced settings), remove empty lines and spaces at your will.
  • The package includes a small brother application for console/automated/batch operations. PrimeCmd uses exactly the same libraries from PrimeComm, so it is merely a layer to access these features in an automated manner.
  • PrimeSkin allows the user to edit the emulator skins.
  • Coming soon: PrimeScreen (screen capturer with fullscreen mode and stream record), more enhancements to PrimePad, etc.
Enjoy!

PrimePad is included and has a dynamic reference now!:
[Image: primepad_soon.gif]

[Image: 2014-04-22_1755.png]

Other screens:
[Image: Image%202014-01-05%20at%208.18.00%20PM.png] [Image: Image%202013-12-22%20at%205.15.00%20PM.png] [Image: 2013-12-22_1708.png] [Image: Image%202013-12-11%20at%2011.59.56%20PM.png]

1 ICON (PNG) image mode isn't available due poor description of the encoding (it is "working" but the image isn't properly encoded yet with common png encoders)
___________________
Demos:
Version 0.1: https://www.youtube.com/watch?v=4QGBjOD3LHo (Send and receive)
Version 0.5: https://www.youtube.com/watch?v=FxG-R0QZ-qI (Conversion to plain text)
Version 0.7: https://www.youtube.com/watch?v=UVALe40TPkc (Command server mode)

BTW, I don't use mac nor linux a lot, but .Net is portable to both:
[Image: Image%202013-12-11%20at%2011.50.58%20PM.png]

The problem is... A new hidusb library is required (mainly just the filestream operations, usb enumerations and simple stuff)
___________________

Changelog:

*0.9.22 20140423: PrimeHelp now can be closed with ESC (so it can be opened system-wide with ALTGR+. (or F1 inside PrimeComm) and operated by keyboard entirely. New style for PrimePad. New keywords definitions for PrimePad including ALL ones from the calculator's catalog. Small changes in the Settings dialog and a new option to disable the loading of these keywords/styles from external files.

*0.9.21 20140423: PrimeHelp now bundled into PrimeComm and PrimePad (just press F1).

___________________

HP Prime Calculator communication library, gui, command line solution
http://ried.cl/proyecto/utilidad-para-in...primecomm/

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-13-2013, 04:33 PM
Post: #2
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
(12-13-2013 03:52 PM)compsystems Wrote:  Erwin, enviando la biblioteca de fractales de este mismo foro veo que no se esta decodificando bien el símbolo flecha a la derecha ->, aparece como ?

Code:
TEXTOUT_P(STRING(→HMS(Timing)),140,100);

¿Enviándolo por el portapapeles o usando el hpprgm?

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-13-2013, 05:46 PM (This post was last modified: 12-13-2013 05:49 PM by eried.)
Post: #3
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
No puedo copiarlo directamente ni al Conn Kit, yo creo que es más problema del foro y la conversión que hace. 'Notepad' soporta unicode y muchos otros formatos.

Si es mas que nada por ese motivo mi interés por hacer PrimeComm. Imaginate este tipo de problemas, sólo para probar un código, debes depurar el código manualmente. Si recibes el txt con primecomm y lo publicas en la web, lo puedes volver a cargar con primecomm: listo, no debes depurar nada. Idealmente me gustaria meter ese txt en un .prime por ejemplo y añadir un xml dentro con la descripción y una captura de pantalla. Así como si fuera un apk de android.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-13-2013, 11:52 PM
Post: #4
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Hey compsystems, creo que ahora ya reparé todo! Big Grin prueba y me dices
______________________

Found a little bug in the size calculation and encoding detection. Now it should work wonderfully for *any* encoding (unicode, bigendianunicode, ansi)

https://github.com/eried/PrimeComm/commi...eedd8c4148

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-14-2013, 03:50 AM
Post: #5
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
¿Puedes grabar ese problema? Con jing o algun programa así

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
12-15-2013, 08:46 PM (This post was last modified: 12-15-2013 09:01 PM by eried.)
Post: #6
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Podríamos organizarnos y crear una lista de comandos, parámetros y ayuda para hacer el editor (el intellisense y eso). Creo que usaré scintilla, es pesado pero poderoso:

[Image: 2013-12-15_1800.png]

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-02-2014, 10:34 AM
Post: #7
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Bueno, mi idea realmente no es copiar ese programa. Preferiría añadir snippets en el "intellisense" como lo hacen editores actuales, eclipse, netbeans, vs.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-02-2014, 10:24 PM (This post was last modified: 01-02-2014 10:27 PM by eried.)
Post: #8
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Genial! tengo que revisar como scintilla recibe los datos (podríamos usar el wiki de tiplanet, así se mantiene centralizado). Así ademas hacemos una versión que sirva para hacer otros editores Big Grin

Estaba también avanzando en el capturador (para proyector o hacer "tutoriales"):
[Image: Image%202014-01-02%20at%207.25.33%20PM.png]

Pero aún es primitivo. La primera versión del editor será mas que nada para reemplazar notepad (con highlight de sintaxis), así para lo que tu querías de "nuevo -> enviar"

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-02-2014, 11:28 PM
Post: #9
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Hello Erwin!
Very good idea to build a "screen grabber". From what I see you can capture video ... Is this correct?

If you can capture video will be a very good tool for building tutorials.

Good luck with the project!

A hug from Argentina.
Find all posts by this user
Quote this message in a reply
01-03-2014, 12:18 AM
Post: #10
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
(01-02-2014 11:28 PM)ArielPalazzesi Wrote:  Hello Erwin!
Very good idea to build a "screen grabber". From what I see you can capture video ... Is this correct?

If you can capture video will be a very good tool for building tutorials.

Good luck with the project!

A hug from Argentina.

Well, that's the idea but I don't want to make it too dependant on video codecs or complex weak stuff so, so in first instance I will save a stream of frames (or maybe an uncompressed/massive avi) Big Grin

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-04-2014, 05:07 PM (This post was last modified: 01-07-2014 05:06 PM by eried.)
Post: #11
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Here is how the custom configuration for the program editor works:
http://scintillanet.codeplex.com/wikipag...stomConfig

Snippets, autocompletion, highlighting, codeblocks, printing is all allowed thanks to scintilla Smile:
[Image: Image%202014-01-04%20at%202.03.00%20PM.png]





Here are some hints about the configuration file (in case someone wants to help to define HPPPL configuration Tongue ):
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ScintillaNET>
    <Language Name="hpppl">
        <Indentation TabWidth="2" UseTabs="true"/>
        <Lexer LineCommentPrefix="//">
            <Keywords List="0">var</Keywords>
            <Keywords List="1">string</Keywords>
        </Lexer>
        <Styles>
            <Style Name="CHARACTER" ForeColor="Black" BackColor="Red"/>
        </Styles>
    </Language>
</ScintillaNET>

Snippets:
Code:
<Snippets>
<Snippet Shortcut="while" IsSurroundsWith="true">WHILE $expression$ DO
    $end$$selected$
END;
$DropMarker$</Snippet>
</Snippets>

Autocomplete (example for CS):
Code:
        <AutoComplete FillUpCharacters=".([" SingleLineAccept="True" IsCaseSensitive="False">
            <List>
                abstract as base break case catch checked continue default delegate do else event explicit extern
                false finally fixed for foreach goto if implicit in interface internal is lock namespace new null
                object operator out override params private protected public readonly ref return sealed sizeof
                stackalloc switch this throw true try typeof unchecked unsafe using virtual while bool byte char
                class const decimal double enum float int long sbyte short static string struct uint ulong ushort void
            </List>
        </AutoComplete>

Incomplete alpha version: http://servicios.ried.cl/primecomm/PrimeComm_alpha.zip (editor works, prints, sends, but does not save/open, etc)

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-07-2014, 04:48 PM (This post was last modified: 01-07-2014 04:51 PM by eried.)
Post: #12
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Big Grin es más un IDE/Editor/deployer que un SDK (aunque la terminología pueda dar cabida). Escribiré lo que falta en inglés por si alguien más tiene sugerencias (dado de que entiendes inglés).

________________________________

Next steps are:

1) Code snippets (scintilla configuration) and keyword autocomplete (maybe local variables too with a simple precompiler)

2) More power tools for the editor, insert image directly (instead of opening it and reusing the code), key override replacements, dumb lexer/precompiler to detect errors early, etc.

3) Symbols toolbox (STO, pi, square root and others). Not sure how is the best efficient way to include them, table matrix docked in the editor window, menu, upper toolbar with few common used symbols and other ones in a popup dialog like in Word->insert symbol.

4) Finish screen capture (my calculator is still in the battery testing procedures! for standby lasting time so this is halted for now)

5) How to include the apps scripts? Autodetect them because the code uses view and stuff? Any suggestion?

6) Real communication with the emulator

7) Adding mono compatible functions (read/write to device) to HidLibrary so the app can works in Linux/MacOs

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-07-2014, 08:57 PM (This post was last modified: 01-08-2014 02:27 PM by compsystems.)
Post: #13
ASCII 7 bits
Hola Erwin, el siguiente es el código de prueba para lo de conversión ASCII 7 bits, hay dos caracteres que no se visualizan bien ( ^-1, i ) ver id1:=X^-1, id5:=i #i

Code:
EXPORT test()
BEGIN
LOCAL id0, id1, id2, id3, id4, id5, id6;X;
LOCAL id7, id8, id9, id10, id11, id12, id13;
LOCAL id14, id15, id16;
id0:=X²;
id1:=X;
9▶id2;
id3:=5E-13;
id4:=exp(5);
id5:=;
id6:=5≠9;
id7:=4≤5;
id8:=9≥8;
id9:=√(4);
id10:=∫(X,X,1,2);
id11:=∂(X,X);
id12:=5∡53;
id13:=π;
id14:=∑(X,X,1,2);
id15:=limit(X,X,X,∞);
id16:=limit(X,X,X,±∞);
END;

El código anterior codificado en ASCII 7 bits, util para realizar conversiones a otros BASICs

Code:
//ASCII 7 bits
EXPORT test()

BEGIN

LOCAL id0, id1, id2, id3, id4, id5, id6;X;
LOCAL id7, id8, id9, id10, id11, id12, id13;
LOCAL id14, id15, id16;


id0:=X\^2\;

id1:=X\^-1\;

9\store\id2;

id3:=5\ee\-13;

id4:=\e\(5);

id5:=\i\;

id6:=5\!=\9;

id7:=4\<=\5;

id8:=9\>=\8;

id9:=\root\(4);

id10:=\integral\(X,X,1,2);

id11:=\diff\(X,X);

id12:=5\/_\53;

id13:=\pi\;

id14:=\Sigma\(X,X,1,2);

id15:=limit(X,X,X,\infinity\);

id16:=limit(X,X,X,\+-\\infinity\);

END;

Guia de caracteres de conversión del código anterior

Code:
\^2\ // superindice2, ver ID0
\^-1\ // superindice-1, ver ID1
\store\ // almacenar, ver ID2
\ee\   // EE , ver ID3
\e\    // #e, ver ID4
\i\    // #i, ver ID5
\!=\    // diferente, ver ID6
\<=\    // menor o igual, ver ID7
\>=\    // mayor o igual, ver ID8
\root\  // raiz, ver ID9
\integral\ // ver ID10
\diff\ // ver ID11 
\/_\ // Angulo ver id12
\pi\ // #pi ver id13
\Sigma\  // sumatoria ver id14
\->\ 
\infinity\ // ver id15
\+-\ // ver id16
Find all posts by this user
Quote this message in a reply
01-08-2014, 12:12 AM
Post: #14
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
No entiendo pero quieres que haga una conversión para TI? Qué utilidad tiene si el lenguaje es distinto? Puedo guardar en 7 bits (ASCII) pero hacer la tabla de conversión suena un poco ya fuera de la utilidad de primecomm

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2014, 02:18 PM (This post was last modified: 01-09-2014 02:16 PM by compsystems.)
Post: #15
ASCII 7 bits
Hola, la conversion a 7 bits, seria útil no solo para portar código hacia calculadoras con BASIC como la serie TI68K, sino ademas a otros BASIC similares e incluso para la HP50G (ALG MODE). La tabla de conversión es simplemente una guía del código que coloque anteriormente

El lenguaje mas parecido a la HP-Prime BASIC es con el TI-BASIC mas info en el siguiente link

http://www.adictoshp.org/topic/591-hp-pr...k-hpprime/

Código muy simple en la HP-Prime

Code:
export HPBasic_IO_prgm00()
// Comentario del programa
begin // inicio del bloque del contenido del programa
  print(); // Limpia la pantalla terminal
  local id0; // definicion del identificador como variable local
  input(id0); // Pide un dato para ser almacenado en el identificador id0
  print("id0 = "+id0); // Imprime en la pantalla en valor del identificador
end; // fin del bloque del contenido del programa



Código portado a las TI68K

Code:
:IO_prgm0() ©  maximo 8 caracteres 
:© Comentario del programa
:Prgm © inicio del bloque del contenido del programa
:   ClrIO © Limpia la pantalla terminal
:   Prompt id0 © Pide un dato para ser almacenado en el identificador id0
:   Disp "id0 = "&id0 © Imprime en la pantalla en valor del identificador
:EndPrgm © fin del bloque del contenido del programa

Diferencias sutiles entre los BASICs
* Los comentarios inician con el simbolo ©
* El encabezado de la funcion es Prgm EndPrgm
* Cada sentencia inicia con :
* Algunos comandos tienen nombres diferentes
* Algunos comandos no requieren parentesis
Find all posts by this user
Quote this message in a reply
01-08-2014, 03:45 PM (This post was last modified: 01-08-2014 03:47 PM by eried.)
Post: #16
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
OK, pero la verdad no sé que relación tiene. Podría meter la simbología de las CASIO y SHARP también, pero ¿no te parecería pérdida de tiempo? Me refiero a que sentido tiene poder guardar un código de Prime para la TI.

Si pones algún ejemplo válido quizás tenga más sentido, pero siendo un código incompatible no veo la diferencia con copiar el código y pegarlo en el editor de TI.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2014, 07:24 PM
Post: #17
PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
The TI-68k series doesn't use 7-bit ASCII, it uses its own charset; what's more, programs are usually stored under tokenized form.
Find all posts by this user
Quote this message in a reply
01-08-2014, 09:18 PM
Post: #18
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
I am not quite sure how the things works in TI world (but as far I tested: everything is usually limited or obfuscated on purpose; starting with the nasty signature checks for the firmware), but what compsystems is suggesting that I should add a conversion for TI Basic from the program editor... and I am not quite sure how useful is doing something like that.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-09-2014, 02:05 PM (This post was last modified: 01-17-2014 05:53 PM by compsystems.)
Post: #19
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Realizar un "traductor" de código seria lo ideal, pero requiere de una gran labor por parte del programador, la idea es automatizar un poco la traducción, por que los símbolos como por ejemplo integral, derivada, sumatoria en el ti-basic o HP-basic *(HP50) son simplemente un reemplazo de set del ASCII extentido, es decir modifican la fuente cambiando de símbolo . Si yo copio un codigo de la HP-Prime por estar codificado en UNICODE al copiarlo y pegarlo en el un editor de programas para la TI68K, observare un código ilegible, mientras que si se convierte a ASCII de 7 bits haría visible esos simbolos, aunque sea como \integral\ \diff\ facilitando enormemente el port

Un juego elemental escrito en HPbasic y TIBasic

HPbasic
Code:
EXPORT Deducir_Numero()
// Juego Matemático super elemental versión 0.0.6"
begin
   local num_ingresado := 0;
   local total_intentos := 8;
   local intentos := total_intentos;
   local num_secreto := IP( random ( 1, 100 ) ); //  ( rand() mod 100 ) + 1;  // OLD FIRMWARE
   print();
   print( "*** Ejecución Iniciada. ***" );
   freeze; wait;
   print( "Juego Matemático versión 0.0.6" );
   wait;
  print( "El programa genera un numero natural entre 1 y 100. Trate de deducirlo en 8 intentos maximo, o en los que usted configure..." );
   wait;
   print( "Ingrese el # de intentos personalizados" );
   freeze; wait( 2 );
   if input( total_intentos,"Total de Intentos","Intentos=","Digite un # como total de intentos maximo" )  
then if total_intentos <= 0 then kill; end; 
   else 
     kill;
   end;
   intentos := total_intentos;
   //print( "Debug: "+num_secreto );

   if NOT( input( num_ingresado,"Deducir_Numero","Num Ingresado=","Cual es el numero?" ) ) then kill; end;
   print( ">"+num_ingresado );

   while( num_secreto <> num_ingresado and intentos > 1 ) do
      if num_secreto > num_ingresado then
         print( "El numero es mayor" );
      else
         print( "El numero es menor" );
      end;
      intentos := intentos - 1;
      print( "Le quedan "+intentos+" intento(s):" );
      freeze;  wait;
      if NOT( input( num_ingresado,"Deducir_Numero","Num Ingresado=","Digite un #" ) ) then kill; end;
      print( ">"+num_ingresado );
   end;

   if num_secreto <> num_ingresado then
      print( "Perdio! El numero era: "+num_secreto );
   else
      print( "Gano! Usted lo dedujo en: "+ ( ( total_intentos + 1 ) - intentos ) +" intento(s.)" );
   end;
   print( "*** Ejecución Finalizada. ***" );

   freeze;
   return "Done";

end;

TI-Basic

redactando ...
Find all posts by this user
Quote this message in a reply
01-12-2014, 10:21 AM (This post was last modified: 01-12-2014 10:31 AM by ArielPalazzesi.)
Post: #20
RE: PrimeComm: Alternative Windows (Library/Console/GUI) utility to send/convert things
Hello!

If I'm not mistaken, the en

Code:
num_secreto local: = (rand () mod 100) + 1;

generates numbers between 1.0 and 2.0 (real numbers with decimals).

[Image: attachment.php?aid=160]

If the game requires numbers between 1 and 100, I think the simplest way is to

Code:
num_secreto local: IP = (random (1,100));

returns (natural) numbers between 1 and 100.

In the line

Code:
if input( total_intentos,"Total de Intentos","Intentos=","Digite un # como total de intentos maximo" )  
then if total_intentos <= 0 then kill end;

should be

Code:
if input( total_intentos,"Total de Intentos","Intentos=","Digite un # como total de intentos maximo" )  
then if total_intentos <= 0 then kill; end;

Am I right?

Greetings!

PS: Sorry about Off Toppic


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 6 Guest(s)