aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Stubs Collection')
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs36
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET_GUI.cs307
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs26
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs14
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs13
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs12
7 files changed, 449 insertions, 30 deletions
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs
index c812afce6..32c2e05c3 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs
@@ -12,7 +12,22 @@ using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
-//--------------------------------------------------------------------------------------------------------------
+//----------------------------- PARAMETERS TO EDIT -------------
+UInt32 OUTPUT_TENSION = 0;
+UInt32 WORK_TENSION = 0;
+UInt32 RELAX_YARN = 0;
+byte INC_DEC_TENSION = 0;
+byte INC_DEC_STRETCH = 0;
+UInt32 METER_START = 0;
+UInt32 INC_DEC_METER = 0;
+UInt32 TARGET = 0;
+UInt32 TENSION_ERROR = 0;
+UInt32 ALARM_TIME = 0;
+byte ALARM_ENABLING = 0;
+byte TARGET_ENABLING = 0;
+byte RELAX_YARN_SPEED = 0;
+//---------------------------------------------------------------
+
// ------ Request Parameters ------
const byte CODE_STRING = 0x01;//BTSR ID
@@ -37,37 +52,37 @@ int BTSR_Write_and_Read()
stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
//DATA_STRING
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//1° BYTE OUTPUT TENSION (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//2° BYTE OUTPUT TENSION (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//3° BYTE WORK TENSION (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//4° BYTE WORK TENSION (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//5° BYTE RELAX YARN (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//6° BYTE RELAX YARN (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//7° BYTE INC DEC TENSION
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//8° BYTE INC DEC STRETCH
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//9° BYTE METER START (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//10° BYTE METER START
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//11° BYTE METER START
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//12° BYTE METER START (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//13° BYTE INC-DEC METER (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//14° BYTE INC-DEC METER
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//15° BYTE INC-DEC METER
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//16° BYTE INC-DEC METER (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//17° BYTE TARGET (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//18° BYTE TARGET
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//19° BYTE TARGET
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//20° BYTE TARGET (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//21° BYTE TENSION ERROR (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//22° BYTE TENSION ERROR (MSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//23° BYTE ALARM TIME (LSB)
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//24° BYTE ALARM TIME (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(OUTPUT_TENSION & 0XFF);//1° BYTE OUTPUT TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((OUTPUT_TENSION >> 8) & 0XFF);//2° BYTE OUTPUT TENSION (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(WORK_TENSION & 0XFF);//3° BYTE WORK TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((WORK_TENSION >> 8) & 0XFF);//4° BYTE WORK TENSION (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(RELAX_YARN & 0XFF);//5° BYTE RELAX YARN (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((RELAX_YARN >> 8) & 0XFF);//6° BYTE RELAX YARN (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(INC_DEC_TENSION);//7° BYTE INC DEC TENSION
+ stubI2CWriteBytesRequest.BytesTWrite.Add(INC_DEC_STRETCH);//8° BYTE INC DEC STRETCH
+ stubI2CWriteBytesRequest.BytesTWrite.Add(METER_START & 0XFF);//9° BYTE METER START (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((METER_START >> 8) & 0XFF);//10° BYTE METER START
+ stubI2CWriteBytesRequest.BytesTWrite.Add((METER_START >> 16) & 0XFF);//11° BYTE METER START
+ stubI2CWriteBytesRequest.BytesTWrite.Add((METER_START >> 24) & 0XFF);//12° BYTE METER START (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(INC_DEC_METER & 0XFF);//13° BYTE INC-DEC METER (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((INC_DEC_METER >> 8) & 0XFF);//14° BYTE INC-DEC METER
+ stubI2CWriteBytesRequest.BytesTWrite.Add((INC_DEC_METER >> 16) & 0XFF);//15° BYTE INC-DEC METER
+ stubI2CWriteBytesRequest.BytesTWrite.Add((INC_DEC_METER >> 24) & 0XFF);//16° BYTE INC-DEC METER (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(TARGET & 0XFF);//17° BYTE TARGET (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((TARGET >> 8) & 0XFF);//18° BYTE TARGET
+ stubI2CWriteBytesRequest.BytesTWrite.Add((TARGET >> 16) & 0XFF);//19° BYTE TARGET
+ stubI2CWriteBytesRequest.BytesTWrite.Add((TARGET >> 24) & 0XFF);//20° BYTE TARGET (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(TENSION_ERROR & 0XFF);//21° BYTE TENSION ERROR (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((TENSION_ERROR >> 8) & 0XFF);//22° BYTE TENSION ERROR (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(ALARM_TIME & 0XFF);//23° BYTE ALARM TIME (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add((ALARM_TIME >> 8) & 0XFF);//24° BYTE ALARM TIME (MSB)
stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//25° BYTE SPARE
stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//26° BYTE SPARE
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//27° BYTE ALARM ENABLING
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//28° BYTE TARGET ENABLING
- stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//29° BYTE RELAX YARN SPEED
+ stubI2CWriteBytesRequest.BytesTWrite.Add(ALARM_ENABLING);//27° BYTE ALARM ENABLING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(TARGET_ENABLING);//28° BYTE TARGET ENABLING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(RELAX_YARN_SPEED);//29° BYTE RELAX YARN SPEED
stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//30° BYTE SPARE
stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//31° BYTE SPARE
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
index b93e006ff..0de86dc14 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
@@ -12,13 +12,45 @@ using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
+//APPLICATION
+const byte SOCKS = 1 ;
+const byte REVERSE_SOCKS = 2 ;
+const byte MEDICAL_SOCKS = 3 ;
+const byte PANTYHOSE = 4 ;
+const byte SEAMLESS = 5 ;
+const byte KNIT = 6 ;
+const byte REVERSE_KNIT = 7 ;
+const byte RASCHEL = 8 ;
+const byte SEWING = 9 ;
+const byte FLAT_KNIT = 10;
+const byte SMALL_LOOM = 11;
+const byte SHOES = 12;
+const byte FLAT_SHOES = 21;
+const byte INLAY = 22;
+const byte WARP = 34;
+const byte REWIND = 35;
+
+//YARN_TYPE
+const byte ELASTOMERIC_YARN = 1;
+const byte ALL_YARNS = 2;
+const byte ALL_YARNS2 = 3;
+const byte ALL_YARNS3 = 4;
+const byte ELASTIC2 = 5;
+const byte ELASTIC3 = 6;
+
+//----------------------------- PARAMETERS TO EDIT -------------
+
+const byte Application = KNIT;
+const byte Yarn_Type = ALL_YARNS3;
+
//--------------------------------------------------------------------------------------------------------------
// ------ Request Parameters ------
const byte CODE_STRING = 0x01;//BTSR ID
const byte FUNCTION_STRING = 0x3F;
-const byte Application = 0x06;
-const byte Yarn_Type = 0x04;
+
+
+
const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
// ------ Response Parameters ------
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET_GUI.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET_GUI.cs
new file mode 100644
index 000000000..5a6b2e419
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET_GUI.cs
@@ -0,0 +1,307 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+byte Application = 0;
+byte Yarn_Type = 0;
+
+//APPLICATION
+const byte SOCKS = 1 ;
+const byte REVERSE_SOCKS = 2 ;
+const byte MEDICAL_SOCKS = 3 ;
+const byte PANTYHOSE = 4 ;
+const byte SEAMLESS = 5 ;
+const byte KNIT = 6 ;
+const byte REVERSE_KNIT = 7 ;
+const byte RASCHEL = 8 ;
+const byte SEWING = 9 ;
+const byte FLAT_KNIT = 10;
+const byte SMALL_LOOM = 11;
+const byte SHOES = 12;
+const byte FLAT_SHOES = 21;
+const byte INLAY = 22;
+const byte WARP = 34;
+const byte REWIND = 35;
+
+//YARN_TYPE
+const byte ELASTOMERIC_YARN = 1;
+const byte ALL_YARNS = 2;
+const byte ALL_YARNS2 = 3;
+const byte ALL_YARNS3 = 4;
+const byte ELASTIC2 = 5;
+const byte ELASTIC3 = 6;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x3F;
+
+
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(Application);//Byte 2 to write
+ stubI2CWriteBytesRequest.BytesTWrite.Add(Yarn_Type);//Byte 3 to write
+
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING LSB);//Byte 4 to write
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING MSB);//Byte 5 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+public void OnExecute(StubManager stubManager)
+{
+
+ Form form1 = new Form();
+ //--------------------Set the caption bar text of the form------------------------
+ form1.Text = " APPLICATION YARN TYPE";
+ form1.TopMost = true;
+ //------- Define the border style of the form to a dialog box---------------------
+ form1.FormBorderStyle = FormBorderStyle.FixedDialog;
+ //------Set the MaximizeBox to false to remove the maximize box-------------------
+ form1.MaximizeBox = false;
+ //------Set the MinimizeBox to false to remove the minimize box-------------------
+ form1.MinimizeBox = false;
+ //----Set the start position of the form to the center of the screen--------------
+ form1.StartPosition = FormStartPosition.CenterScreen;
+ form1.AutoSize = true;
+ form1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ //--------------create ListBox --------------------------------------
+ // Create an instance of the ListBox.
+ ListBox listBox1 = new ListBox();
+ // Set the size and location of the ListBox.
+ listBox1.Size = new System.Drawing.Size(170, 270);
+ listBox1.Location = new System.Drawing.Point(5,5);
+ // Add the ListBox to the form.
+ form1.Controls.Add(listBox1);
+ // Set the ListBox to display items in multiple columns.
+ listBox1.MultiColumn = false;
+ // Set the selection mode to multiple and extended.
+ listBox1.SelectionMode = SelectionMode.MultiExtended;
+
+ // Shutdown the painting of the ListBox as items are added.
+ listBox1.BeginUpdate();
+
+ listBox1.Items.Add("SOCKS");
+ listBox1.Items.Add("REVERSE_SOCKS");
+ listBox1.Items.Add("MEDICAL_SOCKS");
+ listBox1.Items.Add("PANTYHOSE");
+ listBox1.Items.Add("SEAMLESS");
+ listBox1.Items.Add("KNIT");
+ listBox1.Items.Add("REVERSE_KNIT");
+ listBox1.Items.Add("RASCHEL");
+ listBox1.Items.Add("SEWING");
+ listBox1.Items.Add("FLAT_KNIT");
+ listBox1.Items.Add("SMALL_LOOM");
+ listBox1.Items.Add("SHOES");
+ listBox1.Items.Add("FLAT_SHOES");
+ listBox1.Items.Add("INLAY");
+ listBox1.Items.Add("WARP");
+ listBox1.Items.Add("REWIND");
+
+ listBox1.EndUpdate();
+
+ //--------------create ListBox --------------------------------------
+ // Create an instance of the ListBox.
+ ListBox listBox2 = new ListBox();
+ // Set the size and location of the ListBox.
+ listBox2.Size = new System.Drawing.Size(170, 270);
+ listBox2.Location = new System.Drawing.Point(185,5);
+ // Add the ListBox to the form.
+ form1.Controls.Add(listBox2);
+ // Set the ListBox to display items in multiple columns.
+ listBox2.MultiColumn = false;
+ // Set the selection mode to multiple and extended.
+ listBox2.SelectionMode = SelectionMode.MultiExtended;
+
+ // Shutdown the painting of the ListBox as items are added.
+ listBox2.BeginUpdate();
+
+ listBox2.Items.Add("ELASTOMERIC_YARN");
+ listBox2.Items.Add("ALL_YARNS");
+ listBox2.Items.Add("ALL_YARNS2");
+ listBox2.Items.Add("ALL_YARNS3");
+ listBox2.Items.Add("ELASTIC2");
+ listBox2.Items.Add("ELASTIC3");
+
+ listBox2.EndUpdate();
+
+ // Select one items from the ListBox.
+ string text="0";
+
+ listBox1.SetSelected( Convert.ToInt32(text), true);
+ listBox2.SetSelected( Convert.ToInt32(text), true);
+
+ Button button2 = new Button ()
+ {
+ Width = 100,
+ Height = 100,
+ };
+ button2.Location = new Point (370, 40);
+ button2.Text = "Set";
+ form1.Controls.Add(button2);
+
+ button2.Click += async(_,__) =>
+ {
+
+
+ if ( (listBox1.SelectedItem)=="SOCKS")
+ {
+ Application = SOCKS;
+ }
+ else if ( (listBox1.SelectedItem)=="REVERSE_SOCKS")
+ {
+ Application = REVERSE_SOCKS;
+ }
+ else if ( (listBox1.SelectedItem)=="MEDICAL_SOCKS")
+ {
+ Application = MEDICAL_SOCKS;
+ }
+ else if ( (listBox1.SelectedItem)=="PANTYHOSE")
+ {
+ Application = PANTYHOSE;
+ }
+ else if ( (listBox1.SelectedItem)=="SEAMLESS")
+ {
+ Application = SEAMLESS;
+ }
+ else if ( (listBox1.SelectedItem)=="KNIT")
+ {
+ Application = KNIT;
+ }
+ else if ( (listBox1.SelectedItem)=="REVERSE_KNIT")
+ {
+ Application = REVERSE_KNIT;
+ }
+ else if ( (listBox1.SelectedItem)=="RASCHEL")
+ {
+ Application = RASCHEL;
+ }
+ else if ( (listBox1.SelectedItem)=="SEWING")
+ {
+ Application = SEWING;
+ }
+ else if ( (listBox1.SelectedItem)=="FLAT_KNIT")
+ {
+ Application = FLAT_KNIT;
+ }
+ else if ( (listBox1.SelectedItem)=="SMALL_LOOM")
+ {
+ Application = SMALL_LOOM;
+ }
+ else if ( (listBox1.SelectedItem)=="SHOES")
+ {
+ Application = SHOES;
+ }
+ else if ( (listBox1.SelectedItem)=="FLAT_SHOES")
+ {
+ Application = FLAT_SHOES;
+ }
+ else if ( (listBox1.SelectedItem)=="INLAY")
+ {
+ Application = INLAY;
+ }
+ else if ( (listBox1.SelectedItem)=="WARP")
+ {
+ Application = WARP;
+ }
+ else if ( (listBox1.SelectedItem)=="REWIND")
+ {
+ Application = REWIND;
+ }
+
+ if ( (listBox2.SelectedItem)=="ELASTOMERIC_YARN")
+ {
+ Yarn_Type = ELASTOMERIC_YARN;
+ }
+ else if ( (listBox2.SelectedItem)=="ALL_YARNS")
+ {
+ Yarn_Type = ALL_YARNS;
+ }
+ else if ( (listBox2.SelectedItem)=="ALL_YARNS2")
+ {
+ Yarn_Type = ALL_YARNS2;
+ }
+ else if ( (listBox2.SelectedItem)=="ALL_YARNS3")
+ {
+ Yarn_Type = ALL_YARNS3;
+ }
+ else if ( (listBox2.SelectedItem)=="ELASTIC2")
+ {
+ Yarn_Type = ELASTIC2;
+ }
+ else if ( (listBox2.SelectedItem)=="ELASTIC3")
+ {
+ Yarn_Type = ELASTIC3;
+ }
+
+ if((Yarn_Type >= ELASTOMERIC_YARN) && (Yarn_Type <= ELASTIC3))
+ {
+ form1.Close();
+
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- APPLICATION AND YARN TYPOLOGY SET --- \n");
+ stubManager.WriteLine("Set: \n");
+ stubManager.WriteLine( listBox1.SelectedItem);
+ stubManager.WriteLine( listBox2.SelectedItem);
+ stubManager.WriteLine("\nBTSR Response: (#FB - OK, #FA - FAILED) ");
+ BTSR_Get();
+
+ }
+
+
+ };
+
+ form1.ShowDialog();
+
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
index 75549190b..f52b40fef 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
@@ -12,6 +12,32 @@ using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
+//APPLICATION
+const byte SOCKS = 1 ;
+const byte REVERSE_SOCKS = 2 ;
+const byte MEDICAL_SOCKS = 3 ;
+const byte PANTYHOSE = 4 ;
+const byte SEAMLESS = 5 ;
+const byte KNIT = 6 ;
+const byte REVERSE_KNIT = 7 ;
+const byte RASCHEL = 8 ;
+const byte SEWING = 9 ;
+const byte FLAT_KNIT = 10;
+const byte SMALL_LOOM = 11;
+const byte SHOES = 12;
+const byte FLAT_SHOES = 21;
+const byte INLAY = 22;
+const byte WARP = 34;
+const byte REWIND = 35;
+
+//YARN_TYPE
+const byte ELASTOMERIC_YARN = 1;
+const byte ALL_YARNS = 2;
+const byte ALL_YARNS2 = 3;
+const byte ALL_YARNS3 = 4;
+const byte ELASTIC2 = 5;
+const byte ELASTIC3 = 6;
+
//--------------------------------------------------------------------------------------------------------------
// ------ Request Parameters ------
const byte CODE_STRING = 0x01;//BTSR ID
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs
index f722e0dab..82b126fb3 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs
@@ -11,6 +11,8 @@ using Tango.PMR.Stubs;
using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
+double Length = 0.0;
+UInt32 temp = 0;
//--------------------------------------------------------------------------------------------------------------
// ------ Request Parameters ------
@@ -58,6 +60,15 @@ int BTSR_Get()
stubManager.WriteLineHex(temph,2);
}
+ temp = response1.ReadBytes[0] ;
+ temp = temp | (response1.ReadBytes[1] << 8) ;
+ temp = temp | (response1.ReadBytes[2] << 16) ;
+ temp = temp | (response1.ReadBytes[3] << 24) ;
+ Length = (double)(temp) * 3.14159;
+ Length = Length * 0.021;
+ stubManager.WriteLine("\n Length in Meters: ");
+ stubManager.Write(Length);
+
return 1;
}
@@ -68,4 +79,7 @@ public void OnExecute(StubManager stubManager)
Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
stubManager.WriteLine("\n --- METERS TOTAL COUNTER READ (LOW RESOLUTION) --- \n");
BTSR_Get();
+
+
+
} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs
index bcc77ba7c..b4f694786 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs
@@ -12,6 +12,8 @@ using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
+double Length = 0.0;
+UInt32 temp = 0;
//--------------------------------------------------------------------------------------------------------------
// ------ Request Parameters ------
const byte CODE_STRING = 0x01;//BTSR ID
@@ -58,6 +60,17 @@ int BTSR_Get()
stubManager.WriteLineHex(temph,2);
}
+
+ temp = response1.ReadBytes[0] ;
+ temp = temp | (response1.ReadBytes[1] << 8) ;
+ temp = temp | (response1.ReadBytes[2] << 16) ;
+ temp = temp | (response1.ReadBytes[3] << 24) ;
+ Length = (double)(temp) * 3.14159;
+ Length = Length * 0.021;
+ Length = Length / 12.0;
+ stubManager.WriteLine("\n Length in Meters: ");
+ stubManager.Write(Length);
+
return 1;
}
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
index 44f025f09..856ff4804 100644
--- a/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
@@ -12,6 +12,8 @@ using Tango.Stubs;
const byte YES = 0x01;
const byte NO = 0x00;
+double Length = 0.0;
+UInt32 temp = 0;
//--------------------------------------------------------------------------------------------------------------
// ------ Request Parameters ------
const byte CODE_STRING = 0x01;//BTSR ID
@@ -58,6 +60,16 @@ int BTSR_Get()
stubManager.WriteLineHex(temph,2);
}
+ temp = response1.ReadBytes[0] ;
+ temp = temp | (response1.ReadBytes[1] << 8) ;
+ temp = temp | (response1.ReadBytes[2] << 16) ;
+ temp = temp | (response1.ReadBytes[3] << 24) ;
+ Length = (double)(temp) * 3.14159;
+ Length = Length * 0.021;
+ Length = Length / 750.0;
+ stubManager.WriteLine("\n Length in Meters: ");
+ stubManager.Write(Length);
+
return 1;
}