Phil 5.12.14

8:00 – 5:30 SR

  • 8:00 – 11:00 on site
  • DB backups
  • Deployed new RQ
  • Went over the time estimates with Lenny. The upshot is that we will track actual hours worked on the line items.
  • Fix the requisition_id AS funded_budget in __view_monthly_obligations_by_req_id error.
  • I think I may have found the issue that’s keeping the new object from setting the values that are actually used to draw?
    • It’s possible that the matrix is being reset after the update function, with the setPosition calls overriding the matrix.
    • This thread shows how to get position and orientation from the 4×4: http://stackoverflow.com/questions/15079294/inverse-of-object3d-updatematrix-in-three-js
    • Finally figured out the problem. I have the matrix that is in GLOBAL space. I need a matrix that is in local space that I can then multiply by the parent’s matrix. That should work. And it did! Need to verify that stacked objects will behave.
    • They do – after a fashion. The scale information is embedded in the matrix and is applies to all children. Somehow, this is messing with the scale if it is mixed with a rotation. Is it possible matrix.decompose is broken?
    • Well, kind of. From Euler.js setFromRotationMatrix(): // assumes the upper 3×3 of m is a pure rotation matrix (i.e, unscaled). So don’t scale on the transform matrix. Instead, scale the position of the points that make up the object in the local space. This means I may have to look at immediate mode or at least see how the geometry is stored in the object. Or only scale the objects that are the leaf nodes in a tree. That should actually be OK for charts.
  • Starting tooltips and text overlays: http://stackoverflow.com/questions/11586527/converting-world-coordinates-to-screen-coordinates-in-three-js-using-projection. Also example 6-3 from the webgl book (pg 115).
  • Got Hello, World rendered over the two canvases, styled and everything :-).

Dong Shin 05.09.2014

  • deployed new Reqonciler and the ingest works magically!
  • fixed post processing queries by removing Appropriations
  • pre-processing ignore is broken
    • added target table name column
      • ALTER TABLE `_reqonciler_processing` ADD `target_table_name` VARCHAR(50) NULL ;
      • set appropriate table names per query

Phil 5.9.14

7:30 – 5:00 SR

  • DB backups
  • Deploying new Reqonciler
  • Created svn-based stats on development for productivity discussions with Chris. Also generated stats for 2013 for review.
  • Look into picking and reflection map issues. I think the picking problem is that the search does not recurse down the sub-model branch, though the THREE model info is there (Also need to make sure that the model reference is added to user data and that it’s accessible). The reflection is hopefully tied to the recalculation of the reflection camera position that was commented out in the draw function while I was still chasing down the “too much recursion” error.
  • Nope, neither solution worked. I’m thinking that I can have parents/child relations based on just WebGLComponenets. Update sets the positions based on the parent’s model matrix, but the actual object3D hierarchy is flat. That should fix both problems.
    • WebGLCanvas.addModel will also set a WebGLCanvas reference attribute in the WebGLComponent. The component will then look to see if it has any children and also set their canvas if it’s not null. If the canvas is null, then the child will add its object3d to the canvas’ scene
    • Calling addModel on a WebGLComponent will cause the child to add its object3d to the canvas’ scene if the scene is not null.

Dong Shin 05.08.2014

  • found that the new obligations not are saved to budget_center_contracts table
    • post processing query that saves not working correctly?
    • tried to replicate it with test data, but no luck, need to compare the queries word by word
  • added Query Editor to Reqonciler so that editing can easily be done on the app

Phil 5.8.14

8:00 – 2:00 SR

  • DB backups
  • Walked through the outlay problem with Dong and Lenny
  • Worked out estimates for new VizTool requirements. It comes up to 500-1,000 hours of work.
  • Showed dong the new YUI architecture. The switch to direct function declaration seems to have had a good effect on how I expect closure to work, so I’m happy.
  • Adding hierarchical model capability to WebGLComponent. Nope, picking isn’t working in 2D. Need to fix that first. Ok, fixed.
  • Added hierarchy. There is some funny stuff that’s going on WRT data being shared across instances. Local variables (inside the  YUI.add({}) scope are definitely shared. I was expecting that. But it also appears that variables created in the Y.Base.create() scope are also shared. I ran into this problem when I was adding the models array to WebGLComponent. The way around it was to add to the ATTRS: {} object. That’s ok, but I’m still confused…
  • Also, picking and reflection maps don’t work on sub-objects.
  • Oh yeah, and for reference, this is the kind of charts I want to start trying to draw next week:

Phil 5.7.14

8:00 – 5:00 SR

  • DB Backups
  • Fix __view_monthly_obligations_by_contract so that requisition_id’s with different po_reference show up in “unclaimed”
  • Fix funded_budget to requisition id on two views.
  • Refactoring!
  • Change the this.set() functions (or at least the strings) to variables (i.e _ATTR_FOO = ‘foo’); possibly using a factory pattern? (from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures). Yep, that worked just fine.
function makeAdder(x) {
  return function(y) {
    return x + y;
  };
}

var add5 = makeAdder(5);
var add10 = makeAdder(10);

console.log(add5(2));  // 7
console.log(add10(2)); // 12
  • Try moving function declarations below prototype and removing predefinitions.
  • Add skybox argument
  • Everything is pretty much completely refactored. I think this is more clear and less error-prone. It looks exactly the same, but is remarkably different under the skin.
  • Next is hierarchical models.

Phil 5.6.14

9:00 – 5:00 SR

  • Db backups
  • Updated Java on the servers
  • Installed Dong’s new views. Lenny’s testing. There are some issues that he’s noting in an email. It appears that all the old data that were deleted are back, but none of the new data is visible.
  • Edit task list to provide hours.
  • More picking
    • Unitizing the mouse position worked
    • Changing userData to a pointer to the model and using the name field.
    • Done. That was not too bad!
  • Adding reflection maps
    • Added skybox to canvas
    • Added reflections. Going to try for a shiny textured earth tomorrow, then maybe some dragging?

yuiWebGl

Today’s progress.

Dong Shin 05.05.2014

  • ran the Java in command line with no problems, but still the same problem through Reqonciler…. ingested COGNOS data (FY13 and FY14) thru command line
  • pre-processing ran fine, but errors on post-processing. missing views
    • created views and sent it off to Bill/Phil for deployment tomorrow
    • instruction-  There are four views need to be updated/added to the database.
      1. Bring up a command line window and login to mysql database
      2. create views one at a time by copy and paste into mysql command prompt and ensure there is no errors
      3. Login into Reqonciler and run post processing, ensure there is no errors
      4. ask Lenny to verify Obligations/Outlays data!
  • off to Philadelphia!

Phil 5.5.14

8:00 – 10:00, 12:00-4:00 SR

  • DB backups
  • Major debugging deployment
  • 2D and 3D picking. Slow-ish going. The first ‘naive’ attempt didn’t work. Making the mouse x,y unit values that go from -1.0 – 1.0, which I think it the problem. Hit detect does work as expected for 0, 0 – which makes this seem reasonable.

Dong Shin 05.02.2014

  • having problems with new Reqonciler jar files…. The process would just stop right after reading prop files.
  • created a runnable jar files with necessary files
  • packaged up mostly everything from webapp directory for debugging/testing, more than 25MB (limit of gmail?). broke up and sent it off to Bill.

Phil 5.1.14

8:00 – 5:00 SR

  • DB backups
  • Deployed the rest of RQ
  • Status Report!
  • Some weird problem where Dong’s code is (possibly) throwing an exception while reading properties. Maybe put some command-line diagnostics in the main?
  • JavaScript
    • Show/hide stage – done
    • Ortho2 – done
    • Reflection maps
    • Simple physics
    • Model loading

yuiWebGl

Today’s fun

Phil 4.30.14

8:00 – 5:00 SR

  • DB backups
  • Deploy new RQ – or at least most of it…
  • Got the list of desired enhancements. Need to assign hours.
  • JavaScript
    • Threejs examples
    • Work on making a YUI module that extends WebGLComponent – Done!
    • Added three.js loading capability. Easy!
YUI({
        groups:{
            threejs:{
                base: './libs/',
                async: false,
                modules: {
                    'threejs': {
                        path: 'three.js'
                    }
                }
            },
            localModules:{
                base: './BasicBaseElements/',
                modules: {
                    'WebGLCanvas': {
                        path: 'WebGLCanvas/js/WebGLCanvas.js',
                        skinnable: true
                    },
                    'WebGLComponent': {
                        path: 'WebGLComponent/js/WebGLComponent.js',
                        skinnable: false
                    }
                }
            }
        }
    }).use('threejs', 'WebGLCanvas', 'WebGLComponent', 'panel', 'dd-plugin', function (Y) {...});
  • Ok, now to inheritance
  • To inherit in YUI, it looks like all you have to do(?) is to use Y.Base.create, and specify the component that you are extending. Here’s how it looks:
YUI.add('WebGLSphere', function (Y) {
    "use strict";

    // handy constants and shortcuts used in the module
    var _LANG = Y.Lang;
    var _NAME = 'WebGLSphere';



    // publish the global prototype
    Y.WebGLSphere = Y.Base.create(
        _NAME, // the name of this module (for debugging
        Y.WebGLComponent, // the class we are extending (can be Widget too)
        [], // any extensions that we want to properties or methods (e.g. ArrayList)

        // Instance members are the properties and methods that go into the class prototype, those that
        // each instance will get a copy and usually need to be references by 'this'
        {
            // prototype variables

            // prototype methods

        },
        //  Attributes - accessed through this.get('attrName') and this.set('attrName', value).
        // Note that we can do "type" checking here with validators
        {
            ATTRS: {
		myValue:{
			value: 1.0
		}
            }
        }
    );

}, '0.1', {
    requires: ['WebGLComponent'],
    skinnable: false
});

In this case, the module I’m creating is Y.WebGLSphere. I am extending it from Y.WebGLComponent. In the code above, it does nothing. Next, I’m going to override the initModel function to create a sphere and the initializer to take a jpg to use as a texture.

yuiWebGl

Dong Shin 04.29.2014

  • found the culprit that causes the haning/slow queries on obligations/outlays
    • tmp_view_financial_data created by trigger – update_tmp_view_financial_data, 03.21.2014 blog entry for details
    • removed it and update query runs quick!
  • had to manually convert Budget Center, Sub-Budget Center to string using Data->Text to Columns util in Excel

Phil 4.29.14

8:00 – 4:00 SR

  • DB Backups
  • Breaking out models from the scene. Figuring out what parts of THREE.js were needed to work took a bit of time but the results are good.
  • Had a lot of trouble with “this” today. The lesson learned is that when a locally declared function is called from outside the class, there is no “this”. To get that to work you have to have the function AND the variable referenced in the prototype. If the variable is a reference, then it appears that you can get away with declaring it locally, but what really seems to be happening is that the same reference is being shared “globally” across all instances. If the variable is declared in the prototype, it’s unique. Here’s all of WebGLComponent. Note that mesh and dprintArray are declared in the prototype:
YUI.add('WebGLComponent', function (Y) {
     "use strict";

     // handy constants and shortcuts used in the module
     var _LANG = Y.Lang;
     var _NAME = 'WebGLComponent';

     // private variables



     // private function predefinitions. We can "publish" them at the end of this object
     var _initializer;
     var _initModel;
     var _setPosition;
     var _setScale;
     var _update;
     var _dprint;
     var _dshow;

      // private function definitions

      /* The initializer method has several tasks. First, it should set any properties that need to be
      initialized to objects or arrays. Then it will publish all the events this class will produce.
      the cfg object is an arbitrary object such as {myValue:321, foo:'bar'} */
     _initializer = function (cfg) {
         //Y.log("--->The following config object was passed into the RemoteDataChart initializer.'"+cfg.myValue+"'");
          this.dprintArray = new Array(100);
          this.dprintArray.length = 0;
          if (cfg.hasOwnProperty('objName')) {
              this.set('objName', cfg.objName);
     }
     if (cfg.hasOwnProperty('timeScalar')) {
          this.set('timeScalar', cfg.timeScalar);
     }
     this.initModel();

     };


     _initModel = function () {
          var geometry = new THREE.CubeGeometry(1, 1, 1);
          var material = new THREE.MeshPhongMaterial({color: 0xFFFFFF});

          var mesh = new THREE.Mesh(geometry, material);

          this.set('object3d', mesh);
          this.mesh = mesh;
     };

     // setPosition - move the object to a new position
     _setPosition = function (x, y, z) {
          if (this.mesh) {
             this.mesh.position.set(x, y, z);
          }
     };

    //setScale - scale the object
     _setScale = function (x, y, z) {
     if (this.mesh) {
         this.mesh.scale.set(x, y, z);
     }
     };


 _update = function (elapsed) {
          var rate = this.get('timeScalar');
          var angle;
          if (this.mesh) {
              this.mesh.rotation.x += rate * elapsed;
              this.mesh.rotation.y += rate * elapsed;
              this.mesh.rotation.z += rate * elapsed;
              angle = this.mesh.rotation.x;
              this.dprint("angle = "+angle.toFixed(2));
          }
 };


 _dprint = function(str) {
          this.dprintArray.push(this.get('objName')+": "+str);
 };

 _dshow = function(dpa) {
          var i;
          for(i =0; i < this.dprintArray.length; i++){
              dpa.push(this.dprintArray.shift());
          }
          this.dprintArray.length = 0;
 };

 // publish the global prototype
 Y.WebGLComponent = Y.Base.create(
      _NAME, // the name of this module (for debugging
      Y.Base, // the class we are extending (can be Widget too)
      [], // any extensions that we want to properties or methods (e.g. ArrayList)

          // Instance members are the properties and methods that go into the class prototype, those that
          // each instance will get a copy and usually need to be references by 'this'
      {
         // prototype variables
          mesh: null,
          dprintArray: null,

          // prototype methods
          initializer: _initializer,
          initModel: _initModel,
          update: _update,
          setPosition: _setPosition,
          setScale: _setScale,
          dprint: _dprint,
          dshow: _dshow
 },
 // Attributes - accessed through this.get('attrName') and this.set('attrName', value).
 // Note that we can do "type" checking here with validators
 {
          ATTRS: {
              timeScalar:{
                  value: 1.0
              },
              objName:{
                  value: "unset"
              },
              object3d:{
                  value: null
              }
          }
     }
 );

}, '0.1', {
 requires: ['base-build', 'node', 'event'],
 skinnable: false
});