jtbo
Registered
Update at bottom of post, now it is possible to test and contribute to project.
Here is small preview from one of my projects, currently bit over 60 hours has gone to it as I really had no skills in programming for this kind of project so every thing in it has been wall to be climbed, however while doing it I have learned already great deal about programming which was actually main purpose why I did start such project.
This is done in Visual C# 2008 express.
v0.2a win32 binary setup download with Save function (zip, 216kb):
https://github.com/downloads/JTbo/JTbo_Tools/TGM_editor_0.2alpha.zip
Extract to temp folder, run setup.exe.
v0.2a source download (zip, 296kb):
https://github.com/downloads/JTbo/JTbo_Tools/TgmEditor_v0.2a.zip
View attachment 4683
It is quite ugly at the moment because I have had not much plans for UI as of yet. (also my color scheme in windows is not very pretty, but it saves my old eyes) However I would like to create dots representing nodes to left side of boxes. Those boxes are actually generated by the code, so if you have more nodes there is more of them and if you have less nodes there are less of them, currently having more than 32 nodes will probably crash the tool or do some weird things, there is not much of fail safes or anything robust in it right now.
This is roughly how it works as of now.
From open button one can open tgm file and program reads the file, parses values to array and creates text boxes with values in them. Also program outputs read lines to bottom box.
Catch here is that only values from node 0 to node containing center of tire are read, rest are then generated. Reason for this is that I have only symmetric tires to work with and I certainly don't like typing same values over and over again, so program calculates those.
Next I will do code for generate button, I have planned it so that it should read text boxes and generate other side of tire, then output everything to bottom text box, so I can actually use tool for something and copy paste those lines to tgm file.
There is also save button, it does nothing at the moment, but I want it to be able to write lines into tgm file, however it is not yet quite clear for me how to achieve this. Currently I plan to test same parsing code as when reading to find location and write line there, but I'm not too sure if that is going to work at least easily.
I have very little experience and 0 education in coding, I just do tutorials what I find from net, try to code something and when not be able to figure out what to do I search from the net, slowly I learn then.
When I get it to somehow working stage, I plan to put it up to github or similar as it is going to be open source as that is my way, then anyone is of course welcome to improve it.
For those using Notepad++ my regex parameters might be useful or then not, I have not had time to test how well they would work in Notepad++.
To find lines to read I use this: @"Geometry=\(*"
1st param @"\-?\d{1}\.?[0-9]*"
2nd param @"\,\-\d{1}\.[0-9]*\,"
3rd param @"\,\d{1}\.[0-9]*\)"
Then I clean up 2nd param with "\\,", ""
And cleaning up 3rd param I use two as I could not figure out how to get one to clean both comma and bracket
"\\)", ""
"\\,", ""
Cleaning up in C# is possible Regex.Replace.
Here is some link to Notepad++ RegEx stuff that I have not read, but which might be useful for those wanting to know more about that.
http://markantoniou.blogspot.fi/2008/06/notepad-how-to-use-regular-expressions.html
Might not be the most useful tool of course, but for me at least nice byproduct from learning programming
INSTRUCTIONS and stuff you need to know:
Here is small preview from one of my projects, currently bit over 60 hours has gone to it as I really had no skills in programming for this kind of project so every thing in it has been wall to be climbed, however while doing it I have learned already great deal about programming which was actually main purpose why I did start such project.
This is done in Visual C# 2008 express.
v0.2a win32 binary setup download with Save function (zip, 216kb):
https://github.com/downloads/JTbo/JTbo_Tools/TGM_editor_0.2alpha.zip
Extract to temp folder, run setup.exe.
v0.2a source download (zip, 296kb):
https://github.com/downloads/JTbo/JTbo_Tools/TgmEditor_v0.2a.zip
View attachment 4683
It is quite ugly at the moment because I have had not much plans for UI as of yet. (also my color scheme in windows is not very pretty, but it saves my old eyes) However I would like to create dots representing nodes to left side of boxes. Those boxes are actually generated by the code, so if you have more nodes there is more of them and if you have less nodes there are less of them, currently having more than 32 nodes will probably crash the tool or do some weird things, there is not much of fail safes or anything robust in it right now.
This is roughly how it works as of now.
From open button one can open tgm file and program reads the file, parses values to array and creates text boxes with values in them. Also program outputs read lines to bottom box.
Catch here is that only values from node 0 to node containing center of tire are read, rest are then generated. Reason for this is that I have only symmetric tires to work with and I certainly don't like typing same values over and over again, so program calculates those.
Next I will do code for generate button, I have planned it so that it should read text boxes and generate other side of tire, then output everything to bottom text box, so I can actually use tool for something and copy paste those lines to tgm file.
There is also save button, it does nothing at the moment, but I want it to be able to write lines into tgm file, however it is not yet quite clear for me how to achieve this. Currently I plan to test same parsing code as when reading to find location and write line there, but I'm not too sure if that is going to work at least easily.
I have very little experience and 0 education in coding, I just do tutorials what I find from net, try to code something and when not be able to figure out what to do I search from the net, slowly I learn then.
When I get it to somehow working stage, I plan to put it up to github or similar as it is going to be open source as that is my way, then anyone is of course welcome to improve it.
For those using Notepad++ my regex parameters might be useful or then not, I have not had time to test how well they would work in Notepad++.
To find lines to read I use this: @"Geometry=\(*"
1st param @"\-?\d{1}\.?[0-9]*"
2nd param @"\,\-\d{1}\.[0-9]*\,"
3rd param @"\,\d{1}\.[0-9]*\)"
Then I clean up 2nd param with "\\,", ""
And cleaning up 3rd param I use two as I could not figure out how to get one to clean both comma and bracket
"\\)", ""
"\\,", ""
Cleaning up in C# is possible Regex.Replace.
Here is some link to Notepad++ RegEx stuff that I have not read, but which might be useful for those wanting to know more about that.
http://markantoniou.blogspot.fi/2008/06/notepad-how-to-use-regular-expressions.html
Might not be the most useful tool of course, but for me at least nice byproduct from learning programming
INSTRUCTIONS and stuff you need to know:
Of course I could not wait to make save function when I got idea of how to make it work, so there is now new version, 0.2 Alpha available that can save TGM files.
But be careful with it, have backups up to date and operate only with copies of original tire files. Not my fault if your machine goes kaboom, I have warned you
It has not all the functionalities yet in, so here is quick quide how to use.
After opening tool, click open, select copy of TGM file you want to edit. (if you choose wrong file tool crashes)
Make edits as you see fit, then click generate and tool writes your edits to bottom box and also generates other half of tire too. It is possible to copy values from box to TGM file manually also.
Click save button, choose location where you want to save your NEW tgm file, write NEW name and remember .tgm extension (in future I make that automatic). If you choose existing file, tool probably crashes or makes TGM file useless, that part of tool is not yet finished, it can only create NEW files, afaik, haven't even tested overwriting yet.
After you have saved your NEW tgm, tool writes whole TGM file into bottom text box, so you can quickly look if file looks ok, without need of opening file separately. Also tool retains generated geometry lines at top of the bottom box so that you can compare values, copy them and whatever you wish to do with them.
Remember to close tool after that, I have attempted to make it so that you could do 2nd tires in a row, but there might be bugs as that part requires still testing, so only one tires for one tool startup is something I have seen working. This is alpha after all, only intended to give preview and offer possibility to test and perhaps even help with creation of tool, but it still may be useful.
BEWARE:
Don't attempt to use with TGM that has more nodes than what Clio tires have, there is bit of space issues on my screen at least.
Screen height, you probably don't want to use anything less than 1080 pixels, program is 715; 898 pixels in size, so having less than 900 pixels tall screen is causing some of the program being outside of the screen.
Something I would like to solve in future, when I get UI planned out. It is just a rough tool for my usage at the moment, if is any use for you, good, but at this stage it is not intended to be pretty or anything for wide usage, at this stage I put it up as open source and perhaps some can find it worth his time to improve it.
I like GNU/GPL License, make your own version, mention original creator and share the source, so that is what I may go with at some point.
Last edited by a moderator: