Pages: [1] 2 Next   Go Down
  Print  
Author Topic: File/script editor  (Read 1714 times)
0 Members and 1 Guest are viewing this topic.
wontolla
Sr. Member
****

Karma: +34/-7
Offline Offline

Posts: 324


S3 & A720


« on: 14 / March / 2008, 13:10:58 »

Hi everybody.

There has been a discussion lately in this poll POLL: Which missing features would you like to see?
and people have some interesting ideas in how CHDK can have a "file editor" feature.

It looks like the main purpose of a file editor is to make small changes in script files so you can tweak/correct them without a computer.

Some uses could be:
When you are on the field and find out that, given the situation, one of your scripts could be more useful if you make some changes.
Or may be if you are tired of connecting/disconnecting the SD card to your computer and turning on/off the camera several times while writing/testing a script.

Implementation ideas:
The Script Editor would need some kind of keyboard in the screen so the user can select the letter, number or symbol needed and place it in the desired portion of text. As you can see, this process can "take a while" so it's been suggested to have a second menu where the user can choose from a list of frequently-used uBASIC commands. May be this list can be stored as a file in the memory card and CHDK can come with a "standard" collection of these macros but the user can also modify it according to particular needs.

Well, let's not make the story long. The thing is I've been messing with the current File Reader and I thing with a little work it can be modified to allow writing capabilities. For the moment I'm drawing the keyboard in the lower part of the screen (sorry, no viewable results yet).

But the real fun will begin when modifying the actual script file so I would really appreciate if you have experience/suggestions. I will search the net for some code on this. (No sense reinventing the wheel). I'm also far from being a keen script writer so I will need you scripting guys to help me so this feature can be something useful.

Cheers!







Logged
mkmenuts
Jr. Member
**

Karma: +4/-0
Offline Offline

Posts: 60

SD700 (1.01b)


« Reply #1 on: 14 / March / 2008, 13:56:52 »

You might find this interesting:

http://www.forteach.net/video/video/NvVwphbyvOw
Logged
wontolla
Sr. Member
****

Karma: +34/-7
Offline Offline

Posts: 324


S3 & A720


« Reply #2 on: 14 / March / 2008, 15:45:17 »

Thanks mkmenuts, that's a good idea. You just save me a weekend worth of work.

I was working on a typical QWERTY keyboard but that ipod thing looks more efficient.

I thing that's the way to go. The file editor can even have those guide colours!
Logged
Barney Fife
Hero Member
*****

Karma: +70/-219
Offline Offline

Posts: 1159



« Reply #3 on: 14 / March / 2008, 23:41:22 »

Deleted
« Last Edit: 22 / April / 2008, 19:21:31 by Barney Fife » Logged

[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye
marcelo.espinosa
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 5



« Reply #4 on: 15 / March / 2008, 04:04:06 »

How about predictive text... like in cell phones?

a quick search in google showed some pieces of code in java,  and some in C

here you have a program licensed under GPL that implement predictive text, so you have a good starting point (and the source code)
http://linux.wareseeker.com/Desktop-Environment/dasher-4.5.2.zip/315306

the dictionary won't be so huge (basic + common words used by geeks who write scripts   Blink

dictionary of words:
just take a lots of scripts from CHDK, mix them in one file, do some cleaning, sort the words, and "uniq" them, finally filter everything that's useless (this last part is made by hand  Sad )

an example for a quick filtering with the help of unix/linux command:

$ sed -e 's/\s/\n/g; s/[\.,"?@]//g' file_mixed.bas | sort| uniq > result.txt

the first search pattern will look for spaces and tabs and replace them for a new line, the second one wipes any occurrence of the following characters .,"?@
(this list can be enhanced)

this procedure will end with a list of words like this one:

Code:
another
camera
click
current
else
end
endif
get_prop
goto
if
is_key
it
k
k=1
lend
loop
m
m<>15
mode
operation
pictures
print
recording
rem
remote
shoot
shoot_full
start
stop
taking
the
then
to
v
v=1
wait_click

now some hand cleaning and we are ready to go...

just an idea...

Goog luck!

Logged

Ixus700-SD500 owner.
GrAnd
Developers
Hero Member
****

Karma: +74/-2
Offline Offline

Posts: 917


[A610, S3IS]


« Reply #5 on: 15 / March / 2008, 10:17:22 »

(On my dial-up, I can't see that video you referenced, but I'll assume it's the next best thing since sliced-bread. Smiley )

Just google for MobileQWERTY. (But almost all info is in videos)
Logged

CHDK Developer.
wontolla
Sr. Member
****

Karma: +34/-7
Offline Offline

Posts: 324


S3 & A720


« Reply #6 on: 15 / March / 2008, 18:25:20 »

I would just be happy when, in the text editor, if you put the cursor on a letter or number and press [SET] that it would just let you scroll through all ASCII code...
That should be the simplest solution. But if we follow that road, eventually someone will ask for the MobileQWERTY. Double work.

Quote
It's not too different than the keypad on my old Casio Data-Bank wristwatch. 16 keys...
Yep, I also had a Casio Data-Bank. As you say, it has 16 keys. And even a cellphone has at least 12. Both of them have 3 letters on each key.
But in the camera we only have 4-5. The MobileQWERTY is some sort of simulation of a 12 key keyboard.

Quote
But what are you going to do about upper-case?
This MobileQWERTY thing has 4 different "keyboards": uppercase, lowercase, numbers and symbols. I'll stick to this model for now and in the end we can tweak it to fit scripting needs.

Quote
As you press one of the colored keys it would automatically enter common BASIC programming commands like "GOTO", "IF" etc...Couldn't the available ones for a list (or table) be pulled right out of the code for each build.
Sure, I am planning a BASIC command list, but it could take screen real-state. A Predictive Text solution would solve this problem.

How about predictive text... like in cell phones?
Thanks marcelo for the suggestion, link and detailed explanation. I think the Predictive Text solution would be a good way to save a lot of clicks. First, I'll concentrate in the MobileQWERTY. Then, if we see the Predictive Text feasible I'll try to implement it. I'll dare to ask for your help on that dictionary! It looks like you are half-way on getting it.
Logged
wontolla
Sr. Member
****

Karma: +34/-7
Offline Offline

Posts: 324


S3 & A720


« Reply #7 on: 21 / May / 2008, 16:14:58 »

Just an update in the file editor coz people's been asking for news.

Interface is almost done. I modified the File Reader making space for the keyboard and joystick colour guide.



Next step is to implement the actual writing of the file. Any comments/suggestions welcome!

Here is for all cameras (build 403) in case you want to play with it. (Remember it doesn't actually modify the file yet).
     Index of /CHDK/FileEditor

You can also download the video to see how the MobileQWERTY works. (.flv file plays with VLC or FLV Player)
     http://www.wontolla.web44.net/CHDK/FileEditor/MQwerty.flv

For developers:
Here is the modified gui_read.c file in case you are curious. Warning: It's nothing than boring drawing pixels.
     http://www.wontolla.web44.net/CHDK/FileEditor/gui_read.c
« Last Edit: 21 / May / 2008, 16:21:32 by wontolla » Logged
fe50
Hero Member
*****

Karma: +50/-1
Offline Offline

Posts: 598


IXUS 50, IXUS 860is


« Reply #8 on: 21 / May / 2008, 17:16:57 »

Look's great...could be an universal keyboard within CHDK...wow !

A feature for the future could also be something like a clipboard in chdk, so lines of an (selectable) diary file and/or chars from this "CHDK keyboard" can be collected & buffered there. Done so, at any other place (in a script, in file manager, in a menu/setting dialog...) with an insert feature the data can transfered there.
Logged

PhyrePhoX
Global Moderator
Hero Member
*****

Karma: +121/-27
Offline Offline

Posts: 1624


Coders Humiliate DSLR Kiddies


« Reply #9 on: 21 / May / 2008, 17:33:22 »

nice to see some progress Smiley
Logged

fbonomi
Sr. Member
****

Karma: +28/-1
Offline Offline

Posts: 294

A570 IS


« Reply #10 on: 27 / July / 2008, 16:48:12 »

Quote
Next step is to implement the actual writing of the file. Any comments/suggestions welcome!

Hi Wontolla, this project seems very interesting and really would like to see it completed. Can I help in any way? Do you need the file-write part done ?

I know i am bothering you, but I do it on purpose :-) so that you don't forget this good project of yours, it seems you did most of the work already!!
Logged
wontolla
Sr. Member
****

Karma: +34/-7
Offline Offline

Posts: 324


S3 & A720


« Reply #11 on: 27 / July / 2008, 18:50:06 »

No bothering of course!

My problem is I am lazy (look at my avatar) and I always need somebody to wake me up so I go back to work.

You are right, the editor is almost done, at least the basic implementation.

In fact, tomorrow I have a meeting with my advisor. Depending on his mood, if I can trick him into believe I've been doing good work, he will be happy and I can dedicate some time next week to CHDK.

Otherwise, I'll organize the code and comment it so you can finish.

Thanks for offering your help!
Logged
fbonomi
Sr. Member
****

Karma: +28/-1
Offline Offline

Posts: 294

A570 IS


« Reply #12 on: 28 / July / 2008, 05:08:19 »

wonderful, thanks!
Logged
lumin
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1

A620


« Reply #13 on: 04 / October / 2008, 17:31:07 »

I would love to see this finished.

Any word on progress?
Logged
frank
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 7



« Reply #14 on: 05 / October / 2008, 10:12:45 »

I can't download the gui_read.c file
Please make it work, wontolla!
Logged

Camera: A570IS      Firmware: 1.01a
Pages: [1] 2 Next   Go Up
  Print  
 
Jump to: