small change
This commit is contained in:
parent
9f7182673e
commit
821c73362b
|
@ -380,6 +380,8 @@ void Digitizer::ReadData(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===========================================================
|
||||||
|
//===========================================================
|
||||||
//===========================================================
|
//===========================================================
|
||||||
void Digitizer::WriteRegister(Reg registerAddress, uint32_t value, int ch, bool isSave2MemAndFile){
|
void Digitizer::WriteRegister(Reg registerAddress, uint32_t value, int ch, bool isSave2MemAndFile){
|
||||||
if( !isConnected ) return;
|
if( !isConnected ) return;
|
||||||
|
@ -458,10 +460,6 @@ void Digitizer::ReadAllSettingsFromBoard(){
|
||||||
isSettingFilledinMemeory = true;
|
isSettingFilledinMemeory = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Digitizer::SetSettingFromMemory(Reg registerAddress, int ch){
|
|
||||||
WriteRegister(registerAddress, GetSettingFromMemory(registerAddress, ch), ch, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Digitizer::ProgramSettingsToBoard(){
|
void Digitizer::ProgramSettingsToBoard(){
|
||||||
if( !isConnected ) return;
|
if( !isConnected ) return;
|
||||||
/// board setting
|
/// board setting
|
||||||
|
@ -590,36 +588,38 @@ void Digitizer::SaveSettingAsText(string fileName){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reg * haha = new Reg();
|
Reg haha;
|
||||||
|
|
||||||
for( unsigned int i = 0; i < SETTINGSIZE ; i++){
|
for( unsigned int i = 0; i < SETTINGSIZE ; i++){
|
||||||
haha->SetName("");
|
haha.SetName("");
|
||||||
uint32_t actualAddress = haha->CalAddress(i);
|
uint32_t actualAddress = haha.CalAddress(i);
|
||||||
|
|
||||||
///printf("%7d--- 0x%04X, 0x%04X\n", i, haha->GetAddress(), haha->ActualAddress());
|
///printf("%7d--- 0x%04X, 0x%04X\n", i, haha->GetAddress(), haha->ActualAddress());
|
||||||
|
|
||||||
/// board setting
|
|
||||||
for( int p = 0; p < (int) RegisterDPPList.size(); p++){
|
for( int p = 0; p < (int) RegisterDPPList.size(); p++){
|
||||||
if( haha->GetAddress() == (uint32_t) RegisterDPPList[p] ) haha->SetName(RegisterDPPList[p].GetName() );
|
if( haha.GetAddress() == (uint32_t) RegisterDPPList[p] ) haha = RegisterDPPList[p];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( DPPType == V1730_DPP_PHA_CODE) {
|
if( DPPType == V1730_DPP_PHA_CODE) {
|
||||||
for( int p = 0; p < (int) RegisterPHAList.size(); p++){
|
for( int p = 0; p < (int) RegisterPHAList.size(); p++){
|
||||||
if( haha->GetAddress() == (uint32_t) RegisterPHAList[p] ) haha->SetName(RegisterPHAList[p].GetName() );
|
if( haha.GetAddress() == (uint32_t) RegisterPHAList[p] ) haha = RegisterPHAList[p];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( DPPType == V1730_DPP_PSD_CODE) {
|
if( DPPType == V1730_DPP_PSD_CODE) {
|
||||||
for( int p = 0; p < (int) RegisterPSDList.size(); p++){
|
for( int p = 0; p < (int) RegisterPSDList.size(); p++){
|
||||||
if( haha->GetAddress() == (uint32_t) RegisterPSDList[p] ) haha->SetName(RegisterPSDList[p].GetName() );
|
if( haha.GetAddress() == (uint32_t) RegisterPSDList[p] ) haha = RegisterPSDList[p];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( haha.GetName() != "" ) {
|
||||||
if( haha->GetName() != "" ) fprintf( txtFile, "0x%04X %35s 0x%08X %d\n", actualAddress, haha->GetNameChar(), setting[i], setting[i]);
|
std::string typeStr ;
|
||||||
|
if( haha.GetType() == RW::ReadWrite ) typeStr = "R/W";
|
||||||
|
if( haha.GetType() == RW::ReadONLY ) typeStr = "R ";
|
||||||
|
if( haha.GetType() == RW::WriteONLY ) typeStr = " W";
|
||||||
|
fprintf( txtFile, "0x%04X %30s 0x%08X %s %d\n", actualAddress,
|
||||||
|
haha.GetNameChar(),
|
||||||
|
setting[i],
|
||||||
|
typeStr.c_str(),
|
||||||
|
setting[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete haha;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Digitizer::ErrorMsg(string header){
|
void Digitizer::ErrorMsg(string header){
|
||||||
|
|
|
@ -114,7 +114,6 @@ class Digitizer{
|
||||||
///================ Setting
|
///================ Setting
|
||||||
/// board <--> memory functions
|
/// board <--> memory functions
|
||||||
void ReadAllSettingsFromBoard ();
|
void ReadAllSettingsFromBoard ();
|
||||||
void SetSettingFromMemory (Reg registerAddress, int ch = -1); /// write to digitizer
|
|
||||||
void ProgramSettingsToBoard ();
|
void ProgramSettingsToBoard ();
|
||||||
|
|
||||||
/// simply read settings from memory
|
/// simply read settings from memory
|
||||||
|
@ -124,12 +123,12 @@ class Digitizer{
|
||||||
unsigned int * GetSetting() {return setting;};
|
unsigned int * GetSetting() {return setting;};
|
||||||
|
|
||||||
/// memory <--> file
|
/// memory <--> file
|
||||||
|
void SaveSettingAsText (string fileName);
|
||||||
string GetSettingFileName() {return settingFileName;}
|
string GetSettingFileName() {return settingFileName;}
|
||||||
void OpenSettingBinary (string fileName); /// Open setting file, if file not exist, call CreateAndSaveSetiingFile, if file exit simple set the settignFileName
|
void OpenSettingBinary (string fileName); /// Open setting file, if file not exist, call CreateAndSaveSetiingFile, if file exit simple set the settignFileName
|
||||||
void LoadSettingBinary (string fileName); /// load settign file to memory, if digitizer connected, program digitizer
|
void LoadSettingBinary (string fileName); /// load settign file to memory, if digitizer connected, program digitizer
|
||||||
void SaveSettingToFile (Reg registerAddress, unsigned int value, int ch = -1);
|
void SaveSettingToFile (Reg registerAddress, unsigned int value, int ch = -1);
|
||||||
unsigned int ReadSettingFromFile (Reg registerAddress, int ch = -1); /// read from setting binary
|
unsigned int ReadSettingFromFile (Reg registerAddress, int ch = -1); /// read from setting binary
|
||||||
void SaveSettingAsText (string fileName);
|
|
||||||
|
|
||||||
///=================== Relic methods
|
///=================== Relic methods
|
||||||
///void SetRecordLength (unsigned int ns, int ch = -1); /// when ch == -1, mean set all channels
|
///void SetRecordLength (unsigned int ns, int ch = -1); /// when ch == -1, mean set all channels
|
||||||
|
|
Loading…
Reference in New Issue
Block a user