public void TraceBranchM1ComputeEx1(long lGrpId) { trace.Write(TraceLevel.Debug, "CM1GroupsTree::TraceBranchM1ComputeEx1"); try { trace.Write(TraceLevel.Debug, $"Tracing branch of group: {lGrpId}"); trace.Write(TraceLevel.Debug, $"[ Group | Type | NumChilds | NumConstraits | PruneFase | Money | Minutes ]"); CM1Group pGrp = GetGroupFromGrpId(lGrpId); while (pGrp != null) { // For each group have to be a node CM1Node pNode = GetFirstNodeFromIds(pGrp.GetGrpId()); if (pNode != null) { trace.Write(TraceLevel.Debug, $"[ {pGrp.GetGrpId(),-7} | {pGrp.GetGrpTypeId(),-4} | {pNode.ChildsNum,9} | {pNode.CnstrNum,-13} | {pNode.PruneFase,-9} | {pGrp.GetAccMoney(),-5} | {pGrp.GetAccMinutes(),-7} ]"); } pGrp = GetGroupParent(pGrp.GetGrpId()); } } catch (Exception error) { trace.Write(TraceLevel.Error, error.ToLogString()); } }
// Trace public void TraceFullTree() { trace.Write(TraceLevel.Debug, "CM1GroupsTree::TraceFullTree"); try { trace?.Write(TraceLevel.Debug, $"#Groups: {GetGroupNum()} , #Nodes:{GetNodeNum()}"); trace?.Write(TraceLevel.Debug, "Groups [ Group | Type | NumChilds | NumConstraits | PruneFase ] Childs { Group | ChildGroup }:"); trace?.Write(TraceLevel.Debug, "Constraints ( Type | Value ):"); for (int i = 0; i < GetGroupNum(); i++) { CM1Group pGrp = m_Groups[i]; if (pGrp == null) { continue; } // For each group have to be a node CM1Node pNode = GetFirstNodeFromIds(pGrp.GetGrpId()); if (pNode != null) { trace?.Write(TraceLevel.Debug, $" [ {pGrp.GetGrpId(),7} | {pGrp.GetGrpTypeId(),4} | {pNode.ChildsNum,9} | {pNode.CnstrNum,13} | {pNode.PruneFase} ]\t"); // A node can have constraints CM1Constraint[] pCnstr = pGrp.GetConstraints(); for (int k = 0; k < CM1Constraint.CNSTR_NUM; k++) { if (!pCnstr[k].IsValid()) { continue; } trace?.Write(TraceLevel.Debug, $"( {pCnstr[k].TypeId, 4} | %{pCnstr[k].Value},4)"); } // A node can have childs for (int j = 0; j < GetNodeNum(); j++) { pNode = m_Nodes[j]; if (pNode == null || pNode.GrpChild == null || pNode.GrpId != pGrp.GetGrpId()) { continue; } trace?.Write(TraceLevel.Debug, $" ( {pNode.GrpId,7} | {pNode.GrpChild.GetGrpId(),10} )\t"); } ////sRdo += _T("\n"); //trace?.Write(TraceLevel.Info, (LPCTSTR)strRdo); //if (!strCnstr.IsEmpty()) //{ // /* // sRdo += _T("\t"); // sRdo += sCnstr; // sRdo += _T("\n"); // */ // trace.Write(TRACE_M1_LEVEL, _T("\t%s"), (LPCTSTR)strCnstr); //} } } } catch (Exception error) { trace.Write(TraceLevel.Error, error.ToLogString()); } }