-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #627 [Model Editor] Panel Editor - add Parameter and add Element …
…Definition improvements (#649)
- Loading branch information
Showing
22 changed files
with
415 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
COMET.Web.Common/Components/Selectors/MeasurementScaleSelector.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!------------------------------------------------------------------------------ | ||
// Copyright (c) 2023-2024 Starion Group S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua | ||
// | ||
// This file is part of CDP4-COMET WEB Community Edition | ||
// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25 | ||
// Annex A and Annex C. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
-------------------------------------------------------------------------------> | ||
@namespace COMET.Web.Common.Components.Selectors | ||
@using COMET.Web.Common.Model.Selectors | ||
@using CDP4Common.SiteDirectoryData | ||
@inherits DisposableComponent | ||
|
||
<DxComboBox Data="@(this.ViewModel.AvailableMeasurementScales.Select(x => new SelectorModelBaseWrapper<MeasurementScale>(x)))" | ||
TData="SelectorModelBaseWrapper<MeasurementScale>" | ||
TValue="MeasurementScale" | ||
@bind-Value="@(this.ViewModel.SelectedMeasurementScale)" | ||
FilteringMode="DataGridFilteringMode.Contains" | ||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" | ||
TextFieldName="@(nameof(SelectorModelBaseWrapper<ParameterType>.DisplayText))" | ||
ValueFieldName="@(nameof(SelectorModelBaseWrapper<ParameterType>.WrappedThing))" | ||
NullText="Select a Measurement Scale"/> |
44 changes: 44 additions & 0 deletions
44
COMET.Web.Common/Components/Selectors/MeasurementScaleSelector.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="MeasurementScaleSelector.razor.cs" company="Starion Group S.A."> | ||
// Copyright (c) 2024 Starion Group S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. | ||
// | ||
// The COMET WEB Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Affero General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The COMET WEB Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMET.Web.Common.Components.Selectors | ||
{ | ||
using CDP4Common.SiteDirectoryData; | ||
|
||
using COMET.Web.Common.ViewModels.Components.Selectors; | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
/// <summary> | ||
/// Component used to select a <see cref="MeasurementScale" /> | ||
/// </summary> | ||
public partial class MeasurementScaleSelector : DisposableComponent | ||
{ | ||
/// <summary> | ||
/// Gets or sets the <see cref="IMeasurementScaleSelectorViewModel" /> | ||
/// </summary> | ||
[Parameter] | ||
public IMeasurementScaleSelectorViewModel ViewModel { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
COMET.Web.Common/Model/Selectors/SelectorModelBaseWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="SelectorsBaseWrapper.cs" company="Starion Group S.A."> | ||
// Copyright (c) 2024 Starion Group S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. | ||
// | ||
// The COMET WEB Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Affero General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The COMET WEB Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMET.Web.Common.Model.Selectors | ||
{ | ||
using CDP4Common.CommonData; | ||
|
||
using COMET.Web.Common.Extensions; | ||
|
||
/// <summary> | ||
/// The wrapper to be used to display and select data in the <see cref="DefinedThing" /> | ||
/// </summary> | ||
public class SelectorModelBaseWrapper<T> where T : DefinedThing | ||
{ | ||
/// <summary> | ||
/// Creates a new instance of the <see cref="SelectorModelBaseWrapper{T}" /> | ||
/// </summary> | ||
/// <param name="thing">The thing to be wrapped</param> | ||
public SelectorModelBaseWrapper(T thing) | ||
{ | ||
this.WrappedThing = thing; | ||
} | ||
|
||
/// <summary> | ||
/// The thing to be selected | ||
/// </summary> | ||
public T WrappedThing { get; set; } | ||
|
||
/// <summary> | ||
/// The text to display for thing selection | ||
/// </summary> | ||
public string DisplayText => this.WrappedThing?.GetSelectorNameAndShortname(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
COMET.Web.Common/ViewModels/Components/Selectors/IMeasurementScaleSelectorViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="IMeasurementScaleSelectorViewModel.cs" company="Starion Group S.A."> | ||
// Copyright (c) 2024 Starion Group S.A. | ||
// | ||
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, João Rua | ||
// | ||
// This file is part of COMET WEB Community Edition | ||
// The COMET WEB Community Edition is the Starion Group Web Application implementation of ECSS-E-TM-10-25 Annex A and Annex C. | ||
// | ||
// The COMET WEB Community Edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Affero General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 3 of the License, or (at your option) any later version. | ||
// | ||
// The COMET WEB Community Edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace COMET.Web.Common.ViewModels.Components.Selectors | ||
{ | ||
using CDP4Common.SiteDirectoryData; | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
/// <summary> | ||
/// View Model that enables the user to select a <see cref="MeasurementScale" /> | ||
/// </summary> | ||
public interface IMeasurementScaleSelectorViewModel | ||
{ | ||
/// <summary> | ||
/// Gets or sets the callback that is executed when the <see cref="SelectedMeasurementScale" /> property has changed | ||
/// </summary> | ||
EventCallback<MeasurementScale> OnSelectedMeasurementScaleChange { get; set; } | ||
|
||
/// <summary> | ||
/// A collection of available <see cref="DomainOfExpertise" /> | ||
/// </summary> | ||
IEnumerable<MeasurementScale> AvailableMeasurementScales { get; set; } | ||
|
||
/// <summary> | ||
/// The currently selected <see cref="MeasurementScale" /> | ||
/// </summary> | ||
MeasurementScale SelectedMeasurementScale { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.