Пример #1
0
        /*--------------------------------------------------------------------------------------------*/
        private void AddEventor(EventorType.Id pTypeId, long pYear, byte?pMonth = null, byte?pDay = null,
                                byte?pHour = null, byte?pMinute = null, byte?pSecond = null)
        {
            var e = new Eventor();

            e.EventorId = ++vIdCount;
            e.Type      = (byte)pTypeId;
            e.DateTime  = DataUtil.EventorTimesToLong(pYear, pMonth, pDay, pHour, pMinute, pSecond);
            EveMap.Add(e.EventorId, e);
        }
Пример #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void AddFactor(SetupMemberId pMemId, SetupArtifactId pPrimArtId,
                               SetupArtifactId pRelArtId, DescriptorId pDescId, DirectorId?pDirId,
                               EventorId?pEventId, IdentorId?pIdentId, LocatorId?pLocId, VectorId?pVectId,
                               bool pIsDefining, FactorAssertion.Id pAstId, string pNote)
        {
            Descriptor desc = DescMap[(long)pDescId];

            var f = new Factor();

            f.AssertionType  = (byte)pAstId;
            f.IsDefining     = pIsDefining;
            f.Note           = pNote;
            f.DescriptorType = desc.Type;
            AddVertex(f, (SetupVertexId)(++vIdCount));

            ////

            Member mem = Data.GetVertex <Member>((long)pMemId);

            var mcf = new MemberCreatesFactor();

            mcf.Timestamp         = f.Timestamp;
            mcf.DescriptorType    = f.DescriptorType;
            mcf.PrimaryArtifactId = (long)pPrimArtId;
            mcf.RelatedArtifactId = (long)pRelArtId;

            AddEdge(mem, mcf, f);
            AddEdge(f, new FactorCreatedByMember(), mem);

            ////

            Artifact priArt = Data.GetVertex <Artifact>((long)pPrimArtId);
            Artifact relArt = Data.GetVertex <Artifact>((long)pRelArtId);

            var aupf = new ArtifactUsedAsPrimaryByFactor();

            aupf.Timestamp         = f.Timestamp;
            aupf.DescriptorType    = f.DescriptorType;
            aupf.RelatedArtifactId = relArt.VertexId;

            var aurf = new ArtifactUsedAsRelatedByFactor();

            aurf.Timestamp         = f.Timestamp;
            aurf.DescriptorType    = f.DescriptorType;
            aurf.PrimaryArtifactId = priArt.VertexId;

            AddEdge(priArt, aupf, f);
            AddEdge(relArt, aurf, f);
            AddEdge(f, new FactorUsesPrimaryArtifact(), priArt);
            AddEdge(f, new FactorUsesRelatedArtifact(), relArt);

            ////

            if (desc.PrimArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesPrimaryWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.PrimArtRefId));
            }

            if (desc.TypeArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesTypeWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.TypeArtRefId));
            }

            if (desc.RelArtRefId != null)
            {
                AddEdge(f, new FactorDescriptorRefinesRelatedWithArtifact(),
                        Data.GetVertex <Artifact>((long)desc.RelArtRefId));
            }

            if (pDirId != null)
            {
                Director dir = DirMap[(long)pDirId];
                f.DirectorType          = dir.Type;
                f.DirectorPrimaryAction = dir.PrimaryDirectorActionId;
                f.DirectorRelatedAction = dir.RelatedDirectorActionId;
            }

            if (pEventId != null)
            {
                Eventor e = EveMap[(long)pEventId];
                f.EventorType     = e.Type;
                f.EventorDateTime = e.DateTime;
            }

            if (pIdentId != null)
            {
                Identor i = IdenMap[(long)pIdentId];
                f.IdentorType  = i.Type;
                f.IdentorValue = i.Value;
            }

            if (pLocId != null)
            {
                Locator l = LocMap[(long)pLocId];
                f.LocatorType   = l.Type;
                f.LocatorValueX = l.ValueX;
                f.LocatorValueY = l.ValueY;
                f.LocatorValueZ = l.ValueZ;
            }

            if (pVectId != null)
            {
                Vector v = VecMap[(long)pVectId];
                f.VectorType       = v.Type;
                f.VectorUnit       = v.Unit;
                f.VectorUnitPrefix = v.UnitPrefix;
                f.VectorValue      = v.Value;
                AddEdge(f, new FactorVectorUsesAxisArtifact(), Data.GetVertex <Artifact>(v.AxisArtId));
            }

            Data.ElapseTime();
        }