请选择 进入手机版 | 继续访问电脑版

DIY编程器网

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 3321|回复: 3

[UUProg] uuprog开发教程:芯片支持库维护6

[复制链接]
发表于 2014-12-29 08:20:51 | 显示全部楼层 |阅读模式
芯片参数修改和添加差不多,只是修改后点一下修改按钮而已。测试没问题后都得点保存才能将支持库的信息修改。
这里图就不贴了,不清楚就看前一帖。下面是实现代码:
  1. void CProgDeviceManage::OnDeviceModify()
  2. {
  3.         // TODO: Add your control notification handler code here
  4.         CString temp;
  5.         ZeroMemory(&m_stDFile, sizeof(DeviceListFileStruct));
  6. //        ZeroMemory(&m_stDFileHead, sizeof(DeviceListFileHeadStruct));

  7.         UpdateData(true);
  8.         //device name
  9.         if (m_sDeviceName.IsEmpty())
  10.         {
  11.                 AfxMessageBox("芯片名称不能为空");
  12.                 return;
  13.         }
  14.         strcpy(m_stDFile.DeviceName,m_sDeviceName);
  15.         //Device Type
  16.         m_cDeviceType.GetWindowText(temp);
  17.         if (temp.IsEmpty())
  18.         {
  19.                 AfxMessageBox("芯片类型不能为空");
  20.                 return;
  21.         }

  22.         int index;
  23.         CString tname;
  24. //        m_cDeviceType.GetWindowText(temp);
  25.         for (int i=0; i<parent->m_arTypeList.GetSize(); i++)
  26.         {
  27.                 tname = parent->m_arTypeList.GetAt(i).TypeName;
  28.                 if (temp == tname)
  29.                         index = i;
  30.         }
  31.         m_stDFile.DeviceType = parent->m_arTypeList.GetAt(index).TypeVal;

  32. //        if (temp == "EPROM") m_stDFileHead.EpromCount += 1;
  33. //        if (temp == "PROM") m_stDFileHead.PromCount += 1;
  34. //        if (temp == "MPU") m_stDFileHead.MPUCount += 1;
  35. //        if (temp == "PLD") m_stDFileHead.PLDCount += 1;

  36.         m_stDFile.DeviceManuID = (DWORD)strtoul(m_sDeviceManuID, NULL, 16);
  37.         m_stDFile.DeviceID = (DWORD)strtoul(m_sDeviceID, NULL, 16);
  38.         m_stDFile.DeviceCheckCRC = (DWORD)strtoul(m_sDeviceCheckCRC, NULL, 16);
  39.         
  40.         m_cOperationID.GetWindowText(temp);
  41.         for (i=0; i<parent->m_arOperationList.GetSize(); i++)
  42.         {
  43.                 tname = parent->m_arOperationList.GetAt(i).TypeName;
  44.                 if (temp == tname)
  45.                         index = i;
  46.         }
  47.         m_stDFile.OperationID = parent->m_arOperationList.GetAt(index).TypeVal;

  48.         if (m_sDeviceManuName.IsEmpty())
  49.         {
  50.                 AfxMessageBox("厂家名称不能为空");
  51.                 return;
  52.         }
  53.         strcpy(m_stDFile.DeviceManuName,m_sDeviceManuName);

  54.         m_cDeviceSize.GetWindowText(temp);
  55.         for (i=0; i<parent->m_arSizeList.GetSize(); i++)
  56.         {
  57.                 tname = parent->m_arSizeList.GetAt(i).TypeName;
  58.                 if (temp == tname)
  59.                         index = i;
  60.         }
  61.         m_stDFile.DeviceSize = parent->m_arSizeList.GetAt(index).TypeVal;

  62.         m_cDeviceDataWidth.GetWindowText(temp);
  63.         for (i=0; i<parent->m_arDataWidthList.GetSize(); i++)
  64.         {
  65.                 tname = parent->m_arDataWidthList.GetAt(i).TypeName;
  66.                 if (temp == tname)
  67.                         index = i;
  68.         }
  69.         m_stDFile.DeviceDataWidth = parent->m_arDataWidthList.GetAt(index).TypeVal;

  70.         m_cDevicePackage.GetWindowText(temp);
  71.         for (i=0; i<parent->m_arPackageList.GetSize(); i++)
  72.         {
  73.                 tname = parent->m_arPackageList.GetAt(i).TypeName;
  74.                 if (temp == tname)
  75.                         index = i;
  76.         }
  77.         m_stDFile.DevicePackage = parent->m_arPackageList.GetAt(index).TypeVal;

  78.         m_cDevicePinCount.GetWindowText(temp);
  79.         for (i=0; i<parent->m_arPinList.GetSize(); i++)
  80.         {
  81.                 tname = parent->m_arPinList.GetAt(i).TypeName;
  82.                 if (temp == tname)
  83.                         index = i;
  84.         }
  85.         m_stDFile.DevicePinCount = parent->m_arPinList.GetAt(index).TypeVal;

  86.         m_cDeviceVCC.GetWindowText(temp);
  87.         for (i=0; i<parent->m_arVCCList.GetSize(); i++)
  88.         {
  89.                 tname = parent->m_arVCCList.GetAt(i).TypeName;
  90.                 if (temp == tname)
  91.                         index = i;
  92.         }
  93.         m_stDFile.DeviceVCC = parent->m_arVCCList.GetAt(index).TypeVal;

  94.         m_cDeviceVPP.GetWindowText(temp);
  95.         for (i=0; i<parent->m_arVPPList.GetSize(); i++)
  96.         {
  97.                 tname = parent->m_arVPPList.GetAt(i).TypeName;
  98.                 if (temp == tname)
  99.                         index = i;
  100.         }
  101.         m_stDFile.DeviceVPP = parent->m_arVPPList.GetAt(index).TypeVal;

  102.         m_cDeviceAdapter.GetWindowText(temp);
  103.         for (i=0; i<parent->m_arAdapterList.GetSize(); i++)
  104.         {
  105.                 tname = parent->m_arAdapterList.GetAt(i).TypeName;
  106.                 if (temp == tname)
  107.                         index = i;
  108.         }
  109.         m_stDFile.DeviceAdapter = parent->m_arAdapterList.GetAt(index).TypeVal;
  110.         strcpy(m_stDFile.Datasheet,m_sDeviceDatasheet);
  111.         strcpy(m_stDFile.DeviceManuICO,m_sDeviceManuICO);
  112.         strcpy(m_stDFile.DeviceICICO,m_sDeviceICICO);
  113.         strcpy(m_stDFile.DeviceNote,m_sDeviceNote);

  114.         int iDeviceSel;
  115.         m_cDeviceList.GetText(m_cDeviceList.GetCurSel(),temp);
  116.         for (i=0; i<parent->m_arDeviceList.GetSize(); i++)
  117.         {
  118.                 if(temp == parent->m_arDeviceList.GetAt(i).DeviceName)
  119.                         iDeviceSel = i;
  120.         }
  121.         parent->m_arDeviceList.SetAt(iDeviceSel,m_stDFile);
  122.                 AfxMessageBox("芯片信息已修改");
  123.         
  124. }
复制代码
还是那句话,跟一下就明白了。


发表于 2014-12-29 09:05:22 | 显示全部楼层
现在可以刷芯片的吗
 楼主| 发表于 2014-12-29 09:11:27 | 显示全部楼层
快乐之星 发表于 2014-12-29 09:05
现在可以刷芯片的吗

还没开放这个功能呢,请继续关注更新
发表于 2018-12-27 22:00:03 | 显示全部楼层
谢谢分享银子不够支持
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|文字版|手机版|DIY编程器网 ( 桂ICP备14005565号-1 )

GMT+8, 2024-3-19 19:27 , 耗时 0.095096 秒, 22 个查询请求 , Gzip 开启.

各位嘉宾言论仅代表个人观点,非属DIY编程器网立场。

桂公网安备 45031202000115号

DIY编程器群(超员):41210778 DIY编程器

DIY编程器群1(满员):3044634 DIY编程器1

diy编程器群2:551025008 diy编程器群2

QQ:28000622;Email:libyoufer@sina.com

本站由桂林市临桂区技兴电子商务经营部独家赞助。旨在技术交流,请自觉遵守国家法律法规,一旦发现将做封号删号处理。

快速回复 返回顶部 返回列表