diff --git a/.gitignore b/.gitignore index 6c11cc3a..8ccfa79f 100644 --- a/.gitignore +++ b/.gitignore @@ -1100,3 +1100,12 @@ bin/release/ /Learun.Framework.Module/Learun.Util/Learun.Util.Operat/bin/Debug/Learun.Util.xml /Learun.Framework.Module/Learun.Util/Learun.Util/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache newFront/c#前端/.vs/ +/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/3ad7c96f-983b-4ac1-9f92-f5a7901a6021.vsidx +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/815c1f12-618a-42f1-9f48-530a4fe7066c.vsidx +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/da4d986e-a00f-4854-84e3-051892159db9.vsidx +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f3f7e679-645b-4fe3-a724-f2e55e8cd4fe.vsidx +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f843a722-ec3e-425b-a704-f3537ea54b49.vsidx +/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f03e1583-e8e0-43b7-9dbb-a1896ce4b92d.vsidx +/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f2e37380-e651-406b-9320-af642620eee9.vsidx diff --git a/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache b/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache deleted file mode 100644 index 71b62047..00000000 Binary files a/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache and /dev/null differ diff --git a/Learun.Application.Web/AppApi/PlotBOMApiController.cs b/Learun.Application.Web/AppApi/PlotBOMApiController.cs index e663e0fe..ffff394e 100644 --- a/Learun.Application.Web/AppApi/PlotBOMApiController.cs +++ b/Learun.Application.Web/AppApi/PlotBOMApiController.cs @@ -127,6 +127,11 @@ namespace Learun.Application.Web.AppApi { List allTagsInThisGroup = group.ToList(); var GroupName = group.Key.Group; //A-ABC, 正常情况下A是system,放下面;B是tag,放上面 + if (!GroupName.Contains("-")) + { + + continue; + } var upper_text_Part1 = GroupName.Split('-')[1];//ABC var upper_text_Part2 = "";//seq #region seq的不同情况 diff --git a/SWSDBSchemeUpgradeTool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/SWSDBSchemeUpgradeTool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 28eef7d0..88c5aa17 100644 Binary files a/SWSDBSchemeUpgradeTool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/SWSDBSchemeUpgradeTool/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db index 24cccdbb..11e675fa 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-shm b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-shm index 18bff569..31b0d793 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-shm and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-shm differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-wal b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-wal index 4a503767..0b6297d7 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-wal and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/CodeChunks.db-wal differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db index 50ab65d0..ddab609d 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-shm b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-shm index 883254a2..0e854215 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-shm and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-shm differ diff --git a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-wal b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-wal index a422960b..05236062 100644 Binary files a/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-wal and b/newFront/c#前端/.vs/SWS.CAD/CopilotIndices/17.13.444.19527/SemanticSymbols.db-wal differ diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache b/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache deleted file mode 100644 index b8c9cfc0..00000000 Binary files a/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache and /dev/null differ diff --git a/newFront/c#前端/DI-Electrical/App.xaml.cs b/newFront/c#前端/DI-Electrical/App.xaml.cs index b0dd7ffe..4adadc9f 100644 --- a/newFront/c#前端/DI-Electrical/App.xaml.cs +++ b/newFront/c#前端/DI-Electrical/App.xaml.cs @@ -58,6 +58,7 @@ namespace DI_Electrical GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); + GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.Register(); diff --git a/newFront/c#前端/DI-Electrical/ViewModels/ConfigViewModel.cs b/newFront/c#前端/DI-Electrical/ViewModels/ConfigViewModel.cs index 07afadc1..7d2da8e9 100644 --- a/newFront/c#前端/DI-Electrical/ViewModels/ConfigViewModel.cs +++ b/newFront/c#前端/DI-Electrical/ViewModels/ConfigViewModel.cs @@ -69,9 +69,9 @@ namespace DI_Electrical.ViewModels MessageBox.Show("本地文件目录不存在。"); return; } - var data = _configService.parser.ReadFile(_configService.path); + //var data = _configService.parser.ReadFile(_configService.path); - _configService._httpService.Init(address, port); + //_configService._httpService.Init(address, port); IsBusy = true; BusyContent = "保存中..."; var testRes = await _LoginService.Login("1", "11"); @@ -85,10 +85,17 @@ namespace DI_Electrical.ViewModels { address = address.Replace("https://", "").Replace("http://", ""); } - data["Profile"]["Address"] = address; - data["Profile"]["Port"] = port.ToString(); - data["Profile"]["Directory"] = _directory; - _configService.parser.WriteFile(_configService.path, data); + //data["Profile"]["Address"] = address; + //data["Profile"]["Port"] = port.ToString(); + //data["Profile"]["Directory"] = _directory; + //_configService.parser.WriteFile(_configService.path, data); + + //IniHelper.WriteValueFromIniFile("Profile", "strIPAddress", address); + //IniHelper.WriteValueFromIniFile("Profile", "nPort", port.ToString()); + //IniHelper.WriteValueFromIniFile("Profile", "strLocalWorkDir", _directory); + _configService.Save("Profile", "strIPAddress", address); + _configService.Save("Profile", "nPort", port.ToString()); + _configService.Save("Profile", "strLocalWorkDir", _directory); GlobalObject.isConfigIniCreateBySys = false; GlobalObject.SetLocalFileDirectory(_directory); diff --git a/newFront/c#前端/DI-Electrical/ViewModels/LoginViewModel.cs b/newFront/c#前端/DI-Electrical/ViewModels/LoginViewModel.cs index fe30495a..c9610ede 100644 --- a/newFront/c#前端/DI-Electrical/ViewModels/LoginViewModel.cs +++ b/newFront/c#前端/DI-Electrical/ViewModels/LoginViewModel.cs @@ -72,9 +72,9 @@ namespace DI_Electrical.ViewModels Command_Config = new DelegateCommand(onConfig); containerProvider = container; if (GlobalObject.isConfigIniCreateBySys) - { - var config= container.Resolve(); - config.ShowDialog(); + { + var config = container.Resolve(); + config.ShowDialog(); } UserName = _configService.Read(nameof(ConfigIni.UserName)); @@ -91,14 +91,14 @@ namespace DI_Electrical.ViewModels { sPASSWORD = GlobalObject.userInfo.userPs; } - curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port)); + curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort"); } public void onConfig(object o) { var config = containerProvider.Resolve(); config.ShowDialog(); - curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port)); + curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort"); } public override async void ExecuteOKCommandAsync(object obj) @@ -116,7 +116,7 @@ namespace DI_Electrical.ViewModels else { IsBusy = true; BusyContent = "登录中..."; - var res = await _Service.Login(UserName, Userpass); + var res = await _Service.Login(UserName, Userpass); IsBusy = false; if (string.IsNullOrEmpty(res)) { diff --git a/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.dll b/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.dll deleted file mode 100644 index d19e920f..00000000 Binary files a/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.dll and /dev/null differ diff --git a/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.xml b/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.xml deleted file mode 100644 index 7d5e96bc..00000000 --- a/newFront/c#前端/SWS.CAD.Base/bin/Debug/INIFileParser.xml +++ /dev/null @@ -1,1181 +0,0 @@ - - - - INIFileParser - - - - - Asserts that a strings has no blank spaces. - - The string to be checked. - - - - - Represents an INI data parser for files. - - - - - Ctor - - - - - Ctor - - - - - - Implements reading ini data from a file. - - - Uses codification for the file. - - - Path to the file - - - - - Implements reading ini data from a file. - - - Path to the file - - - File's encoding. - - - - - Saves INI data to a file. - - - Creats an ASCII encoded file by default. - - - Path to the file. - - - IniData to be saved as an INI file. - - - - - Writes INI data to a text file. - - - Path to the file. - - - IniData to be saved as an INI file. - - - Specifies the encoding used to create the file. - - - - - Represents all data from an INI file - - - - - Represents all sections from an INI file - - - - - Initializes an empty IniData instance. - - - - - Initializes a new IniData instance using a previous - . - - - object containing the - data with the sections of the file - - - - - Configuration used to write an ini file with the proper - delimiter characters and data. - - - If the instance was created by a parser, - this instance is a copy of the used - by the parser (i.e. different objects instances) - If this instance is created programatically without using a parser, this - property returns an instance of - - - - - Global sections. Contains key/value pairs which are not - enclosed in any section (i.e. they are defined at the beginning - of the file, before any section. - - - - - Gets the instance - with the specified section name. - - - - - Gets or sets all the - for this IniData instance. - - - - - Used to mark the separation between the section name and the key name - when using . - - - Defaults to '.'. - - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - See property for more information. - - - - - Deletes all comments in all sections and key values - - - - - Merges the other iniData into this one by overwriting existing values. - Comments get appended. - - - IniData instance to merge into this. - If it is null this operation does nothing. - - - - - Attempts to retrieve a key, using a single string combining section and - key name. - - - The section and key name to retrieve, separated by . - - If key contains no separator, it is treated as a key in the section. - - Key may contain no more than one separator character. - - - If true is returned, is set to the value retrieved. Otherwise, is set - to an empty string. - - - True if key was found, otherwise false. - - - key contained multiple separators. - - - - - Retrieves a key using a single input string combining section and key name. - - - The section and key name to retrieve, separated by . - - If key contains no separator, it is treated as a key in the section. - - Key may contain no more than one separator character. - - - The key's value if it was found, otherwise null. - - - key contained multiple separators. - - - - - Merge the sections into this by overwriting this sections. - - - - - Merges the given global values into this globals by overwriting existing values. - - - - - Information associated to a key from an INI file. - Includes both the value and the comments associated to the key. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - from a previous instance of . - - - Data is deeply copied - - - The instance of the class - used to create the new instance. - - - - - Gets or sets the comment list associated to this key. - - - - - Gets or sets the value associated to this key. - - - - - Gets or sets the name of the key. - - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - Represents a collection of Keydata. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a given - search comparer - - - Search comparer used to find the key by name in the collection - - - - - Initializes a new instance of the class - from a previous instance of . - - - Data from the original KeyDataCollection instance is deeply copied - - - The instance of the class - used to create the new instance. - - - - - Gets or sets the value of a concrete key. - - - If we try to assign the value of a key which doesn't exists, - a new key is added with the name and the value is assigned to it. - - - Name of the key - - - The string with key's value or null if the key was not found. - - - - - Return the number of keys in the collection - - - - - - Adds a new key to the collection - - - KeyData instance. - - - true if the key was added false if a key with the same name already exist - in the collection - - - - - Adds a new key with the specified name and value to the collection - - - Name of the new key to be added. - - - Value associated to the key. - - - true if the key was added false if a key with the same name already exist - in the collection. - - - - - Clears all comments of this section - - - - - Gets if a specifyed key name exists in the collection. - - Key name to search - true if a key with the specified name exists in the collectoin - false otherwise - - - - Retrieves the data for a specified key given its name - - Name of the key to retrieve. - - A instance holding - the key information or null if the key wasn't found. - - - - - Deletes all keys in this collection. - - - - - Deletes a previously existing key, including its associated data. - - The key to be removed. - - true if a key with the specified name was removed - false otherwise. - - - - - Sets the key data associated to a specified key. - - The new for the key. - - - - Allows iteration througt the collection. - - A strong-typed IEnumerator - - - - Implementation needed - - A weak-typed IEnumerator. - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - Collection of KeyData for a given section - - - - - Information associated to a section in a INI File - Includes both the value and the comments associated to the key. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - from a previous instance of . - - - Data is deeply copied - - - The instance of the class - used to create the new instance. - - - Search comparer. - - - - - Deletes all comments in this section and key/value pairs - - - - - Deletes all the key-value pairs in this section. - - - - - Merges otherSection into this, adding new keys if they don't exists - or overwriting values if the key already exists. - Comments get appended. - - - Comments are also merged but they are always added, not overwritten. - - - - - - Gets or sets the name of the section. - - - The name of the section - - - - - Gets or sets the comment list associated to this section. - - - A list of strings. - - - - - Gets or sets the keys associated to this section. - - - A collection of KeyData objects. - - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - Represents a collection of SectionData. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - StringComparer used when accessing section names - - - - - Initializes a new instance of the class - from a previous instance of . - - - Data is deeply copied - - - The instance of the class - used to create the new instance. - - - - Returns the number of SectionData elements in the collection - - - - - Gets the key data associated to a specified section name. - - An instance of as class - holding the key data from the current parsed INI data, or a null - value if the section doesn't exist. - - - - Creates a new section with empty data. - - - If a section with the same name exists, this operation has no effect. - - Name of the section to be created - true if the a new section with the specified name was added, - false otherwise - If the section name is not valid. - - - - Adds a new SectionData instance to the collection - - Data. - - - - Removes all entries from this collection - - - - - Gets if a section with a specified name exists in the collection. - - Name of the section to search - - true if a section with the specified name exists in the - collection false otherwise - - - - - Returns the section data from a specify section given its name. - - Name of the section. - - An instance of a class - holding the section data for the currently INI data - - - - - Sets the section data for given a section name. - - - The new instance. - - - - - - - true if the section with the specified name was removed, - false otherwise - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - Data associated to this section - - - - - Configuration used to write an ini file with the proper - delimiter characters and data. - - - If the instance was created by a parser, - this instance is a copy of the used - by the parser (i.e. different objects instances) - If this instance is created programatically without using a parser, this - property returns an instance of - - - - - Formats a IniData structure to an string - - - - - Produces an string given - - The data to string. - Ini data. - - - - Configuration used by this formatter when converting IniData - to an string - - - - - Represents all data from an INI file exactly as the - class, but searching for sections and keys names is done with - a case insensitive search. - - - - - Initializes an empty IniData instance. - - - - - Initializes a new IniData instance using a previous - . - - - object containing the - data with the sections of the file - - - - - Copies an instance of the class - - Original - - - - Defines data for a Parser configuration object. - - With a configuration object you can redefine how the parser - will detect special items in the ini file by defining new regex - (e.g. you can redefine the comment regex so it just treat text as - a comment iff the comment caracter is the first in the line) - or changing the set of characters used to define elements in - the ini file (e.g. change the 'comment' caracter from ';' to '#') - You can also define how the parser should treat errors, or how liberal - or conservative should it be when parsing files with "strange" formats. - - - - Default values used if an instance of - is created without specifying a configuration. - - - By default the various delimiters for the data are setted: - ';' for one-line comments - '[' ']' for delimiting a section - '=' for linking key / value pairs - - An example of well formed data with the default values: - - ;section comment
- [section] ; section comment
-
- ; key comment
- key = value ;key comment
-
- ;key2 comment
- key2 = value
-
-
-
-
- - - Copy ctor. - - - Original instance to be copied. - - - - - Sets the char that defines the start of a section name. - - - Defaults to character '[' - - - - - Sets the char that defines the end of a section name. - - - Defaults to character ']' - - - - - Retrieving section / keys by name is done with a case-insensitive - search. - - - Defaults to false (case sensitive search) - - - - - Sets the char that defines the start of a comment. - A comment spans from the comment character to the end of the line. - - - Defaults to character ';' - - - - - Sets the string that defines the start of a comment. - A comment spans from the mirst matching comment string - to the end of the line. - - - Defaults to string ";" - - - - - Gets or sets the string to use as new line string when formating an IniData structure using a - IIniDataFormatter. Parsing an ini-file accepts any new line character (Unix/windows) - - - This allows to write a file with unix new line characters on windows (and vice versa) - - Defaults to value Environment.NewLine - - - - Sets the char that defines a value assigned to a key - - - Defaults to character '=' - - - - - Sets the string around KeyValuesAssignmentChar - - - Defaults to string ' ' - - - - - Allows having keys in the file that don't belong to any section. - i.e. allows defining keys before defining a section. - If set to false and keys without a section are defined, - the will stop with an error. - - - Defaults to true. - - - - - If set to false and the finds duplicate keys in a - section the parser will stop with an error. - If set to true, duplicated keys are allowed in the file. The value - of the duplicate key will be the last value asigned to the key in the file. - - - Defaults to false. - - - - - Only used if is also true - If set to true when the parser finds a duplicate key, it overrites - the previous value, so the key will always contain the value of the - last key readed in the file - If set to false the first readed value is preserved, so the key will - always contain the value of the first key readed in the file - - - Defaults to false. - - - - - Gets or sets a value indicating whether duplicate keys are concatenate - together by . - - - Defaults to false. - - - - - If true the instance will thrown an exception - if an error is found. - If false the parser will just stop execution and return a null value. - - - Defaults to true. - - - - - If set to false and the finds a duplicate section - the parser will stop with an error. - If set to true, duplicated sections are allowed in the file, but only a - element will be created in the - collection. - - - Defaults to false. - - - - - If set to false, the stop with a error if you try - to access a section that was not created previously and the parser will stop with an error. - If set to true, inexistents sections are created, always returning a valid - element. - - - Defaults to false. - - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - 2 - - - - - Responsible for parsing an string from an ini file, and creating - an structure. - - - - - Ctor - - - The parser uses a by default - - - - - Ctor - - - Parser's instance. - - - - - Configuration that defines the behaviour and constraints - that the parser must follow. - - - - - True is the parsing operation encounter any problem - - - - - Returns the list of errors found while parsing the ini file. - - - If the configuration option ThrowExceptionOnError is false it can contain one element - for each problem found while parsing; otherwise it will only contain the very same - exception that was raised. - - - - - Parses a string containing valid ini data - - - String with data - - - An instance with the data contained in - the correctly parsed an structured. - - - Thrown if the data could not be parsed - - - - - Checks if a given string contains a comment. - - - String with a line to be checked. - - - true if any substring from s is a comment, false otherwise. - - - - - Checks if a given string represents a section delimiter. - - - The string to be checked. - - - true if the string represents a section, false otherwise. - - - - - Checks if a given string represents a key / value pair. - - - The string to be checked. - - - true if the string represents a key / value pair, false otherwise. - - - - - Removes a comment from a string if exist, and returns the string without - the comment substring. - - - The string we want to remove the comments from. - - - The string s without comments. - - - - - Processes one line and parses the data found in that line - (section or key/value pair who may or may not have comments) - - The string with the line to process - - - - Proccess a string which contains an ini section. - - - The string to be processed - - - - - Processes a string containing an ini key/value pair. - - - The string to be processed - - - - - Extracts the key portion of a string containing a key/value pair.. - - - The string to be processed, which contains a key/value pair - - - The name of the extracted key. - - - - - Extracts the value portion of a string containing a key/value pair.. - - - The string to be processed, which contains a key/value pair - - - The name of the extracted value. - - - - - Abstract Method that decides what to do in case we are trying to add a duplicated key to a section - - - - - Adds a key to a concrete instance, checking - if duplicate keys are allowed in the configuration - - - Key name - - - Key's value - - - collection where the key should be inserted - - - Name of the section where the is contained. - Used only for logging purposes. - - - - - Temp list of comments - - - - - Tmp var with the name of the seccion which is being process - - - - - Represents an INI data parser for streams. - - - - - This instance will handle ini data parsing and writing - - - - - Ctor - - - - - Ctor - - - - - - Reads data in INI format from a stream. - - Reader stream. - - And instance with the readed ini data parsed. - - - Thrown if is null. - - - - - Writes the ini data to a stream. - - A write stream where the ini data will be stored - An instance. - - Thrown if is null. - - - - - Writes the ini data to a stream. - - A write stream where the ini data will be stored - An instance. - Formaterr instance that controls how the ini data is transformed to a string - - Thrown if is null. - - - - - Represents an INI data parser for strings. - - - - This class is deprecated and kept for backwards compatibility. - It's just a wrapper around class. - Please, replace your code. - - - - - This instance will handle ini data parsing and writing - - - - - Ctor - - - - - Ctor - - - - - - Parses a string containing data formatted as an INI file. - - The string containing the data. - - A new instance with the data parsed from the string. - - - - - Creates a string from the INI data. - - An instance. - - A formatted string with the contents of the - instance object. - - - - - Represents an error ococcurred while parsing data - - -
-
diff --git a/newFront/c#前端/SWS.CAD/Commands.cs b/newFront/c#前端/SWS.CAD/Commands.cs index 86a5ee4d..a28f2dcd 100644 --- a/newFront/c#前端/SWS.CAD/Commands.cs +++ b/newFront/c#前端/SWS.CAD/Commands.cs @@ -24,6 +24,7 @@ using Panel = Bricscad.Windows.Panel; using GlobalObject = SWS.Commons.GlobalObject; using SWS.Model; using SWS.Service; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; [assembly: CommandClass(typeof(Commands))] @@ -540,6 +541,8 @@ namespace SWS.CAD //选择的元素返回的属性信息 var ResTagInfosByPixels = new Model.ec_objecttype(); var listPropertys = new List(); + var _objectTypeService = GlobalObject.container.Resolve(); + var _iOModuleService = GlobalObject.container.Resolve(); // 持续选择直到获取有效电缆 bool isValidCable = false; @@ -564,7 +567,7 @@ namespace SWS.CAD { // 获取句柄(Handle 是字符串类型) var handId = (cable.Handle.ToString()); - var _objectTypeService = GlobalObject.container.Resolve(); + _objectTypeService = GlobalObject.container.Resolve(); var res = await _objectTypeService.GetTagInfosByPixels(dwgFile.Id, handId); if (res != null) { @@ -600,8 +603,20 @@ namespace SWS.CAD //Thread.Sleep(2000); if (isValidCable) { - var _iOModuleService = GlobalObject.container.Resolve(); + var ResTagNumberById = await _objectTypeService.GetTagNumberById(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + var ObjectTypePListBy = await _objectTypeService.GetObjectTypePListByIds(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + string CableSpecification = ObjectTypePListBy.Where(q => q.PropertyName.Equals("电缆规格")).Select(s => s.EnumDataCode).FirstOrDefault(); + CableSpecification = CableSpecification.Substring(0, CableSpecification.Length - 1); + var LatestSerialNumber = await _objectTypeService.GetLatestSerialNumber(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + //获取位号的电缆属性,判断是否设置电缆规格 + var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber); + var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber)).FirstOrDefault(); + if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + //if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + { + System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return; + } var ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID); //如果配置不存在 if (ResCableEngID == null) @@ -636,6 +651,7 @@ namespace SWS.CAD ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -645,6 +661,7 @@ namespace SWS.CAD int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -653,6 +670,20 @@ namespace SWS.CAD switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -663,12 +694,9 @@ namespace SWS.CAD } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = ResTagInfosByPixels.tags.FirstOrDefault().TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -705,6 +733,7 @@ namespace SWS.CAD ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -714,6 +743,7 @@ namespace SWS.CAD int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -722,6 +752,20 @@ namespace SWS.CAD switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -732,12 +776,9 @@ namespace SWS.CAD } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = ResTagInfosByPixels.tags.FirstOrDefault().TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -849,9 +890,305 @@ namespace SWS.CAD btnCableSinal.ToolTip = "信号预分配"; btnCableSinal.Text = "信号预分配"; btnCableSinal.ButtonStyle = RibbonButtonStyle.SmallWithText; - btnCableSinal.CommandHandler = new DelegateCommand(x => + btnCableSinal.CommandHandler = new DelegateCommand(async x => { - MessageBox.Show("功能开发中..."); + if (GlobalObject.userInfo == null || GlobalObject.curProject == null) + { + MessageBox.Show("请先登录系统并选择项目!"); + return; + } + + //在SWS系统内打开且不是只读的图纸才可 + var dwgName = General.GetDwgName(); + var dwgFile = GlobalObject.ListDwgOpened.FirstOrDefault(a => a.Path == dwgName && a.IsReadOnly == false); + if (dwgFile == null) + { return; } + Document doc = Application.DocumentManager.MdiActiveDocument; + Database db = doc.Database; + Editor ed = doc.Editor; + //选择的元素返回的属性信息 + var ResTagInfosByPixels = new Model.ec_objecttype(); + var listPropertys = new List(); + var _objectTypeService = GlobalObject.container.Resolve(); + var _iOModuleService = GlobalObject.container.Resolve(); + // 持续选择直到获取有效电缆 + bool isValidCable = false; + + try + { + #region 选择电缆 + // 创建选择选项(禁用回车确认) + PromptEntityOptions options = new PromptEntityOptions("\n请单击选择电缆: "); + options.AllowNone = false; // 禁止空选 + + // 执行选择(直接单击生效) + PromptEntityResult resultEntity = ed.GetEntity(options); + //WindowVisibility = System.Windows.Visibility.Hidden; + + while (resultEntity.Status == PromptStatus.OK) + { + using (Transaction tr = db.TransactionManager.StartTransaction()) + { + // 获取选中的电缆实体 + Entity cable = tr.GetObject(resultEntity.ObjectId, OpenMode.ForRead) as Entity; + //if (cable != null&&cable.XData != null) + if (cable != null) + { + // 获取句柄(Handle 是字符串类型) + var handId = (cable.Handle.ToString()); + var res = await _objectTypeService.GetTagInfosByPixels(dwgFile.Id, handId); + if (res != null) + { + if (res.Count == 1) + { + var item = res[0]; + var objTypeName = item.ObjectTypeName; + if (objTypeName.Contains("电缆")) + { + ResTagInfosByPixels = item; + isValidCable = true; // 校验通过 + ed.WriteMessage($"\n已选择电缆:{ResTagInfosByPixels.tags.FirstOrDefault().TagNumber}"); + } + + } + } + + } + tr.Commit(); + } + if (isValidCable) + { + break; + } + else + { + ed.WriteMessage($"\n已选择电缆:"); + resultEntity = ed.GetEntity(options); + } + + } + #endregion + + + //Thread.Sleep(2000); + if (isValidCable) + { + var ResTagNumberById = await _objectTypeService.GetTagNumberById(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + var ObjectTypePListBy = await _objectTypeService.GetObjectTypePListByIds(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + string CableSpecification = ObjectTypePListBy.Where(q => q.PropertyName.Equals("电缆规格")).Select(s => s.EnumDataCode).FirstOrDefault(); + CableSpecification = CableSpecification.Substring(0, CableSpecification.Length - 1); + var LatestSerialNumber = await _objectTypeService.GetLatestSerialNumber(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID); + //获取位号的电缆属性,判断是否设置电缆规格 + var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber); + var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber)).FirstOrDefault(); + if(string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + //if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + { + System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return; + + } + var ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID); + //如果配置不存在 + if (ResCableEngID == null) + { + listPropertys = new List(); + System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show($"是否为通讯母线?", "KunHengCAD", System.Windows.MessageBoxButton.OKCancel, System.Windows.MessageBoxImage.Question); + if (result == System.Windows.MessageBoxResult.OK) + { + listPropertys = new List(); + Dictionary pulldownlist; + + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对数", GroupName = "基本参数", PropertyValue = "1", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "每电缆对芯数", GroupName = "基本参数", PropertyValue = "2", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对编号前缀", GroupName = "基本参数", PropertyValue = "Set", ControlTypeName = PROPERTYType.TextBox, }); + pulldownlist = new Dictionary(); + pulldownlist.Add("数字", "数字"); + pulldownlist.Add("字母", "字母"); + pulldownlist.Add("电缆对序号", "电缆对序号"); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号类型", GroupName = "电芯参数", PropertyValue = "数字", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, }); + pulldownlist = new Dictionary(); + pulldownlist.Add("按电缆编号", "按电缆编号"); + pulldownlist.Add("按电缆对编号", "按电缆对编号"); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号规则", GroupName = "电芯参数", PropertyValue = "按电缆对编号", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电芯编号前缀", GroupName = "电芯参数", PropertyValue = "C", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "极性", GroupName = "电芯参数", PropertyValue = "+,-,s", ControlTypeName = PROPERTYType.TextBox, }); + //显示属性弹窗 + var ReslistPro = ShowPropertyMessage("新建" + ResTagInfosByPixels.tags.FirstOrDefault().TagNumber + "电缆配置", listPropertys); + if (ReslistPro == null || ReslistPro.Count() == 0) return; + ec_Cable ec_Cable = new ec_Cable(); + ec_Cable.CableClass = "homerun";//母线 + ec_Cable.Cable_Format = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault(); + ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID; + ec_Cable.Sets = new List(); + int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; + for (int i = 0; i < CableSetCount; i++) + { + ec_CableSet ec_CableSet = new ec_CableSet(); + ec_CableSet.CableSetName = ReslistPro.Where(p => p.DisplayText.Equals("电缆对编号前缀")).Select(p => p.PropertyValue).FirstOrDefault() + (i + 1); + ec_CableSet.CableSetSeq = i + 1; + ec_CableSet.Wires = new List(); + int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; + for (int j = 0; j < WireCount; j++) + { + n++; + ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); + ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; + ec_CableSetWire.SetLevel = j + 1; + string a = ReslistPro.Where(p => p.DisplayText.Equals("电芯编号前缀")).Select(p => p.PropertyValue).FirstOrDefault();//组成线号名的前缀 + string Tag = "";//线号名的中间部分 + switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) + { + case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = (j + 1).ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + j); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + (j + 1).ToString(); + } + break; + } + ec_CableSetWire.Wire_Tag = a + Tag; + ec_CableSet.Wires.Add(ec_CableSetWire); + } + ec_Cable.Sets.Add(ec_CableSet); + } + var httpres = await _iOModuleService.CreateCableByProfile(ec_Cable); + ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID); + } + else + { + listPropertys = new List(); + Dictionary pulldownlist; + + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对数", GroupName = "基本参数", PropertyValue = "10", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "每电缆对芯数", GroupName = "基本参数", PropertyValue = "2", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对编号前缀", GroupName = "基本参数", PropertyValue = "Set", ControlTypeName = PROPERTYType.TextBox, }); + pulldownlist = new Dictionary(); + pulldownlist.Add("数字", "数字"); + pulldownlist.Add("字母", "字母"); + pulldownlist.Add("电缆对序号", "电缆对序号"); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号类型", GroupName = "电芯参数", PropertyValue = "数字", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, }); + pulldownlist = new Dictionary(); + pulldownlist.Add("按电缆编号", "按电缆编号"); + pulldownlist.Add("按电缆对编号", "按电缆对编号"); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号规则", GroupName = "电芯参数", PropertyValue = "按电缆对编号", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电芯编号前缀", GroupName = "电芯参数", PropertyValue = "C", ControlTypeName = PROPERTYType.TextBox, }); + listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "极性", GroupName = "电芯参数", PropertyValue = "+,-,s", ControlTypeName = PROPERTYType.TextBox, }); + //显示属性弹窗 + var ReslistPro = ShowPropertyMessage("新建" + ResTagInfosByPixels.tags.FirstOrDefault().TagNumber + "电缆配置", listPropertys); + if (ReslistPro == null || ReslistPro.Count() == 0) return; + ec_Cable ec_Cable = new ec_Cable(); + ec_Cable.CableClass = "conventional";//常规电缆 + ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID; + ec_Cable.Sets = new List(); + int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; + for (int i = 0; i < CableSetCount; i++) + { + ec_CableSet ec_CableSet = new ec_CableSet(); + ec_CableSet.CableSetName = ReslistPro.Where(p => p.DisplayText.Equals("电缆对编号前缀")).Select(p => p.PropertyValue).FirstOrDefault() + (i + 1); + ec_CableSet.CableSetSeq = i + 1; + ec_CableSet.Wires = new List(); + int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; + for (int j = 0; j < WireCount; j++) + { + n++; + ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); + ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; + ec_CableSetWire.SetLevel = j + 1; + string a = ReslistPro.Where(p => p.DisplayText.Equals("电芯编号前缀")).Select(p => p.PropertyValue).FirstOrDefault();//组成线号名的前缀 + string Tag = "";//线号名的中间部分 + switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) + { + case "按电缆编号"://所有的电缆对中的电芯一起编号 + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n-1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i+1)+"-"+ n.ToString(); + } + break; + case "按电缆对编号"://一个电缆对中线号按顺序编号,另一个电缆对中线号重新从1开始编号 + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = (j + 1).ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + j); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i+1) + "-" + (j+1).ToString(); + } + break; + } + ec_CableSetWire.Wire_Tag = a + Tag; + ec_CableSet.Wires.Add(ec_CableSetWire); + } + ec_Cable.Sets.Add(ec_CableSet); + } + var httpres = await _iOModuleService.CreateCableByProfile(ec_Cable); + ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID); + } + } + if (ResCableEngID != null) + { + + IntPtr cadHandle = Bricscad.ApplicationServices.Application.MainWindow.Handle; + //打开窗体 + var para = new Prism.Services.Dialogs.DialogParameters(); + //para.Add(GlobalObject.dialogPar.para1.ToString(), "6e2919e4-28cd-4fb6-9035-10b2ff0e30fb"); + para.Add(GlobalObject.dialogPar.info.ToString(), cadHandle); + + para.Add(GlobalObject.dialogPar.para1.ToString(), ResCableEngID); + para.Add(GlobalObject.dialogPar.para2.ToString(), ResTagInfosByPixels.tags.FirstOrDefault().TagNumber); + var _dialogService = GlobalObject._prismContainer.Resolve(); + _dialogService.ShowDialog(nameof(DialogSignalPredistribution), para, (RES) => + { + if (RES.Result == ButtonResult.Yes) + { + + } + else if (RES.Result == ButtonResult.No) + { } + }); + } + + } + + } + catch (System.Exception ex) + { + ed.WriteMessage($"\n错误: {ex.Message}"); + } }); btnCableSinal.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CableSinal.png"); btnCableSinal.Id = "信号预分配"; diff --git a/newFront/c#前端/SWS.CAD/Event/ScrollToItemEvent.cs b/newFront/c#前端/SWS.CAD/Event/ScrollToItemEvent.cs new file mode 100644 index 00000000..be965b2d --- /dev/null +++ b/newFront/c#前端/SWS.CAD/Event/ScrollToItemEvent.cs @@ -0,0 +1,9 @@ +using Newtonsoft.Json.Linq; +using Prism.Events; + +namespace SWS.CAD.Event +{ + public class ScrollToItemEvent: PubSubEvent + { + } +} diff --git a/newFront/c#前端/SWS.CAD/GlobalObje.cs b/newFront/c#前端/SWS.CAD/GlobalObje.cs index d235b2e6..de4a2900 100644 --- a/newFront/c#前端/SWS.CAD/GlobalObje.cs +++ b/newFront/c#前端/SWS.CAD/GlobalObje.cs @@ -1,5 +1,6 @@ using IniParser; using Prism.Ioc; +using SWS.Commons; using SWS.Model; using SWS.Service; using System; @@ -59,7 +60,7 @@ namespace SWS.CAD if (_dwgType == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingType.ToString())); var res2 = res.Result; return res2; @@ -83,7 +84,7 @@ namespace SWS.CAD if (_dwgMaterialRange == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialRange.ToString())); var res2 = res.Result; return res2; @@ -107,7 +108,7 @@ namespace SWS.CAD if (_dwgMaterialCensus == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialCensus.ToString())); var res2 = res.Result; return res2; @@ -131,7 +132,7 @@ namespace SWS.CAD if (_dwgStage == null) { - var serv = GlobalObje.container.Resolve(); + var serv =GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingStage.ToString())); var res2 = res.Result; return res2; @@ -155,7 +156,7 @@ namespace SWS.CAD if (_dwgSystem == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingSystem.ToString())); var res2 = res.Result; var res3 = DataItemDetailsToTree(res2); @@ -243,11 +244,11 @@ namespace SWS.CAD para1, para2 } - public static IUnityContainer container; - public static IContainerExtension _prismContainer; - public static HttpClient client; - public static loginRes userInfo; - public static List Users; + //public static IUnityContainer container; + //public static IContainerExtension _prismContainer; + //public static HttpClient client; + //public static loginRes userInfo; + //public static List Users; public static bool isConfigIniCreateBySys = true; //public static string drawingFileId; @@ -321,27 +322,27 @@ namespace SWS.CAD } #endregion - #region 根据ID获取用户名称 - /// - /// 根据ID获取用户名称 - /// - /// - /// - public static string GetUserNameById(string id) - { - if (string.IsNullOrEmpty(id)) - { return ""; } - var user = Users.FirstOrDefault(a => a.F_UserId == id || a.F_Account == id); - if (user != null) - { return user.F_RealName; } - else - { - return ""; - //user = GlobalObject.Users.FirstOrDefault(a => a.F_Account == id); - //return user != null ? user.F_RealName : ""; - } - } - #endregion + //#region 根据ID获取用户名称 + ///// + ///// 根据ID获取用户名称 + ///// + ///// + ///// + //public static string GetUserNameById(string id) + //{ + // if (string.IsNullOrEmpty(id)) + // { return ""; } + // var user = Users.FirstOrDefault(a => a.F_UserId == id || a.F_Account == id); + // if (user != null) + // { return user.F_RealName; } + // else + // { + // return ""; + // //user = GlobalObject.Users.FirstOrDefault(a => a.F_Account == id); + // //return user != null ? user.F_RealName : ""; + // } + //} + //#endregion #region 查找子控件 diff --git a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj index b3d3a3c0..1419120f 100644 --- a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj +++ b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj @@ -167,6 +167,7 @@ + @@ -208,6 +209,7 @@ + @@ -315,6 +317,9 @@ DialogNewTagNumber.xaml + + DialogSignalPredistribution.xaml + DialogTagSelect.xaml @@ -447,6 +452,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj.user b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj.user index 9d7dd50e..baf72ccc 100644 --- a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj.user +++ b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj.user @@ -5,6 +5,6 @@ D:\Program Files\KunHeng\KunHengCAD V21 zh_CN\kunhengcad.exe - ShowAllFiles + ProjectFiles \ No newline at end of file diff --git a/newFront/c#前端/SWS.CAD/Start.cs b/newFront/c#前端/SWS.CAD/Start.cs index 16335dff..a3ae1d18 100644 --- a/newFront/c#前端/SWS.CAD/Start.cs +++ b/newFront/c#前端/SWS.CAD/Start.cs @@ -55,6 +55,7 @@ namespace SWS.CAD GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); + GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); @@ -71,6 +72,7 @@ namespace SWS.CAD GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); + GlobalObject._prismContainer.RegisterDialog(); } } } diff --git a/newFront/c#前端/SWS.CAD/ViewModels/ConfigViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/ConfigViewModel.cs index 184e0c69..06b2c33c 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/ConfigViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/ConfigViewModel.cs @@ -70,7 +70,6 @@ namespace SWS.CAD.ViewModels Application.ShowAlertDialog("本地文件目录不存在。"); return; } - var data = _configService.parser.ReadFile(_configService.path); _configService._httpService.Init(address, port); IsBusy = true; @@ -85,10 +84,14 @@ namespace SWS.CAD.ViewModels { address = address.Replace("https://", "").Replace("http://", ""); } - data["Profile"]["Address"] = address; - data["Profile"]["Port"] = port.ToString(); - data["Profile"]["Directory"] = _directory; - _configService.parser.WriteFile(_configService.path, data); + //var data = _configService.parser.ReadFile(_configService.path); + //data["Profile"]["Address"] = address; + //data["Profile"]["Port"] = port.ToString(); + //data["Profile"]["Directory"] = _directory; + //_configService.parser.WriteFile(_configService.path, data); + _configService.Save("Profile", "strIPAddress", address); + _configService.Save("Profile", "nPort", port.ToString()); + _configService.Save("Profile", "strLocalWorkDir", _directory); GlobalObject.isConfigIniCreateBySys = false; GlobalObject.SetLocalFileDirectory(_directory); diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs index bfd8f1a3..fe8399c7 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs @@ -10,6 +10,7 @@ using System.Windows.Threading; using Bricscad.ApplicationServices; using Bricscad.EditorInput; using OfficeOpenXml; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Information; using Prism.Events; using Prism.Ioc; using Prism.Services.Dialogs; @@ -56,6 +57,8 @@ namespace SWS.CAD.ViewModels RaisePropertyChanged(nameof(SelectedTreeNode)); UpdateChannelInfos(); + var path = FindNodePath(PanelTreels, _SelectedTreeNode); + _eventAggregator.GetEvent().Publish(path); } } @@ -279,7 +282,7 @@ namespace SWS.CAD.ViewModels { ChannelInfo c = new ChannelInfo(); //电缆位号,电缆对,电缆线号,极性 - foreach (var Term in child.Terms) + foreach (var Term in child.Terms.OrderBy(p => p.Term_Seq).ToList()) { index++; c.Index.Add(index.ToString()); @@ -302,7 +305,8 @@ namespace SWS.CAD.ViewModels c.Polaritys.Add(new ec_WireTerminal()); } } - c.Terms.AddRange(child.Terms); + //端子号 + c.Terms.AddRange(child.Terms.OrderBy(p => p.Term_Seq).ToList()); //关联信号 c.Signal = child.Signal; if (child.Signal != null) @@ -333,14 +337,14 @@ namespace SWS.CAD.ViewModels } catch (Exception ex) { - System.Windows.MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error); + System.Windows.MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error); } finally { IsBusy = false; } - - + + } #endregion @@ -523,6 +527,44 @@ namespace SWS.CAD.ViewModels } #endregion + #region 查找节点路径 + public List FindNodePath(ObservableCollection nodes, TreeModel targetNode) + { + List path = new List(); + FindNodePathRecursive(nodes, targetNode, path); + return path; + } + + private bool FindNodePathRecursive(IEnumerable nodes, TreeModel targetNode, List currentPath) + { + foreach (var node in nodes) + { + currentPath.Add(node.Text); + if (node == targetNode) return true; // 找到目标节点,返回True并结束搜索 + if (node.ChildNodes.Count > 0 && FindNodePathRecursive(node.ChildNodes, targetNode, currentPath)) + return true; // 在子节点中继续搜索并找到目标节点,返回True并结束搜索 + currentPath.RemoveAt(currentPath.Count - 1); // 回溯,尝试下一个兄弟节点或父节点的其他兄弟节点 + } + return false; // 没有找到目标节点,返回False + } + #endregion + + #region 通过id查找项 + private TreeModel FindTreeModelById(IEnumerable TreeModels, string id) + { + foreach (var Tree in TreeModels) + { + if (Tree.ID == id) + return Tree; + + var foundInChildren = FindTreeModelById(Tree.ChildNodes, id); + if (foundInChildren != null) + return foundInChildren; + } + + return null; + } + #endregion #region 树形结构右键点击事件 public ICommand MouseRightCmd => new DelegateCommand(MouseRight_Click); @@ -602,6 +644,7 @@ namespace SWS.CAD.ViewModels } PanelTreels.Clear(); PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = PanelTreels.FirstOrDefault(p => p.Text.Equals(positionalvalue)).ChildNodes.FirstOrDefault(c => c.ID.Equals(PanelIDValue)); } else if (RES.Result == ButtonResult.No) { } @@ -684,13 +727,14 @@ namespace SWS.CAD.ViewModels DataItemName = listPro.Where(p => p.DisplayText.Equals("位置名称")).Select(p => p.PropertyValue).FirstOrDefault(), OrderID = int.Parse(listPro.Where(p => p.DisplayText.Equals("排序号")).Select(p => p.PropertyValue).FirstOrDefault()), }; - var httpres = await _dataItemService.SaveDetailForm(ent); - if (httpres != null) + var httpres = await _dataItemService.SaveDetailForm(ent) as learunHttpRes; + if (httpres.code != 200) { - System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; } PanelTreels.Clear(); PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = FindNodeByNodeId(PanelTreels, httpres.data.DataItemID); } else if (RES.Result == ButtonResult.No) { } @@ -880,13 +924,15 @@ namespace SWS.CAD.ViewModels } #endregion - var httpres = await _iOModuleService.CreatePanelStripByProfile(e); - if (httpres != null) + var httpres = await _iOModuleService.CreatePanelStripByProfile(e) as learunHttpRes; + if (httpres.code != 200) { - System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; } PanelTreels.Clear(); PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = FindTreeModelById(PanelTreels, httpres.data.StripID); + } else if (RES.Result == ButtonResult.No) { } @@ -939,13 +985,14 @@ namespace SWS.CAD.ViewModels DataItemName = listPro.Where(p => p.DisplayText.Equals("位置名称")).Select(p => p.PropertyValue).FirstOrDefault(), OrderID = int.Parse(listPro.Where(p => p.DisplayText.Equals("排序号")).Select(p => p.PropertyValue).FirstOrDefault()), }; - var httpres = await _dataItemService.SaveDetailForm(ent); - if (httpres != null) + var httpres = await _dataItemService.SaveDetailForm(ent) as learunHttpRes; + if (httpres.code != 200) { - System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; } PanelTreels.Clear(); PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = FindNodeByNodeId(PanelTreels, httpres.info); } else if (RES.Result == ButtonResult.No) { } @@ -973,6 +1020,7 @@ namespace SWS.CAD.ViewModels { if (RES.Result == ButtonResult.Yes) { + var tempID = SelectedTreeNode.ID; var listPro = RES.Parameters.GetValue>(GlobalObject.dialogPar.para1.ToString()); ec_PanelStrip ent = new ec_PanelStrip() @@ -984,12 +1032,13 @@ namespace SWS.CAD.ViewModels StripID = StripIDValue, }; var httpres = await _iOModuleService.SavePanelStrip(ent); - if (httpres != null) + if (httpres!= null) { System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; } PanelTreels.Clear(); PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = FindNodeByNodeId(PanelTreels, tempID); } else if (RES.Result == ButtonResult.No) { } @@ -1016,7 +1065,15 @@ namespace SWS.CAD.ViewModels MessageBoxResult result = System.Windows.MessageBox.Show($"确定删除[{SelectedTreeNode.Text}]节点以及子节点吗", "KunHengCAD", MessageBoxButton.OKCancel, MessageBoxImage.Question); if (result == MessageBoxResult.OK) { + var tempParentId = SelectedTreeNode.parentId; var httpres = await _iOModuleService.DeletePanelStrip(SelectedTreeNode.ID); + if (httpres!=null) + { + System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + } + PanelTreels.Clear(); + PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + SelectedTreeNode = FindTreeModelById(PanelTreels, tempParentId); } } return; @@ -1068,7 +1125,8 @@ namespace SWS.CAD.ViewModels //获取位号的电缆属性,判断是否设置电缆规格 var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(selectTagNumberOB.TagNumber); var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(selectTagNumberOB.TagNumber)).FirstOrDefault(); - if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) + //if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) { System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; @@ -1107,6 +1165,7 @@ namespace SWS.CAD.ViewModels ec_Cable.EngineerDataID = selectTagNumberOB.EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -1116,6 +1175,7 @@ namespace SWS.CAD.ViewModels int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -1124,6 +1184,20 @@ namespace SWS.CAD.ViewModels switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -1134,12 +1208,9 @@ namespace SWS.CAD.ViewModels } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = selectTagNumberOB.TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -1176,6 +1247,7 @@ namespace SWS.CAD.ViewModels ec_Cable.EngineerDataID = selectTagNumberOB.EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -1185,6 +1257,7 @@ namespace SWS.CAD.ViewModels int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -1193,6 +1266,20 @@ namespace SWS.CAD.ViewModels switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -1203,12 +1290,9 @@ namespace SWS.CAD.ViewModels } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = selectTagNumberOB.TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -1501,11 +1585,12 @@ namespace SWS.CAD.ViewModels //获取位号的电缆属性,判断是否设置电缆规格 var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(resTagNumberListByPixels.TagNumber); var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(resTagNumberListByPixels.TagNumber)).FirstOrDefault(); + if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) //if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault())) - //{ - // System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + { + System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return; - //} + } //获取电缆的配置,没有则创建新配置 var CableBy = await _iOModuleService.GetCableByEngID(resTagNumberListByPixels?.EngineDataID); if (CableBy == null) @@ -1539,6 +1624,7 @@ namespace SWS.CAD.ViewModels ec_Cable.EngineerDataID = resTagNumberListByPixels.EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -1548,6 +1634,7 @@ namespace SWS.CAD.ViewModels int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -1556,6 +1643,20 @@ namespace SWS.CAD.ViewModels switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -1566,12 +1667,9 @@ namespace SWS.CAD.ViewModels } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = resTagNumberListByPixels.TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -1608,6 +1706,7 @@ namespace SWS.CAD.ViewModels ec_Cable.EngineerDataID = resTagNumberListByPixels.EngineDataID; ec_Cable.Sets = new List(); int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0; + int n = 0; for (int i = 0; i < CableSetCount; i++) { ec_CableSet ec_CableSet = new ec_CableSet(); @@ -1617,6 +1716,7 @@ namespace SWS.CAD.ViewModels int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0; for (int j = 0; j < WireCount; j++) { + n++; ec_CableSetWire ec_CableSetWire = new ec_CableSetWire(); ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)]; ec_CableSetWire.SetLevel = j + 1; @@ -1625,6 +1725,20 @@ namespace SWS.CAD.ViewModels switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault()) { case "按电缆编号": + if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) + { + Tag = n.ToString(); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母")) + { + Tag = Tag + (char)('A' + (n - 1)); + } + else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) + { + Tag = (i + 1) + "-" + n.ToString(); + } + break; + case "按电缆对编号": if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字")) { Tag = (j + 1).ToString(); @@ -1635,12 +1749,9 @@ namespace SWS.CAD.ViewModels } else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号")) { - Tag = (i + 1).ToString(); + Tag = (i + 1) + "-" + (j + 1).ToString(); } break; - case "按电缆对编号": - a = resTagNumberListByPixels.TagNumber; - break; } ec_CableSetWire.Wire_Tag = a + Tag; ec_CableSet.Wires.Add(ec_CableSetWire); @@ -2054,7 +2165,7 @@ namespace SWS.CAD.ViewModels if (result == MessageBoxResult.OK) { var httpres = await _iOModuleService.DeletePanelChannel(SelectedChannelInfo.ChannelID); - if (httpres!=null) + if (httpres != null) { System.Windows.MessageBox.Show(httpres, "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; @@ -2530,8 +2641,8 @@ namespace SWS.CAD.ViewModels ent.Signals = new List(); ent.Signals.Add(SelectedChannelInfo.Signal); //解除信号 - var data = await _wireGroupService.SaveSignals(ent); - if (data != null) + var data = await _wireGroupService.SaveSignals(ent) as learunHttpRes>; + if (data.code ==200) { ChannelInfos.Clear(); UpdateChannelInfos(); diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs new file mode 100644 index 00000000..8f100e4e --- /dev/null +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs @@ -0,0 +1,583 @@ + +using Prism.Events; +using Prism.Ioc; +using Prism.Services.Dialogs; +using SWS.CAD.Event; +using SWS.CAD.ViewModels.myViewModelBase; +using SWS.CAD.Views; +using SWS.CAD.Views.CustomControl; +using SWS.Commons; +using SWS.Model; +using SWS.Service; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using Telerik.Windows.Controls; +using Unity; + +namespace SWS.CAD.ViewModels +{ + public class DialogSignalPredistributionViewModel : DialogBase, IDialogAware + { + #region 字段 + private ObservableCollection _PanelTreels = new ObservableCollection(); + /// + /// 页面左侧树形结构数据 + /// + public ObservableCollection PanelTreels + { + get { return _PanelTreels; } + set { _PanelTreels = value; RaisePropertyChanged(nameof(PanelTreels)); } + } + + private Model.TreeModel _SelectedTreeNode; + /// + /// 当前选中的树形节点 + /// + public Model.TreeModel SelectedTreeNode + { + get { return _SelectedTreeNode; } + set + { + _SelectedTreeNode = value; + RaisePropertyChanged(nameof(SelectedTreeNode)); + var path= FindNodePath(PanelTreels, _SelectedTreeNode); + _eventAggregator.GetEvent().Publish(path); + } + } + + private ObservableCollection _SignalPredistributionInfos = new ObservableCollection(); + /// + /// 表格数据 + /// + public ObservableCollection SignalPredistributionInfos + { + get { return _SignalPredistributionInfos; } + set + { + _SignalPredistributionInfos = value; + RaisePropertyChanged(nameof(SignalPredistributionInfos)); + } + } + + + private string _SelectedOption1; + /// + /// 是否通讯母线 + /// + public string SelectedOption1 + { + get { return _SelectedOption1; } + set + { + _SelectedOption1 = value; + RaisePropertyChanged(nameof(SelectedOption1)); + } + } + + private string _SelectedOption2; + /// + /// 选择的信号类型 + /// + public string SelectedOption2 + { + get { return _SelectedOption2; } + set + { + _SelectedOption2 = value; + SignalColumnName = value; + RaisePropertyChanged(nameof(SelectedOption2)); + } + } + + private string _SignalColumnName; + /// + /// 信号类型列的列名 + /// + public string SignalColumnName + { + get { return _SignalColumnName; } + set + { + _SignalColumnName = value; + RaisePropertyChanged(nameof(SignalColumnName)); + if (value.Equals("Digital")) + { + SignalTypeColumn = new ObservableCollection() { "无公共端接线(断开报警NC)", "无公共端接线(闭合报警NO)", "带公共端接线(断开报警NC)", "带公共端接线(闭合报警NO)" }; + } + else if (value.Equals("4-20mA")) + { + SignalTypeColumn = new ObservableCollection() { "无源", "有源" }; + } + else if (value.Equals("-10V-10V")) + { + SignalTypeColumn = new ObservableCollection() { "无源", "有源" }; + } + else if (value.Equals("PT100")) + { + SignalTypeColumn = new ObservableCollection() { "量程100", "量程150", "量程200", "量程600" }; + } + else if (value.Equals("Pulse")) + { + SignalTypeColumn = new ObservableCollection() { "脉冲信号" }; + } + } + } + + + + private List _CommunicationFormats = new List() { "RS485", "RS482", "TCP/IP", "MQTT" }; + /// + /// 通讯格式集合 + /// + public List CommunicationFormats + { + get { return _CommunicationFormats; } + set + { + _CommunicationFormats = value; + RaisePropertyChanged(nameof(CommunicationFormats)); + } + } + + private string _CommunicationFormat = "RS485"; + /// + /// 通讯格式 + /// + public string CommunicationFormat + { + get { return _CommunicationFormat; } + set + { + _CommunicationFormat = value; + RaisePropertyChanged(nameof(CommunicationFormat)); + } + } + + private ObservableCollection _SignalTypeColumn; + /// + /// 信号类型列的下拉列表 + /// + public ObservableCollection SignalTypeColumn + { + get { return _SignalTypeColumn; } + set + { + _SignalTypeColumn = value; + RaisePropertyChanged(nameof(SignalTypeColumn)); + if (SignalPredistributionInfos != null) + { + foreach (var item in SignalPredistributionInfos) + { + item.SignalType = _SignalTypeColumn.FirstOrDefault(); + } + } + } + } + private List _InorOuts = new List() { "输出", "输入" }; + /// + /// 输入/输出列的下拉列表 + /// + public List InorOuts + { + get { return _InorOuts; } + set + { + _InorOuts = value; + RaisePropertyChanged(nameof(InorOuts)); + } + } + + #endregion + + IOModuleService _iOModuleService; + IEventAggregator _eventAggregator; + + public DialogSignalPredistributionViewModel() + { + _iOModuleService = GlobalObject.container.Resolve(); + _eventAggregator = GlobalObject.container.Resolve(); + + } + public string Title => ""; + + public event Action RequestClose; + + public bool CanCloseDialog() + { + return true; + } + + public void OnDialogClosed() + { + + } + + private ec_Cable CableBy; + public async void OnDialogOpened(IDialogParameters parameters) + { + title = $"电缆信号({parameters.GetValue(GlobalObject.dialogPar.para2.ToString())})预分配"; + //树形结构数据 + PanelTreels.AddRange(await _iOModuleService.GetPanelTree()); + //电缆信息 + CableBy = parameters.GetValue(GlobalObject.dialogPar.para1.ToString()); + //是否母线 + if (CableBy.CableClass.Equals("homerun")) + { + SelectedOption1 = "是"; + } + else if (CableBy.CableClass.Equals("conventional") || CableBy.CableClass.Equals("")) + { + SelectedOption1 = "否"; + + } + //设置默认信号类型 + if (string.IsNullOrEmpty(CableBy.PreAssignIOType)) + { + SelectedOption2 = "Digital"; + } + else + { + SelectedOption2 = CableBy.PreAssignIOType; + } + + //设置表格数据 + int index = 0; + foreach (var Set in CableBy.Sets) + { + SignalPredistributionInfo predistributionInfo = new SignalPredistributionInfo(); + predistributionInfo.CablePair = Set.CableSetName; + foreach (var Wire in Set.Wires) + { + index++; + predistributionInfo.Index.Add(index.ToString()); + predistributionInfo.CableWires.Add(Wire); + predistributionInfo.Polaritys.Add(Wire); + } + if (string.IsNullOrEmpty(Set.PreAssignIOTypeDetail)) + { + predistributionInfo.SignalType = SignalTypeColumn.FirstOrDefault(); + } + else + { + predistributionInfo.SignalType = Set.PreAssignIOTypeDetail; + } + predistributionInfo.ChineseDescription = Set.PreAssignGroup_Desc; + predistributionInfo.EnglishDescription = Set.PreAssignGroup_Desc_EN; + + if (string.IsNullOrEmpty(Set.PreAssignInOrOut)) + { + predistributionInfo.InorOut = InorOuts.FirstOrDefault(); + } + else + { + predistributionInfo.InorOut = Set.PreAssignInOrOut; + } + predistributionInfo.SensorCode = Set.PreAssignSensorCode; + + + SignalPredistributionInfos.Add(predistributionInfo); + } + //是否预关联,有则选中节点 + foreach (var Panel in PanelTreels) + { + if (!string.IsNullOrEmpty(Panel.ID)) + { + if (Panel.ID.Equals(CableBy.PanelID)) + { + SelectedTreeNode = Panel; + break; + } + } + foreach (var Child in Panel.ChildNodes) + { + if (!string.IsNullOrEmpty(Child.ID)) + { + if (Child.ID.Equals(CableBy.PanelID)) + { + SelectedTreeNode = Child; + break; + } + } + } + } + + + } + public override async void ExecuteOKCommandAsync(object para) + { + //创建SaveCable接口实例 + ec_Cable newCable = new ec_Cable(); + if (SelectedOption1.Equals("是")) + { + newCable.CableClass = "homerun"; + newCable.PreAssignIOType = CommunicationFormat; + } + else + { + newCable.CableClass = "conventional"; + newCable.PreAssignIOType = SelectedOption2; + } + + newCable.CableID = CableBy.CableID; + newCable.EngineerDataID = CableBy.EngineerDataID; + if (SelectedTreeNode != null) + { + newCable.PanelID = SelectedTreeNode.ID; + } + else + { + MessageBox.Show("请选择系统柜!", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); + return; + } + + newCable.UpdateUserID = GlobalObject.userInfo.userId; + newCable.Sets = new List(); + foreach (var CableBySet in CableBy.Sets) + { + ec_CableSet newCableSet = new ec_CableSet(); + newCableSet.CableSetID = CableBySet.CableSetID; + newCableSet.CableSetName = CableBySet.CableSetName; + newCableSet.CableSetSeq = CableBySet.CableSetSeq; + newCableSet.IsConned = CableBySet.IsConned; + newCableSet.PreAssignGroup_Desc = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).ChineseDescription; + newCableSet.PreAssignGroup_Desc_EN = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).EnglishDescription; + newCableSet.PreAssignIOTypeDetail = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).SignalType; + newCableSet.PreAssignInOrOut = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).InorOut; + newCableSet.PreAssignSensorCode = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).SensorCode; + newCableSet.Wires = new List(); + foreach (var wire in CableBySet.Wires) + { + ec_CableSetWire newWire = new ec_CableSetWire(); + newWire.Polarity = wire.Polarity; + newWire.SetLevel = 0; + newWire.WireID = wire.WireID; + newWire.Wire_Tag = wire.Wire_Tag; + newWire.Wire_Color_ID = wire.Wire_Color_ID; + newWire.PreAssignChannelTermNo = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).CableWires.FirstOrDefault(c => c.Wire_Tag.Equals(wire.Wire_Tag)).PreAssignChannelTermNo; + + newCableSet.Wires.Add(newWire); + } + newCable.Sets.Add(newCableSet); + } + + var httpres = await _iOModuleService.SaveCable(newCable); + + IDialogParameters res = new Prism.Services.Dialogs.DialogParameters(); + //res.Add(GlobalObject.dialogPar.info.ToString(), TagNumber); + RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res)); + } + public override void ExecuteCloseCommand(object parameter) + { + if (parameter as string == "ClickNo") + { + DialogResult res = new DialogResult(ButtonResult.No); + RequestClose.Invoke(res); + } + else + { + RequestClose.Invoke(new DialogResult(ButtonResult.Cancel)); + } + this.Dispose(); + } + #region 方法 + public ICommand ButtonCmd => new DelegateCommand(Button_Click); + /// + /// 页面左侧按钮 + /// + /// + public virtual async void Button_Click(object parameter) + { + #region 清除配置 + if (parameter.ToString().Equals("清除配置")) + { + + MessageBoxResult result = MessageBox.Show($"确定删除“{ CableBy.TagNumber}”电缆配置?", "KunHengCAD", MessageBoxButton.OKCancel, MessageBoxImage.Question); + if (result == MessageBoxResult.OK) + { + var httpres = await _iOModuleService.DeleteCableProfile(CableBy.CableID); + if (httpres == null) + { + RequestClose.Invoke(new DialogResult(ButtonResult.Cancel)); + this.Dispose(); + } + } + return; + } + #endregion + + #region 指定中英文 + if (parameter.ToString().Equals("指定中英文")) + { + //SelectedTreeNode = PanelTreels[2].ChildNodes.LastOrDefault(); + return; + } + #endregion + } + + + #region 查找节点路径 + public List FindNodePath(ObservableCollection nodes, TreeModel targetNode) + { + List path = new List(); + FindNodePathRecursive(nodes, targetNode, path); + return path; + } + + private bool FindNodePathRecursive(IEnumerable nodes, TreeModel targetNode, List currentPath) + { + foreach (var node in nodes) + { + currentPath.Add(node.Text); + if (node == targetNode) return true; // 找到目标节点,返回True并结束搜索 + if (node.ChildNodes.Count > 0 && FindNodePathRecursive(node.ChildNodes, targetNode, currentPath)) + return true; // 在子节点中继续搜索并找到目标节点,返回True并结束搜索 + currentPath.RemoveAt(currentPath.Count - 1); // 回溯,尝试下一个兄弟节点或父节点的其他兄弟节点 + } + return false; // 没有找到目标节点,返回False + } + #endregion + + + + #endregion + + } + + public class SignalPredistributionInfo : DialogBase + { + #region 字段 + private ObservableCollection _Index = new ObservableCollection(); + /// + /// 序号集合 + /// + public ObservableCollection Index + { + get { return _Index; } + set { _Index = value; } + } + + private string _CablePair; + /// + /// 电缆对 + /// + public string CablePair + { + get { return _CablePair; } + set { _CablePair = value; } + } + + private ObservableCollection _CableWires = new ObservableCollection(); + /// + /// 电缆线号 + /// + public ObservableCollection CableWires + { + get { return _CableWires; } + set { _CableWires = value; } + } + + private ObservableCollection _Polaritys = new ObservableCollection(); + /// + /// 极性 + /// + public ObservableCollection Polaritys + { + get { return _Polaritys; } + set + { + _Polaritys = value; + RaisePropertyChanged(nameof(Polaritys)); + } + } + + private string _SignalType; + /// + /// 信号类型 + /// + public string SignalType + { + get { return _SignalType; } + set + { + _SignalType = value; + RaisePropertyChanged(nameof(SignalType)); + } + } + + + private string _ChineseDescription; + /// + /// 中文描述 + /// + public string ChineseDescription + { + get { return _ChineseDescription; } + set + { + _ChineseDescription = value; + RaisePropertyChanged(nameof(ChineseDescription)); + } + } + + private string _EnglishDescription; + /// + /// 英文描述 + /// + public string EnglishDescription + { + get { return _EnglishDescription; } + set + { + _EnglishDescription = value; + RaisePropertyChanged(nameof(EnglishDescription)); + } + } + + private string _InorOut; + /// + /// 输入/输出 + /// + public string InorOut + { + get { return _InorOut; } + set + { + _InorOut = value; + RaisePropertyChanged(nameof(InorOut)); + } + } + + private string _SensorCode; + /// + /// 传感器编号 + /// + public string SensorCode + { + get { return _SensorCode; } + set + { + _SensorCode = value; + RaisePropertyChanged(nameof(SensorCode)); + } + } + + + private ObservableCollection _Terms = new ObservableCollection(); + /// + /// 端子号集合 + /// + public ObservableCollection Terms + { + get { return _Terms; } + set { _Terms = value; } + } + #endregion + } + +} diff --git a/newFront/c#前端/SWS.CAD/ViewModels/LoginViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/LoginViewModel.cs index 70478749..3abf8b69 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/LoginViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/LoginViewModel.cs @@ -92,7 +92,7 @@ namespace SWS.CAD.ViewModels { sPASSWORD = GlobalObject.userInfo.userPs; } - curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port)); + curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort"); } public override async void ExecuteOKCommandAsync(object obj) { diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml index 421fc741..d9d29926 100644 --- a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml @@ -248,7 +248,6 @@ - @@ -265,7 +264,6 @@ - @@ -283,7 +281,6 @@ - @@ -501,6 +498,9 @@ ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}" PreviewMouseRightButtonDown="RadTreeView_PreviewMouseRightButtonDown" Margin="5" telerik:StyleManager.Theme="Office_Blue" AllowDrop="True" + AutoScrollToSelectedItem="True" + IsVirtualizing="True" + telerik:TextSearch.TextPath="Text" > diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml.cs b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml.cs index b0db9979..16f301ee 100644 --- a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml.cs +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml.cs @@ -1,10 +1,17 @@  +using System; +using System.Collections.Generic; +using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; +using Prism.Events; +using SWS.CAD.Event; using SWS.CAD.ViewModels; +using SWS.Commons; using Telerik.Windows.Controls; +using Unity; namespace SWS.CAD.Views.Dialog { @@ -13,14 +20,19 @@ namespace SWS.CAD.Views.Dialog /// public partial class DialogIODistribution : UserControl { + IEventAggregator _eventAggregator; + public DialogIODistribution() { InitializeComponent(); DataContext = new DialogIODistributionViewModel(); + _eventAggregator = GlobalObject.container.Resolve(); + _eventAggregator.GetEvent().Subscribe(ScrollToSelectedItem, ThreadOption.UIThread, true); } private void RadTreeView_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) { + var treeView = sender as RadTreeView; var originalSource = e.OriginalSource as DependencyObject; @@ -80,5 +92,13 @@ namespace SWS.CAD.Views.Dialog return source as T; } + // 滚动到选中项 + private void ScrollToSelectedItem(object path) + { + var pathls = path as List; + var ph = string.Join("\\", pathls); + treeView1.BringPathIntoView(ph); + } + } } diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml new file mode 100644 index 00000000..2e526ce3 --- /dev/null +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml @@ -0,0 +1,471 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml.cs b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml.cs new file mode 100644 index 00000000..c38053d8 --- /dev/null +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSignalPredistribution.xaml.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Threading; +using Prism.Events; +using SWS.CAD.Event; +using SWS.Commons; +using SWS.Model; +using Telerik.Windows.Controls; +using Unity; + +namespace SWS.CAD.Views.Dialog +{ + /// + /// DialogSignalPredistribution.xaml 的交互逻辑 + /// + public partial class DialogSignalPredistribution : UserControl + { + IEventAggregator _eventAggregator; + + public DialogSignalPredistribution() + { + InitializeComponent(); + _eventAggregator = GlobalObject.container.Resolve(); + _eventAggregator.GetEvent().Subscribe(ScrollToSelectedItem, ThreadOption.UIThread, true); + } + + // 滚动到选中项 + private void ScrollToSelectedItem(object path) + { + var pathls = path as List; + var ph = string.Join("\\", pathls); + treeView1.BringPathIntoView(ph); + } + } + + +} diff --git a/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml b/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml index 05ccc353..223f6291 100644 --- a/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml @@ -1455,10 +1455,9 @@ - + - + diff --git a/newFront/c#前端/SWS.Commons/GlobalObject.cs b/newFront/c#前端/SWS.Commons/GlobalObject.cs index 85db596a..e30abe91 100644 --- a/newFront/c#前端/SWS.Commons/GlobalObject.cs +++ b/newFront/c#前端/SWS.Commons/GlobalObject.cs @@ -84,6 +84,7 @@ namespace SWS.Commons public static List designTree = new List(); #endregion + public enum DBConst { /// @@ -154,10 +155,11 @@ namespace SWS.Commons { if (string.IsNullOrEmpty(_LocalFileDirectory)) { - string path = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Config.ini"); - FileIniDataParser parser = new FileIniDataParser(); - var data = parser.ReadFile(path); - _LocalFileDirectory = data["Profile"]["Directory"]; + //string path = configPath; + //FileIniDataParser parser = new FileIniDataParser(); + //var data = parser.ReadFile(path); + //_LocalFileDirectory = data["Profile"]["strLocalWorkDir"]; + _LocalFileDirectory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir"); return _LocalFileDirectory; } else diff --git a/newFront/c#前端/SWS.Commons/Helper/Converter/RadioButtonValueConverter.cs b/newFront/c#前端/SWS.Commons/Helper/Converter/RadioButtonValueConverter.cs new file mode 100644 index 00000000..fa72d695 --- /dev/null +++ b/newFront/c#前端/SWS.Commons/Helper/Converter/RadioButtonValueConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using SWS.Model; + +namespace SWS.Commons.Helper.Converter +{ + public class RadioButtonValueConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is string isChecked) + { + if (isChecked.Equals(parameter.ToString())) + { + return true; + } + else + { + return false; + } + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is bool isChecked) + { + return parameter.ToString(); + } + return parameter.ToString(); + } + } +} diff --git a/newFront/c#前端/SWS.Commons/Helper/IniHelper.cs b/newFront/c#前端/SWS.Commons/Helper/IniHelper.cs new file mode 100644 index 00000000..aab824ef --- /dev/null +++ b/newFront/c#前端/SWS.Commons/Helper/IniHelper.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace SWS.Commons +{ + public static class IniHelper + { + [DllImport("kernel32", CharSet = CharSet.Unicode)] + private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); + [DllImport("kernel32", CharSet = CharSet.Unicode)] + private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); + + /// + ///读取ini文件数据 + /// + /// 段 + /// 键名 + /// 默认值 + /// 文件路径 + /// 读出内容 + public static string ReadValueFromIniFile(string Section, string Key, string def=null, string filePath= null) + { + if (def == null) + { def = ""; } + if (filePath == null) + { + filePath = GlobalObject.configPath; + } + StringBuilder temp = new StringBuilder(4096); + int i = GetPrivateProfileString(Section, Key, def, temp, 4096, filePath); + return temp.ToString(); + } + + /// + /// 写入数据到ini文件 + /// + /// 段 + /// 键名 + /// 键值 + /// 文件路径 + public static void WriteValueFromIniFile(string Section, string Key, string Value, string filePath = null) + { + if (filePath == null) + { + filePath = GlobalObject.configPath; + } + WritePrivateProfileString(Section, Key, Value, filePath); + } + } +} diff --git a/newFront/c#前端/SWS.Commons/Helper/LoggerHelper.cs b/newFront/c#前端/SWS.Commons/Helper/LoggerHelper.cs index 4079da72..fde9743d 100644 --- a/newFront/c#前端/SWS.Commons/Helper/LoggerHelper.cs +++ b/newFront/c#前端/SWS.Commons/Helper/LoggerHelper.cs @@ -24,6 +24,8 @@ namespace SWS.Commons string dllPath = codeBase.Replace("file:///", ""); dllPath = Path.GetDirectoryName(dllPath); logPath = Path.Combine(dllPath, "Logs\\"); + if (!Directory.Exists(logPath)) + { Directory.CreateDirectory(logPath); } var configFile = new FileInfo(Path.Combine(dllPath, "log4net.config")); log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile); } diff --git a/newFront/c#前端/SWS.Commons/SWS.Commons.csproj b/newFront/c#前端/SWS.Commons/SWS.Commons.csproj index 64cae859..5731f7dc 100644 --- a/newFront/c#前端/SWS.Commons/SWS.Commons.csproj +++ b/newFront/c#前端/SWS.Commons/SWS.Commons.csproj @@ -106,10 +106,12 @@ + + diff --git a/newFront/c#前端/SWS.Commons/SWS.Commons.csproj.user b/newFront/c#前端/SWS.Commons/SWS.Commons.csproj.user index a607660d..0b246432 100644 --- a/newFront/c#前端/SWS.Commons/SWS.Commons.csproj.user +++ b/newFront/c#前端/SWS.Commons/SWS.Commons.csproj.user @@ -1,6 +1,6 @@ - ShowAllFiles + ProjectFiles \ No newline at end of file diff --git a/newFront/c#前端/SWS.Electrical/GlobalObj.cs b/newFront/c#前端/SWS.Electrical/GlobalObj.cs index 7e9f6642..33f5af5c 100644 --- a/newFront/c#前端/SWS.Electrical/GlobalObj.cs +++ b/newFront/c#前端/SWS.Electrical/GlobalObj.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -11,6 +12,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using IniParser; +using IniParser.Model; using Newtonsoft.Json; using Prism.Ioc; using SWS.Commons; @@ -41,17 +43,29 @@ namespace SWS.Electrical { try { - var data = configIni.ReadFile(GlobalObject.configPath); - string token = data["LoginInfo"]["LoginToken"]; - string loginkey = data["LoginInfo"]["LoginMark"]; - string curProjId = data["LoginInfo"]["CurProjId"]; - LocalWorkDir= data["Profile"]["strLocalWorkDir"]; - string address = data["Profile"]["strIPAddress"]; - string port = data["Profile"]["nPort"]; - string dbType = data["Profile"]["nConType"]; + //var parser = new FileIniDataParser(); + //string[] lines = File.ReadAllLines(GlobalObject.configPath); + //IniData data = parser.Parser.Parse(File.ReadAllText(GlobalObject.configPath)); + //var data = configIni.ReadFile(GlobalObject.configPath); + //string token = data["LoginInfo"]["LoginToken"]; + //string loginkey = data["LoginInfo"]["LoginMark"]; + //string curProjId = data["LoginInfo"]["CurProjId"]; + //LocalWorkDir= data["Profile"]["strLocalWorkDir"]; + //string address = data["Profile"]["strIPAddress"]; + //string port = data["Profile"]["nPort"]; + //string dbType = data["Profile"]["nConType"]; + //string domain= data["Profile"]["strDomainName"]; + string token = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginToken"); + string loginkey = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginMark"); + string curProjId = IniHelper.ReadValueFromIniFile("LoginInfo", "CurProjId"); + LocalWorkDir = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir"); + string address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress"); + string port = IniHelper.ReadValueFromIniFile("Profile", "nPort"); + string dbType = IniHelper.ReadValueFromIniFile("Profile", "nConType"); + string domain = IniHelper.ReadValueFromIniFile("Profile", "strDomainName"); if (dbType == "1") { - string strDomain = data["Profile"]["strDomainName"]; + string strDomain = domain; GlobalObject.client = new HttpClient() { BaseAddress = new Uri($"{strDomain}/api/"), diff --git a/newFront/c#前端/SWS.Electrical/SWS.Electrical.csproj b/newFront/c#前端/SWS.Electrical/SWS.Electrical.csproj index 088f77c2..49271b7a 100644 --- a/newFront/c#前端/SWS.Electrical/SWS.Electrical.csproj +++ b/newFront/c#前端/SWS.Electrical/SWS.Electrical.csproj @@ -153,6 +153,7 @@ + diff --git a/newFront/c#前端/SWS.Electrical/Start.cs b/newFront/c#前端/SWS.Electrical/Start.cs index 1f6ac95b..b7fb52ca 100644 --- a/newFront/c#前端/SWS.Electrical/Start.cs +++ b/newFront/c#前端/SWS.Electrical/Start.cs @@ -63,6 +63,7 @@ namespace SWS.Electrical GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); + GlobalObject._prismContainer.RegisterDialog(); GlobalObject._prismContainer.RegisterDialog(); } diff --git a/newFront/c#前端/SWS.Electrical/ViewModels/DialogAutoArrangeLayoutViewModel.cs b/newFront/c#前端/SWS.Electrical/ViewModels/DialogAutoArrangeLayoutViewModel.cs index 1a86e4f3..28e9954f 100644 --- a/newFront/c#前端/SWS.Electrical/ViewModels/DialogAutoArrangeLayoutViewModel.cs +++ b/newFront/c#前端/SWS.Electrical/ViewModels/DialogAutoArrangeLayoutViewModel.cs @@ -130,6 +130,7 @@ namespace SWS.Electrical.ViewModels if (value != this._selectRange) { this._selectRange = value; + RangeChange(value); RaisePropertyChanged(nameof(selectRange)); } } @@ -167,6 +168,22 @@ namespace SWS.Electrical.ViewModels } } } + private ObservableCollection _listValue; + /// + /// 输入值 列表 + /// + public ObservableCollection listValue + { + get { return this._listValue; } + set + { + if (value != this._listValue) + { + this._listValue = value; + RaisePropertyChanged(nameof(listValue)); + } + } + } private string _inputValue = ""; /// /// 输入值 @@ -195,11 +212,15 @@ namespace SWS.Electrical.ViewModels EnginedataService _ServiceEnginedata; ObjectTypeService _ServiceObjectType; ProjectSettingsService _ServiceProjectSettings; + DataItemService _ServiceDataItem; List listTagNumberSucc = new List(); private bool isSearch = false;//是否正在查询 private bool isDrawing = false;//是否正在画图 private string dwgName = string.Empty; private List listLibraryTagName = new List();//元件图纸上的位号属性名称, + private List listDeck=new List();//甲板号值列表 + private List listArea = new List();//区域值列表 + private List listSystem = new List();//所属系统值列表 public DialogAutoArrangeLayoutViewModel() { Command_StartDrawing = new DelegateCommand(onStartDrawing); @@ -215,6 +236,7 @@ namespace SWS.Electrical.ViewModels _ServiceEnginedata = GlobalObject.container.Resolve(); _ServiceObjectType = GlobalObject.container.Resolve(); _ServiceProjectSettings = GlobalObject.container.Resolve(); + _ServiceDataItem= GlobalObject.container.Resolve(); listDrawings = new ObservableCollection(); listBasePoint = new ObservableCollection(); listMsg = new ObservableCollection(); @@ -223,7 +245,6 @@ namespace SWS.Electrical.ViewModels list.Add(new KeyValueModel { Key = "区域", Value = "区域" }); list.Add(new KeyValueModel { Key = "所属系统", Value = "所属系统" }); listRange = new ObservableCollection(list); - selectRange = listRange[0]; listOperator = new ObservableCollection() { new KeyValueModel { Key = "等于", Value = "=" } }; @@ -243,7 +264,33 @@ namespace SWS.Electrical.ViewModels { } - + private List GetChildNodes(TreeModel treeModel) + { + List listModel = new List(); + if (treeModel.ChildNodes != null && treeModel.ChildNodes.Any()) + { + foreach (var item in treeModel.ChildNodes) + { + if (item.NodeType == "1") + { + listModel.Add(item); + } + else + { + var list = GetChildNodes(item); + if (list.Any()) + { + listModel.AddRange(list); + } + } + } + return listModel; + } + else + { + return listModel; + } + } public async void OnDialogOpened(IDialogParameters parameters) { try @@ -259,8 +306,19 @@ namespace SWS.Electrical.ViewModels if (item.NodeType == "1") { listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text }); - ec_drawing_file dwgFile = JsonConvert.DeserializeObject(model.NodeExtData.ToString()); - + } + else + { + if (item.Text == "封面、目录、设计说明" || item.Text == "材料表") + { continue; } + var list = GetChildNodes(item); + if (list.Any()) + { + foreach (var dto in list) + { + listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text }); + } + } } } } @@ -289,14 +347,24 @@ namespace SWS.Electrical.ViewModels if (item.NodeType == "1") { listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text }); - ec_drawing_file dwgFile = JsonConvert.DeserializeObject(model.NodeExtData.ToString()); - + } + else + { + if (item.Text == "封面、目录、设计说明" || item.Text == "材料表") + { continue; } + var list = GetChildNodes(item); + if (list.Any()) + { + foreach (var dto in list) + { + listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text }); + } + } } } } } AddMsg($"布置图列表加载完成!"); - } var settingModel = await _ServiceProjectSettings.GetEntity("布置图图例显示位号名称"); if (settingModel == null) @@ -304,16 +372,48 @@ namespace SWS.Electrical.ViewModels listLibraryTagName.Add("位号");//默认 } else { listLibraryTagName = settingModel.SettingValue.Split(',').ToList(); } - + //区域下拉框对应值列表 + var listDetail = await _ServiceDataItem.GetDetails("Area"); + if (listDetail != null && listDetail.Any()) + { + foreach (var item in listDetail) + { listArea.Add(new KeyValueModel() { Key=item.DataItemName, Value=item.DataItemName }); } + } + //甲板号下拉框对应值列表 + listDetail = await _ServiceDataItem.GetDetails("甲板号"); + if (listDetail != null && listDetail.Any()) + { + foreach (var item in listDetail) + { listDeck.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); } + } + //所属系统下拉框对应值列表 + listDetail = await _ServiceDataItem.GetDetails("Be_DrawingSystem"); + if (listDetail != null && listDetail.Any()) + { + foreach (var item in listDetail) + { listSystem.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); } + } + selectRange = listRange[0]; } catch (Exception ex) { MessageBox.Show("DialogOpened异常:" + ex.Message); } - //selectRange = listRange[2]; - //inputValue = "声力电话"; } - + /// + /// 下拉值列表绑定 + /// + /// + private void RangeChange(KeyValueModel model) + { + inputValue = ""; + if (model.Value == "甲板号") + { listValue = new ObservableCollection(listDeck); } + else if (model.Value == "区域") + { listValue = new ObservableCollection(listArea); } + else if (model.Value == "所属系统") + { listValue = new ObservableCollection(listSystem); } + } /// /// 获取基点信息 /// diff --git a/newFront/c#前端/SWS.Electrical/Views/DialogAutoArrangeLayout.xaml b/newFront/c#前端/SWS.Electrical/Views/DialogAutoArrangeLayout.xaml index 31ec28f3..f466f2f8 100644 --- a/newFront/c#前端/SWS.Electrical/Views/DialogAutoArrangeLayout.xaml +++ b/newFront/c#前端/SWS.Electrical/Views/DialogAutoArrangeLayout.xaml @@ -178,13 +178,22 @@ FontSize="16" ItemsSource="{Binding listOperator}" SelectedItem="{Binding selectOperator, Mode=TwoWay}" /> - - + // 此代码由工具生成。 @@ -85,7 +85,7 @@ namespace SWS.Electrical.Views { #line hidden - #line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml" + #line 220 "..\..\..\Views\DialogAutoArrangeLayout.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.DataGrid dgTag; diff --git a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.i.cs b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.i.cs index 48c6c684..d70c25de 100644 --- a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.i.cs +++ b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8006F31A06196293D0E58F4239B97FC4F768BCF414C1B4C2472A1C22D26CF0B1" +#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "55992553F782D436B236E9D0626B49AE48376927B5906F253898CDC4189B1D22" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -85,7 +85,7 @@ namespace SWS.Electrical.Views { #line hidden - #line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml" + #line 220 "..\..\..\Views\DialogAutoArrangeLayout.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.DataGrid dgTag; diff --git a/newFront/c#前端/SWS.Electrical/配置说明.docx b/newFront/c#前端/SWS.Electrical/配置说明.docx new file mode 100644 index 00000000..71cbefd5 --- /dev/null +++ b/newFront/c#前端/SWS.Electrical/配置说明.docx @@ -0,0 +1,10 @@ + + +第1步:把文件拷贝到D盘文件夹[SWS.Electrical]里面 +第2步:在坤恒CAD的安装目录里,找到文件:on_start.lsp ,用记事本打开 + + +第3步:把下面一行命令,添加到最下面 +(command "netload" "D:\\SWS.Electrical\\SWS.Electrical.dll") + +PS:存放文件夹路径可以自己定 diff --git a/newFront/c#前端/SWS.Service/ConfigService.cs b/newFront/c#前端/SWS.Service/ConfigService.cs index 7c2c292f..8b224cde 100644 --- a/newFront/c#前端/SWS.Service/ConfigService.cs +++ b/newFront/c#前端/SWS.Service/ConfigService.cs @@ -2,6 +2,7 @@ using SWS.Commons; using System; using System.IO; +using static System.Collections.Specialized.BitVector32; namespace SWS.Service { @@ -16,13 +17,12 @@ namespace SWS.Service void SetDefaultConfigValue() { if (!File.Exists(path)) - {//默认值 + { + //默认值 var data = parser.Parser.Parse(""); data["Profile"]["strIPAddress"] = "1.117.161.11"; data["Profile"]["nPort"] = "8080"; string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); - - data["Profile"]["strLocalWorkDir"] = $"{userProfilePath}\\AppData\\Roaming\\BricsCAD Electrical"; Directory.CreateDirectory(Path.GetDirectoryName(path)); parser.WriteFile(path, data); @@ -40,17 +40,23 @@ namespace SWS.Service string address; int port; string locDrawingPath; - Read(out address, out port,out locDrawingPath); + Read(out address, out port, out locDrawingPath); _httpService.Init(address, port); - } + } public void Read(out string address, out int port, out string directory) { - var data = parser.ReadFile(path); - address = data["Profile"]["strIPAddress"]; - port = int.Parse(data["Profile"]["nPort"]); - directory = data["Profile"]["strLocalWorkDir"]; + //var data = parser.ReadFile(path); + //address = data["Profile"]["strIPAddress"]; + //port = int.Parse(data["Profile"]["nPort"]); + //directory = data["Profile"]["strLocalWorkDir"]; + + address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress"); + string portString = IniHelper.ReadValueFromIniFile("Profile", "nPort"); + int.TryParse(portString?.Trim(), out port); + //port = int.Parse(IniHelper.ReadValueFromIniFile("Profile", "nPort")); + directory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir"); } - + /// /// 查询某个 /// @@ -58,8 +64,11 @@ namespace SWS.Service /// public string Read(string keyName) { - var data = parser.ReadFile(path); - return data["Profile"][keyName]; + //var data = parser.ReadFile(path); + //return data["Profile"][keyName]; + + var data = IniHelper.ReadValueFromIniFile("Profile", keyName); + return data; } /// /// 查询某个 @@ -67,14 +76,17 @@ namespace SWS.Service /// 节点 /// key名称 /// - public string Read(string session,string keyName) + public string Read(string session, string keyName) { try - { - var data = parser.ReadFile(path); - return data[session][keyName]; + { + //var data = parser.ReadFile(path); + //return data[session][keyName]; + + var data = IniHelper.ReadValueFromIniFile(session, keyName); + return data; } - catch + catch { return null; } @@ -86,9 +98,10 @@ namespace SWS.Service /// public void Save(string keyName, string value) { - var data = parser.ReadFile(path); - data["Profile"][keyName] = value; - parser.WriteFile(path, data); + //var data = parser.ReadFile(path); + //data["Profile"][keyName] = value; + //parser.WriteFile(path, data); + IniHelper.WriteValueFromIniFile("Profile", keyName, value); } /// /// 保存某个值 @@ -98,9 +111,11 @@ namespace SWS.Service /// 值 public void Save(string session, string keyName, string value) { - var data = parser.ReadFile(path); - data[session][keyName] = value; - parser.WriteFile(path, data); + //var data = parser.ReadFile(path); + //data[session][keyName] = value; + //parser.WriteFile(path, data); + + IniHelper.WriteValueFromIniFile(session, keyName, value); } } } diff --git a/newFront/c#前端/SWS.Service/DataItemService.cs b/newFront/c#前端/SWS.Service/DataItemService.cs index 0cd7fb75..eb9459e2 100644 --- a/newFront/c#前端/SWS.Service/DataItemService.cs +++ b/newFront/c#前端/SWS.Service/DataItemService.cs @@ -50,16 +50,16 @@ namespace SWS.Service public async Task SaveDetailForm(ec_dataitemdetail entity) { var res = await this.PostBodyAsync($"DataItemApi/SaveDetailForm?ProjectId={GlobalObject.curProject?.ProjectId}", entity); - if (res.code == 200) - { - //return res.info; - return null; - } - else - { - return res.info; // 返回错误信息 - } - + //if (res.code == 200) + //{ + // //return res.info; + // return null; + //} + //else + //{ + // return res.info; // 返回错误信息 + //} + return res; } } } diff --git a/newFront/c#前端/SWS.Service/IOModuleService.cs b/newFront/c#前端/SWS.Service/IOModuleService.cs index aa1eab8f..7fc4aff5 100644 --- a/newFront/c#前端/SWS.Service/IOModuleService.cs +++ b/newFront/c#前端/SWS.Service/IOModuleService.cs @@ -139,16 +139,16 @@ namespace SWS.Service public async Task CreatePanelStripByProfile(ec_PanelStrip entity) { var res = await this.PostBodyAsync($"IOModuleApi/CreatePanelStripByProfile?projId={GlobalObject.curProject?.ProjectId}", entity); - if (res.code == 200) - { - //return res.info; - return null; - } - else - { - return res.info; // 返回错误信息 - } - + //if (res.code == 200) + //{ + // //return res.info; + // return null; + //} + //else + //{ + // return res.info; // 返回错误信息 + //} + return res; } public async Task DeletePanel(string PanelID) diff --git a/newFront/c#前端/SWS.WPF/SWS.WPF.csproj b/newFront/c#前端/SWS.WPF/SWS.WPF.csproj index 47f9463f..761f1452 100644 --- a/newFront/c#前端/SWS.WPF/SWS.WPF.csproj +++ b/newFront/c#前端/SWS.WPF/SWS.WPF.csproj @@ -126,6 +126,7 @@ + @@ -137,6 +138,9 @@ CustomDialogWindow.xaml + + DialogAssociatedSignal.xaml + DialogAllOutputSignal.xaml @@ -200,6 +204,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/newFront/c#前端/SWS.WPF/Style/CustomStyles.xaml b/newFront/c#前端/SWS.WPF/Style/CustomStyles.xaml index 8fd93801..583627d5 100644 --- a/newFront/c#前端/SWS.WPF/Style/CustomStyles.xaml +++ b/newFront/c#前端/SWS.WPF/Style/CustomStyles.xaml @@ -1,10 +1,10 @@  @@ -579,7 +579,7 @@ - + diff --git a/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogAssociatedSignalViewModel.cs b/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogAssociatedSignalViewModel.cs new file mode 100644 index 00000000..4fb07ae9 --- /dev/null +++ b/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogAssociatedSignalViewModel.cs @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Windows.Input; +using Prism.Services.Dialogs; +using Prism.Ioc; +using SWS.Commons; +using SWS.Model; +using SWS.Service; +using SWS.WPF.Views; +using Telerik.Windows.Controls; +using Unity; +using DialogParameters = Prism.Services.Dialogs.DialogParameters; +using System.Windows; + +namespace SWS.WPF.ViewModels +{ + public class DialogAssociatedSignalViewModel : DialogBase, IDialogAware + { + #region 属性 + private ObservableCollection _MySignals = new ObservableCollection(); + /// + /// 表格数据源 + /// + public ObservableCollection MySignals + { + get { return _MySignals; } + set { _MySignals = value; RaisePropertyChanged(nameof(MySignals)); } + } + private SignalManagementInfo _SelectedSignal; + /// + /// 选中行 + /// + public SignalManagementInfo SelectedSignal + { + get { return _SelectedSignal; } + set { _SelectedSignal = value; RaisePropertyChanged(nameof(SelectedSignal)); } + } + + + private string _Info; + /// + /// 列表上方文字 + /// + public string Info + { + get { return _Info; } + set { _Info = value; RaisePropertyChanged(nameof(Info)); } + } + + private Visibility _IsVisibility = Visibility.Collapsed; + /// + /// 控制取消关联按钮是否可见 + /// + public Visibility IsVisibility + { + get { return _IsVisibility; } + set + { + _IsVisibility = value; + RaisePropertyChanged(nameof(IsVisibility)); + } + } + + /// + /// 信号接口服务 + /// + WireGroupService _wireGroupService; + + public DialogSignalNotice SignalNoticeView { get; set; } + + + + + + #endregion + + + public DialogAssociatedSignalViewModel() + { + + _wireGroupService = GlobalObject.container.Resolve(); + } + + + public string Title => ""; + + public event Action RequestClose; + + public bool CanCloseDialog() + { + return true; + } + + public void OnDialogClosed() + { + + } + + public async void OnDialogOpened(IDialogParameters parameters) + { + title = parameters.GetValue(GlobalObject.dialogPar.title.ToString()); + Info = parameters.GetValue(GlobalObject.dialogPar.info.ToString()); + + + var signals = parameters.GetValue>(GlobalObject.dialogPar.para1.ToString()); + foreach (var item in signals) + { + if (title.Equals("信号选择框")) + { + if (item.type.Equals("信号")) + { + MySignals.Add(item); + } + } + else if (title.Equals("信号关联列表")) + { + MySignals.Add(item); + IsVisibility = Visibility.Visible; + } + + } + + } + public override void ExecuteOKCommandAsync(object para) + { + IDialogParameters par = new DialogParameters(); + if (title.Equals("信号选择框")) + { + if (SelectedSignal == null) + { + MessageBox.Show("请选择一个信号!"); + return; + } + } + else if (title.Equals("信号关联列表")) + { + //如何是取消关联,则把取消的列表传回去 + par.Add(GlobalObject.dialogPar.para2.ToString(), CancelAssociationls); + } + + par.Add(GlobalObject.dialogPar.para1.ToString(), SelectedSignal); + DialogResult result = new DialogResult(ButtonResult.Yes, par); + RequestClose.Invoke(result); + } + public override void ExecuteCloseCommand(object parameter) + { + if (parameter as string == "ClickNo") + { + DialogResult result = new DialogResult(ButtonResult.No); + RequestClose.Invoke(result); + } + else + { + DialogResult result = new DialogResult(ButtonResult.Cancel); + RequestClose.Invoke(result); + } + this.Dispose(); + } + + //全局的取消关联列表 + List CancelAssociationls = new List(); + public ICommand CancelAssociationCmd => new DelegateCommand(CancelAssociation_Click); + /// + /// 取消关联按钮的点击事件 + /// + /// + public virtual void CancelAssociation_Click(object parameter) + { + CancelAssociationls.Add(SelectedSignal); + MySignals.Remove(SelectedSignal); + } + } + public class AssociatedSignalInfo : ViewModelBase + { + #region 字段 + private string _Group_Name; + /// + /// CH.NO + /// + public string Group_Name + { + get { return _Group_Name; } + set { _Group_Name = value; RaisePropertyChanged(nameof(Group_Name)); } + } + + private string _Group_Desc_EN; + /// + /// 英文描述 + /// + public string Group_Desc_EN + { + get { return _Group_Desc_EN; } + set { _Group_Desc_EN = value; RaisePropertyChanged(nameof(Group_Desc_EN)); } + } + private string _Group_Desc; + /// + /// 中文描述 + /// + public string Group_Desc + { + get { return _Group_Desc; } + set { _Group_Desc = value; RaisePropertyChanged(nameof(Group_Desc)); } + } + + private string _IO_Type; + /// + /// 信号类型 + /// + public string IO_Type + { + get { return _IO_Type; } + set { _IO_Type = value; RaisePropertyChanged(nameof(IO_Type)); } + } + + private string _Alarm_LL; + + public string Alarm_LL + { + get { return _Alarm_LL; } + set { _Alarm_LL = value; RaisePropertyChanged(nameof(Alarm_LL)); } + } + private string _Alarm_L; + + public string Alarm_L + { + get { return _Alarm_L; } + set { _Alarm_L = value; RaisePropertyChanged(nameof(Alarm_L)); } + } + private string _Alarm_H; + + public string Alarm_H + { + get { return _Alarm_H; } + set { _Alarm_H = value; RaisePropertyChanged(nameof(Alarm_H)); } + } + private string _Alarm_HH; + + public string Alarm_HH + { + get { return _Alarm_HH; } + set { _Alarm_HH = value; RaisePropertyChanged(nameof(Alarm_HH)); } + } + + private string _SENSOR_CODE; + /// + /// 传感器编号 + /// + public string SENSOR_CODE + { + get { return _SENSOR_CODE; } + set { _SENSOR_CODE = value; RaisePropertyChanged(nameof(SENSOR_CODE)); } + } + + #endregion + + + public AssociatedSignalInfo(ec_Wire_Group ec_Wire_Group) + { + + } + } + + + +} diff --git a/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogSignalManagementViewModel.cs b/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogSignalManagementViewModel.cs index 32ddb48f..16fc16bd 100644 --- a/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogSignalManagementViewModel.cs +++ b/newFront/c#前端/SWS.WPF/ViewModels/DialogSignalManagementVM/DialogSignalManagementViewModel.cs @@ -347,11 +347,11 @@ namespace SWS.WPF.ViewModels } } - private DateTime _ReviewTime; + private DateTime? _ReviewTime; /// /// 送审时间 /// - public DateTime ReviewTime + public DateTime? ReviewTime { get { return _ReviewTime; } set { _ReviewTime = value; @@ -359,11 +359,11 @@ namespace SWS.WPF.ViewModels } } - private DateTime _ConstructionTime; + private DateTime? _ConstructionTime; /// /// 施工时间 /// - public DateTime ConstructionTime + public DateTime? ConstructionTime { get { return _ConstructionTime; } set { _ConstructionTime = value; @@ -371,6 +371,33 @@ namespace SWS.WPF.ViewModels } } + private Visibility _IsReviewTimeVisibility = Visibility.Visible; + /// + /// 控制送审时间是否可见 + /// + public Visibility IsReviewTimeVisibility + { + get { return _IsReviewTimeVisibility; } + set + { + _IsReviewTimeVisibility = value; + RaisePropertyChanged(nameof(IsReviewTimeVisibility)); + } + } + + private Visibility _IsConstructionTimeVisibility = Visibility.Visible; + /// + /// 控制施工时间是否可见 + /// + public Visibility IsConstructionTimeVisibility + { + get { return _IsConstructionTimeVisibility; } + set + { + _IsConstructionTimeVisibility = value; + RaisePropertyChanged(nameof(IsConstructionTimeVisibility)); + } + } private readonly DispatcherTimer _timer = new DispatcherTimer(); @@ -423,6 +450,10 @@ namespace SWS.WPF.ViewModels //DateTime startTime = DateTime.Now; //设置信号源 signals = await _wireGroupService.GetSignals(GlobalObject.curProject.ProjectId, false); + if (signals == null) + { + signals = new List(); + } //TimeSpan duration = DateTime.Now - startTime; //System.Windows.MessageBox.Show($"Time taken: {duration.Seconds} milliseconds"); count = signals.Count().ToString(); @@ -448,24 +479,33 @@ namespace SWS.WPF.ViewModels IsAssociated = parameters.GetValue(GlobalObject.dialogPar.info.ToString()); //获取送审时间和施工时间 - ReviewTime = (DateTime)GlobalObject.curProject.IO_predicted_issue; - ConstructionTime = (DateTime)GlobalObject.curProject.IO_predicted_construct; - + ReviewTime = GlobalObject.curProject.IO_predicted_issue; + ConstructionTime = GlobalObject.curProject.IO_predicted_issue; + if (ReviewTime == null) IsReviewTimeVisibility = Visibility.Collapsed; + if (ConstructionTime == null) IsConstructionTimeVisibility = Visibility.Collapsed; // 获取当前时间 DateTime currentTime = DateTime.Now; // 初始化倒计时时间 - ReviewCountdown.TimeRemaining = (TimeSpan)(ReviewTime - currentTime); - ReviewCountdown.IsActive = true; + ReviewCountdown.TimeRemaining = ReviewTime==null? TimeSpan.Zero:(TimeSpan)(ReviewTime - currentTime); + ReviewCountdown.IsActive = ReviewTime == null ?false: true; if (ReviewCountdown.TimeRemaining<= TimeSpan.Zero) { - System.Windows.MessageBox.Show($"送审时间已过期: {ReviewCountdown.TimeRemaining:%d}天 {ReviewCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error); - } - ConstructionCountdown.TimeRemaining = (TimeSpan)(ConstructionTime - currentTime); + if (GlobalObject.curProject.IO_real_issue == null && GlobalObject.curProject.IO_predicted_issue!=null) + { + System.Windows.MessageBox.Show($"送审时间已过期: {ReviewCountdown.TimeRemaining:%d}天 {ReviewCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error); - ConstructionCountdown.IsActive = true; + } + } + ConstructionCountdown.TimeRemaining = ConstructionTime==null? TimeSpan.Zero:(TimeSpan)(ConstructionTime - currentTime); + + ConstructionCountdown.IsActive = ConstructionTime == null ? false: true; if (ConstructionCountdown.TimeRemaining <= TimeSpan.Zero) { - System.Windows.MessageBox.Show($"施工时间已过期: {ConstructionCountdown.TimeRemaining:%d}天 {ConstructionCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error); + if (GlobalObject.curProject.IO_real_construct == null&& GlobalObject.curProject.IO_predicted_issue!=null) + { + System.Windows.MessageBox.Show($"施工时间已过期: {ConstructionCountdown.TimeRemaining:%d}天 {ConstructionCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error); + + } } // 初始化定时器 @@ -1338,25 +1378,25 @@ namespace SWS.WPF.ViewModels para.Add(GlobalObject.dialogPar.title.ToString(), "信号选择框"); para.Add(GlobalObject.dialogPar.info.ToString(), "请选择要关联的信号:"); para.Add(GlobalObject.dialogPar.para1.ToString(), smInfols); - _dialogService.ShowDialog(nameof(DialogSignalSelect), para, (RES) => + _dialogService.ShowDialog(nameof(DialogAssociatedSignal), para, (RES) => { if (RES.Result == ButtonResult.Yes) { - var signal = RES.Parameters.GetValue(GlobalObject.dialogPar.para1.ToString()); + var signal = RES.Parameters.GetValue(GlobalObject.dialogPar.para1.ToString()); if (!string.IsNullOrEmpty(SelectedSmInfo.LinkedID)) { var LinkedIDs = SelectedSmInfo.LinkedID.Split(',').ToList(); LinkedIDs.RemoveAll(item => string.IsNullOrEmpty(item)); - if (!LinkedIDs.Contains(signal.SignalId)) + if (!LinkedIDs.Contains(signal.Wire_Group_ID)) { - LinkedIDs.Add(signal.SignalId); + LinkedIDs.Add(signal.Wire_Group_ID); } SelectedSmInfo.LinkedID = string.Join(",", LinkedIDs); } else { - SelectedSmInfo.LinkedID = signal.SignalId; + SelectedSmInfo.LinkedID = signal.Wire_Group_ID; } SelectedSmInfo.IsModified = true; System.Windows.MessageBox.Show("关联成功", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); @@ -1389,15 +1429,15 @@ namespace SWS.WPF.ViewModels para.Add(GlobalObject.dialogPar.title.ToString(), "信号关联列表"); para.Add(GlobalObject.dialogPar.info.ToString(), "下面是信号关联列表"); para.Add(GlobalObject.dialogPar.para1.ToString(), sminfols); - _dialogService.ShowDialog(nameof(DialogSignalSelect), para, (RES) => + _dialogService.ShowDialog(nameof(DialogAssociatedSignal), para, (RES) => { if (RES.Result == ButtonResult.Yes) { - var signals = RES.Parameters.GetValue>(GlobalObject.dialogPar.para2.ToString()); + var signals = RES.Parameters.GetValue>(GlobalObject.dialogPar.para2.ToString()); signals.ForEach(s => { - var signalid = s.SignalId; + var signalid = s.Wire_Group_ID; if (LinkedIDs.Contains(signalid)) { LinkedIDs.Remove(signalid); diff --git a/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml new file mode 100644 index 00000000..d3a2bcd6 --- /dev/null +++ b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml.cs b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml.cs new file mode 100644 index 00000000..f62ea689 --- /dev/null +++ b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogAssociatedSignal.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace SWS.WPF.Views +{ + /// + /// DialogAssociatedSignal.xaml 的交互逻辑 + /// + public partial class DialogAssociatedSignal : UserControl + { + public DialogAssociatedSignal() + { + InitializeComponent(); + } + } +} diff --git a/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogSignalManagement.xaml b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogSignalManagement.xaml index 65cd63d4..e76ecfc4 100644 --- a/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogSignalManagement.xaml +++ b/newFront/c#前端/SWS.WPF/Views/DialogSignalManagements/DialogSignalManagement.xaml @@ -224,7 +224,8 @@ Text="{Binding pojectName}" /> + Visibility="{Binding IsReviewTimeVisibility}" + Margin="50,1,0,1" Padding="1"> + Visibility="{Binding IsConstructionTimeVisibility}" + Margin="25,1,0,1" Padding="1"> -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using Microsoft.Xaml.Behaviors; -using Microsoft.Xaml.Behaviors.Core; -using Microsoft.Xaml.Behaviors.Input; -using Microsoft.Xaml.Behaviors.Layout; -using Microsoft.Xaml.Behaviors.Media; -using Prism.DryIoc; -using Prism.Interactivity; -using Prism.Ioc; -using Prism.Mvvm; -using Prism.Regions; -using Prism.Regions.Behaviors; -using Prism.Services.Dialogs; -using Prism.Unity; -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogInput - /// - public partial class DialogInput : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialoginput.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\Views\DialogInput.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.cs deleted file mode 100644 index 8a20f6bc..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.cs +++ /dev/null @@ -1,192 +0,0 @@ -#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7BBBAAC2D30DDCBE426FDE8827BDBF7527EEDC8C0F823DBAF3EBE2D35FF1D1F8" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using Microsoft.Xaml.Behaviors; -using Microsoft.Xaml.Behaviors.Core; -using Microsoft.Xaml.Behaviors.Input; -using Microsoft.Xaml.Behaviors.Layout; -using Microsoft.Xaml.Behaviors.Media; -using Prism.DryIoc; -using Prism.Interactivity; -using Prism.Ioc; -using Prism.Mvvm; -using Prism.Regions; -using Prism.Regions.Behaviors; -using Prism.Services.Dialogs; -using Prism.Unity; -using SWS.Commons.Helper.Converter; -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogSignalManagement - /// - public partial class DialogSignalManagement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - - #line 213 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal SWS.CustomControl.customWindowTitleBar titleBar; - - #line default - #line hidden - - - #line 232 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBlock txtReviewCountdown; - - #line default - #line hidden - - - #line 250 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBlock txtConstructionCountdown; - - #line default - #line hidden - - - #line 306 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal SWS.CustomControl.IconButton PopupButton; - - #line default - #line hidden - - - #line 316 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Primitives.Popup CustomPopup; - - #line default - #line hidden - - - #line 365 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal SWS.CustomControl.IconButton myButton; - - #line default - #line hidden - - - #line 398 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal Telerik.Windows.Controls.RadTreeListView RadGridView1; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialogsignalmanagements/dialogsignalmanagement.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - this.titleBar = ((SWS.CustomControl.customWindowTitleBar)(target)); - return; - case 2: - this.txtReviewCountdown = ((System.Windows.Controls.TextBlock)(target)); - return; - case 3: - this.txtConstructionCountdown = ((System.Windows.Controls.TextBlock)(target)); - return; - case 4: - this.PopupButton = ((SWS.CustomControl.IconButton)(target)); - return; - case 5: - this.CustomPopup = ((System.Windows.Controls.Primitives.Popup)(target)); - return; - case 6: - this.myButton = ((SWS.CustomControl.IconButton)(target)); - return; - case 7: - this.RadGridView1 = ((Telerik.Windows.Controls.RadTreeListView)(target)); - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.i.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.i.cs index 8a20f6bc..ca92cf24 100644 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.i.cs +++ b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalManagement.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7BBBAAC2D30DDCBE426FDE8827BDBF7527EEDC8C0F823DBAF3EBE2D35FF1D1F8" +#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D4B655A725F9DA5CEF801330CC2E000E8A952FC6E92D22159739897F8A32A6A6" //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -86,7 +86,7 @@ namespace SWS.WPF.Views { #line hidden - #line 232 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 233 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBlock txtReviewCountdown; @@ -94,7 +94,7 @@ namespace SWS.WPF.Views { #line hidden - #line 250 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 252 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.TextBlock txtConstructionCountdown; @@ -102,7 +102,7 @@ namespace SWS.WPF.Views { #line hidden - #line 306 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 308 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal SWS.CustomControl.IconButton PopupButton; @@ -110,7 +110,7 @@ namespace SWS.WPF.Views { #line hidden - #line 316 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 318 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal System.Windows.Controls.Primitives.Popup CustomPopup; @@ -118,7 +118,7 @@ namespace SWS.WPF.Views { #line hidden - #line 365 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 367 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal SWS.CustomControl.IconButton myButton; @@ -126,7 +126,7 @@ namespace SWS.WPF.Views { #line hidden - #line 398 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" + #line 400 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] internal Telerik.Windows.Controls.RadTreeListView RadGridView1; diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalNotice.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalNotice.g.cs deleted file mode 100644 index 690e31ae..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalNotice.g.cs +++ /dev/null @@ -1,120 +0,0 @@ -#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "96F2D26AF189BFC9415C3A5E2A7E8B4F6F86E0A3BD2C2F7AAD40D4F0138BF2C9" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using Prism.DryIoc; -using Prism.Interactivity; -using Prism.Ioc; -using Prism.Mvvm; -using Prism.Regions; -using Prism.Regions.Behaviors; -using Prism.Services.Dialogs; -using Prism.Unity; -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogSignalNotice - /// - public partial class DialogSignalNotice : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - - #line 77 "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal Telerik.Windows.Controls.RadGridView RadGridView2; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialogsignalmanagements/dialogsignalnotice.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - this.RadGridView2 = ((Telerik.Windows.Controls.RadGridView)(target)); - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalPropertyhisAndLogs.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalPropertyhisAndLogs.g.cs deleted file mode 100644 index b55ea82e..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalPropertyhisAndLogs.g.cs +++ /dev/null @@ -1,132 +0,0 @@ -#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "BE60D5C45BFF53C850EE04B85D1AED3A70B5A4F94BFCB1E5612DE8D892E9C533" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using Prism.DryIoc; -using Prism.Interactivity; -using Prism.Ioc; -using Prism.Mvvm; -using Prism.Regions; -using Prism.Regions.Behaviors; -using Prism.Services.Dialogs; -using Prism.Unity; -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogSignalPropertyhisAndLogs - /// - public partial class DialogSignalPropertyhisAndLogs : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - - #line 40 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal Telerik.Windows.Controls.RadGridView RadGridView1; - - #line default - #line hidden - - - #line 89 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal Telerik.Windows.Controls.RadGridView RadGridView2; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialogsignalmanagements/dialogsignalpropertyhisandlogs.x" + - "aml", System.UriKind.Relative); - - #line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - this.RadGridView1 = ((Telerik.Windows.Controls.RadGridView)(target)); - return; - case 2: - this.RadGridView2 = ((Telerik.Windows.Controls.RadGridView)(target)); - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalSelect.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalSelect.g.cs deleted file mode 100644 index f154529c..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogSignalManagements/DialogSignalSelect.g.cs +++ /dev/null @@ -1,106 +0,0 @@ -#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalSelect.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "EE32C8B45FE374AABAE5ED09E93D91CDBA87B6F49A5282F213060672367234A0" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using Prism.DryIoc; -using Prism.Interactivity; -using Prism.Ioc; -using Prism.Mvvm; -using Prism.Regions; -using Prism.Regions.Behaviors; -using Prism.Services.Dialogs; -using Prism.Unity; -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogSignalSelect - /// - public partial class DialogSignalSelect : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialogsignalmanagements/dialogsignalselect.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalSelect.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogTest.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogTest.g.cs deleted file mode 100644 index 01ca17ee..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/DialogTest.g.cs +++ /dev/null @@ -1,112 +0,0 @@ -#pragma checksum "..\..\..\Views\DialogTest.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6B3B7EEAB6D20917F0C5D3D89D2899E3CB2081B27EC6998F991166F325652220" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using SWS.CustomControl; -using SWS.WPF.Views; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// DialogTest - /// - public partial class DialogTest : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { - - - #line 19 "..\..\..\Views\DialogTest.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal SWS.CustomControl.customWindowTitleBar titleBar; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/dialogtest.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\Views\DialogTest.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - this.titleBar = ((SWS.CustomControl.customWindowTitleBar)(target)); - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.baml b/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.baml deleted file mode 100644 index 9308906f..00000000 Binary files a/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.baml and /dev/null differ diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.g.cs deleted file mode 100644 index 827dfeee..00000000 --- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/Project.g.cs +++ /dev/null @@ -1,108 +0,0 @@ -#pragma checksum "..\..\..\Views\Project.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "CEE66C3694A40153FDD13BBA62FE1B6DC3D9D33F6B276CA567053423C05A4D66" -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using SWS.CustomControl; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; -using Telerik.Windows.Controls; -using Telerik.Windows.Controls.Animation; -using Telerik.Windows.Controls.Behaviors; -using Telerik.Windows.Controls.Carousel; -using Telerik.Windows.Controls.ComboBox; -using Telerik.Windows.Controls.Data.PropertyGrid; -using Telerik.Windows.Controls.DragDrop; -using Telerik.Windows.Controls.GridView; -using Telerik.Windows.Controls.LayoutControl; -using Telerik.Windows.Controls.Legend; -using Telerik.Windows.Controls.MultiColumnComboBox; -using Telerik.Windows.Controls.Primitives; -using Telerik.Windows.Controls.RadialMenu; -using Telerik.Windows.Controls.TransitionEffects; -using Telerik.Windows.Controls.TreeListView; -using Telerik.Windows.Controls.TreeView; -using Telerik.Windows.Controls.Wizard; -using Telerik.Windows.Data; -using Telerik.Windows.DragDrop; -using Telerik.Windows.DragDrop.Behaviors; -using Telerik.Windows.Input.Touch; -using Telerik.Windows.Shapes; - - -namespace SWS.WPF.Views { - - - /// - /// Project - /// - public partial class Project : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/SWS.WPF;component/views/project.xaml", System.UriKind.Relative); - - #line 1 "..\..\..\Views\Project.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 13 "..\..\..\Views\Project.xaml" - ((SWS.WPF.Views.Project)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} -