-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
obsoleting mechanism #339
Comments
The defining criteria for an obsoleted part should be the existence of a 'replacedby' attribute. Please also see
|
Thanks Kjell. However, I think that the script obsoletes all the svgs of a part (icon, bb, sch and pcb). This could be necessary in some cases, but it is not needed with a lot of other parts where there is only an issue in one of the svgs. This will create a lot of parts with different names that are in fact the same.
In addition, in the case of the potentiometer, only the svg of the schematic needs to be replaced (maybe we will modify other views but they are minor changes). In fact, some of the other svg files that the script is moving to the obsolete folder are used by other parts. Those parts will still work as the svg files will be in the obsolete folder, but it will make a big mess. In fact, if I run this script for the 5 potentiometers in the core, we will end up with 5 different svgs that are equal in the core folder. Finally, there are some cases where the file in the core is already in the obsolete folder. For example, pot_trimmer_6mm.fzp. Thus, you cannot copy it to the obsolete folder directly, you need to rename it. Currently, the script gives an error:
I think I will obsolete the potentiometers manually to have a cleaner repository. "The //obsolete// prefix is a hack to avoid listing obsolete parts as alternatives via the inspector. This should be fixed in Fritzing, so obsolete parts don't show, no matter of the family property." Ok, just to be sure. Should we still use this hack for now until we fix this in Fritzing? |
And I just noticed that there is a problem with the moduleID that generates:
The new moduleID needs to finish in PotentiometerModuleID. If not, the properties of the part cannot be changed in the inspector as the suffix is used to set the editable properties based on the resorces.xml |
Thanks, for the feedback
|
"The script could take a "view" parameter, if we already know beforehand which view/svg will need changes. It would then only copy the needed svg" "In case of a name collision... this is only a quick guess, but maybe: There might already be a problem: Since Fritzing determines the folder automatically, it might have been picking up the /svg/core file all the time instead of the /svg/obsolete file, which probably resulted in messed up circuits. Again, only a quick guess, maybe it was picking up the correct pot_trimmer_6mm file all the time. I think there is not much to do here, user must resolve name collisions." "About the suffix... I think this is a bit of a smell in the parts format, encoding such things in an ID is not a good idea. Suffixes which need to be preserved can be seen in moduleidnames.cpp . I think using random suffixes like "alps-starter-pot9mm" as used in resources/properties.xml triggers more problems, and such parts need to be fixed. So, I'd modify the script to preserve known suffixes" "Yes, we should use the hack. I think it doesn't cause harm. Once this is fixed in Fritzing, it will be just one quirk less to remember when obsoleting parts." |
It looks like I get to be "Someone" (as in Someone should document parts obsoleting) as I need to obsolete the Dual_VNH2SP30_Motor_Driver part. I'll add the //obsolete// to that. As well I think it would be wise to require the replacedby in the version property (which may require adding a version property to the fzp file being obsoleted if there isn't one already present, but I don't think that should cause a problem.) I'm also inclined to enforce the statement in the parts format file document "But it is important to note that within a part, a connector's name and id attributes must be unique—that is, no two connectors in a given part should have the same id or the same name." Since replacedby can be specified for the name field, that may be the reason for this requirement (I suspect duplicate names will cause problems with replacedby but have not yet tried it to see!) The other possibility is thought to be that if the properties of two parts are identical Fritzing will compare connector name fields in order to tell two parts apart. "I would suggest adding an "_vX", where X is the version of the part as specified in the version property." I'm in favor of just adding "_X" where X is the number in the version field, however there is one wrinkle I can think of: a part with multiple active versions. An example is the WeMos D1 mini. We have two in core parts (male and female headers) the pcb hole size is wrong (0.036in instead of the standard 0.038in for a 0.1 header) and it doesn't meet the graphics standards so should be fixed and obsoleted eventually. However there is now a new hardware revision from WeMos (looks to be V4.0) that adds a I2C 2mm grove connector to the board. At the same time there are still lots of D1 mini knockoff boards (without the extra I2C connector available on Ebay and elsewhere. I think that means we should keep the corrected original version of the part (upgraded after obsoleting to meet graphics standards) and add a new version for the new WeMos part. I think we should only be obsoleting (which really isn't an accurate term except for things made by the parts factory such as headers and ICs) that are broken in some way. As has been pointed out to me, people still have parts that are no longer available in their junk boxes and/or can buy them on ebay. The Dual motor driver is a case in point, it is no longer sold by Pololu, but is still useful as a Fritzing part. |
It has been some time since I looked at what is needed to obsolete a part. I think that replacedby will work by just specifying the connector without the name. Both name and id can be used, but only one is needed to be functional, as long as that one is unique. It is just more readable to include the name. |
I'm hoping (but haven't tried yet) this will work to replace both the connector number and the name. original
I'm also wondering (and will have to test) what will happen with parts that change pin numbers between views (there are a few in core parts) like this made up example
where schematic view has a different pin number. I'm wondering if replacedby connector1 will work (or work automatically for all pins) if applied to the schematic connectorId to change it back in to sequence (i.e. make all instances connector1 which is what is desirable!)
|
The obsoleting mechanism is documented in https://github.com/fritzing/fritzing-parts/blob/master/CONTRIBUTING.md, but I think that it still misses some information.
This is the paragraph with the instructions:
First, most of the obsoleted parts have been modified to include the "//obsolete//" prefix before the family property. This is not documented.
Second, I do not think that a different file name is necessary. In fact, there is a pot_slider.fpz in the core folder and the obsolete folder. In any case, I would change the filename when moving the part to the obsolete folder as this will allow having several versions of obsolete parts. In any case, clear guidelines should be reported to change the name of the files. I would suggest adding an "_vX", where X is the version of the part as specified in the version property.
Third, the same applies to svg files, which is more tricky as there are not moduleIDs. Should we change the svg when moving them to the obsolete folder (and changing all the obsoleted parts to point to the renamed svgs) or should we create a new filename for the new svgs?
Fourth, there is a script in the folder, but I think it does not does that all these changes yet. In any case, maybe the script should be mentioned in the documentation if it is useful.
This issue was originated by a discussion to fix the potentiometer symbol, see full discussion in the forum
The text was updated successfully, but these errors were encountered: