aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Folding/AbstractFoldingStrategy.cs
blob: 42eddba4799d4ab2d538eef4636afbe90f628fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)

using System;
using Tango.Scripting.Editors.Document;
using System.Collections.Generic;

namespace Tango.Scripting.Editors.Folding
{
	/// <summary>
	/// Base class for folding strategies.
	/// </summary>
	public abstract class AbstractFoldingStrategy
	{
		/// <summary>
		/// Create <see cref="NewFolding"/>s for the specified document and updates the folding manager with them.
		/// </summary>
		public void UpdateFoldings(FoldingManager manager, TextDocument document)
		{
			int firstErrorOffset;
			IEnumerable<NewFolding> foldings = CreateNewFoldings(document, out firstErrorOffset);
			manager.UpdateFoldings(foldings, firstErrorOffset);
		}
		
		/// <summary>
		/// Create <see cref="NewFolding"/>s for the specified document.
		/// </summary>
		public abstract IEnumerable<NewFolding> CreateNewFoldings(TextDocument document, out int firstErrorOffset);
	}
}
span class="p">, "MIDTANK_7_A", "MIDTANK_7_B", "MIDTANK_8_A", "MIDTANK_8_B", "WINDER_CALIBRATION", "EMBEDDED_VERSION", "EEPROM_ALARM_SUPPORT", "EEPROM_ORIFICE1_ZERO_VALUE", "EEPROM_ORIFICE3_ZERO_VALUE", "EEPROM_WASTE_TANK_ZERO_VALUE", "EEPROM_PULLER_TENSION_POSITION", "EEPROM_WINDER_TENSION_POSITION", "EEPROM_INIT_FAILURE_COUNTER", "DANCER_3", "DANCER_4", "EEPROM_PRESSURE_SENSOR_V0_0", "EEPROM_PRESSURE_SENSOR_V0_1", "EEPROM_DRIER_LOADING_ARM_ANGLE"}; public void OnExecute(StubManager stubManager) { string FileName; StubReadEmbeddedVersionRequest stubReadEmbeddedVersionRequest = new StubReadEmbeddedVersionRequest(); var response2 = stubManager.Run<StubReadEmbeddedVersionResponse>(stubReadEmbeddedVersionRequest); if ((response2.VerMajor>=1)&&(response2.VerMinor>=5)&&(response2.VerPatch>=2)&&(response2.VerBuild>=2)) { MainCardStoredDataRequest mainCardStoredDataRequest = new MainCardStoredDataRequest(); var response3 = stubManager.Run<MainCardStoredDataResponse>(mainCardStoredDataRequest); FileName = "C:/temp/mainEEProm"/*+stubManager.ConnectedMachine.SerialNumber*/+".json"; stubManager.AppendToFile(FileName, "MainCardStoredData: "+ response3); } else { FileName = "C:/temp/mainEEProm"/*+stubManager.ConnectedMachine.SerialNumber*/+".csv"; stubManager.AppendToFile(FileName, "Address,Name,Data"); for (int i = 1; i < 36; i++) { StubMainCardEEpromReadRequest stubMainCardEEpromReadRequest = new StubMainCardEEpromReadRequest(); stubMainCardEEpromReadRequest.Address = i; stubMainCardEEpromReadRequest.Data = 0; var response = stubManager.Run<StubMainCardEEpromReadResponse>(stubMainCardEEpromReadRequest); stubManager.AppendToFile(FileName, "\r\n"+response.Address + "," + Main_Card_EEpromAddress[i] +"," + response.Data); } } }