Curtis

Curtis' Plugin Pack (Update for 3.5.4)

Recommended Posts

I still get the same error.

Also, you don't use the appropriate namespaces for the submenus. For 3.10, there was an update which allows to use special, "self-localizing" namespaces for submenus. If you switch your PDN-language to e. g. French, you will get an "Distort" submenu (in English) containing your distortion effects.

I think the problem is that the appropriate strings are not listed in any kind of documentation.

Note: "Color" has no special namespace as it's plugin unique and no built in submenu. "Distort" has one. I don't know if "Render" has one, but I believe "yes" since 3.20.

Share this post


Link to post
Share on other sites
Curtis    3

OK, so I have finished and am satisfied with this update so I have posted in my first post, I don't know if those of you who get that error will still get it, I made changes that will hopefully fix it but they might not, so if you still get errors from it I will post the source for you guys to look through.

Fisherman's Friend, here is a shot of it from the newest version with default settings but with shading turned on, it started with a blank white canvas and added everything else.

equationsscreenshot.png

Share this post


Link to post
Share on other sites
vista?    1

once again, well done, thx for the updates.

I see you've used 1 DLL for 4 separate plugins like Ed Harvey does in his plugin pack. What more, you've got icons! :D

Thx for all the work you've done so far! :mrgreen:

Share this post


Link to post
Share on other sites
Curtis    3
Still having the error message with equation

I've also tryied y=1 ! = error!

If you still get that message then no equations will work so those two errors aren't separate things. I was hoping I had fixed it but it appears not so I will attach the source to my first post so you can have a look, just a second, I'll go zip it.

Edit- OK, the source code is now attached on my first post.

Share this post


Link to post
Share on other sites
MadJik    153

This is a highier level of coding in CSharp than I actually have... It shows me I really need to learn more...

Anyhow, I've try to find the error... I've added a line

string error = err.ErrorText;
listErrors.Items.Add(error);
if (error.Contains("Invalid") || error.Contains("expected"))
{
 error = "Make sure you aren't missing or have any unnecessary characters";
}

and it gives the internal error : Identifier expected

Perhaps it tells you something!

Share this post


Link to post
Share on other sites
Curtis    3
This is a highier level of coding in CSharp than I actually have... It shows me I really need to learn more...

Anyhow, I've try to find the error... I've added a line

string error = err.ErrorText;
listErrors.Items.Add(error);
if (error.Contains("Invalid") || error.Contains("expected"))
{
 error = "Make sure you aren't missing or have any unnecessary characters";
}

and it gives the internal error : Identifier expected

Perhaps it tells you something!

I don't know thats it, that error is caused by errors in compiling the equation, and that specific if() block is when you type something like "x+" instead of "x+10", if you did that normally it would say "; expected" so I changed that error text to something that made sence to the user. The error you get is from the build method throwing an exception and catching it down the bottom, notice the "Internal Error:" at the start which matches the text in the images that have been posted. Somewhere between there and the end of the Build() method it is throwing another exception.

catch (Exception exc)
{
   update = false;
   userScriptObject = null;
   userAssembly = null;
   result = null;
   listErrors.Items.Add("Internal Error: " + exc.ToString());
}

Just out of curiosity, what happens when you comment out that line ("error = "Make sure...") and then run the plugin, it might say something more descriptive, I don't know, could you try that if you get a chance?

Share this post


Link to post
Share on other sites
MadJik    153

Get it!

Creating the code for the effect:

            + "            int TWOFUNCTIONEQUATION = " + (int)EquationType.Parametric + ";\n"
           + "            int POLAREQUATION = " + (int)EquationType.Polar + ";\n"
           + "            double scalx = " + (double)sliderBoxComboXScaling.Value + "/100.0;\n"
           + "            double scaly = " + (double)sliderBoxComboYScaling.Value + "/100.0;\n"
           + "            double startAngle = " + (double)numericUpDownStartTheta.Value + ";\n"
           + "            double endAngle = " + (double)numericUpDownEndTheta.Value + ";\n"
           + "            double initAngle = " + (double)numericUpDownInitAngle.Value + ";\n"
           + "            double dtheta = " + (double)numericUpDownDTheta.Value + ";\n"
           + "            int equationType = " + (int)equationType + ";\n"
           + "            if(equationType == NORMALEQUATION)\n"

Result code to compile:

            double endAngle = 6,293;
           double initAngle = 0;
           double dtheta = 0,01;

The comma should be a dot!

Share this post


Link to post
Share on other sites
Curtis    3
Get it!

Creating the code for the effect:

            + "            int TWOFUNCTIONEQUATION = " + (int)EquationType.Parametric + ";\n"
           + "            int POLAREQUATION = " + (int)EquationType.Polar + ";\n"
           + "            double scalx = " + (double)sliderBoxComboXScaling.Value + "/100.0;\n"
           + "            double scaly = " + (double)sliderBoxComboYScaling.Value + "/100.0;\n"
           + "            double startAngle = " + (double)numericUpDownStartTheta.Value + ";\n"
           + "            double endAngle = " + (double)numericUpDownEndTheta.Value + ";\n"
           + "            double initAngle = " + (double)numericUpDownInitAngle.Value + ";\n"
           + "            double dtheta = " + (double)numericUpDownDTheta.Value + ";\n"
           + "            int equationType = " + (int)equationType + ";\n"
           + "            if(equationType == NORMALEQUATION)\n"

Result code to compile:

            double endAngle = 6,293;
           double initAngle = 0;
           double dtheta = 0,01;

The comma should be a dot!

Ah, that makes sence, so the numericUpDowns are localized to use "," as decimal points, that should be fixable, I think. I think I have an idea on how to fix that, hold on, I'll post a new dll soon for you to test.

I think I may have found a bug, although it may not be. Why does using tan create arrows automatically?

Like I said in my First post, the arrow working out code isn't perfect, basically how it works now is that the equation is made up of a series of lines, where the x value is incremented by 1 and the y value is determined by your equation, when it draws the equation it draws a line between each point and the next one. How it works out where to put the arrows is if one point lies within the canvas and the other is outside, then it knows there should be an arrow there, tan functions and other steep functions are so steep that from one x value to the next they go from very small, to completely out of the canvas so it thinks it should draw an arrow at the bottom. As it currently stands, it does not recognise that it is a steep curve so it thinks that the point lies outside the canvas because the curve is at the edge when in fact it isn't. Does that make sence or am I just rambling?

Edit- OK, so I have made a couple changes to fix the problem MadJik pointed out, if you are one of the people who get that error would you mind downloading the updated version on the first page that might fix the problem and letting me know if that fixes it, thanks.

Share this post


Link to post
Share on other sites
MadJik    153

I still have the error! :cry:

You should try a function like this:

        private string DoubleToString(double value)
       {
         string s;
         s = value + String.Empty;
         s = s.Replace(",", ".");
         return s;
       }

and change the code to:

            + "            double scalx = " + DoubleToString((double)sliderBoxComboXScaling.Value) + "/100.0;\n"
           + "            double scaly = " + DoubleToString((double)sliderBoxComboYScaling.Value) + "/100.0;\n"
           + "            double startAngle = " + DoubleToString((double)numericUpDownStartTheta.Value) + ";\n"
           + "            double endAngle = " + DoubleToString((double)numericUpDownEndTheta.Value) + ";\n"
           + "            double initAngle = " + DoubleToString((double)numericUpDownInitAngle.Value) + ";\n"
           + "            double dtheta = " + DoubleToString((double)numericUpDownDTheta.Value) + ";\n"

and it works! (tested!)

Share this post


Link to post
Share on other sites
Curtis    3
I still have the error! :cry:

You should try a function like this:

        private string DoubleToString(double value)
       {
         string s;
         s = value + String.Empty;
         s = s.Replace(",", ".");
         return s;
       }

and change the code to:

            + "            double scalx = " + DoubleToString((double)sliderBoxComboXScaling.Value) + "/100.0;\n"
           + "            double scaly = " + DoubleToString((double)sliderBoxComboYScaling.Value) + "/100.0;\n"
           + "            double startAngle = " + DoubleToString((double)numericUpDownStartTheta.Value) + ";\n"
           + "            double endAngle = " + DoubleToString((double)numericUpDownEndTheta.Value) + ";\n"
           + "            double initAngle = " + DoubleToString((double)numericUpDownInitAngle.Value) + ";\n"
           + "            double dtheta = " + DoubleToString((double)numericUpDownDTheta.Value) + ";\n"

and it works! (tested!)

Yeah, before you posted that I actually tried that, but now after looking at it I realise I forgot the "s=" in the replace method method, i wrote

private string DoubleToString(double d)
{
   string s = "" + d;
   s.Replace(",", ".");
   return s;
}

OK, I will update the main post with the new version which should now work for everyone, thanks MadJik.

Share this post


Link to post
Share on other sites
Curtis    3
Now I get just: "Bezeichner erwartet. Bezeichner erwartet." = "Identifier expected. Identifier expected."

Oh, and thanks you moved it to the localized submenus :) .

You downloaded the old version before I updated the main post. The fixed version is now up, try it and let me know.

Share this post


Link to post
Share on other sites
Curtis    3

Ok, so yesterday I was fiddling around with the CodeLab source code trying to build my own C# syntax coloured text box, and, well, I have nearly finished that and the results are pretty good, you can check it out here if your interested. It does still have some problems though, I bet if you look at that image long enough you'll find them.

code_lab_.png

But anyway, thats not why I'm posting. After a little playing around, I managed to make a version of the text box that colours your equation text. So I was just wondering what your thoughts would be on including this in the next update. Here is an example of what it looks like.

equations_test_.png

The reason I think it would be useful is that because it colours functions, constants, variables and operators, if you make a typo it will stay black and so will be easier to find when you get an error. Note that if your equation is longer than the box is and you hold down the delete key it can get a little slow, but that only happens if your equation is longer than the text box is, all regular typing is fine.

So, Your thoughts?

Share this post


Link to post
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