Beispiel #1
0
 /// <summary>
 /// The read.
 /// </summary>
 /// <param name="fileName">
 /// The file name.
 /// </param>
 /// <param name="itemName">
 /// The item name.
 /// </param>
 /// <param name="readCompleted">
 /// The read completed.
 /// </param>
 /// <param name="userState">
 /// The user state.
 /// </param>
 public static void Read(string fileName, string itemName, SubroutineCallCompleted readCompleted, object userState = null)
 {
     if (Thread.CurrentThread.ManagedThreadId != Application.Current.Dispatcher.Thread.ManagedThreadId)
     {
         JobManager.RunInUIThread(
             DispatcherPriority.Normal,
             () =>
             SbProcessHandler.CallSubroutine(
                 readCompleted,
                 "UT.XUI.READ",
                 new[]
                     {
                         new SBString(fileName), new SBString(itemName), new SBString(), new SBString(), new SBString("0"),
                         new SBString()
                     },
                 userState ?? new object()));
     }
     else
     {
         SbProcessHandler.CallSubroutine(
             readCompleted,
             "UT.XUI.READ",
             new[]
                 {
                     new SBString(fileName), new SBString(itemName), new SBString(), new SBString(), new SBString("0"), new SBString()
                 },
             userState ?? new object());
     }
 }
Beispiel #2
0
 /// <summary>
 /// The is debug enabled.
 /// </summary>
 /// <param name="subroutineCallCompleted">
 /// The subroutine call completed.
 /// </param>
 internal static void IsDebugEnabled(SubroutineCallCompleted subroutineCallCompleted)
 {
     SbProcessHandler.CallSubroutine(
         subroutineCallCompleted,
         "XUI.DEBUG",
         new[] { new SBString("6"), new SBString(), new SBString(), new SBString(), new SBString("0"), new SBString() },
         new object[0]);
 }
Beispiel #3
0
 /// <summary>
 /// The get common variable.
 /// </summary>
 /// <param name="subroutineCallCompleted">
 /// The subroutine call completed.
 /// </param>
 /// <param name="whichVariable">
 /// The which variable.
 /// </param>
 internal static void GetCommonVariable(SubroutineCallCompleted subroutineCallCompleted, string whichVariable)
 {
     SbProcessHandler.CallSubroutine(
         subroutineCallCompleted,
         "XUI.DEBUG",
         new[] { new SBString("4"), new SBString(whichVariable), new SBString(), new SBString(), new SBString("0"), new SBString() },
         new object[0]);
 }
Beispiel #4
0
 /// <summary>
 /// The enable debug.
 /// </summary>
 /// <param name="subroutineCallCompleted">
 /// The subroutine call completed.
 /// </param>
 /// <param name="enable">
 /// The enable.
 /// </param>
 internal static void EnableDebug(SubroutineCallCompleted subroutineCallCompleted, bool enable)
 {
     SbProcessHandler.CallSubroutine(
         subroutineCallCompleted,
         "XUI.DEBUG",
         new[]
             {
                 new SBString("1"), new SBString(enable ? "1" : "0"), new SBString(), new SBString(), new SBString("0"), new SBString()
             },
         new object[0]);
 }
        /// <summary>
        /// The upload.
        /// </summary>
        /// <param name="sourceFileName">
        /// The source file name.
        /// </param>
        /// <param name="targetFileName">
        /// The target file name.
        /// </param>
        /// <param name="itemId">
        /// The item id.
        /// </param>
        /// <param name="options">
        /// The options.
        /// </param>
        /// <param name="uploadCompleted">
        /// The upload completed.
        /// </param>
        public static void Upload(
            string sourceFileName,
            string targetFileName,
            string itemId,
            string options,
            SubroutineCallCompleted uploadCompleted)
        {
            // SUBROUTINE TU.UPLOAD(DOS.FILE.NAME, F.RXFILE, ITEMID, OPTIONS, DESCRIPTION, STATUS.REC)
            // MESSAGE = DOS.FILE.NAME : @AM : @AM : FILE.NAME : @AM : ITEMID
            // FT.OPTIONS = OPTIONS : "O"
            // DATA = ""
            // CALL SB.FT.MASTER(3, MESSAGE, DATA, FT.OPTIONS, STATUS.REC)
            if (!File.Exists(sourceFileName))
            {
                return;
            }
            var message = new SBString();
            message.SBInsert(1, sourceFileName);
            message.SBInsert(3, targetFileName);
            message.SBInsert(4, itemId);

            SbProcessHandler.CallSubroutine(
                uploadCompleted,
                "SB.FT.MASTER",
                new[] { new SBString("3"), message, new SBString(), new SBString(options + "O"), new SBString() },
                new object[] { sourceFileName, targetFileName, itemId, options });

            /*
            SbProcessHandler.CallSubroutine(
                "SB.FT.MASTER",
                5,
                new[] { new SBString("3"), message, new SBString(), new SBString(options + "O"), new SBString() },
                new object[] { sourceFileName, targetFileName, itemId, options },
                uploadCompleted);
            */
        }
Beispiel #6
0
 /// <summary>
 /// The is xui debug there.
 /// </summary>
 /// <param name="subroutineCallCompleted">
 /// The subroutine call completed.
 /// </param>
 internal static void IsXuiDebugThere(SubroutineCallCompleted subroutineCallCompleted)
 {
     SBFile.Read("VOC", "XUI.DEBUG", subroutineCallCompleted);
 }
Beispiel #7
0
 /// <summary>
 /// Writes the record.
 /// </summary>
 /// <remarks>
 /// FILE.NAME = PARAM1&lt;1&gt;
 ///     ID = PARAM1&lt;2&gt;
 ///     ATTR = PARAM1&lt;3&gt;
 ///     MODE = PARAM1&lt;4&gt;
 ///     REC = PARAM2
 /// </remarks>
 /// <param name="writeCompleted">
 /// The write completed.
 /// </param>
 /// <param name="itemInfo">
 /// The item information.
 /// </param>
 /// <param name="record">
 /// The record.
 /// </param>
 internal static void WriteRecord(SubroutineCallCompleted writeCompleted, SBString itemInfo, SBString record)
 {
     SbProcessHandler.CallSubroutine(
         writeCompleted,
         "XUI.DEBUG",
         new[] { new SBString("7"), itemInfo, record, new SBString(), new SBString("0"), new SBString() },
         new object[0]);
 }
Beispiel #8
0
 /// <summary>
 /// The stack expression.
 /// </summary>
 /// <param name="expressionStackCompleted">
 /// The expression stack completed.
 /// </param>
 /// <param name="expression">
 /// The expression.
 /// </param>
 /// <param name="fileName">
 /// The file name.
 /// </param>
 internal static void StackExpression(SubroutineCallCompleted expressionStackCompleted, string expression, string fileName)
 {
     JobManager.RunInUIThread(
         DispatcherPriority.Normal,
         delegate
             {
                 try
                 {
                     SbProcessHandler.CallSubroutine(
                         expressionStackCompleted,
                         "XUI.DEBUG",
                         new[]
                             {
                                 new SBString("8"), new SBString(expression), new SBString(fileName), new SBString(), new SBString("0"),
                                 new SBString()
                             },
                         new object[0]);
                 }
                 catch (Exception exception)
                 {
                     CustomLogger.LogException(exception, "A problem occurred calling XUI.DEBUG mode 8.");
                 }
             });
 }
Beispiel #9
0
        /// <summary>
        /// The read dictionary item.
        /// </summary>
        /// <param name="fileName">
        /// The file name.
        /// </param>
        /// <param name="itemName">
        /// The item name.
        /// </param>
        /// <param name="readState">
        /// The read state.
        /// </param>
        /// <param name="subroutineCallCompleted">
        /// The subroutine call completed.
        /// </param>
        public static void ReadDictionaryItem(
            string fileName,
            string itemName,
            object readState,
            SubroutineCallCompleted subroutineCallCompleted)
        {
            if (string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(itemName))
            {
                return;
            }

            var fName = fileName.StartsWith("DICT ") ? fileName : "DICT " + fileName;
            if (Thread.CurrentThread.ManagedThreadId != Application.Current.Dispatcher.Thread.ManagedThreadId)
            {
                JobManager.RunInUIThread(DispatcherPriority.Input, () => Read(fName, itemName, subroutineCallCompleted, readState));
            }
            else
            {
                Read(fName, itemName, subroutineCallCompleted, readState);
            }
        }
Beispiel #10
0
        /// <summary>
        /// Writes the specified file name.
        /// </summary>
        /// <param name="fileName">
        /// Name of the file.
        /// </param>
        /// <param name="id">
        /// The identifier.
        /// </param>
        /// <param name="attribute">
        /// The attribute.
        /// </param>
        /// <param name="mode">
        /// The mode.
        /// </param>
        /// <param name="record">
        /// The record.
        /// </param>
        /// <param name="subroutineCallCompleted">
        /// The subroutine call completed.
        /// </param>
        public static void Write(
            string fileName,
            string id,
            string attribute,
            string mode,
            SBString record,
            SubroutineCallCompleted subroutineCallCompleted)
        {
            /*
            FILE.NAME = PARAM1<1>
            ID = PARAM1<2>
            ATTR = PARAM1<3>
            MODE = PARAM1<4>
            REC = PARAM2
             *
             * SUBROUTINE XUI.DEBUG(MODE, PARAM1, PARAM2, PARAM3, STATUS, STATUSDESC)
             */
            var param1 = new SBString();
            param1.SBInsert(1, fileName);
            param1.SBInsert(2, id);
            param1.SBInsert(3, attribute);
            param1.SBInsert(4, mode);

            if (Thread.CurrentThread.ManagedThreadId != Application.Current.Dispatcher.Thread.ManagedThreadId)
            {
                JobManager.RunInUIThread(DispatcherPriority.Input, () => XuiDebug.WriteRecord(subroutineCallCompleted, param1, record));
            }
            else
            {
                XuiDebug.WriteRecord(subroutineCallCompleted, param1, record);
            }
        }
Beispiel #11
0
 /// <summary>
 /// Writes the specified file name.
 /// </summary>
 /// <param name="fileName">
 /// Name of the file.
 /// </param>
 /// <param name="id">
 /// The identifier.
 /// </param>
 /// <param name="record">
 /// The record.
 /// </param>
 /// <param name="subroutineCallCompleted">
 /// The subroutine call completed.
 /// </param>
 public static void Write(string fileName, string id, SBString record, SubroutineCallCompleted subroutineCallCompleted)
 {
     Write(fileName, id, string.Empty, "0", record, subroutineCallCompleted);
 }