Commit 7b2f009c authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

разнес функции по отдельным файлам

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47577 954022d7-b5bf-4e40-9824-e11837661b57
parent 772acfe0
......@@ -53,6 +53,17 @@ SET SRC_TABLE_EGINE=^
"%TABLE_ENGINE%\graphics\pdfprinter.js" ^
"%TABLE_ENGINE%\model\CollaborativeEditing.js" ^
"%TABLE_ENGINE%\model\parserFormula.js" ^
"%TABLE_ENGINE%\model\dateandtimeFunctions.js" ^
"%TABLE_ENGINE%\model\engineeringFunctions.js" ^
"%TABLE_ENGINE%\model\cubeFunctions.js" ^
"%TABLE_ENGINE%\model\databaseFunctions.js" ^
"%TABLE_ENGINE%\model\textanddataFunctions.js" ^
"%TABLE_ENGINE%\model\statisticalFunctions.js" ^
"%TABLE_ENGINE%\model\financialFunctions.js" ^
"%TABLE_ENGINE%\model\mathematicFunctions.js" ^
"%TABLE_ENGINE%\model\lookupandreferenceFunctions.js" ^
"%TABLE_ENGINE%\model\informationFunctions.js" ^
"%TABLE_ENGINE%\model\logicalFunctions.js" ^
"%TABLE_ENGINE%\model\DrawingObjects.js" ^
"%TABLE_ENGINE%\model\NumFormat.js" ^
"%TABLE_ENGINE%\model\Serialize.js" ^
......
......@@ -41,6 +41,17 @@
<script type="text/javascript" src="../model/CollaborativeEditing.js"></script>
<script type="text/javascript" src="../model/parserFormula.js"></script>
<script type="text/javascript" src="../model/dateandtimeFunctions.js"></script>
<script type="text/javascript" src="../model/engineeringFunctions.js"></script>
<script type="text/javascript" src="../model/cubeFunctions.js"></script>
<script type="text/javascript" src="../model/databaseFunctions.js"></script>
<script type="text/javascript" src="../model/textanddataFunctions.js"></script>
<script type="text/javascript" src="../model/statisticalFunctions.js"></script>
<script type="text/javascript" src="../model/financialFunctions.js"></script>
<script type="text/javascript" src="../model/mathematicFunctions.js"></script>
<script type="text/javascript" src="../model/lookupandreferenceFunctions.js"></script>
<script type="text/javascript" src="../model/informationFunctions.js"></script>
<script type="text/javascript" src="../model/logicalFunctions.js"></script>
<script type="text/javascript" src="../model/CellComment.js"></script>
<script type="text/javascript" src="../../Common/NumFormat.js"></script>
<script type="text/javascript" src="../model/Serialize.js"></script>
......@@ -105,8 +116,21 @@
<script src="../../Common/Charts/libraries/hsv.js"></script>
<script src="../../Common/Charts/libraries/rgbcolor.js"></script>
<script type="text/javascript" src="FormulaTests.js"></script>
<!--for shapes-->
<script src="../../Word/Drawing/Graphics.js"></script>
<script src="../model/DrawingObjects/DrawingObjectsController.js"></script>
<script src="../model/DrawingObjects/States.js"></script>
<script src="../model/DrawingObjects/Format/GroupShape.js"></script>
<script src="../model/DrawingObjects/Format/Image.js"></script>
<script src="../model/DrawingObjects/Format/Shape.js"></script>
<script src="../model/DrawingObjects/Tracks/ResizeTracks.js"></script>
<script src="../model/DrawingObjects/Tracks/RotateTracks.js"></script>
<script src="../model/DrawingObjects/Tracks/NewShapeTracks.js"></script>
<script src="../model/DrawingObjects/Hit.js"></script>
<script type="text/javascript" src="FormulaTests.js"></script>
</head>
<body>
<h1 id="qunit-header">Parser Formulas tests</h1>
......
......@@ -936,4 +936,103 @@
})
test("Test: \"TIMEVALUE\"",function(){
oParser = new parserFormula("timevalue(\"10:02:34\")","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 0.4184490740740740) < dif );
oParser = new parserFormula("timevalue(\"02-01-2006 10:15:29 AM\")","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 0.4274189814823330) < dif );
oParser = new parserFormula("timevalue(\"22:02\")","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 0.9180555555555560) < dif );
})
test("Test: \"WEEKNUM\"",function(){
/* oParser = new parserFormula("WEEKNUM(DATE(2006,1,1))","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 1) < dif );
oParser = new parserFormula("WEEKNUM(DATE(2006,1,1),17)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 1) < dif );
oParser = new parserFormula("WEEKNUM(DATE(2006,1,1),1)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 1) < dif );
oParser = new parserFormula("WEEKNUM(DATE(2006,1,1),21)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 52) < dif );
oParser = new parserFormula("WEEKNUM(DATE(2006,2,1),1)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 5) < dif );//10
oParser = new parserFormula("WEEKNUM(DATE(2006,2,1),2)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 6) < dif );//12
oParser = new parserFormula("WEEKNUM(DATE(2006,2,1),11)","A2",ws);
ok(oParser.parse());
ok( Math.abs(oParser.calculate().getValue() - 6) < dif );//14*/
oParser = new parserFormula("WEEKNUM(DATE(2007,1,1),15)","A2",ws);//понед
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,1),15)","A2",ws);//втор
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2003,1,1),15)","A2",ws);//сред
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2009,1,1),15)","A2",ws);//чет
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2010,1,1),15)","A2",ws);//пят
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2011,1,1),15)","A2",ws);//суб
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2012,1,1),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 1);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,4),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,10),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 2);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,11),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 3);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,17),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 3);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,18),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 4);
oParser = new parserFormula("WEEKNUM(DATE(2008,1,24),15)","A2",ws);//вск
ok(oParser.parse());
strictEqual( oParser.calculate().getValue(), 4);
})
});
......@@ -66,6 +66,17 @@
<script type="text/javascript" src="model/CollaborativeEditing.js"></script>
<script type="text/javascript" src="model/ConditionalFormatting.js"></script>
<script type="text/javascript" src="model/parserFormula.js"></script>
<script type="text/javascript" src="model/dateandtimeFunctions.js"></script>
<script type="text/javascript" src="model/engineeringFunctions.js"></script>
<script type="text/javascript" src="model/cubeFunctions.js"></script>
<script type="text/javascript" src="model/databaseFunctions.js"></script>
<script type="text/javascript" src="model/textanddataFunctions.js"></script>
<script type="text/javascript" src="model/statisticalFunctions.js"></script>
<script type="text/javascript" src="model/financialFunctions.js"></script>
<script type="text/javascript" src="model/mathematicFunctions.js"></script>
<script type="text/javascript" src="model/lookupandreferenceFunctions.js"></script>
<script type="text/javascript" src="model/informationFunctions.js"></script>
<script type="text/javascript" src="model/logicalFunctions.js"></script>
<script type="text/javascript" src="model/CellComment.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="model/Serialize.js"></script>
......
/**
* Created with JetBrains WebStorm.
* User: Dmitry.Shahtanov
* Date: 27.06.13
* Time: 15:15
* To change this template use File | Settings | File Templates.
*/
cFormulaFunction.Cube = {
'groupName' : "Cube",
'CUBEKPIMEMBER' : function(){
var r = new cBaseFunction("CUBEKPIMEMBER");
return r;
},
'CUBEMEMBER' : function(){
var r = new cBaseFunction("CUBEMEMBER");
return r;
},
'CUBEMEMBERPROPERTY' : function(){
var r = new cBaseFunction("CUBEMEMBERPROPERTY");
return r;
},
'CUBERANKEDMEMBER' : function(){
var r = new cBaseFunction("CUBERANKEDMEMBER");
return r;
},
'CUBESET' : function(){
var r = new cBaseFunction("CUBESET");
return r;
},
'CUBESETCOUNT' : function(){
var r = new cBaseFunction("CUBESETCOUNT");
return r;
},
'CUBEVALUE' : function(){
var r = new cBaseFunction("CUBEVALUE");
return r;
}
}
\ No newline at end of file
/**
* Created with JetBrains WebStorm.
* User: Dmitry.Shahtanov
* Date: 27.06.13
* Time: 15:16
* To change this template use File | Settings | File Templates.
*/
cFormulaFunction.Database = {
'groupName' : "Database",
'DAVERAGE' : function(){
var r = new cBaseFunction("DAVERAGE");
return r;
},
'DCOUNT' : function(){
var r = new cBaseFunction("DCOUNT");
return r;
},
'DCOUNTA' : function(){
var r = new cBaseFunction("DCOUNTA");
return r;
},
'DGET' : function(){
var r = new cBaseFunction("DGET");
return r;
},
'DMAX' : function(){
var r = new cBaseFunction("DMAX");
return r;
},
'DMIN' : function(){
var r = new cBaseFunction("DMIN");
return r;
},
'DPRODUCT' : function(){
var r = new cBaseFunction("DPRODUCT");
return r;
},
'DSTDEV' : function(){
var r = new cBaseFunction("DSTDEV");
return r;
},
'DSTDEVP' : function(){
var r = new cBaseFunction("DSTDEVP");
return r;
},
'DSUM' : function(){
var r = new cBaseFunction("DSUM");
return r;
},
'DVAR' : function(){
var r = new cBaseFunction("DVAR");
return r;
},
'DVARP' : function(){
var r = new cBaseFunction("DVARP");
return r;
}
}
This diff is collapsed.
/**
* Created with JetBrains WebStorm.
* User: Dmitry.Shahtanov
* Date: 27.06.13
* Time: 12:25
* To change this template use File | Settings | File Templates.
*/
cFormulaFunction.Engineering = {
'groupName':"Engineering",
'BESSELI':function () {
var r = new cBaseFunction( "BESSELI" );
return r;
},
'BESSELJ':function () {
var r = new cBaseFunction( "BESSELJ" );
return r;
},
'BESSELK':function () {
var r = new cBaseFunction( "BESSELK" );
return r;
},
'BESSELY':function () {
var r = new cBaseFunction( "BESSELY" );
return r;
},
'BIN2DEC':function () {
var r = new cBaseFunction( "BIN2DEC" );
return r;
},
'BIN2HEX':function () {
var r = new cBaseFunction( "BIN2HEX" );
return r;
},
'BIN2OCT':function () {
var r = new cBaseFunction( "BIN2OCT" );
return r;
},
'COMPLEX':function () {
var r = new cBaseFunction( "COMPLEX" );
return r;
},
'CONVERT':function () {
var r = new cBaseFunction( "CONVERT" );
return r;
},
'DEC2BIN':function () {
var r = new cBaseFunction( "DEC2BIN" );
return r;
},
'DEC2HEX':function () {
var r = new cBaseFunction( "DEC2HEX" );
return r;
},
'DEC2OCT':function () {
var r = new cBaseFunction( "DEC2OCT" );
return r;
},
'DELTA':function () {
var r = new cBaseFunction( "DELTA" );
return r;
},
'ERF':function () {
var r = new cBaseFunction( "ERF" );
return r;
},
'ERFC':function () {
var r = new cBaseFunction( "ERFC" );
return r;
},
'GESTEP':function () {
var r = new cBaseFunction( "GESTEP" );
return r;
},
'HEX2BIN':function () {
var r = new cBaseFunction( "HEX2BIN" );
return r;
},
'HEX2DEC':function () {
var r = new cBaseFunction( "HEX2DEC" );
return r;
},
'HEX2OCT':function () {
var r = new cBaseFunction( "HEX2OCT" );
return r;
},
'IMABS':function () {
var r = new cBaseFunction( "IMABS" );
return r;
},
'IMAGINARY':function () {
var r = new cBaseFunction( "IMAGINARY" );
return r;
},
'IMARGUMENT':function () {
var r = new cBaseFunction( "IMARGUMENT" );
return r;
},
'IMCONJUGATE':function () {
var r = new cBaseFunction( "IMCONJUGATE" );
return r;
},
'IMCOS':function () {
var r = new cBaseFunction( "IMCOS" );
return r;
},
'IMDIV':function () {
var r = new cBaseFunction( "IMDIV" );
return r;
},
'IMEXP':function () {
var r = new cBaseFunction( "IMEXP" );
return r;
},
'IMLN':function () {
var r = new cBaseFunction( "IMLN" );
return r;
},
'IMLOG10':function () {
var r = new cBaseFunction( "IMLOG10" );
return r;
},
'IMLOG2':function () {
var r = new cBaseFunction( "IMLOG2" );
return r;
},
'IMPOWER':function () {
var r = new cBaseFunction( "IMPOWER" );
return r;
},
'IMPRODUCT':function () {
var r = new cBaseFunction( "IMPRODUCT" );
return r;
},
'IMREAL':function () {
var r = new cBaseFunction( "IMREAL" );
return r;
},
'IMSIN':function () {
var r = new cBaseFunction( "IMSIN" );
return r;
},
'IMSQRT':function () {
var r = new cBaseFunction( "IMSQRT" );
return r;
},
'IMSUB':function () {
var r = new cBaseFunction( "IMSUB" );
return r;
},
'IMSUM':function () {
var r = new cBaseFunction( "IMSUM" );
return r;
},
'OCT2BIN':function () {
var r = new cBaseFunction( "OCT2BIN" );
return r;
},
'OCT2DEC':function () {
var r = new cBaseFunction( "OCT2DEC" );
return r;
},
'OCT2HEX':function () {
var r = new cBaseFunction( "OCT2HEX" );
return r;
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment