-
Notifications
You must be signed in to change notification settings - Fork 68
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
[FEATURE] Add 'baketext' support where appropiate #686
Comments
Please explain it better.
Please describe an step by step workflow for:
BTW: You can already copy the schematic and or PCB using KiBot. |
I actually do NOT want to store them in the project; the git repository is to be (at all times obviously) untouched. For the obvious 'dirty-ness' reason, but also we won't commit changes as part of the pipeline anyway.
That's an interesting point; but I also have 'restore' in my config set. So one work-around would indeed be, do not restore the files, but copy them after kibot as an output.
Manually (or using kibot) change the text variables (but also the built-in kicad variables). e.g. whenever $COMMENT1 is used, we'd have to manually change that in the sch/pcb files. I suppose when manually doing this, one would; parse project file (or root schematic), and then all linked schematics run
We have a job running (build, deploy whatever) which will resolve all variables to static texts, those generated by kibot; but also those generated/populated by kicad. The generated files are now placed as an output into the output folder. Again, pretty much what is done with kibot present, navigate or kicanvas.
|
But this equivalent to what the (deprecated) I still don't understand why is this needed. You should invest some time in creating a very simple example and KiBot configuration showing the use case and what is the exact problem with what we currently have. |
So I tried the copy_from; and copy_files needs a list of files, which I don't know, but kibot does. The simple example my pipeline template in itself. https://gitlab.com/ci-includes/kici. Here, the pipeline runs, and generates all sorts of outputs; see for example the output of the latest tag; https://gitlab.com/ci-includes/kici/-/jobs/7999345181/artifacts/browse where all generated outputs are shown. What's missing however, is the schematics and pcb files, with prefilled variables, because those are in the repository. However when sharing these files (output) you don't get the pcb files or schematics (well you do, because they are part of kicanvas, present or navigate, IF you use those outputs). So having an output that just does the pcb files would be enough to be able to 'release' them and offer them for easy sharing. Actually kicanvas is more complete then present or navigate, as that also includes the project file. Granted, you do have to explicitly configure kicanvas to do so, so a generic 'kicad' output probably should just do that anyway ... |
Look at the ExportProject template.
Nope, this isn't a simple example.
And hence isn't a simple example
The variables are in the project, as long as you copy the project you'll get the values.
ExportProject is used to share your project.
Ok, is already implemented, you also sch_variant and pcb_variant. But they are good only if the other person has the 3D models.
?!!
Like the outputs I mentioned before.
|
It was a bit hard to find, but yes, that's exactly what I want, the secret, which is undocumented, is
This seems to 'auto-detect' what files to upload.
I guess we have to agree to disagree, while I can agree with that it's many examples, they are all each simple.
it generates ONE output, per pipeline step, so one simple template is run. This is by design to make sure things try to stay simple, rather then having one major template with everything.
Cool, my issue was in not knowing what Just a little bit of 'concern' I have, is that the variables are stored in the project, they are not resolved into the silk-screen, like kikit's So then the feature request kind-of is still accurate, that during project export, we want to bake variables into the silk-screen. E.g. when I share ONLY the
👍
They are part of the repo; which copy_files already takes care off :) Kibot is actually really good in doing even more; it copies the symbol and footprints as well; impressive. Just not sure why it's adding ironically, they do not even work :p and throw an error (when generating the 3D render)
Navigate doesn't include the
|
Oops, the FileList class overlapped with other 2 classes and the 1.8.x docs made only one visible.
We have an internal template with this functionality (documented) and Quick Start uses it.
But where we don't agree is in the time. You are looking for help, so you should make it easy to help you. Analyzing tons of simple files is time consuming.
And becomes really hard to track. When I say simple I mean just simple. I get the files, put them in a folder and run the command you say. Just one minute, otherwise I must spend 30 minutes trying to figure out what to do. If you want help make it simple for other to help you.
The problem here is how can we know we are replacing everything ...
Are you really talking about the
|
Ahh! That's why then :)
Fair enough; Next time I'll paste a 1 liner to reproduce things :)
Obviously! I'll make it easy!
I suppose 'just like kikit
Whatever produces this output: https://ci-includes.gitlab.io/kici/world/navigate/world-navigate.html where the kicad_pro is well hidden ;) |
KiKit doesn´t do. Doing it you risk to make the file invalid.
Please read the docs to understand what this output does. In fact it can include the kicanvas and copy_files, so it can't be less than any of them. |
So then kibot does it? https://kibot.readthedocs.io/en/latest/configuration/outputs/PanelizeLayout.html
I meant that kicanvas will include |
Nope, KiKit, but it does something completely different to what you describe.
This is not true.
Because you didn't read the docs to discover what navigate_results does.
Again something you should get from the docs. |
I still don't get the main use for such a feature. First time you mentioned it I though it was related to your manual panelization process |
Hmm, what kitkit baketext seems to do, is just 'sed' all the variables into the value fields. E.g. if I have a silk-screen text, that has as value This is important to me, when sharing just the Even more so important, because I actually put
Yes, it CAN, but does not by default. E.g. I must include kicanvas, to get the kicanvas files. Without this include, I will not get the
Indeed, IF I include the ExportProject template (or the appropiate copy_files) output, then navigate will include those outputs. This was what I was missing and what made me chase this partial rabbit whole. I needed to learn about ExportProject/copy_files first :) So thank you for that!
No, I did, but was hoping/assuming as a basis, it would include the schematic and the PCB files by default. Where my confusion came from, is that I include a bunch of things, one being the pdf print, which has been so ingrained into my memory, I treated navigate as always having 'at least the schematic and pcb' files, which is not even true, it's the PDF's of these, and only because I have them in my list for navigate. I first needed to learn about ExportProject to also find the project included.
But you already told me before, it wasn't in the docs :p Or rather, exportProject is listed very briefly and not exactly clearly (unless you know what to expect) and So this part is fully resolved now with your help, this is all not a problem any longer, except for
When doing panelization, I found out about kikit's E.g. I have a preflight that does |
Nope.
Why are you doing this?
RTFD.
Why assume something that isn't stated in the docs? In fact the docs says something very different.
What I told you is that 1.8.0 docs on Read the Docs confused all the FileList classes. It doesn't mean that the docs doesn't talk about ExportProject. And it doesn't mean you don't have examples of copy_files in the repo.
Why? Because you want to avoid the .kicad_pro?
And here you use ExportProject. Or you can just copy the project file or ... The baketext thing is good for a panel, which isn't something you manually edit, but is really bad for something you will eventually edit. I think this can be solved using the KiCad cache, not sure. |
The above is not relevant anymore, and we are hugely miss-understanding each other anyway :)
>
> > E.g. I have a preflight that does `git describe` to dynamically generate a variable for the revision. I tag my repository with the files to mark a release, the pipeline runs with kibot and runs `exportProject`. However because variables are not resolved, the `file.kicad_pcb` can not be shared without the `file.kicad_pro` as the project file holds the variables. Obviously, when doing a `copy_files` step, I want an option to `baketext` so that all variables are resolved.
>
> And here you use ExportProject. Or you can just copy the project file or ...
>
> The baketext thing is good for a panel, which isn't something you manually edit, but is really bad for something you will eventually edit.
>
> I think this can be solved using the KiCad cache, not sure.
Not really. In the end, what I'm after, is a single output job; that when run from a repo; creates a nice output folder (that I then can compress) which gives me an active state of the files in the repository, but the files do not have the intend to be ever edited again, they have been 'pulled out of' the repo. E.g. they have been 'released'. What |
Using variables with kicad is great, we can put in our schematic things such as
$COMMENT1
or$GIT_VSC_TAG
(which is generated in preflight.However, these tags are 'replaced' with the actual text in the git repository that holds the kicad files, which is 'logical'. One (complex) way of dealing with this is a pre-commit script that would replace the value when you create a git tag; but if you update the code, you'd have to re-update this tag, becoming quickly cumbersome.
KiKit introduces a nice feature called
baketext
, that will expand variables when it creates newpanel.kicad_pcb
.This is currently not done for other things kibot generates, such as present, navigate or kicanvas. Therefor I recommend that we get a flag (or even do it as default), where variables get expanded in these 'releases'.
Probably worth a different feature request, but we'd also could probably use to generate a simple 'dumb' output, that basically just copies (with baked text) the schematic and pcb files. One thing that's subtle here, other then 'why not just do
sed in > outdir/pcb.sch
, is that we don't know all files to copy, more specifically, not all schematics (with hierarchical schematics).E.g. when invoking kibot with--schematic root.kicad_sch --board board.kicad_pcb
, kibot (kicad) will know exactly which schematic and board files to use, e.g. kicanvas etc all have the correct files included. Thus having a 'copy' output that does all preflight and other processing is definitely useful.The text was updated successfully, but these errors were encountered: