ibom.html 198 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Interactive BOM for KiCAD</title>
  7. <style type="text/css">
  8. :root {
  9. --pcb-edge-color: black;
  10. --pad-color: #878787;
  11. --pad-hole-color: #CCCCCC;
  12. --pad-color-highlight: #D04040;
  13. --pad-color-highlight-both: #D0D040;
  14. --pad-color-highlight-marked: #44a344;
  15. --pin1-outline-color: #ffb629;
  16. --pin1-outline-color-highlight: #ffb629;
  17. --pin1-outline-color-highlight-both: #fcbb39;
  18. --pin1-outline-color-highlight-marked: #fdbe41;
  19. --silkscreen-edge-color: #aa4;
  20. --silkscreen-polygon-color: #4aa;
  21. --silkscreen-text-color: #4aa;
  22. --fabrication-edge-color: #907651;
  23. --fabrication-polygon-color: #907651;
  24. --fabrication-text-color: #a27c24;
  25. --track-color: #def5f1;
  26. --track-color-highlight: #D04040;
  27. --zone-color: #def5f1;
  28. --zone-color-highlight: #d0404080;
  29. }
  30. html,
  31. body {
  32. margin: 0px;
  33. height: 100%;
  34. font-family: Verdana, sans-serif;
  35. }
  36. .dark.topmostdiv {
  37. --pcb-edge-color: #eee;
  38. --pad-color: #808080;
  39. --pin1-outline-color: #ffa800;
  40. --pin1-outline-color-highlight: #ccff00;
  41. --track-color: #42524f;
  42. --zone-color: #42524f;
  43. background-color: #252c30;
  44. color: #eee;
  45. }
  46. button {
  47. background-color: #eee;
  48. border: 1px solid #888;
  49. color: black;
  50. height: 44px;
  51. width: 44px;
  52. text-align: center;
  53. text-decoration: none;
  54. display: inline-block;
  55. font-size: 14px;
  56. font-weight: bolder;
  57. }
  58. .dark button {
  59. /* This will be inverted */
  60. background-color: #c3b7b5;
  61. }
  62. button.depressed {
  63. background-color: #0a0;
  64. color: white;
  65. }
  66. .dark button.depressed {
  67. /* This will be inverted */
  68. background-color: #b3b;
  69. }
  70. button:focus {
  71. outline: 0;
  72. }
  73. button#tb-btn {
  74. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.32 290.12h5.82M1.32 291.45h5.82' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 292.5v4.23M.26 292.63H8.2' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='1.35' y='295.73'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
  75. }
  76. button#lr-btn {
  77. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.06 290.12H3.7m-2.64 1.33H3.7m-2.64 1.32H3.7m-2.64 1.3H3.7m-2.64 1.33H3.7' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 288.8v7.94m0-4.11h3.96' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='5.11' y='291.96'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
  78. }
  79. button#bom-btn {
  80. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)' fill='none' stroke='%23000' stroke-width='.4'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' stroke-linejoin='round'/%3E%3Cpath d='M1.59 290.12h5.29M1.59 291.45h5.33M1.59 292.75h5.33M1.59 294.09h5.33M1.59 295.41h5.33'/%3E%3C/g%3E%3C/svg%3E");
  81. }
  82. button#bom-grouped-btn {
  83. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%23000' stroke-linejoin='round' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-linecap='square' stroke-width='2' d='M6 10h4m4 0h5m4 0h3M6.1 22h3m3.9 0h5m4 0h4m-16-8h4m4 0h4'/%3E%3Cpath stroke-linecap='null' d='M5 17.5h22M5 26.6h22M5 5.5h22'/%3E%3C/g%3E%3C/svg%3E");
  84. }
  85. button#bom-ungrouped-btn {
  86. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%23000' stroke-linejoin='round' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-linecap='square' stroke-width='2' d='M6 10h4m-4 8h3m-3 8h4'/%3E%3Cpath stroke-linecap='null' d='M5 13.5h22m-22 8h22M5 5.5h22'/%3E%3C/g%3E%3C/svg%3E");
  87. }
  88. button#bom-netlist-btn {
  89. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg fill='none' stroke='%23000' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-width='2' d='M6 26l6-6v-8m13.8-6.3l-6 6v8'/%3E%3Ccircle cx='11.8' cy='9.5' r='2.8' stroke-width='2'/%3E%3Ccircle cx='19.8' cy='22.8' r='2.8' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
  90. }
  91. button#copy {
  92. background-image: url("data:image/svg+xml,%3Csvg height='48' viewBox='0 0 48 48' width='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h48v48h-48z' fill='none'/%3E%3Cpath d='M32 2h-24c-2.21 0-4 1.79-4 4v28h4v-28h24v-4zm6 8h-22c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h22c2.21 0 4-1.79 4-4v-28c0-2.21-1.79-4-4-4zm0 32h-22v-28h22v28z'/%3E%3C/svg%3E");
  93. background-position: 6px 6px;
  94. background-repeat: no-repeat;
  95. background-size: 26px 26px;
  96. border-radius: 6px;
  97. height: 40px;
  98. width: 40px;
  99. margin: 10px 5px;
  100. }
  101. button#copy:active {
  102. box-shadow: inset 0px 0px 5px #6c6c6c;
  103. }
  104. textarea.clipboard-temp {
  105. position: fixed;
  106. top: 0;
  107. left: 0;
  108. width: 2em;
  109. height: 2em;
  110. padding: 0;
  111. border: None;
  112. outline: None;
  113. box-shadow: None;
  114. background: transparent;
  115. }
  116. .left-most-button {
  117. border-right: 0;
  118. border-top-left-radius: 6px;
  119. border-bottom-left-radius: 6px;
  120. }
  121. .middle-button {
  122. border-right: 0;
  123. }
  124. .right-most-button {
  125. border-top-right-radius: 6px;
  126. border-bottom-right-radius: 6px;
  127. }
  128. .button-container {
  129. font-size: 0;
  130. margin: 10px 10px 10px 0px;
  131. }
  132. .dark .button-container {
  133. filter: invert(1);
  134. }
  135. .button-container button {
  136. background-size: 32px 32px;
  137. background-position: 5px 5px;
  138. background-repeat: no-repeat;
  139. }
  140. @media print {
  141. .hideonprint {
  142. display: none;
  143. }
  144. }
  145. canvas {
  146. cursor: crosshair;
  147. }
  148. canvas:active {
  149. cursor: grabbing;
  150. }
  151. .fileinfo {
  152. width: 100%;
  153. max-width: 1000px;
  154. border: none;
  155. padding: 5px;
  156. }
  157. .fileinfo .title {
  158. font-size: 20pt;
  159. font-weight: bold;
  160. }
  161. .fileinfo td {
  162. overflow: hidden;
  163. white-space: nowrap;
  164. max-width: 1px;
  165. width: 50%;
  166. text-overflow: ellipsis;
  167. }
  168. .bom {
  169. border-collapse: collapse;
  170. font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  171. font-size: 10pt;
  172. table-layout: fixed;
  173. width: 100%;
  174. margin-top: 1px;
  175. position: relative;
  176. }
  177. .bom th,
  178. .bom td {
  179. border: 1px solid black;
  180. padding: 5px;
  181. word-wrap: break-word;
  182. text-align: center;
  183. position: relative;
  184. }
  185. .dark .bom th,
  186. .dark .bom td {
  187. border: 1px solid #777;
  188. }
  189. .bom th {
  190. background-color: #CCCCCC;
  191. background-clip: padding-box;
  192. }
  193. .dark .bom th {
  194. background-color: #3b4749;
  195. }
  196. .bom tr.highlighted:nth-child(n) {
  197. background-color: #cfc;
  198. }
  199. .dark .bom tr.highlighted:nth-child(n) {
  200. background-color: #226022;
  201. }
  202. .bom tr:nth-child(even) {
  203. background-color: #f2f2f2;
  204. }
  205. .dark .bom tr:nth-child(even) {
  206. background-color: #313b40;
  207. }
  208. .bom tr.checked {
  209. color: #1cb53d;
  210. }
  211. .dark .bom tr.checked {
  212. color: #2cce54;
  213. }
  214. .bom tr {
  215. transition: background-color 0.2s;
  216. }
  217. .bom .numCol {
  218. width: 30px;
  219. }
  220. .bom .value {
  221. width: 15%;
  222. }
  223. .bom .quantity {
  224. width: 65px;
  225. }
  226. .bom th .sortmark {
  227. position: absolute;
  228. right: 1px;
  229. top: 1px;
  230. margin-top: -5px;
  231. border-width: 5px;
  232. border-style: solid;
  233. border-color: transparent transparent #221 transparent;
  234. transform-origin: 50% 85%;
  235. transition: opacity 0.2s, transform 0.4s;
  236. }
  237. .dark .bom th .sortmark {
  238. filter: invert(1);
  239. }
  240. .bom th .sortmark.none {
  241. opacity: 0;
  242. }
  243. .bom th .sortmark.desc {
  244. transform: rotate(180deg);
  245. }
  246. .bom th:hover .sortmark.none {
  247. opacity: 0.5;
  248. }
  249. .bom .bom-checkbox {
  250. width: 30px;
  251. position: relative;
  252. user-select: none;
  253. -moz-user-select: none;
  254. }
  255. .bom .bom-checkbox:before {
  256. content: "";
  257. position: absolute;
  258. border-width: 15px;
  259. border-style: solid;
  260. border-color: #51829f transparent transparent transparent;
  261. visibility: hidden;
  262. top: -15px;
  263. }
  264. .bom .bom-checkbox:after {
  265. content: "Double click to set/unset all";
  266. position: absolute;
  267. color: white;
  268. top: -35px;
  269. left: -26px;
  270. background: #51829f;
  271. padding: 5px 15px;
  272. border-radius: 8px;
  273. white-space: nowrap;
  274. visibility: hidden;
  275. }
  276. .bom .bom-checkbox:hover:before,
  277. .bom .bom-checkbox:hover:after {
  278. visibility: visible;
  279. transition: visibility 0.2s linear 1s;
  280. }
  281. .split {
  282. -webkit-box-sizing: border-box;
  283. -moz-box-sizing: border-box;
  284. box-sizing: border-box;
  285. overflow-y: auto;
  286. overflow-x: hidden;
  287. background-color: inherit;
  288. }
  289. .split.split-horizontal,
  290. .gutter.gutter-horizontal {
  291. height: 100%;
  292. float: left;
  293. }
  294. .gutter {
  295. background-color: #ddd;
  296. background-repeat: no-repeat;
  297. background-position: 50%;
  298. transition: background-color 0.3s;
  299. }
  300. .dark .gutter {
  301. background-color: #777;
  302. }
  303. .gutter.gutter-horizontal {
  304. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
  305. cursor: ew-resize;
  306. width: 5px;
  307. }
  308. .gutter.gutter-vertical {
  309. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
  310. cursor: ns-resize;
  311. height: 5px;
  312. }
  313. .searchbox {
  314. float: left;
  315. height: 40px;
  316. margin: 10px 5px;
  317. padding: 12px 32px;
  318. font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  319. font-size: 18px;
  320. box-sizing: border-box;
  321. border: 1px solid #888;
  322. border-radius: 6px;
  323. outline: none;
  324. background-color: #eee;
  325. transition: background-color 0.2s, border 0.2s;
  326. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNklEQVQ4T8XSMUvDQBQH8P/LElFa/AIZHcTBQSz0I/gFstTBRR2KUC4ldDxw7h0Bl3RRUATxi4iiODgoiLNrbQYp5J6cpJJqomkX33Z37/14d/dIa33MzDuYI4johOI4XhyNRteO46zNYjDzAxE1yBZprVeZ+QbAUhXEGJMA2Ox2u4+fQIa0mPmsCgCgJYQ4t7lfgF0opQYAdv9ABkKI/UnOFCClXKjX61cA1osQY8x9kiRNKeV7IWA3oyhaSdP0FkAtjxhj3hzH2RBCPOf3pzqYHCilfAAX+URm9oMguPzeWSGQvUcMYC8rOBJCHBRdqxTo9/vbRHRqi8bj8XKv1xvODbiuW2u32/bvf0SlDv4XYOY7z/Mavu+nM1+BmQ+NMc0wDF/LprP0DbTWW0T00ul0nn4b7Q87+X4Qmfiq2wAAAABJRU5ErkJggg==');
  327. background-position: 10px 10px;
  328. background-repeat: no-repeat;
  329. }
  330. .dark .searchbox {
  331. background-color: #111;
  332. color: #eee;
  333. }
  334. .searchbox::placeholder {
  335. color: #ccc;
  336. }
  337. .dark .searchbox::placeholder {
  338. color: #666;
  339. }
  340. .filter {
  341. width: calc(60% - 64px);
  342. }
  343. .reflookup {
  344. width: calc(40% - 10px);
  345. }
  346. input[type=text]:focus {
  347. background-color: white;
  348. border: 1px solid #333;
  349. }
  350. .dark input[type=text]:focus {
  351. background-color: #333;
  352. border: 1px solid #ccc;
  353. }
  354. mark.highlight {
  355. background-color: #5050ff;
  356. color: #fff;
  357. padding: 2px;
  358. border-radius: 6px;
  359. }
  360. .dark mark.highlight {
  361. background-color: #76a6da;
  362. color: #111;
  363. }
  364. .menubtn {
  365. background-color: white;
  366. border: none;
  367. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 20 20'%3E%3Cpath fill='none' d='M0 0h20v20H0V0z'/%3E%3Cpath d='M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z'/%3E%3C/svg%3E%0A");
  368. background-position: center;
  369. background-repeat: no-repeat;
  370. }
  371. .statsbtn {
  372. background-color: white;
  373. border: none;
  374. background-image: url("data:image/svg+xml,%3Csvg width='36' height='36' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h28v24H4V6zm0 8h28v8H4m9-16v24h10V5.8' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  375. background-position: center;
  376. background-repeat: no-repeat;
  377. }
  378. .iobtn {
  379. background-color: white;
  380. border: none;
  381. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M3 33v-7l6.8-7h16.5l6.7 7v7H3zM3.2 26H33M21 9l5-5.9 5 6h-2.5V15h-5V9H21zm-4.9 0l-5 6-5-6h2.5V3h5v6h2.5z'/%3E%3Cpath fill='none' stroke='%23000' d='M6.1 29.5H10'/%3E%3C/svg%3E");
  382. background-position: center;
  383. background-repeat: no-repeat;
  384. }
  385. .visbtn {
  386. background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath fill='none' stroke='%23333' d='M2.5 4.5h5v15h-5zM9.5 4.5h5v15h-5zM16.5 4.5h5v15h-5z'/%3E%3C/svg%3E");
  387. background-position: center;
  388. background-repeat: no-repeat;
  389. padding: 15px;
  390. }
  391. #vismenu-content {
  392. left: 0px;
  393. font-family: Verdana, sans-serif;
  394. }
  395. .dark .statsbtn,
  396. .dark .savebtn,
  397. .dark .menubtn,
  398. .dark .iobtn,
  399. .dark .visbtn {
  400. filter: invert(1);
  401. }
  402. .flexbox {
  403. display: flex;
  404. align-items: center;
  405. justify-content: space-between;
  406. width: 100%;
  407. }
  408. .savebtn {
  409. background-color: #d6d6d6;
  410. width: auto;
  411. height: 30px;
  412. flex-grow: 1;
  413. margin: 5px;
  414. border-radius: 4px;
  415. }
  416. .savebtn:active {
  417. background-color: #0a0;
  418. color: white;
  419. }
  420. .dark .savebtn:active {
  421. /* This will be inverted */
  422. background-color: #b3b;
  423. }
  424. .stats {
  425. border-collapse: collapse;
  426. font-size: 12pt;
  427. table-layout: fixed;
  428. width: 100%;
  429. min-width: 450px;
  430. }
  431. .dark .stats td {
  432. border: 1px solid #bbb;
  433. }
  434. .stats td {
  435. border: 1px solid black;
  436. padding: 5px;
  437. word-wrap: break-word;
  438. text-align: center;
  439. position: relative;
  440. }
  441. #checkbox-stats div {
  442. position: absolute;
  443. left: 0;
  444. top: 0;
  445. height: 100%;
  446. width: 100%;
  447. display: flex;
  448. align-items: center;
  449. justify-content: center;
  450. }
  451. #checkbox-stats .bar {
  452. background-color: rgba(28, 251, 0, 0.6);
  453. }
  454. .menu {
  455. position: relative;
  456. display: inline-block;
  457. margin: 10px 10px 10px 0px;
  458. }
  459. .menu-content {
  460. font-size: 12pt !important;
  461. text-align: left !important;
  462. font-weight: normal !important;
  463. display: none;
  464. position: absolute;
  465. background-color: white;
  466. right: 0;
  467. min-width: 300px;
  468. box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  469. z-index: 100;
  470. padding: 8px;
  471. }
  472. .dark .menu-content {
  473. background-color: #111;
  474. }
  475. .menu:hover .menu-content {
  476. display: block;
  477. }
  478. .menu:hover .menubtn,
  479. .menu:hover .iobtn,
  480. .menu:hover .statsbtn {
  481. background-color: #eee;
  482. }
  483. .menu-label {
  484. display: inline-block;
  485. padding: 8px;
  486. border: 1px solid #ccc;
  487. border-top: 0;
  488. width: calc(100% - 18px);
  489. }
  490. .menu-label-top {
  491. border-top: 1px solid #ccc;
  492. }
  493. .menu-textbox {
  494. float: left;
  495. height: 24px;
  496. margin: 10px 5px;
  497. padding: 5px 5px;
  498. font-family: Consolas, "DejaVu Sans Mono", Monaco, monospace;
  499. font-size: 14px;
  500. box-sizing: border-box;
  501. border: 1px solid #888;
  502. border-radius: 4px;
  503. outline: none;
  504. background-color: #eee;
  505. transition: background-color 0.2s, border 0.2s;
  506. width: calc(100% - 10px);
  507. }
  508. .menu-textbox.invalid,
  509. .dark .menu-textbox.invalid {
  510. color: red;
  511. }
  512. .dark .menu-textbox {
  513. background-color: #222;
  514. color: #eee;
  515. }
  516. .radio-container {
  517. margin: 4px;
  518. }
  519. .topmostdiv {
  520. width: 100%;
  521. height: 100%;
  522. background-color: white;
  523. transition: background-color 0.3s;
  524. }
  525. #top {
  526. height: 78px;
  527. border-bottom: 2px solid black;
  528. }
  529. .dark #top {
  530. border-bottom: 2px solid #ccc;
  531. }
  532. #dbg {
  533. display: block;
  534. }
  535. ::-webkit-scrollbar {
  536. width: 8px;
  537. }
  538. ::-webkit-scrollbar-track {
  539. background: #aaa;
  540. }
  541. ::-webkit-scrollbar-thumb {
  542. background: #666;
  543. border-radius: 3px;
  544. }
  545. ::-webkit-scrollbar-thumb:hover {
  546. background: #555;
  547. }
  548. .slider {
  549. -webkit-appearance: none;
  550. width: 100%;
  551. margin: 3px 0;
  552. padding: 0;
  553. outline: none;
  554. opacity: 0.7;
  555. -webkit-transition: .2s;
  556. transition: opacity .2s;
  557. border-radius: 3px;
  558. }
  559. .slider:hover {
  560. opacity: 1;
  561. }
  562. .slider:focus {
  563. outline: none;
  564. }
  565. .slider::-webkit-slider-runnable-track {
  566. -webkit-appearance: none;
  567. width: 100%;
  568. height: 8px;
  569. background: #d3d3d3;
  570. border-radius: 3px;
  571. border: none;
  572. }
  573. .slider::-webkit-slider-thumb {
  574. -webkit-appearance: none;
  575. width: 15px;
  576. height: 15px;
  577. border-radius: 50%;
  578. background: #0a0;
  579. cursor: pointer;
  580. margin-top: -4px;
  581. }
  582. .dark .slider::-webkit-slider-thumb {
  583. background: #3d3;
  584. }
  585. .slider::-moz-range-thumb {
  586. width: 15px;
  587. height: 15px;
  588. border-radius: 50%;
  589. background: #0a0;
  590. cursor: pointer;
  591. }
  592. .slider::-moz-range-track {
  593. height: 8px;
  594. background: #d3d3d3;
  595. border-radius: 3px;
  596. }
  597. .dark .slider::-moz-range-thumb {
  598. background: #3d3;
  599. }
  600. .slider::-ms-track {
  601. width: 100%;
  602. height: 8px;
  603. border-width: 3px 0;
  604. background: transparent;
  605. border-color: transparent;
  606. color: transparent;
  607. transition: opacity .2s;
  608. }
  609. .slider::-ms-fill-lower {
  610. background: #d3d3d3;
  611. border: none;
  612. border-radius: 3px;
  613. }
  614. .slider::-ms-fill-upper {
  615. background: #d3d3d3;
  616. border: none;
  617. border-radius: 3px;
  618. }
  619. .slider::-ms-thumb {
  620. width: 15px;
  621. height: 15px;
  622. border-radius: 50%;
  623. background: #0a0;
  624. cursor: pointer;
  625. margin: 0;
  626. }
  627. .shameless-plug {
  628. font-size: 0.8em;
  629. text-align: center;
  630. display: block;
  631. }
  632. a {
  633. color: #0278a4;
  634. }
  635. .dark a {
  636. color: #00b9fd;
  637. }
  638. #frontcanvas,
  639. #backcanvas {
  640. touch-action: none;
  641. }
  642. .placeholder {
  643. border: 1px dashed #9f9fda !important;
  644. background-color: #edf2f7 !important;
  645. }
  646. .dragging {
  647. z-index: 999;
  648. }
  649. .dark .dragging>table>tbody>tr {
  650. background-color: #252c30;
  651. }
  652. .dark .placeholder {
  653. filter: invert(1);
  654. }
  655. .column-spacer {
  656. top: 0;
  657. left: 0;
  658. width: calc(100% - 4px);
  659. position: absolute;
  660. cursor: pointer;
  661. user-select: none;
  662. height: 100%;
  663. }
  664. .column-width-handle {
  665. top: 0;
  666. right: 0;
  667. width: 4px;
  668. position: absolute;
  669. cursor: col-resize;
  670. user-select: none;
  671. height: 100%;
  672. }
  673. .column-width-handle:hover {
  674. background-color: #4f99bd;
  675. }
  676. </style>
  677. <script type="text/javascript" >
  678. ///////////////////////////////////////////////
  679. /*
  680. Split.js - v1.3.5
  681. MIT License
  682. https://github.com/nathancahill/Split.js
  683. */
  684. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Split=t()}(this,function(){"use strict";var e=window,t=e.document,n="addEventListener",i="removeEventListener",r="getBoundingClientRect",s=function(){return!1},o=e.attachEvent&&!e[n],a=["","-webkit-","-moz-","-o-"].filter(function(e){var n=t.createElement("div");return n.style.cssText="width:"+e+"calc(9px)",!!n.style.length}).shift()+"calc",l=function(e){return"string"==typeof e||e instanceof String?t.querySelector(e):e};return function(u,c){function z(e,t,n){var i=A(y,t,n);Object.keys(i).forEach(function(t){return e.style[t]=i[t]})}function h(e,t){var n=B(y,t);Object.keys(n).forEach(function(t){return e.style[t]=n[t]})}function f(e){var t=E[this.a],n=E[this.b],i=t.size+n.size;t.size=e/this.size*i,n.size=i-e/this.size*i,z(t.element,t.size,this.aGutterSize),z(n.element,n.size,this.bGutterSize)}function m(e){var t;this.dragging&&((t="touches"in e?e.touches[0][b]-this.start:e[b]-this.start)<=E[this.a].minSize+M+this.aGutterSize?t=E[this.a].minSize+this.aGutterSize:t>=this.size-(E[this.b].minSize+M+this.bGutterSize)&&(t=this.size-(E[this.b].minSize+this.bGutterSize)),f.call(this,t),c.onDrag&&c.onDrag())}function g(){var e=E[this.a].element,t=E[this.b].element;this.size=e[r]()[y]+t[r]()[y]+this.aGutterSize+this.bGutterSize,this.start=e[r]()[G]}function d(){var t=this,n=E[t.a].element,r=E[t.b].element;t.dragging&&c.onDragEnd&&c.onDragEnd(),t.dragging=!1,e[i]("mouseup",t.stop),e[i]("touchend",t.stop),e[i]("touchcancel",t.stop),t.parent[i]("mousemove",t.move),t.parent[i]("touchmove",t.move),delete t.stop,delete t.move,n[i]("selectstart",s),n[i]("dragstart",s),r[i]("selectstart",s),r[i]("dragstart",s),n.style.userSelect="",n.style.webkitUserSelect="",n.style.MozUserSelect="",n.style.pointerEvents="",r.style.userSelect="",r.style.webkitUserSelect="",r.style.MozUserSelect="",r.style.pointerEvents="",t.gutter.style.cursor="",t.parent.style.cursor=""}function S(t){var i=this,r=E[i.a].element,o=E[i.b].element;!i.dragging&&c.onDragStart&&c.onDragStart(),t.preventDefault(),i.dragging=!0,i.move=m.bind(i),i.stop=d.bind(i),e[n]("mouseup",i.stop),e[n]("touchend",i.stop),e[n]("touchcancel",i.stop),i.parent[n]("mousemove",i.move),i.parent[n]("touchmove",i.move),r[n]("selectstart",s),r[n]("dragstart",s),o[n]("selectstart",s),o[n]("dragstart",s),r.style.userSelect="none",r.style.webkitUserSelect="none",r.style.MozUserSelect="none",r.style.pointerEvents="none",o.style.userSelect="none",o.style.webkitUserSelect="none",o.style.MozUserSelect="none",o.style.pointerEvents="none",i.gutter.style.cursor=j,i.parent.style.cursor=j,g.call(i)}function v(e){e.forEach(function(t,n){if(n>0){var i=F[n-1],r=E[i.a],s=E[i.b];r.size=e[n-1],s.size=t,z(r.element,r.size,i.aGutterSize),z(s.element,s.size,i.bGutterSize)}})}function p(){F.forEach(function(e){e.parent.removeChild(e.gutter),E[e.a].element.style[y]="",E[e.b].element.style[y]=""})}void 0===c&&(c={});var y,b,G,E,w=l(u[0]).parentNode,D=e.getComputedStyle(w).flexDirection,U=c.sizes||u.map(function(){return 100/u.length}),k=void 0!==c.minSize?c.minSize:100,x=Array.isArray(k)?k:u.map(function(){return k}),L=void 0!==c.gutterSize?c.gutterSize:10,M=void 0!==c.snapOffset?c.snapOffset:30,O=c.direction||"horizontal",j=c.cursor||("horizontal"===O?"ew-resize":"ns-resize"),C=c.gutter||function(e,n){var i=t.createElement("div");return i.className="gutter gutter-"+n,i},A=c.elementStyle||function(e,t,n){var i={};return"string"==typeof t||t instanceof String?i[e]=t:i[e]=o?t+"%":a+"("+t+"% - "+n+"px)",i},B=c.gutterStyle||function(e,t){return n={},n[e]=t+"px",n;var n};"horizontal"===O?(y="width","clientWidth",b="clientX",G="left","paddingLeft"):"vertical"===O&&(y="height","clientHeight",b="clientY",G="top","paddingTop");var F=[];return E=u.map(function(e,t){var i,s={element:l(e),size:U[t],minSize:x[t]};if(t>0&&(i={a:t-1,b:t,dragging:!1,isFirst:1===t,isLast:t===u.length-1,direction:O,parent:w},i.aGutterSize=L,i.bGutterSize=L,i.isFirst&&(i.aGutterSize=L/2),i.isLast&&(i.bGutterSize=L/2),"row-reverse"===D||"column-reverse"===D)){var a=i.a;i.a=i.b,i.b=a}if(!o&&t>0){var c=C(t,O);h(c,L),c[n]("mousedown",S.bind(i)),c[n]("touchstart",S.bind(i)),w.insertBefore(c,s.element),i.gutter=c}0===t||t===u.length-1?z(s.element,s.size,L/2):z(s.element,s.size,L);var f=s.element[r]()[y];return f<s.minSize&&(s.minSize=f),t>0&&F.push(i),s}),o?{setSizes:v,destroy:p}:{setSizes:v,getSizes:function(){return E.map(function(e){return e.size})},collapse:function(e){if(e===F.length){var t=F[e-1];g.call(t),o||f.call(t,t.size-t.bGutterSize)}else{var n=F[e];g.call(n),o||f.call(n,n.aGutterSize)}},destroy:p}}});
  685. ///////////////////////////////////////////////
  686. ///////////////////////////////////////////////
  687. // Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
  688. // This work is free. You can redistribute it and/or modify it
  689. // under the terms of the WTFPL, Version 2
  690. // For more information see LICENSE.txt or http://www.wtfpl.net/
  691. //
  692. // For more information, the home page:
  693. // http://pieroxy.net/blog/pages/lz-string/testing.html
  694. //
  695. // LZ-based compression algorithm, version 1.4.4
  696. var LZString=function(){var o=String.fromCharCode,i={};var n={decompressFromBase64:function(o){return null==o?"":""==o?null:n._decompress(o.length,32,function(n){return function(o,n){if(!i[o]){i[o]={};for(var t=0;t<o.length;t++)i[o][o.charAt(t)]=t}return i[o][n]}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o.charAt(n))})},_decompress:function(i,n,t){var r,e,a,s,p,u,l,f=[],c=4,d=4,h=3,v="",g=[],m={val:t(0),position:n,index:1};for(r=0;r<3;r+=1)f[r]=r;for(a=0,p=Math.pow(2,2),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;switch(a){case 0:for(a=0,p=Math.pow(2,8),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;l=o(a);break;case 1:for(a=0,p=Math.pow(2,16),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;l=o(a);break;case 2:return""}for(f[3]=l,e=l,g.push(l);;){if(m.index>i)return"";for(a=0,p=Math.pow(2,h),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;switch(l=a){case 0:for(a=0,p=Math.pow(2,8),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;f[d++]=o(a),l=d-1,c--;break;case 1:for(a=0,p=Math.pow(2,16),u=1;u!=p;)s=m.val&m.position,m.position>>=1,0==m.position&&(m.position=n,m.val=t(m.index++)),a|=(s>0?1:0)*u,u<<=1;f[d++]=o(a),l=d-1,c--;break;case 2:return g.join("")}if(0==c&&(c=Math.pow(2,h),h++),f[l])v=f[l];else{if(l!==d)return null;v=e+e.charAt(0)}g.push(v),f[d++]=e+v.charAt(0),e=v,0==--c&&(c=Math.pow(2,h),h++)}}};return n}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return LZString});
  697. ///////////////////////////////////////////////
  698. ///////////////////////////////////////////////
  699. /*!
  700. * PEP v0.4.3 | https://github.com/jquery/PEP
  701. * Copyright jQuery Foundation and other contributors | http://jquery.org/license
  702. */
  703. !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()}(this,function(){"use strict";function a(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1);
  704. for(var d,e=2;e<m.length;e++)d=m[e],c[d]=b[d]||n[e];c.buttons=b.buttons||0;
  705. var f=0;return f=b.pressure&&c.buttons?b.pressure:c.buttons?.5:0,c.x=c.clientX,c.y=c.clientY,c.pointerId=b.pointerId||0,c.width=b.width||0,c.height=b.height||0,c.pressure=f,c.tiltX=b.tiltX||0,c.tiltY=b.tiltY||0,c.twist=b.twist||0,c.tangentialPressure=b.tangentialPressure||0,c.pointerType=b.pointerType||"",c.hwTimestamp=b.hwTimestamp||0,c.isPrimary=b.isPrimary||!1,c}function b(){this.array=[],this.size=0}function c(a,b,c,d){this.addCallback=a.bind(d),this.removeCallback=b.bind(d),this.changedCallback=c.bind(d),A&&(this.observer=new A(this.mutationWatcher.bind(this)))}function d(a){return"body /shadow-deep/ "+e(a)}function e(a){return'[touch-action="'+a+'"]'}function f(a){return"{ -ms-touch-action: "+a+"; touch-action: "+a+"; }"}function g(){if(F){D.forEach(function(a){String(a)===a?(E+=e(a)+f(a)+"\n",G&&(E+=d(a)+f(a)+"\n")):(E+=a.selectors.map(e)+f(a.rule)+"\n",G&&(E+=a.selectors.map(d)+f(a.rule)+"\n"))});var a=document.createElement("style");a.textContent=E,document.head.appendChild(a)}}function h(){if(!window.PointerEvent){if(window.PointerEvent=a,window.navigator.msPointerEnabled){var b=window.navigator.msMaxTouchPoints;Object.defineProperty(window.navigator,"maxTouchPoints",{value:b,enumerable:!0}),u.registerSource("ms",_)}else Object.defineProperty(window.navigator,"maxTouchPoints",{value:0,enumerable:!0}),u.registerSource("mouse",N),void 0!==window.ontouchstart&&u.registerSource("touch",V);u.register(document)}}function i(a){if(!u.pointermap.has(a)){var b=new Error("InvalidPointerId");throw b.name="InvalidPointerId",b}}function j(a){for(var b=a.parentNode;b&&b!==a.ownerDocument;)b=b.parentNode;if(!b){var c=new Error("InvalidStateError");throw c.name="InvalidStateError",c}}function k(a){var b=u.pointermap.get(a);return 0!==b.buttons}function l(){window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:W},releasePointerCapture:{value:X},hasPointerCapture:{value:Y}})}
  706. var m=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],n=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],o=window.Map&&window.Map.prototype.forEach,p=o?Map:b;b.prototype={set:function(a,b){return void 0===b?this["delete"](a):(this.has(a)||this.size++,void(this.array[a]=b))},has:function(a){return void 0!==this.array[a]},"delete":function(a){this.has(a)&&(delete this.array[a],this.size--)},get:function(a){return this.array[a]},clear:function(){this.array.length=0,this.size=0},forEach:function(a,b){return this.array.forEach(function(c,d){a.call(b,c,d,this)},this)}};var q=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],r=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],s={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},t="undefined"!=typeof SVGElementInstance,u={pointermap:new p,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(a,b){var c=b,d=c.events;d&&(d.forEach(function(a){c[a]&&(this.eventMap[a]=c[a].bind(c))},this),this.eventSources[a]=c,this.eventSourceList.push(c))},register:function(a){for(var b,c=this.eventSourceList.length,d=0;d<c&&(b=this.eventSourceList[d]);d++)
  707. b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;d<c&&(b=this.eventSourceList[d]);d++)
  708. b.unregister.call(b,a)},contains:function(a,b){try{return a.contains(b)}catch(c){return!1}},down:function(a){a.bubbles=!0,this.fireEvent("pointerdown",a)},move:function(a){a.bubbles=!0,this.fireEvent("pointermove",a)},up:function(a){a.bubbles=!0,this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){a.bubbles=!0,this.fireEvent("pointercancel",a)},leaveOut:function(a){this.out(a),this.propagate(a,this.leave,!1)},enterOver:function(a){this.over(a),this.propagate(a,this.enter,!0)},eventHandler:function(a){if(!a._handledByPE){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),a._handledByPE=!0}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(b,c){this.captureInfo[c.pointerId]&&(c.relatedTarget=null);var d=new a(b,c);return c.preventDefault&&(d.preventDefault=c.preventDefault),d._target=d._target||c.target,d},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){for(var b,c=Object.create(null),d=0;d<q.length;d++)b=q[d],c[b]=a[b]||r[d],!t||"target"!==b&&"relatedTarget"!==b||c[b]instanceof SVGElementInstance&&(c[b]=c[b].correspondingUseElement);return a.preventDefault&&(c.preventDefault=function(){a.preventDefault()}),c},getTarget:function(a){var b=this.captureInfo[a.pointerId];return b?a._target!==b&&a.type in s?void 0:b:a._target},propagate:function(a,b,c){for(var d=a.target,e=[];d!==document&&!d.contains(a.relatedTarget);) if(e.push(d),d=d.parentNode,!d)return;c&&e.reverse(),e.forEach(function(c){a.target=c,b.call(this,a)},this)},setCapture:function(b,c,d){this.captureInfo[b]&&this.releaseCapture(b,d),this.captureInfo[b]=c,this.implicitRelease=this.releaseCapture.bind(this,b,d),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease);var e=new a("gotpointercapture");e.pointerId=b,e._target=c,d||this.asyncDispatchEvent(e)},releaseCapture:function(b,c){var d=this.captureInfo[b];if(d){this.captureInfo[b]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease);var e=new a("lostpointercapture");e.pointerId=b,e._target=d,c||this.asyncDispatchEvent(e)}},dispatchEvent:/*scope.external.dispatchEvent || */function(a){var b=this.getTarget(a);if(b)return b.dispatchEvent(a)},asyncDispatchEvent:function(a){requestAnimationFrame(this.dispatchEvent.bind(this,a))}};u.boundHandler=u.eventHandler.bind(u);var v={shadow:function(a){if(a)return a.shadowRoot||a.webkitShadowRoot},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);if(this.canTarget(b))return b},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for(e=this.targetingShadow(f);e;){if(d=e.elementFromPoint(b,c)){var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d} e=this.olderShadow(e)} return f}},owner:function(a){
  709. for(var b=a;b.parentNode;)b=b.parentNode;
  710. return b.nodeType!==Node.DOCUMENT_NODE&&b.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(b=document),b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target);
  711. return d.elementFromPoint(b,c)||(d=document),this.searchRoot(d,b,c)}},w=Array.prototype.forEach.call.bind(Array.prototype.forEach),x=Array.prototype.map.call.bind(Array.prototype.map),y=Array.prototype.slice.call.bind(Array.prototype.slice),z=Array.prototype.filter.call.bind(Array.prototype.filter),A=window.MutationObserver||window.WebKitMutationObserver,B="[touch-action]",C={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};c.prototype={watchSubtree:function(a){
  712. //
  713. this.observer&&v.canTarget(a)&&this.observer.observe(a,C)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){w(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(B):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(y(b))},
  714. installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){
  715. var b=x(a,this.findElements,this);
  716. return b.push(z(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}};var D=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],E="",F=window.PointerEvent||window.MSPointerEvent,G=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,H=u.pointermap,I=25,J=[1,4,2,8,16],K=!1;try{K=1===new MouseEvent("test",{buttons:1}).buttons}catch(L){}
  717. var M,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},lastTouches:[],
  718. isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,d=a.clientX,e=a.clientY,f=0,g=c.length;f<g&&(b=c[f]);f++){
  719. var h=Math.abs(d-b.x),i=Math.abs(e-b.y);if(h<=I&&i<=I)return!0}},prepareEvent:function(a){var b=u.cloneEvent(a),c=b.preventDefault;return b.preventDefault=function(){a.preventDefault(),c()},b.pointerId=this.POINTER_ID,b.isPrimary=!0,b.pointerType=this.POINTER_TYPE,b},prepareButtonsForMove:function(a,b){var c=H.get(this.POINTER_ID);
  720. 0!==b.which&&c?a.buttons=c.buttons:a.buttons=0,b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=H.get(this.POINTER_ID),c=this.prepareEvent(a);K||(c.buttons=J[c.button],b&&(c.buttons|=b.buttons),a.buttons=c.buttons),H.set(this.POINTER_ID,a),b&&0!==b.buttons?u.move(c):u.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);K||this.prepareButtonsForMove(b,a),b.button=-1,H.set(this.POINTER_ID,a),u.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=H.get(this.POINTER_ID),c=this.prepareEvent(a);if(!K){var d=J[c.button];
  721. c.buttons=b?b.buttons&~d:0,a.buttons=c.buttons}H.set(this.POINTER_ID,a),
  722. c.buttons&=~J[c.button],0===c.buttons?u.up(c):u.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);K||this.prepareButtonsForMove(b,a),b.button=-1,H.set(this.POINTER_ID,a),u.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);K||this.prepareButtonsForMove(b,a),b.button=-1,u.leaveOut(b)}},cancel:function(a){var b=this.prepareEvent(a);u.cancel(b),this.deactivateMouse()},deactivateMouse:function(){H["delete"](this.POINTER_ID)}},O=u.captureInfo,P=v.findTarget.bind(v),Q=v.allShadows.bind(v),R=u.pointermap,S=2500,T=200,U="touch-action",V={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){M.enableOnSubtree(a)},unregister:function(){},elementAdded:function(a){var b=a.getAttribute(U),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,u.listen(a,this.events),
  723. Q(a).forEach(function(a){a._scrollType=c,u.listen(a,this.events)},this))},elementRemoved:function(a){a._scrollType=void 0,u.unlisten(a,this.events),
  724. Q(a).forEach(function(a){a._scrollType=void 0,u.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(U),d=this.touchActionToScrollType(c),e=this.touchActionToScrollType(b);
  725. d&&e?(a._scrollType=d,Q(a).forEach(function(a){a._scrollType=d},this)):e?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){
  726. (0===R.size||1===R.size&&R.has(1))&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(a){a.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,T)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;return"touchstart"!==a&&"touchmove"!==a||(b=1),b},touchToPointer:function(a){var b=this.currentTouchEvent,c=u.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=O[d]||P(c),c.bubbles=!0,c.cancelable=!0,c.detail=this.clickCount,c.button=0,c.buttons=this.typeToButtons(b.type),c.width=2*(a.radiusX||a.webkitRadiusX||0),c.height=2*(a.radiusY||a.webkitRadiusY||0),c.pressure=a.force||a.webkitForce||.5,c.isPrimary=this.isPrimaryTouch(a),c.pointerType=this.POINTER_TYPE,
  727. c.altKey=b.altKey,c.ctrlKey=b.ctrlKey,c.metaKey=b.metaKey,c.shiftKey=b.shiftKey;
  728. var e=this;return c.preventDefault=function(){e.scrolling=!1,e.firstXY=null,b.preventDefault()},c},processTouches:function(a,b){var c=a.changedTouches;this.currentTouchEvent=a;for(var d,e=0;e<c.length;e++)d=c[e],b.call(this,this.touchToPointer(d))},
  729. shouldScroll:function(a){if(this.firstXY){var b,c=a.currentTarget._scrollType;if("none"===c)
  730. b=!1;else if("XY"===c)
  731. b=!0;else{var d=a.changedTouches[0],e=c,f="Y"===c?"X":"Y",g=Math.abs(d["client"+e]-this.firstXY[e]),h=Math.abs(d["client"+f]-this.firstXY[f]);
  732. b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;d<e&&(c=a[d]);d++)if(c.identifier===b)return!0},
  733. vacuumTouches:function(a){var b=a.touches;
  734. if(R.size>=b.length){var c=[];R.forEach(function(a,d){
  735. if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(e)}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){R.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),u.enterOver(a),u.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,c=R.get(b.pointerId);
  736. if(c){var d=c.out,e=c.outTarget;u.move(b),d&&e!==b.target&&(d.relatedTarget=b.target,b.relatedTarget=e,
  737. d.target=e,b.target?(u.leaveOut(d),u.enterOver(b)):(
  738. b.target=e,b.relatedTarget=null,this.cancelOut(b))),c.out=b,c.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(u.up(a),u.leaveOut(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){u.cancel(a),u.leaveOut(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){R["delete"](a.pointerId),this.removePrimaryPointer(a)},
  739. dedupSynthMouse:function(a){var b=N.lastTouches,c=a.changedTouches[0];
  740. if(this.isPrimaryTouch(c)){
  741. var d={x:c.clientX,y:c.clientY};b.push(d);var e=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,b,d);setTimeout(e,S)}}};M=new c(V.elementAdded,V.elementRemoved,V.elementChanged,V);var W,X,Y,Z=u.pointermap,$=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,_={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;return $&&(b=u.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]),b},cleanup:function(a){Z["delete"](a)},MSPointerDown:function(a){Z.set(a.pointerId,a);var b=this.prepareEvent(a);u.down(b)},MSPointerMove:function(a){var b=this.prepareEvent(a);u.move(b)},MSPointerUp:function(a){var b=this.prepareEvent(a);u.up(b),this.cleanup(a.pointerId)},MSPointerOut:function(a){var b=this.prepareEvent(a);u.leaveOut(b)},MSPointerOver:function(a){var b=this.prepareEvent(a);u.enterOver(b)},MSPointerCancel:function(a){var b=this.prepareEvent(a);u.cancel(b),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var b=u.makeEvent("lostpointercapture",a);u.dispatchEvent(b)},MSGotPointerCapture:function(a){var b=u.makeEvent("gotpointercapture",a);u.dispatchEvent(b)}},aa=window.navigator;aa.msPointerEnabled?(W=function(a){i(a),j(this),k(a)&&(u.setCapture(a,this,!0),this.msSetPointerCapture(a))},X=function(a){i(a),u.releaseCapture(a,!0),this.msReleasePointerCapture(a)}):(W=function(a){i(a),j(this),k(a)&&u.setCapture(a,this)},X=function(a){i(a),u.releaseCapture(a)}),Y=function(a){return!!u.captureInfo[a]},g(),h(),l();var ba={dispatcher:u,Installer:c,PointerEvent:a,PointerMap:p,targetFinding:v};return ba});
  742. ///////////////////////////////////////////////
  743. ///////////////////////////////////////////////
  744. var config = {"dark_mode": false, "show_pads": true, "show_fabrication": false, "show_silkscreen": true, "highlight_pin1": false, "redraw_on_drag": true, "board_rotation": 0, "checkboxes": "Sourced,Placed", "bom_view": "left-right", "layer_view": "FB", "fields": ["Value", "Footprint"]}
  745. ///////////////////////////////////////////////
  746. ///////////////////////////////////////////////
  747. var pcbdata = JSON.parse(LZString.decompressFromBase64("N4IgpgJg5mDOD6AjRB7AHiAXAAlAWwEsA7DHATjIDoAmARgBYAabEQogTy2wHYAOSgAwCArM1YBDNKWy1a3Sr2pkxeSZxy0BVevW4BfMZBiwuAbVAAXdgAcwXELDBQ8YIhZBjYF8QCd3OU1l5biVmPkpNYQBdQyIIMyDKEOUZLUoAZl0YlgB3AggLAAsuARoDXBArW3tHZ1d3T28/BLkk0NSqTO5s8DizCgyGZk1OrLE8guKcUupyyxs7HAcnFzcPFi9ff2xTAfShjoyxlld4gL2D8MieiaKSsuZ56qXa1YaNpu3dzsv+a9izjtEskwn8RDd8ndpmUehAfOI8kQoCYcKBYAQADYAa1gAGMfGBXFxQAAxMyWQoEXFYohwFHYUq0UQbABuUGs4ihLAAspp6DRqOkBNReIxNLQIrwQsJuAAZPmUei8MgANjIonFkul3F5An5KoE6TIos1BpVQvo8r1AqFIrFAglZotVv51EFwpNQgUAnNepdl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zXcoHVVaq//izasdndAA1VGqsDAWqkbUgAM1XDAd7VUq+1W0qx1UzakADOq5gCuqwHWjs2lWzad7X48gIBWq91W2qtolVKJpQWAeAAQAV5XEgSpQEAElXwAFkDkExpTNKJYAsgeHARAL+BAAA=="))
  748. ///////////////////////////////////////////////
  749. ///////////////////////////////////////////////
  750. /* Utility functions */
  751. var storagePrefix = 'KiCad_HTML_BOM__' + pcbdata.metadata.title + '__' +
  752. pcbdata.metadata.revision + '__#';
  753. var storage;
  754. function initStorage(key) {
  755. try {
  756. window.localStorage.getItem("blank");
  757. storage = window.localStorage;
  758. } catch (e) {
  759. // localStorage not available
  760. }
  761. if (!storage) {
  762. try {
  763. window.sessionStorage.getItem("blank");
  764. storage = window.sessionStorage;
  765. } catch (e) {
  766. // sessionStorage also not available
  767. }
  768. }
  769. }
  770. function readStorage(key) {
  771. if (storage) {
  772. return storage.getItem(storagePrefix + key);
  773. } else {
  774. return null;
  775. }
  776. }
  777. function writeStorage(key, value) {
  778. if (storage) {
  779. storage.setItem(storagePrefix + key, value);
  780. }
  781. }
  782. function fancyDblClickHandler(el, onsingle, ondouble) {
  783. return function() {
  784. if (el.getAttribute("data-dblclick") == null) {
  785. el.setAttribute("data-dblclick", 1);
  786. setTimeout(function() {
  787. if (el.getAttribute("data-dblclick") == 1) {
  788. onsingle();
  789. }
  790. el.removeAttribute("data-dblclick");
  791. }, 200);
  792. } else {
  793. el.removeAttribute("data-dblclick");
  794. ondouble();
  795. }
  796. }
  797. }
  798. function smoothScrollToRow(rowid) {
  799. document.getElementById(rowid).scrollIntoView({
  800. behavior: "smooth",
  801. block: "center",
  802. inline: "nearest"
  803. });
  804. }
  805. function focusInputField(input) {
  806. input.scrollIntoView(false);
  807. input.focus();
  808. input.select();
  809. }
  810. function copyToClipboard() {
  811. var text = '';
  812. for (var node of bomhead.childNodes[0].childNodes) {
  813. if (node.firstChild) {
  814. text = text + node.firstChild.nodeValue;
  815. }
  816. if (node != bomhead.childNodes[0].lastChild) {
  817. text += '\t';
  818. }
  819. }
  820. text += '\n';
  821. for (var row of bombody.childNodes) {
  822. for (var cell of row.childNodes) {
  823. for (var node of cell.childNodes) {
  824. if (node.nodeName == "INPUT") {
  825. if (node.checked) {
  826. text = text + '✓';
  827. }
  828. } else if (node.nodeName == "MARK") {
  829. text = text + node.firstChild.nodeValue;
  830. } else {
  831. text = text + node.nodeValue;
  832. }
  833. }
  834. if (cell != row.lastChild) {
  835. text += '\t';
  836. }
  837. }
  838. text += '\n';
  839. }
  840. var textArea = document.createElement("textarea");
  841. textArea.classList.add('clipboard-temp');
  842. textArea.value = text;
  843. document.body.appendChild(textArea);
  844. textArea.focus();
  845. textArea.select();
  846. try {
  847. if (document.execCommand('copy')) {
  848. console.log('Bom copied to clipboard.');
  849. }
  850. } catch (err) {
  851. console.log('Can not copy to clipboard.');
  852. }
  853. document.body.removeChild(textArea);
  854. }
  855. function removeGutterNode(node) {
  856. for (var i = 0; i < node.childNodes.length; i++) {
  857. if (node.childNodes[i].classList &&
  858. node.childNodes[i].classList.contains("gutter")) {
  859. node.removeChild(node.childNodes[i]);
  860. break;
  861. }
  862. }
  863. }
  864. function cleanGutters() {
  865. removeGutterNode(document.getElementById("bot"));
  866. removeGutterNode(document.getElementById("canvasdiv"));
  867. }
  868. var units = {
  869. prefixes: {
  870. giga: ["G", "g", "giga", "Giga", "GIGA"],
  871. mega: ["M", "mega", "Mega", "MEGA"],
  872. kilo: ["K", "k", "kilo", "Kilo", "KILO"],
  873. milli: ["m", "milli", "Milli", "MILLI"],
  874. micro: ["U", "u", "micro", "Micro", "MICRO", "μ", "µ"], // different utf8 μ
  875. nano: ["N", "n", "nano", "Nano", "NANO"],
  876. pico: ["P", "p", "pico", "Pico", "PICO"],
  877. },
  878. unitsShort: ["R", "r", "Ω", "F", "f", "H", "h"],
  879. unitsLong: [
  880. "OHM", "Ohm", "ohm", "ohms",
  881. "FARAD", "Farad", "farad",
  882. "HENRY", "Henry", "henry"
  883. ],
  884. getMultiplier: function(s) {
  885. if (this.prefixes.giga.includes(s)) return 1e9;
  886. if (this.prefixes.mega.includes(s)) return 1e6;
  887. if (this.prefixes.kilo.includes(s)) return 1e3;
  888. if (this.prefixes.milli.includes(s)) return 1e-3;
  889. if (this.prefixes.micro.includes(s)) return 1e-6;
  890. if (this.prefixes.nano.includes(s)) return 1e-9;
  891. if (this.prefixes.pico.includes(s)) return 1e-12;
  892. return 1;
  893. },
  894. valueRegex: null,
  895. }
  896. function initUtils() {
  897. var allPrefixes = units.prefixes.giga
  898. .concat(units.prefixes.mega)
  899. .concat(units.prefixes.kilo)
  900. .concat(units.prefixes.milli)
  901. .concat(units.prefixes.micro)
  902. .concat(units.prefixes.nano)
  903. .concat(units.prefixes.pico);
  904. var allUnits = units.unitsShort.concat(units.unitsLong);
  905. units.valueRegex = new RegExp("^([0-9\.]+)" +
  906. "\\s*(" + allPrefixes.join("|") + ")?" +
  907. "(" + allUnits.join("|") + ")?" +
  908. "(\\b.*)?$", "");
  909. units.valueAltRegex = new RegExp("^([0-9]*)" +
  910. "(" + units.unitsShort.join("|") + ")?" +
  911. "([GgMmKkUuNnPp])?" +
  912. "([0-9]*)" +
  913. "(\\b.*)?$", "");
  914. if (config.fields.includes("Value")) {
  915. var index = config.fields.indexOf("Value");
  916. pcbdata.bom["parsedValues"] = {};
  917. for (var id in pcbdata.bom.fields) {
  918. pcbdata.bom.parsedValues[id] = parseValue(pcbdata.bom.fields[id][index])
  919. }
  920. }
  921. }
  922. function parseValue(val, ref) {
  923. var inferUnit = (unit, ref) => {
  924. if (unit) {
  925. unit = unit.toLowerCase();
  926. if (unit == 'Ω' || unit == "ohm" || unit == "ohms") {
  927. unit = 'r';
  928. }
  929. unit = unit[0];
  930. } else {
  931. ref = /^([a-z]+)\d+$/i.exec(ref);
  932. if (ref) {
  933. ref = ref[1].toLowerCase();
  934. if (ref == "c") unit = 'f';
  935. else if (ref == "l") unit = 'h';
  936. else if (ref == "r" || ref == "rv") unit = 'r';
  937. else unit = null;
  938. }
  939. }
  940. return unit;
  941. };
  942. val = val.replace(/,/g, "");
  943. var match = units.valueRegex.exec(val);
  944. var unit;
  945. if (match) {
  946. val = parseFloat(match[1]);
  947. if (match[2]) {
  948. val = val * units.getMultiplier(match[2]);
  949. }
  950. unit = inferUnit(match[3], ref);
  951. if (!unit) return null;
  952. else return {
  953. val: val,
  954. unit: unit,
  955. extra: match[4],
  956. }
  957. }
  958. match = units.valueAltRegex.exec(val);
  959. if (match && (match[1] || match[4])) {
  960. val = parseFloat(match[1] + "." + match[4]);
  961. if (match[3]) {
  962. val = val * units.getMultiplier(match[3]);
  963. }
  964. unit = inferUnit(match[2], ref);
  965. if (!unit) return null;
  966. else return {
  967. val: val,
  968. unit: unit,
  969. extra: match[5],
  970. }
  971. }
  972. return null;
  973. }
  974. function valueCompare(a, b, stra, strb) {
  975. if (a === null && b === null) {
  976. // Failed to parse both values, compare them as strings.
  977. if (stra != strb) return stra > strb ? 1 : -1;
  978. else return 0;
  979. } else if (a === null) {
  980. return 1;
  981. } else if (b === null) {
  982. return -1;
  983. } else {
  984. if (a.unit != b.unit) return a.unit > b.unit ? 1 : -1;
  985. else if (a.val != b.val) return a.val > b.val ? 1 : -1;
  986. else if (a.extra != b.extra) return a.extra > b.extra ? 1 : -1;
  987. else return 0;
  988. }
  989. }
  990. function validateSaveImgDimension(element) {
  991. var valid = false;
  992. var intValue = 0;
  993. if (/^[1-9]\d*$/.test(element.value)) {
  994. intValue = parseInt(element.value);
  995. if (intValue <= 16000) {
  996. valid = true;
  997. }
  998. }
  999. if (valid) {
  1000. element.classList.remove("invalid");
  1001. } else {
  1002. element.classList.add("invalid");
  1003. }
  1004. return intValue;
  1005. }
  1006. function saveImage(layer) {
  1007. var width = validateSaveImgDimension(document.getElementById("render-save-width"));
  1008. var height = validateSaveImgDimension(document.getElementById("render-save-height"));
  1009. var bgcolor = null;
  1010. if (!document.getElementById("render-save-transparent").checked) {
  1011. var style = getComputedStyle(topmostdiv);
  1012. bgcolor = style.getPropertyValue("background-color");
  1013. }
  1014. if (!width || !height) return;
  1015. // Prepare image
  1016. var canvas = document.createElement("canvas");
  1017. var layerdict = {
  1018. transform: {
  1019. x: 0,
  1020. y: 0,
  1021. s: 1,
  1022. panx: 0,
  1023. pany: 0,
  1024. zoom: 1,
  1025. },
  1026. bg: canvas,
  1027. fab: canvas,
  1028. silk: canvas,
  1029. highlight: canvas,
  1030. layer: layer,
  1031. }
  1032. // Do the rendering
  1033. recalcLayerScale(layerdict, width, height);
  1034. prepareLayer(layerdict);
  1035. clearCanvas(canvas, bgcolor);
  1036. drawBackground(layerdict, false);
  1037. drawHighlightsOnLayer(layerdict, false);
  1038. // Save image
  1039. var imgdata = canvas.toDataURL("image/png");
  1040. var filename = pcbdata.metadata.title;
  1041. if (pcbdata.metadata.revision) {
  1042. filename += `.${pcbdata.metadata.revision}`;
  1043. }
  1044. filename += `.${layer}.png`;
  1045. saveFile(filename, dataURLtoBlob(imgdata));
  1046. }
  1047. function saveSettings() {
  1048. var data = {
  1049. type: "InteractiveHtmlBom settings",
  1050. version: 1,
  1051. pcbmetadata: pcbdata.metadata,
  1052. settings: settings,
  1053. }
  1054. var blob = new Blob([JSON.stringify(data, null, 4)], {
  1055. type: "application/json"
  1056. });
  1057. saveFile(`${pcbdata.metadata.title}.settings.json`, blob);
  1058. }
  1059. function loadSettings() {
  1060. var input = document.createElement("input");
  1061. input.type = "file";
  1062. input.accept = ".settings.json";
  1063. input.onchange = function(e) {
  1064. var file = e.target.files[0];
  1065. var reader = new FileReader();
  1066. reader.onload = readerEvent => {
  1067. var content = readerEvent.target.result;
  1068. var newSettings;
  1069. try {
  1070. newSettings = JSON.parse(content);
  1071. } catch (e) {
  1072. alert("Selected file is not InteractiveHtmlBom settings file.");
  1073. return;
  1074. }
  1075. if (newSettings.type != "InteractiveHtmlBom settings") {
  1076. alert("Selected file is not InteractiveHtmlBom settings file.");
  1077. return;
  1078. }
  1079. var metadataMatches = newSettings.hasOwnProperty("pcbmetadata");
  1080. if (metadataMatches) {
  1081. for (var k in pcbdata.metadata) {
  1082. if (!newSettings.pcbmetadata.hasOwnProperty(k) || newSettings.pcbmetadata[k] != pcbdata.metadata[k]) {
  1083. metadataMatches = false;
  1084. }
  1085. }
  1086. }
  1087. if (!metadataMatches) {
  1088. var currentMetadata = JSON.stringify(pcbdata.metadata, null, 4);
  1089. var fileMetadata = JSON.stringify(newSettings.pcbmetadata, null, 4);
  1090. if (!confirm(
  1091. `Settins file metadata does not match current metadata.\n\n` +
  1092. `Page metadata:\n${currentMetadata}\n\n` +
  1093. `Settings file metadata:\n${fileMetadata}\n\n` +
  1094. `Press OK if you would like to import settings anyway.`)) {
  1095. return;
  1096. }
  1097. }
  1098. overwriteSettings(newSettings.settings);
  1099. }
  1100. reader.readAsText(file, 'UTF-8');
  1101. }
  1102. input.click();
  1103. }
  1104. function overwriteSettings(newSettings) {
  1105. initDone = false;
  1106. Object.assign(settings, newSettings);
  1107. writeStorage("bomlayout", settings.bomlayout);
  1108. writeStorage("bommode", settings.bommode);
  1109. writeStorage("canvaslayout", settings.canvaslayout);
  1110. writeStorage("bomCheckboxes", settings.checkboxes.join(","));
  1111. document.getElementById("bomCheckboxes").value = settings.checkboxes.join(",");
  1112. for (var checkbox of settings.checkboxes) {
  1113. writeStorage("checkbox_" + checkbox, settings.checkboxStoredRefs[checkbox]);
  1114. }
  1115. writeStorage("markWhenChecked", settings.markWhenChecked);
  1116. padsVisible(settings.renderPads);
  1117. document.getElementById("padsCheckbox").checked = settings.renderPads;
  1118. fabricationVisible(settings.renderFabrication);
  1119. document.getElementById("fabricationCheckbox").checked = settings.renderFabrication;
  1120. silkscreenVisible(settings.renderSilkscreen);
  1121. document.getElementById("silkscreenCheckbox").checked = settings.renderSilkscreen;
  1122. referencesVisible(settings.renderReferences);
  1123. document.getElementById("referencesCheckbox").checked = settings.renderReferences;
  1124. valuesVisible(settings.renderValues);
  1125. document.getElementById("valuesCheckbox").checked = settings.renderValues;
  1126. tracksVisible(settings.renderTracks);
  1127. document.getElementById("tracksCheckbox").checked = settings.renderTracks;
  1128. zonesVisible(settings.renderZones);
  1129. document.getElementById("zonesCheckbox").checked = settings.renderZones;
  1130. dnpOutline(settings.renderDnpOutline);
  1131. document.getElementById("dnpOutlineCheckbox").checked = settings.renderDnpOutline;
  1132. setRedrawOnDrag(settings.redrawOnDrag);
  1133. document.getElementById("dragCheckbox").checked = settings.redrawOnDrag;
  1134. setDarkMode(settings.darkMode);
  1135. document.getElementById("darkmodeCheckbox").checked = settings.darkMode;
  1136. setHighlightPin1(settings.highlightpin1);
  1137. document.getElementById("highlightpin1Checkbox").checked = settings.highlightpin1;
  1138. showFootprints(settings.show_footprints);
  1139. writeStorage("boardRotation", settings.boardRotation);
  1140. document.getElementById("boardRotation").value = settings.boardRotation / 5;
  1141. document.getElementById("rotationDegree").textContent = settings.boardRotation;
  1142. initDone = true;
  1143. prepCheckboxes();
  1144. changeBomLayout(settings.bomlayout);
  1145. }
  1146. function saveFile(filename, blob) {
  1147. var link = document.createElement("a");
  1148. var objurl = URL.createObjectURL(blob);
  1149. link.download = filename;
  1150. link.href = objurl;
  1151. link.click();
  1152. }
  1153. function dataURLtoBlob(dataurl) {
  1154. var arr = dataurl.split(','),
  1155. mime = arr[0].match(/:(.*?);/)[1],
  1156. bstr = atob(arr[1]),
  1157. n = bstr.length,
  1158. u8arr = new Uint8Array(n);
  1159. while (n--) {
  1160. u8arr[n] = bstr.charCodeAt(n);
  1161. }
  1162. return new Blob([u8arr], {
  1163. type: mime
  1164. });
  1165. }
  1166. var settings = {
  1167. canvaslayout: "default",
  1168. bomlayout: "default",
  1169. bommode: "grouped",
  1170. checkboxes: [],
  1171. checkboxStoredRefs: {},
  1172. darkMode: false,
  1173. highlightpin1: false,
  1174. redrawOnDrag: true,
  1175. boardRotation: 0,
  1176. renderPads: true,
  1177. renderReferences: true,
  1178. renderValues: true,
  1179. renderSilkscreen: true,
  1180. renderFabrication: true,
  1181. renderDnpOutline: false,
  1182. renderTracks: true,
  1183. renderZones: true,
  1184. columnOrder: [],
  1185. hiddenColumns: [],
  1186. }
  1187. function initDefaults() {
  1188. settings.bomlayout = readStorage("bomlayout");
  1189. if (settings.bomlayout === null) {
  1190. settings.bomlayout = config.bom_view;
  1191. }
  1192. if (!['bom-only', 'left-right', 'top-bottom'].includes(settings.bomlayout)) {
  1193. settings.bomlayout = config.bom_view;
  1194. }
  1195. settings.bommode = readStorage("bommode");
  1196. if (settings.bommode === null) {
  1197. settings.bommode = "grouped";
  1198. }
  1199. if (!["grouped", "ungrouped", "netlist"].includes(settings.bommode)) {
  1200. settings.bommode = "grouped";
  1201. }
  1202. settings.canvaslayout = readStorage("canvaslayout");
  1203. if (settings.canvaslayout === null) {
  1204. settings.canvaslayout = config.layer_view;
  1205. }
  1206. var bomCheckboxes = readStorage("bomCheckboxes");
  1207. if (bomCheckboxes === null) {
  1208. bomCheckboxes = config.checkboxes;
  1209. }
  1210. settings.checkboxes = bomCheckboxes.split(",").filter((e) => e);
  1211. document.getElementById("bomCheckboxes").value = bomCheckboxes;
  1212. settings.markWhenChecked = readStorage("markWhenChecked") || "";
  1213. populateMarkWhenCheckedOptions();
  1214. function initBooleanSetting(storageString, def, elementId, func) {
  1215. var b = readStorage(storageString);
  1216. if (b === null) {
  1217. b = def;
  1218. } else {
  1219. b = (b == "true");
  1220. }
  1221. document.getElementById(elementId).checked = b;
  1222. func(b);
  1223. }
  1224. initBooleanSetting("padsVisible", config.show_pads, "padsCheckbox", padsVisible);
  1225. initBooleanSetting("fabricationVisible", config.show_fabrication, "fabricationCheckbox", fabricationVisible);
  1226. initBooleanSetting("silkscreenVisible", config.show_silkscreen, "silkscreenCheckbox", silkscreenVisible);
  1227. initBooleanSetting("referencesVisible", true, "referencesCheckbox", referencesVisible);
  1228. initBooleanSetting("valuesVisible", true, "valuesCheckbox", valuesVisible);
  1229. if ("tracks" in pcbdata) {
  1230. initBooleanSetting("tracksVisible", true, "tracksCheckbox", tracksVisible);
  1231. initBooleanSetting("zonesVisible", true, "zonesCheckbox", zonesVisible);
  1232. } else {
  1233. document.getElementById("tracksAndZonesCheckboxes").style.display = "none";
  1234. tracksVisible(false);
  1235. zonesVisible(false);
  1236. }
  1237. initBooleanSetting("dnpOutline", false, "dnpOutlineCheckbox", dnpOutline);
  1238. initBooleanSetting("redrawOnDrag", config.redraw_on_drag, "dragCheckbox", setRedrawOnDrag);
  1239. initBooleanSetting("darkmode", config.dark_mode, "darkmodeCheckbox", setDarkMode);
  1240. initBooleanSetting("highlightpin1", config.highlight_pin1, "highlightpin1Checkbox", setHighlightPin1);
  1241. var fields = ["checkboxes", "References"].concat(config.fields).concat(["Quantity"]);
  1242. var hcols = JSON.parse(readStorage("hiddenColumns"));
  1243. if (hcols === null) {
  1244. hcols = [];
  1245. }
  1246. settings.hiddenColumns = hcols.filter(e => fields.includes(e));
  1247. var cord = JSON.parse(readStorage("columnOrder"));
  1248. if (cord === null) {
  1249. cord = fields;
  1250. } else {
  1251. cord = cord.filter(e => fields.includes(e));
  1252. if (cord.length != fields.length)
  1253. cord = fields;
  1254. }
  1255. settings.columnOrder = cord;
  1256. settings.boardRotation = readStorage("boardRotation");
  1257. if (settings.boardRotation === null) {
  1258. settings.boardRotation = config.board_rotation * 5;
  1259. } else {
  1260. settings.boardRotation = parseInt(settings.boardRotation);
  1261. }
  1262. document.getElementById("boardRotation").value = settings.boardRotation / 5;
  1263. document.getElementById("rotationDegree").textContent = settings.boardRotation;
  1264. }
  1265. // Helper classes for user js callbacks.
  1266. const IBOM_EVENT_TYPES = {
  1267. ALL: "all",
  1268. HIGHLIGHT_EVENT: "highlightEvent",
  1269. CHECKBOX_CHANGE_EVENT: "checkboxChangeEvent",
  1270. BOM_BODY_CHANGE_EVENT: "bomBodyChangeEvent",
  1271. }
  1272. const EventHandler = {
  1273. callbacks: {},
  1274. init: function() {
  1275. for (eventType of Object.values(IBOM_EVENT_TYPES))
  1276. this.callbacks[eventType] = [];
  1277. },
  1278. registerCallback: function(eventType, callback) {
  1279. this.callbacks[eventType].push(callback);
  1280. },
  1281. emitEvent: function(eventType, eventArgs) {
  1282. event = {
  1283. eventType: eventType,
  1284. args: eventArgs,
  1285. }
  1286. var callback;
  1287. for (callback of this.callbacks[eventType])
  1288. callback(event);
  1289. for (callback of this.callbacks[IBOM_EVENT_TYPES.ALL])
  1290. callback(event);
  1291. }
  1292. }
  1293. EventHandler.init();
  1294. ///////////////////////////////////////////////
  1295. ///////////////////////////////////////////////
  1296. /* PCB rendering code */
  1297. var emptyContext2d = document.createElement("canvas").getContext("2d");
  1298. function deg2rad(deg) {
  1299. return deg * Math.PI / 180;
  1300. }
  1301. function calcFontPoint(linepoint, text, offsetx, offsety, tilt) {
  1302. var point = [
  1303. linepoint[0] * text.width + offsetx,
  1304. linepoint[1] * text.height + offsety
  1305. ];
  1306. // This approximates pcbnew behavior with how text tilts depending on horizontal justification
  1307. point[0] -= (linepoint[1] + 0.5 * (1 + text.justify[0])) * text.height * tilt;
  1308. return point;
  1309. }
  1310. function drawText(ctx, text, color) {
  1311. if ("ref" in text && !settings.renderReferences) return;
  1312. if ("val" in text && !settings.renderValues) return;
  1313. ctx.save();
  1314. ctx.fillStyle = color;
  1315. ctx.strokeStyle = color;
  1316. ctx.lineCap = "round";
  1317. ctx.lineJoin = "round";
  1318. ctx.lineWidth = text.thickness;
  1319. if ("svgpath" in text) {
  1320. ctx.stroke(new Path2D(text.svgpath));
  1321. ctx.restore();
  1322. return;
  1323. }
  1324. ctx.translate(...text.pos);
  1325. ctx.translate(text.thickness * 0.5, 0);
  1326. var angle = -text.angle;
  1327. if (text.attr.includes("mirrored")) {
  1328. ctx.scale(-1, 1);
  1329. angle = -angle;
  1330. }
  1331. var tilt = 0;
  1332. if (text.attr.includes("italic")) {
  1333. tilt = 0.125;
  1334. }
  1335. var interline = text.height * 1.5 + text.thickness;
  1336. var txt = text.text.split("\n");
  1337. // KiCad ignores last empty line.
  1338. if (txt[txt.length - 1] == '') txt.pop();
  1339. ctx.rotate(deg2rad(angle));
  1340. var offsety = (1 - text.justify[1]) / 2 * text.height; // One line offset
  1341. offsety -= (txt.length - 1) * (text.justify[1] + 1) / 2 * interline; // Multiline offset
  1342. for (var i in txt) {
  1343. var lineWidth = text.thickness + interline / 2 * tilt;
  1344. for (var j = 0; j < txt[i].length; j++) {
  1345. if (txt[i][j] == '\t') {
  1346. var fourSpaces = 4 * pcbdata.font_data[' '].w * text.width;
  1347. lineWidth += fourSpaces - lineWidth % fourSpaces;
  1348. } else {
  1349. if (txt[i][j] == '~') {
  1350. j++;
  1351. if (j == txt[i].length)
  1352. break;
  1353. }
  1354. lineWidth += pcbdata.font_data[txt[i][j]].w * text.width;
  1355. }
  1356. }
  1357. var offsetx = -lineWidth * (text.justify[0] + 1) / 2;
  1358. var inOverbar = false;
  1359. for (var j = 0; j < txt[i].length; j++) {
  1360. if (txt[i][j] == '\t') {
  1361. var fourSpaces = 4 * pcbdata.font_data[' '].w * text.width;
  1362. offsetx += fourSpaces - offsetx % fourSpaces;
  1363. continue;
  1364. } else if (txt[i][j] == '~') {
  1365. j++;
  1366. if (j == txt[i].length)
  1367. break;
  1368. if (txt[i][j] != '~') {
  1369. inOverbar = !inOverbar;
  1370. }
  1371. }
  1372. var glyph = pcbdata.font_data[txt[i][j]];
  1373. if (inOverbar) {
  1374. var overbarStart = [offsetx, -text.height * 1.4 + offsety];
  1375. var overbarEnd = [offsetx + text.width * glyph.w, overbarStart[1]];
  1376. if (!lastHadOverbar) {
  1377. overbarStart[0] += text.height * 1.4 * tilt;
  1378. lastHadOverbar = true;
  1379. }
  1380. ctx.beginPath();
  1381. ctx.moveTo(...overbarStart);
  1382. ctx.lineTo(...overbarEnd);
  1383. ctx.stroke();
  1384. } else {
  1385. lastHadOverbar = false;
  1386. }
  1387. for (var line of glyph.l) {
  1388. ctx.beginPath();
  1389. ctx.moveTo(...calcFontPoint(line[0], text, offsetx, offsety, tilt));
  1390. for (var k = 1; k < line.length; k++) {
  1391. ctx.lineTo(...calcFontPoint(line[k], text, offsetx, offsety, tilt));
  1392. }
  1393. ctx.stroke();
  1394. }
  1395. offsetx += glyph.w * text.width;
  1396. }
  1397. offsety += interline;
  1398. }
  1399. ctx.restore();
  1400. }
  1401. function drawedge(ctx, scalefactor, edge, color) {
  1402. ctx.strokeStyle = color;
  1403. ctx.fillStyle = color;
  1404. ctx.lineWidth = Math.max(1 / scalefactor, edge.width);
  1405. ctx.lineCap = "round";
  1406. ctx.lineJoin = "round";
  1407. if ("svgpath" in edge) {
  1408. ctx.stroke(new Path2D(edge.svgpath));
  1409. } else {
  1410. ctx.beginPath();
  1411. if (edge.type == "segment") {
  1412. ctx.moveTo(...edge.start);
  1413. ctx.lineTo(...edge.end);
  1414. }
  1415. if (edge.type == "rect") {
  1416. ctx.moveTo(...edge.start);
  1417. ctx.lineTo(edge.start[0], edge.end[1]);
  1418. ctx.lineTo(...edge.end);
  1419. ctx.lineTo(edge.end[0], edge.start[1]);
  1420. ctx.lineTo(...edge.start);
  1421. }
  1422. if (edge.type == "arc") {
  1423. ctx.arc(
  1424. ...edge.start,
  1425. edge.radius,
  1426. deg2rad(edge.startangle),
  1427. deg2rad(edge.endangle));
  1428. }
  1429. if (edge.type == "circle") {
  1430. ctx.arc(
  1431. ...edge.start,
  1432. edge.radius,
  1433. 0, 2 * Math.PI);
  1434. ctx.closePath();
  1435. }
  1436. if (edge.type == "curve") {
  1437. ctx.moveTo(...edge.start);
  1438. ctx.bezierCurveTo(...edge.cpa, ...edge.cpb, ...edge.end);
  1439. }
  1440. if("filled" in edge && edge.filled)
  1441. ctx.fill();
  1442. else
  1443. ctx.stroke();
  1444. }
  1445. }
  1446. function getChamferedRectPath(size, radius, chamfpos, chamfratio) {
  1447. // chamfpos is a bitmask, left = 1, right = 2, bottom left = 4, bottom right = 8
  1448. var path = new Path2D();
  1449. var width = size[0];
  1450. var height = size[1];
  1451. var x = width * -0.5;
  1452. var y = height * -0.5;
  1453. var chamfOffset = Math.min(width, height) * chamfratio;
  1454. path.moveTo(x, 0);
  1455. if (chamfpos & 4) {
  1456. path.lineTo(x, y + height - chamfOffset);
  1457. path.lineTo(x + chamfOffset, y + height);
  1458. path.lineTo(0, y + height);
  1459. } else {
  1460. path.arcTo(x, y + height, x + width, y + height, radius);
  1461. }
  1462. if (chamfpos & 8) {
  1463. path.lineTo(x + width - chamfOffset, y + height);
  1464. path.lineTo(x + width, y + height - chamfOffset);
  1465. path.lineTo(x + width, 0);
  1466. } else {
  1467. path.arcTo(x + width, y + height, x + width, y, radius);
  1468. }
  1469. if (chamfpos & 2) {
  1470. path.lineTo(x + width, y + chamfOffset);
  1471. path.lineTo(x + width - chamfOffset, y);
  1472. path.lineTo(0, y);
  1473. } else {
  1474. path.arcTo(x + width, y, x, y, radius);
  1475. }
  1476. if (chamfpos & 1) {
  1477. path.lineTo(x + chamfOffset, y);
  1478. path.lineTo(x, y + chamfOffset);
  1479. path.lineTo(x, 0);
  1480. } else {
  1481. path.arcTo(x, y, x, y + height, radius);
  1482. }
  1483. path.closePath();
  1484. return path;
  1485. }
  1486. function getOblongPath(size) {
  1487. return getChamferedRectPath(size, Math.min(size[0], size[1]) / 2, 0, 0);
  1488. }
  1489. function getPolygonsPath(shape) {
  1490. if (shape.path2d) {
  1491. return shape.path2d;
  1492. }
  1493. if ("svgpath" in shape) {
  1494. shape.path2d = new Path2D(shape.svgpath);
  1495. } else {
  1496. var path = new Path2D();
  1497. for (var polygon of shape.polygons) {
  1498. path.moveTo(...polygon[0]);
  1499. for (var i = 1; i < polygon.length; i++) {
  1500. path.lineTo(...polygon[i]);
  1501. }
  1502. path.closePath();
  1503. }
  1504. shape.path2d = path;
  1505. }
  1506. return shape.path2d;
  1507. }
  1508. function drawPolygonShape(ctx, scalefactor, shape, color) {
  1509. ctx.save();
  1510. if (!("svgpath" in shape)) {
  1511. ctx.translate(...shape.pos);
  1512. ctx.rotate(deg2rad(-shape.angle));
  1513. }
  1514. if("filled" in shape && !shape.filled) {
  1515. ctx.strokeStyle = color;
  1516. ctx.lineWidth = Math.max(1 / scalefactor, shape.width);
  1517. ctx.lineCap = "round";
  1518. ctx.lineJoin = "round";
  1519. ctx.stroke(getPolygonsPath(shape));
  1520. } else {
  1521. ctx.fillStyle = color;
  1522. ctx.fill(getPolygonsPath(shape));
  1523. }
  1524. ctx.restore();
  1525. }
  1526. function drawDrawing(ctx, scalefactor, drawing, color) {
  1527. if (["segment", "arc", "circle", "curve", "rect"].includes(drawing.type)) {
  1528. drawedge(ctx, scalefactor, drawing, color);
  1529. } else if (drawing.type == "polygon") {
  1530. drawPolygonShape(ctx, scalefactor, drawing, color);
  1531. } else {
  1532. drawText(ctx, drawing, color);
  1533. }
  1534. }
  1535. function getCirclePath(radius) {
  1536. var path = new Path2D();
  1537. path.arc(0, 0, radius, 0, 2 * Math.PI);
  1538. path.closePath();
  1539. return path;
  1540. }
  1541. function getCachedPadPath(pad) {
  1542. if (!pad.path2d) {
  1543. // if path2d is not set, build one and cache it on pad object
  1544. if (pad.shape == "rect") {
  1545. pad.path2d = new Path2D();
  1546. pad.path2d.rect(...pad.size.map(c => -c * 0.5), ...pad.size);
  1547. } else if (pad.shape == "oval") {
  1548. pad.path2d = getOblongPath(pad.size);
  1549. } else if (pad.shape == "circle") {
  1550. pad.path2d = getCirclePath(pad.size[0] / 2);
  1551. } else if (pad.shape == "roundrect") {
  1552. pad.path2d = getChamferedRectPath(pad.size, pad.radius, 0, 0);
  1553. } else if (pad.shape == "chamfrect") {
  1554. pad.path2d = getChamferedRectPath(pad.size, pad.radius, pad.chamfpos, pad.chamfratio)
  1555. } else if (pad.shape == "custom") {
  1556. pad.path2d = getPolygonsPath(pad);
  1557. }
  1558. }
  1559. return pad.path2d;
  1560. }
  1561. function drawPad(ctx, pad, color, outline) {
  1562. ctx.save();
  1563. ctx.translate(...pad.pos);
  1564. ctx.rotate(deg2rad(pad.angle));
  1565. if (pad.offset) {
  1566. ctx.translate(...pad.offset);
  1567. }
  1568. ctx.fillStyle = color;
  1569. ctx.strokeStyle = color;
  1570. var path = getCachedPadPath(pad);
  1571. if (outline) {
  1572. ctx.stroke(path);
  1573. } else {
  1574. ctx.fill(path);
  1575. }
  1576. ctx.restore();
  1577. }
  1578. function drawPadHole(ctx, pad, padHoleColor) {
  1579. if (pad.type != "th") return;
  1580. ctx.save();
  1581. ctx.translate(...pad.pos);
  1582. ctx.rotate(deg2rad(pad.angle));
  1583. ctx.fillStyle = padHoleColor;
  1584. if (pad.drillshape == "oblong") {
  1585. ctx.fill(getOblongPath(pad.drillsize));
  1586. } else {
  1587. ctx.fill(getCirclePath(pad.drillsize[0] / 2));
  1588. }
  1589. ctx.restore();
  1590. }
  1591. function drawFootprint(ctx, layer, scalefactor, footprint, colors, highlight, outline) {
  1592. if (highlight) {
  1593. // draw bounding box
  1594. if (footprint.layer == layer) {
  1595. ctx.save();
  1596. ctx.globalAlpha = 0.2;
  1597. ctx.translate(...footprint.bbox.pos);
  1598. ctx.rotate(deg2rad(-footprint.bbox.angle));
  1599. ctx.translate(...footprint.bbox.relpos);
  1600. ctx.fillStyle = colors.pad;
  1601. ctx.fillRect(0, 0, ...footprint.bbox.size);
  1602. ctx.globalAlpha = 1;
  1603. ctx.strokeStyle = colors.pad;
  1604. ctx.strokeRect(0, 0, ...footprint.bbox.size);
  1605. ctx.restore();
  1606. }
  1607. }
  1608. // draw drawings
  1609. for (var drawing of footprint.drawings) {
  1610. if (drawing.layer == layer) {
  1611. drawDrawing(ctx, scalefactor, drawing.drawing, colors.pad);
  1612. }
  1613. }
  1614. // draw pads
  1615. if (settings.renderPads) {
  1616. for (var pad of footprint.pads) {
  1617. if (pad.layers.includes(layer)) {
  1618. drawPad(ctx, pad, colors.pad, outline);
  1619. if (pad.pin1 && settings.highlightpin1) {
  1620. drawPad(ctx, pad, colors.outline, true);
  1621. }
  1622. }
  1623. }
  1624. for (var pad of footprint.pads) {
  1625. drawPadHole(ctx, pad, colors.padHole);
  1626. }
  1627. }
  1628. }
  1629. function drawEdgeCuts(canvas, scalefactor) {
  1630. var ctx = canvas.getContext("2d");
  1631. var edgecolor = getComputedStyle(topmostdiv).getPropertyValue('--pcb-edge-color');
  1632. for (var edge of pcbdata.edges) {
  1633. drawDrawing(ctx, scalefactor, edge, edgecolor);
  1634. }
  1635. }
  1636. function drawFootprints(canvas, layer, scalefactor, highlight) {
  1637. var ctx = canvas.getContext("2d");
  1638. ctx.lineWidth = 3 / scalefactor;
  1639. var style = getComputedStyle(topmostdiv);
  1640. var colors = {
  1641. pad: style.getPropertyValue('--pad-color'),
  1642. padHole: style.getPropertyValue('--pad-hole-color'),
  1643. outline: style.getPropertyValue('--pin1-outline-color'),
  1644. }
  1645. for (var i = 0; i < pcbdata.footprints.length; i++) {
  1646. var mod = pcbdata.footprints[i];
  1647. var outline = settings.renderDnpOutline && pcbdata.bom.skipped.includes(i);
  1648. var h = highlightedFootprints.includes(i);
  1649. var d = markedFootprints.has(i);
  1650. if (highlight) {
  1651. if(h && d) {
  1652. colors.pad = style.getPropertyValue('--pad-color-highlight-both');
  1653. colors.outline = style.getPropertyValue('--pin1-outline-color-highlight-both');
  1654. } else if (h) {
  1655. colors.pad = style.getPropertyValue('--pad-color-highlight');
  1656. colors.outline = style.getPropertyValue('--pin1-outline-color-highlight');
  1657. } else if (d) {
  1658. colors.pad = style.getPropertyValue('--pad-color-highlight-marked');
  1659. colors.outline = style.getPropertyValue('--pin1-outline-color-highlight-marked');
  1660. }
  1661. }
  1662. if( h || d || !highlight) {
  1663. drawFootprint(ctx, layer, scalefactor, mod, colors, highlight, outline);
  1664. }
  1665. }
  1666. }
  1667. function drawBgLayer(layername, canvas, layer, scalefactor, edgeColor, polygonColor, textColor) {
  1668. var ctx = canvas.getContext("2d");
  1669. for (var d of pcbdata.drawings[layername][layer]) {
  1670. if (["segment", "arc", "circle", "curve", "rect"].includes(d.type)) {
  1671. drawedge(ctx, scalefactor, d, edgeColor);
  1672. } else if (d.type == "polygon") {
  1673. drawPolygonShape(ctx, scalefactor, d, polygonColor);
  1674. } else {
  1675. drawText(ctx, d, textColor);
  1676. }
  1677. }
  1678. }
  1679. function drawTracks(canvas, layer, color, highlight) {
  1680. ctx = canvas.getContext("2d");
  1681. ctx.strokeStyle = color;
  1682. ctx.lineCap = "round";
  1683. for (var track of pcbdata.tracks[layer]) {
  1684. if (highlight && highlightedNet != track.net) continue;
  1685. ctx.lineWidth = track.width;
  1686. ctx.beginPath();
  1687. if ('radius' in track) {
  1688. ctx.arc(
  1689. ...track.center,
  1690. track.radius,
  1691. deg2rad(track.startangle),
  1692. deg2rad(track.endangle));
  1693. } else {
  1694. ctx.moveTo(...track.start);
  1695. ctx.lineTo(...track.end);
  1696. }
  1697. ctx.stroke();
  1698. }
  1699. }
  1700. function drawZones(canvas, layer, color, highlight) {
  1701. ctx = canvas.getContext("2d");
  1702. ctx.strokeStyle = color;
  1703. ctx.fillStyle = color;
  1704. ctx.lineJoin = "round";
  1705. for (var zone of pcbdata.zones[layer]) {
  1706. if (!zone.path2d) {
  1707. zone.path2d = getPolygonsPath(zone);
  1708. }
  1709. if (highlight && highlightedNet != zone.net) continue;
  1710. ctx.fill(zone.path2d);
  1711. if (zone.width > 0) {
  1712. ctx.lineWidth = zone.width;
  1713. ctx.stroke(zone.path2d);
  1714. }
  1715. }
  1716. }
  1717. function clearCanvas(canvas, color = null) {
  1718. var ctx = canvas.getContext("2d");
  1719. ctx.save();
  1720. ctx.setTransform(1, 0, 0, 1, 0, 0);
  1721. if (color) {
  1722. ctx.fillStyle = color;
  1723. ctx.fillRect(0, 0, canvas.width, canvas.height);
  1724. } else {
  1725. if (!window.matchMedia("print").matches)
  1726. ctx.clearRect(0, 0, canvas.width, canvas.height);
  1727. }
  1728. ctx.restore();
  1729. }
  1730. function drawNets(canvas, layer, highlight) {
  1731. var style = getComputedStyle(topmostdiv);
  1732. if (settings.renderTracks) {
  1733. var trackColor = style.getPropertyValue(highlight ? '--track-color-highlight' : '--track-color');
  1734. drawTracks(canvas, layer, trackColor, highlight);
  1735. }
  1736. if (settings.renderZones) {
  1737. var zoneColor = style.getPropertyValue(highlight ? '--zone-color-highlight' : '--zone-color');
  1738. drawZones(canvas, layer, zoneColor, highlight);
  1739. }
  1740. if (highlight && settings.renderPads) {
  1741. var padColor = style.getPropertyValue('--pad-color-highlight');
  1742. var padHoleColor = style.getPropertyValue('--pad-hole-color');
  1743. var ctx = canvas.getContext("2d");
  1744. for (var footprint of pcbdata.footprints) {
  1745. // draw pads
  1746. var padDrawn = false;
  1747. for (var pad of footprint.pads) {
  1748. if (highlightedNet != pad.net) continue;
  1749. if (pad.layers.includes(layer)) {
  1750. drawPad(ctx, pad, padColor, false);
  1751. padDrawn = true;
  1752. }
  1753. }
  1754. if (padDrawn) {
  1755. // redraw all pad holes because some pads may overlap
  1756. for (var pad of footprint.pads) {
  1757. drawPadHole(ctx, pad, padHoleColor);
  1758. }
  1759. }
  1760. }
  1761. }
  1762. }
  1763. function drawHighlightsOnLayer(canvasdict, clear = true) {
  1764. if (clear) {
  1765. clearCanvas(canvasdict.highlight);
  1766. }
  1767. if (markedFootprints.size > 0 || highlightedFootprints.length > 0) {
  1768. drawFootprints(canvasdict.highlight, canvasdict.layer,
  1769. canvasdict.transform.s * canvasdict.transform.zoom, true);
  1770. }
  1771. if (highlightedNet !== null) {
  1772. drawNets(canvasdict.highlight, canvasdict.layer, true);
  1773. }
  1774. }
  1775. function drawHighlights() {
  1776. drawHighlightsOnLayer(allcanvas.front);
  1777. drawHighlightsOnLayer(allcanvas.back);
  1778. }
  1779. function drawBackground(canvasdict, clear = true) {
  1780. if (clear) {
  1781. clearCanvas(canvasdict.bg);
  1782. clearCanvas(canvasdict.fab);
  1783. clearCanvas(canvasdict.silk);
  1784. }
  1785. drawNets(canvasdict.bg, canvasdict.layer, false);
  1786. drawFootprints(canvasdict.bg, canvasdict.layer,
  1787. canvasdict.transform.s * canvasdict.transform.zoom, false);
  1788. drawEdgeCuts(canvasdict.bg, canvasdict.transform.s * canvasdict.transform.zoom);
  1789. var style = getComputedStyle(topmostdiv);
  1790. var edgeColor = style.getPropertyValue('--silkscreen-edge-color');
  1791. var polygonColor = style.getPropertyValue('--silkscreen-polygon-color');
  1792. var textColor = style.getPropertyValue('--silkscreen-text-color');
  1793. if (settings.renderSilkscreen) {
  1794. drawBgLayer(
  1795. "silkscreen", canvasdict.silk, canvasdict.layer,
  1796. canvasdict.transform.s * canvasdict.transform.zoom,
  1797. edgeColor, polygonColor, textColor);
  1798. }
  1799. edgeColor = style.getPropertyValue('--fabrication-edge-color');
  1800. polygonColor = style.getPropertyValue('--fabrication-polygon-color');
  1801. textColor = style.getPropertyValue('--fabrication-text-color');
  1802. if (settings.renderFabrication) {
  1803. drawBgLayer(
  1804. "fabrication", canvasdict.fab, canvasdict.layer,
  1805. canvasdict.transform.s * canvasdict.transform.zoom,
  1806. edgeColor, polygonColor, textColor);
  1807. }
  1808. }
  1809. function prepareCanvas(canvas, flip, transform) {
  1810. var ctx = canvas.getContext("2d");
  1811. ctx.setTransform(1, 0, 0, 1, 0, 0);
  1812. var fontsize = 1.55;
  1813. ctx.scale(transform.zoom, transform.zoom);
  1814. ctx.translate(transform.panx, transform.pany);
  1815. if (flip) {
  1816. ctx.scale(-1, 1);
  1817. }
  1818. ctx.translate(transform.x, transform.y);
  1819. ctx.rotate(deg2rad(settings.boardRotation));
  1820. ctx.scale(transform.s, transform.s);
  1821. }
  1822. function prepareLayer(canvasdict) {
  1823. var flip = (canvasdict.layer == "B");
  1824. for (var c of ["bg", "fab", "silk", "highlight"]) {
  1825. prepareCanvas(canvasdict[c], flip, canvasdict.transform);
  1826. }
  1827. }
  1828. function rotateVector(v, angle) {
  1829. angle = deg2rad(angle);
  1830. return [
  1831. v[0] * Math.cos(angle) - v[1] * Math.sin(angle),
  1832. v[0] * Math.sin(angle) + v[1] * Math.cos(angle)
  1833. ];
  1834. }
  1835. function applyRotation(bbox) {
  1836. var corners = [
  1837. [bbox.minx, bbox.miny],
  1838. [bbox.minx, bbox.maxy],
  1839. [bbox.maxx, bbox.miny],
  1840. [bbox.maxx, bbox.maxy],
  1841. ];
  1842. corners = corners.map((v) => rotateVector(v, settings.boardRotation));
  1843. return {
  1844. minx: corners.reduce((a, v) => Math.min(a, v[0]), Infinity),
  1845. miny: corners.reduce((a, v) => Math.min(a, v[1]), Infinity),
  1846. maxx: corners.reduce((a, v) => Math.max(a, v[0]), -Infinity),
  1847. maxy: corners.reduce((a, v) => Math.max(a, v[1]), -Infinity),
  1848. }
  1849. }
  1850. function recalcLayerScale(layerdict, width, height) {
  1851. var bbox = applyRotation(pcbdata.edges_bbox);
  1852. var scalefactor = 0.98 * Math.min(
  1853. width / (bbox.maxx - bbox.minx),
  1854. height / (bbox.maxy - bbox.miny)
  1855. );
  1856. if (scalefactor < 0.1) {
  1857. scalefactor = 1;
  1858. }
  1859. layerdict.transform.s = scalefactor;
  1860. var flip = (layerdict.layer == "B");
  1861. if (flip) {
  1862. layerdict.transform.x = -((bbox.maxx + bbox.minx) * scalefactor + width) * 0.5;
  1863. } else {
  1864. layerdict.transform.x = -((bbox.maxx + bbox.minx) * scalefactor - width) * 0.5;
  1865. }
  1866. layerdict.transform.y = -((bbox.maxy + bbox.miny) * scalefactor - height) * 0.5;
  1867. for (var c of ["bg", "fab", "silk", "highlight"]) {
  1868. canvas = layerdict[c];
  1869. canvas.width = width;
  1870. canvas.height = height;
  1871. canvas.style.width = (width / devicePixelRatio) + "px";
  1872. canvas.style.height = (height / devicePixelRatio) + "px";
  1873. }
  1874. }
  1875. function redrawCanvas(layerdict) {
  1876. prepareLayer(layerdict);
  1877. drawBackground(layerdict);
  1878. drawHighlightsOnLayer(layerdict);
  1879. }
  1880. function resizeCanvas(layerdict) {
  1881. var canvasdivid = {
  1882. "F": "frontcanvas",
  1883. "B": "backcanvas"
  1884. } [layerdict.layer];
  1885. var width = document.getElementById(canvasdivid).clientWidth * devicePixelRatio;
  1886. var height = document.getElementById(canvasdivid).clientHeight * devicePixelRatio;
  1887. recalcLayerScale(layerdict, width, height);
  1888. redrawCanvas(layerdict);
  1889. }
  1890. function resizeAll() {
  1891. resizeCanvas(allcanvas.front);
  1892. resizeCanvas(allcanvas.back);
  1893. }
  1894. function pointWithinDistanceToSegment(x, y, x1, y1, x2, y2, d) {
  1895. var A = x - x1;
  1896. var B = y - y1;
  1897. var C = x2 - x1;
  1898. var D = y2 - y1;
  1899. var dot = A * C + B * D;
  1900. var len_sq = C * C + D * D;
  1901. var dx, dy;
  1902. if (len_sq == 0) {
  1903. // start and end of the segment coincide
  1904. dx = x - x1;
  1905. dy = y - y1;
  1906. } else {
  1907. var param = dot / len_sq;
  1908. var xx, yy;
  1909. if (param < 0) {
  1910. xx = x1;
  1911. yy = y1;
  1912. } else if (param > 1) {
  1913. xx = x2;
  1914. yy = y2;
  1915. } else {
  1916. xx = x1 + param * C;
  1917. yy = y1 + param * D;
  1918. }
  1919. dx = x - xx;
  1920. dy = y - yy;
  1921. }
  1922. return dx * dx + dy * dy <= d * d;
  1923. }
  1924. function modulo(n, mod) {
  1925. return ((n % mod) + mod) % mod;
  1926. }
  1927. function pointWithinDistanceToArc(x, y, xc, yc, radius, startangle, endangle, d) {
  1928. var dx = x - xc;
  1929. var dy = y - yc;
  1930. var r_sq = dx * dx + dy * dy;
  1931. var rmin = Math.max(0, radius - d);
  1932. var rmax = radius + d;
  1933. if (r_sq < rmin * rmin || r_sq > rmax * rmax)
  1934. return false;
  1935. var angle1 = modulo(deg2rad(startangle), 2 * Math.PI);
  1936. var dx1 = xc + radius * Math.cos(angle1) - x;
  1937. var dy1 = yc + radius * Math.sin(angle1) - y;
  1938. if (dx1 * dx1 + dy1 * dy1 <= d * d)
  1939. return true;
  1940. var angle2 = modulo(deg2rad(endangle), 2 * Math.PI);
  1941. var dx2 = xc + radius * Math.cos(angle2) - x;
  1942. var dy2 = yc + radius * Math.sin(angle2) - y;
  1943. if (dx2 * dx2 + dy2 * dy2 <= d * d)
  1944. return true;
  1945. var angle = modulo(Math.atan2(dy, dx), 2 * Math.PI);
  1946. if (angle1 > angle2)
  1947. return (angle >= angle2 || angle <= angle1);
  1948. else
  1949. return (angle >= angle1 && angle <= angle2);
  1950. }
  1951. function pointWithinPad(x, y, pad) {
  1952. var v = [x - pad.pos[0], y - pad.pos[1]];
  1953. v = rotateVector(v, -pad.angle);
  1954. if (pad.offset) {
  1955. v[0] -= pad.offset[0];
  1956. v[1] -= pad.offset[1];
  1957. }
  1958. return emptyContext2d.isPointInPath(getCachedPadPath(pad), ...v);
  1959. }
  1960. function netHitScan(layer, x, y) {
  1961. // Check track segments
  1962. if (settings.renderTracks && pcbdata.tracks) {
  1963. for (var track of pcbdata.tracks[layer]) {
  1964. if ('radius' in track) {
  1965. if (pointWithinDistanceToArc(x, y, ...track.center, track.radius, track.startangle, track.endangle, track.width / 2)) {
  1966. return track.net;
  1967. }
  1968. } else {
  1969. if (pointWithinDistanceToSegment(x, y, ...track.start, ...track.end, track.width / 2)) {
  1970. return track.net;
  1971. }
  1972. }
  1973. }
  1974. }
  1975. // Check pads
  1976. if (settings.renderPads) {
  1977. for (var footprint of pcbdata.footprints) {
  1978. for (var pad of footprint.pads) {
  1979. if (pad.layers.includes(layer) && pointWithinPad(x, y, pad)) {
  1980. return pad.net;
  1981. }
  1982. }
  1983. }
  1984. }
  1985. return null;
  1986. }
  1987. function pointWithinFootprintBbox(x, y, bbox) {
  1988. var v = [x - bbox.pos[0], y - bbox.pos[1]];
  1989. v = rotateVector(v, bbox.angle);
  1990. return bbox.relpos[0] <= v[0] && v[0] <= bbox.relpos[0] + bbox.size[0] &&
  1991. bbox.relpos[1] <= v[1] && v[1] <= bbox.relpos[1] + bbox.size[1];
  1992. }
  1993. function bboxHitScan(layer, x, y) {
  1994. var result = [];
  1995. for (var i = 0; i < pcbdata.footprints.length; i++) {
  1996. var footprint = pcbdata.footprints[i];
  1997. if (footprint.layer == layer) {
  1998. if (pointWithinFootprintBbox(x, y, footprint.bbox)) {
  1999. result.push(i);
  2000. }
  2001. }
  2002. }
  2003. return result;
  2004. }
  2005. function handlePointerDown(e, layerdict) {
  2006. if (e.button != 0 && e.button != 1) {
  2007. return;
  2008. }
  2009. e.preventDefault();
  2010. e.stopPropagation();
  2011. if (!e.hasOwnProperty("offsetX")) {
  2012. // The polyfill doesn't set this properly
  2013. e.offsetX = e.pageX - e.currentTarget.offsetLeft;
  2014. e.offsetY = e.pageY - e.currentTarget.offsetTop;
  2015. }
  2016. layerdict.pointerStates[e.pointerId] = {
  2017. distanceTravelled: 0,
  2018. lastX: e.offsetX,
  2019. lastY: e.offsetY,
  2020. downTime: Date.now(),
  2021. };
  2022. }
  2023. function handleMouseClick(e, layerdict) {
  2024. if (!e.hasOwnProperty("offsetX")) {
  2025. // The polyfill doesn't set this properly
  2026. e.offsetX = e.pageX - e.currentTarget.offsetLeft;
  2027. e.offsetY = e.pageY - e.currentTarget.offsetTop;
  2028. }
  2029. var x = e.offsetX;
  2030. var y = e.offsetY;
  2031. var t = layerdict.transform;
  2032. if (layerdict.layer == "B") {
  2033. x = (devicePixelRatio * x / t.zoom - t.panx + t.x) / -t.s;
  2034. } else {
  2035. x = (devicePixelRatio * x / t.zoom - t.panx - t.x) / t.s;
  2036. }
  2037. y = (devicePixelRatio * y / t.zoom - t.y - t.pany) / t.s;
  2038. var v = rotateVector([x, y], -settings.boardRotation);
  2039. if ("nets" in pcbdata) {
  2040. var net = netHitScan(layerdict.layer, ...v);
  2041. if (net !== highlightedNet) {
  2042. netClicked(net);
  2043. }
  2044. }
  2045. if (highlightedNet === null) {
  2046. var footprints = bboxHitScan(layerdict.layer, ...v);
  2047. if (footprints.length > 0) {
  2048. footprintsClicked(footprints);
  2049. }
  2050. }
  2051. }
  2052. function handlePointerLeave(e, layerdict) {
  2053. e.preventDefault();
  2054. e.stopPropagation();
  2055. if (!settings.redrawOnDrag) {
  2056. redrawCanvas(layerdict);
  2057. }
  2058. delete layerdict.pointerStates[e.pointerId];
  2059. }
  2060. function resetTransform(layerdict) {
  2061. layerdict.transform.panx = 0;
  2062. layerdict.transform.pany = 0;
  2063. layerdict.transform.zoom = 1;
  2064. redrawCanvas(layerdict);
  2065. }
  2066. function handlePointerUp(e, layerdict) {
  2067. if (!e.hasOwnProperty("offsetX")) {
  2068. // The polyfill doesn't set this properly
  2069. e.offsetX = e.pageX - e.currentTarget.offsetLeft;
  2070. e.offsetY = e.pageY - e.currentTarget.offsetTop;
  2071. }
  2072. e.preventDefault();
  2073. e.stopPropagation();
  2074. if (e.button == 2) {
  2075. // Reset pan and zoom on right click.
  2076. resetTransform(layerdict);
  2077. layerdict.anotherPointerTapped = false;
  2078. return;
  2079. }
  2080. // We haven't necessarily had a pointermove event since the interaction started, so make sure we update this now
  2081. var ptr = layerdict.pointerStates[e.pointerId];
  2082. ptr.distanceTravelled += Math.abs(e.offsetX - ptr.lastX) + Math.abs(e.offsetY - ptr.lastY);
  2083. if (e.button == 0 && ptr.distanceTravelled < 10 && Date.now() - ptr.downTime <= 500) {
  2084. if (Object.keys(layerdict.pointerStates).length == 1) {
  2085. if (layerdict.anotherPointerTapped) {
  2086. // This is the second pointer coming off of a two-finger tap
  2087. resetTransform(layerdict);
  2088. } else {
  2089. // This is just a regular tap
  2090. handleMouseClick(e, layerdict);
  2091. }
  2092. layerdict.anotherPointerTapped = false;
  2093. } else {
  2094. // This is the first finger coming off of what could become a two-finger tap
  2095. layerdict.anotherPointerTapped = true;
  2096. }
  2097. } else {
  2098. if (!settings.redrawOnDrag) {
  2099. redrawCanvas(layerdict);
  2100. }
  2101. layerdict.anotherPointerTapped = false;
  2102. }
  2103. delete layerdict.pointerStates[e.pointerId];
  2104. }
  2105. function handlePointerMove(e, layerdict) {
  2106. if (!layerdict.pointerStates.hasOwnProperty(e.pointerId)) {
  2107. return;
  2108. }
  2109. e.preventDefault();
  2110. e.stopPropagation();
  2111. if (!e.hasOwnProperty("offsetX")) {
  2112. // The polyfill doesn't set this properly
  2113. e.offsetX = e.pageX - e.currentTarget.offsetLeft;
  2114. e.offsetY = e.pageY - e.currentTarget.offsetTop;
  2115. }
  2116. var thisPtr = layerdict.pointerStates[e.pointerId];
  2117. var dx = e.offsetX - thisPtr.lastX;
  2118. var dy = e.offsetY - thisPtr.lastY;
  2119. // If this number is low on pointer up, we count the action as a click
  2120. thisPtr.distanceTravelled += Math.abs(dx) + Math.abs(dy);
  2121. if (Object.keys(layerdict.pointerStates).length == 1) {
  2122. // This is a simple drag
  2123. layerdict.transform.panx += devicePixelRatio * dx / layerdict.transform.zoom;
  2124. layerdict.transform.pany += devicePixelRatio * dy / layerdict.transform.zoom;
  2125. } else if (Object.keys(layerdict.pointerStates).length == 2) {
  2126. var otherPtr = Object.values(layerdict.pointerStates).filter((ptr) => ptr != thisPtr)[0];
  2127. var oldDist = Math.sqrt(Math.pow(thisPtr.lastX - otherPtr.lastX, 2) + Math.pow(thisPtr.lastY - otherPtr.lastY, 2));
  2128. var newDist = Math.sqrt(Math.pow(e.offsetX - otherPtr.lastX, 2) + Math.pow(e.offsetY - otherPtr.lastY, 2));
  2129. var scaleFactor = newDist / oldDist;
  2130. if (scaleFactor != NaN) {
  2131. layerdict.transform.zoom *= scaleFactor;
  2132. var zoomd = (1 - scaleFactor) / layerdict.transform.zoom;
  2133. layerdict.transform.panx += devicePixelRatio * otherPtr.lastX * zoomd;
  2134. layerdict.transform.pany += devicePixelRatio * otherPtr.lastY * zoomd;
  2135. }
  2136. }
  2137. thisPtr.lastX = e.offsetX;
  2138. thisPtr.lastY = e.offsetY;
  2139. if (settings.redrawOnDrag) {
  2140. redrawCanvas(layerdict);
  2141. }
  2142. }
  2143. function handleMouseWheel(e, layerdict) {
  2144. e.preventDefault();
  2145. e.stopPropagation();
  2146. var t = layerdict.transform;
  2147. var wheeldelta = e.deltaY;
  2148. if (e.deltaMode == 1) {
  2149. // FF only, scroll by lines
  2150. wheeldelta *= 30;
  2151. } else if (e.deltaMode == 2) {
  2152. wheeldelta *= 300;
  2153. }
  2154. var m = Math.pow(1.1, -wheeldelta / 40);
  2155. // Limit amount of zoom per tick.
  2156. if (m > 2) {
  2157. m = 2;
  2158. } else if (m < 0.5) {
  2159. m = 0.5;
  2160. }
  2161. t.zoom *= m;
  2162. var zoomd = (1 - m) / t.zoom;
  2163. t.panx += devicePixelRatio * e.offsetX * zoomd;
  2164. t.pany += devicePixelRatio * e.offsetY * zoomd;
  2165. redrawCanvas(layerdict);
  2166. }
  2167. function addMouseHandlers(div, layerdict) {
  2168. div.addEventListener("pointerdown", function(e) {
  2169. handlePointerDown(e, layerdict);
  2170. });
  2171. div.addEventListener("pointermove", function(e) {
  2172. handlePointerMove(e, layerdict);
  2173. });
  2174. div.addEventListener("pointerup", function(e) {
  2175. handlePointerUp(e, layerdict);
  2176. });
  2177. var pointerleave = function(e) {
  2178. handlePointerLeave(e, layerdict);
  2179. }
  2180. div.addEventListener("pointercancel", pointerleave);
  2181. div.addEventListener("pointerleave", pointerleave);
  2182. div.addEventListener("pointerout", pointerleave);
  2183. div.onwheel = function(e) {
  2184. handleMouseWheel(e, layerdict);
  2185. }
  2186. for (var element of [div, layerdict.bg, layerdict.fab, layerdict.silk, layerdict.highlight]) {
  2187. element.addEventListener("contextmenu", function(e) {
  2188. e.preventDefault();
  2189. }, false);
  2190. }
  2191. }
  2192. function setRedrawOnDrag(value) {
  2193. settings.redrawOnDrag = value;
  2194. writeStorage("redrawOnDrag", value);
  2195. }
  2196. function setBoardRotation(value) {
  2197. settings.boardRotation = value * 5;
  2198. writeStorage("boardRotation", settings.boardRotation);
  2199. document.getElementById("rotationDegree").textContent = settings.boardRotation;
  2200. resizeAll();
  2201. }
  2202. function initRender() {
  2203. allcanvas = {
  2204. front: {
  2205. transform: {
  2206. x: 0,
  2207. y: 0,
  2208. s: 1,
  2209. panx: 0,
  2210. pany: 0,
  2211. zoom: 1,
  2212. },
  2213. pointerStates: {},
  2214. anotherPointerTapped: false,
  2215. bg: document.getElementById("F_bg"),
  2216. fab: document.getElementById("F_fab"),
  2217. silk: document.getElementById("F_slk"),
  2218. highlight: document.getElementById("F_hl"),
  2219. layer: "F",
  2220. },
  2221. back: {
  2222. transform: {
  2223. x: 0,
  2224. y: 0,
  2225. s: 1,
  2226. panx: 0,
  2227. pany: 0,
  2228. zoom: 1,
  2229. },
  2230. pointerStates: {},
  2231. anotherPointerTapped: false,
  2232. bg: document.getElementById("B_bg"),
  2233. fab: document.getElementById("B_fab"),
  2234. silk: document.getElementById("B_slk"),
  2235. highlight: document.getElementById("B_hl"),
  2236. layer: "B",
  2237. }
  2238. };
  2239. addMouseHandlers(document.getElementById("frontcanvas"), allcanvas.front);
  2240. addMouseHandlers(document.getElementById("backcanvas"), allcanvas.back);
  2241. }
  2242. ///////////////////////////////////////////////
  2243. ///////////////////////////////////////////////
  2244. /*
  2245. * Table reordering via Drag'n'Drop
  2246. * Inspired by: https://htmldom.dev/drag-and-drop-table-column
  2247. */
  2248. function setBomHandlers() {
  2249. const bom = document.getElementById('bomtable');
  2250. let dragName;
  2251. let placeHolderElements;
  2252. let draggingElement;
  2253. let forcePopulation;
  2254. let xOffset;
  2255. let yOffset;
  2256. let wasDragged;
  2257. const mouseUpHandler = function(e) {
  2258. // Delete dragging element
  2259. draggingElement.remove();
  2260. // Make BOM selectable again
  2261. bom.style.removeProperty("userSelect");
  2262. // Remove listeners
  2263. document.removeEventListener('mousemove', mouseMoveHandler);
  2264. document.removeEventListener('mouseup', mouseUpHandler);
  2265. if (wasDragged) {
  2266. // Redraw whole BOM
  2267. populateBomTable();
  2268. }
  2269. }
  2270. const mouseMoveHandler = function(e) {
  2271. // Notice the dragging
  2272. wasDragged = true;
  2273. // Make the dragged element visible
  2274. draggingElement.style.removeProperty("display");
  2275. // Set elements position to mouse position
  2276. draggingElement.style.left = `${e.screenX - xOffset}px`;
  2277. draggingElement.style.top = `${e.screenY - yOffset}px`;
  2278. // Forced redrawing of BOM table
  2279. if (forcePopulation) {
  2280. forcePopulation = false;
  2281. // Copy array
  2282. phe = Array.from(placeHolderElements);
  2283. // populate BOM table again
  2284. populateBomHeader(dragName, phe);
  2285. populateBomBody(dragName, phe);
  2286. }
  2287. // Set up array of hidden columns
  2288. var hiddenColumns = Array.from(settings.hiddenColumns);
  2289. // In the ungrouped mode, quantity don't exist
  2290. if (settings.bommode === "ungrouped")
  2291. hiddenColumns.push("Quantity");
  2292. // If no checkbox fields can be found, we consider them hidden
  2293. if (settings.checkboxes.length == 0)
  2294. hiddenColumns.push("checkboxes");
  2295. // Get table headers and group them into checkboxes, extrafields and normal headers
  2296. const bh = document.getElementById("bomhead");
  2297. headers = Array.from(bh.querySelectorAll("th"))
  2298. headers.shift() // numCol is not part of the columnOrder
  2299. headerGroups = []
  2300. lastCompoundClass = null;
  2301. for (i = 0; i < settings.columnOrder.length; i++) {
  2302. cElem = settings.columnOrder[i];
  2303. if (hiddenColumns.includes(cElem)) {
  2304. // Hidden columns appear as a dummy element
  2305. headerGroups.push([]);
  2306. continue;
  2307. }
  2308. elem = headers.filter(e => getColumnOrderName(e) === cElem)[0];
  2309. if (elem.classList.contains("bom-checkbox")) {
  2310. if (lastCompoundClass === "bom-checkbox") {
  2311. cbGroup = headerGroups.pop();
  2312. cbGroup.push(elem);
  2313. headerGroups.push(cbGroup);
  2314. } else {
  2315. lastCompoundClass = "bom-checkbox";
  2316. headerGroups.push([elem])
  2317. }
  2318. } else {
  2319. headerGroups.push([elem])
  2320. }
  2321. }
  2322. // Copy settings.columnOrder
  2323. var columns = Array.from(settings.columnOrder)
  2324. // Set up array with indices of hidden columns
  2325. var hiddenIndices = hiddenColumns.map(e => settings.columnOrder.indexOf(e));
  2326. var dragIndex = columns.indexOf(dragName);
  2327. var swapIndex = dragIndex;
  2328. var swapDone = false;
  2329. // Check if the current dragged element is swapable with the left or right element
  2330. if (dragIndex > 0) {
  2331. // Get left headers boundingbox
  2332. swapIndex = dragIndex - 1;
  2333. while (hiddenIndices.includes(swapIndex) && swapIndex > 0)
  2334. swapIndex--;
  2335. if (!hiddenIndices.includes(swapIndex)) {
  2336. box = getBoundingClientRectFromMultiple(headerGroups[swapIndex]);
  2337. if (e.clientX < box.left + window.scrollX + (box.width / 2)) {
  2338. swapElement = columns[dragIndex];
  2339. columns.splice(dragIndex, 1);
  2340. columns.splice(swapIndex, 0, swapElement);
  2341. forcePopulation = true;
  2342. swapDone = true;
  2343. }
  2344. }
  2345. }
  2346. if ((!swapDone) && dragIndex < headerGroups.length - 1) {
  2347. // Get right headers boundingbox
  2348. swapIndex = dragIndex + 1;
  2349. while (hiddenIndices.includes(swapIndex))
  2350. swapIndex++;
  2351. if (swapIndex < headerGroups.length) {
  2352. box = getBoundingClientRectFromMultiple(headerGroups[swapIndex]);
  2353. if (e.clientX > box.left + window.scrollX + (box.width / 2)) {
  2354. swapElement = columns[dragIndex];
  2355. columns.splice(dragIndex, 1);
  2356. columns.splice(swapIndex, 0, swapElement);
  2357. forcePopulation = true;
  2358. swapDone = true;
  2359. }
  2360. }
  2361. }
  2362. // Write back change to storage
  2363. if (swapDone) {
  2364. settings.columnOrder = columns
  2365. writeStorage("columnOrder", JSON.stringify(columns));
  2366. }
  2367. }
  2368. const mouseDownHandler = function(e) {
  2369. var target = e.target;
  2370. if (target.tagName.toLowerCase() != "td")
  2371. target = target.parentElement;
  2372. // Used to check if a dragging has ever happened
  2373. wasDragged = false;
  2374. // Create new element which will be displayed as the dragged column
  2375. draggingElement = document.createElement("div")
  2376. draggingElement.classList.add("dragging");
  2377. draggingElement.style.display = "none";
  2378. draggingElement.style.position = "absolute";
  2379. draggingElement.style.overflow = "hidden";
  2380. // Get bomhead and bombody elements
  2381. const bh = document.getElementById("bomhead");
  2382. const bb = document.getElementById("bombody");
  2383. // Get all compound headers for the current column
  2384. var compoundHeaders;
  2385. if (target.classList.contains("bom-checkbox")) {
  2386. compoundHeaders = Array.from(bh.querySelectorAll("th.bom-checkbox"));
  2387. } else {
  2388. compoundHeaders = [target];
  2389. }
  2390. // Create new table which will display the column
  2391. var newTable = document.createElement("table");
  2392. newTable.classList.add("bom");
  2393. newTable.style.background = "white";
  2394. draggingElement.append(newTable);
  2395. // Create new header element
  2396. var newHeader = document.createElement("thead");
  2397. newTable.append(newHeader);
  2398. // Set up array for storing all placeholder elements
  2399. placeHolderElements = [];
  2400. // Add all compound headers to the new thead element and placeholders
  2401. compoundHeaders.forEach(function(h) {
  2402. clone = cloneElementWithDimensions(h);
  2403. newHeader.append(clone);
  2404. placeHolderElements.push(clone);
  2405. });
  2406. // Create new body element
  2407. var newBody = document.createElement("tbody");
  2408. newTable.append(newBody);
  2409. // Get indices for compound headers
  2410. var idxs = compoundHeaders.map(e => getBomTableHeaderIndex(e));
  2411. // For each row in the BOM body...
  2412. var rows = bb.querySelectorAll("tr");
  2413. rows.forEach(function(row) {
  2414. // ..get the cells for the compound column
  2415. const tds = row.querySelectorAll("td");
  2416. var copytds = idxs.map(i => tds[i]);
  2417. // Add them to the new element and the placeholders
  2418. var newRow = document.createElement("tr");
  2419. copytds.forEach(function(td) {
  2420. clone = cloneElementWithDimensions(td);
  2421. newRow.append(clone);
  2422. placeHolderElements.push(clone);
  2423. });
  2424. newBody.append(newRow);
  2425. });
  2426. // Compute width for compound header
  2427. var width = compoundHeaders.reduce((acc, x) => acc + x.clientWidth, 0);
  2428. draggingElement.style.width = `${width}px`;
  2429. // Insert the new dragging element and disable selection on BOM
  2430. bom.insertBefore(draggingElement, null);
  2431. bom.style.userSelect = "none";
  2432. // Determine the mouse position offset
  2433. xOffset = e.screenX - compoundHeaders.reduce((acc, x) => Math.min(acc, x.offsetLeft), compoundHeaders[0].offsetLeft);
  2434. yOffset = e.screenY - compoundHeaders[0].offsetTop;
  2435. // Get name for the column in settings.columnOrder
  2436. dragName = getColumnOrderName(target);
  2437. // Change text and class for placeholder elements
  2438. placeHolderElements = placeHolderElements.map(function(e) {
  2439. newElem = cloneElementWithDimensions(e);
  2440. newElem.textContent = "";
  2441. newElem.classList.add("placeholder");
  2442. return newElem;
  2443. });
  2444. // On next mouse move, the whole BOM needs to be redrawn to show the placeholders
  2445. forcePopulation = true;
  2446. // Add listeners for move and up on mouse
  2447. document.addEventListener('mousemove', mouseMoveHandler);
  2448. document.addEventListener('mouseup', mouseUpHandler);
  2449. }
  2450. // In netlist mode, there is nothing to reorder
  2451. if (settings.bommode === "netlist")
  2452. return;
  2453. // Add mouseDownHandler to every column except the numCol
  2454. bom.querySelectorAll("th")
  2455. .forEach(function(head) {
  2456. if (!head.classList.contains("numCol")) {
  2457. head.onmousedown = mouseDownHandler;
  2458. }
  2459. });
  2460. }
  2461. function getBoundingClientRectFromMultiple(elements) {
  2462. var elems = Array.from(elements);
  2463. if (elems.length == 0)
  2464. return null;
  2465. var box = elems.shift()
  2466. .getBoundingClientRect();
  2467. elems.forEach(function(elem) {
  2468. var elembox = elem.getBoundingClientRect();
  2469. box.left = Math.min(elembox.left, box.left);
  2470. box.top = Math.min(elembox.top, box.top);
  2471. box.width += elembox.width;
  2472. box.height = Math.max(elembox.height, box.height);
  2473. });
  2474. return box;
  2475. }
  2476. function cloneElementWithDimensions(elem) {
  2477. var newElem = elem.cloneNode(true);
  2478. newElem.style.height = window.getComputedStyle(elem).height;
  2479. newElem.style.width = window.getComputedStyle(elem).width;
  2480. return newElem;
  2481. }
  2482. function getBomTableHeaderIndex(elem) {
  2483. const bh = document.getElementById('bomhead');
  2484. const ths = Array.from(bh.querySelectorAll("th"));
  2485. return ths.indexOf(elem);
  2486. }
  2487. function getColumnOrderName(elem) {
  2488. var cname = elem.getAttribute("col_name");
  2489. if (cname === "bom-checkbox")
  2490. return "checkboxes";
  2491. else
  2492. return cname;
  2493. }
  2494. function resizableGrid(tablehead) {
  2495. var cols = tablehead.firstElementChild.children;
  2496. var rowWidth = tablehead.offsetWidth;
  2497. for (var i = 1; i < cols.length; i++) {
  2498. if (cols[i].classList.contains("bom-checkbox"))
  2499. continue;
  2500. cols[i].style.width = ((cols[i].clientWidth - paddingDiff(cols[i])) * 100 / rowWidth) + '%';
  2501. }
  2502. for (var i = 1; i < cols.length - 1; i++) {
  2503. var div = document.createElement('div');
  2504. div.className = "column-width-handle";
  2505. cols[i].appendChild(div);
  2506. setListeners(div);
  2507. }
  2508. function setListeners(div) {
  2509. var startX, curCol, nxtCol, curColWidth, nxtColWidth, rowWidth;
  2510. div.addEventListener('mousedown', function(e) {
  2511. e.preventDefault();
  2512. e.stopPropagation();
  2513. curCol = e.target.parentElement;
  2514. nxtCol = curCol.nextElementSibling;
  2515. startX = e.pageX;
  2516. var padding = paddingDiff(curCol);
  2517. rowWidth = curCol.parentElement.offsetWidth;
  2518. curColWidth = curCol.clientWidth - padding;
  2519. nxtColWidth = nxtCol.clientWidth - padding;
  2520. });
  2521. document.addEventListener('mousemove', function(e) {
  2522. if (startX) {
  2523. var diffX = e.pageX - startX;
  2524. diffX = -Math.min(-diffX, curColWidth - 20);
  2525. diffX = Math.min(diffX, nxtColWidth - 20);
  2526. curCol.style.width = ((curColWidth + diffX) * 100 / rowWidth) + '%';
  2527. nxtCol.style.width = ((nxtColWidth - diffX) * 100 / rowWidth) + '%';
  2528. console.log(`${curColWidth + nxtColWidth} ${(curColWidth + diffX) * 100 / rowWidth + (nxtColWidth - diffX) * 100 / rowWidth}`);
  2529. }
  2530. });
  2531. document.addEventListener('mouseup', function(e) {
  2532. curCol = undefined;
  2533. nxtCol = undefined;
  2534. startX = undefined;
  2535. nxtColWidth = undefined;
  2536. curColWidth = undefined
  2537. });
  2538. }
  2539. function paddingDiff(col) {
  2540. if (getStyleVal(col, 'box-sizing') == 'border-box') {
  2541. return 0;
  2542. }
  2543. var padLeft = getStyleVal(col, 'padding-left');
  2544. var padRight = getStyleVal(col, 'padding-right');
  2545. return (parseInt(padLeft) + parseInt(padRight));
  2546. }
  2547. function getStyleVal(elm, css) {
  2548. return (window.getComputedStyle(elm, null).getPropertyValue(css))
  2549. }
  2550. }
  2551. ///////////////////////////////////////////////
  2552. ///////////////////////////////////////////////
  2553. /* DOM manipulation and misc code */
  2554. var bomsplit;
  2555. var canvassplit;
  2556. var initDone = false;
  2557. var bomSortFunction = null;
  2558. var currentSortColumn = null;
  2559. var currentSortOrder = null;
  2560. var currentHighlightedRowId;
  2561. var highlightHandlers = [];
  2562. var footprintIndexToHandler = {};
  2563. var netsToHandler = {};
  2564. var markedFootprints = new Set();
  2565. var highlightedFootprints = [];
  2566. var highlightedNet = null;
  2567. var lastClicked;
  2568. function dbg(html) {
  2569. dbgdiv.innerHTML = html;
  2570. }
  2571. function redrawIfInitDone() {
  2572. if (initDone) {
  2573. redrawCanvas(allcanvas.front);
  2574. redrawCanvas(allcanvas.back);
  2575. }
  2576. }
  2577. function padsVisible(value) {
  2578. writeStorage("padsVisible", value);
  2579. settings.renderPads = value;
  2580. redrawIfInitDone();
  2581. }
  2582. function referencesVisible(value) {
  2583. writeStorage("referencesVisible", value);
  2584. settings.renderReferences = value;
  2585. redrawIfInitDone();
  2586. }
  2587. function valuesVisible(value) {
  2588. writeStorage("valuesVisible", value);
  2589. settings.renderValues = value;
  2590. redrawIfInitDone();
  2591. }
  2592. function tracksVisible(value) {
  2593. writeStorage("tracksVisible", value);
  2594. settings.renderTracks = value;
  2595. redrawIfInitDone();
  2596. }
  2597. function zonesVisible(value) {
  2598. writeStorage("zonesVisible", value);
  2599. settings.renderZones = value;
  2600. redrawIfInitDone();
  2601. }
  2602. function dnpOutline(value) {
  2603. writeStorage("dnpOutline", value);
  2604. settings.renderDnpOutline = value;
  2605. redrawIfInitDone();
  2606. }
  2607. function setDarkMode(value) {
  2608. if (value) {
  2609. topmostdiv.classList.add("dark");
  2610. } else {
  2611. topmostdiv.classList.remove("dark");
  2612. }
  2613. writeStorage("darkmode", value);
  2614. settings.darkMode = value;
  2615. redrawIfInitDone();
  2616. }
  2617. function setShowBOMColumn(field, value) {
  2618. if (field === "references") {
  2619. var rl = document.getElementById("reflookup");
  2620. rl.disabled = !value;
  2621. if (!value) {
  2622. rl.value = "";
  2623. updateRefLookup("");
  2624. }
  2625. }
  2626. var n = settings.hiddenColumns.indexOf(field);
  2627. if (value) {
  2628. if (n != -1) {
  2629. settings.hiddenColumns.splice(n, 1);
  2630. }
  2631. } else {
  2632. if (n == -1) {
  2633. settings.hiddenColumns.push(field);
  2634. }
  2635. }
  2636. writeStorage("hiddenColumns", JSON.stringify(settings.hiddenColumns));
  2637. if (initDone) {
  2638. populateBomTable();
  2639. }
  2640. redrawIfInitDone();
  2641. }
  2642. function setFullscreen(value) {
  2643. if (value) {
  2644. document.documentElement.requestFullscreen();
  2645. } else {
  2646. document.exitFullscreen();
  2647. }
  2648. }
  2649. function fabricationVisible(value) {
  2650. writeStorage("fabricationVisible", value);
  2651. settings.renderFabrication = value;
  2652. redrawIfInitDone();
  2653. }
  2654. function silkscreenVisible(value) {
  2655. writeStorage("silkscreenVisible", value);
  2656. settings.renderSilkscreen = value;
  2657. redrawIfInitDone();
  2658. }
  2659. function setHighlightPin1(value) {
  2660. writeStorage("highlightpin1", value);
  2661. settings.highlightpin1 = value;
  2662. redrawIfInitDone();
  2663. }
  2664. function getStoredCheckboxRefs(checkbox) {
  2665. function convert(ref) {
  2666. var intref = parseInt(ref);
  2667. if (isNaN(intref)) {
  2668. for (var i = 0; i < pcbdata.footprints.length; i++) {
  2669. if (pcbdata.footprints[i].ref == ref) {
  2670. return i;
  2671. }
  2672. }
  2673. return -1;
  2674. } else {
  2675. return intref;
  2676. }
  2677. }
  2678. if (!(checkbox in settings.checkboxStoredRefs)) {
  2679. var val = readStorage("checkbox_" + checkbox);
  2680. settings.checkboxStoredRefs[checkbox] = val ? val : "";
  2681. }
  2682. if (!settings.checkboxStoredRefs[checkbox]) {
  2683. return new Set();
  2684. } else {
  2685. return new Set(settings.checkboxStoredRefs[checkbox].split(",").map(r => convert(r)).filter(a => a >= 0));
  2686. }
  2687. }
  2688. function getCheckboxState(checkbox, references) {
  2689. var storedRefsSet = getStoredCheckboxRefs(checkbox);
  2690. var currentRefsSet = new Set(references.map(r => r[1]));
  2691. // Get difference of current - stored
  2692. var difference = new Set(currentRefsSet);
  2693. for (ref of storedRefsSet) {
  2694. difference.delete(ref);
  2695. }
  2696. if (difference.size == 0) {
  2697. // All the current refs are stored
  2698. return "checked";
  2699. } else if (difference.size == currentRefsSet.size) {
  2700. // None of the current refs are stored
  2701. return "unchecked";
  2702. } else {
  2703. // Some of the refs are stored
  2704. return "indeterminate";
  2705. }
  2706. }
  2707. function setBomCheckboxState(checkbox, element, references) {
  2708. var state = getCheckboxState(checkbox, references);
  2709. element.checked = (state == "checked");
  2710. element.indeterminate = (state == "indeterminate");
  2711. }
  2712. function createCheckboxChangeHandler(checkbox, references, row) {
  2713. return function () {
  2714. refsSet = getStoredCheckboxRefs(checkbox);
  2715. var markWhenChecked = settings.markWhenChecked == checkbox;
  2716. eventArgs = {
  2717. checkbox: checkbox,
  2718. refs: references,
  2719. }
  2720. if (this.checked) {
  2721. // checkbox ticked
  2722. for (var ref of references) {
  2723. refsSet.add(ref[1]);
  2724. }
  2725. if (markWhenChecked) {
  2726. row.classList.add("checked");
  2727. for (var ref of references) {
  2728. markedFootprints.add(ref[1]);
  2729. }
  2730. drawHighlights();
  2731. }
  2732. eventArgs.state = 'checked';
  2733. } else {
  2734. // checkbox unticked
  2735. for (var ref of references) {
  2736. refsSet.delete(ref[1]);
  2737. }
  2738. if (markWhenChecked) {
  2739. row.classList.remove("checked");
  2740. for (var ref of references) {
  2741. markedFootprints.delete(ref[1]);
  2742. }
  2743. drawHighlights();
  2744. }
  2745. eventArgs.state = 'unchecked';
  2746. }
  2747. settings.checkboxStoredRefs[checkbox] = [...refsSet].join(",");
  2748. writeStorage("checkbox_" + checkbox, settings.checkboxStoredRefs[checkbox]);
  2749. updateCheckboxStats(checkbox);
  2750. EventHandler.emitEvent(IBOM_EVENT_TYPES.CHECKBOX_CHANGE_EVENT, eventArgs);
  2751. }
  2752. }
  2753. function clearHighlightedFootprints() {
  2754. if (currentHighlightedRowId) {
  2755. document.getElementById(currentHighlightedRowId).classList.remove("highlighted");
  2756. currentHighlightedRowId = null;
  2757. highlightedFootprints = [];
  2758. highlightedNet = null;
  2759. }
  2760. }
  2761. function createRowHighlightHandler(rowid, refs, net) {
  2762. return function () {
  2763. if (currentHighlightedRowId) {
  2764. if (currentHighlightedRowId == rowid) {
  2765. return;
  2766. }
  2767. document.getElementById(currentHighlightedRowId).classList.remove("highlighted");
  2768. }
  2769. document.getElementById(rowid).classList.add("highlighted");
  2770. currentHighlightedRowId = rowid;
  2771. highlightedFootprints = refs ? refs.map(r => r[1]) : [];
  2772. highlightedNet = net;
  2773. drawHighlights();
  2774. EventHandler.emitEvent(
  2775. IBOM_EVENT_TYPES.HIGHLIGHT_EVENT, {
  2776. rowid: rowid,
  2777. refs: refs,
  2778. net: net
  2779. });
  2780. }
  2781. }
  2782. function entryMatches(entry) {
  2783. if (settings.bommode == "netlist") {
  2784. // entry is just a net name
  2785. return entry.toLowerCase().indexOf(filter) >= 0;
  2786. }
  2787. // check refs
  2788. if (!settings.hiddenColumns.includes("references")) {
  2789. for (var ref of entry) {
  2790. if (ref[0].toLowerCase().indexOf(filter) >= 0) {
  2791. return true;
  2792. }
  2793. }
  2794. }
  2795. // check fields
  2796. for (var i in config.fields) {
  2797. var f = config.fields[i];
  2798. if (!settings.hiddenColumns.includes(f)) {
  2799. for (var ref of entry) {
  2800. if (pcbdata.bom.fields[ref[1]][i].toLowerCase().indexOf(filter) >= 0) {
  2801. return true;
  2802. }
  2803. }
  2804. }
  2805. }
  2806. return false;
  2807. }
  2808. function findRefInEntry(entry) {
  2809. return entry.filter(r => r[0].toLowerCase() == reflookup);
  2810. }
  2811. function highlightFilter(s) {
  2812. if (!filter) {
  2813. return s;
  2814. }
  2815. var parts = s.toLowerCase().split(filter);
  2816. if (parts.length == 1) {
  2817. return s;
  2818. }
  2819. var r = "";
  2820. var pos = 0;
  2821. for (var i in parts) {
  2822. if (i > 0) {
  2823. r += '<mark class="highlight">' +
  2824. s.substring(pos, pos + filter.length) +
  2825. '</mark>';
  2826. pos += filter.length;
  2827. }
  2828. r += s.substring(pos, pos + parts[i].length);
  2829. pos += parts[i].length;
  2830. }
  2831. return r;
  2832. }
  2833. function checkboxSetUnsetAllHandler(checkboxname) {
  2834. return function () {
  2835. var checkboxnum = 0;
  2836. while (checkboxnum < settings.checkboxes.length &&
  2837. settings.checkboxes[checkboxnum].toLowerCase() != checkboxname.toLowerCase()) {
  2838. checkboxnum++;
  2839. }
  2840. if (checkboxnum >= settings.checkboxes.length) {
  2841. return;
  2842. }
  2843. var allset = true;
  2844. var checkbox;
  2845. var row;
  2846. for (row of bombody.childNodes) {
  2847. checkbox = row.childNodes[checkboxnum + 1].childNodes[0];
  2848. if (!checkbox.checked || checkbox.indeterminate) {
  2849. allset = false;
  2850. break;
  2851. }
  2852. }
  2853. for (row of bombody.childNodes) {
  2854. checkbox = row.childNodes[checkboxnum + 1].childNodes[0];
  2855. checkbox.checked = !allset;
  2856. checkbox.indeterminate = false;
  2857. checkbox.onchange();
  2858. }
  2859. }
  2860. }
  2861. function createColumnHeader(name, cls, comparator, is_checkbox = false) {
  2862. var th = document.createElement("TH");
  2863. th.innerHTML = name;
  2864. th.classList.add(cls);
  2865. if (is_checkbox)
  2866. th.setAttribute("col_name", "bom-checkbox");
  2867. else
  2868. th.setAttribute("col_name", name);
  2869. var span = document.createElement("SPAN");
  2870. span.classList.add("sortmark");
  2871. span.classList.add("none");
  2872. th.appendChild(span);
  2873. var spacer = document.createElement("div");
  2874. spacer.className = "column-spacer";
  2875. th.appendChild(spacer);
  2876. spacer.onclick = function () {
  2877. if (currentSortColumn && th !== currentSortColumn) {
  2878. // Currently sorted by another column
  2879. currentSortColumn.childNodes[1].classList.remove(currentSortOrder);
  2880. currentSortColumn.childNodes[1].classList.add("none");
  2881. currentSortColumn = null;
  2882. currentSortOrder = null;
  2883. }
  2884. if (currentSortColumn && th === currentSortColumn) {
  2885. // Already sorted by this column
  2886. if (currentSortOrder == "asc") {
  2887. // Sort by this column, descending order
  2888. bomSortFunction = function (a, b) {
  2889. return -comparator(a, b);
  2890. }
  2891. currentSortColumn.childNodes[1].classList.remove("asc");
  2892. currentSortColumn.childNodes[1].classList.add("desc");
  2893. currentSortOrder = "desc";
  2894. } else {
  2895. // Unsort
  2896. bomSortFunction = null;
  2897. currentSortColumn.childNodes[1].classList.remove("desc");
  2898. currentSortColumn.childNodes[1].classList.add("none");
  2899. currentSortColumn = null;
  2900. currentSortOrder = null;
  2901. }
  2902. } else {
  2903. // Sort by this column, ascending order
  2904. bomSortFunction = comparator;
  2905. currentSortColumn = th;
  2906. currentSortColumn.childNodes[1].classList.remove("none");
  2907. currentSortColumn.childNodes[1].classList.add("asc");
  2908. currentSortOrder = "asc";
  2909. }
  2910. populateBomBody();
  2911. }
  2912. if (is_checkbox) {
  2913. spacer.onclick = fancyDblClickHandler(
  2914. spacer, spacer.onclick, checkboxSetUnsetAllHandler(name));
  2915. }
  2916. return th;
  2917. }
  2918. function populateBomHeader(placeHolderColumn = null, placeHolderElements = null) {
  2919. while (bomhead.firstChild) {
  2920. bomhead.removeChild(bomhead.firstChild);
  2921. }
  2922. var tr = document.createElement("TR");
  2923. var th = document.createElement("TH");
  2924. th.classList.add("numCol");
  2925. var vismenu = document.createElement("div");
  2926. vismenu.id = "vismenu";
  2927. vismenu.classList.add("menu");
  2928. var visbutton = document.createElement("div");
  2929. visbutton.classList.add("visbtn");
  2930. visbutton.classList.add("hideonprint");
  2931. var viscontent = document.createElement("div");
  2932. viscontent.classList.add("menu-content");
  2933. viscontent.id = "vismenu-content";
  2934. settings.columnOrder.forEach(column => {
  2935. if (typeof column !== "string")
  2936. return;
  2937. // Skip empty columns
  2938. if (column === "checkboxes" && settings.checkboxes.length == 0)
  2939. return;
  2940. else if (column === "Quantity" && settings.bommode == "ungrouped")
  2941. return;
  2942. var label = document.createElement("label");
  2943. label.classList.add("menu-label");
  2944. var input = document.createElement("input");
  2945. input.classList.add("visibility_checkbox");
  2946. input.type = "checkbox";
  2947. input.onchange = function (e) {
  2948. setShowBOMColumn(column, e.target.checked)
  2949. };
  2950. input.checked = !(settings.hiddenColumns.includes(column));
  2951. label.appendChild(input);
  2952. if (column.length > 0)
  2953. label.append(column[0].toUpperCase() + column.slice(1));
  2954. viscontent.appendChild(label);
  2955. });
  2956. viscontent.childNodes[0].classList.add("menu-label-top");
  2957. vismenu.appendChild(visbutton);
  2958. if (settings.bommode != "netlist") {
  2959. vismenu.appendChild(viscontent);
  2960. th.appendChild(vismenu);
  2961. }
  2962. tr.appendChild(th);
  2963. var checkboxCompareClosure = function (checkbox) {
  2964. return (a, b) => {
  2965. var stateA = getCheckboxState(checkbox, a);
  2966. var stateB = getCheckboxState(checkbox, b);
  2967. if (stateA > stateB) return -1;
  2968. if (stateA < stateB) return 1;
  2969. return 0;
  2970. }
  2971. }
  2972. var stringFieldCompareClosure = function (fieldIndex) {
  2973. return (a, b) => {
  2974. var fa = pcbdata.bom.fields[a[0][1]][fieldIndex];
  2975. var fb = pcbdata.bom.fields[b[0][1]][fieldIndex];
  2976. if (fa != fb) return fa > fb ? 1 : -1;
  2977. else return 0;
  2978. }
  2979. }
  2980. var referenceRegex = /(?<prefix>[^0-9]+)(?<number>[0-9]+)/;
  2981. var compareRefs = (a, b) => {
  2982. var ra = referenceRegex.exec(a);
  2983. var rb = referenceRegex.exec(b);
  2984. if (ra === null || rb === null) {
  2985. if (a != b) return a > b ? 1 : -1;
  2986. return 0;
  2987. } else {
  2988. if (ra.groups.prefix != rb.groups.prefix) {
  2989. return ra.groups.prefix > rb.groups.prefix ? 1 : -1;
  2990. }
  2991. if (ra.groups.number != rb.groups.number) {
  2992. return parseInt(ra.groups.number) > parseInt(rb.groups.number) ? 1 : -1;
  2993. }
  2994. return 0;
  2995. }
  2996. }
  2997. if (settings.bommode == "netlist") {
  2998. th = createColumnHeader("Net name", "bom-netname", (a, b) => {
  2999. if (a > b) return -1;
  3000. if (a < b) return 1;
  3001. return 0;
  3002. });
  3003. tr.appendChild(th);
  3004. } else {
  3005. // Filter hidden columns
  3006. var columns = settings.columnOrder.filter(e => !settings.hiddenColumns.includes(e));
  3007. var valueIndex = config.fields.indexOf("Value");
  3008. var footprintIndex = config.fields.indexOf("Footprint");
  3009. columns.forEach((column) => {
  3010. if (column === placeHolderColumn) {
  3011. var n = 1;
  3012. if (column === "checkboxes")
  3013. n = settings.checkboxes.length;
  3014. for (i = 0; i < n; i++) {
  3015. td = placeHolderElements.shift();
  3016. tr.appendChild(td);
  3017. }
  3018. return;
  3019. } else if (column === "checkboxes") {
  3020. for (var checkbox of settings.checkboxes) {
  3021. th = createColumnHeader(
  3022. checkbox, "bom-checkbox", checkboxCompareClosure(checkbox), true);
  3023. tr.appendChild(th);
  3024. }
  3025. } else if (column === "References") {
  3026. tr.appendChild(createColumnHeader("References", "references", (a, b) => {
  3027. var i = 0;
  3028. while (i < a.length && i < b.length) {
  3029. if (a[i] != b[i]) return compareRefs(a[i][0], b[i][0]);
  3030. i++;
  3031. }
  3032. return a.length - b.length;
  3033. }));
  3034. } else if (column === "Value") {
  3035. tr.appendChild(createColumnHeader("Value", "value", (a, b) => {
  3036. var ra = a[0][1], rb = b[0][1];
  3037. return valueCompare(
  3038. pcbdata.bom.parsedValues[ra], pcbdata.bom.parsedValues[rb],
  3039. pcbdata.bom.fields[ra][valueIndex], pcbdata.bom.fields[rb][valueIndex]);
  3040. }));
  3041. return;
  3042. } else if (column === "Footprint") {
  3043. tr.appendChild(createColumnHeader(
  3044. "Footprint", "footprint", stringFieldCompareClosure(footprintIndex)));
  3045. } else if (column === "Quantity" && settings.bommode == "grouped") {
  3046. tr.appendChild(createColumnHeader("Quantity", "quantity", (a, b) => {
  3047. return a.length - b.length;
  3048. }));
  3049. } else {
  3050. // Other fields
  3051. var i = config.fields.indexOf(column);
  3052. if (i < 0)
  3053. return;
  3054. tr.appendChild(createColumnHeader(
  3055. column, `field${i + 1}`, stringFieldCompareClosure(i)));
  3056. }
  3057. });
  3058. }
  3059. bomhead.appendChild(tr);
  3060. }
  3061. function populateBomBody(placeholderColumn = null, placeHolderElements = null) {
  3062. while (bom.firstChild) {
  3063. bom.removeChild(bom.firstChild);
  3064. }
  3065. highlightHandlers = [];
  3066. footprintIndexToHandler = {};
  3067. netsToHandler = {};
  3068. currentHighlightedRowId = null;
  3069. var first = true;
  3070. if (settings.bommode == "netlist") {
  3071. bomtable = pcbdata.nets.slice();
  3072. } else {
  3073. switch (settings.canvaslayout) {
  3074. case 'F':
  3075. bomtable = pcbdata.bom.F.slice();
  3076. break;
  3077. case 'FB':
  3078. bomtable = pcbdata.bom.both.slice();
  3079. break;
  3080. case 'B':
  3081. bomtable = pcbdata.bom.B.slice();
  3082. break;
  3083. }
  3084. if (settings.bommode == "ungrouped") {
  3085. // expand bom table
  3086. expandedTable = []
  3087. for (var bomentry of bomtable) {
  3088. for (var ref of bomentry) {
  3089. expandedTable.push([ref]);
  3090. }
  3091. }
  3092. bomtable = expandedTable;
  3093. }
  3094. }
  3095. if (bomSortFunction) {
  3096. bomtable = bomtable.sort(bomSortFunction);
  3097. }
  3098. for (var i in bomtable) {
  3099. var bomentry = bomtable[i];
  3100. if (filter && !entryMatches(bomentry)) {
  3101. continue;
  3102. }
  3103. var references = null;
  3104. var netname = null;
  3105. var tr = document.createElement("TR");
  3106. var td = document.createElement("TD");
  3107. var rownum = +i + 1;
  3108. tr.id = "bomrow" + rownum;
  3109. td.textContent = rownum;
  3110. tr.appendChild(td);
  3111. if (settings.bommode == "netlist") {
  3112. netname = bomentry;
  3113. td = document.createElement("TD");
  3114. td.innerHTML = highlightFilter(netname ? netname : "&lt;no net&gt;");
  3115. tr.appendChild(td);
  3116. } else {
  3117. if (reflookup) {
  3118. references = findRefInEntry(bomentry);
  3119. if (references.length == 0) {
  3120. continue;
  3121. }
  3122. } else {
  3123. references = bomentry;
  3124. }
  3125. // Filter hidden columns
  3126. var columns = settings.columnOrder.filter(e => !settings.hiddenColumns.includes(e));
  3127. columns.forEach((column) => {
  3128. if (column === placeholderColumn) {
  3129. var n = 1;
  3130. if (column === "checkboxes")
  3131. n = settings.checkboxes.length;
  3132. for (i = 0; i < n; i++) {
  3133. td = placeHolderElements.shift();
  3134. tr.appendChild(td);
  3135. }
  3136. return;
  3137. } else if (column === "checkboxes") {
  3138. for (var checkbox of settings.checkboxes) {
  3139. if (checkbox) {
  3140. td = document.createElement("TD");
  3141. var input = document.createElement("input");
  3142. input.type = "checkbox";
  3143. input.onchange = createCheckboxChangeHandler(checkbox, references, tr);
  3144. setBomCheckboxState(checkbox, input, references);
  3145. if (input.checked && settings.markWhenChecked == checkbox) {
  3146. tr.classList.add("checked");
  3147. }
  3148. td.appendChild(input);
  3149. tr.appendChild(td);
  3150. }
  3151. }
  3152. } else if (column === "References") {
  3153. td = document.createElement("TD");
  3154. td.innerHTML = highlightFilter(references.map(r => r[0]).join(", "));
  3155. tr.appendChild(td);
  3156. } else if (column === "Quantity" && settings.bommode == "grouped") {
  3157. // Quantity
  3158. td = document.createElement("TD");
  3159. td.textContent = references.length;
  3160. tr.appendChild(td);
  3161. } else {
  3162. // All the other fields
  3163. var field_index = config.fields.indexOf(column)
  3164. if (field_index < 0)
  3165. return;
  3166. var valueSet = new Set();
  3167. references.map(r => r[1]).forEach((id) => valueSet.add(pcbdata.bom.fields[id][field_index]));
  3168. td = document.createElement("TD");
  3169. td.innerHTML = highlightFilter(Array.from(valueSet).join(", "));
  3170. tr.appendChild(td);
  3171. }
  3172. });
  3173. }
  3174. bom.appendChild(tr);
  3175. var handler = createRowHighlightHandler(tr.id, references, netname);
  3176. tr.onmousemove = handler;
  3177. highlightHandlers.push({
  3178. id: tr.id,
  3179. handler: handler,
  3180. });
  3181. if (references !== null) {
  3182. for (var refIndex of references.map(r => r[1])) {
  3183. footprintIndexToHandler[refIndex] = handler;
  3184. }
  3185. }
  3186. if (netname !== null) {
  3187. netsToHandler[netname] = handler;
  3188. }
  3189. if ((filter || reflookup) && first) {
  3190. handler();
  3191. first = false;
  3192. }
  3193. }
  3194. EventHandler.emitEvent(
  3195. IBOM_EVENT_TYPES.BOM_BODY_CHANGE_EVENT, {
  3196. filter: filter,
  3197. reflookup: reflookup,
  3198. checkboxes: settings.checkboxes,
  3199. bommode: settings.bommode,
  3200. });
  3201. }
  3202. function highlightPreviousRow() {
  3203. if (!currentHighlightedRowId) {
  3204. highlightHandlers[highlightHandlers.length - 1].handler();
  3205. } else {
  3206. if (highlightHandlers.length > 1 &&
  3207. highlightHandlers[0].id == currentHighlightedRowId) {
  3208. highlightHandlers[highlightHandlers.length - 1].handler();
  3209. } else {
  3210. for (var i = 0; i < highlightHandlers.length - 1; i++) {
  3211. if (highlightHandlers[i + 1].id == currentHighlightedRowId) {
  3212. highlightHandlers[i].handler();
  3213. break;
  3214. }
  3215. }
  3216. }
  3217. }
  3218. smoothScrollToRow(currentHighlightedRowId);
  3219. }
  3220. function highlightNextRow() {
  3221. if (!currentHighlightedRowId) {
  3222. highlightHandlers[0].handler();
  3223. } else {
  3224. if (highlightHandlers.length > 1 &&
  3225. highlightHandlers[highlightHandlers.length - 1].id == currentHighlightedRowId) {
  3226. highlightHandlers[0].handler();
  3227. } else {
  3228. for (var i = 1; i < highlightHandlers.length; i++) {
  3229. if (highlightHandlers[i - 1].id == currentHighlightedRowId) {
  3230. highlightHandlers[i].handler();
  3231. break;
  3232. }
  3233. }
  3234. }
  3235. }
  3236. smoothScrollToRow(currentHighlightedRowId);
  3237. }
  3238. function populateBomTable() {
  3239. populateBomHeader();
  3240. populateBomBody();
  3241. setBomHandlers();
  3242. resizableGrid(bomhead);
  3243. }
  3244. function footprintsClicked(footprintIndexes) {
  3245. var lastClickedIndex = footprintIndexes.indexOf(lastClicked);
  3246. for (var i = 1; i <= footprintIndexes.length; i++) {
  3247. var refIndex = footprintIndexes[(lastClickedIndex + i) % footprintIndexes.length];
  3248. if (refIndex in footprintIndexToHandler) {
  3249. lastClicked = refIndex;
  3250. footprintIndexToHandler[refIndex]();
  3251. smoothScrollToRow(currentHighlightedRowId);
  3252. break;
  3253. }
  3254. }
  3255. }
  3256. function netClicked(net) {
  3257. if (net in netsToHandler) {
  3258. netsToHandler[net]();
  3259. smoothScrollToRow(currentHighlightedRowId);
  3260. } else {
  3261. clearHighlightedFootprints();
  3262. highlightedNet = net;
  3263. drawHighlights();
  3264. }
  3265. }
  3266. function updateFilter(input) {
  3267. filter = input.toLowerCase();
  3268. populateBomTable();
  3269. }
  3270. function updateRefLookup(input) {
  3271. reflookup = input.toLowerCase();
  3272. populateBomTable();
  3273. }
  3274. function changeCanvasLayout(layout) {
  3275. document.getElementById("fl-btn").classList.remove("depressed");
  3276. document.getElementById("fb-btn").classList.remove("depressed");
  3277. document.getElementById("bl-btn").classList.remove("depressed");
  3278. switch (layout) {
  3279. case 'F':
  3280. document.getElementById("fl-btn").classList.add("depressed");
  3281. if (settings.bomlayout != "bom-only") {
  3282. canvassplit.collapse(1);
  3283. }
  3284. break;
  3285. case 'B':
  3286. document.getElementById("bl-btn").classList.add("depressed");
  3287. if (settings.bomlayout != "bom-only") {
  3288. canvassplit.collapse(0);
  3289. }
  3290. break;
  3291. default:
  3292. document.getElementById("fb-btn").classList.add("depressed");
  3293. if (settings.bomlayout != "bom-only") {
  3294. canvassplit.setSizes([50, 50]);
  3295. }
  3296. }
  3297. settings.canvaslayout = layout;
  3298. writeStorage("canvaslayout", layout);
  3299. resizeAll();
  3300. changeBomMode(settings.bommode);
  3301. }
  3302. function populateMetadata() {
  3303. document.getElementById("title").innerHTML = pcbdata.metadata.title;
  3304. document.getElementById("revision").innerHTML = "Rev: " + pcbdata.metadata.revision;
  3305. document.getElementById("company").innerHTML = pcbdata.metadata.company;
  3306. document.getElementById("filedate").innerHTML = pcbdata.metadata.date;
  3307. if (pcbdata.metadata.title != "") {
  3308. document.title = pcbdata.metadata.title + " BOM";
  3309. }
  3310. // Calculate board stats
  3311. var fp_f = 0,
  3312. fp_b = 0,
  3313. pads_f = 0,
  3314. pads_b = 0,
  3315. pads_th = 0;
  3316. for (var i = 0; i < pcbdata.footprints.length; i++) {
  3317. if (pcbdata.bom.skipped.includes(i)) continue;
  3318. var mod = pcbdata.footprints[i];
  3319. if (mod.layer == "F") {
  3320. fp_f++;
  3321. } else {
  3322. fp_b++;
  3323. }
  3324. for (var pad of mod.pads) {
  3325. if (pad.type == "th") {
  3326. pads_th++;
  3327. } else {
  3328. if (pad.layers.includes("F")) {
  3329. pads_f++;
  3330. }
  3331. if (pad.layers.includes("B")) {
  3332. pads_b++;
  3333. }
  3334. }
  3335. }
  3336. }
  3337. document.getElementById("stats-components-front").innerHTML = fp_f;
  3338. document.getElementById("stats-components-back").innerHTML = fp_b;
  3339. document.getElementById("stats-components-total").innerHTML = fp_f + fp_b;
  3340. document.getElementById("stats-groups-front").innerHTML = pcbdata.bom.F.length;
  3341. document.getElementById("stats-groups-back").innerHTML = pcbdata.bom.B.length;
  3342. document.getElementById("stats-groups-total").innerHTML = pcbdata.bom.both.length;
  3343. document.getElementById("stats-smd-pads-front").innerHTML = pads_f;
  3344. document.getElementById("stats-smd-pads-back").innerHTML = pads_b;
  3345. document.getElementById("stats-smd-pads-total").innerHTML = pads_f + pads_b;
  3346. document.getElementById("stats-th-pads").innerHTML = pads_th;
  3347. // Update version string
  3348. document.getElementById("github-link").innerHTML = "InteractiveHtmlBom&nbsp;" +
  3349. /^v\d+\.\d+/.exec(pcbdata.ibom_version)[0];
  3350. }
  3351. function changeBomLayout(layout) {
  3352. document.getElementById("bom-btn").classList.remove("depressed");
  3353. document.getElementById("lr-btn").classList.remove("depressed");
  3354. document.getElementById("tb-btn").classList.remove("depressed");
  3355. switch (layout) {
  3356. case 'bom-only':
  3357. document.getElementById("bom-btn").classList.add("depressed");
  3358. if (bomsplit) {
  3359. bomsplit.destroy();
  3360. bomsplit = null;
  3361. canvassplit.destroy();
  3362. canvassplit = null;
  3363. }
  3364. document.getElementById("frontcanvas").style.display = "none";
  3365. document.getElementById("backcanvas").style.display = "none";
  3366. document.getElementById("bot").style.height = "";
  3367. break;
  3368. case 'top-bottom':
  3369. document.getElementById("tb-btn").classList.add("depressed");
  3370. document.getElementById("frontcanvas").style.display = "";
  3371. document.getElementById("backcanvas").style.display = "";
  3372. document.getElementById("bot").style.height = "calc(100% - 80px)";
  3373. document.getElementById("bomdiv").classList.remove("split-horizontal");
  3374. document.getElementById("canvasdiv").classList.remove("split-horizontal");
  3375. document.getElementById("frontcanvas").classList.add("split-horizontal");
  3376. document.getElementById("backcanvas").classList.add("split-horizontal");
  3377. if (bomsplit) {
  3378. bomsplit.destroy();
  3379. bomsplit = null;
  3380. canvassplit.destroy();
  3381. canvassplit = null;
  3382. }
  3383. bomsplit = Split(['#bomdiv', '#canvasdiv'], {
  3384. sizes: [50, 50],
  3385. onDragEnd: resizeAll,
  3386. direction: "vertical",
  3387. gutterSize: 5
  3388. });
  3389. canvassplit = Split(['#frontcanvas', '#backcanvas'], {
  3390. sizes: [50, 50],
  3391. gutterSize: 5,
  3392. onDragEnd: resizeAll
  3393. });
  3394. break;
  3395. case 'left-right':
  3396. document.getElementById("lr-btn").classList.add("depressed");
  3397. document.getElementById("frontcanvas").style.display = "";
  3398. document.getElementById("backcanvas").style.display = "";
  3399. document.getElementById("bot").style.height = "calc(100% - 80px)";
  3400. document.getElementById("bomdiv").classList.add("split-horizontal");
  3401. document.getElementById("canvasdiv").classList.add("split-horizontal");
  3402. document.getElementById("frontcanvas").classList.remove("split-horizontal");
  3403. document.getElementById("backcanvas").classList.remove("split-horizontal");
  3404. if (bomsplit) {
  3405. bomsplit.destroy();
  3406. bomsplit = null;
  3407. canvassplit.destroy();
  3408. canvassplit = null;
  3409. }
  3410. bomsplit = Split(['#bomdiv', '#canvasdiv'], {
  3411. sizes: [50, 50],
  3412. onDragEnd: resizeAll,
  3413. gutterSize: 5
  3414. });
  3415. canvassplit = Split(['#frontcanvas', '#backcanvas'], {
  3416. sizes: [50, 50],
  3417. gutterSize: 5,
  3418. direction: "vertical",
  3419. onDragEnd: resizeAll
  3420. });
  3421. }
  3422. settings.bomlayout = layout;
  3423. writeStorage("bomlayout", layout);
  3424. changeCanvasLayout(settings.canvaslayout);
  3425. }
  3426. function changeBomMode(mode) {
  3427. document.getElementById("bom-grouped-btn").classList.remove("depressed");
  3428. document.getElementById("bom-ungrouped-btn").classList.remove("depressed");
  3429. document.getElementById("bom-netlist-btn").classList.remove("depressed");
  3430. var chkbxs = document.getElementsByClassName("visibility_checkbox");
  3431. switch (mode) {
  3432. case 'grouped':
  3433. document.getElementById("bom-grouped-btn").classList.add("depressed");
  3434. for (var i = 0; i < chkbxs.length; i++) {
  3435. chkbxs[i].disabled = false;
  3436. }
  3437. break;
  3438. case 'ungrouped':
  3439. document.getElementById("bom-ungrouped-btn").classList.add("depressed");
  3440. for (var i = 0; i < chkbxs.length; i++) {
  3441. chkbxs[i].disabled = false;
  3442. }
  3443. break;
  3444. case 'netlist':
  3445. document.getElementById("bom-netlist-btn").classList.add("depressed");
  3446. for (var i = 0; i < chkbxs.length; i++) {
  3447. chkbxs[i].disabled = true;
  3448. }
  3449. }
  3450. writeStorage("bommode", mode);
  3451. if (mode != settings.bommode) {
  3452. settings.bommode = mode;
  3453. bomSortFunction = null;
  3454. currentSortColumn = null;
  3455. currentSortOrder = null;
  3456. clearHighlightedFootprints();
  3457. }
  3458. populateBomTable();
  3459. }
  3460. function focusFilterField() {
  3461. focusInputField(document.getElementById("filter"));
  3462. }
  3463. function focusRefLookupField() {
  3464. focusInputField(document.getElementById("reflookup"));
  3465. }
  3466. function toggleBomCheckbox(bomrowid, checkboxnum) {
  3467. if (!bomrowid || checkboxnum > settings.checkboxes.length) {
  3468. return;
  3469. }
  3470. var bomrow = document.getElementById(bomrowid);
  3471. var checkbox = bomrow.childNodes[checkboxnum].childNodes[0];
  3472. checkbox.checked = !checkbox.checked;
  3473. checkbox.indeterminate = false;
  3474. checkbox.onchange();
  3475. }
  3476. function checkBomCheckbox(bomrowid, checkboxname) {
  3477. var checkboxnum = 0;
  3478. while (checkboxnum < settings.checkboxes.length &&
  3479. settings.checkboxes[checkboxnum].toLowerCase() != checkboxname.toLowerCase()) {
  3480. checkboxnum++;
  3481. }
  3482. if (!bomrowid || checkboxnum >= settings.checkboxes.length) {
  3483. return;
  3484. }
  3485. var bomrow = document.getElementById(bomrowid);
  3486. var checkbox = bomrow.childNodes[checkboxnum + 1].childNodes[0];
  3487. checkbox.checked = true;
  3488. checkbox.indeterminate = false;
  3489. checkbox.onchange();
  3490. }
  3491. function setBomCheckboxes(value) {
  3492. writeStorage("bomCheckboxes", value);
  3493. settings.checkboxes = value.split(",").map((e) => e.trim()).filter((e) => e);
  3494. prepCheckboxes();
  3495. populateMarkWhenCheckedOptions();
  3496. setMarkWhenChecked(settings.markWhenChecked);
  3497. }
  3498. function setMarkWhenChecked(value) {
  3499. writeStorage("markWhenChecked", value);
  3500. settings.markWhenChecked = value;
  3501. markedFootprints.clear();
  3502. for (var ref of (value ? getStoredCheckboxRefs(value) : [])) {
  3503. markedFootprints.add(ref);
  3504. }
  3505. populateBomTable();
  3506. drawHighlights();
  3507. }
  3508. function prepCheckboxes() {
  3509. var table = document.getElementById("checkbox-stats");
  3510. while (table.childElementCount > 1) {
  3511. table.removeChild(table.lastChild);
  3512. }
  3513. if (settings.checkboxes.length) {
  3514. table.style.display = "";
  3515. } else {
  3516. table.style.display = "none";
  3517. }
  3518. for (var checkbox of settings.checkboxes) {
  3519. var tr = document.createElement("TR");
  3520. var td = document.createElement("TD");
  3521. td.innerHTML = checkbox;
  3522. tr.appendChild(td);
  3523. td = document.createElement("TD");
  3524. td.id = "checkbox-stats-" + checkbox;
  3525. var progressbar = document.createElement("div");
  3526. progressbar.classList.add("bar");
  3527. td.appendChild(progressbar);
  3528. var text = document.createElement("div");
  3529. text.classList.add("text");
  3530. td.appendChild(text);
  3531. tr.appendChild(td);
  3532. table.appendChild(tr);
  3533. updateCheckboxStats(checkbox);
  3534. }
  3535. }
  3536. function populateMarkWhenCheckedOptions() {
  3537. var container = document.getElementById("markWhenCheckedContainer");
  3538. if (settings.checkboxes.length == 0) {
  3539. container.parentElement.style.display = "none";
  3540. return;
  3541. }
  3542. container.innerHTML = '';
  3543. container.parentElement.style.display = "inline-block";
  3544. function createOption(name, displayName) {
  3545. var id = "markWhenChecked-" + name;
  3546. var div = document.createElement("div");
  3547. div.classList.add("radio-container");
  3548. var input = document.createElement("input");
  3549. input.type = "radio";
  3550. input.name = "markWhenChecked";
  3551. input.value = name;
  3552. input.id = id;
  3553. input.onchange = () => setMarkWhenChecked(name);
  3554. div.appendChild(input);
  3555. // Preserve the selected element when the checkboxes change
  3556. if (name == settings.markWhenChecked) {
  3557. input.checked = true;
  3558. }
  3559. var label = document.createElement("label");
  3560. label.innerHTML = displayName;
  3561. label.htmlFor = id;
  3562. div.appendChild(label);
  3563. container.appendChild(div);
  3564. }
  3565. createOption("", "None");
  3566. for (var checkbox of settings.checkboxes) {
  3567. createOption(checkbox, checkbox);
  3568. }
  3569. }
  3570. function updateCheckboxStats(checkbox) {
  3571. var checked = getStoredCheckboxRefs(checkbox).size;
  3572. var total = pcbdata.footprints.length - pcbdata.bom.skipped.length;
  3573. var percent = checked * 100.0 / total;
  3574. var td = document.getElementById("checkbox-stats-" + checkbox);
  3575. td.firstChild.style.width = percent + "%";
  3576. td.lastChild.innerHTML = checked + "/" + total + " (" + Math.round(percent) + "%)";
  3577. }
  3578. document.onkeydown = function (e) {
  3579. switch (e.key) {
  3580. case "n":
  3581. if (document.activeElement.type == "text") {
  3582. return;
  3583. }
  3584. if (currentHighlightedRowId !== null) {
  3585. checkBomCheckbox(currentHighlightedRowId, "placed");
  3586. highlightNextRow();
  3587. e.preventDefault();
  3588. }
  3589. break;
  3590. case "ArrowUp":
  3591. highlightPreviousRow();
  3592. e.preventDefault();
  3593. break;
  3594. case "ArrowDown":
  3595. highlightNextRow();
  3596. e.preventDefault();
  3597. break;
  3598. default:
  3599. break;
  3600. }
  3601. if (e.altKey) {
  3602. switch (e.key) {
  3603. case "f":
  3604. focusFilterField();
  3605. e.preventDefault();
  3606. break;
  3607. case "r":
  3608. focusRefLookupField();
  3609. e.preventDefault();
  3610. break;
  3611. case "z":
  3612. changeBomLayout("bom-only");
  3613. e.preventDefault();
  3614. break;
  3615. case "x":
  3616. changeBomLayout("left-right");
  3617. e.preventDefault();
  3618. break;
  3619. case "c":
  3620. changeBomLayout("top-bottom");
  3621. e.preventDefault();
  3622. break;
  3623. case "v":
  3624. changeCanvasLayout("F");
  3625. e.preventDefault();
  3626. break;
  3627. case "b":
  3628. changeCanvasLayout("FB");
  3629. e.preventDefault();
  3630. break;
  3631. case "n":
  3632. changeCanvasLayout("B");
  3633. e.preventDefault();
  3634. break;
  3635. default:
  3636. break;
  3637. }
  3638. if (e.key >= '1' && e.key <= '9') {
  3639. toggleBomCheckbox(currentHighlightedRowId, parseInt(e.key));
  3640. e.preventDefault();
  3641. }
  3642. }
  3643. }
  3644. function hideNetlistButton() {
  3645. document.getElementById("bom-ungrouped-btn").classList.remove("middle-button");
  3646. document.getElementById("bom-ungrouped-btn").classList.add("right-most-button");
  3647. document.getElementById("bom-netlist-btn").style.display = "none";
  3648. }
  3649. window.onload = function (e) {
  3650. initUtils();
  3651. initRender();
  3652. initStorage();
  3653. initDefaults();
  3654. cleanGutters();
  3655. populateMetadata();
  3656. dbgdiv = document.getElementById("dbg");
  3657. bom = document.getElementById("bombody");
  3658. bomhead = document.getElementById("bomhead");
  3659. filter = "";
  3660. reflookup = "";
  3661. if (!("nets" in pcbdata)) {
  3662. hideNetlistButton();
  3663. }
  3664. initDone = true;
  3665. setBomCheckboxes(document.getElementById("bomCheckboxes").value);
  3666. // Triggers render
  3667. changeBomLayout(settings.bomlayout);
  3668. // Users may leave fullscreen without touching the checkbox. Uncheck.
  3669. document.addEventListener('fullscreenchange', () => {
  3670. if (!document.fullscreenElement)
  3671. document.getElementById('fullscreenCheckbox').checked = false;
  3672. });
  3673. }
  3674. window.onresize = resizeAll;
  3675. window.matchMedia("print").addListener(resizeAll);
  3676. ///////////////////////////////////////////////
  3677. ///////////////////////////////////////////////
  3678. ///////////////////////////////////////////////
  3679. </script>
  3680. </head>
  3681. <body>
  3682. <div id="topmostdiv" class="topmostdiv">
  3683. <div id="top">
  3684. <div style="float: right; height: 100%;">
  3685. <div class="hideonprint menu" style="float: right; top: 8px;">
  3686. <button class="menubtn"></button>
  3687. <div class="menu-content">
  3688. <label class="menu-label menu-label-top" style="width: calc(50% - 18px)">
  3689. <input id="darkmodeCheckbox" type="checkbox" onchange="setDarkMode(this.checked)">
  3690. Dark mode
  3691. </label><!-- This comment eats space! All of it!
  3692. --><label class="menu-label menu-label-top" style="width: calc(50% - 17px); border-left: 0;">
  3693. <input id="fullscreenCheckbox" type="checkbox" onchange="setFullscreen(this.checked)">
  3694. Full Screen
  3695. </label>
  3696. <label class="menu-label" style="width: calc(50% - 18px)">
  3697. <input id="fabricationCheckbox" type="checkbox" checked onchange="fabricationVisible(this.checked)">
  3698. Fab layer
  3699. </label><!-- This comment eats space! All of it!
  3700. --><label class="menu-label" style="width: calc(50% - 17px); border-left: 0;">
  3701. <input id="silkscreenCheckbox" type="checkbox" checked onchange="silkscreenVisible(this.checked)">
  3702. Silkscreen
  3703. </label>
  3704. <label class="menu-label" style="width: calc(50% - 18px)">
  3705. <input id="referencesCheckbox" type="checkbox" checked onchange="referencesVisible(this.checked)">
  3706. References
  3707. </label><!-- This comment eats space! All of it!
  3708. --><label class="menu-label" style="width: calc(50% - 17px); border-left: 0;">
  3709. <input id="valuesCheckbox" type="checkbox" checked onchange="valuesVisible(this.checked)">
  3710. Values
  3711. </label>
  3712. <div id="tracksAndZonesCheckboxes">
  3713. <label class="menu-label" style="width: calc(50% - 18px)">
  3714. <input id="tracksCheckbox" type="checkbox" checked onchange="tracksVisible(this.checked)">
  3715. Tracks
  3716. </label><!-- This comment eats space! All of it!
  3717. --><label class="menu-label" style="width: calc(50% - 17px); border-left: 0;">
  3718. <input id="zonesCheckbox" type="checkbox" checked onchange="zonesVisible(this.checked)">
  3719. Zones
  3720. </label>
  3721. </div>
  3722. <label class="menu-label" style="width: calc(50% - 18px)">
  3723. <input id="padsCheckbox" type="checkbox" checked onchange="padsVisible(this.checked)">
  3724. Pads
  3725. </label><!-- This comment eats space! All of it!
  3726. --><label class="menu-label" style="width: calc(50% - 17px); border-left: 0;">
  3727. <input id="dnpOutlineCheckbox" type="checkbox" checked onchange="dnpOutline(this.checked)">
  3728. DNP outlined
  3729. </label>
  3730. <label class="menu-label">
  3731. <input id="highlightpin1Checkbox" type="checkbox" onchange="setHighlightPin1(this.checked)">
  3732. Highlight first pin
  3733. </label>
  3734. <label class="menu-label">
  3735. <input id="dragCheckbox" type="checkbox" checked onchange="setRedrawOnDrag(this.checked)">
  3736. Continuous redraw on drag
  3737. </label>
  3738. <label class="menu-label">
  3739. <span>Board rotation</span>
  3740. <span style="float: right"><span id="rotationDegree">0</span>&#176;</span>
  3741. <input id="boardRotation" type="range" min="-36" max="36" value="0" class="slider" oninput="setBoardRotation(this.value)">
  3742. </label>
  3743. <label class="menu-label">
  3744. <div style="margin-left: 5px">Bom checkboxes</div>
  3745. <input id="bomCheckboxes" class="menu-textbox" type=text
  3746. oninput="setBomCheckboxes(this.value)">
  3747. </label>
  3748. <label class="menu-label">
  3749. <div style="margin-left: 5px">Mark when checked</div>
  3750. <div id="markWhenCheckedContainer"></div>
  3751. </label>
  3752. <label class="menu-label">
  3753. <span class="shameless-plug">
  3754. <span>Created using</span>
  3755. <a id="github-link" target="blank" href="https://github.com/openscopeproject/InteractiveHtmlBom">InteractiveHtmlBom</a>
  3756. </span>
  3757. </label>
  3758. </div>
  3759. </div>
  3760. <div class="button-container hideonprint"
  3761. style="float: right; position: relative; top: 8px">
  3762. <button id="fl-btn" class="left-most-button" onclick="changeCanvasLayout('F')"
  3763. title="Front only">F
  3764. </button>
  3765. <button id="fb-btn" class="middle-button" onclick="changeCanvasLayout('FB')"
  3766. title="Front and Back">FB
  3767. </button>
  3768. <button id="bl-btn" class="right-most-button" onclick="changeCanvasLayout('B')"
  3769. title="Back only">B
  3770. </button>
  3771. </div>
  3772. <div class="button-container hideonprint"
  3773. style="float: right; position: relative; top: 8px">
  3774. <button id="bom-btn" class="left-most-button" onclick="changeBomLayout('bom-only')"
  3775. title="BOM only"></button>
  3776. <button id="lr-btn" class="middle-button" onclick="changeBomLayout('left-right')"
  3777. title="BOM left, drawings right"></button>
  3778. <button id="tb-btn" class="right-most-button" onclick="changeBomLayout('top-bottom')"
  3779. title="BOM top, drawings bot"></button>
  3780. </div>
  3781. <div class="button-container hideonprint"
  3782. style="float: right; position: relative; top: 8px">
  3783. <button id="bom-grouped-btn" class="left-most-button" onclick="changeBomMode('grouped')"
  3784. title="Grouped BOM"></button>
  3785. <button id="bom-ungrouped-btn" class="middle-button" onclick="changeBomMode('ungrouped')"
  3786. title="Ungrouped BOM"></button>
  3787. <button id="bom-netlist-btn" class="right-most-button" onclick="changeBomMode('netlist')"
  3788. title="Netlist"></button>
  3789. </div>
  3790. <div class="hideonprint menu" style="float: right; top: 8px;">
  3791. <button class="statsbtn"></button>
  3792. <div class="menu-content">
  3793. <table class="stats">
  3794. <tbody>
  3795. <tr>
  3796. <td width="40%">Board stats</td>
  3797. <td>Front</td>
  3798. <td>Back</td>
  3799. <td>Total</td>
  3800. </tr>
  3801. <tr>
  3802. <td>Components</td>
  3803. <td id="stats-components-front">~</td>
  3804. <td id="stats-components-back">~</td>
  3805. <td id="stats-components-total">~</td>
  3806. </tr>
  3807. <tr>
  3808. <td>Groups</td>
  3809. <td id="stats-groups-front">~</td>
  3810. <td id="stats-groups-back">~</td>
  3811. <td id="stats-groups-total">~</td>
  3812. </tr>
  3813. <tr>
  3814. <td>SMD pads</td>
  3815. <td id="stats-smd-pads-front">~</td>
  3816. <td id="stats-smd-pads-back">~</td>
  3817. <td id="stats-smd-pads-total">~</td>
  3818. </tr>
  3819. <tr>
  3820. <td>TH pads</td>
  3821. <td colspan=3 id="stats-th-pads">~</td>
  3822. </tr>
  3823. </tbody>
  3824. </table>
  3825. <table class="stats">
  3826. <col width="40%"/><col />
  3827. <tbody id="checkbox-stats">
  3828. <tr>
  3829. <td colspan=2 style="border-top: 0">Checkboxes</td>
  3830. </tr>
  3831. </tbody>
  3832. </table>
  3833. </div>
  3834. </div>
  3835. <div class="hideonprint menu" style="float: right; top: 8px;">
  3836. <button class="iobtn"></button>
  3837. <div class="menu-content">
  3838. <div class="menu-label menu-label-top">
  3839. <div style="margin-left: 5px;">Save board image</div>
  3840. <div class="flexbox">
  3841. <input id="render-save-width" class="menu-textbox" type="text" value="1000" placeholder="Width"
  3842. style="flex-grow: 1; width: 50px;" oninput="validateSaveImgDimension(this)">
  3843. <span>X</span>
  3844. <input id="render-save-height" class="menu-textbox" type="text" value="1000" placeholder="Height"
  3845. style="flex-grow: 1; width: 50px;" oninput="validateSaveImgDimension(this)">
  3846. </div>
  3847. <label>
  3848. <input id="render-save-transparent" type="checkbox">
  3849. Transparent background
  3850. </label>
  3851. <div class="flexbox">
  3852. <button class="savebtn" onclick="saveImage('F')">Front</button>
  3853. <button class="savebtn" onclick="saveImage('B')">Back</button>
  3854. </div>
  3855. </div>
  3856. <div class="menu-label">
  3857. <span style="margin-left: 5px;">Config and checkbox state</span>
  3858. <div class="flexbox">
  3859. <button class="savebtn" onclick="saveSettings()">Export</button>
  3860. <button class="savebtn" onclick="loadSettings()">Import</button>
  3861. </div>
  3862. </div>
  3863. </div>
  3864. </div>
  3865. </div>
  3866. <div id="fileinfodiv" style="overflow: auto;">
  3867. <table class="fileinfo">
  3868. <tbody>
  3869. <tr>
  3870. <td id="title" class="title" style="width: 70%">
  3871. Title
  3872. </td>
  3873. <td id="revision" class="title" style="width: 30%">
  3874. Revision
  3875. </td>
  3876. </tr>
  3877. <tr>
  3878. <td id="company">
  3879. Company
  3880. </td>
  3881. <td id="filedate">
  3882. Date
  3883. </td>
  3884. </tr>
  3885. </tbody>
  3886. </table>
  3887. </div>
  3888. </div>
  3889. <div id="bot" class="split" style="height: calc(100% - 80px)">
  3890. <div id="bomdiv" class="split split-horizontal">
  3891. <div style="width: 100%">
  3892. <input id="reflookup" class="textbox searchbox reflookup hideonprint" type="text" placeholder="Ref lookup"
  3893. oninput="updateRefLookup(this.value)">
  3894. <input id="filter" class="textbox searchbox filter hideonprint" type="text" placeholder="Filter"
  3895. oninput="updateFilter(this.value)">
  3896. <div class="button-container hideonprint" style="float: left; margin: 0;">
  3897. <button id="copy" title="Copy bom table to clipboard"
  3898. onclick="copyToClipboard()"></button>
  3899. </div>
  3900. </div>
  3901. <div id="dbg"></div>
  3902. <table class="bom" id="bomtable">
  3903. <thead id="bomhead">
  3904. </thead>
  3905. <tbody id="bombody">
  3906. </tbody>
  3907. </table>
  3908. </div>
  3909. <div id="canvasdiv" class="split split-horizontal">
  3910. <div id="frontcanvas" class="split" touch-action="none" style="overflow: hidden">
  3911. <div style="position: relative; width: 100%; height: 100%;">
  3912. <canvas id="F_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
  3913. <canvas id="F_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
  3914. <canvas id="F_slk" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
  3915. <canvas id="F_hl" style="position: absolute; left: 0; top: 0; z-index: 3;"></canvas>
  3916. </div>
  3917. </div>
  3918. <div id="backcanvas" class="split" touch-action="none" style="overflow: hidden">
  3919. <div style="position: relative; width: 100%; height: 100%;">
  3920. <canvas id="B_bg" style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
  3921. <canvas id="B_fab" style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
  3922. <canvas id="B_slk" style="position: absolute; left: 0; top: 0; z-index: 2;"></canvas>
  3923. <canvas id="B_hl" style="position: absolute; left: 0; top: 0; z-index: 3;"></canvas>
  3924. </div>
  3925. </div>
  3926. </div>
  3927. </div>
  3928. </div>
  3929. </body>
  3930. </html>