SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => Slick-C® Macro Programming => Topic started by: Gary on November 27, 2007, 10:44:03 AM
-
I have made a new approach to open Keil uVision project files which does not require to hack the system macros shipped with SlickEdit which is not recommended according to the SlickCMacroBestPractices.pdf document saying "Modifying macros that ship with SlickEdit - Don't do it! Take your hands away from the keyboard..." ;D
This version is an adaption of the cwprojconv.e macro shipped with SlickEdit 12.0.0.0.
The macro allows to import the folder and files used in a .uv2 file. It does so by parsing the original file and using SlickEdit's API to create the folders and adding the respective source files. Import of tools etc. is not supported yet.
My recommendation is to add the function to the [Project] menu. You can do so by selecting '_mdi_menu' from the [Macro][Menus...]. Add the function 'OpenUvisionProject' to the menu [Project][Open Other Workspace].
This thread shall be used for new versions of this macro only. Please post questions, bugs, feature requests, etc. here: http://community.slickedit.com/index.php?topic=2407
-
Attached you find an updated version with the changes requested by roguebear. Also a thank you to HS2 for the input on executing shell commands from SlickEdit and outputting to the build window.
File Version: 0.9.1
File Changes:
- A project properties section is now created in the .prj file - this enables the functionality of the [Project Properties] window.
- A Slick-C function KeilTranslate has been introduced to perform the translate (compile/assemble) task (this does not support any compile options at the moment
-
Our company only has licences for V10.0, will this macro work with this version?
-
Never mind, it does work ;D
-
the keil has new verison uv4. can sb modify the .e to confit uv2, uv3, uv4 ?
-
the keil has new verison uv4. can sb modify the .e to confit uv2, uv3, uv4 ?
Hi all, I am out of the embedded business so i do not intend to maintain this macro anymore.
uv4 uses an XML project file now - it should not be too complicated to write a new converter - volunteers are welcome ;) roguebear? ;D ;D ;D
-
Luckily SE uses XML (project) files as well. So hopefully the required parsing funtions (e.g. _xmlcfg_*) are already there.
Just a hint.
Good luck, HS2
-
_xmlcfg_.. function cann't get the content between <tag>...</tag>. so I can't convert keil or iar project to slickedit... anyone can help?
-
I thought that's what _xmlcfg_get_value_ does?
-
get_value only can get the attribute value. such as.
<name attribute = "12345">, but can't get the value of <name>12345</name>
-
You're right, _xmlcfg_get_value_ can't get that.
But for completeness here's what _xmlcfg_get_value_ gets, which isn't an attribute; there's a separate function for getting attribute values.
<Field name="Comment">
<Value>
<![CDATA[It can extract this, right here.]]>
</Value>
</Field>
-
_xmlcfg_get_value_ gets ???
I can't find this function. I use slickedit 16.0.0.3. the newest version.
I am crazy for this problem many weeks!!
-
The XMLCFG APIs are for parsing certain kinds of specially formed XML intended for use by SlickEdit for storing configuration settings.
I don't think XMLCFG is designed to be capable of what you're looking for.
-
Have any suggestion about how to get the "12345" between <node>12345</node>??
-
I don't know the bigger picture about what needs to be done. If it's converting a Keil uVision workspace to a SlickEdit workspace, then I'd just write an external program and invoke that.
Slick-C is portable, but it's a macro language, and there are limits to its sophistication.
-
Most people use keil and IAR. can you write a program which can convert keil and IAR project to slickedit.
I think it's maybe a big project. the newest version of keil arm is 4.22a, keil c51 is 9.05 , IAR arm is 6.20.
Need get *.c *.h *.a *.asm or *.cpp file, and include path, even the parameter which can use it debug project directly in slickedit. so I think it takes a long time to make this software perfect.
So i think use slickeedit's macro to write this function maybe the best choice. if i can get the value between <node> </node>, I'll maintain it, upgrade it continuously.
-
Most people use keil and IAR. can you write a program which can convert keil and IAR project to slickedit.
I think it's maybe a big project. the newest version of keil arm is 4.22a, keil c51 is 9.05 , IAR arm is 6.20.
Need get *.c *.h *.a *.asm or *.cpp file, and include path, even the parameter which can use it debug project directly in slickedit. so I think it takes a long time to make this software perfect.
So i think use slickeedit's macro to write this function maybe the best choice. if i can get the value between <node> </node>, I'll maintain it, upgrade it continuously.
How do you know _xmlcfg_get_value doesn't do what you want?
Slickedit's hotfix mechanism uses _xmlcfg_get_value to get the value of the Defect nodes in the function hotfixGetFixDescriptions below. _xmlcfg_get_attribute gets the value of the attribute.
<Defect Ids="12138" Modules="window.e">
List untitled windows in Windows list.
</Defect>
static _str hotfixGetFixDescriptions(int handle)
{
// the text is PCDATA
description := "";
// now get the individual defect descriptions
typeless defects[];
status := _xmlcfg_find_simple_array(handle, "/HotFix/Defect", defects);
if (defects._length() > 0) {
description :+= "<ul>";
foreach (auto node in defects) {
modules := _xmlcfg_get_attribute(handle, node, "Modules");
ids := _xmlcfg_get_attribute(handle, node, "Ids");
if (modules=='') modules="general fix";
description :+= "<li><font color=\"darkred\">":+modules:+"</font> -- ";
text_node := _xmlcfg_get_first_child(handle, node, VSXMLCFG_NODE_PCDATA);
if (text_node > 0) {
_str defect_info = _xmlcfg_get_value(handle, text_node);
description :+= stranslate(defect_info, " ", "[\t\n\r]",'r');
}
description :+= "</li>";
}
description :+= "</ul>";
}
// that's all folks
return description;
}
-
great! It works . thank you very much.
to get the text value, must use.
foreach(auto node ....)
then use _...get_firstchild_...
then....
now, I can go on my works.
-
has uvprojconv.e for uv4 come out? can sb share it? :) :) :)