示例#1
0
	bool TestManager::RunBurnIDC(TestParameters* testParameters) const
	{
		char* pcEnd;
		string sCartridgeNum = GetValue("CartridgeNum", testParameters);
		unsigned char ucCartridgeNum = (unsigned char)strtol(sCartridgeNum.c_str(), &pcEnd, 10);

		unsigned char aucMaterialInfo[MATERIAL_INFO_LENGTH];
		size_t usMaterialInfoLength;
		string sMaterialInfo = GetValue("MaterialInfo", testParameters);
		if (sMaterialInfo.empty())
		{
			MaterialInformation mi;
			string sValue = GetValue("TagStructID", testParameters);
			mi.TagStructID = (TAG_TYPE__STRUCT_ID)strtol(sValue.c_str(), &pcEnd, 10);
			sValue = GetValue("MaterialType", testParameters);
			mi.MaterialType = (TAG_TYPE__MATERIAL_TYPE)strtol(sValue.c_str(), &pcEnd, 10);
			mi.MfgDateTime = (TAG_TYPE__MFG_DATE_TIME)GetUnixTimeValue("MfgDateTime", testParameters);
			string sBatchNo = GetValue("BatchNo", testParameters);
			memcpy(mi.BatchNo, sBatchNo.c_str(), BATCH_NO_SIZE);
			sValue = GetValue("InitialWeight", testParameters);
			mi.InitialWeight = (TAG_TYPE__INITIAL_WEIGHT)strtol(sValue.c_str(), &pcEnd, 10);
			mi.ExpirationDate = (TAG_TYPE__MFG_DATE_TIME)GetUnixTimeValue("ExpirationDate", testParameters);
			usMaterialInfoLength = mi.Encode(aucMaterialInfo);
		}
		else
		{
			ReadFileContent(m_testsFolder, sMaterialInfo, aucMaterialInfo, &usMaterialInfoLength);
		}

		unsigned char aucPrvKS[PRIVATE_KEY_SIZE];
		size_t keySize = sizeof(aucPrvKS);
		string sPrvKS = GetValue("PrvKS", testParameters);
		ReadFileContent(m_testsFolder, sPrvKS, aucPrvKS, &keySize);

		unsigned char aucPubKS[PUBLIC_KEY_SIZE];
		keySize = sizeof(aucPubKS);
		string sPubKS = GetValue("PubKS", testParameters);
		ReadFileContent(m_testsFolder, sPubKS, aucPubKS, &keySize);

		testParameters->Result = materialMonitor->BurnIDC(ucCartridgeNum, aucMaterialInfo, (unsigned short)usMaterialInfoLength, aucPrvKS, aucPubKS);
		if (m_materialInfo[ucCartridgeNum] != NULL)
		{
			delete[] m_materialInfo[ucCartridgeNum];
		}

		if (testParameters->Result == IDTLIB_SUCCESS)
		{
			m_materialInfo[ucCartridgeNum] = new unsigned char[usMaterialInfoLength];
			memcpy(m_materialInfo[ucCartridgeNum], aucMaterialInfo, usMaterialInfoLength);
		}
		else
		{
			m_materialInfo[ucCartridgeNum] = NULL;
		}

		return testParameters->Result == testParameters->ExpectedResult;
	}
void CPropFunction::FillDialog()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));

    SetFileName();
    string buf;
    ReadFileContent(CString(m_ProjectPath) + _T("\\") + m_sFileName, buf);
    m_FunctionText = buf.c_str();
    m_Function = (Function *)ParsePou(m_FunctionText, m_Function);
    InitFromFile(m_Function);
    COperation::FillDialog();
    GetDialog()->SetCreateUser(m_sCreateUser);
    GetDialog()->SetCreateDate(m_sCreateDate);
    GetDialog()->SetLastModUser(m_sLastModUser);
    GetDialog()->SetLastModDate(m_sLastModDate);
    GetDialog()->SetAlias(m_sAlias);
    GetDialog()->SetName(m_sName);
    GetDialog()->SetText1(m_sUsrText[0]);
	GetDialog()->SetText2(m_sUsrText[1]);
	GetDialog()->SetText3(m_sUsrText[2]);
	GetDialog()->SetHelpUrl(m_sHelpUrl);
	GetDialog()->SetUrl(m_sUrl);

    GetDialog()->SetMembers(m_pMembers);
    m_pMembers = NULL;

    GetDialog()->SetReturnType(m_sFunctionType);
}
示例#3
0
	bool TestManager::RunAuthenticateCartridge(TestParameters* testParameters) const
	{
		Logger logger = Logger::getInstance(TESTER_LOGGER_NAME);

		char* pcEnd;
		string sCartridgeNum = GetValue("CartridgeNum", testParameters);
		unsigned char ucCartridgeNum = (unsigned char)strtol(sCartridgeNum.c_str(), &pcEnd, 10);
		if (*pcEnd != 0)
		{
			LOG4CPLUS_ERROR(logger, "Invalid cartridge num (" << sCartridgeNum << ").");
			return false;
		}

		unsigned char* pucPubKS;
		unsigned char aucPubKS[PUBLIC_KEY_SIZE];
		string sPubKS = GetValue("PubKS", testParameters);
		if (sPubKS.empty())
		{
			pucPubKS = NULL;
		}
		else
		{
			size_t keySize = sizeof(aucPubKS);
			ReadFileContent(m_testsFolder, sPubKS, aucPubKS, &keySize);
			pucPubKS = aucPubKS;
		}

		unsigned char cert[CERTIFICATE_SIZE];
		unsigned short certLength;
		memset(cert, 0, CERTIFICATE_SIZE);

		testParameters->Result = materialMonitor->AuthenticateCartridge(ucCartridgeNum, pucPubKS, cert, &certLength, &m_volumes[ucCartridgeNum]);
		return testParameters->Result == testParameters->ExpectedResult;
	}
// ----------------------------------------------------------------------------
MenuItemDataMap_t clKeyboardManager::DoLoadDefaultAccelerators()
// ----------------------------------------------------------------------------
{
    MenuItemDataMap_t entries;
    wxFileName fnDefaultOldSettings(wxStandardPaths::Get().GetTempDir(), _T("keyMnuAccels.conf"));
    wxString personality = Manager::Get()->GetPersonalityManager()->GetPersonality();
    fnDefaultOldSettings.SetName(personality + _T(".") + fnDefaultOldSettings.GetName());

    if(fnDefaultOldSettings.FileExists())
    {
        wxString content;
        if(not ReadFileContent(fnDefaultOldSettings, content)) {
            return entries;
        }
        wxArrayString lines = ::wxStringTokenize(content, _T("\r\n"), wxTOKEN_STRTOK);
        for(size_t i = 0; i < lines.GetCount(); ++i)
        {
            wxArrayString parts = ::wxStringTokenize(lines.Item(i), _T("|"), wxTOKEN_RET_EMPTY);
            //-if(parts.GetCount() < 3) continue; //(pecan 2019/04/27)
            if(parts.GetCount() < 2) continue;
            MenuItemData binding;
            binding.resourceID = parts.Item(0);
            binding.parentMenu = parts.Item(1);
            if (parts.GetCount() > 2)               //(pecan 2019/04/27)
            binding.action = parts.Item(2);
            if(parts.GetCount() == 4) {
                binding.accel = parts.Item(3);
            }
            entries.insert(std::make_pair(binding.resourceID, binding));
        }
    }
    return entries;
}
/**
 * Function name			CInsertResource::ParseConfig
 * Description			
 * @return			void 
 * @exception			
 * @see			
*/
void CInsertResource::ParseConfig()
{
    //test if it's the config file. If not than the Handler was called from the main menu
    //and we have to construct the name of the config file
    CString SourceFile(m_sSourceFile); 
    if(GetExtentionFromFileName(SourceFile) != _T(".con"))
    {
        SAFEARRAY* parrFileNames;
	
        CComBSTR sClassType = _T("CONFIGURATION");
        HRESULT hRes = m_pICEProjectInfo->getClassesOfType(sClassType, &parrFileNames);
    
        BSTR HUGEP *pbstr;

        // Get a pointer to the elements of the array.
        hRes = ::SafeArrayAccessData(parrFileNames, (void HUGEP**)&pbstr);
        if (hRes==S_OK)
        {
            ASSERT((parrFileNames->rgsabound[0]).cElements>0);
            if ((parrFileNames->rgsabound[0]).cElements>0)
            {
                SourceFile = pbstr[0];
            }
        }

        ::SafeArrayUnaccessData(parrFileNames);
        ::SafeArrayDestroy(parrFileNames);
    }

    ReadFileContent(CString(m_ProjectPath) + _T("\\") + SourceFile, 
                    m_ConfigText);
    ASSERT(m_ConfigText.length() != 0);
    ASSERT(m_Config == NULL);
    parse_string(m_ConfigText, &m_Config);
}
void FileUtils::OSXOpenDebuggerTerminalAndGetTTY(const wxString& path, wxString& tty, long& pid)
{
    tty.Clear();
    wxString command;
    wxString tmpfile;
    wxString escapedPath = path;
    if(escapedPath.Contains(" ")) {
        escapedPath.Prepend("\"").Append("\"");
    }
    tmpfile << "/tmp/terminal.tty." << ::wxGetProcessId();
    command << "osascript -e 'tell app \"Terminal\" to do script \"tty > " << tmpfile << " && clear && sleep 12345\"'";
    CL_DEBUG("Executing: %s", command);
    long res = ::wxExecute(command);
    if(res == 0) {
        CL_WARNING("Failed to execute command:\n%s", command);
        return;
    }

    // Read the tty from the file, wait for it up to 10 seconds
    wxFileName ttyFile(tmpfile);
    pid = wxNOT_FOUND;
    for(size_t i = 0; i < 10; ++i) {
        if(!ttyFile.Exists()) {
            ::wxSleep(1);
            continue;
        }
        ReadFileContent(ttyFile, tty);
        tty.Trim().Trim(false);

        // Remove the file
        wxLogNull noLog;
        ::wxRemoveFile(ttyFile.GetFullPath());

        // Get the parent process ID (we want the parent PID and not
        // the sleep command PID)
        wxString psCommand;
        psCommand << "ps -A -o ppid,command";
        wxString psOutput = ProcUtils::SafeExecuteCommand(psCommand);
        CL_DEBUG("PS output:\n%s\n", psOutput);
        wxArrayString lines = ::wxStringTokenize(psOutput, "\n", wxTOKEN_STRTOK);
        for(size_t u = 0; u < lines.GetCount(); ++u) {
            wxString l = lines.Item(u);
            l.Trim().Trim(false);
            if(l.Contains("sleep") && l.Contains("12345")) {
                // we got a match
                CL_DEBUG("Got a match!");
                wxString ppidString = l.BeforeFirst(' ');
                ppidString.ToCLong(&pid);
                break;
            }
        }
        break;
    }
    CL_DEBUG("PID is: %d\n", (int)pid);
    CL_DEBUG("TTY is: %s\n", tty);
}
示例#7
0
	bool TestManager::RunInPlaceStatusModified(TestParameters* testParameters) const
	{
		int returnValue, origStatus, diffStatus;
		do
		{
			origStatus = *m_status;
			returnValue = materialMonitor->GetInPlaceStatus(m_status);
			diffStatus = origStatus ^ *m_status;
			CPSleep(1000);
		} while (
			(returnValue == IDTLIB_SUCCESS) &&
			(diffStatus == 0) &&
			!m_bStop);

		testParameters->Result = IDTLIB_SUCCESS;
		for (unsigned char ucCartridgeNum = 0; ucCartridgeNum < IDT_COUNT; ucCartridgeNum++)
		{
			if ((diffStatus & (1 << ucCartridgeNum)) == 0)
			{
				continue;
			}

			int result;
			if ((*m_status & (1 << ucCartridgeNum)) == 0)
			{
				result = materialMonitor->RemoveCartridge(ucCartridgeNum);
			}
			else
			{
				unsigned char aucIdd[CERTIFICATE_SIZE];
				unsigned short usIddLength;
				unsigned int currentVolume;
				unsigned char* pucPubKS;
				unsigned char aucPubKS[PUBLIC_KEY_SIZE];
				string sPubKS = GetValue("PubKS", testParameters);
				if (sPubKS.empty())
				{
					pucPubKS = NULL;
				}
				else
				{
					size_t keySize = sizeof(aucPubKS);
					ReadFileContent(m_testsFolder, sPubKS, aucPubKS, &keySize);
					pucPubKS = aucPubKS;
				}
				result = materialMonitor->AuthenticateCartridge(ucCartridgeNum, pucPubKS, aucIdd, &usIddLength, &currentVolume);
			}

			if (result != IDTLIB_SUCCESS)
			{
				testParameters->Result = result;
			}
		}

		return testParameters->Result == testParameters->ExpectedResult;
	}
示例#8
0
int ReadObjMeta(ObjStoreContext* pContext, uint64_t objid, ObjMeta* pMeta)
{
	uint8_t utf8Path[257] = { 0 };
	GetObjMetaPath(pContext, objid, utf8Path);
	FILE* pf = fopen(utf8Path, "rb");
	if (pf)
	{
		uint64_t bufferlen = 257 + 4 + 16;
		uint8_t metabuffer[257 + 4 + 16] = { 0 };
		
		int readlen = ReadFileContent(pf, metabuffer, &bufferlen);//#MetaFile 够小就是原子操作
		fclose(pf);

		uint64_t* plist = (uint64_t*)metabuffer;
		pMeta->objid = plist[0];
		pMeta->datalen = plist[1];
		uint32_t* pread = (uint32_t*)(metabuffer + 2 * sizeof(uint64_t));
		strncpy(utf8Path, metabuffer + 2 * sizeof(uint64_t) + sizeof(uint32_t), pread[0]);
		FILE* pfPageList = fopen(utf8Path, "rb");
		if (pfPageList)
		{
			uint64_t pageBufferLen = 4 + 8 * (pMeta->datalen / pContext->pagesize) + 8;
			uint8_t* pagebuffer = malloc(pageBufferLen);
			readlen = ReadFileContent(pfPageList, pagebuffer, &pageBufferLen);
			fclose(pfPageList);

			ReadPageListFromData(pContext, pagebuffer, &(pMeta->dataPage));
			free(pagebuffer);

			return 0;//成功
		}
		else
		{
			printf("read page list error\n");
		}
	}
	else
	{
		printf("read meta error\n");
	}

	return -1;
}
/**
 * Function name			CInsertConstant::ParseConstFile
 * Description			
 * @return			void 
 * @exception			
 * @see			
*/
void CInsertConstant::ParseConstFile()
{
    ReadFileContent(CString(m_ProjectPath) + _T("\\") + CString(m_sFileName), 
                    m_ConstFileText);

    if(m_pConstList) {
        delete m_pConstList;
        m_pConstList = NULL;
    }
    parse_string(m_ConstFileText, &m_pConstList);
}
示例#10
0
int ReadObjData(ObjStoreContext* pContext, uint64_t objid, uint8_t* pOutput, uint64_t* pDataLen)
{
	ObjMeta theMeta;
	theMeta.dataPage.pPageArray = NULL;
	int result = -1;
	if (ReadObjMeta(pContext, objid, &theMeta) == 0)
	{
		if (*pDataLen < theMeta.datalen)
		{
			*pDataLen = theMeta.datalen;
			return result;
		}

		int i = 0;
		int readlen = 0;
		uint64_t datalen = theMeta.datalen;
		uint8_t utf8path[257] = { 0 };
		uint8_t* pWritePos = pOutput;
		for (i = 0; i < theMeta.dataPage.listSize; ++i)
		{
			GetPagePath(pContext, theMeta.dataPage.pPageArray[i], utf8path);
			FILE* pf = fopen(utf8path, "rb");
			if (pf)
			{
				uint64_t readlen = datalen + sizeof(uint64_t);
				ReadFileContent(pf, pWritePos, &readlen);
				readlen -= sizeof(uint64_t);
				memcpy(pWritePos, pWritePos + sizeof(uint64_t), readlen);
				pWritePos += readlen;
				datalen -= readlen;
			}
			else
			{
				printf("read page error\n");
				return result;
			}
		}

		*pDataLen = theMeta.datalen;
		result = 0;
	}

	if (theMeta.dataPage.pPageArray)
	{
		free(theMeta.dataPage.pPageArray);
	}

	return result;
}
/**
 * Function name			CDeleteGvlImport::ParseResource
 * Description		Parses the resource	
 * @return			successful?
 * @exception			
 * @see             parse_string, ReadFileContent			
*/
BOOL CDeleteGvlImport::ParseResource()
{
    string buf;
    ReadFileContent(CString(m_ProjectPath) + _T("\\") + CString(m_sFileName), 
                    buf);
    if(m_Resource)
    {
        delete m_Resource;
        m_Resource = NULL;
    }

    parse_string(buf, &m_Resource);
    m_ResourceText = buf.c_str();
    if(m_Resource)
    {
        return TRUE;
    }
    return FALSE;
}
void CPropTask::FillDialog()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));

    SetFileName();
    string buf;
    ReadFileContent(CString(m_ProjectPath) + _T("\\") + m_sFileName, buf);
    m_ResourceText = buf.c_str();
    m_sName = GetNameFromId();
    ASSERT(!m_ResourceText.IsEmpty());
    m_Resource = (Resource *)ParsePou(m_ResourceText, m_Resource);
    InitFromFile(m_Resource);
    if(!m_bAutomationMode)
    {
        COperation::FillDialog();
        GetDialog()->SetCreateUser(m_sCreateUser);
        GetDialog()->SetCreateDate(m_sCreateDate);
        GetDialog()->SetLastModUser(m_sLastModUser);
        GetDialog()->SetLastModDate(m_sLastModDate);
        GetDialog()->SetAlias(m_sAlias);
        GetDialog()->SetName(m_sName);
        GetDialog()->SetText1(m_sUsrText[0]);
	    GetDialog()->SetText2(m_sUsrText[1]);
	    GetDialog()->SetText3(m_sUsrText[2]);
	    GetDialog()->SetHelpUrl(m_sHelpUrl);
	    GetDialog()->SetUrl(m_sUrl);
        BOOL bAutoStart = IsAutoStart();
        GetDialog()->SetAutoStart(bAutoStart);
		GetDialog()->SetLoaded(IsLoaded());		// NFTASKHANDLING 19.05.05 SIS
        GetDialog()->SetInterval(m_sInterval);
        GetDialog()->SetIoSync(m_sIOSync);
        GetDialog()->SetPriority(m_sPriority);
        GetDialog()->SetEventString(m_sEvent);
        GetDialog()->SetWatchdog(m_sWatchdog);
    }
}
示例#13
0
void FileUtils::OSXOpenDebuggerTerminalAndGetTTY(const wxString& path, const wxString& appname, wxString& tty,
                                                 long& pid)
{
    tty.Clear();
    wxString command;
    wxString tmpfile;
    tmpfile << "/tmp/terminal.tty." << ::wxGetProcessId();
    wxFileName helperScript("/tmp", "codelite-lldb-helper.sh");
    wxString fileContent;
    fileContent << "#!/bin/bash\n";
    fileContent << "tty > " << tmpfile << "\n";
    fileContent << "sleep 12345";
    FileUtils::WriteFileContent(helperScript, fileContent);
    int rc = system("chmod +x /tmp/codelite-lldb-helper.sh");
    wxUnusedVar(rc);

    command << "/usr/bin/open -a " << appname << " /tmp/codelite-lldb-helper.sh";
    clDEBUG() << "Executing: " << command;
    long res = ::wxExecute(command);
    if(res == 0) {
        clWARNING() << "Failed to execute command:" << command;
        return;
    }

    // Read the tty from the file, wait for it up to 10 seconds
    wxFileName ttyFile(tmpfile);
    pid = wxNOT_FOUND;
    for(size_t i = 0; i < 10; ++i) {
        if(!ttyFile.Exists()) {
            ::wxSleep(1);
            continue;
        }
        ReadFileContent(ttyFile, tty);
        tty.Trim().Trim(false);

        // Remove the file
        clRemoveFile(ttyFile.GetFullPath());

        // Get the parent process ID (we want the parent PID and not
        // the sleep command PID)
        wxString psCommand;
        psCommand << "ps -A -o ppid,command";
        wxString psOutput = ProcUtils::SafeExecuteCommand(psCommand);
        clDEBUG() << "ps command output:\n" << psOutput;
        wxArrayString lines = ::wxStringTokenize(psOutput, "\n", wxTOKEN_STRTOK);
        for(size_t u = 0; u < lines.GetCount(); ++u) {
            wxString l = lines.Item(u);
            l.Trim().Trim(false);
            if(l.Contains("sleep") && l.Contains("12345")) {
                // we got a match
                clDEBUG() << "Got a match!";
                wxString ppidString = l.BeforeFirst(' ');
                ppidString.ToCLong(&pid);
                break;
            }
        }
        break;
    }
    clDEBUG() << "PID is:" << pid;
    clDEBUG() << "TTY is:" << tty;
}
// ----------------------------------------------------------------------------
void clKeyboardManager::Initialize(bool isRefreshRequest)
// ----------------------------------------------------------------------------
{
    wxUnusedVar(isRefreshRequest);
    m_menuTable.clear();

    // First, try to load accelerators from %appdata% keybindings.conf
    //      containing merged default + user defined accerators
    // Second, try loading from default accerators in %appdata% + accerators.conf

    clKeyboardBindingConfig config;
    if( not config.Exists()) //does keybindings.conf exist?
    {
        #if defined(LOGGING)
        LOGIT( _T("[%s]"), _("Keyboard manager: No configuration found - importing old settings"));
        #endif
        //CL_DEBUG("Keyboard manager: No configuration found - importing old settings");
        // Decide which file we want to load, take the user settings file first
        // GetUserDataDir() == "c:\Users\<username>\AppData\Roaming\<appname>\config\keybindings.conf"
        // GetDataDir()     == executable directory

        // Old accererator setting are in %appdata%
        wxFileName fnOldSettings(wxStandardPaths::Get().GetTempDir(), _T("keyMnuAccels.conf"));
        wxString personality = Manager::Get()->GetPersonalityManager()->GetPersonality();
        fnOldSettings.SetName(personality + _T(".") + fnOldSettings.GetName());

        wxFileName fnFileToLoad;
        bool canDeleteOldSettings(false);
        // If %appdata% accerators.conf exist, use it
        if(fnOldSettings.FileExists())
        {
            fnFileToLoad = fnOldSettings;
            //-canDeleteOldSettings = true;
        }
        else    // else use executable dir accerators.conf.default accerators
        {
            //-fnFileToLoad = fnDefaultOldSettings;
            wxASSERT_MSG(0, _("clKeyboardManager::Initialize() missing accerators.conf file"));
        }

        if(fnFileToLoad.FileExists())
        {
            #if defined(LOGGING)
            LOGIT( _T("KeyboardManager:Importing settings from:\n\t[%s]"), fnFileToLoad.GetFullPath().wx_str());
            #endif
            // Apply the old settings to the menus
            wxString content;
            if(not ReadFileContent(fnFileToLoad, content)) return;
            wxArrayString lines = ::wxStringTokenize(content, _T("\r\n"), wxTOKEN_STRTOK);
            for(size_t i = 0; i < lines.GetCount(); ++i)
            {
                #if defined(LOGGING)
                    #if wxVERSION_NUMBER > 3000
                    LOGIT( _T("AccelFile[%u:%s]"), (unsigned)i, lines.Item(i).wx_str() );
                    #else
                    LOGIT( _T("AccelFile[%u:%s]"), i, lines.Item(i).wx_str() );
                    #endif
                #endif
                wxArrayString parts = ::wxStringTokenize(lines.Item(i), _T("|"), wxTOKEN_RET_EMPTY);
                if(parts.GetCount() < 3) continue;
                MenuItemData binding;
                binding.resourceID = parts.Item(0);
                binding.parentMenu = parts.Item(1);
                binding.action = parts.Item(2);
                if(parts.GetCount() == 4) {
                    binding.accel = parts.Item(3);
                }
                m_menuTable.insert(std::make_pair(binding.resourceID, binding));
            }

            if(canDeleteOldSettings) {
                if (fnFileToLoad.FileExists())
                    ::wxRemoveFile(fnFileToLoad.GetFullPath());
            }
        }
    }
    else //config exists: "keybindings.conf"
    {
        config.Load();
        m_menuTable = config.GetBindings();
    }

    // Load the default settings and add any new entries from accerators.conf
    MenuItemDataMap_t defaultEntries = DoLoadDefaultAccelerators();

    // Remove any map items nolonger matching the menu structure
    for (MenuItemDataMap_t::iterator mapIter = m_menuTable.begin(); mapIter != m_menuTable.end(); ++mapIter)
    {
        mnuContinue:
        if (mapIter == m_menuTable.end()) break;
        //search menu structure map for map menuId
        if ( defaultEntries.count(mapIter->first) == 0)
        {   // menuID nolonger exists
            #if defined(LOGGING)
                wxString mapAccel = mapIter->second.accel;
                wxString mapParent = mapIter->second.parentMenu;
                wxString mapMnuID = mapIter->first;
                LOGIT( _T("Removing ID mismatch[%s][%s][%s]"), mapMnuID.wx_str(), mapParent.wx_str(), mapAccel.wx_str());
            #endif
            mapIter = m_menuTable.erase(mapIter);
            goto mnuContinue;
        }
        else //remove the found map item if its label doesn't match menu structure label//(pecan 2019/05/18)
        {   // Have matching map resoureID and menu structure resourceID (ie., menuItemID)
            MenuItemDataMap_t::iterator mnuIter = defaultEntries.find(mapIter->first);
            if (mnuIter == defaultEntries.end())
                continue;
            wxString mapParent = mapIter->second.parentMenu;
            if (mapParent.empty()) continue; //skip global accelerators
            wxString mnuParent = mnuIter->second.parentMenu;
            if (mnuParent.empty()) continue; //skip global accelerators
            if (mapParent.Lower() != mnuParent.Lower())
            {
                #if defined(LOGGING)
                    wxString mapMnuID = mapIter->first;
                    wxString mapAccel = mapIter->second.accel;
                    LOGIT( _T("Removing LabelMismatch[%s][%s][%s]"), mapMnuID.wx_str(), mapParent.wx_str(), mapAccel.wx_str());
                #endif
                mapIter = m_menuTable.erase(mapIter);
                goto mnuContinue;
            }//endif label compare
        }//endif else have matching resourceID
    }//endfor mapIter

    // Add any new entries from accerators.conf (the menu structure)
    std::for_each(defaultEntries.begin(), defaultEntries.end(), [&](const MenuItemDataMap_t::value_type& vdflt)
    {
        //-wxString vtValue = vdflt.first;         //The menu id number
        if(m_menuTable.count(vdflt.first) == 0) {  //searches map for like shortcut string
            m_menuTable.insert(vdflt);
        }
        // ----------------------------------------------------------------------------
        // NO!no! don't overwrite past user changes; m_menuTable already has user keybinder.conf changes.
        // while defaultEntries have original CodeBlocks menu accelerators
        // User must make (or made) m_menuTable changes via KeyBinder configuration dialog.
        // ----------------------------------------------------------------------------
        //-else //verify keyboard shortcut
        //-{
        //-    MenuItemDataMap_t::iterator mapIter = m_menuTable.find(vdflt.first);
        //-    if (mapIter != m_menuTable.end()) //should never be true!
        //-    if (mapIter->second.accel != vdflt.second.accel)
        //-    {
        //-        #if defined(LOGGING)
        //-        wxString mapMenuItem = mapIter->second.parentMenu + mapIter->second.accel;
        //-        wxString vdfltMenuItem = vdflt.second.parentMenu +vdflt.second.accel;
        //-        LOGIT( _T("Initialize changing accel[%s]to[%s]"), mapMenuItem.wx_str(), vdfltMenuItem.wx_str());
        //-        #endif
        //-        mapIter->second.accel = vdflt.second.accel;
        //-    }
        //-}
    });

    // Warn about duplicate shortcut entries (eg., (Print/PrevCallTip Ctrl-P) and (CC Search/Ctrl-Shift-.) have duplicates) //(2019/04/23)
    CheckForDuplicateAccels(m_menuTable);

    // Store the correct configuration; globalTable is inserted into menuTable
    config.SetBindings(m_menuTable, m_globalTable).Save();

    // And apply the changes
    Update();
}