- Posts: 425
- Thank you received: 81
qtvcp issues
- auto-mation-assist
- Offline
- Platinum Member
-
Less
More
7 years 9 months ago #124269
by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Norbert
In regards to your, 'Does your way also work correct, if no movement is involved?
What if we just send a G4 P1 or M61 Q2 or just a (MSG, Hallo world)'
G4 P - interp goes from idle to reading and inserts the G4 in the G code list.
M61 Q2 - interp goes from idle to reading and inserts M61 in the Mcode list.
MSG, Hallo world - gives: unkown word starting with 'S' - interp stays in idle
Hallo world - gives: unkown word starting with 'a' - interp stays in idle
Looks like its ok to me.
If are commas allowed in a command for some reason I would have to change how I handle a command.
In regards to your, 'Does your way also work correct, if no movement is involved?
What if we just send a G4 P1 or M61 Q2 or just a (MSG, Hallo world)'
G4 P - interp goes from idle to reading and inserts the G4 in the G code list.
M61 Q2 - interp goes from idle to reading and inserts M61 in the Mcode list.
MSG, Hallo world - gives: unkown word starting with 'S' - interp stays in idle
Hallo world - gives: unkown word starting with 'a' - interp stays in idle
Looks like its ok to me.
If are commas allowed in a command for some reason I would have to change how I handle a command.
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Offline
- Platinum Member
-
Less
More
- Posts: 425
- Thank you received: 81
7 years 9 months ago #124270
by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
Chris,
This is the present code I use for finishing the present jogging position commands to exist MDI mode. It get called by periodic. jogging_control[14] gets set to 1 by the button push of a selected command. I do not see a need to change it for my application.
def mdi_to_manual(self):
if self.jogging_control[14] == -1:
return
if self.jogging_control[14] == 1:
if self.s.inpos == True:
# task_mode: manual = 1, auto = 2, midi = 3
if self.s.task_mode == 3:
self.c.mode(linuxcnc.MODE_MANUAL)
self.jogging_control[14] = -1
print "mdi position cmd completed"
This is the present code I use for finishing the present jogging position commands to exist MDI mode. It get called by periodic. jogging_control[14] gets set to 1 by the button push of a selected command. I do not see a need to change it for my application.
def mdi_to_manual(self):
if self.jogging_control[14] == -1:
return
if self.jogging_control[14] == 1:
if self.s.inpos == True:
# task_mode: manual = 1, auto = 2, midi = 3
if self.s.task_mode == 3:
self.c.mode(linuxcnc.MODE_MANUAL)
self.jogging_control[14] = -1
print "mdi position cmd completed"
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
7 years 9 months ago - 7 years 9 months ago #124274
by cmorley
Is much easier to read. Its future proof. it's consistent.
But even more then that I think you could not even need the whole function if you used other objects for the intended behaviour.
I believe this was for positioning the axes with the push of a single button, which there is an action button for that.
Of course there will be times that the widgets/libraries will not cover your needs, in that case I would be interesting in improving the widget/library if it is a common enough behaviour. If it's really odd then of course custom code makes sense, but even then it also makes sense to use as much of the 'building blocks' as you can.
In this way everyone who builds a screen helps and gets help from eveyone else who makes a screen - because the code is consistent, exercised and improved.
Just my 2cents worth.
Thanks
Chris M
Replied by cmorley on topic qtvcp issues
Code:
def mdi_to_manual(self):
if self.jogging_control[14] == -1:
return
if self.jogging_control[14] == 1:
if self.s.inpos == True:
ACTION.SET_MANUAL_MODE()
self.jogging_control[14] = -1
print "mdi position cmd completed"
Is much easier to read. Its future proof. it's consistent.
But even more then that I think you could not even need the whole function if you used other objects for the intended behaviour.
I believe this was for positioning the axes with the push of a single button, which there is an action button for that.
Of course there will be times that the widgets/libraries will not cover your needs, in that case I would be interesting in improving the widget/library if it is a common enough behaviour. If it's really odd then of course custom code makes sense, but even then it also makes sense to use as much of the 'building blocks' as you can.
In this way everyone who builds a screen helps and gets help from eveyone else who makes a screen - because the code is consistent, exercised and improved.
Just my 2cents worth.
Thanks
Chris M
Last edit: 7 years 9 months ago by cmorley.
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Offline
- Platinum Member
-
Less
More
- Posts: 425
- Thank you received: 81
7 years 9 months ago - 7 years 9 months ago #124281
by auto-mation-assist
Replied by auto-mation-assist on topic qtvcp issues
That is much easier to read. I don’t know why it removes tabs when I copy and paste some code. It looks fine until I submit it. The function this is for is to read the pre-set multi axis position commands from the .ini file and send a selected one from an array of labeled buttons. It is also used for other similar functions that handle handle different data.
I know you prefer action items but i prefer to use my code to the maximum degree possible and is something that will likely never change. One type of car for example does not suit everyones personal preferences and that is why there are some many different ones on the road. Each year improvements are made to each model, and each model is able to take a person to the desired destination. Kind of like software.
I know you prefer action items but i prefer to use my code to the maximum degree possible and is something that will likely never change. One type of car for example does not suit everyones personal preferences and that is why there are some many different ones on the road. Each year improvements are made to each model, and each model is able to take a person to the desired destination. Kind of like software.
Last edit: 7 years 9 months ago by auto-mation-assist.
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
7 years 9 months ago #124284
by cmorley
Replied by cmorley on topic qtvcp issues
Not sure if you noticed:
To post code don't use quick replay, use Action and then there is special button to paste code
<code>
Put code here
<\code>
it's a pain but It preserves spaces in the code.
I guess we will have to agree to disagree
Chris M
To post code don't use quick replay, use Action and then there is special button to paste code
<code>
Put code here
<\code>
it's a pain but It preserves spaces in the code.
I guess we will have to agree to disagree
Chris M
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
-
Less
More
- Posts: 7368
- Thank you received: 2181
7 years 9 months ago #124433
by cmorley
Replied by cmorley on topic qtvcp issues
I pushed Qtvcp to master so you could base your work from master to keep current now if you like.
Chris M
Chris M
The following user(s) said Thank You: phillc54, KCJ
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.173 seconds