Example #1
1
        private static List<MonthOfTheYear> listOnMonth(Int16 pInit, Int16 pFinish)
        {
            List<MonthOfTheYear> lstMeses = new List<MonthOfTheYear>();
            List<MonthOfTheYear> allMonths =  new List<MonthOfTheYear>();
            Int16 init, finish;

            allMonths = putOnMonth();

            if (pInit < 1)
                init = 1;
            else if (pInit > 12) 
                init = 12;
            else
                init = pInit;

            //************************************************************

            if (pFinish < 1 || pFinish > 12)
                finish = 12;
            else if (pInit > pFinish)
                finish = pInit;
            else
                finish = pFinish;

            //************************************************************

            foreach (MonthOfTheYear mes in allMonths)
            {
                if (mes.Num >= init && mes.Num <= finish)
                    lstMeses.Add(mes);
            }
            return lstMeses;
        }
Example #2
0
    //district
    public DataTable load_districts(Int16 stateId)
    {
        try
        {
            if (care.State == ConnectionState.Closed)
            {
                care.Open();
            }

            adapt = new SqlDataAdapter("fetchDist", care);
            adapt.SelectCommand.CommandType = CommandType.StoredProcedure;
            adapt.SelectCommand.Parameters.AddWithValue("@stateId", stateId);
            DataSet ds = new DataSet();
            adapt.Fill(ds, "tblDist");
            adapt.Dispose();
            return ds.Tables["tblDist"];
        }
        catch
        {
            throw;
        }

        finally
        {
            care.Close();
        }
    }
Example #3
0
 public override void OnJoinRandomFailed(System.Int16 returnCode, System.String message)
 {
     base.OnJoinRandomFailed(returnCode, message);
     PhotonNetwork.CreateRoom(null, new RoomOptions {
         MaxPlayers = 20
     });
 }
        /// <summary>
        /// Metoda szukająca maksymalny przepływ.
        /// </summary>
        /// <param name="start">Punkt początkowy przepływu</param>
        /// <param name="stop">Punkt końcowy przepływu</param>
        /// <param name="_matrix">Graf na ktorym operujemy przedstawiony w postaci macierzy incydencji</param>
        public virtual void Flow(int start, int stop, Int16?[][] _matrix)
        {
            setFlowMatrix(_matrix);

            flow_val = 0;

            //wyjatkowy przypadek
            if (start == stop) {
                raport_str.Append("Start == Stop: przepływ dowolny\n");
                return;
            }

            //ścieżkę reprezentujemy jako sekwencyjną listę liczb
            //które określają wierzchołki przez które trzeba przejść
            List<int> path = null;

            //jeśli jest ścieżka o długości większej niż 0
            while((path = findPath(start,stop)).Count > 0){
                int min = findMinFlow(path);
                flow_val += min;
                minimize(path, min);
            }

            raport_str.Append("Maksymalny przepływ wg. Forda i Fulkersona to " + flow_val + "\n");
        }
Example #5
0
    static void ConvertAndWrite(FileStream fileStream, float[] samples)
    {
        // var samples = new float[clip.samples];

        // clip.GetData(samples, 0);

        System.Int16[] intData = new System.Int16[samples.Length];
        //converting in 2 float[] steps to Int16[], //then Int16[] to Byte[]

        System.Byte[] bytesData = new System.Byte[samples.Length * 2];
        //bytesData array is twice the size of
        //dataSource array because a float converted in Int16 is 2 bytes.

        int rescaleFactor = 32767;         //to convert float to Int16

        for (int i = 0; i < samples.Length; i++)
        {
            intData[i] = (short)(samples[i] * rescaleFactor);
            System.Byte[] byteArr = new System.Byte[2];
            byteArr = System.BitConverter.GetBytes(intData[i]);
            byteArr.CopyTo(bytesData, i * 2);
        }

        fileStream.Write(bytesData, 0, bytesData.Length);
    }
Example #6
0
        public static string Caesar(this string source, Int16 shift)
        {
            var maxChar = Convert.ToInt32(char.MaxValue);
            var minChar = Convert.ToInt32(char.MinValue);

            var buffer = source.ToCharArray();

            for (var i = 0; i < buffer.Length; i++)
            {
                var shifted = Convert.ToInt32(buffer[i]) + shift;

                if (shifted > maxChar)
                {
                    shifted -= maxChar;
                }
                else if (shifted < minChar)
                {
                    shifted += maxChar;
                }

                buffer[i] = Convert.ToChar(shifted);
            }

            var result = new string(buffer);
            return result;
        }
		/// <summary>
		/// Find Player by Id
		/// </summary>
		public TServer FindTServer(Int16 Id)
		{
			TServer player;
			if (this.serverList.TryGetValue(Id, out player))
				return player;
			return null;
		}
 public TinhEntity()
 {
     m_pk_itinhid=0;
     m_stentinh="";
     m_skyhieu="";
     m_iso31662="";
 }
Example #9
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="artifact"></param>
        /// <param name="typeCodeValue"></param>
        /// <param name="endpointIndex"></param>
        /// <param name="sourceIdHash"></param>
        /// <param name="messageHandle"></param>
        public static void ParseArtifact(string artifact, ref Int16 typeCodeValue, ref Int16 endpointIndex, ref byte[] sourceIdHash, ref byte[] messageHandle)
        {
            if (sourceIdHash.Length != SourceIdLength)
                throw new ArgumentException(
                    string.Format(argumentLengthErrorFmt, sourceIdHash.Length, SourceIdLength), "sourceIdHash");

            if (messageHandle.Length != MessageHandleLength)
                throw new ArgumentException(
                    string.Format(argumentLengthErrorFmt, messageHandle.Length, MessageHandleLength), "messageHandle");

            byte[] bytes = Convert.FromBase64String(artifact);

            if (bytes.Length != artifactLength)
                throw new ArgumentException("Unexpected artifact length", "artifact");

            typeCodeValue = (Int16)(bytes[0] << 8 | bytes[1]);

            endpointIndex = (Int16)(bytes[2] << 8 | bytes[3]);

            int index = 4;

            for(int i = 0; i < SourceIdLength; i++)
            {
                sourceIdHash[i] = bytes[i + index];
            }

            index += SourceIdLength;

            for (int i = 0; i < MessageHandleLength; i++)
            {
                messageHandle[i] = bytes[i + index];
            }
        }
Example #10
0
 // Constructor
 public BPBase()
 {
     _iSessionTimeout = 0;  // Int16.Parse(ConfigurationManager.AppSettings["Application.SessionTimeout"].ToString());
       _sApplicationURL = ""; // ConfigurationManager.AppSettings["Application.URL"].ToString();
       _sConnectionApplication = ""; // ConfigurationManager.ConnectionStrings["Application.DBCnn"].ToString();
       _sConnectionRepositorio = ""; // ConfigurationManager.ConnectionStrings["Application.Repositorio"].ToString();
 }
Example #11
0
    void Update()
    {
        if (connected)
        {
            // When connected to Arduino
            if (_txUINT8 != (UINT8)txUINT8)
            {
                _txUINT8 = (UINT8)txUINT8;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txINT8 != (INT8)txINT8)
            {
                _txINT8 = (INT8)txINT8;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txUINT16 != (UINT16)txUINT16)
            {
                _txUINT16 = (UINT16)txUINT16;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txINT16 != (INT16)txINT16)
            {
                _txINT16 = (INT16)txINT16;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txUINT32 != (UINT32)txUINT32)
            {
                _txUINT32 = (UINT32)txUINT32;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txINT32 != (INT32)txINT32)
            {
                _txINT32 = (INT32)txINT32;
                SetDirty();                 // It must call to run OnPush
            }
            if (_txFLOAT32 != (FLOAT32)txFLOAT32)
            {
                _txFLOAT32 = (FLOAT32)txFLOAT32;
                SetDirty();                 // It must call to run OnPush
            }
            if (txSTRING.Equals(_txSTRING) == false)
            {
                _txSTRING = (STRING)txSTRING;
                SetDirty();                 // It must call to run OnPush
            }

            rxUINT8   = _rxUINT8;
            rxINT8    = _rxINT8;
            rxUINT16  = _rxUINT16;
            rxINT16   = _rxINT16;
            rxUINT32  = _rxUINT32;
            rxINT32   = _rxINT32;
            rxFLOAT32 = _rxFLOAT32;
            rxSTRING  = _rxSTRING;
        }
        else
        {
            // When disconnected to Arduino
        }
    }
Example #12
0
 public Trip(BinaryReader byteFile)
 {
     this.Time = byteFile.ReadInt64();
     this.TimeDT = new DateTime(this.Time);
     this.Comment = byteFile.ReadString();
     this.declination = byteFile.ReadInt16();
 }
Example #13
0
		public void UpdateTeaState(Int16 stateID,string stateName)
		{
			using(FlowStatesDataAccess flowStatesDA = new FlowStatesDataAccess())
			{
				flowStatesDA.UpdateTeaState(stateID,stateName);
			}
		}
 public void getMpdata(Int16 constituencyId)
 {
     try
     {
         DataTable dt = new DataTable();
         dt = mpdetailsbal.getData(constituencyId); /** empid fetch throw ***/
         imgMpProfile.ImageUrl = dt.Rows[0]["profilePic"].ToString();
         lblname.Text = dt.Rows[0]["firstName"].ToString() + "  " + dt.Rows[0]["middleName"].ToString() + " " + dt.Rows[0]["lastName"].ToString();
         lblconstituency.Text = dt.Rows[0]["constituency"].ToString();
         lblparty.Text = dt.Rows[0]["partyName"].ToString() + "(" + dt.Rows[0]["Abbreviation"].ToString() + ")";
         lblmail.Text = dt.Rows[0]["email"].ToString();
         lblcntct.Text = dt.Rows[0]["mobile"].ToString();
         lbleducational_q.Text = dt.Rows[0]["qualification"].ToString();
         lblprofession.Text = dt.Rows[0]["profession"].ToString();
         lblp_address.Text = dt.Rows[0]["permanentAddress"].ToString() + ", " + dt.Rows[0][12].ToString() + ", " + dt.Rows[0][13].ToString();
         lblpresent_address.Text = dt.Rows[0]["currentAddress"].ToString() + ", " + dt.Rows[0][15].ToString() + ", " + dt.Rows[0][16].ToString();
         mpidval = Int64.Parse(dt.Rows[0]["mpId"].ToString());
         //DataTable numDt = new DataTable();
         //numDt = issuesbal.Issues_Numbers(Convert.ToInt64(dt.Rows[0]["mpId"]));
         //lblissuesno.Text = numDt.Rows[0][0].ToString();
         //lblsolvedissuesno.Text = numDt.Rows[0][1].ToString();
     }
     catch
     {
         throw;
     }
     finally
     {
     }
 }
Example #15
0
 public Trip()
 {
     this.TimeDT = DateTime.Now;
     this.Time = this.TimeDT.Ticks;
     this.Comment = "";
     this.declination = Int16.MinValue;
 }
Example #16
0
 public CourseTime(string days, Int16 startTime, Int16 endTime)
 {
     this.days = new List<Day>();
     this.startTime = startTime;
     this.endTime = endTime;
     AddDays(days);
 }
Example #17
0
 public SetSlotPacket(sbyte windowId = 0, Int16 slot = 0, object slotData = null)
     : base(PacketType.SetSlot)
 {
     WindowID = windowId;
     Slot = slot;
     SlotData = slotData;
 }
Example #18
0
        private Socket _mSocket; //TCP connection to device

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a PLC object with all the parameters needed for connections.
        /// For S7-1200 and S7-1500, the default is rack = 0 and slot = 0.
        /// You need slot > 0 if you are connecting to external ethernet card (CP).
        /// For S7-300 and S7-400 the default is rack = 0 and slot = 2.
        /// </summary>
        /// <param name="cpu">CpuType of the plc (select from the enum)</param>
        /// <param name="ip">Ip address of the plc</param>
        /// <param name="rack">rack of the plc, usually it's 0, but check in the hardware configuration of Step7 or TIA portal</param>
        /// <param name="slot">slot of the CPU of the plc, usually it's 2 for S7300-S7400, 0 for S7-1200 and S7-1500.
        ///  If you use an external ethernet card, this must be set accordingly.</param>
        public Plc(CpuType cpu, string ip, Int16 rack, Int16 slot)
        {
            IP = ip;
            CPU = cpu;
            Rack = rack;
            Slot = slot;
        }
 public void Tick(object sender, EventArgs args)
 {
     hslcolor.Hue = hue;
     hue++;
     if (hue >= 240)
         hue = 0;
 }
Example #20
0
 public static byte[] ToByteArray(Int16[] value)
 {
     ByteArray arr = new ByteArray();
     foreach (Int16 val in value)
         arr.Add(ToByteArray(val));
     return arr.array;
 }
Example #21
0
    public static System.Int16 Int16Parse(string value)
    {
        System.Int16 number = 0;
        bool         result = System.Int16.TryParse(value, out number);

        return((true == result)?number:(System.Int16) 0);
    }
Example #22
0
 public MetaData(byte key, string fileName, Int16 fileSize,
             byte parity)
     : base(key, parity)
 {
     FileName = fileName;
       ProgramSize = fileSize;
 }
		public override void LoadDataModuloPermissoes(DataSet CurrentDataSet, Int16 IDTipoFunctionGroup, Int16 IdxTipoFunction, IDbConnection conn)
		{
            using (SqlCommand command = SqlSyntax.CreateSelectCommandWithNoDeletedRowsParam((SqlConnection)conn))
            using (SqlDataAdapter da = new SqlDataAdapter(command))
			{
                command.Parameters.AddWithValue("@IDTipoFunctionGroup", IDTipoFunctionGroup);
                command.Parameters.AddWithValue("@IdxTipoFunction", IdxTipoFunction);

				da.SelectCommand.CommandText = SqlSyntax.CreateSelectCommandText(CurrentDataSet.Tables["Trustee"]);
				da.Fill(CurrentDataSet, "Trustee");

				da.SelectCommand.CommandText = SqlSyntax.CreateSelectCommandText(CurrentDataSet.Tables["TrusteeUser"]);
				da.Fill(CurrentDataSet, "TrusteeUser");

				da.SelectCommand.CommandText = SqlSyntax.CreateSelectCommandText(CurrentDataSet.Tables["TrusteeGroup"]);
				da.Fill(CurrentDataSet, "TrusteeGroup");

                da.SelectCommand.CommandText = SqlSyntax.CreateSelectCommandText(CurrentDataSet.Tables["UserGroups"]);
                da.Fill(CurrentDataSet, "UserGroups");

                da.SelectCommand.CommandText = SqlSyntax.CreateSelectCommandText(CurrentDataSet.Tables["TrusteePrivilege"],
                    " WHERE TrusteePrivilege.IDTipoFunctionGroup=@IDTipoFunctionGroup AND TrusteePrivilege.IdxTipoFunction=@IdxTipoFunction");
				da.Fill(CurrentDataSet, "TrusteePrivilege");
			}
		}
        private double[] waveform; //Stim voltage

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Electrical stimulation event to be interpreted by NeuroRighter's all channel stimulation board.
        /// </summary>
        /// <param name="channel">Channel to stimulate</param>
        /// <param name="time"> Time sample that stimulation should be applied </param>
        /// <param name="waveform"> Stimulation waveform. </param>
        public StimulusOutEvent(int channel, ulong time, double[] waveform)
        {
            try
            {
                this.channel = (short)channel;
                this.sampleIndex = time;
                this.waveform = new double[waveform.Length];
                for (int i = 0; i < waveform.Length; i++)
                {
                    this.waveform[i] = waveform[i];
                }

                this.analogEncode = new double[2];
                this.digitalEncode = new uint[3];
                this.analogEncode[0] = Math.Ceiling((double)channel / 8.0);
                this.analogEncode[1] = (double)((channel - 1) % 8) + 1.0;

                this.digitalEncode[0] = Convert.ToUInt32(Math.Pow(2, (Properties.Settings.Default.StimPortBandwidth == 32 ? BLANKING_BIT_32bitPort : BLANKING_BIT_8bitPort)));
                this.digitalEncode[1] = channel2MUX_noEN((double)channel);
                this.digitalEncode[2] = channel2MUX((double)channel);
                this.sampleDuration = (uint)waveform.Length;
                if (DigitalEncode[1] == 0 || DigitalEncode[2] == 0)
                    throw new Exception("NR stimulation exception: you are attempting to stimulate on channel " + channel.ToString() + " which has resulted in an error. \n" +
                        "this could be caused by your Properties.Settings.Default.MUXChannels, which is set to " + Properties.Settings.Default.MUXChannels.ToString() + " and must be either 16 or 8"
                            );
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Example #25
0
    public DataTable getIssues(Int64 NUMBER,Int16 TYPE)
    {
        try
        {

            query = "ISSUES_FETCHING";
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
          dap = new SqlDataAdapter(query,con);
          dap.SelectCommand.CommandType = CommandType.StoredProcedure;
          dap.SelectCommand.Parameters.AddWithValue("@number",NUMBER) ;
          dap.SelectCommand.Parameters.AddWithValue("@type", TYPE);

          DataSet ds = new DataSet();
           dap.Fill(ds,"temp");
           dap.Dispose();
            return ds.Tables["temp"];
        }
        catch
        {
            throw;
        }
        finally
        {  if(con.State == ConnectionState.Open)
            con.Close();
        }
    }
 public Image(Int16 minute, string file_name, string date_taken, Int16 method)
 {
     this.minute = minute;
     this.file_name = file_name;
     this.date_taken = date_taken;
     this.method = method;
 }
Example #27
0
        public void TestLeader()
        {
            Int16[] leader = new Int16[36000];
              Random random = new Random();
              for (int i = 0; i < leader.Length;) {
            leader[i++] = 10000;
            leader[i++] = 9000;
            leader[i++] = (Int16) (random.Next(2) < 1 ? -8000 : 8000);
            leader[i++] = -12000;
            leader[i++] = -9000;
              }
              IEnumerator<Int16> ie = new List<Int16>(leader).GetEnumerator();
              ie.MoveNext();
              Assert.IsTrue(new DataChunker().IsLeader(ie));

              for (int i = 0; i < leader.Length;) {
            leader[i++] = 10000;
            leader[i++] = 9000;
            leader[i++] = 8000;
            leader[i++] = 12000;
            leader[i++] = 9000;
              }
              ie = new List<Int16>(leader).GetEnumerator();
              ie.MoveNext();
              Assert.IsFalse(new DataChunker().IsLeader(ie));
        }
Example #28
0
        public MainApp(bool passed_debug_mode, string passed_version, bool passed_verbose)
        {
            //This checks if there is a new version, and if so alerts user
            ThreadStart update_Checker = new ThreadStart(this.check_updates_wrapper);
            Thread new_thread = new Thread(update_Checker);
            new_thread.Name = "6 to 4 - Update Checker";
            new_thread.Start();
            //Start the actual window
            InitializeComponent();
            //Tell all threads, amin is still running, is janky but works
            running = 2;
            //Starts animating icon while devcon is running
            ThreadStart Animation = new ThreadStart(this.animation);
            Thread animation_thread = new Thread(Animation);
            animation_thread.Name = "6 to 4 - Animation Thread";
            animation_thread.Start();

            //Set internals from passed
            internal_version = passed_version;
            internal_debug = passed_debug_mode;
            internal_verbose = passed_verbose;
            //Easter egg
            if (internal_verbose == true)
            {
                FLASHY = new Visual_Form();
                verbose_wrapper();
            }
        }
Example #29
0
 public int ReadGasCard(short com, int baud, ref string kh, ref int ql, ref decimal money, ref short cs, ref Int16 bkcs, ref string yhh)
 {
     byte[] cardNO = new byte[100];
     byte[] kmm = new byte[100];
     byte[] dqdm = new byte[100];
     byte[] yhh1 = System.Text.Encoding.GetEncoding(1252).GetBytes(yhh);
     byte[] sqrq = new byte[100];
     byte[] sxrq = new byte[100];
     byte[] sxbj = new byte[100];
     byte[] tm = new byte[100];
     short klx = 0;
     short kzt = 0;
     int ljgql = 0;
     int ljyql = 0;
     int syql = 0;
     int bjql = 0;
     int czsx = 0;
     int tzed = 0;
     int oldprice = 0;
     int newprice = 0;
     short Nbkcs = bkcs;
     int ret = StaticReadGasCard(0, baud, kmm, ref klx, ref kzt, cardNO, dqdm, yhh1, tm, 
         ref ql, ref cs, ref ljgql, ref Nbkcs, ref ljyql, ref syql, ref bjql, ref czsx, 
         ref tzed, sqrq, ref oldprice, ref newprice, sxrq, sxbj);
     Log.Debug("read card ret=" + ret);
     //卡号转换成字符串
     cardNO[8] = 0;
     kh = Encoding.ASCII.GetString(cardNO, 0, 8);
     return ret;
 }
Example #30
0
 public Device(
      Boolean _dhcp_
     ,Boolean _enabled_
     ,Boolean _allowStorage_
     ,Boolean _acceptKOPR_
     ,Boolean _allowRetrieve_
     ,Boolean _allowQuery_
     ,Boolean _allowAutoRoute_
     ,Int16 _throttleMaxConnections_
     ,DateTime _lastAccessedTime_
     ,DeviceTypeEnum _deviceTypeEnum_
     ,ServerEntityKey _serverPartitionKey_
     ,String _aeTitle_
     ,Int32 _port_
     ,String _description_
     ,String _ipAddress_
     ):base("Device")
 {
     Dhcp = _dhcp_;
     Enabled = _enabled_;
     AllowStorage = _allowStorage_;
     AcceptKOPR = _acceptKOPR_;
     AllowRetrieve = _allowRetrieve_;
     AllowQuery = _allowQuery_;
     AllowAutoRoute = _allowAutoRoute_;
     ThrottleMaxConnections = _throttleMaxConnections_;
     LastAccessedTime = _lastAccessedTime_;
     DeviceTypeEnum = _deviceTypeEnum_;
     ServerPartitionKey = _serverPartitionKey_;
     AeTitle = _aeTitle_;
     Port = _port_;
     Description = _description_;
     IpAddress = _ipAddress_;
 }
Example #31
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="typeCodeValue"></param>
        /// <param name="endpointIndexValue"></param>
        /// <param name="sourceIdHash"></param>
        /// <param name="messageHandle"></param>
        /// <returns>A Base64 encoded string containing the artifact</returns>
        public static string CreateArtifact(Int16 typeCodeValue, Int16 endpointIndexValue, byte[] sourceIdHash, byte[] messageHandle)
        {
            if (sourceIdHash.Length != SourceIdLength)
                throw new ArgumentException(
                    string.Format(argumentLengthErrorFmt, sourceIdHash.Length,SourceIdLength), "sourceIdHash");

            if (messageHandle.Length != MessageHandleLength)
                throw new ArgumentException(
                    string.Format(argumentLengthErrorFmt, messageHandle.Length, MessageHandleLength), "messageHandle");

            byte[] typeCode = new byte[2];
            typeCode[0] = (byte)(typeCodeValue >> 8);
            typeCode[1] = (byte)(typeCodeValue);
            
            
            byte[] endpointIndex = new byte[2];
            endpointIndex[0] = (byte)(endpointIndexValue >> 8);
            endpointIndex[1] = (byte)(endpointIndexValue);

            byte[] result = new byte[2 + 2 + SourceIdLength + MessageHandleLength];

            typeCode.CopyTo(result, 0);
            endpointIndex.CopyTo(result, 2);
            sourceIdHash.CopyTo(result, 4);
            messageHandle.CopyTo(result, 4 + SourceIdLength);

            return Convert.ToBase64String(result);
        }
 public void Int16Tests(Int16 number, Byte[] expectedBytes)
 {
     var buffer = new byte[2];
     var encoder = new KafkaEncoder(buffer);
     encoder.Write(number);
     Assert.That(buffer, Is.EqualTo(expectedBytes));
 }
Example #33
0
        public DbfHeader(int numberOfRecords, int numberOfFields, short recordLength, Encoding encoding)
        {
            this.versionNumber = 3;

            DateTime now = DateTime.Now;

            this.yearOfLastUpdate = (byte)(now.Year - 1900);

            this.monthOfLastUpdate = (byte)now.Month;

            this.dayOfLastUpdate = (byte)now.Day;

            this.numberOfRecords = numberOfRecords;

            this.lengthOfHeader = (short)(numberOfFields * 32 + 33); ;

            this.lengthOfEachRecord = recordLength;

            this.reserved1 = 0;

            this.incompleteTransaction = 0;

            this.encryptionFlag = 0;

            this.freeRecordThread = 0;

            this.reserved2 = 0;

            this.mdxFlag = 0;

            this.languageDriver = byte.Parse((EsriCodePages.EncodingToLanguageIdentifier(encoding)),
                                    System.Globalization.NumberStyles.HexNumber);

            this.reserved3 = 0;
        }
 internal CreateSolutionResultProtocol(FChoice.Toolkits.Clarify.Interfaces.CreateSolutionResult result)
 {
     this.WorkaroundObjid = result.WorkaroundObjid;
     this.ReturnCode = result.ReturnCode;
     this.IDNum = result.IDNum;
     this.Objid = result.Objid;
 }
    void OnGUI()
    {
        GUI.enabled = true;

        GUILayout.Label("Input Texture", EditorStyles.boldLabel);
        texture = EditorGUILayout.ObjectField("Input Texture", texture, typeof(Texture2D), false) as Texture2D;

        GUI.enabled = texture == null ? false : true;

        if (GUILayout.Button("Convert to Raw and Save"))
        {
            var path = EditorUtility.SaveFilePanel(
                "Save texture as RAW",
                "",
                texture.name + ".raw",
                "raw");

            if (path.Length != 0)
            {
                Color[] pixels = texture.GetPixels();
                byte[]  bytes  = new byte[pixels.Length * 2];
                int     index  = 0;
                for (int u = texture.width - 1; u >= 0; --u)
                {
                    for (int v = 0; v < texture.height; ++v)
                    {
                        int i = u * texture.height + v;

                        float        buffer     = (pixels[i].r * 65535);
                        System.Int16 i16Buffer  = (System.Int16)buffer;
                        byte[]       byteBuffer = shortToByte(i16Buffer);
                        bytes[index++] = byteBuffer[0];
                        bytes[index++] = byteBuffer[1];
                    }
                }

                File.WriteAllBytes(path, bytes);
            }
        }

        GUI.enabled = true;
    }
Example #36
0
 public static extern Int16 _8164_suppress_vibration(System.Int16 AxisNo, System.UInt16 ReverseTime, System.UInt16 ForwardTime);
Example #37
0
 public static extern Int16 _8164_backlash_comp(System.Int16 AxisNo, System.Int16 BCompPulse, System.Int16 Mode);
Example #38
0
 public override void OnCreateRoomFailed(System.Int16 returnCode, System.String message)
 {
     base.OnCreateRoomFailed(returnCode, message);
     Debug.Log("Tu puta madre");
     triesToConnectToRoom = false;
 }
Example #39
0
 public static extern Int16 _8164_set_pitch_compensate(System.Int16 AxisNo, System.Int16 TableSize, ref System.Int32 PTableArray, ref System.Int32 NTableArray, System.Int32 TableInterval);
Example #40
0
 public static extern Int16 _8164_set_home_config(System.Int16 AxisNo, System.Int16 home_mode, System.Int16 org_logic, System.Int16 ez_logic, System.Int16 ez_count, System.Int16 erc_out);
Example #41
0
 public static extern Int16 _8164_set_move_ratio(System.Int16 AxisNo, System.Double move_ratio);
 public static Int16 ToInt16(this String Expr, Int16 DefaultValue = 0)
 {
     return(ToInt16Nullable(Expr) ?? DefaultValue);
 }
Example #43
0
 public static extern Int16 _8164_pulser_home_move(System.Int16 AxisNo, System.Int16 HomeType, System.Double SpeedLimit);
Example #44
0
 public JSONObject AddField(string name, System.Int16 val)
 {
     return(AddField(name, Create(val)));
 }
Example #45
0
 public void Add(System.Int16 val)
 {
     Add(Create(val));
 }
Example #46
0
 public Int16Pair(System.Int16 A, System.Int16 B)
 {
     a = A; b = B;
 }
Example #47
0
 public static extern Int16 _8164_set_inp(System.Int16 AxisNo, System.Int16 inp_enable, System.Int16 inp_logic);
Example #48
0
 public static extern Int16 _8164_set_alm(System.Int16 AxisNo, System.Int16 alm_logic, System.Int16 alm_mode);
Example #49
0
 public static extern Int16 _8164_set_pulser_iptmode(System.Int16 AxisNo, System.Int16 InputMode, System.Int16 Inverse);
Example #50
0
 public static extern Int16 _8164_sv_move(System.Int16 AxisNo, System.Double StrVel, System.Double MaxVel, System.Double Tacc, System.Double SVacc);
Example #51
0
 public static extern Int16 _8164_initial(ref System.Int16 existCards);
Example #52
0
 public static extern Int16 _8164_get_pitch_table_target_pos(System.Int16 AxisNo, ref System.Double TargetPos);
Example #53
0
 public static extern Int16 _8164_pulser_pmove(System.Int16 AxisNo, System.Double Dist, System.Double SpeedLimit);
Example #54
0
 public static extern Int16 _8164_calculate_rmove_pitch_compensate(System.Int16 AxisNo, System.Double Dist, ref System.Double Result);
Example #55
0
 public static extern Int16 _8164_set_sd_pin(System.Int16 AxisNo, System.Int16 Type);
Example #56
0
 public static extern Int16 _8164_enable_pitch_compensate(System.Int16 AxisNo, System.Int16 Enable);
Example #57
0
 public static extern Int16 _8164_set_erc(System.Int16 AxisNo, System.Int16 erc_logic, System.Int16 erc_on_time);
Example #58
0
 public static extern Int16 _8164_set_el(System.Int16 AxisNo, System.Int16 el_mode);
Example #59
0
 public static extern Int16 _8164_set_pcs_logic(System.Int16 AxisNo, System.Int16 pcs_logic);
Example #60
0
 public static extern Int16 _8164_set_sd(System.Int16 AxisNo, System.Int16 enable, System.Int16 sd_logic, System.Int16 sd_latch, System.Int16 sd_mode);