@@ -492,8 +492,8 @@ class LevelCompilerCore extends EventEmitter{
492492 const model_r = projectData . _model_data [ marker_r ] ;
493493 if ( model_r [ 1 ] !== "" ) {
494494 const duo_connected_hole = lcfnc . zeroPadding ( model_r [ 1 ] ) ;
495- const duo_connected_sec = lcfnc . zeroPadding ( model_r [ 2 ] ) ;
496- const duo_connected_dist = Math . round ( parseFloat ( model_r [ 3 ] ) * 10 ) / 10 ;
495+ const duo_connected_sec = lcfnc . zeroPadding ( model_r [ 2 ] ) ;
496+ const duo_connected_dist = lcfnc . round ( parseFloat ( model_r [ 3 ] ) , 1 ) ;
497497 this . projects [ projectIdx [ 0 ] ] . _duo_connection [ correlated_marker_id . toString ( ) ] = [
498498 duo_connected_hole ,
499499 duo_connected_sec ,
@@ -636,6 +636,7 @@ class LevelCompilerCore extends EventEmitter{
636636 //if old id, update to new id
637637 this . replaceNewId ( ) ;
638638
639+ this . updateSearchIdx ( ) ;
639640 }
640641 loadEventListFromCsv ( filepath ) {
641642 if ( this . projects . length == 0 ) return false ;
@@ -1428,21 +1429,27 @@ class LevelCompilerCore extends EventEmitter{
14281429 type :project . model_type ,
14291430 evaluation :false ,
14301431 is_connected_master : false ,
1432+ distance_confliction_counts :0 ,
1433+ distance_confliction :[ ] ,
1434+ distance_confliction_name :[ ] ,
14311435
14321436 cd_error_incompleted_counts :0 ,
14331437 cd_error_floating_counts :0 ,
14341438 cd_confliction_counts :0 ,
14351439 cd_confliction :[ ] ,
1440+ cd_confliction_name :[ ] ,
14361441
14371442 efd_error_incompleted_counts :0 ,
14381443 efd_error_floating_counts :0 ,
14391444 efd_confliction_counts :0 ,
14401445 efd_confliction :[ ] ,
1446+ efd_confliction_name :[ ] ,
14411447
14421448 rank_error_counts :0 ,
14431449 age_error_counts :0 ,
14441450 age_confliction_counts :0 ,
14451451 age_confliction :[ ] ,
1452+ age_confliction_name :[ ] ,
14461453
14471454 max_rank :- 1 ,
14481455 hole_counts : 0 ,
@@ -1467,10 +1474,31 @@ class LevelCompilerCore extends EventEmitter{
14671474 hole . sections . forEach ( ( section ) => {
14681475 //counts sections
14691476 result . section_counts += 1 ;
1470- section . markers . forEach ( ( marker ) => {
1477+ const epsilon = 1e-3 ;
1478+ let inDuplicateGroup = false ;
1479+ section . markers . forEach ( ( marker , index ) => {
14711480 //counts markers
14721481 result . marker_counts += 1 ;
14731482
1483+ if ( index > 0 ) {
1484+ const prevMarker = section . markers [ index - 1 ] ;
1485+
1486+ if ( Math . abs ( marker . distance - prevMarker . distance ) < epsilon ) {
1487+ if ( ! inDuplicateGroup ) {
1488+ result . distance_confliction_counts += 1 ;
1489+ inDuplicateGroup = true ;
1490+ }
1491+ result . distance_confliction_counts += 1 ;
1492+ result . distance_confliction . push ( marker . id ) ;
1493+ result . distance_confliction_name . push ( hole . name + "-" + section . name + "-" + marker . distance + "cm" ) ;
1494+
1495+ console . log ( "LCCore: Duplicate distances detected at: " + hole . name + "-" + section . name + "-" + marker . distance + "cm" )
1496+ } else {
1497+ inDuplicateGroup = false ;
1498+ }
1499+ }
1500+
1501+
14741502 if ( marker . composite_depth == null ) {
14751503 //counts CD error
14761504 if ( marker . depth_source [ 0 ] == "floating" ) {
@@ -1489,6 +1517,7 @@ class LevelCompilerCore extends EventEmitter{
14891517 result . cd_confliction_counts += 1 ;
14901518 if ( marker . composite_depth && connected_cd ) {
14911519 result . cd_confliction . push ( marker . composite_depth - connected_cd ) ;
1520+ result . cd_confliction_name . push ( hole . name + "-" + section . name + "-" + marker . distance + "cm" ) ;
14921521 }
14931522 }
14941523 }
@@ -1514,6 +1543,7 @@ class LevelCompilerCore extends EventEmitter{
15141543 result . efd_confliction_counts += 1 ;
15151544 if ( marker . event_free_depth && connected_efd ) {
15161545 result . efd_confliction . push ( marker . event_free_depth - connected_efd ) ;
1546+ result . efd_confliction_name . push ( hole . name + "-" + section . name + "-" + marker . distance + "cm" ) ;
15171547 }
15181548
15191549 }
@@ -1535,6 +1565,7 @@ class LevelCompilerCore extends EventEmitter{
15351565 result . age_confliction_counts += 1 ;
15361566 if ( ( marker . age && connected_age ) ) {
15371567 result . age_confliction . push ( marker . age - connected_age ) ;
1568+ result . age_confliction_name . push ( hole . name + "-" + section . name + "-" + marker . distance + "cm" ) ;
15381569 }
15391570
15401571 }
@@ -1756,6 +1787,7 @@ class LevelCompilerCore extends EventEmitter{
17561787 tempUpperIdx = [ p , h , s , m + 1 ] ;
17571788 }
17581789 }
1790+
17591791 if ( distance >= sectionData . markers [ m ] . distance && distance <= sectionData . markers [ m + 1 ] . distance ) {
17601792 tempUpperIdx = [ p , h , s , m ] ;
17611793 tempLowerIdx = [ p , h , s , m + 1 ] ;
@@ -1872,6 +1904,10 @@ class LevelCompilerCore extends EventEmitter{
18721904 //get section data
18731905 let sectionId = this . projects [ upperIdxs [ 0 ] [ 0 ] ] . holes [ upperIdxs [ 0 ] [ 1 ] ] . sections [ upperIdxs [ 0 ] [ 2 ] ] . id ;
18741906 const masterIdx = this . search_idx_list [ this . base_project_id . toString ( ) ] ;
1907+ if ( masterIdx ) {
1908+ } else {
1909+ console . log ( this . base_project_id , masterIdx )
1910+ }
18751911
18761912 //check duo connection
18771913 let isMasterExist = false ;
@@ -2440,11 +2476,11 @@ class LevelCompilerCore extends EventEmitter{
24402476 if ( event [ 0 ] == "erosion" ) {
24412477 event_border_drilling_depth = this . projects [ projectIdx [ 0 ] ] . holes [ h ] . sections [ s ] . markers [ m ] . drilling_depth ;
24422478 event_border_distance = event_start_distance ;
2443- event_border_distance_for_check = Math . round ( event_border_distance * 10 ) / 10 ;
2479+ event_border_distance_for_check = lcfnc . round ( event_border_distance , 1 ) ;
24442480 } else if ( event [ 0 ] == "deposition" || event [ 0 ] == "markup" ) {
24452481 event_border_drilling_depth = this . projects [ projectIdx [ 0 ] ] . holes [ h ] . sections [ s ] . markers [ m ] . drilling_depth + event [ 2 ] ;
24462482 event_border_distance = event_start_distance + event [ 2 ] ;
2447- event_border_distance_for_check = Math . round ( event_border_distance * 10 ) / 10 ;
2483+ event_border_distance_for_check = lcfnc . round ( event_border_distance , 1 ) ;
24482484 }
24492485 const startIdx = this . search_idx_list [ this . projects [ projectIdx [ 0 ] ] . holes [ h ] . sections [ s ] . markers [ m ] . id . toString ( ) ] ;
24502486 const targetSectionData = this . projects [ projectIdx [ 0 ] ] . holes [ startIdx [ 1 ] ] . sections [ startIdx [ 2 ] ] ;
@@ -2458,7 +2494,7 @@ class LevelCompilerCore extends EventEmitter{
24582494 //get current data
24592495 const currentMarkerData = targetSectionData . markers [ m2 ] ;
24602496 currentIdx = this . search_idx_list [ currentMarkerData . id . toString ( ) ] ;
2461- const current_distance = Math . round ( currentMarkerData . distance * 10 ) / 10 ;
2497+ const current_distance = lcfnc . round ( currentMarkerData . distance , 1 ) ;
24622498 if ( current_distance > event_border_distance_for_check ) {
24632499 //case through(layer exist between current and event border)
24642500 if ( m2 == startIdx [ 3 ] - 1 ) {
@@ -2540,7 +2576,7 @@ class LevelCompilerCore extends EventEmitter{
25402576 //get current data
25412577 const currentMarkerData = targetSectionData . markers [ m2 ] ;
25422578 currentIdx = this . search_idx_list [ currentMarkerData . id . toString ( ) ] ;
2543- const current_distance = Math . round ( currentMarkerData . distance * 10 ) / 10 ;
2579+ const current_distance = lcfnc . round ( currentMarkerData . distance , 1 ) ;
25442580
25452581 if ( current_distance < event_border_distance_for_check ) {
25462582 //case through(layer exist between current and event border)
@@ -5498,7 +5534,7 @@ class LevelCompilerCore extends EventEmitter{
54985534 this . setStatus ( "completed" , "" ) ;
54995535 return output ;
55005536 }
5501- getIdxFromTrinity ( projectId , [ holeName , sectionName , distance ] ) {
5537+ getIdxFromTrinity ( projectId , [ holeName , sectionName , distance ] , epsilon = 1e-1 ) {
55025538 this . setStatus ( "running" , "getIdxFromTrinity" ) ;
55035539 //get idx
55045540 let projectIdx = null ;
@@ -5521,7 +5557,7 @@ class LevelCompilerCore extends EventEmitter{
55215557 idx [ 2 ] = s ;
55225558 for ( let m = 0 ; m < section . markers . length ; m ++ ) {
55235559 const marker = section . markers [ m ] ;
5524- if ( Math . round ( marker . distance * 10 ) / 10 == Math . round ( parseFloat ( distance ) * 10 ) / 10 ) {
5560+ if ( Math . abs ( marker . distance - parseFloat ( distance ) ) < epsilon ) {
55255561 idx [ 3 ] = m ;
55265562 }
55275563 }
@@ -5950,10 +5986,12 @@ class LevelCompilerCore extends EventEmitter{
59505986 targetData . hole_name = holeData . name ;
59515987 targetData . section_name = sectionData . name ;
59525988 targetData . distance = markerData . distance ;
5953- const cd = this . getDepthFromTrinity ( id , [ targetData ] , "composite_depth" ) ;
5954- if ( cd [ 0 ] [ 1 ] !== null ) {
5955- compositeDepth = "@" + cd [ 0 ] [ 1 ] . toFixed ( 1 ) ;
5956- }
5989+ const cd = resultIds [ i ] [ 0 ] ;
5990+ compositeDepth = "@" + cd . toFixed ( 1 ) ;
5991+ //const cd = this.getDepthFromTrinity(id, [targetData], "composite_depth");
5992+ //if(cd[0][1]!==null){
5993+ // compositeDepth = "@"+cd[0][1].toFixed(1);
5994+ //}
59575995
59585996 //get event list
59595997 //Bore_hole core_number Event_top Event_bottom ID
@@ -6275,7 +6313,7 @@ class LevelCompilerCore extends EventEmitter{
62756313
62766314 //add zero point
62776315 if ( r == 1 ) {
6278- masterHole += "(" + modelData [ 1 ] [ 13 ] . slice ( 1 ) + ")" ;
6316+ masterHole += "(" + modelData [ 1 ] [ 13 ] . slice ( 1 ) + ")" ;
62796317 }
62806318
62816319 toRow . push ( masterHole ) ;
0 commit comments