hqchart 1.1.13311 → 1.1.13318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umychart.vue.js +63 -41
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +200 -2
- package/src/jscommon/umychart.complier.js +30 -12
- package/src/jscommon/umychart.js +273 -4
- package/src/jscommon/umychart.resource/css/tools.css +35 -0
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +49 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +11 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +14 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +304 -17
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +504 -19
|
@@ -5541,6 +5541,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5541
5541
|
|
|
5542
5542
|
//画图工具
|
|
5543
5543
|
if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
|
|
5544
|
+
if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
|
|
5544
5545
|
|
|
5545
5546
|
//注册事件
|
|
5546
5547
|
if (option.EventCallback)
|
|
@@ -6803,6 +6804,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6803
6804
|
this.IsShowRightMenu=true; //显示右键菜单
|
|
6804
6805
|
|
|
6805
6806
|
this.DialogDrawTool; //画图工具
|
|
6807
|
+
this.DialogModifyDraw; //画图修改
|
|
6806
6808
|
|
|
6807
6809
|
|
|
6808
6810
|
this.ClearStockCache=function()
|
|
@@ -6827,6 +6829,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6827
6829
|
this.DialogDrawTool.Create();
|
|
6828
6830
|
}
|
|
6829
6831
|
|
|
6832
|
+
this.InitalModifyDrawDialog=function()
|
|
6833
|
+
{
|
|
6834
|
+
if ( this.DialogModifyDraw) return;
|
|
6835
|
+
|
|
6836
|
+
this.DialogModifyDraw=new JSDialogModifyDraw();
|
|
6837
|
+
this.DialogModifyDraw.Inital(this);
|
|
6838
|
+
this.DialogModifyDraw.Create();
|
|
6839
|
+
}
|
|
6840
|
+
|
|
6830
6841
|
this.ShowDrawToolDialog=function(x,y)
|
|
6831
6842
|
{
|
|
6832
6843
|
if (!this.DialogDrawTool) return;
|
|
@@ -6849,6 +6860,31 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6849
6860
|
return this.DialogDrawTool.IsShow();
|
|
6850
6861
|
}
|
|
6851
6862
|
|
|
6863
|
+
this.ShowModifyDrawDialog=function(chart, x,y)
|
|
6864
|
+
{
|
|
6865
|
+
if (!this.DialogModifyDraw) return;
|
|
6866
|
+
|
|
6867
|
+
this.DialogModifyDraw.SetChartPicture(chart);
|
|
6868
|
+
if (this.DialogModifyDraw.IsShow()) return;
|
|
6869
|
+
|
|
6870
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
6871
|
+
var rtScroll=GetScrollPosition();
|
|
6872
|
+
|
|
6873
|
+
var top=this.UIElement.offsetTop+15;
|
|
6874
|
+
var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;
|
|
6875
|
+
left+=rtClient.left+rtScroll.Left;
|
|
6876
|
+
top+=rtClient.top+rtScroll.Top;
|
|
6877
|
+
|
|
6878
|
+
this.DialogModifyDraw.Show(left, top);
|
|
6879
|
+
}
|
|
6880
|
+
|
|
6881
|
+
this.CloseModifyDrawDialog=function()
|
|
6882
|
+
{
|
|
6883
|
+
if (!this.DialogModifyDraw) return;
|
|
6884
|
+
|
|
6885
|
+
this.DialogModifyDraw.Close();
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6852
6888
|
//obj={ Element:, Canvas: }
|
|
6853
6889
|
this.SetCorssCursorElement=function(obj)
|
|
6854
6890
|
{
|
|
@@ -7528,6 +7564,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7528
7564
|
}
|
|
7529
7565
|
}
|
|
7530
7566
|
|
|
7567
|
+
|
|
7568
|
+
if (!this.SelectChartDrawPicture) this.CloseModifyDrawDialog(); //当前没有选中画图 隐藏画图修改框
|
|
7569
|
+
|
|
7531
7570
|
document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
|
|
7532
7571
|
document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
|
|
7533
7572
|
|
|
@@ -10222,6 +10261,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10222
10261
|
this.SelectChartDrawPicture=null;
|
|
10223
10262
|
if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
|
|
10224
10263
|
this.ClearChartDrawPicture(drawPicture); //删除选中的画图工具
|
|
10264
|
+
this.CloseModifyDrawDialog();
|
|
10225
10265
|
}
|
|
10226
10266
|
else if (this.SelectedChart && this.SelectedChart.Selected.Identify)
|
|
10227
10267
|
{
|
|
@@ -11928,11 +11968,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11928
11968
|
this.OnSelectChartPicture=function(chart)
|
|
11929
11969
|
{
|
|
11930
11970
|
JSConsole.Chart.Log('[JSChartContainer::OnSelectChartPicture]',chart);
|
|
11931
|
-
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
11932
|
-
if (!this.ChartPictureMenu) return;
|
|
11933
11971
|
|
|
11934
|
-
|
|
11935
|
-
|
|
11972
|
+
if (!this.DialogModifyDraw) return;
|
|
11973
|
+
|
|
11974
|
+
if (chart.ClassName=="ChartDrawPictureText" || chart.ClassName=='ChartDrawVolProfile')
|
|
11975
|
+
{
|
|
11976
|
+
this.CloseModifyDrawDialog();
|
|
11977
|
+
|
|
11978
|
+
if (!this.ChartPictureMenu) this.ChartPictureMenu=g_DialogFactory.Create('ChartPictureSettingMenu', this.UIElement.parentNode);
|
|
11979
|
+
if (!this.ChartPictureMenu) return;
|
|
11980
|
+
|
|
11981
|
+
var event={ data: { ChartPicture:chart, HQChart:this}};
|
|
11982
|
+
this.ChartPictureMenu.DoModal(event);
|
|
11983
|
+
}
|
|
11984
|
+
else
|
|
11985
|
+
{
|
|
11986
|
+
this.ShowModifyDrawDialog(chart);
|
|
11987
|
+
}
|
|
11936
11988
|
}
|
|
11937
11989
|
|
|
11938
11990
|
this.FinishMoveChartDrawPicture=function()
|
|
@@ -59479,6 +59531,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59479
59531
|
|
|
59480
59532
|
{ Name:"水平线2", ClassName:"ChartDrawHLine", Create:function() { return new ChartDrawHLine(); }},
|
|
59481
59533
|
|
|
59534
|
+
{ Name:"MonitorLine", ClassName:"ChartDrawMonitorLine", Create:function() { return new ChartDrawMonitorLine(); }},
|
|
59535
|
+
|
|
59482
59536
|
|
|
59483
59537
|
//trading view样式
|
|
59484
59538
|
{ Name:"Note", ClassName:"ChartDrawNote", Create:function() { return new ChartDrawNote(); } },
|
|
@@ -64334,6 +64388,221 @@ function ChartDrawCrosshair()
|
|
|
64334
64388
|
}
|
|
64335
64389
|
}
|
|
64336
64390
|
|
|
64391
|
+
//画图工具-监测线
|
|
64392
|
+
function ChartDrawMonitorLine()
|
|
64393
|
+
{
|
|
64394
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
64395
|
+
this.newMethod();
|
|
64396
|
+
delete this.newMethod;
|
|
64397
|
+
|
|
64398
|
+
this.ClassName='ChartDrawMonitorLine';
|
|
64399
|
+
this.PointCount=1;
|
|
64400
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
64401
|
+
this.IsHScreen=false;
|
|
64402
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
64403
|
+
this.FormatLabelTextCallback=null;
|
|
64404
|
+
|
|
64405
|
+
this.LineColor='rgb(255,215,0)'
|
|
64406
|
+
this.LabelConfig=
|
|
64407
|
+
{
|
|
64408
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
64409
|
+
BGColor:"rgb(30,144,255)", YTextOffset:4,
|
|
64410
|
+
LineColor:"rgba(255,215,0,0.8)",
|
|
64411
|
+
LineDash:[3,5],
|
|
64412
|
+
}
|
|
64413
|
+
|
|
64414
|
+
this.SetOption=function(option)
|
|
64415
|
+
{
|
|
64416
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
64417
|
+
if (option.Label)
|
|
64418
|
+
{
|
|
64419
|
+
var item=option.Label;
|
|
64420
|
+
var dest=this.LabelConfig
|
|
64421
|
+
if (item.Font) dest.Font=item.Font;
|
|
64422
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
64423
|
+
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
64424
|
+
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
64425
|
+
if (IFrameSplitOperator.IsNumber(item.YTextOffset)) dest.YTextOffset=item.YTextOffset;
|
|
64426
|
+
}
|
|
64427
|
+
|
|
64428
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
64429
|
+
}
|
|
64430
|
+
|
|
64431
|
+
this.Draw=function()
|
|
64432
|
+
{
|
|
64433
|
+
this.LinePoint=[];
|
|
64434
|
+
if (this.IsFrameMinSize()) return;
|
|
64435
|
+
if (!this.IsShow) return;
|
|
64436
|
+
|
|
64437
|
+
if (!this.Frame || !this.Frame.Data) return;
|
|
64438
|
+
var data=this.Frame.Data;
|
|
64439
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.Data)) return;
|
|
64440
|
+
|
|
64441
|
+
if (this.Point.length!=1) return;
|
|
64442
|
+
if (this.Value.length!=1) return;
|
|
64443
|
+
this.IsHScreen=this.Frame.IsHScreen;
|
|
64444
|
+
if (this.IsHScreen) return;
|
|
64445
|
+
|
|
64446
|
+
if (this.Status==20) this.DrawMoveLine();
|
|
64447
|
+
else if (this.Status==10) this.DrawMonitorLine(data);
|
|
64448
|
+
}
|
|
64449
|
+
|
|
64450
|
+
this.DrawMoveLine=function()
|
|
64451
|
+
{
|
|
64452
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
64453
|
+
var pt=this.Point[0];
|
|
64454
|
+
var x=ToFixedPoint(pt.X);
|
|
64455
|
+
this.ClipFrame();
|
|
64456
|
+
|
|
64457
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64458
|
+
this.Canvas.beginPath();
|
|
64459
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64460
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64461
|
+
this.Canvas.stroke();
|
|
64462
|
+
|
|
64463
|
+
this.Canvas.restore();
|
|
64464
|
+
}
|
|
64465
|
+
|
|
64466
|
+
this.DrawMonitorLine=function(data)
|
|
64467
|
+
{
|
|
64468
|
+
var isMinute=this.Frame.IsMinuteFrame();
|
|
64469
|
+
var dataWidth=this.Frame.DataWidth;
|
|
64470
|
+
var distanceWidth=this.Frame.DistanceWidth;
|
|
64471
|
+
var xPointCount=this.Frame.XPointCount;
|
|
64472
|
+
|
|
64473
|
+
if (this.IsHScreen)
|
|
64474
|
+
{
|
|
64475
|
+
//var border=this.Frame.ChartBorder.GetHScreenBorder();
|
|
64476
|
+
//var chartright=border.BottomEx;
|
|
64477
|
+
//var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
64478
|
+
}
|
|
64479
|
+
else
|
|
64480
|
+
{
|
|
64481
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
64482
|
+
var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
64483
|
+
var chartright=border.RightEx;
|
|
64484
|
+
}
|
|
64485
|
+
|
|
64486
|
+
var ptData=this.Value[0];
|
|
64487
|
+
this.ClipFrame();
|
|
64488
|
+
|
|
64489
|
+
var labelInfo=null;
|
|
64490
|
+
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
64491
|
+
{
|
|
64492
|
+
var item=data.Data[i];
|
|
64493
|
+
|
|
64494
|
+
if (isMinute)
|
|
64495
|
+
{
|
|
64496
|
+
var x=this.Frame.GetXFromIndex(j);
|
|
64497
|
+
}
|
|
64498
|
+
else
|
|
64499
|
+
{
|
|
64500
|
+
var left=xOffset;
|
|
64501
|
+
var right=xOffset+dataWidth;
|
|
64502
|
+
if (right>chartright) break;
|
|
64503
|
+
var x=left+(right-left)/2;
|
|
64504
|
+
}
|
|
64505
|
+
|
|
64506
|
+
if (i==ptData.XValue) //起始
|
|
64507
|
+
{
|
|
64508
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64509
|
+
this.Canvas.beginPath();
|
|
64510
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64511
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64512
|
+
this.Canvas.stroke();
|
|
64513
|
+
|
|
64514
|
+
var line={Start:{X:x, Y:border.TopEx}, End:{X:x, Y:border.BottomEx}};
|
|
64515
|
+
this.LinePoint.push(line);
|
|
64516
|
+
}
|
|
64517
|
+
else if (i==data.Data.length-1) //结束
|
|
64518
|
+
{
|
|
64519
|
+
if (this.LabelConfig.LineDash) this.Canvas.setLineDash(this.LabelConfig.LineDash);
|
|
64520
|
+
this.Canvas.strokeStyle=this.LabelConfig.LineColor;
|
|
64521
|
+
this.Canvas.beginPath();
|
|
64522
|
+
this.Canvas.moveTo(x,border.TopEx);
|
|
64523
|
+
this.Canvas.lineTo(x,border.BottomEx);
|
|
64524
|
+
this.Canvas.stroke();
|
|
64525
|
+
if (this.LabelConfig.LineDash) this.Canvas.setLineDash([]);
|
|
64526
|
+
|
|
64527
|
+
labelInfo={ Left:right, Data:data, StartIndex:ptData.XValue, AryText:[] };
|
|
64528
|
+
}
|
|
64529
|
+
}
|
|
64530
|
+
|
|
64531
|
+
this.Canvas.restore();
|
|
64532
|
+
|
|
64533
|
+
if (labelInfo) this.DrawLabel(labelInfo);
|
|
64534
|
+
}
|
|
64535
|
+
|
|
64536
|
+
this.DrawLabel=function(labelInfo)
|
|
64537
|
+
{
|
|
64538
|
+
if (!this.FormatLabelTextCallback) return;
|
|
64539
|
+
this.FormatLabelTextCallback(labelInfo);
|
|
64540
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
64541
|
+
if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
|
|
64542
|
+
|
|
64543
|
+
/*
|
|
64544
|
+
labelInfo.YValue=7.15;
|
|
64545
|
+
labelInfo.AryText=
|
|
64546
|
+
[
|
|
64547
|
+
{ Name:"标题1:", Text:"6666", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64548
|
+
{ Name:"标题2:", Text:"08.00", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64549
|
+
{ Name:"标题3:", Text:"999.1", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" },
|
|
64550
|
+
{ Name:"标题4:", Text:"320" , NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)"},
|
|
64551
|
+
{ Name:"标题5:", Text:"77775.77", NameColor:"rgb(255,255,255)", TextColor:"rgb(30,10,30)" }
|
|
64552
|
+
]
|
|
64553
|
+
*/
|
|
64554
|
+
|
|
64555
|
+
var y=this.Frame.GetYFromData(labelInfo.YValue,false);
|
|
64556
|
+
this.Canvas.font=this.LabelConfig.Font;
|
|
64557
|
+
this.Canvas.textAlign="left";
|
|
64558
|
+
this.Canvas.textBaseline="top";
|
|
64559
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
64560
|
+
var maxWidth=0, lineCount=0;
|
|
64561
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64562
|
+
{
|
|
64563
|
+
var item=labelInfo.AryText[i];
|
|
64564
|
+
item.NameWidth=0;
|
|
64565
|
+
item.TextWidth=0;
|
|
64566
|
+
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
64567
|
+
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
64568
|
+
|
|
64569
|
+
var itemWidth=item.NameWidth+item.TextWidth;
|
|
64570
|
+
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
64571
|
+
++lineCount;
|
|
64572
|
+
}
|
|
64573
|
+
|
|
64574
|
+
var rtBG={ Left:labelInfo.Left+1, Top:y, Width:maxWidth+4, Height:lineHeight*lineCount+4 };
|
|
64575
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64576
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
64577
|
+
if (this.LabelConfig.BGColor)
|
|
64578
|
+
{
|
|
64579
|
+
this.Canvas.fillStyle=this.LabelConfig.BGColor
|
|
64580
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
64581
|
+
}
|
|
64582
|
+
|
|
64583
|
+
var xText=rtBG.Left+2;
|
|
64584
|
+
var yText=rtBG.Top+this.LabelConfig.YTextOffset;
|
|
64585
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64586
|
+
{
|
|
64587
|
+
var item=labelInfo.AryText[i];
|
|
64588
|
+
|
|
64589
|
+
if (item.Name)
|
|
64590
|
+
{
|
|
64591
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
64592
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
64593
|
+
}
|
|
64594
|
+
|
|
64595
|
+
if (item.Text)
|
|
64596
|
+
{
|
|
64597
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
64598
|
+
this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
|
|
64599
|
+
}
|
|
64600
|
+
|
|
64601
|
+
yText+=lineHeight;
|
|
64602
|
+
}
|
|
64603
|
+
}
|
|
64604
|
+
}
|
|
64605
|
+
|
|
64337
64606
|
//画图工具-波浪尺
|
|
64338
64607
|
function ChartDrawWaveRuler()
|
|
64339
64608
|
{
|
|
@@ -111526,6 +111795,7 @@ JSSymbolData.prototype.JsonDataToFinance=function(data)
|
|
|
111526
111795
|
|
|
111527
111796
|
var JS_EXECUTE_DEBUG_LOG=false;
|
|
111528
111797
|
|
|
111798
|
+
|
|
111529
111799
|
var JS_EXECUTE_JOB_ID=
|
|
111530
111800
|
{
|
|
111531
111801
|
JOB_DOWNLOAD_SYMBOL_DATA:1, //下载股票的K线数据
|
|
@@ -113653,9 +113923,10 @@ function JSExplainer(ast,option)
|
|
|
113653
113923
|
if (!this.AST) this.ThrowError();
|
|
113654
113924
|
if (!this.AST.Body) this.ThrowError();
|
|
113655
113925
|
|
|
113656
|
-
for(
|
|
113926
|
+
for(var i=0; i<this.AST.Body.length; ++i)
|
|
113657
113927
|
{
|
|
113658
|
-
|
|
113928
|
+
//console.log(`[JSExplainer::RunAST] ${i}`);
|
|
113929
|
+
var item =this.AST.Body[i];
|
|
113659
113930
|
this.VisitNode(item);
|
|
113660
113931
|
|
|
113661
113932
|
//输出变量
|
|
@@ -113778,7 +114049,7 @@ function JSExplainer(ast,option)
|
|
|
113778
114049
|
{
|
|
113779
114050
|
varName=itemExpression.Left.Name;
|
|
113780
114051
|
let varValue=this.VarTable.get(varName);
|
|
113781
|
-
this.VarTable.set(varName,varValue); //把常量放到变量表里
|
|
114052
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //把常量放到变量表里
|
|
113782
114053
|
}
|
|
113783
114054
|
else if (itemExpression.Type==Syntax.Identifier)
|
|
113784
114055
|
{
|
|
@@ -113816,7 +114087,7 @@ function JSExplainer(ast,option)
|
|
|
113816
114087
|
let varValue=this.ReadVariable(varName,itemExpression);
|
|
113817
114088
|
varName="__temp_si_"+i+"__";
|
|
113818
114089
|
isNoneName=true;
|
|
113819
|
-
this.VarTable.set(varName,varValue); //放到变量表里
|
|
114090
|
+
this.VarTable.set(varName,this.ConvertToShortValue(varValue)); //放到变量表里
|
|
113820
114091
|
}
|
|
113821
114092
|
}
|
|
113822
114093
|
else if(itemExpression.Type==Syntax.Literal) //常量
|
|
@@ -114021,7 +114292,7 @@ function JSExplainer(ast,option)
|
|
|
114021
114292
|
return node.Out;
|
|
114022
114293
|
}
|
|
114023
114294
|
|
|
114024
|
-
JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114295
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
114025
114296
|
|
|
114026
114297
|
if (g_JSComplierResource.IsCustomFunction(funcName))
|
|
114027
114298
|
{
|
|
@@ -114048,6 +114319,8 @@ function JSExplainer(ast,option)
|
|
|
114048
114319
|
["BARSLASTCOUNT", { Name:"BARSLASTCOUNT", Param:{ Count:1 }, ToString:function(args) { return `条件${args[0]}连续成立次数`; } } ],
|
|
114049
114320
|
["BARSCOUNT", { Name:"BARSCOUNT", Param:{ Count:1 }, ToString:function(args) { return `${args[0]}有效数据周期数`; } } ],
|
|
114050
114321
|
["BARSLAST", { Name:"BARSLAST", Param:{ Count:1 }, ToString:function(args) { return `上次${args[0]}不为0距今天数`; } } ],
|
|
114322
|
+
["BARSLASTS", { Name:"BARSLASTS", Param:{ Count:2 }, ToString:function(args) { return `倒数第N次成立时距今的周期数`; } } ],
|
|
114323
|
+
|
|
114051
114324
|
["BARSNEXT", { Name:"BARSNEXT", Param:{ Count:1 }, ToString:function(args) { return `下次${args[0]}不为0距今天数`; } } ],
|
|
114052
114325
|
["BARSSINCEN", { Name:"BARSSINCEN", Param:{ Count:2 }, ToString:function(args) { return `在${args[1]}周期内首次${args[0]}距今天数`; } } ],
|
|
114053
114326
|
["BARSSINCE", { Name:"BARSSINCE", Param:{ Count:1 }, ToString:function(args) { return `首次${args[0]}距今天数`; } } ],
|
|
@@ -114215,7 +114488,7 @@ function JSExplainer(ast,option)
|
|
|
114215
114488
|
if (item.Param.Count!=args.length)
|
|
114216
114489
|
this.ThrowUnexpectedNode(node,`函数${funcName}参数个数不正确. 需要${item.Param.Count}个参数`);
|
|
114217
114490
|
}
|
|
114218
|
-
|
|
114491
|
+
|
|
114219
114492
|
return item.ToString(args);
|
|
114220
114493
|
}
|
|
114221
114494
|
|
|
@@ -114492,8 +114765,22 @@ function JSExplainer(ast,option)
|
|
|
114492
114765
|
else if (right.Type==Syntax.UnaryExpression)
|
|
114493
114766
|
value=this.VisitUnaryExpression(right);
|
|
114494
114767
|
|
|
114495
|
-
JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
114496
|
-
|
|
114768
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitAssignmentExpression]' , varName, ' = ',value);
|
|
114769
|
+
|
|
114770
|
+
this.VarTable.set(varName,this.ConvertToShortValue(value));
|
|
114771
|
+
}
|
|
114772
|
+
|
|
114773
|
+
this.ConvertToShortValue=function(value)
|
|
114774
|
+
{
|
|
114775
|
+
var maxLength=80;
|
|
114776
|
+
if (value && value.length>=maxLength)
|
|
114777
|
+
{
|
|
114778
|
+
var shortValue=value.slice(0, maxLength-10);
|
|
114779
|
+
shortValue+="......";
|
|
114780
|
+
return shortValue;
|
|
114781
|
+
}
|
|
114782
|
+
|
|
114783
|
+
return value;
|
|
114497
114784
|
}
|
|
114498
114785
|
|
|
114499
114786
|
this.ReadMemberVariable=function(node)
|
|
@@ -114553,7 +114840,7 @@ function JSExplainer(ast,option)
|
|
|
114553
114840
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114554
114841
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114555
114842
|
|
|
114556
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114843
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value , leftValue, rightValue);
|
|
114557
114844
|
value.Out=null; //保存中间值
|
|
114558
114845
|
|
|
114559
114846
|
value.Out=`(${leftValue} ${value.Operator} ${rightValue})`;
|
|
@@ -114570,14 +114857,14 @@ function JSExplainer(ast,option)
|
|
|
114570
114857
|
else if (value.Operator=="=") value.Out='(平盘)';
|
|
114571
114858
|
}
|
|
114572
114859
|
|
|
114573
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114860
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] BinaryExpression',value);
|
|
114574
114861
|
}
|
|
114575
114862
|
else if (value.Type==Syntax.LogicalExpression)
|
|
114576
114863
|
{
|
|
114577
114864
|
let leftValue=this.GetNodeValue(value.Left);
|
|
114578
114865
|
let rightValue=this.GetNodeValue(value.Right);
|
|
114579
114866
|
|
|
114580
|
-
JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114867
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExecute::VisitBinaryExpression] LogicalExpression',value , leftValue, rightValue);
|
|
114581
114868
|
value.Out=null; //保存中间值
|
|
114582
114869
|
|
|
114583
114870
|
switch(value.Operator)
|
|
@@ -114592,7 +114879,7 @@ function JSExplainer(ast,option)
|
|
|
114592
114879
|
break;
|
|
114593
114880
|
}
|
|
114594
114881
|
|
|
114595
|
-
JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114882
|
+
if (JS_EXECUTE_DEBUG_LOG) JSConsole.Complier.Log('[JSExplainer::VisitBinaryExpression] LogicalExpression',value);
|
|
114596
114883
|
}
|
|
114597
114884
|
|
|
114598
114885
|
node=temp;
|
|
@@ -132517,7 +132804,7 @@ function ScrollBarBGChart()
|
|
|
132517
132804
|
|
|
132518
132805
|
|
|
132519
132806
|
|
|
132520
|
-
var HQCHART_VERSION="1.1.
|
|
132807
|
+
var HQCHART_VERSION="1.1.13317";
|
|
132521
132808
|
|
|
132522
132809
|
function PrintHQChartVersion()
|
|
132523
132810
|
{
|