tig-rrr писал(а):
главное понять принцип как из Хиасм массив передать (каким способом)Передавать можно разными способами.
Сделал 2 примера.
Первый как текст (но не 1000000 точек)
Add(MainForm,7714850,140,189)
{
Width=535
Height=417
Caption="Управление , комбинации клавиш"
Point(onClose)
link(onCreate,6871536:doFor,[(179,209)(179,146)])
link(onClose,7014996:doConsoleTerminate,[])
}
Add(FormatStr,12356033,364,203)
{
DataCount=1
Mask="[Reflection.Assembly]::UnsafeLoadFrom('.\ScottPlot.dll') | Out-Null\r\n[Reflection.Assembly]::UnsafeLoadFrom('.\ScottPlot.WinForms.dll') | Out-Null\r\n\r\n$plt = [ScottPlot.Plot]::new(600, 400)\r\n$data = @'\r\n%1\r\n'@\r\n# $array = @() \r\n\r\n[double[]]$array = $data.split([Environment]::NewLine) -ne ''\r\n\r\n$plt.PlotSignal($array)\r\n\r\n$plt.XLabel('Название горизонтальной оси');\r\n$plt.YLabel('Название вертикальной оси');\r\n\r\n$piotviewer = [ScottPlot.FormsPlotViewer]::new($plt)\r\n$piotviewer.Text = 'График 1000000 точек'\r\n$piotviewer.Height = 400\r\n$piotviewer.Width = 1200\r\n$piotviewer.Handle\r\n$piotviewer.ShowDialog()"
link(onFString,7014996:doConsoleExec,[])
link(Str1,9588492:Text,[])
}
Add(WinExec,7014996,427,189)
{
FileName="POWERSHELL"
Mode=0
Action="runas"
Point(doConsoleExec)
Point(doConsoleTerminate)
Point(onConsoleTerminate)
Point(onConsoleResult)
Point(onConsoleError)
link(onConsoleResult,9194188:doNormal,[])
link(onConsoleError,15431191:doCharset,[(480,223)(480,237)])
}
Add(WinTools,9194188,490,182)
{
Point(doNormal)
}
Add(Memo,13999287,553,231)
{
Width=519
Height=378
Align=5
Font=[MS Sans Serif,12,0,0,1]
Strings=#0:|20:Left-click-drag: pan|22:Right-click-drag: zoom|30:Middle-click-drag: zoom region|32:ALT+Left-click-drag: zoom region|28:Scroll wheel: zoom to cursor|0:|22:Right-click: show menu|23:Middle-click: auto-axis|28:Double-click: show benchmark|0:|40:CTRL+Left-click-drag to pan horizontally|39:SHIFT+Left-click-drag to pan vertically|42:CTRL+Right-click-drag to zoom horizontally|41:SHIFT+Right-click-drag to zoom vertically|42:CTRL+SHIFT+Right-click-drag to zoom evenly|51:SHIFT+click-drag draggables for fixed-size dragging|
ScrollBars=3
}
Add(For,6871536,196,140)
{
End=1000
link(onEvent,15991546:doRandom,[])
link(onStop,12356033:doString,[(242,153)(242,209)])
AddHint(50,-98,39,13,End)
}
Add(Random,15991546,252,140)
{
Max=8640
Point(doRandomWithoutRepeats)
link(onRandom,13321979:doOperation,[])
}
Add(StrList,9588492,364,140)
{
FileName="test.txt"
Point(doSave)
}
Add(Charset,15431191,490,231)
{
link(onCharset,13999287:doAdd,[])
}
Add(Math,13321979,301,140)
{
OpType=3
Op2=1000
link(onResult,9588492:doAdd,[])
}
Add(MainForm,1104467,259,105)
{
Width=510
Height=409
link(onCreate,7229501:doEvent1,[])
}
Add(For,6871536,420,119)
{
End=1000000
link(onEvent,15991546:doRandom,[])
link(onStop,568821:doEvent1,[(464,132)(464,167)])
AddHint(-42,47,57,13,End)
}
Add(Random,15991546,476,119)
{
Max=8640
Point(doRandomWithoutRepeats)
link(onRandom,13321979:doOperation,[])
}
Add(Math,13321979,525,119)
{
OpType=3
Op2=1000
link(onResult,9588492:doAdd,[(573,125)(573,139)])
}
Add(TimeCounter,11116776,357,119)
{
link(onStart,6871536:doFor,[])
link(onStop,1104467:doCaption,[(401,132)(401,97)(246,97)(246,111)])
}
Add(Hub,7229501,315,119)
{
link(onEvent1,11116776:doStart,[])
link(onEvent2,11116776:doStop,[])
}
Add(StrList,9588492,588,133)
{
FileName="test.txt"
Point(doSave)
}
Add(FormatStr,12356033,588,196)
{
DataCount=1
Mask="[Reflection.Assembly]::UnsafeLoadFrom('.\ScottPlot.dll') | Out-Null\r\n[Reflection.Assembly]::UnsafeLoadFrom('.\ScottPlot.WinForms.dll') | Out-Null\r\n\r\n$plt = [ScottPlot.Plot]::new(600, 400)\r\n\r\n[double[]]$array = Get-Content -Path '.\\test.txt'\r\n\r\n$plt.PlotSignal($array)\r\n\r\n$plt.XLabel('Название горизонтальной оси');\r\n$plt.YLabel('Название вертикальной оси');\r\n\r\n$piotviewer = [ScottPlot.FormsPlotViewer]::new($plt)\r\n$piotviewer.Text = 'График 1000000 точек'\r\n$piotviewer.Height = 400\r\n$piotviewer.Width = 1200\r\n$piotviewer.Handle\r\n$piotviewer.ShowDialog()\r\n"
link(onFString,7014996:doConsoleExec,[])
}
Add(WinExec,7014996,651,182)
{
FileName="POWERSHELL"
Mode=0
Action="runas"
Point(doConsoleExec)
Point(doConsoleTerminate)
Point(onConsoleTerminate)
Point(onConsoleResult)
Point(onConsoleError)
link(onConsoleResult,9194188:doNormal,[])
link(onConsoleError,15431191:doCharset,[(704,216)(704,230)])
}
Add(WinTools,9194188,714,175)
{
Point(doNormal)
}
Add(Memo,13999287,777,224)
{
Width=519
Height=378
Align=5
Font=[MS Sans Serif,12,0,0,1]
Strings=#0:|20:Left-click-drag: pan|22:Right-click-drag: zoom|30:Middle-click-drag: zoom region|32:ALT+Left-click-drag: zoom region|28:Scroll wheel: zoom to cursor|0:|22:Right-click: show menu|23:Middle-click: auto-axis|28:Double-click: show benchmark|0:|40:CTRL+Left-click-drag to pan horizontally|39:SHIFT+Left-click-drag to pan vertically|42:CTRL+Right-click-drag to zoom horizontally|41:SHIFT+Right-click-drag to zoom vertically|42:CTRL+SHIFT+Right-click-drag to zoom evenly|51:SHIFT+click-drag draggables for fixed-size dragging|
ScrollBars=3
}
Add(Charset,15431191,714,224)
{
link(onCharset,13999287:doAdd,[])
}
Add(Hub,568821,518,161)
{
link(onEvent1,9588492:doSave,[])
link(onEvent2,12356033:doString,[(564,174)(564,202)])
}