public void run() { if (!File.Exists(xml_full)) { throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml"); } if (File.Exists(xml_lock_full)) { throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!"); } File.Create(xml_lock_full).Dispose(); write("[XML] LOCK ON"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xml_full); xmlDoc = XML_Handle.removeEmptyNodes(xmlDoc); List <XmlNode> pages = XML_Handle.getAllPages(xmlDoc); List <XmlNode> rebars = XML_Handle.getAllRebar(xmlDoc); if (rebars.Count > 0) { filtreeri(pages, rebars, xmlDoc); xmlDoc.Save(xml_output_full); } }
public void run(bool multy) { List <_Area_v1> areas = new List <_Area_v1>(); if (multy == true) { areas = getAllAreas(boxNames); } else { areas = getSelectedAreas(boxNames); } if (areas.Count < 1) { string names = string.Join(", ", boxNames.ToArray()); throw new DMTException("[ERROR] - (" + names + ") not found"); } List <_Mark> allMarks = getAllMarks(markLayerName); if (allMarks.Count < 1) { throw new DMTException("ERROR - " + "Reinforcement marks" + " not found"); } if (!File.Exists(xml_full)) { throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml"); } if (File.Exists(xml_lock_full)) { throw new DMTException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!"); } File.Create(xml_lock_full).Dispose(); write("[XML] LOCK ON"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xml_full); List <XmlNode> bending = XML_Handle.getAllRebar(xmlDoc); File.Delete(xml_lock_full); write("[XML] LOCK OFF"); Dictionary <_Area_v1, List <_Mark> > local_reinforcement = matchMarkArea(areas, allMarks); local_stats = generateAllWeights(local_reinforcement, bending); return; }
public void run() { if (!File.Exists(xml_full)) { throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml"); } if (File.Exists(xml_lock_full)) { throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!"); } File.Create(xml_lock_full).Dispose(); write("[XML] LOCK ON"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xml_full); xmlDoc = XML_Handle.removeEmptyNodes(xmlDoc); List <_Mark> marks = getSelectedMarks(); List <_Mark> filteredMarks = filterSelectedMarks(marks); List <XmlNode> pages = XML_Handle.getAllPages(xmlDoc); List <XmlNode> rebars = XML_Handle.getAllRebar(xmlDoc); Dictionary <_Mark, XmlNode> warning = new Dictionary <_Mark, XmlNode>(); List <_Mark> undefined = findMarksInXML(rebars, filteredMarks, ref warning); if (undefined.Count != 0) { List <XmlNode> newRebars = handleUndefined(undefined, rebars, xmlDoc); rebars.AddRange(newRebars); filtreeri(pages, rebars, xmlDoc); xmlDoc.Save(xml_output_full); } foreach (_Mark m in warning.Keys) { write("--- WARINING: " + m.ToString()); string rebarString = XML_Handle.getXMLRebarString(warning[m]); write("--- WARINING: " + rebarString); write(""); } }
public void run() { if (!File.Exists(xml_full)) { throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml"); } if (File.Exists(xml_lock_full)) { throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!"); } string userFilter = promptFilter(); if (userFilter == null) { return; } string userDiameter = promptDiameter(); if (userDiameter == null || userDiameter == "") { userDiameter = "???"; } File.Create(xml_lock_full).Dispose(); write("[XML] LOCK ON"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xml_full); List <XmlNode> rows = XML_Handle.getAllRebar(xmlDoc); List <XmlNode> filteredRows = XML_Handle.filter(rows, userFilter); List <XmlNode> similar = findSimilar(userFilter, userDiameter, filteredRows, xmlDoc); printSimilar(similar); }
public void run() { if (!File.Exists(xml_full)) { throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml"); } if (File.Exists(xml_lock_full)) { throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!"); } File.Create(xml_lock_full).Dispose(); write("[XML] LOCK ON"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xml_full); List <XmlNode> rows = XML_Handle.getAllRebar(xmlDoc); string userFilter = promptFilter(); List <XmlNode> filteredRows = XML_Handle.filter(rows, userFilter); foreach (XmlNode row in filteredRows) { XmlNode rebar = row["B2aBar"]; if (rebar == null) { write("error reading"); continue; } string rebarString = XML_Handle.getXMLRebarString(rebar); write(rebarString); } }