internal DataDescription
   (
   ComunicationNet.DataBlocksRow myRow, TimeSpan timeOut, IDataWrite myWriteInt,
   IStationState myStationState, ref int cVConstrain
   )
   : base(myRow, myWriteInt, myStationState, myDataQueue, timeOut, ref cVConstrain)
 { }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataBlock"/> class.
 /// </summary>
 /// <param name="myRow">My row.</param>
 /// <param name="myWriteInt">My write interface.</param>
 /// <param name="myStationState">State of my station.</param>
 /// <param name="myQueue">My queue.</param>
 /// <param name="cycle">The cycle.</param>
 /// <param name="cVConstrain">The down counter of max number of tags allowed according to license.</param>
 internal DataBlock(ComunicationNet.DataBlocksRow myRow, IDataWrite myWriteInt, IStationState myStationState, WaitTimeList<DataBlock> myQueue, TimeSpan cycle, ref int cVConstrain)
     : base(myQueue, cycle)
 {
   myStartAddress = (int)myRow.Address;
   myDataType = (short)myRow.DataType;
   CreateAllTags
     (myRow.GetTagsRows(), out mylength, myWriteInt, myStartAddress, myDataType, myStationState, ref cVConstrain);
 }
 internal DataWriteDescription
   (int myAddress, short myDataType, IDataWrite writeToStation)
 {
   this.myAddress = myAddress;
   this.myDataType = myDataType;
   this.m_WriteToStation = writeToStation;
   //this.myStation=0; //MZTD: ew. do zaimplementowania
 }
Exemple #4
0
 public Engine(CommandParser commandParser,
               StudentSystem studentSystem,
               IDataReader dataReader,
               IDataWrite dataWriter)
 {
     this.studentSystem = studentSystem;
     this.commandParser = commandParser;
     this.dataReader    = dataReader;
     this.dataWrite     = dataWriter;
 }
        void Run()
        {
            // MSAccess
            _dataSourcePath = @"C:\Users\Sören\Downloads\drive-download-20190707T124853Z-001\CarDatabase.accdb";

            // SQLite
            //_dataSourcePath   = @"C:\0Daten\CarDatabase.db";

            try
            {
                // CarData Layer
                _dataRead = SFactoryIDataRead.CreateInstance(EDataType.Access, _dataSourcePath);
                _dataRead.InitDb();
                _dataWrite = SFactoryIDataWrite.CreateInstance(EDataType.Access, _dataSourcePath);
                _dataWrite.InitDb();

                // CarLogic Layer
                _logicQueries  = SFactoryILogicQueries.CreateInstance(_dataRead);
                _logicCommands = SFactoryILogicCommands.CreateInstance(_dataWrite);

                // CarPresentation Layer
                _dialog = SFactoryIDialog.CreateInstance(_logicQueries, _logicCommands);

                // Start the App
                _app = new Application();
                _app.Run(_dialog as Window);
            }
            catch (ApplicationException e)
            {
                MessageBox.Show(e.Message, "Fehler in der Anwendung", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Fehler in der Anwendung", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
            finally
            {
                if (_dataRead != null)
                {
                    _dataRead.CloseDb();
                }
                if (_dataWrite != null)
                {
                    _dataWrite.CloseDb();
                }
            }
        }
Exemple #6
0
        /// Stream input data from a reader. Calculate the incremental interquartile
        /// mean of the data set.
        /// Can throw Exception on convert to int32.
        static void StreamIQMData(IDataRead reader, IDataWrite writer)
        {
            DataSet data = new DataSet();

            String line;

            while ((line = reader.Read()) != null)
            {
                data.AddPoint(Convert.ToInt32(line));
                if (data.Count < 4)
                {
                    continue;
                }

                double mean   = data.GetIQMean();
                String output = String.Format("Index => {0}, Mean => {1:F2}", data.Count, mean);
                writer.Write(output);
            }
        }
 private void CreateAllTags(ComunicationNet.TagsRow[] tagsDsc, out int length, IDataWrite myWriteInt, int myAddress, short myDataType, IStationState myStationState, ref int cVConstrain)
 {
   SortedList sortedTgs = new SortedList();
   foreach (ComunicationNet.TagsRow curr in tagsDsc)
   {
     if (cVConstrain > 0)
     {
       sortedTgs.Add(curr.TagID, curr);
       cVConstrain--;
     }
   }
   length = sortedTgs.Count;
   tagHendlers = new Tag[length];
   for (ushort idx = 0; (idx < length); idx++)
   {
     ComunicationNet.TagsRow currRow =
       (ComunicationNet.TagsRow)sortedTgs.GetByIndex(idx);
     tagHendlers[idx] = newTag(currRow, myStationState, myAddress + idx, myDataType, myWriteInt);
   }
 }//CreateAllTags
 /// <summary>
 /// Tag constructor
 /// </summary>
 /// <param name="myDSC">params from Tags table</param>
 /// <param name="myStation">pointer to interface that allow to change priority of the station</param>
 /// <param name="myAddress">address</param>
 /// <param name="myDataType">Data type</param>
 /// <param name="writeToStation">pointer to interface that allow to write to station</param>
 /// <param name="property_colllection">collection of properties for this tag see: <see cref="Opc.Da.ItemPropertyCollection"/></param>
 internal TagDataDescription
   (
   NetConfig.TagsRow myDSC, IStationState myStation, int myAddress,
   short myDataType, IDataWrite writeToStation, Opc.Da.ItemPropertyCollection property_colllection
   )
   : base(myDSC, myStation)
 {
   if (property_colllection != null)
     this.AddProperties(property_colllection);
   writableTag = (myDSC.AccessRights == (sbyte)ItemAccessRights.ReadWrite || myDSC.AccessRights == (sbyte)ItemAccessRights.WriteOnly);
   myDWD = new DataWriteDescription(myAddress, myDataType, writeToStation);
   ComunicationNet.TagBitRow[] tagbitsDsc = myDSC.GetTagBitRows();
   if (tagbitsDsc.Length != 0)
   {
     this.TagBitList = new ArrayList();
     foreach (ComunicationNet.TagBitRow curr in tagbitsDsc)
     {
       TagBit newTagBit = new TagBit(myDSC.Name + "_" + curr.Name, (int)curr.BitNumber);
       this.TagBitList.Add(newTagBit);
     }
   }
   else
     this.TagBitList = null;
 }
 protected abstract Tag newTag(ComunicationNet.TagsRow currRow, IStationState myStationState, int myAddress, short myDataType, IDataWrite myWriteInt);
 public EventoRepository(IDataRead reader, IDataWrite writer) : base(reader, writer)
 {
 }
Exemple #11
0
 public Base(IDataRead reader, IDataWrite writer)
 {
     Reader = reader;
     Writer = writer;
 }
Exemple #12
0
 public ParticipanteRepository(IDataRead reader, IDataWrite writer) : base(reader, writer)
 {
 }
      protected override DataBlock.Tag newTag(ComunicationNet.TagsRow currRow, IStationState myStationState, int myAddress, short myDataType, IDataWrite myWriteInt)
      {
#if COMMSERVER
        Opc.Da.ItemPropertyCollection prop_coll = ItemDescriber2OpcDA.GetItemPropertiesCollection(currRow.Name, Initialization.m_ds_dsc);
#else
        Opc.Da.ItemPropertyCollection prop_coll=null;
#endif
        return new TagDataDescription(currRow, myStationState, myAddress, myDataType, myWriteInt, prop_coll);
      }
 protected ParticipanteController(IDataRead reader, IDataWrite writer)
 {
     Db = new ParticipanteRepository(reader, writer);
 }
Exemple #15
0
 public CompeticaoRepository(IDataRead reader, IDataWrite writer) : base(reader, writer)
 {
 }