Thursday, December 17, 2015

Map3D Industry Model : Select job topic states

select * from tb_job_topic jt,
TB_JOB_TOPIC_STATE jts,
S497_NETWORK_UPDATE nu,
S497_NETWORK_UPDATE_JOB nuj,
TB_JOB j
where jt.ID = jts.JOB_TOPIC_ID
and nu.NWUP_ID = nuj.NWUP_ID
and j.id = nuj.JOB_ID
and nuj.JOB_ID = 837
and jt.JOB_ID = 837
and jts.SELECTED = :state;

select * from tb_job_topic jt,
TB_JOB_TOPIC_STATE jts,
S497_NETWORK_UPDATE nu,
S497_NETWORK_UPDATE_JOB nuj,
TB_JOB j
where jt.ID = jts.JOB_TOPIC_ID
and nu.NWUP_ID = nuj.NWUP_ID
and j.id = nuj.JOB_ID
and nuj.JOB_ID = :jid
and jt.JOB_ID = :jid
and jts.SELECTED = :state;

Monday, November 16, 2015

Map3D Industry Model : Modify Job States & Job State Transitions

By default Map 3D industry models have 4 job states and their corresponding job state transitions.
It is possible to add some extra states and modify or add corresponding state transitions if the defaults are insufficient for your implementation.

Default job states

select * from tb_job_state;


Default job state transitions

select * from tb_job_state_transition;



Transition Direction

  • (F,Forward)
  • (B,Backward)
Transition Type
  • (M,Merge the features)
  • (D,Delete the job)
  • (N, Do nothing)
SQL Example

--insert new job states into table tb_job_state
delete from tb_job_state where id in(5,6,7,8,9);
delete from TB_JOB_STATE_TRANSITION where id in(6,7,8,9,10);
delete from TB_JOB_STATE_TRANSITION where id in(12,13,14,15,16,22);
delete from TB_JOB_STATE_TRANSITION where id in(17,18,19,20,21);
insert into tb_job_state (ID, DESCRIPTION, FEATURES_EDITABLE,INITIAL_STATE,NAME,USE_JOBID) VALUES(5,null,1,1,'Planning',1);
insert into tb_job_state (ID, DESCRIPTION, FEATURES_EDITABLE,INITIAL_STATE,NAME,USE_JOBID) VALUES(6,null,1,0,'Design',0);
insert into tb_job_state (ID, DESCRIPTION, FEATURES_EDITABLE,INITIAL_STATE,NAME,USE_JOBID) VALUES(7,null,1,0,'Phase Planning',0);
insert into tb_job_state (ID, DESCRIPTION, FEATURES_EDITABLE,INITIAL_STATE,NAME,USE_JOBID) VALUES(8,null,1,0,'Construction',0);
insert into tb_job_state (ID, DESCRIPTION, FEATURES_EDITABLE,INITIAL_STATE,NAME,USE_JOBID) VALUES(9,null,1,0,'Asset Management',0);
--insert new job state transitions forward into table tb_job_state_transition
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(6,null,5,6,'F','M');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(7,null,6,7,'F','M');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(8,null,7,8,'F','M');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(9,null,8,9,'F','M');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(10,null,9,1,'F','M');
--insert new job state transitions delete into table tb_job_state_transition
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(12,null,5,4,'F','D');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(13,null,6,4,'F','D');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(14,null,7,4,'F','D');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(15,null,8,4,'F','D');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(16,null,9,4,'F','D');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(22,null,1,4,'F','D');
--insert new job state transitions backwards into table tb_job_state_transition
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(17,null,6,5,'B','N');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(18,null,7,6,'B','N');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(19,null,8,7,'B','N');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(20,null,9,8,'B','N');
insert into TB_JOB_STATE_TRANSITION (ID,PASSWORD, PREDECESSOR_ID, SUCCESSOR_ID, TRANSITION_DIRECTION, TRANSITION_TYPE) VALUES(21,null,1,9,'B','N');
commit;

Result Job States

Result Job State Transitions


Map3D Industry Model : SQL Query Logical Topology Connection & Jobs

SQL Query

select topo.fid, topo.FID_FROM, topo.F_CLASS_ID_FROM,
dic2.F_CLASS_NAME CLASSNAME_FROM, topo.FID_TO, topo.F_CLASS_ID_TO, dic.F_CLASS_NAME CLASSNAME_TO,  topo.FLOW,
j.id, j.NAME, j.COMMENTARY,
jv.STATE
from 
RNT_NODE_EDGE_TOPO_CONN topo, TB_DICTIONARY dic, TB_DICTIONARY dic2, TB_JOB j, TB_JOB_VERSION jv
where dic.F_CLASS_ID = topo.F_CLASS_ID_TO
and dic2.F_CLASS_ID = topo.F_CLASS_ID_FROM
and j.id = jv.JOB_ID
and jv.JOB_VERSION = topo.JOB_VERSION;



flow 

  • (1,forward) 
  • (2,backward) 
  • (3, forward and backward)

state

select * from tb_job_state;


Tuesday, June 16, 2015

Reset Logical Topology Map3D Industry Model

 /// <summary>
        /// Reset the topology of the industry model currently connected to.
        /// </summary>
        public static void ResetTopology()
        {
            var application = Application.Active;
            var connection = application.Documents.Active.Connection;

            using (var ma = new Topobase.LogicalTopology.Maintainance(connection))
            {
                connection.Open();
                //Make sure there are topologies to clear
                if (connection.Topologies != null)
                {
                    for (int i = 0; i < connection.Topologies.Count; i++)
                    {
                        //Check the type of the topologies before clearing them.
                        //Make sure they are logical topologies and not area
   var topology =     
   connection.Topologies.Get(connection.Topologies[i].Name);
                        var logicalToplogy = topology as LogicalTopology;
                        //Clear topology attached to the industry model
                        ma.ClearTopology(logicalToplogy, null);
                        //Initialize topolgy of the current industy model
                        ma.InitializeTopology(logicalToplogy, null);
                    }
                }
            }
        }

Monday, March 30, 2015

FME DWG Text 2 RASTER

First you need to TXTEXP all your text within autocad. After you ran the command you will end up with lines on layer 0.

Then you can run this workbench to transform your data from autocad vector data to any raster image.

Enjoy!

Download Workbench


Tuesday, December 2, 2014

MAP3D (Topobase) can't split linestring due to duplicate points

Apparently if you look at the geometry using the API (feature) the collection of the linestring has double starting points and double endpoints.

A validation on oracle doesn't detect the problem in the collection of the linestring.

Performing a spatial function, either rectify or a simplify, on the geometry will solve the problem.

select * from tb_job where name = 'Aansluiting 67 G split';
exec job3.setjob(45);
select * from in_geo_segment where FID = 43141;
update in_geo_segment set geom = SDO_UTIL.SIMPLIFY(geom,0.01,0.005) where fid = 43141;
commit;

select * from tb_job where name = 'Aansluiting 108 G split';
exec job3.setjob(48);
select * from in_geo_segment where FID = 46655;
update in_geo_segment set geom = SDO_UTIL.SIMPLIFY(geom,0.01,0.005) where fid = 46655;
update in_geo_segment set geom = SDO_UTIL.SIMPLIFY(geom,0.01,0.005) where fid = 46651;
update in_geo_segment set geom = SDO_UTIL.SIMPLIFY(geom,0.01,0.005) where fid = 47169;
commit;

Tuesday, July 29, 2014

The program can't start because WMVCore.DLL is missing from your computer

Today I had this error on my windows server 2008 r2 install when trying to launch camtasia studio on the server.

This youtube video explained me how to resolve this problem.

https://www.youtube.com/watch?v=QoQqs0SiS8w

Monday, July 14, 2014

FME : Validate the attribute names of a feature

Goal : Verify the attribute names of a feature layer in a dataset using FME.

My dataset source is an sdf but this can be done with any reader source FME can read.
I had to use a few transformers to filter the attribute names of the feature layer.

1. First of all you need to use a Sampler to make sure you end up with one single feature instead of the complete dataset.

2. Once you filtered a single feature you use an attributeexploder to aquire the feature's fme attribute names.


3. Next I added a Tester to verify the expected attribute names.

4. I added the result to a list using the listbuilder

5. I used a ListCounter to get the amount of passed tests.


6. I will verify the amount of passed tests against the amount of expected attribute names within the dataset.

7. The failed results are written to a text file using a TEXTWRITER



Voila, thats how you verify whether the expected amount of columns are part of your dataset using FME.

The result can be downloaded here

Thursday, July 10, 2014

C# Using PSTool PsExec to execute programs on remote systems 2

Small update. I haven't implemented all the remarks of Cjorn yet.

public interface IValidator
    {
        DirectoryInfo OutputDirectoryFromClient { get; set; }
        DirectoryInfo OutputDirectoryOnServer { get; set; }
        DirectoryInfo WorkbenchDirectoryFromClient { get; set; }
        DirectoryInfo WorkbenchDirectoryOnServer { get; set; }

        FileInfo FileToValidate { get; set; }
        FileInfo FmeBatch { get; set; }
        FileInfo FmeWorkbench { get; set; }

        FileInfo PsExec { get; set; }
        FileInfo FmeExec { get; set; }

        string UserName { get; set; }
        string Password { get; set; }
        string ServerName { get; set; }

        string StandardError { get; }
        string StandardOutput { get; }

        void Validate();

    }

public class Validator : IValidator
    {
        public DirectoryInfo OutputDirectoryFromClient { get; set; }

        public DirectoryInfo OutputDirectoryOnServer { get; set; }

        public DirectoryInfo WorkbenchDirectoryFromClient { get; set; }

        public DirectoryInfo WorkbenchDirectoryOnServer { get; set; }

        public FileInfo FmeBatch { get; set; }

        public FileInfo FileToValidate { get; set; }

        public FileInfo FmeWorkbench { get; set; }

        public FileInfo PsExec { get; set; }

        public FileInfo FmeExec { get; set; }

        public string UserName { get; set; }

        public string Password { get; set; }

        public string ServerName { get; set; }

        public string StandardError { get; private set; }

        public string StandardOutput { get; private set; }


        private void CreateSourceCopy()
        {
            File.Copy(FileToValidate.FullName, WorkbenchDirectoryFromClient.FullName + "source.sdf");
        }

        private void RemoveSourceCopy()
        {
            if (File.Exists(WorkbenchDirectoryFromClient.FullName + "source.sdf"))
                File.Delete(WorkbenchDirectoryFromClient.FullName + "source.sdf");
        }

        private void RemoveOutput()
        {
            if (File.Exists(OutputDirectoryFromClient.FullName + "validated.sdf"))
                File.Delete(OutputDirectoryFromClient.FullName + "validated.sdf");
        }

        public void Validate()
        {
            RemoveSourceCopy();
            RemoveOutput();

            CreateSourceCopy();

            var arg = ServerName + @" cmd.exe -u " + UserName + @" -p " + Password + @" /c " + FmeBatch.FullName;

            var p = new Process
                {
                    StartInfo =
                        {
                            UseShellExecute = false,
                            RedirectStandardOutput = true,
                            RedirectStandardError = true,
                            RedirectStandardInput = true,
                            FileName = PsExec.FullName,
                            Arguments = arg,
                            CreateNoWindow = true
                        }
                };

            using (p)
            {
                p.Start();

                StandardOutput = p.StandardOutput.ReadToEnd();
                StandardError = p.StandardError.ReadToEnd();

                //One should add an amount of time before we exit as this could lock up your app if the process never exits.
                p.WaitForExit();
            }

            RemoveSourceCopy();
        }
    }

public class ValidatorViewModel : ViewModelBase
    {
        public List<string> ValidationErrors { get; set; }

        private string _standardOutput;
        public string StandardOutput { get { return _standardOutput; } set { _standardOutput = value; OnPropertyChanged("StandardOutput"); } }

        private string _standardError;
        public string StandardError { get { return _standardError; } set { _standardError = value; OnPropertyChanged("StandardError"); } }

        #region Constructor
        public ValidatorViewModel(IValidator validator)
        {
            Validator = validator;
            ValidationErrors = new List<string>();
        }
        #endregion

        #region Properties & Variables
        public IValidator Validator { get; private set; }
        private string _sourceFileName;
        public string SourceFileName { get { return _sourceFileName; } set { _sourceFileName = value; OnPropertyChanged("SourceFileName"); } }
        #endregion
       
        #region Commands
        private RelayCommand _sourceUploadCommand;
        public ICommand SourceUploadCommand
        {
            get
            {
                return _sourceUploadCommand ?? (_sourceUploadCommand = new RelayCommand(param => SourceUploadExecute(),
                                                                                      param => CanSourceUploadExecute()));
            }
        }

        private void SourceUploadExecute()
        {
            try
            {
                var ofd = new OpenFileDialog
                {
                    InitialDirectory = "c:\\",
                    Filter = "sdf files (*.sdf)|*.sdf|All files (*.*)|*.*",
                    RestoreDirectory = true
                };
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    Validator.FileToValidate = new FileInfo(ofd.FileName);
                    SourceFileName = Validator.FileToValidate.FullName;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private bool CanSourceUploadExecute()
        {
            return true;
        }

        private RelayCommand _validateUploadCommand;
        public ICommand ValidateUploadCommand
        {
            get
            {
                return _validateUploadCommand ?? (_validateUploadCommand = new RelayCommand(param => ValidateUploadExecute(),
                                                                                      param => CanValidateUploadExecute()));
            }
        }

        private void ValidateUploadExecute()
        {
            try
            {
                try
                {
                    Validator.Validate();
                    StandardError = Validator.StandardError;
                    StandardOutput = Validator.StandardOutput;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private bool CanValidateUploadExecute()
        {
            ValidationErrors.Clear();

            if (Validator.OutputDirectoryFromClient == null)
            {
                ValidationErrors.Add("OutputDirectoryFromClient is not set.");
                return false;
            }

            if (Validator.OutputDirectoryOnServer == null)
            {
                ValidationErrors.Add("OutputDirectoryOnServer is not set.");
                return false;
            }

            if (Validator.WorkbenchDirectoryOnServer == null)
            {
                ValidationErrors.Add("WorkbenchDirectoryOnServer is not set.");
                return false;
            }

            if (Validator.FileToValidate == null)
            {
                ValidationErrors.Add("FileToValidate is not set.");
                return false;
            }

            if (Validator.FmeWorkbench == null)
            {
                ValidationErrors.Add("FmeWorkbench is not set.");
                return false;
            }

            if (Validator.PsExec == null)
            {
                ValidationErrors.Add("PsExec is not set.");
                return false;
            }

            if (Validator.FmeExec == null)
            {
                ValidationErrors.Add("FmeExec is not set.");
                return false;
            }

            if (Validator.FmeBatch == null)
            {
                ValidationErrors.Add("FmeBatch is not set.");
                return false;
            }

            if (!Directory.Exists(Validator.OutputDirectoryFromClient.FullName))
            {
                ValidationErrors.Add("Invalid Output Directory From Client Path");
                return false;
            }

            return true;
        }

        private RelayCommand _openDestinationCommand;
        public ICommand OpenDestinationCommand
        {
            get
            {
                return _openDestinationCommand ?? (_openDestinationCommand = new RelayCommand(param => OpenDestinationExecute(),
                                                                                      param => CanOpenDestinationExecute()));
            }
        }

        private void OpenDestinationExecute()
        {
            try
            {
                Process.Start("explorer.exe", Validator.OutputDirectoryFromClient.FullName);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private bool CanOpenDestinationExecute()
        {
            return true;
        }
        #endregion
    }

public TrackValidatorViewModel() : base(new Validator())
        {
            Validator.OutputDirectoryFromClient = new DirectoryInfo(@"\\hictblockap022\FME\TrackValidator\");
            Validator.OutputDirectoryOnServer = new DirectoryInfo(@"E:\FME\TrackValidator\");
            Validator.WorkbenchDirectoryFromClient = new DirectoryInfo(@"\\hictblockap022\FME\Infranet\TrackValidator\");
            Validator.WorkbenchDirectoryOnServer = new DirectoryInfo(@"E:\FME\Infranet\TrackValidator\");

            Validator.FmeBatch = new FileInfo(Validator.WorkbenchDirectoryOnServer + "trackvalidator.bat");
            Validator.FmeWorkbench = new FileInfo(Validator.WorkbenchDirectoryOnServer + "trackvalidator.fmw");

            Validator.PsExec = new FileInfo(@"C:\Users\Public\Documents\Infranet\PSTools\PsExec.exe");
            Validator.FmeExec = new FileInfo(@"C:\Program Files\FME\fme.exe");

            Validator.UserName = "CXP8200";
            Validator.Password = "password";
            Validator.ServerName = @"\\hictblockap022";
        }

  public class SwitchValidatorViewModel : ValidatorViewModel
    {
        public SwitchValidatorViewModel() : base(new Validator())
        {
            Validator.OutputDirectoryFromClient = new DirectoryInfo(@"\\hictblockap022\FME\SwitchValidator\");
            Validator.OutputDirectoryOnServer = new DirectoryInfo(@"E:\FME\SwitchValidator\");
            Validator.WorkbenchDirectoryFromClient = new DirectoryInfo(@"\\hictblockap022\FME\Infranet\SwitchValidator\");
            Validator.WorkbenchDirectoryOnServer = new DirectoryInfo(@"E:\FME\Infranet\SwitchValidator\");

            Validator.FmeBatch = new FileInfo(Validator.WorkbenchDirectoryOnServer + "switchvalidator.bat");
            Validator.FmeWorkbench = new FileInfo(Validator.WorkbenchDirectoryOnServer + "switchvalidator.fmw");

            Validator.PsExec = new FileInfo(@"C:\Users\Public\Documents\Infranet\PSTools\PsExec.exe");
            Validator.FmeExec = new FileInfo(@"C:\Program Files\FME\fme.exe");

            Validator.UserName = "CXP8200";
            Validator.Password = "password";
            Validator.ServerName = @"\\hictblockap022";
        }
    }

<UserControl x:Class="BRail.InfraNet.TrackValidator.TrackValidatorView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Button Grid.Column="0" Grid.Row="0" Command="{Binding SourceUploadCommand}" Content="Open Source" Margin="0,5,5,5"/>
        <Button Grid.Column="1" Grid.Row="0" Command="{Binding ValidateUploadCommand}" Content="Validate Source" Margin="5"/>
        <Button Grid.Column="2" Grid.Row="0" Command="{Binding OpenDestinationCommand}" Content="Open Result" Margin="5,5,0,5"/>
        <TextBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Margin="0,5,0,0" IsReadOnly="True" Height="25" TextWrapping="Wrap" Text="{Binding SourceFileName, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top"/>
        <TextBox Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" Margin="0,5,0,0" TextWrapping="Wrap" Text="{Binding StandardError}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Height="Auto"/>
    </Grid>
</UserControl>

<Window x:Class="BRail.InfraNet.TrackValidator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:BRail.InfraNet.TrackValidator"
        Title="Master Validator" Height="Auto" Width="Auto">
   
      <Grid Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
            <Border BorderBrush="LightBlue" BorderThickness="5" Margin="5" Grid.Column="0">
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Height="20" TextAlignment="Center" Text="TrackValidator" Background="LightBlue" FontStyle="Italic" FontWeight="Bold"/>
                    <local:TrackValidatorView Grid.Row="1" Margin="0,5,0,0" DataContext="{Binding Source={StaticResource TrackValidatorViewModel}}"/>
                </Grid>
            </Border>
            <Border BorderBrush="LightBlue" BorderThickness="5" Margin="5" Grid.Column="1">
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Height="20" TextAlignment="Center" Text="SwitchValidator" Background="LightBlue" FontStyle="Italic" FontWeight="Bold"/>
                    <local:TrackValidatorView Grid.Row="1" Margin="0,5,0,0" DataContext="{Binding Source={StaticResource SwitchValidatorViewModel}}"/>
                </Grid>
            </Border>
           
            </Grid>
   
</Window>