// Function from file: cart.dm
        public void post_status(string command = null, dynamic data1 = null, dynamic data2 = null)
        {
            RadioFrequency frequency     = null;
            Signal         status_signal = null;

            frequency = GlobalVars.SSradio.return_frequency(1435);

            if (!(frequency != null))
            {
                return;
            }
            status_signal        = new Signal();
            status_signal.source = this;
            status_signal.transmission_method = 1;
            status_signal.data["command"]     = command;

            switch ((string)(command))
            {
            case "message":
                status_signal.data["msg1"] = data1;
                status_signal.data["msg2"] = data2;
                break;

            case "alert":
                status_signal.data["picture_state"] = data1;
                break;
            }
            frequency.post_signal(this, status_signal);
            return;
        }
        // Function from file: console.dm
        public void post_signal(string command = null)
        {
            RadioFrequency frequency     = null;
            Signal         status_signal = null;

            frequency = GlobalVars.SSradio.return_frequency(1435);

            if (!(frequency != null))
            {
                return;
            }
            status_signal        = new Signal();
            status_signal.source = this;
            status_signal.transmission_method = 1;
            status_signal.data["command"]     = command;
            frequency.post_signal(this, status_signal);
            return;
        }
示例#3
0
        // Function from file: meter.dm
        public override int?process_atmos(  )
        {
            GasMixture     environment      = null;
            double         env_pressure     = 0;
            int            val              = 0;
            int            val2             = 0;
            int            val3             = 0;
            RadioFrequency radio_connection = null;
            Signal         signal           = null;


            if (!Lang13.Bool(this.target))
            {
                this.icon_state = "meterX";
                return(0);
            }

            if ((this.stat & 3) != 0)
            {
                this.icon_state = "meter0";
                return(0);
            }
            this.f_use_power(5);
            environment = ((Ent_Static)this.target).return_air();

            if (!(environment != null))
            {
                this.icon_state = "meterX";
                return(0);
            }
            env_pressure = environment.return_pressure();

            if (env_pressure <= 15.198750495910645)
            {
                this.icon_state = "meter0";
            }
            else if (env_pressure <= 182.38499450683594)
            {
                val             = Num13.Floor(env_pressure / 30.39750099182129 + 0.5);
                this.icon_state = "meter1_" + val;
            }
            else if (env_pressure <= 3039.75)
            {
                val2            = Num13.Floor(env_pressure / 506.625 - 0.41) + 1;
                this.icon_state = "meter2_" + val2;
            }
            else if (env_pressure <= 5978.1748046875)
            {
                val3            = Num13.Floor(env_pressure / 506.625 - 6) + 1;
                this.icon_state = "meter3_" + val3;
            }
            else
            {
                this.icon_state = "meter4";
            }

            if (this.frequency != 0)
            {
                radio_connection = GlobalVars.SSradio.return_frequency(this.frequency);

                if (!(radio_connection != null))
                {
                    return(null);
                }
                signal        = new Signal();
                signal.source = this;
                signal.transmission_method = 1;
                signal.data = new ByTable().Set("id_tag", this.id_tag).Set("device", "AM").Set("pressure", Num13.Floor(env_pressure)).Set("sigtype", "status");
                radio_connection.post_signal(this, signal);
            }
            return(null);
        }