hkienle
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: ose --- SPDX-FileCopyrightText: Holger Kienle, <hkienle@posteo.de> SPDX-FileCopyrightText: (add yourself if you contributed) SPDX-License-Identifier: CC-BY-SA-4.0 :::success Please contribute by directly editing and/or [commenting](https://hackmd.io/c/tutorials/%2Fs%2Fhow-to-use-comments)! ::: # bommm: Bill of Materials Master Manager [ToC] This working document outlines a textual specification language for (OSE) machines to - DRAFT-FOR-COMMENT describe their *features* in a hierarchical fashion. - STARTED describe feature *alternatives*, leading to different possible *configurations*. - TODO generate an (interactive) graph of the feature tree for documentation. - TODO generate a textual list / spreadsheet of the (leaf) features (= "virtual BOM") - STARTED describe *procurable items*. - TODO map (leaf) features to procurable items. - TODO describe suppliers - TODO map procurable items to potential suppliers - TODO run heuristics to obtain a proposed BOM with procurable items and suppliers (= "physical BOM") - TODO generate spreadsheet-based BOM (for subsequent manual refinement) - ... ## Feature tree :::info :nerd_face: The underlying representation is a typed, attributed directed-acyclic graph (dag). ::: The composition of a machine is described in a tree structure that consists of *features* (nodes in a tree). To start specifying a 3D printer: ``` feature printer is ... // top-level node: the machine we want to specify ``` A feature is composed of sub-features that are specified in a list notation. Sub-features are separted with commas (`,`). ``` /* * 3D printer feature specification */ feature printer is baseplate , x-axis , y-axis, z-axis // axes are not identical , ... // more sub-features ``` :::info :bulb: A feature is "a prominent or distinctive user-visible aspect, quality, or characteristic of a systems" [(SEI report)](https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=11231). In other words, it's everything you want it to be as long as it suits your needs. ::: :::info :bulb: Comments are C/C++ style. ::: The above statement specifices a parent node (`printer`) and the parent node's child nodes (`baseplate`, `x-axis`, etc.). The child nodes are connected to the parent with (implicit, directed) edges. ```graphviz digraph { node [fontname=Courier] "baseplate" -> printer; "x-axis" -> printer; "y-axis" -> printer; "z-axis" -> printer; "..." -> printer; } ``` Sub-feature are **mandatory** parts of the (parent-)feature. Because all children are mandatory, you can think of the parent as an "AND-node". ``` feature parent is child-1 , child-2, ... , child-n // parent is an AND node ``` ### Arc count attribute A feature can have multiple identical sub-features. This is expressed with a special `count` attribute, which is attached to the arc: ``` carriage = ... screw-m6 [ count=5 ] ... // the carriage has 5 screws ``` ```graphviz digraph { node [fontname=Courier] "screw-m6" -> carriage [label=5]; } ``` :::warning :nerd_face: The syntax of attributes is inspired by graphviz/dot. ::: Because this is an attribute with special meaning that is frequently used there is a special syntax for it: ``` carriage = ... 5 * screw-m6 ... // equivalent syntactic sugar ``` :::warning :nerd_face: [Syntactic sugar](http://en.wikipedia.org/wiki/Syntactic_sugar) is a convenient notation/shortform, which can be also expressed in a more general, but also more verbose, way. (Think of i++ vs. i=i+1.) ::: All of the following lines have the same meaning: ``` feature parent is ... child ... feature parent is ... 1* child ... feature parent is ... child [ count=1 ] ... ``` :::info :bulb: The count attribute expresses a discrete quantity and has no unit. ::: :::danger :fire: ``` feature parent is ... 5 * child [ count=7 ] ... // undefined ``` ::: ### Arc attributes Besides count, an arc can have any number of attribute and they can have different types: ``` feature parent is ... child [ a= 1 ] // number [ b= true ] // boolean [ c= "foo" ] // string [ d= 1/12 ] // fraction: n / m [ count= 5 ] ... ``` :::info :bulb: :nerd_face: Arcs, same as nodes, are first-class entities. In other words, both are “[reified](https://en.wikipedia.org/wiki/Reification_(computer_science))”. ::: :::danger :fire: ``` feature parent is ... child [ a= 5 ] [ a= 7 ] // undefined ``` ::: The following lines have the same meaning: ``` ... a_part [diy= true] ... a_part [diy] // syntactic sugar ``` Features (tree nodes) can have attributes as well. See below. ### Atomic features (leaf nodes) Features that have no children are *leaf nodes*. Atomic features can be specified explicitly with: ``` feature screw-m6 is empty // atomic feature, no children ``` This can be seen as explicit documentation, but is also used as a mechanism to attach attributes to features, see below. ### Feature attributes Similar to arcs, features can have attributes that are used to attach properties to them. ``` feature rod // rod with lenght 35cm, syntactic sugar needed? [ quantity = 35 ] [ factor = 1/100 ] [ unit = "m" ] is empty ``` ### Caveat: features are unique Features are identified by their names. This means that a feature is unique, and uniquely associated with a tree node. For example, let's specify the screws needed for the printer's Y-axis: ``` feature y-axis is carriage , idler , y-base feature carriage is 5 * screw-m6-18mm , ... feature idler is 3 * screw-m6-18mm , ... feature y-base is 4 * screw-m6-18mm , ... ``` Now, `screw-m6-18mm` is a unique feature, even though it shows up several times in the specification. The resulting tree looks like this: ```graphviz digraph { node [fontname=Courier] carriage -> "y-axis" idler -> "y-axis" "y-base" -> "y-axis" "screw-m6-18mm" -> carriage [label=5] "screw-m6-18mm" -> idler [label=3] "screw-m6-18mm" -> "y-base" [label=4] } ``` :::info :bulb: (Looking ahead, it's possible to propagate the count attribut towards the root to know that the y-axis needs 12 screws in total.) ::: ### Adding to the feature tree For modularity and flexibility, it is desirable to add nodes, arcs, and attributes to the tree incrementally. :::warning :nerd_face: The feature specification may look declarative, but parts of it will be probably operational (e.g., ordering matters)! ::: :::danger :question: ``` feature rod [a=1] is empty ... feature rod [b=1] is empty // allowed?: add attribute b ... feature rod is foo // allowed?: rod is no longer atomic, wow! ... feature rod is bar // allowed?: rod has now two children: foo and bar ``` ::: However, this incremental build-up of the tree makes the specification much harder to understand and maintain! :::info :bulb: Avoid incremental build-up of the tree. :::warning :nerd_face: In other words, stay declarative, avoid operational behavior! ::: ### Naming conventions > There are only two hard things in Computer Science: cache invalidation and naming things. -- <https://www.martinfowler.com/bliki/TwoHardThings.html> The naming of features is important to make the feature tree easy to understand and maintain. Dashes (`-`) are used for grouping. How detailed a feature is named may depend on whether the machine has similar parts that need to be distinguished. ``` screw-m6 // there is only one M6 screw (and it has length 18mmm) ``` ``` screw-m6 // default: almost all M6 screws have length 18mm screw-m6-25mm // exception: a few screws have length 25mm ``` ``` screw-m6-18mm // all screws are named consistently screw-m6-25mm // all screws are named consistently ``` Underscores (`_`) in names are used to make features more readable. ``` a4988 // only understood by the initiated driver // too generic driver-a4988 // there is only one driver, no need to subgroup a4988_driver // seem about right for a name a4988_driver_carrier // maybe even better, maybe too verbose ``` Ampersands (`&`) in names can be used for logical groups. (Again, this is only a naming convention, the ampersand has no semantic meaning.) ``` feature a4988_driver_&_heatsink is a4988_driver // every driver carrier... , heatsink-tiny // ...needs a (tiny) heatsink ``` :::info :angel: So far, now need for a CamelCase naming convention. ::: ## Unresolved feature tree (nodes with alternatives) :::warning :nerd_face: Inspired by [and-or trees](http://en.wikipedia.org/wiki/And-or_tree) and [feature trees](http://en.wikipedia.org/wiki/Feature_model). ::: Besides AND-nodes, a feature can be expressed as an ALT-node, which lists alternative features seperated with a pipe symbol (`|`). ``` feature parent is child-1 | child-2 | ... | child-n // ALT-node ``` An ALT-node represents a configuration option because exactly *one* child node needs to be picked later on to obtain a valid configuration. ALT-nodes are useful to distinguish build/design variations. ``` feature power_plug is plug-us {us} // the "{<cfg>}"-notation is explained later | plug-euro {europe} ``` ``` /* need a better example: this is decided at procurement!? */ feature pulley is // each axis needs a pulley: pulley-metal // either we buy it... | pulley-diy // ...or we print it ourselves ``` AND-nodes and ALT-nodes are graphically distinguished with oval and boxed nodes, respectively. ```graphviz digraph { node [fontname=Courier] "AND-node" "ALT-node" [shape=box] } ``` ### Feature resolution :construction_worker: ## Modularity ### includes ## Procurable items A *procurable item*, or simply *procurable* is something that - is expected that it can be purchased from a supplier - can be manufactured by ourselves (`diy`) Typically there will be several procurables that can satisfy a given feature. For example, for a certain screw, different package sizes may be procured: ``` /* procurables for feature screw-m6-18mm */ procurable screw-m6-18mm-04pcs [count= 4] procures screw-m6-18mm procurable screw-m6-18mm-50pcs [count=50] procures screw-m6-18mm ... ``` For example, for an Arduino it may be useful to distinguish between different kinds: ``` feature arduino-mega is ... // let's support the original procurable arduino-mega-genuine procures arduino-mega // any cheap clone will do procurable arduino-mega-clone procures arduino-mega // this one seem good trade-off regarding price/quality procurable arduino-mega-joyit procures arduino-mega ``` ``` /* specify feature tree */ feature pulley is pulley-metal {default} | pulley-diy feature pulley-metal is empty feature pulley-diy [diy] [filament-cm=200] [time-sec=300] is empty /* specify procurable */ // single piece procurable pulley-metal-1pcs procures pulley-metal // package procurable pulley-metal-5pcs // ? seperate or global name space [ count=5 ] // package with 5 pieces procures pulley-metal ``` :::danger :question: global or separate namespace for features and procurables ``` feature foo is ... procurable foo procures foo // ? ok or name clash ``` ::: :construction_worker: ## Resources - First attempt of a specification. Uses differnent terminoloy and syntax. Contains some ideas that are not incorporated yet: https://docs.google.com/document/d/1OKpR-UmcQx-ATKXIcIaU51CezamdNJhNGehdjjXJo84/edit

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully