void DDSWidget::loadQmaxPlugins() { QPluginLoader loader4("libQmaxPTInterface.so", this); ILineEdit = qobject_cast<IQmaxLineEdit*> (loader4.instance()); IPTLibrary = qobject_cast<IQmaxPTLibrary*> (loader4.instance()); INumberPanel = qobject_cast<IQmaxNumberPanel*> (loader4.instance()); QPluginLoader loaderApp("libPTApplicationcardInterface.so", this); IAppCard = qobject_cast<IApplicationCardInterface*> (loaderApp.instance()); qDebug() << "Appcard" << IAppCard; IAppCard->setDeviceName(SLOT0); IAppCard->enumerateAPPCard(); m_objAD5293Component = new AD5293(IAppCard); qDebug() << "Code ID:" << hex << IAppCard->readAppCardCodeId(); QPluginLoader loader2("libBackPlaneInterface.so", this); IBackPlane = qobject_cast<IntefaceBackPlane*> (loader2.instance()); IBackPlane->InitializeBpObject(); // GPIO Envet QPluginLoader loader3("libGPIOEventInterface.so",this); IGPIOEvent = qobject_cast<PTGPIOEventInterface*>(loader3.instance()); IGPIOEvent->InvokeGPIOEvent(this, "/dev/input/event1", "gpioevent", &m_nKeyCode); // Enable Interrupt // IBackPlane->writeBackPlaneRegister(0x40,0x20); // IBackPlane->writeBackPlaneRegister(0x0FFF,0x1E); // IBackPlane->writeBackPlaneRegister(0x1,0x24); // // IGPIOEvent->setProbeFlag(-1); }
void VIHWClass::initializeHWLibraries() { //ApplicationInterfacePlugin QPluginLoader loader1("libPTApplicationcardInterface.so"); IAppCard = qobject_cast<IApplicationCardInterface*>(loader1.instance()); IAppCard->setDeviceName(SLOT0); IAppCard->enumerateAPPCard(); qDebug() << "APPCard Code ID:" <<IAppCard->readAppCardCodeId(); m_nInterruptValue = IAppCard->readScratchPad(); qDebug()<<"Scratch:"<<m_nInterruptValue; //BackPanel Interface Plugin QPluginLoader loader2("libBackPlaneInterface.so"); IBackPlane = qobject_cast<IntefaceBackPlane*> (loader2.instance()); IBackPlane->InitializeBpObject(); qDebug() << "BACKPlane Code ID:" <<IBackPlane->readBackPlaneCodeID(); IBackPlane->writeBackPlaneRegister(0x01, 0x48); //PSOC Interface Plugin QPluginLoader loader3("libPTPsocInterface2.so"); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); IPsoc->openSerial(); QPluginLoader loaderSPIMemory("libSPIMemoryInterface.so"); ISPIMemory = qobject_cast<ISPIMemoryInterface*> (loaderSPIMemory.instance()); ISPIMemory->setHardwarwObject(IAppCard); ISPIMemory->accessSPIMemory(BACKPLANE); m_objAD5318Component = new AD5318Components(IAppCard); m_objAD5293Component = new AD5293(IAppCard); resetDAC(); //IPsoc->closeSerial(); //IPsoc->changeBaudRate(1); //IPsoc->writeSerial(0x50); //IPsoc->writeSerial(0x01); peformDriveConfiguration(); }
GPIOEvent::GPIOEvent(QWidget *parent,int *pKeyCode):QWidget(parent){ //qDebug()<<"----------------------------GPIO LIBRARY STARTS----------------------------"; m_TW = parent; m_nKey = pKeyCode; //Backpanel Interface Plugin QPluginLoader loader2("libBackPlaneInterface.so",this); IBackPlane = qobject_cast<IntefaceBackPlane*>(loader2.instance()); IBackPlane->InitializeBpObject(); QPluginLoader loader1("libPTApplicationcardInterface.so"); IAppCard = qobject_cast<IApplicationCardInterface*>(loader1.instance()); IAppCard->setDeviceName(SLOT0); IAppCard->enumerateAPPCard(); m_nInterruptValue = IAppCard->readScratchPad(); QPluginLoader loaderSPIMemory("libSPIMemoryInterface.so"); ISPIMemory = qobject_cast<ISPIMemoryInterface*> (loaderSPIMemory.instance()); IAppCard->setSPIAppendBit(0xC000); QPluginLoader loader3("libPTPsocInterface2.so"); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); IPsoc->openSerial(); m_nReceiveData = new unsigned short int[300]; m_stopFlag = false; m_strReceiveName =".\ActualData.bin"; //m_objEvent = new QEvent(APPCARDDRIVEEVENT); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QPluginLoader loader3("libPTPsocInterface.so",this); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); IPsoc->openSerial(); }
void PTPSoCTestJigInterface2::LoadPlugins(){ QPluginLoader loader3("libPTPsocInterface2.so",this); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); QPluginLoader loader2("libBackPlaneInterface.so", this); IBackPlane = qobject_cast<IntefaceBackPlane*> (loader2.instance()); QPluginLoader loader4("libQmaxPTInterface.so", this); ILineEdit = qobject_cast<IQmaxLineEdit*> (loader4.instance()); INumberPanel = qobject_cast<IQmaxNumberPanel*> (loader4.instance()); QPluginLoader loader5("libGPIOEventInterface.so",this); IGPIOEvent = qobject_cast<PTGPIOEventInterface*>(loader5.instance()); }
ShortLocater::ShortLocater(QWidget *parent) : QWidget(parent) { ui.setupUi(this); qDebug()<<"----------------------------SHORT LOCATER START----------------------------"; //DISPLAY dis=new DISPLAY(ui.displayPanel); dis->selectGeometry(150,30); ui.units->setFont(QFont("DejaVu Sans", 85, 50, false)); QPluginLoader loader2("libBackPlaneInterface.so",this); IBackPlane = qobject_cast<IntefaceBackPlane*>(loader2.instance()); IBackPlane->InitializeBpObject(); QPluginLoader loader3("libPTPsocInterface2.so",this); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); IPsoc->openSerial(); QPluginLoader loader4("libPTDMMLibInterface2.so",this); IDMMLib = qobject_cast<IDMMLibInterface*>(loader4.instance()); QPluginLoader loader5("libGPIOEventInterface.so",this); IGPIOEvent = qobject_cast<PTGPIOEventInterface*>(loader5.instance()); QPluginLoader loader6("libPTKeyEventInterfaces.so",this); IPTKeyEvent = qobject_cast<PTEventInterface*>(loader6.instance()); QPluginLoader loader8("libPTGPIOPinInterface.so",this); IGPIOPin = qobject_cast<InterfaceGPIOPins*>(loader8.instance()); QPluginLoader testing("libAppBckPsoc.so",this); test = qobject_cast<IPTAppBckPsocInterface*>(testing.instance()); QPluginLoader loaderhaadc("libADCHighAccuracy.so", this); HAADC = qobject_cast<IHACADCTestJigInterface*> (loaderhaadc.instance()); HAADC->setHACADC(ui.HAADC_WIDGET); ui.HAADC_WIDGET->setWindowFlags(Qt::Dialog); HAADC->showWidget(); // // toolboxFlag=false; // ToolBox(toolboxFlag); Initializations(); connect(m_nADCtimer,SIGNAL(timeout()),this,SLOT(Measure())); }
PortableTester::PortableTester(QWidget *parent) : QMainWindow(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint), ui(new Ui::PortableTester) { ui->setupUi(this); /* LoginDialog* loginDialog = new LoginDialog( this ); connect(loginDialog,SIGNAL(acceptLogin(QString&,QString&,int&)),this,SLOT(slotAcceptUserLogin(QString&,QString&))); do{ loginDialog->exec(); }while(!m_nPassword);*/ //qDebug() //<< "----------------------------PORTABLE TESTER STARTS----------------------------"; //Set home Directory as Current Directory QDir::setCurrent("/home"); //PT6 Application Interface Library QPluginLoader apploader1("libPTComponentsInterface.so", this); QObject *AppPlugin1 = apploader1.instance(); IPT = qobject_cast<IPTComponentsInterface*> (AppPlugin1); //Application Card Interface Library QPluginLoader loaderApp("libPTApplicationcardInterface.so", this); IAppCard = qobject_cast<IApplicationCardInterface*> (loaderApp.instance()); IAppCard->setDeviceName(SLOT0); IAppCard->enumerateAPPCard(); //Backplane Interface Library QPluginLoader loader2("libBackPlaneInterface.so", this); IBackPlane = qobject_cast<IntefaceBackPlane*> (loader2.instance()); IBackPlane->InitializeBpObject(); //PSOC Interface Library QPluginLoader loader3("libPTPsocInterface2.so", this); IPsoc = qobject_cast<IPSOCCOMMUNICATION*> (loader3.instance()); IPsoc->openSerial(); objTimer = new QTimer(this); connect(objTimer, SIGNAL(timeout()), this, SLOT(checkButton())); // idleTimer=new QTimer(this); // connect(idleTimer, SIGNAL(timeout()),this,SLOT(idleScreen())); // idleTimer->setInterval(23000); // idleTimer->start(); //QMax PT Interface Library QPluginLoader loader4("libQmaxPTInterface.so", this); IptLib = qobject_cast<IQmaxPTLibrary*> (loader4.instance()); //GPIO Event Interface Library QPluginLoader loader5("libGPIOEventInterface.so", this); IGPIOEvent = qobject_cast<PTGPIOEventInterface*> (loader5.instance()); //PT Keypad Interface Library QPluginLoader loader6("libPTKeyEventInterfaces.so", this); IPTKeyEvent = qobject_cast<PTEventInterface*> (loader6.instance()); //GPIO PIN Interface Library for toggle touch and kill QPluginLoader loader7("libPTGPIOPinInterface.so", this); IGPIOPin = qobject_cast<InterfaceGPIOPins*> (loader7.instance()); // //Hardware Identification Library // QPluginLoader loader8("libPTHWIDInterface.so", this); // IHWID = qobject_cast<IHWIDInterface*> (loader8.instance()); // // //Utility Panel Interface Library // QPluginLoader loader9("libUtilityPanel.so", this); // IUtility = qobject_cast<UtilityInterface*> (loader9.instance()); IBackPlane->writeBackPlaneRegister(0x03, 0x14); // Initialize LCD Control // IptLib->InitPTLibrary("./PTUI.xml", "MainWindow"); initialitation(); IPTKeyEvent->InvokeGPIOEvent(this, "/dev/input/event2", "pt_kpp",&m_nPTKeyCode); // IGPIOEvent->InvokeGPIOEvent(this, "/dev/input/event3", "gpioshutdown", &m_nPTShutDown);//do not uncomment VI will not work properly //qDebug() << "PT win Id" << this->winId(); isWindowOpen = false; msgBoxLive = false; /* QByteArray psocData; QMessageBox failure; IPsoc->writeSerial(0xff); IPsoc->writeSerial(0xff); psocData = IPsoc->readSerByte(); if (psocData.endsWith("*?") == true) { qDebug() << "PSOC RESET DONE on 1st try"; } else { IPsoc->writeSerial(0xff); psocData = IPsoc->readSerByte(); if (psocData.endsWith("*?") == true) { qDebug() << "PSOC RESET DONE on 2nd try"; } else { IPsoc->writeSerial(0xff); psocData = IPsoc->readSerByte(); if (psocData.endsWith("*?") == true) { qDebug() << "PSOC RESET DONE on 3rd try"; } else { failure.setText("PSOC RESET FAILURE"); failure.exec(); } } } qDebug() << "RESET DATA:" << psocData; */ QMessageBox testing; if (IAppCard->readAppCardCodeId() != 0x1982) { testing.setText("Check Appcard !!!"); testing.exec(); } if (IBackPlane->readBackPlaneCodeID() != 0x2704) { testing.setText("Check Backpanel !!!"); testing.exec(); } // IAppCard->resetADC(1); dmmPlugin = viPlugin = fgPlugin = slPlugin = icmPlugin = false; m_bTouchFlag = true; //~~~~~~~~~~~Transparent OM Symbol Splash~~~~~~~~~~~ /* QPixmap pixmap(":/images/Tamil_ohm2.png"); QSplashScreen splash(pixmap); splash.setMask(pixmap.mask()); splash.show(); splash.close();*/ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~Digital Clock~~~~~~~~~~~~~~~~~~~~~~~ clock=new QDigitalClock(this); clock->setGeometry(620,0,170,30); clock->m_TextColor=QColor(255,255,255,255); clock->setFont(QFont("DejaVu Sans",14,50,false)); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ myID=0; // qInstallMsgHandler(customMessageHandler); }
PTDMMLibInterface::PTDMMLibInterface(QObject *parent):QObject(parent) { // qDebug()<<"----------------------------PTDMM INTERFACE STARTS----------------------------"; //Library Initializations QPluginLoader loaderApp("libPTApplicationcardInterface.so", this); IAppCard = qobject_cast<IApplicationCardInterface*> (loaderApp.instance()); IAppCard->setDeviceName(SLOT0); IAppCard->enumerateAPPCard(); //qDebug()<<"App Card Code ID:"<<hex<<IAppCard->readAppCardCodeId(); IAppCard->setSPIAppendBit(0xC000); m_objAD5318Component = new AD5318Components(IAppCard); m_objAD7190 = new AD7190Component(IAppCard); QPluginLoader loader3("libPTPsocInterface2.so",this); IPsoc = qobject_cast<IPSOCCOMMUNICATION*>(loader3.instance()); IPsoc->openSerial(); QPluginLoader loader7("libCalibrationInterface.so",this); ICALIB = qobject_cast<InterfaceCalibrationLib*>(loader7.instance()); IAppCard->writeRegister(0x0000,0x0048);//offset relay //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Drive initializations m_objAD5318Component->resetDAC5318(true); //RESET DAC m_eSelect = DACF; m_objAD5318Component->configureADC5318CW(); m_nDACVoltage=0.0; ForceCurrent(0,m_nDACVoltage); m_eSelect = DACG; m_objAD5318Component->configureADC5318CW(); m_nDACVoltage=0.0; ForceCurrent(0,m_nDACVoltage); //Receive initializations m_nADC=1; m_objAD7190->resetADC(1); calib_value.flag=false; ADCRxVoltage=0.0; values.Data=0.0; values.ConvertedData=0.0; noOfSamples=1; for(int i=0;i<noOfSamples;i++) avgRetval[i]=0.0; avg=0; retval=0; //qDebug()<<"----------------------------PTDMM INTERFACE STARTS----------------------------"; }