| Потоки | - SharedStream |
SharedStream
Краткое описание
Компонент предназначен для работы с файлами проекций в память, как с файловыми потоками.
С помощью этого компонента можно читать и записывать файлы, практически неограниченной длины (2^63 байт). Кроме тго, с помощью этого компонента можно передавать данные между приложениями, не используя очереди событий системы и, соответственно, не требует наличия окна обработки очереди
С помощью этого компонента можно читать и записывать файлы, практически неограниченной длины (2^63 байт). Кроме тго, с помощью этого компонента можно передавать данные между приложениями, не используя очереди событий системы и, соответственно, не требует наличия окна обработки очереди
Параметры
Методы
События
Свойства
Данные
Примеры
Add(MainForm,11176470,609,413)
{
Left=20
Top=105
Width=527
Height=368
Caption="FileMapVewer"
Position=1
Point(onClose)
}
Add(Menu,9436858,210,322)
{
Menu=#4:Load|4:Next|8:Previous|5:Begin|3:End|
Point(onSelectNum)
link(onSelectNum,12401350:doEvent,[])
}
Add(IndexToChanel,12401350,259,329)
{
Count=5
Data=Integer(0)
link(onEvent1,1786215:doExecute,[])
link(onEvent2,6449920:doOperation,[(300,342)(300,216)])
link(onEvent3,1172799:doOperation,[(305,349)(305,244)])
link(onEvent4,16402917:doWork2,[(315,356)(315,321)])
link(onEvent5,3042786:doData,[(310,363)(310,293)])
}
Add(Hub,2606912,378,329)
{
OutCount=3
link(onEvent1,16402917:doWork3,[(459,335)])
link(onEvent2,12437222:doOpen,[])
link(onEvent3,4206186:doWork1,[(403,349)])
}
Add(FormatStr,6713179,560,413)
{
DataCount=4
Mask="%1 - %2 - %3 - %4"
link(onFString,11176470:doCaption,[])
link(Str1,10881460:Var2,[])
link(Str2,15197747:Var2,[])
link(Str4,12437222:Granularity,[(587,390)(517,390)])
}
Add(ODialog,1786215,329,329)
{
link(onExecute,2606912:doEvent1,[])
}
Add(HubEx,4206186,399,406)
{
link(onEvent,10015508:doEvent1,[])
}
Add(Hub,4964243,581,210)
{
link(onEvent1,12437222:doRemapping,[(605,216)(605,380)(465,380)(465,349)])
link(onEvent2,4206186:doWork3,[(650,223)(650,510)(403,510)])
}
Add(Hub,10015508,413,406)
{
link(onEvent1,11127952:doData,[])
link(onEvent2,4597674:doConvert,[(440,419)(440,482)])
}
Add(Memo,8054800,560,455)
{
Width=519
Height=334
Align=5
Font=[Courier New,8,0,0,204]
ScrollBars=3
}
Add(DoData,11127952,448,406)
{
link(onEventData,14388698:doCase,[])
link(Data,12437222:SizeMMF,[(454,387)(496,387)])
}
Add(Case,14388698,497,406)
{
DataOnTrue=String(Достигнут конец файла)
link(onNextCase,1493232:doWork1,[(550,412)])
link(onTrue,1493232:doWork2,[])
}
Add(HubEx,1493232,546,413)
{
link(onEvent,6713179:doString,[])
}
Add(Memory,2399477,483,287)
{
Default=String()
}
Add(SharedStream,12437222,476,336)
{
PageMem=16
Point(FileSize)
Point(FileOffset)
Point(Granularity)
link(CoreName,2399477:Value,[])
link(Offset,12053861:Value,[(496,325)(524,325)])
}
Add(Stream2Hex,4597674,476,476)
{
Mode=4
link(onResult,8054800:doText,[])
link(Data,12437222:Stream,[])
}
Add(HubEx,16402917,455,315)
{
Angle=3
link(onEvent,12053861:doClear,[(459,223)])
}
Add(Memory,12053861,518,210)
{
Default=Integer(0)
link(onData,4964243:doEvent1,[])
}
Add(HubEx,10265774,448,210)
{
link(onEvent,12053861:doValue,[])
}
Add(Math,6449920,357,210)
{
Op2=1048576
Point(doClear)
link(onResult,9509682:doWork2,[])
link(Op1,2953199:Var1,[(363,194)])
}
Add(Math,1172799,399,238)
{
OpType=1
Op2=1048576
Point(doClear)
link(onResult,9509682:doWork3,[(445,244)])
link(Op1,2953199:Var2,[])
}
Add(GetDataEx,15197747,567,385)
{
Angle=3
link(Data,12437222:FileOffset,[(510,390)])
}
Add(GetDataEx,2953199,399,189)
{
Angle=1
link(Data,15197747:Var1,[(573,194)])
}
Add(DoData,3042786,399,287)
{
link(onEventData,10265774:doWork3,[(452,293)])
link(Data,10881460:Var1,[(405,276)(566,276)])
}
Add(GetDataEx,10881460,560,392)
{
Angle=3
link(Data,12437222:FileSize,[(503,397)])
}
Add(HubEx,9509682,441,210)
{
link(onEvent,10265774:doWork2,[])
}
Add(MainForm,11176470,455,140)
{
Left=20
Top=105
Width=527
Caption="FileMapReadWrite"
Point(onClose)
}
Add(Menu,9436858,154,196)
{
Menu=#4:Load|5:Write|
Point(onSelectNum)
link(onSelectNum,12401350:doEvent,[])
}
Add(IndexToChanel,12401350,203,203)
{
Data=Integer(0)
link(onEvent1,1786215:doExecute,[(247,209)(247,146)])
link(onEvent2,9182042:doEvent1,[])
}
Add(DoData,2298906,343,217)
{
link(onEventData,1143428:doPut,[])
link(Data,11804486:Text,[(349,200)(420,200)(420,255)(461,255)])
}
Add(DataToFile,1143428,399,217)
{
Type=6
Point(doPosition)
Point(Position)
link(onGet,11804486:doText,[])
link(Stream,11748904:Stream,[])
}
Add(Hub,9182042,301,210)
{
link(onEvent1,696098:doWork2,[])
link(onEvent2,2298906:doData,[])
}
Add(SharedStream,11748904,399,140)
{
CoreName="My_MapFile"
PageMem=4
link(onOpen,11176470:doCaption,[])
}
Add(Memo,11804486,455,196)
{
Width=574
Height=387
Align=5
Font=[Courier New,10,1,0,204]
ScrollBars=3
}
Add(ODialog,1786215,259,140)
{
link(onExecute,8165055:doEvent1,[])
}
Add(Hub,8165055,301,140)
{
OutCount=3
link(onEvent1,11748904:doOpen,[])
link(onEvent2,696098:doWork1,[(333,153)])
link(onEvent3,1143428:doGet,[(384,160)(384,230)])
}
Add(HubEx,696098,329,210)
{
Angle=1
link(onEvent,1143428:doPosition,[(333,237)])
}
Add(MainForm,11176470,434,203)
{
Left=20
Top=105
Width=527
Caption="MemoryMapFile"
Point(onClose)
link(onCreate,11748904:doOpen,[])
}
Add(Menu,9436858,224,273)
{
Menu=#6:Append|5:Write|4:Read|
Point(onSelectNum)
link(onSelectNum,12401350:doEvent,[])
}
Add(IndexToChanel,12401350,273,280)
{
Count=3
Data=Integer(0)
link(onEvent1,2934282:doOperation,[])
link(onEvent2,11567502:doWork3,[(368,293)])
link(onEvent3,1104125:doEvent1,[(315,300)(315,328)])
}
Add(DoData,2298906,434,287)
{
link(onEventData,1143428:doPut,[])
link(Data,11804486:Text,[(440,269)(510,269)(510,345)(552,345)])
}
Add(DataToFile,1143428,490,287)
{
Type=6
Point(doPosition)
Point(Position)
link(onGet,11804486:doText,[])
link(Stream,11748904:Stream,[])
}
Add(Hub,9182042,378,280)
{
link(onEvent1,2836025:doWork1,[(410,286)])
link(onEvent2,2298906:doData,[])
}
Add(HubEx,2836025,406,301)
{
link(onEvent,1143428:doPosition,[])
}
Add(Hub,1104125,378,322)
{
link(onEvent1,2836025:doWork3,[(410,328)])
link(onEvent2,1143428:doGet,[(474,335)(474,300)])
}
Add(Math,2934282,322,280)
{
OpType=1
Op2=1
link(onResult,11567502:doWork2,[])
link(Op1,1143428:Position,[(328,269)(360,269)(360,345)(503,345)])
}
Add(SharedStream,11748904,490,217)
{
CoreName="My_MapFile"
PageMem=4
link(onOpen,11176470:doCaption,[(534,223)(534,196)(420,196)(420,209)])
}
Add(Memo,11804486,546,266)
{
Width=574
Height=387
Align=5
Font=[Courier New,10,1,0,204]
}
Add(HubEx,11567502,364,280)
{
link(onEvent,9182042:doEvent1,[])
}
Add(MainForm,11176470,511,399)
{
Left=20
Top=105
Width=370
Height=116
Caption="FileMapCopy"
Position=1
Point(onClose)
}
Add(Hub,2606912,231,301)
{
OutCount=5
link(onEvent1,12053861:doClear,[(262,307)(262,237)])
link(onEvent2,75271:doData,[])
link(onEvent3,12437222:doOpen,[])
link(onEvent4,2453142:doData,[(262,328)(262,447)])
link(onEvent5,8948769:doWork1,[(256,335)])
}
Add(FormatStr,6713179,357,399)
{
DataCount=3
Mask="%2 / %1 / %3"
link(onFString,2689277:doWork2,[])
link(Str1,6464666:Var2,[])
link(Str2,12437222:FileSize,[])
link(Str3,8406968:Var2,[])
}
Add(ODialog,1786215,147,301)
{
link(onExecute,9721491:doText,[])
}
Add(SharedStream,12437222,343,315)
{
CoreName="Reader"
PageMem=160
Point(FileSize)
Point(CountFileBlock)
Point(FileOffset)
Point(CurOffsetBlock)
link(Offset,16245746:Var2,[])
}
Add(Memory,12053861,357,224)
{
Default=Integer(0)
}
Add(Edit,9721491,189,301)
{
Left=5
Top=10
Width=325
Color=15527129
Text=""
link(onChange,2606912:doEvent1,[])
}
Add(Button,15010227,105,301)
{
Left=335
Top=10
Width=20
Font=[MS Sans Serif,8,1,0,1]
Cursor=2
TabOrder=-1
Caption="..."
Data=Integer(6)
link(onClick,1786215:doExecute,[])
}
Add(Hub,7955653,280,189)
{
OutCount=5
link(onEvent1,12053861:doValue,[(345,195)(345,230)])
link(onEvent2,12437222:doRemapping,[(320,202)(320,328)])
link(onEvent3,13857900:doWork2,[])
link(onEvent4,8948769:doWork3,[(448,216)(448,455)(256,455)])
link(onEvent5,16653913:doOperation,[(315,223)(315,475)])
}
Add(HubEx,8948769,252,399)
{
link(onEvent,6713179:doString,[])
}
Add(Edit,6608579,595,231)
{
Left=5
Top=35
Width=285
Color=13099746
Text=""
ReadOnly=0
link(onChange,3741764:doFileExists,[])
}
Add(SDialog,607125,553,231)
{
link(onExecute,6608579:doText,[])
}
Add(ProgressBar,999899,595,434)
{
Left=5
Top=60
Width=350
Height=15
Ctl3D=0
WinStyle=2
Smooth=1
ProgressColor=7554575
Point(doMax)
}
Add(SharedStream,4764602,595,315)
{
CoreName="Writer"
PageMem=160
Mode=1
link(onOpen,3538368:doCopy,[(636,321)(636,286)(583,286)(583,398)])
link(FileName,14638908:Var2,[])
link(Offset,16245746:Var3,[(615,292)])
link(Size,6464666:Var3,[(622,298)(482,298)(482,383)])
}
Add(Hub,9127255,84,98)
{
OutCount=3
link(onEvent1,13857900:doWork1,[(501,104)])
link(onEvent2,13074501:doStart,[])
link(onEvent3,15201884:doFor,[(109,118)(109,195)])
}
Add(Application,2819314,595,476)
{
}
Add(HubEx,13857900,497,203)
{
Angle=1
link(onEvent,4764602:doOpen,[(501,321)])
}
Add(GetDataEx,6464666,357,378)
{
link(Data,12437222:SizeMMF,[])
}
Add(GetDataEx,16245746,357,287)
{
link(Data,12053861:Value,[])
}
Add(StreamCopy,3538368,595,392)
{
link(Dest,4764602:Stream,[])
link(Source,12437222:Stream,[(608,376)(349,376)])
}
Add(For,15201884,119,189)
{
IncludeEnd=1
link(onEvent,13481594:doCalc,[])
link(onStop,2532482:doEvent1,[])
link(End,12814098:GetData,[])
}
Add(TimeCounter,13074501,448,105)
{
link(onStop,2689277:doWork1,[(494,118)])
}
Add(HubEx,2689277,490,399)
{
link(onEvent,11176470:doCaption,[])
}
Add(EventFromData,12814098,126,140)
{
link(onEvent,573981:doOperation,[])
}
Add(Math,573981,175,140)
{
OpType=1
Op2=1
link(onResult,12814098:doData,[(218,146)(218,128)(114,128)(114,146)])
link(Op1,5399951:Var1,[(181,97)(433,97)])
}
Add(MathParse,13481594,238,189)
{
link(onResult,7955653:doEvent1,[])
link(X1,12437222:FileOffset,[(244,165)(405,165)(405,358)(384,358)])
link(X2,6464666:Var1,[(251,170)(335,170)(335,383)])
}
Add(DoData,2453142,427,441)
{
link(onEventData,999899:doMax,[])
link(Data,5399951:Var2,[])
}
Add(GetDataEx,8406968,371,364)
{
link(Data,12437222:CountFileBlock,[])
}
Add(FileTools,3741764,637,210)
{
link(onEnd,11825168:doEvent,[])
}
Add(IndexToChanel,11825168,679,210)
{
link(onEvent1,8297473:doWork3,[(725,216)])
link(onEvent2,8911471:doDelete,[])
}
Add(FileTools,8911471,735,203)
{
link(onEnd,8297473:doWork2,[(777,209)(777,83)])
link(FileName,14638908:Var3,[(741,191)(786,191)(786,278)])
}
Add(GetDataEx,14638908,595,273)
{
link(Data,6608579:Text,[])
}
Add(HubEx,8297473,721,77)
{
Angle=2
link(onEvent,11001603:doTimer,[(23,83)(23,104)])
}
Add(Button,53629,511,231)
{
Left=300
Top=35
Font=[MS Sans Serif,8,1,0,1]
TabOrder=-1
Caption="Copy"
link(onClick,607125:doExecute,[])
}
Add(Hub,885053,546,469)
{
link(onEvent1,14504423:doWork3,[(574,475)])
link(onEvent2,2819314:doProcessMessages,[])
}
Add(Math,16653913,385,469)
{
Op2=1
link(onResult,885053:doEvent1,[])
link(Op1,12437222:CurOffsetBlock,[])
}
Add(Timer,11001603,35,98)
{
Interval=25
Enable=1
AutoStop=1
link(onTimer,9127255:doEvent1,[])
}
Add(GetDataEx,5399951,427,364)
{
Angle=3
link(Data,8406968:Var3,[])
}
Add(DoData,75271,266,308)
{
Data=Integer(0)
link(onEventData,14504423:doWork2,[(310,314)(310,440)])
}
Add(HubEx,14504423,570,434)
{
link(onEvent,999899:doPosition,[])
}
Add(Hub,2532482,182,196)
{
OutCount=3
link(onEvent1,13074501:doStop,[(225,202)(225,118)])
link(onEvent2,4764602:doClose,[(226,209)(226,270)(573,270)(573,335)])
link(onEvent3,12437222:doClose,[(219,216)(219,275)(325,275)(325,335)])
}
Замечания
Обновление элемента: [svn]SharedStream.pas[/svn]
BB-code статьи для вставки
Всего комментариев: 0
(комментарии к статье еще не добавлены)