Ejemplo n.º 1
0
    public Dir FindOrCreate(string path, bool mightBeFile = true)
    {
        int i = path.IndexOf('/');

        if (i > -1)
        {
            Dir dir = FindOrCreate(path.Substring(0, i), false);
            return(dir.FindOrCreate(path.Substring(i + 1), true));
        }
        // if the name is at the end of a path and contains a "."
        // we assume it is a file (unless it is "." by itself)
        if (mightBeFile && path != "." && path.Contains("."))
        {
            Files.Add(path);
            return(this);
        }
        Dir child;

        if (Dirs.ContainsKey(path))
        {
            child = Dirs[path];
        }
        else
        {
            child = new Dir(path);
            Dirs.Add(path, child);
        }
        return(child);
    }
Ejemplo n.º 2
0
    Dirs ReverseDir(Dirs d)
    {
        switch (d)
        {
        case Dirs.N:
            return(Dirs.S);

        case Dirs.NE:
            return(Dirs.SW);

        case Dirs.E:
            return(Dirs.W);

        case Dirs.SE:
            return(Dirs.NW);

        case Dirs.S:
            return(Dirs.N);

        case Dirs.SW:
            return(Dirs.NE);

        case Dirs.W:
            return(Dirs.E);

        case Dirs.NW:
            return(Dirs.SE);

        default:
            return(Dirs.NONE);
        }
    }
Ejemplo n.º 3
0
 public MovingStartButton(int start, int end, Dirs dir)
 {
     pos      = start;
     this.end = end;
     this.dir = dir;
     Moving   = true;
 }
Ejemplo n.º 4
0
        private void SearchSubDir(DirectoryInfo dir, bool isCount)
        {
            if (isCount)
            {
                foreach (FileInfo file in dir.GetFiles())
                {
                    Size += file.Length;
                }
            }

            DirectoryInfo[] subDirs = dir.GetDirectories();
            if (subDirs != null && subDirs.Length > 0)
            {
                foreach (DirectoryInfo subDir in subDirs)
                {
                    if (String.Compare(subDir.Name, "Debug", true) == 0)
                    {
                        Dirs.Add(subDir.FullName);
                        FoundDir(subDir.FullName);
                        SearchSubDir(subDir, true);
                    }
                    else
                    {
                        SearchSubDir(subDir, isCount);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private static void InitializeProcess()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
            {
                WriteLine("Platform is not supported.");
                Exit(-0xFFFFFFF);
                return;
            }

            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                OutputEncoding = Encoding.Unicode;
            }
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore,
                Formatting        = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                Culture           = CultureInfo.InvariantCulture
            };
            if (GetEnvironmentVariable("WT_SESSION") == null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                SetEnvironmentVariable($"RUNE_EMOJI_USE", "0");
                SetEnvironmentVariable($"RUNE_COLOR_USE", "0");
                SetEnvironmentVariable($"RUNE_NIER_USE", "0");
                SetEnvironmentVariable($"NO_COLOR", "true");
                ForegroundColor = ConsoleColor.Gray;
                WriteLine($"no windows-terminal: coloring, emoji and nier has disabled.");
                ForegroundColor = ConsoleColor.White;
            }
            Dirs.Ensure();
            Config.Ensure();
        }
Ejemplo n.º 6
0
 public void Add(params GestureDir[] newDirs)
 {
     foreach (var d in newDirs)
     {
         Dirs.Add(d);
     }
 }
Ejemplo n.º 7
0
    public Sprite GetD(Dirs d)
    {
        switch (d)
        {
        case Dirs.N:
            return(dpads[1]);

        case Dirs.NE:
            return(dpads[2]);

        case Dirs.E:
            return(dpads[3]);

        case Dirs.SE:
            return(dpads[4]);

        case Dirs.S:
            return(dpads[5]);

        case Dirs.SW:
            return(dpads[6]);

        case Dirs.W:
            return(dpads[7]);

        case Dirs.NW:
            return(dpads[8]);

        default:
            return(dpads[0]);
        }
    }
    public Dir FindOrCreate(string path)
    {
        int i = path.IndexOf('/');

        if (i > -1)
        {
            Dir dir = FindOrCreate(path.Substring(0, i));
            return(dir.FindOrCreate(path.Substring(i + 1)));
        }
        // if the path contains a "." it is a file, unless it is "." by itself
        if (path != "." && path.Contains("."))
        {
            Files.Add(path);
            return(this);
        }
        Dir child;

        if (Dirs.ContainsKey(path))
        {
            child = Dirs[path];
        }
        else
        {
            child = new Dir(path);
            Dirs.Add(path, child);
        }
        return(child);
    }
Ejemplo n.º 9
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (pI.JoystickInput() != new Vector3())
     {
         outCompass = pI.CompassInput();
         outAngle   = (int)outCompass;
         outVec     = pI.JoystickInput();
         //transform.Translate(Quaternion.Euler(0.0f, 0.0f, (int)pI.CompassInput()) * new Vector3(0.0f, 1.0f, 0.0f) * Time.fixedDeltaTime);
     }
     if (pI.LTButtonDown)
     {
         transform.Translate(new Vector3(0.0f, -1.0f, 0.0f));
     }
     if (pI.RTButtonDown)
     {
         transform.Translate(new Vector3(0.0f, 1.0f, 0.0f));
     }
     if (pI.ButtonDown(Button.B))
     {
         transform.Translate(new Vector3(1.0f, 0.0f, 0.0f));
     }
     if (pI.ButtonDown(Button.X))
     {
         transform.Translate(new Vector3(-1.0f, 0.0f, 0.0f));
     }
     //transform.Translate(pI.JoystickInput() * Time.fixedDeltaTime * 10.0f);
 }
Ejemplo n.º 10
0
    Vector3 DirLookup(Dirs d)
    {
        switch (d)
        {
        case Dirs.N:
            return(new Vector3(0.0f, 1.0f, 0.0f));

        case Dirs.NE:
            return(new Vector3(1.0f, 1.0f, 0.0f));

        case Dirs.E:
            return(new Vector3(1.0f, 0.0f, 0.0f));

        case Dirs.SE:
            return(new Vector3(1.0f, -1.0f, 0.0f));

        case Dirs.S:
            return(new Vector3(0.0f, -1.0f, 0.0f));

        case Dirs.SW:
            return(new Vector3(-1.0f, -1.0f, 0.0f));

        case Dirs.W:
            return(new Vector3(-1.0f, 0.0f, 0.0f));

        case Dirs.NW:
            return(new Vector3(-1.0f, 1.0f, 0.0f));

        default:
            return(new Vector3(-1.0f, 1.0f, 0.0f));
        }
    }
Ejemplo n.º 11
0
 private bool checkMov(Dirs dir)
 {
     // if a wall is detected, movement is impossible
     if (dir == Dirs.up)
     {
         if (!Physics2D.OverlapCircle(vUp, 0.2f, layerImpass))
         {
             return(true);
         }
     }
     else if (dir == Dirs.down)
     {
         if (!Physics2D.OverlapCircle(vDown, 0.2f, layerImpass))
         {
             return(true);
         }
     }
     else if (dir == Dirs.left)
     {
         if (!Physics2D.OverlapCircle(vLeft, 0.2f, layerImpass))
         {
             return(true);
         }
     }
     else if (dir == Dirs.right)
     {
         if (!Physics2D.OverlapCircle(vRight, 0.2f, layerImpass))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 12
0
 public void AddDir(Dir dir)
 {
     if (!ContainsDir(dir))
     {
         Dirs.Add(GetDir(dir));
         dirs += dir.GetHashCode();
     }
 }
Ejemplo n.º 13
0
        public override bool Equals(object obj)
        {
            var o = obj as Gesture;

            return(o != null &&
                   o.GestureButton == GestureButton &&
                   Dirs.SequenceEqual(o.Dirs) && Modifier == o.Modifier);
        }
Ejemplo n.º 14
0
        public void ClearTestDirectoryTest()
        {
            foreach (var dir in Dirs)
            {
                Client.DeleteDirectoryTask(dir, true).Wait();
            }

            Dirs.All(dir => Client.DirectoryExistsTask(dir).Result == false).Should().Be.True();
        }
Ejemplo n.º 15
0
        public DirsSetupViewModel()
        {
            SelectProgDirCommand    = new DelegateCommand(SelectProgDir);
            SelectReportDirCommand  = new DelegateCommand(SelectReportDir);
            SelectSafeLocateCommand = new DelegateCommand(SelectSafeLocateProgram);

            Dirs = ServerDirManager.Inst;
            Dirs.LoadDirs();
        }
Ejemplo n.º 16
0
        static Neytiri()
        {
            _traceDir = Dirs.DirByCodebase(Dirs.TraceDir);

            if (!Directory.Exists(_traceDir))
            {
                Directory.CreateDirectory(_traceDir);
            }
        }
Ejemplo n.º 17
0
 public Edge(int x, int y, Dirs dir)
 {
     if ((dir != Dirs.W) && (dir != Dirs.S))
     {
         throw new ArgumentException("Edges must be West or South.");
     }
     this.x   = x;
     this.y   = y;
     this.dir = dir;
 }
Ejemplo n.º 18
0
 public Dirs co(
     Dirs dirs, Dir doc
     )
 {
     return(new Dirs(
                nilnul.obj.seq.convert_._AppendX.Append(dirs,
                                                        doc)
                ));
     //throw new NotImplementedException();
 }
Ejemplo n.º 19
0
        private void SelectProgDir()
        {
            FolderBrowserDialog fbDlg = new FolderBrowserDialog();

            if (fbDlg.ShowDialog() == DialogResult.OK)
            {
                Dirs.MeasureProgDirectory = fbDlg.SelectedPath;
                Dirs.SaveDirs();
            }
        }
Ejemplo n.º 20
0
        private void SelectedPcdDirectory()
        {
            FolderBrowserDialog fbDlg = new FolderBrowserDialog();

            if (fbDlg.ShowDialog() == DialogResult.OK)
            {
                Dirs.PcdmisReportsDirectory = fbDlg.SelectedPath;
                Dirs.SaveDirs();
            }
        }
Ejemplo n.º 21
0
        public Face Neighbour(Dirs dir, int dist = 1)
        {
            if (!offsets.ContainsKey(dir))
            {
                throw new ArgumentException("The direction you requested is not recognized.");
            }
            Tuple <int, int> val = offsets[dir];

            return(new Face(this.x + (val.Item1 * dist), this.y + (val.Item2 * dist)));
        }
Ejemplo n.º 22
0
    void ConnectNeighbors(Chunk c, Chunk n, Dir dir)
    {
        if (n == null)
        {
            return;
        }
        int d = (int)dir;

        c.neighbors[d]           = n;
        n.neighbors[Dirs.Opp(d)] = c;
    }
Ejemplo n.º 23
0
 public void Remove(DbRemoteTree remoteTree)
 {
     if (remoteTree.Type == RemoteType.dir)
     {
         Dirs.Remove(remoteTree);
     }
     else
     {
         Items.Remove(remoteTree);
     }
 }
Ejemplo n.º 24
0
        } // ConnectWithServer
        

        /// <summary>Показать файлы и папки</summary>
        public void ShowFilesAndDirs(string path)
        {
            ServerFS.Clear();
            Files.Clear();
            Dirs.Clear();
            DataGridMain.ItemsSource = null;

            GetFileList(path);
            GetDirList(path);

            DataGridMain.ItemsSource = ServerFS;
        } // ShowFilesAndDirs
Ejemplo n.º 25
0
        protected override void OnFixtureTearDown()
        {
            Task.WaitAll(Dirs.Select(dir => Client.DeleteDirectoryTask(dir, true)).ToArray());

            ClearFilesAsync(Client, RemoteFileDir);
            Client.DeleteDirectoryTask(RemoteFileDir).IgnoreExceptions().Wait();

            ClearFilesAsync(Client, MovedDirectoryName);
            Client.DeleteDirectoryTask(MovedDirectoryName).IgnoreExceptions().Wait();

            base.OnFixtureTearDown();
        }
Ejemplo n.º 26
0
 public bool InSelection(string path)
 {
     if (Paths.Any(x => string.Compare(x, path, IgnoreCase) == 0))
     {
         return(SelectMatchedPath());
     }
     if (Dirs.Any(x => path.StartsWith(x + "/", IgnoreCase, CultureInfo.InvariantCulture)))
     {
         return(SelectMatchedPath());
     }
     return(!SelectMatchedPath());
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 对所有元素进行排序
 /// </summary>
 public void Sort()
 {
     foreach (var item in Dirs)
     {
         if (item.Dirs.Count > 0 || item.Items.Count > 0)
         {
             item.Sort();
         }
     }
     Dirs.Sort((x, y) => string.Compare(x.Name, y.Name));
     Items.Sort((x, y) => string.Compare(x.Name, y.Name));
 }
Ejemplo n.º 28
0
    IEnumerator Turn(Transform t, Dirs target, float step)
    {
        Quaternion qtarget = Quaternion.Euler(0, 0, (float)target);
        Quaternion rot     = t.rotation;

        while (rot != qtarget)
        {
            rot        = Quaternion.RotateTowards(rot, qtarget, step);
            t.rotation = rot;
            yield return(null);
        }
    }
Ejemplo n.º 29
0
        public void CreateDirectoryTest()
        {
            ClearTestDirectoryTest();

            foreach (var dir in Dirs)
            {
                Client.CreateDirectoryTask(dir).Result.Should().Be.True();
            }

            Dirs.All(dir => Client.DirectoryExistsTask(dir).Result).Should().Be.True();

            Client.ListDirectoryDetailTask().Result.RunEach(path => Console.WriteLine(path.FullName));
        }
Ejemplo n.º 30
0
 /// <summary>
 /// 创建日志对象的新实例,根据指定的日志文件路径和指定的日志文件创建类型
 /// </summary>
 /// <param name="p">日志文件保存路径</param>
 /// <param name="t">日志文件创建方式的枚举</param>
 public Log(string p, LogType t)
 {
     Dirs.isExitOrCreate(p);
     if (msgs == null)
     {
         state = true;
         path  = p;
         type  = t;
         msgs  = new Queue <Msg>();
         Thread thread = new Thread(work);
         thread.Start();
     }
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Получить строковое обозначение директории на SCADA-Сервере
 /// </summary>
 protected string DirToString(Dirs directory)
 {
     switch (directory)
     {
         case Dirs.Cur:
             return "[Srez]" + Path.DirectorySeparatorChar;
         case Dirs.Hour:
             return "[Hr]" + Path.DirectorySeparatorChar;
         case Dirs.Min:
             return "[Min]" + Path.DirectorySeparatorChar;
         case Dirs.Events:
             return "[Ev]" + Path.DirectorySeparatorChar;
         case Dirs.BaseDAT:
             return "[Base]" + Path.DirectorySeparatorChar;
         case Dirs.Itf:
             return "[Itf]" + Path.DirectorySeparatorChar;
         default:
             return "";
     }
 }
Ejemplo n.º 32
0
 public MovingStartButton(int start, int end, Dirs dir)
 {
     pos = start;
     this.end = end;
     this.dir = dir;
     Moving = true;
 }
Ejemplo n.º 33
0
        /// <summary>
        /// Принять дату и время изменения файла от SCADA-Сервера.
        /// В случае отсутствия файла возвращается минимальная дата
		/// </summary>
        public DateTime ReceiveFileAge(Dirs dir, string fileName)
        {
            Monitor.Enter(tcpLock);
            DateTime result = DateTime.MinValue;
            string filePath = DirToString(dir) + fileName;
            errMsg = "";

            try
            {
                if (RestoreConnection())
                {
#if DETAILED_LOG
                    WriteAction(string.Format(Localization.UseRussian ? 
                        "Приём даты и времени изменения файла {0} от SCADA-Сервера" :
                        "Receive date and time of file {0} modification from SCADA-Server", filePath), 
                        Log.ActTypes.Action);
#endif

                    commState = CommStates.WaitResponse;
                    tcpClient.ReceiveTimeout = commSettings.ServerTimeout;

                    // отправка запроса даты и времени изменения файла
                    int cmdLen = 6 + fileName.Length;
                    byte[] buf = new byte[cmdLen];
                    buf[0] = (byte)(cmdLen % 256);
                    buf[1] = (byte)(cmdLen / 256);
                    buf[2] = 0x0C;
                    buf[3] = 0x01;
                    buf[4] = (byte)dir;
                    buf[5] = (byte)fileName.Length;
                    Array.Copy(Encoding.Default.GetBytes(fileName), 0, buf, 6, fileName.Length);
                    netStream.Write(buf, 0, cmdLen);

                    // приём даты и времени изменения файла
                    buf = new byte[12];
                    netStream.Read(buf, 0, 12);

                    // обработка даты и времени изменения файла
                    if (CheckDataFormat(buf, 0x0C))
                    {
                        double dt = BitConverter.ToDouble(buf, 4);
                        result = dt == 0.0 ? DateTime.MinValue : Arithmetic.DecodeDateTime(dt);
                        commState = CommStates.Authorized;
                    }
                    else
                    {
                        errMsg = string.Format(Localization.UseRussian ? 
                            "Неверный формат ответа SCADA-Сервера на запрос даты и времени изменения файла {0}" :
                            "Incorrect SCADA-Server response to file modification date and time request", filePath);
                        WriteAction(errMsg, Log.ActTypes.Error);
                        commState = CommStates.Error;
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg = string.Format(Localization.UseRussian ?
                        "Ошибка при приёме даты и времени изменения файла {0} от SCADA-Сервера: " :
                        "Error receiving date and time of file {0} modification from SCADA-Server: ", filePath) + 
                        ex.Message;
                WriteAction(errMsg, Log.ActTypes.Exception);
                Disconnect();
            }
            finally
            {
                RestoreReceiveTimeout();
                Monitor.Exit(tcpLock);
            }

            return result;
        }
Ejemplo n.º 34
0
Archivo: Comm.cs Proyecto: iyus/scada
 /// <summary>
 /// Получить полное имя файла
 /// </summary>
 private string GetFullFileName(Dirs dir, string fileName)
 {
     switch (dir)
     {
         case Dirs.Cur:
             return settings.ArcDir + @"Cur\" + fileName;
         case Dirs.Hr:
             return settings.ArcDir + @"Hour\" + fileName;
         case Dirs.Min:
             return settings.ArcDir + @"Min\" + fileName;
         case Dirs.Ev:
             return settings.ArcDir + @"Events\" + fileName;
         case Dirs.BaseDAT:
             return settings.BaseDATDir + fileName;
         case Dirs.Itf:
             return settings.ItfDir + fileName;
         case Dirs.CurCopy:
             return settings.ArcCopyDir + @"Cur\" + fileName;
         case Dirs.HrCopy:
             return settings.ArcCopyDir + @"Hour\" + fileName;
         case Dirs.MinCopy:
             return settings.ArcCopyDir + @"Min\" + fileName;
         default: // Dirs.EvCopy
             return settings.ArcCopyDir + @"Events\" + fileName;
     }
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Получить строковое обозначение директории на SCADA-Сервере
 /// </summary>
 protected string DirToString(Dirs directory)
 {
     switch (directory)
     {
         case Dirs.Cur:
             return "[Srez]\\";
         case Dirs.Hour:
             return "[Hr]\\";
         case Dirs.Min:
             return "[Min]\\";
         case Dirs.Events:
             return "[Ev]\\";
         case Dirs.BaseDAT:
             return "[Base]\\";
         case Dirs.Itf:
             return "[Itf]\\";
         default:
             return "";
     }
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Принять файл от SCADA-Сервера
        /// </summary>
        protected bool ReceiveFile(Dirs dir, string fileName, Stream inStream)
        {
            bool result = false;
            string filePath = DirToString(dir) + fileName;

            try
            {
#if DETAILED_LOG
                WriteAction(string.Format(Localization.UseRussian ? "Приём файла {0} от SCADA-Сервера" : 
                    "Receive file {0} from SCADA-Server", filePath), Log.ActTypes.Action);
#endif

                commState = CommStates.WaitResponse;
                tcpClient.ReceiveTimeout = commSettings.ServerTimeout;

                const int dataSize = 10240; // размер запрашиваемых данных 10 кБ
                const byte dataSizeL = dataSize % 256;
                const byte dataSizeH = dataSize / 256;

                byte[] buf = new byte[6 + dataSize]; // буфер отправляемых и получаемых данных
                bool open = true;  // выполняется открытие файла
                bool stop = false; // признак завершения приёма данных

                while (!stop)
                {
                    if (open)
                    {
                        // отправка команды открытия файла и чтения данных
                        byte fileNameLen = (byte)fileName.Length;
                        int cmdLen = 7 + fileNameLen;
                        buf[0] = (byte)(cmdLen % 256);
                        buf[1] = (byte)(cmdLen / 256);
                        buf[2] = 0x08;
                        buf[3] = (byte)dir;
                        buf[4] = fileNameLen;
                        Array.Copy(Encoding.Default.GetBytes(fileName), 0, buf, 5, fileNameLen);
                        buf[cmdLen - 2] = dataSizeL;
                        buf[cmdLen - 1] = dataSizeH;
                        netStream.Write(buf, 0, cmdLen);
                    }
                    else
                    {
                        // отправка команды чтения данных из файла
                        buf[0] = 0x05;
                        buf[1] = 0x00;
                        buf[2] = 0x0A;
                        buf[3] = dataSizeL;
                        buf[4] = dataSizeH;
                        netStream.Write(buf, 0, 5);
                    }

                    // приём результата открытия файла и считанных данных
                    byte cmdNum = buf[2];
                    int headerLen = open ? 6 : 5;
                    int bytesRead = netStream.Read(buf, 0, headerLen);
                    int dataSizeRead = 0; // размер считанных из файла данных                    

                    if (bytesRead == headerLen)
                    {
                        dataSizeRead = buf[headerLen - 2] + 256 * buf[headerLen - 1];
                        if (0 < dataSizeRead && dataSizeRead <= dataSize)
                            bytesRead += ReadNetStream(buf, headerLen, dataSizeRead);
                    }

                    if (CheckDataFormat(buf, cmdNum, bytesRead) && bytesRead == dataSizeRead + headerLen)
                    {
                        if (open)
                        {
                            open = false;

                            if (buf[3] > 0) // файл открыт
                            {
                                inStream.Write(buf, 6, dataSizeRead);
                                commState = CommStates.Authorized;
                                stop = dataSizeRead < dataSize;
                            }
                            else
                            {
                                errMsg = string.Format(Localization.UseRussian ? 
                                    "SCADA-Серверу не удалось открыть файл {0}" : 
                                    "SCADA-Server unable to open file {0}", filePath);
                                WriteAction(errMsg, Log.ActTypes.Action);
                                commState = CommStates.NotReady;
                                stop = true;
                            }
                        }
                        else
                        {
                            inStream.Write(buf, 5, dataSizeRead);
                            commState = CommStates.Authorized;
                            stop = dataSizeRead < dataSize;
                        }
                    }
                    else
                    {
                        errMsg = string.Format(Localization.UseRussian ? 
                            "Неверный формат ответа SCADA-Сервера на команду открытия или чтения из файла {0}" :
                            "Incorrect SCADA-Server response to open file or read from file {0} command ", filePath);
                        WriteAction(errMsg, Log.ActTypes.Error);
                        commState = CommStates.Error;
                        stop = true;
                    }
                }

                // определение результата
                if (commState == CommStates.Authorized)
                {
                    if (inStream.Length > 0)
                        inStream.Position = 0;
                    result = true;
                }
            }
            catch (Exception ex)
            {
                errMsg = string.Format(Localization.UseRussian ? "Ошибка при приёме файла {0} от SCADA-Сервера: " :
                    "Error receiving file {0} from SCADA-Server: ", filePath) + ex.Message;
                WriteAction(errMsg, Log.ActTypes.Exception);
                Disconnect();
            }
            finally
            {
                RestoreReceiveTimeout();
            }

            return result;
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Получить полное имя файла
        /// </summary>
        private string GetFullFileName(Dirs dir, string fileName)
        {
            fileName = ScadaUtils.CorrectDirectorySeparator(fileName);
            string sepPlusFileName = Path.DirectorySeparatorChar + fileName;

            switch (dir)
            {
                case Dirs.Cur:
                    return settings.ArcDir + "Cur" + sepPlusFileName;
                case Dirs.Hr:
                    return settings.ArcDir + "Hour" + sepPlusFileName;
                case Dirs.Min:
                    return settings.ArcDir + "Min" + sepPlusFileName;
                case Dirs.Ev:
                    return settings.ArcDir + "Events" + sepPlusFileName;
                case Dirs.BaseDAT:
                    return settings.BaseDATDir + fileName;
                case Dirs.Itf:
                    return settings.ItfDir + fileName;
                case Dirs.CurCopy:
                    return settings.ArcCopyDir + "Cur" + sepPlusFileName;
                case Dirs.HrCopy:
                    return settings.ArcCopyDir + "Hour" + sepPlusFileName;
                case Dirs.MinCopy:
                    return settings.ArcCopyDir + "Min" + sepPlusFileName;
                default: // Dirs.EvCopy
                    return settings.ArcCopyDir + "Events" + sepPlusFileName;
            }
        }