Shop OBEX P1 Docs P2 Docs Learn Events
Coming soon to a Prop near you - PrEditor — Parallax Forums

Coming soon to a Prop near you - PrEditor

CassLanCassLan Posts: 586
edited 2009-07-05 20:16 in Propeller 1
7/1/09
No its not finished yet, however there have been some changes in the approach:

I ran into some issues as far as filesize...I do want to be able to edit programs·with this and 3k~5k just isn't enough.
And now we have no less than TWO on-chip compilable languages (Femto & OMG Sphinx)
In addition, the more features added...the·smaller the editable file could be.
SO what could be done to make this work?
idea.gif After some talking with Chip, Potatohead and Steve Moracco (sp?) at UPEW, the approach has totally been altered:
Instead of reading a file into memory..making changes to said buffer via user editing, and then writing the file back to SD when the user saves, the new approach is more of a Journaling system.
A chunk of the file is read into memory..enough to display a full page(give or take a little more), and when the user makes edits..these edits are logged into a small changelog buffer(1kb).
When refreshing the display, first the small file buffer is consulted..then the changelog is consulted...then the information is displayed.

After a certain amount of time of inactivity or when the changelog buffer gets close to full (Thinking of having a progress bar for this) the changes will be applied to the file in question on the SD.
I'm confident this will be fast enough to be transparent to the end user..and this will also leave room for future growth of PrEditor.

This approach has many advantages to the former:
*Filesize limitations pretty much gone.
*Possibly a recover on power loss option (The changelog buffer would have to be recorded on SD for this to be feasible)

I've also decided to make a real flow-chart type plan before I jump in, this wont completely alleviate any changes to things written as I go, but I'm sure it will help to have all of the functional dependencies plotted out, and yeild a better end result.

I'd love to hear what folks think about this approach, I'm very motivated after mparks demonstration as this is a very real use for this right now.

Rick





Original Post
Hey all,
I've been working on a text editor, and although its not finished yet, I wanted to share some screen shots.
I'm really happy with how its coming out. jumpin.gif

Does it remind you of anything?

Rick

·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Prop Forum Search (Via Google)

Post Edited (CassLan) : 7/4/2009 11:25:46 PM GMT
640 x 480 - 98K
640 x 480 - 114K
640 x 480 - 125K
«134

Comments

  • jazzedjazzed Posts: 11,803
    edited 2009-04-23 20:59
    Looks like windoz "edit" [noparse]:)[/noparse] Very nicely done!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230
  • trodosstrodoss Posts: 577
    edited 2009-04-23 22:05
    Very nice! Definately an EDIT/QBASIC feel to the UI.
    If you pair it with FemtoBasicColor, you could almost have something like QBASIC [noparse];)[/noparse]·· [noparse][[/noparse]Edit:] Well, maybe GW-BASIC.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-04-23 22:53
    Common! Don't try to fool us with low-res pics of dos EDIT.COM [noparse]:)[/noparse]

    Won't believe it without code. <SMIRK>

    Double Wow. Nice Job!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • TubularTubular Posts: 4,706
    edited 2009-04-23 23:46
    Great work, Rick.

    Nice authentic screen captures too, how did you do those?

    tubular
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-24 00:00
    What display does it use? It looks like a TV. Does this work on a VGA monitor as well? Which drivers does it use?

    I'm really looking forward to this.
  • KPRKPR Posts: 189
    edited 2009-04-24 00:27
    yes very nice... can't wait to see source..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New ICON coming, gotta wait for the INK to heal, now we have colour!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-04-24 02:48
    Except for the color, it could be something I used on my Apple computer circa 1985. Oooorrrr.... it's one of Microsoft's latest developments. tongue.gif

    Good job!


    smile.gif
  • CassLanCassLan Posts: 586
    edited 2009-04-24 14:22
    Thanks all, I really appreciate the feedback.

    Its definately an attempt at an EDIT.COM/QBASIC clone.

    @Tubular- The screen captures are taken from a DVR for security cameras (thats what I do: http://www.cassidydevelopment.net), specifically this card:http://www.dwgsecurity.com/securitycameras/pc/viewPrd.asp?idcategory=2156&idproduct=29139, it accepts any composite video source. I can get them cheap if you want one.

    @Mike- It is running on a TV, it uses a modified TV_Text driver for display. During design its been my goal to make it easily portable to VGA. The scroll bars help but you still end up with a 38x9 area for viewable editing, VGA would solve that but IMO take away some of the portability.

    I'm really having fun with this and will post the source when its done.

    Rick
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-04-24 15:06
    Can you post your modified TV_text Driver? I was wondering how you were able to fit in the text editor code if you were using the memory comsuming Parallax Graphics driver. The TV_text program being able to draw boxes and lines in a windows-like fashion would be great for a project that I am working on right now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontrolled.
  • BaggersBaggers Posts: 3,019
    edited 2009-04-24 15:09
    @Rick, wow, looks great [noparse]:)[/noparse] are you adding all the copy paste functions of edit too?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • CassLanCassLan Posts: 586
    edited 2009-04-24 15:23
    @Baggers- Thanks! I know it might seem a bit ambitious...but I'm going for the whole kit and kaboodle! Block Selection with KB or Mouse..Cut, Copy, Paste..Find, Replace...Color Scheme Change. The only thing that was available in EDIT that I wont be tackling (and I never used anyway) was the "View" Menu which allowed you to split the screen and have multiple documents open at once...there is hardly any screen real estate on a TV...I cant imagine working on 2 docs at once!!

    @microcontrolled- The TV_Text driver is barely modified, just for Locate(x,y) in one command, and a variation on the Clear Screen command, I'm using ASCII Characters to draw the lines and borders, they are all in the character chart of the propeller tool under the help menu, you can paste them right into the program your working on. It wouldnt be hard to write a Box function that uses the propper TV_Text driver. When its done I will post all the source, I'm gonna be working on it all weekend, so lets hope for the best!!

    Rick
  • ShazzShazz Posts: 52
    edited 2009-04-24 15:47
    Excellent !!!! Will this editor read files from a SD card ?
  • BaggersBaggers Posts: 3,019
    edited 2009-04-24 19:05
    @Rick, excellent [noparse]:)[/noparse] I shall be looking forward to having a play with this [noparse]:)[/noparse]

    We will just need a Compile/Run button next lol [noparse]:)[/noparse]))

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • DgswanerDgswaner Posts: 795
    edited 2009-04-24 19:34
    it's funny, through all of the advancements in technology, we end up back were we started, just on different platforms. I had a bit of nostalgia yesterday when I bought Wolfenstine 3d for my Iphone, now again with this. got to love it!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DGSwaner

    "When in doubt, use C4" - Jamie Hyneman, Myth Buster
  • CassLanCassLan Posts: 586
    edited 2009-04-24 22:32
    Hi Again,

    @Shazz- Definitely, opening files from and saving files to SD are top priority.

    @DGSwaner- I know what you mean...Wolf3d and QBasic are some of my fondest memories.

    @Baggers- I really don't see why this editor·on a "Run" Command couldn't (1) Save the File, (2) Modify some autoexec script (another file) ·(3) Reboot the Prop which could potentially kick on to Femto Running the file....but one thing at a time [noparse];)[/noparse]

    All the drop-down menu coding is done, its also been done in a way so that it buffers the screen before drawing the menu...so it can be added to other programs without forcing the program to re-draw itself after a menu selection is made.

    I need a 2nd PS2 Breadboard Adapter for the mouse, I will be ordering that tomorrow.
    I'll be hitting the Saving/Loading stuff tomorrow.
    Now I have a question to the folks that are familiar with SD Card Files, and the Format of text documents...if that is a format..or lack of a format.

    I'm hoping some of the folks who have made other editors can lend some advise.

    When I read the file off the SD Card..it will be in a string of bytes only?
    Is there a limit to the size of an Array of bytes in spin?
    Any "End of Line" characters are just like any other byte, and that's up to the editor to render?
    Would it be best to keep the file contained as one long Array of bytes when loaded into Prop memory? Or have others found it easier to display as Line1[noparse]/noparse, Line2[noparse]/noparse?

    Thanks,

    Rick




    ·
  • mparkmpark Posts: 1,305
    edited 2009-04-25 01:31
    I wrote a simple text editor and posted it here: http://forums.parallax.com/showthread.php?p=790443.

    I have a 20000-byte array to work with. I read the file off the SD card (using fsrw) as a whole into the array and massage it from there. In the Windows world, text files typically end lines with CR and LF. For my purposes, I want lines to be null-terminated, so I go through the array and change CRLF pairs to null. Since two bytes are turning into one, I use bytemove to bump the rest of the array up to fill the gap. (I have some code to handle plain LF (*nix) and plain CR (Mac?) line terminators, but I haven't tested it.)

    Hope this helps, and good luck. It's looking great so far!
  • CassLanCassLan Posts: 586
    edited 2009-04-25 01:50
    Thanks mpark,

    I'm actually looking at your code now...couldn't wait till tommorow [noparse];)[/noparse]
    I will let you know how it goes.

    Rick
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-25 02:30
    There is more info on SD cards in the ZiCog thread and a little on the TriBladeProp thread. We are using FAT16 and I have 32MB files on the card. PropDos/PropCmd can access the file structure and my variant of ZiCog_Demo (spin section) uses the drivers directly to get at the file data. It demands contiguous sectors for speed, but the code is there to obtain it via sectors - you will just need to look at the loading of the sram section.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • CassLanCassLan Posts: 586
    edited 2009-04-25 03:23
    I have to admit that I was nervous going into the SD Card portion of this project, but let me say thanks to Tomas Rokicki for writing and documenting the FSRW routines Mike Green, OBC and mpark for your examples of use in your work...It's really not as scary as I thought it would be lol.gif.

    I was thrown at first because I thought the mode in popen had to be a Zero-terminated string and·String("r")·was not working, but because of the examples mentioned above that was quickly remedied.

    @OBC- I had not realized how far you went with the editor..DIR Display..and the switching between BASIC and the editor is really cool.

    @Cluso99- Thanks, I'm looking into all these examples!

    Oh yeah..any suggestions for a Name?·· PREDIT?

    Rick



    Post Edited (CassLan) : 4/25/2009 3:41:16 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-25 03:27
    Just to give credit where it's due ... Tomas Rokicki wrote the fsrw routines. I extended them somewhat in the process of creating BoeBotBasic. I did write the sdspiFemto assembly routines for low level SD card and EEPROM access.
  • CassLanCassLan Posts: 586
    edited 2009-04-25 03:37
    Mike thanks for that correction, thats my mistake, my first exposure to fsrw was from FemtoBASIC, I just looked at the entry in the Obex though and I see your 100% correct.

    Thanks Tomas Rokicki!!

    Rick
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-25 08:14
    That's the beauty of this forum - so many have contributed it's not always possible to give credit where credit is due. But usually it is in the source code smile.gif
    I can just say, thanks to all contributors smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • BaggersBaggers Posts: 3,019
    edited 2009-04-25 08:16
    Casslan, yes one step at a time [noparse]:)[/noparse] extras can be added later

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-04-25 14:23
    CassLan said...


    @OBC- I had not realized how far you went with the editor..DIR Display..and the switching between BASIC and the editor is really cool.

    Actually it looks like your editor could work out to be a great upgrade to
    that idea! Looking forward to playing with your code. [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • simonlsimonl Posts: 866
    edited 2009-04-25 20:11
    @CassLan: Very nice work, I can't wait to try it.

    I'd go for PrEditor wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
  • CassLanCassLan Posts: 586
    edited 2009-04-25 20:23
    @simonl- now THAT is a name!

    Been working on it..my brain is like Jelly, here are some more pics.

    @OBC- You have any tricks on how to sort files by name?

    Rick
    640 x 480 - 108K
    640 x 480 - 96K
    640 x 480 - 101K
    640 x 480 - 96K
    640 x 480 - 161K
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-04-25 20:45
    Wow.. You are really raising the bar with this.. [noparse]:)[/noparse]

    No, I haven't done an Alpha sort for the DIR command, we're due. [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • BaggersBaggers Posts: 3,019
    edited 2009-04-25 21:44
    casslan, if you want once you're done and have released the code, I'll put a filesort in for you.
    What kind of sort are you looking for?
    just filename, or sorted by extension then filename?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • jazzedjazzed Posts: 11,803
    edited 2009-04-25 22:05
    Rick, Predator (PrEditor) has many connotations these days .... No malice·against simonl.

    As far as line endings go, you could add the LFCR or CRLF or whatever choice to the options pane.
    You should also consider adding the option to convert tabs to spaces and set tab size.

    Good progress.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230
  • CassLanCassLan Posts: 586
    edited 2009-04-25 23:30
    @Baggers & OBC- I got a simple Alphabetical file sort going, sorting by only the first character, I'm just trying to be stingy with the·memory at this point, so I can't possibly store all the filenames one might have on their SD card and do a sort from that, instead I'm just using the fsrw.opendir command once per letter of the alphabet, and seeing if·the filenames start with that particular character.·

    @jazzed- I was going to have those line ending options available..had not thought about the tab/space conversion, or tab space settings though. Thanks! About the program name "PrEditor", I think its a very clever title and I'm not really concerned about a miss-interpretation based on the fact that it shares the same pronounciation as a word that could be used to describe bad people, I hear that word on nature shows all the time and my mind doesn't flash to images of Dateline NBC. I do appreciate the thought, and perhaps if I was creating this to sell or build some brand image I might change it, but for now I think its fine.


    Rick
Sign In or Register to comment.