blocks_mpython.min.js 443 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149
  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", "'\x3cHH'"],
  931. ["4", "'\x3cLL'"]
  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. };