Esempio n. 1
0
 public static void Log(string message, string color, Nodo n)
 {
     if (linesPerSecond > 500)
         System.Threading.Thread.Sleep(1000);
     if (fdoc.Dispatcher.CheckAccess())
         log(message, color, n);
     else
         log2(message, color, n);
     linesPerSecond++;
 }
Esempio n. 2
0
  static void log (string message, string color, Nodo n)
 {
     string s = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " : " + message;
     Paragraph par = new Paragraph();
     TextBlock tblock = new TextBlock(new Run(s));
     tblock.Tag = n;
     tblock.Cursor = Cursors.Hand;
     tblock.PreviewMouseDown += link_click;
     tblock.Padding = new Thickness(0);
     tblock.FontWeight=FontWeights.Bold;
     tblock.LineHeight = 10;
     tblock.TextWrapping = TextWrapping.NoWrap;
     tblock.Margin = new Thickness(1);
     par.Margin = new Thickness(2);
     par.Loaded += paragraph_Loaded;            
     par.Inlines.Add(tblock);
     fdoc.Blocks.Add(par);
 }
Esempio n. 3
0
 public Canale(string name,Nodo father, string[] fields, List<string> map)
 {
     this.father = father;
     protocolname = map[0];
     propertyDefinitions = ComDefinitions.Map[map[0]];
     propertyValues = new PropertyList();
     this.name = name;
     foreach (var pt in propertyDefinitions)
     {
         if (!pt.Value.Visibile) continue;
         int i = map.FindIndex(x => x == pt.Key);
         if (pt.Key == "Abilitato")
         {
             if (!Boolean.TryParse(fields[i - 1], out abilitazione)) abilitazione = false;
         }
         if (i > 0)
         {
             propertyValues.Add(pt.Key, (fields[i - 1]).Replace("%sc%",";"), pt.Value);
         }
         else
             propertyValues.Add(pt.Key, "", pt.Value);
     }
 
 }
Esempio n. 4
0
 public Foglia(string name, Nodo father, bool abilitazione) : base(name, father, abilitazione) {
     propertyValues = new PropertyList();
 }
Esempio n. 5
0
        public Report61850(string name, Nodo father, bool abilitazione) : base(name, father, abilitazione)
        {

        }
Esempio n. 6
0
 public int checkCOMNames(Nodo cTree)
 {
     int errs = 0;
     List<Foglia> collisions, leaves = new List<Foglia>();
     cTree.getLeaves(leaves);
     foreach (Foglia f in leaves)
     {
         collisions = leaves.FindAll(x => x.Name == f.Name);
         if (collisions.Count <= 1) continue;
         Logger.Log("Channel names error: i seguenti canali hanno lo stesso nome","Red");
         foreach (Foglia vc in collisions)
             Logger.Log(vc.Path,"Red");
          errs++; errors++;
     }
     return errs;
 }
Esempio n. 7
0
        public VarNodo(string name, Nodo father, bool abilitazione) : base(name, father, abilitazione)
        {

        }
Esempio n. 8
0
 public bool checkAncestor(Nodo n)
 {
     Nodo f = this;
     while (f!=null)
     {
         if (f == n) return true;
         f = f.father;
     }
     return false;
 }
Esempio n. 9
0
 public virtual Nodo Clone()
 {
     Nodo n = new Nodo(name, null, abilitazione);
     foreach (Nodo child in children)
     {
         n.Append((Nodo)(child.Clone()));
     }
     n.rebuild();
     return n;
 }
Esempio n. 10
0
 public void Remove(Nodo n)
 {
     children.Remove(n);
 }
Esempio n. 11
0
 /// <summary>
 /// Aggiunge un figlio al nodo
 /// </summary>
 /// <param name="n"></param>
 public virtual void Append(Nodo n)
 {
     children.Add(n);
     n.father = this;
 }
Esempio n. 12
0
 public Nodo(string name, Nodo father, bool abilitazione)
 {
     this.name = name;
     this.father = father;
     this.abilitazione = abilitazione;
     children = new ObservableCollection<Nodo>();
 }
Esempio n. 13
0
 private static void log2(string message, string color,Nodo n)
 {
     fdoc.Dispatcher.BeginInvoke(logndeleg, message, color,n);
 }
Esempio n. 14
0
 public Canale(string name, Nodo father, bool abilitazione) : base(name, father, abilitazione)
 {
 }
Esempio n. 15
0
 public Variable(string name, Nodo father, bool abilitazione,int GMAddress) : base(name, father, abilitazione) {
     this.GMAddress = GMAddress;
 }