コード例 #1
0
        private CompletePossitionReport ProcessTrainPosMessage(PCBridgeDataTransferMessage dataMessage)
        {
            CompletePossitionReport complete = new CompletePossitionReport();
            Packet gpsPacket  = dataMessage.GetPacket(STIRConsts.Packet_OtherData);      //packet 44
            GPSFix gpsDetails = ConstructGPSFix(gpsPacket);
            Packet posPacket  = dataMessage.GetPacket(STIRConsts.Packet_PositionReport); //packet 0

            if (posPacket != null)
            {
                complete.Basic = ConstructReport(posPacket);
            }
            if (gpsDetails != null)
            {
                complete.GPSDetails = gpsDetails;
            }
            Field Q_CABROLE = dataMessage.GetMessageField(STIRConsts.FieldName_Q_CABROLE);

            if (Q_CABROLE != null)
            {
                complete.FrontCabNotBack = Q_CABROLE.value == 0;
            }

            Field Q_STIRSTATUS = dataMessage.GetMessageField(STIRConsts.FieldName_Q_CABROLE);

            if (Q_STIRSTATUS != null)
            {
                complete.Stir_Status = (StirStatusEnum)(byte)Q_STIRSTATUS.value;
            }

            complete.NID_Engine = dataMessage.GetMessageField(STIRConsts.FieldName_NID_ENGINE).value;
            complete.TSAP       = dataMessage.TSAP;
            return(complete);
        }
コード例 #2
0
        private void ProcessFullMessage()
        {
            PCBridgeDataTransferMessage dataMessage = new PCBridgeDataTransferMessage(OutterBuffer.ToArray());

            dataMessage.messageManager = m_messageManager;
            dataMessage.Interpret();
            StirMessage             NID       = (StirMessage)dataMessage.nid_message;
            CompletePossitionReport posReport = null;

            switch (NID)
            {
            case StirMessage.NID_TrainPosUpdate:    //136
                posReport = ProcessTrainPosMessage(dataMessage);
                break;

            case StirMessage.NID_TrainStatus:    //136
                posReport = ProcessTrainPosMessage(dataMessage);
                break;

            case StirMessage.NID_NewSTiR_AOC:    //171
                TriggerStir(dataMessage);
                break;

            case StirMessage.NID_RevokeSTiR:    //173
                RevokeStir(dataMessage);
                break;

            default:
                break;
            }
            if (posReport != null)
            {
                posReport.Source = NID;
            }
        }
コード例 #3
0
 public static void InsertPositionUpdate(CompletePossitionReport report)
 {
     //AurthenticateServiceClient authClient = new AurthenticateServiceClient();
     //RacoonAurthorisationResponse response = authClient.Authenticate(
     //    Properties.Settings.Default.MiddlewareAccount,
     //    Properties.Settings.Default.MiddlewarePassword,
     //    Properties.Settings.Default.StardogUser,
     //    Properties.Settings.Default.StardogPassword,
     //    new Uri(Properties.Settings.Default.StardogServer),
     //    Properties.Settings.Default.StardogDB,
     //    "EN-GB");
 }