function TrajectoryModel(trajectoryView, streamUtilities) { var mStreamUtilities = streamUtilities; var mChanges = new Array(); var mStreamNodes= trajectoryView.streamNodes; var mStreamNodeHash = new Array(); function loadStreamNodeHash() { for( var i = 0; i < mStreamNodes.length; i++ ) { if( mStreamNodes[i] ) mStreamNodeHash[mStreamNodes[i].stream.mStream] = mStreamNodes[i]; } } loadStreamNodeHash(); this.Load = function(depot) { loadChangeTrajectoryData(depot); } function loadChangeTrajectoryData(depot) { $( "#progressbar" ).show(); $( "#progressbar" ).progressbar({ value: 0 }); mStreamUtilities.getDepotChanges(depot, changeTrajectoryDataCallback); mStreamUtilities.getDepotIntegrated(depot, integratedDataCallback); } function integratedDataCallback() { var integratedHistory = arguments[0]; var changeOriginationHash = new Object(); for (var i = 0; i < integratedHistory.size; i++) { var integrationDataPoint = integratedHistory.data[i]; var change = integrationDataPoint['change']; if( integrationDataPoint['error'] || integrationDataPoint['how'] == 'ignored' || integrationDataPoint['how'] == 'ignored by') continue;//ignore the ignores if( !changeOriginationHash[change]) changeOriginationHash[change] = new Array(); var stream; var tokens = integrationDataPoint['how']; tokens = tokens.split(' '); if( tokens.length > 1 ) { if( tokens[1] == 'into' ) stream = mStreamUtilities.streamFromDepotPath( integrationDataPoint['toFile'] ); else if( tokens[1] = 'from' ) stream = mStreamUtilities.streamFromDepotPath( integrationDataPoint['fromFile'] ); var containsStream = false; for(var streamCount = 0; streamCount < changeOriginationHash[change].length; streamCount++ ) { if( changeOriginationHash[change][streamCount] == stream ) { containsStream = true; break; } } if( !containsStream ) changeOriginationHash[change].push(stream); } } trajectoryView.setChangeOriginationData( changeOriginationHash ); //console.log('done processing integrated data'); } function changeTrajectoryDataCallback() { var changes = arguments[0]; mChanges.length = 0; //populate the table for (var i = 0; i < changes.size; i++) { var changelist = changes.data[i]; mStreamUtilities.groomChangelist(changelist); if( changelist.Status == 'submitted' ) { changelist.stream = mStreamUtilities.streamFromDepotPath(changelist.path) mChanges.push(changelist); } } loadChangeHistory(mChanges); trajectoryView.loadTable(mChanges); //console.log('done with changeDataCallback'); } var mChangeHistoryCounter = 0; var mProgressBarIncrement = 1; var mProgressBarValue = 0; function loadChangeHistory(changes) { mChangeHistoryCounter = 0; mProgressBarIncrement = mChanges.length / 100; for(var i = 0; i < changes.length; i++) { var changeList = changes[i]; mStreamUtilities.groomChangelist(changeList); var f = function(val) { return function(obj) { changeHistoryCallback(val,obj); } }; changeList.history = new Array(); mStreamUtilities.getChangeHistory(changeList.Change, f(changeList)); } } function changeHistoryCallback(changeList, history) { mChangeHistoryCounter++; mProgressBarValue += mProgressBarIncrement; $( "#progressbar" ).progressbar({ value: mProgressBarValue }); var changeHistory= history; var buf = ' '; for (var i = 0; i < changeHistory.size; i++) { var change = changeHistory.data[i]; mStreamUtilities.groomChangelist(change); //change.Change = parseInt(change.Change); change.stream = mStreamUtilities.streamFromDepotPath(change.path); changeList.history.push(change); buf += ' ' + change.Change; } //console.log('parent cl: ' + changeList.Change + '; history changelists: ' + buf); if( mChangeHistoryCounter == mChanges.length ) { $( "#progressbar" ).progressbar({ value: 0 }); $( "#progressbar" ).hide(); //console.log('finished changeHistoryCallback'); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 8124 | David George |
Updated some of the calls to ClientKit to sync up with it's refactoring. Commented out the diagnostic time-tracking stuff in TrajectoryModel. Refactored TrajectoryView so that it once again has a asynchronous progress bar. |
||
#5 | 8116 | David George | Interim checkin so Jaimen can test against ClientKit. | ||
#4 | 8110 | David George | This is a fairly unstable checkin that is a first attempt at getting the StreamGraph to work with the refactored ClientKit. | ||
#3 | 8090 | David George |
More optimization of the changelist trajectory dialog. Updated the third-party flexigrid. Updated jquery. Added timeTracker, a temporary object that'll assist me in tracking time for optimization purposes. |
||
#2 | 8084 | David George |
Began work on optimizing the changelist trajectory algorithm. By using lazy loading, it's now about 4x faster. Refactored TrajectoryView and TrajectoryModel so that the model doesn't know about the view (I know, should never have known about it in the first place. I figured out how to create a Listener pattern in JavaScript so that I could do this a little more elegantly). |
||
#1 | 8081 | David George |
Initial submit of JavaScript StreamGraph. Main functionality is: Change Trajectory (Change Flow), Timeline, and GitStreams. |