Traduction
Maxime_86
Messages postés
42
Statut
Membre
-
Maxime_86 Messages postés 42 Statut Membre -
Maxime_86 Messages postés 42 Statut Membre -
Bonjour,
Est ce que quelqu'un pourrait-il m'aider à traduire ce programme qui est en langage C, pour que je puisse en faire un autre sur labview. Merci d'avance.
while(nb_bin<of) //the RIS acquisition is done when all bins have benn filled
{
status = Acquire(InstrumentID[InstrIdx]);
if (status) return status;
status = AcqrsD1_readData( InstrumentID[InstrIdx],
channel,
&readPar,
waveformArray,
&descriptor,
&segDesc);
nb_iter++;
index = int(fabs(segDesc.horPos) * of / si); // bin index
//horPos in range check (oa mode only)
if ((oa < 100)&&
((segDesc.horPos < ris_data[index].lower_bin) ||
(segDesc.horPos > ris_data[index].upper_bin)))
{
skipped++;
continue; // next acquisition
}
// check if a valid horPos value is already set for this bin
if(ris_data[index].horPos > 0.0)
{
// yes, compare it with the current horPos to known which one
// is the more centered
if(fabs(ris_data[index].c_bin - segDesc.horPos)>
fabs(ris_data[index].c_bin - ris_data[index].horPos))
continue; // next acquisition
}
else
nb_bin++;
// Set the horPos and the waveform for this bin
ris_data[index].horpos = segDesc.horPos;
memcpy(ris_data[index].waveformArray, buffer_size);
}
Est ce que quelqu'un pourrait-il m'aider à traduire ce programme qui est en langage C, pour que je puisse en faire un autre sur labview. Merci d'avance.
while(nb_bin<of) //the RIS acquisition is done when all bins have benn filled
{
status = Acquire(InstrumentID[InstrIdx]);
if (status) return status;
status = AcqrsD1_readData( InstrumentID[InstrIdx],
channel,
&readPar,
waveformArray,
&descriptor,
&segDesc);
nb_iter++;
index = int(fabs(segDesc.horPos) * of / si); // bin index
//horPos in range check (oa mode only)
if ((oa < 100)&&
((segDesc.horPos < ris_data[index].lower_bin) ||
(segDesc.horPos > ris_data[index].upper_bin)))
{
skipped++;
continue; // next acquisition
}
// check if a valid horPos value is already set for this bin
if(ris_data[index].horPos > 0.0)
{
// yes, compare it with the current horPos to known which one
// is the more centered
if(fabs(ris_data[index].c_bin - segDesc.horPos)>
fabs(ris_data[index].c_bin - ris_data[index].horPos))
continue; // next acquisition
}
else
nb_bin++;
// Set the horPos and the waveform for this bin
ris_data[index].horpos = segDesc.horPos;
memcpy(ris_data[index].waveformArray, buffer_size);
}
2 réponses
-
Ca va etre compliqué sans avoir aucune déclaration de variable ou de fonctions dans le code.
C'est comme si je te demandais ce que fait :
Hup.dec = deco(val1,val2,&err); -
oui, je comprends ce que vous dites, mais je vous assure je n'fais aucun secret mon bosse m'a donnée ce code, et m'a demandé de le transformer en labview c'est tout mais bon puisque c'est impossible...