Files on HP Prime Question
05-14-2015, 01:48 AM (This post was last modified: 05-14-2015 02:06 AM by mandresve.)
Post: #1
 mandresve Member Posts: 91 Joined: Mar 2015
Files on HP Prime Question
Hello. I am delighted with the new firmware, it has a significant progress that really satisfies me as user of this calculator. I recently seen the inclusion of commands designed to operate files directly within app (now every app has a folder for variables and files). I was thinking about the future development of what is now "mViewer GX Creator" of TiPlanet website. It will soon be possible to download images and / or documents in the HP Prime taking the advantages of the new firmware features?

Just a thought ... Thanks!

Manuel Andrés Velez

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-14-2015, 05:45 PM
Post: #2
 Tim Wessman Senior Member Posts: 2,175 Joined: Dec 2013
RE: Files on HP Prime Question
It will definitely be possible. In fact, being able to make that work better was definitely in our minds when we implemented support for direct png and the new application structure.

What is needed on their end:

a. Export a folder containing an application rather then a program. You can also give it an icon. Quad Explorer or similar is a good one to base on for the moment as it will be really small.
b. inside the folder, have smaller png files broken up in a grid of content. Not sure what the ideal size will be. Might even be a single screen size... dunno.
c. For loading in the viewer, doing something like G1:="doc_1_1.png" to copy in the PNG data.
d. Don't use the ICON keyword. :-)
e: Use AVars to allow you to store a local application variable containing information like view position or similar to make sure it will stay around for a while.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
05-15-2015, 01:08 AM
Post: #3
 mandresve Member Posts: 91 Joined: Mar 2015
RE: Files on HP Prime Question
(05-14-2015 05:45 PM)Tim Wessman Wrote:  It will definitely be possible. In fact, being able to make that work better was definitely in our minds when we implemented support for direct png and the new application structure.

What is needed on their end:

a. Export a folder containing an application rather then a program. You can also give it an icon. Quad Explorer or similar is a good one to base on for the moment as it will be really small.
b. inside the folder, have smaller png files broken up in a grid of content. Not sure what the ideal size will be. Might even be a single screen size... dunno.
c. For loading in the viewer, doing something like G1:="doc_1_1.png" to copy in the PNG data.
d. Don't use the ICON keyword. :-)
e: Use AVars to allow you to store a local application variable containing information like view position or similar to make sure it will stay around for a while.

Tim, beyond AWESOME!! I'll make a little demo right now and when it reaches a good level, I'll put it here so that many people can use it and help to the development.

Many many thanks.

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-15-2015, 02:41 AM
Post: #4
 Tim Wessman Senior Member Posts: 2,175 Joined: Dec 2013
RE: Files on HP Prime Question
Oops, that should be G1:=AFiles("doc_1_1.png") instead.

With the AFiles command, you basically have access for two types of objects at the moment - THPObj (which is what we call any HP object - list, real number, string, etc that you can generate in the calculator) and PNG files.

Any time you save anything using the AFiles command, it will be a THPObj. If you are saving one of the GROB objects, or loading into them however a conversion to a PNG format will save the file to the disk or load from PNG.

Thus doing AFiles("screen"):=G0 will save your current screen as a png named "screen" in your current app directory.

You can of course use other objects but we have no way to give you nice, direct access to them. You can use the AFilesB to save/load direct binary content in a byte by byte fashion but this will be rather tricky.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
05-15-2015, 04:30 AM
Post: #5
 mandresve Member Posts: 91 Joined: Mar 2015
RE: Files on HP Prime Question
(05-15-2015 02:41 AM)Tim Wessman Wrote:  ...
You can use the AFilesB to save/load direct binary content in a byte by byte fashion but this will be rather tricky.

Yes, it can trigger many problems. There would be some way so far to operate the zoom or displacement of a PNG image? That would be the next step to build good software with the functionality to read images of this type.

Tim, thank you very much for the support and attention given to this thread.

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-15-2015, 07:57 PM
Post: #6
 debrouxl Member Posts: 249 Joined: Dec 2013
RE: Files on HP Prime Question
We TI-Planet admins have noticed this thread, and will certainly want to leverage the new features
05-16-2015, 12:56 AM
Post: #7
 mandresve Member Posts: 91 Joined: Mar 2015
RE: Files on HP Prime Question
(05-15-2015 07:57 PM)debrouxl Wrote:  We TI-Planet admins have noticed this thread, and will certainly want to leverage the new features

Yes, but if TiPlanet people read this post, I want to express that I really feel so uncomfortable having to upload my files to the web to convert documents for the HP Prime. It should be a PC software, or something, I don't like to depend on the Internet for such things. Anyway they always strive to do a good job and always succeed.

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-16-2015, 07:18 AM (This post was last modified: 05-16-2015 01:15 PM by debrouxl.)
Post: #8
 debrouxl Member Posts: 249 Joined: Dec 2013
RE: Files on HP Prime Question
I hear you, and I agree with you. But while computer- (client-) side software is good for advanced users like you and me, it is unusable for many of the users targeted by such an online tool, believe me

Times have changed, and not in the good direction. Nowadays, installing and using fat client software, let alone read basic documentation, is way too hard for many teenagers. We do have the resources to provide support for an online tool which works well nowadays (otherwise we'd hear many more complaints, given how widely used it is), but we don't have the resources to provide adequate support to match what essentially amounts to PEBKAC in installing and using the software in execution environments we don't control

Other projects made by people who are also TI-Planet admins, not necessarily under the TI-Planet umbrella, for the community of users and programmers, include fat client software.
Speaking for myself: I'm working mostly on libti*/gfm/tilp, outside of the TI-Planet umbrella. Those are the components of the only maintained fat client portable third-party Connectivity Kit, in HP parlance ("linking software", in TI parlance), for the three series of TI graphing calculators, dating back to 1999. libti* is the inspiration for libhpcalcs, the only reasonably working and only portable third-party library for communicating with Prime calculators (but it's not very usable because it has no GUI).

EDIT: of course, leveraging the new document format capabilities for mViewer GX Creator requires that they be fully scriptable from a pure Linux environment.
05-16-2015, 11:39 PM (This post was last modified: 05-17-2015 02:08 PM by mandresve.)
Post: #9
 mandresve Member Posts: 91 Joined: Mar 2015
RE: Files on HP Prime Question
(05-16-2015 07:18 AM)debrouxl Wrote:  side software is good for advanced users like you and me, it is unusable for many of the users targeted by such an online tool, believe me

As an Engineer, I believe to you haha. For now, I'm just sitting here waiting for the next GX Creator.

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-18-2015, 05:53 AM
Post: #10
 cyrille de brébisson Senior Member Posts: 891 Joined: Dec 2013
RE: Files on HP Prime Question
Hello,

Prime does not offer a 'picture viewer', or build in facilities to 'view' pictures.

You can always load a png into the current screen and freeze the screen to see your picture (or at least the first 320*240 pixels).
An example:
In home, create a bunch of equations on the stack, to fill up your screen.
Then type:
AFiles("a.png"):= G0; ENTER
Then clear your stack (to have a visually different screen and make sure that things work).
Then type:
G0:=AFiles("a.png"); freeze; ENTER
See how your screen shot was placed on the screen?

Cyrille
05-18-2015, 05:56 AM
Post: #11
 mandresve Member Posts: 91 Joined: Mar 2015
RE: Files on HP Prime Question
(05-18-2015 05:53 AM)cyrille de brébisson Wrote:  Hello,

Prime does not offer a 'picture viewer', or build in facilities to 'view' pictures.

You can always load a png into the current screen and freeze the screen to see your picture (or at least the first 320*240 pixels).
An example:
In home, create a bunch of equations on the stack, to fill up your screen.
Then type:
AFiles("a.png"):= G0; ENTER
Then clear your stack (to have a visually different screen and make sure that things work).
Then type:
G0:=AFiles("a.png"); freeze; ENTER
See how your screen shot was placed on the screen?

Cyrille

Yes, thanks for the help. I could do the experiment properly. I will continue playing with the calculator.

Success is the ability to go from one failure to the next without any loss of enthusiasm.
05-20-2015, 10:10 PM (This post was last modified: 05-20-2015 10:18 PM by critor.)
Post: #12
 critor Junior Member Posts: 27 Joined: Jul 2014
RE: Files on HP Prime Question
Yeah, a nice PNG images viewing app seems quite easy now.

But a document viewing app still remains much more difficult:

* We could convert a PDF into a collection of several PNG images, with one image per page.
But a huge problem is that the latest Connectivity Kit version doesn't let you drag and drop files into applications 'Files' folders.
You need to right-click the app 'Files' folder, and add your PNG images, one by one.
So if your PDF is for example 50 pages long, you can just forget this for now.

* Another idea would be to concatenate several PNG images into a single file, thus forming the document.
But together with it comes another problem :
- to be able to get a part of a file data, we have to use AFilesB() and not AFiles()
- to be able to display the PNG data, we have to use AFiles() and not AFilesB()
Indeed, G1:=AFilesB(filename,offset,size) doesn't seem to work, even when offset is 0.

Any idea of a workaround ? Any other ideas ?

Thanks.
05-21-2015, 05:56 AM
Post: #13
 Thomas_Sch Senior Member Posts: 306 Joined: Dec 2013
RE: Files on HP Prime Question
(05-20-2015 10:10 PM)critor Wrote:  ..
Any idea of a workaround ? Any other ideas ?
Thanks.
The prime is a calculator.

just my 2 ct.
05-21-2015, 06:02 AM
Post: #14
 debrouxl Member Posts: 249 Joined: Dec 2013
RE: Files on HP Prime Question
FYI, critor is the main developer of mViewer GX Creator, and one of the other TI-Planet admins.

I know you can do more helpful replies
05-21-2015, 06:41 AM
Post: #15
 Thomas_Sch Senior Member Posts: 306 Joined: Dec 2013
RE: Files on HP Prime Question
(05-21-2015 06:02 AM)debrouxl Wrote:  FYI, critor is the main developer of mViewer GX Creator, and one of the other TI-Planet admins.

I know you can do more helpful replies
I do not disagree, but on the other hand I do not understand what is supposed to be so important in a PDF reader for the prime.
05-21-2015, 03:07 PM
Post: #16
 Tim Wessman Senior Member Posts: 2,175 Joined: Dec 2013
RE: Files on HP Prime Question
(05-20-2015 10:10 PM)critor Wrote:  You need to right-click the app 'Files' folder, and add your PNG images, one by one.

Drag the application to the content pane in the bottom left corner. Drag whatever files you want to the directory. Send it. :-)

Any file in the application directory will be sent along. No recursion to lower directories. The "add file" just copies your selected file to the folder - nothing more.

Quote:* Another idea would be to concatenate several PNG images into a single file, thus forming the document.

A PNG is zip file essentially. http://en.wikipedia.org/wiki/Portable_Ne...ompression
Quote:PNG uses a non-patented lossless data compression method known as DEFLATE, which is the same algorithm used in the zlib compression library.

This means that

Quote:Indeed, G1:=AFilesB(filename,offset,size) doesn't seem to work, even when offset is 0.

would be like getting a hex editor to pull out a small block from the middle of a .zip file and trying to use it directly. It just isn't possible as you don't have a fully formed zip archive will all the information needed to decompress it.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
05-21-2015, 03:43 PM (This post was last modified: 05-21-2015 03:44 PM by critor.)
Post: #17
 critor Junior Member Posts: 27 Joined: Jul 2014
RE: Files on HP Prime Question
(05-21-2015 03:07 PM)Tim Wessman Wrote:
Quote:* Another idea would be to concatenate several PNG images into a single file, thus forming the document.

A PNG is zip file essentially. http://en.wikipedia.org/wiki/Portable_Ne...ompression
Quote:PNG uses a non-patented lossless data compression method known as DEFLATE, which is the same algorithm used in the zlib compression library.

This means that

Quote:Indeed, G1:=AFilesB(filename,offset,size) doesn't seem to work, even when offset is 0.

would be like getting a hex editor to pull out a small block from the middle of a .zip file and trying to use it directly. It just isn't possible as you don't have a fully formed zip archive will all the information needed to decompress it.

But I'm sorry, it seems you did misunderstand me.

A document may be made of hundreds of pages, which implies hundreds of images, and much more if you have several documents.

For users which want to have many documents in their HP-Prime, one way to make their life easier would be to concatenate all PNG pages from a single document into a single file.

Let me explain this the Linux-way :
Code:
cat page1.png page2.png page3.png > doc1.png

Then, "G1:=AFilesB("doc1.png",offset2,size2)" doesn't work.
And of course, offset2 and size2 are correct, delimiting a complete PNG (or ZIP if you prefer) image.

By the way, even "G1:=AFilesB(...)" doesn't work with a normal PNG.
So we're apparently forced to use "G1:=AFiles(...)", except that it doesn't accept offset and size parameters.
Post: #18
 Adriweb Junior Member Posts: 24 Joined: Jun 2014
RE: Files on HP Prime Question
(05-21-2015 06:41 AM)Thomas_Sch Wrote:
(05-21-2015 06:02 AM)debrouxl Wrote:  FYI, critor is the main developer of mViewer GX Creator, and one of the other TI-Planet admins.

I know you can do more helpful replies
I do not disagree, but on the other hand I do not understand what is supposed to be so important in a PDF reader for the prime.

Well, that's the "funny" thing, approximately a thousand PDF/images get converted daily on TI-Planet (for TI-Nspires mainly, but the HP Prime is the 2nd most popular platform of the generator -lots of people from south-america and spanish-speaking countries, idk why-). So, clearly, many people find all that very important

In France, for example, since it's allowed to have anything on your calculator for the exams (and teachers encourage having programs and anything possible), well people put their exercices, courses etc.
Though, all this is going to stop starting 2018, in France, as the government suddenly realized people could put quite a few things on their calcs... so they decided to make the students take the exams with the calcs in a "Test mode" (wiping the memory, temporarily if possible, flashing a LED, etc... Tim and the other devs know what I'm talking about since they updated the Prime's test mode in the latest build to be aligned with the regulation)

05-21-2015, 04:38 PM
Post: #19
 Tim Wessman Senior Member Posts: 2,175 Joined: Dec 2013
RE: Files on HP Prime Question
(05-21-2015 03:43 PM)critor Wrote:  For users which want to have many documents in their HP-Prime, one way to make their life easier would be to concatenate all PNG pages from a single document into a single file.

Why would that be any easier then simply having your viewer flip from page to page using separate files? Just put the files in a directory and send. There is no "difficult process to add files" like you seem to be implying. You can open your document\HP Connectivity Kit\Content\<your_app>\ and add the files like any other folder. Or do the same thing by dragging them into the folder in the connkit file browser. Or load them in a folder in a zip. Or directly add it to the folder in the HP Connectivity Kit\Calcs\<your calc name> directory.

You are correct that you can't yet drag to an individual application directly in the calculator tree, but there are at least 4 other ways to do it directly right now.

Quote:Then, "G1:=AFilesB("doc1.png",offset2,size2)" doesn't work.

Well, since you are returning a list of numbers representing bytes... it wouldn't.

Quote:By the way, even "G1:=AFilesB(...)" doesn't work with a normal PNG.

AFilesB(...) returns the size of the file as a number.

It seems like you are asking to be able to do the equivalent of take 100 video files, combine them into one single large file, and then be able to later use that single file as if they were separate. I've never seen a single program that does that as it doesn't really make sense. The closest thing I've seen is some of the comic book readers which just are a compression archive with named files in sequence...

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
05-21-2015, 04:56 PM (This post was last modified: 05-21-2015 04:57 PM by critor.)
Post: #20
 critor Junior Member Posts: 27 Joined: Jul 2014
RE: Files on HP Prime Question