æ°ãæåããã¹ã¯ãããã¢ããªã±ãŒã·ã§ã³ã«Golangã䜿çšããããšãç®æšã«Golangãæ€èšãå§ããŸããã èšèªãããªã¥ãŒã ãããã³ãã®ããã«æžãããããã±ãŒãžã®äž»é¡ãå°è±¡çã§ããããGUIã®ç¶æ³ã¯ããã»ã©ãã©è²ã§ã¯ãããŸããã 詳现ã«ã€ããŠã¯è©³ãã説æããŸããããããã€ãã®ã¬ãã¥ãŒãšæ¢åã®GUIããã±ãŒãžã®æŠèŠãèªãã åŸãç¹ã«ãã®çµéšãããã®ã§ãèªåã§äœæããããšã«ããŸããã
ç§ã®æåã®èãã¯ããã§ã«æãããéã«æ²¿ã£ãŠè¡ãããšã§ããïŒå¯Ÿå¿ããäžé£ã®é¢æ°ãCã§æžããããã§ã«çšæãããŠãããã®ãé©å¿ãããŸã-ãã€ãŠããŒããŒãšC ++çšã«æžãããã®ãcgoïŒC API for GolangïŒã䜿çšããŠãã€ã³ããããã¬ã³ããªãŒãªã©ãããŒã ç§ããããå§ããŠæåã®ãŠã£ã³ããŠãæã«å ¥ããŸããããWindowsãLinuxãçŽç²ã«æè¡çãªäœæ¥ãå¥ã ã«è¡ã£ãŠããã®ã§ããã§ã«é²ãã§ããã®ã§ãç§ã®ç±æã¯ããå·ããŠããŸããã
ãããŠãå¥ã®ã¢ã€ãã¢ãçãŸããŸããã
çµå±ã®ãšãããããŒããŒçšã®GUIã©ã€ãã©ãªã§ããHwGUIãæ¢ã«ãããŸããããã¯ãéåžžã«æ©èœçã§ãã¯ãã¹ãã©ãããã©ãŒã ã§ãããã¢ããªã±ãŒã·ã§ã³ã§å®æçã«äœ¿çšããŠããŸãã å¿ èŠãªãã®ã¯ãã¹ãŠæ¢ã«å®è£ ãããŠããŸãã ããçš®ã®GUIãµãŒããŒãšããŠæ©èœããããã°ã©ã ããã®åºç€ã®äžã«æžããŠã¯ã©ãã§ããããã èµ·ååŸããã®ãµãŒããŒã¯ç¹å®ã®ããŒããéãã«ãªãã¹ã³ããGolangããã°ã©ã ããæ¥ç¶ãåä¿¡ããåŸããŠã£ã³ããŠããŠã£ãžã§ãããäœæããããããæäœãããŠã£ãžã§ããããã®ã€ãã³ãã衚瀺ããããšãã«ãã£ãŒãããã¯ãæäŸããŸãGUIãå®è£ ããŸãã GUIå®è£ ã®äœã¬ãã«ã®è©³çŽ°ã¯ãã¹ãŠãWindowsã®å ŽåãWinAPIãžã®çŽæ¥åŒã³åºããLinux / Unixã®å ŽåãããããmacOsã®å Žå-GTKãä»ããŠããã§ã«ã©ã€ãã©ãªã«ãããŸãã ããã«ãç§ã¯èšèã®æå³ã§ãµãŒããŒãäœæããã€ããã¯ãããŸãããç°ãªãããã°ã©ã ããã®æ¥ç¶ãåãå ¥ããŸãã-ããã¯è¿œå ã®äžå¿ èŠãªå°é£ããããããŸãã Golangããã°ã©ã ã®åã€ã³ã¹ã¿ã³ã¹ã«å¯ŸããŠãGUIãµãŒããŒã®åå¥ã®ã€ã³ã¹ã¿ã³ã¹ãèµ·åãããã¿ã¹ã¯ãããã«ç°¡çŽ åãããŸãã ãããã£ãŠãäžè¬ã«ãããã°ã©ã ã¯2ã€ã®ããã»ã¹ã§æ§æãããäžæ¹ã¯ã¡ã€ã³ã¿ã¹ã¯ãå®è¡ããããäžæ¹ã¯ã€ã³ã¿ãŒãã§ã€ã¹ãæ åœããŸãã
Goã®å¯Ÿå¿ããããã±ãŒãžã«ã¯ãGUIãµãŒããŒãèµ·åããŠçµåããInitããã·ãŒãžã£ãããã³ãŠã£ã³ããŠãšãŠã£ãžã§ãããäœæããŠæäœããããã®äžé£ã®æ§é ãã¡ãœãããé¢æ°ãå«ããå¿ èŠããããŸãã ããããã¹ãŠã®æ©èœã®äž»ãªå 容ã¯ãç¹å®ã®åœ¢åŒïŒJSONã«åºã¥ãïŒã®ã¡ãã»ãŒãžããµãŒããŒã«éä¿¡ãããµãŒããŒããã¡ãã»ãŒãžãåä¿¡ããããšã§ãã éä¿¡ã¯2ã€ã®tcp / ipããŒãã䜿çšããŠãµããŒããããŸãã1ã€ã¯ãµãŒããŒãžã®ãªã¯ãšã¹ãã®éä¿¡ãæ åœãããã1ã€ã¯ã€ãã³ãåŠçïŒãã¿ã³ã®ã¯ãªãã¯ããŠã£ã³ããŠã®ã¯ããŒãºãªã©ïŒã®ããã®ãµãŒããŒããã®ã·ã°ãã«ã®åä¿¡ãæ åœããŸãã ã¿ã¹ã¯ã¯æ¯èŒçåçŽã§ãããã±ãŒãžèªäœã¯å°ããã§ãã cgoã䜿çšããå¿ èŠãããµãŒãããŒãã£ã©ã€ãã©ãªãžã®ãã€ã³ããããã¹ãŠGoã®ã³ãŒããå¿ èŠãããŸããã ããã°ã©ã èªäœã®å®è¡å¯èœãã¡ã€ã«ãšGUIãµãŒããŒã®å®è¡å¯èœãã¡ã€ã«ã¯ãã¹ãŠã§ãã
GUIãµãŒããŒã®å®è£ ã«Harbor + HwGUIãéžæããã®ã¯ããŸããããããæãåçŽã§æéã®ãœãªã¥ãŒã·ã§ã³ã§ããããã€ãã£ããããŒã«ã§ããããã§ãã ããããããã¯ä»ã®èŠ³ç¹ããã¯è¯ãéžæã§ãã ããã§ãç§ã®æèŠã§ã¯ãäž»ãªå©ç¹ïŒ
- ãããã¯ã¹å ãã®ã¯ãã¹ãã©ãããã©ãŒã ã
- ãã€ãã£ãã«ãã¯ã¢ã³ããã£ãŒã«ãšåŒã°ãããã®ãWindowsã§ã¯ãããã¯æä»çã«WinAPIåŒã³åºãã§ãããããLinux / Unixã§ã¯GTKã ãã ããmacOsã®GTKãããã€ãã£ããã§ãããã©ããã¯ããŸãããããŸããã
- Harborãçµã¿èŸŒã¿ã®ã¹ã¯ãªããèšèªãšããŠäœ¿çšããæ©èœã«ãããã³ãŒããã©ã°ã¡ã³ãããµãŒããŒã«å®è¡ããããã«è»¢éã§ããŸããããšãã°ãã€ãã³ããã³ãã©ãŒã¯ãå®è£ ã®è©³çŽ°ããã¡ã€ã³ããã°ã©ã ããªãããŒãã§ããŸãã ããã«ãHarborã¯ãdbfãäžéšã®ããŒã¿ããŒã¹ã®æäœãªã©ãå€ãã®ç¹ã§åªããŠããŸãã
- å°å·ã®å®è£ ;
- DesignerïŒHwGUIãŠãŒãã£ãªãã£ïŒã«ãã£ãŠäœæãããç»é¢ãã©ãŒã ã䜿çšããæ©èœã ãããã®ãã©ãŒã ã¯XML圢åŒã§ä¿åããããµãŒããŒãå®è¡ãããŠããOSãå€æŽããããšãªã䜿çšã§ããŸãã
- åãDesignerã§äœæãããã¬ããŒããã©ãŒã ãïŒXMLã§ãïŒå°å·ã«äœ¿çšããæ©èœã
èŠããã«ãç§ã¯ãããå§ããäœæ¥ã®å€§éšåã¯ãã§ã«å®äºããŠããŸãã GuiServerãšGolang External GUIãã¬ãŒã ã¯ãŒã¯ã®äž¡æ¹ã®ãããžã§ã¯ãã¯Githubäžã«ããããã¹ãŠã®ãªã³ã¯ã¯èšäºã®æåŸã«ãããŸãã 以äžã«ã¹ã¯ãªãŒã³ã·ã§ãããããã€ã瀺ããŸãã ç¹å¥ãªããšã¯ãããŸããããã¹ãããã ãã§ãã
ããã¯ç°¡åãªãã€ã¢ãã°ããã¯ã¹ã§ãã
ããã¯ãKernigan and Donovanã®æ¬ã®äŸã«åºã¥ããŠè¡ãããŸãã
çŸåšããããžã§ã¯ãã®äž»ãªç®æšã¯ããã®çãã«ããã«ãExternalãšGuiServerãHwGUIã§ã§ããããšããã¹ãŠå®è¡ã§ããããã«ããããšã§ãã ããŠãExternalã䜿çšããŠå®éã®ã¢ããªã±ãŒã·ã§ã³ãäœæããããã»ã¹ã§ã¯ãããã«å¿ èŠãªãã®ãæ確ã«ãªããŸãã
ããã§çµããã«ãªãå¯èœæ§ãããã®ã§ãGolangããã±ãŒãžã®èª¬æã延æããŸããã ãããããã®èšäºã®äž»ãªããšã¯ãŸã å§ãŸã£ãã°ããã§ãã çµå±ã®ãšãããåãGUIãµãŒããŒã§GUIãã¬ãŒã ã¯ãŒã¯ãå®è£ ããããã«èª¬æããæ¹æ³ã¯ãä»ã®èšèªã«ã䜿çšã§ããŸãã CãPythonãJavaã...ãããã«ã¯PerlãPHPïŒãããŠãªãããã§ã¯ãªãã®ãïŒ-èšäºã®ã¿ã€ãã«ãåç §ããŠãã ããã æå°ã³ã¹ã-ããªãæ©èœçãªGUIãœãªã¥ãŒã·ã§ã³ãçšæãããŠããŸãã ç¹å®ã®åèšèªã«ãšã£ãŠæãé£ããããšã¯ããµãŒããŒãšã®äº€æã®å®è£ ã§ã¯ãããŸãããããã®ãœãªã¥ãŒã·ã§ã³ã¯ãã®ãã©ãã€ã ãå éšããžãã¯ã«ææ©çã«é©åããŸãã 誰ãããã®ãããªèšèªçšã«ãã®ãããªãã¬ãŒã ã¯ãŒã¯ãäœæãããå Žåãå¿ èŠãªæ å ±ãååŸããããããŸãå Žåã«ãã£ãŠã¯GUIãµãŒããŒã«ããã€ãã®æ©èœãè¿œå ããããã«ãå¯èœãªéãã®æ¯æŽãæäŸããŸãã
Golangããã±ãŒãžãšäžŠè¡ããŠãäž»ã«æ€èšŒ/ãããã°ã®ç®çã§ãHarborã®ã¢ããã°ãäœæããŸããã Perlã®ãã¬ãŒã ã¯ãŒã¯ã¯å®è¡ããããã«ãããŸããããCãŸãã¯C ++ã®å Žåã¯éåžžã«å¯èœæ§ãé«ãã§ãã çç±ã¯æ¬¡ã®ãšããã§ããçµå±ã®ãšãããGUIãµãŒããŒã®äœ¿çšã«é¢é£ããå¥ã®èå³æ·±ãæ©èœããããå¥ã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ã§ããŸãã ã¡ã€ã³ããã°ã©ã ã¯1å°ã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ããããã®ã€ã³ã¿ãŒãã§ã€ã¹ã¯å¥ã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ãããŸãã ãã®ã±ãŒã¹ã䜿çšããããã®ãªãã·ã§ã³ã¯ããã«ããã«èŠãããŸãïŒ
- ã¡ã€ã³ããã°ã©ã ã¯ãã°ã©ãã£ã«ã«ã·ã§ã«ããŸã£ããã€ã³ã¹ããŒã«ãããŠããªãLinux / UnixãµãŒããŒã§å®è¡ãããŸãã
- ã¡ã€ã³ããã°ã©ã ã¯ïŒäŒç€Ÿã®æ¡ä»¶ä»ãäŒèšå£«ãããïŒå€åœã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ããããŠãŒã¶ãŒã¯ããã劚ããã«èªåã§ç®¡çããŸãã
- ã¡ã€ã³ããã°ã©ã ã¯ã¹ããŒããã©ã³ã§å®è¡ãããéåžžã®ã³ã³ãã¥ãŒã¿ãŒãããã®å éšãæãäžããŸãã
- ã¡ã€ã³ããã°ã©ã ã¯ãéåžžã®ã¢ãã¿ãŒãååšããªãå¯èœæ§ã®ããäžéšã®ArduinoãRaspberryããŸãã¯ãããã®ã«ãŠã³ã¿ãŒããŒãã®ã³ã³ãããŒã©ãŒã§å®è¡ãããŸãã ããªãã®ã©ããããããšæ¥ç¶ããŠãã ããã
ããŠããã®æåŸã®ãªãã·ã§ã³ã§ã¯ãGUIãµãŒããŒã®Cãã¬ãŒã ã¯ãŒã¯ããããã圹ç«ã€ã§ãããããã®å¯èœæ§ã¯éåžžã«ææã ãšæããŸãã
ãããŠæåŸã«ããªã³ã¯ïŒ
github.com/alkresin/guiserver-Githubã®GuiServer
github.com/alkresin/external-Githubã®å€éšïŒGoããã±ãŒãžïŒ
www.kresin.ru/guisrv.html-ç§ã®ãµã€ãã®GuiServerããŒãžãããã§æ¢è£œã®ãã€ããªãããŠã³ããŒãã§ããŸã
habr.com/post/198618-ããŒããŒã«é¢ããç§ã®èšäºã¯Habréã«ãããŸã
en.wikipedia.org/wiki/Harbor-ãŠã£ãããã£ã¢ã®æž¯
www.kresin.ru/harbour.html-ç§ã®ãŠã§ããµã€ãã®ããŒããŒããŒãž
www.kresin.ru/hwgui.html-ç§ã®ãŠã§ããµã€ãã®HwGUIããŒãž
PSïŒãœãŒã¹ããGuiServerãæ§ç¯ããããã«HarbourãšHwGUIãã€ã³ã¹ããŒã«ãã人ã¯ã»ãšãã©ããªãã®ã§ãåéãããã€ããªãå®æçã«ãµã€ãã®GuiServerããŒãžã«æçš¿ããŸã-WindowsãDebian 8 32ããããUbuntu 18.04 64ããã Fedoraçšã«çµã¿ç«ãŠãããšã¯ã§ããŸãããmacOsã§ã¯ãæ®å¿µãªãããåŸæ©åå ã«ã¯ãããŸããã