Idea: Visual NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

muntoo wrote:Or Sidneys1 can run Ubuntu in VirtualBox, and test at his leisure, unless of course 2GB is too much for him. ;)
Which I did, actually. Running two VMs, Ubuntu 10.10 and openSUSE (idk what version) Unfortunately, the Mono support on Ubuntu is inadequate to run Visual NXC :(

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

Ohhh-key-day.. I've barely done anything with V-NXC recently, quite frankly. Been far too busy with some other projects **cough*Portal-2*cough** (But don't worry, I'll be coming back to this project at some point, I'm merely taking a break atm)

Anyways, I've been contemplating how to have V-NXC handle blocks, and I think I'm going to go with a pretty straightforward XML syntax. This is pretty rough, and it's just an idea, no actual working code yet, but tell me what you think, what extra features/tags it should have, and etcetera:

Code: Select all

<?xml version="1.0"?>
<codeElement title="Do-While">

	<category>Loops</category>

	<color>1BD8F5</color>

	<isLoop>True</isLoop>

	<code>
		[comment]// Loops code 'do' until 'while' logic is false.
		[comment]// 'Do' is run once initially without checking 'while'.
		do
		{
			[loop]
		}
		while([logic])
	</code>

	<!-- 
		The [comment], [loop], and [logic] 'tags' are so Visual NXC knows where
		to put blocks within blocks ([loop]), logic code (ex: x == 1) ([logic]), and comments in the
		output NXC code ([comment]) (those are there so that the user can disable
		NXC comments in the output files)
	-->

</codeElement>
Again, this is all rough ideas. I want to nail this down before I write the code to turn the XML into actual blocks, though.

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: Idea: Visual NXC

Post by timpattinson »

maybe instead of
<codeElement title="Do-While">

<category>Loops</category>

you could have
<category name="Loops">
<codeElement title="Do-While">
...
</codeElement>
<codeElement title="For">
...
</codeElement>
</category>
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

Ok so I wrote a quick mock-up app to see what the possibilities are for the XML... And it looks like the best we're going to get is a little less user-friendly than I expected:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<CodeElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <title>Test!</title>
  <isLoop>false</isLoop>
  <code>
    <string>test</string>
    <string>{</string>
    <string>	//Lol</string>
    <string>}</string>
  </code>
  <cat>Loops</cat>
  <Color>FFFF0000</Color>
</CodeElement>
But I can write a small applet inside Visual NXC that will handle making these files for us.. All we'd have to do is tell it what to make and it will handle it automatically.

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: Idea: Visual NXC

Post by muntoo »

sidneys1 wrote:

Code: Select all

    <string>test</string>
    <string>{</string>
    <string>	//Lol</string>
    <string>}</string>

Code: Select all

    <string>test<br />
    {<br />
       //Lol<br />
    }</string>
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

muntoo wrote:

Code: Select all

    <string>test<br />
    {<br />
       //Lol<br />
    }</string>
I would have preferred that, but what I posted is what .NET will allow. I could use a string instead of a string array, but then it's harder for me to process. :x

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: Idea: Visual NXC

Post by muntoo »

I don't think this will help, but could you use the <pre> tag?

A wise man should have once said: "Lot of work now save you lot of work in future." (And they really need to fix their grammar. ;) )

-----
sidneys1 wrote:Dudmaster, please stop spamming this thread. If you think your C++ executable is worth mentioning, make your own thread.
Actually, I believe he's [unknowingly?] trolling.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

muntoo wrote:I don't think this will help, but could you use the <pre> tag?
Actually, I'm just going to have it detect indentation automatically via the braces { }... Saves me trouble worring about people formatting their XML right.

Have a nice day,
~Sidneys1
My Mindstorms website: http://sidneys1.com
sidneys1
Posts: 141
Joined: 01 Oct 2010, 14:38
Location: Pennsylvania - The United States of America
Contact:

Re: Idea: Visual NXC

Post by sidneys1 »

Ugh, well, sorry there hasn't been much action here lately.. I haven't had much time to work on this. I've got a ton of other projects (specifically rolling out Batch Image Processor v2 and an entry into the ThinkingWithPortals Summer Mapping Initiative contest) and some distractions (SUMMER VACATION, Minecraft, Far Cry 2, Prince of Persia, CoD: WaW, Portal 2, and etc) that are leaving me with little time to work on this worthy project. I have to go to work for the summer pretty soon, and while I will have a little free time (a few hours a day) it's unlikely that I'll spend much of that time (if any) working on V-NXC. However, once I get the (vastly improved) second version of my Batch Image Processor out and stable, I'll be able to make V-NXC my primary programming focus. (other than the ever-present priority of FilmFree)

Have a nice day,
~Sidneys1

P.S. I thought I'd add, if anyone here is interested in being on the Visual NXC developer team (currently: me, myself, and I) feel free to PM me. Be ready to present some example XML (to help me write up the V-NXC block/code file format) or C# to prove your worth. (Or maybe even some VB if you're really good at it.. I hate VB but if you're as good in it as I am in C# then I'll welcome you in)
My Mindstorms website: http://sidneys1.com
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Idea: Visual NXC

Post by HaWe »

Sidney,
it's a big chunk of work as a thought still from the start, and not to critizise your approach, but I had 2 or 3 or 4 ideas about your project:

1.) visual Basic or Delphi or Borland C++ (which I actually know better) don't generate code that calculates or writes any useful routines - they generate just a user interface with windows, buttons, canvas, menus, edit boxes. What happens "internally" if a user pushs a button must still be written in "legal handwritten C or Pascal code" - each variable, each loop, each if, is +, *, / -, ^, % or what ever.
2.) What you try to do is much more than this: you try to put every keyword, variable, more-dim. array, expression, macro, modifier, device, into a graphic symbol.
3.) NXC has lots of keywords and symbols and devices and what else with lots of adjustments - you know that from NXT-G symbols with it's adjustment-, input-, and outbut-submenus.
4.) If you try to put all this (the programming language itself, not just the user panel and interface) into grafic symbols you will end up inevitably at a grafic language which more or less looks like or similar as NXT-G or Robolab or Labview, except the fantastic benefit that you will have an additional written code in NXC syntax.

I really don't want to discourage you or call your challenge into any question, but given the fact that it is an almost unmanageable chunck of keywords, definitions, predefined expressions and macros (look at NXCdefs.h) which have to be processed into a graphic symbol it's worth while a big team of specialists who care about it's implementation and redeployment and it's hard to see in how many years this project will ever be finished...

I personally almost would have resigned since quite from the start, but I honestly hope this could be a further incentive for all for all involved people to bring this actually magnificent project to a glorious final... :)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests