Hi there...
Originally Posted by
wysota
It's hard to answer any of those questions without knowing how the library works and what it does.
The library is a series of pure C++ classes. Each class has a series of routines and each of them represents an electronic unit. It's a simulator. The user inputs the initial data (eg voltage, ...) and the routine produces the outcomes. I need to viualise this via a GUI. But C++ is not the ideal language for this. Here comes a simple routine example:
generic_unit* specific_generic_unit(const int min, const int* volt, const double energy)
{
int i;
if(min<=0)
{
printf("specific_generic_unit: problem.\n");
exit(1);
}
int M=1<<min;
double level=sqrt(energy);
double* sR = new double[2*M];
double off=32.53253245435/M;
for(i=0;i<M;i++)
{
sR[2*i] = level*cos(off*(1.+2.*i));
sR[2*i+1] = level*sin(off*(1.+2.*i));
}
generic_unit* temp=new generic_unit;
if (volt==(const int*)1)volt=[12,43,43,21];
temp->SetParameters(min,sR,volt,false);
delete[] sR;
return temp;
}
generic_unit* specific_generic_unit(const int min, const int* volt, const double energy)
{
int i;
if(min<=0)
{
printf("specific_generic_unit: problem.\n");
exit(1);
}
int M=1<<min;
double level=sqrt(energy);
double* sR = new double[2*M];
double off=32.53253245435/M;
for(i=0;i<M;i++)
{
sR[2*i] = level*cos(off*(1.+2.*i));
sR[2*i+1] = level*sin(off*(1.+2.*i));
}
generic_unit* temp=new generic_unit;
if (volt==(const int*)1)volt=[12,43,43,21];
temp->SetParameters(min,sR,volt,false);
delete[] sR;
return temp;
}
To copy to clipboard, switch view to plain text mode
Have in mind that there will be multiple, different and complex type input and multiple output as well. I DON'T WANT TO INTERFERE with those routines' code. That's my critical question...Do I need something more than the Qt Suite. Won't it compile the whole thing, the C++ routines and the Qt gui code at the same project? I have no idea how to start at this point...how to connect my code with the GUI...Probably I haven't studied enough, or is this a Qt weakness?
Originally Posted by
wysota
I can try to answer the last question -- you don't need any code to glue your library to Qt but it might be beneficial if you had a wrapper around your library to integrate it with Qt's API, especially its data structures and models.
Some glue code? Beneficial coding is crucial as well. But if there is a need for glue code then we return to my first question about connecting directly Qt GUI with the C++ library at the sam Qt project. Are there any examples of such glue code?
Bookmarks