updating rs_commands

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

updating rs_commands

ravas
This post was updated on .
Hi Dongxu +

I saw the work you did on rs_commands... it's appreciated!

I added some priority commands (from my perspective),
and tried to push, but it says permission denied.

I'm willing to help with this;
let me know how to proceed.

:D

git user name: r-a-v-a-s
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

dxli
hi ravas,

I sent an invitation to you on github, and please make sure you have write access to the official repository.

Thanks,

Dongxu
ravas wrote
Hi Dongxu +

I saw the work you did on rs_commands... it's appreciated!

I added some priority commands (from my perspective),
and tried to push, but it says permission denied.

I'm willing to help with this;
let me know how to proceed.

:D

git user name: r-a-v-a-s
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

dxli
In reply to this post by ravas
Hi,

I think it would be good also, if we allow in the alias file to define new commands.

currently the format of alias file contains 2 columns:

<alias>  <existing command>


We can implement it accept 3 columns as well:

<short command> <full command> <RS2::ActionType as uint or string>

Need some implementation to use ActionType as string.

Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
I've added commands for 20 actions:

Line:
- parallel through point: ptp, pp
- orthogonal: ortho, perp
- tangent(P,C): tangentpc, tanpc
- horizontal: horizontal, hor
- vertical: vertical, ver
- bisector: bisect, bi
- polygon2: polygon2v, poly2
- freehand: free, fhl

Spline:
- spline: spline, spl
- spline through points: spline2, stp

Circle:
- two point: circle2, c2
- three point: circle3, c3
- tangent to 3: tan3, ct3

Ellipse:
- inscribed: ellipseinscribed, ie, ei

Info:
- distance point to point: distance, dist, dpp
- angle: angle, ang
- area: area, ar

Modify:
- attributes: modifyattr, attr, ma
- properties: properties, prop
- fillet: fillet, fi

Let me know what you think.

Using the example:          
{{"circle", QObject::tr("circle", "draw circle")}}
There are three things to input: command, command, description
What exactly is the description ("draw circle") used for?
When I input "ci" the command line output reads: "ci (circle)"
It seems like "ci (draw circle)" would be expected.

Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
In reply to this post by dxli
For the alias file I imagine a CSV file:

action1, alias_a, alias_b, ...
action2, alias_c, alias_d, ...
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

dxli
In reply to this post by ravas
for the QObject::tr() function is descripted here:

https://wiki.qt.io/QtInternationalization#What_is_tr.28.29.3F

basically, tr("string", "description") means the string would be the translation of the "string", and "description" services a hint useful for people doing the translation, so people can know better what the "string" actually means.
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
Thank you ^_^
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
In reply to this post by ravas
I've added everything I think I will use. However, if the goal is a command for every tool, then I could add more. Otherwise, we can wait and see what is requested. What do you think?
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

dxli
good enough to me.

Just one question, I'm not sure about the reason why there could be only one full command for each action?

For example, can we assign both "parallel" and "offset" for ModifyOffset?

ravas wrote
I've added everything I think I will use. However, if the goal is a command for every tool, then I could add more. Otherwise, we can wait and see what is requested. What do you think?
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
Is the concept of full and short commands exclusively for the tab completion/hint feature?

I notice that if I input: o
and then press tab
the output is "offset, ortho"

ortho is from the action I added (ActionDrawLineOrthogonal).

However it says nothing about "os" (ActionSnapFree)...
I guess because it's a short command...

Therefore it seems like the reasoning would be to limit what appears when you press tab.
Maybe the idea is to avoid similar full commands when coding so that pressing tab will complete more often.
For example, if I switch "perp" to the full command instead of "ortho", then o will complete to offset.

It's an unusual design... as opposed to the classic auto-complete list that appears while typing.
It does have the benefit of not running a function with every keystroke, which is something I like.
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

dxli
trying to complete command at every keystroke is a smart way, as far as it does not interfare with typing.

we may implement a standard command completion way.

ravas wrote
Is the concept of full and short commands exclusively for the tab completion/hint feature?

I notice that if I input: o
and then press tab
the output is "offset, ortho"

ortho is from the action I added (ActionDrawLineOrthogonal).

However it says nothing about "os" (ActionSnapFree)...
I guess because it's a short command...

Therefore it seems like the reasoning would be to limit what appears when you press tab.
Maybe the idea is to avoid similar full commands when coding so that pressing tab will complete more often.
For example, if I switch "perp" to the full command instead of "ortho", then o will complete to offset.

It's an unusual design... as opposed to the classic auto-complete list that appears while typing.
It does have the benefit of not running a function with every keystroke, which is something I like.
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
I meant to say that I like how the current system does not run a function on every keystroke.
I intentionally avoid keystroke triggered analysis in my text editor to assure there is no input lag.

Auto-complete systems that analyze the input on every keystroke can be convenient;
however, the cost is reduced performance,
lots of extra processing (some of it producing nothing),
and as you noted it can interfere with typing when we don't care about using auto-completion.

If you are inspired to add the feature, I suggest an option to disable it.
Personally I can remember the short commands, so no completion system assists me.

I think the priorities are fixing bugs, and adding things that people are begging for
that would benefit the majority of users.

I'm an advocate for focusing on what needs to be completed
so that we can move our attention to LibreCAD 3.
Reply | Threaded
Open this post in threaded view
|

Re: updating rs_commands

ravas
In reply to this post by dxli
dxli wrote
Just one question, I'm not sure about the reason why there could be only one full command for each action?

For example, can we assign both "parallel" and "offset" for ModifyOffset?
I noticed:

        //zoom redraw
        {
            {{"regen", QObject::tr("regen", "zoom - redraw")},
             {"redraw", QObject::tr("redraw", "zoom - redraw")}},
            {{"rg", QObject::tr("rg", "zoom - redraw")},
            {"zr", QObject::tr("zr", "zoom - redraw")}},
            RS2::ActionZoomRedraw
        },
If we enter "re" and press tab, then "regen" and "redraw" both come up.
So it appears that we could make both "parallel" and "offset" full commands.