diff --git a/ComputerResourceConsole.csproj b/ComputerResourceConsole.csproj index e72633d30a67fa1b3ceec6f9908a3fd2c85e97ab..88b327ea1a23ce2317afeb9bb242203f65e81cd6 100644 --- a/ComputerResourceConsole.csproj +++ b/ComputerResourceConsole.csproj @@ -81,9 +81,6 @@ ..\NGIS_Solution\sdk\nxmodel.context.csharp\bin\x86\Debug\nxdat.csharp.dll - - ..\NGIS_Solution\sdk\nxmodel.mdl.csharp\bin\x86\Debug\nxmodel.mdl.csharp.dll - @@ -149,41 +146,111 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + Form diff --git a/ComputerResourceConsole.suo b/ComputerResourceConsole.suo index 771fc59e247f40936513a7c9534ddb36fc08a2e2..6ca383997ddee7c6726c6d719bae0d2fcfa355e3 100644 Binary files a/ComputerResourceConsole.suo and b/ComputerResourceConsole.suo differ diff --git a/MDL/MDL.Class/EventPage.cs b/MDL/MDL.Class/EventPage.cs index 6b125fb3af1c550cc8d877bc54f2e2345453e2cc..49c08d781ec17efd46c1c1209552a88cfcfdf174 100644 --- a/MDL/MDL.Class/EventPage.cs +++ b/MDL/MDL.Class/EventPage.cs @@ -149,9 +149,9 @@ namespace MDL.Class .Select(g => g.First()) // 从每个分组中选择第一个元素 .ToList(); ComboBox.Items.Clear(); - foreach (Dataset dataset in uniqueDatasets) + foreach (Dataset ds in uniqueDatasets) { - ComboBox.Items.Add(dataset.Name); + ComboBox.Items.Add(ds.Name); } } @@ -248,9 +248,9 @@ namespace MDL.Class ComboBox.Location = new Point(191, 315); ComboBox.Items.Clear(); - foreach (Dataset dataset in uniqueDatasets) + foreach (Dataset ds in uniqueDatasets) { - ComboBox.Items.Add(dataset.Name); + ComboBox.Items.Add(ds.Name); } ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; // 禁止用户输入 ComboBox.Name = "comboBox3"; diff --git a/MDL/MDL.Properties/Settings.cs b/MDL/MDL.Properties/Settings.cs index a1d3727670e4c339f3e60fd65c02578de574154a..5d60d7cd9d2d1f6dd5de60cbb3af1b3f29272a20 100644 --- a/MDL/MDL.Properties/Settings.cs +++ b/MDL/MDL.Properties/Settings.cs @@ -10,6 +10,5 @@ namespace MDL.Properties { private static Settings defaultInstance = (Settings)SettingsBase.Synchronized(new Settings()); - public static Settings Default => defaultInstance; } } diff --git a/NGIS.Model/ModelBehavior.cs b/NGIS.Model/ModelBehavior.cs index 074375fc27150a41dd8c80cd21e1c99989f75fc6..a542f3ae51f8672ff70ad8a9ac16e326eb2416ce 100644 --- a/NGIS.Model/ModelBehavior.cs +++ b/NGIS.Model/ModelBehavior.cs @@ -54,11 +54,11 @@ namespace NGIS.Model addModelDatasetItem(ref pDataset); } } - XmlNodeList elementsByTagName2 = xmlElement.GetElementsByTagName("RelatedDatasets"); + XmlNodeList elementsByTagName2 = xmlElement.GetElementsByTagName("States"); if (elementsByTagName.Count > 0) { XmlElement xmlElement4 = (XmlElement)elementsByTagName2[0]; - XmlElement xmlElement5 = (XmlElement)xmlElement4.FirstChild; + XmlElement xmlElement5 = xmlElement4; for (int j = 0; j < xmlElement5.ChildNodes.Count; j++) { XmlElement xmlElement6 = (XmlElement)xmlElement5.ChildNodes[j]; @@ -75,6 +75,7 @@ namespace NGIS.Model { pState.stateType = EModelStateType.EMST_GROUP; } + pState.modelEvents = new List(); for (int k = 0; k < xmlElement6.ChildNodes.Count; k++) { XmlElement xmlElement7 = (XmlElement)xmlElement6.ChildNodes[k]; @@ -113,19 +114,21 @@ namespace NGIS.Model { item.optional = Convert.ToBoolean(attribute4); } - pState.modelEvents = new List(); pState.modelEvents.Add(item); } addModelState(ref pState); } XmlElement xmlElement9 = (XmlElement)xmlElement4.ChildNodes[1]; - for (int l = 0; l < xmlElement9.ChildNodes.Count; l++) - { - XmlElement xmlElement10 = (XmlElement)xmlElement9.ChildNodes[l]; - string attribute5 = xmlElement10.GetAttribute("from"); - string attribute6 = xmlElement10.GetAttribute("to"); - addModelStateTransition(attribute5, attribute6); - } + if (xmlElement9 != null) + { + for (int l = 0; l < xmlElement9.ChildNodes.Count; l++) + { + XmlElement xmlElement10 = (XmlElement)xmlElement9.ChildNodes[l]; + string attribute5 = xmlElement10.GetAttribute("from"); + string attribute6 = xmlElement10.GetAttribute("to"); + addModelStateTransition(attribute5, attribute6); + } + } } XmlNodeList elementsByTagName3 = xmlElement.GetElementsByTagName("RelatedDatasets"); if (elementsByTagName.Count > 0) @@ -140,15 +143,18 @@ namespace NGIS.Model item2.DefaultValue = childNode.GetAttribute("defaultValue"); mProcessParameters.Add(item2); } - XmlElement xmlElement14 = (XmlElement)xmlElement11.ChildNodes[1]; - foreach (XmlElement childNode2 in xmlElement14.ChildNodes) - { - ModelParameter item3 = default(ModelParameter); - item3.Key = childNode2.GetAttribute("key"); - item3.Description = childNode2.GetAttribute("description"); - item3.DefaultValue = childNode2.GetAttribute("defaultValue"); - mProcessParameters.Add(item3); - } + XmlElement xmlElement14 = (XmlElement)xmlElement11.ChildNodes[1]; + if (xmlElement14 != null) + { + foreach (XmlElement childNode2 in xmlElement14.ChildNodes) + { + ModelParameter item3 = default(ModelParameter); + item3.Key = childNode2.GetAttribute("key"); + item3.Description = childNode2.GetAttribute("description"); + item3.DefaultValue = childNode2.GetAttribute("defaultValue"); + mProcessParameters.Add(item3); + } + } } return true; } diff --git a/control/ModelServiceDebuggerControl.cs b/control/ModelServiceDebuggerControl.cs index 0bc378e5d82550360f404ef8c9e1433cd12dcb73..9b8899d7117baa943a23a4035e221ca08725d4c6 100644 --- a/control/ModelServiceDebuggerControl.cs +++ b/control/ModelServiceDebuggerControl.cs @@ -62,11 +62,11 @@ namespace ComputerResourceConsole.control public bool loadMDLFile(string mdlPath) { + this._mdl = new ModelClass(); + this._mdl.LoadFromXmlFile(mdlPath); + this._pDebuggerOpera.MDLPath = mdlPath; try { - this._mdl = new ModelClass(); - this._mdl.LoadFromXmlFile(mdlPath); - this._pDebuggerOpera.MDLPath = mdlPath; } catch (Exception ex) { diff --git a/view/frm_packing.cs b/view/frm_packing.cs index 60281608590d277cb0c4bd0b2a6ea8d5e14d028a..0cd16ae4a10e135c3de30ad9ffed4d89d8382eb1 100644 --- a/view/frm_packing.cs +++ b/view/frm_packing.cs @@ -40,8 +40,8 @@ namespace ComputerResourceConsole.view InitializeComponent(); //! For test! - this.dgv_files.Rows.Add("E:\\GitCode\\ogms\\python\\ogms\\context\\yolov5s.pt"); - this.dgv_files.Rows.Add("E:\\GitCode\\ogms\\python\\ogms\\context\\yolov5\\"); + //this.dgv_files.Rows.Add("E:\\GitCode\\ogms\\python\\ogms\\context\\yolov5s.pt"); + //this.dgv_files.Rows.Add("E:\\GitCode\\ogms\\python\\ogms\\context\\yolov5\\"); } public string ProgrammingLanguage