blocks_mpython.min.js 451 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328
  1. 'use strict';
  2. goog.provide('Blockly.Blocks.CocoRobo');
  3. goog.require('Blockly.Blocks');
  4. var musical_note = [
  5. ["C3", "C3"],
  6. ["C#3", "C#3"],
  7. ["D3", "D3"],
  8. ["D#3", "D#3"],
  9. ["E3", "E3"],
  10. ["F3", "F3"],
  11. ["F#3", "F#3"],
  12. ["G3", "G3"],
  13. ["G#3", "G#3"],
  14. ["A3", "A3"],
  15. ["A#3", "A#3"],
  16. ["B3", "B3"],
  17. ["C4", "C4"],
  18. ["C#4", "C#4"],
  19. ["D4", "D4"],
  20. ["D#4", "D#4"],
  21. ["E4", "E4"],
  22. ["F4", "F4"],
  23. ["F#4", "F#4"],
  24. ["G4", "G4"],
  25. ["G#4", "G#4"],
  26. ["A4", "A4"],
  27. ["A#4", "A#4"],
  28. ["B4", "B4"],
  29. ["C5", "C5"],
  30. ["C#5", "C#5"],
  31. ["D5", "D5"],
  32. ["D#5", "D#5"],
  33. ["E5", "E5"],
  34. ["F5", "F5"],
  35. ["F#5", "F#5"],
  36. ["G5", "G5"],
  37. ["G#5", "G#5"],
  38. ["A5", "A5"],
  39. ["A#5", "A#5"],
  40. ["B5", "B5"]
  41. ],
  42. music_tone_freq = [
  43. ["C3", "131"],
  44. ["C#3", "139"],
  45. ["D3", "147"],
  46. ["D#3", "156"],
  47. ["E3", "165"],
  48. ["F3", "175"],
  49. ["F#3", "185"],
  50. ["G3", "196"],
  51. ["G#3", "208"],
  52. ["A3", "220"],
  53. ["A#3", "233"],
  54. ["B3", "247"],
  55. ["C4", "262"],
  56. ["C#4", "277"],
  57. ["D4", "294"],
  58. ["D#4", "311"],
  59. ["E4", "330"],
  60. ["F4", "349"],
  61. ["F#4", "370"],
  62. ["G4", "392"],
  63. ["G#4", "415"],
  64. ["A4", "440"],
  65. ["A#4", "466"],
  66. ["B4", "494"],
  67. ["C5", "523"],
  68. ["C#5", "554"],
  69. ["D5", "587"],
  70. ["D#5", "622"],
  71. ["E5", "659"],
  72. ["F5", "698"],
  73. ["F#5", "740"],
  74. ["G5", "784"],
  75. ["G#5", "831"],
  76. ["A5", "880"],
  77. ["A#5", "932"],
  78. ["B5", "988"]
  79. ],
  80. music_tick = [
  81. ["1/4", "1"],
  82. ["1/2", "2"],
  83. ["1", "4"],
  84. ["2", "8"]
  85. ],
  86. usocket_color = 32,
  87. logic_color = 210,
  88. CocoRobo_bluebit_color = "#336699",
  89. list_color = Blockly.Blocks.lists.HUE,
  90. math_color = 230,
  91. event_color = 32,
  92. lcd_color = 96,
  93. buttonColor = 300,
  94. pinColor = 260,
  95. rgbColor = 0,
  96. buzzColor = 192,
  97. tuple_color = 192,
  98. dict_color = 32,
  99. accelerometerColor = 55,
  100. wifi_color = 160,
  101. iot_color = 64,
  102. iot_blynk_color = "#24c48e",
  103. iot_onenet_color = 64,
  104. iot_tinyweb_color = 160,
  105. set_color = 160,
  106. extend_color = 288,
  107. bluetooth_color = "#a101e5",
  108. purple_red = 328,
  109. wine_red = rgbColor,
  110. brown = event_color,
  111. green = lcd_color,
  112. light_blue = tuple_color,
  113. purple = pinColor,
  114. light_green = wifi_color,
  115. yellow_green = iot_onenet_color,
  116. bright_green = iot_blynk_color,
  117. bright_purple = extend_color,
  118. deep_blue = CocoRobo_bluebit_color,
  119. read_digital = [
  120. ["P0", "0"],
  121. ["P1", "1"],
  122. ["P2", "2"],
  123. ["P6(buzzer)", "6"],
  124. ["P7(RGB)", "7"],
  125. ["P8", "8"],
  126. ["P9", "9"],
  127. ["P13", "13"],
  128. ["P14", "14"],
  129. ["P15", "15"],
  130. ["P16", "16"],
  131. ["P19(SCL)", "19"],
  132. ["P20(SDA)", "20"]
  133. ],
  134. read_analog = [
  135. ["P0", "0"],
  136. ["P1", "1"],
  137. ["P2", "2"],
  138. ["P3(EXT)", "3"],
  139. ["P4(light)", "4"],
  140. ["P10(sound)", "10"]
  141. ],
  142. read_analog_1 = [
  143. ["P1", "1"],
  144. ["P0", "0"],
  145. ["P2", "2"],
  146. ["P3(EXT)", "3"],
  147. ["P4(light)", "4"],
  148. ["P10(sound)", "10"]
  149. ],
  150. set_digital_state = [
  151. ["LOW", "0"],
  152. ["HIGH", "1"]
  153. ],
  154. set_digital = [
  155. ["P0", "0"],
  156. ["P1", "1"],
  157. ["P5(button_A)", "5"],
  158. ["P6(buzzer)", "6"],
  159. ["P7(RGB)", "7"],
  160. ["P8", "8"],
  161. ["P9", "9"],
  162. ["P11(button_B)", "11"],
  163. ["P13", "13"],
  164. ["P14", "14"],
  165. ["P15", "15"],
  166. ["P16", "16"],
  167. ["P19(SCL)", "19"],
  168. ["P20(SDA)", "20"]
  169. ],
  170. set_digital_1 = [
  171. ["P1", "1"],
  172. ["P0", "0"],
  173. ["P5(button_A)", "5"],
  174. ["P6(buzzer)", "6"],
  175. ["P7(RGB)", "7"],
  176. ["P8", "8"],
  177. ["P9", "9"],
  178. ["P13", "13"],
  179. ["P14", "14"],
  180. ["P15", "15"],
  181. ["P16", "16"],
  182. ["P19(SCL)", "19"],
  183. ["P20(SDA)", "20"]
  184. ],
  185. set_analog = [
  186. ["P0", "0"],
  187. ["P1", "1"],
  188. ["P5(button_A)", "5"],
  189. ["P6(buzzer)", "6"],
  190. ["P7(RGB)", "7"],
  191. ["P8", "8"],
  192. ["P9", "9"],
  193. ["P11(button_B)", "11"],
  194. ["P13", "13"],
  195. ["P14", "14"],
  196. ["P15", "15"],
  197. ["P16", "16"],
  198. ["P19(SCL)", "19"],
  199. ["P20(SDA)", "20"]
  200. ],
  201. set_analog_1 = [
  202. ["P1", "1"],
  203. ["P0", "0"],
  204. ["P5(button_A)", "5"],
  205. ["P6(buzzer)", "6"],
  206. ["P7(RGB)", "7"],
  207. ["P8", "8"],
  208. ["P9", "9"],
  209. ["P13", "13"],
  210. ["P14", "14"],
  211. ["P15", "15"],
  212. ["P16", "16"],
  213. ["P19(SCL)", "19"],
  214. ["P20(SDA)", "20"]
  215. ],
  216. all_pin = [
  217. ["P0", "0"],
  218. ["P1", "1"],
  219. ["P2", "2"],
  220. ["P3(EXT)", "3"],
  221. ["P4(light)", "4"],
  222. ["P6(buzzer)", "6"],
  223. ["P7(RGB)", "7"],
  224. ["P8", "8"],
  225. ["P9", "9"],
  226. ["P10", "10"],
  227. ["P13", "13"],
  228. ["P14", "14"],
  229. ["P15", "15"],
  230. ["P16", "16"],
  231. ["P19(SCL)", "19"],
  232. ["P20(SDA)", "20"]
  233. ],
  234. buzz_tone = [
  235. ["do", "262"],
  236. ["re", "294"],
  237. ["mi", "330"],
  238. ["fa", "349"],
  239. ["sol", "392"],
  240. ["la", "440"],
  241. ["si", "494"]
  242. ],
  243. dh11_hum_tem_pin = [
  244. ["P6(buzzer)", "6"],
  245. ["P7(RGB)", "7"],
  246. ["P8", "8"],
  247. ["P9", "9"],
  248. ["P13", "13"],
  249. ["P14", "14"],
  250. ["P15", "15"],
  251. ["P16", "16"],
  252. ["P19(SCL)", "19"],
  253. ["P20(SDA)", "20"]
  254. ],
  255. text_color = 160,
  256. touchPad = [
  257. ["P", "P"],
  258. ["Y", "Y"],
  259. ["T", "T"],
  260. ["H", "H"],
  261. ["O", "O"],
  262. ["N", "N"]
  263. ],
  264. axis = [
  265. ["X", "X"],
  266. ["Y", "Y"],
  267. ["Z", "Z"]
  268. ],
  269. WiFi_config = [
  270. ["IP", "0"],
  271. ["gateway", "3"]
  272. ] //, ["netmask", "2"], ["DNS", "3"]
  273. ,
  274. WiFi_channel = [
  275. ["1", "1"],
  276. ["2", "2"],
  277. ["3", "3"],
  278. ["4", "4"],
  279. ["5", "5"],
  280. ["6", "6"],
  281. ["7", "7"],
  282. ["8", "8"],
  283. ["9", "9"],
  284. ["10", "10"],
  285. ["11", "11"],
  286. ["12", "12"],
  287. ["13", "13"]
  288. ],
  289. button_AB = [
  290. ["A", "button_a"],
  291. ["B", "button_b"]
  292. ],
  293. uart_tx_pin = [
  294. ["P16", "16"],
  295. ["P0", "0"],
  296. ["P1", "1"],
  297. ["P6(buzzer)", "6"],
  298. ["P7(RGB)", "7"],
  299. ["P8", "8"],
  300. ["P9", "9"],
  301. ["P13", "13"],
  302. ["P14", "14"],
  303. ["P15", "15"],
  304. ["P19(SCL)", "19"],
  305. ["P20(SDA)", "20"]
  306. ],
  307. uart_rx_pin = [
  308. ["P15", "15"],
  309. ["P0", "0"],
  310. ["P1", "1"],
  311. ["P2", "2"],
  312. ["P3(EXT)", "3"],
  313. ["P4(light)", "4"],
  314. ["P6(buzzer)", "6"],
  315. ["P7(RGB)", "7"],
  316. ["P8", "8"],
  317. ["P9", "9"],
  318. ["P10", "10"],
  319. ["P13", "13"],
  320. ["P14", "14"],
  321. ["P16", "16"],
  322. ["P19(SCL)", "19"],
  323. ["P20(SDA)", "20"]
  324. ],
  325. i2c_pin = [
  326. ["P6(buzzer)", "6"],
  327. ["P7(RGB)", "7"],
  328. ["P8", "8"],
  329. ["P9", "9"],
  330. ["P13", "13"],
  331. ["P14", "14"],
  332. ["P15", "15"],
  333. ["P16", "16"],
  334. ["P19(SCL)", "19"],
  335. ["P20(SDA)", "20"]
  336. ],
  337. output_pin = [
  338. ["P0", "0"],
  339. ["P1", "1"],
  340. ["P6(buzzer)", "6"],
  341. ["P7(RGB)", "7"],
  342. ["P8", "8"],
  343. ["P9", "9"],
  344. ["P13", "13"],
  345. ["P14", "14"],
  346. ["P15", "15"],
  347. ["P16", "16"],
  348. ["P19(SCL)", "19"],
  349. ["P20(SDA)", "20"]
  350. ];
  351. Blockly.Blocks.i2c_pin = {
  352. init: function () {
  353. this.jsonInit({
  354. inputsInline: !0,
  355. output: "Number",
  356. colour: CategoryColors.Pin,
  357. helpUrl: Blockly.Msg.I2C_PIN_HELPURL,
  358. tooltip: Blockly.Msg.I2C_PIN_TOOLTIP,
  359. message0: Blockly.Msg.I2C_PIN_MESSAGE0,
  360. args0: [{
  361. options: i2c_pin,
  362. type: "field_dropdown",
  363. name: "i2c_pin"
  364. }]
  365. })
  366. }
  367. };
  368. Blockly.Blocks.uart_rx_pin = {
  369. init: function () {
  370. this.jsonInit({
  371. inputsInline: !0,
  372. output: "Number",
  373. colour: CategoryColors.Pin,
  374. helpUrl: Blockly.Msg.UART_RX_PIN_HELPURL,
  375. tooltip: Blockly.Msg.UART_RX_PIN_TOOLTIP,
  376. message0: Blockly.Msg.UART_RX_PIN_MESSAGE0,
  377. args0: [{
  378. options: uart_rx_pin,
  379. type: "field_dropdown",
  380. name: "uart_rx_pin"
  381. }]
  382. })
  383. }
  384. };
  385. Blockly.Blocks.uart_tx_pin = {
  386. init: function () {
  387. this.jsonInit({
  388. inputsInline: !0,
  389. output: "Number",
  390. colour: CategoryColors.Pin,
  391. helpUrl: Blockly.Msg.UART_TX_PIN_HELPURL,
  392. tooltip: Blockly.Msg.UART_TX_PIN_TOOLTIP,
  393. message0: Blockly.Msg.UART_TX_PIN_MESSAGE0,
  394. args0: [{
  395. options: uart_tx_pin,
  396. type: "field_dropdown",
  397. name: "uart_tx_pin"
  398. }]
  399. })
  400. }
  401. };
  402. Blockly.Blocks.dh11_hum_tem_pin = {
  403. init: function () {
  404. this.jsonInit({
  405. inputsInline: !0,
  406. output: "Number",
  407. colour: CategoryColors.Pin,
  408. helpUrl: Blockly.Msg.DH11_HUM_TEM_PIN_HELPURL,
  409. tooltip: Blockly.Msg.DH11_HUM_TEM_PIN_TOOLTIP,
  410. message0: Blockly.Msg.DH11_HUM_TEM_PIN_MESSAGE0,
  411. args0: [{
  412. options: dh11_hum_tem_pin,
  413. type: "field_dropdown",
  414. name: "dh11_hum_tem_pin"
  415. }]
  416. })
  417. }
  418. };
  419. Blockly.Blocks.pwm_pin = {
  420. init: function () {
  421. this.jsonInit({
  422. inputsInline: !0,
  423. output: "Number",
  424. colour: CategoryColors.Pin,
  425. helpUrl: Blockly.Msg.PWM_PIN_HELPURL,
  426. tooltip: Blockly.Msg.PWM_PIN_TOOLTIP,
  427. message0: Blockly.Msg.PWM_PIN_MESSAGE0,
  428. args0: [{
  429. options: [
  430. [Blockly.Msg.CocoRobo_PWM_PIN_P7, "7"],
  431. ["P8", "8"],
  432. [Blockly.Msg.CocoRobo_PWM_PIN_P9, "9"],
  433. ["P13", "13"],
  434. ["P14", "14"],
  435. ["P15", "15"],
  436. ["P16", "16"]
  437. ],
  438. type: "field_dropdown",
  439. name: "pwm_pin"
  440. }]
  441. })
  442. }
  443. };
  444. Blockly.Blocks.all_pin = {
  445. init: function () {
  446. this.jsonInit({
  447. inputsInline: !0,
  448. output: "Number",
  449. colour: CategoryColors.Pin,
  450. helpUrl: Blockly.Msg.ALL_PIN_HELPURL,
  451. tooltip: Blockly.Msg.ALL_PIN_TOOLTIP,
  452. message0: Blockly.Msg.ALL_PIN_MESSAGE0,
  453. args0: [{
  454. options: all_pin,
  455. type: "field_dropdown",
  456. name: "all_pin"
  457. }]
  458. })
  459. }
  460. };
  461. Blockly.Blocks.set_digital = {
  462. init: function () {
  463. this.jsonInit({
  464. inputsInline: !0,
  465. output: "Number",
  466. colour: CategoryColors.Pin,
  467. helpUrl: Blockly.Msg.SET_DIGITAL_HELPURL,
  468. tooltip: Blockly.Msg.SET_DIGITAL_TOOLTIP,
  469. message0: Blockly.Msg.SET_DIGITAL_MESSAGE0,
  470. args0: [{
  471. options: set_digital,
  472. type: "field_dropdown",
  473. name: "set_digital"
  474. }]
  475. })
  476. }
  477. };
  478. Blockly.Blocks.set_analog = {
  479. init: function () {
  480. this.jsonInit({
  481. inputsInline: !0,
  482. output: "Number",
  483. colour: CategoryColors.Pin,
  484. helpUrl: Blockly.Msg.SET_ANALOG_HELPURL,
  485. tooltip: Blockly.Msg.SET_ANALOG_TOOLTIP,
  486. message0: Blockly.Msg.SET_ANALOG_MESSAGE0,
  487. args0: [{
  488. options: set_analog,
  489. type: "field_dropdown",
  490. name: "set_analog"
  491. }]
  492. })
  493. }
  494. };
  495. Blockly.Blocks.read_analog_pin = {
  496. init: function () {
  497. this.jsonInit({
  498. inputsInline: !0,
  499. output: "Number",
  500. colour: CategoryColors.Pin,
  501. helpUrl: Blockly.Msg.READ_ANALOG_PIN_HELPURL,
  502. tooltip: Blockly.Msg.READ_ANALOG_PIN_TOOLTIP,
  503. message0: Blockly.Msg.READ_ANALOG_PIN_MESSAGE0,
  504. args0: [{
  505. options: read_analog,
  506. type: "field_dropdown",
  507. name: "read_analog_pin"
  508. }]
  509. })
  510. }
  511. };
  512. Blockly.Blocks.input_pin = {
  513. init: function () {
  514. this.jsonInit({
  515. inputsInline: !0,
  516. output: "Number",
  517. colour: CategoryColors.Pin,
  518. helpUrl: Blockly.Msg.INPUT_PIN_HELPURL,
  519. tooltip: Blockly.Msg.INPUT_PIN_TOOLTIP,
  520. message0: Blockly.Msg.INPUT_PIN_MESSAGE0,
  521. args0: [{
  522. options: all_pin,
  523. type: "field_dropdown",
  524. name: "input_pin"
  525. }]
  526. })
  527. }
  528. };
  529. Blockly.Blocks.output_pin = {
  530. init: function () {
  531. this.jsonInit({
  532. inputsInline: !0,
  533. output: "Number",
  534. colour: CategoryColors.Pin,
  535. helpUrl: Blockly.Msg.OUTPUT_PIN_HELPURL,
  536. tooltip: Blockly.Msg.OUTPUT_PIN_TOOLTIP,
  537. message0: Blockly.Msg.OUTPUT_PIN_MESSAGE0,
  538. args0: [{
  539. options: output_pin,
  540. type: "field_dropdown",
  541. name: "output_pin"
  542. }]
  543. })
  544. }
  545. };
  546. function getFirstProvince() {
  547. for (var a in CITYS_DATA)
  548. return a;
  549. return ""
  550. }
  551. function getCitysByProvince(a) {
  552. var b = [],
  553. c;
  554. for (c in CITYS_DATA[a])
  555. b.push([c, c]);
  556. return b
  557. }
  558. var PROVINCES = [],
  559. key;
  560. for (key in CITYS_DATA)
  561. PROVINCES.push([key, key]);
  562. var CITYS = getCitysByProvince(getFirstProvince());
  563. Blockly.Blocks.china_city = {
  564. init: function () {
  565. this.jsonInit({
  566. inputsInline: !0,
  567. output: "String",
  568. colour: CategoryColors.Weather,
  569. helpUrl: "",
  570. tooltip: "",
  571. message0: Blockly.Msg.CHINA_CITY_MESSAGE0,
  572. args0: [{
  573. options: PROVINCES,
  574. type: "field_dropdown",
  575. name: "province"
  576. }, {
  577. options: CITYS,
  578. type: "field_dropdown",
  579. name: "city"
  580. }]
  581. })
  582. }
  583. };
  584. Blockly.Blocks.china_city_town = {
  585. init: function () {
  586. this.jsonInit({
  587. inputsInline: !0,
  588. output: "String",
  589. colour: CategoryColors.Wifi,
  590. helpUrl: "",
  591. tooltip: "",
  592. message0: Blockly.Msg.CHINA_CITY_TOWN_MESSAGE0,
  593. args0: [{
  594. options: PROVINCES,
  595. type: "field_dropdown",
  596. name: "province"
  597. }, {
  598. options: CITYS,
  599. type: "field_dropdown",
  600. name: "city"
  601. }, {
  602. options: [
  603. ["-", "-"]
  604. ],
  605. type: "field_dropdown",
  606. name: "town"
  607. }, {
  608. options: [
  609. [Blockly.Msg.CHINA_CITY_PINYIN, "pinyin"],
  610. [Blockly.Msg.CHINA_CITY_CNNAME, "cnname"]
  611. ],
  612. type: "field_dropdown",
  613. name: "type"
  614. }]
  615. })
  616. }
  617. };
  618. Blockly.Blocks.int_to_chr = {
  619. init: function () {
  620. this.jsonInit({
  621. inputsInline: !0,
  622. output: "String",
  623. colour: CategoryColors.Math,
  624. helpUrl: Blockly.Msg.INT_TO_CHR_HELPURL,
  625. tooltip: Blockly.Msg.INT_TO_CHR_TOOLTIP,
  626. message0: Blockly.Msg.INT_TO_CHR_MESSAGE0,
  627. args0: [{
  628. check: "Number",
  629. type: "input_value",
  630. name: "_int"
  631. }]
  632. })
  633. }
  634. };
  635. Blockly.Blocks.CocoRobo_hcsr04_obj = {
  636. init: function () {
  637. this.jsonInit({
  638. inputsInline: !0,
  639. nextStatement: null,
  640. previousStatement: null,
  641. colour: CategoryColors.General,
  642. helpUrl: Blockly.Msg.CocoRobo_HCSR04_OBJ_HELPURL,
  643. tooltip: Blockly.Msg.CocoRobo_HCSR04_OBJ_TOOLTIP,
  644. message0: Blockly.Msg.CocoRobo_HCSR04_OBJ_MESSAGE0,
  645. args0: [{
  646. text: "hcsr04",
  647. type: "field_input",
  648. name: "hcsr04_name"
  649. }, {
  650. check: "Number",
  651. type: "input_value",
  652. name: "trigger"
  653. }, {
  654. check: "Number",
  655. type: "input_value",
  656. name: "echo"
  657. }]
  658. })
  659. }
  660. };
  661. Blockly.Blocks.CocoRobo_hcsr04_distance = {
  662. init: function () {
  663. this.jsonInit({
  664. inputsInline: !0,
  665. output: "Number",
  666. colour: CategoryColors.General,
  667. helpUrl: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_HELPURL,
  668. tooltip: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_TOOLTIP,
  669. message0: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_MESSAGE0,
  670. args0: [{
  671. text: "hcsr04",
  672. type: "field_input",
  673. name: "hcsr04_name"
  674. }, {
  675. options: [
  676. ["mm", "mm"],
  677. ["cm", "cm"]
  678. ],
  679. type: "field_dropdown",
  680. name: "unit"
  681. }]
  682. })
  683. }
  684. };
  685. Blockly.Blocks.CocoRobo_hcsr04_distance_mm = {
  686. init: function () {
  687. this.jsonInit({
  688. inputsInline: !0,
  689. output: "Number",
  690. colour: CategoryColors.Pin,
  691. helpUrl: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_MM_HELPURL,
  692. tooltip: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_MM_TOOLTIP,
  693. message0: Blockly.Msg.CocoRobo_HCSR04_DISTANCE_MM_MESSAGE0,
  694. args0: [{
  695. text: "hcsr04",
  696. type: "field_input",
  697. name: "hcsr04_name"
  698. }]
  699. })
  700. }
  701. };
  702. Blockly.Blocks.CocoRobo_pm2_5_MIC = {
  703. init: function () {
  704. this.jsonInit({
  705. inputsInline: !0,
  706. output: "Number",
  707. colour: CategoryColors.General,
  708. helpUrl: Blockly.Msg.CocoRobo_PM2_5_MIC_HELPURL,
  709. tooltip: Blockly.Msg.CocoRobo_PM2_5_MIC_TOOLTIP,
  710. message0: Blockly.Msg.CocoRobo_PM2_5_MIC_MESSAGE0,
  711. args0: [{
  712. check: "Number",
  713. type: "input_value",
  714. name: "rx"
  715. }, {
  716. options: [
  717. ["PM1.0ug/m3", "_pm_data[0]"],
  718. ["PM2.5ug/m3", "_pm_data[1]"],
  719. ["PM10ug/m3", "_pm_data[2]"]
  720. ],
  721. type: "field_dropdown",
  722. name: "unit"
  723. }]
  724. })
  725. }
  726. };
  727. Blockly.Blocks.CocoRobo_pm2_5_LitresAir = {
  728. init: function () {
  729. this.jsonInit({
  730. inputsInline: !0,
  731. output: "Number",
  732. colour: CategoryColors.General,
  733. helpUrl: Blockly.Msg.CocoRobo_PM2_5_LitresAir_HELPURL,
  734. tooltip: Blockly.Msg.CocoRobo_PM2_5_LitresAir_TOOLTIP,
  735. message0: Blockly.Msg.CocoRobo_PM2_5_LitresAir_MESSAGE0,
  736. args0: [{
  737. check: "Number",
  738. type: "input_value",
  739. name: "rx"
  740. }, {
  741. options: [
  742. ["0.3um", "_pm_data[3]"],
  743. ["0.5um", "_pm_data[4]"],
  744. ["1um", "_pm_data[5]"],
  745. ["2.5um", "_pm_data[6]"],
  746. ["5um", "_pm_data[7]"],
  747. ["10um", "_pm_data[8]"]
  748. ],
  749. type: "field_dropdown",
  750. name: "unit"
  751. }]
  752. })
  753. }
  754. };
  755. Blockly.Blocks.CocoRobo_mac_address = {
  756. init: function () {
  757. this.jsonInit({
  758. inputsInline: !0,
  759. output: "String",
  760. colour: "X" == SOFTWARE_KEY ? CategoryColors.System : CategoryColors.Wifi,
  761. helpUrl: Blockly.Msg.CocoRobo_MAC_ADDRESS_HELPURL,
  762. tooltip: Blockly.Msg.CocoRobo_MAC_ADDRESS_TOOLTIP,
  763. message0: Blockly.Msg.CocoRobo_MAC_ADDRESS_MESSAGE0
  764. })
  765. }
  766. };
  767. Blockly.Blocks.CocoRobo_ujson_loads = {
  768. init: function () {
  769. this.jsonInit({
  770. inputsInline: !0,
  771. output: null,
  772. colour: CategoryColors.Text,
  773. helpUrl: Blockly.Msg.CocoRobo_UJSON_LOADS_HELPURL,
  774. tooltip: Blockly.Msg.CocoRobo_UJSON_LOADS_TOOLTIP,
  775. message0: Blockly.Msg.CocoRobo_UJSON_LOADS_MESSAGE0,
  776. args0: [{
  777. check: "String",
  778. type: "input_value",
  779. name: "data"
  780. }]
  781. })
  782. }
  783. };
  784. Blockly.Blocks.CocoRobo_code_annotation = {
  785. init: function () {
  786. this.jsonInit({
  787. inputsInline: !0,
  788. nextStatement: null,
  789. previousStatement: null,
  790. // output: null,
  791. colour: CategoryColors.Text,
  792. helpUrl: Blockly.Msg.CocoRobo_code_annotation_HELPURL,
  793. tooltip: Blockly.Msg.CocoRobo_code_annotation_TOOLTIP,
  794. message0: Blockly.Msg.CocoRobo_code_annotation_MESSAGE0,
  795. args0: [{
  796. check: "String",
  797. type: "input_value",
  798. name: "data"
  799. }]
  800. })
  801. }
  802. };
  803. Blockly.Blocks.CocoRobo_ujson_dumps = {
  804. init: function () {
  805. this.jsonInit({
  806. inputsInline: !0,
  807. output: "String",
  808. colour: CategoryColors.Text,
  809. helpUrl: Blockly.Msg.CocoRobo_UJSON_DUMPS_HELPURL,
  810. tooltip: Blockly.Msg.CocoRobo_UJSON_DUMPS_TOOLTIP,
  811. message0: Blockly.Msg.CocoRobo_UJSON_DUMPS_MESSAGE0,
  812. args0: [{
  813. type: "input_value",
  814. name: "data"
  815. }]
  816. })
  817. }
  818. };
  819. Blockly.Blocks.CocoRobo_base64_to_data = {
  820. init: function () {
  821. this.jsonInit({
  822. inputsInline: !0,
  823. output: null,
  824. colour: CategoryColors.Math,
  825. helpUrl: Blockly.Msg.CocoRobo_BASE64_TO_DATA_HELPURL,
  826. tooltip: Blockly.Msg.CocoRobo_BASE64_TO_DATA_TOOLTIP,
  827. message0: Blockly.Msg.CocoRobo_BASE64_TO_DATA_MESSAGE0,
  828. args0: [{
  829. type: "input_value",
  830. name: "data"
  831. }]
  832. })
  833. }
  834. };
  835. Blockly.Blocks.CocoRobo_data_to_base64 = {
  836. init: function () {
  837. this.jsonInit({
  838. inputsInline: !0,
  839. output: null,
  840. colour: CategoryColors.Math,
  841. helpUrl: Blockly.Msg.CocoRobo_DATA_TO_BASE64_HELPURL,
  842. tooltip: Blockly.Msg.CocoRobo_DATA_TO_BASE64_TOOLTIP,
  843. message0: Blockly.Msg.CocoRobo_DATA_TO_BASE64_MESSAGE0,
  844. args0: [{
  845. type: "input_value",
  846. name: "data"
  847. }]
  848. })
  849. }
  850. };
  851. Blockly.Blocks.CocoRobo_hex_to_bin_str = {
  852. init: function () {
  853. this.jsonInit({
  854. inputsInline: !0,
  855. output: null,
  856. colour: CategoryColors.Math,
  857. helpUrl: Blockly.Msg.CocoRobo_HEX_TO_BIN_STR_HELPURL,
  858. tooltip: Blockly.Msg.CocoRobo_HEX_TO_BIN_STR_TOOLTIP,
  859. message0: Blockly.Msg.CocoRobo_HEX_TO_BIN_STR_MESSAGE0,
  860. args0: [{
  861. check: "String",
  862. type: "input_value",
  863. name: "convert_chr"
  864. }]
  865. })
  866. }
  867. };
  868. Blockly.Blocks.CocoRobo_str_to_hex = {
  869. init: function () {
  870. this.jsonInit({
  871. inputsInline: !0,
  872. output: null,
  873. colour: CategoryColors.Math,
  874. helpUrl: Blockly.Msg.CocoRobo_STR_TO_HEX_HELPURL,
  875. tooltip: Blockly.Msg.CocoRobo_STR_TO_HEX_TOOLTIP,
  876. message0: Blockly.Msg.CocoRobo_STR_TO_HEX_MESSAGE0,
  877. args0: [{
  878. check: "String",
  879. type: "input_value",
  880. name: "convert_chr"
  881. }]
  882. })
  883. }
  884. };
  885. Blockly.Blocks.CocoRobo_chr_to_int = {
  886. init: function () {
  887. this.jsonInit({
  888. inputsInline: !0,
  889. output: "String",
  890. colour: CategoryColors.Math,
  891. helpUrl: Blockly.Msg.CocoRobo_CHR_TO_INT_HELPURL,
  892. tooltip: Blockly.Msg.CocoRobo_CHR_TO_INT_TOOLTIP,
  893. message0: Blockly.Msg.CocoRobo_CHR_TO_INT_MESSAGE0,
  894. args0: [{
  895. check: "String",
  896. type: "input_value",
  897. name: "convert_chr"
  898. }]
  899. })
  900. }
  901. };
  902. Blockly.Blocks.CocoRobo_int_to_chr = {
  903. init: function () {
  904. this.jsonInit({
  905. inputsInline: !0,
  906. output: "String",
  907. colour: CategoryColors.Math,
  908. helpUrl: Blockly.Msg.CocoRobo_INT_TO_CHR_HELPURL,
  909. tooltip: Blockly.Msg.CocoRobo_INT_TO_CHR_TOOLTIP,
  910. message0: Blockly.Msg.CocoRobo_INT_TO_CHR_MESSAGE0,
  911. args0: [{
  912. check: "Number",
  913. type: "input_value",
  914. name: "convert_num"
  915. }]
  916. })
  917. }
  918. };
  919. Blockly.Blocks.CocoRobo_ten_converted_to_bytes = {
  920. init: function () {
  921. this.jsonInit({
  922. inputsInline: !0,
  923. output: null,
  924. colour: CategoryColors.Math,
  925. helpUrl: Blockly.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_HELPURL,
  926. // tooltip: Blockly.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP,
  927. message0: Blockly.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_MESSAGE0,
  928. args0: [{
  929. options: [
  930. ["2", "'\x3cH'"],
  931. ["4", "'\x3cL'"]
  932. ],
  933. type: "field_dropdown",
  934. name: "convert_choice"
  935. }, {
  936. check: "Number",
  937. type: "input_value",
  938. name: "convert_num"
  939. }]
  940. });
  941. var thisBlock = this;
  942. this.setTooltip(function () {
  943. var mode = thisBlock.getFieldValue('convert_choice');
  944. var TOOLTIPS = {
  945. "'\x3cHH'": Blockly.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP.replace('%1', "2"),
  946. "'\x3cLL'": Blockly.Msg.CocoRobo_TEN_CONVERTED_TO_BYTES_TOOLTIP.replace('%1', "4")
  947. };
  948. return TOOLTIPS[mode];
  949. });
  950. }
  951. };
  952. Blockly.Blocks.CocoRobo_convert_to_ten = {
  953. init: function () {
  954. this.jsonInit({
  955. inputsInline: !0,
  956. output: "Number",
  957. colour: CategoryColors.Math,
  958. helpUrl: Blockly.Msg.CocoRobo_CONVERT_TO_TEN_HELPURL,
  959. // tooltip: Blockly.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP,
  960. message0: Blockly.Msg.CocoRobo_CONVERT_TO_TEN_MESSAGE0,
  961. args0: [{
  962. options: [
  963. [Blockly.Msg.CocoRobo_BIN, "2"],
  964. [Blockly.Msg.CocoRobo_OCT, "8"],
  965. [Blockly.Msg.CocoRobo_HEX, "16"]
  966. ],
  967. type: "field_dropdown",
  968. name: "convert_choice"
  969. }, {
  970. check: "String",
  971. type: "input_value",
  972. name: "convert_str"
  973. }]
  974. });
  975. var thisBlock = this;
  976. this.setTooltip(function () {
  977. var mode = thisBlock.getFieldValue('convert_choice');
  978. var TOOLTIPS = {
  979. '2': Blockly.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace('%2', "bin"),
  980. '8': Blockly.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace('%2', "oct"),
  981. '16': Blockly.Msg.CocoRobo_CONVERT_TO_TEN_TOOLTIP.replace('%2', "hex")
  982. };
  983. return TOOLTIPS[mode];
  984. });
  985. }
  986. };
  987. Blockly.Blocks.CocoRobo_ten_convert_to = {
  988. init: function () {
  989. this.jsonInit({
  990. inputsInline: !0,
  991. output: "String",
  992. colour: CategoryColors.Math,
  993. helpUrl: Blockly.Msg.CocoRobo_TEN_CONVERT_TO_HELPURL,
  994. // tooltip: Blockly.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP,
  995. message0: Blockly.Msg.CocoRobo_TEN_CONVERT_TO_MESSAGE0,
  996. args0: [{
  997. check: "Number",
  998. type: "input_value",
  999. name: "int_num"
  1000. }, {
  1001. options: [
  1002. [Blockly.Msg.CocoRobo_BIN, "bin"],
  1003. [Blockly.Msg.CocoRobo_OCT, "oct"],
  1004. [Blockly.Msg.CocoRobo_HEX, "hex"]
  1005. ],
  1006. type: "field_dropdown",
  1007. name: "ten_convert_to"
  1008. }]
  1009. });
  1010. var thisBlock = this;
  1011. this.setTooltip(function () {
  1012. return Blockly.Msg.CocoRobo_TEN_CONVERT_TO_TOOLTIP.replace('%2',
  1013. thisBlock.getFieldValue('ten_convert_to'));
  1014. });
  1015. }
  1016. };
  1017. Blockly.Blocks.CocoRobo_high_low = {
  1018. init: function () {
  1019. this.jsonInit({
  1020. inputsInline: !0,
  1021. output: "Number",
  1022. colour: CategoryColors.Pin,
  1023. helpUrl: Blockly.Msg.CocoRobo_HIGH_LOW_HELPURL,
  1024. tooltip: Blockly.Msg.CocoRobo_HIGH_LOW_TOOLTIP,
  1025. message0: Blockly.Msg.CocoRobo_HIGH_LOW_MESSAGE0,
  1026. args0: [{
  1027. options: [
  1028. ["HIGH", "1"],
  1029. ["LOW", "0"]
  1030. ],
  1031. type: "field_dropdown",
  1032. name: "high_low"
  1033. }]
  1034. })
  1035. }
  1036. };
  1037. Blockly.Blocks.CocoRobo_start_new_thread = {
  1038. init: function () {
  1039. this.jsonInit({
  1040. inputsInline: !0,
  1041. nextStatement: null,
  1042. previousStatement: null,
  1043. colour: CategoryColors.Event,
  1044. helpUrl: Blockly.Msg.CocoRobo_START_NEW_THREAD_HELPURL,
  1045. tooltip: Blockly.Msg.CocoRobo_START_NEW_THREAD_TOOLTIP,
  1046. message0: Blockly.Msg.CocoRobo_START_NEW_THREAD_MESSAGE0,
  1047. args0: [{
  1048. options: [
  1049. ["1", "1"],
  1050. ["2", "2"],
  1051. ["3", "3"],
  1052. ["4", "4"]
  1053. ],
  1054. type: "field_dropdown",
  1055. name: "thread_name"
  1056. }]
  1057. });
  1058. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1059. }
  1060. };
  1061. Blockly.Blocks.CocoRobo_lock_object_acquire_lock = {
  1062. init: function () {
  1063. this.jsonInit({
  1064. inputsInline: !0,
  1065. nextStatement: null,
  1066. previousStatement: null,
  1067. colour: CategoryColors.Event,
  1068. helpUrl: Blockly.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_HELPURL,
  1069. tooltip: Blockly.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_TOOLTIP,
  1070. message0: Blockly.Msg.CocoRobo_LOCK_OBJECT_ACQUIRE_LOCK_MESSAGE0,
  1071. args0: [{
  1072. type: "field_input",
  1073. name: "thread_lock_object",
  1074. text: "lock"
  1075. }]
  1076. })
  1077. }
  1078. };
  1079. Blockly.Blocks.text_is_number = {
  1080. init: function () {
  1081. this.jsonInit({
  1082. inputsInline: !0,
  1083. output: "Boolean",
  1084. colour: CategoryColors.Text,
  1085. helpUrl: Blockly.Msg.TEXT_IS_NUMBER_HELPURL,
  1086. // tooltip: Blockly.Msg.TEXT_IS_NUMBER_TOOLTIP,
  1087. message0: Blockly.Msg.TEXT_IS_NUMBER_MESSAGE0,
  1088. args0: [{
  1089. type: "input_value",
  1090. name: "TEXT",
  1091. check: "String"
  1092. }, {
  1093. options: [
  1094. [Blockly.Msg.TEXT_IS_DIGIT, ".isdigit()"],
  1095. [Blockly.Msg.TEXT_IS_ALPHA, ".isalpha()"]
  1096. ],
  1097. type: "field_dropdown",
  1098. name: "TYPE"
  1099. }]
  1100. });
  1101. var thisBlock = this;
  1102. this.setTooltip(function () {
  1103. var mode = thisBlock.getFieldValue('TYPE');
  1104. var TOOLTIPS = {
  1105. '.isdigit()': Blockly.Msg.TEXT_IS_NUMBER_TOOLTIP.replace('%1', Blockly.Msg.TEXT_IS_DIGIT),
  1106. '.isalpha()': Blockly.Msg.TEXT_IS_NUMBER_TOOLTIP.replace('%1', Blockly.Msg.TEXT_IS_ALPHA)
  1107. };
  1108. return TOOLTIPS[mode];
  1109. });
  1110. }
  1111. };
  1112. Blockly.Blocks.CocoRobo_bytes_decode = {
  1113. init: function () {
  1114. this.jsonInit({
  1115. inputsInline: !0,
  1116. output: "String",
  1117. colour: CategoryColors.Text,
  1118. helpUrl: Blockly.Msg.CocoRobo_BYTES_DECODE_HELPURL,
  1119. tooltip: Blockly.Msg.CocoRobo_BYTES_DECODE_TOOLTIP,
  1120. message0: Blockly.Msg.CocoRobo_BYTES_DECODE_MESSAGE0,
  1121. args0: [{
  1122. type: "input_value",
  1123. name: "bytes_decode"
  1124. }]
  1125. })
  1126. }
  1127. };
  1128. Blockly.Blocks.text_format = {
  1129. init: function () {
  1130. this.jsonInit({
  1131. inputsInline: !1,
  1132. output: "String",
  1133. colour: "#33cc99" /* CategoryColors.Text*/,
  1134. helpUrl: Blockly.Msg.TEXT_FORMAT_HELPURL,
  1135. tooltip: Blockly.Msg.TEXT_FORMAT_TOOLTIP,
  1136. message0: Blockly.Msg.TEXT_FORMAT_MESSAGE0,
  1137. args0: [{
  1138. type: "input_value",
  1139. name: "FORMAT",
  1140. check: "String"
  1141. }, {
  1142. type: "input_value",
  1143. name: "CONTENT"
  1144. }]
  1145. })
  1146. }
  1147. };
  1148. Blockly.Blocks.text_format2 = {
  1149. init: function () {
  1150. this.jsonInit({
  1151. inputsInline: !1,
  1152. output: "String",
  1153. colour: CategoryColors.Text,
  1154. helpUrl: Blockly.Msg.TEXT_FORMAT2_HELPURL,
  1155. tooltip: Blockly.Msg.TEXT_FORMAT2_TOOLTIP,
  1156. message0: Blockly.Msg.TEXT_FORMAT2_MESSAGE0,
  1157. args0: [{
  1158. type: "input_value",
  1159. name: "FORMAT",
  1160. check: "String"
  1161. }, {
  1162. type: "input_value",
  1163. name: "CONTENT"
  1164. }]
  1165. })
  1166. }
  1167. };
  1168. Blockly.Blocks.text_to_byte = {
  1169. init: function () {
  1170. this.jsonInit({
  1171. inputsInline: !0,
  1172. output: null,
  1173. colour: "#33cc99" /*CategoryColors.Text*/,
  1174. helpUrl: Blockly.Msg.TEXT_TO_BYTE_HELPURL,
  1175. tooltip: Blockly.Msg.TEXT_TO_BYTE_TOOLTIP,
  1176. message0: Blockly.Msg.TEXT_TO_BYTE_MESSAGE0,
  1177. args0: [{
  1178. type: "input_value",
  1179. name: "TEXT",
  1180. check: "String"
  1181. }]
  1182. })
  1183. }
  1184. };
  1185. Blockly.Blocks.other_to_byte = {
  1186. init: function () {
  1187. this.jsonInit({
  1188. inputsInline: !0,
  1189. output: null,
  1190. colour: CategoryColors.Text,
  1191. helpUrl: Blockly.Msg.OTHER_TO_BYTE_HELPURL,
  1192. tooltip: Blockly.Msg.OTHER_TO_BYTE_TOOLTIP,
  1193. message0: Blockly.Msg.OTHER_TO_BYTE_MESSAGE0,
  1194. args0: [{
  1195. type: "input_value",
  1196. name: "input_var"
  1197. }]
  1198. })
  1199. }
  1200. };
  1201. Blockly.Blocks.bit_inversion = {
  1202. init: function () {
  1203. this.jsonInit({
  1204. inputsInline: !0,
  1205. output: "Number",
  1206. colour: CategoryColors.Math,
  1207. helpUrl: Blockly.Msg.BIT_INVERSION_HELPURL,
  1208. tooltip: Blockly.Msg.BIT_INVERSION_TOOLTIP,
  1209. message0: Blockly.Msg.BIT_INVERSION_MESSAGE0,
  1210. args0: [{
  1211. type: "input_value",
  1212. name: "data"
  1213. }]
  1214. })
  1215. }
  1216. };
  1217. Blockly.Blocks.CocoRobo_try_except = {
  1218. init: function () {
  1219. this.jsonInit({
  1220. message0: "",
  1221. previousStatement: null,
  1222. nextStatement: null,
  1223. colour: CategoryColors.Logic,
  1224. tooltip: Blockly.Msg.CocoRobo_try_except_TOOLTIP,
  1225. helpUrl: ""
  1226. });
  1227. this.appendStatementInput("TRY").appendField("try");
  1228. this.appendStatementInput("EXCEPT").appendField("except");
  1229. }
  1230. };
  1231. Blockly.Blocks.CocoRobo_try_except_finally = {
  1232. init: function () {
  1233. this.jsonInit({
  1234. message0: "",
  1235. previousStatement: null,
  1236. nextStatement: null,
  1237. colour: CategoryColors.Logic,
  1238. tooltip: Blockly.Msg.CocoRobo_try_except_finally_TOOLTIP,
  1239. helpUrl: ""
  1240. });
  1241. // this.appendStatementInput("TRY").appendField(Blockly.Msg.TRY_EXCEPT_TRY);
  1242. // this.appendStatementInput("EXCEPT").appendField(Blockly.Msg.TRY_EXCEPT_EXCEPT);
  1243. // this.appendStatementInput("FINALLY").appendField(Blockly.Msg.TRY_EXCEPT_FINALLY)
  1244. this.appendStatementInput("TRY").appendField("try");
  1245. this.appendStatementInput("EXCEPT").appendField("except");
  1246. this.appendStatementInput("FINALLY").appendField("finally")
  1247. }
  1248. };
  1249. Blockly.Blocks.text_append_text = {
  1250. init: function () {
  1251. this.jsonInit({
  1252. colour: CategoryColors.Text,
  1253. args0: [{
  1254. type: "input_value",
  1255. name: "text_abc"
  1256. }, {
  1257. type: "input_value",
  1258. name: "append_text"
  1259. }],
  1260. output: "String",
  1261. inputsInline: !0,
  1262. helpUrl: Blockly.Msg.TEXT_APPEND_TEXT_HELPURL,
  1263. tooltip: Blockly.Msg.TEXT_APPEND_TEXT_TOOLTIP,
  1264. message0: Blockly.Msg.TEXT_APPEND_TEXT_MESSAGE0
  1265. })
  1266. }
  1267. };
  1268. Blockly.Blocks.CocoRobo_custom_code = {
  1269. init: function () {
  1270. this.jsonInit({
  1271. inputsInline: !1,
  1272. nextStatement: null,
  1273. previousStatement: null,
  1274. colour: CategoryColors.Text,
  1275. helpUrl: Blockly.Msg.CocoRobo_CUSTOM_CODE_HELPURL,
  1276. tooltip: Blockly.Msg.CocoRobo_CUSTOM_CODE_TOOLTIP,
  1277. message0: Blockly.Msg.CocoRobo_CUSTOM_CODE_MESSAGE0,
  1278. args0: [{
  1279. name: "custom_type",
  1280. options: [
  1281. [Blockly.Msg.CocoRobo_CUSTOM_TYPE_NORMAL, "normal"],
  1282. [Blockly.Msg.CocoRobo_CUSTOM_TYPE_IMPORT, "topping"]
  1283. ],
  1284. type: "field_dropdown"
  1285. }, {
  1286. type: "input_dummy"
  1287. }, {
  1288. type: "field_textarea",
  1289. name: "custom_code",
  1290. text: "custom code"
  1291. }]
  1292. })
  1293. }
  1294. };
  1295. Blockly.Blocks.CocoRobo_machine_reset = {
  1296. init: function () {
  1297. this.jsonInit({
  1298. inputsInline: !0,
  1299. nextStatement: null,
  1300. previousStatement: null,
  1301. colour: CategoryColors.System,
  1302. helpUrl: Blockly.Msg.CocoRobo_MACHINE_RESET_HELPURL,
  1303. tooltip: Blockly.Msg.CocoRobo_MACHINE_RESET_TOOLTIP,
  1304. message0: Blockly.Msg.CocoRobo_MACHINE_RESET_MESSAGE0
  1305. })
  1306. }
  1307. };
  1308. Blockly.Blocks.math_random_randrange = {
  1309. init: function () {
  1310. this.jsonInit({
  1311. inputsInline: !0,
  1312. output: "Number",
  1313. colour: CategoryColors.Math,
  1314. helpUrl: Blockly.Msg.MATH_RANDOM_RANDRANGE_HELPURL,
  1315. tooltip: Blockly.Msg.MATH_RANDOM_RANDRANGE_TOOLTIP,
  1316. message0: Blockly.Msg.MATH_RANDOM_RANDRANGE_MESSAGE0,
  1317. args0: [{
  1318. check: "Number",
  1319. type: "input_value",
  1320. name: "start"
  1321. }, {
  1322. check: "Number",
  1323. type: "input_value",
  1324. name: "stop"
  1325. }, {
  1326. check: "Number",
  1327. type: "input_value",
  1328. name: "step"
  1329. }]
  1330. })
  1331. }
  1332. };
  1333. Blockly.Blocks.math_angle = {
  1334. init: function () {
  1335. this.jsonInit({
  1336. inputsInline: !0,
  1337. output: "Number",
  1338. colour: CategoryColors.Math,
  1339. helpUrl: "",
  1340. tooltip: "",
  1341. message0: "%1",
  1342. args0: [{
  1343. name: "angle",
  1344. type: "field_angle"
  1345. }]
  1346. })
  1347. }
  1348. };
  1349. Blockly.Blocks.math_keep_decimal = {
  1350. init: function () {
  1351. this.jsonInit({
  1352. inputsInline: !0,
  1353. output: "Number",
  1354. colour: CategoryColors.Math,
  1355. helpUrl: Blockly.Msg.MATH_KEEP_DECIMAL_HELPURL,
  1356. tooltip: Blockly.Msg.MATH_KEEP_DECIMAL_TOOLTIP,
  1357. message0: Blockly.Msg.MATH_KEEP_DECIMAL_MESSAGE0,
  1358. args0: [{
  1359. check: "Number",
  1360. type: "input_value",
  1361. name: "NUM"
  1362. }, {
  1363. check: "Number",
  1364. type: "input_value",
  1365. name: "PLACE"
  1366. }]
  1367. })
  1368. }
  1369. };
  1370. Blockly.Blocks.labplus_mapping = {
  1371. init: function () {
  1372. this.jsonInit({
  1373. inputsInline: !0,
  1374. colour: CategoryColors.Math,
  1375. args0: [{
  1376. name: "inputNum",
  1377. type: "input_value",
  1378. check: "Number"
  1379. }, {
  1380. name: "bMin",
  1381. type: "input_value",
  1382. check: "Number"
  1383. }, {
  1384. name: "bMax",
  1385. type: "input_value",
  1386. check: "Number"
  1387. }, {
  1388. name: "cMin",
  1389. type: "input_value",
  1390. check: "Number"
  1391. }, {
  1392. name: "cMax",
  1393. type: "input_value",
  1394. check: "Number"
  1395. }],
  1396. output: "Number",
  1397. message0: Blockly.Msg.labplus_mapping_MESSAGE0,
  1398. tooltip: Blockly.Msg.labplus_mapping_TOOLTIP,
  1399. helpUrl: Blockly.Msg.labplus_mapping_HELPURL
  1400. })
  1401. }
  1402. };
  1403. Blockly.Blocks.CocoRobo_Timer = {
  1404. init: function () {
  1405. this.jsonInit({
  1406. message0: Blockly.Msg.CocoRobo_Timer_MESSAGE0,
  1407. nextStatement: null,
  1408. previousStatement: null,
  1409. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1410. helpUrl: Blockly.Msg.CocoRobo_Timer_HELPURL,
  1411. tooltip: Blockly.Msg.CocoRobo_Timer_TOOLTIP,
  1412. args0: [{
  1413. check: "Number",
  1414. type: "input_value",
  1415. name: "Num"
  1416. }, {
  1417. options: [
  1418. [Blockly.Msg.CocoRobo_PERIODIC, "PERIODIC"],
  1419. [Blockly.Msg.CocoRobo_ONE_SHOT, "ONE_SHOT"]
  1420. ],
  1421. type: "field_dropdown",
  1422. name: "Timer_mode"
  1423. }, {
  1424. check: "Number",
  1425. type: "input_value",
  1426. name: "period"
  1427. }]
  1428. });
  1429. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1430. }
  1431. };
  1432. Blockly.Blocks.CocoRobo_timer_option = {
  1433. init: function () {
  1434. this.jsonInit({
  1435. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1436. output: "Number",
  1437. helpUrl: "",
  1438. tooltip: "",
  1439. message0: "%1",
  1440. args0: [{
  1441. options: [
  1442. ["1", "1"],
  1443. ["2", "2"],
  1444. ["4", "4"],
  1445. ["7", "7"],
  1446. ["8", "8"],
  1447. ["9", "9"],
  1448. ["10", "10"]
  1449. ],
  1450. type: "field_dropdown",
  1451. name: "Timer_num"
  1452. }]
  1453. })
  1454. }
  1455. };
  1456. Blockly.Blocks.CocoRobo_event_option = {
  1457. init: function () {
  1458. this.jsonInit({
  1459. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1460. output: "Number",
  1461. helpUrl: "",
  1462. tooltip: "",
  1463. message0: "%1",
  1464. args0: [{
  1465. options: [
  1466. ["10", "10"],
  1467. ["9", "9"],
  1468. ["8", "8"],
  1469. ["7", "7"],
  1470. ["4", "4"],
  1471. ["2", "2"],
  1472. ["1", "1"]
  1473. ],
  1474. type: "field_dropdown",
  1475. name: "Timer_num"
  1476. }]
  1477. })
  1478. }
  1479. };
  1480. Blockly.Blocks.CocoRobo_Timer_value = {
  1481. init: function () {
  1482. this.jsonInit({
  1483. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1484. output: "Number",
  1485. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1486. tooltip: Blockly.Msg.CocoRobo_Timer_value_TOOLTIP,
  1487. message0: Blockly.Msg.CocoRobo_Timer_value_MESSAGE0,
  1488. args0: [{
  1489. check: "Number",
  1490. type: "input_value",
  1491. name: "Timer_num"
  1492. }]
  1493. })
  1494. }
  1495. };
  1496. Blockly.Blocks.CocoRobo_Timer_deinit = {
  1497. init: function () {
  1498. this.jsonInit({
  1499. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1500. inputsInline: !0,
  1501. nextStatement: null,
  1502. previousStatement: null,
  1503. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1504. tooltip: Blockly.Msg.CocoRobo_Timer_deinit_TOOLTIP,
  1505. message0: Blockly.Msg.CocoRobo_Timer_deinit_MESSAGE0,
  1506. args0: [{
  1507. check: "Number",
  1508. type: "input_value",
  1509. name: "Timer_num"
  1510. }]
  1511. })
  1512. }
  1513. };
  1514. Blockly.Blocks.CocoRobo_Interrupt_pin = {
  1515. init: function () {
  1516. this.jsonInit({
  1517. message0: Blockly.Msg.CocoRobo_Interrupt_pin_MESSAGE0,
  1518. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.System,
  1519. helpUrl: Blockly.Msg.CocoRobo_Interrupt_pin_HELPURL,
  1520. tooltip: Blockly.Msg.CocoRobo_Interrupt_pin_TOOLTIP,
  1521. args0: [{
  1522. check: "Number",
  1523. type: "input_value",
  1524. name: "Interrupt_pin"
  1525. }, {
  1526. options: [
  1527. [Blockly.Msg.CocoRobo_Interrupt_pin_IRQ_RISING, "to_high"],
  1528. [Blockly.Msg.CocoRobo_Interrupt_pin_IRQ_FALLING, "to_low"]
  1529. ],
  1530. type: "field_dropdown",
  1531. name: "action"
  1532. }]
  1533. });
  1534. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1535. }
  1536. };
  1537. Blockly.Blocks.CocoRobo_Interrupt_AB = {
  1538. init: function () {
  1539. this.jsonInit({
  1540. inputsInline: !0,
  1541. message0: Blockly.Msg.CocoRobo_Interrupt_AB_MESSAGE0,
  1542. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.System,
  1543. helpUrl: Blockly.Msg.CocoRobo_Interrupt_AB_HELPURL,
  1544. tooltip: Blockly.Msg.CocoRobo_Interrupt_AB_TOOLTIP,
  1545. args0: [{
  1546. options: button_AB,
  1547. type: "field_dropdown",
  1548. name: "button"
  1549. }, {
  1550. options: [
  1551. [Blockly.Msg.CocoRobo_IRQ_FALLING, "down"],
  1552. [Blockly.Msg.CocoRobo_IRQ_RISING, "up"]
  1553. ],
  1554. type: "field_dropdown",
  1555. name: "action"
  1556. }]
  1557. });
  1558. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1559. }
  1560. };
  1561. Blockly.Blocks.CocoRobo_is_shaked = {
  1562. init: function () {
  1563. this.jsonInit({
  1564. colour: "#e8795b",
  1565. output: "Boolean",
  1566. helpUrl: Blockly.Msg.CocoRobo_IS_SHAKED_HELPURL,
  1567. tooltip: Blockly.Msg.CocoRobo_IS_SHAKED_TOOLTIP,
  1568. message0: Blockly.Msg.CocoRobo_IS_SHAKED_MESSAGE0,
  1569. args0: [{
  1570. options: [
  1571. [Blockly.Msg.CocoRobo_IS_SHAKED, "shaked"],
  1572. [Blockly.Msg.CocoRobo_IS_THROWN, "thrown"]
  1573. ],
  1574. type: "field_dropdown",
  1575. name: "action"
  1576. }]
  1577. })
  1578. }
  1579. };
  1580. Blockly.Blocks.CocoRobo_shake_detector = {
  1581. init: function () {
  1582. this.jsonInit({
  1583. inputsInline: !0,
  1584. message0: Blockly.Msg.CocoRobo_SHAKE_DETECTOR_MESSAGE0,
  1585. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.System,
  1586. helpUrl: Blockly.Msg.CocoRobo_SHAKE_DETECTOR_HELPURL,
  1587. tooltip: Blockly.Msg.CocoRobo_SHAKE_DETECTOR_TOOLTIP,
  1588. args0: [{
  1589. options: [
  1590. [Blockly.Msg.CocoRobo_IS_SHAKED, "shaked"],
  1591. [Blockly.Msg.CocoRobo_IS_THROWN, "thrown"]
  1592. ],
  1593. type: "field_dropdown",
  1594. name: "action"
  1595. }]
  1596. });
  1597. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1598. }
  1599. };
  1600. Blockly.Blocks.CocoRobo_is_tilted = {
  1601. init: function () {
  1602. this.jsonInit({
  1603. colour: "#e8795b",
  1604. output: "Boolean",
  1605. helpUrl: Blockly.Msg.CocoRobo_IS_TILTED_HELPURL,
  1606. tooltip: Blockly.Msg.CocoRobo_IS_TILTED_TOOLTIP,
  1607. message0: Blockly.Msg.CocoRobo_IS_TILTED_MESSAGE0,
  1608. args0: [{
  1609. options: [
  1610. [Blockly.Msg.CocoRobo_DIRECTION_FORWARD, "forward"],
  1611. [Blockly.Msg.CocoRobo_DIRECTION_BACK, "back"],
  1612. [Blockly.Msg.CocoRobo_DIRECTION_LEFT, "left"],
  1613. [Blockly.Msg.CocoRobo_DIRECTION_RIGHT, "right"]
  1614. ],
  1615. type: "field_dropdown",
  1616. name: "direction"
  1617. }]
  1618. })
  1619. }
  1620. };
  1621. Blockly.Blocks.CocoRobo_tilt_detector = {
  1622. init: function () {
  1623. this.jsonInit({
  1624. inputsInline: !0,
  1625. message0: Blockly.Msg.CocoRobo_TILT_DETECTOR_MESSAGE0,
  1626. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.System,
  1627. helpUrl: Blockly.Msg.CocoRobo_TILT_DETECTOR_HELPURL,
  1628. tooltip: Blockly.Msg.CocoRobo_TILT_DETECTOR_TOOLTIP,
  1629. args0: [{
  1630. options: [
  1631. [Blockly.Msg.CocoRobo_DIRECTION_FORWARD, "forward"],
  1632. [Blockly.Msg.CocoRobo_DIRECTION_BACK, "back"],
  1633. [Blockly.Msg.CocoRobo_DIRECTION_LEFT, "left"],
  1634. [Blockly.Msg.CocoRobo_DIRECTION_RIGHT, "right"],
  1635. [Blockly.Msg.CocoRobo_DIRECTION_NONE, "none"]
  1636. ],
  1637. type: "field_dropdown",
  1638. name: "direction"
  1639. }]
  1640. });
  1641. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1642. }
  1643. };
  1644. Blockly.Blocks.CocoRobo_touch_event = {
  1645. init: function () {
  1646. this.jsonInit({
  1647. inputsInline: !0,
  1648. message0: Blockly.Msg.CocoRobo_TOUCH_EVENT_MESSAGE0,
  1649. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.System,
  1650. helpUrl: Blockly.Msg.CocoRobo_TOUCH_EVENT_HELPURL,
  1651. tooltip: Blockly.Msg.CocoRobo_TOUCH_EVENT_TOOLTIP,
  1652. args0: [{
  1653. options: touchPad,
  1654. type: "field_dropdown",
  1655. name: "touchPad"
  1656. }, {
  1657. options: [
  1658. [Blockly.Msg.CocoRobo_TOUCH_EVENT_PRESSED, "pressed"],
  1659. [Blockly.Msg.CocoRobo_TOUCH_EVENT_UNPRESSED, "unpressed"]
  1660. ],
  1661. type: "field_dropdown",
  1662. name: "action"
  1663. }]
  1664. });
  1665. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1666. }
  1667. };
  1668. Blockly.Blocks.CocoRobo_custom_event = {
  1669. init: function () {
  1670. this.jsonInit({
  1671. message0: Blockly.Msg.CocoRobo_CUSTOM_EVENT_MESSAGE0,
  1672. nextStatement: null,
  1673. previousStatement: null,
  1674. colour: "X" == SOFTWARE_KEY ? CategoryColors.Event : CategoryColors.Loop,
  1675. inputsInline: !0,
  1676. helpUrl: Blockly.Msg.CocoRobo_CUSTOM_EVENT_HELPURL,
  1677. tooltip: Blockly.Msg.CocoRobo_CUSTOM_EVENT_TOOLTIP,
  1678. args0: [{
  1679. check: "Number",
  1680. type: "input_value",
  1681. name: "index"
  1682. }, {
  1683. check: "Boolean",
  1684. type: "input_value",
  1685. name: "condition"
  1686. }]
  1687. });
  1688. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  1689. }
  1690. };
  1691. Blockly.Blocks.CocoRobo_time_ticks = {
  1692. init: function () {
  1693. this.jsonInit({
  1694. colour: CategoryColors.System,
  1695. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1696. tooltip: Blockly.Msg.CocoRobo_time_ticks_TOOLTIP,
  1697. message0: Blockly.Msg.CocoRobo_time_ticks_MESSAGE0,
  1698. output: "Number",
  1699. args0: [{
  1700. options: [
  1701. [Blockly.Msg.CocoRobo_s, "time"],
  1702. [Blockly.Msg.CocoRobo_ms, "ticks_ms"],
  1703. [Blockly.Msg.CocoRobo_us, "ticks_us"]
  1704. ],
  1705. type: "field_dropdown",
  1706. name: "time_ticks"
  1707. }]
  1708. })
  1709. }
  1710. };
  1711. Blockly.Blocks.CocoRobo_time_localtime = {
  1712. init: function () {
  1713. this.jsonInit({
  1714. colour: CategoryColors.System,
  1715. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1716. tooltip: Blockly.Msg.CocoRobo_time_localtime_TOOLTIP,
  1717. message0: Blockly.Msg.CocoRobo_time_localtime_MESSAGE0,
  1718. output: "Number",
  1719. args0: [{
  1720. options: [
  1721. [Blockly.Msg.CocoRobo_year, "0"],
  1722. [Blockly.Msg.CocoRobo_month, "1"],
  1723. [Blockly.Msg.CocoRobo_date, "2"],
  1724. [Blockly.Msg.CocoRobo_hour, "3"],
  1725. [Blockly.Msg.CocoRobo_minute, "4"],
  1726. [Blockly.Msg.CocoRobo_s, "5"],
  1727. [Blockly.Msg.CocoRobo_week, "6"],
  1728. [Blockly.Msg.CocoRobo_days, "7"]
  1729. ],
  1730. type: "field_dropdown",
  1731. name: "time_localtime"
  1732. }]
  1733. })
  1734. }
  1735. };
  1736. Blockly.Blocks.CocoRobo_sway_xyz = {
  1737. init: function () {
  1738. this.jsonInit({
  1739. colour: CategoryColors.System,
  1740. args0: [{
  1741. name: "direction_group",
  1742. options: [
  1743. [Blockly.Msg.CocoRobo_left_right, "left_right"],
  1744. [Blockly.Msg.CocoRobo_front_back, "front_back"]
  1745. ],
  1746. type: "field_dropdown"
  1747. }],
  1748. output: "Boolean",
  1749. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1750. tooltip: Blockly.Msg.CocoRobo_sway_xyz_TOOLTIP,
  1751. message0: Blockly.Msg.CocoRobo_sway_xyz_MESSAGE0
  1752. })
  1753. }
  1754. };
  1755. Blockly.Blocks.CocoRobo_servo_angle0 = {
  1756. init: function () {
  1757. this.jsonInit({
  1758. colour: CategoryColors.Pin,
  1759. args0: [{
  1760. name: "pwm_pin",
  1761. check: "Number",
  1762. type: "input_value"
  1763. }, {
  1764. name: "servo_angle",
  1765. type: "input_value",
  1766. check: "Number"
  1767. }],
  1768. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1769. tooltip: Blockly.Msg.CocoRobo_servo_angle0_TOOLTIP,
  1770. message0: Blockly.Msg.CocoRobo_servo_angle0_MESSAGE0,
  1771. inputsInline: !0,
  1772. nextStatement: null,
  1773. previousStatement: null
  1774. })
  1775. }
  1776. };
  1777. Blockly.Blocks.CocoRobo_servo_angle = {
  1778. init: function () {
  1779. this.jsonInit({
  1780. colour: CategoryColors.Pin,
  1781. args0: [{
  1782. name: "pwm_pin",
  1783. check: "Number",
  1784. type: "input_value"
  1785. }, {
  1786. name: "servo_angle",
  1787. type: "input_value",
  1788. check: "Number"
  1789. }, {
  1790. name: "min_us",
  1791. type: "input_value",
  1792. check: "Number"
  1793. }, {
  1794. name: "max_us",
  1795. type: "input_value",
  1796. check: "Number"
  1797. }, {
  1798. name: "actuation_range",
  1799. type: "input_value",
  1800. check: "Number"
  1801. }],
  1802. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1803. tooltip: Blockly.Msg.CocoRobo_servo_angle_TOOLTIP,
  1804. message0: Blockly.Msg.CocoRobo_servo_angle_MESSAGE0,
  1805. inputsInline: !0,
  1806. nextStatement: null,
  1807. previousStatement: null
  1808. })
  1809. }
  1810. };
  1811. Blockly.Blocks.CocoRobo_dh11_hum_tem = {
  1812. init: function () {
  1813. this.jsonInit({
  1814. colour: CategoryColors.General,
  1815. args0: [{
  1816. name: "dh11_hum_tem_pin",
  1817. check: "Number",
  1818. type: "input_value"
  1819. }, {
  1820. name: "hum_tem",
  1821. options: [
  1822. [Blockly.Msg.CocoRobo_tem, "temperature"],
  1823. [Blockly.Msg.CocoRobo_hum, "humidity"]
  1824. ],
  1825. type: "field_dropdown"
  1826. }],
  1827. output: "Number",
  1828. helpUrl: Blockly.Msg.CocoRobo_dh11_hum_tem_HELPURL,
  1829. tooltip: Blockly.Msg.CocoRobo_dh11_hum_tem_TOOLTIP,
  1830. message0: Blockly.Msg.CocoRobo_dh11_hum_tem_MESSAGE0
  1831. })
  1832. }
  1833. };
  1834. Blockly.Blocks.CocoRobo_dh22_hum_tem = {
  1835. init: function () {
  1836. this.jsonInit({
  1837. colour: CategoryColors.General,
  1838. args0: [{
  1839. name: "dh22_hum_tem_pin",
  1840. check: "Number",
  1841. type: "input_value"
  1842. }, {
  1843. name: "hum_tem",
  1844. options: [
  1845. [Blockly.Msg.CocoRobo_tem, "temperature"],
  1846. [Blockly.Msg.CocoRobo_hum, "humidity"]
  1847. ],
  1848. type: "field_dropdown"
  1849. }],
  1850. output: "Number",
  1851. helpUrl: Blockly.Msg.CocoRobo_DH22_HUM_TEM_HELPURL,
  1852. tooltip: Blockly.Msg.CocoRobo_DH22_HUM_TEM_TOOLTIP,
  1853. message0: Blockly.Msg.CocoRobo_DH22_HUM_TEM_MESSAGE0
  1854. })
  1855. }
  1856. };
  1857. Blockly.Blocks.CocoRobo_sleep_ms = {
  1858. init: function () {
  1859. this.jsonInit({
  1860. inputsInline: !0,
  1861. nextStatement: null,
  1862. previousStatement: null,
  1863. colour: CategoryColors.Loop,
  1864. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1865. tooltip: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_TOOLTIP,
  1866. message0: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_MESSAGE0,
  1867. args0: [{
  1868. check: "Number",
  1869. type: "input_value",
  1870. name: "duration"
  1871. }, {
  1872. name: "ms_us",
  1873. options: [
  1874. [Blockly.Msg.CocoRobo_s, "s"],
  1875. [Blockly.Msg.CocoRobo_MS, "ms"],
  1876. [Blockly.Msg.CocoRobo_US, "us"]
  1877. ],
  1878. type: "field_dropdown"
  1879. }]
  1880. })
  1881. }
  1882. };
  1883. Blockly.Blocks.CocoRobo_type = {
  1884. init: function () {
  1885. this.jsonInit({
  1886. message0: Blockly.Msg.CocoRobo_TYPE_MESSAGE0,
  1887. args0: [{
  1888. type: "input_value",
  1889. name: "VAR"
  1890. }],
  1891. output: null,
  1892. colour: CategoryColors.Logic,
  1893. tooltip: Blockly.Msg.CocoRobo_TYPE_TOOLTIP,
  1894. helpUrl: Blockly.Msg.CocoRobo_TYPE_HELPURL
  1895. })
  1896. }
  1897. };
  1898. Blockly.Blocks.CocoRobo_type_is = {
  1899. init: function () {
  1900. this.jsonInit({
  1901. message0: Blockly.Msg.CocoRobo_TYPE_IS_MESSAGE0,
  1902. args0: [{
  1903. type: "input_value",
  1904. name: "VAR"
  1905. }, {
  1906. name: "TYPE",
  1907. options: [
  1908. ["int", "int"],
  1909. ["float", "float"],
  1910. ["bool", "bool"],
  1911. ["str", "str"],
  1912. ["list", "list"],
  1913. ["tuple", "tuple"],
  1914. ["set", "set"],
  1915. ["dict", "dict"],
  1916. ["bytes", "bytes"],
  1917. ["bytearray", "bytearray"],
  1918. ["complex", "complex"]
  1919. ],
  1920. type: "field_dropdown"
  1921. }],
  1922. output: "Boolean",
  1923. colour: CategoryColors.Logic,
  1924. // tooltip: Blockly.Msg.CocoRobo_TYPE_IS_TOOLTIP,
  1925. helpUrl: Blockly.Msg.CocoRobo_TYPE_IS_HELPURL
  1926. });
  1927. var thisBlock = this;
  1928. this.setTooltip(function () {
  1929. return Blockly.Msg.CocoRobo_TYPE_IS_TOOLTIP.replace('%2',
  1930. thisBlock.getFieldValue('TYPE'));
  1931. });
  1932. }
  1933. };
  1934. Blockly.Blocks.CocoRobo_eval = {
  1935. init: function () {
  1936. this.jsonInit({
  1937. message0: Blockly.Msg.CocoRobo_EVAL_MESSAGE0,
  1938. args0: [{
  1939. check: "String",
  1940. type: "input_value",
  1941. name: "VAR"
  1942. }],
  1943. output: null,
  1944. colour: CategoryColors.Logic,
  1945. tooltip: Blockly.Msg.CocoRobo_EVAL_TOOLTIP,
  1946. helpUrl: Blockly.Msg.CocoRobo_EVAL_HELPURL
  1947. })
  1948. }
  1949. };
  1950. Blockly.Blocks.CocoRobo_return = {
  1951. init: function () {
  1952. this.jsonInit({
  1953. inputsInline: !0,
  1954. nextStatement: null,
  1955. previousStatement: null,
  1956. colour: CategoryColors.Logic,
  1957. helpUrl: Blockly.Msg.CocoRobo_RETURN_HELPURL,
  1958. tooltip: Blockly.Msg.CocoRobo_RETURN_TOOLTIP,
  1959. message0: Blockly.Msg.CocoRobo_RETURN_MESSAGE0,
  1960. args0: [{
  1961. type: "input_value",
  1962. name: "VAR"
  1963. }]
  1964. })
  1965. }
  1966. };
  1967. Blockly.Blocks.CocoRobo_time_difference = {
  1968. init: function () {
  1969. this.jsonInit({
  1970. inputsInline: !0,
  1971. colour: CategoryColors.System,
  1972. output: "Number",
  1973. helpUrl: Blockly.Msg.CocoRobo_TIME_DIFFERENCE_HELPURL,
  1974. tooltip: Blockly.Msg.CocoRobo_TIME_DIFFERENCE_TOOLTIP,
  1975. message0: Blockly.Msg.CocoRobo_TIME_DIFFERENCE_MESSAGE0,
  1976. args0: [{
  1977. check: "Number",
  1978. type: "input_value",
  1979. name: "time1"
  1980. }, {
  1981. check: "Number",
  1982. type: "input_value",
  1983. name: "time2"
  1984. }]
  1985. })
  1986. }
  1987. };
  1988. Blockly.Blocks.CocoRobo_def_clock = {
  1989. init: function () {
  1990. this.jsonInit({
  1991. inputsInline: !0,
  1992. nextStatement: null,
  1993. previousStatement: null,
  1994. colour: CategoryColors.Show,
  1995. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  1996. tooltip: Blockly.Msg.CocoRobo_def_clock_TOOLTIP,
  1997. message0: Blockly.Msg.CocoRobo_def_clock_MESSAGE0,
  1998. args0: [{
  1999. type: "field_input",
  2000. name: "clock_name",
  2001. text: "my_clock"
  2002. }, {
  2003. check: "Number",
  2004. type: "input_value",
  2005. name: "x"
  2006. }, {
  2007. check: "Number",
  2008. type: "input_value",
  2009. name: "y"
  2010. }, {
  2011. check: "Number",
  2012. type: "input_value",
  2013. name: "radius"
  2014. }]
  2015. })
  2016. }
  2017. };
  2018. Blockly.Blocks.CocoRobo_settime_clock = {
  2019. init: function () {
  2020. this.jsonInit({
  2021. inputsInline: !0,
  2022. nextStatement: null,
  2023. previousStatement: null,
  2024. colour: CategoryColors.Show,
  2025. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2026. tooltip: Blockly.Msg.CocoRobo_settime_clock_TOOLTIP,
  2027. message0: Blockly.Msg.CocoRobo_settime_clock_MESSAGE0,
  2028. args0: [{
  2029. type: "field_input",
  2030. name: "clock_name",
  2031. text: "my_clock"
  2032. }]
  2033. })
  2034. }
  2035. };
  2036. Blockly.Blocks.CocoRobo_draw_clear_clock = {
  2037. init: function () {
  2038. this.jsonInit({
  2039. inputsInline: !0,
  2040. nextStatement: null,
  2041. previousStatement: null,
  2042. colour: CategoryColors.Show,
  2043. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2044. tooltip: Blockly.Msg.CocoRobo_draw_clear_clock_TOOLTIP,
  2045. message0: Blockly.Msg.CocoRobo_draw_clear_clock_MESSAGE0,
  2046. args0: [{
  2047. name: "draw_clear_clock",
  2048. options: [
  2049. [Blockly.Msg.CocoRobo_draw, "drawClock"],
  2050. [Blockly.Msg.CocoRobo_clear, "clear"]
  2051. ],
  2052. type: "field_dropdown"
  2053. }, {
  2054. type: "field_input",
  2055. name: "clock_name",
  2056. text: "my_clock"
  2057. }]
  2058. })
  2059. }
  2060. };
  2061. Blockly.Blocks.CocoRobo_button_is_pressed = {
  2062. init: function () {
  2063. this.jsonInit({
  2064. colour: CategoryColors.System,
  2065. args0: [{
  2066. name: "button",
  2067. options: [
  2068. ["A", "a"],
  2069. ["B", "b"],
  2070. ["A+B", "A+B"]
  2071. ],
  2072. type: "field_dropdown"
  2073. }],
  2074. output: "Boolean",
  2075. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2076. tooltip: Blockly.Msg.CocoRobo_button_is_pressed_TOOLTIP,
  2077. message0: Blockly.Msg.CocoRobo_button_is_pressed_MESSAGE0
  2078. })
  2079. }
  2080. };
  2081. Blockly.Blocks.CocoRobo_button_both_pressed = {
  2082. init: function () {
  2083. this.jsonInit({
  2084. colour: CategoryColors.System,
  2085. output: "Boolean",
  2086. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2087. tooltip: Blockly.Msg.CocoRobo_button_both_pressed_TOOLTIP,
  2088. message0: Blockly.Msg.CocoRobo_button_both_pressed_MESSAGE0
  2089. })
  2090. }
  2091. };
  2092. Blockly.Blocks.CocoRobo_touchPad_value = {
  2093. init: function () {
  2094. this.jsonInit({
  2095. colour: CategoryColors.System,
  2096. args0: [{
  2097. name: "touchPad",
  2098. options: touchPad,
  2099. type: "field_dropdown"
  2100. }],
  2101. output: "Boolean",
  2102. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2103. tooltip: Blockly.Msg.CocoRobo_touchPad_value_TOOLTIP,
  2104. message0: Blockly.Msg.CocoRobo_touchPad_value_MESSAGE0
  2105. })
  2106. }
  2107. };
  2108. Blockly.Blocks.CocoRobo_touchPad_value_num = {
  2109. init: function () {
  2110. this.jsonInit({
  2111. colour: CategoryColors.System,
  2112. args0: [{
  2113. name: "touchPad",
  2114. options: touchPad,
  2115. type: "field_dropdown"
  2116. }],
  2117. output: "Number",
  2118. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2119. tooltip: Blockly.Msg.CocoRobo_touchPad_value_num_TOOLTIP,
  2120. message0: Blockly.Msg.CocoRobo_touchPad_value_num_MESSAGE0
  2121. })
  2122. }
  2123. };
  2124. Blockly.Blocks.CocoRobo_read_digital = {
  2125. init: function () {
  2126. this.jsonInit({
  2127. colour: CategoryColors.Pin,
  2128. args0: [{
  2129. name: "allPin",
  2130. check: "Number",
  2131. type: "input_value"
  2132. }],
  2133. output: "Number",
  2134. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2135. tooltip: Blockly.Msg.CocoRobo_read_digital_TOOLTIP,
  2136. message0: Blockly.Msg.CocoRobo_read_digital_MESSAGE0
  2137. })
  2138. }
  2139. };
  2140. Blockly.Blocks.CocoRobo_read_ds18b20 = {
  2141. init: function () {
  2142. this.jsonInit({
  2143. colour: CategoryColors.General,
  2144. args0: [{
  2145. name: "allPin",
  2146. check: "Number",
  2147. type: "input_value"
  2148. }],
  2149. output: "Number",
  2150. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2151. tooltip: Blockly.Msg.CocoRobo_read_DS18B20_TOOLTIP,
  2152. message0: Blockly.Msg.CocoRobo_read_DS18B20_MESSAGE0
  2153. })
  2154. }
  2155. };
  2156. Blockly.Blocks.CocoRobo_set_digital = {
  2157. init: function () {
  2158. this.jsonInit({
  2159. inputsInline: !0,
  2160. nextStatement: null,
  2161. previousStatement: null,
  2162. colour: CategoryColors.Pin,
  2163. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2164. tooltip: Blockly.Msg.CocoRobo_set_digital_TOOLTIP,
  2165. message0: Blockly.Msg.CocoRobo_set_digital_MESSAGE0,
  2166. args0: [{
  2167. check: "Number",
  2168. type: "input_value",
  2169. name: "num"
  2170. }, {
  2171. name: "allPin",
  2172. check: "Number",
  2173. type: "input_value"
  2174. }]
  2175. })
  2176. }
  2177. };
  2178. Blockly.Blocks.CocoRobo_set_pin_mode = {
  2179. init: function () {
  2180. this.jsonInit({
  2181. inputsInline: !0,
  2182. nextStatement: null,
  2183. previousStatement: null,
  2184. colour: CategoryColors.Pin,
  2185. helpUrl: Blockly.Msg.CocoRobo_SETS_PIN_MODE_HELPURL,
  2186. tooltip: Blockly.Msg.CocoRobo_SETS_PIN_MODE_TOOLTIP,
  2187. message0: Blockly.Msg.CocoRobo_SETS_PIN_MODE_MESSAGE0,
  2188. args0: [{
  2189. name: "allPin",
  2190. check: "Number",
  2191. type: "input_value"
  2192. }, {
  2193. name: "in_out",
  2194. options: [
  2195. [Blockly.Msg.CocoRobo_SET_PIN_LEAKY_OUT, "OUT_DRAIN"]
  2196. ],
  2197. type: "field_dropdown"
  2198. }, {
  2199. name: "pin_up_down_pull",
  2200. options: [
  2201. [Blockly.Msg.CocoRobo_SET_PIN_NO_PULL, "None"],
  2202. [Blockly.Msg.CocoRobo_SET_PIN_DOWN_PULL, "Pin.PULL_DOWN"],
  2203. [Blockly.Msg.CocoRobo_SET_PIN_UP_PULL, "Pin.PULL_UP"]
  2204. ],
  2205. type: "field_dropdown"
  2206. }, {
  2207. name: "pin_value",
  2208. check: "Number",
  2209. type: "input_value"
  2210. }]
  2211. })
  2212. }
  2213. };
  2214. Blockly.Blocks.CocoRobo_read_analog = {
  2215. init: function () {
  2216. this.jsonInit({
  2217. colour: CategoryColors.Pin,
  2218. args0: [{
  2219. check: "Number",
  2220. type: "input_value",
  2221. name: "allPin"
  2222. }],
  2223. output: "Number",
  2224. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2225. tooltip: Blockly.Msg.CocoRobo_read_analog_TOOLTIP,
  2226. message0: Blockly.Msg.CocoRobo_read_analog_MESSAGE0
  2227. })
  2228. }
  2229. };
  2230. Blockly.Blocks.CocoRobo_set_analog = {
  2231. init: function () {
  2232. this.jsonInit({
  2233. inputsInline: !0,
  2234. nextStatement: null,
  2235. previousStatement: null,
  2236. colour: CategoryColors.Pin,
  2237. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2238. tooltip: Blockly.Msg.CocoRobo_set_analog_TOOLTIP,
  2239. message0: Blockly.Msg.CocoRobo_set_analog_MESSAGE0,
  2240. args0: [{
  2241. check: "Number",
  2242. type: "input_value",
  2243. name: "num"
  2244. }, {
  2245. name: "allPin",
  2246. check: "Number",
  2247. type: "input_value"
  2248. }]
  2249. })
  2250. }
  2251. };
  2252. Blockly.Blocks.CocoRobo_rgb_list = {
  2253. init: function () {
  2254. this.jsonInit({
  2255. inputsInline: !0,
  2256. output: "Number",
  2257. colour: CategoryColors.Pin,
  2258. helpUrl: "",
  2259. tooltip: "",
  2260. message0: "%1",
  2261. args0: [{
  2262. options: [
  2263. [Blockly.Msg.CocoRobo_RGB_0, "0"],
  2264. [Blockly.Msg.CocoRobo_RGB_1, "1"],
  2265. [Blockly.Msg.CocoRobo_RGB_2, "2"],
  2266. [Blockly.Msg.CocoRobo_RGB_ALL, "-1"]
  2267. ],
  2268. type: "field_dropdown",
  2269. name: "rgb_list"
  2270. }]
  2271. })
  2272. }
  2273. };
  2274. Blockly.Blocks.CocoRobo_set_rgb_list_color = {
  2275. init: function () {
  2276. this.jsonInit({
  2277. inputsInline: !0,
  2278. nextStatement: null,
  2279. previousStatement: null,
  2280. colour: CategoryColors.onboard_RGB,
  2281. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2282. tooltip: Blockly.Msg.CocoRobo_SET_RGB_LIST_COLOR_TOOLTIP,
  2283. message0: Blockly.Msg.CocoRobo_SET_RGB_LIST_COLOR_MESSAGE0,
  2284. args0: [{
  2285. name: "num",
  2286. check: "Number",
  2287. type: "input_value"
  2288. }, {
  2289. type: "field_colour",
  2290. name: "COLOUR",
  2291. colour: "#ff0000"
  2292. }]
  2293. })
  2294. }
  2295. };
  2296. Blockly.Blocks.CocoRobo_set_rgb_list_number = {
  2297. init: function () {
  2298. this.jsonInit({
  2299. inputsInline: !0,
  2300. nextStatement: null,
  2301. previousStatement: null,
  2302. colour: CategoryColors.onboard_RGB,
  2303. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2304. tooltip: Blockly.Msg.CocoRobo_SET_RGB_LIST_NUMBER_TOOLTIP,
  2305. message0: Blockly.Msg.CocoRobo_SET_RGB_LIST_NUMBER_MESSAGE0,
  2306. args0: [{
  2307. name: "num",
  2308. check: "Number",
  2309. type: "input_value"
  2310. }, {
  2311. check: "Number",
  2312. type: "input_value",
  2313. name: "r"
  2314. }, {
  2315. check: "Number",
  2316. type: "input_value",
  2317. name: "g"
  2318. }, {
  2319. check: "Number",
  2320. type: "input_value",
  2321. name: "b"
  2322. }]
  2323. })
  2324. }
  2325. };
  2326. Blockly.Blocks.CocoRobo_off_rgb_list = {
  2327. init: function () {
  2328. this.jsonInit({
  2329. inputsInline: !0,
  2330. nextStatement: null,
  2331. previousStatement: null,
  2332. colour: CategoryColors.onboard_RGB,
  2333. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2334. tooltip: Blockly.Msg.CocoRobo_OFF_RGB_LIST_TOOLTIP,
  2335. message0: Blockly.Msg.CocoRobo_OFF_RGB_LIST_MESSAGE0,
  2336. args0: [{
  2337. name: "num",
  2338. check: "Number",
  2339. type: "input_value"
  2340. }]
  2341. })
  2342. }
  2343. };
  2344. Blockly.Blocks.CocoRobo_set_RGB_color = {
  2345. init: function () {
  2346. this.jsonInit({
  2347. inputsInline: !0,
  2348. nextStatement: null,
  2349. previousStatement: null,
  2350. colour: CategoryColors.System,
  2351. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2352. tooltip: Blockly.Msg.CocoRobo_set_RGB_color_TOOLTIP,
  2353. message0: Blockly.Msg.CocoRobo_set_RGB_color_MESSAGE0,
  2354. args0: [{
  2355. check: "Number",
  2356. type: "input_value",
  2357. name: "num"
  2358. }, {
  2359. type: "field_colour",
  2360. name: "COLOUR",
  2361. colour: "#ff0000"
  2362. }]
  2363. })
  2364. }
  2365. };
  2366. Blockly.Blocks.CocoRobo_set_RGB = {
  2367. init: function () {
  2368. this.jsonInit({
  2369. inputsInline: !0,
  2370. nextStatement: null,
  2371. previousStatement: null,
  2372. colour: CategoryColors.System,
  2373. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2374. tooltip: Blockly.Msg.CocoRobo_set_RGB_TOOLTIP,
  2375. message0: Blockly.Msg.CocoRobo_set_RGB_MESSAGE0,
  2376. args0: [{
  2377. check: "Number",
  2378. type: "input_value",
  2379. name: "num"
  2380. }, {
  2381. check: "Number",
  2382. type: "input_value",
  2383. name: "r"
  2384. }, {
  2385. check: "Number",
  2386. type: "input_value",
  2387. name: "g"
  2388. }, {
  2389. check: "Number",
  2390. type: "input_value",
  2391. name: "b"
  2392. }]
  2393. })
  2394. }
  2395. };
  2396. Blockly.Blocks.CocoRobo_set_RGB_color_all = {
  2397. init: function () {
  2398. this.jsonInit({
  2399. inputsInline: !0,
  2400. nextStatement: null,
  2401. previousStatement: null,
  2402. colour: CategoryColors.System,
  2403. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2404. tooltip: Blockly.Msg.CocoRobo_set_RGB_color_all_TOOLTIP,
  2405. message0: Blockly.Msg.CocoRobo_set_RGB_color_all_MESSAGE0,
  2406. args0: [{
  2407. type: "field_colour",
  2408. name: "COLOUR",
  2409. colour: "#ff0000"
  2410. }]
  2411. })
  2412. }
  2413. };
  2414. Blockly.Blocks.CocoRobo_set_RGB_all = {
  2415. init: function () {
  2416. this.jsonInit({
  2417. inputsInline: !0,
  2418. nextStatement: null,
  2419. previousStatement: null,
  2420. colour: CategoryColors.System,
  2421. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2422. tooltip: Blockly.Msg.CocoRobo_set_RGB_all_TOOLTIP,
  2423. message0: Blockly.Msg.CocoRobo_set_RGB_all_MESSAGE0,
  2424. args0: [{
  2425. check: "Number",
  2426. type: "input_value",
  2427. name: "r"
  2428. }, {
  2429. check: "Number",
  2430. type: "input_value",
  2431. name: "g"
  2432. }, {
  2433. check: "Number",
  2434. type: "input_value",
  2435. name: "b"
  2436. }]
  2437. })
  2438. }
  2439. };
  2440. Blockly.Blocks.CocoRobo_fresh_RGB = {
  2441. init: function () {
  2442. this.jsonInit({
  2443. inputsInline: !0,
  2444. nextStatement: null,
  2445. previousStatement: null,
  2446. colour: CategoryColors.System,
  2447. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2448. tooltip: Blockly.Msg.CocoRobo_fresh_RGB_TOOLTIP,
  2449. message0: Blockly.Msg.CocoRobo_fresh_RGB_MESSAGE0
  2450. })
  2451. }
  2452. };
  2453. Blockly.Blocks.CocoRobo_off_RGB = {
  2454. init: function () {
  2455. this.jsonInit({
  2456. inputsInline: !0,
  2457. nextStatement: null,
  2458. previousStatement: null,
  2459. colour: CategoryColors.System,
  2460. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2461. tooltip: Blockly.Msg.CocoRobo_off_RGB_TOOLTIP,
  2462. message0: Blockly.Msg.CocoRobo_off_RGB_MESSAGE0
  2463. })
  2464. }
  2465. };
  2466. Blockly.Blocks.CocoRobo_buzz_state = {
  2467. init: function () {
  2468. this.jsonInit({
  2469. inputsInline: !0,
  2470. nextStatement: null,
  2471. previousStatement: null,
  2472. colour: CategoryColors.Music,
  2473. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2474. tooltip: Blockly.Msg.CocoRobo_buzz_state_TOOLTIP,
  2475. message0: Blockly.Msg.CocoRobo_buzz_state_MESSAGE0
  2476. })
  2477. }
  2478. };
  2479. Blockly.Blocks.CocoRobo_buzz_freq = {
  2480. init: function () {
  2481. this.jsonInit({
  2482. inputsInline: !0,
  2483. nextStatement: null,
  2484. previousStatement: null,
  2485. colour: CategoryColors.Music,
  2486. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2487. tooltip: Blockly.Msg.CocoRobo_buzz_freq_TOOLTIP,
  2488. message0: Blockly.Msg.CocoRobo_buzz_freq_MESSAGE0,
  2489. args0: [{
  2490. check: "Number",
  2491. type: "input_value",
  2492. name: "freq"
  2493. }, {
  2494. check: "Number",
  2495. type: "input_value",
  2496. name: "pin"
  2497. }]
  2498. })
  2499. }
  2500. };
  2501. Blockly.Blocks.CocoRobo_buzz_tone = {
  2502. init: function () {
  2503. this.jsonInit({
  2504. inputsInline: !0,
  2505. nextStatement: null,
  2506. previousStatement: null,
  2507. colour: CategoryColors.Music,
  2508. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2509. tooltip: Blockly.Msg.CocoRobo_buzz_tone_TOOLTIP,
  2510. message0: Blockly.Msg.CocoRobo_buzz_tone_MESSAGE0,
  2511. args0: [{
  2512. name: "buzz_tone",
  2513. options: buzz_tone,
  2514. type: "field_dropdown"
  2515. }]
  2516. })
  2517. }
  2518. };
  2519. Blockly.Blocks.CocoRobo_read_sound = {
  2520. init: function () {
  2521. this.jsonInit({
  2522. colour: CategoryColors.System,
  2523. output: "Number",
  2524. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2525. tooltip: Blockly.Msg.CocoRobo_read_sound_TOOLTIP,
  2526. message0: Blockly.Msg.CocoRobo_read_sound_MESSAGE0
  2527. })
  2528. }
  2529. };
  2530. Blockly.Blocks.CocoRobo_read_light = {
  2531. init: function () {
  2532. this.jsonInit({
  2533. colour: "#e8795b",
  2534. output: "Number",
  2535. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2536. tooltip: Blockly.Msg.CocoRobo_read_light_TOOLTIP,
  2537. message0: Blockly.Msg.CocoRobo_read_light_MESSAGE0
  2538. })
  2539. }
  2540. };
  2541. Blockly.Blocks.CocoRobo_accelerometer_get = {
  2542. init: function () {
  2543. this.jsonInit({
  2544. colour: "#e8795b",
  2545. args0: [{
  2546. name: "axis",
  2547. options: axis,
  2548. type: "field_dropdown"
  2549. }],
  2550. output: "Number",
  2551. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2552. tooltip: Blockly.Msg.CocoRobo_accelerometer_get_TOOLTIP,
  2553. message0: Blockly.Msg.CocoRobo_accelerometer_get_MESSAGE0
  2554. })
  2555. }
  2556. };
  2557. Blockly.Blocks.CocoRobo_accelerometer_get_x = {
  2558. init: function () {
  2559. this.jsonInit({
  2560. colour: CategoryColors.System,
  2561. output: "Number",
  2562. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2563. tooltip: Blockly.Msg.CocoRobo_accelerometer_get_x_TOOLTIP,
  2564. message0: Blockly.Msg.CocoRobo_accelerometer_get_x_MESSAGE0
  2565. })
  2566. }
  2567. };
  2568. Blockly.Blocks.CocoRobo_accelerometer_get_y = {
  2569. init: function () {
  2570. this.jsonInit({
  2571. colour: CategoryColors.System,
  2572. output: "Number",
  2573. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2574. tooltip: Blockly.Msg.CocoRobo_accelerometer_get_y_TOOLTIP,
  2575. message0: Blockly.Msg.CocoRobo_accelerometer_get_y_MESSAGE0
  2576. })
  2577. }
  2578. };
  2579. Blockly.Blocks.CocoRobo_accelerometer_get_z = {
  2580. init: function () {
  2581. this.jsonInit({
  2582. colour: CategoryColors.System,
  2583. output: "Number",
  2584. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2585. tooltip: Blockly.Msg.CocoRobo_accelerometer_get_z_TOOLTIP,
  2586. message0: Blockly.Msg.CocoRobo_accelerometer_get_z_MESSAGE0
  2587. })
  2588. }
  2589. };
  2590. Blockly.Blocks.CocoRobo_accelerometer_set_range = {
  2591. init: function () {
  2592. this.jsonInit({
  2593. colour: CategoryColors.System,
  2594. args0: [{
  2595. name: "range",
  2596. options: [
  2597. [Blockly.Msg.CocoRobo_ACCELEROMETER_RANGE_2G, "RANGE_2G"],
  2598. [Blockly.Msg.CocoRobo_ACCELEROMETER_RANGE_4G, "RANGE_4G"],
  2599. [Blockly.Msg.CocoRobo_ACCELEROMETER_RANGE_8G, "RANGE_8G"],
  2600. [Blockly.Msg.CocoRobo_ACCELEROMETER_RANGE_16G, "RANGE_16G"]
  2601. ],
  2602. type: "field_dropdown"
  2603. }],
  2604. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2605. tooltip: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_RANGE_TOOLTIP,
  2606. message0: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_RANGE_MESSAGE0,
  2607. nextStatement: null,
  2608. previousStatement: null
  2609. })
  2610. }
  2611. };
  2612. Blockly.Blocks.CocoRobo_accelerometer_set_resolustion = {
  2613. init: function () {
  2614. this.jsonInit({
  2615. colour: CategoryColors.System,
  2616. args0: [{
  2617. name: "resolustion",
  2618. options: [
  2619. [Blockly.Msg.CocoRobo_ACCELEROMETER_RES_10_BIT, "RES_10_BIT"],
  2620. [Blockly.Msg.CocoRobo_ACCELEROMETER_RES_12_BIT, "RES_12_BIT"],
  2621. [Blockly.Msg.CocoRobo_ACCELEROMETER_RES_14_BIT, "RES_14_BIT"]
  2622. ],
  2623. type: "field_dropdown"
  2624. }],
  2625. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2626. tooltip: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_RESOLUSTION_TOOLTIP,
  2627. message0: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_RESOLUSTION_MESSAGE0,
  2628. nextStatement: null,
  2629. previousStatement: null
  2630. })
  2631. }
  2632. };
  2633. Blockly.Blocks.CocoRobo_accelerometer_set_offset = {
  2634. init: function () {
  2635. this.jsonInit({
  2636. colour: CategoryColors.System,
  2637. args0: [{
  2638. type: "input_dummy"
  2639. }, {
  2640. check: "Number",
  2641. type: "input_value",
  2642. name: "x"
  2643. }, {
  2644. check: "Number",
  2645. type: "input_value",
  2646. name: "y"
  2647. }, {
  2648. check: "Number",
  2649. type: "input_value",
  2650. name: "z"
  2651. }],
  2652. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2653. tooltip: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_OFFSET_TOOLTIP,
  2654. message0: Blockly.Msg.CocoRobo_ACCELEROMETER_SET_OFFSET_MESSAGE0,
  2655. nextStatement: null,
  2656. previousStatement: null
  2657. })
  2658. }
  2659. };
  2660. Blockly.Blocks.CocoRobo_tilt_angle = {
  2661. init: function () {
  2662. this.jsonInit({
  2663. colour: "#e8795b",
  2664. args0: [{
  2665. name: "axis",
  2666. options: axis,
  2667. type: "field_dropdown"
  2668. }],
  2669. output: "Number",
  2670. helpUrl: Blockly.Msg.CocoRobo_TILT_ANGLE_HELPURL,
  2671. tooltip: Blockly.Msg.CocoRobo_TILT_ANGLE_TOOLTIP,
  2672. message0: Blockly.Msg.CocoRobo_TILT_ANGLE_MESSAGE0
  2673. })
  2674. }
  2675. };
  2676. Blockly.Blocks.CocoRobo_random_choice = {
  2677. init: function () {
  2678. this.jsonInit({
  2679. message0: Blockly.Msg.CocoRobo_random_choice_MESSAGE0,
  2680. args0: [{
  2681. type: "input_value",
  2682. name: "list",
  2683. check: ["Array", "String"]
  2684. }],
  2685. output: "String",
  2686. colour: CategoryColors.Math,
  2687. tooltip: Blockly.Msg.CocoRobo_random_choice_TOOLTIP,
  2688. helpUrl: Blockly.Msg.CocoRobo_HELPURL
  2689. })
  2690. }
  2691. };
  2692. Blockly.Blocks.machine_time_pulse_us = {
  2693. init: function () {
  2694. this.jsonInit({
  2695. inputsInline: !0,
  2696. output: "Number",
  2697. colour: CategoryColors.Pin,
  2698. helpUrl: Blockly.Msg.MACHINE_TIME_PULSE_US_HELPURL,
  2699. tooltip: Blockly.Msg.MACHINE_TIME_PULSE_US_TOOLTIP,
  2700. message0: Blockly.Msg.MACHINE_TIME_PULSE_US_MESSAGE0,
  2701. args0: [{
  2702. check: "Number",
  2703. type: "input_value",
  2704. name: "pin"
  2705. }, {
  2706. check: "Number",
  2707. type: "input_value",
  2708. name: "pulse"
  2709. }]
  2710. })
  2711. }
  2712. };
  2713. Blockly.Blocks.CocoRobo_print = {
  2714. init: function () {
  2715. this.jsonInit({
  2716. colour: CategoryColors.Text,
  2717. args0: [{
  2718. name: "CONTENT",
  2719. type: "input_value",
  2720. check: ["Number", "String"]
  2721. }],
  2722. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2723. tooltip: Blockly.Msg.CocoRobo_print_TOOLTIP,
  2724. message0: Blockly.Msg.CocoRobo_print_MESSAGE0,
  2725. nextStatement: null,
  2726. previousStatement: null
  2727. })
  2728. }
  2729. };
  2730. Blockly.Blocks.CocoRobo_print_to_chart = {
  2731. init: function () {
  2732. this.setColour(CategoryColors.Math);
  2733. this.itemCount_ = 1;
  2734. this.updateShape_();
  2735. this.setNextStatement(!0);
  2736. this.setPreviousStatement(!0);
  2737. this.setMutator(new Blockly.Mutator(["CocoRobo_print_to_chart_item"]));
  2738. this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_TOOLTIP)
  2739. },
  2740. mutationToDom: function () {
  2741. var a = document.createElement("mutation");
  2742. a.setAttribute("items", this.itemCount_);
  2743. return a
  2744. },
  2745. domToMutation: function (a) {
  2746. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  2747. this.updateShape_()
  2748. },
  2749. decompose: function (a) {
  2750. var b = a.newBlock("CocoRobo_print_to_chart_container");
  2751. b.initSvg();
  2752. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  2753. var d = a.newBlock("CocoRobo_print_to_chart_item");
  2754. d.initSvg();
  2755. c.connect(d.previousConnection);
  2756. c = d.nextConnection
  2757. }
  2758. return b
  2759. },
  2760. compose: function (a) {
  2761. var b = a.getInputTargetBlock("STACK");
  2762. for (a = []; b;)
  2763. a.push(b.valueConnection_),
  2764. b = b.nextConnection && b.nextConnection.targetBlock();
  2765. for (b = 0; b < this.itemCount_; b++) {
  2766. var c = this.getInput("ADD" + b).connection.targetConnection;
  2767. c && -1 == a.indexOf(c) && c.disconnect()
  2768. }
  2769. this.itemCount_ = a.length;
  2770. 4 < this.itemCount_ && (this.itemCount_ = 4);
  2771. this.updateShape_();
  2772. for (b = 0; b < this.itemCount_; b++)
  2773. Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
  2774. },
  2775. saveConnections: function (a) {
  2776. a = a.getInputTargetBlock("STACK");
  2777. for (var b = 0; a;) {
  2778. var c = this.getInput("ADD" + b);
  2779. a.valueConnection_ = c && c.connection.targetConnection;
  2780. b++;
  2781. a = a.nextConnection && a.nextConnection.targetBlock()
  2782. }
  2783. },
  2784. updateShape_: function () {
  2785. this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_EMPTY_TITLE);
  2786. for (var a = 0; a < this.itemCount_; a++)
  2787. if (!this.getInput("ADD" + a)) {
  2788. var b = this.appendValueInput("ADD" + a);
  2789. 0 == a && b.setCheck("Number").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_INPUT_WITH)
  2790. }
  2791. for (; this.getInput("ADD" + a);)
  2792. this.removeInput("ADD" + a),
  2793. a++
  2794. }
  2795. };
  2796. Blockly.Blocks.CocoRobo_print_to_chart_item = {
  2797. init: function () {
  2798. this.setColour(CategoryColors.Math);
  2799. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TITLE);
  2800. this.setPreviousStatement(!0);
  2801. this.setNextStatement(!0);
  2802. this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TOOLTIP);
  2803. this.contextMenu = !1
  2804. }
  2805. };
  2806. Blockly.Blocks.CocoRobo_print_to_chart_container = {
  2807. init: function () {
  2808. this.setColour(CategoryColors.Math);
  2809. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TITLE_ADD);
  2810. this.appendStatementInput("STACK");
  2811. this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TOOLTIP);
  2812. this.contextMenu = !1
  2813. }
  2814. };
  2815. Blockly.Blocks.CocoRobo_init_chart = {
  2816. init: function () {
  2817. this.setColour(CategoryColors.Math);
  2818. this.itemCount_ = 1;
  2819. this.updateShape_();
  2820. this.setNextStatement(!0);
  2821. this.setPreviousStatement(!0);
  2822. this.setMutator(new Blockly.Mutator(["CocoRobo_init_chart_item"]));
  2823. this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_TOOLTIP)
  2824. },
  2825. mutationToDom: function () {
  2826. var a = document.createElement("mutation");
  2827. a.setAttribute("items", this.itemCount_);
  2828. return a
  2829. },
  2830. domToMutation: function (a) {
  2831. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  2832. this.updateShape_()
  2833. },
  2834. decompose: function (a) {
  2835. var b = a.newBlock("CocoRobo_init_chart_container");
  2836. b.initSvg();
  2837. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  2838. var d = a.newBlock("CocoRobo_init_chart_item");
  2839. d.initSvg();
  2840. c.connect(d.previousConnection);
  2841. c = d.nextConnection
  2842. }
  2843. return b
  2844. },
  2845. compose: function (a) {
  2846. var b = a.getInputTargetBlock("STACK");
  2847. for (a = []; b;)
  2848. a.push(b.valueConnection_),
  2849. b = b.nextConnection && b.nextConnection.targetBlock();
  2850. for (b = 0; b < this.itemCount_; b++) {
  2851. var c = this.getInput("ADD" + b).connection.targetConnection;
  2852. c && -1 == a.indexOf(c) && c.disconnect()
  2853. }
  2854. this.itemCount_ = a.length;
  2855. 4 < this.itemCount_ && (this.itemCount_ = 4);
  2856. this.updateShape_();
  2857. for (b = 0; b < this.itemCount_; b++)
  2858. Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
  2859. },
  2860. saveConnections: function (a) {
  2861. a = a.getInputTargetBlock("STACK");
  2862. for (var b = 0; a;) {
  2863. var c = this.getInput("ADD" + b);
  2864. a.valueConnection_ = c && c.connection.targetConnection;
  2865. b++;
  2866. a = a.nextConnection && a.nextConnection.targetBlock()
  2867. }
  2868. },
  2869. updateShape_: function () {
  2870. this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_INIT_CHART_EMPTY_TITLE);
  2871. for (var a = 0; a < this.itemCount_; a++)
  2872. if (!this.getInput("ADD" + a)) {
  2873. var b = this.appendValueInput("ADD" + a);
  2874. 0 == a && b.setCheck("String").appendField(Blockly.Msg.CocoRobo_INIT_CHART_INPUT_WITH)
  2875. }
  2876. for (; this.getInput("ADD" + a);)
  2877. this.removeInput("ADD" + a),
  2878. a++
  2879. }
  2880. };
  2881. Blockly.Blocks.CocoRobo_init_chart_item = {
  2882. init: function () {
  2883. this.setColour(CategoryColors.Math);
  2884. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TITLE);
  2885. this.setPreviousStatement(!0);
  2886. this.setNextStatement(!0);
  2887. this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TOOLTIP);
  2888. this.contextMenu = !1
  2889. }
  2890. };
  2891. Blockly.Blocks.CocoRobo_init_chart_container = {
  2892. init: function () {
  2893. this.setColour(CategoryColors.Math);
  2894. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TITLE_ADD);
  2895. this.appendStatementInput("STACK");
  2896. this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TOOLTIP);
  2897. this.contextMenu = !1
  2898. }
  2899. };
  2900. Blockly.Blocks.CocoRobo_ir_remote_recv = {
  2901. init: function () {
  2902. this.jsonInit({
  2903. message0: Blockly.Msg.CocoRobo_IR_REMOTE_RECV_MESSAGE0,
  2904. inputsInline: !0,
  2905. colour: CategoryColors.Sensor,
  2906. helpUrl: Blockly.Msg.CocoRobo_IR_REMOTE_RECV_HELPURL,
  2907. tooltip: Blockly.Msg.CocoRobo_IR_REMOTE_RECV_TOOLTIP,
  2908. args0: [{
  2909. check: "Number",
  2910. type: "input_value",
  2911. name: "pin"
  2912. }, {
  2913. type: "input_value",
  2914. name: "address"
  2915. }, {
  2916. type: "input_value",
  2917. name: "command"
  2918. }]
  2919. });
  2920. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  2921. }
  2922. };
  2923. Blockly.Blocks.CocoRobo_ir_remote_send = {
  2924. init: function () {
  2925. this.jsonInit({
  2926. message0: Blockly.Msg.CocoRobo_IR_REMOTE_SEND_MESSAGE0,
  2927. inputsInline: !0,
  2928. nextStatement: null,
  2929. previousStatement: null,
  2930. colour: CategoryColors.Sensor,
  2931. helpUrl: Blockly.Msg.CocoRobo_IR_REMOTE_SEND_HELPURL,
  2932. tooltip: Blockly.Msg.CocoRobo_IR_REMOTE_SEND_TOOLTIP,
  2933. args0: [{
  2934. check: "Number",
  2935. type: "input_value",
  2936. name: "pin"
  2937. }, {
  2938. check: ["Number", "Array"],
  2939. type: "input_value",
  2940. name: "address"
  2941. }, {
  2942. check: ["Number", "Array"],
  2943. type: "input_value",
  2944. name: "command"
  2945. }]
  2946. })
  2947. }
  2948. };
  2949. Blockly.Blocks.CocoRobo_bme280_hum_tem_pre = {
  2950. init: function () {
  2951. this.jsonInit({
  2952. colour: CategoryColors.Common,
  2953. args0: [{
  2954. name: "hum_tem_pre",
  2955. options: [
  2956. [Blockly.Msg.CocoRobo_tem, "temperature"],
  2957. [Blockly.Msg.CocoRobo_hum, "humidity"],
  2958. [Blockly.Msg.CocoRobo_pre, "pressure"]
  2959. ],
  2960. type: "field_dropdown"
  2961. }],
  2962. output: "Number",
  2963. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2964. tooltip: Blockly.Msg.CocoRobo_bme280_hum_tem_pre_TOOLTIP,
  2965. message0: Blockly.Msg.CocoRobo_bme280_hum_tem_pre_MESSAGE0
  2966. })
  2967. }
  2968. };
  2969. Blockly.Blocks.CocoRobo_compass_get_axis = {
  2970. init: function () {
  2971. this.jsonInit({
  2972. colour: CategoryColors.System,
  2973. args0: [{
  2974. name: "axis",
  2975. options: axis,
  2976. type: "field_dropdown"
  2977. }],
  2978. output: "Number",
  2979. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2980. tooltip: Blockly.Msg.CocoRobo_COMPASS_GET_AXIS_TOOLTIP,
  2981. message0: Blockly.Msg.CocoRobo_COMPASS_GET_AXIS_MESSAGE0
  2982. })
  2983. }
  2984. };
  2985. Blockly.Blocks.CocoRobo_compass_get_angle = {
  2986. init: function () {
  2987. this.jsonInit({
  2988. colour: CategoryColors.System,
  2989. output: "Number",
  2990. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  2991. tooltip: Blockly.Msg.CocoRobo_COMPASS_GET_ANGLE_TOOLTIP,
  2992. message0: Blockly.Msg.CocoRobo_COMPASS_GET_ANGLE_MESSAGE0
  2993. })
  2994. }
  2995. };
  2996. Blockly.Blocks.CocoRobo_audio_set_volume = {
  2997. init: function () {
  2998. this.jsonInit({
  2999. inputsInline: !0,
  3000. nextStatement: null,
  3001. previousStatement: null,
  3002. colour: CategoryColors.Audio,
  3003. helpUrl: Blockly.Msg.CocoRobo_AUDIO_SET_VOLUME_HELPURL,
  3004. tooltip: Blockly.Msg.CocoRobo_AUDIO_SET_VOLUME_TOOLTIP,
  3005. message0: Blockly.Msg.CocoRobo_AUDIO_SET_VOLUME_MESSAGE0,
  3006. args0: [{
  3007. check: "Number",
  3008. type: "input_value",
  3009. name: "volume"
  3010. }]
  3011. })
  3012. }
  3013. };
  3014. Blockly.Blocks.CocoRobo_audio_xunfei_tts = {
  3015. init: function () {
  3016. this.jsonInit({
  3017. inputsInline: !0,
  3018. nextStatement: null,
  3019. previousStatement: null,
  3020. colour: CategoryColors.Audio,
  3021. helpUrl: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_HELPURL,
  3022. tooltip: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_TOOLTIP,
  3023. message0: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_MESSAGE0,
  3024. args0: [{
  3025. check: "String",
  3026. type: "input_value",
  3027. name: "TEXT"
  3028. }]
  3029. })
  3030. }
  3031. };
  3032. Blockly.Blocks.CocoRobo_audio_xunfei_tts_config = {
  3033. init: function () {
  3034. this.jsonInit({
  3035. inputsInline: !0,
  3036. nextStatement: null,
  3037. previousStatement: null,
  3038. colour: CategoryColors.Audio,
  3039. helpUrl: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_CONFIG_HELPURL,
  3040. tooltip: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_CONFIG_TOOLTIP,
  3041. message0: Blockly.Msg.CocoRobo_AUDIO_XUNFEI_TTS_CONFIG_MESSAGE0,
  3042. args0: [{
  3043. check: "String",
  3044. type: "input_value",
  3045. name: "APPID"
  3046. }, {
  3047. check: "String",
  3048. type: "input_value",
  3049. name: "API_KEY"
  3050. }]
  3051. })
  3052. }
  3053. };
  3054. Blockly.Blocks.CocoRobo_audio_play = {
  3055. init: function () {
  3056. this.jsonInit({
  3057. inputsInline: !0,
  3058. nextStatement: null,
  3059. previousStatement: null,
  3060. colour: CategoryColors.Audio,
  3061. helpUrl: Blockly.Msg.CocoRobo_AUDIO_PLAY_HELPURL,
  3062. tooltip: Blockly.Msg.CocoRobo_AUDIO_PLAY_TOOLTIP,
  3063. message0: Blockly.Msg.CocoRobo_AUDIO_PLAY_MESSAGE0,
  3064. args0: [{
  3065. check: "String",
  3066. type: "input_value",
  3067. name: "url"
  3068. }]
  3069. })
  3070. }
  3071. };
  3072. Blockly.Blocks.CocoRobo_audio_cmd = {
  3073. init: function () {
  3074. this.jsonInit({
  3075. inputsInline: !0,
  3076. nextStatement: null,
  3077. previousStatement: null,
  3078. colour: CategoryColors.Audio,
  3079. helpUrl: Blockly.Msg.CocoRobo_AUDIO_CMD_HELPURL,
  3080. tooltip: Blockly.Msg.CocoRobo_AUDIO_CMD_TOOLTIP,
  3081. message0: Blockly.Msg.CocoRobo_AUDIO_CMD_MESSAGE0,
  3082. args0: [{
  3083. options: [
  3084. [Blockly.Msg.PAUSE, "pause"],
  3085. [Blockly.Msg.PLAY, "resume"],
  3086. [Blockly.Msg.STOP, "stop"]
  3087. ],
  3088. type: "field_dropdown",
  3089. name: "cmd"
  3090. }]
  3091. })
  3092. }
  3093. };
  3094. Blockly.Blocks.CocoRobo_audio_deinit = {
  3095. init: function () {
  3096. this.jsonInit({
  3097. inputsInline: !0,
  3098. nextStatement: null,
  3099. previousStatement: null,
  3100. colour: CategoryColors.Audio,
  3101. helpUrl: Blockly.Msg.CocoRobo_AUDIO_DEINIT_HELPURL,
  3102. tooltip: Blockly.Msg.CocoRobo_AUDIO_DEINIT_TOOLTIP,
  3103. message0: Blockly.Msg.CocoRobo_AUDIO_DEINIT_MESSAGE0
  3104. })
  3105. }
  3106. };
  3107. Blockly.Blocks.CocoRobo_audio_init = {
  3108. init: function () {
  3109. this.jsonInit({
  3110. inputsInline: !0,
  3111. nextStatement: null,
  3112. previousStatement: null,
  3113. colour: CategoryColors.Audio,
  3114. helpUrl: Blockly.Msg.CocoRobo_AUDIO_INIT_HELPURL,
  3115. tooltip: Blockly.Msg.CocoRobo_AUDIO_INIT_TOOLTIP,
  3116. message0: Blockly.Msg.CocoRobo_AUDIO_INIT_MESSAGE0
  3117. })
  3118. }
  3119. };
  3120. Blockly.Blocks.CocoRobo_record_init = {
  3121. init: function () {
  3122. this.jsonInit({
  3123. inputsInline: !0,
  3124. nextStatement: null,
  3125. previousStatement: null,
  3126. colour: CategoryColors.Audio,
  3127. helpUrl: Blockly.Msg.CocoRobo_RECORD_INIT_HELPURL,
  3128. tooltip: Blockly.Msg.CocoRobo_RECORD_INIT_TOOLTIP,
  3129. message0: Blockly.Msg.CocoRobo_RECORD_INIT_MESSAGE0
  3130. })
  3131. }
  3132. };
  3133. Blockly.Blocks.CocoRobo_record_deinit = {
  3134. init: function () {
  3135. this.jsonInit({
  3136. inputsInline: !0,
  3137. nextStatement: null,
  3138. previousStatement: null,
  3139. colour: CategoryColors.Audio,
  3140. helpUrl: Blockly.Msg.CocoRobo_RECORD_DEINIT_HELPURL,
  3141. tooltip: Blockly.Msg.CocoRobo_RECORD_DEINIT_TOOLTIP,
  3142. message0: Blockly.Msg.CocoRobo_RECORD_DEINIT_MESSAGE0
  3143. })
  3144. }
  3145. };
  3146. Blockly.Blocks.CocoRobo_record_wav = {
  3147. init: function () {
  3148. this.jsonInit({
  3149. inputsInline: !0,
  3150. nextStatement: null,
  3151. previousStatement: null,
  3152. colour: CategoryColors.Audio,
  3153. helpUrl: Blockly.Msg.CocoRobo_RECORD_WAV_HELPURL,
  3154. tooltip: Blockly.Msg.CocoRobo_RECORD_WAV_TOOLTIP,
  3155. message0: Blockly.Msg.CocoRobo_RECORD_WAV_MESSAGE0,
  3156. args0: [{
  3157. check: "String",
  3158. type: "input_value",
  3159. name: "file_name"
  3160. }, {
  3161. check: "Number",
  3162. type: "input_value",
  3163. name: "record_time"
  3164. }]
  3165. })
  3166. }
  3167. };
  3168. Blockly.Blocks.CocoRobo_asr = {
  3169. init: function () {
  3170. this.jsonInit({
  3171. inputsInline: !0,
  3172. output: "String",
  3173. colour: CategoryColors.AI,
  3174. helpUrl: Blockly.Msg.CocoRobo_ASR_HELPURL,
  3175. tooltip: Blockly.Msg.CocoRobo_ASR_TOOLTIP,
  3176. message0: Blockly.Msg.CocoRobo_ASR_MESSAGE0
  3177. })
  3178. }
  3179. };
  3180. Blockly.Blocks.CocoRobo_ir_recv = {
  3181. init: function () {
  3182. this.jsonInit({
  3183. inputsInline: !0,
  3184. output: null,
  3185. colour: CategoryColors.Bluebit,
  3186. helpUrl: Blockly.Msg.CocoRobo_IR_RECV_HELPURL,
  3187. tooltip: Blockly.Msg.CocoRobo_IR_RECV_TOOLTIP,
  3188. message0: Blockly.Msg.CocoRobo_IR_RECV_MESSAGE0,
  3189. args0: [{
  3190. check: "Number",
  3191. type: "input_value",
  3192. name: "rx"
  3193. }]
  3194. })
  3195. }
  3196. };
  3197. Blockly.Blocks.CocoRobo_ir_trans = {
  3198. init: function () {
  3199. this.jsonInit({
  3200. inputsInline: !0,
  3201. nextStatement: null,
  3202. previousStatement: null,
  3203. colour: CategoryColors.Bluebit,
  3204. helpUrl: Blockly.Msg.CocoRobo_IR_TRANS_HELPURL,
  3205. tooltip: Blockly.Msg.CocoRobo_IR_TRANS_TOOLTIP,
  3206. message0: Blockly.Msg.CocoRobo_IR_TRANS_MESSAGE0,
  3207. args0: [{
  3208. type: "input_value",
  3209. name: "data"
  3210. }, {
  3211. check: "Number",
  3212. type: "input_value",
  3213. name: "tx"
  3214. }]
  3215. })
  3216. }
  3217. };
  3218. Blockly.Blocks.CocoRobo_lcd_move = {
  3219. init: function () {
  3220. this.jsonInit({
  3221. inputsInline: !0,
  3222. nextStatement: null,
  3223. previousStatement: null,
  3224. colour: CategoryColors.Bluebit,
  3225. helpUrl: Blockly.Msg.CocoRobo_LCD_MOVE_HELPURL,
  3226. tooltip: Blockly.Msg.CocoRobo_LCD_MOVE_TOOLTIP,
  3227. message0: Blockly.Msg.CocoRobo_LCD_MOVE_MESSAGE0,
  3228. args0: [{
  3229. options: [
  3230. [Blockly.Msg.CocoRobo_LEFT, "left"],
  3231. [Blockly.Msg.CocoRobo_RIGHT, "right"]
  3232. ],
  3233. type: "field_dropdown",
  3234. name: "move"
  3235. }]
  3236. })
  3237. }
  3238. };
  3239. Blockly.Blocks.CocoRobo_lcd_text_direction = {
  3240. init: function () {
  3241. this.jsonInit({
  3242. inputsInline: !0,
  3243. nextStatement: null,
  3244. previousStatement: null,
  3245. colour: CategoryColors.Bluebit,
  3246. helpUrl: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_HELPURL,
  3247. tooltip: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_TOOLTIP,
  3248. message0: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_MESSAGE0,
  3249. args0: [{
  3250. options: [
  3251. [Blockly.Msg.CocoRobo_LEFT_TO_RIGHT, "LEFT_TO_RIGHT"],
  3252. [Blockly.Msg.CocoRobo_RIGHT_TO_LEFT, "RIGHT_TO_LEFT"]
  3253. ],
  3254. type: "field_dropdown",
  3255. name: "text_direction"
  3256. }]
  3257. })
  3258. }
  3259. };
  3260. Blockly.Blocks.CocoRobo_lcd_clear = {
  3261. init: function () {
  3262. this.jsonInit({
  3263. inputsInline: !0,
  3264. nextStatement: null,
  3265. previousStatement: null,
  3266. colour: CategoryColors.Bluebit,
  3267. helpUrl: Blockly.Msg.CocoRobo_LCD_CLEAR_HELPURL,
  3268. tooltip: Blockly.Msg.CocoRobo_LCD_CLEAR_TOOLTIP,
  3269. message0: Blockly.Msg.CocoRobo_LCD_CLEAR_MESSAGE0
  3270. })
  3271. }
  3272. };
  3273. Blockly.Blocks.CocoRobo_lcd_set_cursor = {
  3274. init: function () {
  3275. this.jsonInit({
  3276. inputsInline: !0,
  3277. nextStatement: null,
  3278. previousStatement: null,
  3279. colour: CategoryColors.Bluebit,
  3280. helpUrl: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_HELPURL,
  3281. tooltip: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_TOOLTIP,
  3282. message0: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_MESSAGE0,
  3283. args0: [{
  3284. check: "Number",
  3285. type: "input_value",
  3286. name: "column"
  3287. }, {
  3288. check: "Number",
  3289. type: "input_value",
  3290. name: "row"
  3291. }]
  3292. })
  3293. }
  3294. };
  3295. Blockly.Blocks.CocoRobo_lcd_cursor = {
  3296. init: function () {
  3297. this.jsonInit({
  3298. inputsInline: !0,
  3299. nextStatement: null,
  3300. previousStatement: null,
  3301. colour: CategoryColors.Bluebit,
  3302. helpUrl: Blockly.Msg.CocoRobo_LCD_CURSOR_HELPURL,
  3303. tooltip: Blockly.Msg.CocoRobo_LCD_CURSOR_TOOLTIP,
  3304. message0: Blockly.Msg.CocoRobo_LCD_CURSOR_MESSAGE0,
  3305. args0: [{
  3306. options: [
  3307. [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "Cursor(1)"],
  3308. [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "Cursor(0)"],
  3309. [Blockly.Msg.CocoRobo_LCD_CURSOR_BLINK, "Blink(1)"],
  3310. [Blockly.Msg.CocoRobo_LCD_CURSOR_NO_BLINK, "Blink(0)"]
  3311. ],
  3312. type: "field_dropdown",
  3313. name: "cursor_cmd"
  3314. }]
  3315. })
  3316. }
  3317. };
  3318. Blockly.Blocks.CocoRobo_lcd_home = {
  3319. init: function () {
  3320. this.jsonInit({
  3321. inputsInline: !0,
  3322. nextStatement: null,
  3323. previousStatement: null,
  3324. colour: CategoryColors.Bluebit,
  3325. helpUrl: Blockly.Msg.CocoRobo_LCD_HOME_HELPURL,
  3326. tooltip: Blockly.Msg.CocoRobo_LCD_HOME_TOOLTIP,
  3327. message0: Blockly.Msg.CocoRobo_LCD_HOME_MESSAGE0
  3328. })
  3329. }
  3330. };
  3331. Blockly.Blocks.CocoRobo_lcd_print = {
  3332. init: function () {
  3333. this.jsonInit({
  3334. inputsInline: !0,
  3335. nextStatement: null,
  3336. previousStatement: null,
  3337. colour: CategoryColors.Bluebit,
  3338. helpUrl: Blockly.Msg.CocoRobo_LCD_PRINT_HELPURL,
  3339. tooltip: Blockly.Msg.CocoRobo_LCD_PRINT_TOOLTIP,
  3340. message0: Blockly.Msg.CocoRobo_LCD_PRINT_MESSAGE0,
  3341. args0: [{
  3342. check: "String",
  3343. type: "input_value",
  3344. name: "display_str"
  3345. }]
  3346. })
  3347. }
  3348. };
  3349. Blockly.Blocks.CocoRobo_lcd_object = {
  3350. init: function () {
  3351. this.jsonInit({
  3352. inputsInline: !0,
  3353. nextStatement: null,
  3354. previousStatement: null,
  3355. colour: CategoryColors.Bluebit,
  3356. helpUrl: Blockly.Msg.CocoRobo_LCD_OBJECT_HELPURL,
  3357. tooltip: Blockly.Msg.CocoRobo_LCD_OBJECT_TOOLTIP,
  3358. message0: Blockly.Msg.CocoRobo_LCD_OBJECT_MESSAGE0
  3359. })
  3360. }
  3361. };
  3362. Blockly.Blocks.CocoRobo_ir_recv = {
  3363. init: function () {
  3364. this.jsonInit({
  3365. inputsInline: !0,
  3366. output: null,
  3367. colour: CategoryColors.Bluebit,
  3368. helpUrl: Blockly.Msg.CocoRobo_IR_RECV_HELPURL,
  3369. tooltip: Blockly.Msg.CocoRobo_IR_RECV_TOOLTIP,
  3370. message0: Blockly.Msg.CocoRobo_IR_RECV_MESSAGE0,
  3371. args0: [{
  3372. check: "Number",
  3373. type: "input_value",
  3374. name: "rx"
  3375. }]
  3376. })
  3377. }
  3378. };
  3379. Blockly.Blocks.CocoRobo_ir_trans = {
  3380. init: function () {
  3381. this.jsonInit({
  3382. inputsInline: !0,
  3383. nextStatement: null,
  3384. previousStatement: null,
  3385. colour: CategoryColors.Bluebit,
  3386. helpUrl: Blockly.Msg.CocoRobo_IR_TRANS_HELPURL,
  3387. tooltip: Blockly.Msg.CocoRobo_IR_TRANS_TOOLTIP,
  3388. message0: Blockly.Msg.CocoRobo_IR_TRANS_MESSAGE0,
  3389. args0: [{
  3390. type: "input_value",
  3391. name: "data"
  3392. }, {
  3393. check: "Number",
  3394. type: "input_value",
  3395. name: "tx"
  3396. }]
  3397. })
  3398. }
  3399. };
  3400. Blockly.Blocks.CocoRobo_lcd_move = {
  3401. init: function () {
  3402. this.jsonInit({
  3403. inputsInline: !0,
  3404. nextStatement: null,
  3405. previousStatement: null,
  3406. colour: CategoryColors.Bluebit,
  3407. helpUrl: Blockly.Msg.CocoRobo_LCD_MOVE_HELPURL,
  3408. tooltip: Blockly.Msg.CocoRobo_LCD_MOVE_TOOLTIP,
  3409. message0: Blockly.Msg.CocoRobo_LCD_MOVE_MESSAGE0,
  3410. args0: [{
  3411. options: [
  3412. [Blockly.Msg.CocoRobo_LEFT, "left"],
  3413. [Blockly.Msg.CocoRobo_RIGHT, "right"]
  3414. ],
  3415. type: "field_dropdown",
  3416. name: "move"
  3417. }]
  3418. })
  3419. }
  3420. };
  3421. Blockly.Blocks.CocoRobo_lcd_text_direction = {
  3422. init: function () {
  3423. this.jsonInit({
  3424. inputsInline: !0,
  3425. nextStatement: null,
  3426. previousStatement: null,
  3427. colour: CategoryColors.Bluebit,
  3428. helpUrl: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_HELPURL,
  3429. tooltip: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_TOOLTIP,
  3430. message0: Blockly.Msg.CocoRobo_LCD_TEXT_DIRECTION_MESSAGE0,
  3431. args0: [{
  3432. options: [
  3433. [Blockly.Msg.CocoRobo_LEFT_TO_RIGHT, "LEFT_TO_RIGHT"],
  3434. [Blockly.Msg.CocoRobo_RIGHT_TO_LEFT, "RIGHT_TO_LEFT"]
  3435. ],
  3436. type: "field_dropdown",
  3437. name: "text_direction"
  3438. }]
  3439. })
  3440. }
  3441. };
  3442. Blockly.Blocks.CocoRobo_lcd_clear = {
  3443. init: function () {
  3444. this.jsonInit({
  3445. inputsInline: !0,
  3446. nextStatement: null,
  3447. previousStatement: null,
  3448. colour: CategoryColors.Bluebit,
  3449. helpUrl: Blockly.Msg.CocoRobo_LCD_CLEAR_HELPURL,
  3450. tooltip: Blockly.Msg.CocoRobo_LCD_CLEAR_TOOLTIP,
  3451. message0: Blockly.Msg.CocoRobo_LCD_CLEAR_MESSAGE0
  3452. })
  3453. }
  3454. };
  3455. Blockly.Blocks.CocoRobo_lcd_set_cursor = {
  3456. init: function () {
  3457. this.jsonInit({
  3458. inputsInline: !0,
  3459. nextStatement: null,
  3460. previousStatement: null,
  3461. colour: CategoryColors.Bluebit,
  3462. helpUrl: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_HELPURL,
  3463. tooltip: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_TOOLTIP,
  3464. message0: Blockly.Msg.CocoRobo_LCD_SET_CURSOR_MESSAGE0,
  3465. args0: [{
  3466. check: "Number",
  3467. type: "input_value",
  3468. name: "column"
  3469. }, {
  3470. check: "Number",
  3471. type: "input_value",
  3472. name: "row"
  3473. }]
  3474. })
  3475. }
  3476. };
  3477. Blockly.Blocks.CocoRobo_lcd_cursor = {
  3478. init: function () {
  3479. this.jsonInit({
  3480. inputsInline: !0,
  3481. nextStatement: null,
  3482. previousStatement: null,
  3483. colour: CategoryColors.Bluebit,
  3484. helpUrl: Blockly.Msg.CocoRobo_LCD_CURSOR_HELPURL,
  3485. tooltip: Blockly.Msg.CocoRobo_LCD_CURSOR_TOOLTIP,
  3486. message0: Blockly.Msg.CocoRobo_LCD_CURSOR_MESSAGE0,
  3487. args0: [{
  3488. options: [
  3489. [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "Cursor(1)"],
  3490. [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "Cursor(0)"],
  3491. [Blockly.Msg.CocoRobo_LCD_CURSOR_BLINK, "Blink(1)"],
  3492. [Blockly.Msg.CocoRobo_LCD_CURSOR_NO_BLINK, "Blink(0)"]
  3493. ],
  3494. type: "field_dropdown",
  3495. name: "cursor_cmd"
  3496. }]
  3497. })
  3498. }
  3499. };
  3500. Blockly.Blocks.CocoRobo_lcd_home = {
  3501. init: function () {
  3502. this.jsonInit({
  3503. inputsInline: !0,
  3504. nextStatement: null,
  3505. previousStatement: null,
  3506. colour: CategoryColors.Bluebit,
  3507. helpUrl: Blockly.Msg.CocoRobo_LCD_HOME_HELPURL,
  3508. tooltip: Blockly.Msg.CocoRobo_LCD_HOME_TOOLTIP,
  3509. message0: Blockly.Msg.CocoRobo_LCD_HOME_MESSAGE0
  3510. })
  3511. }
  3512. };
  3513. Blockly.Blocks.CocoRobo_lcd_print = {
  3514. init: function () {
  3515. this.jsonInit({
  3516. inputsInline: !0,
  3517. nextStatement: null,
  3518. previousStatement: null,
  3519. colour: CategoryColors.Bluebit,
  3520. helpUrl: Blockly.Msg.CocoRobo_LCD_PRINT_HELPURL,
  3521. tooltip: Blockly.Msg.CocoRobo_LCD_PRINT_TOOLTIP,
  3522. message0: Blockly.Msg.CocoRobo_LCD_PRINT_MESSAGE0,
  3523. args0: [{
  3524. check: "String",
  3525. type: "input_value",
  3526. name: "display_str"
  3527. }]
  3528. })
  3529. }
  3530. };
  3531. Blockly.Blocks.CocoRobo_lcd_object = {
  3532. init: function () {
  3533. this.jsonInit({
  3534. inputsInline: !0,
  3535. nextStatement: null,
  3536. previousStatement: null,
  3537. colour: CategoryColors.Bluebit,
  3538. helpUrl: Blockly.Msg.CocoRobo_LCD_OBJECT_HELPURL,
  3539. tooltip: Blockly.Msg.CocoRobo_LCD_OBJECT_TOOLTIP,
  3540. message0: Blockly.Msg.CocoRobo_LCD_OBJECT_MESSAGE0
  3541. })
  3542. }
  3543. };
  3544. Blockly.Blocks.CocoRobo_bluebit_lcd_bmp = {
  3545. init: function () {
  3546. this.jsonInit({
  3547. inputsInline: !0,
  3548. nextStatement: null,
  3549. previousStatement: null,
  3550. colour: CategoryColors.Bluebit,
  3551. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_BMP_HELPURL,
  3552. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_BMP_TOOLTIP,
  3553. message0: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_BMP_MESSAGE0,
  3554. args0: [{
  3555. check: "Number",
  3556. type: "input_value",
  3557. name: "x"
  3558. }, {
  3559. check: "Number",
  3560. type: "input_value",
  3561. name: "y"
  3562. }, {
  3563. check: "Number",
  3564. type: "input_value",
  3565. name: "w"
  3566. }, {
  3567. check: "Number",
  3568. type: "input_value",
  3569. name: "h"
  3570. }, {
  3571. check: "Array",
  3572. type: "input_value",
  3573. name: "bmp"
  3574. }]
  3575. })
  3576. }
  3577. };
  3578. Blockly.Blocks.CocoRobo_bluebit_lcd_clear = {
  3579. init: function () {
  3580. this.jsonInit({
  3581. inputsInline: !0,
  3582. nextStatement: null,
  3583. previousStatement: null,
  3584. colour: CategoryColors.Bluebit,
  3585. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_CLEAR_HELPURL,
  3586. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_CLEAR_TOOLTIP,
  3587. message0: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_CLEAR_MESSAGE0
  3588. })
  3589. }
  3590. };
  3591. Blockly.Blocks.CocoRobo_bluebit_lcd_init = {
  3592. init: function () {
  3593. this.jsonInit({
  3594. inputsInline: !0,
  3595. nextStatement: null,
  3596. previousStatement: null,
  3597. colour: CategoryColors.Bluebit,
  3598. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_INIT_HELPURL,
  3599. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_INIT_TOOLTIP,
  3600. message0: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_INIT_MESSAGE0,
  3601. args0: [{
  3602. check: "Number",
  3603. type: "input_value",
  3604. name: "tx"
  3605. }, {
  3606. check: "Number",
  3607. type: "input_value",
  3608. name: "rx"
  3609. }]
  3610. })
  3611. }
  3612. };
  3613. Blockly.Blocks.CocoRobo_bluebit_lcd_print = {
  3614. init: function () {
  3615. this.jsonInit({
  3616. inputsInline: !0,
  3617. nextStatement: null,
  3618. previousStatement: null,
  3619. colour: CategoryColors.Bluebit,
  3620. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_PRINT_HELPURL,
  3621. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_PRINT_TOOLTIP,
  3622. message0: Blockly.Msg.CocoRobo_BLUEBIT_OLCD_PRINT_MESSAGE0,
  3623. args0: [{
  3624. check: "String",
  3625. type: "input_value",
  3626. name: "_print"
  3627. }, {
  3628. check: "Number",
  3629. type: "input_value",
  3630. name: "x"
  3631. }, {
  3632. check: "Number",
  3633. type: "input_value",
  3634. name: "y"
  3635. }]
  3636. })
  3637. }
  3638. };
  3639. Blockly.Blocks.CocoRobo_bluebit_extio_writeio = {
  3640. init: function () {
  3641. this.jsonInit({
  3642. inputsInline: !0,
  3643. nextStatement: null,
  3644. previousStatement: null,
  3645. colour: CategoryColors.Bluebit,
  3646. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_WRITEIO_HELPURL,
  3647. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_WRITEIO_TOOLTIP,
  3648. message0: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_WRITEIO_MESSAGE0,
  3649. args0: [{
  3650. type: "input_value",
  3651. name: "io_value"
  3652. }, {
  3653. options: [
  3654. ["0", "0"],
  3655. ["1", "1"],
  3656. ["2", "2"],
  3657. ["3", "3"],
  3658. ["4", "4"],
  3659. ["5", "5"],
  3660. ["6", "6"],
  3661. ["7", "7"]
  3662. ],
  3663. type: "field_dropdown",
  3664. name: "IO"
  3665. }]
  3666. })
  3667. }
  3668. };
  3669. Blockly.Blocks.CocoRobo_bluebit_extio_readio = {
  3670. init: function () {
  3671. this.jsonInit({
  3672. inputsInline: !0,
  3673. output: "Number",
  3674. colour: CategoryColors.Bluebit,
  3675. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_READIO_HELPURL,
  3676. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_READIO_TOOLTIP,
  3677. message0: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_READIO_MESSAGE0,
  3678. args0: [{
  3679. options: [
  3680. ["0", "0"],
  3681. ["1", "1"],
  3682. ["2", "2"],
  3683. ["3", "3"],
  3684. ["4", "4"],
  3685. ["5", "5"],
  3686. ["6", "6"],
  3687. ["7", "7"]
  3688. ],
  3689. type: "field_dropdown",
  3690. name: "IO"
  3691. }]
  3692. })
  3693. }
  3694. };
  3695. Blockly.Blocks.CocoRobo_bluebit_extio_iomode = {
  3696. init: function () {
  3697. this.jsonInit({
  3698. inputsInline: !0,
  3699. nextStatement: null,
  3700. previousStatement: null,
  3701. colour: CategoryColors.Bluebit,
  3702. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_IOMODE_HELPURL,
  3703. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_IOMODE_TOOLTIP,
  3704. message0: Blockly.Msg.CocoRobo_BLUEBIT_EXTIO_IOMODE_MESSAGE0,
  3705. args0: [{
  3706. options: [
  3707. [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_OUTPUT, "0"],
  3708. [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_INPUT, "1"]
  3709. ],
  3710. type: "field_dropdown",
  3711. name: "mode"
  3712. }, {
  3713. options: [
  3714. ["0", "0"],
  3715. ["1", "1"],
  3716. ["2", "2"],
  3717. ["3", "3"],
  3718. ["4", "4"],
  3719. ["5", "5"],
  3720. ["6", "6"],
  3721. ["7", "7"]
  3722. ],
  3723. type: "field_dropdown",
  3724. name: "IO"
  3725. }]
  3726. })
  3727. }
  3728. };
  3729. Blockly.Blocks.CocoRobo_bluebit_mp3_singleLoop = {
  3730. init: function () {
  3731. this.jsonInit({
  3732. inputsInline: !0,
  3733. nextStatement: null,
  3734. previousStatement: null,
  3735. colour: CategoryColors.Bluebit,
  3736. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_SINGLELOOP_HELPURL,
  3737. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_SINGLELOOP_TOOLTIP,
  3738. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_SINGLELOOP_MESSAGE0,
  3739. args0: [{
  3740. options: [
  3741. [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"],
  3742. [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]
  3743. ],
  3744. type: "field_dropdown",
  3745. name: "singleLoop"
  3746. }]
  3747. })
  3748. }
  3749. };
  3750. Blockly.Blocks.CocoRobo_bluebit_mp3_cmd = {
  3751. init: function () {
  3752. this.jsonInit({
  3753. inputsInline: !0,
  3754. nextStatement: null,
  3755. previousStatement: null,
  3756. colour: CategoryColors.Bluebit,
  3757. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_CMD_HELPURL,
  3758. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_CMD_TOOLTIP,
  3759. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_CMD_MESSAGE0,
  3760. args0: [{
  3761. options: [
  3762. [Blockly.Msg.PAUSE, "pause"],
  3763. [Blockly.Msg.STOP, "stop"],
  3764. [Blockly.Msg.PLAY, "play"],
  3765. [Blockly.Msg.PLAYNEXT, "playNext"],
  3766. [Blockly.Msg.PLAYPREV, "playPrev"]
  3767. ],
  3768. type: "field_dropdown",
  3769. name: "cmd"
  3770. }]
  3771. })
  3772. }
  3773. };
  3774. Blockly.Blocks.CocoRobo_bluebit_mp3_play_song = {
  3775. init: function () {
  3776. this.jsonInit({
  3777. inputsInline: !0,
  3778. nextStatement: null,
  3779. previousStatement: null,
  3780. colour: CategoryColors.Bluebit,
  3781. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_PLAY_SONG_HELPURL,
  3782. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_PLAY_SONG_TOOLTIP,
  3783. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_PLAY_SONG_MESSAGE0,
  3784. args0: [{
  3785. check: "Number",
  3786. type: "input_value",
  3787. name: "song_order"
  3788. }]
  3789. })
  3790. }
  3791. };
  3792. Blockly.Blocks.CocoRobo_bluebit_mp3_volume_plus = {
  3793. init: function () {
  3794. this.jsonInit({
  3795. inputsInline: !0,
  3796. nextStatement: null,
  3797. previousStatement: null,
  3798. colour: CategoryColors.Bluebit,
  3799. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_PLUS_HELPURL,
  3800. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_PLUS_TOOLTIP,
  3801. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_PLUS_MESSAGE0,
  3802. args0: [{
  3803. options: [
  3804. [Blockly.Msg.CocoRobo_PLUS_1, "volumeInc"],
  3805. [Blockly.Msg.CocoRobo_MINUS_1, "volumeDec"]
  3806. ],
  3807. type: "field_dropdown",
  3808. name: "volume_plus"
  3809. }]
  3810. })
  3811. }
  3812. };
  3813. Blockly.Blocks.CocoRobo_bluebit_mp3_init = {
  3814. init: function () {
  3815. this.jsonInit({
  3816. inputsInline: !0,
  3817. nextStatement: null,
  3818. previousStatement: null,
  3819. colour: CategoryColors.Bluebit,
  3820. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_INIT_HELPURL,
  3821. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_INIT_TOOLTIP,
  3822. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_INIT_MESSAGE0,
  3823. args0: [{
  3824. check: "Number",
  3825. type: "input_value",
  3826. name: "mp3_tx"
  3827. }]
  3828. })
  3829. }
  3830. };
  3831. Blockly.Blocks.CocoRobo_bluebit_mp3_volume = {
  3832. init: function () {
  3833. this.jsonInit({
  3834. inputsInline: !0,
  3835. nextStatement: null,
  3836. previousStatement: null,
  3837. colour: CategoryColors.Bluebit,
  3838. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_HELPURL,
  3839. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_TOOLTIP,
  3840. message0: Blockly.Msg.CocoRobo_BLUEBIT_MP3_VOLUME_MESSAGE0,
  3841. args0: [{
  3842. check: "Number",
  3843. type: "input_value",
  3844. name: "volume_level"
  3845. }]
  3846. })
  3847. }
  3848. };
  3849. Blockly.Blocks.CocoRobo_bluebit_matrix_show = {
  3850. init: function () {
  3851. this.jsonInit({
  3852. inputsInline: !0,
  3853. nextStatement: null,
  3854. previousStatement: null,
  3855. colour: CategoryColors.Bluebit,
  3856. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_SHOW_HELPURL,
  3857. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_SHOW_TOOLTIP,
  3858. message0: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_SHOW_MESSAGE0
  3859. })
  3860. }
  3861. };
  3862. Blockly.Blocks.CocoRobo_bluebit_matrix_bitmap = {
  3863. init: function () {
  3864. this.jsonInit({
  3865. colour: CategoryColors.Bluebit,
  3866. args0: [{
  3867. type: "input_dummy"
  3868. }, {
  3869. checked: !1,
  3870. type: "field_checkbox",
  3871. name: "00"
  3872. }, {
  3873. checked: !1,
  3874. type: "field_checkbox",
  3875. name: "01"
  3876. }, {
  3877. checked: !1,
  3878. type: "field_checkbox",
  3879. name: "02"
  3880. }, {
  3881. checked: !1,
  3882. type: "field_checkbox",
  3883. name: "03"
  3884. }, {
  3885. checked: !1,
  3886. type: "field_checkbox",
  3887. name: "04"
  3888. }, {
  3889. checked: !1,
  3890. type: "field_checkbox",
  3891. name: "05"
  3892. }, {
  3893. checked: !1,
  3894. type: "field_checkbox",
  3895. name: "06"
  3896. }, {
  3897. checked: !1,
  3898. type: "field_checkbox",
  3899. name: "07"
  3900. }, {
  3901. type: "input_dummy"
  3902. }, {
  3903. checked: !1,
  3904. type: "field_checkbox",
  3905. name: "10"
  3906. }, {
  3907. checked: !1,
  3908. type: "field_checkbox",
  3909. name: "11"
  3910. }, {
  3911. checked: !1,
  3912. type: "field_checkbox",
  3913. name: "12"
  3914. }, {
  3915. checked: !1,
  3916. type: "field_checkbox",
  3917. name: "13"
  3918. }, {
  3919. checked: !1,
  3920. type: "field_checkbox",
  3921. name: "14"
  3922. }, {
  3923. checked: !1,
  3924. type: "field_checkbox",
  3925. name: "15"
  3926. }, {
  3927. checked: !1,
  3928. type: "field_checkbox",
  3929. name: "16"
  3930. }, {
  3931. checked: !1,
  3932. type: "field_checkbox",
  3933. name: "17"
  3934. }, {
  3935. type: "input_dummy"
  3936. }, {
  3937. checked: !1,
  3938. type: "field_checkbox",
  3939. name: "20"
  3940. }, {
  3941. checked: !1,
  3942. type: "field_checkbox",
  3943. name: "21"
  3944. }, {
  3945. checked: !1,
  3946. type: "field_checkbox",
  3947. name: "22"
  3948. }, {
  3949. checked: !1,
  3950. type: "field_checkbox",
  3951. name: "23"
  3952. }, {
  3953. checked: !1,
  3954. type: "field_checkbox",
  3955. name: "24"
  3956. }, {
  3957. checked: !1,
  3958. type: "field_checkbox",
  3959. name: "25"
  3960. }, {
  3961. checked: !1,
  3962. type: "field_checkbox",
  3963. name: "26"
  3964. }, {
  3965. checked: !1,
  3966. type: "field_checkbox",
  3967. name: "27"
  3968. }, {
  3969. type: "input_dummy"
  3970. }, {
  3971. checked: !1,
  3972. type: "field_checkbox",
  3973. name: "30"
  3974. }, {
  3975. checked: !1,
  3976. type: "field_checkbox",
  3977. name: "31"
  3978. }, {
  3979. checked: !1,
  3980. type: "field_checkbox",
  3981. name: "32"
  3982. }, {
  3983. checked: !1,
  3984. type: "field_checkbox",
  3985. name: "33"
  3986. }, {
  3987. checked: !1,
  3988. type: "field_checkbox",
  3989. name: "34"
  3990. }, {
  3991. checked: !1,
  3992. type: "field_checkbox",
  3993. name: "35"
  3994. }, {
  3995. checked: !1,
  3996. type: "field_checkbox",
  3997. name: "36"
  3998. }, {
  3999. checked: !1,
  4000. type: "field_checkbox",
  4001. name: "37"
  4002. }, {
  4003. type: "input_dummy"
  4004. }, {
  4005. checked: !1,
  4006. type: "field_checkbox",
  4007. name: "40"
  4008. }, {
  4009. checked: !1,
  4010. type: "field_checkbox",
  4011. name: "41"
  4012. }, {
  4013. checked: !1,
  4014. type: "field_checkbox",
  4015. name: "42"
  4016. }, {
  4017. checked: !1,
  4018. type: "field_checkbox",
  4019. name: "43"
  4020. }, {
  4021. checked: !1,
  4022. type: "field_checkbox",
  4023. name: "44"
  4024. }, {
  4025. checked: !1,
  4026. type: "field_checkbox",
  4027. name: "45"
  4028. }, {
  4029. checked: !1,
  4030. type: "field_checkbox",
  4031. name: "46"
  4032. }, {
  4033. checked: !1,
  4034. type: "field_checkbox",
  4035. name: "47"
  4036. }, {
  4037. type: "input_dummy"
  4038. }, {
  4039. checked: !1,
  4040. type: "field_checkbox",
  4041. name: "50"
  4042. }, {
  4043. checked: !1,
  4044. type: "field_checkbox",
  4045. name: "51"
  4046. }, {
  4047. checked: !1,
  4048. type: "field_checkbox",
  4049. name: "52"
  4050. }, {
  4051. checked: !1,
  4052. type: "field_checkbox",
  4053. name: "53"
  4054. }, {
  4055. checked: !1,
  4056. type: "field_checkbox",
  4057. name: "54"
  4058. }, {
  4059. checked: !1,
  4060. type: "field_checkbox",
  4061. name: "55"
  4062. }, {
  4063. checked: !1,
  4064. type: "field_checkbox",
  4065. name: "56"
  4066. }, {
  4067. checked: !1,
  4068. type: "field_checkbox",
  4069. name: "57"
  4070. }, {
  4071. type: "input_dummy"
  4072. }, {
  4073. checked: !1,
  4074. type: "field_checkbox",
  4075. name: "60"
  4076. }, {
  4077. checked: !1,
  4078. type: "field_checkbox",
  4079. name: "61"
  4080. }, {
  4081. checked: !1,
  4082. type: "field_checkbox",
  4083. name: "62"
  4084. }, {
  4085. checked: !1,
  4086. type: "field_checkbox",
  4087. name: "63"
  4088. }, {
  4089. checked: !1,
  4090. type: "field_checkbox",
  4091. name: "64"
  4092. }, {
  4093. checked: !1,
  4094. type: "field_checkbox",
  4095. name: "65"
  4096. }, {
  4097. checked: !1,
  4098. type: "field_checkbox",
  4099. name: "66"
  4100. }, {
  4101. checked: !1,
  4102. type: "field_checkbox",
  4103. name: "67"
  4104. }, {
  4105. type: "input_dummy"
  4106. }, {
  4107. checked: !1,
  4108. type: "field_checkbox",
  4109. name: "70"
  4110. }, {
  4111. checked: !1,
  4112. type: "field_checkbox",
  4113. name: "71"
  4114. }, {
  4115. checked: !1,
  4116. type: "field_checkbox",
  4117. name: "72"
  4118. }, {
  4119. checked: !1,
  4120. type: "field_checkbox",
  4121. name: "73"
  4122. }, {
  4123. checked: !1,
  4124. type: "field_checkbox",
  4125. name: "74"
  4126. }, {
  4127. checked: !1,
  4128. type: "field_checkbox",
  4129. name: "75"
  4130. }, {
  4131. checked: !1,
  4132. type: "field_checkbox",
  4133. name: "76"
  4134. }, {
  4135. checked: !1,
  4136. type: "field_checkbox",
  4137. name: "77"
  4138. }],
  4139. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BITMAP_HELPURL,
  4140. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BITMAP_TOOLTIP,
  4141. message0: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BITMAP_MESSAGE0,
  4142. nextStatement: null,
  4143. previousStatement: null
  4144. })
  4145. }
  4146. };
  4147. Blockly.Blocks.CocoRobo_bluebit_matrix_fill = {
  4148. init: function () {
  4149. this.jsonInit({
  4150. inputsInline: !0,
  4151. nextStatement: null,
  4152. previousStatement: null,
  4153. colour: CategoryColors.Bluebit,
  4154. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_FILL_HELPURL,
  4155. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_FILL_TOOLTIP,
  4156. message0: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_FILL_MESSAGE0,
  4157. args0: [{
  4158. options: [
  4159. [Blockly.Msg.CocoRobo_display_fill_1, "1"],
  4160. [Blockly.Msg.CocoRobo_display_fill_0, "0"]
  4161. ],
  4162. type: "field_dropdown",
  4163. name: "fill_clear"
  4164. }]
  4165. })
  4166. }
  4167. };
  4168. Blockly.Blocks.CocoRobo_bluebit_matrix_brightness = {
  4169. init: function () {
  4170. this.jsonInit({
  4171. inputsInline: !0,
  4172. nextStatement: null,
  4173. previousStatement: null,
  4174. colour: CategoryColors.Bluebit,
  4175. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BRIGHTNESS_HELPURL,
  4176. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BRIGHTNESS_TOOLTIP,
  4177. message0: Blockly.Msg.CocoRobo_BLUEBIT_MATRIX_BRIGHTNESS_MESSAGE0,
  4178. args0: [{
  4179. check: "Number",
  4180. type: "input_value",
  4181. name: "brightness_level"
  4182. }]
  4183. })
  4184. }
  4185. };
  4186. Blockly.Blocks.CocoRobo_bluebit_midi_play = {
  4187. init: function () {
  4188. this.jsonInit({
  4189. inputsInline: !0,
  4190. nextStatement: null,
  4191. previousStatement: null,
  4192. colour: CategoryColors.Bluebit,
  4193. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_PLAY_HELPURL,
  4194. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_PLAY_TOOLTIP,
  4195. message0: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_PLAY_MESSAGE0,
  4196. args0: [{
  4197. options: [
  4198. [Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_PLAY, "1"],
  4199. [Blockly.Msg.STOP, "0"]
  4200. ],
  4201. type: "field_dropdown",
  4202. name: "play_stop"
  4203. }, {
  4204. check: "Number",
  4205. type: "input_value",
  4206. name: "play_note"
  4207. }]
  4208. })
  4209. }
  4210. };
  4211. Blockly.Blocks.CocoRobo_bluebit_midi_instrument = {
  4212. init: function () {
  4213. this.jsonInit({
  4214. inputsInline: !0,
  4215. nextStatement: null,
  4216. previousStatement: null,
  4217. colour: CategoryColors.Bluebit,
  4218. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_INSTRUMENT_HELPURL,
  4219. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_INSTRUMENT_TOOLTIP,
  4220. message0: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_INSTRUMENT_MESSAGE0,
  4221. args0: [{
  4222. options: [
  4223. [Blockly.Msg.MIDI_PIANO, "1"],
  4224. [Blockly.Msg.MIDI_BRIGHTACOUSTICPIANO, "2"],
  4225. [Blockly.Msg.MIDI_ELECTRICGRANDPIANO, "3"],
  4226. [Blockly.Msg.MIDI_HARPSICHORD, "7"],
  4227. [Blockly.Msg.MIDI_CELESTA, "9"],
  4228. [Blockly.Msg.MIDI_GLOCKENSPIEL, "10"],
  4229. [Blockly.Msg.MIDI_MARIMBA, "13"],
  4230. [Blockly.Msg.MIDI_XYLOPHONE, "14"],
  4231. [Blockly.Msg.MIDI_TUBULARBELL, "15"],
  4232. [Blockly.Msg.MIDI_DULCIMER, "16"],
  4233. [Blockly.Msg.MIDI_VIBRAPHONE, "12"],
  4234. [Blockly.Msg.MIDI_ORGAN, "17"],
  4235. [Blockly.Msg.MIDI_ACOUSTIC_GUITAR, "25"],
  4236. [Blockly.Msg.MIDI_ELECTRIC_GUITAR, "31"],
  4237. [Blockly.Msg.MIDI_ACOUSTIC_BASS, "33"],
  4238. [Blockly.Msg.MIDI_STRING_ENSEMBLE, "49"],
  4239. [Blockly.Msg.MIDI_VIOLIN, "41"],
  4240. [Blockly.Msg.MIDI_TRUMPET, "57"],
  4241. [Blockly.Msg.MIDI_SAX, "65"],
  4242. [Blockly.Msg.MIDI_STEEL_DRUMS, "115"],
  4243. [Blockly.Msg.MIDI_LEAD, "81"],
  4244. [Blockly.Msg.MIDI_PAD, "89"]
  4245. ],
  4246. type: "field_dropdown",
  4247. name: "midi_instrument"
  4248. }]
  4249. })
  4250. }
  4251. };
  4252. Blockly.Blocks.CocoRobo_bluebit_midi_volume = {
  4253. init: function () {
  4254. this.jsonInit({
  4255. inputsInline: !0,
  4256. nextStatement: null,
  4257. previousStatement: null,
  4258. colour: CategoryColors.Bluebit,
  4259. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_VOLUME_HELPURL,
  4260. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_VOLUME_TOOLTIP,
  4261. message0: Blockly.Msg.CocoRobo_BLUEBIT_MIDI_VOLUME_MESSAGE0,
  4262. args0: [{
  4263. check: "Number",
  4264. type: "input_value",
  4265. name: "midi_volume"
  4266. }]
  4267. })
  4268. }
  4269. };
  4270. Blockly.Blocks.CocoRobo_bluebit_init_midi = {
  4271. init: function () {
  4272. this.jsonInit({
  4273. inputsInline: !0,
  4274. nextStatement: null,
  4275. previousStatement: null,
  4276. colour: CategoryColors.Bluebit,
  4277. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_INIT_MIDI_HELPURL,
  4278. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_INIT_MIDI_TOOLTIP,
  4279. message0: Blockly.Msg.CocoRobo_BLUEBIT_INIT_MIDI_MESSAGE0,
  4280. args0: [{
  4281. check: "Number",
  4282. type: "input_value",
  4283. name: "midi_tx"
  4284. }]
  4285. })
  4286. }
  4287. };
  4288. Blockly.Blocks.CocoRobo_bluebit_get_all_color = {
  4289. init: function () {
  4290. this.jsonInit({
  4291. inputsInline: !0,
  4292. output: "Array",
  4293. colour: CategoryColors.Bluebit,
  4294. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_HELPURL,
  4295. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_TOOLTIP,
  4296. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_MESSAGE0
  4297. })
  4298. }
  4299. };
  4300. Blockly.Blocks.CocoRobo_bluebit_get_color = {
  4301. init: function () {
  4302. this.jsonInit({
  4303. inputsInline: !0,
  4304. output: "Number",
  4305. colour: CategoryColors.Bluebit,
  4306. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_HELPURL,
  4307. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_TOOLTIP,
  4308. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_MESSAGE0,
  4309. args0: [{
  4310. name: "r_g_b",
  4311. type: "field_dropdown",
  4312. options: [
  4313. [Blockly.Msg.CocoRobo_RED, "0"],
  4314. [Blockly.Msg.CocoRobo_GREEN, "1"],
  4315. [Blockly.Msg.CocoRobo_BLUE, "2"]
  4316. ]
  4317. }]
  4318. })
  4319. }
  4320. };
  4321. Blockly.Blocks.CocoRobo_bluebit_get_all_color_hsv = {
  4322. init: function () {
  4323. this.jsonInit({
  4324. inputsInline: !0,
  4325. output: "Array",
  4326. colour: CategoryColors.Bluebit,
  4327. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_HSV_HELPURL,
  4328. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_HSV_TOOLTIP,
  4329. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_ALL_COLOR_HSV_MESSAGE0
  4330. })
  4331. }
  4332. };
  4333. Blockly.Blocks.CocoRobo_bluebit_get_color_hsv = {
  4334. init: function () {
  4335. this.jsonInit({
  4336. inputsInline: !0,
  4337. output: "Number",
  4338. colour: CategoryColors.Bluebit,
  4339. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_HSV_HELPURL,
  4340. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_HSV_TOOLTIP,
  4341. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_COLOR_HSV_MESSAGE0,
  4342. args0: [{
  4343. name: "hsv",
  4344. type: "field_dropdown",
  4345. options: [
  4346. ["H", "0"],
  4347. ["S", "1"],
  4348. ["V", "2"]
  4349. ]
  4350. }]
  4351. })
  4352. }
  4353. };
  4354. Blockly.Blocks.CocoRobo_bluebit_get_force_measure = {
  4355. init: function () {
  4356. this.jsonInit({
  4357. inputsInline: !0,
  4358. output: "Number",
  4359. colour: CategoryColors.Bluebit,
  4360. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_FORCE_MEASURE_HELPURL,
  4361. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_FORCE_MEASURE_TOOLTIP,
  4362. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_FORCE_MEASURE_MESSAGE0,
  4363. args0: [{
  4364. name: "measure",
  4365. type: "field_dropdown",
  4366. options: [
  4367. ["0", "0X64"],
  4368. ["1", "0X65"],
  4369. ["2", "0X66"],
  4370. ["3", "0X67"]
  4371. ]
  4372. }]
  4373. })
  4374. }
  4375. };
  4376. Blockly.Blocks.CocoRobo_bluebit_get_electricity_measure = {
  4377. init: function () {
  4378. this.jsonInit({
  4379. inputsInline: !0,
  4380. output: "Number",
  4381. colour: CategoryColors.Bluebit,
  4382. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_ELECTRICITY_MEASURE_HELPURL,
  4383. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_ELECTRICITY_MEASURE_TOOLTIP,
  4384. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_ELECTRICITY_MEASURE_MESSAGE0,
  4385. args0: [{
  4386. name: "measure",
  4387. type: "field_dropdown",
  4388. options: [
  4389. ["0", "0X60"],
  4390. ["1", "0X61"],
  4391. ["2", "0X62"],
  4392. ["3", "0X63"]
  4393. ]
  4394. }]
  4395. })
  4396. }
  4397. };
  4398. Blockly.Blocks.CocoRobo_bluebit_get_voltage_measure = {
  4399. init: function () {
  4400. this.jsonInit({
  4401. inputsInline: !0,
  4402. output: "Number",
  4403. colour: CategoryColors.Bluebit,
  4404. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_VOLTAGE_MEASURE_HELPURL,
  4405. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_VOLTAGE_MEASURE_TOOLTIP,
  4406. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_VOLTAGE_MEASURE_MESSAGE0,
  4407. args0: [{
  4408. name: "measure",
  4409. type: "field_dropdown",
  4410. options: [
  4411. ["0", "0X6A"],
  4412. ["1", "0X6B"],
  4413. ["2", "0X6C"],
  4414. ["3", "0X6D"]
  4415. ]
  4416. }]
  4417. })
  4418. }
  4419. };
  4420. Blockly.Blocks.CocoRobo_bluebit_get_magnetic_measure = {
  4421. init: function () {
  4422. this.jsonInit({
  4423. inputsInline: !0,
  4424. output: "Number",
  4425. colour: CategoryColors.Bluebit,
  4426. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_MAGNETIC_MEASURE_HELPURL,
  4427. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_MAGNETIC_MEASURE_TOOLTIP,
  4428. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_MAGNETIC_MEASURE_MESSAGE0,
  4429. args0: [{
  4430. name: "measure",
  4431. type: "field_dropdown",
  4432. options: [
  4433. ["0", "0X58"],
  4434. ["1", "0X59"],
  4435. ["2", "0X5A"],
  4436. ["3", "0X5B"]
  4437. ]
  4438. }]
  4439. })
  4440. }
  4441. };
  4442. Blockly.Blocks.CocoRobo_bluebit_get_PH_measure = {
  4443. init: function () {
  4444. this.jsonInit({
  4445. inputsInline: !0,
  4446. output: "Number",
  4447. colour: CategoryColors.Bluebit,
  4448. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_PH_MEASURE_HELPURL,
  4449. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_PH_MEASURE_TOOLTIP,
  4450. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_PH_MEASURE_MESSAGE0,
  4451. args0: [{
  4452. name: "measure",
  4453. type: "field_dropdown",
  4454. options: [
  4455. ["0", "0X54"],
  4456. ["1", "0X55"]
  4457. ]
  4458. }]
  4459. })
  4460. }
  4461. };
  4462. Blockly.Blocks.CocoRobo_bluebit_get_tds_measure = {
  4463. init: function () {
  4464. this.jsonInit({
  4465. inputsInline: !0,
  4466. output: "Number",
  4467. colour: CategoryColors.Bluebit,
  4468. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_TDS_MEASURE_HELPURL,
  4469. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_TDS_MEASURE_TOOLTIP,
  4470. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_TDS_MEASURE_MESSAGE0,
  4471. args0: [{
  4472. name: "measure",
  4473. type: "field_dropdown",
  4474. options: [
  4475. ["0", "0X68"],
  4476. ["1", "0X69"]
  4477. ]
  4478. }]
  4479. })
  4480. }
  4481. };
  4482. Blockly.Blocks.CocoRobo_bluebit_get_pressure_measure = {
  4483. init: function () {
  4484. this.jsonInit({
  4485. inputsInline: !0,
  4486. output: "Number",
  4487. colour: CategoryColors.Bluebit,
  4488. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_PRESSURE_MEASURE_HELPURL,
  4489. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_PRESSURE_MEASURE_TOOLTIP,
  4490. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_PRESSURE_MEASURE_MESSAGE0,
  4491. args0: [{
  4492. name: "measure",
  4493. type: "field_dropdown",
  4494. options: [
  4495. ["0", "0X5C"],
  4496. ["1", "0X5D"],
  4497. ["2", "0X5E"],
  4498. ["3", "0X5F"]
  4499. ]
  4500. }]
  4501. })
  4502. }
  4503. };
  4504. Blockly.Blocks.CocoRobo_bluebit_get_photogate_timer_measure = {
  4505. init: function () {
  4506. this.jsonInit({
  4507. inputsInline: !0,
  4508. output: "Number",
  4509. colour: CategoryColors.Bluebit,
  4510. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_PHOTOGATE_TIMER_MEASURE_HELPURL,
  4511. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_PHOTOGATE_TIMER_MEASURE_TOOLTIP,
  4512. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_PHOTOGATE_TIMER_MEASURE_MESSAGE0,
  4513. args0: [{
  4514. name: "measure",
  4515. type: "field_dropdown",
  4516. options: [
  4517. ["0", "0X50"],
  4518. ["1", "0X51"]
  4519. ]
  4520. }]
  4521. })
  4522. }
  4523. };
  4524. Blockly.Blocks.CocoRobo_init_assistant_wifi = {
  4525. init: function () {
  4526. this.jsonInit({
  4527. inputsInline: !0,
  4528. output: "Number",
  4529. colour: CategoryColors.Bluebit,
  4530. helpUrl: Blockly.Msg.CocoRobo_INIT_ASSISTANT_WIFI_HELPURL,
  4531. tooltip: Blockly.Msg.CocoRobo_INIT_ASSISTANT_WIFI_TOOLTIP,
  4532. message0: Blockly.Msg.CocoRobo_INIT_ASSISTANT_WIFI_MESSAGE0,
  4533. args0: [{
  4534. check: "String",
  4535. type: "input_value",
  4536. name: "ssid"
  4537. }, {
  4538. check: "String",
  4539. type: "input_value",
  4540. name: "password"
  4541. }]
  4542. })
  4543. }
  4544. };
  4545. Blockly.Blocks.CocoRobo_init_assistant_profile = {
  4546. init: function () {
  4547. this.jsonInit({
  4548. colour: CategoryColors.Bluebit,
  4549. args0: [{
  4550. type: "input_value",
  4551. name: "file_path"
  4552. }],
  4553. inputsInline: !0,
  4554. nextStatement: null,
  4555. previousStatement: null,
  4556. helpUrl: Blockly.Msg.CocoRobo_INIT_ASSISTANT_PROFILE_HELPURL,
  4557. tooltip: Blockly.Msg.CocoRobo_INIT_ASSISTANT_PROFILE_TOOLTIP,
  4558. message0: Blockly.Msg.CocoRobo_INIT_ASSISTANT_PROFILE_MESSAGE0
  4559. })
  4560. }
  4561. };
  4562. Blockly.Blocks.CocoRobo_bluebit_seg_clear = {
  4563. init: function () {
  4564. this.jsonInit({
  4565. inputsInline: !0,
  4566. nextStatement: null,
  4567. previousStatement: null,
  4568. colour: CategoryColors.Bluebit,
  4569. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SEG_CLEAR_HELPURL,
  4570. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SEG_CLEAR_TOOLTIP,
  4571. message0: Blockly.Msg.CocoRobo_BLUEBIT_SEG_CLEAR_MESSAGE0
  4572. })
  4573. }
  4574. };
  4575. Blockly.Blocks.CocoRobo_bluebit_seg_display = {
  4576. init: function () {
  4577. this.jsonInit({
  4578. inputsInline: !0,
  4579. nextStatement: null,
  4580. previousStatement: null,
  4581. colour: CategoryColors.Bluebit,
  4582. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SEG_DISPLAY_HELPURL,
  4583. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SEG_DISPLAY_TOOLTIP,
  4584. message0: Blockly.Msg.CocoRobo_BLUEBIT_SEG_DISPLAY_MESSAGE0,
  4585. args0: [{
  4586. check: "Number",
  4587. type: "input_value",
  4588. name: "seg_num"
  4589. }]
  4590. })
  4591. }
  4592. };
  4593. Blockly.Blocks.CocoRobo_bluebit_ambientlight = {
  4594. init: function () {
  4595. this.jsonInit({
  4596. inputsInline: !0,
  4597. output: "Number",
  4598. colour: CategoryColors.Bluebit,
  4599. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_AMBIENTLIGHT_HELPURL,
  4600. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_AMBIENTLIGHT_TOOLTIP,
  4601. message0: Blockly.Msg.CocoRobo_BLUEBIT_AMBIENTLIGHT_MESSAGE0
  4602. })
  4603. }
  4604. };
  4605. Blockly.Blocks.CocoRobo_bluebit_hum_tem = {
  4606. init: function () {
  4607. this.jsonInit({
  4608. colour: CategoryColors.Bluebit,
  4609. output: "Number",
  4610. args0: [{
  4611. name: "hum_tem",
  4612. options: [
  4613. [Blockly.Msg.CocoRobo_BLUEBIT_TEMPERATURE, "temperature"],
  4614. [Blockly.Msg.CocoRobo_BLUEBIT_HUMIDITY, "humidity"]
  4615. ],
  4616. type: "field_dropdown"
  4617. }],
  4618. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_HUM_TEM_HELPURL,
  4619. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_HUM_TEM_TOOLTIP,
  4620. message0: Blockly.Msg.CocoRobo_BLUEBIT_HUM_TEM_MESSAGE0
  4621. })
  4622. }
  4623. };
  4624. Blockly.Blocks.CocoRobo_bluebit_ultrasonic = {
  4625. init: function () {
  4626. this.jsonInit({
  4627. colour: CategoryColors.Bluebit,
  4628. output: "Number",
  4629. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_ULTRASONIC_HELPURL,
  4630. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_ULTRASONIC_TOOLTIP,
  4631. message0: Blockly.Msg.CocoRobo_BLUEBIT_ULTRASONIC_MESSAGE0
  4632. })
  4633. }
  4634. };
  4635. Blockly.Blocks.CocoRobo_bluebit_read_digital = {
  4636. init: function () {
  4637. this.jsonInit({
  4638. colour: CategoryColors.Bluebit,
  4639. args0: [{
  4640. name: "digital_senor",
  4641. options: [
  4642. [Blockly.Msg.CocoRobo_BLUEBIT_SOUND, "SOUND"],
  4643. [Blockly.Msg.CocoRobo_BLUEBIT_IR_RECEIVE, "IR"],
  4644. [Blockly.Msg.CocoRobo_BLUEBIT_VIBRATION, "VIBRATION"],
  4645. [Blockly.Msg.CocoRobo_BLUEBIT_RFID, "RFID"],
  4646. [Blockly.Msg.CocoRobo_BLUEBIT_FINGERPRINT_SCANNER, "FINGERPRINT"],
  4647. [Blockly.Msg.CocoRobo_BLUEBIT_PIR, "PIR"],
  4648. [Blockly.Msg.CocoRobo_BLUEBIT_MAGNETIC, "MAGNETIC"],
  4649. [Blockly.Msg.CocoRobo_BLUEBIT_BUTTON, "BUTTON"]
  4650. ],
  4651. type: "field_dropdown"
  4652. }, {
  4653. name: "allPin",
  4654. check: "Number",
  4655. type: "input_value"
  4656. }],
  4657. output: "Boolean",
  4658. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_READ_DIGITAL_HELPURL,
  4659. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_READ_DIGITAL_TOOLTIP,
  4660. message0: Blockly.Msg.CocoRobo_BLUEBIT_READ_DIGITAL_MESSAGE0
  4661. })
  4662. }
  4663. };
  4664. Blockly.Blocks.CocoRobo_bluebit_line_follower = {
  4665. init: function () {
  4666. this.jsonInit({
  4667. colour: CategoryColors.Bluebit,
  4668. args0: [{
  4669. name: "allPin",
  4670. check: "Number",
  4671. type: "input_value"
  4672. }],
  4673. output: "Boolean",
  4674. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_LINE_FOLLOWER_HELPURL,
  4675. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_LINE_FOLLOWER_TOOLTIP,
  4676. message0: Blockly.Msg.CocoRobo_BLUEBIT_LINE_FOLLOWER_MESSAGE0
  4677. })
  4678. }
  4679. };
  4680. Blockly.Blocks.CocoRobo_bluebit_set_true = {
  4681. init: function () {
  4682. this.jsonInit({
  4683. inputsInline: !0,
  4684. nextStatement: null,
  4685. previousStatement: null,
  4686. colour: CategoryColors.Bluebit,
  4687. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SET_TRUE_HELPURL,
  4688. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SET_TRUE_TOOLTIP,
  4689. message0: Blockly.Msg.CocoRobo_BLUEBIT_SET_TRUE_MESSAGE0,
  4690. args0: [{
  4691. name: "set_digital_senor",
  4692. options: [
  4693. [Blockly.Msg.CocoRobo_BLUEBIT_FAN, "_FAN"],
  4694. [Blockly.Msg.CocoRobo_BLUEBIT_LASER, "_LASER"]
  4695. ],
  4696. type: "field_dropdown"
  4697. }, {
  4698. name: "set_digital_P",
  4699. check: "Number",
  4700. type: "input_value"
  4701. }]
  4702. })
  4703. }
  4704. };
  4705. Blockly.Blocks.CocoRobo_bluebit_set_false = {
  4706. init: function () {
  4707. this.jsonInit({
  4708. inputsInline: !0,
  4709. nextStatement: null,
  4710. previousStatement: null,
  4711. colour: CategoryColors.Bluebit,
  4712. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SET_FALSE_HELPURL,
  4713. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SET_FALSE_TOOLTIP,
  4714. message0: Blockly.Msg.CocoRobo_BLUEBIT_SET_FALSE_MESSAGE0,
  4715. args0: [{
  4716. name: "set_digital_senor",
  4717. options: [
  4718. [Blockly.Msg.CocoRobo_BLUEBIT_FAN, "_FAN"],
  4719. [Blockly.Msg.CocoRobo_BLUEBIT_LASER, "_LASER"]
  4720. ],
  4721. type: "field_dropdown"
  4722. }, {
  4723. name: "set_digital_P",
  4724. check: "Number",
  4725. type: "input_value"
  4726. }]
  4727. })
  4728. }
  4729. };
  4730. Blockly.Blocks.CocoRobo_bluebit_read_analog = {
  4731. init: function () {
  4732. this.jsonInit({
  4733. colour: CategoryColors.Bluebit,
  4734. args0: [{
  4735. name: "analog_senor",
  4736. options: [
  4737. [Blockly.Msg.CocoRobo_BLUEBIT_ANALOG_LIGHT, "_ANALOG_LIGHT"],
  4738. [Blockly.Msg.CocoRobo_BLUEBIT_SOUND, "_SOUND"],
  4739. [Blockly.Msg.CocoRobo_BLUEBIT_NTC_TEMP, "_NTC"],
  4740. [Blockly.Msg.CocoRobo_BLUEBIT_WATER, "_WATER"],
  4741. [Blockly.Msg.CocoRobo_BLUEBIT_SOIL_MOISTURE, "_SOIL"],
  4742. [Blockly.Msg.CocoRobo_BLUEBIT_ROTATE_DIMMER, "_ROTATE"],
  4743. [Blockly.Msg.CocoRobo_BLUEBIT_LINEAR_SLIDING_POTENTIOMETER, "_LINEAR_SLIDING_POTENTIOMETER"],
  4744. [Blockly.Msg.CocoRobo_BLUEBIT_LM35_TEMP, "_LM35"]
  4745. ],
  4746. type: "field_dropdown"
  4747. }, {
  4748. name: "read_analog_P",
  4749. check: "Number",
  4750. type: "input_value"
  4751. }],
  4752. output: "Number",
  4753. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_READ_ANALOG_HELPURL,
  4754. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_READ_ANALOG_TOOLTIP,
  4755. message0: Blockly.Msg.CocoRobo_BLUEBIT_READ_ANALOG_MESSAGE0
  4756. })
  4757. }
  4758. };
  4759. Blockly.Blocks.CocoRobo_bluebit_set_analog = {
  4760. init: function () {
  4761. this.jsonInit({
  4762. colour: CategoryColors.Bluebit,
  4763. args0: [{
  4764. check: "Number",
  4765. type: "input_value",
  4766. name: "analog_value"
  4767. }, {
  4768. name: "set_analog_P",
  4769. check: "Number",
  4770. type: "input_value"
  4771. }],
  4772. inputsInline: !0,
  4773. nextStatement: null,
  4774. previousStatement: null,
  4775. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SET_ANALOG_HELPURL,
  4776. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SET_ANALOG_TOOLTIP,
  4777. message0: Blockly.Msg.CocoRobo_BLUEBIT_SET_ANALOG_MESSAGE0
  4778. })
  4779. }
  4780. };
  4781. Blockly.Blocks.CocoRobo_bluebit_voice_record_on = {
  4782. init: function () {
  4783. this.jsonInit({
  4784. colour: CategoryColors.Bluebit,
  4785. args0: [{
  4786. type: "field_dropdown",
  4787. name: "func",
  4788. options: [
  4789. [Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_PLAY, "play"],
  4790. [Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_REC, "rec"]
  4791. ]
  4792. }, {
  4793. type: "input_dummy"
  4794. }, {
  4795. name: "rec",
  4796. check: "Number",
  4797. type: "input_value"
  4798. }, {
  4799. name: "play",
  4800. check: "Number",
  4801. type: "input_value"
  4802. }],
  4803. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_ON_HELPURL,
  4804. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_ON_TOOLTIP,
  4805. message0: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_ON_MESSAGE0,
  4806. nextStatement: null,
  4807. previousStatement: null,
  4808. inputsInline: !0
  4809. })
  4810. }
  4811. };
  4812. Blockly.Blocks.CocoRobo_bluebit_voice_record_off = {
  4813. init: function () {
  4814. this.jsonInit({
  4815. colour: CategoryColors.Bluebit,
  4816. args0: [{
  4817. type: "input_dummy"
  4818. }, {
  4819. name: "rec",
  4820. check: "Number",
  4821. type: "input_value"
  4822. }, {
  4823. name: "play",
  4824. check: "Number",
  4825. type: "input_value"
  4826. }],
  4827. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_OFF_HELPURL,
  4828. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_OFF_TOOLTIP,
  4829. message0: Blockly.Msg.CocoRobo_BLUEBIT_VOICE_RECORD_OFF_MESSAGE0,
  4830. nextStatement: null,
  4831. previousStatement: null,
  4832. inputsInline: !0
  4833. })
  4834. }
  4835. };
  4836. Blockly.Blocks.CocoRobo_bluebit_motor_on = {
  4837. init: function () {
  4838. this.jsonInit({
  4839. colour: CategoryColors.Bluebit,
  4840. args0: [{
  4841. name: "status",
  4842. type: "field_dropdown",
  4843. options: [
  4844. [Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_CLOCKWISE, "1"],
  4845. [Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_ANTICLOCKWISE, "0"]
  4846. ]
  4847. }, {
  4848. name: "speed",
  4849. type: "input_value",
  4850. check: "Number"
  4851. }, {
  4852. name: "ain1",
  4853. check: "Number",
  4854. type: "input_value"
  4855. }, {
  4856. name: "ain2",
  4857. check: "Number",
  4858. type: "input_value"
  4859. }],
  4860. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_HELPURL,
  4861. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_TOOLTIP,
  4862. message0: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_MESSAGE0,
  4863. inputsInline: !0,
  4864. nextStatement: null,
  4865. previousStatement: null
  4866. })
  4867. }
  4868. };
  4869. Blockly.Blocks.CocoRobo_bluebit_motor_off = {
  4870. init: function () {
  4871. this.jsonInit({
  4872. colour: CategoryColors.Bluebit,
  4873. args0: [{
  4874. type: "input_dummy"
  4875. }, {
  4876. name: "ain1",
  4877. check: "Number",
  4878. type: "input_value"
  4879. }, {
  4880. name: "ain2",
  4881. check: "Number",
  4882. type: "input_value"
  4883. }],
  4884. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_HELPURL,
  4885. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_TOOLTIP,
  4886. message0: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_MESSAGE0,
  4887. inputsInline: !0,
  4888. nextStatement: null,
  4889. previousStatement: null
  4890. })
  4891. }
  4892. };
  4893. Blockly.Blocks.CocoRobo_bluebit_get_motorpeed = {
  4894. init: function () {
  4895. this.jsonInit({
  4896. colour: CategoryColors.Bluebit,
  4897. args0: [{
  4898. name: "left_right_interface",
  4899. options: [
  4900. ["M1", "1"],
  4901. ["M2", "2"]
  4902. ],
  4903. type: "field_dropdown"
  4904. }],
  4905. inputsInline: !0,
  4906. output: "Number",
  4907. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_GET_MOTORPEED_HELPURL,
  4908. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_GET_MOTORPEED_TOOLTIP,
  4909. message0: Blockly.Msg.CocoRobo_BLUEBIT_GET_MOTORPEED_MESSAGE0
  4910. })
  4911. }
  4912. };
  4913. Blockly.Blocks.CocoRobo_m1m2_led_on = {
  4914. init: function () {
  4915. this.jsonInit({
  4916. inputsInline: !0,
  4917. nextStatement: null,
  4918. previousStatement: null,
  4919. colour: CategoryColors.Bluebit,
  4920. helpUrl: Blockly.Msg.CocoRobo_M1M2_LED_ON_HELPURL,
  4921. tooltip: Blockly.Msg.CocoRobo_M1M2_LED_ON_TOOLTIP,
  4922. message0: Blockly.Msg.CocoRobo_M1M2_LED_ON_MESSAGE0,
  4923. args0: [{
  4924. name: "m1m2",
  4925. options: [
  4926. ["M1", "1"],
  4927. ["M2", "2"]
  4928. ],
  4929. type: "field_dropdown"
  4930. }, {
  4931. check: "Number",
  4932. type: "input_value",
  4933. name: "brightness"
  4934. }]
  4935. })
  4936. }
  4937. };
  4938. Blockly.Blocks.CocoRobo_m1m2_led_off = {
  4939. init: function () {
  4940. this.jsonInit({
  4941. inputsInline: !0,
  4942. nextStatement: null,
  4943. previousStatement: null,
  4944. colour: CategoryColors.Bluebit,
  4945. helpUrl: Blockly.Msg.CocoRobo_M1M2_LED_OFF_HELPURL,
  4946. tooltip: Blockly.Msg.CocoRobo_M1M2_LED_OFF_TOOLTIP,
  4947. message0: Blockly.Msg.CocoRobo_M1M2_LED_OFF_MESSAGE0,
  4948. args0: [{
  4949. name: "m1m2",
  4950. options: [
  4951. ["M1", "1"],
  4952. ["M2", "2"]
  4953. ],
  4954. type: "field_dropdown"
  4955. }]
  4956. })
  4957. }
  4958. };
  4959. Blockly.Blocks.CocoRobo_bluebit_set_Fan = {
  4960. init: function () {
  4961. this.jsonInit({
  4962. colour: CategoryColors.Bluebit,
  4963. args0: [{
  4964. name: "left_right_interface",
  4965. options: [
  4966. ["M1", "1"],
  4967. ["M2", "2"]
  4968. ],
  4969. type: "field_dropdown"
  4970. }],
  4971. inputsInline: !0,
  4972. nextStatement: null,
  4973. previousStatement: null,
  4974. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_HELPURL,
  4975. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_TOOLTIP,
  4976. message0: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_MESSAGE0
  4977. })
  4978. }
  4979. };
  4980. Blockly.Blocks.CocoRobo_bluebit_set_Fan_off = {
  4981. init: function () {
  4982. this.jsonInit({
  4983. colour: CategoryColors.Bluebit,
  4984. args0: [{
  4985. name: "left_right_interface",
  4986. options: [
  4987. ["M1", "1"],
  4988. ["M2", "2"]
  4989. ],
  4990. type: "field_dropdown"
  4991. }],
  4992. inputsInline: !0,
  4993. nextStatement: null,
  4994. previousStatement: null,
  4995. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_OFF_HELPURL,
  4996. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_OFF_TOOLTIP,
  4997. message0: Blockly.Msg.CocoRobo_BLUEBIT_SET_FAN_OFF_MESSAGE0
  4998. })
  4999. }
  5000. };
  5001. Blockly.Blocks.CocoRobo_bluebit_4button = {
  5002. init: function () {
  5003. this.jsonInit({
  5004. colour: CategoryColors.Bluebit,
  5005. args0: [{
  5006. name: "pin",
  5007. check: "Number",
  5008. type: "input_value"
  5009. }, {
  5010. name: "button_val",
  5011. type: "field_dropdown",
  5012. options: [
  5013. [Blockly.Msg.BLUE, "'A'"],
  5014. [Blockly.Msg.GREEN, "'B'"],
  5015. [Blockly.Msg.RED, "'C'"],
  5016. [Blockly.Msg.YELLOW, "'D'"]
  5017. ]
  5018. }],
  5019. output: "Boolean",
  5020. message0: Blockly.Msg.CocoRobo_BLUEBIT_4BUTTON_MESSAGE0,
  5021. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_4BUTTON_TOOLTIP,
  5022. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_4BUTTON_HELPURL
  5023. })
  5024. }
  5025. };
  5026. Blockly.Blocks.CocoRobo_bluebit_joystick = {
  5027. init: function () {
  5028. this.jsonInit({
  5029. colour: CategoryColors.Bluebit,
  5030. args0: [{
  5031. name: "pin",
  5032. check: "Number",
  5033. type: "input_value"
  5034. }, {
  5035. name: "pin1",
  5036. check: "Number",
  5037. type: "input_value"
  5038. }, {
  5039. name: "axis",
  5040. type: "field_dropdown",
  5041. options: [
  5042. ["X", "X"],
  5043. ["Y", "Y"]
  5044. ]
  5045. }],
  5046. output: "Number",
  5047. message0: Blockly.Msg.CocoRobo_BLUEBIT_JOYSTICK_MESSAGE0,
  5048. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_JOYSTICK_TOOLTIP,
  5049. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_JOYSTICK_HELPURL
  5050. })
  5051. }
  5052. };
  5053. Blockly.Blocks.CocoRobo_bluebit_motor_on_i2c = {
  5054. init: function () {
  5055. this.jsonInit({
  5056. colour: CategoryColors.Bluebit,
  5057. args0: [{
  5058. name: "left_right_interface",
  5059. options: [
  5060. ["M1", "M1"],
  5061. ["M2", "M2"]
  5062. ],
  5063. type: "field_dropdown"
  5064. }, {
  5065. name: "status",
  5066. type: "field_dropdown",
  5067. options: [
  5068. [Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_CLOCKWISE, "CLOCKWISE"],
  5069. [Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_ANTICLOCKWISE, "ANTICLOCKWISE"]
  5070. ]
  5071. }, {
  5072. check: "Number",
  5073. type: "input_value",
  5074. name: "speed"
  5075. }],
  5076. inputsInline: !0,
  5077. nextStatement: null,
  5078. previousStatement: null,
  5079. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_I2C_HELPURL,
  5080. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_I2C_TOOLTIP,
  5081. message0: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_ON_I2C_MESSAGE0
  5082. })
  5083. }
  5084. };
  5085. Blockly.Blocks.CocoRobo_bluebit_motor_off_i2c = {
  5086. init: function () {
  5087. this.jsonInit({
  5088. colour: CategoryColors.Bluebit,
  5089. inputsInline: !0,
  5090. nextStatement: null,
  5091. previousStatement: null,
  5092. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_I2C_HELPURL,
  5093. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_I2C_TOOLTIP,
  5094. message0: Blockly.Msg.CocoRobo_BLUEBIT_MOTOR_OFF_I2C_MESSAGE0
  5095. })
  5096. }
  5097. };
  5098. Blockly.Blocks.CocoRobo_bluebit_coded_three_motor_on_i2c = {
  5099. init: function () {
  5100. this.jsonInit({
  5101. colour: CategoryColors.Bluebit,
  5102. args0: [{
  5103. name: "pattern",
  5104. options: [
  5105. ["pwm", "set_pwm"],
  5106. ["\u5de1\u822a", "set_cruise"],
  5107. ["\u5b9a\u4f4d", "set_position"]
  5108. ],
  5109. type: "field_dropdown"
  5110. }, {
  5111. name: "Dial_code",
  5112. options: [
  5113. ["0", "0X10"],
  5114. ["1", "0X11"],
  5115. ["2", "0X12"],
  5116. ["3", "0X13"]
  5117. ],
  5118. type: "field_dropdown"
  5119. }, {
  5120. check: "Number",
  5121. type: "input_value",
  5122. name: "speed1"
  5123. }, {
  5124. check: "Number",
  5125. type: "input_value",
  5126. name: "speed2"
  5127. }],
  5128. inputsInline: !0,
  5129. nextStatement: null,
  5130. previousStatement: null,
  5131. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_CODED_THREE_MOTOR_ON_I2C_HELPURL,
  5132. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_CODED_THREE_MOTOR_ON_I2C_TOOLTIP,
  5133. message0: Blockly.Msg.CocoRobo_BLUEBIT_CODED_THREE_MOTOR_ON_I2C_MESSAGE0
  5134. })
  5135. }
  5136. };
  5137. Blockly.Blocks.CocoRobo_bluebit_coded_stop_motor_on_i2c = {
  5138. init: function () {
  5139. this.jsonInit({
  5140. inputsInline: !0,
  5141. nextStatement: null,
  5142. previousStatement: null,
  5143. colour: CategoryColors.Bluebit,
  5144. helpUrl: Blockly.Msg.CocoRobo_BLUEBIT_CODED_STOP_MOTOR_ON_I2C_HELPURL,
  5145. tooltip: Blockly.Msg.CocoRobo_BLUEBIT_CODED_STOP_MOTOR_ON_I2C_TOOLTIP,
  5146. message0: Blockly.Msg.CocoRobo_BLUEBIT_CODED_STOP_MOTOR_ON_I2C_MESSAGE0,
  5147. args0: [{
  5148. name: "coded_stop",
  5149. type: "field_dropdown",
  5150. options: [
  5151. ["0", "0X10"],
  5152. ["1", "0X11"],
  5153. ["2", "0X12"],
  5154. ["3", "0X13"]
  5155. ]
  5156. }]
  5157. })
  5158. }
  5159. };
  5160. Blockly.Blocks.CocoRobo_init_bluetooth = {
  5161. init: function () {
  5162. this.jsonInit({
  5163. inputsInline: !0,
  5164. nextStatement: null,
  5165. previousStatement: null,
  5166. colour: bluetooth_color,
  5167. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5168. tooltip: Blockly.Msg.CocoRobo_init_bluetooth_TOOLTIP,
  5169. message0: Blockly.Msg.CocoRobo_init_bluetooth_MESSAGE0,
  5170. args0: [{
  5171. check: "String",
  5172. type: "input_value",
  5173. name: "init_bluetooth"
  5174. }]
  5175. })
  5176. }
  5177. };
  5178. Blockly.Blocks.CocoRobo_OnOff_bluetooth = {
  5179. init: function () {
  5180. this.jsonInit({
  5181. inputsInline: !0,
  5182. nextStatement: null,
  5183. previousStatement: null,
  5184. colour: bluetooth_color,
  5185. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5186. tooltip: Blockly.Msg.CocoRobo_OnOff_bluetooth_TOOLTIP,
  5187. message0: Blockly.Msg.CocoRobo_OnOff_bluetooth_MESSAGE0,
  5188. args0: [{
  5189. name: "OnOff_bluetooth",
  5190. type: "field_dropdown",
  5191. options: [
  5192. ["\u5f00\u542f", "start"],
  5193. ["\u5173\u95ed", "stop"]
  5194. ]
  5195. }]
  5196. })
  5197. }
  5198. };
  5199. Blockly.Blocks.CocoRobo_HID_consumer_bluetooth = {
  5200. init: function () {
  5201. this.jsonInit({
  5202. inputsInline: !0,
  5203. nextStatement: null,
  5204. previousStatement: null,
  5205. colour: bluetooth_color,
  5206. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5207. tooltip: Blockly.Msg.CocoRobo_HID_consumer_bluetooth_TOOLTIP,
  5208. message0: Blockly.Msg.CocoRobo_HID_consumer_bluetooth_MESSAGE0,
  5209. args0: [{
  5210. options: [
  5211. ["Power", "ble.HID_CONSUMER_POWER"],
  5212. ["Reset", "ble.HID_CONSUMER_RESET"],
  5213. ["Sleep", "ble.HID_CONSUMER_SLEEP"],
  5214. ["Menu", "ble.HID_CONSUMER_MENU"],
  5215. ["Selection", "ble.HID_CONSUMER_SELECTION"],
  5216. ["Assign Selection", "ble.HID_CONSUMER_ASSIGN_SEL"],
  5217. ["Mode Step", "ble.HID_CONSUMER_MODE_STEP"],
  5218. ["Recall Last", "ble.HID_CONSUMER_RECALL_LAST"],
  5219. ["Quit", "ble.HID_CONSUMER_QUIT"],
  5220. ["Help", "ble.HID_CONSUMER_HELP"],
  5221. ["Channel Increment", "ble.HID_CONSUMER_CHANNEL_UP"],
  5222. ["Channel Decrement", "ble.HID_CONSUMER_CHANNEL_DOWN"],
  5223. ["Play", "ble.HID_CONSUMER_PLAY"],
  5224. ["Pause", "ble.HID_CONSUMER_PAUSE"],
  5225. ["Record", "ble.HID_CONSUMER_RECORD"],
  5226. ["Fast Forward", "ble.HID_CONSUMER_FAST_FORWARD"],
  5227. ["Rewind", "ble.HID_CONSUMER_REWIND"],
  5228. ["Scan Next Track", "ble.HID_CONSUMER_SCAN_NEXT_TRK"],
  5229. ["Scan Previous Track", "ble.HID_CONSUMER_SCAN_PREV_TRK"],
  5230. ["Stop", "ble.HID_CONSUMER_STOP"],
  5231. ["Eject", "ble.HID_CONSUMER_EJECT"],
  5232. ["Random Play", "ble.HID_CONSUMER_RANDOM_PLAY"],
  5233. ["Select Disk", "ble.HID_CONSUMER_SELECT_DISC"],
  5234. ["Enter Disc", "ble.HID_CONSUMER_ENTER_DISC"],
  5235. ["Repeat", "ble.HID_CONSUMER_REPEAT"],
  5236. ["Volume", "ble.HID_CONSUMER_VOLUME"],
  5237. ["Balance", "ble.HID_CONSUMER_BALANCE"],
  5238. ["Mute", "ble.HID_CONSUMER_MUTE"],
  5239. ["Bass", "ble.HID_CONSUMER_BASS"],
  5240. ["Volume Increment", "ble.HID_CONSUMER_VOLUME_UP"],
  5241. ["Volume Decrement", "ble.HID_CONSUMER_VOLUME_DOWN"]
  5242. ],
  5243. type: "field_dropdown",
  5244. name: "type"
  5245. }, {
  5246. options: [
  5247. ["\u5f00\u542f", "True"],
  5248. ["\u5173\u95ed", "False"]
  5249. ],
  5250. type: "field_dropdown",
  5251. name: "status_bar"
  5252. }]
  5253. })
  5254. }
  5255. };
  5256. Blockly.Blocks.CocoRobo_HID_keyboard_bluetooth = {
  5257. init: function () {
  5258. this.jsonInit({
  5259. inputsInline: !0,
  5260. nextStatement: null,
  5261. previousStatement: null,
  5262. colour: bluetooth_color,
  5263. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5264. tooltip: Blockly.Msg.CocoRobo_HID_keyboard_bluetooth_TOOLTIP,
  5265. message0: Blockly.Msg.CocoRobo_HID_keyboard_bluetooth_MESSAGE0,
  5266. args0: [{
  5267. name: "HID_keyboard_bluetooth",
  5268. type: "field_dropdown",
  5269. options: [
  5270. ["A", "ble.HID_KEY_A"],
  5271. ["B", "ble.HID_KEY_B"],
  5272. ["C", "ble.HID_KEY_C"],
  5273. ["D", "ble.HID_KEY_D"],
  5274. ["E", "ble.HID_KEY_E"],
  5275. ["F", "ble.HID_KEY_F"],
  5276. ["G", "ble.HID_KEY_G"],
  5277. ["H", "ble.HID_KEY_H"],
  5278. ["I", "ble.HID_KEY_I"],
  5279. ["J", "ble.HID_KEY_J"],
  5280. ["K", "ble.HID_KEY_K"],
  5281. ["L", "ble.HID_KEY_L"],
  5282. ["M", "ble.HID_KEY_M"],
  5283. ["N", "ble.HID_KEY_N"],
  5284. ["O", "ble.HID_KEY_O"],
  5285. ["P", "ble.HID_KEY_P"],
  5286. ["Q", "ble.HID_KEY_Q"],
  5287. ["R", "ble.HID_KEY_R"],
  5288. ["S", "ble.HID_KEY_S"],
  5289. ["T", "ble.HID_KEY_T"],
  5290. ["U", "ble.HID_KEY_U"],
  5291. ["V", "ble.HID_KEY_V"],
  5292. ["W", "ble.HID_KEY_W"],
  5293. ["X", "ble.HID_KEY_X"],
  5294. ["Y", "ble.HID_KEY_Y"],
  5295. ["Z", "ble.HID_KEY_Z"],
  5296. ["1", "ble.HID_KEY_1"],
  5297. ["2", "ble.HID_KEY_2"],
  5298. ["3", "ble.HID_KEY_3"],
  5299. ["4", "ble.HID_KEY_4"],
  5300. ["5", "ble.HID_KEY_5"],
  5301. ["6", "ble.HID_KEY_6"],
  5302. ["7", "ble.HID_KEY_7"],
  5303. ["8", "ble.HID_KEY_8"],
  5304. ["9", "ble.HID_KEY_9"],
  5305. ["0", "ble.HID_KEY_0"],
  5306. ["Return", "ble.HID_KEY_RETURN"],
  5307. ["ESCAPE", "ble.HID_KEY_ESCAPE"],
  5308. ["DELETE", "ble.HID_KEY_DELETE"],
  5309. ["Tab", "ble.HID_KEY_TAB"],
  5310. ["Spacebar", "ble.HID_KEY_SPACEBAR"],
  5311. ["- and (underscore)", "ble.HID_KEY_MINUS"],
  5312. ["\x3d and +", "ble.HID_KEY_EQUAL"],
  5313. ["[ and {", "ble.HID_KEY_LEFT_BRKT"],
  5314. [" ] and }", "ble.HID_KEY_RIGHT_BRKT"],
  5315. ["and |", "ble.HID_KEY_BACK_SLASH"],
  5316. ["; and :", "ble.HID_KEY_SEMI_COLON"],
  5317. ["\u2018\u2019 and \u201c\u201d", "ble.HID_KEY_SGL_QUOTE"],
  5318. ["Grave Accent and Tilde", "ble.HID_KEY_GRV_ACCENT"],
  5319. [", and \x3c", "ble.HID_KEY_COMMA"],
  5320. [". and \x3e", "ble.HID_KEY_DOT"],
  5321. ["/ and ?", "ble.HID_KEY_FWD_SLASH"],
  5322. ["/ and ?", "ble.HID_KEY_CAPS_LOCK"],
  5323. ["F1", "ble.HID_KEY_F1"],
  5324. ["F2", "ble.HID_KEY_F2"],
  5325. ["F3", "ble.HID_KEY_F3"],
  5326. ["F4", "ble.HID_KEY_F4"],
  5327. ["F5", "ble.HID_KEY_F5"],
  5328. ["F6", "ble.HID_KEY_F6"],
  5329. ["F7", "ble.HID_KEY_F7"],
  5330. ["F8", "ble.HID_KEY_F8"],
  5331. ["F9", "ble.HID_KEY_F9"],
  5332. ["F10", "ble.HID_KEY_F10"],
  5333. ["F11", "ble.HID_KEY_F11"],
  5334. ["F12", "ble.HID_KEY_F12"],
  5335. ["Print Screen", "ble.HID_KEY_PRNT_SCREEN"],
  5336. ["Scroll Lock", "ble.HID_KEY_SCROLL_LOCK"],
  5337. ["Pause", "ble.HID_KEY_PAUSE"],
  5338. ["Insert", "ble.HID_KEY_INSERT"],
  5339. ["Home", "ble.HID_KEY_HOME"],
  5340. ["PageUp", "ble.HID_KEY_PAGE_UP"],
  5341. ["Delete Forward", "ble.HID_KEY_DELETE_FWD"],
  5342. ["End", "ble.HID_KEY_END"],
  5343. ["PageDown", "ble.HID_KEY_PAGE_DOWN"],
  5344. ["RightArrow", "ble.HID_KEY_RIGHT_ARROW"],
  5345. ["LeftArrow", "ble.HID_KEY_LEFT_ARROW"],
  5346. ["DownArrow", "ble.HID_KEY_DOWN_ARROW"],
  5347. ["UpArrow", "ble.HID_KEY_UP_ARROW"],
  5348. ["Num Lock and Clear", "ble.HID_KEY_NUM_LOCK"],
  5349. [" /", "ble.HID_KEY_DIVIDE"],
  5350. [" *", "ble.HID_KEY_MULTIPLY"],
  5351. [" -", "ble.HID_KEY_SUBTRACT"],
  5352. [" +-", "ble.HID_KEY_ADD"],
  5353. [" ENTER", "ble.HID_KEY_ENTER"],
  5354. [" 1 and End", "ble.HID_KEYPAD_1"],
  5355. [" 2 and Down Arrow", "ble.HID_KEYPAD_2"],
  5356. [" 3 and PageDn", "ble.HID_KEYPAD_3"],
  5357. [" 4 and Lfet Arrow", "ble.HID_KEYPAD_4"],
  5358. [" 5", "ble.HID_KEYPAD_5"],
  5359. [" 6 and Right Arrow", "ble.HID_KEYPAD_6"],
  5360. [" 7 and Home", "ble.HID_KEYPAD_7"],
  5361. [" 8 and Up Arrow", "ble.HID_KEYPAD_8"],
  5362. [" 9 and PageUp", "ble.HID_KEYPAD_9"],
  5363. [" 0 and Insert", "ble.HID_KEYPAD_0"],
  5364. [" . and Delete", "ble.HID_KEYPAD_DOT"],
  5365. [" Mute", "ble.HID_KEY_MUTE"],
  5366. [" Volume up", "ble.HID_KEY_VOLUME_UP"],
  5367. [" Volume down", "ble.HID_KEY_VOLUME_DOWN"]
  5368. ]
  5369. }]
  5370. })
  5371. }
  5372. };
  5373. Blockly.Blocks.CocoRobo_HID_release_keyboard_bluetooth = {
  5374. init: function () {
  5375. this.jsonInit({
  5376. inputsInline: !0,
  5377. nextStatement: null,
  5378. previousStatement: null,
  5379. colour: bluetooth_color,
  5380. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5381. tooltip: Blockly.Msg.CocoRobo_HID_release_keyboard_bluetooth_TOOLTIP,
  5382. message0: Blockly.Msg.CocoRobo_HID_release_keyboard_bluetooth_MESSAGE0,
  5383. args0: [{
  5384. name: "HID_release_keyboard",
  5385. type: "field_dropdown"
  5386. }]
  5387. })
  5388. }
  5389. };
  5390. Blockly.Blocks.CocoRobo_HID_mouse_bluetooth = {
  5391. init: function () {
  5392. this.jsonInit({
  5393. inputsInline: !0,
  5394. nextStatement: null,
  5395. previousStatement: null,
  5396. colour: bluetooth_color,
  5397. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5398. tooltip: Blockly.Msg.CocoRobo_HID_mouse_bluetooth_TOOLTIP,
  5399. message0: Blockly.Msg.CocoRobo_HID_mouse_bluetooth_MESSAGE0,
  5400. args0: [{
  5401. name: "HID_mouse",
  5402. type: "field_dropdown",
  5403. options: [
  5404. ["\u5de6\u952e", "ble.HID_MOUSE_LEFT"],
  5405. ["\u53f3\u952e", "ble.HID_MOUSE_RIGHT"],
  5406. ["\u6eda\u8f6e\u6309\u4e0b", "ble.HID_MOUSE_MIDDLE"]
  5407. ]
  5408. }]
  5409. })
  5410. }
  5411. };
  5412. Blockly.Blocks.CocoRobo_HID_release_mouse_bluetooth = {
  5413. init: function () {
  5414. this.jsonInit({
  5415. inputsInline: !0,
  5416. nextStatement: null,
  5417. previousStatement: null,
  5418. colour: bluetooth_color,
  5419. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5420. tooltip: Blockly.Msg.CocoRobo_HID_release_mouse_bluetooth_TOOLTIP,
  5421. message0: Blockly.Msg.CocoRobo_HID_release_mouse_bluetooth_MESSAGE0,
  5422. args0: [{
  5423. name: "HID_release_mouse",
  5424. type: "field_dropdown"
  5425. }]
  5426. })
  5427. }
  5428. };
  5429. Blockly.Blocks.CocoRobo_HID_mouse_pointer_bluetooth = {
  5430. init: function () {
  5431. this.jsonInit({
  5432. inputsInline: !0,
  5433. nextStatement: null,
  5434. previousStatement: null,
  5435. colour: bluetooth_color,
  5436. helpUrl: Blockly.Msg.CocoRobo_HID_mouse_pointer_bluetooth_HELPURL,
  5437. tooltip: Blockly.Msg.CocoRobo_HID_mouse_pointer_bluetooth_TOOLTIP,
  5438. message0: Blockly.Msg.CocoRobo_HID_mouse_pointer_bluetooth_MESSAGE0,
  5439. args0: [{
  5440. check: "Number",
  5441. type: "input_value",
  5442. name: "column"
  5443. }, {
  5444. check: "Number",
  5445. type: "input_value",
  5446. name: "row"
  5447. }]
  5448. })
  5449. }
  5450. };
  5451. Blockly.Blocks.CocoRobo_HID_keyboard_group_bluetooth = {
  5452. init: function () {
  5453. this.jsonInit({
  5454. inputsInline: !0,
  5455. nextStatement: null,
  5456. previousStatement: null,
  5457. colour: bluetooth_color,
  5458. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5459. tooltip: Blockly.Msg.CocoRobo_HID_keyboard_group_bluetooth_TOOLTIP,
  5460. message0: Blockly.Msg.CocoRobo_HID_keyboard_group_bluetooth_MESSAGE0,
  5461. args0: [{
  5462. name: "HID_keyboard_bluetooth",
  5463. type: "field_dropdown",
  5464. options: [
  5465. ["A", "ble.HID_KEY_A"],
  5466. ["B", "ble.HID_KEY_B"],
  5467. ["C", "ble.HID_KEY_C"],
  5468. ["D", "ble.HID_KEY_D"],
  5469. ["E", "ble.HID_KEY_E"],
  5470. ["F", "ble.HID_KEY_F"],
  5471. ["G", "ble.HID_KEY_G"],
  5472. ["H", "ble.HID_KEY_H"],
  5473. ["I", "ble.HID_KEY_I"],
  5474. ["J", "ble.HID_KEY_J"],
  5475. ["K", "ble.HID_KEY_K"],
  5476. ["L", "ble.HID_KEY_L"],
  5477. ["M", "ble.HID_KEY_M"],
  5478. ["N", "ble.HID_KEY_N"],
  5479. ["O", "ble.HID_KEY_O"],
  5480. ["P", "ble.HID_KEY_P"],
  5481. ["Q", "ble.HID_KEY_Q"],
  5482. ["R", "ble.HID_KEY_R"],
  5483. ["S", "ble.HID_KEY_S"],
  5484. ["T", "ble.HID_KEY_T"],
  5485. ["U", "ble.HID_KEY_U"],
  5486. ["V", "ble.HID_KEY_V"],
  5487. ["W", "ble.HID_KEY_W"],
  5488. ["X", "ble.HID_KEY_X"],
  5489. ["Y", "ble.HID_KEY_Y"],
  5490. ["Z", "ble.HID_KEY_Z"],
  5491. ["1", "ble.HID_KEY_1"],
  5492. ["2", "ble.HID_KEY_2"],
  5493. ["3", "ble.HID_KEY_3"],
  5494. ["4", "ble.HID_KEY_4"],
  5495. ["5", "ble.HID_KEY_5"],
  5496. ["6", "ble.HID_KEY_6"],
  5497. ["7", "ble.HID_KEY_7"],
  5498. ["8", "ble.HID_KEY_8"],
  5499. ["9", "ble.HID_KEY_9"],
  5500. ["0", "ble.HID_KEY_0"],
  5501. ["Return", "ble.HID_KEY_RETURN"],
  5502. ["ESCAPE", "ble.HID_KEY_ESCAPE"],
  5503. ["DELETE", "ble.HID_KEY_DELETE"],
  5504. ["Tab", "ble.HID_KEY_TAB"],
  5505. ["Spacebar", "ble.HID_KEY_SPACEBAR"],
  5506. ["- and (underscore)", "ble.HID_KEY_MINUS"],
  5507. ["\x3d and +", "ble.HID_KEY_EQUAL"],
  5508. ["[ and {", "ble.HID_KEY_LEFT_BRKT"],
  5509. [" ] and }", "ble.HID_KEY_RIGHT_BRKT"],
  5510. ["and |", "ble.HID_KEY_BACK_SLASH"],
  5511. ["; and :", "ble.HID_KEY_SEMI_COLON"],
  5512. ["\u2018\u2019 and \u201c\u201d", "ble.HID_KEY_SGL_QUOTE"],
  5513. ["Grave Accent and Tilde", "ble.HID_KEY_GRV_ACCENT"],
  5514. [", and \x3c", "ble.HID_KEY_COMMA"],
  5515. [". and \x3e", "ble.HID_KEY_DOT"],
  5516. ["/ and ?", "ble.HID_KEY_FWD_SLASH"],
  5517. ["/ and ?", "ble.HID_KEY_CAPS_LOCK"],
  5518. ["F1", "ble.HID_KEY_F1"],
  5519. ["F2", "ble.HID_KEY_F2"],
  5520. ["F3", "ble.HID_KEY_F3"],
  5521. ["F4", "ble.HID_KEY_F4"],
  5522. ["F5", "ble.HID_KEY_F5"],
  5523. ["F6", "ble.HID_KEY_F6"],
  5524. ["F7", "ble.HID_KEY_F7"],
  5525. ["F8", "ble.HID_KEY_F8"],
  5526. ["F9", "ble.HID_KEY_F9"],
  5527. ["F10", "ble.HID_KEY_F10"],
  5528. ["F11", "ble.HID_KEY_F11"],
  5529. ["F12", "ble.HID_KEY_F12"],
  5530. ["Print Screen", "ble.HID_KEY_PRNT_SCREEN"],
  5531. ["Scroll Lock", "ble.HID_KEY_SCROLL_LOCK"],
  5532. ["Pause", "ble.HID_KEY_PAUSE"],
  5533. ["Insert", "ble.HID_KEY_INSERT"],
  5534. ["Home", "ble.HID_KEY_HOME"],
  5535. ["PageUp", "ble.HID_KEY_PAGE_UP"],
  5536. ["Delete Forward", "ble.HID_KEY_DELETE_FWD"],
  5537. ["End", "ble.HID_KEY_END"],
  5538. ["PageDown", "ble.HID_KEY_PAGE_DOWN"],
  5539. ["RightArrow", "ble.HID_KEY_RIGHT_ARROW"],
  5540. ["LeftArrow", "ble.HID_KEY_LEFT_ARROW"],
  5541. ["DownArrow", "ble.HID_KEY_DOWN_ARROW"],
  5542. ["UpArrow", "ble.HID_KEY_UP_ARROW"],
  5543. ["Num Lock and Clear", "ble.HID_KEY_NUM_LOCK"],
  5544. [" /", "ble.HID_KEY_DIVIDE"],
  5545. [" *", "ble.HID_KEY_MULTIPLY"],
  5546. [" -", "ble.HID_KEY_SUBTRACT"],
  5547. [" +-", "ble.HID_KEY_ADD"],
  5548. [" ENTER", "ble.HID_KEY_ENTER"],
  5549. [" 1 and End", "ble.HID_KEYPAD_1"],
  5550. [" 2 and Down Arrow", "ble.HID_KEYPAD_2"],
  5551. [" 3 and PageDn", "ble.HID_KEYPAD_3"],
  5552. [" 4 and Lfet Arrow", "ble.HID_KEYPAD_4"],
  5553. [" 5", "ble.HID_KEYPAD_5"],
  5554. [" 6 and Right Arrow", "ble.HID_KEYPAD_6"],
  5555. [" 7 and Home", "ble.HID_KEYPAD_7"],
  5556. [" 8 and Up Arrow", "ble.HID_KEYPAD_8"],
  5557. [" 9 and PageUp", "ble.HID_KEYPAD_9"],
  5558. [" 0 and Insert", "ble.HID_KEYPAD_0"],
  5559. [" . and Delete", "ble.HID_KEYPAD_DOT"],
  5560. [" Mute", "ble.HID_KEY_MUTE"],
  5561. [" Volume up", "ble.HID_KEY_VOLUME_UP"],
  5562. [" Volume down", "ble.HID_KEY_VOLUME_DOWN"]
  5563. ]
  5564. }, {
  5565. type: "input_value",
  5566. name: "group"
  5567. }]
  5568. })
  5569. }
  5570. };
  5571. Blockly.Blocks.CocoRobo_HID_keyboard_part_bluetooth = {
  5572. init: function () {
  5573. this.jsonInit({
  5574. inputsInline: !0,
  5575. output: null,
  5576. colour: bluetooth_color,
  5577. helpUrl: Blockly.Msg.CocoRobo_HID_keyboard_part_bluetooth_HELPURL,
  5578. tooltip: Blockly.Msg.CocoRobo_HID_keyboard_part_bluetooth_TOOLTIP,
  5579. message0: Blockly.Msg.CocoRobo_HID_keyboard_part_bluetooth_MESSAGE0,
  5580. args0: [{
  5581. type: "field_dropdown",
  5582. name: "HID_keyboard_group",
  5583. options: [
  5584. ["L_CTRL", "ble.KEY_MASK_L_CTRL"],
  5585. ["L_SHIFT", "ble.KEY_MASK_L_SHIFT"],
  5586. ["L_ALT", "ble.KEY_MASK_L_ALT"],
  5587. ["L_GUI", "ble.KEY_MASK_L_GUI"],
  5588. ["R_CTRL", "ble.KEY_MASK_R_CTRL "],
  5589. ["R_SHIFT", "ble.KEY_MASK_R_SHIFT"],
  5590. ["R_ALT", "ble.KEY_MASK_R_ALT"],
  5591. ["R_GUI", "ble.KEY_MASK_R_GUI"]
  5592. ]
  5593. }]
  5594. })
  5595. }
  5596. };
  5597. Blockly.Blocks.dict_create_with = {
  5598. init: function () {
  5599. this.jsonInit({
  5600. inputsInline: !0,
  5601. nextStatement: null,
  5602. previousStatement: null,
  5603. colour: CategoryColors.Dictionary,
  5604. helpUrl: Blockly.Msg.DICT_CREATE_WITH_HELPURL,
  5605. tooltip: Blockly.Msg.DICT_CREATE_WITH_TOOLTIP,
  5606. message0: Blockly.Msg.DICT_CREATE_WITH_MESSAGE0,
  5607. args0: [{
  5608. type: "input_value",
  5609. name: "dict_name"
  5610. }, {
  5611. type: "input_value",
  5612. name: "dict_items"
  5613. }]
  5614. })
  5615. }
  5616. };
  5617. Blockly.Blocks.dict_create_with_items_insert = {
  5618. init: function () {
  5619. this.setColour(CategoryColors.Dictionary);
  5620. this.appendDummyInput("").appendField(new Blockly.FieldLabel(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH), "TIP");
  5621. this.itemCount_ = 3;
  5622. this.updateShape_();
  5623. this.setOutput(!0);
  5624. this.setMutator(new Blockly.Mutator(["dict_create_with_item"]));
  5625. this.setTooltip(Blockly.Msg.DICT_CREATE_WITH_ITEMS_INSERT_TOOLTIP)
  5626. },
  5627. mutationToDom: function () {
  5628. var a = document.createElement("mutation");
  5629. a.setAttribute("items", this.itemCount_);
  5630. return a
  5631. },
  5632. domToMutation: function (a) {
  5633. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  5634. this.updateShape_()
  5635. },
  5636. decompose: function (a) {
  5637. var b = a.newBlock("dict_create_with_container");
  5638. b.initSvg();
  5639. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  5640. var d = a.newBlock("dict_create_with_item");
  5641. d.initSvg();
  5642. c.connect(d.previousConnection);
  5643. c = d.nextConnection
  5644. }
  5645. return b
  5646. },
  5647. compose: function (a) {
  5648. a = a.getInputTargetBlock("STACK");
  5649. for (var b = [], c = 0; a;)
  5650. b[c] = a.valueConnection_,
  5651. a = a.nextConnection && a.nextConnection.targetBlock(),
  5652. c++;
  5653. this.itemCount_ = c;
  5654. this.updateShape_();
  5655. for (c = 0; c < this.itemCount_; c++)
  5656. b[c] && this.getInput("ADD" + c).connection.connect(b[c])
  5657. },
  5658. saveConnections: function (a) {
  5659. a = a.getInputTargetBlock("STACK");
  5660. for (var b = 0; a;) {
  5661. var c = this.getInput("ADD" + b);
  5662. a.valueConnection_ = c && c.connection.targetConnection;
  5663. b++;
  5664. a = a.nextConnection && a.nextConnection.targetBlock()
  5665. }
  5666. },
  5667. updateShape_: function () {
  5668. this.getInput("EMPTY") && this.removeInput("EMPTY");
  5669. for (var a = [], b = 0; this.getInput("ADD" + b); b++)
  5670. a.push(this.getFieldValue("KEY" + b)),
  5671. this.removeInput("ADD" + b);
  5672. if (0 == this.itemCount_)
  5673. this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_EMPTY_TITLE);
  5674. else
  5675. for (this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH),
  5676. b = 0; b < this.itemCount_; b++)
  5677. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput(a.length > b ? a[b] : 0 == b ? "key_0" : "key_" + b), "KEY" + b).appendField(":")
  5678. },
  5679. getVars: function () {
  5680. return [this.getFieldValue("VAR")]
  5681. },
  5682. renameVar: function (a, b) {
  5683. Blockly.Names.equals(a, this.getFieldValue("VAR")) && this.setTitleValue(b, "VAR")
  5684. }
  5685. };
  5686. Blockly.Blocks.dict_create_with_item = {
  5687. init: function () {
  5688. this.setColour(CategoryColors.Dictionary);
  5689. this.appendDummyInput().appendField(Blockly.Msg.DICT_CREATE_WITH_ITEM_TITLE);
  5690. this.setPreviousStatement(!0);
  5691. this.setNextStatement(!0);
  5692. this.setTooltip(Blockly.Msg.DICT_CREATE_WITH_ITEM_TOOLTIP);
  5693. this.contextMenu = !1
  5694. }
  5695. };
  5696. Blockly.Blocks.dict_create_with_container = {
  5697. init: function () {
  5698. this.setColour(CategoryColors.Dictionary);
  5699. this.appendDummyInput().appendField(Blockly.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD);
  5700. this.appendStatementInput("STACK");
  5701. this.setTooltip(Blockly.Msg.DICT_CREATE_WITH_CONTAINER_TOOLTIP);
  5702. this.contextMenu = !1
  5703. }
  5704. };
  5705. Blockly.Blocks.dict_key_value = {
  5706. init: function () {
  5707. this.jsonInit({
  5708. colour: CategoryColors.Dictionary,
  5709. args0: [{
  5710. type: "input_value",
  5711. name: "dict_name"
  5712. }, {
  5713. type: "input_value",
  5714. name: "dict_items"
  5715. }],
  5716. output: ["String", "Number", "Boolean", "Array"],
  5717. inputsInline: !0,
  5718. helpUrl: Blockly.Msg.DICT_KEY_VALUE_HELPURL,
  5719. tooltip: Blockly.Msg.DICT_KEY_VALUE_TOOLTIP,
  5720. message0: Blockly.Msg.DICT_KEY_VALUE_MESSAGE0
  5721. })
  5722. }
  5723. };
  5724. Blockly.Blocks.add_dict_key_value = {
  5725. init: function () {
  5726. this.jsonInit({
  5727. colour: CategoryColors.Dictionary,
  5728. args0: [{
  5729. type: "input_value",
  5730. name: "dict_name"
  5731. }, {
  5732. type: "input_value",
  5733. name: "dict_items"
  5734. }, {
  5735. type: "input_value",
  5736. name: "add_value"
  5737. }],
  5738. inputsInline: !0,
  5739. nextStatement: null,
  5740. previousStatement: null,
  5741. helpUrl: Blockly.Msg.ADD_DICT_KEY_VALUE_HELPURL,
  5742. tooltip: Blockly.Msg.ADD_DICT_KEY_VALUE_TOOLTIP,
  5743. message0: Blockly.Msg.ADD_DICT_KEY_VALUE_MESSAGE0
  5744. })
  5745. }
  5746. };
  5747. Blockly.Blocks.dict_length = {
  5748. init: function () {
  5749. this.jsonInit({
  5750. colour: CategoryColors.Dictionary,
  5751. args0: [{
  5752. type: "input_value",
  5753. name: "dict_name"
  5754. }],
  5755. output: "Number",
  5756. inputsInline: !0,
  5757. helpUrl: Blockly.Msg.DICT_LENGTH_HELPURL,
  5758. tooltip: Blockly.Msg.DICT_LENGTH_TOOLTIP,
  5759. message0: Blockly.Msg.DICT_LENGTH_MESSAGE0
  5760. })
  5761. }
  5762. };
  5763. Blockly.Blocks.dict_key_exist = {
  5764. init: function () {
  5765. this.jsonInit({
  5766. colour: CategoryColors.Dictionary,
  5767. args0: [{
  5768. type: "input_value",
  5769. name: "dict_name"
  5770. }, {
  5771. type: "input_value",
  5772. name: "dict_items"
  5773. }],
  5774. output: "Boolean",
  5775. inputsInline: !0,
  5776. helpUrl: Blockly.Msg.DICT_KEY_EXIST_HELPURL,
  5777. tooltip: Blockly.Msg.DICT_KEY_EXIST_TOOLTIP,
  5778. message0: Blockly.Msg.DICT_KEY_EXIST_MESSAGE0
  5779. })
  5780. }
  5781. };
  5782. Blockly.Blocks.dict_key_or_val_list = {
  5783. init: function () {
  5784. this.jsonInit({
  5785. colour: CategoryColors.Dictionary,
  5786. args0: [{
  5787. type: "input_value",
  5788. name: "dict_name"
  5789. }, {
  5790. options: [
  5791. [Blockly.Msg.DICT_KEYS, "keys"],
  5792. [Blockly.Msg.DICT_VALUES, "values"]
  5793. ],
  5794. type: "field_dropdown",
  5795. name: "key_or_val"
  5796. }],
  5797. output: "Array",
  5798. inputsInline: !0,
  5799. helpUrl: Blockly.Msg.DICT_KEY_OR_VAL_LIST_HELPURL,
  5800. // tooltip: Blockly.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP,
  5801. message0: Blockly.Msg.DICT_KEY_OR_VAL_LIST_MESSAGE0
  5802. });
  5803. var thisBlock = this;
  5804. this.setTooltip(function () {
  5805. var mode = thisBlock.getFieldValue('key_or_val');
  5806. var TOOLTIPS = {
  5807. 'keys': Blockly.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP.replace('%2', Blockly.Msg.DICT_KEYS),
  5808. 'values': Blockly.Msg.DICT_KEY_OR_VAL_LIST_TOOLTIP.replace('%2', Blockly.Msg.DICT_VALUES)
  5809. };
  5810. return TOOLTIPS[mode];
  5811. });
  5812. }
  5813. };
  5814. Blockly.Blocks.CocoRobo_input = {
  5815. init: function () {
  5816. this.jsonInit({
  5817. output: "Number",
  5818. colour: CategoryColors.Text,
  5819. helpUrl: Blockly.Msg.CocoRobo_INPUT_HELPURL,
  5820. tooltip: Blockly.Msg.CocoRobo_INPUT_TOOLTIP,
  5821. message0: Blockly.Msg.CocoRobo_INPUT_MESSAGE0,
  5822. args0: [{
  5823. check: "String",
  5824. type: "input_value",
  5825. name: "imports"
  5826. }]
  5827. })
  5828. }
  5829. };
  5830. Blockly.Blocks.file_to_list = {
  5831. init: function () {
  5832. this.jsonInit({
  5833. colour: CategoryColors.File,
  5834. args0: [{
  5835. type: "input_value",
  5836. name: "file_path"
  5837. }, {
  5838. options: [
  5839. [Blockly.Msg.CocoRobo_ENTER, "ENTER"],
  5840. [Blockly.Msg.CocoRobo_COMMA, ","],
  5841. [Blockly.Msg.CocoRobo_SEMICOLON, ";"],
  5842. [Blockly.Msg.CocoRobo_SPACE, " "]
  5843. ],
  5844. type: "field_dropdown",
  5845. name: "separator"
  5846. }],
  5847. output: "Array",
  5848. inputsInline: !0,
  5849. helpUrl: Blockly.Msg.FILE_TO_LIST_HELPURL,
  5850. tooltip: Blockly.Msg.FILE_TO_LIST_TOOLTIP,
  5851. message0: Blockly.Msg.FILE_TO_LIST_MESSAGE0
  5852. })
  5853. }
  5854. };
  5855. Blockly.Blocks.file_to_bin = {
  5856. init: function () {
  5857. this.jsonInit({
  5858. colour: CategoryColors.File,
  5859. args0: [{
  5860. type: "input_value",
  5861. name: "file_path"
  5862. }],
  5863. output: "Array",
  5864. inputsInline: !0,
  5865. helpUrl: Blockly.Msg.FILE_TO_BIN_HELPURL,
  5866. tooltip: Blockly.Msg.FILE_TO_BIN_TOOLTIP,
  5867. message0: Blockly.Msg.FILE_TO_BIN_MESSAGE0
  5868. })
  5869. }
  5870. };
  5871. Blockly.Blocks.CocoRobo_init_file = {
  5872. init: function () {
  5873. this.jsonInit({
  5874. colour: CategoryColors.File,
  5875. args0: [{
  5876. type: "input_value",
  5877. name: "file_path"
  5878. }],
  5879. inputsInline: !0,
  5880. nextStatement: null,
  5881. previousStatement: null,
  5882. helpUrl: Blockly.Msg.CocoRobo_INIT_FILE_HELPURL,
  5883. tooltip: Blockly.Msg.CocoRobo_INIT_FILE_TOOLTIP,
  5884. message0: Blockly.Msg.CocoRobo_INIT_FILE_MESSAGE0
  5885. })
  5886. }
  5887. };
  5888. Blockly.Blocks.CocoRobo_write_file = {
  5889. init: function () {
  5890. this.jsonInit({
  5891. colour: CategoryColors.File,
  5892. args0: [{
  5893. type: "input_value",
  5894. name: "file_path"
  5895. }, {
  5896. type: "input_value",
  5897. name: "data"
  5898. }, {
  5899. options: [
  5900. [Blockly.Msg.CocoRobo_ENTER, "ENTER"],
  5901. [Blockly.Msg.CocoRobo_COMMA, ","],
  5902. [Blockly.Msg.CocoRobo_SEMICOLON, ";"],
  5903. [Blockly.Msg.CocoRobo_SPACE, " "]
  5904. ],
  5905. type: "field_dropdown",
  5906. name: "separator"
  5907. }],
  5908. inputsInline: !0,
  5909. nextStatement: null,
  5910. previousStatement: null,
  5911. helpUrl: Blockly.Msg.CocoRobo_WRITE_FILE_HELPURL,
  5912. tooltip: Blockly.Msg.CocoRobo_WRITE_FILE_TOOLTIP,
  5913. message0: Blockly.Msg.CocoRobo_WRITE_FILE_MESSAGE0
  5914. })
  5915. }
  5916. };
  5917. Blockly.Blocks.CocoRobo_sdcard_init = {
  5918. init: function () {
  5919. this.jsonInit({
  5920. colour: CategoryColors.File,
  5921. inputsInline: !0,
  5922. nextStatement: null,
  5923. previousStatement: null,
  5924. helpUrl: Blockly.Msg.CocoRobo_SDCARD_INIT_HELPURL,
  5925. tooltip: Blockly.Msg.CocoRobo_SDCARD_INIT_TOOLTIP,
  5926. message0: Blockly.Msg.CocoRobo_SDCARD_INIT_MESSAGE0
  5927. })
  5928. }
  5929. };
  5930. Blockly.Blocks.CocoRobo_sdcard_mount = {
  5931. init: function () {
  5932. this.jsonInit({
  5933. colour: CategoryColors.File,
  5934. args0: [{
  5935. check: "String",
  5936. type: "input_value",
  5937. name: "sd_path"
  5938. }],
  5939. inputsInline: !0,
  5940. nextStatement: null,
  5941. previousStatement: null,
  5942. helpUrl: Blockly.Msg.CocoRobo_SDCARD_MOUNT_HELPURL,
  5943. tooltip: Blockly.Msg.CocoRobo_SDCARD_MOUNT_TOOLTIP,
  5944. message0: Blockly.Msg.CocoRobo_SDCARD_MOUNT_MESSAGE0
  5945. })
  5946. }
  5947. };
  5948. Blockly.Blocks.CocoRobo_dev_i2c_init = {
  5949. init: function () {
  5950. this.jsonInit({
  5951. colour: CategoryColors.Pin,
  5952. args0: [{
  5953. type: "input_value",
  5954. name: "freq"
  5955. }, {
  5956. check: "Number",
  5957. type: "input_value",
  5958. name: "scl"
  5959. }, {
  5960. check: "Number",
  5961. type: "input_value",
  5962. name: "sda"
  5963. }],
  5964. helpUrl: Blockly.Msg.CocoRobo_dev_i2c_init_HELPURL,
  5965. tooltip: Blockly.Msg.CocoRobo_dev_i2c_init_TOOLTIP,
  5966. message0: Blockly.Msg.CocoRobo_dev_i2c_init_MESSAGE0,
  5967. nextStatement: null,
  5968. previousStatement: null,
  5969. inputsInline: !0
  5970. })
  5971. }
  5972. };
  5973. Blockly.Blocks.CocoRobo_i2c_init = {
  5974. init: function () {
  5975. this.jsonInit({
  5976. colour: CategoryColors.Pin,
  5977. args0: [{
  5978. type: "input_value",
  5979. name: "freq"
  5980. }],
  5981. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  5982. tooltip: Blockly.Msg.CocoRobo_i2c_init_TOOLTIP,
  5983. message0: Blockly.Msg.CocoRobo_i2c_init_MESSAGE0,
  5984. nextStatement: null,
  5985. previousStatement: null
  5986. })
  5987. }
  5988. };
  5989. Blockly.Blocks.CocoRobo_i2c_read_write = {
  5990. init: function () {
  5991. this.jsonInit({
  5992. colour: CategoryColors.Pin,
  5993. args0: [{
  5994. name: "adr",
  5995. type: "input_value",
  5996. check: "Number"
  5997. }, {
  5998. name: "data",
  5999. type: "input_value",
  6000. check: ["Number", "String"]
  6001. }],
  6002. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  6003. tooltip: Blockly.Msg.CocoRobo_i2c_read_write_TOOLTIP,
  6004. message0: Blockly.Msg.CocoRobo_i2c_read_write_MESSAGE0,
  6005. nextStatement: null,
  6006. previousStatement: null,
  6007. inputsInline: !0
  6008. })
  6009. }
  6010. };
  6011. Blockly.Blocks.CocoRobo_i2c_readfrom = {
  6012. init: function () {
  6013. this.jsonInit({
  6014. colour: CategoryColors.Pin,
  6015. args0: [{
  6016. name: "adr",
  6017. type: "input_value",
  6018. check: "Number"
  6019. }, {
  6020. name: "num",
  6021. type: "input_value",
  6022. check: "Number"
  6023. }],
  6024. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  6025. tooltip: Blockly.Msg.CocoRobo_i2c_readfrom_TOOLTIP,
  6026. message0: Blockly.Msg.CocoRobo_i2c_readfrom_MESSAGE0,
  6027. output: "String",
  6028. inputsInline: !0
  6029. })
  6030. }
  6031. };
  6032. Blockly.Blocks.mqtt_common_setup = {
  6033. init: function () {
  6034. this.jsonInit({
  6035. inputsInline: !1,
  6036. nextStatement: null,
  6037. previousStatement: null,
  6038. colour: CategoryColors.IoT_MQTT,
  6039. helpUrl: Blockly.Msg.MQTT_COMMON_SETUP_HELPURL,
  6040. tooltip: Blockly.Msg.MQTT_COMMON_SETUP_TOOLTIP,
  6041. message0: Blockly.Msg.MQTT_COMMON_SETUP_MESSAGE0,
  6042. args0: [{
  6043. type: "input_dummy"
  6044. }, {
  6045. type: "input_value",
  6046. name: "client_id"
  6047. }, {
  6048. type: "input_value",
  6049. name: "server"
  6050. }, {
  6051. type: "input_value",
  6052. name: "port"
  6053. }, {
  6054. type: "input_value",
  6055. name: "user"
  6056. }, {
  6057. type: "input_value",
  6058. name: "password"
  6059. }, {
  6060. type: "input_value",
  6061. name: "keepalive"
  6062. }]
  6063. })
  6064. }
  6065. };
  6066. Blockly.Blocks.mqtt_tencent_setup = {
  6067. init: function () {
  6068. this.jsonInit({
  6069. inputsInline: !1,
  6070. nextStatement: null,
  6071. previousStatement: null,
  6072. colour: CategoryColors.IoT_MQTT,
  6073. helpUrl: Blockly.Msg.MQTT_TENCENT_SETUP_HELPURL,
  6074. tooltip: Blockly.Msg.MQTT_TENCENT_SETUP_TOOLTIP,
  6075. message0: Blockly.Msg.MQTT_TENCENT_SETUP_MESSAGE0,
  6076. args0: [{
  6077. type: "input_dummy"
  6078. }, {
  6079. check: "String",
  6080. type: "input_value",
  6081. name: "Url"
  6082. }, {
  6083. check: "Number",
  6084. type: "input_value",
  6085. name: "Port"
  6086. }, {
  6087. check: "String",
  6088. type: "input_value",
  6089. name: "AppId"
  6090. }, {
  6091. check: "String",
  6092. type: "input_value",
  6093. name: "Device"
  6094. }, {
  6095. type: "input_dummy"
  6096. }, {
  6097. check: "String",
  6098. type: "input_value",
  6099. name: "ReportTopic"
  6100. }, {
  6101. check: "String",
  6102. type: "input_value",
  6103. name: "ControlTopic"
  6104. }]
  6105. })
  6106. }
  6107. };
  6108. Blockly.Blocks.mqtt_setup = {
  6109. init: function () {
  6110. this.jsonInit({
  6111. nextStatement: null,
  6112. previousStatement: null,
  6113. colour: CategoryColors.IoT_MQTT,
  6114. helpUrl: Blockly.Msg.MQTT_SETUP_HELPURL,
  6115. tooltip: Blockly.Msg.MQTT_SETUP_TOOLTIP,
  6116. message0: Blockly.Msg.MQTT_SETUP_MESSAGE0,
  6117. args0: [{
  6118. type: "input_dummy"
  6119. }, {
  6120. check: "String",
  6121. type: "input_value",
  6122. name: "Server"
  6123. }, {
  6124. check: "String",
  6125. type: "input_value",
  6126. name: "Iot_id"
  6127. }, {
  6128. check: "String",
  6129. type: "input_value",
  6130. name: "Iot_pwd"
  6131. }, {
  6132. check: "String",
  6133. type: "input_value",
  6134. name: "Client_ID"
  6135. }]
  6136. })
  6137. }
  6138. };
  6139. Blockly.Blocks.mqtt_connect = {
  6140. init: function () {
  6141. this.jsonInit({
  6142. inputsInline: !0,
  6143. nextStatement: null,
  6144. previousStatement: null,
  6145. colour: CategoryColors.IoT_MQTT,
  6146. helpUrl: Blockly.Msg.MQTT_CONNECT_HELPURL,
  6147. tooltip: Blockly.Msg.MQTT_CONNECT_TOOLTIP,
  6148. message0: Blockly.Msg.MQTT_CONNECT_MESSAGE0
  6149. })
  6150. }
  6151. };
  6152. Blockly.Blocks.mqtt_publish = {
  6153. init: function () {
  6154. this.jsonInit({
  6155. inputsInline: !0,
  6156. nextStatement: null,
  6157. previousStatement: null,
  6158. colour: CategoryColors.IoT_MQTT,
  6159. helpUrl: Blockly.Msg.MQTT_PUBLISH_HELPURL,
  6160. tooltip: Blockly.Msg.MQTT_PUBLISH_TOOLTIP,
  6161. message0: Blockly.Msg.MQTT_PUBLISH_MESSAGE0,
  6162. args0: [{
  6163. type: "input_value",
  6164. name: "msg"
  6165. }, {
  6166. check: "String",
  6167. type: "input_value",
  6168. name: "topic"
  6169. }]
  6170. })
  6171. }
  6172. };
  6173. Blockly.Blocks.mqtt_receive = {
  6174. init: function () {
  6175. this.jsonInit({
  6176. inputsInline: !0,
  6177. nextStatement: null,
  6178. previousStatement: null,
  6179. colour: CategoryColors.IoT_MQTT,
  6180. helpUrl: Blockly.Msg.MQTT_RECEIVE_HELPURL,
  6181. tooltip: Blockly.Msg.MQTT_RECEIVE_TOOLTIP,
  6182. message0: Blockly.Msg.MQTT_RECEIVE_MESSAGE0,
  6183. args0: [{
  6184. check: "Variable",
  6185. type: "input_value",
  6186. name: "topic"
  6187. }, {
  6188. type: "input_value",
  6189. name: "msg"
  6190. }]
  6191. });
  6192. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6193. }
  6194. };
  6195. Blockly.Blocks.mqtt_rec_from_topic = {
  6196. init: function () {
  6197. this.jsonInit({
  6198. inputsInline: !0,
  6199. nextStatement: null,
  6200. previousStatement: null,
  6201. colour: CategoryColors.IoT_MQTT,
  6202. helpUrl: Blockly.Msg.MQTT_REC_FROM_TOPIC_HELPURL,
  6203. tooltip: Blockly.Msg.MQTT_REC_FROM_TOPIC_TOOLTIP,
  6204. message0: Blockly.Msg.MQTT_REC_FROM_TOPIC_MESSAGE0,
  6205. args0: [{
  6206. text: "rJO1km2oN",
  6207. type: "field_input",
  6208. name: "topic"
  6209. }, {
  6210. type: "input_value",
  6211. name: "msg"
  6212. }]
  6213. });
  6214. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6215. }
  6216. };
  6217. Blockly.Blocks.mqtt_wait_msg = {
  6218. init: function () {
  6219. this.jsonInit({
  6220. inputsInline: !0,
  6221. nextStatement: null,
  6222. previousStatement: null,
  6223. colour: CategoryColors.IoT_MQTT,
  6224. helpUrl: Blockly.Msg.MQTT_WAIT_MSG_HELPURL,
  6225. tooltip: Blockly.Msg.MQTT_WAIT_MSG_TOOLTIP,
  6226. message0: Blockly.Msg.MQTT_WAIT_MSG_MESSAGE0,
  6227. args0: [{
  6228. options: [
  6229. [Blockly.Msg.CocoRobo_USOCKET_BLOCK, "block"],
  6230. [Blockly.Msg.CocoRobo_USOCKET_UNBLOCK, "unblock"]
  6231. ],
  6232. type: "field_dropdown",
  6233. name: "mode"
  6234. }]
  6235. })
  6236. }
  6237. };
  6238. Blockly.Blocks.mqtt_disconnect = {
  6239. init: function () {
  6240. this.jsonInit({
  6241. inputsInline: !0,
  6242. nextStatement: null,
  6243. previousStatement: null,
  6244. colour: CategoryColors.IoT_MQTT,
  6245. helpUrl: Blockly.Msg.MQTT_DISCONNECT_HELPURL,
  6246. tooltip: Blockly.Msg.MQTT_DISCONNECT_TOOLTIP,
  6247. message0: Blockly.Msg.MQTT_DISCONNECT_MESSAGE0
  6248. })
  6249. }
  6250. };
  6251. Blockly.Blocks.mqtt_last_will = {
  6252. init: function () {
  6253. this.jsonInit({
  6254. inputsInline: !0,
  6255. nextStatement: null,
  6256. previousStatement: null,
  6257. colour: CategoryColors.IoT_MQTT,
  6258. helpUrl: Blockly.Msg.MQTT_LAST_WILL_HELPURL,
  6259. tooltip: Blockly.Msg.MQTT_LAST_WILL_TOOLTIP,
  6260. message0: Blockly.Msg.MQTT_LAST_WILL_MESSAGE0,
  6261. args0: [{
  6262. check: "String",
  6263. type: "input_value",
  6264. name: "msg"
  6265. }, {
  6266. check: "String",
  6267. type: "input_value",
  6268. name: "topic"
  6269. }]
  6270. })
  6271. }
  6272. };
  6273. Blockly.Blocks.CocoRobo_tinywebio_start = {
  6274. init: function () {
  6275. this.jsonInit({
  6276. inputsInline: !0,
  6277. nextStatement: null,
  6278. previousStatement: null,
  6279. colour: CategoryColors.IoT_TinyWebIO,
  6280. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  6281. tooltip: Blockly.Msg.CocoRobo_tinywebio_start_TOOLTIP,
  6282. message0: Blockly.Msg.CocoRobo_tinywebio_start_MESSAGE0,
  6283. args0: [{
  6284. name: "tinywebio_mode",
  6285. options: [
  6286. [Blockly.Msg.CocoRobo_run_in_back, "0"],
  6287. [Blockly.Msg.CocoRobo_run_in_front, "1"]
  6288. ],
  6289. type: "field_dropdown"
  6290. }]
  6291. })
  6292. }
  6293. };
  6294. Blockly.Blocks.CocoRobo_tinywebio_client_setup = {
  6295. init: function () {
  6296. this.jsonInit({
  6297. inputsInline: !1,
  6298. nextStatement: null,
  6299. previousStatement: null,
  6300. colour: CategoryColors.IoT_TinyWebIO,
  6301. helpUrl: Blockly.Msg.CocoRobo_tinywebio_client_setup_HELPURL,
  6302. tooltip: Blockly.Msg.CocoRobo_tinywebio_client_setup_TOOLTIP,
  6303. message0: Blockly.Msg.CocoRobo_tinywebio_client_setup_MESSAGE0,
  6304. args0: [{
  6305. type: "input_dummy"
  6306. }, {
  6307. type: "input_value",
  6308. name: "db_server",
  6309. check: "String"
  6310. }, {
  6311. type: "input_value",
  6312. name: "send_items",
  6313. check: "String"
  6314. }, {
  6315. type: "input_value",
  6316. name: "recv_items",
  6317. check: "String"
  6318. }, {
  6319. name: "interval",
  6320. type: "input_value",
  6321. check: "Number"
  6322. }]
  6323. })
  6324. }
  6325. };
  6326. Blockly.Blocks.CocoRobo_tinywebio_client_action = {
  6327. init: function () {
  6328. this.jsonInit({
  6329. inputsInline: !0,
  6330. nextStatement: null,
  6331. previousStatement: null,
  6332. colour: CategoryColors.IoT_TinyWebIO,
  6333. helpUrl: Blockly.Msg.CocoRobo_tinywebio_client_action_HELPURL,
  6334. tooltip: Blockly.Msg.CocoRobo_tinywebio_client_action_TOOLTIP,
  6335. message0: Blockly.Msg.CocoRobo_tinywebio_client_action_MESSAGE0,
  6336. args0: [{
  6337. name: "action_mode",
  6338. options: [
  6339. [Blockly.Msg.CocoRobo_tinywebio_client_action_start, "start"],
  6340. [Blockly.Msg.CocoRobo_tinywebio_client_action_stop, "stop"]
  6341. ],
  6342. type: "field_dropdown"
  6343. }]
  6344. })
  6345. }
  6346. };
  6347. Blockly.Blocks.CocoRobo_blynk_terminal_widget_vpin = {
  6348. init: function () {
  6349. this.jsonInit({
  6350. inputsInline: !0,
  6351. nextStatement: null,
  6352. previousStatement: null,
  6353. colour: CategoryColors.IoT_Blynk,
  6354. helpUrl: Blockly.Msg.CocoRobo_BLYNK_TERMINAL_WIDGET_VPIN_HELPURL,
  6355. tooltip: Blockly.Msg.CocoRobo_BLYNK_TERMINAL_WIDGET_VPIN_TOOLTIP,
  6356. message0: Blockly.Msg.CocoRobo_BLYNK_TERMINAL_WIDGET_VPIN_MESSAGE0,
  6357. args0: [{
  6358. check: "Number",
  6359. type: "input_value",
  6360. name: "virtual_pin"
  6361. }]
  6362. })
  6363. }
  6364. };
  6365. Blockly.Blocks.CocoRobo_blynk_sync_virtual = {
  6366. init: function () {
  6367. this.jsonInit({
  6368. inputsInline: !0,
  6369. nextStatement: null,
  6370. previousStatement: null,
  6371. colour: CategoryColors.IoT_Blynk,
  6372. helpUrl: Blockly.Msg.CocoRobo_BLYNK_SYNC_VIRTUAL_HELPURL,
  6373. tooltip: Blockly.Msg.CocoRobo_BLYNK_SYNC_VIRTUAL_TOOLTIP,
  6374. message0: Blockly.Msg.CocoRobo_BLYNK_SYNC_VIRTUAL_MESSAGE0,
  6375. args0: [{
  6376. check: "Number",
  6377. type: "input_value",
  6378. name: "virtual_pin"
  6379. }]
  6380. })
  6381. }
  6382. };
  6383. Blockly.Blocks.CocoRobo_blynk_on_disconnected = {
  6384. init: function () {
  6385. this.jsonInit({
  6386. inputsInline: !0,
  6387. nextStatement: null,
  6388. previousStatement: null,
  6389. colour: CategoryColors.IoT_Blynk,
  6390. helpUrl: Blockly.Msg.CocoRobo_BLYNK_ON_DISCONNECTED_HELPURL,
  6391. tooltip: Blockly.Msg.CocoRobo_BLYNK_ON_DISCONNECTED_TOOLTIP,
  6392. message0: Blockly.Msg.CocoRobo_BLYNK_ON_DISCONNECTED_MESSAGE0
  6393. });
  6394. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6395. }
  6396. };
  6397. Blockly.Blocks.CocoRobo_blynk_on_connected = {
  6398. init: function () {
  6399. this.jsonInit({
  6400. inputsInline: !0,
  6401. nextStatement: null,
  6402. previousStatement: null,
  6403. colour: CategoryColors.IoT_Blynk,
  6404. helpUrl: Blockly.Msg.CocoRobo_BLYNK_ON_CONNECTED_HELPURL,
  6405. tooltip: Blockly.Msg.CocoRobo_BLYNK_ON_CONNECTED_TOOLTIP,
  6406. message0: Blockly.Msg.CocoRobo_BLYNK_ON_CONNECTED_MESSAGE0
  6407. });
  6408. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6409. }
  6410. };
  6411. Blockly.Blocks.CocoRobo_blynktimer_run = {
  6412. init: function () {
  6413. this.jsonInit({
  6414. inputsInline: !0,
  6415. nextStatement: null,
  6416. previousStatement: null,
  6417. colour: CategoryColors.IoT_Blynk,
  6418. helpUrl: Blockly.Msg.CocoRobo_BLYNKTIMER_RUN_HELPURL,
  6419. tooltip: Blockly.Msg.CocoRobo_BLYNKTIMER_RUN_TOOLTIP,
  6420. message0: Blockly.Msg.CocoRobo_BLYNKTIMER_RUN_MESSAGE0
  6421. })
  6422. }
  6423. };
  6424. Blockly.Blocks.CocoRobo_blynk_run = {
  6425. init: function () {
  6426. this.jsonInit({
  6427. inputsInline: !0,
  6428. nextStatement: null,
  6429. previousStatement: null,
  6430. colour: CategoryColors.IoT_Blynk,
  6431. helpUrl: Blockly.Msg.CocoRobo_BLYNK_RUN_HELPURL,
  6432. tooltip: Blockly.Msg.CocoRobo_BLYNK_RUN_TOOLTIP,
  6433. message0: Blockly.Msg.CocoRobo_BLYNK_RUN_MESSAGE0
  6434. })
  6435. }
  6436. };
  6437. Blockly.Blocks.CocoRobo_blynk_app_notify = {
  6438. init: function () {
  6439. this.jsonInit({
  6440. inputsInline: !0,
  6441. nextStatement: null,
  6442. previousStatement: null,
  6443. colour: CategoryColors.IoT_Blynk,
  6444. helpUrl: Blockly.Msg.CocoRobo_BLYNK_APP_NOTIFY_HELPURL,
  6445. tooltip: Blockly.Msg.CocoRobo_BLYNK_APP_NOTIFY_TOOLTIP,
  6446. message0: Blockly.Msg.CocoRobo_BLYNK_APP_NOTIFY_MESSAGE0,
  6447. args0: [{
  6448. check: "String",
  6449. type: "input_value",
  6450. name: "notification"
  6451. }]
  6452. })
  6453. }
  6454. };
  6455. Blockly.Blocks.CocoRobo_blynk_stop_timers = {
  6456. init: function () {
  6457. this.jsonInit({
  6458. inputsInline: !0,
  6459. nextStatement: null,
  6460. previousStatement: null,
  6461. colour: CategoryColors.IoT_Blynk,
  6462. helpUrl: Blockly.Msg.CocoRobo_BLYNK_STOP_TIMERS_HELPURL,
  6463. tooltip: Blockly.Msg.CocoRobo_BLYNK_STOP_TIMERS_TOOLTIP,
  6464. message0: Blockly.Msg.CocoRobo_BLYNK_STOP_TIMERS_MESSAGE0,
  6465. args0: [{
  6466. check: "Number",
  6467. type: "input_value",
  6468. name: "timer_num"
  6469. }]
  6470. })
  6471. }
  6472. };
  6473. Blockly.Blocks.CocoRobo_blynk_set_property = {
  6474. init: function () {
  6475. this.jsonInit({
  6476. inputsInline: !0,
  6477. nextStatement: null,
  6478. previousStatement: null,
  6479. colour: CategoryColors.IoT_Blynk,
  6480. helpUrl: Blockly.Msg.CocoRobo_BLYNK_SET_PROPERTY_HELPURL,
  6481. tooltip: Blockly.Msg.CocoRobo_BLYNK_SET_PROPERTY_TOOLTIP,
  6482. message0: Blockly.Msg.CocoRobo_BLYNK_SET_PROPERTY_MESSAGE0,
  6483. args0: [{
  6484. check: "String",
  6485. type: "input_value",
  6486. name: "attribute_name"
  6487. }, {
  6488. type: "input_value",
  6489. name: "attribute_value"
  6490. }]
  6491. })
  6492. }
  6493. };
  6494. Blockly.Blocks.CocoRobo_blynk_email = {
  6495. init: function () {
  6496. this.jsonInit({
  6497. inputsInline: !1,
  6498. nextStatement: null,
  6499. previousStatement: null,
  6500. colour: CategoryColors.IoT_Blynk,
  6501. helpUrl: Blockly.Msg.CocoRobo_BLYNK_EMAIL_HELPURL,
  6502. tooltip: Blockly.Msg.CocoRobo_BLYNK_EMAIL_TOOLTIP,
  6503. message0: Blockly.Msg.CocoRobo_BLYNK_EMAIL_MESSAGE0,
  6504. args0: [{
  6505. type: "input_dummy"
  6506. }, {
  6507. check: "String",
  6508. type: "input_value",
  6509. name: "subject"
  6510. }, {
  6511. check: "String",
  6512. type: "input_value",
  6513. name: "body"
  6514. }]
  6515. })
  6516. }
  6517. };
  6518. Blockly.Blocks.CocoRobo_blynk_get_timers = {
  6519. init: function () {
  6520. this.jsonInit({
  6521. inputsInline: !0,
  6522. output: null,
  6523. colour: CategoryColors.IoT_Blynk,
  6524. helpUrl: Blockly.Msg.CocoRobo_BLYNK_GET_TIMERS_HELPURL,
  6525. tooltip: Blockly.Msg.CocoRobo_BLYNK_GET_TIMERS_TOOLTIP,
  6526. message0: Blockly.Msg.CocoRobo_BLYNK_GET_TIMERS_MESSAGE0
  6527. })
  6528. }
  6529. };
  6530. Blockly.Blocks.CocoRobo_blynktimer = {
  6531. init: function () {
  6532. this.jsonInit({
  6533. message0: Blockly.Msg.CocoRobo_BLYNKTIMER_MESSAGE0,
  6534. nextStatement: null,
  6535. previousStatement: null,
  6536. colour: CategoryColors.IoT_Blynk,
  6537. helpUrl: Blockly.Msg.CocoRobo_BLYNKTIMER_HELPURL,
  6538. tooltip: Blockly.Msg.CocoRobo_BLYNKTIMER_TOOLTIP,
  6539. args0: [{
  6540. check: "Number",
  6541. type: "input_value",
  6542. name: "Num"
  6543. }, {
  6544. options: [
  6545. [Blockly.Msg.CocoRobo_PERIODIC, "False"],
  6546. [Blockly.Msg.CocoRobo_ONE_SHOT, "True"]
  6547. ],
  6548. type: "field_dropdown",
  6549. name: "Timer_mode"
  6550. }, {
  6551. check: "Number",
  6552. type: "input_value",
  6553. name: "period"
  6554. }]
  6555. });
  6556. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6557. }
  6558. };
  6559. Blockly.Blocks.CocoRobo_blynk_sensor_data_to_app = {
  6560. init: function () {
  6561. this.jsonInit({
  6562. inputsInline: !0,
  6563. nextStatement: null,
  6564. previousStatement: null,
  6565. colour: CategoryColors.IoT_Blynk,
  6566. helpUrl: Blockly.Msg.CocoRobo_BLYNK_SENSOR_DATA_TO_APP_HELPURL,
  6567. tooltip: Blockly.Msg.CocoRobo_BLYNK_SENSOR_DATA_TO_APP_TOOLTIP,
  6568. message0: Blockly.Msg.CocoRobo_BLYNK_SENSOR_DATA_TO_APP_MESSAGE0,
  6569. args0: [{
  6570. type: "input_value",
  6571. name: "sensor_data"
  6572. }, {
  6573. check: "Number",
  6574. type: "input_value",
  6575. name: "virtual_pin"
  6576. }]
  6577. })
  6578. }
  6579. };
  6580. Blockly.Blocks.CocoRobo_blynk_app_data = {
  6581. init: function () {
  6582. this.jsonInit({
  6583. inputsInline: !0,
  6584. nextStatement: null,
  6585. previousStatement: null,
  6586. colour: CategoryColors.IoT_Blynk,
  6587. helpUrl: Blockly.Msg.CocoRobo_BLYNK_APP_DATA_HELPURL,
  6588. tooltip: Blockly.Msg.CocoRobo_BLYNK_APP_DATA_TOOLTIP,
  6589. message0: Blockly.Msg.CocoRobo_BLYNK_APP_DATA_MESSAGE0,
  6590. args0: [{
  6591. check: "Number",
  6592. type: "input_value",
  6593. name: "virtual_pin"
  6594. }, {
  6595. type: "input_value",
  6596. name: "virtual_pin_val"
  6597. }]
  6598. });
  6599. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6600. }
  6601. };
  6602. Blockly.Blocks.CocoRobo_blynk_setup = {
  6603. init: function () {
  6604. this.jsonInit({
  6605. nextStatement: null,
  6606. previousStatement: null,
  6607. colour: CategoryColors.IoT_Blynk,
  6608. helpUrl: Blockly.Msg.CocoRobo_BLYNK_SETUP_HELPURL,
  6609. tooltip: Blockly.Msg.CocoRobo_BLYNK_SETUP_TOOLTIP,
  6610. message0: Blockly.Msg.CocoRobo_BLYNK_SETUP_MESSAGE0,
  6611. args0: [{
  6612. type: "input_dummy"
  6613. }, {
  6614. check: "String",
  6615. type: "input_value",
  6616. name: "server"
  6617. }, {
  6618. check: "Number",
  6619. type: "input_value",
  6620. name: "port"
  6621. }, {
  6622. check: "String",
  6623. type: "input_value",
  6624. name: "auth"
  6625. }]
  6626. })
  6627. }
  6628. };
  6629. Blockly.Blocks.CocoRobo_onenet_option_boards = {
  6630. init: function () {
  6631. this.jsonInit({
  6632. inputsInline: !0,
  6633. nextStatement: null,
  6634. previousStatement: null,
  6635. colour: CategoryColors.IoT_OneNet_WeChat,
  6636. helpUrl: Blockly.Msg.CocoRobo_ONENET_OPTION_BOARDS_HELPURL,
  6637. tooltip: Blockly.Msg.CocoRobo_ONENET_OPTION_BOARDS_TOOLTIP,
  6638. message0: Blockly.Msg.CocoRobo_ONENET_OPTION_BOARDS_MESSAGE0,
  6639. args0: [{
  6640. options: WECHAT_APP_DEVICES,
  6641. type: "field_dropdown",
  6642. name: "option_boards"
  6643. }]
  6644. })
  6645. }
  6646. };
  6647. Blockly.Blocks.CocoRobo_onenet_setup = {
  6648. init: function () {
  6649. this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);
  6650. this.setColour(CategoryColors.IoT_OneNet);
  6651. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_ONENET);
  6652. this.appendValueInput("server").setCheck("String").appendField(Blockly.Msg.CocoRobo_SERVER);
  6653. this.appendValueInput("device_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_DEVICE_ID);
  6654. this.appendValueInput("product_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_PRODUCT_ID);
  6655. this.appendValueInput("product_APIKey").setCheck("String").appendField(Blockly.Msg.CocoRobo_API_KEY);
  6656. this.setPreviousStatement(!0);
  6657. this.setNextStatement(!0);
  6658. this.setInputsInline(!1);
  6659. this.setTooltip(Blockly.Msg.CocoRobo_ONENET_TOOLTIP)
  6660. }
  6661. };
  6662. Blockly.Blocks.CocoRobo_onenet_setup = {
  6663. init: function () {
  6664. this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);
  6665. this.setColour(CategoryColors.IoT_OneNet);
  6666. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_ONENET);
  6667. this.appendValueInput("server").setCheck("String").appendField(Blockly.Msg.CocoRobo_SERVER);
  6668. this.appendValueInput("device_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_DEVICE_ID);
  6669. this.appendValueInput("product_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_PRODUCT_ID);
  6670. this.appendValueInput("product_APIKey").setCheck("String").appendField(Blockly.Msg.CocoRobo_API_KEY);
  6671. this.setPreviousStatement(!0);
  6672. this.setNextStatement(!0);
  6673. this.setInputsInline(!1);
  6674. this.setTooltip(Blockly.Msg.CocoRobo_ONENET_TOOLTIP)
  6675. }
  6676. };
  6677. Blockly.Blocks.CocoRobo_onenet_setup_wechat_app = {
  6678. init: function () {
  6679. this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);
  6680. this.setColour(CategoryColors.IoT_OneNet_WeChat);
  6681. this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_ONENET_WECHAT_APP);
  6682. this.appendValueInput("server").setCheck("String").appendField(Blockly.Msg.CocoRobo_SERVER);
  6683. this.appendValueInput("device_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_DEVICE_ID);
  6684. this.appendValueInput("product_id").setCheck("String").appendField(Blockly.Msg.CocoRobo_PRODUCT_ID);
  6685. this.appendValueInput("product_APIKey").setCheck("String").appendField(Blockly.Msg.CocoRobo_API_KEY);
  6686. this.setPreviousStatement(!0);
  6687. this.setNextStatement(!0);
  6688. this.setInputsInline(!1);
  6689. this.setTooltip(Blockly.Msg.CocoRobo_ONENET_TOOLTIP)
  6690. }
  6691. };
  6692. Blockly.Blocks.CocoRobo_onenet_recv = {
  6693. init: function () {
  6694. this.jsonInit({
  6695. message0: Blockly.Msg.CocoRobo_ONENET_RECV_MESSAGE0,
  6696. nextStatement: null,
  6697. previousStatement: null,
  6698. colour: CategoryColors.IoT_OneNet,
  6699. inputsInline: !0,
  6700. helpUrl: Blockly.Msg.CocoRobo_ONENET_RECV_HELPURL,
  6701. tooltip: Blockly.Msg.CocoRobo_ONENET_RECV_TOOLTIP,
  6702. args0: [{
  6703. type: "input_value",
  6704. name: "message"
  6705. }]
  6706. });
  6707. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6708. }
  6709. };
  6710. Blockly.Blocks.CocoRobo_onenet_recv_from_wechat_app = {
  6711. init: function () {
  6712. this.jsonInit({
  6713. message0: Blockly.Msg.CocoRobo_ONENET_RECV_FROM_WECHAT_APP_MESSAGE0,
  6714. nextStatement: null,
  6715. previousStatement: null,
  6716. colour: CategoryColors.IoT_OneNet_WeChat,
  6717. inputsInline: !0,
  6718. helpUrl: Blockly.Msg.CocoRobo_ONENET_RECV_FROM_WECHAT_APP_HELPURL,
  6719. tooltip: Blockly.Msg.CocoRobo_ONENET_RECV_FROM_WECHAT_APP_TOOLTIP,
  6720. args0: [{
  6721. type: "input_value",
  6722. name: "name"
  6723. }, {
  6724. type: "input_value",
  6725. name: "value"
  6726. }]
  6727. });
  6728. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6729. }
  6730. };
  6731. Blockly.Blocks.CocoRobo_onenet_recv_msg = {
  6732. init: function () {
  6733. this.jsonInit({
  6734. message0: Blockly.Msg.CocoRobo_ONENET_RECV_MSG_MESSAGE0,
  6735. nextStatement: null,
  6736. previousStatement: null,
  6737. colour: CategoryColors.IoT_OneNet,
  6738. inputsInline: !0,
  6739. helpUrl: Blockly.Msg.CocoRobo_ONENET_RECV_MSG_HELPURL,
  6740. tooltip: Blockly.Msg.CocoRobo_ONENET_RECV_MSG_TOOLTIP,
  6741. args0: [{
  6742. type: "field_input",
  6743. name: "message",
  6744. text: "on"
  6745. }]
  6746. });
  6747. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  6748. }
  6749. };
  6750. Blockly.Blocks.CocoRobo_onenet_pub_value = {
  6751. init: function () {
  6752. this.jsonInit({
  6753. inputsInline: !0,
  6754. nextStatement: null,
  6755. previousStatement: null,
  6756. colour: CategoryColors.IoT_OneNet,
  6757. helpUrl: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE_HELPURL,
  6758. tooltip: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE_TOOLTIP,
  6759. message0: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE_MESSAGE0,
  6760. args0: [{
  6761. check: "String",
  6762. type: "input_value",
  6763. name: "NAME"
  6764. }, {
  6765. check: "Number",
  6766. type: "input_value",
  6767. name: "VALUE"
  6768. }]
  6769. })
  6770. }
  6771. };
  6772. Blockly.Blocks.CocoRobo_onenet_pub_value_wechat_app = {
  6773. init: function () {
  6774. this.jsonInit({
  6775. inputsInline: !0,
  6776. nextStatement: null,
  6777. previousStatement: null,
  6778. colour: CategoryColors.IoT_OneNet_WeChat,
  6779. helpUrl: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE2_HELPURL,
  6780. tooltip: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE2_TOOLTIP,
  6781. message0: Blockly.Msg.CocoRobo_ONENET_PUB_VALUE2_MESSAGE0,
  6782. args0: [{
  6783. check: "String",
  6784. type: "input_value",
  6785. name: "NAME"
  6786. }, {
  6787. check: "Number",
  6788. type: "input_value",
  6789. name: "VALUE"
  6790. }]
  6791. })
  6792. }
  6793. };
  6794. Blockly.Blocks.CocoRobo_onenet_pub_dict = {
  6795. init: function () {
  6796. this.jsonInit({
  6797. inputsInline: !0,
  6798. nextStatement: null,
  6799. previousStatement: null,
  6800. colour: CategoryColors.IoT_OneNet,
  6801. helpUrl: Blockly.Msg.CocoRobo_ONENET_PUB_DICT_HELPURL,
  6802. tooltip: Blockly.Msg.CocoRobo_ONENET_PUB_DICT_TOOLTIP,
  6803. message0: Blockly.Msg.CocoRobo_ONENET_PUB_DICT_MESSAGE0,
  6804. args0: [{
  6805. check: "Array",
  6806. type: "input_value",
  6807. name: "DICT"
  6808. }]
  6809. })
  6810. }
  6811. };
  6812. Blockly.Blocks.CocoRobo_onenet_disconnect = {
  6813. init: function () {
  6814. this.jsonInit({
  6815. inputsInline: !0,
  6816. nextStatement: null,
  6817. previousStatement: null,
  6818. colour: CategoryColors.IoT_OneNet,
  6819. helpUrl: Blockly.Msg.CocoRobo_ONENET_DISCONNECT_HELPURL,
  6820. tooltip: Blockly.Msg.CocoRobo_ONENET_DISCONNECT_TOOLTIP,
  6821. message0: Blockly.Msg.CocoRobo_ONENET_DISCONNECT_MESSAGE0
  6822. })
  6823. }
  6824. };
  6825. Blockly.Blocks.list_first_index = {
  6826. init: function () {
  6827. this.jsonInit({
  6828. inputsInline: !0,
  6829. output: "Number",
  6830. colour: CategoryColors.List,
  6831. helpUrl: Blockly.Msg.LIST_FIRST_INDEX_HELPURL,
  6832. // tooltip: Blockly.Msg.LIST_FIRST_INDEX_TOOLTIP,
  6833. message0: Blockly.Msg.LIST_FIRST_INDEX_MESSAGE0,
  6834. args0: [{
  6835. type: "input_value",
  6836. name: "elem"
  6837. }, {
  6838. check: "Array",
  6839. type: "input_value",
  6840. name: "my_list"
  6841. }, {
  6842. options: [
  6843. [Blockly.Msg.FIRST, "first"],
  6844. [Blockly.Msg.LAST, "last"]
  6845. ],
  6846. type: "field_dropdown",
  6847. name: "last_or_first"
  6848. }]
  6849. });
  6850. var thisBlock = this;
  6851. this.setTooltip(function () {
  6852. var mode = thisBlock.getFieldValue('last_or_first');
  6853. var TOOLTIPS = {
  6854. 'first': Blockly.Msg.LIST_FIRST_INDEX_TOOLTIP.replace('%3', Blockly.Msg.FIRST),
  6855. 'last': Blockly.Msg.LIST_FIRST_INDEX_TOOLTIP.replace('%3', Blockly.Msg.LAST)
  6856. };
  6857. return TOOLTIPS[mode];
  6858. });
  6859. }
  6860. };
  6861. Blockly.Blocks.list_item_exist = {
  6862. init: function () {
  6863. this.jsonInit({
  6864. colour: CategoryColors.List,
  6865. args0: [{
  6866. type: "input_value",
  6867. name: "list_name"
  6868. }, {
  6869. type: "input_value",
  6870. name: "list_item"
  6871. }],
  6872. output: "Boolean",
  6873. inputsInline: !0,
  6874. helpUrl: Blockly.Msg.LIST_ITEM_EXIST_HELPURL,
  6875. tooltip: Blockly.Msg.LIST_ITEM_EXIST_TOOLTIP,
  6876. message0: Blockly.Msg.LIST_ITEM_EXIST_MESSAGE0
  6877. })
  6878. }
  6879. };
  6880. Blockly.Blocks.set_list_order_item = {
  6881. init: function () {
  6882. this.jsonInit({
  6883. colour: CategoryColors.List,
  6884. args0: [{
  6885. type: "input_value",
  6886. name: "list_name"
  6887. }, {
  6888. options: [
  6889. [Blockly.Msg.CocoRobo_ORDER, "["],
  6890. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  6891. ],
  6892. type: "field_dropdown",
  6893. name: "list_order"
  6894. }, {
  6895. check: "Number",
  6896. type: "input_value",
  6897. name: "list_order_item"
  6898. }, {
  6899. type: "input_value",
  6900. name: "set_value"
  6901. }],
  6902. inputsInline: !0,
  6903. nextStatement: null,
  6904. previousStatement: null,
  6905. helpUrl: Blockly.Msg.SET_LIST_ORDER_ITEM_HELPURL,
  6906. tooltip: Blockly.Msg.SET_LIST_ORDER_ITEM_TOOLTIP,
  6907. message0: Blockly.Msg.SET_LIST_ORDER_ITEM_MESSAGE0
  6908. })
  6909. }
  6910. };
  6911. Blockly.Blocks.insert_list_order_item = {
  6912. init: function () {
  6913. this.jsonInit({
  6914. colour: CategoryColors.List,
  6915. args0: [{
  6916. type: "input_value",
  6917. name: "list_name"
  6918. }, {
  6919. options: [
  6920. [Blockly.Msg.CocoRobo_ORDER, "("],
  6921. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "(-"]
  6922. ],
  6923. type: "field_dropdown",
  6924. name: "list_order"
  6925. }, {
  6926. check: "Number",
  6927. type: "input_value",
  6928. name: "list_order_item"
  6929. }, {
  6930. type: "input_value",
  6931. name: "set_value"
  6932. }],
  6933. inputsInline: !0,
  6934. nextStatement: null,
  6935. previousStatement: null,
  6936. helpUrl: Blockly.Msg.INSERT_LIST_ORDER_ITEM_HELPURL,
  6937. tooltip: Blockly.Msg.INSERT_LIST_ORDER_ITEM_TOOLTIP,
  6938. message0: Blockly.Msg.INSERT_LIST_ORDER_ITEM_MESSAGE0
  6939. })
  6940. }
  6941. };
  6942. Blockly.Blocks.list_order_item = {
  6943. init: function () {
  6944. this.jsonInit({
  6945. colour: CategoryColors.List,
  6946. args0: [{
  6947. type: "input_value",
  6948. name: "list_name"
  6949. }, {
  6950. options: [
  6951. [Blockly.Msg.CocoRobo_ORDER, "["],
  6952. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  6953. ],
  6954. type: "field_dropdown",
  6955. name: "list_order"
  6956. }, {
  6957. check: "Number",
  6958. type: "input_value",
  6959. name: "list_order_item"
  6960. }],
  6961. output: ["Number", "String", "Boolean", "Array"],
  6962. inputsInline: !0,
  6963. helpUrl: Blockly.Msg.LIST_ORDER_ITEM_HELPURL,
  6964. tooltip: Blockly.Msg.LIST_ORDER_ITEM_TOOLTIP,
  6965. message0: Blockly.Msg.LIST_ORDER_ITEM_MESSAGE0
  6966. })
  6967. }
  6968. };
  6969. Blockly.Blocks.parts_of_list = {
  6970. init: function () {
  6971. this.jsonInit({
  6972. colour: CategoryColors.List,
  6973. args0: [{
  6974. type: "input_value",
  6975. name: "list_name"
  6976. }, {
  6977. options: [
  6978. [Blockly.Msg.CocoRobo_ORDER, "["],
  6979. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  6980. ],
  6981. type: "field_dropdown",
  6982. name: "list_start_order"
  6983. }, {
  6984. check: "Number",
  6985. type: "input_value",
  6986. name: "start_item"
  6987. }, {
  6988. options: [
  6989. [Blockly.Msg.CocoRobo_ORDER, ":"],
  6990. [Blockly.Msg.CocoRobo_REVERSE_ORDER, ":-"]
  6991. ],
  6992. type: "field_dropdown",
  6993. name: "list_end_order"
  6994. }, {
  6995. check: "Number",
  6996. type: "input_value",
  6997. name: "end_item"
  6998. }],
  6999. output: null,
  7000. inputsInline: !0,
  7001. helpUrl: Blockly.Msg.PARTS_OF_LIST_HELPURL,
  7002. tooltip: Blockly.Msg.PARTS_OF_LIST_TOOLTIP,
  7003. message0: Blockly.Msg.PARTS_OF_LIST_MESSAGE0
  7004. })
  7005. }
  7006. };
  7007. Blockly.Blocks.list_to_tuple = {
  7008. init: function () {
  7009. this.jsonInit({
  7010. colour: CategoryColors.Tuple,
  7011. args0: [{
  7012. check: "Array",
  7013. type: "input_value",
  7014. name: "list_name"
  7015. }],
  7016. output: null,
  7017. inputsInline: !0,
  7018. helpUrl: Blockly.Msg.LIST_TO_TUPLE_HELPURL,
  7019. tooltip: Blockly.Msg.LIST_TO_TUPLE_TOOLTIP,
  7020. message0: Blockly.Msg.LIST_TO_TUPLE_MESSAGE0
  7021. })
  7022. }
  7023. };
  7024. Blockly.Blocks.lists_clear = {
  7025. init: function () {
  7026. this.jsonInit({
  7027. message0: Blockly.Msg.CocoRobo_lists_clear_MESSAGE0,
  7028. args0: [{
  7029. check: "Array",
  7030. type: "input_value",
  7031. name: "list_name"
  7032. }],
  7033. nextStatement: null,
  7034. previousStatement: null,
  7035. inputsInline: !0,
  7036. colour: CategoryColors.List,
  7037. tooltip: Blockly.Msg.CocoRobo_lists_clear_TOOLTIP,
  7038. helpUrl: Blockly.Msg.CocoRobo_lists_clear_HELPURL
  7039. })
  7040. }
  7041. };
  7042. Blockly.Blocks.lists_append = {
  7043. init: function () {
  7044. this.jsonInit({
  7045. message0: Blockly.Msg.CocoRobo_lists_append_MESSAGE0,
  7046. args0: [{
  7047. check: "Array",
  7048. type: "input_value",
  7049. name: "list_name"
  7050. }, {
  7051. type: "input_value",
  7052. name: "last_item",
  7053. check: ["String", "Number"]
  7054. }],
  7055. nextStatement: null,
  7056. previousStatement: null,
  7057. inputsInline: !0,
  7058. colour: CategoryColors.List,
  7059. tooltip: Blockly.Msg.CocoRobo_lists_append_TOOLTIP,
  7060. helpUrl: Blockly.Msg.CocoRobo_lists_append_HELPURL
  7061. })
  7062. }
  7063. };
  7064. Blockly.Blocks.lists_extend = {
  7065. init: function () {
  7066. this.jsonInit({
  7067. message0: Blockly.Msg.CocoRobo_lists_extend_MESSAGE0,
  7068. args0: [{
  7069. check: "Array",
  7070. type: "input_value",
  7071. name: "list_name"
  7072. }, {
  7073. type: "input_value",
  7074. name: "extend_list",
  7075. check: "Array"
  7076. }],
  7077. nextStatement: null,
  7078. previousStatement: null,
  7079. inputsInline: !0,
  7080. colour: CategoryColors.List,
  7081. tooltip: Blockly.Msg.CocoRobo_lists_extend_TOOLTIP,
  7082. helpUrl: Blockly.Msg.CocoRobo_lists_extend_HELPURL
  7083. })
  7084. }
  7085. };
  7086. Blockly.Blocks.CocoRobo_return_list = {
  7087. init: function () {
  7088. this.jsonInit({
  7089. colour: CategoryColors.List,
  7090. args0: [{
  7091. type: "input_value",
  7092. name: "list_name"
  7093. }, {
  7094. type: "input_value",
  7095. name: "list_items"
  7096. }],
  7097. nextStatement: null,
  7098. previousStatement: null,
  7099. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7100. tooltip: Blockly.Msg.CocoRobo_return_list_TOOLTIP,
  7101. message0: Blockly.Msg.CocoRobo_return_list_MESSAGE0,
  7102. inputsInline: !0
  7103. })
  7104. }
  7105. };
  7106. Blockly.Blocks.CocoRobo_music_note = {
  7107. init: function () {
  7108. this.jsonInit({
  7109. inputsInline: !0,
  7110. colour: CategoryColors.Music,
  7111. output: "String",
  7112. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7113. tooltip: Blockly.Msg.CocoRobo_music_note_TOOLTIP,
  7114. message0: Blockly.Msg.CocoRobo_music_note_MESSAGE0,
  7115. args0: [{
  7116. name: "gamut",
  7117. options: [
  7118. ["A", "A"],
  7119. ["B", "B"],
  7120. ["C", "C"],
  7121. ["D", "D"],
  7122. ["E", "E"],
  7123. ["F", "F"],
  7124. ["G", "G"]
  7125. ],
  7126. type: "field_dropdown"
  7127. }, {
  7128. check: "Number",
  7129. type: "input_value",
  7130. name: "num1"
  7131. }, {
  7132. check: "Number",
  7133. type: "input_value",
  7134. name: "num2"
  7135. }]
  7136. })
  7137. }
  7138. };
  7139. Blockly.Blocks.CocoRobo_music_play = {
  7140. init: function () {
  7141. this.jsonInit({
  7142. inputsInline: !1,
  7143. colour: CategoryColors.Music,
  7144. nextStatement: null,
  7145. previousStatement: null,
  7146. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7147. tooltip: Blockly.Msg.CocoRobo_MUSIC_PLAY_TOOLTIP,
  7148. message0: Blockly.Msg.CocoRobo_MUSIC_PLAY_MESSAGE0,
  7149. args0: [{
  7150. name: "melody",
  7151. options: [
  7152. ["DADADADUM", "DADADADUM"],
  7153. ["ENTERTAINER", "ENTERTAINER"],
  7154. ["PRELUDE", "PRELUDE"],
  7155. ["ODE", "ODE"],
  7156. ["NYAN", "NYAN"],
  7157. ["RINGTONE", "RINGTONE"],
  7158. ["FUNK", "FUNK"],
  7159. ["BLUES", "BLUES"],
  7160. ["BIRTHDAY", "BIRTHDAY"],
  7161. ["WEDDING", "WEDDING"],
  7162. ["FUNERAL", "FUNERAL"],
  7163. ["PUNCHLINE", "PUNCHLINE"],
  7164. ["PYTHON", "PYTHON"],
  7165. ["BADDY", "BADDY"],
  7166. ["CHASE", "CHASE"],
  7167. ["BA_DING", "BA_DING"],
  7168. ["WAWAWAWAA", "WAWAWAWAA"],
  7169. ["JUMP_UP", "JUMP_UP"],
  7170. ["JUMP_DOWN", "JUMP_DOWN"],
  7171. ["POWER_UP", "POWER_UP"],
  7172. ["POWER_DOWN", "POWER_DOWN"],
  7173. [Blockly.Msg.CocoRobo_MUSIC_GE_CHANG_ZU_GUO, "GE_CHANG_ZU_GUO"],
  7174. [Blockly.Msg.CocoRobo_MUSIC_DONG_FANG_HONG, "DONG_FANG_HONG"],
  7175. [Blockly.Msg.CocoRobo_MUSIC_CAI_YUN_ZHUI_YUE, "CAI_YUN_ZHUI_YUE"],
  7176. [Blockly.Msg.CocoRobo_MUSIC_ZOU_JIN_XIN_SHI_DAI, "ZOU_JIN_XIN_SHI_DAI"],
  7177. [Blockly.Msg.CocoRobo_MUSIC_MO_LI_HUA, "MO_LI_HUA"],
  7178. [Blockly.Msg.CocoRobo_MUSIC_YI_MENG_SHAN_XIAO_DIAO, "YI_MENG_SHAN_XIAO_DIAO"]
  7179. ],
  7180. type: "field_dropdown"
  7181. }, {
  7182. check: "Number",
  7183. type: "input_value",
  7184. name: "pin"
  7185. }]
  7186. })
  7187. }
  7188. };
  7189. Blockly.Blocks.CocoRobo_music_play_until_end = {
  7190. init: function () {
  7191. this.jsonInit({
  7192. inputsInline: !1,
  7193. colour: CategoryColors.Music,
  7194. nextStatement: null,
  7195. previousStatement: null,
  7196. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7197. tooltip: Blockly.Msg.CocoRobo_MUSIC_PLAY_UNTIL_END_TOOLTIP,
  7198. message0: Blockly.Msg.CocoRobo_MUSIC_PLAY_UNTIL_END_MESSAGE0,
  7199. args0: [{
  7200. name: "melody",
  7201. options: [
  7202. ["DADADADUM", "DADADADUM"],
  7203. ["ENTERTAINER", "ENTERTAINER"],
  7204. ["PRELUDE", "PRELUDE"],
  7205. ["ODE", "ODE"],
  7206. ["NYAN", "NYAN"],
  7207. ["RINGTONE", "RINGTONE"],
  7208. ["FUNK", "FUNK"],
  7209. ["BLUES", "BLUES"],
  7210. ["BIRTHDAY", "BIRTHDAY"],
  7211. ["WEDDING", "WEDDING"],
  7212. ["FUNERAL", "FUNERAL"],
  7213. ["PUNCHLINE", "PUNCHLINE"],
  7214. ["PYTHON", "PYTHON"],
  7215. ["BADDY", "BADDY"],
  7216. ["CHASE", "CHASE"],
  7217. ["BA_DING", "BA_DING"],
  7218. ["WAWAWAWAA", "WAWAWAWAA"],
  7219. ["JUMP_UP", "JUMP_UP"],
  7220. ["JUMP_DOWN", "JUMP_DOWN"],
  7221. ["POWER_UP", "POWER_UP"],
  7222. ["POWER_DOWN", "POWER_DOWN"],
  7223. [Blockly.Msg.CocoRobo_MUSIC_GE_CHANG_ZU_GUO, "GE_CHANG_ZU_GUO"],
  7224. [Blockly.Msg.CocoRobo_MUSIC_DONG_FANG_HONG, "DONG_FANG_HONG"],
  7225. [Blockly.Msg.CocoRobo_MUSIC_CAI_YUN_ZHUI_YUE, "CAI_YUN_ZHUI_YUE"],
  7226. [Blockly.Msg.CocoRobo_MUSIC_ZOU_JIN_XIN_SHI_DAI, "ZOU_JIN_XIN_SHI_DAI"],
  7227. [Blockly.Msg.CocoRobo_MUSIC_MO_LI_HUA, "MO_LI_HUA"],
  7228. [Blockly.Msg.CocoRobo_MUSIC_YI_MENG_SHAN_XIAO_DIAO, "YI_MENG_SHAN_XIAO_DIAO"]
  7229. ],
  7230. type: "field_dropdown"
  7231. }, {
  7232. check: "Number",
  7233. type: "input_value",
  7234. name: "pin"
  7235. }]
  7236. })
  7237. }
  7238. };
  7239. Blockly.Blocks.microbit_music_play_built_in = {
  7240. init: function () {
  7241. this.jsonInit({
  7242. inputsInline: !1,
  7243. colour: CategoryColors.Music,
  7244. nextStatement: null,
  7245. previousStatement: null,
  7246. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7247. tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_TOOLTIP,
  7248. message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_MESSAGE0,
  7249. args0: [{
  7250. name: "melody",
  7251. options: [
  7252. ["DADADADUM", "DADADADUM"],
  7253. ["ENTERTAINER", "ENTERTAINER"],
  7254. ["PRELUDE", "PRELUDE"],
  7255. ["ODE", "ODE"],
  7256. ["NYAN", "NYAN"],
  7257. ["RINGTONE", "RINGTONE"],
  7258. ["FUNK", "FUNK"],
  7259. ["BLUES", "BLUES"],
  7260. ["BIRTHDAY", "BIRTHDAY"],
  7261. ["WEDDING", "WEDDING"],
  7262. ["FUNERAL", "FUNERAL"],
  7263. ["PUNCHLINE", "PUNCHLINE"],
  7264. ["PYTHON", "PYTHON"],
  7265. ["BADDY", "BADDY"],
  7266. ["CHASE", "CHASE"],
  7267. ["BA_DING", "BA_DING"],
  7268. ["WAWAWAWAA", "WAWAWAWAA"],
  7269. ["JUMP_UP", "JUMP_UP"],
  7270. ["JUMP_DOWN", "JUMP_DOWN"],
  7271. ["POWER_UP", "POWER_UP"],
  7272. ["POWER_DOWN", "POWER_DOWN"],
  7273. [Blockly.Msg.CocoRobo_MUSIC_GE_CHANG_ZU_GUO, "GE_CHANG_ZU_GUO"],
  7274. [Blockly.Msg.CocoRobo_MUSIC_DONG_FANG_HONG, "DONG_FANG_HONG"],
  7275. [Blockly.Msg.CocoRobo_MUSIC_CAI_YUN_ZHUI_YUE, "CAI_YUN_ZHUI_YUE"],
  7276. [Blockly.Msg.CocoRobo_MUSIC_ZOU_JIN_XIN_SHI_DAI, "ZOU_JIN_XIN_SHI_DAI"],
  7277. [Blockly.Msg.CocoRobo_MUSIC_MO_LI_HUA, "MO_LI_HUA"],
  7278. [Blockly.Msg.CocoRobo_MUSIC_YI_MENG_SHAN_XIAO_DIAO, "YI_MENG_SHAN_XIAO_DIAO"]
  7279. ],
  7280. type: "field_dropdown"
  7281. }, {
  7282. checked: !0,
  7283. type: "field_checkbox",
  7284. name: "wait"
  7285. }, {
  7286. checked: !1,
  7287. type: "field_checkbox",
  7288. name: "loop"
  7289. }, {
  7290. check: "Number",
  7291. type: "input_value",
  7292. name: "pin"
  7293. }]
  7294. })
  7295. }
  7296. };
  7297. Blockly.Blocks.CocoRobo_music_pin_p6 = {
  7298. init: function () {
  7299. this.jsonInit({
  7300. inputsInline: !0,
  7301. output: "Number",
  7302. colour: CategoryColors.Music,
  7303. helpUrl: Blockly.Msg.CocoRobo_MUSIC_PIN_P6_HELPURL,
  7304. tooltip: Blockly.Msg.CocoRobo_MUSIC_PIN_P6_TOOLTIP,
  7305. message0: "%1",
  7306. args0: [{
  7307. options: [
  7308. [Blockly.Msg.CocoRobo_MUSIC_PIN_P6, "6"],
  7309. ["P0", "0"],
  7310. ["P1", "1"],
  7311. ["P8", "8"],
  7312. ["P9", "9"],
  7313. ["P13", "13"],
  7314. ["P14", "14"],
  7315. ["P15", "15"],
  7316. ["P16", "16"],
  7317. ["P19", "19"],
  7318. ["P20", "20"]
  7319. ],
  7320. type: "field_dropdown",
  7321. name: "music_pin"
  7322. }]
  7323. })
  7324. }
  7325. };
  7326. Blockly.Blocks.microbit_music_pitch = {
  7327. init: function () {
  7328. this.jsonInit({
  7329. inputsInline: !0,
  7330. nextStatement: null,
  7331. previousStatement: null,
  7332. colour: CategoryColors.Music,
  7333. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7334. tooltip: Blockly.Msg.MICROBIT_MUSIC_PITCH_TOOLTIP,
  7335. message0: Blockly.Msg.MICROBIT_MUSIC_PITCH_MESSAGE0,
  7336. args0: [{
  7337. check: "Number",
  7338. type: "input_value",
  7339. name: "pitch"
  7340. }, {
  7341. type: "input_dummy"
  7342. }, {
  7343. check: "Number",
  7344. type: "input_value",
  7345. name: "duration"
  7346. }, {
  7347. check: "Number",
  7348. type: "input_value",
  7349. name: "pin"
  7350. }]
  7351. })
  7352. }
  7353. };
  7354. Blockly.Blocks.microbit_music_play_list_of_notes = {
  7355. init: function () {
  7356. this.jsonInit({
  7357. colour: CategoryColors.Music,
  7358. nextStatement: null,
  7359. previousStatement: null,
  7360. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7361. tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_TOOLTIP,
  7362. message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_MESSAGE0,
  7363. args0: [{
  7364. check: "Array",
  7365. type: "input_value",
  7366. name: "notes"
  7367. }, {
  7368. checked: !0,
  7369. type: "field_checkbox",
  7370. name: "wait"
  7371. }, {
  7372. type: "input_dummy"
  7373. }, {
  7374. checked: !1,
  7375. type: "field_checkbox",
  7376. name: "loop"
  7377. }, {
  7378. check: "Number",
  7379. type: "input_value",
  7380. name: "pin"
  7381. }]
  7382. })
  7383. }
  7384. };
  7385. Blockly.Blocks.microbit_music_reset = {
  7386. init: function () {
  7387. this.jsonInit({
  7388. colour: CategoryColors.Music,
  7389. nextStatement: null,
  7390. previousStatement: null,
  7391. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7392. tooltip: Blockly.Msg.MICROBIT_MUSIC_RESET_TOOLTIP,
  7393. message0: Blockly.Msg.MICROBIT_MUSIC_RESET_MESSAGE0
  7394. })
  7395. }
  7396. };
  7397. Blockly.Blocks.microbit_music_stop = {
  7398. init: function () {
  7399. this.jsonInit({
  7400. colour: CategoryColors.Music,
  7401. nextStatement: null,
  7402. previousStatement: null,
  7403. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7404. tooltip: Blockly.Msg.MICROBIT_MUSIC_STOP_TOOLTIP,
  7405. message0: Blockly.Msg.MICROBIT_MUSIC_STOP_MESSAGE0,
  7406. args0: [{
  7407. check: "Number",
  7408. type: "input_value",
  7409. name: "pin"
  7410. }]
  7411. })
  7412. }
  7413. };
  7414. Blockly.Blocks.microbit_music_set_tempo = {
  7415. init: function () {
  7416. this.jsonInit({
  7417. inputsInline: !0,
  7418. nextStatement: null,
  7419. previousStatement: null,
  7420. colour: CategoryColors.Music,
  7421. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7422. tooltip: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_TOOLTIP,
  7423. message0: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_MESSAGE0,
  7424. args0: [{
  7425. check: "Number",
  7426. type: "input_value",
  7427. name: "ticks"
  7428. }, {
  7429. check: "Number",
  7430. type: "input_value",
  7431. name: "bpm"
  7432. }]
  7433. })
  7434. }
  7435. };
  7436. Blockly.Blocks.microbit_music_set_tempo_speed = {
  7437. init: function () {
  7438. this.jsonInit({
  7439. inputsInline: !0,
  7440. nextStatement: null,
  7441. previousStatement: null,
  7442. colour: CategoryColors.Music,
  7443. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7444. tooltip: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_SPEED_TOOLTIP,
  7445. message0: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_SPEED_MESSAGE0,
  7446. args0: [{
  7447. check: "Number",
  7448. type: "input_value",
  7449. name: "bpm"
  7450. }]
  7451. })
  7452. }
  7453. };
  7454. Blockly.Blocks.microbit_music_get_tempo = {
  7455. init: function () {
  7456. this.jsonInit({
  7457. colour: CategoryColors.Music,
  7458. output: "Array",
  7459. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7460. tooltip: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_TOOLTIP,
  7461. message0: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_MESSAGE0
  7462. })
  7463. }
  7464. };
  7465. Blockly.Blocks.CocoRobo_music_range_pitch = {
  7466. init: function () {
  7467. this.jsonInit({
  7468. colour: CategoryColors.Music,
  7469. inputsInline: !0,
  7470. nextStatement: null,
  7471. previousStatement: null,
  7472. helpUrl: Blockly.Msg.CocoRobo_music_HELPURL,
  7473. tooltip: Blockly.Msg.CocoRobo_music_range_pitch_TOOLTIP,
  7474. message0: Blockly.Msg.CocoRobo_music_range_pitch_MESSAGE0,
  7475. args0: [{
  7476. check: "Number",
  7477. type: "input_value",
  7478. name: "start"
  7479. }, {
  7480. check: "Number",
  7481. type: "input_value",
  7482. name: "end"
  7483. }, {
  7484. check: "Number",
  7485. type: "input_value",
  7486. name: "step"
  7487. }, {
  7488. check: "Number",
  7489. type: "input_value",
  7490. name: "time"
  7491. }, {
  7492. check: "Number",
  7493. type: "input_value",
  7494. name: "pin"
  7495. }]
  7496. })
  7497. }
  7498. };
  7499. Blockly.Blocks.CocoRobo_music_tone_tempo = {
  7500. init: function () {
  7501. this.jsonInit({
  7502. inputsInline: !0,
  7503. nextStatement: null,
  7504. previousStatement: null,
  7505. colour: CategoryColors.Music,
  7506. helpUrl: Blockly.Msg.CocoRobo_MUSIC_TONE_TEMPO_HELPURL,
  7507. tooltip: Blockly.Msg.CocoRobo_MUSIC_TONE_TEMPO_TOOLTIP,
  7508. message0: Blockly.Msg.CocoRobo_MUSIC_TONE_TEMPO_MESSAGE0,
  7509. args0: [{
  7510. type: "input_value",
  7511. name: "musical_note",
  7512. check: "String"
  7513. }, {
  7514. type: "input_value",
  7515. name: "pin",
  7516. check: "Number"
  7517. }]
  7518. })
  7519. }
  7520. };
  7521. Blockly.Blocks.CocoRobo_music_tone = {
  7522. init: function () {
  7523. this.jsonInit({
  7524. inputsInline: !0,
  7525. output: "Number",
  7526. colour: CategoryColors.Music,
  7527. helpUrl: Blockly.Msg.CocoRobo_MUSIC_TONE_HELPURL,
  7528. tooltip: Blockly.Msg.CocoRobo_MUSIC_TONE_TOOLTIP,
  7529. message0: Blockly.Msg.CocoRobo_MUSIC_TONE_MESSAGE0,
  7530. args0: [{
  7531. name: "music_tone",
  7532. options: music_tone_freq,
  7533. type: "field_dropdown"
  7534. }]
  7535. })
  7536. }
  7537. };
  7538. Blockly.Blocks.CocoRobo_music_musical_note = {
  7539. init: function () {
  7540. this.jsonInit({
  7541. message0: Blockly.Msg.CocoRobo_MUSIC_MUSICAL_NOTE_MESSAGE0,
  7542. args0: [{
  7543. name: "musical_note",
  7544. options: musical_note,
  7545. type: "field_dropdown"
  7546. }, {
  7547. name: "music_tick",
  7548. options: music_tick,
  7549. type: "field_dropdown"
  7550. }],
  7551. inputsInline: !0,
  7552. output: "String",
  7553. colour: CategoryColors.Music,
  7554. helpUrl: Blockly.Msg.CocoRobo_MUSIC_MUSICAL_NOTE_HELPURL,
  7555. tooltip: Blockly.Msg.CocoRobo_MUSIC_MUSICAL_NOTE_TOOLTIP
  7556. })
  7557. }
  7558. };
  7559. Blockly.Blocks.CocoRobo_music_tick = {
  7560. init: function () {
  7561. this.jsonInit({
  7562. inputsInline: !0,
  7563. output: "Number",
  7564. colour: CategoryColors.Music,
  7565. helpUrl: Blockly.Msg.CocoRobo_MUSIC_TICK_HELPURL,
  7566. tooltip: Blockly.Msg.CocoRobo_MUSIC_TICK_TOOLTIP,
  7567. message0: Blockly.Msg.CocoRobo_MUSIC_TICK_MESSAGE0,
  7568. args0: [{
  7569. name: "music_tick",
  7570. options: music_tick,
  7571. type: "field_dropdown"
  7572. }]
  7573. })
  7574. }
  7575. };
  7576. Blockly.Blocks.CocoRobo_neopixel_init = {
  7577. init: function () {
  7578. this.jsonInit({
  7579. colour: CategoryColors.Neopixel,
  7580. inputsInline: !0,
  7581. nextStatement: null,
  7582. previousStatement: null,
  7583. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7584. tooltip: Blockly.Msg.CocoRobo_neopixel_init_TOOLTIP,
  7585. message0: Blockly.Msg.CocoRobo_neopixel_init_MESSAGE0,
  7586. args0: [{
  7587. type: "field_input",
  7588. name: "neopixel_name",
  7589. text: "my_rgb"
  7590. }, {
  7591. check: "Number",
  7592. type: "input_value",
  7593. name: "analogP_IO"
  7594. }, {
  7595. check: "Number",
  7596. type: "input_value",
  7597. name: "n"
  7598. }]
  7599. })
  7600. }
  7601. };
  7602. Blockly.Blocks.CocoRobo_neopixel_single = {
  7603. init: function () {
  7604. this.jsonInit({
  7605. colour: CategoryColors.Neopixel,
  7606. inputsInline: !0,
  7607. nextStatement: null,
  7608. previousStatement: null,
  7609. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7610. tooltip: Blockly.Msg.CocoRobo_neopixel_single_TOOLTIP,
  7611. message0: Blockly.Msg.CocoRobo_neopixel_single_MESSAGE0,
  7612. args0: [{
  7613. type: "field_input",
  7614. name: "neopixel_name",
  7615. text: "my_rgb"
  7616. }, {
  7617. check: "Number",
  7618. type: "input_value",
  7619. name: "order"
  7620. }, {
  7621. check: "Number",
  7622. type: "input_value",
  7623. name: "r"
  7624. }, {
  7625. check: "Number",
  7626. type: "input_value",
  7627. name: "g"
  7628. }, {
  7629. check: "Number",
  7630. type: "input_value",
  7631. name: "b"
  7632. }]
  7633. })
  7634. }
  7635. };
  7636. Blockly.Blocks.CocoRobo_neopixel_single_gui = {
  7637. init: function () {
  7638. this.jsonInit({
  7639. colour: CategoryColors.Neopixel,
  7640. inputsInline: !0,
  7641. nextStatement: null,
  7642. previousStatement: null,
  7643. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7644. tooltip: Blockly.Msg.CocoRobo_neopixel_single_gui_TOOLTIP,
  7645. message0: Blockly.Msg.CocoRobo_neopixel_single_gui_MESSAGE0,
  7646. args0: [{
  7647. type: "field_input",
  7648. name: "neopixel_name",
  7649. text: "my_rgb"
  7650. }, {
  7651. check: "Number",
  7652. type: "input_value",
  7653. name: "order"
  7654. }, {
  7655. type: "field_colour",
  7656. name: "COLOUR",
  7657. colour: "#ff0000"
  7658. }]
  7659. })
  7660. }
  7661. };
  7662. Blockly.Blocks.CocoRobo_neopixel_show = {
  7663. init: function () {
  7664. this.jsonInit({
  7665. colour: CategoryColors.Neopixel,
  7666. inputsInline: !0,
  7667. nextStatement: null,
  7668. previousStatement: null,
  7669. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7670. tooltip: Blockly.Msg.CocoRobo_neopixel_show_TOOLTIP,
  7671. message0: Blockly.Msg.CocoRobo_neopixel_show_MESSAGE0,
  7672. args0: [{
  7673. type: "field_input",
  7674. name: "neopixel_name",
  7675. text: "my_rgb"
  7676. }]
  7677. })
  7678. }
  7679. };
  7680. Blockly.Blocks.CocoRobo_neopixel_off = {
  7681. init: function () {
  7682. this.jsonInit({
  7683. colour: CategoryColors.Neopixel,
  7684. inputsInline: !0,
  7685. nextStatement: null,
  7686. previousStatement: null,
  7687. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7688. tooltip: Blockly.Msg.CocoRobo_neopixel_off_TOOLTIP,
  7689. message0: Blockly.Msg.CocoRobo_neopixel_off_MESSAGE0,
  7690. args0: [{
  7691. type: "field_input",
  7692. name: "neopixel_name",
  7693. text: "my_rgb"
  7694. }]
  7695. })
  7696. }
  7697. };
  7698. Blockly.Blocks.CocoRobo_neopixel_all = {
  7699. init: function () {
  7700. this.jsonInit({
  7701. colour: CategoryColors.Neopixel,
  7702. inputsInline: !0,
  7703. nextStatement: null,
  7704. previousStatement: null,
  7705. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7706. tooltip: Blockly.Msg.CocoRobo_neopixel_all_TOOLTIP,
  7707. message0: Blockly.Msg.CocoRobo_neopixel_all_MESSAGE0,
  7708. args0: [{
  7709. type: "field_input",
  7710. name: "neopixel_name",
  7711. text: "my_rgb"
  7712. }, {
  7713. check: "Number",
  7714. type: "input_value",
  7715. name: "r"
  7716. }, {
  7717. check: "Number",
  7718. type: "input_value",
  7719. name: "g"
  7720. }, {
  7721. check: "Number",
  7722. type: "input_value",
  7723. name: "b"
  7724. }]
  7725. })
  7726. }
  7727. };
  7728. Blockly.Blocks.CocoRobo_neopixel_all_gui = {
  7729. init: function () {
  7730. this.jsonInit({
  7731. colour: CategoryColors.Neopixel,
  7732. inputsInline: !0,
  7733. nextStatement: null,
  7734. previousStatement: null,
  7735. helpUrl: Blockly.Msg.CocoRobo_neopixel_init_HELPURL,
  7736. tooltip: Blockly.Msg.CocoRobo_neopixel_all_gui_TOOLTIP,
  7737. message0: Blockly.Msg.CocoRobo_neopixel_all_gui_MESSAGE0,
  7738. args0: [{
  7739. type: "field_input",
  7740. name: "neopixel_name",
  7741. text: "my_rgb"
  7742. }, {
  7743. type: "field_colour",
  7744. name: "COLOUR",
  7745. colour: "#ff0000"
  7746. }]
  7747. })
  7748. }
  7749. };
  7750. Blockly.Blocks.CocoRobo_neopixel_rainbow = {
  7751. init: function () {
  7752. this.jsonInit({
  7753. colour: CategoryColors.Neopixel,
  7754. inputsInline: !0,
  7755. nextStatement: null,
  7756. previousStatement: null,
  7757. helpUrl: Blockly.Msg.CocoRobo_NEOPIXEL_RAINBOW_HELPURL,
  7758. tooltip: Blockly.Msg.CocoRobo_NEOPIXEL_RAINBOW_TOOLTIP,
  7759. message0: Blockly.Msg.CocoRobo_NEOPIXEL_RAINBOW_MESSAGE0,
  7760. args0: [{
  7761. type: "field_input",
  7762. name: "neopixel_name",
  7763. text: "my_rgb"
  7764. }, {
  7765. check: "Number",
  7766. type: "input_value",
  7767. name: "n"
  7768. }, {
  7769. check: "Number",
  7770. type: "input_value",
  7771. name: "bright"
  7772. }, {
  7773. check: "Number",
  7774. type: "input_value",
  7775. name: "offset"
  7776. }]
  7777. })
  7778. }
  7779. };
  7780. Blockly.Blocks.CocoRobo_neopixel_brightness = {
  7781. init: function () {
  7782. this.jsonInit({
  7783. colour: CategoryColors.Neopixel,
  7784. inputsInline: !0,
  7785. nextStatement: null,
  7786. previousStatement: null,
  7787. helpUrl: Blockly.Msg.CocoRobo_NEOPIXEL_BRIGHTNESS_HELPURL,
  7788. tooltip: Blockly.Msg.CocoRobo_NEOPIXEL_BRIGHTNESS_TOOLTIP,
  7789. message0: Blockly.Msg.CocoRobo_NEOPIXEL_BRIGHTNESS_MESSAGE0,
  7790. args0: [{
  7791. type: "field_input",
  7792. name: "neopixel_name",
  7793. text: "my_rgb"
  7794. }, {
  7795. check: "Number",
  7796. type: "input_value",
  7797. name: "bright"
  7798. }]
  7799. })
  7800. }
  7801. };
  7802. Blockly.Blocks.CocoRobo_display_FrameBuffer = {
  7803. init: function () {
  7804. this.jsonInit({
  7805. inputsInline: !0,
  7806. nextStatement: null,
  7807. previousStatement: null,
  7808. colour: CategoryColors.Show,
  7809. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7810. tooltip: Blockly.Msg.CocoRobo_display_FrameBuffer_TOOLTIP,
  7811. message0: Blockly.Msg.CocoRobo_display_FrameBuffer_MESSAGE0,
  7812. args0: [{
  7813. check: ["Array"],
  7814. type: "input_value",
  7815. name: "bmp"
  7816. }, {
  7817. check: "Number",
  7818. type: "input_value",
  7819. name: "w"
  7820. }, {
  7821. check: "Number",
  7822. type: "input_value",
  7823. name: "h"
  7824. }, {
  7825. name: "scan_mode",
  7826. options: [
  7827. [Blockly.Msg.CocoRobo_horizontal, "HLSB"],
  7828. [Blockly.Msg.CocoRobo_vertical, "VLSB"]
  7829. ],
  7830. type: "field_dropdown"
  7831. }]
  7832. })
  7833. }
  7834. };
  7835. Blockly.Blocks.CocoRobo_display_blit = {
  7836. init: function () {
  7837. this.jsonInit({
  7838. inputsInline: !0,
  7839. nextStatement: null,
  7840. previousStatement: null,
  7841. colour: CategoryColors.Show,
  7842. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7843. tooltip: Blockly.Msg.CocoRobo_display_blit_TOOLTIP,
  7844. message0: Blockly.Msg.CocoRobo_display_blit_MESSAGE0,
  7845. args0: [{
  7846. check: "Number",
  7847. type: "input_value",
  7848. name: "x"
  7849. }, {
  7850. check: "Number",
  7851. type: "input_value",
  7852. name: "y"
  7853. }]
  7854. })
  7855. }
  7856. };
  7857. Blockly.Blocks.CocoRobo_front_reverse = {
  7858. init: function () {
  7859. this.jsonInit({
  7860. inputsInline: !0,
  7861. nextStatement: null,
  7862. previousStatement: null,
  7863. colour: CategoryColors.Show,
  7864. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7865. tooltip: Blockly.Msg.CocoRobo_front_reverse_TOOLTIP,
  7866. message0: Blockly.Msg.CocoRobo_front_reverse_MESSAGE0,
  7867. args0: [{
  7868. name: "front_reverse",
  7869. options: [
  7870. [Blockly.Msg.CocoRobo_front, "0"],
  7871. [Blockly.Msg.CocoRobo_reverse, "1"]
  7872. ],
  7873. type: "field_dropdown"
  7874. }]
  7875. })
  7876. }
  7877. };
  7878. Blockly.Blocks.CocoRobo_images_append = {
  7879. init: function () {
  7880. this.jsonInit({
  7881. inputsInline: !0,
  7882. nextStatement: null,
  7883. previousStatement: null,
  7884. colour: CategoryColors.Show,
  7885. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7886. tooltip: Blockly.Msg.CocoRobo_images_append_TOOLTIP,
  7887. message0: Blockly.Msg.CocoRobo_images_append_MESSAGE0,
  7888. args0: [{
  7889. check: "Number",
  7890. type: "input_value",
  7891. name: "num"
  7892. }, {
  7893. check: "Number",
  7894. type: "input_value",
  7895. name: "period"
  7896. }, {
  7897. check: "Number",
  7898. type: "input_value",
  7899. name: "Length"
  7900. }, {
  7901. check: "Number",
  7902. type: "input_value",
  7903. name: "Width"
  7904. }]
  7905. })
  7906. }
  7907. };
  7908. Blockly.Blocks.CocoRobo_display_Show = {
  7909. init: function () {
  7910. this.jsonInit({
  7911. nextStatement: null,
  7912. previousStatement: null,
  7913. colour: CategoryColors.Show,
  7914. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7915. tooltip: Blockly.Msg.CocoRobo_display_Show_TOOLTIP,
  7916. message0: Blockly.Msg.CocoRobo_display_Show_MESSAGE0
  7917. })
  7918. }
  7919. };
  7920. Blockly.Blocks.CocoRobo_display_DispChar = {
  7921. init: function () {
  7922. this.jsonInit({
  7923. inputsInline: !0,
  7924. nextStatement: null,
  7925. previousStatement: null,
  7926. colour: CategoryColors.Show,
  7927. helpUrl: Blockly.Msg.CocoRobo_display_DispChar_HELPURL,
  7928. tooltip: Blockly.Msg.CocoRobo_display_DispChar_TOOLTIP,
  7929. message0: Blockly.Msg.CocoRobo_display_DispChar_MESSAGE0,
  7930. args0: [{
  7931. check: "Number",
  7932. type: "input_value",
  7933. name: "x"
  7934. }, {
  7935. check: "Number",
  7936. type: "input_value",
  7937. name: "y"
  7938. }, {
  7939. check: "String",
  7940. type: "input_value",
  7941. name: "message"
  7942. }, {
  7943. options: [
  7944. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_1, "1"],
  7945. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_2, "2"],
  7946. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_3, "3"],
  7947. ["XOR", "4"]
  7948. ],
  7949. type: "field_dropdown",
  7950. name: "TEXTMODE"
  7951. }]
  7952. })
  7953. }
  7954. };
  7955. Blockly.Blocks.CocoRobo_display_DispChar_5lines = {
  7956. init: function () {
  7957. this.jsonInit({
  7958. inputsInline: !0,
  7959. nextStatement: null,
  7960. previousStatement: null,
  7961. colour: CategoryColors.Show,
  7962. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  7963. tooltip: Blockly.Msg.CocoRobo_display_DispChar_5lines_TOOLTIP,
  7964. message0: Blockly.Msg.CocoRobo_display_DispChar_5lines_MESSAGE0,
  7965. args0: [{
  7966. type: "input_value",
  7967. name: "DispChar_5lines"
  7968. }, {
  7969. check: "String",
  7970. type: "input_value",
  7971. name: "message"
  7972. }, {
  7973. options: [
  7974. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_1, "1"],
  7975. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_2, "2"],
  7976. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_3, "3"],
  7977. ["XOR", "4"]
  7978. ],
  7979. type: "field_dropdown",
  7980. name: "TEXTMODE"
  7981. }]
  7982. })
  7983. }
  7984. };
  7985. Blockly.Blocks.CocoRobo_clear_dispchar_5lines = {
  7986. init: function () {
  7987. this.jsonInit({
  7988. inputsInline: !0,
  7989. nextStatement: null,
  7990. previousStatement: null,
  7991. colour: CategoryColors.Show,
  7992. helpUrl: Blockly.Msg.CocoRobo_CLEAR_DISPCHAR_5LINES_HELPURL,
  7993. tooltip: Blockly.Msg.CocoRobo_CLEAR_DISPCHAR_5LINES_TOOLTIP,
  7994. message0: Blockly.Msg.CocoRobo_CLEAR_DISPCHAR_5LINES_MESSAGE0,
  7995. args0: [{
  7996. name: "DispChar_5lines",
  7997. type: "input_value"
  7998. }]
  7999. })
  8000. }
  8001. };
  8002. Blockly.Blocks.CocoRobo_4_lines = {
  8003. init: function () {
  8004. this.jsonInit({
  8005. message0: Blockly.Msg.CocoRobo_4_LINES_MESSAGE0,
  8006. args0: [{
  8007. name: "CocoRobo_4_lines",
  8008. options: [
  8009. ["1", "0"],
  8010. ["2", "16"],
  8011. ["3", "32"],
  8012. ["4", "48"]
  8013. ],
  8014. type: "field_dropdown"
  8015. }],
  8016. inputsInline: !0,
  8017. output: "Number",
  8018. colour: CategoryColors.Show,
  8019. helpUrl: Blockly.Msg.CocoRobo_4_LINES_HELPURL,
  8020. tooltip: Blockly.Msg.CocoRobo_4_LINES_TOOLTIP
  8021. })
  8022. }
  8023. };
  8024. Blockly.Blocks.CocoRobo_display_fill = {
  8025. init: function () {
  8026. this.jsonInit({
  8027. message0: "%1 %2 " + Blockly.Msg.CocoRobo_display_fill_MESSAGE0,
  8028. args0: [{
  8029. type: "field_image",
  8030. src: "blockly/media/screen_init_header.png",
  8031. width: "42",
  8032. height: "42",
  8033. alt: "*",
  8034. flipRtl: false
  8035. },
  8036. {
  8037. type: "input_dummy"
  8038. }
  8039. ],
  8040. colour: CategoryColors.Show,
  8041. // args0: [{
  8042. // name: "display_fill",
  8043. // options: [[Blockly.Msg.CocoRobo_display_fill_O, "fill(0)"]], //[Blockly.Msg.CocoRobo_display_fill_0, "fill(0)"], [Blockly.Msg.CocoRobo_display_fill_1, "fill(1)"], [Blockly.Msg.CocoRobo_display_invert_0, "invert(0)"], [Blockly.Msg.CocoRobo_display_invert_1, "invert(1)"]
  8044. // type: "field_dropdown"
  8045. // }],
  8046. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8047. tooltip: Blockly.Msg.CocoRobo_display_fill_TOOLTIP,
  8048. previousStatement: null,
  8049. nextStatement: null
  8050. // message0:
  8051. })
  8052. }
  8053. };
  8054. Blockly.Blocks.CocoRobo_lcd_pixel_option = {
  8055. init: function () {
  8056. this.jsonInit({
  8057. colour: CategoryColors.Show,
  8058. output: "Number",
  8059. helpUrl: "",
  8060. tooltip: "",
  8061. message0: "%1",
  8062. args0: [{
  8063. options: [
  8064. [Blockly.Msg.CocoRobo_display_pixel_1, "1"],
  8065. [Blockly.Msg.CocoRobo_display_pixel_0, "0"]
  8066. ],
  8067. type: "field_dropdown",
  8068. name: "VALUE"
  8069. }]
  8070. })
  8071. }
  8072. };
  8073. Blockly.Blocks.CocoRobo_display_pixel = {
  8074. init: function () {
  8075. this.jsonInit({
  8076. inputsInline: !0,
  8077. nextStatement: null,
  8078. previousStatement: null,
  8079. colour: CategoryColors.Show,
  8080. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8081. tooltip: Blockly.Msg.CocoRobo_display_pixel_TOOLTIP,
  8082. message0: Blockly.Msg.CocoRobo_display_pixel_MESSAGE0,
  8083. args0: [{
  8084. check: "Number",
  8085. type: "input_value",
  8086. name: "x"
  8087. }, {
  8088. check: "Number",
  8089. type: "input_value",
  8090. name: "y"
  8091. }, {
  8092. check: "Number",
  8093. type: "input_value",
  8094. name: "display_pixel"
  8095. }]
  8096. })
  8097. }
  8098. };
  8099. Blockly.Blocks.CocoRobo_ProgressBar = {
  8100. init: function () {
  8101. this.jsonInit({
  8102. colour: CategoryColors.Show,
  8103. args0: [{
  8104. type: "input_dummy"
  8105. }, {
  8106. name: "x",
  8107. type: "input_value",
  8108. check: "Number"
  8109. }, {
  8110. name: "y",
  8111. type: "input_value",
  8112. check: "Number"
  8113. }, {
  8114. name: "width",
  8115. type: "input_value",
  8116. check: "Number"
  8117. }, {
  8118. name: "height",
  8119. type: "input_value",
  8120. check: "Number"
  8121. }, {
  8122. name: "progress",
  8123. type: "input_value",
  8124. check: "Number"
  8125. }],
  8126. inputsInline: !0,
  8127. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8128. tooltip: Blockly.Msg.CocoRobo_ProgressBar_TOOLTIP,
  8129. message0: Blockly.Msg.CocoRobo_ProgressBar_MESSAGE0,
  8130. nextStatement: null,
  8131. previousStatement: null
  8132. })
  8133. }
  8134. };
  8135. Blockly.Blocks.CocoRobo_stripBar = {
  8136. init: function () {
  8137. this.jsonInit({
  8138. colour: CategoryColors.Show,
  8139. args0: [{
  8140. name: "dir_h_v",
  8141. options: [
  8142. [Blockly.Msg.CocoRobo_vertical, "0"],
  8143. [Blockly.Msg.CocoRobo_horizontal, "1"]
  8144. ],
  8145. type: "field_dropdown"
  8146. }, {
  8147. name: "x",
  8148. type: "input_value",
  8149. check: "Number"
  8150. }, {
  8151. name: "y",
  8152. type: "input_value",
  8153. check: "Number"
  8154. }, {
  8155. name: "width",
  8156. type: "input_value",
  8157. check: "Number"
  8158. }, {
  8159. name: "height",
  8160. type: "input_value",
  8161. check: "Number"
  8162. }, {
  8163. name: "progress",
  8164. type: "input_value",
  8165. check: "Number"
  8166. }],
  8167. inputsInline: !0,
  8168. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8169. tooltip: Blockly.Msg.CocoRobo_stripBar_TOOLTIP,
  8170. message0: Blockly.Msg.CocoRobo_stripBar_MESSAGE0,
  8171. nextStatement: null,
  8172. previousStatement: null
  8173. })
  8174. }
  8175. };
  8176. Blockly.Blocks.CocoRobo_display_hvline = {
  8177. init: function () {
  8178. this.jsonInit({
  8179. colour: CategoryColors.Show,
  8180. args0: [{
  8181. name: "state",
  8182. options: [
  8183. [Blockly.Msg.CocoRobo_DISPLAY_MODE_1, "1"],
  8184. [Blockly.Msg.CocoRobo_DISPLAY_MODE_0, "0"]
  8185. ],
  8186. type: "field_dropdown"
  8187. }, {
  8188. name: "dir_h_v",
  8189. options: [
  8190. [Blockly.Msg.CocoRobo_vertical, "0"],
  8191. [Blockly.Msg.CocoRobo_horizontal, "1"]
  8192. ],
  8193. type: "field_dropdown"
  8194. }, {
  8195. type: "input_dummy"
  8196. }, {
  8197. name: "x",
  8198. type: "input_value",
  8199. check: "Number"
  8200. }, {
  8201. name: "y",
  8202. type: "input_value",
  8203. check: "Number"
  8204. }, {
  8205. name: "length",
  8206. type: "input_value",
  8207. check: "Number"
  8208. }],
  8209. inputsInline: !0,
  8210. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8211. tooltip: Blockly.Msg.CocoRobo_DISPLAY_HVLINE_TOOLTIP,
  8212. message0: Blockly.Msg.CocoRobo_DISPLAY_HVLINE_MESSAGE0,
  8213. nextStatement: null,
  8214. previousStatement: null
  8215. })
  8216. }
  8217. };
  8218. Blockly.Blocks.CocoRobo_display_hline = {
  8219. init: function () {
  8220. this.jsonInit({
  8221. colour: CategoryColors.Show,
  8222. args0: [{
  8223. name: "state",
  8224. options: [
  8225. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8226. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8227. ],
  8228. type: "field_dropdown"
  8229. }, {
  8230. type: "input_dummy"
  8231. }, {
  8232. name: "x",
  8233. type: "input_value",
  8234. check: "Number"
  8235. }, {
  8236. name: "y",
  8237. type: "input_value",
  8238. check: "Number"
  8239. }, {
  8240. name: "length",
  8241. type: "input_value",
  8242. check: "Number"
  8243. }],
  8244. inputsInline: !0,
  8245. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8246. tooltip: Blockly.Msg.CocoRobo_display_hline_TOOLTIP,
  8247. message0: Blockly.Msg.CocoRobo_display_hline_MESSAGE0,
  8248. nextStatement: null,
  8249. previousStatement: null
  8250. })
  8251. }
  8252. };
  8253. Blockly.Blocks.CocoRobo_display_vline = {
  8254. init: function () {
  8255. this.jsonInit({
  8256. colour: CategoryColors.Show,
  8257. args0: [{
  8258. name: "state",
  8259. options: [
  8260. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8261. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8262. ],
  8263. type: "field_dropdown"
  8264. }, {
  8265. type: "input_dummy"
  8266. }, {
  8267. name: "x",
  8268. type: "input_value",
  8269. check: "Number"
  8270. }, {
  8271. name: "y",
  8272. type: "input_value",
  8273. check: "Number"
  8274. }, {
  8275. name: "length",
  8276. type: "input_value",
  8277. check: "Number"
  8278. }],
  8279. inputsInline: !0,
  8280. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8281. tooltip: Blockly.Msg.CocoRobo_display_vline_TOOLTIP,
  8282. message0: Blockly.Msg.CocoRobo_display_vline_MESSAGE0,
  8283. nextStatement: null,
  8284. previousStatement: null
  8285. })
  8286. }
  8287. };
  8288. Blockly.Blocks.CocoRobo_display_line = {
  8289. init: function () {
  8290. this.jsonInit({
  8291. colour: CategoryColors.Show,
  8292. args0: [{
  8293. name: "state",
  8294. options: [
  8295. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8296. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8297. ],
  8298. type: "field_dropdown"
  8299. }, {
  8300. type: "input_dummy"
  8301. }, {
  8302. name: "x1",
  8303. type: "input_value",
  8304. check: "Number"
  8305. }, {
  8306. name: "y1",
  8307. type: "input_value",
  8308. check: "Number"
  8309. }, {
  8310. name: "x2",
  8311. type: "input_value",
  8312. check: "Number"
  8313. }, {
  8314. name: "y2",
  8315. type: "input_value",
  8316. check: "Number"
  8317. }],
  8318. inputsInline: !0,
  8319. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8320. tooltip: Blockly.Msg.CocoRobo_display_line_TOOLTIP,
  8321. message0: Blockly.Msg.CocoRobo_display_line_MESSAGE0,
  8322. nextStatement: null,
  8323. previousStatement: null
  8324. })
  8325. }
  8326. };
  8327. Blockly.Blocks.CocoRobo_display_shape_rect = {
  8328. init: function () {
  8329. this.jsonInit({
  8330. colour: CategoryColors.Show,
  8331. args0: [{
  8332. name: "state",
  8333. options: [
  8334. [Blockly.Msg.CocoRobo_DISPLAY_MODE_1, "1"],
  8335. [Blockly.Msg.CocoRobo_DISPLAY_MODE_0, "0"]
  8336. ],
  8337. type: "field_dropdown"
  8338. }, {
  8339. name: "shape",
  8340. options: [
  8341. [Blockly.Msg.CocoRobo_DISPLAY_HOLLOW, "rect"],
  8342. [Blockly.Msg.CocoRobo_DISPLAY_SOLID, "fill_rect"]
  8343. ],
  8344. type: "field_dropdown"
  8345. }, {
  8346. type: "input_dummy"
  8347. }, {
  8348. name: "x",
  8349. type: "input_value",
  8350. check: "Number"
  8351. }, {
  8352. name: "y",
  8353. type: "input_value",
  8354. check: "Number"
  8355. }, {
  8356. name: "w",
  8357. type: "input_value",
  8358. check: "Number"
  8359. }, {
  8360. name: "h",
  8361. type: "input_value",
  8362. check: "Number"
  8363. }],
  8364. inputsInline: !0,
  8365. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8366. tooltip: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_RECT_TOOLTIP,
  8367. message0: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_RECT_MESSAGE0,
  8368. nextStatement: null,
  8369. previousStatement: null
  8370. })
  8371. }
  8372. };
  8373. Blockly.Blocks.CocoRobo_display_rect = {
  8374. init: function () {
  8375. this.jsonInit({
  8376. colour: CategoryColors.Show,
  8377. args0: [{
  8378. name: "state",
  8379. options: [
  8380. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8381. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8382. ],
  8383. type: "field_dropdown"
  8384. }, {
  8385. type: "input_dummy"
  8386. }, {
  8387. name: "x",
  8388. type: "input_value",
  8389. check: "Number"
  8390. }, {
  8391. name: "y",
  8392. type: "input_value",
  8393. check: "Number"
  8394. }, {
  8395. name: "w",
  8396. type: "input_value",
  8397. check: "Number"
  8398. }, {
  8399. name: "h",
  8400. type: "input_value",
  8401. check: "Number"
  8402. }],
  8403. inputsInline: !0,
  8404. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8405. tooltip: Blockly.Msg.CocoRobo_display_rect_TOOLTIP,
  8406. message0: Blockly.Msg.CocoRobo_display_rect_MESSAGE0,
  8407. nextStatement: null,
  8408. previousStatement: null
  8409. })
  8410. }
  8411. };
  8412. Blockly.Blocks.CocoRobo_display_RoundRect = {
  8413. init: function () {
  8414. this.jsonInit({
  8415. colour: CategoryColors.Show,
  8416. args0: [{
  8417. name: "state",
  8418. options: [
  8419. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8420. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8421. ],
  8422. type: "field_dropdown"
  8423. }, {
  8424. type: "input_dummy"
  8425. }, {
  8426. name: "x",
  8427. type: "input_value",
  8428. check: "Number"
  8429. }, {
  8430. name: "y",
  8431. type: "input_value",
  8432. check: "Number"
  8433. }, {
  8434. name: "w",
  8435. type: "input_value",
  8436. check: "Number"
  8437. }, {
  8438. name: "h",
  8439. type: "input_value",
  8440. check: "Number"
  8441. }, {
  8442. name: "r",
  8443. type: "input_value",
  8444. check: "Number"
  8445. }],
  8446. inputsInline: !0,
  8447. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8448. tooltip: Blockly.Msg.CocoRobo_display_RoundRect_TOOLTIP,
  8449. message0: Blockly.Msg.CocoRobo_display_RoundRect_MESSAGE0,
  8450. nextStatement: null,
  8451. previousStatement: null
  8452. })
  8453. }
  8454. };
  8455. Blockly.Blocks.CocoRobo_display_fill_rect = {
  8456. init: function () {
  8457. this.jsonInit({
  8458. colour: CategoryColors.Show,
  8459. args0: [{
  8460. name: "state",
  8461. options: [
  8462. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8463. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8464. ],
  8465. type: "field_dropdown"
  8466. }, {
  8467. type: "input_dummy"
  8468. }, {
  8469. name: "x",
  8470. type: "input_value",
  8471. check: "Number"
  8472. }, {
  8473. name: "y",
  8474. type: "input_value",
  8475. check: "Number"
  8476. }, {
  8477. name: "w",
  8478. type: "input_value",
  8479. check: "Number"
  8480. }, {
  8481. name: "h",
  8482. type: "input_value",
  8483. check: "Number"
  8484. }],
  8485. inputsInline: !0,
  8486. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8487. tooltip: Blockly.Msg.CocoRobo_display_fill_rect_TOOLTIP,
  8488. message0: Blockly.Msg.CocoRobo_display_fill_rect_MESSAGE0,
  8489. nextStatement: null,
  8490. previousStatement: null
  8491. })
  8492. }
  8493. };
  8494. Blockly.Blocks.CocoRobo_display_shape_circle = {
  8495. init: function () {
  8496. this.jsonInit({
  8497. colour: CategoryColors.Show,
  8498. args0: [{
  8499. name: "state",
  8500. options: [
  8501. [Blockly.Msg.CocoRobo_DISPLAY_MODE_1, "1"],
  8502. [Blockly.Msg.CocoRobo_DISPLAY_MODE_0, "0"]
  8503. ],
  8504. type: "field_dropdown"
  8505. }, {
  8506. name: "shape",
  8507. options: [
  8508. [Blockly.Msg.CocoRobo_DISPLAY_HOLLOW, "circle"],
  8509. [Blockly.Msg.CocoRobo_DISPLAY_SOLID, "fill_circle"]
  8510. ],
  8511. type: "field_dropdown"
  8512. }, {
  8513. type: "input_dummy"
  8514. }, {
  8515. name: "x",
  8516. type: "input_value",
  8517. check: "Number"
  8518. }, {
  8519. name: "y",
  8520. type: "input_value",
  8521. check: "Number"
  8522. }, {
  8523. name: "radius",
  8524. type: "input_value",
  8525. check: "Number"
  8526. }],
  8527. inputsInline: !0,
  8528. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8529. tooltip: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_CIRCLE_TOOLTIP,
  8530. message0: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_CIRCLE_MESSAGE0,
  8531. nextStatement: null,
  8532. previousStatement: null
  8533. })
  8534. }
  8535. };
  8536. Blockly.Blocks.CocoRobo_display_fill_circle = {
  8537. init: function () {
  8538. this.jsonInit({
  8539. colour: CategoryColors.Show,
  8540. args0: [{
  8541. name: "state",
  8542. options: [
  8543. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8544. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8545. ],
  8546. type: "field_dropdown"
  8547. }, {
  8548. type: "input_dummy"
  8549. }, {
  8550. name: "x",
  8551. type: "input_value",
  8552. check: "Number"
  8553. }, {
  8554. name: "y",
  8555. type: "input_value",
  8556. check: "Number"
  8557. }, {
  8558. name: "radius",
  8559. type: "input_value",
  8560. check: "Number"
  8561. }],
  8562. inputsInline: !0,
  8563. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8564. tooltip: Blockly.Msg.CocoRobo_display_fill_circle_TOOLTIP,
  8565. message0: Blockly.Msg.CocoRobo_display_fill_circle_MESSAGE0,
  8566. nextStatement: null,
  8567. previousStatement: null
  8568. })
  8569. }
  8570. };
  8571. Blockly.Blocks.CocoRobo_display_circle = {
  8572. init: function () {
  8573. this.jsonInit({
  8574. colour: CategoryColors.Show,
  8575. args0: [{
  8576. name: "state",
  8577. options: [
  8578. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8579. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8580. ],
  8581. type: "field_dropdown"
  8582. }, {
  8583. type: "input_dummy"
  8584. }, {
  8585. name: "x",
  8586. type: "input_value",
  8587. check: "Number"
  8588. }, {
  8589. name: "y",
  8590. type: "input_value",
  8591. check: "Number"
  8592. }, {
  8593. name: "radius",
  8594. type: "input_value",
  8595. check: "Number"
  8596. }],
  8597. inputsInline: !0,
  8598. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8599. tooltip: Blockly.Msg.CocoRobo_display_circle_TOOLTIP,
  8600. message0: Blockly.Msg.CocoRobo_display_circle_MESSAGE0,
  8601. nextStatement: null,
  8602. previousStatement: null
  8603. })
  8604. }
  8605. };
  8606. Blockly.Blocks.CocoRobo_display_shape_triangle = {
  8607. init: function () {
  8608. this.jsonInit({
  8609. colour: CategoryColors.Show,
  8610. args0: [{
  8611. name: "state",
  8612. options: [
  8613. [Blockly.Msg.CocoRobo_DISPLAY_MODE_1, "1"],
  8614. [Blockly.Msg.CocoRobo_DISPLAY_MODE_0, "0"]
  8615. ],
  8616. type: "field_dropdown"
  8617. }, {
  8618. name: "shape",
  8619. options: [
  8620. [Blockly.Msg.CocoRobo_DISPLAY_HOLLOW, "triangle"],
  8621. [Blockly.Msg.CocoRobo_DISPLAY_SOLID, "fill_triangle"]
  8622. ],
  8623. type: "field_dropdown"
  8624. }, {
  8625. type: "input_dummy"
  8626. }, {
  8627. name: "x",
  8628. type: "input_value",
  8629. check: "Number"
  8630. }, {
  8631. name: "y",
  8632. type: "input_value",
  8633. check: "Number"
  8634. }, {
  8635. name: "x2",
  8636. type: "input_value",
  8637. check: "Number"
  8638. }, {
  8639. name: "y2",
  8640. type: "input_value",
  8641. check: "Number"
  8642. }, {
  8643. name: "x3",
  8644. type: "input_value",
  8645. check: "Number"
  8646. }, {
  8647. name: "y3",
  8648. type: "input_value",
  8649. check: "Number"
  8650. }],
  8651. inputsInline: !0,
  8652. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8653. tooltip: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_TRIANGLE_TOOLTIP,
  8654. message0: Blockly.Msg.CocoRobo_DISPLAY_SHAPE_TRIANGLE_MESSAGE0,
  8655. nextStatement: null,
  8656. previousStatement: null
  8657. })
  8658. }
  8659. };
  8660. Blockly.Blocks.CocoRobo_display_triangle = {
  8661. init: function () {
  8662. this.jsonInit({
  8663. colour: CategoryColors.Show,
  8664. args0: [{
  8665. name: "state",
  8666. options: [
  8667. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8668. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8669. ],
  8670. type: "field_dropdown"
  8671. }, {
  8672. type: "input_dummy"
  8673. }, {
  8674. name: "x",
  8675. type: "input_value",
  8676. check: "Number"
  8677. }, {
  8678. name: "y",
  8679. type: "input_value",
  8680. check: "Number"
  8681. }, {
  8682. name: "x2",
  8683. type: "input_value",
  8684. check: "Number"
  8685. }, {
  8686. name: "y2",
  8687. type: "input_value",
  8688. check: "Number"
  8689. }, {
  8690. name: "x3",
  8691. type: "input_value",
  8692. check: "Number"
  8693. }, {
  8694. name: "y3",
  8695. type: "input_value",
  8696. check: "Number"
  8697. }],
  8698. inputsInline: !0,
  8699. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8700. tooltip: Blockly.Msg.CocoRobo_display_triangle_TOOLTIP,
  8701. message0: Blockly.Msg.CocoRobo_display_triangle_MESSAGE0,
  8702. nextStatement: null,
  8703. previousStatement: null
  8704. })
  8705. }
  8706. };
  8707. Blockly.Blocks.CocoRobo_display_fill_triangle = {
  8708. init: function () {
  8709. this.jsonInit({
  8710. colour: CategoryColors.Show,
  8711. args0: [{
  8712. name: "state",
  8713. options: [
  8714. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8715. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8716. ],
  8717. type: "field_dropdown"
  8718. }, {
  8719. type: "input_dummy"
  8720. }, {
  8721. name: "x",
  8722. type: "input_value",
  8723. check: "Number"
  8724. }, {
  8725. name: "y",
  8726. type: "input_value",
  8727. check: "Number"
  8728. }, {
  8729. name: "x2",
  8730. type: "input_value",
  8731. check: "Number"
  8732. }, {
  8733. name: "y2",
  8734. type: "input_value",
  8735. check: "Number"
  8736. }, {
  8737. name: "x3",
  8738. type: "input_value",
  8739. check: "Number"
  8740. }, {
  8741. name: "y3",
  8742. type: "input_value",
  8743. check: "Number"
  8744. }],
  8745. inputsInline: !0,
  8746. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8747. tooltip: Blockly.Msg.CocoRobo_display_fill_triangle_TOOLTIP,
  8748. message0: Blockly.Msg.CocoRobo_display_fill_triangle_MESSAGE0,
  8749. nextStatement: null,
  8750. previousStatement: null
  8751. })
  8752. }
  8753. };
  8754. Blockly.Blocks.CocoRobo_display_Bitmap = {
  8755. init: function () {
  8756. this.jsonInit({
  8757. colour: CategoryColors.Show,
  8758. args0: [{
  8759. name: "state",
  8760. options: [
  8761. [Blockly.Msg.CocoRobo_display_hline_1, "1"],
  8762. [Blockly.Msg.CocoRobo_display_hline_0, "0"]
  8763. ],
  8764. type: "field_dropdown"
  8765. }, {
  8766. name: "x",
  8767. type: "input_value",
  8768. check: "Number"
  8769. }, {
  8770. name: "y",
  8771. type: "input_value",
  8772. check: "Number"
  8773. }, {
  8774. name: "w",
  8775. type: "input_value",
  8776. check: "Number"
  8777. }, {
  8778. name: "h",
  8779. type: "input_value",
  8780. check: "Number"
  8781. }, {
  8782. check: ["String", "Array"],
  8783. type: "input_value",
  8784. name: "Bitmap"
  8785. }],
  8786. inputsInline: !0,
  8787. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  8788. tooltip: Blockly.Msg.CocoRobo_display_Bitmap_TOOLTIP,
  8789. message0: Blockly.Msg.CocoRobo_display_Bitmap_MESSAGE0,
  8790. nextStatement: null,
  8791. previousStatement: null
  8792. })
  8793. }
  8794. };
  8795. Blockly.Blocks.CocoRobo_get_pbm_data = {
  8796. init: function () {
  8797. this.jsonInit({
  8798. colour: CategoryColors.Show,
  8799. args0: [{
  8800. check: "String",
  8801. type: "input_value",
  8802. name: "file_path"
  8803. }, {
  8804. name: "select",
  8805. check: "String",
  8806. type: "field_dropdown",
  8807. options: [
  8808. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_1, "0"],
  8809. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_2, "1"]
  8810. ]
  8811. }],
  8812. output: "Array",
  8813. helpUrl: Blockly.Msg.CocoRobo_GET_PBM_DATA_HELPURL,
  8814. tooltip: Blockly.Msg.CocoRobo_GET_PBM_DATA_TOOLTIP,
  8815. message0: Blockly.Msg.CocoRobo_GET_PBM_DATA_MESSAGE0
  8816. })
  8817. }
  8818. };
  8819. Blockly.Blocks.CocoRobo_get_pbm_data_custom = {
  8820. init: function () {
  8821. this.jsonInit({
  8822. colour: CategoryColors.Show,
  8823. args0: [{
  8824. check: "String",
  8825. type: "input_value",
  8826. name: "file_path"
  8827. }, {
  8828. name: "select",
  8829. check: "String",
  8830. type: "field_dropdown",
  8831. options: [
  8832. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_1, "0"],
  8833. [Blockly.Msg.CocoRobo_DISPCHAR_MODE_2, "1"]
  8834. ]
  8835. }],
  8836. output: "Array",
  8837. helpUrl: Blockly.Msg.CocoRobo_GET_PBM_DATA_HELPURL,
  8838. tooltip: Blockly.Msg.CocoRobo_GET_PBM_DATA_TOOLTIP,
  8839. message0: Blockly.Msg.CocoRobo_GET_PBM_DATA_CUSTOM_MESSAGE0
  8840. })
  8841. }
  8842. };
  8843. Blockly.Blocks.CocoRobo_display_pbm_data = {
  8844. init: function () {
  8845. this.jsonInit({
  8846. colour: CategoryColors.Show,
  8847. args0: [{
  8848. name: "x",
  8849. type: "input_value",
  8850. check: "Number"
  8851. }, {
  8852. name: "y",
  8853. type: "input_value",
  8854. check: "Number"
  8855. }, {
  8856. check: "Array",
  8857. type: "input_value",
  8858. name: "pbm_data"
  8859. }],
  8860. inputsInline: !0,
  8861. helpUrl: Blockly.Msg.CocoRobo_DISPLAY_PBM_DATA_HELPURL,
  8862. tooltip: Blockly.Msg.CocoRobo_DISPLAY_PBM_DATA_TOOLTIP,
  8863. message0: Blockly.Msg.CocoRobo_DISPLAY_PBM_DATA_MESSAGE0,
  8864. nextStatement: null,
  8865. previousStatement: null
  8866. })
  8867. }
  8868. };
  8869. Blockly.Blocks.CocoRobo_bitmap_from_file = {
  8870. init: function () {
  8871. this.jsonInit({
  8872. colour: CategoryColors.Show,
  8873. args0: [{
  8874. name: "x",
  8875. type: "input_value",
  8876. check: "Number"
  8877. }, {
  8878. name: "y",
  8879. type: "input_value",
  8880. check: "Number"
  8881. }, {
  8882. name: "w",
  8883. type: "input_value",
  8884. check: "Number"
  8885. }, {
  8886. name: "h",
  8887. type: "input_value",
  8888. check: "Number"
  8889. }, {
  8890. check: "Array",
  8891. type: "input_value",
  8892. name: "pbm_data"
  8893. }],
  8894. inputsInline: !0,
  8895. helpUrl: Blockly.Msg.CocoRobo_BITMAP_FROM_FILE_HELPURL,
  8896. tooltip: Blockly.Msg.CocoRobo_BITMAP_FROM_FILE_TOOLTIP,
  8897. message0: Blockly.Msg.CocoRobo_BITMAP_FROM_FILE_MESSAGE0,
  8898. nextStatement: null,
  8899. previousStatement: null
  8900. })
  8901. }
  8902. };
  8903. Blockly.Blocks.CocoRobo_pbm_image = {
  8904. init: function () {
  8905. this.jsonInit({
  8906. colour: CategoryColors.Show,
  8907. args0: [{
  8908. type: "field_image",
  8909. name: "file_image",
  8910. src: "/static/face/1.png",
  8911. width: 128,
  8912. height: 64,
  8913. alt: "*"
  8914. }, {
  8915. name: "path",
  8916. options: [
  8917. [Blockly.Msg.CocoRobo_FACE_1, "face/1.pbm"],
  8918. [Blockly.Msg.CocoRobo_FACE_2, "face/2.pbm"],
  8919. [Blockly.Msg.CocoRobo_FACE_3, "face/3.pbm"],
  8920. [Blockly.Msg.CocoRobo_FACE_4, "face/4.pbm"],
  8921. [Blockly.Msg.CocoRobo_FACE_5, "face/5.pbm"],
  8922. [Blockly.Msg.CocoRobo_FACE_6, "face/6.pbm"],
  8923. [Blockly.Msg.CocoRobo_FACE_7, "face/7.pbm"],
  8924. [Blockly.Msg.CocoRobo_FACE_8, "face/8.pbm"],
  8925. [Blockly.Msg.CocoRobo_FACE_9, "face/9.pbm"],
  8926. [Blockly.Msg.CocoRobo_FACE_10, "face/10.pbm"],
  8927. [Blockly.Msg.CocoRobo_FACE_11, "face/11.pbm"],
  8928. [Blockly.Msg.CocoRobo_FACE_12, "face/12.pbm"],
  8929. [Blockly.Msg.CocoRobo_FACE_ROCK, "face/rock.pbm"],
  8930. [Blockly.Msg.CocoRobo_FACE_ROCK_S, "face/rock_s.pbm"],
  8931. [Blockly.Msg.CocoRobo_FACE_PAPER, "face/paper.pbm"],
  8932. [Blockly.Msg.CocoRobo_FACE_PAPER_S, "face/paper_s.pbm"],
  8933. [Blockly.Msg.CocoRobo_FACE_SCISSORS, "face/scissors.pbm"],
  8934. [Blockly.Msg.CocoRobo_FACE_SCISSORS_S, "face/scissors_s.pbm"],
  8935. ["Expressions/Big smile.pbm", "face/Expressions/Big smile.pbm"],
  8936. ["Expressions/Heart large.pbm", "face/Expressions/Heart large.pbm"],
  8937. ["Expressions/Heart small.pbm", "face/Expressions/Heart small.pbm"],
  8938. ["Expressions/Mouth 1 open.pbm", "face/Expressions/Mouth 1 open.pbm"],
  8939. ["Expressions/Mouth 1 shut.pbm", "face/Expressions/Mouth 1 shut.pbm"],
  8940. ["Expressions/Mouth 2 open.pbm", "face/Expressions/Mouth 2 open.pbm"],
  8941. ["Expressions/Mouth 2 shut.pbm", "face/Expressions/Mouth 2 shut.pbm"],
  8942. ["Expressions/Sad.pbm", "face/Expressions/Sad.pbm"],
  8943. ["Expressions/Sick.pbm", "face/Expressions/Sick.pbm"],
  8944. ["Expressions/Smile.pbm", "face/Expressions/Smile.pbm"],
  8945. ["Expressions/Swearing.pbm", "face/Expressions/Swearing.pbm"],
  8946. ["Expressions/Talking.pbm", "face/Expressions/Talking.pbm"],
  8947. ["Expressions/Wink.pbm", "face/Expressions/Wink.pbm"],
  8948. ["Expressions/ZZZ.pbm", "face/Expressions/ZZZ.pbm"],
  8949. ["Eyes/Angry.pbm", "face/Eyes/Angry.pbm"],
  8950. ["Eyes/Awake.pbm", "face/Eyes/Awake.pbm"],
  8951. ["Eyes/Black eye.pbm", "face/Eyes/Black eye.pbm"],
  8952. ["Eyes/Bottom left.pbm", "face/Eyes/Bottom left.pbm"],
  8953. ["Eyes/Bottom right.pbm", "face/Eyes/Bottom right.pbm"],
  8954. ["Eyes/Crazy 1.pbm", "face/Eyes/Crazy 1.pbm"],
  8955. ["Eyes/Crazy 2.pbm", "face/Eyes/Crazy 2.pbm"],
  8956. ["Eyes/Disappointed.pbm", "face/Eyes/Disappointed.pbm"],
  8957. ["Eyes/Dizzy.pbm", "face/Eyes/Dizzy.pbm"],
  8958. ["Eyes/Down.pbm", "face/Eyes/Down.pbm"],
  8959. ["Eyes/Evil.pbm", "face/Eyes/Evil.pbm"],
  8960. ["Eyes/Hurt.pbm", "face/Eyes/Hurt.pbm"],
  8961. ["Eyes/Knocked out.pbm", "face/Eyes/Knocked out.pbm"],
  8962. ["Eyes/Love.pbm", "face/Eyes/Love.pbm"],
  8963. ["Eyes/Middle left.pbm", "face/Eyes/Middle left.pbm"],
  8964. ["Eyes/Middle right.pbm", "face/Eyes/Middle right.pbm"],
  8965. ["Eyes/Neutral.pbm", "face/Eyes/Neutral.pbm"],
  8966. ["Eyes/Nuclear.pbm", "face/Eyes/Nuclear.pbm"],
  8967. ["Eyes/Pinch left.pbm", "face/Eyes/Pinch left.pbm"],
  8968. ["Eyes/Pinch middle.pbm", "face/Eyes/Pinch middle.pbm"],
  8969. ["Eyes/Pinch right.pbm", "face/Eyes/Pinch right.pbm"],
  8970. ["Eyes/Tear.pbm", "face/Eyes/Tear.pbm"],
  8971. ["Eyes/Tired left.pbm", "face/Eyes/Tired left.pbm"],
  8972. ["Eyes/Tired middle.pbm", "face/Eyes/Tired middle.pbm"],
  8973. ["Eyes/Tired right.pbm", "face/Eyes/Tired right.pbm"],
  8974. ["Eyes/Toxic.pbm", "face/Eyes/Toxic.pbm"],
  8975. ["Eyes/Up.pbm", "face/Eyes/Up.pbm"],
  8976. ["Eyes/Winking.pbm", "face/Eyes/Winking.pbm"],
  8977. ["Information/Accept.pbm", "face/Information/Accept.pbm"],
  8978. ["Information/Backward.pbm", "face/Information/Backward.pbm"],
  8979. ["Information/Decline.pbm", "face/Information/Decline.pbm"],
  8980. ["Information/Forward.pbm", "face/Information/Forward.pbm"],
  8981. ["Information/Left.pbm", "face/Information/Left.pbm"],
  8982. ["Information/No go.pbm", "face/Information/No go.pbm"],
  8983. ["Information/Question mark.pbm", "face/Information/Question mark.pbm"],
  8984. ["Information/Right.pbm", "face/Information/Right.pbm"],
  8985. ["Information/Stop 1.pbm", "face/Information/Stop 1.pbm"],
  8986. ["Information/Stop 2.pbm", "face/Information/Stop 2.pbm"],
  8987. ["Information/Thumbs down.pbm", "face/Information/Thumbs down.pbm"],
  8988. ["Information/Thumbs up.pbm", "face/Information/Thumbs up.pbm"],
  8989. ["Information/Warning.pbm", "face/Information/Warning.pbm"],
  8990. ["Objects/Bomb.pbm", "face/Objects/Bomb.pbm"],
  8991. ["Objects/Boom.pbm", "face/Objects/Boom.pbm"],
  8992. ["Objects/Fire.pbm", "face/Objects/Fire.pbm"],
  8993. ["Objects/Flowers.pbm", "face/Objects/Flowers.pbm"],
  8994. ["Objects/Forest.pbm", "face/Objects/Forest.pbm"],
  8995. ["Objects/Light off.pbm", "face/Objects/Light off.pbm"],
  8996. ["Objects/Light on.pbm", "face/Objects/Light on.pbm"],
  8997. ["Objects/Lightning.pbm", "face/Objects/Lightning.pbm"],
  8998. ["Objects/Night.pbm", "face/Objects/Night.pbm"],
  8999. ["Objects/Pirate.pbm", "face/Objects/Pirate.pbm"],
  9000. ["Objects/Snow.pbm", "face/Objects/Snow.pbm"],
  9001. ["Objects/Target.pbm", "face/Objects/Target.pbm"],
  9002. ["Progress/Bar 0.pbm", "face/Progress/Bar 0.pbm"],
  9003. ["Progress/Bar 1.pbm", "face/Progress/Bar 1.pbm"],
  9004. ["Progress/Bar 2.pbm", "face/Progress/Bar 2.pbm"],
  9005. ["Progress/Bar 3.pbm", "face/Progress/Bar 3.pbm"],
  9006. ["Progress/Bar 4.pbm", "face/Progress/Bar 4.pbm"],
  9007. ["Progress/Dial 0.pbm", "face/Progress/Dial 0.pbm"],
  9008. ["Progress/Dial 1.pbm", "face/Progress/Dial 1.pbm"],
  9009. ["Progress/Dial 2.pbm", "face/Progress/Dial 2.pbm"],
  9010. ["Progress/Dial 3.pbm", "face/Progress/Dial 3.pbm"],
  9011. ["Progress/Dial 4.pbm", "face/Progress/Dial 4.pbm"],
  9012. ["Progress/Dots 0.pbm", "face/Progress/Dots 0.pbm"],
  9013. ["Progress/Dots 1.pbm", "face/Progress/Dots 1.pbm"],
  9014. ["Progress/Dots 2.pbm", "face/Progress/Dots 2.pbm"],
  9015. ["Progress/Dots 3.pbm", "face/Progress/Dots 3.pbm"],
  9016. ["Progress/Hourglass 0.pbm", "face/Progress/Hourglass 0.pbm"],
  9017. ["Progress/Hourglass 1.pbm", "face/Progress/Hourglass 1.pbm"],
  9018. ["Progress/Hourglass 2.pbm", "face/Progress/Hourglass 2.pbm"],
  9019. ["Progress/Timer 0.pbm", "face/Progress/Timer 0.pbm"],
  9020. ["Progress/Timer 1.pbm", "face/Progress/Timer 1.pbm"],
  9021. ["Progress/Timer 2.pbm", "face/Progress/Timer 2.pbm"],
  9022. ["Progress/Timer 3.pbm", "face/Progress/Timer 3.pbm"],
  9023. ["Progress/Timer 4.pbm", "face/Progress/Timer 4.pbm"],
  9024. ["Progress/Water level 0.pbm", "face/Progress/Water level 0.pbm"],
  9025. ["Progress/Water level 1.pbm", "face/Progress/Water level 1.pbm"],
  9026. ["Progress/Water level 2.pbm", "face/Progress/Water level 2.pbm"],
  9027. ["Progress/Water level 3.pbm", "face/Progress/Water level 3.pbm"],
  9028. ["System/Accept_1.pbm", "face/System/Accept_1.pbm"],
  9029. ["System/Accept_2.pbm", "face/System/Accept_2.pbm"],
  9030. ["System/Alert.pbm", "face/System/Alert.pbm"],
  9031. ["System/Box.pbm", "face/System/Box.pbm"],
  9032. ["System/Busy_0.pbm", "face/System/Busy_0.pbm"],
  9033. ["System/Busy_1.pbm", "face/System/Busy_1.pbm"],
  9034. ["System/Decline_1.pbm", "face/System/Decline_1.pbm"],
  9035. ["System/Decline_2.pbm", "face/System/Decline_2.pbm"],
  9036. ["System/Dot_empty.pbm", "face/System/Dot_empty.pbm"],
  9037. ["System/Dot_full.pbm", "face/System/Dot_full.pbm"],
  9038. ["System/Play.pbm", "face/System/Play.pbm"],
  9039. ["System/Slider_0.pbm", "face/System/Slider_0.pbm"],
  9040. ["System/Slider_1.pbm", "face/System/Slider_1.pbm"],
  9041. ["System/Slider_2.pbm", "face/System/Slider_2.pbm"],
  9042. ["System/Slider_3.pbm", "face/System/Slider_3.pbm"],
  9043. ["System/Slider_4.pbm", "face/System/Slider_4.pbm"],
  9044. ["System/Slider_5.pbm", "face/System/Slider_5.pbm"],
  9045. ["System/Slider_6.pbm", "face/System/Slider_6.pbm"],
  9046. ["System/Slider_7.pbm", "face/System/Slider_7.pbm"],
  9047. ["System/Slider_8.pbm", "face/System/Slider_8.pbm"]
  9048. ],
  9049. type: "field_dropdown"
  9050. }, {
  9051. type: "field_label",
  9052. name: "size_image",
  9053. text: "64 * 64"
  9054. }],
  9055. output: "String",
  9056. helpUrl: "",
  9057. tooltip: "",
  9058. message0: "%1 %2 %3"
  9059. })
  9060. }
  9061. };
  9062. Blockly.Blocks.CocoRobo_font = {
  9063. init: function () {
  9064. this.jsonInit({
  9065. colour: CategoryColors.Show,
  9066. args0: [{
  9067. name: "font",
  9068. options: [
  9069. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_11, "font.digiface_11"],
  9070. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_16, "font.digiface_16"],
  9071. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_21, "font.digiface_21"],
  9072. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_30, "font.digiface_30"],
  9073. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_44, "font.digiface_44"],
  9074. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_IT_30, "font.digiface_it_30"],
  9075. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_IT_42, "font.digiface_it_42"],
  9076. [Blockly.Msg.CocoRobo_FONT_DVSM_12, "font.dvsm_12"],
  9077. [Blockly.Msg.CocoRobo_FONT_DVSM_16, "font.dvsm_16"],
  9078. [Blockly.Msg.CocoRobo_FONT_DVSM_21, "font.dvsm_21"],
  9079. [Blockly.Msg.CocoRobo_FONT_DVSMB_12, "font.dvsmb_12"],
  9080. [Blockly.Msg.CocoRobo_FONT_DVSMB_16, "font.dvsmb_16"],
  9081. [Blockly.Msg.CocoRobo_FONT_DVSMB_21, "font.dvsmb_21"]
  9082. ],
  9083. type: "field_dropdown"
  9084. }],
  9085. output: "String",
  9086. helpUrl: "",
  9087. tooltip: "",
  9088. message0: "%1"
  9089. })
  9090. }
  9091. };
  9092. Blockly.Blocks.CocoRobo_display_font = {
  9093. init: function () {
  9094. this.jsonInit({
  9095. inputsInline: !0,
  9096. nextStatement: null,
  9097. previousStatement: null,
  9098. colour: CategoryColors.Show,
  9099. helpUrl: Blockly.Msg.CocoRobo_DISPLAY_FONT_HELPURL,
  9100. tooltip: Blockly.Msg.CocoRobo_DISPLAY_FONT_TOOLTIP,
  9101. message0: Blockly.Msg.CocoRobo_DISPLAY_FONT_MESSAGE0,
  9102. args0: [{
  9103. check: "Number",
  9104. type: "input_value",
  9105. name: "x"
  9106. }, {
  9107. check: "Number",
  9108. type: "input_value",
  9109. name: "y"
  9110. }, {
  9111. check: "String",
  9112. type: "input_value",
  9113. name: "message"
  9114. }, {
  9115. name: "font",
  9116. options: [
  9117. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_11, "font.digiface_11"],
  9118. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_16, "font.digiface_16"],
  9119. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_21, "font.digiface_21"],
  9120. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_30, "font.digiface_30"],
  9121. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_44, "font.digiface_44"],
  9122. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_IT_30, "font.digiface_it_30"],
  9123. [Blockly.Msg.CocoRobo_FONT_DIGIFACE_IT_42, "font.digiface_it_42"],
  9124. [Blockly.Msg.CocoRobo_FONT_DVSM_12, "font.dvsm_12"],
  9125. [Blockly.Msg.CocoRobo_FONT_DVSM_16, "font.dvsm_16"],
  9126. [Blockly.Msg.CocoRobo_FONT_DVSM_21, "font.dvsm_21"],
  9127. [Blockly.Msg.CocoRobo_FONT_DVSMB_12, "font.dvsmb_12"],
  9128. [Blockly.Msg.CocoRobo_FONT_DVSMB_16, "font.dvsmb_16"],
  9129. [Blockly.Msg.CocoRobo_FONT_DVSMB_21, "font.dvsmb_21"]
  9130. ],
  9131. type: "field_dropdown"
  9132. }, {
  9133. name: "wrap",
  9134. options: [
  9135. [Blockly.Msg.CocoRobo_FONT_NO_WRAP, "False"],
  9136. [Blockly.Msg.CocoRobo_FONT_WRAP, "True"]
  9137. ],
  9138. type: "field_dropdown"
  9139. }]
  9140. })
  9141. }
  9142. };
  9143. Blockly.Blocks.CocoRobo_display_custom_font = {
  9144. init: function () {
  9145. this.jsonInit({
  9146. inputsInline: !0,
  9147. nextStatement: null,
  9148. previousStatement: null,
  9149. colour: CategoryColors.Show,
  9150. helpUrl: Blockly.Msg.CocoRobo_DISPLAY_FONT_HELPURL,
  9151. tooltip: Blockly.Msg.CocoRobo_DISPLAY_FONT_TOOLTIP,
  9152. message0: Blockly.Msg.CocoRobo_DISPLAY_FONT_MESSAGE0,
  9153. args0: [{
  9154. check: "Number",
  9155. type: "input_value",
  9156. name: "x"
  9157. }, {
  9158. check: "Number",
  9159. type: "input_value",
  9160. name: "y"
  9161. }, {
  9162. check: "String",
  9163. type: "input_value",
  9164. name: "message"
  9165. }, {
  9166. name: "font",
  9167. text: "font.dvsm_16",
  9168. type: "field_input"
  9169. }, {
  9170. name: "wrap",
  9171. options: [
  9172. [Blockly.Msg.CocoRobo_FONT_NO_WRAP, "False"],
  9173. [Blockly.Msg.CocoRobo_FONT_WRAP, "True"]
  9174. ],
  9175. type: "field_dropdown"
  9176. }]
  9177. })
  9178. }
  9179. };
  9180. Blockly.Blocks.CocoRobo_image_to_oled = {
  9181. init: function () {
  9182. this.jsonInit({
  9183. inputsInline: !1,
  9184. nextStatement: null,
  9185. previousStatement: null,
  9186. colour: CategoryColors.Show,
  9187. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  9188. tooltip: Blockly.Msg.CocoRobo_image_to_lcd_TOOLTIP,
  9189. message0: Blockly.Msg.CocoRobo_image_to_lcd_MESSAGE0,
  9190. args0: [{
  9191. check: "String",
  9192. type: "input_value",
  9193. name: "image_dir"
  9194. }, {
  9195. check: "Number",
  9196. type: "input_value",
  9197. name: "w"
  9198. }, {
  9199. check: "Number",
  9200. type: "input_value",
  9201. name: "h"
  9202. }]
  9203. })
  9204. }
  9205. };
  9206. Blockly.Blocks.CocoRobo_qr_code = {
  9207. init: function () {
  9208. this.jsonInit({
  9209. inputsInline: !0,
  9210. nextStatement: null,
  9211. previousStatement: null,
  9212. colour: CategoryColors.Show,
  9213. helpUrl: Blockly.Msg.CocoRobo_QR_CODE_HELPURL,
  9214. tooltip: Blockly.Msg.CocoRobo_QR_CODE_TOOLTIP,
  9215. message0: Blockly.Msg.CocoRobo_QR_CODE_MESSAGE0,
  9216. args0: [{
  9217. check: "Number",
  9218. type: "input_value",
  9219. name: "x"
  9220. }, {
  9221. check: "Number",
  9222. type: "input_value",
  9223. name: "y"
  9224. }, {
  9225. check: "String",
  9226. type: "input_value",
  9227. name: "str"
  9228. }, {
  9229. name: "scale",
  9230. options: [
  9231. ["58 * 58", "2"],
  9232. ["29 * 29", "1"]
  9233. ],
  9234. type: "field_dropdown"
  9235. }]
  9236. })
  9237. }
  9238. };
  9239. Blockly.Blocks.CocoRobo_radio_rec = {
  9240. init: function () {
  9241. this.jsonInit({
  9242. inputsInline: !0,
  9243. output: null,
  9244. colour: CategoryColors.Radio,
  9245. helpUrl: Blockly.Msg.CocoRobo_RADIO_REC_HELPURL,
  9246. tooltip: Blockly.Msg.CocoRobo_RADIO_REC_TOOLTIP,
  9247. message0: Blockly.Msg.CocoRobo_RADIO_REC_MESSAGE0
  9248. })
  9249. }
  9250. };
  9251. Blockly.Blocks.CocoRobo_radio_send = {
  9252. init: function () {
  9253. this.jsonInit({
  9254. inputsInline: !0,
  9255. nextStatement: null,
  9256. previousStatement: null,
  9257. colour: CategoryColors.Radio,
  9258. helpUrl: Blockly.Msg.CocoRobo_RADIO_SEND_HELPURL,
  9259. tooltip: Blockly.Msg.CocoRobo_RADIO_SEND_TOOLTIP,
  9260. message0: Blockly.Msg.CocoRobo_RADIO_SEND_MESSAGE0,
  9261. args0: [{
  9262. check: "String",
  9263. type: "input_value",
  9264. name: "send"
  9265. }]
  9266. })
  9267. }
  9268. };
  9269. Blockly.Blocks.CocoRobo_radio_channel = {
  9270. init: function () {
  9271. this.jsonInit({
  9272. inputsInline: !0,
  9273. nextStatement: null,
  9274. previousStatement: null,
  9275. colour: CategoryColors.Radio,
  9276. helpUrl: Blockly.Msg.CocoRobo_RADIO_CHANNEL_HELPURL,
  9277. tooltip: Blockly.Msg.CocoRobo_RADIO_CHANNEL_TOOLTIP,
  9278. message0: Blockly.Msg.CocoRobo_RADIO_CHANNEL_MESSAGE0,
  9279. args0: [{
  9280. check: "Number",
  9281. type: "input_value",
  9282. name: "channel"
  9283. }]
  9284. })
  9285. }
  9286. };
  9287. Blockly.Blocks.CocoRobo_radio_on_off = {
  9288. init: function () {
  9289. this.jsonInit({
  9290. inputsInline: !0,
  9291. nextStatement: null,
  9292. previousStatement: null,
  9293. colour: CategoryColors.Radio,
  9294. helpUrl: Blockly.Msg.CocoRobo_RADIO_ON_OFF_HELPURL,
  9295. tooltip: Blockly.Msg.CocoRobo_RADIO_ON_OFF_TOOLTIP,
  9296. message0: Blockly.Msg.CocoRobo_RADIO_ON_OFF_MESSAGE0,
  9297. args0: [{
  9298. options: [
  9299. [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "on"],
  9300. [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "off"]
  9301. ],
  9302. type: "field_dropdown",
  9303. name: "on_off"
  9304. }]
  9305. })
  9306. }
  9307. };
  9308. Blockly.Blocks.CocoRobo_radio_recv = {
  9309. init: function () {
  9310. this.jsonInit({
  9311. message0: Blockly.Msg.CocoRobo_RADIO_RECV_MESSAGE0,
  9312. colour: CategoryColors.Radio,
  9313. inputsInline: !0,
  9314. helpUrl: Blockly.Msg.CocoRobo_RADIO_RECV_HELPURL,
  9315. tooltip: Blockly.Msg.CocoRobo_RADIO_RECV_TOOLTIP,
  9316. args0: [{
  9317. type: "input_value",
  9318. name: "message"
  9319. }]
  9320. });
  9321. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  9322. }
  9323. };
  9324. Blockly.Blocks.CocoRobo_radio_recv_msg = {
  9325. init: function () {
  9326. this.jsonInit({
  9327. message0: Blockly.Msg.CocoRobo_RADIO_RECV_MSG_MESSAGE0,
  9328. colour: CategoryColors.Radio,
  9329. inputsInline: !0,
  9330. helpUrl: Blockly.Msg.CocoRobo_RADIO_RECV_MSG_HELPURL,
  9331. tooltip: Blockly.Msg.CocoRobo_RADIO_RECV_MSG_TOOLTIP,
  9332. args0: [{
  9333. type: "field_input",
  9334. name: "message",
  9335. text: "on"
  9336. }]
  9337. });
  9338. this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO)
  9339. }
  9340. };
  9341. Blockly.Blocks.set_subset_superset = {
  9342. init: function () {
  9343. this.jsonInit({
  9344. inputsInline: !0,
  9345. output: "Boolean",
  9346. colour: CategoryColors.Set,
  9347. helpUrl: Blockly.Msg.SUBSET_SUPERSET_HELPURL,
  9348. // tooltip: Blockly.Msg.SUBSET_SUPERSET_TOOLTIP,
  9349. message0: Blockly.Msg.SUBSET_SUPERSET_MESSAGE0,
  9350. args0: [{
  9351. type: "input_value",
  9352. name: "set_name"
  9353. }, {
  9354. type: "input_value",
  9355. name: "set_1_name"
  9356. }, {
  9357. options: [
  9358. [Blockly.Msg.CocoRobo_SUBSET, ".issubset"],
  9359. [Blockly.Msg.CocoRobo_SUPERSET, ".issuperset"]
  9360. ],
  9361. type: "field_dropdown",
  9362. name: "subset_superset"
  9363. }]
  9364. });
  9365. var thisBlock = this;
  9366. this.setTooltip(function () {
  9367. var mode = thisBlock.getFieldValue('subset_superset');
  9368. var TOOLTIPS = {
  9369. '.issubset': Blockly.Msg.SUBSET_SUPERSET_TOOLTIP.replace('%3', Blockly.Msg.CocoRobo_SUBSET),
  9370. '.issuperset': Blockly.Msg.SUBSET_SUPERSET_TOOLTIP.replace('%3', Blockly.Msg.CocoRobo_SUPERSET)
  9371. };
  9372. return TOOLTIPS[mode];
  9373. });
  9374. }
  9375. };
  9376. Blockly.Blocks.sets_update_ways = {
  9377. init: function () {
  9378. this.jsonInit({
  9379. inputsInline: !0,
  9380. nextStatement: null,
  9381. previousStatement: null,
  9382. colour: CategoryColors.Set,
  9383. helpUrl: Blockly.Msg.SETS_UPDATE_WAYS_HELPURL,
  9384. // tooltip: Blockly.Msg.SETS_UPDATE_WAYS_TOOLTIP,
  9385. message0: Blockly.Msg.SETS_UPDATE_WAYS_MESSAGE0,
  9386. args0: [{
  9387. type: "input_value",
  9388. name: "set_name"
  9389. }, {
  9390. type: "input_value",
  9391. name: "set_1_name"
  9392. }, {
  9393. options: [
  9394. [Blockly.Msg.CocoRobo_INTERSECTION, ".intersection_update"],
  9395. [Blockly.Msg.CocoRobo_UNION, ".update"],
  9396. [Blockly.Msg.CocoRobo_DIFFERENCE, ".difference_update"]
  9397. ],
  9398. type: "field_dropdown",
  9399. name: "sets_update_ways"
  9400. }]
  9401. });
  9402. var thisBlock = this;
  9403. this.setTooltip(function () {
  9404. var mode = thisBlock.getFieldValue('sets_update_ways');
  9405. var TOOLTIPS = {
  9406. '.intersection_update': Blockly.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace('%3', Blockly.Msg.CocoRobo_INTERSECTION),
  9407. '.update': Blockly.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace('%3', Blockly.Msg.CocoRobo_UNION),
  9408. '.difference_update': Blockly.Msg.SETS_UPDATE_WAYS_TOOLTIP.replace('%3', Blockly.Msg.CocoRobo_DIFFERENCE)
  9409. };
  9410. return TOOLTIPS[mode];
  9411. });
  9412. }
  9413. };
  9414. Blockly.Blocks.get_sets_pop = {
  9415. init: function () {
  9416. this.jsonInit({
  9417. inputsInline: !0,
  9418. output: null,
  9419. colour: CategoryColors.Set,
  9420. helpUrl: Blockly.Msg.GET_SETS_POP_HELPURL,
  9421. tooltip: Blockly.Msg.GET_SETS_POP_TOOLTIP,
  9422. message0: Blockly.Msg.GET_SETS_POP_MESSAGE0,
  9423. args0: [{
  9424. type: "input_value",
  9425. name: "set_name"
  9426. }]
  9427. })
  9428. }
  9429. };
  9430. Blockly.Blocks.len_of_sets = {
  9431. init: function () {
  9432. this.jsonInit({
  9433. inputsInline: !0,
  9434. output: "Number",
  9435. colour: CategoryColors.Set,
  9436. helpUrl: Blockly.Msg.LEN_OF_SETS_HELPURL,
  9437. tooltip: Blockly.Msg.LEN_OF_SETS_TOOLTIP,
  9438. message0: Blockly.Msg.LEN_OF_SETS_MESSAGE0,
  9439. args0: [{
  9440. type: "input_value",
  9441. name: "set_name"
  9442. }]
  9443. })
  9444. }
  9445. };
  9446. Blockly.Blocks.intersection_of_sets = {
  9447. init: function () {
  9448. this.jsonInit({
  9449. inputsInline: !0,
  9450. output: "Array",
  9451. colour: CategoryColors.Set,
  9452. helpUrl: Blockly.Msg.INTERSECTION_OF_SETS_HELPURL,
  9453. // tooltip: Blockly.Msg.INTERSECTION_OF_SETS_TOOLTIP,
  9454. message0: Blockly.Msg.INTERSECTION_OF_SETS_MESSAGE0,
  9455. args0: [{
  9456. options: [
  9457. [Blockly.Msg.CocoRobo_INTERSECTION, " \x26 "],
  9458. [Blockly.Msg.CocoRobo_UNION, " | "],
  9459. [Blockly.Msg.CocoRobo_DIFFERENCE, " - "]
  9460. ],
  9461. type: "field_dropdown",
  9462. name: "set_operation_type"
  9463. }, {
  9464. type: "input_value",
  9465. name: "set_name"
  9466. }, {
  9467. type: "input_value",
  9468. name: "set_1_name"
  9469. }]
  9470. });
  9471. var thisBlock = this;
  9472. this.setTooltip(function () {
  9473. var mode = thisBlock.getFieldValue('set_operation_type');
  9474. var TOOLTIPS = {
  9475. " \x26 ": Blockly.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace('%1', Blockly.Msg.CocoRobo_INTERSECTION),
  9476. " | ": Blockly.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace('%1', Blockly.Msg.CocoRobo_UNION),
  9477. " - ": Blockly.Msg.INTERSECTION_OF_SETS_TOOLTIP.replace('%1', Blockly.Msg.CocoRobo_DIFFERENCE)
  9478. };
  9479. return TOOLTIPS[mode];
  9480. });
  9481. }
  9482. };
  9483. Blockly.Blocks.set_update_with = {
  9484. init: function () {
  9485. this.jsonInit({
  9486. inputsInline: !0,
  9487. nextStatement: null,
  9488. previousStatement: null,
  9489. colour: CategoryColors.Set,
  9490. helpUrl: Blockly.Msg.SET_UPDATE_WITH_HELPURL,
  9491. tooltip: Blockly.Msg.SET_UPDATE_WITH_TOOLTIP,
  9492. message0: Blockly.Msg.SET_UPDATE_WITH_MESSAGE0,
  9493. args0: [{
  9494. type: "input_value",
  9495. name: "set_name"
  9496. }, {
  9497. type: "input_value",
  9498. name: "set_items"
  9499. }]
  9500. })
  9501. }
  9502. };
  9503. Blockly.Blocks.set_create_with = {
  9504. init: function () {
  9505. this.jsonInit({
  9506. inputsInline: !0,
  9507. nextStatement: null,
  9508. previousStatement: null,
  9509. colour: CategoryColors.Set,
  9510. helpUrl: Blockly.Msg.SET_CREATE_WITH_HELPURL,
  9511. tooltip: Blockly.Msg.SET_CREATE_WITH_TOOLTIP,
  9512. message0: Blockly.Msg.SET_CREATE_WITH_MESSAGE0,
  9513. args0: [{
  9514. type: "input_value",
  9515. name: "set_name"
  9516. }, {
  9517. type: "input_value",
  9518. name: "set_items"
  9519. }]
  9520. })
  9521. }
  9522. };
  9523. Blockly.Blocks.text_set = {
  9524. init: function () {
  9525. this.setHelpUrl(Blockly.Msg.TEXT_SET_HELPURL);
  9526. this.setColour(CategoryColors.Set);
  9527. this.appendDummyInput().appendField(Blockly.Msg.TEXT_SET_START).appendField(new Blockly.FieldTextInput(""), "TEXT").appendField(Blockly.Msg.TEXT_SET_END);
  9528. this.setOutput(!0, "Array");
  9529. this.setTooltip(Blockly.Msg.Text_Set_TOOLTIP);
  9530. }
  9531. };
  9532. Blockly.Blocks.create_empty_set = {
  9533. init: function () {
  9534. this.jsonInit({
  9535. inputsInline: !0,
  9536. nextStatement: null,
  9537. previousStatement: null,
  9538. colour: CategoryColors.Set,
  9539. helpUrl: Blockly.Msg.CREATE_EMPTY_SET_HELPURL,
  9540. tooltip: Blockly.Msg.CREATE_EMPTY_SET_TOOLTIP,
  9541. message0: Blockly.Msg.CREATE_EMPTY_SET_MESSAGE0,
  9542. args0: [{
  9543. type: "input_value",
  9544. name: "set_name"
  9545. }]
  9546. })
  9547. }
  9548. };
  9549. Blockly.Blocks.set_create_with_items_insert = {
  9550. init: function () {
  9551. this.setHelpUrl(Blockly.Msg.SET_CREATE_WITH_ITEMS_INSERT_HELPURL);
  9552. this.setColour(CategoryColors.Set);
  9553. this.itemCount_ = 3;
  9554. this.updateShape_();
  9555. this.setOutput(!0, "Array");
  9556. this.setMutator(new Blockly.Mutator(["set_create_with_item"]));
  9557. this.setTooltip(Blockly.Msg.SET_CREATE_WITH_ITEMS_INSERT_TOOLTIP)
  9558. },
  9559. mutationToDom: function () {
  9560. var a = document.createElement("mutation");
  9561. a.setAttribute("items", this.itemCount_);
  9562. return a
  9563. },
  9564. domToMutation: function (a) {
  9565. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  9566. this.updateShape_()
  9567. },
  9568. decompose: function (a) {
  9569. var b = a.newBlock("set_create_with_container");
  9570. b.initSvg();
  9571. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  9572. var d = a.newBlock("set_create_with_item");
  9573. d.initSvg();
  9574. c.connect(d.previousConnection);
  9575. c = d.nextConnection
  9576. }
  9577. return b
  9578. },
  9579. compose: function (a) {
  9580. var b = a.getInputTargetBlock("STACK");
  9581. for (a = []; b;)
  9582. a.push(b.valueConnection_),
  9583. b = b.nextConnection && b.nextConnection.targetBlock();
  9584. for (b = 0; b < this.itemCount_; b++) {
  9585. var c = this.getInput("ADD" + b).connection.targetConnection;
  9586. c && -1 == a.indexOf(c) && c.disconnect()
  9587. }
  9588. this.itemCount_ = a.length;
  9589. this.updateShape_();
  9590. for (b = 0; b < this.itemCount_; b++)
  9591. Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
  9592. },
  9593. saveConnections: function (a) {
  9594. a = a.getInputTargetBlock("STACK");
  9595. for (var b = 0; a;) {
  9596. var c = this.getInput("ADD" + b);
  9597. a.valueConnection_ = c && c.connection.targetConnection;
  9598. b++;
  9599. a = a.nextConnection && a.nextConnection.targetBlock()
  9600. }
  9601. },
  9602. updateShape_: function () {
  9603. this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.SET_CREATE_EMPTY_TITLE);
  9604. for (var a = 0; a < this.itemCount_; a++)
  9605. if (!this.getInput("ADD" + a)) {
  9606. var b = this.appendValueInput("ADD" + a);
  9607. 0 == a && b.appendField(Blockly.Msg.SET_CREATE_WITH_INPUT_WITH)
  9608. }
  9609. for (; this.getInput("ADD" + a);)
  9610. this.removeInput("ADD" + a),
  9611. a++
  9612. }
  9613. };
  9614. Blockly.Blocks.set_create_with_item = {
  9615. init: function () {
  9616. this.setColour(CategoryColors.Set);
  9617. this.appendDummyInput().appendField(Blockly.Msg.SET_CREATE_WITH_ITEM_TITLE);
  9618. this.setPreviousStatement(!0);
  9619. this.setNextStatement(!0);
  9620. this.setTooltip(Blockly.Msg.SET_CREATE_WITH_ITEM_TOOLTIP);
  9621. this.contextMenu = !1
  9622. }
  9623. };
  9624. Blockly.Blocks.set_create_with_container = {
  9625. init: function () {
  9626. this.setColour(CategoryColors.Set);
  9627. this.appendDummyInput().appendField(Blockly.Msg.SET_CREATE_WITH_CONTAINER_TITLE_ADD);
  9628. this.appendStatementInput("STACK");
  9629. this.setTooltip(Blockly.Msg.SET_CREATE_WITH_CONTAINER_TOOLTIP);
  9630. this.contextMenu = !1
  9631. }
  9632. };
  9633. Blockly.Blocks.set_tuple_order_item = {
  9634. init: function () {
  9635. this.jsonInit({
  9636. colour: CategoryColors.Tuple,
  9637. args0: [{
  9638. type: "input_value",
  9639. name: "tuple_name"
  9640. }, {
  9641. options: [
  9642. [Blockly.Msg.CocoRobo_ORDER, "["],
  9643. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  9644. ],
  9645. type: "field_dropdown",
  9646. name: "tuple_order"
  9647. }, {
  9648. check: "Number",
  9649. type: "input_value",
  9650. name: "tuple_order_item"
  9651. }, {
  9652. type: "input_value",
  9653. name: "set_value"
  9654. }],
  9655. inputsInline: !0,
  9656. nextStatement: null,
  9657. previousStatement: null,
  9658. helpUrl: Blockly.Msg.SET_TUPLE_ORDER_ITEM_HELPURL,
  9659. tooltip: Blockly.Msg.SET_TUPLE_ORDER_ITEM_TOOLTIP,
  9660. message0: Blockly.Msg.SET_TUPLE_ORDER_ITEM_MESSAGE0
  9661. })
  9662. }
  9663. };
  9664. Blockly.Blocks.tuple_create_with_items_insert = {
  9665. init: function () {
  9666. this.setHelpUrl(Blockly.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_HELPURL);
  9667. this.setColour(CategoryColors.Tuple);
  9668. this.itemCount_ = 3;
  9669. this.updateShape_();
  9670. this.setOutput(!0);
  9671. this.setMutator(new Blockly.Mutator(["tuple_create_with_item"]));
  9672. this.setTooltip(Blockly.Msg.TUPLE_CREATE_WITH_ITEMS_INSERT_TOOLTIP)
  9673. },
  9674. mutationToDom: function () {
  9675. var a = document.createElement("mutation");
  9676. a.setAttribute("items", this.itemCount_);
  9677. return a
  9678. },
  9679. domToMutation: function (a) {
  9680. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  9681. this.updateShape_()
  9682. },
  9683. decompose: function (a) {
  9684. var b = a.newBlock("tuple_create_with_container");
  9685. b.initSvg();
  9686. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  9687. var d = a.newBlock("tuple_create_with_item");
  9688. d.initSvg();
  9689. c.connect(d.previousConnection);
  9690. c = d.nextConnection
  9691. }
  9692. return b
  9693. },
  9694. compose: function (a) {
  9695. var b = a.getInputTargetBlock("STACK");
  9696. for (a = []; b;)
  9697. a.push(b.valueConnection_),
  9698. b = b.nextConnection && b.nextConnection.targetBlock();
  9699. for (b = 0; b < this.itemCount_; b++) {
  9700. var c = this.getInput("ADD" + b).connection.targetConnection;
  9701. c && -1 == a.indexOf(c) && c.disconnect()
  9702. }
  9703. this.itemCount_ = a.length;
  9704. this.updateShape_();
  9705. for (b = 0; b < this.itemCount_; b++)
  9706. Blockly.Mutator.reconnect(a[b], this, "ADD" + b)
  9707. },
  9708. saveConnections: function (a) {
  9709. a = a.getInputTargetBlock("STACK");
  9710. for (var b = 0; a;) {
  9711. var c = this.getInput("ADD" + b);
  9712. a.valueConnection_ = c && c.connection.targetConnection;
  9713. b++;
  9714. a = a.nextConnection && a.nextConnection.targetBlock()
  9715. }
  9716. },
  9717. updateShape_: function () {
  9718. this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.TUPLE_CREATE_EMPTY_TITLE);
  9719. for (var a = 0; a < this.itemCount_; a++)
  9720. if (!this.getInput("ADD" + a)) {
  9721. var b = this.appendValueInput("ADD" + a);
  9722. 0 == a && b.appendField(Blockly.Msg.TUPLE_CREATE_WITH_INPUT_WITH)
  9723. }
  9724. for (; this.getInput("ADD" + a);)
  9725. this.removeInput("ADD" + a),
  9726. a++
  9727. }
  9728. };
  9729. Blockly.Blocks.tuple_create_with_item = {
  9730. init: function () {
  9731. this.setColour(CategoryColors.Tuple);
  9732. this.appendDummyInput().appendField(Blockly.Msg.TUPLE_CREATE_WITH_ITEM_TITLE);
  9733. this.setPreviousStatement(!0);
  9734. this.setNextStatement(!0);
  9735. this.setTooltip(Blockly.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP);
  9736. this.contextMenu = !1
  9737. }
  9738. };
  9739. Blockly.Blocks.tuple_create_with_container = {
  9740. init: function () {
  9741. this.setColour(CategoryColors.Tuple);
  9742. this.appendDummyInput().appendField(Blockly.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD);
  9743. this.appendStatementInput("STACK");
  9744. this.setTooltip(Blockly.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP);
  9745. this.contextMenu = !1
  9746. }
  9747. };
  9748. Blockly.Blocks.tuple_create_with = {
  9749. init: function () {
  9750. this.jsonInit({
  9751. colour: CategoryColors.Tuple,
  9752. args0: [{
  9753. type: "input_value",
  9754. name: "tuple_name"
  9755. }, {
  9756. type: "input_value",
  9757. name: "tuple_items"
  9758. }],
  9759. inputsInline: !0,
  9760. nextStatement: null,
  9761. previousStatement: null,
  9762. helpUrl: Blockly.Msg.tuple_create_with_HELPURL,
  9763. tooltip: Blockly.Msg.tuple_create_with_TOOLTIP,
  9764. message0: Blockly.Msg.tuple_create_with_MESSAGE0
  9765. })
  9766. }
  9767. };
  9768. Blockly.Blocks.tuple_order_item = {
  9769. init: function () {
  9770. this.jsonInit({
  9771. colour: CategoryColors.Tuple,
  9772. args0: [{
  9773. type: "input_value",
  9774. name: "tuple_name"
  9775. }, {
  9776. options: [
  9777. [Blockly.Msg.CocoRobo_ORDER, "["],
  9778. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  9779. ],
  9780. type: "field_dropdown",
  9781. name: "tuple_order"
  9782. }, {
  9783. check: "Number",
  9784. type: "input_value",
  9785. name: "tuple_order_item"
  9786. }],
  9787. output: ["Number", "String", "Boolean", "Array"],
  9788. inputsInline: !0,
  9789. helpUrl: Blockly.Msg.tuple_order_item_HELPURL,
  9790. tooltip: Blockly.Msg.tuple_order_item_TOOLTIP,
  9791. message0: Blockly.Msg.tuple_order_item_MESSAGE0
  9792. })
  9793. }
  9794. };
  9795. Blockly.Blocks.tuple_min_max_len = {
  9796. init: function () {
  9797. this.jsonInit({
  9798. colour: CategoryColors.Tuple,
  9799. args0: [{
  9800. type: "input_value",
  9801. name: "tuple_name"
  9802. }, {
  9803. options: [
  9804. [Blockly.Msg.CocoRobo_MIN, "min"],
  9805. [Blockly.Msg.CocoRobo_MAX, "max"],
  9806. [Blockly.Msg.CocoRobo_LENTH, "len"]
  9807. ],
  9808. type: "field_dropdown",
  9809. name: "tuple_min_max_len"
  9810. }],
  9811. output: ["Number", "String"],
  9812. inputsInline: !0,
  9813. helpUrl: Blockly.Msg.TUPLE_MIN_MAX_LEN_HELPURL,
  9814. // tooltip: Blockly.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP,
  9815. message0: Blockly.Msg.TUPLE_MIN_MAX_LEN_MESSAGE0
  9816. });
  9817. var thisBlock = this;
  9818. this.setTooltip(function () {
  9819. var mode = thisBlock.getFieldValue('tuple_min_max_len');
  9820. var TOOLTIPS = {
  9821. 'min': Blockly.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace('%2', Blockly.Msg.CocoRobo_MIN),
  9822. 'max': Blockly.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace('%2', Blockly.Msg.CocoRobo_MAX),
  9823. 'len': Blockly.Msg.TUPLE_MIN_MAX_LEN_TOOLTIP.replace('%2', Blockly.Msg.CocoRobo_LENTH)
  9824. };
  9825. return TOOLTIPS[mode];
  9826. });
  9827. }
  9828. };
  9829. Blockly.Blocks.tuple_item_exist = {
  9830. init: function () {
  9831. this.jsonInit({
  9832. colour: CategoryColors.Tuple,
  9833. args0: [{
  9834. type: "input_value",
  9835. name: "tuple_name"
  9836. }, {
  9837. type: "input_value",
  9838. name: "tuple_item"
  9839. }],
  9840. output: "Boolean",
  9841. inputsInline: !0,
  9842. helpUrl: Blockly.Msg.TUPLE_ITEM_EXIST_HELPURL,
  9843. tooltip: Blockly.Msg.TUPLE_ITEM_EXIST_TOOLTIP,
  9844. message0: Blockly.Msg.TUPLE_ITEM_EXIST_MESSAGE0
  9845. })
  9846. }
  9847. };
  9848. Blockly.Blocks.parts_of_tuple = {
  9849. init: function () {
  9850. this.jsonInit({
  9851. colour: CategoryColors.Tuple,
  9852. args0: [{
  9853. type: "input_value",
  9854. name: "tuple_name"
  9855. }, {
  9856. check: "Number",
  9857. type: "input_value",
  9858. name: "tuple_item"
  9859. }],
  9860. output: null,
  9861. inputsInline: !0,
  9862. helpUrl: Blockly.Msg.PARTS_OF_TUPLE_HELPURL,
  9863. tooltip: Blockly.Msg.PARTS_OF_TUPLE_TOOLTIP,
  9864. message0: Blockly.Msg.PARTS_OF_TUPLE_MESSAGE0
  9865. })
  9866. }
  9867. };
  9868. Blockly.Blocks.parts_of_tuple2 = {
  9869. init: function () {
  9870. this.jsonInit({
  9871. colour: CategoryColors.Tuple,
  9872. args0: [{
  9873. type: "input_value",
  9874. name: "tuple_name"
  9875. }, {
  9876. options: [
  9877. [Blockly.Msg.CocoRobo_ORDER, "["],
  9878. [Blockly.Msg.CocoRobo_REVERSE_ORDER, "[-"]
  9879. ],
  9880. type: "field_dropdown",
  9881. name: "tuple_start_order"
  9882. }, {
  9883. check: "Number",
  9884. type: "input_value",
  9885. name: "start_item"
  9886. }, {
  9887. options: [
  9888. [Blockly.Msg.CocoRobo_ORDER, ":"],
  9889. [Blockly.Msg.CocoRobo_REVERSE_ORDER, ":-"]
  9890. ],
  9891. type: "field_dropdown",
  9892. name: "tuple_end_order"
  9893. }, {
  9894. check: "Number",
  9895. type: "input_value",
  9896. name: "end_item"
  9897. }],
  9898. output: null,
  9899. inputsInline: !0,
  9900. helpUrl: Blockly.Msg.PARTS_OF_TUPLE2_HELPURL,
  9901. tooltip: Blockly.Msg.PARTS_OF_TUPLE2_TOOLTIP,
  9902. message0: Blockly.Msg.PARTS_OF_TUPLE2_MESSAGE0
  9903. })
  9904. }
  9905. };
  9906. Blockly.Blocks.CocoRobo_uart_input = {
  9907. init: function () {
  9908. this.jsonInit({
  9909. inputsInline: !0,
  9910. output: "String",
  9911. colour: CategoryColors.UART,
  9912. helpUrl: Blockly.Msg.CocoRobo_UART_INPUT_HELPURL,
  9913. tooltip: Blockly.Msg.CocoRobo_UART_INPUT_TOOLTIP,
  9914. message0: Blockly.Msg.CocoRobo_UART_INPUT_MESSAGE0,
  9915. args0: [{
  9916. type: "field_input",
  9917. name: "title",
  9918. text: "Please enter: "
  9919. }]
  9920. })
  9921. }
  9922. };
  9923. Blockly.Blocks.CocoRobo_uart_write_bytes = {
  9924. init: function () {
  9925. this.jsonInit({
  9926. inputsInline: !0,
  9927. nextStatement: null,
  9928. previousStatement: null,
  9929. colour: CategoryColors.UART,
  9930. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_HELPURL,
  9931. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_TOOLTIP,
  9932. message0: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_MESSAGE0,
  9933. args0: [{
  9934. options: [
  9935. ["uart1", "uart1"],
  9936. ["uart2", "uart2"]
  9937. ],
  9938. type: "field_dropdown",
  9939. name: "uart_name"
  9940. }, {
  9941. check: "Array",
  9942. type: "input_value",
  9943. name: "write_byte_arrays"
  9944. }]
  9945. })
  9946. }
  9947. };
  9948. Blockly.Blocks.CocoRobo_uart_get_write_bytes = {
  9949. init: function () {
  9950. this.jsonInit({
  9951. inputsInline: !0,
  9952. output: null,
  9953. colour: CategoryColors.UART,
  9954. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_HELPURL,
  9955. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_TOOLTIP,
  9956. message0: Blockly.Msg.CocoRobo_UART_WRITE_BYTES_MESSAGE0,
  9957. args0: [{
  9958. options: [
  9959. ["uart1", "uart1"],
  9960. ["uart2", "uart2"]
  9961. ],
  9962. type: "field_dropdown",
  9963. name: "uart_name"
  9964. }, {
  9965. check: "Array",
  9966. type: "input_value",
  9967. name: "write_byte_arrays"
  9968. }]
  9969. })
  9970. }
  9971. };
  9972. Blockly.Blocks.CocoRobo_uart_write_byte = {
  9973. init: function () {
  9974. this.jsonInit({
  9975. inputsInline: !0,
  9976. nextStatement: null,
  9977. previousStatement: null,
  9978. colour: CategoryColors.UART,
  9979. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_HELPURL,
  9980. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_TOOLTIP,
  9981. message0: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_MESSAGE0,
  9982. args0: [{
  9983. options: [
  9984. ["uart1", "uart1"],
  9985. ["uart2", "uart2"]
  9986. ],
  9987. type: "field_dropdown",
  9988. name: "uart_name"
  9989. }, {
  9990. check: "Number",
  9991. type: "input_value",
  9992. name: "write_one_byte"
  9993. }]
  9994. })
  9995. }
  9996. };
  9997. Blockly.Blocks.CocoRobo_uart_get_write_byte = {
  9998. init: function () {
  9999. this.jsonInit({
  10000. inputsInline: !0,
  10001. output: null,
  10002. colour: CategoryColors.UART,
  10003. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_HELPURL,
  10004. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_TOOLTIP,
  10005. message0: Blockly.Msg.CocoRobo_UART_WRITE_BYTE_MESSAGE0,
  10006. args0: [{
  10007. options: [
  10008. ["uart1", "uart1"],
  10009. ["uart2", "uart2"]
  10010. ],
  10011. type: "field_dropdown",
  10012. name: "uart_name"
  10013. }, {
  10014. check: "Number",
  10015. type: "input_value",
  10016. name: "write_one_byte"
  10017. }]
  10018. })
  10019. }
  10020. };
  10021. Blockly.Blocks.CocoRobo_uart_read = {
  10022. init: function () {
  10023. this.jsonInit({
  10024. inputsInline: !0,
  10025. output: null,
  10026. colour: CategoryColors.UART,
  10027. helpUrl: Blockly.Msg.CocoRobo_UART_READ_HELPURL,
  10028. tooltip: Blockly.Msg.CocoRobo_UART_READ_TOOLTIP,
  10029. message0: Blockly.Msg.CocoRobo_UART_READ_MESSAGE0,
  10030. args0: [{
  10031. options: [
  10032. ["uart1", "uart1"],
  10033. ["uart2", "uart2"]
  10034. ],
  10035. type: "field_dropdown",
  10036. name: "uart_name"
  10037. }]
  10038. })
  10039. }
  10040. };
  10041. Blockly.Blocks.CocoRobo_uart_readinto = {
  10042. init: function () {
  10043. this.jsonInit({
  10044. inputsInline: !0,
  10045. output: null,
  10046. colour: CategoryColors.UART,
  10047. helpUrl: Blockly.Msg.CocoRobo_UART_READINTO_HELPURL,
  10048. tooltip: Blockly.Msg.CocoRobo_UART_READINTO_TOOLTIP,
  10049. message0: Blockly.Msg.CocoRobo_UART_READINTO_MESSAGE0,
  10050. args0: [{
  10051. options: [
  10052. ["uart1", "uart1"],
  10053. ["uart2", "uart2"]
  10054. ],
  10055. type: "field_dropdown",
  10056. name: "uart_name"
  10057. }]
  10058. })
  10059. }
  10060. };
  10061. Blockly.Blocks.CocoRobo_uart_read_length = {
  10062. init: function () {
  10063. this.jsonInit({
  10064. inputsInline: !0,
  10065. output: null,
  10066. colour: CategoryColors.UART,
  10067. helpUrl: Blockly.Msg.CocoRobo_UART_READ_LENGTH_HELPURL,
  10068. tooltip: Blockly.Msg.CocoRobo_UART_READ_LENGTH_TOOLTIP,
  10069. message0: Blockly.Msg.CocoRobo_UART_READ_LENGTH_MESSAGE0,
  10070. args0: [{
  10071. options: [
  10072. ["uart1", "uart1"],
  10073. ["uart2", "uart2"]
  10074. ],
  10075. type: "field_dropdown",
  10076. name: "uart_name"
  10077. }, {
  10078. check: "Number",
  10079. type: "input_value",
  10080. name: "read_length"
  10081. }]
  10082. })
  10083. }
  10084. };
  10085. Blockly.Blocks.CocoRobo_uart_readline = {
  10086. init: function () {
  10087. this.jsonInit({
  10088. inputsInline: !0,
  10089. output: null,
  10090. colour: CategoryColors.UART,
  10091. helpUrl: Blockly.Msg.CocoRobo_UART_READLINE_HELPURL,
  10092. tooltip: Blockly.Msg.CocoRobo_UART_READLINE_TOOLTIP,
  10093. message0: Blockly.Msg.CocoRobo_UART_READLINE_MESSAGE0,
  10094. args0: [{
  10095. options: [
  10096. ["uart1", "uart1"],
  10097. ["uart2", "uart2"]
  10098. ],
  10099. type: "field_dropdown",
  10100. name: "uart_name"
  10101. }]
  10102. })
  10103. }
  10104. };
  10105. Blockly.Blocks.CocoRobo_uart_has_data = {
  10106. init: function () {
  10107. this.jsonInit({
  10108. inputsInline: !0,
  10109. output: "Boolean",
  10110. colour: CategoryColors.UART,
  10111. helpUrl: Blockly.Msg.CocoRobo_UART_HAS_DATA_HELPURL,
  10112. tooltip: Blockly.Msg.CocoRobo_UART_HAS_DATA_TOOLTIP,
  10113. message0: Blockly.Msg.CocoRobo_UART_HAS_DATA_MESSAGE0,
  10114. args0: [{
  10115. options: [
  10116. ["uart1", "uart1"],
  10117. ["uart2", "uart2"]
  10118. ],
  10119. type: "field_dropdown",
  10120. name: "uart_name"
  10121. }]
  10122. })
  10123. }
  10124. };
  10125. Blockly.Blocks.CocoRobo_uart_write_hex = {
  10126. init: function () {
  10127. this.jsonInit({
  10128. inputsInline: !0,
  10129. nextStatement: null,
  10130. previousStatement: null,
  10131. colour: CategoryColors.UART,
  10132. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_HEX_HELPURL,
  10133. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_HEX_TOOLTIP,
  10134. message0: Blockly.Msg.CocoRobo_UART_WRITE_HEX_MESSAGE0,
  10135. args0: [{
  10136. options: [
  10137. ["uart1", "uart1"],
  10138. ["uart2", "uart2"]
  10139. ],
  10140. type: "field_dropdown",
  10141. name: "uart_name"
  10142. }, {
  10143. type: "field_input",
  10144. name: "data",
  10145. text: "0xff00ff"
  10146. }, {
  10147. options: [
  10148. [Blockly.Msg.CocoRobo_FONT_NO_WRAP, "no_new"],
  10149. [Blockly.Msg.CocoRobo_FONT_WRAP, "new"]
  10150. ],
  10151. type: "field_dropdown",
  10152. name: "newline"
  10153. }]
  10154. })
  10155. }
  10156. };
  10157. Blockly.Blocks.CocoRobo_uart_write_str = {
  10158. init: function () {
  10159. this.jsonInit({
  10160. inputsInline: !0,
  10161. nextStatement: null,
  10162. previousStatement: null,
  10163. colour: CategoryColors.UART,
  10164. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_STR_HELPURL,
  10165. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_STR_TOOLTIP,
  10166. message0: Blockly.Msg.CocoRobo_UART_WRITE_STR_MESSAGE0,
  10167. args0: [{
  10168. options: [
  10169. ["uart1", "uart1"],
  10170. ["uart2", "uart2"]
  10171. ],
  10172. type: "field_dropdown",
  10173. name: "uart_name"
  10174. }, {
  10175. check: "String",
  10176. type: "input_value",
  10177. name: "data"
  10178. }, {
  10179. options: [
  10180. [Blockly.Msg.CocoRobo_FONT_NO_WRAP, "no_new"],
  10181. [Blockly.Msg.CocoRobo_FONT_WRAP, "new"]
  10182. ],
  10183. type: "field_dropdown",
  10184. name: "newline"
  10185. }]
  10186. })
  10187. }
  10188. };
  10189. Blockly.Blocks.CocoRobo_uart_get_write_str = {
  10190. init: function () {
  10191. this.jsonInit({
  10192. inputsInline: !0,
  10193. output: null,
  10194. colour: CategoryColors.UART,
  10195. helpUrl: Blockly.Msg.CocoRobo_UART_WRITE_STR_HELPURL,
  10196. tooltip: Blockly.Msg.CocoRobo_UART_WRITE_STR_TOOLTIP,
  10197. message0: Blockly.Msg.CocoRobo_UART_WRITE_STR_MESSAGE0,
  10198. args0: [{
  10199. options: [
  10200. ["uart1", "uart1"],
  10201. ["uart2", "uart2"]
  10202. ],
  10203. type: "field_dropdown",
  10204. name: "uart_name"
  10205. }, {
  10206. check: "String",
  10207. type: "input_value",
  10208. name: "data"
  10209. }, {
  10210. options: [
  10211. [Blockly.Msg.CocoRobo_FONT_NO_WRAP, "no_new"],
  10212. [Blockly.Msg.CocoRobo_FONT_WRAP, "new"]
  10213. ],
  10214. type: "field_dropdown",
  10215. name: "newline"
  10216. }]
  10217. })
  10218. }
  10219. };
  10220. Blockly.Blocks.CocoRobo_uart_init = {
  10221. init: function () {
  10222. this.jsonInit({
  10223. inputsInline: !0,
  10224. nextStatement: null,
  10225. previousStatement: null,
  10226. colour: CategoryColors.UART,
  10227. helpUrl: Blockly.Msg.CocoRobo_UART_INIT_HELPURL,
  10228. tooltip: Blockly.Msg.CocoRobo_UART_INIT_TOOLTIP,
  10229. message0: Blockly.Msg.CocoRobo_UART_INIT_MESSAGE0,
  10230. args0: [{
  10231. type: "input_value",
  10232. name: "baudrate"
  10233. }, {
  10234. check: "Number",
  10235. type: "input_value",
  10236. name: "tx"
  10237. }, {
  10238. check: "Number",
  10239. type: "input_value",
  10240. name: "rx"
  10241. }, {
  10242. options: [
  10243. ["uart1", "uart1"],
  10244. ["uart2", "uart2"]
  10245. ],
  10246. type: "field_dropdown",
  10247. name: "uart_name"
  10248. }]
  10249. })
  10250. }
  10251. };
  10252. Blockly.Blocks.CocoRobo_uart_deinit = {
  10253. init: function () {
  10254. this.jsonInit({
  10255. inputsInline: !0,
  10256. nextStatement: null,
  10257. previousStatement: null,
  10258. colour: CategoryColors.UART,
  10259. helpUrl: Blockly.Msg.CocoRobo_UART_DEINIT_HELPURL,
  10260. tooltip: Blockly.Msg.CocoRobo_UART_DEINIT_TOOLTIP,
  10261. message0: Blockly.Msg.CocoRobo_UART_DEINIT_MESSAGE0,
  10262. args0: [{
  10263. options: [
  10264. ["uart1", "uart1"],
  10265. ["uart2", "uart2"]
  10266. ],
  10267. type: "field_dropdown",
  10268. name: "uart_name"
  10269. }]
  10270. })
  10271. }
  10272. };
  10273. Blockly.Blocks.CocoRobo_baudrate = {
  10274. init: function () {
  10275. this.jsonInit({
  10276. inputsInline: !0,
  10277. output: "Number",
  10278. colour: CategoryColors.UART,
  10279. helpUrl: Blockly.Msg.CocoRobo_BAUDRATE_HELPURL,
  10280. tooltip: Blockly.Msg.CocoRobo_BAUDRATE_TOOLTIP,
  10281. message0: Blockly.Msg.CocoRobo_BAUDRATE_MESSAGE0,
  10282. args0: [{
  10283. options: [
  10284. ["115200", "115200"],
  10285. ["57600", "57600"],
  10286. ["56000", "56000"],
  10287. ["43000", "43000"],
  10288. ["38400", "38400"],
  10289. ["31250", "31250"],
  10290. ["28800", "28800"],
  10291. ["19200", "19200"],
  10292. ["14400", "14400"],
  10293. ["9600", "9600"],
  10294. ["4800", "4800"],
  10295. ["2400", "2400"],
  10296. ["1200", "1200"],
  10297. ["600", "600"],
  10298. ["300", "300"]
  10299. ],
  10300. type: "field_dropdown",
  10301. name: "baudrate"
  10302. }]
  10303. })
  10304. }
  10305. };
  10306. Blockly.Blocks.CocoRobo_usocket_read = {
  10307. init: function () {
  10308. this.jsonInit({
  10309. inputsInline: !0,
  10310. output: null,
  10311. colour: CategoryColors.Network,
  10312. helpUrl: Blockly.Msg.CocoRobo_USOCKET_READ_HELPURL,
  10313. tooltip: Blockly.Msg.CocoRobo_USOCKET_READ_TOOLTIP,
  10314. message0: Blockly.Msg.CocoRobo_USOCKET_READ_MESSAGE0,
  10315. args0: [{
  10316. type: "field_input",
  10317. name: "socket_name",
  10318. text: "s"
  10319. }, {
  10320. check: "Number",
  10321. type: "input_value",
  10322. name: "size"
  10323. }]
  10324. })
  10325. }
  10326. };
  10327. Blockly.Blocks.CocoRobo_usocket_setblocking = {
  10328. init: function () {
  10329. this.jsonInit({
  10330. inputsInline: !0,
  10331. nextStatement: null,
  10332. previousStatement: null,
  10333. colour: CategoryColors.Network,
  10334. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SETBLOCKING_HELPURL,
  10335. tooltip: Blockly.Msg.CocoRobo_USOCKET_SETBLOCKING_TOOLTIP,
  10336. message0: Blockly.Msg.CocoRobo_USOCKET_SETBLOCKING_MESSAGE0,
  10337. args0: [{
  10338. type: "field_input",
  10339. name: "socket_name",
  10340. text: "s"
  10341. }, {
  10342. options: [
  10343. [Blockly.Msg.CocoRobo_USOCKET_BLOCK, "True"],
  10344. [Blockly.Msg.CocoRobo_USOCKET_UNBLOCK, "False"]
  10345. ],
  10346. type: "field_dropdown",
  10347. name: "mode"
  10348. }]
  10349. })
  10350. }
  10351. };
  10352. Blockly.Blocks.CocoRobo_usocket_settimeout = {
  10353. init: function () {
  10354. this.jsonInit({
  10355. inputsInline: !0,
  10356. nextStatement: null,
  10357. previousStatement: null,
  10358. colour: CategoryColors.Network,
  10359. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SETTIMEOUT_HELPURL,
  10360. tooltip: Blockly.Msg.CocoRobo_USOCKET_SETTIMEOUT_TOOLTIP,
  10361. message0: Blockly.Msg.CocoRobo_USOCKET_SETTIMEOUT_MESSAGE0,
  10362. args0: [{
  10363. type: "field_input",
  10364. name: "socket_name",
  10365. text: "s"
  10366. }, {
  10367. check: "Number",
  10368. type: "input_value",
  10369. name: "_nums"
  10370. }]
  10371. })
  10372. }
  10373. };
  10374. Blockly.Blocks.CocoRobo_text_ESC = {
  10375. init: function () {
  10376. this.jsonInit({
  10377. inputsInline: !0,
  10378. output: null,
  10379. colour: Blockly.Blocks.texts.HUE,
  10380. helpUrl: Blockly.Msg.CocoRobo_TEXT_ESC_HELPURL,
  10381. tooltip: Blockly.Msg.CocoRobo_TEXT_ESC_TOOLTIP,
  10382. message0: Blockly.Msg.CocoRobo_TEXT_ESC_MESSAGE0,
  10383. args0: [{
  10384. options: [
  10385. ["\\n", "\\n"],
  10386. ["\\n\\n", "\\n\\n"],
  10387. ["\\r", "\\r"],
  10388. ["\\r\\n", "\\r\\n"],
  10389. ["\\b", "\\b"],
  10390. ["\\other", "\\other"],
  10391. ["\\", "\\"],
  10392. ["\\\\", "\\\\"]
  10393. ],
  10394. type: "field_dropdown",
  10395. name: "mode"
  10396. }]
  10397. })
  10398. }
  10399. };
  10400. Blockly.Blocks.CocoRobo_usocket_recv = {
  10401. init: function () {
  10402. this.jsonInit({
  10403. inputsInline: !0,
  10404. output: null,
  10405. colour: CategoryColors.Network,
  10406. helpUrl: Blockly.Msg.CocoRobo_USOCKET_RECV_HELPURL,
  10407. tooltip: Blockly.Msg.CocoRobo_USOCKET_RECV_TOOLTIP,
  10408. message0: Blockly.Msg.CocoRobo_USOCKET_RECV_MESSAGE0,
  10409. args0: [{
  10410. type: "field_input",
  10411. name: "socket_name",
  10412. text: "s"
  10413. }, {
  10414. check: "Number",
  10415. type: "input_value",
  10416. name: "_nums"
  10417. }]
  10418. })
  10419. }
  10420. };
  10421. Blockly.Blocks.CocoRobo_usocket_recvfrom = {
  10422. init: function () {
  10423. this.jsonInit({
  10424. inputsInline: !0,
  10425. output: null,
  10426. colour: CategoryColors.Network,
  10427. helpUrl: Blockly.Msg.CocoRobo_USOCKET_RECVFROM_HELPURL,
  10428. tooltip: Blockly.Msg.CocoRobo_USOCKET_RECVFROM_TOOLTIP,
  10429. message0: Blockly.Msg.CocoRobo_USOCKET_RECVFROM_MESSAGE0,
  10430. args0: [{
  10431. type: "field_input",
  10432. name: "socket_name",
  10433. text: "s"
  10434. }, {
  10435. check: "Number",
  10436. type: "input_value",
  10437. name: "_nums"
  10438. }]
  10439. })
  10440. }
  10441. };
  10442. Blockly.Blocks.CocoRobo_usocket_sendall = {
  10443. init: function () {
  10444. this.jsonInit({
  10445. inputsInline: !0,
  10446. nextStatement: null,
  10447. previousStatement: null,
  10448. colour: CategoryColors.Network,
  10449. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SENDALL_HELPURL,
  10450. tooltip: Blockly.Msg.CocoRobo_USOCKET_SENDALL_TOOLTIP,
  10451. message0: Blockly.Msg.CocoRobo_USOCKET_SENDALL_MESSAGE0,
  10452. args0: [{
  10453. type: "field_input",
  10454. name: "socket_name",
  10455. text: "s"
  10456. }, {
  10457. check: "String",
  10458. type: "input_value",
  10459. name: "_bytes"
  10460. }]
  10461. })
  10462. }
  10463. };
  10464. Blockly.Blocks.CocoRobo_usocket_sends = {
  10465. init: function () {
  10466. this.jsonInit({
  10467. inputsInline: !0,
  10468. nextStatement: null,
  10469. previousStatement: null,
  10470. colour: CategoryColors.Network,
  10471. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SENDS_HELPURL,
  10472. tooltip: Blockly.Msg.CocoRobo_USOCKET_SENDS_TOOLTIP,
  10473. message0: Blockly.Msg.CocoRobo_USOCKET_SENDS_MESSAGE0,
  10474. args0: [{
  10475. type: "field_input",
  10476. name: "socket_name",
  10477. text: "s"
  10478. }, {
  10479. check: "String",
  10480. type: "input_value",
  10481. name: "_bytes"
  10482. }]
  10483. })
  10484. }
  10485. };
  10486. Blockly.Blocks.CocoRobo_usocket_send = {
  10487. init: function () {
  10488. this.jsonInit({
  10489. inputsInline: !0,
  10490. output: "Number",
  10491. colour: CategoryColors.Network,
  10492. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SEND_HELPURL,
  10493. tooltip: Blockly.Msg.CocoRobo_USOCKET_SEND_TOOLTIP,
  10494. message0: Blockly.Msg.CocoRobo_USOCKET_SEND_MESSAGE0,
  10495. args0: [{
  10496. type: "field_input",
  10497. name: "socket_name",
  10498. text: "s"
  10499. }, {
  10500. check: "String",
  10501. type: "input_value",
  10502. name: "_bytes"
  10503. }]
  10504. })
  10505. }
  10506. };
  10507. Blockly.Blocks.CocoRobo_usocket_sendto = {
  10508. init: function () {
  10509. this.jsonInit({
  10510. inputsInline: !1,
  10511. nextStatement: null,
  10512. previousStatement: null,
  10513. colour: CategoryColors.Network,
  10514. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SENDTO_HELPURL,
  10515. tooltip: Blockly.Msg.CocoRobo_USOCKET_SENDTO_TOOLTIP,
  10516. message0: Blockly.Msg.CocoRobo_USOCKET_SENDTO_MESSAGE0,
  10517. args0: [{
  10518. type: "field_input",
  10519. name: "socket_name",
  10520. text: "s"
  10521. }, {
  10522. check: "String",
  10523. type: "input_value",
  10524. name: "_bytes"
  10525. }, {
  10526. check: "Array",
  10527. type: "input_value",
  10528. name: "_address"
  10529. }]
  10530. })
  10531. }
  10532. };
  10533. Blockly.Blocks.CocoRobo_usocket_connect = {
  10534. init: function () {
  10535. this.jsonInit({
  10536. inputsInline: !0,
  10537. nextStatement: null,
  10538. previousStatement: null,
  10539. colour: CategoryColors.Network,
  10540. helpUrl: Blockly.Msg.CocoRobo_USOCKET_CONNECT_HELPURL,
  10541. tooltip: Blockly.Msg.CocoRobo_USOCKET_CONNECT_TOOLTIP,
  10542. message0: Blockly.Msg.CocoRobo_USOCKET_CONNECT_MESSAGE0,
  10543. args0: [{
  10544. type: "field_input",
  10545. name: "socket_name",
  10546. text: "s"
  10547. }, {
  10548. check: "String",
  10549. type: "input_value",
  10550. name: "host"
  10551. }, {
  10552. check: "Number",
  10553. type: "input_value",
  10554. name: "port"
  10555. }]
  10556. })
  10557. }
  10558. };
  10559. Blockly.Blocks.CocoRobo_usocket_getaddrinfo = {
  10560. init: function () {
  10561. this.jsonInit({
  10562. inputsInline: !0,
  10563. output: "String",
  10564. colour: CategoryColors.Network,
  10565. helpUrl: Blockly.Msg.CocoRobo_USOCKET_GETADDRINFO_HELPURL,
  10566. tooltip: Blockly.Msg.CocoRobo_USOCKET_GETADDRINFO_TOOLTIP,
  10567. message0: Blockly.Msg.CocoRobo_USOCKET_GETADDRINFO_MESSAGE0,
  10568. args0: [{
  10569. check: "String",
  10570. type: "input_value",
  10571. name: "host"
  10572. }, {
  10573. check: "Number",
  10574. type: "input_value",
  10575. name: "port"
  10576. }]
  10577. })
  10578. }
  10579. };
  10580. Blockly.Blocks.CocoRobo_usocket_accept = {
  10581. init: function () {
  10582. this.jsonInit({
  10583. inputsInline: !0,
  10584. output: "Array",
  10585. colour: CategoryColors.Network,
  10586. helpUrl: Blockly.Msg.CocoRobo_USOCKET_ACCEPT_HELPURL,
  10587. tooltip: Blockly.Msg.CocoRobo_USOCKET_ACCEPT_TOOLTIP,
  10588. message0: Blockly.Msg.CocoRobo_USOCKET_ACCEPT_MESSAGE0,
  10589. args0: [{
  10590. type: "field_input",
  10591. name: "socket_name",
  10592. text: "s"
  10593. }]
  10594. })
  10595. }
  10596. };
  10597. Blockly.Blocks.CocoRobo_usocket_listen = {
  10598. init: function () {
  10599. this.jsonInit({
  10600. inputsInline: !0,
  10601. nextStatement: null,
  10602. previousStatement: null,
  10603. colour: CategoryColors.Network,
  10604. helpUrl: Blockly.Msg.CocoRobo_USOCKET_LISTEN_HELPURL,
  10605. tooltip: Blockly.Msg.CocoRobo_USOCKET_LISTEN_TOOLTIP,
  10606. message0: Blockly.Msg.CocoRobo_USOCKET_LISTEN_MESSAGE0,
  10607. args0: [{
  10608. type: "field_input",
  10609. name: "socket_name",
  10610. text: "s"
  10611. }, {
  10612. check: "Number",
  10613. type: "input_value",
  10614. name: "backlog"
  10615. }]
  10616. })
  10617. }
  10618. };
  10619. Blockly.Blocks.CocoRobo_usocket_bind = {
  10620. init: function () {
  10621. this.jsonInit({
  10622. inputsInline: !0,
  10623. nextStatement: null,
  10624. previousStatement: null,
  10625. colour: CategoryColors.Network,
  10626. helpUrl: Blockly.Msg.CocoRobo_USOCKET_BIND_HELPURL,
  10627. tooltip: Blockly.Msg.CocoRobo_USOCKET_BIND_TOOLTIP,
  10628. message0: Blockly.Msg.CocoRobo_USOCKET_BIND_MESSAGE0,
  10629. args0: [{
  10630. type: "field_input",
  10631. name: "socket_name",
  10632. text: "s"
  10633. }, {
  10634. check: "String",
  10635. type: "input_value",
  10636. name: "address"
  10637. }, {
  10638. check: "Number",
  10639. type: "input_value",
  10640. name: "port"
  10641. }]
  10642. })
  10643. }
  10644. };
  10645. Blockly.Blocks.CocoRobo_usocket_close = {
  10646. init: function () {
  10647. this.jsonInit({
  10648. inputsInline: !0,
  10649. nextStatement: null,
  10650. previousStatement: null,
  10651. colour: CategoryColors.Network,
  10652. helpUrl: Blockly.Msg.CocoRobo_USOCKET_CLOSE_HELPURL,
  10653. tooltip: Blockly.Msg.CocoRobo_USOCKET_CLOSE_TOOLTIP,
  10654. message0: Blockly.Msg.CocoRobo_USOCKET_CLOSE_MESSAGE0,
  10655. args0: [{
  10656. type: "field_input",
  10657. name: "socket_name",
  10658. text: "s"
  10659. }]
  10660. })
  10661. }
  10662. };
  10663. Blockly.Blocks.CocoRobo_usocket_init = {
  10664. init: function () {
  10665. this.jsonInit({
  10666. inputsInline: !0,
  10667. nextStatement: null,
  10668. previousStatement: null,
  10669. colour: CategoryColors.Network,
  10670. helpUrl: Blockly.Msg.CocoRobo_USOCKET_INIT_HELPURL,
  10671. tooltip: Blockly.Msg.CocoRobo_USOCKET_INIT_TOOLTIP,
  10672. message0: Blockly.Msg.CocoRobo_USOCKET_INIT_MESSAGE0,
  10673. args0: [{
  10674. type: "field_input",
  10675. name: "socket_name",
  10676. text: "s"
  10677. }, {
  10678. options: [
  10679. ["AF_INET", "AF_INET"],
  10680. ["AF_INET6", "AF_INET6"]
  10681. ],
  10682. type: "field_dropdown",
  10683. name: "af"
  10684. }, {
  10685. options: [
  10686. ["SOCK_STREAM", "SOCK_STREAM"],
  10687. ["SOCK_DGRAM", "SOCK_DGRAM"],
  10688. ["SOCK_RAW", "SOCK_RAW"],
  10689. ["SO_REUSEADDR", "SO_REUSEADDR"]
  10690. ],
  10691. type: "field_dropdown",
  10692. name: "_type"
  10693. }]
  10694. })
  10695. }
  10696. };
  10697. Blockly.Blocks.CocoRobo_usocket_setsockopt = {
  10698. init: function () {
  10699. this.jsonInit({
  10700. inputsInline: !0,
  10701. nextStatement: null,
  10702. previousStatement: null,
  10703. colour: CategoryColors.Network,
  10704. helpUrl: Blockly.Msg.CocoRobo_USOCKET_SETSOCKOPT_HELPURL,
  10705. tooltip: Blockly.Msg.CocoRobo_USOCKET_SETSOCKOPT_TOOLTIP,
  10706. message0: Blockly.Msg.CocoRobo_USOCKET_SETSOCKOPT_MESSAGE0,
  10707. args0: [{
  10708. type: "field_input",
  10709. name: "socket_name",
  10710. text: "s"
  10711. }, {
  10712. options: [
  10713. ["SOCK_STREAM", "SOCK_STREAM"],
  10714. ["SOCK_DGRAM", "SOCK_DGRAM"],
  10715. ["SOCK_RAW", "SOCK_RAW"],
  10716. ["SO_REUSEADDR", "SO_REUSEADDR"]
  10717. ],
  10718. type: "field_dropdown",
  10719. name: "_type"
  10720. }, {
  10721. check: "Number",
  10722. type: "input_value",
  10723. name: "value"
  10724. }]
  10725. })
  10726. }
  10727. };
  10728. Blockly.Blocks.CocoRobo_get_post = {
  10729. init: function () {
  10730. this.jsonInit({
  10731. inputsInline: !1,
  10732. nextStatement: null,
  10733. previousStatement: null,
  10734. colour: CategoryColors.Network,
  10735. helpUrl: Blockly.Msg.CocoRobo_GET_POST_HELPURL,
  10736. tooltip: Blockly.Msg.CocoRobo_GET_POST_TOOLTIP,
  10737. message0: Blockly.Msg.CocoRobo_GET_POST_MESSAGE0,
  10738. args0: [{
  10739. options: [
  10740. ["get", "get"],
  10741. ["post", "post"]
  10742. ],
  10743. type: "field_dropdown",
  10744. name: "get_post"
  10745. }, {
  10746. check: "String",
  10747. type: "input_value",
  10748. name: "url"
  10749. }, {
  10750. type: "input_value",
  10751. name: "json"
  10752. }]
  10753. })
  10754. }
  10755. };
  10756. Blockly.Blocks.CocoRobo_urequests_get_post = {
  10757. init: function () {
  10758. this.jsonInit({
  10759. inputsInline: !1,
  10760. nextStatement: null,
  10761. previousStatement: null,
  10762. colour: CategoryColors.Network,
  10763. helpUrl: Blockly.Msg.CocoRobo_UREQUESTS_GET_POST_HELPURL,
  10764. tooltip: Blockly.Msg.CocoRobo_UREQUESTS_GET_POST_TOOLTIP,
  10765. message0: Blockly.Msg.CocoRobo_UREQUESTS_GET_POST_MESSAGE0,
  10766. args0: [{
  10767. options: [
  10768. ["Get", "get"],
  10769. ["Post", "post"]
  10770. ],
  10771. type: "field_dropdown",
  10772. name: "method"
  10773. }, {
  10774. check: "String",
  10775. type: "input_value",
  10776. name: "url"
  10777. }, {
  10778. type: "input_value",
  10779. name: "json"
  10780. }]
  10781. })
  10782. }
  10783. };
  10784. Blockly.Blocks.CocoRobo_urequests_post_file = {
  10785. init: function () {
  10786. this.jsonInit({
  10787. inputsInline: !1,
  10788. nextStatement: null,
  10789. previousStatement: null,
  10790. colour: CategoryColors.Network,
  10791. helpUrl: Blockly.Msg.CocoRobo_UREQUESTS_POST_FILE_HELPURL,
  10792. tooltip: Blockly.Msg.CocoRobo_UREQUESTS_POST_FILE_TOOLTIP,
  10793. message0: Blockly.Msg.CocoRobo_UREQUESTS_POST_FILE_MESSAGE0,
  10794. args0: [{
  10795. type: "input_dummy"
  10796. }, {
  10797. check: "String",
  10798. type: "input_value",
  10799. name: "url"
  10800. }, {
  10801. check: "String",
  10802. type: "input_value",
  10803. name: "file_name"
  10804. }, {
  10805. check: "String",
  10806. type: "input_value",
  10807. name: "file_type"
  10808. }, {
  10809. check: "Array",
  10810. type: "input_value",
  10811. name: "json"
  10812. }]
  10813. })
  10814. }
  10815. };
  10816. Blockly.Blocks.CocoRobo_response = {
  10817. init: function () {
  10818. this.jsonInit({
  10819. inputsInline: !0,
  10820. output: null,
  10821. colour: CategoryColors.Network,
  10822. helpUrl: Blockly.Msg.CocoRobo_RESPONSE_HELPURL,
  10823. tooltip: Blockly.Msg.CocoRobo_RESPONSE_TOOLTIP,
  10824. message0: Blockly.Msg.CocoRobo_RESPONSE_MESSAGE0,
  10825. args0: [{
  10826. options: [
  10827. [Blockly.Msg.TEXT, "text"],
  10828. [Blockly.Msg._BYTE, "content"],
  10829. [Blockly.Msg.DICT_CREATE_WITH_CONTAINER_TITLE_ADD, "json()"]
  10830. ],
  10831. type: "field_dropdown",
  10832. name: "response"
  10833. }]
  10834. })
  10835. }
  10836. };
  10837. Blockly.Blocks.CocoRobo_response_attribute = {
  10838. init: function () {
  10839. this.jsonInit({
  10840. inputsInline: !0,
  10841. output: null,
  10842. colour: CategoryColors.Network,
  10843. helpUrl: Blockly.Msg.CocoRobo_RESPONSE_ATTRIBUTE_HELPURL,
  10844. tooltip: Blockly.Msg.CocoRobo_RESPONSE_ATTRIBUTE_TOOLTIP,
  10845. message0: Blockly.Msg.CocoRobo_RESPONSE_ATTRIBUTE_MESSAGE0,
  10846. args0: [{
  10847. options: [
  10848. ["encoding", "encoding"],
  10849. ["status code", "status_code"],
  10850. ["reason", "reason"]
  10851. ],
  10852. type: "field_dropdown",
  10853. name: "response_attribute"
  10854. }]
  10855. })
  10856. }
  10857. };
  10858. Blockly.Blocks.CocoRobo_init_wifi = {
  10859. init: function () {
  10860. this.jsonInit({
  10861. inputsInline: !0,
  10862. nextStatement: null,
  10863. previousStatement: null,
  10864. colour: CategoryColors.Wifi,
  10865. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  10866. tooltip: Blockly.Msg.CocoRobo_init_wifi_TOOLTIP,
  10867. message0: Blockly.Msg.CocoRobo_init_wifi_MESSAGE0,
  10868. args0: [{
  10869. check: "String",
  10870. type: "input_value",
  10871. name: "ssid"
  10872. }, {
  10873. check: "String",
  10874. type: "input_value",
  10875. name: "password"
  10876. }]
  10877. })
  10878. }
  10879. };
  10880. Blockly.Blocks.CocoRobo_wifi_all_config = {
  10881. init: function () {
  10882. this.jsonInit({
  10883. inputsInline: !0,
  10884. output: "Array",
  10885. colour: CategoryColors.Wifi,
  10886. helpUrl: Blockly.Msg.CocoRobo_WIFI_ALL_CONFIG_HELPURL,
  10887. tooltip: Blockly.Msg.CocoRobo_WIFI_ALL_CONFIG_TOOLTIP,
  10888. message0: Blockly.Msg.CocoRobo_WIFI_ALL_CONFIG_MESSAGE0
  10889. })
  10890. }
  10891. };
  10892. Blockly.Blocks.CocoRobo_wifi_isconnected = {
  10893. init: function () {
  10894. this.jsonInit({
  10895. inputsInline: !0,
  10896. output: "Boolean",
  10897. colour: CategoryColors.Wifi,
  10898. helpUrl: Blockly.Msg.CocoRobo_WIFI_ISCONNECTED_HELPURL,
  10899. tooltip: Blockly.Msg.CocoRobo_WIFI_ISCONNECTED_TOOLTIP,
  10900. message0: Blockly.Msg.CocoRobo_WIFI_ISCONNECTED_MESSAGE0
  10901. })
  10902. }
  10903. };
  10904. Blockly.Blocks.CocoRobo_WiFi_config = {
  10905. init: function () {
  10906. this.jsonInit({
  10907. colour: CategoryColors.Wifi,
  10908. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  10909. tooltip: Blockly.Msg.CocoRobo_WiFi_config_TOOLTIP,
  10910. message0: Blockly.Msg.CocoRobo_WiFi_config_MESSAGE0,
  10911. output: "String",
  10912. args0: [{
  10913. options: WiFi_config,
  10914. type: "field_dropdown",
  10915. name: "WiFi_config"
  10916. }]
  10917. })
  10918. }
  10919. };
  10920. Blockly.Blocks.CocoRobo_dis_WiFi = {
  10921. init: function () {
  10922. this.jsonInit({
  10923. inputsInline: !0,
  10924. nextStatement: null,
  10925. previousStatement: null,
  10926. colour: CategoryColors.Wifi,
  10927. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  10928. tooltip: Blockly.Msg.CocoRobo_dis_WiFi_TOOLTIP,
  10929. message0: Blockly.Msg.CocoRobo_dis_WiFi_MESSAGE0
  10930. })
  10931. }
  10932. };
  10933. Blockly.Blocks.CocoRobo_wifi_channel = {
  10934. init: function () {
  10935. this.jsonInit({
  10936. inputsInline: !0,
  10937. colour: CategoryColors.Wifi,
  10938. helpUrl: "",
  10939. tooltip: "",
  10940. message0: "%1",
  10941. output: "Number",
  10942. args0: [{
  10943. options: WiFi_channel,
  10944. type: "field_dropdown",
  10945. name: "channel"
  10946. }]
  10947. })
  10948. }
  10949. };
  10950. Blockly.Blocks.CocoRobo_enable_APWiFi = {
  10951. init: function () {
  10952. this.jsonInit({
  10953. inputsInline: !0,
  10954. nextStatement: null,
  10955. previousStatement: null,
  10956. colour: CategoryColors.Wifi,
  10957. helpUrl: Blockly.Msg.CocoRobo_ENABLE_APWIFI_HELPURL,
  10958. tooltip: Blockly.Msg.CocoRobo_ENABLE_APWIFI_TOOLTIP,
  10959. message0: Blockly.Msg.CocoRobo_ENABLE_APWIFI_MESSAGE0,
  10960. args0: [{
  10961. check: "String",
  10962. type: "input_value",
  10963. name: "essid"
  10964. }, {
  10965. check: "String",
  10966. type: "input_value",
  10967. name: "password"
  10968. }, {
  10969. check: "Number",
  10970. type: "input_value",
  10971. name: "channel"
  10972. }]
  10973. })
  10974. }
  10975. };
  10976. Blockly.Blocks.CocoRobo_disable_APWiFi = {
  10977. init: function () {
  10978. this.jsonInit({
  10979. inputsInline: !0,
  10980. nextStatement: null,
  10981. previousStatement: null,
  10982. colour: CategoryColors.Wifi,
  10983. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  10984. tooltip: Blockly.Msg.CocoRobo_disable_APWiFi_TOOLTIP,
  10985. message0: Blockly.Msg.CocoRobo_disable_APWiFi_MESSAGE0
  10986. })
  10987. }
  10988. };
  10989. Blockly.Blocks.CocoRobo_seniverse_city_weather = {
  10990. init: function () {
  10991. this.jsonInit({
  10992. inputsInline: !1,
  10993. colour: CategoryColors.Weather,
  10994. helpUrl: Blockly.Msg.CocoRobo_SENIVERSE_CITY_WEATHER_HELPURL,
  10995. tooltip: Blockly.Msg.CocoRobo_SENIVERSE_CITY_WEATHER_TOOLTIP,
  10996. message0: Blockly.Msg.CocoRobo_SENIVERSE_CITY_WEATHER_MESSAGE0,
  10997. output: "Array",
  10998. args0: [{
  10999. options: [
  11000. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_API_1, "api_1"],
  11001. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_API_2, "api_2"],
  11002. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_API_3, "api_3"]
  11003. ],
  11004. type: "field_dropdown",
  11005. name: "api"
  11006. }, {
  11007. type: "input_dummy"
  11008. }, {
  11009. check: "String",
  11010. type: "input_value",
  11011. name: "location"
  11012. }, {
  11013. type: "field_input",
  11014. name: "key",
  11015. text: "your_private_key"
  11016. }, {
  11017. type: "input_dummy"
  11018. }, {
  11019. options: [
  11020. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_LANGUAGE_1, "zh-Hans"],
  11021. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_LANGUAGE_2, "zh-Hant"]
  11022. ],
  11023. type: "field_dropdown",
  11024. name: "language"
  11025. }, {
  11026. type: "input_dummy"
  11027. }, {
  11028. options: [
  11029. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_UNIT_1, "c"],
  11030. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_UNIT_2, "f"]
  11031. ],
  11032. type: "field_dropdown",
  11033. name: "unit"
  11034. }]
  11035. })
  11036. }
  11037. };
  11038. Blockly.Blocks.CocoRobo_define_seniverse_weather = {
  11039. init: function () {
  11040. this.jsonInit({
  11041. inputsInline: !0,
  11042. nextStatement: null,
  11043. previousStatement: null,
  11044. colour: CategoryColors.Weather,
  11045. helpUrl: Blockly.Msg.CocoRobo_DEFINE_SENIVERSE_WEATHER_HELPURL,
  11046. tooltip: Blockly.Msg.CocoRobo_DEFINE_SENIVERSE_WEATHER_TOOLTIP,
  11047. message0: Blockly.Msg.CocoRobo_DEFINE_SENIVERSE_WEATHER_MESSAGE0,
  11048. args0: [{
  11049. type: "field_input",
  11050. name: "var_name",
  11051. text: "w1"
  11052. }, {
  11053. check: "Array",
  11054. type: "input_value",
  11055. name: "info"
  11056. }]
  11057. })
  11058. }
  11059. };
  11060. Blockly.Blocks.CocoRobo_get_seniverse_weather_info = {
  11061. init: function () {
  11062. this.jsonInit({
  11063. inputsInline: !0,
  11064. output: ["String", "Array"],
  11065. colour: CategoryColors.Weather,
  11066. helpUrl: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO_HELPURL,
  11067. tooltip: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO_TOOLTIP,
  11068. message0: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO_MESSAGE0,
  11069. args0: [{
  11070. type: "field_input",
  11071. name: "var_name",
  11072. text: "w1"
  11073. }, {
  11074. options: [
  11075. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_city_name, "name"],
  11076. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_city_id, "id"],
  11077. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_country, "country"],
  11078. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_path, "path"],
  11079. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_timezone, "timezone"],
  11080. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_timezone_offset, "timezone_offset"],
  11081. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_last_update_date, "last_update_date"],
  11082. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_last_update, "last_update"],
  11083. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_object, "object"]
  11084. ],
  11085. type: "field_dropdown",
  11086. name: "type"
  11087. }]
  11088. })
  11089. }
  11090. };
  11091. Blockly.Blocks.CocoRobo_get_seniverse_weather_info1 = {
  11092. init: function () {
  11093. this.jsonInit({
  11094. inputsInline: !0,
  11095. output: "String",
  11096. colour: CategoryColors.Weather,
  11097. helpUrl: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO1_HELPURL,
  11098. tooltip: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO1_TOOLTIP,
  11099. message0: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO1_MESSAGE0,
  11100. args0: [{
  11101. type: "field_input",
  11102. name: "var_name",
  11103. text: "w1"
  11104. }, {
  11105. options: [
  11106. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_text, "text"],
  11107. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_code, "code"],
  11108. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_temperature, "temperature"]
  11109. ],
  11110. type: "field_dropdown",
  11111. name: "type"
  11112. }]
  11113. })
  11114. }
  11115. };
  11116. Blockly.Blocks.CocoRobo_get_seniverse_weather_info2 = {
  11117. init: function () {
  11118. this.jsonInit({
  11119. inputsInline: !0,
  11120. output: "String",
  11121. colour: CategoryColors.Weather,
  11122. helpUrl: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO2_HELPURL,
  11123. tooltip: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO2_TOOLTIP,
  11124. message0: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO2_MESSAGE0,
  11125. args0: [{
  11126. type: "field_input",
  11127. name: "var_name",
  11128. text: "w1"
  11129. }, {
  11130. options: [
  11131. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_today, "0"],
  11132. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_tomorrow, "1"],
  11133. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_the_day_after_tomorrow, "2"]
  11134. ],
  11135. type: "field_dropdown",
  11136. name: "date"
  11137. }, {
  11138. options: [
  11139. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_high, "high"],
  11140. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_low, "low"],
  11141. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_text_day, "text_day"],
  11142. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_code_day, "code_day"],
  11143. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_text_night, "text_night"],
  11144. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_code_night, "code_night"],
  11145. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_wind_direction, "wind_direction"],
  11146. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_wind_direction_degree, "wind_direction_degree"],
  11147. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_wind_speed, "wind_speed"],
  11148. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_wind_scale, "wind_scale"],
  11149. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_date, "date"]
  11150. ],
  11151. type: "field_dropdown",
  11152. name: "type"
  11153. }]
  11154. })
  11155. }
  11156. };
  11157. Blockly.Blocks.CocoRobo_get_seniverse_weather_info3 = {
  11158. init: function () {
  11159. this.jsonInit({
  11160. inputsInline: !0,
  11161. output: "String",
  11162. colour: CategoryColors.Weather,
  11163. helpUrl: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO3_HELPURL,
  11164. tooltip: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO3_TOOLTIP,
  11165. message0: Blockly.Msg.CocoRobo_GET_SENIVERSE_WEATHER_INFO3_MESSAGE0,
  11166. args0: [{
  11167. type: "field_input",
  11168. name: "var_name",
  11169. text: "w1"
  11170. }, {
  11171. options: [
  11172. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_car_washing, "car_washing"],
  11173. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_dressing, "dressing"],
  11174. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_flu, "flu"],
  11175. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_sport, "sport"],
  11176. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_travel, "travel"],
  11177. [Blockly.Msg.CocoRobo_SENIVERSE_WEATHER_uv, "uv"]
  11178. ],
  11179. type: "field_dropdown",
  11180. name: "type"
  11181. }]
  11182. })
  11183. }
  11184. };
  11185. Blockly.Blocks.CocoRobo_ntptime_settime = {
  11186. init: function () {
  11187. this.jsonInit({
  11188. inputsInline: !0,
  11189. nextStatement: null,
  11190. previousStatement: null,
  11191. colour: CategoryColors.Wifi,
  11192. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  11193. tooltip: Blockly.Msg.CocoRobo_ntptime_settime_TOOLTIP,
  11194. message0: Blockly.Msg.CocoRobo_ntptime_settime_MESSAGE0,
  11195. // args0: [{
  11196. // name: "timezone",
  11197. // options: [[Blockly.Msg.CocoRobo_ntptime_timezone_E8, "8"], [Blockly.Msg.CocoRobo_ntptime_timezone_E9, "9"], [Blockly.Msg.CocoRobo_ntptime_timezone_E10, "10"], [Blockly.Msg.CocoRobo_ntptime_timezone_E11, "11"], [Blockly.Msg.CocoRobo_ntptime_timezone_E12, "12"], [Blockly.Msg.CocoRobo_ntptime_timezone_W12, "-12"], [Blockly.Msg.CocoRobo_ntptime_timezone_W11, "-11"], [Blockly.Msg.CocoRobo_ntptime_timezone_W10, "-10"], [Blockly.Msg.CocoRobo_ntptime_timezone_W9, "-9"], [Blockly.Msg.CocoRobo_ntptime_timezone_W8, "-8"], [Blockly.Msg.CocoRobo_ntptime_timezone_W7, "-7"], [Blockly.Msg.CocoRobo_ntptime_timezone_W6, "-6"], [Blockly.Msg.CocoRobo_ntptime_timezone_W5, "-5"], [Blockly.Msg.CocoRobo_ntptime_timezone_W4, "-4"], [Blockly.Msg.CocoRobo_ntptime_timezone_W3, "-3"], [Blockly.Msg.CocoRobo_ntptime_timezone_W2, "-2"], [Blockly.Msg.CocoRobo_ntptime_timezone_W1, "-1"], [Blockly.Msg.CocoRobo_ntptime_timezone_0, "0"], [Blockly.Msg.CocoRobo_ntptime_timezone_E1, "1"], [Blockly.Msg.CocoRobo_ntptime_timezone_E2, "2"], [Blockly.Msg.CocoRobo_ntptime_timezone_E3, "3"], [Blockly.Msg.CocoRobo_ntptime_timezone_E4, "4"], [Blockly.Msg.CocoRobo_ntptime_timezone_E5, "5"], [Blockly.Msg.CocoRobo_ntptime_timezone_E6, "6"], [Blockly.Msg.CocoRobo_ntptime_timezone_E7, "7"]],
  11198. // type: "field_dropdown"
  11199. // }, {
  11200. // type: "field_input",
  11201. // name: "server",
  11202. // text: "time.windows.com"
  11203. // }]
  11204. })
  11205. }
  11206. };
  11207. Blockly.Blocks.CocoRobo_wifi_clock = {
  11208. init: function () {
  11209. this.jsonInit({
  11210. inputsInline: !0,
  11211. nextStatement: null,
  11212. previousStatement: null,
  11213. colour: rgbColor,
  11214. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  11215. tooltip: Blockly.Msg.CocoRobo_wifi_clock_TOOLTIP,
  11216. message0: Blockly.Msg.CocoRobo_wifi_clock_MESSAGE0,
  11217. args0: [{
  11218. check: "Number",
  11219. type: "input_value",
  11220. name: "x"
  11221. }, {
  11222. check: "Number",
  11223. type: "input_value",
  11224. name: "y"
  11225. }, {
  11226. check: "Number",
  11227. type: "input_value",
  11228. name: "radius"
  11229. }]
  11230. })
  11231. }
  11232. };
  11233. Blockly.Blocks.CocoRobobox_sound = {
  11234. init: function () {
  11235. this.jsonInit({
  11236. colour: "#e8795b",
  11237. output: "Number",
  11238. helpUrl: Blockly.Msg.CocoRobobox_sound_HELPURL,
  11239. tooltip: Blockly.Msg.CocoRobobox_sound_TOOLTIP,
  11240. message0: Blockly.Msg.CocoRobobox_sound_MESSAGE0
  11241. })
  11242. }
  11243. };
  11244. Blockly.Blocks.CocoRobobox_light = {
  11245. init: function () {
  11246. this.jsonInit({
  11247. colour: CategoryColors.Box,
  11248. output: "Number",
  11249. helpUrl: Blockly.Msg.CocoRobobox_light_HELPURL,
  11250. tooltip: Blockly.Msg.CocoRobobox_light_TOOLTIP,
  11251. message0: Blockly.Msg.CocoRobobox_light_MESSAGE0
  11252. })
  11253. }
  11254. };
  11255. Blockly.Blocks.CocoRobobox_slider = {
  11256. init: function () {
  11257. this.jsonInit({
  11258. inputsInline: !0,
  11259. output: "Number",
  11260. colour: CategoryColors.Box,
  11261. helpUrl: Blockly.Msg.CocoRoboBOX_SLIDER_HELPURL,
  11262. tooltip: Blockly.Msg.CocoRoboBOX_SLIDER_TOOLTIP,
  11263. message0: Blockly.Msg.CocoRoboBOX_SLIDER_MESSAGE0
  11264. })
  11265. }
  11266. };
  11267. Blockly.Blocks.CocoRobobox_5button = {
  11268. init: function () {
  11269. this.jsonInit({
  11270. colour: CategoryColors.Box,
  11271. args0: [{
  11272. name: "button_val",
  11273. type: "field_dropdown",
  11274. options: [
  11275. ["\u2191", "'up'"],
  11276. ["\u2193", "'down'"],
  11277. ["\u2190", "'left'"],
  11278. ["\u2192", "'right'"],
  11279. ["OK", "'ok'"]
  11280. ]
  11281. }],
  11282. output: "Boolean",
  11283. message0: Blockly.Msg.CocoRoboBOX_5BUTTON_MESSAGE0,
  11284. tooltip: Blockly.Msg.CocoRoboBOX_5BUTTON_TOOLTIP,
  11285. helpUrl: Blockly.Msg.CocoRoboBOX_5BUTTON_HELPURL
  11286. })
  11287. }
  11288. };
  11289. Blockly.Blocks.CocoRobobox_ultrasonic = {
  11290. init: function () {
  11291. this.jsonInit({
  11292. inputsInline: !0,
  11293. output: null,
  11294. colour: CategoryColors.Box,
  11295. helpUrl: Blockly.Msg.CocoRoboBOX_ULTRASONIC_HELPURL,
  11296. tooltip: Blockly.Msg.CocoRoboBOX_ULTRASONIC_TOOLTIP,
  11297. message0: Blockly.Msg.CocoRoboBOX_ULTRASONIC_MESSAGE0
  11298. })
  11299. }
  11300. };
  11301. Blockly.Blocks.CocoRobobox_Thehumanbodyinfrare = {
  11302. init: function () {
  11303. this.jsonInit({
  11304. inputsInline: !0,
  11305. output: null,
  11306. colour: CategoryColors.Box,
  11307. helpUrl: Blockly.Msg.CocoRoboBOX_THEHUMANBODYINFRARE_HELPURL,
  11308. tooltip: Blockly.Msg.CocoRoboBOX_THEHUMANBODYINFRARE_TOOLTIP,
  11309. message0: Blockly.Msg.CocoRoboBOX_THEHUMANBODYINFRARE_MESSAGE0
  11310. })
  11311. }
  11312. };
  11313. Blockly.Blocks.CocoRobo_bme280_hum_tem_pre = {
  11314. init: function () {
  11315. this.jsonInit({
  11316. colour: CategoryColors.Box,
  11317. args0: [{
  11318. name: "hum_tem_pre",
  11319. options: [
  11320. [Blockly.Msg.CocoRobo_tem, "temperature"],
  11321. [Blockly.Msg.CocoRobo_hum, "humidity"],
  11322. [Blockly.Msg.CocoRobo_pre, "pressure"]
  11323. ],
  11324. type: "field_dropdown"
  11325. }],
  11326. output: "Number",
  11327. helpUrl: Blockly.Msg.CocoRobo_HELPURL,
  11328. tooltip: Blockly.Msg.CocoRobo_bme280_hum_tem_pre_TOOLTIP,
  11329. message0: Blockly.Msg.CocoRobo_bme280_hum_tem_pre_MESSAGE0
  11330. })
  11331. }
  11332. };
  11333. Blockly.Blocks.CocoRobobox_motor = {
  11334. init: function () {
  11335. this.jsonInit({
  11336. inputsInline: !0,
  11337. nextStatement: null,
  11338. previousStatement: null,
  11339. colour: CategoryColors.Box,
  11340. helpUrl: Blockly.Msg.CocoRoboBOX_MOTOR_HELPURL,
  11341. tooltip: Blockly.Msg.CocoRoboBOX_MOTOR_TOOLTIP,
  11342. message0: Blockly.Msg.CocoRoboBOX_MOTOR_MESSAGE0,
  11343. args0: [{
  11344. check: "Number",
  11345. type: "input_value",
  11346. name: "speed"
  11347. }]
  11348. })
  11349. }
  11350. };
  11351. Blockly.Blocks.CocoRobobox_RGB_clear = {
  11352. init: function () {
  11353. this.jsonInit({
  11354. inputsInline: !0,
  11355. nextStatement: null,
  11356. previousStatement: null,
  11357. type: "field_dropdown",
  11358. colour: CategoryColors.Box,
  11359. message0: Blockly.Msg.CocoRoboBOX_RGB_clear_MESSAGE0,
  11360. tooltip: Blockly.Msg.CocoRoboBOX_RGB_clear_TOOLTIP,
  11361. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_clear_HELPURL
  11362. })
  11363. }
  11364. };
  11365. Blockly.Blocks.CocoRobobox_RGB_pixel = {
  11366. init: function () {
  11367. this.jsonInit({
  11368. inputsInline: !0,
  11369. nextStatement: null,
  11370. previousStatement: null,
  11371. colour: CategoryColors.Box,
  11372. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_pixel_HELPURL,
  11373. tooltip: Blockly.Msg.CocoRoboBOX_RGB_pixel_TOOLTIP,
  11374. message0: Blockly.Msg.CocoRoboBOX_RGB_pixel_MESSAGE0,
  11375. args0: [{
  11376. check: "Number",
  11377. type: "input_value",
  11378. name: "speed1"
  11379. }, {
  11380. check: "Number",
  11381. type: "input_value",
  11382. name: "speed2"
  11383. }, {
  11384. check: "Number",
  11385. type: "input_value",
  11386. name: "speed3"
  11387. }, {
  11388. check: "Number",
  11389. type: "input_value",
  11390. name: "speed4"
  11391. }, {
  11392. check: "Number",
  11393. type: "input_value",
  11394. name: "speed5"
  11395. }]
  11396. })
  11397. }
  11398. };
  11399. Blockly.Blocks.CocoRobobox_RGB_get_pixel = {
  11400. init: function () {
  11401. this.jsonInit({
  11402. output: "Number",
  11403. colour: CategoryColors.Box,
  11404. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_get_pixel_HELPURL,
  11405. tooltip: Blockly.Msg.CocoRoboBOX_RGB_get_pixel_TOOLTIP,
  11406. message0: Blockly.Msg.CocoRoboBOX_RGB_get_pixel_MESSAGE0,
  11407. args0: [{
  11408. check: "Number",
  11409. type: "input_value",
  11410. name: "speed1"
  11411. }, {
  11412. check: "Number",
  11413. type: "input_value",
  11414. name: "speed2"
  11415. }]
  11416. })
  11417. }
  11418. };
  11419. Blockly.Blocks.CocoRobobox_RGB_ImageText = {
  11420. init: function () {
  11421. this.jsonInit({
  11422. inputsInline: !0,
  11423. nextStatement: null,
  11424. previousStatement: null,
  11425. colour: CategoryColors.Box,
  11426. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_ImageText_HELPURL,
  11427. tooltip: Blockly.Msg.CocoRoboBOX_RGB_ImageText_TOOLTIP,
  11428. message0: Blockly.Msg.CocoRoboBOX_RGB_ImageText_MESSAGE0,
  11429. args0: [{
  11430. check: "String",
  11431. type: "input_value",
  11432. name: "speed1"
  11433. }, {
  11434. check: "Number",
  11435. type: "input_value",
  11436. name: "speed2"
  11437. }]
  11438. })
  11439. }
  11440. };
  11441. Blockly.Blocks.CocoRobobox_RGB_SetImage = {
  11442. init: function () {
  11443. this.jsonInit({
  11444. colour: CategoryColors.Box,
  11445. args0: [{
  11446. type: "input_dummy"
  11447. }, {
  11448. name: "row0",
  11449. type: "input_value",
  11450. check: "String"
  11451. }, {
  11452. name: "row1",
  11453. type: "input_value",
  11454. check: "String"
  11455. }, {
  11456. name: "row2",
  11457. type: "input_value",
  11458. check: "String"
  11459. }, {
  11460. name: "row3",
  11461. type: "input_value",
  11462. check: "String"
  11463. }, {
  11464. name: "row4",
  11465. type: "input_value",
  11466. check: "String"
  11467. }],
  11468. output: "microbit_image",
  11469. helpUrl: Blockly.Msg.MICROBIT_IMAGE_CREATE1_HELPURL,
  11470. tooltip: Blockly.Msg.MICROBIT_IMAGE_CREATE1_TOOLTIP,
  11471. message0: Blockly.Msg.MICROBIT_IMAGE_CREATE1_MESSAGE0
  11472. })
  11473. }
  11474. };
  11475. Blockly.Blocks.CocoRobobox_RGB_Image = {
  11476. init: function () {
  11477. this.jsonInit({
  11478. colour: CategoryColors.Box,
  11479. nextStatement: null,
  11480. previousStatement: null,
  11481. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_HELPURL,
  11482. tooltip: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_TOOLTIP,
  11483. message0: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_MESSAGE0,
  11484. args0: [{
  11485. check: ["microbit_image", "String"],
  11486. type: "input_value",
  11487. name: "image"
  11488. }]
  11489. })
  11490. }
  11491. };
  11492. Blockly.Blocks.CocoRobobox_RGB_ImageImport = {
  11493. init: function () {
  11494. this.jsonInit({
  11495. colour: CategoryColors.Box,
  11496. inputsInline: !0,
  11497. output: "String",
  11498. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGEImport_HELPURL,
  11499. tooltip: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGEImport_TOOLTIP,
  11500. message0: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGEImport_MESSAGE0,
  11501. args0: [{
  11502. check: ["microbit_image", "String"],
  11503. type: "input_value",
  11504. name: "image"
  11505. }]
  11506. })
  11507. }
  11508. };
  11509. Blockly.Blocks.CocoRobobox_RGB_ImageCopy = {
  11510. init: function () {
  11511. this.jsonInit({
  11512. colour: CategoryColors.Box,
  11513. inputsInline: !0,
  11514. output: "String",
  11515. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_Copy_HELPURL,
  11516. tooltip: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_Copy_TOOLTIP,
  11517. message0: Blockly.Msg.CocoRoboBOX_RGB_SHOW_IMAGE_Copy_MESSAGE0,
  11518. args0: [{
  11519. check: ["microbit_image", "String"],
  11520. type: "input_value",
  11521. name: "image"
  11522. }]
  11523. })
  11524. }
  11525. };
  11526. Blockly.Blocks.CocoRobobox_RGB_ImageCot = {
  11527. init: function () {
  11528. this.jsonInit({
  11529. output: "String",
  11530. inputsInline: !0,
  11531. colour: CategoryColors.Box,
  11532. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_ImageCot_HELPURL,
  11533. tooltip: Blockly.Msg.CocoRoboBOX_RGB_ImageCot_TOOLTIP,
  11534. message0: Blockly.Msg.CocoRoboBOX_RGB_ImageCot_MESSAGE0,
  11535. args0: [{
  11536. check: ["microbit_image", "String"],
  11537. type: "input_value",
  11538. name: "image"
  11539. }, {
  11540. check: "Number",
  11541. type: "input_value",
  11542. name: "speed2"
  11543. }, {
  11544. check: "Number",
  11545. type: "input_value",
  11546. name: "speed3"
  11547. }, {
  11548. check: "Number",
  11549. type: "input_value",
  11550. name: "speed4"
  11551. }, {
  11552. check: "Number",
  11553. type: "input_value",
  11554. name: "speed5"
  11555. }]
  11556. })
  11557. }
  11558. };
  11559. Blockly.Blocks.CocoRobo_image_builtins = {
  11560. init: function () {
  11561. this.jsonInit({
  11562. colour: CategoryColors.Box,
  11563. args0: [{
  11564. name: "image",
  11565. options: [
  11566. [Blockly.Msg.MICROBIT_IMAGE_HEART, "HEART"],
  11567. [Blockly.Msg.MICROBIT_IMAGE_HEART_SMALL, "HEART_SMALL"],
  11568. [Blockly.Msg.MICROBIT_IMAGE_HAPPY, "HAPPY"],
  11569. [Blockly.Msg.MICROBIT_IMAGE_SMILE, "SMILE"],
  11570. [Blockly.Msg.MICROBIT_IMAGE_SAD, "SAD"],
  11571. [Blockly.Msg.MICROBIT_IMAGE_CONFUSED, "CONFUSED"],
  11572. [Blockly.Msg.MICROBIT_IMAGE_ANGRY, "ANGRY"],
  11573. [Blockly.Msg.MICROBIT_IMAGE_ASLEEP, "ASLEEP"],
  11574. [Blockly.Msg.MICROBIT_IMAGE_SUPRISED, "SURPRISED"],
  11575. [Blockly.Msg.MICROBIT_IMAGE_SILLY, "SILLY"],
  11576. [Blockly.Msg.MICROBIT_IMAGE_FABULOUS, "FABULOUS"],
  11577. [Blockly.Msg.MICROBIT_IMAGE_MEH, "MEH"],
  11578. [Blockly.Msg.MICROBIT_IMAGE_YES, "YES"],
  11579. [Blockly.Msg.MICROBIT_IMAGE_NO, "NO"],
  11580. [Blockly.Msg.MICROBIT_IMAGE_CLOCK12, "CLOCK12"],
  11581. [Blockly.Msg.MICROBIT_IMAGE_CLOCK11, "CLOCK11"],
  11582. [Blockly.Msg.MICROBIT_IMAGE_CLOCK10, "CLOCK10"],
  11583. [Blockly.Msg.MICROBIT_IMAGE_CLOCK9, "CLOCK9"],
  11584. [Blockly.Msg.MICROBIT_IMAGE_CLOCK8, "CLOCK8"],
  11585. [Blockly.Msg.MICROBIT_IMAGE_CLOCK7, "CLOCK7"],
  11586. [Blockly.Msg.MICROBIT_IMAGE_CLOCK6, "CLOCK6"],
  11587. [Blockly.Msg.MICROBIT_IMAGE_CLOCK5, "CLOCK5"],
  11588. [Blockly.Msg.MICROBIT_IMAGE_CLOCK4, "CLOCK4"],
  11589. [Blockly.Msg.MICROBIT_IMAGE_CLOCK3, "CLOCK3"],
  11590. [Blockly.Msg.MICROBIT_IMAGE_CLOCK2, "CLOCK2"],
  11591. [Blockly.Msg.MICROBIT_IMAGE_CLOCK1, "CLOCK1"],
  11592. [Blockly.Msg.MICROBIT_IMAGE_ARROW_N, "ARROW_N"],
  11593. [Blockly.Msg.MICROBIT_IMAGE_ARROW_NE, "ARROW_NE"],
  11594. [Blockly.Msg.MICROBIT_IMAGE_ARROW_E, "ARROW_E"],
  11595. [Blockly.Msg.MICROBIT_IMAGE_ARROW_SE, "ARROW_SE"],
  11596. [Blockly.Msg.MICROBIT_IMAGE_ARROW_S, "ARROW_S"],
  11597. [Blockly.Msg.MICROBIT_IMAGE_ARROW_SW, "ARROW_SW"],
  11598. [Blockly.Msg.MICROBIT_IMAGE_ARROW_W, "ARROW_W"],
  11599. [Blockly.Msg.MICROBIT_IMAGE_ARROW_NW, "ARROW_NW"],
  11600. [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE, "TRIANGLE"],
  11601. [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE_LEFT, "TRIANGLE_LEFT"],
  11602. [Blockly.Msg.MICROBIT_IMAGE_CHESSBOARD, "CHESSBOARD"],
  11603. [Blockly.Msg.MICROBIT_IMAGE_DIAMOND, "DIAMOND"],
  11604. [Blockly.Msg.MICROBIT_IMAGE_DIAMOND_SMALL, "DIAMOND_SMALL"],
  11605. [Blockly.Msg.MICROBIT_IMAGE_SQUARE, "SQUARE"],
  11606. [Blockly.Msg.MICROBIT_IMAGE_SQUARE_SMALL, "SQUARE_SMALL"],
  11607. [Blockly.Msg.MICROBIT_IMAGE_RABBIT, "RABBIT"],
  11608. [Blockly.Msg.MICROBIT_IMAGE_COW, "COW"],
  11609. [Blockly.Msg.MICROBIT_IMAGE_MUSIC_CROTCHET, "MUSIC_CROTCHET"],
  11610. [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVER, "MUSIC_QUAVER"],
  11611. [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVERS, "MUSIC_QUAVERS"],
  11612. [Blockly.Msg.MICROBIT_IMAGE_PITCHFORK, "PITCHFORK"],
  11613. [Blockly.Msg.MICROBIT_IMAGE_XMAS, "XMAS"],
  11614. [Blockly.Msg.MICROBIT_IMAGE_PACMAN, "PACMAN"],
  11615. [Blockly.Msg.MICROBIT_IMAGE_TARGET, "TARGET"],
  11616. [Blockly.Msg.MICROBIT_IMAGE_TSHIRT, "TSHIRT"],
  11617. [Blockly.Msg.MICROBIT_IMAGE_ROLLERSKATE, "ROLLERSKATE"],
  11618. [Blockly.Msg.MICROBIT_IMAGE_DUCK, "DUCK"],
  11619. [Blockly.Msg.MICROBIT_IMAGE_HOUSE, "HOUSE"],
  11620. [Blockly.Msg.MICROBIT_IMAGE_TORTOISE, "TORTOISE"],
  11621. [Blockly.Msg.MICROBIT_IMAGE_BUTTERFLY, "BUTTERFLY"],
  11622. [Blockly.Msg.MICROBIT_IMAGE_STICKFIGURE, "STICKFIGURE"],
  11623. [Blockly.Msg.MICROBIT_IMAGE_GHOST, "GHOST"],
  11624. [Blockly.Msg.MICROBIT_IMAGE_SWORD, "SWORD"],
  11625. [Blockly.Msg.MICROBIT_IMAGE_GIRAFFE, "GIRAFFE"],
  11626. [Blockly.Msg.MICROBIT_IMAGE_SKULL, "SKULL"],
  11627. [Blockly.Msg.MICROBIT_IMAGE_UMBRELLA, "UMBRELLA"],
  11628. [Blockly.Msg.MICROBIT_IMAGE_SNAKE, "SNAKE"]
  11629. ],
  11630. type: "field_dropdown"
  11631. }],
  11632. output: ["microbit_image", "Array"],
  11633. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_BUILTINS_HELPURL,
  11634. tooltip: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_BUILTINS_TOOLTIP,
  11635. message0: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_BUILTINS_MESSAGE0
  11636. })
  11637. }
  11638. };
  11639. Blockly.Blocks.CocoRobobox_image_shift = {
  11640. init: function () {
  11641. this.jsonInit({
  11642. colour: CategoryColors.Box,
  11643. args0: [{
  11644. check: "microbit_image",
  11645. type: "input_value",
  11646. name: "image"
  11647. }, {
  11648. name: "shift",
  11649. options: [
  11650. [Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_LEFT, "LEFT"],
  11651. [Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_RIGHT, "RIGHT"],
  11652. [Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_UP, "UP"],
  11653. [Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_DOWN, "DOWN"]
  11654. ],
  11655. type: "field_dropdown"
  11656. }, {
  11657. check: "Number",
  11658. type: "input_value",
  11659. name: "pos"
  11660. }],
  11661. output: "microbit_image",
  11662. helpUrl: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_HELPURL,
  11663. tooltip: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_TOOLTIP,
  11664. message0: Blockly.Msg.CocoRoboBOX_RGB_IMAGE_SHIFT_MESSAGE0
  11665. })
  11666. }
  11667. };
  11668. Blockly.Blocks.CocoRobobox_triaxial_acceleration = {
  11669. init: function () {
  11670. this.jsonInit({
  11671. inputsInline: !0,
  11672. output: null,
  11673. colour: CategoryColors.Box,
  11674. helpUrl: Blockly.Msg.CocoRoboBOX_TRIAXIAL_ACCELERATION_HELPURL,
  11675. tooltip: Blockly.Msg.CocoRoboBOX_TRIAXIAL_ACCELERATION_TOOLTIP,
  11676. message0: Blockly.Msg.CocoRoboBOX_TRIAXIAL_ACCELERATION_MESSAGE0,
  11677. args0: [{
  11678. options: [
  11679. ["X", "0"],
  11680. ["Y", "1"],
  11681. ["Z", "2"]
  11682. ],
  11683. type: "field_dropdown",
  11684. name: "enable"
  11685. }]
  11686. })
  11687. }
  11688. };
  11689. Blockly.Blocks.CocoRobobox_triaxial_angular_velocity = {
  11690. init: function () {
  11691. this.jsonInit({
  11692. inputsInline: !0,
  11693. output: null,
  11694. colour: CategoryColors.Box,
  11695. helpUrl: Blockly.Msg.CocoRoboBOX_TRIAXIAL_AUGULAR_VELOCITY_HELPURL,
  11696. tooltip: Blockly.Msg.CocoRoboBOX_TRIAXIAL_AUGULAR_VELOCITY_TOOLTIP,
  11697. message0: Blockly.Msg.CocoRoboBOX_TRIAXIAL_AUGULAR_VELOCITY_MESSAGE0,
  11698. args0: [{
  11699. options: [
  11700. ["X", "0"],
  11701. ["Y", "1"],
  11702. ["Z", "2"]
  11703. ],
  11704. type: "field_dropdown",
  11705. name: "enable"
  11706. }]
  11707. })
  11708. }
  11709. };
  11710. Blockly.Blocks.CocoRobobox_euler_angle = {
  11711. init: function () {
  11712. this.jsonInit({
  11713. inputsInline: !0,
  11714. output: null,
  11715. colour: CategoryColors.Box,
  11716. helpUrl: Blockly.Msg.CocoRoboBOX_EULER_ANGLE_HELPURL,
  11717. tooltip: Blockly.Msg.CocoRoboBOX_EULER_ANGLE_TOOLTIP,
  11718. message0: Blockly.Msg.CocoRoboBOX_EULER_ANGLE_MESSAGE0,
  11719. args0: [{
  11720. options: [
  11721. ["P", "0"],
  11722. ["R", "1"],
  11723. ["Y", "2"]
  11724. ],
  11725. type: "field_dropdown",
  11726. name: "enable"
  11727. }]
  11728. })
  11729. }
  11730. };
  11731. Blockly.Blocks.CocoRobobox_quaternion = {
  11732. init: function () {
  11733. this.jsonInit({
  11734. inputsInline: !0,
  11735. output: null,
  11736. colour: CategoryColors.Box,
  11737. helpUrl: Blockly.Msg.CocoRoboBOX_QUATERNION_HELPURL,
  11738. tooltip: Blockly.Msg.CocoRoboBOX_QUATERNION_TOOLTIP,
  11739. message0: Blockly.Msg.CocoRoboBOX_QUATERNION_MESSAGE0,
  11740. args0: [{
  11741. options: [
  11742. ["W", "0"],
  11743. ["X", "1"],
  11744. ["Y", "2"],
  11745. ["Z", "3"]
  11746. ],
  11747. type: "field_dropdown",
  11748. name: "enable"
  11749. }]
  11750. })
  11751. }
  11752. };
  11753. Blockly.Blocks.CocoRobo_AI2_Face_tracking = {
  11754. init: function () {
  11755. this.jsonInit({
  11756. inputsInline: !0,
  11757. nextStatement: null,
  11758. previousStatement: null,
  11759. colour: CategoryColors.AI_face,
  11760. helpUrl: Blockly.Msg.CocoRobo_AI2_FACE_TRACKING_HELPURL,
  11761. tooltip: Blockly.Msg.CocoRobo_AI2_FACE_TRACKING_TOOLTIP,
  11762. message0: Blockly.Msg.CocoRobo_AI2_FACE_TRACKING_MESSAGE0
  11763. })
  11764. }
  11765. };
  11766. Blockly.Blocks.CocoRobo_AI2_Face_photograph_tracking = {
  11767. init: function () {
  11768. this.jsonInit({
  11769. inputsInline: !0,
  11770. nextStatement: null,
  11771. previousStatement: null,
  11772. colour: CategoryColors.AI_face,
  11773. helpUrl: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_TRACKING_HELPURL,
  11774. tooltip: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_TRACKING_TOOLTIP,
  11775. message0: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_TRACKING_MESSAGE0
  11776. })
  11777. }
  11778. };
  11779. Blockly.Blocks.CocoRobo_AI2_result_face = {
  11780. init: function () {
  11781. this.jsonInit({
  11782. output: "String",
  11783. colour: CategoryColors.AI_face,
  11784. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_HELPURL,
  11785. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_TOOLTIP,
  11786. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_MESSAGE0
  11787. })
  11788. }
  11789. };
  11790. Blockly.Blocks.CocoRobo_AI2_result_face_x = {
  11791. init: function () {
  11792. this.jsonInit({
  11793. output: "String",
  11794. colour: CategoryColors.AI_face,
  11795. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_X_HELPURL,
  11796. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_X_TOOLTIP,
  11797. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_X_MESSAGE0
  11798. })
  11799. }
  11800. };
  11801. Blockly.Blocks.CocoRobo_AI2_result_face_y = {
  11802. init: function () {
  11803. this.jsonInit({
  11804. output: "String",
  11805. colour: CategoryColors.AI_face,
  11806. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_Y_HELPURL,
  11807. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_Y_TOOLTIP,
  11808. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_Y_MESSAGE0
  11809. })
  11810. }
  11811. };
  11812. Blockly.Blocks.CocoRobo_AI2_result_face_w = {
  11813. init: function () {
  11814. this.jsonInit({
  11815. output: "String",
  11816. colour: CategoryColors.AI_face,
  11817. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_W_HELPURL,
  11818. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_W_TOOLTIP,
  11819. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_W_MESSAGE0
  11820. })
  11821. }
  11822. };
  11823. Blockly.Blocks.CocoRobo_AI2_result_face_h = {
  11824. init: function () {
  11825. this.jsonInit({
  11826. output: "String",
  11827. colour: CategoryColors.AI_face,
  11828. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_H_HELPURL,
  11829. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_H_TOOLTIP,
  11830. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_H_MESSAGE0
  11831. })
  11832. }
  11833. };
  11834. Blockly.Blocks.CocoRobo_AI2_result_face_value = {
  11835. init: function () {
  11836. this.jsonInit({
  11837. output: "String",
  11838. colour: CategoryColors.AI_face,
  11839. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_VALUE_HELPURL,
  11840. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_VALUE_TOOLTIP,
  11841. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_VALUE_MESSAGE0
  11842. })
  11843. }
  11844. };
  11845. Blockly.Blocks.CocoRobo_AI2_result_face_objnum = {
  11846. init: function () {
  11847. this.jsonInit({
  11848. output: "String",
  11849. colour: CategoryColors.AI_face,
  11850. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_OBJNUM_HELPURL,
  11851. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_OBJNUM_TOOLTIP,
  11852. message0: Blockly.Msg.CocoRobo_AI2_RESULT_FACE_OBJNUM_MESSAGE0
  11853. })
  11854. }
  11855. };
  11856. Blockly.Blocks.CocoRobo_AI2_20classid_tracking = {
  11857. init: function () {
  11858. this.jsonInit({
  11859. inputsInline: !0,
  11860. nextStatement: null,
  11861. previousStatement: null,
  11862. colour: CategoryColors.AI_20classid,
  11863. helpUrl: Blockly.Msg.CocoRobo_AI2_20class_TRACKING_HELPURL,
  11864. tooltip: Blockly.Msg.CocoRobo_AI2_20class_TRACKING_TOOLTIP,
  11865. message0: Blockly.Msg.CocoRobo_AI2_20class_TRACKING_MESSAGE0
  11866. })
  11867. }
  11868. };
  11869. Blockly.Blocks.CocoRobo_AI2_20classid_photograph_tracking = {
  11870. init: function () {
  11871. this.jsonInit({
  11872. inputsInline: !0,
  11873. nextStatement: null,
  11874. previousStatement: null,
  11875. colour: CategoryColors.AI_20classid,
  11876. helpUrl: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_20TRACKING_HELPURL,
  11877. tooltip: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_20TRACKING_TOOLTIP,
  11878. message0: Blockly.Msg.CocoRobo_AI2_PHOTOGRAPH_20TRACKING_MESSAGE0
  11879. })
  11880. }
  11881. };
  11882. Blockly.Blocks.CocoRobo_AI2_result_20class = {
  11883. init: function () {
  11884. this.jsonInit({
  11885. output: "String",
  11886. colour: CategoryColors.AI_20classid,
  11887. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_HELPURL,
  11888. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_TOOLTIP,
  11889. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_MESSAGE0
  11890. })
  11891. }
  11892. };
  11893. Blockly.Blocks.CocoRobo_AI2_result_20class_x = {
  11894. init: function () {
  11895. this.jsonInit({
  11896. output: "String",
  11897. colour: CategoryColors.AI_20classid,
  11898. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_X_HELPURL,
  11899. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_X_TOOLTIP,
  11900. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_X_MESSAGE0
  11901. })
  11902. }
  11903. };
  11904. Blockly.Blocks.CocoRobo_AI2_result_20class_y = {
  11905. init: function () {
  11906. this.jsonInit({
  11907. output: "String",
  11908. colour: CategoryColors.AI_20classid,
  11909. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_Y_HELPURL,
  11910. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_Y_TOOLTIP,
  11911. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_Y_MESSAGE0
  11912. })
  11913. }
  11914. };
  11915. Blockly.Blocks.CocoRobo_AI2_result_20class_w = {
  11916. init: function () {
  11917. this.jsonInit({
  11918. output: "String",
  11919. colour: CategoryColors.AI_20classid,
  11920. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_W_HELPURL,
  11921. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_W_TOOLTIP,
  11922. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_W_MESSAGE0
  11923. })
  11924. }
  11925. };
  11926. Blockly.Blocks.CocoRobo_AI2_result_20class_h = {
  11927. init: function () {
  11928. this.jsonInit({
  11929. output: "String",
  11930. colour: CategoryColors.AI_20classid,
  11931. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_H_HELPURL,
  11932. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_H_TOOLTIP,
  11933. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_H_MESSAGE0
  11934. })
  11935. }
  11936. };
  11937. Blockly.Blocks.CocoRobo_AI2_result_20class_value = {
  11938. init: function () {
  11939. this.jsonInit({
  11940. output: "String",
  11941. colour: CategoryColors.AI_20classid,
  11942. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_VALUE_HELPURL,
  11943. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_VALUE_TOOLTIP,
  11944. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_VALUE_MESSAGE0
  11945. })
  11946. }
  11947. };
  11948. Blockly.Blocks.CocoRobo_AI2_result_20class_objnum = {
  11949. init: function () {
  11950. this.jsonInit({
  11951. output: "String",
  11952. colour: CategoryColors.AI_20classid,
  11953. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_OBJNUM_HELPURL,
  11954. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_OBJNUM_TOOLTIP,
  11955. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_OBJNUM_MESSAGE0
  11956. })
  11957. }
  11958. };
  11959. Blockly.Blocks.CocoRobo_AI2_result_20class_classid = {
  11960. init: function () {
  11961. this.jsonInit({
  11962. output: "String",
  11963. colour: CategoryColors.AI_20classid,
  11964. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_CLASSID_HELPURL,
  11965. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_CLASSID_TOOLTIP,
  11966. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_CLASSID_MESSAGE0
  11967. })
  11968. }
  11969. };
  11970. Blockly.Blocks.CocoRobo_AI2_result_20class_index = {
  11971. init: function () {
  11972. this.jsonInit({
  11973. output: "String",
  11974. colour: CategoryColors.AI_20classid,
  11975. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_INDEX_HELPURL,
  11976. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_INDEX_TOOLTIP,
  11977. message0: Blockly.Msg.CocoRobo_AI2_RESULT_20CLASS_INDEX_MESSAGE0
  11978. })
  11979. }
  11980. };
  11981. Blockly.Blocks.CocoRobo_AI2_number_discern = {
  11982. init: function () {
  11983. this.jsonInit({
  11984. inputsInline: !0,
  11985. nextStatement: null,
  11986. previousStatement: null,
  11987. colour: CategoryColors.AI_number,
  11988. helpUrl: Blockly.Msg.CocoRobo_AI2_NUMBER_DISCERN_HELPURL,
  11989. tooltip: Blockly.Msg.CocoRobo_AI2_NUMBER_DISCERN_TOOLTIP,
  11990. message0: Blockly.Msg.CocoRobo_AI2_NUMBER_DISCERN_MESSAGE0
  11991. })
  11992. }
  11993. };
  11994. Blockly.Blocks.CocoRobo_AI2_number_result = {
  11995. init: function () {
  11996. this.jsonInit({
  11997. inputsInline: !0,
  11998. nextStatement: null,
  11999. previousStatement: null,
  12000. colour: CategoryColors.AI_number,
  12001. helpUrl: Blockly.Msg.CocoRobo_AI2_RESULT_NUMBER_DISCERN_HELPURL,
  12002. tooltip: Blockly.Msg.CocoRobo_AI2_RESULT_NUMBER_DISCERN_TOOLTIP,
  12003. message0: Blockly.Msg.CocoRobo_AI2_RESULT_NUMBER_DISCERN_MESSAGE0
  12004. })
  12005. }
  12006. };
  12007. Blockly.Blocks.CocoRobo_AI_NumberDetect_all = {
  12008. init: function () {
  12009. this.jsonInit({
  12010. output: "Number",
  12011. colour: CategoryColors.AI_number,
  12012. helpUrl: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ALL_HELPURL,
  12013. tooltip: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ALL_TOOLTIP,
  12014. message0: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ALL_MESSAGE0
  12015. })
  12016. }
  12017. };
  12018. Blockly.Blocks.CocoRobo_AI_NumberDetect_number = {
  12019. init: function () {
  12020. this.jsonInit({
  12021. output: "Number",
  12022. colour: CategoryColors.AI_number,
  12023. helpUrl: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_NUMBER_HELPURL,
  12024. tooltip: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_NUMBER_TOOLTIP,
  12025. message0: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_NUMBER_MESSAGE0
  12026. })
  12027. }
  12028. };
  12029. Blockly.Blocks.CocoRobo_AI_NumberDetect_adience = {
  12030. init: function () {
  12031. this.jsonInit({
  12032. output: "Number",
  12033. colour: CategoryColors.AI_number,
  12034. helpUrl: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ADIENCE_HELPURL,
  12035. tooltip: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ADIENCE_TOOLTIP,
  12036. message0: Blockly.Msg.CocoRobo_AI2_NUMBER_DETECT_ADIENCE_MESSAGE0
  12037. })
  12038. }
  12039. };
  12040. Blockly.Blocks.CocoRobo_AI_trace_color = {
  12041. init: function () {
  12042. this.jsonInit({
  12043. inputsInline: !0,
  12044. output: "Number",
  12045. colour: CategoryColors.AI_color,
  12046. helpUrl: Blockly.Msg.CocoRobo_AI_TRACE_COLOR_HELPURL,
  12047. tooltip: Blockly.Msg.CocoRobo_AI_TRACE_COLOR_TOOLTIP,
  12048. message0: Blockly.Msg.CocoRobo_AI_TRACE_COLOR_MESSAGE0,
  12049. args0: [{
  12050. check: "Number",
  12051. type: "input_value",
  12052. name: "lab"
  12053. }, {
  12054. check: "Number",
  12055. type: "input_value",
  12056. name: "pixel"
  12057. }, {
  12058. check: "Number",
  12059. type: "input_value",
  12060. name: "area"
  12061. }]
  12062. })
  12063. }
  12064. };
  12065. Blockly.Blocks.CocoRobo_AI_trace_color_displayten = {
  12066. init: function () {
  12067. this.jsonInit({
  12068. inputsInline: !0,
  12069. nextStatement: null,
  12070. previousStatement: null,
  12071. colour: CategoryColors.AI_color,
  12072. helpUrl: Blockly.Msg.CocoRobo_AI_TRACE_CILOR_DISPLAYTEN_HELPURL,
  12073. tooltip: Blockly.Msg.CocoRobo_AI_TRACE_CILOR_DISPLAYTEN_TOOLTIP,
  12074. message0: Blockly.Msg.CocoRobo_AI_TRACE_CILOR_DISPLAYTEN_MESSAGE0,
  12075. args0: [{
  12076. options: [
  12077. [Blockly.Msg.CocoRobo_AI_TRACE_COLOR_RECTANGLE, "rectangle(blob.rect())"],
  12078. [Blockly.Msg.CocoRobo_AI_TRACE_COLOR_CROSS, "cross(blob.cx(), blob.cy())"]
  12079. ],
  12080. type: "field_dropdown",
  12081. name: "number"
  12082. }]
  12083. })
  12084. }
  12085. };
  12086. Blockly.Blocks.CocoRobo_AI2_blob_all = {
  12087. init: function () {
  12088. this.jsonInit({
  12089. output: "Number",
  12090. colour: CategoryColors.AI_color,
  12091. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_ALL_HELPURL,
  12092. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_ALL_TOOLTIP,
  12093. message0: Blockly.Msg.CocoRobo_AI_BLOB_ALL_MESSAGE0,
  12094. args0: [{
  12095. check: "Number",
  12096. type: "input_value",
  12097. name: "variables"
  12098. }]
  12099. })
  12100. }
  12101. };
  12102. Blockly.Blocks.CocoRobo_AI2_blob_x = {
  12103. init: function () {
  12104. this.jsonInit({
  12105. output: "Number",
  12106. colour: CategoryColors.AI_color,
  12107. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_X_HELPURL,
  12108. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_X_TOOLTIP,
  12109. message0: Blockly.Msg.CocoRobo_AI_BLOB_X_MESSAGE0,
  12110. args0: [{
  12111. check: "Number",
  12112. type: "input_value",
  12113. name: "variables"
  12114. }]
  12115. })
  12116. }
  12117. };
  12118. Blockly.Blocks.CocoRobo_AI2_blob_y = {
  12119. init: function () {
  12120. this.jsonInit({
  12121. output: "Number",
  12122. colour: CategoryColors.AI_color,
  12123. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_Y_HELPURL,
  12124. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_Y_TOOLTIP,
  12125. message0: Blockly.Msg.CocoRobo_AI_BLOB_Y_MESSAGE0,
  12126. args0: [{
  12127. check: "Number",
  12128. type: "input_value",
  12129. name: "variables"
  12130. }]
  12131. })
  12132. }
  12133. };
  12134. Blockly.Blocks.CocoRobo_AI2_blob_w = {
  12135. init: function () {
  12136. this.jsonInit({
  12137. output: "Number",
  12138. colour: CategoryColors.AI_color,
  12139. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_W_HELPURL,
  12140. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_W_TOOLTIP,
  12141. message0: Blockly.Msg.CocoRobo_AI_BLOB_W_MESSAGE0,
  12142. args0: [{
  12143. check: "Number",
  12144. type: "input_value",
  12145. name: "variables"
  12146. }]
  12147. })
  12148. }
  12149. };
  12150. Blockly.Blocks.CocoRobo_AI2_blob_h = {
  12151. init: function () {
  12152. this.jsonInit({
  12153. output: "Number",
  12154. colour: CategoryColors.AI_color,
  12155. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_H_HELPURL,
  12156. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_H_TOOLTIP,
  12157. message0: Blockly.Msg.CocoRobo_AI_BLOB_H_MESSAGE0,
  12158. args0: [{
  12159. check: "Number",
  12160. type: "input_value",
  12161. name: "variables"
  12162. }]
  12163. })
  12164. }
  12165. };
  12166. Blockly.Blocks.CocoRobo_AI2_blob_number = {
  12167. init: function () {
  12168. this.jsonInit({
  12169. output: "Number",
  12170. colour: CategoryColors.AI_color,
  12171. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_NUMBER_HELPURL,
  12172. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_NUMBER_TOOLTIP,
  12173. message0: Blockly.Msg.CocoRobo_AI_BLOB_NUMBER_MESSAGE0,
  12174. args0: [{
  12175. check: "Number",
  12176. type: "input_value",
  12177. name: "variables"
  12178. }]
  12179. })
  12180. }
  12181. };
  12182. Blockly.Blocks.CocoRobo_AI2_blob_center_x = {
  12183. init: function () {
  12184. this.jsonInit({
  12185. output: "Number",
  12186. colour: CategoryColors.AI_color,
  12187. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_X_HELPURL,
  12188. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_X_TOOLTIP,
  12189. message0: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_X_MESSAGE0,
  12190. args0: [{
  12191. check: "Number",
  12192. type: "input_value",
  12193. name: "variables"
  12194. }]
  12195. })
  12196. }
  12197. };
  12198. Blockly.Blocks.CocoRobo_AI2_blob_center_y = {
  12199. init: function () {
  12200. this.jsonInit({
  12201. output: "Number",
  12202. colour: CategoryColors.AI_color,
  12203. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_Y_HELPURL,
  12204. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_Y_TOOLTIP,
  12205. message0: Blockly.Msg.CocoRobo_AI_BLOB_CENTER_Y_MESSAGE0,
  12206. args0: [{
  12207. check: "Number",
  12208. type: "input_value",
  12209. name: "variables"
  12210. }]
  12211. })
  12212. }
  12213. };
  12214. Blockly.Blocks.CocoRobo_AI2_blob_orthogon = {
  12215. init: function () {
  12216. this.jsonInit({
  12217. output: "Number",
  12218. colour: CategoryColors.AI_color,
  12219. helpUrl: Blockly.Msg.CocoRobo_AI_BLOB_ORTHOGON_HELPURL,
  12220. tooltip: Blockly.Msg.CocoRobo_AI_BLOB_ORTHOGON_TOOLTIP,
  12221. message0: Blockly.Msg.CocoRobo_AI_BLOB_ORTHOGON_MESSAGE0,
  12222. args0: [{
  12223. check: "Number",
  12224. type: "input_value",
  12225. name: "variables"
  12226. }]
  12227. })
  12228. }
  12229. };
  12230. Blockly.Blocks.CocoRobo_AI_sensor_reset = {
  12231. init: function () {
  12232. this.jsonInit({
  12233. inputsInline: !0,
  12234. nextStatement: null,
  12235. previousStatement: null,
  12236. colour: CategoryColors.AI_camera,
  12237. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_RESET_HELPURL,
  12238. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_RESET_TOOLTIP,
  12239. message0: Blockly.Msg.CocoRobo_AI_SENSOR_RESET_MESSAGE0
  12240. })
  12241. }
  12242. };
  12243. Blockly.Blocks.CocoRobo_AI_sensor_images = {
  12244. init: function () {
  12245. this.jsonInit({
  12246. inputsInline: !0,
  12247. nextStatement: null,
  12248. previousStatement: null,
  12249. colour: CategoryColors.AI_camera,
  12250. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_IMAGES_HELPURL,
  12251. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_IMAGES_TOOLTIP,
  12252. message0: Blockly.Msg.CocoRobo_AI_SENSOR_IMAGES_MESSAGE0
  12253. })
  12254. }
  12255. };
  12256. Blockly.Blocks.CocoRobo_AI_sensor_enable = {
  12257. init: function () {
  12258. this.jsonInit({
  12259. inputsInline: !0,
  12260. nextStatement: null,
  12261. previousStatement: null,
  12262. colour: CategoryColors.AI_camera,
  12263. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_ENABLE_HELPURL,
  12264. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_ENABLE_TOOLTIP,
  12265. message0: Blockly.Msg.CocoRobo_AI_SENSOR_ENABLE_MESSAGE0,
  12266. args0: [{
  12267. options: [
  12268. [Blockly.Msg.CocoRobo_AI_SENSOR_ENABLE_START, "1"],
  12269. [Blockly.Msg.CocoRobo_AI_SENSOR_ENABLE_STOP, "0"]
  12270. ],
  12271. type: "field_dropdown",
  12272. name: "enable"
  12273. }]
  12274. })
  12275. }
  12276. };
  12277. Blockly.Blocks.CocoRobo_AI_sensor_return = {
  12278. init: function () {
  12279. this.jsonInit({
  12280. output: "Number",
  12281. colour: CategoryColors.AI_camera,
  12282. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_RETURN_HELPURL,
  12283. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_RETURN_TOOLTIP,
  12284. message0: Blockly.Msg.CocoRobo_AI_SENSOR_RETURN_MESSAGE0,
  12285. args0: [{
  12286. options: [
  12287. ["\u5206\u8fa8\u7387\u5bbd\u5ea6", "width"],
  12288. ["\u5206\u8fa8\u7387\u9ad8\u5ea6", "height"],
  12289. ["\u56fe\u50cf\u5e27\u683c\u5f0f", "format"],
  12290. ["\u56fe\u50cf\u5e27\u5927\u5c0f", "size"]
  12291. ],
  12292. type: "field_dropdown",
  12293. name: "enable"
  12294. }]
  12295. })
  12296. }
  12297. };
  12298. Blockly.Blocks.CocoRobo_AI_sensor_sets = {
  12299. init: function () {
  12300. this.jsonInit({
  12301. inputsInline: !0,
  12302. nextStatement: null,
  12303. previousStatement: null,
  12304. colour: CategoryColors.AI_camera,
  12305. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_SETS_HELPURL,
  12306. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_SETS_TOOLTIP,
  12307. message0: Blockly.Msg.CocoRobo_AI_SENSOR_SETS_MESSAGE0,
  12308. args0: [{
  12309. options: [
  12310. [Blockly.Msg.CocoRobo_AI_SENSOR_SETS_CONTRAST, "contrast"],
  12311. [Blockly.Msg.CocoRobo_AI_SENSOR_SETS_BRIGHTNESS, "brightness"],
  12312. [Blockly.Msg.CocoRobo_AI_SENSOR_SETS_SATURATION, "saturation"]
  12313. ],
  12314. type: "field_dropdown",
  12315. name: "pattern"
  12316. }, {
  12317. options: [
  12318. ["-2", "-2"],
  12319. ["-1", "-1"],
  12320. ["0", "0"],
  12321. ["1", "1"],
  12322. ["2", "2"]
  12323. ],
  12324. type: "field_dropdown",
  12325. name: "number"
  12326. }]
  12327. })
  12328. }
  12329. };
  12330. Blockly.Blocks.CocoRobo_AI_sensor_auto_gain = {
  12331. init: function () {
  12332. this.jsonInit({
  12333. inputsInline: !0,
  12334. nextStatement: null,
  12335. previousStatement: null,
  12336. colour: CategoryColors.AI_camera,
  12337. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_GAIN_HELPURL,
  12338. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_GAIN_TOOLTIP,
  12339. message0: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_GAIN_MESSAGE0,
  12340. args0: [{
  12341. options: [
  12342. [Blockly.Msg.CocoRobo_OPEN, "1"],
  12343. [Blockly.Msg.CocoRobo_CLOSE, "0"]
  12344. ],
  12345. type: "field_dropdown",
  12346. name: "enable"
  12347. }]
  12348. })
  12349. }
  12350. };
  12351. Blockly.Blocks.CocoRobo_AI_sensor_auto_whitebal = {
  12352. init: function () {
  12353. this.jsonInit({
  12354. inputsInline: !0,
  12355. nextStatement: null,
  12356. previousStatement: null,
  12357. colour: CategoryColors.AI_camera,
  12358. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_WHITEBAL_HELPURL,
  12359. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_WHITEBAL_TOOLTIP,
  12360. message0: Blockly.Msg.CocoRobo_AI_SENSOR_AUTO_WHITEBAL_MESSAGE0,
  12361. args0: [{
  12362. options: [
  12363. [Blockly.Msg.CocoRobo_OPEN, "True"],
  12364. [Blockly.Msg.CocoRobo_CLOSE, "False"]
  12365. ],
  12366. type: "field_dropdown",
  12367. name: "enable"
  12368. }]
  12369. })
  12370. }
  12371. };
  12372. Blockly.Blocks.CocoRobo_AI_sensor_level_MI = {
  12373. init: function () {
  12374. this.jsonInit({
  12375. inputsInline: !0,
  12376. nextStatement: null,
  12377. previousStatement: null,
  12378. colour: CategoryColors.AI_camera,
  12379. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_HELPURL,
  12380. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_TOOLTIP,
  12381. message0: Blockly.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_MESSAGE0,
  12382. args0: [{
  12383. options: [
  12384. [Blockly.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_H, "hmirror"],
  12385. [Blockly.Msg.CocoRobo_AI_SENSOR_LEVEL_MI_V, "vflip"]
  12386. ],
  12387. type: "field_dropdown",
  12388. name: "select"
  12389. }, {
  12390. options: [
  12391. [Blockly.Msg.CocoRobo_OPEN, "1"],
  12392. [Blockly.Msg.CocoRobo_CLOSE, "0"]
  12393. ],
  12394. type: "field_dropdown",
  12395. name: "enable"
  12396. }]
  12397. })
  12398. }
  12399. };
  12400. Blockly.Blocks.CocoRobo_AI_sensor_pattern = {
  12401. init: function () {
  12402. this.jsonInit({
  12403. inputsInline: !0,
  12404. nextStatement: null,
  12405. previousStatement: null,
  12406. colour: CategoryColors.AI_camera,
  12407. helpUrl: Blockly.Msg.CocoRobo_AI_SENSOR_PATTERN_HELPURL,
  12408. tooltip: Blockly.Msg.CocoRobo_AI_SENSOR_PATTERN_TOOLTIP,
  12409. message0: Blockly.Msg.CocoRobo_AI_SENSOR_PATTERN_MESSAGE0,
  12410. args0: [{
  12411. options: [
  12412. [Blockly.Msg.CocoRobo_AI_SENSOR_PATTERN_GRAYSCALE, "GRAYSCALE"],
  12413. [Blockly.Msg.CocoRobo_AI_SENSOR_PATTERN_COLOR, "RGB565"]
  12414. ],
  12415. type: "field_dropdown",
  12416. name: "yolo"
  12417. }]
  12418. })
  12419. }
  12420. };
  12421. Blockly.Blocks.CocoRobo_AI_lcd_init = {
  12422. init: function () {
  12423. this.jsonInit({
  12424. inputsInline: !0,
  12425. nextStatement: null,
  12426. previousStatement: null,
  12427. colour: CategoryColors.AI_LCD,
  12428. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_INIT_HELPURL,
  12429. tooltip: Blockly.Msg.CocoRobo_AI_LCD_INIT_TOOLTIP,
  12430. message0: Blockly.Msg.CocoRobo_AI_LCD_INIT_MESSAGE0
  12431. })
  12432. }
  12433. };
  12434. Blockly.Blocks.CocoRobo_AI_lcd_text = {
  12435. init: function () {
  12436. this.jsonInit({
  12437. inputsInline: !0,
  12438. nextStatement: null,
  12439. previousStatement: null,
  12440. colour: CategoryColors.AI_LCD,
  12441. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_TEXT_HELPURL,
  12442. tooltip: Blockly.Msg.CocoRobo_AI_LCD_TEXT_TOOLTIP,
  12443. message0: Blockly.Msg.CocoRobo_AI_LCD_TEXT_MESSAGE0,
  12444. args0: [{
  12445. check: "Number",
  12446. type: "input_value",
  12447. name: "x"
  12448. }, {
  12449. check: "Number",
  12450. type: "input_value",
  12451. name: "y"
  12452. }, {
  12453. check: "String",
  12454. type: "input_value",
  12455. name: "message"
  12456. }]
  12457. })
  12458. }
  12459. };
  12460. Blockly.Blocks.CocoRobo_AI_LCD_clearall = {
  12461. init: function () {
  12462. this.jsonInit({
  12463. inputsInline: !0,
  12464. nextStatement: null,
  12465. previousStatement: null,
  12466. colour: CategoryColors.AI_LCD,
  12467. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_CLEAR_ALL_HELPURL,
  12468. tooltip: Blockly.Msg.CocoRobo_AI_LCD_CLEAR_ALL_TOOLTIP,
  12469. message0: Blockly.Msg.CocoRobo_AI_LCD_CLEAR_ALL_MESSAGE0
  12470. })
  12471. }
  12472. };
  12473. Blockly.Blocks.CocoRobo_AI_lcd_pixel_colour = {
  12474. init: function () {
  12475. this.jsonInit({
  12476. inputsInline: !0,
  12477. nextStatement: null,
  12478. previousStatement: null,
  12479. colour: CategoryColors.AI_LCD,
  12480. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_PIXEL_COLOUR_HELPURL,
  12481. tooltip: Blockly.Msg.CocoRobo_AI_LCD_PIXEL_COLOUR_TOOLTIP,
  12482. message0: Blockly.Msg.CocoRobo_AI_LCD_PIXEL_COLOUR_MESSAGE0,
  12483. args0: [{
  12484. check: "Number",
  12485. type: "input_value",
  12486. name: "x"
  12487. }, {
  12488. check: "Number",
  12489. type: "input_value",
  12490. name: "y"
  12491. }, {
  12492. check: "Number",
  12493. type: "input_value",
  12494. name: "r"
  12495. }, {
  12496. check: "Number",
  12497. type: "input_value",
  12498. name: "g"
  12499. }, {
  12500. check: "Number",
  12501. type: "input_value",
  12502. name: "b"
  12503. }]
  12504. })
  12505. }
  12506. };
  12507. Blockly.Blocks.CocoRobo_AI_lcd_colour = {
  12508. init: function () {
  12509. this.jsonInit({
  12510. inputsInline: !0,
  12511. nextStatement: null,
  12512. previousStatement: null,
  12513. colour: CategoryColors.AI_LCD,
  12514. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_COLOUR_HELPURL,
  12515. tooltip: Blockly.Msg.CocoRobo_AI_LCD_COLOUR_TOOLTIP,
  12516. message0: Blockly.Msg.CocoRobo_AI_LCD_COLOUR_MESSAGE0,
  12517. args0: [{
  12518. check: "Number",
  12519. type: "input_value",
  12520. name: "r"
  12521. }, {
  12522. check: "Number",
  12523. type: "input_value",
  12524. name: "g"
  12525. }, {
  12526. check: "Number",
  12527. type: "input_value",
  12528. name: "b"
  12529. }]
  12530. })
  12531. }
  12532. };
  12533. Blockly.Blocks.CocoRobo_AI_lcd_display = {
  12534. init: function () {
  12535. this.jsonInit({
  12536. inputsInline: !0,
  12537. nextStatement: null,
  12538. previousStatement: null,
  12539. colour: CategoryColors.AI_LCD,
  12540. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_HELPURL,
  12541. tooltip: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_TOOLTIP,
  12542. message0: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_MESSAGE0
  12543. })
  12544. }
  12545. };
  12546. Blockly.Blocks.CocoRobo_AI_lcd_display_size = {
  12547. init: function () {
  12548. this.jsonInit({
  12549. inputsInline: !0,
  12550. nextStatement: null,
  12551. previousStatement: null,
  12552. colour: CategoryColors.AI_LCD,
  12553. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_SIZE_HELPURL,
  12554. tooltip: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_SIZE_TOOLTIP,
  12555. message0: Blockly.Msg.CocoRobo_AI_LCD_DISPLAY_SIZE_MESSAGE0,
  12556. args0: [{
  12557. check: "Number",
  12558. type: "input_value",
  12559. name: "x"
  12560. }, {
  12561. check: "Number",
  12562. type: "input_value",
  12563. name: "y"
  12564. }, {
  12565. check: "Number",
  12566. type: "input_value",
  12567. name: "w"
  12568. }, {
  12569. check: "Number",
  12570. type: "input_value",
  12571. name: "h"
  12572. }]
  12573. })
  12574. }
  12575. };
  12576. Blockly.Blocks.CocoRobo_AI_lcd_show_image_erosion = {
  12577. init: function () {
  12578. this.jsonInit({
  12579. inputsInline: !0,
  12580. nextStatement: null,
  12581. previousStatement: null,
  12582. colour: CategoryColors.AI_LCD,
  12583. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_EROSION_HELPURL,
  12584. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_EROSION_TOOLTIP,
  12585. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_EROSION_MESSAGE0,
  12586. args0: [{
  12587. check: "Number",
  12588. type: "input_value",
  12589. name: "x"
  12590. }]
  12591. })
  12592. }
  12593. };
  12594. Blockly.Blocks.CocoRobo_AI_lcd_show_image_middle = {
  12595. init: function () {
  12596. this.jsonInit({
  12597. inputsInline: !0,
  12598. nextStatement: null,
  12599. previousStatement: null,
  12600. colour: CategoryColors.AI_LCD,
  12601. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MIDDLE_HELPURL,
  12602. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MIDDLE_TOOLTIP,
  12603. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MIDDLE_MESSAGE0,
  12604. args0: [{
  12605. check: "Number",
  12606. type: "input_value",
  12607. name: "size"
  12608. }, {
  12609. check: "Number",
  12610. type: "input_value",
  12611. name: "bias"
  12612. }]
  12613. })
  12614. }
  12615. };
  12616. Blockly.Blocks.CocoRobo_AI_lcd_show_image_mode = {
  12617. init: function () {
  12618. this.jsonInit({
  12619. inputsInline: !0,
  12620. nextStatement: null,
  12621. previousStatement: null,
  12622. colour: CategoryColors.AI_LCD,
  12623. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MODE_HELPURL,
  12624. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MODE_TOOLTIP,
  12625. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_MODE_MESSAGE0,
  12626. args0: [{
  12627. check: "Number",
  12628. type: "input_value",
  12629. name: "size"
  12630. }]
  12631. })
  12632. }
  12633. };
  12634. Blockly.Blocks.CocoRobo_AI_lcd_show_image_indistinct = {
  12635. init: function () {
  12636. this.jsonInit({
  12637. inputsInline: !0,
  12638. nextStatement: null,
  12639. previousStatement: null,
  12640. colour: CategoryColors.AI_LCD,
  12641. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_INDISTINCT_HELPURL,
  12642. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_INDISTINCT_TOOLTIP,
  12643. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_INDISTINCT_MESSAGE0,
  12644. args0: [{
  12645. check: "Number",
  12646. type: "input_value",
  12647. name: "size"
  12648. }]
  12649. })
  12650. }
  12651. };
  12652. Blockly.Blocks.CocoRobo_AI_lcd_show_image_cartoon = {
  12653. init: function () {
  12654. this.jsonInit({
  12655. inputsInline: !0,
  12656. nextStatement: null,
  12657. previousStatement: null,
  12658. colour: CategoryColors.AI_LCD,
  12659. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_CARTOON_HELPURL,
  12660. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_CARTOON_TOOLTIP,
  12661. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_CARTOON_MESSAGE0,
  12662. args0: [{
  12663. check: "Number",
  12664. type: "input_value",
  12665. name: "size"
  12666. }, {
  12667. check: "Number",
  12668. type: "input_value",
  12669. name: "seed"
  12670. }, {
  12671. check: "Number",
  12672. type: "input_value",
  12673. name: "floating"
  12674. }]
  12675. })
  12676. }
  12677. };
  12678. Blockly.Blocks.CocoRobo_AI_lcd_show_image_3D = {
  12679. init: function () {
  12680. this.jsonInit({
  12681. inputsInline: !0,
  12682. nextStatement: null,
  12683. previousStatement: null,
  12684. colour: CategoryColors.AI_LCD,
  12685. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_3D_HELPURL,
  12686. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_3D_TOOLTIP,
  12687. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_3D_MESSAGE0,
  12688. args0: [{
  12689. check: "Number",
  12690. type: "input_value",
  12691. name: "x_rotation"
  12692. }, {
  12693. check: "Number",
  12694. type: "input_value",
  12695. name: "y_rotation"
  12696. }, {
  12697. check: "Number",
  12698. type: "input_value",
  12699. name: "z_rotation"
  12700. }, {
  12701. check: "Number",
  12702. type: "input_value",
  12703. name: "x_translation"
  12704. }, {
  12705. check: "Number",
  12706. type: "input_value",
  12707. name: "y_translation"
  12708. }, {
  12709. check: "Number",
  12710. type: "input_value",
  12711. name: "zoom"
  12712. }]
  12713. })
  12714. }
  12715. };
  12716. Blockly.Blocks.CocoRobo_AI_LCD_show_REC = {
  12717. init: function () {
  12718. this.jsonInit({
  12719. inputsInline: !0,
  12720. nextStatement: null,
  12721. previousStatement: null,
  12722. colour: CategoryColors.AI_LCD,
  12723. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_REC_HELPURL,
  12724. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_REC_TOOLTIP,
  12725. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_REC_MESSAGE0,
  12726. args0: [{
  12727. options: [
  12728. [Blockly.Msg.CocoRobo_DISPLAY_HOLLOW, "False"],
  12729. [Blockly.Msg.CocoRobo_DISPLAY_SOLID, "True"]
  12730. ],
  12731. type: "field_dropdown",
  12732. name: "solid"
  12733. }, {
  12734. check: "Number",
  12735. type: "input_value",
  12736. name: "thickness"
  12737. }, {
  12738. check: "Number",
  12739. type: "input_value",
  12740. name: "x"
  12741. }, {
  12742. check: "Number",
  12743. type: "input_value",
  12744. name: "y"
  12745. }, {
  12746. check: "Number",
  12747. type: "input_value",
  12748. name: "w"
  12749. }, {
  12750. check: "Number",
  12751. type: "input_value",
  12752. name: "h"
  12753. }, {
  12754. check: "Number",
  12755. type: "input_value",
  12756. name: "r"
  12757. }, {
  12758. check: "Number",
  12759. type: "input_value",
  12760. name: "g"
  12761. }, {
  12762. check: "Number",
  12763. type: "input_value",
  12764. name: "b"
  12765. }]
  12766. })
  12767. }
  12768. };
  12769. Blockly.Blocks.CocoRobo_AI_LCD_show_string = {
  12770. init: function () {
  12771. this.jsonInit({
  12772. inputsInline: !0,
  12773. nextStatement: null,
  12774. previousStatement: null,
  12775. colour: CategoryColors.AI_LCD,
  12776. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_STRING_HELPURL,
  12777. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_STRING_TOOLTIP,
  12778. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_STRING_MESSAGE0,
  12779. args0: [{
  12780. check: "Number",
  12781. type: "input_value",
  12782. name: "x"
  12783. }, {
  12784. check: "Number",
  12785. type: "input_value",
  12786. name: "y"
  12787. }, {
  12788. check: "Number",
  12789. type: "input_value",
  12790. name: "w"
  12791. }, {
  12792. check: "Number",
  12793. type: "input_value",
  12794. name: "h"
  12795. }, {
  12796. check: "Number",
  12797. type: "input_value",
  12798. name: "r"
  12799. }, {
  12800. check: "Number",
  12801. type: "input_value",
  12802. name: "g"
  12803. }, {
  12804. check: "Number",
  12805. type: "input_value",
  12806. name: "b"
  12807. }, {
  12808. check: "Number",
  12809. type: "input_value",
  12810. name: "thickness"
  12811. }]
  12812. })
  12813. }
  12814. };
  12815. Blockly.Blocks.CocoRobo_AI_LCD_return_colour = {
  12816. init: function () {
  12817. this.jsonInit({
  12818. output: "String",
  12819. colour: CategoryColors.AI_LCD,
  12820. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_return_colour_HELPURL,
  12821. tooltip: Blockly.Msg.CocoRobo_AI_LCD_return_colour_TOOLTIP,
  12822. message0: Blockly.Msg.CocoRobo_AI_LCD_return_colour_MESSAGE0,
  12823. args0: [{
  12824. check: "Number",
  12825. type: "input_value",
  12826. name: "x"
  12827. }, {
  12828. check: "Number",
  12829. type: "input_value",
  12830. name: "y"
  12831. }]
  12832. })
  12833. }
  12834. };
  12835. Blockly.Blocks.CocoRobo_AI_LCD_show_circle = {
  12836. init: function () {
  12837. this.jsonInit({
  12838. inputsInline: !0,
  12839. nextStatement: null,
  12840. previousStatement: null,
  12841. colour: CategoryColors.AI_LCD,
  12842. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_CIRCLE_HELPURL,
  12843. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_CIRCLE_TOOLTIP,
  12844. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_CIRCLE_MESSAGE0,
  12845. args0: [{
  12846. options: [
  12847. [Blockly.Msg.CocoRobo_DISPLAY_HOLLOW, "False"],
  12848. [Blockly.Msg.CocoRobo_DISPLAY_SOLID, "True"]
  12849. ],
  12850. type: "field_dropdown",
  12851. name: "fill"
  12852. }, {
  12853. check: "Number",
  12854. type: "input_value",
  12855. name: "x"
  12856. }, {
  12857. check: "Number",
  12858. type: "input_value",
  12859. name: "y"
  12860. }, {
  12861. check: "Number",
  12862. type: "input_value",
  12863. name: "radius"
  12864. }, {
  12865. check: "Number",
  12866. type: "input_value",
  12867. name: "r"
  12868. }, {
  12869. check: "Number",
  12870. type: "input_value",
  12871. name: "g"
  12872. }, {
  12873. check: "Number",
  12874. type: "input_value",
  12875. name: "b"
  12876. }, {
  12877. check: "Number",
  12878. type: "input_value",
  12879. name: "thickness"
  12880. }]
  12881. })
  12882. }
  12883. };
  12884. Blockly.Blocks.CocoRobo_AI_lcd_text_most = {
  12885. init: function () {
  12886. this.jsonInit({
  12887. inputsInline: !0,
  12888. nextStatement: null,
  12889. previousStatement: null,
  12890. colour: CategoryColors.AI_LCD,
  12891. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_TEXT_MOST_HELPURL,
  12892. tooltip: Blockly.Msg.CocoRobo_AI_LCD_TEXT_MOST_TOOLTIP,
  12893. message0: Blockly.Msg.CocoRobo_AI_LCD_TEXT_MOST_MESSAGE0,
  12894. args0: [{
  12895. check: "Number",
  12896. type: "input_value",
  12897. name: "x"
  12898. }, {
  12899. check: "Number",
  12900. type: "input_value",
  12901. name: "y"
  12902. }, {
  12903. check: "String",
  12904. type: "input_value",
  12905. name: "message"
  12906. }, {
  12907. check: "Number",
  12908. type: "input_value",
  12909. name: "r"
  12910. }, {
  12911. check: "Number",
  12912. type: "input_value",
  12913. name: "g"
  12914. }, {
  12915. check: "Number",
  12916. type: "input_value",
  12917. name: "b"
  12918. }, {
  12919. check: "Number",
  12920. type: "input_value",
  12921. name: "scale"
  12922. }]
  12923. })
  12924. }
  12925. };
  12926. Blockly.Blocks.CocoRobo_AI_LCD_show_ten_string = {
  12927. init: function () {
  12928. this.jsonInit({
  12929. inputsInline: !0,
  12930. nextStatement: null,
  12931. previousStatement: null,
  12932. colour: CategoryColors.AI_LCD,
  12933. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_TEN_STRING_HELPURL,
  12934. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_TEN_STRING_TOOLTIP,
  12935. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_TEN_STRING_MESSAGE0,
  12936. args0: [{
  12937. check: "Number",
  12938. type: "input_value",
  12939. name: "x"
  12940. }, {
  12941. check: "Number",
  12942. type: "input_value",
  12943. name: "y"
  12944. }, {
  12945. check: "Number",
  12946. type: "input_value",
  12947. name: "r"
  12948. }, {
  12949. check: "Number",
  12950. type: "input_value",
  12951. name: "g"
  12952. }, {
  12953. check: "Number",
  12954. type: "input_value",
  12955. name: "b"
  12956. }, {
  12957. check: "Number",
  12958. type: "input_value",
  12959. name: "size"
  12960. }, {
  12961. check: "Number",
  12962. type: "input_value",
  12963. name: "thickness"
  12964. }]
  12965. })
  12966. }
  12967. };
  12968. Blockly.Blocks.CocoRobo_AI_LCD_show_arrows = {
  12969. init: function () {
  12970. this.jsonInit({
  12971. inputsInline: !0,
  12972. nextStatement: null,
  12973. previousStatement: null,
  12974. colour: CategoryColors.AI_LCD,
  12975. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ARROWS_HELPURL,
  12976. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ARROWS_TOOLTIP,
  12977. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ARROWS_MESSAGE0,
  12978. args0: [{
  12979. check: "Number",
  12980. type: "input_value",
  12981. name: "x"
  12982. }, {
  12983. check: "Number",
  12984. type: "input_value",
  12985. name: "y"
  12986. }, {
  12987. check: "Number",
  12988. type: "input_value",
  12989. name: "w"
  12990. }, {
  12991. check: "Number",
  12992. type: "input_value",
  12993. name: "h"
  12994. }, {
  12995. check: "Number",
  12996. type: "input_value",
  12997. name: "r"
  12998. }, {
  12999. check: "Number",
  13000. type: "input_value",
  13001. name: "g"
  13002. }, {
  13003. check: "Number",
  13004. type: "input_value",
  13005. name: "b"
  13006. }, {
  13007. check: "Number",
  13008. type: "input_value",
  13009. name: "thickness"
  13010. }]
  13011. })
  13012. }
  13013. };
  13014. Blockly.Blocks.CocoRobo_AI_lcd_show_image_picture = {
  13015. init: function () {
  13016. this.jsonInit({
  13017. inputsInline: !0,
  13018. nextStatement: null,
  13019. previousStatement: null,
  13020. colour: CategoryColors.AI_LCD,
  13021. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_PIRCTURE_HELPURL,
  13022. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_PIRCTURE_TOOLTIP,
  13023. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_PIRCTURE_MESSAGE0,
  13024. args0: [{
  13025. check: "String",
  13026. type: "input_value",
  13027. name: "message"
  13028. }]
  13029. })
  13030. }
  13031. };
  13032. Blockly.Blocks.CocoRobo_AI_lcd_show_image_heat = {
  13033. init: function () {
  13034. this.jsonInit({
  13035. inputsInline: !0,
  13036. nextStatement: null,
  13037. previousStatement: null,
  13038. colour: CategoryColors.AI_LCD,
  13039. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_HELPURL,
  13040. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_TOOLTIP,
  13041. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_MESSAGE0,
  13042. args0: [{
  13043. options: [
  13044. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_GRAYSCALE, "to_grayscale"],
  13045. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_RAINBOW, "to_rainbow"],
  13046. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_NEGATE, "negate"],
  13047. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_HEAT_INVERT, "invert"]
  13048. ],
  13049. type: "field_dropdown",
  13050. name: "enable"
  13051. }]
  13052. })
  13053. }
  13054. };
  13055. Blockly.Blocks.CocoRobo_AI_lcd_show_image_descartes = {
  13056. init: function () {
  13057. this.jsonInit({
  13058. inputsInline: !0,
  13059. nextStatement: null,
  13060. previousStatement: null,
  13061. colour: CategoryColors.AI_LCD,
  13062. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_HELPURL,
  13063. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_TOOLTIP,
  13064. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_MESSAGE0,
  13065. args0: [{
  13066. options: [
  13067. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_LINPOLAR, "linpolar"],
  13068. [Blockly.Msg.CocoRobo_AI_LCD_SHOW_IMAGE_DESCARTES_LOGPOLAR, "logpolar"]
  13069. ],
  13070. type: "field_dropdown",
  13071. name: "enable"
  13072. }, {
  13073. options: [
  13074. [Blockly.Msg.CocoRobo_CLOSE, "False"],
  13075. [Blockly.Msg.CocoRobo_OPEN, "True"]
  13076. ],
  13077. type: "field_dropdown",
  13078. name: "select"
  13079. }]
  13080. })
  13081. }
  13082. };
  13083. Blockly.Blocks.CocoRobo_AI_lcd_show_ectype = {
  13084. init: function () {
  13085. this.jsonInit({
  13086. inputsInline: !0,
  13087. nextStatement: null,
  13088. previousStatement: null,
  13089. colour: CategoryColors.AI_LCD,
  13090. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_HELPURL,
  13091. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_TOOLTIP,
  13092. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_MESSAGE0,
  13093. args0: [{
  13094. check: "String",
  13095. type: "input_value",
  13096. name: "message"
  13097. }, {
  13098. check: "Number",
  13099. type: "input_value",
  13100. name: "x"
  13101. }, {
  13102. check: "Number",
  13103. type: "input_value",
  13104. name: "y"
  13105. }, {
  13106. check: "Number",
  13107. type: "input_value",
  13108. name: "w"
  13109. }, {
  13110. check: "Number",
  13111. type: "input_value",
  13112. name: "h"
  13113. }]
  13114. })
  13115. }
  13116. };
  13117. Blockly.Blocks.CocoRobo_AI_lcd_show_ectype_show = {
  13118. init: function () {
  13119. this.jsonInit({
  13120. inputsInline: !0,
  13121. nextStatement: null,
  13122. previousStatement: null,
  13123. colour: CategoryColors.AI_LCD,
  13124. helpUrl: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_SHOW_HELPURL,
  13125. tooltip: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_SHOW_TOOLTIP,
  13126. message0: Blockly.Msg.CocoRobo_AI_LCD_SHOW_ECTYPE_SHOW_MESSAGE0,
  13127. args0: [{
  13128. check: "Number",
  13129. type: "input_value",
  13130. name: "x"
  13131. }, {
  13132. check: "Number",
  13133. type: "input_value",
  13134. name: "y"
  13135. }, {
  13136. check: "Number",
  13137. type: "input_value",
  13138. name: "w"
  13139. }, {
  13140. check: "Number",
  13141. type: "input_value",
  13142. name: "h"
  13143. }]
  13144. })
  13145. }
  13146. };
  13147. Blockly.Blocks.pinyin_dict_create_with_items_insert = {
  13148. init: function () {
  13149. this.setColour(CategoryColors.Dictionary);
  13150. this.appendDummyInput("").appendField(new Blockly.FieldLabel(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH), "TIP");
  13151. this.itemCount_ = 3;
  13152. this.updateShape_();
  13153. this.setOutput(!0);
  13154. this.setMutator(new Blockly.Mutator(["dict_create_with_item"]));
  13155. this.setTooltip(Blockly.Msg.DICT_CREATE_WITH_ITEMS_INSERT_TOOLTIP)
  13156. },
  13157. mutationToDom: function () {
  13158. var a = document.createElement("mutation");
  13159. a.setAttribute("items", this.itemCount_);
  13160. return a
  13161. },
  13162. domToMutation: function (a) {
  13163. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  13164. this.updateShape_()
  13165. },
  13166. decompose: function (a) {
  13167. var b = a.newBlock("dict_create_with_container");
  13168. b.initSvg();
  13169. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  13170. var d = a.newBlock("dict_create_with_item");
  13171. d.initSvg();
  13172. c.connect(d.previousConnection);
  13173. c = d.nextConnection
  13174. }
  13175. return b
  13176. },
  13177. compose: function (a) {
  13178. a = a.getInputTargetBlock("STACK");
  13179. for (var b = [], c = 0; a;)
  13180. b[c] = a.valueConnection_,
  13181. a = a.nextConnection && a.nextConnection.targetBlock(),
  13182. c++;
  13183. this.itemCount_ = c;
  13184. this.updateShape_();
  13185. for (c = 0; c < this.itemCount_; c++)
  13186. b[c] && this.getInput("ADD" + c).connection.connect(b[c])
  13187. },
  13188. saveConnections: function (a) {
  13189. a = a.getInputTargetBlock("STACK");
  13190. for (var b = 0; a;) {
  13191. var c = this.getInput("ADD" + b);
  13192. a.valueConnection_ = c && c.connection.targetConnection;
  13193. b++;
  13194. a = a.nextConnection && a.nextConnection.targetBlock()
  13195. }
  13196. },
  13197. updateShape_: function () {
  13198. this.getInput("EMPTY") && this.removeInput("EMPTY");
  13199. for (var a = [], b = 0; this.getInput("ADD" + b); b++)
  13200. a.push(this.getFieldValue("KEY" + b)),
  13201. this.removeInput("ADD" + b);
  13202. if (0 == this.itemCount_)
  13203. this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_EMPTY_TITLE);
  13204. else
  13205. if (this.itemCount_ == 3 && a.length == 0) {
  13206. for (this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH),
  13207. b = 0; b < this.itemCount_; b++)
  13208. if (b == 0) {
  13209. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("ni-hao-ya"), "KEY" + b).appendField(":")
  13210. }
  13211. else if (b == 1) {
  13212. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("hao-de-ya"), "KEY" + b).appendField(":")
  13213. }
  13214. else {
  13215. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("xiao-ai-ya"), "KEY" + b).appendField(":")
  13216. }
  13217. }
  13218. else {
  13219. for (this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH),
  13220. b = 0; b < this.itemCount_; b++)
  13221. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput(a.length > b ? a[b] : 0 == b ? "key_0" : "key_" + b), "KEY" + b).appendField(":")
  13222. }
  13223. },
  13224. getVars: function () {
  13225. return [this.getFieldValue("VAR")]
  13226. },
  13227. renameVar: function (a, b) {
  13228. Blockly.Names.equals(a, this.getFieldValue("VAR")) && this.setTitleValue(b, "VAR")
  13229. }
  13230. };
  13231. Blockly.Blocks.robot_dog_pinyin_dict_create_with_items_insert = {
  13232. init: function () {
  13233. this.setColour(CategoryColors.Dictionary);
  13234. this.appendDummyInput("").appendField(new Blockly.FieldLabel(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH), "TIP");
  13235. this.itemCount_ = 6;
  13236. this.updateShape_();
  13237. this.setOutput(!0);
  13238. this.setMutator(new Blockly.Mutator(["dict_create_with_item"]));
  13239. this.setTooltip(Blockly.Msg.DICT_CREATE_WITH_ITEMS_INSERT_TOOLTIP)
  13240. },
  13241. mutationToDom: function () {
  13242. var a = document.createElement("mutation");
  13243. a.setAttribute("items", this.itemCount_);
  13244. return a
  13245. },
  13246. domToMutation: function (a) {
  13247. this.itemCount_ = parseInt(a.getAttribute("items"), 10);
  13248. this.updateShape_()
  13249. },
  13250. decompose: function (a) {
  13251. var b = a.newBlock("dict_create_with_container");
  13252. b.initSvg();
  13253. for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) {
  13254. var d = a.newBlock("dict_create_with_item");
  13255. d.initSvg();
  13256. c.connect(d.previousConnection);
  13257. c = d.nextConnection
  13258. }
  13259. return b
  13260. },
  13261. compose: function (a) {
  13262. a = a.getInputTargetBlock("STACK");
  13263. for (var b = [], c = 0; a;)
  13264. b[c] = a.valueConnection_,
  13265. a = a.nextConnection && a.nextConnection.targetBlock(),
  13266. c++;
  13267. this.itemCount_ = c;
  13268. this.updateShape_();
  13269. for (c = 0; c < this.itemCount_; c++)
  13270. b[c] && this.getInput("ADD" + c).connection.connect(b[c])
  13271. },
  13272. saveConnections: function (a) {
  13273. a = a.getInputTargetBlock("STACK");
  13274. for (var b = 0; a;) {
  13275. var c = this.getInput("ADD" + b);
  13276. a.valueConnection_ = c && c.connection.targetConnection;
  13277. b++;
  13278. a = a.nextConnection && a.nextConnection.targetBlock()
  13279. }
  13280. },
  13281. updateShape_: function () {
  13282. this.getInput("EMPTY") && this.removeInput("EMPTY");
  13283. for (var a = [], b = 0; this.getInput("ADD" + b); b++)
  13284. a.push(this.getFieldValue("KEY" + b)),
  13285. this.removeInput("ADD" + b);
  13286. if (0 == this.itemCount_)
  13287. this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_EMPTY_TITLE);
  13288. else
  13289. if (this.itemCount_ == 6 && a.length == 0) {
  13290. for (this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH),
  13291. b = 0; b < this.itemCount_; b++)
  13292. if (b == 0) {
  13293. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("pa-xia"), "KEY" + b).appendField(":")
  13294. }
  13295. else if (b == 1) {
  13296. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("zhan-li"), "KEY" + b).appendField(":")
  13297. }
  13298. else if (b == 2) {
  13299. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("zhuan-quan"), "KEY" + b).appendField(":")
  13300. }
  13301. else if (b == 3) {
  13302. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("dun-qi"), "KEY" + b).appendField(":")
  13303. }
  13304. else if (b == 4) {
  13305. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("mi-shi"), "KEY" + b).appendField(":")
  13306. }
  13307. else if (b == 5) {
  13308. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput("wo-shou"), "KEY" + b).appendField(":")
  13309. }
  13310. }
  13311. else {
  13312. for (this.getField("TIP").setText(Blockly.Msg.DICT_CREATE_WITH_INPUT_WITH),
  13313. b = 0; b < this.itemCount_; b++)
  13314. this.appendValueInput("ADD" + b).setCheck(null).setAlign(Blockly.ALIGN_RIGHT).appendField(new Blockly.FieldTextInput(a.length > b ? a[b] : 0 == b ? "key_0" : "key_" + b), "KEY" + b).appendField(":")
  13315. }
  13316. },
  13317. getVars: function () {
  13318. return [this.getFieldValue("VAR")]
  13319. },
  13320. renameVar: function (a, b) {
  13321. Blockly.Names.equals(a, this.getFieldValue("VAR")) && this.setTitleValue(b, "VAR")
  13322. }
  13323. };