Add(MainForm,2953706,420,91) { Point(onClose) } Add(InlineCode,3036192,273,189) { @Hint=#9:CLOCKER -|16:Генератор тактов| WorkPoints=#60:doClockMks=Генератор тактов с периодом Delay в микросекундах|34:doStop=Остановка генератора тактов| EventPoints=#54:onClock=Событие происходит каждые Delay единиц времени| DataPoints=#5:Delay| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,Share,Windows,Debug;|0:|4:type|29: THiAsmClass = class(TDebug)|10: private|17: FStop:boolean;|9: public|20: Delay:THI_Event;|22: onClock:THI_Event;|0:|54: procedure doClockMks(var _Data:TData; Index:word);|50: procedure doStop(var _Data:TData; Index:word);|6: end;|0:|14:implementation|0:|33:procedure THiAsmClass.doClockMks;|20:var sp,ep,cnt:int64;|12:var dl:real;|5:begin|18: FStop := false;|34: QueryPerformanceFrequency(cnt);|26: cnt := cnt div 1000000;|28: dl := ToRealEvent(Delay);|27: while not FStop do begin|34: QueryPerformanceCounter(sp);|12: repeat|34: QueryPerformanceCounter(ep);|34: until (ep - sp)div cnt > dl;|33: _hi_OnEvent(onClock,_Data);|32:// _hi_OnEvent(onClock,dl);|7: end;|4:end;|0:|29:procedure THiAsmClass.doStop;|5:begin|16: FStop := true;|4:end;|0:|4:end.| link(onClock,6640081:doStop,[(313,195)(313,97)]) link(Delay,5231732:Value,[]) AddHint(28,59,90,26,@Hint) } Add(Memory,5231732,273,140) { Default=Integer(500) } Add(Button,13603856,124,182) { Left=270 Top=145 Align=5 link(onClick,8007501:doStart,[]) } Add(TimeCounter,6640081,322,84) { Precision=1 link(onStop,11501098:doEvent1,[]) } Add(Hub,4052253,243,182) { link(onEvent1,14456206:doWork2,[(261,188)(261,89)]) link(onEvent2,3036192:doClockMks,[]) } Add(Hub,11501098,378,91) { link(onEvent1,2953706:doCaption,[]) link(onEvent2,14456206:doWork1,[(405,104)(405,49)(294,49)]) } Add(HubEx,14456206,290,83) { link(onEvent,6640081:doStart,[(318,89)(318,90)]) } Add(Thread,8007501,189,182) { Delay=0 FastStop=0 link(onExec,4052253:doEvent1,[]) }