Machinist Calculator
The only thing I don't like about Qt is all that humpyback stuff...
John
Please Log in or Create an account to join the conversation.
Sorry I've been out all day shooting, its that time of year over here.
I now use Qt4, used Qt3 for a long time but its getting old, Qt5 is in beta at present.
The use of the Designer .ui file directly in the make process takes a bit of getting used to, to start with I resisted it and just used the generated code within hand written code.The only thing I don't like about Qt is all that humpyback stuff...
However once you get your head around how to use the created class properly, it means that you can just change your GUI in Designer and then re-compile and it is there.
All you have to do is write the slots which receive the signals from buttons you created being pressed etc.
Designer is not always intuitive, but google is your friend, if you are having problems getting it to do something you can bet someone else has in the past.
regards
Please Log in or Create an account to join the conversation.
www.linuxcnc.org/index.php/english/forum...or-linuxcnc?start=18
The Designer .ui file is generated into a header file called ui_qtVCPTest.h which defines the class Ui_qtVCPTest and contains a setupUI() function which builds it.
All you need to do in C++ is to specify this class in the inheritance of your new qtVCPTest class and then just call setupUI() to build the window.
This snippet is the declaration
#include "ui_qtVCPTest.h"
class qtVCPTest : public QMainWindow , private Ui_qtVCPWindow
{
Q_OBJECT
public:
qtVCPTest(int argc, char** argv);
NML_Access *_nml;
void blankPins();
private slots:
virtual void onTool_1();
virtual void onTool_2();
virtual void onTool_3();
virtual void onTool_4();
virtual void onTool_5();
virtual void onTool_6();
virtual void onTool_7();
virtual void onTool_8();
};
qtVCPTest::qtVCPTest(int argc, char** argv)
{
QString str;
// build the main window from ui
setupUi(this);
// ....other setup stuff here
}
//slots for pushbuttons etc
void qtVCPTest::blankPins()
{
for (int i = 0; i < ARRAY_LEN; i ++)
_nml->setBitPinValue(name_array[i], false);
}
void qtVCPTest::onTool_1()
{
blankPins();
_nml->setBitPinValue("tool-1", true);
}
void qtVCPTest::onTool_2()
{
blankPins();
_nml->setBitPinValue("tool-2", true);
}
// and so on for all 8 buttons
You are obviously getting into the programming, I'll convert you to C++ yet!
regards
Please Log in or Create an account to join the conversation.
It would have to be a stand alone program.
Personally I would like to see it available inside a GUI rather then only stand alone.
(similar problem with NGCGUI -It can only be included in a TCL parent program - though it could be fixed)
My 2 cents
Chris
Please Log in or Create an account to join the conversation.
It will only get occasional use and could easily be free standing just as the Arc Buddy etc are.
Thus far I have not got any further with this.One thing ArcEye and I were talking of is it is not clear if QT can be embedded into existing linuxcnc GUIs.
The parent of a Qt window is a QWidget*, not an X11 WinID, and whilst the WinID is contained in a member of the QWidget class, there seems nothing useful you can do with that so far as embedding goes.
Embedding of X11 apps into a QX11EmbedContainer works the other way round no problem, I wrote a Webcam program that used mplayer embedded to display the camera view.
The only solution really is to write a Qt GUI for Linuxcnc to completely replace Axis. Then you could have the main window as a docking frame, within which any number of child windows could be open and docked in various positions or on tabs etc. Designer itself is an example of this window docking.
I may get around to this at some point as a logical extension of the HAL and NML access libraries I am working on.
Other projects will take precedence for now.
regards
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It does look like I need to fix the path finding in order to run it from a desktop launcher.
John
Please Log in or Create an account to join the conversation.
In Ubuntu run sfc.pyc either by clicking on it in the file manager or from a
terminal with ./sfc.pyc
i don't see the .pyc file. i do have the four file in one folder, that
and the readme file
opening in terminal works. is just the thread working ?
Please Log in or Create an account to join the conversation.
The threads tab is the only one that is finished so far. I'm working on the drilling tab now.
John
Please Log in or Create an account to join the conversation.