一种智能调料盒的制作方法

文档序号:1493735阅读:289来源:国知局

专利名称::一种智能调料盒的制作方法
技术领域
:本发明设计一种烹饪设备,其是一种能按一定程序辅助炒菜的智能调料盒。
背景技术
:炒菜做饭是一项再平常不过的日常家务劳动,但如今城市里的独生子女,从小到大都在家长的庇护中长大,普遍缺乏烧菜这项技能,随着这群80后的独生子女开始拥有自己家庭,烧菜做饭成了他们不得不面对的问题,如果能有一种产品既能辅助初学者完成炒菜做饭这项工作,又能让他们亲自体会到烹饪的乐趣和家庭的温暖,就能极大地解决以上的问题,使得人们的生活能够更加和谐美好。现有技术中的智能调料盒均直接采用220v民用电,并未将220v民用电转换为安全电压使用,这给使用智能调料盒带来一定的安全隐患。另外,现有技术采用机械的方式来控制调料的阀门,而采用机械方式由于机械磨损的方式,其故障率较高,并且在定量加料时,由于容器体积因素影响,其加料的控制精度不高,例如采用预定单位容积为V的容器来实现定量加料,此时受于容器固有容积的影响,每次只能增加单位体积的调料,即实现的定量加料的数值是不连续的,智能为N*V(其中N为自然数)。本发明采用220V转9V交流连接的单片机来控制电磁阀门,有效避免了现有技术中存在的上述缺陷,使得用电更安全,阀门故障概率大大下降,控制更灵活。另外,本发明由于采用单片机,可以有效地对智能调料盒的软件版本升级,使得本发明的智能调料盒可扩展性更强,也可采用自主编程的方式对智能调料盒的功能实现扩展,以在原有智能调料盒的基础上实现新功能,做出新菜肴;由于使用程序智能控制电磁阀门的开启与闭合,可实现数值连续的定量加料,这大大增大了智能调料盒做菜调料的适用范围,使得做出新菜肴更加方便、简单,同时,由于无需机械智能调料盒的诸多部件,本发明智能调料盒的维护也简单了很多。本发明智能调料盒依托预先编辑的程序和菜谱数据,不但能够在播报菜谱文件的同时,配合地放下液体和固体调料,辅助教学整个烹饪过程,更由于采用的菜谱文件都是出自美食书籍,使得炒出的菜更加美味,膳食搭配更加科学合理。相比与先前市场上的有些自动炒菜机,它的设计不仅仅更加经济和实用,更便于维护。其设计出发点也不仅仅是完成炒菜这项工作,还兼顾让人能够体验烹饪的乐趣。
发明内容本发明所要解决的技术问题是:提供一种用电安全、可扩展性强、调料控制精度和范围灵活的智能调料盒。—种智能调料盒,包括智能控制装置、至少一个固体调料箱和至少一个液体调料箱,其特征在于:所述智能控制装置包括单片机和多个由电磁阀门构成的固体阀门和液体阀门,固体调料箱和液体调料箱设有出料口,固体调料箱通过出料口和与之对应的一个固体阀门相连接,液体调料箱通过出料口和与之对应的一个液体阀门相连接;所述液体阀门和固体阀门分别与单片机相连接,并由单片机控制固体阀门和液体阀门的开启与闭合。从而控制液体调料的流出和固体调料的输出;所述单片机使用民用220V交流电转9V交流电;进一步的,所述智能调料盒中的单片机与外部电脑以串口或者无线的方式连接,所述外部电脑通过菜谱软件实现与所述单片机联合对固体阀门和液体阀门的开启或闭合的控制,所述菜谱软件基于微软VisualC++软件编写的MFC程序制作;进一步的,用户通过所述外部电脑设定调料量的具体值,然后通过控制阀门口打开的时间来精确控制调料量的值,具体值的大小通过阀门口打开时间乘以阀门口的横截面积再乘以固体或液体的流出速度得出。进一步的,所述调料盒还包括一支架板,所述单片机、固体调料箱、液体调料箱、固体阀门和液体阀门直接或者间接固定在所述支架板上;固体调料箱、液体调料箱位于固体阀门和液体阀门上方,并且分别通过软管进行相应的连接;进一步的,所述固体阀门和所述液体阀门分别固定在对应的活动杆上,所述活动杆分为两段,两段连接部上设有固定旋钮,用于固定活动杆的形状,所述活动杆的另一端通过固定支架固定在支架板上,所述活动杆具备调整所述固体阀门和所述液体阀门出料口位置的功能;进一步的,所述支架板还包括一底座,所述底座上设置煤气炉灶或电磁炉;进一步的,所述支架板还包括一支架挡板,用于当电脑放于智能调料盒旁边时,避免油迸溅到电脑上;进一步的,所述单片机使用民用220V交流电转9V交流电对应于一电转设备,所述电转设备将220V交流电转换为9V交流电;所述电转设备外壳为防水外壳;进一步的,所述单片机的型号为JMDM28D10MT单片机。本发明的有益效果是:既能用于辅助初级烹饪者学习烹饪,也能用于日常的生活中,所烹饪出的菜品营养科学、美味,操作简便,只要懂得一点电脑知识和基础炒菜流程,并由烧菜所需的材料,就能用它做出任何一种菜肴,其设计经济、实用,也便于维护,调整方便,能与现有的各种灶具匹配做菜。图1是智能调料盒立体图图2是智能调料盒侧视图图3是智能调料盒液体做菜程序界面具体实施例方式图1、2为本发明的智能调料盒的立体图和侧视图,该调料盒主要包括:智能控制装置、固体调料箱和液体调料箱。其中,固体调料箱和液体调料箱由调料箱2实现,智能控制装置包括单片机4和多个电磁阀门。图1中的固体阀门9、液体阀门10均为电磁阀门,调料箱2分为圆形或方形设有出料口的固体调料箱和液体调料箱,分别与固体阀门9和液体阀门10相连接,图1示出的例子中采用软管的方式连接,当然也可采用金属制成的管子连接,或其他本领域熟知的方式予以连接,液体阀门10和固体阀门9分别与单片机4相连接,可用电线连接,也可用其他本领域所熟知的其他可传输控制信号的缆线,或者采用无线方式连接,此时单片机4和液体阀门10、固体阀门9上分别设有无线发射和接收装置(图1仅给出了电线的连接方式,并未给出无线和其他的连接方式),单片机4控制固体阀门9和液体阀门10的开启与闭合,从而控制液体的流出和固体调料的输出。固体、液体阀门的出口正对锅11,以实现阀门流出的液体或固体调料进入锅中。锅放在电磁炉或者炉灶12上。该单片机4还设有串口线或无线收发模块(图1仅示出了串口连接的方式),可以与外部的电脑(计算机)16连接,外部电脑16可与单片机4进行通信,可读出单片机4的数据,或者将外部数据写入该单片机,也可通过软件实现对该智能调料盒的控制,此时实际上是外部电脑和该单片机联合实现对固体阀门和液体阀门的开启或闭合的控制,上述控制的具体实现为,外部电脑16通过菜谱软件与单片机4通信,通过将相应操作与控制指令发送给单片机4,由单片机4控制固体阀门9和液体阀门10的开启与闭合,从而实现外部电脑16和单片机4联合对固体阀门9和体液阀门10的控制,所述菜谱软件基于微软VisualC++软件编写的MFC程序制作。图1所示的例子中,单片机为JMDM28-D10MT单片机,当然也可采用其它型号的单片机。为方便该智能调料盒的使用与固定,调料箱2、单片机4、固体阀门9和液体阀门10可以固定在支架板I上,调料箱2位于固体阀门9和液体阀门10的上方,以实现依靠调料重力影响自动落入到锅中,调料箱2可以有多个,可根据所需调料种类数量制作相应个数的调料箱,图1中示出的调料箱中三个为液体调料箱,一个为固体调料箱,分别盛放油酱醋和盐。该支架板还可包括一底座13,并在底座上放置炉灶,例如电磁炉或煤气炉灶。如图2所示,为方便调节固体阀门9和液体阀门10的下落方位,使调料正好下落到锅11中,可将固体阀门9和液体阀门10分别固定在一活动杆上,该活动杆分为两段,两段连接部上设有固定旋钮15,用于固定活动杆的形状,从而固定固体阀门9和液体阀门10的位置,该活动杆的另一端通过固定支架14固定在支架板I上,这样,就可通过调整该活动杆来微调整阀门出料出口与锅之间的距离,也可调整阀门出料出口与锅11对准,这样即使大小不同的锅,均可通过调整该活动杆来使阀门口对准锅11所需要的位置。为了能够实现对固体阀门和液体阀门的位置调整,此时连接调料箱和阀门的管子应为软管或者其他可方便调节形状的管子。因此,能与现有的各种灶具匹配做菜。当电脑与单片机采用串口连接时,为避免油迸溅到电脑上,可在放置电脑与智能调料盒之间设置一支架挡板3。单片机电源使用的是民用220V交流电转9V交流电,电转换设备可以放在干燥不易沾水的地方,由密封好不漏水的防水外壳保护该电转换设备。在厨房使用时,由于直接使用9V交流电,即使有液体流到供电装置也不会产生危险,因此,更加安全。优选地,该智能调料盒还可设置一音频输出单元(图1-3中未示出),该声音输出单元与该单片机相连接,或与电脑16相连接,或使用电脑16本身的音频输出单元,用于输出提示语音或信息。在控制调料具体量的大小方面,可通过控制阀门口打开的时间来精确控制调料量的大小,具体量的大小可通过阀门口打开时间乘以阀门口的横截面积再乘以固体或液体的流出速度得出,该过程一般为通过外部电脑设定好调料量的具体值,后将该值传送给单片机,由单片机具体实施控制(参见图3)。该智能调料盒的控制调料输出的过程为,JMDM28D10MT单片机4和电脑16联合控制,烹饪者选择菜谱名和菜料质量,所述电脑生成菜谱数据,这些数据通过串口线5传达所述JMDM28D10MT单片机4,再由所述JMDM28D10MT单片机4自动控制所述固体阀门9、所述液体阀门10和语音菜谱辅助协同运作。固体调料装置由所述固体阀门9控制固体调料,力口料信号通过串口线5给所述JMDM28DIOMT单片机4信号,以控制所述固体阀门的开启和闭合,从而通过所述固体阀门的开启和闭合控制调料的流出和停止。就具体的软件实现而言,本发明软件是用基于微软VisualC++软件编写的MFC程序制作的菜谱软件,图3为该菜谱软件的操作界面。该菜谱软件代码以及具体控制流程参见附录I,该软件可实现对调料量的多少的控制,其功能除了根据用户所选择的调料的量来控制由电磁阀门构成的固体阀门9和液体阀门10的开启和闭合外,可实现菜的主料由烹饪者根据菜谱的语音提示在规定时间手动放入锅中,或者给出该菜的语音提示信息。该软件还可包括一美食数据库,该数据库预先保存各类美食制作过程数据,该数据库可通过录入美食书籍来建立,通过该数据库,可以在用户制做菜肴的过程中实时为用户提供语音提示,以简化菜肴的制作过程。当然,对本领域技术人员而言,就具体的软件实现而言,并不具体局限于说明书所附的附录I所描述的具体程序,本发明附录I所描述的程序仅为本发明的一优选实施例,本领域技术人员完全可以在附录I所描述的程序代码上做出等同替换或者适当删除或者增加本领域技术人员熟知的一些功能或者流程,以实现对附录I所描述程序的优化。该智能调料盒的工作方法步骤如下:1、将智能调料盒所在板放在灶台前方,调节板上阀门的高度和角度,使得阀门的出口可以在较低的位置对准锅,用串口线连接单片机和电脑,接上电源,并打开电脑。2、检查硬件间连接和单片机显示灯,以确保整套装置可以正常运行。3、点击桌面上的菜谱程序cooking,exe,在用户定义区内第一步先选择需要烹饪的菜的菜名。4、第二步中程序根据第一步中用户已输入的菜名自动生成在烹饪该菜会用到的主料和辅料,此时用户输入已准备的主料质量,并选择口味的清淡程度(有偏淡、适中、偏重三项可以选择),然后按下“确定”进入下一步。5、第三步中程序会根据用户在第二步中已经输入的主料和口味,科学地生成菜谱数据,其中包括将会用到的调料量和投放的时间点,用户可以选择默认的数据,也可以对该数据做稍许修改,最后按下“确定”结束用户定义区。6、在做菜提示区中,此时会显示炒菜的步骤介绍,通过它,用户可以了解到该菜的更详细信息,在烧干锅中剩余水分后,按下“开始”,程序开始做菜。7、在做菜过程中,程序中有操作步骤的语音提示、进度条提示和关于该菜的更详细介绍,用户只需根据语音提示,放入菜的主料和翻炒即可,而程序会在规定的时间点放入菜的辅料,待整个过程完成后,会有提示“菜已经完成了”,此时装盘即可。8、用户可以按下“重置”进行下一道菜的烹饪,也可以按下“退出”,退出程序。本领域技术人员根据本发明公开内容可知,具体的菜谱软件实现方式多样,并不局限于本申请后附的具体代码,还可以为本领域技术人员数值的其他方式,本发明的发明点和有益效果是采用电磁阀门、单片机控制,并可安全用电、用户操作方便。应当理解的是,本发明上述针对具体实施例的描述较为具体,不能因此而理解为对本发明专利保护范围的限制,本领域技术人员根据本发明公开内容对本发明具体实施例做出的等同技术手段的替换,均应属于本发明专利保护的范围。附录1:头文件1、Cooking,h//Cooking,h:mainheaderfilefortheCOOKINGapplicationIl#if!defined(AFX_C00KING_H__C0463E0F_5F44_405B_87E8_555424CF5A4A__INCLUDED」#defineAFX_C00KING_H—C0463E0F_5F44_405B_87E8_555424CF5A4A__INCLUDED,#if_MSC_VER>1000#pragmaonce#endif//_MSC_VER>1000#ifndef_AFXWIN_H_#errorinclude’stdafx.h’beforeincludingthisfileforPCH#endif#include"resource.h〃//mainsymbols///////////////////////////////////////////////////////////////////////////////CCookingApp:IlSeeCooking,cppfortheimplementationofthisclassIlclassCCookingApp:publicCffinApp{public:CCookingApp();IlOverridesIlClassffizardgeneratedvirtualfunctionoverrides//{{AFX_VIRTUAL(CCookingApp)public:virtualB00LInitInstance();//}}AFX_VIRTUALIlImplementation//{{AFX_MSG(CCookingApp)afx_msgvoidOnButtonl();//}}AFX_MSGDECLARE_MESSAGE_MAP()};///////////////////////////////////////////////////////////////////////////////{{AFX—INSERT—LOCATION}}IlMicrosoftVisualC++willinsertadditionaldeclarationsimmediatelybeforethepreviousline.#endif//!defined(AFX—COOKING—H—C0463E0F—5F44—405B—87E8—555424CF5A4A—INCLUDED」2、CookingDlg.h//CookingDlg.h:headerfile////{{AFX—INCLUDES()#include"mscomm.h"//}}AFX—INCLUDES#if!defined(AFX_C00KINGDLG_H_F12A8AB8_0235_4767_9469_942F52401C5E—INCLUDED」#defineAFX—C00KINGDLG—H—F12A8AB8—0235—4767—9469—942F52401C5E—INCLUDED—#if_MSC_VER>1000#pragmaonce#endif//—MSC—VER>1000//externintindex;externintml,m2;/////////////////////////////////////////////////////////////////////////////IlCCookingDlgdialogclassCCookingDlg:publicCDialog{//Constructionpublic:CCookingDlg(CWnd^pParent=NULL);//standardconstructorIlDialogData//{{AFX—DATA(CCookingDlg)enum{IDD=IDD—COOKING—DIALOG};CProgressCtrlm_jindu2;CProgressCtrlm—jindul;CProgressCtrlm—jinduO;intm_radl;CMSCommm—ctrlComm;//}}AFX—DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX—VIRTUAL(CCookingDlg)protected:virtualvoidDoDataExchange(CDataExchange^pDX);//DDX/DDVsupport//}}AFX—VIRTUAL//Implementationprotected:HICONm—hlcon;IlGeneratedmessagemapfunctions//{{AFX—MSG(CCookingDlg)virtualBOOLOnInitDialogO;afx_msgvoidOnSysCommand(UINTnID,LPARAMIParam);afx_msgvoidOnPaint();afx—msgHCURSOROnQueryDragIcon();afx—msgvoid0nButton2();afx—msgvoid0nButton3();afx—msgvoid0nButton4();afx—msgvoidOnTimer(UINTnIDEvent);afx—msgHBRUSHOnCtlColor(CDC*pDC,CWnd*pWnd,UINTnCtlColor);afx—msgvoid0nButton5();//}}AFX—MSGDECLARE—MESSAGE—MAP()private:CBrushm—brush;};//{{AFX—INSERT—LOCATION}}//MicrosoftVisualC++willinsertadditionaldeclarationsimmediatelybeforethepreviousline.#endif//!defined(AFX—C00KINGDLG—H—F12A8AB8—0235—4767—9469—942F52401C5E—INCLUDED」3、dlgl.h#if!defined(AFX_DLG1_H__7F9846FA_7599_4717_B4DB_B9A36935E7DE__INCLUDED」#defineAFX—DLG1—H—7F9846FA—7599—4717—B4DB—B9A36935E7DE—INCLUDED—#if_MSC_VER>1000#pragmaonce#endif//_MSC_VER>1000//dlgl.h:headerfile///////////////////////////////////////////////////////////////////////////////Hdlgldialogclassdlgl:publicCDialog{IlConstructionpublic:dlgl(CWnd^pParent=NULL);//standardconstructorIlDialogData//{{AFX—DATA(dlgl)enum{IDD=IDD—DIAL0G1};//NOTE:theClassWizardwilladddatamembershere//}}AFX—DATAIlOverrides//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX—VIRTUAL(dlgl)protected:virtualvoidDoDataExchange(CDataExchange^pDX);//DDX/DDVsupport//}}AFX—VIRTUAL//Implementationprotected://Generatedmessagemapfunctions//{{AFX—MSG(dlgl)virtualBOOLOnInitDialogO;//}}AFX—MSGDECLARE—MESSAGE—MAP()};//{{AFX—INSERT—LOCATION}}//MicrosoftVisualC++willinsertadditionaldeclarationsimmediatelybeforethepreviousline.#endif//!defined(AFX—DLG1—H—7F9846FA—7599—4717—B4DB—B9A36935E7DE—INCLUDED」4、mscomm.h#if!defined(AFX—MSC0MM—H——54CC5195—86C5—4ED5—9A65—926E202F6165—INCLUDED」#defineAFX—MSC0MM—H—54CC5195—86C5—4ED5—9A65—926E202F6165—INCLUDED—#if_MSC_VER>1000#pragmaonce#endif//—MSC—VER>1000//MachinegeneratedIDispatchwrapperclass(es)createdbyMicrosoftVisualC++//NOTE:Donotmodifythecontentsofthisfile.1fthisclassisregeneratedby//MicrosoftVisualC++,yourmodificationswillbeoverwritten.///////////////////////////////////////////////////////////////////////////////CMSCommwrapperclassclassCMSComm:publicCWnd{protected:DECLARE—DYNCREATE(CMSComm)public:CLSIDconst&GetClsidO{staticCLSIDconstclsid={0x648a5600,0x2c6e,0x101b,{0x82,0xb6,0x0,0x0,0x0,0x0,0x0,0x14}};returnclsid;}virtualB00LCreate(LPCTSTRIpszClassName,LPCTSTRIpszWindowName,DWORDdwStyle,constRECT&rect,CWnd^pParentWnd,UINTnID,CCreateContext^pContext=NULL){returnCreateControl(GetClsid(),IpszWindowName,dwStyle,rect,pParentWnd,nID);}BOOLCreate(LPCTSTRIpszWindowName,DWORDdwStyle,constRECT&rect,CWnd^pParentWnd,UINTnID,CFile^pPersist=NULL,BOOLbStorage=FALSE,BSTRbstrLicKey=NULL){returnCreateControl(GetClsid(),IpszWindowName,dwStyle,rect,pParentWnd,nID,pPersist,bStorage,bstrLicKey);}IlAttributespublic://Operationspublic:voidSetCDHolding(BOOLbNewValue);BOOLGetCDHoldingO;voidSetCommID(longnNewValue);longGetCommIDO;voidSetCommPort(shortnNewValue);shortGetCommPort();voidSetCTSHolding(BOOLbNewValue);BOOLGetCTSHoldingO;voidSetDSRHolding(BOOLbNewValue);BOOLGetDSRHoldingO;voidSetDTREnable(BOOLbNewValue);BOOLGetDTREnable();voidSetHandshaking(longnNewValue);longGetHandshaking();voidSetInBufferSize(shortnNewValue);shortGetInBufferSize();voidSetInBufferCount(shortnNewValue);shortGetInBufferCount();voidSetBreak(BOOLbNewValue);BOOLGetBreak();voidSetInputLen(shortnNewValue);shortGetInputLen();voidSetNullDiscard(BOOLbNewValue);BOOLGetNullDiscard();voidSetOutBufferSize(shortnNewValue);shortGetOutBufferSize();voidSetOutBufferCount(shortnNewValue);shortGetOutBufferCount();voidSetParityReplace(LPCTSTRIpszNewValue);CStringGetParityReplace();voidSetPortOpen(BOOLbNewValue);BOOLGetPortOpen();voidSetRThreshold(shortnNewValue);shortGetRThreshold();voidSetRTSEnable(BOOLbNewValue);BOOLGetRTSEnableO;voidSetSettings(LPCTSTRIpszNewValue);CStringGetSettings();voidSetSThreshold(shortnNewValue);shortGetSThresholdO;voidSetOutput(constVARIANT&newValue);VARIANTGetOutput();voidSetInput(constVARIANT&newValue);VARIANTGetInput();voidSetCommEvent(shortnNewValue);shortGetCommEvent();voidSetEOFEnable(B00LbNewValue);BOOLGetEOFEnable();voidSetInputMode(longnNewValue);longGetInputMode();};//{{AFX—INSERT—LOCATION}}//MicrosoftVisualC++willinsertadditionaldeclarationsimmediatelybeforethepreviousline.#endif//!defined(AFX—MSC0MM—H——54CC5195—86C5—4ED5—9A65—926E202F6165—INCLUDED」源文件1、Cooking,cpp//Cooking,cpp:Definestheclassbehaviorsfortheapplication.//#include"stdafx.h"#include"Cooking,h"#include"CookingDlg.h"#ifdef—DEBUG#definenewDEBUG—NEW#undefTHIS—FILEstaticcharTHIS—FILE[]=—FILE—;#endif/////////////////////////////////////////////////////////////////////////////IlCCookingAppBEGIN—MESSAGE—MAP(CCookingApp,CWinApp)//{{AFX—MSG—MAP(CCookingApp)//}}AFX—MSG—MAPON—COMMAND(ID—HELP,CWinApp::OnHelp)END—MESSAGE—MAP0///////////////////////////////////////////////////////////////////////////////CCookingAppconstructionCCookingApp::CCookingAppO{HTODO:addconstructioncodehere,//PlaceallsignificantinitializationinInitInstance}///////////////////////////////////////////////////////////////////////////////TheoneandonlyCCookingAppobjectCCookingApptheApp;/////////////////////////////////////////////////////////////////////////////IlCCookingAppinitializationBOOLCCookingApp::1nitInstance(){AfxEnableControlContainer();IlStandardinitialization//IfyouarenotusingthesefeaturesandwishtoreducethesizeIlofyourfinalexecutable,youshouldremovefromthefollowing//thespecificinitializationroutinesyoudonotneed.#ifdef_AFXDLLEnable3dControls();//CallthiswhenusingMFCinasharedDLL#elseEnable3dControlsStatic();//CallthiswhenlinkingtoMFCstatically#endifCCookingDlgdig;m—pMainWnd=&dlg;intnResponse=dig.DoModal();if(nResponse==ID0K){//T0D0:PlacecodeheretohandlewhenthedialogisIldismissedwithOK}elseif(nResponse==IDCANCEL){//T0D0:Placecodeheretohandlewhenthedialogis//dismissedwithCancel}//Sincethedialoghasbeenclosed,returnFALSEsothatweexittheIlapplication,ratherthanstarttheapplication’smessagepump.returnFALSE;}2、CookingDlg.cpp//CookingDlg.cpp:1mplementationfile//#include"stdafx.h"#include"Cooking,h"#include"CookingDlg.h"#include"math.h"#include"mmsystem.h"#include"dlgl.h"#ifdef—DEBUG#definenewDEBUG—NEW#undefTHIS—FILEstaticcharTHIS—FILE[]=—FILE—;#endif//intindex(0);intml,m2;inttim;CStringstrl,str2;//主料CStringsi,s2,s3,s4,s5;//其余材料intxl(0),x2(0),x3(0),x4(0),x5(0);inttt,tl,t2;///////////////////////////////////////////////////////////////////////////////CAboutDlgdialogusedforAppAboutclassCAboutDlg:publicCDialog{public:CAboutDlg();ΗDialogData//{{AFX—DATA(CAboutDlg)enum{IDD=IDD—AB0UTB0X};//}}AFX—DATA//ClassWizardgeneratedvirtualfunctionoverrides//{{AFX—VIRTUAL(CAboutDlg)protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDVsupport//}}AFX_VIRTUALIlImplementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg():CDialog(CAboutDlg::1DD){//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT}voidCAboutDlg::DoDataExchange(CDataExchange^pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)//{{AFX_MSG_MAP(CAboutDlg)//Nomessagehandlers//}}AFX_MSG_MAPEND_MESSAGE_MAP()///////////////////////////////////////////////////////////////////////////////CCookingDlgdialogCCookingDlg::CCookingDlg(CWnd*pParent/*=NULL*/):CDialog(CCookingDlg::1DD,pParent){//{{AFX_DATA_INIT(CCookingDlg)m_radl=-1;//}}AFX_DATA_INITIlNotethatLoadIcondoesnotrequireasubsequentDestroyIconinWin32m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);}voidCCookingDlg::DoDataExchange(CDataExchange^pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCookingDlg)DDX_Control(pDX,IDC_PR0GRESS9,m_jindu2);DDX_Control(pDX,IDC_PR0GRESS8,m_jindul);DDX_Control(pDX,IDC_PR0GRESS7,m_jinduO);DDX_Radio(pDX,IDC_RAD101,m_radl);DDX_Control(pDX,IDC_MSC0MM1,m_ctrlComm);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCookingDlg,CDialog)//{{AFX_MSG_MAP(CCookingDlg)0N_WM_SYSC0MMAND()0N_WM_PAINT()0N_WM_QUERYDRAGIC0N()0N_BN_CLICKED(IDC_BUTT0N2,0nButton2)0N_BN_CLICKED(IDC_BUTT0N3,0nButton3)0N_BN_CLICKED(IDC_BUTT0N4,0nButton4)0N_WM_TIMERO0N_WM_CTLC0L0R()0N_BN_CLICKED(IDC_BUTT0N5,0nButton5)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////IlCCookingDlgmessagehandlersBOOLCCookingDlg::OnInitDialog(){CDialog::OnInitDialog();//Add"About..."menuitemtosystemmenu.//IDM_AB0UTB0Xmustbeinthesystemcommandrange.ASSERT((IDM_AB0UTB0X&OxFFFO)==IDM_AB0UTB0X);ASSERT(IDM_AB0UTB0X<OxFOOO);CMenu^pSysMenu=GetSystemMenu(FALSE);if(pSysMenu!=NULL){CStringstrAboutMenu;strAboutMenu.LoadString(IDS_AB0UTB0X);if(!strAboutMenu.1sEmpty()){pSysMenu->AppendMenu(MF—SEPARATOR);pSysMenu->AppendMenu(MF—STRING,IDM—ABOUTBOX,strAboutMenu);}}IlSettheiconforthisdialog.TheframeworkdoesthisautomaticallyIlwhentheapplication’smainwindowisnotadialogSetIcon(m_hIcon,TRUE);//SetbigiconSetIcon(m—hlcon,FALSE);//SetsmalliconIlTODO:Addextrainitializationherethis->GetDlgItem(IDC_BUTT0N3)->EnableWindow(FALSE);this_>GetDlgItem(IDC—BUTT0N4)->EnableWindow(FALSE);//串口参数设置if(m—ctrlComm.GetPortOpen())m—ctrlComm.SetPortOpen(FALSE);m—ctrlComm.SetCommPort(3);//选择comlif(!m—ctrlComm.GetPortOpen())m—ctrlComm.SetPortOpen(TRUE);//打开串口elseAfxMessageBox("cannotopenserialport");m—ctrlComm.SetSettings("9600,n,8,l");//波特率9600,无校验,8个数据位,I个停止位m_ctrlComm.SetInputMode(I);//1:表示以二进制方式检取数据//m—ctrlComm.SetRThreshold(I);//参数I表示每当串口接收缓冲区中有多于或等于I个字符时将引发一个接收数据的OnComm事件m—ctrlComm.SetInputLen(O);//设置当前接收区数据长度为Om—ctrlComm.GetInputO;//先预读缓冲区以清除残留数据//设置固阀初始值m—ctrlComm.SetOutput(COleVariant("0(006,I)"));//设置背景色m—brush.CreateSolidBrush(RGB(236,243,253));this->GetDlgItem(IDC_BUTT0N3)->EnableWindow(FALSE);this_>GetDlgItem(IDC—BUTT0N4)->EnahleWindow(FALSE);this->GetDlgItem(IDC_STATIC63)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT1)->EnableWindow(TRUE);this_>GetDlgItem(IDC—RAD101)->EnableWindow(TRUE);this->GetDlgItem(IDC_RAD102)->EnableWindow(TRUE);this->GetDlgItem(IDC_RAD103)->EnableWindow(TRUE);//TODO:AddyourcontrolnotificationhandlercodehereFILE*pfilel;TCHARszBufl[1000];//显示步骤memset(szBuf1,0,999);pfilel=fopen("12.txt","rb");//打开文件fread(szBufl,1,1000,pfilel);//读取文件(GetDlgItem(IDC_STATICl))->SetWindowText(szBufI);//写控件fclose(pfilel);//关闭文件FILE*pfile2;TCHARszBuf2[1000];//显示步骤memset(szBuf2,0,999);pfile2=fopen("13.txt","rb");//打开文件fread(szBuf2,1,1000,pfile2);//读取文件(GetDlgItem(IDC_STATIC2))->SetWindowText(szBuf2);//写控件fclose(pfile2);//关闭文件FILE*pfile5;TCHARSzBuf5[1000];//显示步骤memset(szBuf5,0,999);Ilpfile5=fopen("01.txt","rb");//打开文件Ilelseif(index==I)pfile5=fopen("ll.txt","rb");//打开文件fread(szBuf5,1,1000,pfile5);//读取文件(GetDlgItem(IDC_STATIC5))->SetWindowText(szBuf5);//写控件fclose(pfile5);//关闭文件FILE*pfile3;TCHARszBuf3[1000];//显示步骤memset(szBuf3,0,999);pfile3=fopen("14.txt","rb");//打开文件fread(szBuf3,1,1000,pfile3);//读取文件(GetDlgItem(IDC_STATIC3))->SetWindowText(szBuf3);//写控件fclose(pfile3);//关闭文件GetDlgItem(IDC—STATIC11)->SetWindowText("总时间(4min40s)");GetDlgItem(IDC—STATIC12)->SetWindowText("步骤I(lmin40s)");GetDlgItem(IDC—STATIC13)->SetWindowText("步骤2(3min)〃);returnTRUE;//returnTRUEunlessyousetthefocustoacontrol}voidCCookingDlg::OnSysCommand(UINTnID,LPARAMIParam){if((nID&OxFFFO)==IDM—ABOUTBOX){CAboutDlgdlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID,IParam);}}IlIfyouaddaminimizebuttontoyourdialog,youwillneedthecodebelow//todrawtheicon.ForMFCapplicationsusingthedocument/viewmodel,Ilthisisautomaticallydoneforyoubytheframework.voidCCookingDlg::OnPaint(){if(Islconic()){CPaintDCdc(this);//devicecontextforpaintingSendMessage(WM—ICONERASEBKGND,(WPARAM)dc.GetSafeHdc(),0);//Centericoninclientrectangleintcxlcon=GetSystemMetrics(SM_CXIC0N);intcylcon=GetSystemMetrics(SM_CYIC0N);CRectrect;GetClientRect(&rect);intx=(rect.Width()-cxlcon+l)/2;inty=(rect.Height()-cylcon+l)/2;//Drawtheicondc.DrawIcon(x,y,m—hlcon);}else{CDialog::OnPaint();}}//Thesystemcallsthistoobtainthecursortodisplaywhiletheuserdrags//theminimizedwindow.HCURSORCCookingDlg::OnQueryDragIcon(){return(HCURSOR)m_hIcon;}//第二步voidCCookingDlg::0nButton2(){this_>GetDlgItem(IDC—EDIT01)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT02)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT03)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT04)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT05)->EnableWindow(TRUE);this_>GetDlgItem(IDC—EDIT06)->EnableWindow(TRUE);//TODO:Addyourcontrolnotificationhandlercodeherethis_>GetDlgItem(IDC—BUTT0N4)->EnableWindow(FALSE);UpdateData();GetDlgItemText(IDC—EDIT1,strl);GetDlgItemText(IDC—EDIT2,str2);intq(0);if(strl=="")MessageBox("请输入主材料的质量");elseif(ceil(atof(strl))>10000||ceil(atof(strl))<100)MessageBox("您输入的材料数量不合理,请重新输入");elseq=I;if(m_radl==—I)MessageBox("请选择口味!");if(q==I&&m_radl!=-1){this->GetDlgItem(IDC_BUTT0N2)->EnableWindow(FALSE);this->GetDlgItem(IDC_BUTT0N3)->EnableWindow(TRUE);this_>GetDlgItem(IDC—RAD101)->EnableWindow(FALSE);this_>GetDlgItem(IDC—RAD102)->EnableWindow(FALSE);this_>GetDlgItem(IDC—RAD103)->EnableWindow(FALSE);FILE*pfile4;TCHARszBuf4[1000];//显示步骤memset(szBuf4,0,999);pfile4=fopen("15.txt","rb");//打开文件fread(szBuf4,1,1000,pfile4);//读取文件(GetDlgItem(IDC_STATIC4))->SetWindowText(szBuf4);//写控件(GetDlgItem(IDC_STATIC6))->SetWindowText(szBuf4);//写控件fclose(pfile4);//关闭文件//计算建议量{ml=(int)ceil(atof(strl));//白菜(克)xl=(int)ceil(0.15*ml);//油(ml)if(m_radl==0)x2=(int)ceil(ml*0.005);//盐(g)if(m_radl==1)x2=(int)ceil(ml*0.004);if(m_radl==2)x2=(int)ceil(ml*0.0625);x4=(int)ceil(ml*0.035);//醋(ml)x3=(int)ceil(x4*0.333);//酱油(ml)x5=(int)ceil(x3*0.5);//醋(ml)}Η显示建议量s1.Format(/r%d",xl);s2.Format("%d",x2);s3.Format("%d",x3);s4.Format("%d",x4);s5.Format("%d",x5);{GetDlgItem(IDC—EDIT1)->EnableWindow(FALSE);GetDlgItem(IDC—STATIC01)->SetWindowText(strl);GetDlgItem(IDC_STATIC02)->SetWindowText(sl);GetDlgItem(IDC_STATIC03)->SetWindowText(s2);GetDlgItem(IDC—STATIC04)->SetWindowText(s3);GetDlgItem(IDC—STATIC05)->SetWindowText(s4);GetDlgItem(IDC_STATIC06)->SetWindowText(s5);GetDlgItem(IDC—EDIT01)->SetWindowText(strl);GetDlgItem(IDC—EDIT02)->SetWindowText(si);GetDlgItem(IDC—EDIT03)->SetWindowText(s2);GetDlgItem(IDC—EDIT04)->SetWindowText(s3);GetDlgItem(IDC—EDIT05)->SetWindowText(s4);GetDlgItem(IDC—EDIT06)->SetWindowText(s5);}}}//第三步voidCCookingDlg::0nButton3(){//TODO:Addyourcontrolnotificationhandlercodeherethis->GetDlgItem(IDC_BUTT0N4)->EnableWindow(FALSE);this->GetDlgItem(IDC_EDIT01)->EnableWindow(FALSE);this_>GetDlgItem(IDC—EDIT02)->EnableWindow(FALSE);this_>GetDlgItem(IDC—EDIT03)->EnableWindow(FALSE);this_>GetDlgItem(IDC—EDIT04)->EnableWindow(FALSE);this_>GetDlgItem(IDC—EDIT05)->EnableWindow(FALSE);this_>GetDlgItem(IDC—EDIT06)->EnableWindow(FALSE);UpdateData();{this->GetDlgItem(IDC_BUTT0N3)->EnableWindow(FALSE);GetDlgItemText(IDC—EDIT01,strl);GetDlgItemText(IDC—EDIT02,si);GetDlgItemText(IDC—EDIT03,s2);GetDlgItemText(IDC—EDIT04,s3);GetDlgItemText(IDC—EDIT05,s4);GetDlgItemText(IDC—EDIT06,s5);ml=(int)ceil(atof(strl));//白菜(g)xl=(int)ceil(atof(si));x2=(int)ceil(atof(s2));x3=(int)ceil(atof(s3));x4=(int)ceil(atof(s4));x5=(int)ceil(atof(s5));//播放准备提示音PlaySound("2—1.wav",NULL,SND—ASYNC);//提示准备材料dlglaa;aa.DoModal();}this->GetDlgItem(IDC_BUTT0N4)->EnableWindow(TRUE);}//开始做菜voidCCookingDlg::0nButton4(){this_>GetDlgItem(IDC—BUTT0N4)->EnableWindow(FALSE);//T0D0:Addyourcontrolnotificationhandlercodehere//this->GetDlgItem(IDC—BUTT0N1)->EnableWindow(FALSE);this->GetDlgItem(IDC_BUTT0N2)->EnableWindow(FALSE);this->GetDlgItem(IDC_BUTT0N3)->EnableWindow(FALSE);SetTimer(l,1000,NULL);tim=0;Ηif(index==0)Il{tt=240;tl=120;t2=tt_tl;}Ilelseif(index==I){tt=280;tl=100;t2=tt_tl;}m—jindu0.SetRange(I,tt);m—jindu0.SetPos(O);m—jindul.SetRange(1,tl);m—jindul.SetPos(O);m—jindu2.SetRange(I,t2);m—jindu2.SetPos(O);}voidCCookingDlg::OnTimer(UINTnIDEvent){//TODO:Addyourmessagehandlercodehereand/orcalldefaultCDialog::OnTimer(nIDEvent);if(tim<=tt){CStringsmti("0"),sws("0");swm.Format(/r%d",(tt-tim)/60);sws.Format(/r%d",(tt-tim)%60);GetDlgItem(IDC—STATIC20)->SetWindowText(smti);GetDlgItem(IDC—STATIC21)->SetWindowText(sws);m—jindu0.SetPos(tim);CString0"),swsl("0");if(tim<=tl){sMnl.Format("%d",(tl-tim)/60);sws1.Format(/r%d",(tl-tim)%60);GetDlgItem(IDC—STATIC30)->SetWindowText(smtiI);GetDlgItem(IDC—STATIC31)->SetWindowText(swsl);m—jindul.SetPos(tim);}else{sMnl.Format("%d",(t2_tim+tl)/60);swsl.Format(/r%d",(t2_tim+tl)%60);GetDlgItem(IDC_STATIC40)->SetffindowText(swml);GetDlgItem(IDC_STATIC41)->SetffindowText(swsl);m_jindu2.SetPos(tim-tl);}Η放调料{//放油(油为灯9)if(tim==3)m_ctrlComm.SetOutput(COleVariant("0(009,1)"));if(tim==(3+xl/6))m_ctr1Comm.SetOutput(COleVariant("0(009,0)"));//放盐、醋、酱油(盐为灯7、醋为灯11、酱油为灯12)if(tim==106)m_ctrlComm.SetOutput(COleVariant(;/0(007,1)"));if(tim==114)m_ctrlComm.SetOutput(COleVariant(;/0(007,0)"));if(tim==115)m_ctrlComm.SetOutput(COleVariant(;/0(011,1)"));if(tim==(115+x4/8))m_ctrlComm.SetOutput(COleVariant("0(011,0)"));if(tim==122)m_ctrlComm.SetOutput(COleVariant(;/0(012,1)"));if(tim==(122+x3/7))m_ctrlComm.SetOutput(COleVariant("0(012,0)"));//放香油(香油为灯10)if(tim==275)m_ctrlComm.SetOutput(COleVariant("0(009,1)"));if(tim==(275+x5/6))m_ctr1Comm.SetOutput(COleVariant("0(009,0)"));//语音提示if(tim==0)PlaySound("2_2.wav",NULL,SND_ASYNC);if(tim==35)PlaySound("2_3.wav",NULL,SND_ASYNC);if(tim==101)PlaySound(;/2_4.wav",NULL,SND_ASYNC);if(tim==273)PlaySound("2_5.wav",NULL,SND_ASYNC);}tim=tim+1;}}HBRUSHCCookingDlg::OnCtlColor(CDC*pDC,CWnd*pffnd,UINTnCtlColor){HBRUSHhbr=CDialog::OnCtlColor(pDC,pffnd,nCtlColor);if(pffnd->GetDlgCtrlID()==IDC_STATIC50)/*控件的名称*/{PDC->SetTextColor(RGB(0,0,0));/*将色彩容器中的文字颜色设置为黑色*/PDC->SetBkMode(TRANSPARENT);/*设置文字的背景为透明,否则文字背景认为系统默认色*///PDC->SetBkColor(RGB(255,0,0));/*设置文字的背景色,注意如果写了上面句的话,背景色无效*/}if(pffnd->GetDlgCtrlID()==IDC_STATIC51){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC52){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC53){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC54){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC61){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC62){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC63){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC64){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC65){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC66){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC67){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC68){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC69){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC70){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC71){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC72){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC73){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC2){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC3){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC4){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC5){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC6){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC01){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC02){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC03){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC04){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC05){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC06){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC11){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC12){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC13){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC21){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC22){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC23){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC24){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC25){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC27){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC20){pDC_>SetTextColor(RGB(0,0,O));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC30){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC40){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC31){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_STATIC41){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_RAD101){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_RAD102){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_RAD103){pDC_>SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);}if(pffnd->GetDlgCtrlID()==IDC_C0MB01){pDC->SetTextColor(RGB(0,0,0));pDC->SetBkMode(TRANSPARENT);//pDC->SetBkColor(RGB(255,255,0));}//TODO:ChangeanyattributesoftheDCherereturnm_brush;//TODO:Returnadifferentbrushifthedefaultisnotdesired//returnhbr;}voidCCookingDlg::0nButton5(){IlT0D0:AddyourcontrolnotificationhandlercodehereGetDlgItem(IDC_EDIT1)->SetffindowText{"");m_radl=-1;this->GetDlgItem(IDC_STATIC63)->Enableffindow(TRUE);this->GetDlgItem(IDC_EDITl)->Enableffindow(TRUE);GetDlgItem(IDC_STATIC01)->SetffindowText{"");GetDlgItem(IDC_STATIC02)->SetWindowText(〃");GetDlgItem(IDC_STATIC03)->SetWindowText(〃");GetDlgItem(IDC_STATIC04)->SetffindowText("");GetDlgItem(IDC_STATIC05)->SetWindowText(〃");GetDlgItem(IDC_STATIC06)->SetWindowText(〃");GetDlgItem(IDC—STATIC4)->SetWindowText("");GetDlgItem(IDC—STATIC6)->SetWindowText("");GetDlgItem(IDC_EDIT01)->SetWindowText(,/");GetDlgItem(IDC—EDIT02)->SetWindowText("");GetDlgItem(IDC—EDIT03)->SetWindowText("");GetDlgItem(IDC—EDIT04)->SetWindowText("");GetDlgItem(IDC—EDIT05)->SetWindowText("");GetDlgItem(IDC—EDIT06)->SetWindowText("");this->GetDlgItem(IDC_BUTT0N2)->EnableWindow(TRUE);this->GetDlgItem(IDC_BUTT0N3)->EnableWindow(FALSE);this->GetDlgItem(IDC_BUTT0N4)->EnableWindow(FALSE);this_>GetDlgItem(IDC—RAD101)->EnableWindow(TRUE);this->GetDlgItem(IDC_RAD102)->EnableWindow(TRUE);this_>GetDlgItem(IDC—RAD103)->EnableWindow(TRUE);KillTimer(I);tt=350;tl=150;t2=200;m—jindu0.SetRange(I,tt);m—jindu0.SetPos(O);m—jindul.SetRange(1,tl);m—jindul.SetPos(O);m—jindu2.SetRange(I,t2);m—jindu2.SetPos(O);GetDlgItem(IDC—STATIC20)->SetWindowText("");GetDlgItem(IDC_STATIC21)->SetWindowText(,/");GetDlgItem(IDC—STATIC30)->SetWindowText("");GetDlgItem(IDC_STATIC31)->SetWindowText(,/");GetDlgItem(IDC—STATIC40)->SetWindowText("");GetDlgItem(IDC—STATIC41)->SetWindowText("");PlaySound("空.wav",NULL,SND—ASYNC);}3λdlgl.cpp//dlgl.cpp!implementationfile//#include"stdafx.h"#include"Cooking,h"#include"CookingDlg.h"#include"dlgl.h"#ifdef—DEBUG#definenewDEBUG—NEW#undefTHIS_FILEstaticcharTHIS_FILE[]=—FILE—;#endifCStringssl,ss2;///////////////////////////////////////////////////////////////////////////////dlgldialogdlgl::dlgl(Cffnd*pParent/*=NULL*/):CDialog(dlgl::1DD,pParent){//{{AFX_DATA_INIT(dlgl)//NOTE:theClassffizardwilladdmemberinitializationhere//}}AFX_DATA_INIT}voiddlgl::DoDataExchange(CDataExchange^pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(dlgl)IlNOTE:theClassffizardwilladdDDXandDDVcallshere//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(dlgl,CDialog)//{{AFX_MSG_MAP(dlgl)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////IldlglmessagehandlersBOOLdlgl::OnInitDialog0{CDialog::OnInitDialog();//TODO:AddextrainitializationhereFILE*pfilel;TCHARszBufl[1000];//显示步骤memset(szBuf1,0,999);//if(index==0)Ηpfilel=fopen("02.txt","rb");//打开文件Ilelseif(index==I)pfilel=fopen("12.txt","rb");//打开文件fread(szBufl,1,1000,pfilel);//读取文件(GetDlgItem(IDC_STATIC01))->SetWindowText(szBufl);//写控件fclose(pfilel);//关闭文件FILE*pfile2;TCHARszBuf2[1000];//显示步骤memset(szBuf2,0,999);Ilif(index==0)Ηpfile2=fopen("03.txt","rb");//打开文件Ilelseif(index==I)pfile2=fopen("13.txt","rb");//打开文件fread(szBuf2,1,1000,pfile2);//读取文件(GetDlgItem(IDC_STATIC02))->SetWindowText(szBuf2);//写控件fclose(pfile2);//关闭文件ssl.Format(/r%d",ml);ss2.Format(/r%d",m2);Ilif(index==0)//{IlGetDlgItem(IDC—STATIC11)->SetWindowText(ssl);IlGetDlgItem(IDC—STATIC12)->SetWindowText(ss2);//}//elseif(index==I)GetDlgItem(IDC—STATIC11)->SetWindowText(ssl);returnTRUE;//returnTRUEunlessyousetthefocustoacontrolIlEXCEPTION:OCXPropertyPagesshouldreturnFALSE}4λmscomm.cpp//MachinegeneratedIDispatchwrapperclass(es)createdbyMicrosoftVisualC++//NOTE:Donotmodifythecontentsofthisfile.1fthisclassisregeneratedby//MicrosoftVisualC++,yourmodificationswillbeoverwritten.#include"stdafx.h"#include"mscomm.h"///////////////////////////////////////////////////////////////////////////////CMSCommMPLEMENT—DYNCREATE(CMSComm,CWnd)/////////////////////////////////////////////////////////////////////////////IlCMSCommproperties///////////////////////////////////////////////////////////////////////////////CMSCommoperationsvoidCMSComm::SetCDHolding(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x1,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetCDHoldingO{BOOLresult;InvokeHelper(0x1,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetCommID(longnNewValue){staticBYTEparms[]=VTS_I4;InvokeHelper(0x3,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}longCMSComm::GetCommID(){longresult;InvokeHelper(0x3,DISPATCH_PROPERTYGET,VT_I4,(void*)&result,NULL);returnresult;}voidCMSComm::SetCommPort(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(0x4,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetCommPort(){shortresult;InvokeHeIper(0x4,DISPATCH_PROPERTYGET,VT_I2,(void*)&resuit,NULL);returnresult;}voidCMSComm::SetCTSHolding(B00LbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x5,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetCTSHoldingO{BOOLresult;InvokeHelper(0x5,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetDSRHolding(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x7,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetDSRHoldingO{BOOLresult;InvokeHelper(0x7,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetDTREnable(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x9,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetDTREnable(){BOOLresult;InvokeHelper(0x9,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetHandshaking(longnNewValue){staticBYTEparms[]=VTS_I4;InvokeHelper(Oxa,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}longCMSComm::GetHandshakingO{longresult;InvokeHelper(Oxa,DISPATCH_PROPERTYGET,VT_I4,(void*)&result,NULL);returnresult;}voidCMSComm::SetInBufferSize(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(Oxb,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetInBufferSize(){shortresult;InvokeHelper(Oxb,DISPATCH_PROPERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetInBufTerCount(shortnNewValue){[1021]staticBYTEparms[]=VTS_I2;InvokeHelper(Oxc,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetInBufferCount(){shortresult;[1029]InvokeHeIper(Oxc,DISPATCH_PROPERTYGET,VT_I2,(void*)&resuit,NULL);returnresult;}voidCMSComm::SetBreak(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(Oxd,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetBreakO{BOOLresult;InvokeHelper(Oxd,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetInputLen(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(Oxe,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetInputLen(){shortresult;InvokeHelper(Oxe,DISPATCH_PROPERTYGET,VT_I2,(void*)&result,NULL);returnresult;}[1058]voidCMSComm::SetNullDiscard(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x10,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetNulIDiscardO{BOOLresult;InvokeHelper(0x10,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}[1071]voidCMSComm::SetOutBufferSize(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(0x11,DISPATCH_PR0PERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetOutBufferSize(){shortresult;InvokeHelper(0x11,DISPATCH_PR0PERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetOutBufferCount(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(0x12,DISPATCH_PR0PERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetOutBufferCount(){shortresult;InvokeHelper(0x12,DISPATCH_PR0PERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetParityReplace(LPCTSTRIpszNewValue){staticBYTEparms[]=VTS_BSTR;InvokeHelper(0x13,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,IpszNewValue);}CStringCMSComm::GetParityReplace(){CStringresult;[1107]InvokeHelper(0x13,DISPATCH_PROPERTYGET,VT_BSTR,(void*)&result,NULL);returnresult;}voidCMSComm::SetPortOpen(B00LbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x14,DISPATCH_PR0PERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetPortOpen(){BOOLresult;InvokeHelper(0x14,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetRThreshold(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(0x15,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetRThresholdO[1131]{shortresult;InvokeHelper(0x15,DISPATCH_PROPERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetRTSEnable(BOOLbNewValue){staticBYTEparms[]=VTS_B00L;InvokeHelper(0x16,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetRTSEnable(){BOOLresult;InvokeHelper(0x16,DISPATCH_PROPERTYGET,VT_B00L,(void*)&result,NULL);returnresult;}voidCMSComm::SetSettings(LPCTSTRIpszNewValue){staticBYTEparms[]=VTS_BSTR;InvokeHelper(0x17,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,IpszNewValue);}CStringCMSComm::GetSettings(){CStringresult;InvokeHelper(0x17,DISPATCH_PROPERTYGET,VT_BSTR,(void*)&result,NULL);returnresult;}voidCMSComm::SetSThreshold(shortnNewValue){staticBYTEparms[]=VTS_I2;InvokeHelper(0x18,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,[1167]nNewValue);}shortCMSComm::GetSThresholdO{shortresult;InvokeHelper(0x18,DISPATCH_PROPERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetOutput(constVARIANT&newValue)[1176]{staticBYTEparms[]=VTS_VARIANT;InvokeHelper(0x19,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,&newValue);}VARIANTCMSComm::GetOutput(){VARIANTresult;InvokeHelper(0x19,DISPATCH_PROPERTYGET,VT_VARIANT,(void*)&result,NULL);returnresult;}voidCMSComm::SetInput(constVARIANT&newValue){staticBYTEparms[]=VTS_VARIANT;InvokeHelper(Oxla,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,&newValue);}VARIANTCMSComm::GetInput(){VARIANTresult;InvokeHelper(Oxla,DISPATCH_PROPERTYGET,VT_VARIANT,(void*)&result,NULL);returnresult;}voidCMSComm::SetCommEvent(shortnNewValue){staticBYTEparms[]=[1204]VTS_I2;InvokeHelper(Oxlb,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}shortCMSComm::GetCommEvent(){shortresult;InvokeHelper(Oxlb,DISPATCH_PROPERTYGET,VT_I2,(void*)&result,NULL);returnresult;}voidCMSComm::SetEOFEnable(BOOLbNewValue){[1216]staticBYTEparms[]=VTS_B00L;InvokeHelper(Oxlc,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,bNewValue);}BOOLCMSComm::GetEOFEnable(){BOOLresult;InvokeHelper(Oxlc,DISPATCH_PROPERTYGET,VT_BOOL,(void*)&result,NULL);returnresult;}voidCMSComm::SetInputMode(longnNewValue){staticBYTEparms[]=VTS_I4;InvokeHelper(Oxld,DISPATCH_PROPERTYPUT,VT_EMPTY,NULL,parms,nNewValue);}longCMSComm::GetInputMode(){longresult;InvokeHelper(Oxld,DISPATCH_PROPERTYGET,VT_I4,(void*)&result,NULL);returnresult;}权利要求1.一种智能调料盒,包括智能控制装置、至少一个固体调料箱和至少一个液体调料箱,其特征在于:所述智能控制装置包括单片机(4)和多个由电磁阀门构成的固体阀门(9)和液体阀门(10),固体调料箱和液体调料箱设有出料口,固体调料箱通过出料口和与之对应的一个固体阀门(9)相连接,液体调料箱通过出料口和与之对应的一个液体阀门(10)相连接;所述液体阀门(10)和固体阀门(9)分别与单片机⑷相连接,并由单片机⑷控制固体阀门(9)和液体阀门(10)的开启与闭合。从而控制液体调料的流出和固体调料的输出;所述单片机(4)使用民用220V交流电转9V交流电。2.按权利要求1所述的智能调料盒,其特征在于:所述智能调料盒中的单片机(4)与外部电脑(16)以串口或者无线的方式连接,所述外部电脑(16)通过菜谱软件实现与所述单片机(4)联合对固体阀门(9)和液体阀门(10)的开启或闭合进行控制,所述菜谱软件的制作基于微软VisualC++软件编写的MFC程序。3.按权利要求2所述的智能调料盒,其特征在于:用户通过所述外部电脑(16)设定调料量的具体值,然后通过控制阀门口打开的时间来精确控制调料量的值,具体值的大小通过阀门口打开时间乘以阀门口的横截面积再乘以固体或液体的流出速度得出。4.按权利要求1-3所述的智能调料盒,其特征在于:所述调料盒还包括一支架板(1),所述单片机(4)、固体调料箱、液体调料箱、固体阀门(9)和液体阀门(10)直接或者间接固定在所述支架板(I)上;固体调料箱和液体调料箱位于固体阀门(9)和液体阀门(10)上方,并且分别通过软管进行相应的连接。5.按权利要求4所述的智能调料盒,其特征在于:所述固体阀门(9)和所述液体阀门(10)分别固定在对应的活动杆上,所述活动杆分为两段,两段连接部上设有固定旋钮(15),用于固定活动杆的形状,所述活动杆的另一端通过固定支架(14)固定在支架板(I)上,所述活动杆具备调整所述固体阀门和所述液体阀门出料口位置的功能。6.按权利要求5所述的智能调料盒,其特征在于:所述支架板(I)还包括一底座(13),所述底座(13)上设置煤气炉灶或电磁炉。7.按权利要求6所述的智能调料盒,其特征在于:所述支架板(I)还包括一支架挡板(3),用于在电脑放于智能调料盒旁边时,避免油进溅到电脑上。8.按权利要求1-7所述的智能调料盒,其特征在于:所述单片机(4)使用民用220V交流电转9V交流电对应于一电转设备,所述电转设备将220V交流电转换为9V交流电;所述电转设备外壳为防水外壳。9.按权利要求1-8所述的智能调料盒,其特征在于:所述单片机的型号为JMDM28DIOMT单片机。全文摘要一种家用炒菜智能调料盒,包括智能控制装置、至少一个固体调料箱和至少一个液体调料箱,其特征在于所述智能控制装置包括单片机(4)和多个由电磁阀门构成的固体阀门(9)和液体阀门(10),固体调料箱和液体调料箱设有出料口,固体调料箱通过出料口和与之对应的一个固体阀门(9)相连接,液体调料箱通过出料口和与之对应的一个液体阀门(10)相连接;所述液体阀门(10)和固体阀门(9)分别与单片机(4)相连接,并由单片机(4)控制固体阀门(9)和液体阀门(10)的开启与闭合,从而控制液体调料的流出和固体调料的输出;所述单片机(4)使用民用220V交流电转9V交流电。文档编号A47J47/00GK103082898SQ200910093739公开日2013年5月8日申请日期2009年10月16日优先权日2009年10月16日发明者张治国,王诗涛,胡冬晶,郭瑾,廖思静,高文鹏,金博思申请人:北京邮电大学
网友询问留言 已有0条留言
  • 还没有人留言评论。精彩留言会获得点赞!
1