예제 #1
0
        //---------------------------------------------------------------------------
        public void fn_SaveasCSV(string src, string filename)
        {
            //Local Var.
            string sFrom     = src + filename;
            string sTo       = string.Empty;
            string sPath     = "D:\\LogExport";
            string sFileName = filename.Substring(0, filename.Length - 4) + ".csv";

            //Check Folder
            if (!Directory.Exists(sPath))
            {
                Directory.CreateDirectory(sPath);
            }

            //
            sTo = sPath + "\\" + sFileName;

            try
            {
                File.Copy(sFrom, sTo);

                UserMsgBox.Show(string.Format($"File Export Ok - Path : {sTo}"));
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.Message);
                ExceptionTrace("<fn_SaveasCSV>", ex);

                UserMsgBox.Show(string.Format($"File Export Error - {ex.Message}"));
            }
        }
예제 #2
0
        //---------------------------------------------------------------------------
        private void menuExit_Click(object sender, RoutedEventArgs e)
        {
            if (SEQ._bAuto || SEQ._bRun)
            {
                UserMsgBox.Warning("Can't exit while the machine is running or AUTO mode");
                return;
            }

            if (!UserMsgBox.Confirm("System Shut Down?"))
            {
                return;
            }


            //
            LOG.fn_Trace("----- [MAIN] PROGRAM END   -----  ");


            //JUNG/200417
            SEQ_SPIND.fn_MoveToolClamp(ccFwd);

            //Door Open Set
            SEQ.fn_SetDoorLock(ccOpen);
            SEQ.fn_SetDoorLock_Side(ccOpen);

            //
            IO.fn_SetAutoKey(true);

            //
            fn_MainClose();

            //
            this.Close();
        }
예제 #3
0
 //---------------------------------------------------------------------------
 public void fn_SetURL(string url, bool reset = false)
 {
     try
     {
         if (reset)
         {
             //if (m_Instance._bConnect) return;
             this.client             = new HttpClient();
             this.client.BaseAddress = new Uri(url);
             this.client.Timeout     = TimeSpan.FromSeconds(5.0);
         }
         else
         {
             this.client.BaseAddress = new Uri(url);
         }
     }
     catch (System.Exception ex)
     {
         UserMsgBox.Error("[URL ERROR] " + ex.Message);
     }
 }