aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DigitalInItem.cs
blob: bf06aae95c9a19332bc8305c049555f71cf8ebfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Xml.Serialization;
using Tango.BL.Entities;
using Tango.SharedUI.Helpers;

namespace Tango.MachineStudio.Technician.TechItems
{
    /// <summary>
    /// Represents a digital input pin item.
    /// </summary>
    /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
    [TechItem(0)]
    public class DigitalInItem : TechItem
    {
        private TechIo _techIo;
        /// <summary>
        /// Gets or sets the DB tech item.
        /// </summary>
        [XmlIgnore]
        public TechIo TechIo
        {
            get { return _techIo; }
            set { _techIo = value; RaisePropertyChangedAuto(); TechName = _techIo != null ? _techIo.InterfaceName : null; ItemGuid = value != null ? value.Guid : null; }
        }

        private bool _value;
        /// <summary>
        /// Gets or sets whether the input is on.
        /// </summary>
        [XmlIgnore]
        public bool Value
        {
            get { return _value; }
            set { _value = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DigitalInItem"/> class.
        /// </summary>
        public DigitalInItem() : base()
        {
            Name = "Digital Input Interface";
            Description = "Digital Input Interface LED";
            Image = ResourceHelper.GetImageFromResources("Images/digital-in.png");
            Color = Colors.White;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DigitalInItem"/> class.
        /// </summary>
        /// <param name="techIo">The db tech.</param>
        public DigitalInItem(TechIo techIo) : this()
        {
            TechIo = techIo;
        }

        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public override TechItem Clone()
        {
            DigitalInItem cloned = base.Clone() as DigitalInItem;
            cloned.TechIo = TechIo;
            return cloned;
        }
    }
}
t;MainWindow.xaml</DependentUpon> <SubType>Code</SubType> </Compile> </ItemGroup> <ItemGroup> <Compile Include="MainWindowVM.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> <None Include="Tango.PPC.Publisher.UI.json" /> </ItemGroup> <ItemGroup> <None Include="App.config" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\Tango.BL\Tango.BL.csproj"> <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> <Name>Tango.BL</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> <Name>Tango.Core</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.Git\Tango.Git.csproj"> <Project>{99081c0e-065c-4d68-bf60-f82330cca02d}</Project> <Name>Tango.Git</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.Settings\Tango.Settings.csproj"> <Project>{D8F1AD85-526A-4F50-B6DC-D437AF63D8D8}</Project> <Name>Tango.Settings</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj"> <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> <Name>Tango.SharedUI</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.SQLExaminer\Tango.SQLExaminer.csproj"> <Project>{e1e66ed9-597d-45fa-8048-de90a6930484}</Project> <Name>Tango.SQLExaminer</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj"> <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> <Name>Tango.Transport</Name> </ProjectReference> <ProjectReference Include="..\..\Tango.Web\Tango.Web.csproj"> <Project>{5001990f-977b-48ff-b217-0236a5022ad8}</Project> <Name>Tango.Web</Name> </ProjectReference> <ProjectReference Include="..\Tango.PPC.Common\Tango.PPC.Common.csproj"> <Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project> <Name>Tango.PPC.Common</Name> </ProjectReference> </ItemGroup> <ItemGroup> <BootstrapperPackage Include=".NETFramework,Version=v4.6.1"> <Visible>False</Visible> <ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName> <Install>true</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> <Visible>False</Visible> <ProductName>.NET Framework 3.5 SP1</ProductName> <Install>false</Install> </BootstrapperPackage> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> <UserProperties BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>