|
不知道大家有没有这样的感觉,就是在涉及到界面的项目中,如带液晶显示(1602之类的字符液晶,12864或者更大分辨率的图形点阵液晶)的时候,界面设计往往是非常头疼的一件事情。如果前期没有规划好,后期处理起来更是非常棘手。如果在代码编写的差不多的时候,如果客户又提出了新的需求,则界面又会发生变化,如果程序结构设计的不好,则会耗费相当大的工作量去修改。如果能有类似的PC上位机软件做界面设计管理,如在PC机上面设计好界面以及编写相应的代码,然后上位机编译输出代码,下位机解释执行,或者上位机直接生成完整的.c .h 文件参与工程的编译。这样即可以远远提高工作效率,又可以应对变化的需求。目前市场上面类似的东西除了串口液晶 文本显示器 HMI 之外好像还没有针对这样的应用场合的软件。大家在做人机交互的界面设计时候是如何处理的呢?希望大家能够谈谈自己的想法。是否存在一种通用的做法可以适应大多数的应用场合?目前我想深入研究一下基于单色液晶的界面设计,编写一款类似的PC上位机软件。希望大家畅所欲言。下面的资料是在国外论坛找到的,个人感觉这种思路就非常好,如果再配合一下上位机,不愧也为一种好的人机交互处理方式。
国外论坛摘抄的:
The Menu consists of a 8 Byte Table per line... the Table is held in program codespace (see elsewhere on this forum how to do that).
Byte 1 tell the Menu Subroutine what kind of Data Element we are dealing with... ie, Numeric, Numeric with Fixed Decimals, Alphanumeric, Date, Time etc.
Byte 2 is the Data Element Byte Length.
Byte 3 is the Minimum permitted value for any Numeric entry.
Byte 4 is the Maximum permitted value for any Numeric entry.
Byte 5 are Flags... these are Bits that Control frills, eg Cursor ON/OFF, Visible or Invisible Entry (like that required for Passwords) , whether Data-Entry is permitted or not, etc etc
Byte 6 points to the location in EEPROM where the first Byte of Data is to be found.
Byte 7 points to the Message in Program Codespace which will appear on your LCD prompting your Data-Entry (eg "Enter Time Delay").
Byte 8 points to a secondarry Message in Program Codespace for additional information (eg "Minutes").
The Menu Subroutine, sequentially reads the eight control bytes and acts on it accordingly. Once you have built your subroutine, it's a simple matter of adding just eight bytes (plus prompting messages) per Menu item. It's small, it's compact, and everything you need to learn how to do it is on this forum somewhere (though not in a ready cut & paste form). Clue: It does rely very heavilly on reading large Tables of Data from Program Codespace and manipulating Alphanumeric STRINGS (for all the LCD Messages) with PBP. Sort out how to do that first, and the rest is simple! |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|