Jump to content

Arduino GUI Programmer


nikosliapis
 Share

Recommended Posts

The latest version of the GUI Programmer:

Vesion Changes :

0.22) Bug fixed when loading Rule for modifying

0.23) Adds the ability to set a Counter to a fixed value so that the user can "reset" the value of a Counter

0.24) Bug fixed: used to add a space infront of the Counters in inputs causing problems to simulator

Fixe the _check_syntax() function to accept 0 as value when output is a counter

0.25) - Prevent user entering a pin name containing the words "Virtual_Coil" or "Counter" because causes problems on the function

_update_rule_combos_others()

- Adds the autocomplete choise when apllying a new rule, which automatically creates another opposite rule

For example: if a rule is * Pin_0 = HIGH ==> Pin_5 = HIGH *

then the rule * Pin_0 = LOW ==> Pin_5 = LOW * will be automatically created

0.26) - Changed the generated code regarding Counters (each Counter will increase or dicrease only on input toggle)

0.27) - Show the Project name on the window title

- Help is available under "Help-How to"

0.28) - The settings combos are disabled only if they have been used inside a Rule

0.29) - Adds the abbility to use an Output as Input (Further testing required)

0.30) - Bug fixed: Pin_A5 was not updated to the rule combos

- New feature that enables user to compare 2 analog pins

- Improve the generated code conserning the expression feature. (Use of the constrain() Arduino command to limit the values and not if...then)

- Improve the generated code conserning analog inputs. (Map the values of AI to a range of 0-255 when reading the pin and not when writing the corresponting output. By doing the mapping at the begining there is no need to remap when comparison of analog pins)

- Change the header(top line) of the saved project (This is done so older versions of Arduino Simulator(V0.06 and below) wont open projects with the comparison feature, because they can't handle the rules.)

- Bug fixed: Wrong project name when "save as"

0.31) - Minor change in the order of the comparator when comparing analog pins (Division is the default selection)

- Show tip text associated with the controls

0.32) - Prevent user entering a pin name containing the character "", because it is used as delimiter at the "Boole calc" function and may create problems.

- Bug fixed: When the number of created rules where over 30 they didn't fit at the rule selection combo. Now a scrollbar appears if needed

- Three new alternative ways to create rules are added:

1) Boolean Calculator: A calculator like GUI Window that allows the user to create Logical (Boolean) Expressions which are

automatically transfered to Rules.

2) Boolean Truth Table (2 Inputs): A Truth Table ready for 2 inputs and 1 output. The entered data are automatically

transfered to Rules.

3) Boolean Truth Table (custom Inputs): A generalized Truth Table able to handle more inputs (1-9)

0.33) - Add a space option along with the "AND" and "OR" options in the rule combos

- Bug fixed: When the number of inputs is three and above then the opossite rules regarding Virtual Coils are also created.

- Bug fixed: Changed the way that counts the open and closed parentheses in the _create_output_from_bool_expression function

- When using Bool calculator, user can create an expression with an "Not" in the output to invert the output

- Bug fixed: Button 13 on Bool Calculator was not functioning. (An empty label was overlaping)

- Changed the symbols for "AND" , "OR" on boole calculator. Now the symbols are: AND -> "*" OR -> "+"

- Remove the counters from the combos on bool functions

0.34 - Add the "Preview Truth Table" feature on the Bool Calculator

- Some syntax check of the expression in the Bool Calculator

- In the "Boolean Truth Table (Custom Inputs)" tool all the possible states of inputs are automatically created

- Change the label showing the maximum number of inputs on the "Boolean Truth Table (Custom Inputs)" tool according to the daclared Digital Inputs

- Add the "Fill Inputs" button on the "Boolean Truth Table (Custom Inputs)" tool, which automatically sets all the possible states of the inputs

- Bug fixed: Program crash when rule was deleted twise

- Add a Clear Rules option under the Clear Settings Button

0.35 - Use of a much better way to generate Rules when the "Boole's Calculator" or "Boole's Truth table" are used.

The generated Rules and the Virtual Coils used are much less.

Arduino Programmer V0.30.au3

Arduino Programmer V0.35.au3

The latest version of the Arduino pseudo simulator:

Vesion Changes :

0.02) Counters increase (or dicrease) only when the triger input changes condition

0.03) Bug fixed: Counters were not increased (or dicreased) correctly when the same counter was declared in more than one rule

0.04) Display the type of each pin next to the pin

0.05) Create a list view which shows the rules of the project, so that the user can check on them when testing

Show the name of the current project on the window title

Bug fixed: Delete the labels that shows the pin state when a second project is opened

When the project doesn't have any Rules, Display an error message

The How to... under the help menu is active

0.06) Show the pin name next the pin

0.07) Corrections made to handle the new "Compare" feature

0.08) Show control tips when mouse hovers over them

0.09) User can view in real time the states and values of Virtual Coils and Counters

Arduino Simulator V0.07.au3

Arduino Simulator V0.09.au3

And some simple examples:

Examples.zip

Looking forward for comments and recomentations.

Thank you all very much

Edited by nikosliapis

Coding can be fun when you do it your own.

Link to comment
Share on other sites

nikosliapis

Looks good!

If you enter a rule and press Generate_code and forgot to press Add_Rule then the script crashes because $rule_count is zero and you have Dim statements using $Rule_count for the number of elements..

I don't understand how an analogue input is used. If I try to create a rule using Pin_A0 for example, the choice is Gets High or Low

I think it would be helpful if the first window was kept so that additional pin settings could be made or corrected as rules are though up, and I think an essential addition is an option to save the settings as a project so that you can continue working on it another time.

I think it is better to keep the latest version in your first post with notes on the changes, otherwise people will have to search for the latest version and many would get the one in the first post which is out of date.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

martin

First of all, thank you for your time testing my script

If you enter a rule and press Generate_code and forgot to press Add_Rule then the script crashes because $rule_count is zero and you have Dim statements using $Rule_count for the number of elements..

In the latest version the last rule must be completely empty in order to generate code otherwise an error message pops, promting the user to correct it by creating one last empty rule. (I know it's not the best thing :bye: but i am looking for a way to bypass this ;) . Perhaps it's better to test the syntax of rules when the "generate code" button is pressed and report to the user which rules has a syntax error). Indeed the program crashes when no rule at all is set, but what is the point generating arduino code with no rules :doh: .

Nevertheless i will adjust the program to generate only the "void setup()" function in such a case ;) .

I don't understand how an analogue input is used. If I try to create a rule using Pin_A0 for example, the choice is Gets High or Low

When an analog input or output are selected the user can write directly inside the combo box to set the value. For analog inputs the value must be between 0 - 1024 and for outputs between 0 - 255. For example:

post-54141-0-34876400-1332447092_thumb.j

I think it would be helpful if the first window was kept so that additional pin settings could be made or corrected as rules are though up

Of course you are correct. What i have in mind for future versions is to eliminate the first window. I am thinking to make the "Pin Information" corner the place to set the state of each pin. Truth is that, this was my first idea but i had a problem updating the options in the selection of inputs when a change on pin was made, so i let it go. I'm open to suggestions for eliminating this problem. :cheer:

I think an essential addition is an option to save the settings as a project so that you can continue working on it another time

Very usefull indeed. I will start working on a save and open option to save the project to a file.

I think it is better to keep the latest version in your first post

Allready done , what was i thinking ? :oops:

Coding can be fun when you do it your own.

Link to comment
Share on other sites

When an analog input or output are selected the user can write directly inside the combo box to set the value. For analog inputs the value must be between 0 - 1024 and for outputs between 0 - 255. For example:

post-54141-0-34876400-1332447092_thumb.j

I see. It was not obvious to me because there is still a combo there so the appearance is that you should select from the combo list. I would prefer it if the combo was made invisible and an edit was made visible to replace it when an analogue input is selected, and preferably something like a label over the edit to prompt for the allowed range. Eg "(Enter value 0 to 1024)".

I will start working on a save and open option to save the project to a file.

I think this is a good AutoIt project :oops:

If you save the project then maybe you could consider another thing. I think there will problems unless you do something like Koda does.

What will happen is that people can start by using your programmer, but there will be sections of code they will want to write which are nothing to do with what your programmer does, or maybe they only want to add comments. At the moment the only way to deal with this is to have one file for your project, and copy and paste sections from the code your program produces.

So you could have a file for the Arduino code, and when you write a rule for example, you write comments before and after, like this

//rule 17 region!!Do not change the code in this region it is maintained by the NAG Programmer.
if (dig_in_state[0] == HIGH) {
    digitalWrite(dig_out[0], LOW);
  }
//rule 17 endregion

Then when you update rule 17 you copy the file up to "//rule 17 region", write the new rule and write everything from "//rule 17 endregion" onwards. That way people can add whatever code they like and there is no need to copy and paste.

I have these problems

There seems to be no option to set analogue outputs yet.

If I try to change a rule I am told that the output has not been set even if it has been set.

There seems to be no way to remove a rule.

If I change a rule which has been saved it seems to have no effect and I can enter incorrect data.

Your labels overlap the combo boxes and this shows up when you add a rule.

It would be good if instead of only dealing with the last rule, as I think your program does (though I haven't examined your code) then you should examine the rule where the last change was. This could be quite difficult. So maybe instead you could have a fixed set of edits and comboboxes. When you say "add rule" the rule is added to an edit say with a reference like rule 5. Make the edit read only. Maybe a listview would be better, then you could click on a line to select the one you want to change. You can make an extra combo box at the start of the line which contains the list of rule numbers. "1,2,3,4, New Rule" for example. Then you could edit a rule without any confusion and your program would be a bit simpler perhaps. You could have a Delete button to delete the currently displayed rule, or maybe you should just empty the rule so it can be reused and so that the references stay the same for other rules.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

There seems to be no option to set analogue outputs yet.

The pins that have the ability to be declared as Analog Outputs are marked with a " ~ " next to the pin name (same as the Arduino board).

In order to declare that pin as Analog Output you must select the "AO" option as shown below:

post-54141-0-98943200-1332576214_thumb.j

Your labels overlap the combo boxes and this shows up when you add a rule.

Fixed in the latest version :oops:

That way people can add whatever code they like and there is no need to copy and paste.

If i understand correctly, you recommend to add comments in the Arduino code marking the Rule from which this part of the

code was generated so that it is easier for the user to identify and it ?

Please verify my assumption.

So maybe instead you could have a fixed set of edits and comboboxes. When you say "add rule" the rule is added to an edit say with a reference like rule 5. Make the edit read only. Maybe a listview would be better, then you could click on a line to select the one you want to change. You can make an extra combo box at the start of the line which contains the list of rule numbers. "1,2,3,4, New Rule" for example. Then you could edit a rule without any confusion and your program would be a bit simpler perhaps. You could have a Delete button to delete the currently displayed rule, or maybe you should just empty the rule so it can be reused and so that the references stay the same for other rules.

Can you please provide a draft GUI of what you have in mind.

Manipulating "real time" changes in the rules is a very BIG issue and i'm afraid goes beyond my coding abilitys. Hopefully i will manage to overcome it.

If I try to change a rule I am told that the output has not been set even if it has been set.

Please provide a screenshot

Coding can be fun when you do it your own.

Link to comment
Share on other sites

The pins that have the ability to be declared as Analog Outputs are marked with a " ~ " next to the pin name (same as the Arduino board).

In order to declare that pin as Analog Output you must select the "AO" option as shown below:

post-54141-0-98943200-1332576214_thumb.j

Yes but maybe it was a problem I had when I tried to change a saved rule. I can't reproduce it with your lates version (which is much better by the way)

If i understand correctly, you recommend to add comments in the Arduino code marking the Rule from which this part of the

code was generated so that it is easier for the user to identify and it ?

Please verify my assumption.

No. That's not what I mean at all. I haven't described trhe problem well enough so let me try a different way. How should a user build a project using your programmer to help him? This is what I would do but I soon run into trouble.

1. I start with an idea of what I want and how I will achieve it. Of course things will change as I go along.

2. I begin with your NAG programmer and I create a few rules. This gives me some code.

3. I work on the code adding things which I want. Maybe a wifi shield or a display. Maybe I just add some comments but it could be anything.

4. I decide that I need some more rules for inputs, or that I need to change a rule so I go back to your programmer.

5. I create the new rule or ciorrect an old one by editing the saved project (I know this is not avaialable yet). The first problem is that there is no way for an existing rule to be changed using your present version. But even if you create one, how are you going to correct the rules which are in my developed source code without either wiping out my hours of work, or just giving me some code which I have to spend much too long on copying and pasting to my project source code. Unless you have some way of replacing existing rules in the source code with changed ones, or even of avoiding dulpicating rules, then the system is too difficult to use so people won't use it. You will have given people a tool which converts a job into a more difficult and longer job.

If you haven't used Koda then I recommend that you do because it creates the graphical code. You can add whatever code you want to the script and then if you modify the gui using Koda it will update the gui parts and leave your nice code alone. You have to have sometjing like that IMO.

Can you please provide a draft GUI of what you have in mind.

Please provide a screenshot

OK, here's what I was thinking but it's only a suggestion.

That way you can have a vertical scroll bar for the listview, you can select a rule by clicking on the line etc. You only need one set of combo boxes and you don't need to keep creating new ones for new rules. When you create code you just go through the list as you must do already, but the problem is the maintenance of the source code which I mentioned before. It would be good if you gave the option to add a comment for a rule such as "// turn on lights when it gets dark".

It is very likely that I'm being too demanding but it's easy to ignore me :oops:

Manipulating "real time" changes in the rules is a very BIG issue and i'm afraid goes beyond my coding abilitys. Hopefully i will manage to overcome it.

Real time isn't needed at all. It is not really different than what you are already doing. You copy the old source code to a new file untill you come to a rule , you write the new version of that rule to the new file, carry on copying from after the rule in the old file and so on. (You have to allow for the user rearranging the rules in the source code so they might not be in order any more.Then rename the old file to a backupversion and rename the new file to the old file name. You can definitely do it based on what you have done so far.

The bit that you didn't understand about my comments suggestion is that was how I think you can identify where the existing rules are in the application source code.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

It is very likely that I'm being too demanding but it's easy to ignore me

Progress comes through what other people want and need.

The hall concept of this forum is to make programs and UDF that other people will happily use.

Please never stop asking for improvements.

Looks like A LOT of work needs to be done. :bye::oops:

Coding can be fun when you do it your own.

Link to comment
Share on other sites

I've watched Arduino and if I'd been around years ago a lot of my "ideas" then would be reality now. :oops:

But now in my old age (46) everything I can think of doing with it I consider to be a waste of money for what it gives me or just way too exspensive. ;)

I'd love to get it into using them but just can't find a "usefull" project that won't cost the earth. :bye:

OH and one I can show the wife and say SEE computers can do usefull things in the "real-wiorld". :doh:

Any ideas?

Link to comment
Share on other sites

@storme

Only one, because the circuit responsible for recognition of the phone off-hook is made by transistors, together with the ring!

The problem is the array of conversation, I'm still thinking about how to do it without using dedicated ICs.

Regards,

João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

Hey guys! The previous 5 posts have really nothing to do with this thread so show some consideration for nikosliapis and people who want to follow the progress of the NAG programmer and lets keep on track.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Program looks fantastic. Just a pair of ideas:

When the program prompts for an error you launch a Msgbox:

#region **Add New Rule** Create next Rule =========================================================================================================================================
    ; If syntax is not correct then display the apropriate message promting the user to correct it
    If $check_input_1_value = -1 Then
     MsgBox (0,"Input_1_value ERROR", "Input_1 is declared as Digital input and it's value is not High or Low. Fix and continue")

It would be better if you use this Msgbox code:

MsgBox(262160,"Input_1_value ERROR", "Input_1 is declared as Digital input and it's value is not High or Low. Fix and continue")

So there will only can be one Msgbox at time at it will be over everything on the screen (if you click quickly to "Generate Code" 2 or three times you'll see the current problem).

And a visual feature: wouldn't it be great to prompt the user for the kind of Arduino Board is s/he using and change the graphic for an image of the board like these?

Posted Image

Congratulations and thanks for your program, it looks great.

Link to comment
Share on other sites

Thank you all for your comments.

It would be better if you use this Msgbox code:

Indeed is better will be changed in future versions

And a visual feature: wouldn't it be great to prompt the user for the kind of Arduino Board is s/he using and change the graphic for an image of the board like these?

I think this feature will be like "A cherry on the top" for my program :bye: . My script is still in infancy :oops: , so there is still a lot of work to be done and a lot of technical problems to solve.

Anyway i followed martin's suggestion, and i am working on a new interface for my script. It is not yet complete but here is a screenshot of what

it will look like:

post-54141-0-96025300-1332769167_thumb.j

Coding can be fun when you do it your own.

Link to comment
Share on other sites

Looks good!

I'm looking forward to trying your new version when you're happy with it.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...