add default setting name
This commit is contained in:
parent
2e65bbf233
commit
4020a2aeac
|
@ -183,7 +183,7 @@ inline void Data::AllocateDataSize(uShort dataSize){
|
|||
printf("dataSize cannot < 1, set dataSize = 1.\n");
|
||||
dataSize = 1;
|
||||
}
|
||||
printf("Data::%s, size: %u\n", __func__, dataSize);
|
||||
//printf("Data::%s, size: %u\n", __func__, dataSize);
|
||||
|
||||
this->dataSize = dataSize;
|
||||
|
||||
|
@ -219,8 +219,6 @@ inline void Data::AllocateDataSize(uShort dataSize){
|
|||
|
||||
inline void Data::ClearDataPointer(){
|
||||
|
||||
printf("Data::%s\n", __func__);
|
||||
|
||||
for(int ch = 0; ch < numInputCh; ch++){
|
||||
delete [] Timestamp[ch] ;
|
||||
delete [] fineTime[ch];
|
||||
|
|
|
@ -1022,6 +1022,8 @@ void Digitizer::SaveSettingToFile(Reg registerAddress, unsigned int value, unsig
|
|||
if ( !isSettingFileExist ) return ;
|
||||
if ( !isSettingFileCoupled ) return;
|
||||
|
||||
printf("Write setting file : %s. %s, ch:%u, 0x%8X\n", settingFileName.c_str(), registerAddress.GetNameChar(), ch, value);
|
||||
|
||||
unsigned short index = registerAddress.Index(ch);
|
||||
setting[index] = value;
|
||||
|
||||
|
|
|
@ -4019,19 +4019,31 @@ void DigiSettingsPanel::SaveSetting(int opt){
|
|||
QDir dir(rawDataPath);
|
||||
if( !dir.exists() ) dir.mkpath(".");
|
||||
|
||||
QString filePath = QFileDialog::getSaveFileName(this, "Save Settings File", rawDataPath, opt == 0 ? "Binary (*.bin)" : "Text file (*.txt)");
|
||||
QString defaultFileName = "Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "_" + QString::fromStdString(digi[ID]->GetData()->DPPTypeStr) + ".bin";
|
||||
|
||||
QString filePath = QFileDialog::getSaveFileName(this,
|
||||
"Save Settings File",
|
||||
rawDataPath,
|
||||
opt == 0 ? "Binary (*.bin)" : "Text file (*.txt)");
|
||||
|
||||
if (!filePath.isEmpty()) {
|
||||
|
||||
QFileDialog dialog;
|
||||
dialog.selectFile(defaultFileName);
|
||||
|
||||
if( dialog.exec() == QDialog::Accepted){
|
||||
|
||||
filePath = dialog.selectedFiles().first();
|
||||
|
||||
QFileInfo fileInfo(filePath);
|
||||
QString ext = fileInfo.suffix();
|
||||
if( opt == 0 ){
|
||||
if( ext == "") filePath += ".bin";
|
||||
if( ext.isEmpty() ) filePath += ".bin";
|
||||
digi[ID]->SaveAllSettingsAsBin(filePath.toStdString().c_str());
|
||||
leSaveFilePath[ID]->setText(filePath);
|
||||
}
|
||||
if( opt == 1 ){
|
||||
if( ext == "") filePath += ".txt";
|
||||
if( ext.isEmpty() ) filePath += ".txt";
|
||||
digi[ID]->SaveAllSettingsAsText(filePath.toStdString().c_str());
|
||||
leSaveFilePath[ID]->setText(filePath + " | not loadable!!");
|
||||
}
|
||||
|
@ -4042,6 +4054,8 @@ void DigiSettingsPanel::SaveSetting(int opt){
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DigiSettingsPanel::LoadSetting(){
|
||||
QFileDialog fileDialog(this);
|
||||
fileDialog.setDirectory(rawDataPath);
|
||||
|
|
|
@ -639,10 +639,11 @@ void Scope::SetUpSpinBox(RSpinBox * &sb, QString str, int row, int col, const Re
|
|||
|
||||
uint32_t value = sb->value() / tick2ns / abs(para.GetPartialStep());
|
||||
|
||||
if( para == DPP::RecordLength_G){
|
||||
int factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1;
|
||||
value = value * factor;
|
||||
}
|
||||
//todo NEED TO CHECK
|
||||
// if( para == DPP::RecordLength_G){
|
||||
// int factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1;
|
||||
// value = value * factor;
|
||||
// }
|
||||
|
||||
if( para == DPP::ChannelDCOffset || para == DPP::QDC::DCOffset){
|
||||
value = uint16_t((1.0 - sb->value()/100.) * 0xFFFF);
|
||||
|
|
Loading…
Reference in New Issue
Block a user