Template talk:Usaf serial

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Aircraft by serial number[edit]

Joshbaumgartner, is there any way this template can be made to pass through the "regser" parameter from {{Acreg/layout}} so that categories like Category:SR-71 Blackbird by serial number will show up? Huntster (t @ c) 19:22, 7 October 2019 (UTC)

@Huntster: Okay did some updates. You can now add the 'rs' parameter for uses of {{Usaf serial}} to do this. Note that I revamped the parameters and added a proper documentation page to usaf serial. I added the template to a few SR-71s and it seems to work. On a side note, I raised Category:Lockheed SR-71 Blackbird for COM:CFD for standardizing the name throughout the sub cats. Thanks for adding the template to a bunch of aircraft. Josh (talk) 21:15, 7 October 2019 (UTC)
Joshbaumgartner, regarding SR-71 standardisation, I was thinking exactly that when I made a quick perusal of the cat structure, so that's good. Thanks for updating the template as well. Question, though: in which circumstances would you recommend *this* template be used compared to {{Aircraft registration}}? There's a lot of overlap. Huntster (t @ c) 03:07, 8 October 2019 (UTC)
@Huntster: {{Aircraft registration}} is something I came up years ago when far less experienced at template editing. It is pretty clunky (requires a lot of parameters from the user) and doesn't really do what I wanted to do with USAF serials. The idea was to use {{Usaf serial}} for all USA/AF serial numbered aircraft. It uses {{Acreg/layout}} for implementation which gives me some common code for similar templates, as I would plan on making a USN buno one, and ones for other established serial number systems. The idea is that {{Usaf serial}} is an entry template...that is it is an easy one for users to add without having to do too much parsing and doesn't have a lot of parameters required beyond those directly relevant to USAF aircraft. If there are ways to make it easier to use, or things that older templates do that you would like included in this template's abilities, let me know, it is all being developed. Josh (talk) 16:25, 8 October 2019 (UTC)
Joshbaumgartner: I certainly prefer {{Usaf serial}} for its simplicity. I was just looking at the very complex cases like the deeeeeeep categories of F-16, for example, and how {{Aircraft registration}} handles them. I find the F-16 tree an interesting test case, but I don't think we should *want* to copy that into other military aircraft categories. It's just too complex. Honestly, I'd love to find a way to develop a fully standardised set of subcategories for all aircraft, since what we have today is somewhat hit and miss.
All that said, perhaps a parameter for year of construction would be useful here? Admittedly, it can be pretty difficult to determine for some airframes, and I know some editors have confused the year in the serial numbers as year of construction. Huntster (t @ c) 17:06, 8 October 2019 (UTC)
@Huntster: Good suggestion, build year is easy to build in as an optional parameter (with a note to not just assume FY = BY). The F-16 is an aircraft in global service (>5000 built) that always attracts cameras and has a lot of good references available, so it lends to a very deep and detailed category tree since we have so much sheer material relating to it. Most aircraft do not have anywhere close to as much material so of course they should not have all of that structure. The idea, and I fully agree that a consistent structure is desirable, would be a scalable convention that can grow in line with the files available for an aircraft. We certainly do not want to force all of the structure of the F-16 on say the SEPECAT Jaguar, but the structure of the Jaguar ought to be consistent with the F-16 to whatever level of depth is appropriate for the aircraft. Probably is a discussion we can have going forward, not really relevant to the template. I do the template to try and work with the categories however they exist, not to drive category structure per se. Josh (talk) 21:38, 8 October 2019 (UTC)

Aircraft by service[edit]

Have you considered adding support for category trees like Category:Lockheed C-130J Hercules of the United States Air Force? This could seemingly fail down easily to Category:Lockheed C-130 Hercules of the United States Air Force and Category:Lockheed aircraft of the United States Air Force. Huntster (t @ c) 16:50, 11 November 2019 (UTC)

I just realised I wrote this but never actually pinged you, Josh, sorry. Huntster (t @ c) 16:39, 16 November 2019 (UTC)
@Huntster: No reason not to, I would think. I've added a bit that should at least handle the ac/3 parameter in "of the operator" categories. I may need to build it a bit more for corner cases when they come up. Josh (talk) 20:59, 16 November 2019 (UTC)
Joshbaumgartner, oh hey! Just noticed the effect, thanks for that. One other thing I've taken notice of today, that (for example) Aircraft numbered 1102 and Number 1102 on aircraft are in separate category trees, but the template only chooses one to throw in, even if an aircraft could go in both. Huntster (t @ c) 21:14, 16 November 2019 (UTC)
@Huntster: Yeah, I am also going to create a similar JASDF serial template for those numbers to support some implementations I have noticed. As for the numbers, the primary target is to place an aircraft in Aircraft numbered 1102 as the aircraft category does not necessarily depict the number actually on the aircraft. The fall back if Aircraft numbered 1102 does not exist is to place it in both Aircraft by number and Number 1102 on aircraft, but this is only until the preferred category is created. Josh (talk) 21:20, 16 November 2019 (UTC)
Joshbaumgartner, yeah, going through some of the JASDF has taken some...shoe-horning...to get things in place, since it needs both the USAF contract year for *that* set of categories and the JASDF tail number for *those* categories. Heh. No other good way to go about it, unless somehow this was converted simply into "Template:Serial" and the first field identifies the force... USAF, USN, JASDF, TAF, etc. Then again, trying to make one template do *everything* has not had a great track record on Wiki or Commons in the past! Huntster (t @ c) 21:26, 16 November 2019 (UTC)
@Huntster: Yeah, I think for JASDF/USAF aircraft they will need a proper cat for each number, otherwise you will find a JASDF serial listed under the 'ac by USAF serial' cat or vice-versa. I have made {{Jasdf serial}} and applied it to 05-1084 (aircraft) as well as creating 89-0118 (aircraft) to support it. See what you think. Josh (talk) 21:33, 16 November 2019 (UTC)
Joshbaumgartner, the Aircraft by Japan Self-Defense Forces FY05 serial number series is problematic, since they do not use the first two numbers of their own series to identify fiscal year. For example, 35-1071 (aircraft). The FY, I think, would still necessarily have to reflect the USAF FY, since that was all of their origins. Huntster (t @ c) 22:21, 16 November 2019 (UTC)

Built in dates[edit]

Joshbaumgartner, take a look at 40-2168 (aircraft), specifically that it is sorting into "Built in 1941" rather than "Aircraft built in 1941". I looked at the subtemplate here, but I could find no obvious reason why it would be malfunctioning in this manner. Huntster (t @ c) 16:38, 28 November 2019 (UTC)

Joshbaumgartner: another thought... considering these are serial numbers rather than registrations, properly, what about having the template check first if "by serial" and "by serial number" categories exist, and if not, then try to sort into "by registration". Right now it can be faked using |rs=, but this breaks other things slightly. Huntster (t @ c) 20:36, 29 November 2019 (UTC)
@Huntster: The sorting into "Built in 1941" is fixed. Seems that a simply 'ifexist' was not enough, but now it tests to see if the aircraft parameter is set first before checking if the category exists. Side benefit is that it might save a couple of pointless category lookups. As for the second thought, I think that situation is what I had in mind when I created the |rs= option, so interested to know what gets broken by using it like this. I may need to create |rs= for each level of aircraft identity or something like that to fix this. Josh (talk) 20:29, 2 December 2019 (UTC)
Joshbaumgartner, check out 42-97849 (aircraft) as an example. Remove |rs=serial number to see the difference. Specifically, using |rs= here kills off Aircraft by United States Army serial number. To be honest, I haven't extensively tested what else it might effect in other combinations, just because there are so many. I'll look into this more.
The B-17G cases I'm currently working on are interesting for the template, because I have both serial number and registration categories. This is why I think serial number should be the default, with registration as backup, since all these military aircraft categories *are* serial numbers rather than registrations-per-se. It would ultimately make it a lot easier going forward to default to serial number. Huntster (t @ c) 21:45, 2 December 2019 (UTC)
@Huntster: Okay, as I suspected, I may need to be more detailed in how |rs= is applied. Let me play with it a bit and come up with something. Josh (talk) 22:38, 2 December 2019 (UTC)

Serial number/registration error[edit]

Joshbaumgartner, take a look at 42-3352 (aircraft) if you don't mind. The template is trying to sort it into both the serial number and registration categories. Huntster (t @ c) 16:05, 11 December 2019 (UTC)

@Huntster: okay that is what I feared would happen earlier. So now instead of a simple early if for the serial number for aircraft1, it actually promulgates the rs parameter down to the aircraft2 (family) and aircraft3 (mfr) levels. Also, I've added parameters rs1, rs2, and rs3 that will allow some customization for each level as needed to get the desired results. There is an added complication however with this individual aircraft. You have Douglas as the manufacturer, so ideally it should show up somewhere under Category:Douglas aircraft by registration, but because of the nature of it being a Boeing aircraft generally, if a user goes to Category:Douglas aircraft by registration, they will never find it no matter how deep they go, as it instead is in Category:Boeing B-17 by serial number which is a sub of Category:Boeing aircraft by registration. I'm not sure if it is a big enough issue to warrant a lot of effort to cover cases where one company builds another company's design, but open to ideas! Thanks! Josh (talk) 23:35, 11 December 2019 (UTC)