Exemplo n.º 1
0
void PTPSoCTestJigInterface2::SignalsAndSlots(){

    connect(ui.pushButton,   SIGNAL(clicked()),this,SLOT(TestButton()));
    connect(ui.pushButton_2,SIGNAL(clicked()),this,SLOT(ReadCodeID()));
    connect(ui.pushButton_3,SIGNAL(clicked()),this,SLOT(ReadRelays()));
    connect(ui.pushButton_4,SIGNAL(clicked()),this,SLOT(ResetRelays()));
    connect(ui.pushButton_5,SIGNAL(clicked()),this,SLOT(SwitchMux()));
    connect(ui.pushButton_6,SIGNAL(clicked()),this,SLOT(SendCommand()));

    connect(ui.groupBox_3,SIGNAL(clicked()),this,SLOT(VoltageCurrent()));
    connect(ui.groupBox_4,SIGNAL(clicked()),this,SLOT(FunctionGenerator()));
    connect(ui.groupBox_6,SIGNAL(clicked()),this,SLOT(InCircuitMeasurement()));
    connect(ui.groupBox_10,SIGNAL(clicked()),this,SLOT(EmbeddedKey()));

    connect(ui.comboBox_8,SIGNAL(currentIndexChanged(int)),this,SLOT(VoltageCurrent2(int)));
    connect(ui.comboBox_9,SIGNAL(currentIndexChanged(int)),this,SLOT(FunctionGenerater(int)));
    connect(ui.comboBox_11,SIGNAL(currentIndexChanged(int)),this,SLOT(InCircuitMeasureMent(int)));
    connect(ui.comboBox_12,SIGNAL(currentIndexChanged(int)),this,SLOT(MuxInputs(int)));
    connect(ui.comboBox_13,SIGNAL(currentIndexChanged(int)),this,SLOT(CommandSelection(int)));

    connect(MuxTestLineEdit, SIGNAL(focussed(bool)), this, SLOT(callMuxTestInput()));
    connect(MuxRefLineEdit, SIGNAL(focussed(bool)), this, SLOT(callMuxRefInput()));
    connect(CommandLineEdit, SIGNAL(focussed(bool)), this, SLOT(callCommandInput()));

    connect(ui.groupBox_15,SIGNAL(clicked(bool)),this,SLOT(EnDisSRCIM(bool)));
}
Exemplo n.º 2
0
int PTPSoCTestJigInterface2::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: on_switchFLY_clicked(); break;
        case 1: on_switchSRCIMP_clicked(); break;
        case 2: on_comboBox_10_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: EnDisSRCIM((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: TestButton(); break;
        case 5: SwitchMux(); break;
        case 6: ReadCodeID(); break;
        case 7: ReadRelays(); break;
        case 8: ResetRelays(); break;
        case 9: SendCommand(); break;
        case 10: Multimeter(); break;
        case 11: Oscilloscope(); break;
        case 12: FunctionGenerator(); break;
        case 13: ShortLocator(); break;
        case 14: InCircuitMeasurement(); break;
        case 15: VoltageCurrent(); break;
        case 16: Voltage((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 17: R2Wire((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 18: R4Wire((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 19: Current((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 20: Oscilloscope1((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 21: Oscilloscope2((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 22: FunctionGenerater((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 23: ShortLocater((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 24: InCircuitMeasureMent((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 25: VoltageCurrent1((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 26: VoltageCurrent2((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 27: MuxInputs((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 28: callMuxTestInput(); break;
        case 29: callMuxRefInput(); break;
        case 30: callCommandInput(); break;
        case 31: EmbeddedKey(); break;
        case 32: CommandSelection((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 33: psocError((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 34: receiveValue((*reinterpret_cast< uint(*)>(_a[1]))); break;
        case 35: receiveValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 36: receiveValue((*reinterpret_cast< QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 37;
    }
    return _id;
}
Exemplo n.º 3
0
int main(int argc, char **argv){
	
// Set I2C bus 	
	DEVICE = 2; // /dev/i2c-2 Olinuxino A20 micro, change if other board or i2c port used
	
	/* Read  program options */
	while(1){
		static struct option long_options[]=
		{
			{"verbose", no_argument,	&_DEBUG,	1},
			{"debug",	no_argument,	&_DEBUG,	1},
			
			
			{"relays?",	no_argument,0,'r'},
			{"adc",		required_argument,0,'a'},
			{"id",		no_argument,0,'i'},
			{"getport",		no_argument,0,'g'},
			{"getlat", no_argument,0,'G'},
			{"setrelays",	required_argument,0,'S'},
			{"setoutputs",	required_argument,0,'o'},
			{"settris",	required_argument,0,'t'},
			{"setpullups",	required_argument,0,'p'},
			{"switchon",	required_argument,0,'s'},
			{"switchoff",	required_argument,0,'n'},
			{"firmware",no_argument,0,'f'},
			{"help",	no_argument,0,'h'},
			{"busscan",	no_argument,0,'F'},
			{"setaddress", required_argument,0,'x'},
			{"setfactory",	no_argument,0,'X'},
			{0,		0, 			0,		0}
		};
		int option_index = 0;
		int c = getopt_long(argc, argv, "s:t:a:igGrp:o:S:n:fhx:bX?", long_options, &option_index);
		unsigned int value; 
		if (c == -1)
		{
			break;
		}
		
		switch(c)
		{
			case 'v':
				_DEBUG = 1;
				break;
			case 'h':
				Print_Help();
				break;
				
			case 'S':
				value = atoi(optarg);
				Relay(value);
				break;
			case 's':
				value = atoi(optarg);
				RelayOn(value);
				break;					
			case 'o':
				value = atoi(optarg);
				SetGPIO(value);
				break;	
			case 'n':
				value = atoi(optarg);
				RelayOff(value);
				break;				
			case 'b':
				DEVICE = atoi(optarg);
				break;					
			case 'a':
				value = atoi(optarg);
				ReadADC(value);
				break;
			case 'g':
				
				ReadGPIO();
				break;	
			case 'G':
				
				ReadLAT();
				break;	
			case 'F':
				BusScan();
				break;						
			case 'i':
				
				ReadID();
				break;	
			case 'X':
				Set_Factory();
				break;			
			case 'r':
				ReadRelays();
				break;
			case 't':
				value = atoi(optarg);
				Set_TRIS(value);
				break;
			case 'x':
				value = atoi(optarg);
				Set_Address(value);
				break;						
			case 'p':
				value = atoi(optarg);
				Set_PU(value);
				break;	
			case 'f':
			ReadSV();			
				break;
				
			default:
			
		//	Print_Help();
				break;
		}
	
	}
	
	
		
	return 0;
}